From nobody Thu May 2 13:26:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517821844698153.42104892641908; Mon, 5 Feb 2018 01:10:44 -0800 (PST) Received: from localhost ([::1]:44181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eicnT-0004Fm-Aw for importer@patchew.org; Mon, 05 Feb 2018 04:10:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eicmI-0003f4-Fu for qemu-devel@nongnu.org; Mon, 05 Feb 2018 04:09:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eicmE-0007Mn-Fa for qemu-devel@nongnu.org; Mon, 05 Feb 2018 04:09:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62916) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eicmE-0007Ky-6A; Mon, 05 Feb 2018 04:09:26 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E32827CB9C; Mon, 5 Feb 2018 09:09:24 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-199.ams2.redhat.com [10.36.116.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92B49196AD; Mon, 5 Feb 2018 09:09:13 +0000 (UTC) From: David Hildenbrand To: qemu-s390x@nongnu.org, qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 10:09:12 +0100 Message-Id: <20180205090912.6110-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 05 Feb 2018 09:09:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] s390x/cpumodel: model PTFF subfunctions for Multiple-epoch facility 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: Thomas Huth , David Hildenbrand , Cornelia Huck , Alexander Graf , Christian Borntraeger , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" For now, the kernel does not properly indicate configured CPU subfunctions to the guest, but simply uses the host values (as support in KVM is still missing). That's why we missed to model the PTFF subfunctions that come with Multiple-epoch facility. Let's properly add these, along with a new feature group. Signed-off-by: David Hildenbrand --- target/s390x/cpu_features.c | 5 +++++ target/s390x/cpu_features_def.h | 4 ++++ target/s390x/gen-features.c | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index 85d10b5710..8606e52ca0 100644 --- a/target/s390x/cpu_features.c +++ b/target/s390x/cpu_features.c @@ -156,8 +156,12 @@ static const S390FeatDef s390_features[] =3D { FEAT_INIT("ptff-qpc", S390_FEAT_TYPE_PTFF, 3, "PTFF Query Physical Clo= ck"), FEAT_INIT("ptff-qui", S390_FEAT_TYPE_PTFF, 4, "PTFF Query UTC Informat= ion"), FEAT_INIT("ptff-qtou", S390_FEAT_TYPE_PTFF, 5, "PTFF Query TOD Offset = User"), + FEAT_INIT("ptff-qsie", S390_FEAT_TYPE_PTFF, 10, "PTFF Query Steering I= nformation Extended"), + FEAT_INIT("ptff-qtoue", S390_FEAT_TYPE_PTFF, 13, "PTFF Query TOD Offse= t User Extended"), FEAT_INIT("ptff-sto", S390_FEAT_TYPE_PTFF, 65, "PTFF Set TOD Offset"), FEAT_INIT("ptff-stou", S390_FEAT_TYPE_PTFF, 69, "PTFF Set TOD Offset U= ser"), + FEAT_INIT("ptff-stoe", S390_FEAT_TYPE_PTFF, 73, "PTFF Set TOD Offset E= xtended"), + FEAT_INIT("ptff-stoue", S390_FEAT_TYPE_PTFF, 77, "PTFF Set TOD Offset = User Extended"), =20 FEAT_INIT("kmac-dea", S390_FEAT_TYPE_KMAC, 1, "KMAC DEA"), FEAT_INIT("kmac-tdea-128", S390_FEAT_TYPE_KMAC, 2, "KMAC TDEA-128"), @@ -445,6 +449,7 @@ static S390FeatGroupDef s390_feature_groups[] =3D { FEAT_GROUP_INIT("plo", PLO, "Perform-locked-operation facility"), FEAT_GROUP_INIT("tods", TOD_CLOCK_STEERING, "Tod-clock-steering facili= ty"), FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced= with z13"), + FEAT_GROUP_INIT("mepochptff", MEPOCH_PTFF, "PTFF enhancements introduc= ed with Multiple-epoch facility"), FEAT_GROUP_INIT("msa", MSA, "Message-security-assist facility"), FEAT_GROUP_INIT("msa1", MSA_EXT_1, "Message-security-assist-extension = 1 facility"), FEAT_GROUP_INIT("msa2", MSA_EXT_2, "Message-security-assist-extension = 2 facility"), diff --git a/target/s390x/cpu_features_def.h b/target/s390x/cpu_features_de= f.h index 4d930871b4..7c5915c7b2 100644 --- a/target/s390x/cpu_features_def.h +++ b/target/s390x/cpu_features_def.h @@ -151,8 +151,12 @@ typedef enum { S390_FEAT_PTFF_QPT, S390_FEAT_PTFF_QUI, S390_FEAT_PTFF_QTOU, + S390_FEAT_PTFF_QSIE, + S390_FEAT_PTFF_QTOUE, S390_FEAT_PTFF_STO, S390_FEAT_PTFF_STOU, + S390_FEAT_PTFF_STOE, + S390_FEAT_PTFF_STOUE, =20 /* KMAC */ S390_FEAT_KMAC_DEA, diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 58b6ac484e..8c04ff913f 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -59,6 +59,12 @@ S390_FEAT_PTFF_QTOU, \ S390_FEAT_PTFF_STOU =20 +#define S390_FEAT_GROUP_MEPOCH_PTFF \ + S390_FEAT_PTFF_QSIE, \ + S390_FEAT_PTFF_QTOUE, \ + S390_FEAT_PTFF_STOE, \ + S390_FEAT_PTFF_STOUE + #define S390_FEAT_GROUP_MSA \ S390_FEAT_MSA, \ S390_FEAT_KMAC_DEA, \ @@ -219,6 +225,9 @@ static uint16_t group_TOD_CLOCK_STEERING[] =3D { static uint16_t group_GEN13_PTFF[] =3D { S390_FEAT_GROUP_GEN13_PTFF, }; +static uint16_t group_MEPOCH_PTFF[] =3D { + S390_FEAT_GROUP_MEPOCH_PTFF, +}; static uint16_t group_MSA[] =3D { S390_FEAT_GROUP_MSA, }; @@ -665,6 +674,7 @@ static FeatGroupDefSpec FeatGroupDef[] =3D { FEAT_GROUP_INITIALIZER(PLO), FEAT_GROUP_INITIALIZER(TOD_CLOCK_STEERING), FEAT_GROUP_INITIALIZER(GEN13_PTFF), + FEAT_GROUP_INITIALIZER(MEPOCH_PTFF), FEAT_GROUP_INITIALIZER(MSA), FEAT_GROUP_INITIALIZER(MSA_EXT_1), FEAT_GROUP_INITIALIZER(MSA_EXT_2), --=20 2.14.3