From patchwork Thu Apr 18 11:31:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 10907095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A66151390 for ; Thu, 18 Apr 2019 11:35:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8727228C22 for ; Thu, 18 Apr 2019 11:35:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76B9228C38; Thu, 18 Apr 2019 11:35:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CFD1D28C22 for ; Thu, 18 Apr 2019 11:35:12 +0000 (UTC) Received: from localhost ([127.0.0.1]:39858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH5Jv-0005dK-La for patchwork-qemu-devel@patchwork.kernel.org; Thu, 18 Apr 2019 07:35:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH5GE-0002g5-VO for qemu-devel@nongnu.org; Thu, 18 Apr 2019 07:31:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hH5GD-0004Sh-HI for qemu-devel@nongnu.org; Thu, 18 Apr 2019 07:31:22 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45406 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hH5GD-0004Rn-BT for qemu-devel@nongnu.org; Thu, 18 Apr 2019 07:31:21 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3IBTSJn033218 for ; Thu, 18 Apr 2019 07:31:20 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rxq8636bb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 18 Apr 2019 07:31:20 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 18 Apr 2019 12:31:18 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 18 Apr 2019 12:31:15 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3IBVDim34734116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Apr 2019 11:31:13 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E02CA405B; Thu, 18 Apr 2019 11:31:13 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5EFA7A4059; Thu, 18 Apr 2019 11:31:13 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 18 Apr 2019 11:31:13 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 16AD520F63B; Thu, 18 Apr 2019 13:31:13 +0200 (CEST) From: Christian Borntraeger To: Cornelia Huck Date: Thu, 18 Apr 2019 13:31:07 +0200 X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190418113110.160664-1-borntraeger@de.ibm.com> References: <20190418113110.160664-1-borntraeger@de.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19041811-0028-0000-0000-0000036231C8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041811-0029-0000-0000-00002421720F Message-Id: <20190418113110.160664-8-borntraeger@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-18_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904180082 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 07/10] s390x/cpumodel: deflate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Jason J . Herne" , Collin Walling , David Hildenbrand , qemu-devel , Halil Pasic , Christian Borntraeger , qemu-s390x , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP add the deflate conversion facility. Signed-off-by: Christian Borntraeger --- target/s390x/cpu_features.c | 9 +++++++++ target/s390x/cpu_features.h | 1 + target/s390x/cpu_features_def.h | 7 +++++++ target/s390x/gen-features.c | 12 ++++++++++++ target/s390x/kvm.c | 6 ++++++ 5 files changed, 35 insertions(+) diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index e0a4769c19..5f37e655fe 100644 --- a/target/s390x/cpu_features.c +++ b/target/s390x/cpu_features.c @@ -110,6 +110,7 @@ static const S390FeatDef s390_features[] = { FEAT_INIT("cmmnt", S390_FEAT_TYPE_STFL, 147, "CMM: ESSA-enhancement (no translate) facility"), FEAT_INIT("vxeh2", S390_FEAT_TYPE_STFL, 148, "Vector Enhancements facility 2"), FEAT_INIT("esort-base", S390_FEAT_TYPE_STFL, 150, "Enhanced-sort facility (excluding subfunctions)"), + FEAT_INIT("deflate-base", S390_FEAT_TYPE_STFL, 151, "Deflate-conversion facility (excluding subfunctions)"), FEAT_INIT("vxbeh", S390_FEAT_TYPE_STFL, 152, "Vector BCD enhancements facility 1"), FEAT_INIT("msa9-base", S390_FEAT_TYPE_STFL, 155, "Message-security-assist-extension-9 facility (excluding subfunctions)"), FEAT_INIT("etoken", S390_FEAT_TYPE_STFL, 156, "Etoken facility"), @@ -347,6 +348,11 @@ static const S390FeatDef s390_features[] = { FEAT_INIT("sortl-32", S390_FEAT_TYPE_SORTL, 130, "SORTL 32 input lists"), FEAT_INIT("sortl-128", S390_FEAT_TYPE_SORTL, 132, "SORTL 128 input lists"), FEAT_INIT("sortl-f0", S390_FEAT_TYPE_SORTL, 192, "SORTL format 0 parameter-block"), + + FEAT_INIT("dfltcc-gdht", S390_FEAT_TYPE_DFLTCC, 1, "DFLTCC GDHT"), + FEAT_INIT("dfltcc-cmpr", S390_FEAT_TYPE_DFLTCC, 2, "DFLTCC CMPR"), + FEAT_INIT("dfltcc-xpnd", S390_FEAT_TYPE_DFLTCC, 4, "DFLTCC XPND"), + FEAT_INIT("dfltcc-f0", S390_FEAT_TYPE_DFLTCC, 192, "DFLTCC format 0 parameter-block"), }; const S390FeatDef *s390_feat_def(S390Feat feat) @@ -411,6 +417,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type, case S390_FEAT_TYPE_KMA: case S390_FEAT_TYPE_KDSA: case S390_FEAT_TYPE_SORTL: + case S390_FEAT_TYPE_DFLTCC: set_be_bit(0, data); /* query is always available */ break; default: @@ -439,6 +446,7 @@ void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type, break; case S390_FEAT_TYPE_PLO: case S390_FEAT_TYPE_SORTL: + case S390_FEAT_TYPE_DFLTCC: nr_bits = 256; break; default: @@ -511,6 +519,7 @@ static S390FeatGroupDef s390_feature_groups[] = { FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO, "Message-security-assist-extension 9 PCKMO subfunctions"), FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), + FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), }; const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group) diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h index 3b8c5b25dd..da695a8346 100644 --- a/target/s390x/cpu_features.h +++ b/target/s390x/cpu_features.h @@ -41,6 +41,7 @@ typedef enum { S390_FEAT_TYPE_KMA, S390_FEAT_TYPE_KDSA, S390_FEAT_TYPE_SORTL, + S390_FEAT_TYPE_DFLTCC, } S390FeatType; /* Definition of a CPU feature */ diff --git a/target/s390x/cpu_features_def.h b/target/s390x/cpu_features_def.h index bb8585847f..292b17b35d 100644 --- a/target/s390x/cpu_features_def.h +++ b/target/s390x/cpu_features_def.h @@ -98,6 +98,7 @@ typedef enum { S390_FEAT_CMM_NT, S390_FEAT_VECTOR_ENH2, S390_FEAT_ESORT_BASE, + S390_FEAT_DEFLATE_BASE, S390_FEAT_VECTOR_BCD_ENH, S390_FEAT_MSA_EXT_9, S390_FEAT_ETOKEN, @@ -354,6 +355,12 @@ typedef enum { S390_FEAT_SORTL_128, S390_FEAT_SORTL_F0, + /* DEFLATE */ + S390_FEAT_DEFLATE_GHDT, + S390_FEAT_DEFLATE_CMPR, + S390_FEAT_DEFLATE_XPND, + S390_FEAT_DEFLATE_F0, + S390_FEAT_MAX, } S390Feat; diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 3db323fc0c..170226d3dd 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -254,6 +254,13 @@ S390_FEAT_SORTL_F0 +#define S390_FEAT_GROUP_DEFLATE_CONVERSION \ + S390_FEAT_DEFLATE_BASE, \ + S390_FEAT_DEFLATE_GHDT, \ + S390_FEAT_DEFLATE_CMPR, \ + S390_FEAT_DEFLATE_XPND, \ + S390_FEAT_DEFLATE_F0 + /* cpu feature groups */ static uint16_t group_PLO[] = { S390_FEAT_GROUP_PLO, @@ -307,6 +314,10 @@ static uint16_t group_ENH_SORT[] = { S390_FEAT_GROUP_ENH_SORT, }; +static uint16_t group_DEFLATE_CONVERSION[] = { + S390_FEAT_GROUP_DEFLATE_CONVERSION, +}; + /* Base features (in order of release) * Only non-hypervisor managed features belong here. * Base feature sets are static meaning they do not change in future QEMU @@ -765,6 +776,7 @@ static FeatGroupDefSpec FeatGroupDef[] = { FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO), FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), FEAT_GROUP_INITIALIZER(ENH_SORT), + FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), }; #define QEMU_FEAT_INITIALIZER(_name) \ diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 7681492c41..db9108b63c 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2086,6 +2086,9 @@ static int query_cpu_subfunc(S390FeatBitmap features) if (test_bit(S390_FEAT_ESORT_BASE, features)) { s390_add_from_feat_block(features, S390_FEAT_TYPE_SORTL, prop.sortl); } + if (test_bit(S390_FEAT_DEFLATE_BASE, features)) { + s390_add_from_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc); + } return 0; } @@ -2136,6 +2139,9 @@ static int configure_cpu_subfunc(const S390FeatBitmap features) if (test_bit(S390_FEAT_ESORT_BASE, features)) { s390_fill_feat_block(features, S390_FEAT_TYPE_SORTL, prop.sortl); } + if (test_bit(S390_FEAT_DEFLATE_BASE, features)) { + s390_fill_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc); + } return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr); }