[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 23/29] s390x/cpumodel: model PTFF subfunctions for Mu
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL 23/29] s390x/cpumodel: model PTFF subfunctions for Multiple-epoch facility |
Date: |
Fri, 9 Feb 2018 10:25:18 +0100 |
From: David Hildenbrand <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Tested-by: Christian Borntraeger <address@hidden>
Reviewed-by: Christian Borntraeger <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/cpu_features.c | 5 +++++
target/s390x/cpu_features_def.h | 4 ++++
target/s390x/gen-features.c | 11 +++++++++++
target/s390x/kvm.c | 8 ++++++++
4 files changed, 28 insertions(+)
diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
index 85d10b5710..a5619f2893 100644
--- a/target/s390x/cpu_features.c
+++ b/target/s390x/cpu_features.c
@@ -156,8 +156,12 @@ static const S390FeatDef s390_features[] = {
FEAT_INIT("ptff-qpc", S390_FEAT_TYPE_PTFF, 3, "PTFF Query Physical Clock"),
FEAT_INIT("ptff-qui", S390_FEAT_TYPE_PTFF, 4, "PTFF Query UTC
Information"),
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
Information Extended"),
+ FEAT_INIT("ptff-qtoue", S390_FEAT_TYPE_PTFF, 13, "PTFF Query TOD Offset
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
User"),
+ FEAT_INIT("ptff-stoe", S390_FEAT_TYPE_PTFF, 73, "PTFF Set TOD Offset
Extended"),
+ FEAT_INIT("ptff-stoue", S390_FEAT_TYPE_PTFF, 77, "PTFF Set TOD Offset User
Extended"),
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[] = {
FEAT_GROUP_INIT("plo", PLO, "Perform-locked-operation facility"),
FEAT_GROUP_INIT("tods", TOD_CLOCK_STEERING, "Tod-clock-steering facility"),
FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced
with z13"),
+ FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements
introduced 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_def.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,
/* KMAC */
S390_FEAT_KMAC_DEA,
diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index 89a140c9a7..f6211b4e6b 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
+#define S390_FEAT_GROUP_MULTIPLE_EPOCH_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[] = {
static uint16_t group_GEN13_PTFF[] = {
S390_FEAT_GROUP_GEN13_PTFF,
};
+static uint16_t group_MULTIPLE_EPOCH_PTFF[] = {
+ S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF,
+};
static uint16_t group_MSA[] = {
S390_FEAT_GROUP_MSA,
};
@@ -466,6 +475,7 @@ static uint16_t full_GEN14_GA1[] = {
S390_FEAT_CMM_NT,
S390_FEAT_HPMA2,
S390_FEAT_SIE_KSS,
+ S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF,
};
/* Default features (in order of release)
@@ -668,6 +678,7 @@ static FeatGroupDefSpec FeatGroupDef[] = {
FEAT_GROUP_INITIALIZER(PLO),
FEAT_GROUP_INITIALIZER(TOD_CLOCK_STEERING),
FEAT_GROUP_INITIALIZER(GEN13_PTFF),
+ FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF),
FEAT_GROUP_INITIALIZER(MSA),
FEAT_GROUP_INITIALIZER(MSA_EXT_1),
FEAT_GROUP_INITIALIZER(MSA_EXT_2),
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index bfd14723f1..deb870921b 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -2221,6 +2221,14 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model,
Error **errp)
return;
}
+ /* PTFF subfunctions might be indicated although kernel support missing */
+ if (!test_bit(S390_FEAT_MULTIPLE_EPOCH, model->features)) {
+ clear_bit(S390_FEAT_PTFF_QSIE, model->features);
+ clear_bit(S390_FEAT_PTFF_QTOUE, model->features);
+ clear_bit(S390_FEAT_PTFF_STOE, model->features);
+ clear_bit(S390_FEAT_PTFF_STOUE, model->features);
+ }
+
/* with cpu model support, CMM is only indicated if really available */
if (kvm_s390_cmma_available()) {
set_bit(S390_FEAT_CMM, model->features);
--
2.13.6
- [qemu-s390x] [PULL 09/29] s390x/flic: make floating interrupts on TCG actually floating, (continued)
- [qemu-s390x] [PULL 09/29] s390x/flic: make floating interrupts on TCG actually floating, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 13/29] s390x: fix size + content of STSI blocks, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 14/29] s390x/tcg: STSI overhaul, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 18/29] s390x/kvm: cache the kvm flic in a central function, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 17/29] s390x/tcg: cache the qemu flic in a central function, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 16/29] configure: s390x supports mttcg now, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 15/29] s390x/tcg: remove SMP warning, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 20/29] s390x/sclp: fix event mask handling, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 21/29] s390x/tcg: wire up pci instructions, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 22/29] s390x/cpumodel: allow zpci features in qemu model, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 23/29] s390x/cpumodel: model PTFF subfunctions for Multiple-epoch facility,
Cornelia Huck <=
- [qemu-s390x] [PULL 24/29] s390x/pci: fixup the code walking IOMMU tables, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 19/29] s390x/flic: cache the common flic class in a central function, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 25/29] s390x/pci: fixup global refresh, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 26/29] s390x/pci: use the right pal and pba in reg_ioat(), Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 27/29] MAINTAINERS: add myself as overall s390x maintainer, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 29/29] MAINTAINERS: add David as additional tcg/s390 maintainer, Cornelia Huck, 2018/02/09
- [qemu-s390x] [PULL 28/29] MAINTAINERS: reorganize s390-ccw bios maintainership, Cornelia Huck, 2018/02/09
- Re: [qemu-s390x] [Qemu-devel] [PULL 00/29] s390x: assorted updates, no-reply, 2018/02/09
- Re: [qemu-s390x] [PULL 00/29] s390x: assorted updates, Peter Maydell, 2018/02/09