yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-s390x-cpumodel-default-enable-bpb-and-ppa15-for-z196.patch

ae23c9
From 9269bf16c4ca06496840473ec842dfcbc2d9020f Mon Sep 17 00:00:00 2001
ae23c9
From: Cornelia Huck <cohuck@redhat.com>
ae23c9
Date: Tue, 7 Aug 2018 09:05:54 +0000
ae23c9
Subject: [PATCH 19/21] s390x/cpumodel: default enable bpb and ppa15 for z196
ae23c9
 and later
ae23c9
ae23c9
RH-Author: Cornelia Huck <cohuck@redhat.com>
ae23c9
Message-id: <20180807100554.29643-3-cohuck@redhat.com>
ae23c9
Patchwork-id: 81660
ae23c9
O-Subject: [qemu-kvm RHEL8/virt212 PATCH 2/2] s390x/cpumodel: default enable bpb and ppa15 for z196 and later
ae23c9
Bugzilla: 1595718
ae23c9
RH-Acked-by: David Hildenbrand <david@redhat.com>
ae23c9
RH-Acked-by: Thomas Huth <thuth@redhat.com>
ae23c9
RH-Acked-by: Jens Freimann <jfreiman@redhat.com>
ae23c9
ae23c9
Upstream: downstream version of 8727315111 ("s390x/cpumodel: default
ae23c9
	  enable bpb and ppa15 for z196 and later"); downstream does
ae23c9
	  not have the upstream machine types, instead we need to
ae23c9
	  turn off the bits for the RHEL 7.5 machine
ae23c9
ae23c9
Most systems and host kernels provide the necessary building blocks for
ae23c9
bpb and ppa15. We can reverse the logic and default enable those
ae23c9
features, while still allowing to disable it via cpu model.
ae23c9
ae23c9
So let us add bpb and ppa15 to z196 and later default CPU model for the
ae23c9
qemu rhel7.6.0 machine. (like -cpu z13).  Older machine types (i.e.
ae23c9
s390-ccw-virtio-rhel7.5.0) will retain the old value and not provide those
ae23c9
bits in the default model.
ae23c9
ae23c9
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ae23c9
---
ae23c9
 hw/s390x/s390-virtio-ccw.c  | 4 ++++
ae23c9
 target/s390x/gen-features.c | 2 ++
ae23c9
 2 files changed, 6 insertions(+)
ae23c9
ae23c9
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
ae23c9
index 64e2a3b..bf039a1 100644
ae23c9
--- a/hw/s390x/s390-virtio-ccw.c
ae23c9
+++ b/hw/s390x/s390-virtio-ccw.c
ae23c9
@@ -912,6 +912,10 @@ static void ccw_machine_rhel750_instance_options(MachineState *machine)
ae23c9
     /* before 2.12 we emulated the very first z900, and RHEL 7.5 is
ae23c9
        based on 2.10 */
ae23c9
     s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat);
ae23c9
+
ae23c9
+    /* bpb and ppa15 were only in the full model in RHEL 7.5 */
ae23c9
+    s390_cpudef_featoff_greater(11, 1, S390_FEAT_PPA15);
ae23c9
+    s390_cpudef_featoff_greater(11, 1, S390_FEAT_BPB);
ae23c9
 }
ae23c9
 
ae23c9
 static void ccw_machine_rhel750_class_options(MachineClass *mc)
ae23c9
diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
ae23c9
index 0cdbc15..6626b6f 100644
ae23c9
--- a/target/s390x/gen-features.c
ae23c9
+++ b/target/s390x/gen-features.c
ae23c9
@@ -512,6 +512,8 @@ static uint16_t default_GEN11_GA1[] = {
ae23c9
     S390_FEAT_IPTE_RANGE,
ae23c9
     S390_FEAT_ACCESS_EXCEPTION_FS_INDICATION,
ae23c9
     S390_FEAT_GROUP_MSA_EXT_4,
ae23c9
+    S390_FEAT_PPA15,
ae23c9
+    S390_FEAT_BPB,
ae23c9
 };
ae23c9
 
ae23c9
 #define default_GEN11_GA2 EmptyFeat
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9