Skip to contentSkip to conversation

s390x/cpumodel: default enable mepoch for z14 and later

PATCH In review Collin Walling 4 participants 9 messages Feb 8, 2019 – Feb 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 s390x/cpumodel: default enable mepoch for z14 and later

Latest systems and host kernels support mepoch, which is a feature that was meant to be supported for z14 GA1 from the get-go. Let's copy it to the z14 GA1 default CPU model.

Machines s390-ccw-virtio-3.1 and older will retain the old CPU models and will not provide this bit in the default model.

---
 hw/s390x/s390-virtio-ccw.c  | 1 +
 target/s390x/gen-features.c | 1 +
 2 files changed, 2 insertions(+)
hw/s390x/s390-virtio-ccw.c +1 -0
index fd9d0b0542..32c5027345 100644
@@ -757,6 +757,7 @@ DEFINE_CCW_MACHINE(4_0, "4.0", true);
 static void ccw_machine_3_1_instance_options(MachineState *machine)
 {
     ccw_machine_4_0_instance_options(machine);
+    s390_cpudef_featoff_greater(14, 1, S390_FEAT_MULTIPLE_EPOCH);
 }
 
 static void ccw_machine_3_1_class_options(MachineClass *mc)
target/s390x/gen-features.c +1 -0
index 70015eaaf5..d258d67dca 100644
@@ -550,6 +550,7 @@ static uint16_t default_GEN14_GA1[] = {
     S390_FEAT_GROUP_MSA_EXT_6,
     S390_FEAT_GROUP_MSA_EXT_7,
     S390_FEAT_GROUP_MSA_EXT_8,
+    S390_FEAT_MULTIPLE_EPOCH,
 };
 
 /* QEMU (CPU model) features */
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 s390x/cpumodel: add z14 GA2 model

Introduce the z14 GA2 cpu model for QEMU. There are no new features introduced with this model, and will inherit the same feature set as z14 GA1.

---
 target/s390x/cpu_models.c   | 1 +
 target/s390x/gen-features.c | 7 +++++++
 2 files changed, 8 insertions(+)
target/s390x/cpu_models.c +1 -0
index 7c253ff308..968c21cd47 100644
@@ -79,6 +79,7 @@ static S390CPUDef s390_cpu_defs[] = {
     CPUDEF_INIT(0x2964, 13, 2, 47, 0x08000000U, "z13.2", "IBM z13 GA2"),
     CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
     CPUDEF_INIT(0x3906, 14, 1, 47, 0x08000000U, "z14", "IBM z14 GA1"),
+    CPUDEF_INIT(0x3906, 14, 2, 47, 0x08000000U, "z14.2", "IBM z14 GA2"),
     CPUDEF_INIT(0x3907, 14, 1, 47, 0x08000000U, "z14ZR1", "IBM z14 Model ZR1 GA1"),
 };
 
target/s390x/gen-features.c +7 -0
index d258d67dca..3026fbd88e 100644
@@ -353,6 +353,8 @@ static uint16_t base_GEN14_GA1[] = {
     S390_FEAT_ORDER_PRESERVING_COMPRESSION,
 };
 
+#define base_GEN14_GA2 EmptyFeat
+
 /* Full features (in order of release)
  * Automatically includes corresponding base features.
  * Full features are all features this hardware supports even if kvm/QEMU do not
@@ -480,6 +482,8 @@ static uint16_t full_GEN14_GA1[] = {
     S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF,
 };
 
+#define full_GEN14_GA2 EmptyFeat
+
 /* Default features (in order of release)
  * Automatically includes corresponding base features.
  * Default features are all features this version of QEMU supports for this
@@ -553,6 +557,8 @@ static uint16_t default_GEN14_GA1[] = {
     S390_FEAT_MULTIPLE_EPOCH,
 };
 
+#define default_GEN14_GA2 EmptyFeat
+
 /* QEMU (CPU model) features */
 
 static uint16_t qemu_V2_11[] = {
@@ -661,6 +667,7 @@ static CpuFeatDefSpec CpuFeatDef[] = {
     CPU_FEAT_INITIALIZER(GEN13_GA1),
     CPU_FEAT_INITIALIZER(GEN13_GA2),
     CPU_FEAT_INITIALIZER(GEN14_GA1),
+    CPU_FEAT_INITIALIZER(GEN14_GA2),
 };
 
 #define FEAT_GROUP_INITIALIZER(_name)                  \
Signature · 1 line
2.20.1
Reviewed-by on v1 1/2
#4 lore raw
In reply to Collin Walling
Quoted 8 lines · Collin Walling

Latest systems and host kernels support mepoch, which is a feature that was meant to be supported for z14 GA1 from the get-go. Let's copy it to the z14 GA1 default CPU model.

Machines s390-ccw-virtio-3.1 and older will retain the old CPU models and will not provide this bit in the default model.

Yes, we missed that back then for the intial z14 version as the kernel and qemu parts were added later.

Quoted 30 lines
---
 hw/s390x/s390-virtio-ccw.c  | 1 +
 target/s390x/gen-features.c | 1 +
 2 files changed, 2 insertions(+)
hw/s390x/s390-virtio-ccw.c +1 -0
index fd9d0b0542..32c5027345 100644
@@ -757,6 +757,7 @@ DEFINE_CCW_MACHINE(4_0, "4.0", true);
 static void ccw_machine_3_1_instance_options(MachineState *machine)
 {
     ccw_machine_4_0_instance_options(machine);
+    s390_cpudef_featoff_greater(14, 1, S390_FEAT_MULTIPLE_EPOCH);
 }
 
 static void ccw_machine_3_1_class_options(MachineClass *mc)
target/s390x/gen-features.c +1 -0
index 70015eaaf5..d258d67dca 100644
@@ -550,6 +550,7 @@ static uint16_t default_GEN14_GA1[] = {
     S390_FEAT_GROUP_MSA_EXT_6,
     S390_FEAT_GROUP_MSA_EXT_7,
     S390_FEAT_GROUP_MSA_EXT_8,
+    S390_FEAT_MULTIPLE_EPOCH,
 };
 
 /* QEMU (CPU model) features */
Acked-by on v1 2/2
#2 lore raw

Re: [Qemu-devel] [qemu-s390x] [PATCH 2/2] s390x/cpumodel: add z14 GA2 model

In reply to Collin Walling
Quoted 5 lines · Collin Walling

Introduce the z14 GA2 cpu model for QEMU. There are no new features introduced with this model, and will inherit the same feature set as z14 GA1.

Quoted 57 lines
---
 target/s390x/cpu_models.c   | 1 +
 target/s390x/gen-features.c | 7 +++++++
 2 files changed, 8 insertions(+)
target/s390x/cpu_models.c +1 -0
index 7c253ff308..968c21cd47 100644
@@ -79,6 +79,7 @@ static S390CPUDef s390_cpu_defs[] = {
     CPUDEF_INIT(0x2964, 13, 2, 47, 0x08000000U, "z13.2", "IBM z13 GA2"),
     CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
     CPUDEF_INIT(0x3906, 14, 1, 47, 0x08000000U, "z14", "IBM z14 GA1"),
+    CPUDEF_INIT(0x3906, 14, 2, 47, 0x08000000U, "z14.2", "IBM z14 GA2"),
     CPUDEF_INIT(0x3907, 14, 1, 47, 0x08000000U, "z14ZR1", "IBM z14 Model ZR1 GA1"),
 };
 
target/s390x/gen-features.c +7 -0
index d258d67dca..3026fbd88e 100644
@@ -353,6 +353,8 @@ static uint16_t base_GEN14_GA1[] = {
     S390_FEAT_ORDER_PRESERVING_COMPRESSION,
 };
 
+#define base_GEN14_GA2 EmptyFeat
+
 /* Full features (in order of release)
  * Automatically includes corresponding base features.
  * Full features are all features this hardware supports even if kvm/QEMU do not
@@ -480,6 +482,8 @@ static uint16_t full_GEN14_GA1[] = {
     S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF,
 };
 
+#define full_GEN14_GA2 EmptyFeat
+
 /* Default features (in order of release)
  * Automatically includes corresponding base features.
  * Default features are all features this version of QEMU supports for this
@@ -553,6 +557,8 @@ static uint16_t default_GEN14_GA1[] = {
     S390_FEAT_MULTIPLE_EPOCH,
 };
 
+#define default_GEN14_GA2 EmptyFeat
+
 /* QEMU (CPU model) features */
 
 static uint16_t qemu_V2_11[] = {
@@ -661,6 +667,7 @@ static CpuFeatDefSpec CpuFeatDef[] = {
     CPU_FEAT_INITIALIZER(GEN13_GA1),
     CPU_FEAT_INITIALIZER(GEN13_GA2),
     CPU_FEAT_INITIALIZER(GEN14_GA1),
+    CPU_FEAT_INITIALIZER(GEN14_GA2),
 };
 
 #define FEAT_GROUP_INITIALIZER(_name)                  \
#5 lore raw
In reply to Collin Walling
Quoted 3 lines · On Fri, 8 Feb 2019 17:11:10 -0500 Collin Walling <[email protected]> wrote:

Latest systems and host kernels support mepoch, which is a feature that was meant to be supported for z14 GA1 from the get-go. Let's copy it to the z14 GA1 default CPU model.

Do older kernels simply not support it, or was there something actively missing? IOW, is it fine to turn this on with older kernels?

[It's probably all good, although I like to wait for David's ack for any cpu model patches :)]

Quoted 34 lines

Machines s390-ccw-virtio-3.1 and older will retain the old CPU models and will not provide this bit in the default model.

---
 hw/s390x/s390-virtio-ccw.c  | 1 +
 target/s390x/gen-features.c | 1 +
 2 files changed, 2 insertions(+)
hw/s390x/s390-virtio-ccw.c +1 -0
index fd9d0b0542..32c5027345 100644
@@ -757,6 +757,7 @@ DEFINE_CCW_MACHINE(4_0, "4.0", true);
 static void ccw_machine_3_1_instance_options(MachineState *machine)
 {
     ccw_machine_4_0_instance_options(machine);
+    s390_cpudef_featoff_greater(14, 1, S390_FEAT_MULTIPLE_EPOCH);
 }
 
 static void ccw_machine_3_1_class_options(MachineClass *mc)
target/s390x/gen-features.c +1 -0
index 70015eaaf5..d258d67dca 100644
@@ -550,6 +550,7 @@ static uint16_t default_GEN14_GA1[] = {
     S390_FEAT_GROUP_MSA_EXT_6,
     S390_FEAT_GROUP_MSA_EXT_7,
     S390_FEAT_GROUP_MSA_EXT_8,
+    S390_FEAT_MULTIPLE_EPOCH,
 };
 
 /* QEMU (CPU model) features */
#6 lore raw
Quoted 9 lines · Cornelia Huck
Quoted 3 lines · On Fri, 8 Feb 2019 17:11:10 -0500 Collin Walling <[email protected]> wrote:

Latest systems and host kernels support mepoch, which is a feature that was meant to be supported for z14 GA1 from the get-go. Let's copy it to the z14 GA1 default CPU model.

Do older kernels simply not support it, or was there something actively missing? IOW, is it fine to turn this on with older kernels?

Older kernels will not provide the necessary implementation, so mepoch will not work with such older kernel. (So worst case would be that a new qemu+old kernel requires to add mepoch=off to -cpu z14)
The idea of this patch is to update QEMU in accordance with newer kernels to use more features by default if people use -cpu z14.

Now that I look a 2nd time: shall we also add
S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF ?

Quoted 39 lines

[It's probably all good, although I like to wait for David's ack for any cpu model patches :)]

Quoted 34 lines

Machines s390-ccw-virtio-3.1 and older will retain the old CPU models and will not provide this bit in the default model.

---
 hw/s390x/s390-virtio-ccw.c  | 1 +
 target/s390x/gen-features.c | 1 +
 2 files changed, 2 insertions(+)
hw/s390x/s390-virtio-ccw.c +1 -0
index fd9d0b0542..32c5027345 100644
@@ -757,6 +757,7 @@ DEFINE_CCW_MACHINE(4_0, "4.0", true);
 static void ccw_machine_3_1_instance_options(MachineState *machine)
 {
     ccw_machine_4_0_instance_options(machine);
+    s390_cpudef_featoff_greater(14, 1, S390_FEAT_MULTIPLE_EPOCH);
 }
 
 static void ccw_machine_3_1_class_options(MachineClass *mc)
target/s390x/gen-features.c +1 -0
index 70015eaaf5..d258d67dca 100644
@@ -550,6 +550,7 @@ static uint16_t default_GEN14_GA1[] = {
     S390_FEAT_GROUP_MSA_EXT_6,
     S390_FEAT_GROUP_MSA_EXT_7,
     S390_FEAT_GROUP_MSA_EXT_8,
+    S390_FEAT_MULTIPLE_EPOCH,
 };
 
 /* QEMU (CPU model) features */
Reviewed-by on v1 2/2
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] s390x/cpumodel: add z14 GA2 model

In reply to Collin Walling
Quoted 55 lines · Collin Walling

Introduce the z14 GA2 cpu model for QEMU. There are no new features introduced with this model, and will inherit the same feature set as z14 GA1.

---
 target/s390x/cpu_models.c   | 1 +
 target/s390x/gen-features.c | 7 +++++++
 2 files changed, 8 insertions(+)
target/s390x/cpu_models.c +1 -0
index 7c253ff308..968c21cd47 100644
@@ -79,6 +79,7 @@ static S390CPUDef s390_cpu_defs[] = {
     CPUDEF_INIT(0x2964, 13, 2, 47, 0x08000000U, "z13.2", "IBM z13 GA2"),
     CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
     CPUDEF_INIT(0x3906, 14, 1, 47, 0x08000000U, "z14", "IBM z14 GA1"),
+    CPUDEF_INIT(0x3906, 14, 2, 47, 0x08000000U, "z14.2", "IBM z14 GA2"),
     CPUDEF_INIT(0x3907, 14, 1, 47, 0x08000000U, "z14ZR1", "IBM z14 Model ZR1 GA1"),
 };
 
target/s390x/gen-features.c +6 -0
index d258d67dca..3026fbd88e 100644
@@ -353,6 +353,8 @@ static uint16_t base_GEN14_GA1[] = {
     S390_FEAT_ORDER_PRESERVING_COMPRESSION,
 };
 
+#define base_GEN14_GA2 EmptyFeat
+
 /* Full features (in order of release)
  * Automatically includes corresponding base features.
  * Full features are all features this hardware supports even if kvm/QEMU do not
@@ -480,6 +482,8 @@ static uint16_t full_GEN14_GA1[] = {
     S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF,
 };
 
+#define full_GEN14_GA2 EmptyFeat
+
 /* Default features (in order of release)
  * Automatically includes corresponding base features.
  * Default features are all features this version of QEMU supports for this
@@ -553,6 +557,8 @@ static uint16_t default_GEN14_GA1[] = {
     S390_FEAT_MULTIPLE_EPOCH,
 };
 
+#define default_GEN14_GA2 EmptyFeat
+
 /* QEMU (CPU model) features */
 
 static uint16_t qemu_V2_11[] = {

target/s390x/gen-features.c static CpuFeatDefSpec CpuFeatDef[] = { · line 673

Quoted 7 lines
target/s390x/gen-features.c +1 -0
@@ -661,6 +667,7 @@ static CpuFeatDefSpec CpuFeatDef[] = {
     CPU_FEAT_INITIALIZER(GEN13_GA1),
     CPU_FEAT_INITIALIZER(GEN13_GA2),
     CPU_FEAT_INITIALIZER(GEN14_GA1),
+    CPU_FEAT_INITIALIZER(GEN14_GA2),
 };
 
 #define FEAT_GROUP_INITIALIZER(_name)                  \
Signature · 3 lines
Thanks,

David / dhildenb
Reviewed-by
#7 lore raw
In reply to Christian Borntraeger
Quoted 10 lines · Christian Borntraeger
Quoted 7 lines · Cornelia Huck
Quoted 3 lines · On Fri, 8 Feb 2019 17:11:10 -0500 Collin Walling <[email protected]> wrote:

Latest systems and host kernels support mepoch, which is a feature that was meant to be supported for z14 GA1 from the get-go. Let's copy it to the z14 GA1 default CPU model.

Quoted 6 lines
Quoted 2 lines

Do older kernels simply not support it, or was there something actively missing? IOW, is it fine to turn this on with older kernels?

Older kernels will not provide the necessary implementation, so mepoch will not work with such older kernel. (So worst case would be that a new qemu+old kernel requires to add mepoch=off to -cpu z14)

Or use a compat machine.

Quoted 2 lines

The idea of this patch is to update QEMU in accordance with newer kernels to use more features by default if people use -cpu z14.

Agreed, this was the original purpose of the default models. Can "break" on old kernels, but the compat machines can help for these users, so it does not really "break".

Quoted 3 lines

Now that I look a 2nd time: shall we also add
S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF ?

I think so.

Quoted 5 lines
Quoted 5 lines

[It's probably all good, although I like to wait for David's ack for any cpu model patches :)]

I'm fine with this :)

With S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF also added

Quoted 37 lines
Quoted 36 lines
Quoted 35 lines

Machines s390-ccw-virtio-3.1 and older will retain the old CPU models and will not provide this bit in the default model.

---
 hw/s390x/s390-virtio-ccw.c  | 1 +
 target/s390x/gen-features.c | 1 +
 2 files changed, 2 insertions(+)
hw/s390x/s390-virtio-ccw.c +1 -0
index fd9d0b0542..32c5027345 100644
@@ -757,6 +757,7 @@ DEFINE_CCW_MACHINE(4_0, "4.0", true);
 static void ccw_machine_3_1_instance_options(MachineState *machine)
 {
     ccw_machine_4_0_instance_options(machine);
+    s390_cpudef_featoff_greater(14, 1, S390_FEAT_MULTIPLE_EPOCH);
 }
 
 static void ccw_machine_3_1_class_options(MachineClass *mc)
target/s390x/gen-features.c +1 -0
index 70015eaaf5..d258d67dca 100644
@@ -550,6 +550,7 @@ static uint16_t default_GEN14_GA1[] = {
     S390_FEAT_GROUP_MSA_EXT_6,
     S390_FEAT_GROUP_MSA_EXT_7,
     S390_FEAT_GROUP_MSA_EXT_8,
+    S390_FEAT_MULTIPLE_EPOCH,
 };
 
 /* QEMU (CPU model) features */
Signature · 3 lines
Thanks,

David / dhildenb
#8 lore raw
Quoted 18 lines · On Mon, 11 Feb 2019 09:55:25 +0100 David Hildenbrand <[email protected]> wrote:
Quoted 10 lines · Christian Borntraeger
Quoted 7 lines · Cornelia Huck
Quoted 3 lines · On Fri, 8 Feb 2019 17:11:10 -0500 Collin Walling <[email protected]> wrote:

Latest systems and host kernels support mepoch, which is a feature that was meant to be supported for z14 GA1 from the get-go. Let's copy it to the z14 GA1 default CPU model.

Quoted 6 lines
Quoted 2 lines

Do older kernels simply not support it, or was there something actively missing? IOW, is it fine to turn this on with older kernels?

Older kernels will not provide the necessary implementation, so mepoch will not work with such older kernel. (So worst case would be that a new qemu+old kernel requires to add mepoch=off to -cpu z14)

Quoted 8 lines

Or use a compat machine.

Quoted 2 lines

The idea of this patch is to update QEMU in accordance with newer kernels to use more features by default if people use -cpu z14.

Agreed, this was the original purpose of the default models. Can "break" on old kernels, but the compat machines can help for these users, so it does not really "break".

That seems fine then.

Quoted 10 lines
Quoted 4 lines

Now that I look a 2nd time: shall we also add
S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF ?

I think so.

Quoted 3 lines
Quoted 3 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

[It's probably all good, although I like to wait for David's ack for any cpu model patches :)]

I'm fine with this :)

With S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF also added

Ok, can I please get a v2 with that added as well?

Quoted 40 lines
Quoted 38 lines
Quoted 37 lines
Quoted 36 lines

Machines s390-ccw-virtio-3.1 and older will retain the old CPU models and will not provide this bit in the default model.

---
 hw/s390x/s390-virtio-ccw.c  | 1 +
 target/s390x/gen-features.c | 1 +
 2 files changed, 2 insertions(+)
hw/s390x/s390-virtio-ccw.c +1 -0
index fd9d0b0542..32c5027345 100644
@@ -757,6 +757,7 @@ DEFINE_CCW_MACHINE(4_0, "4.0", true);
 static void ccw_machine_3_1_instance_options(MachineState *machine)
 {
     ccw_machine_4_0_instance_options(machine);
+    s390_cpudef_featoff_greater(14, 1, S390_FEAT_MULTIPLE_EPOCH);
 }
 
 static void ccw_machine_3_1_class_options(MachineClass *mc)
target/s390x/gen-features.c +1 -0
index 70015eaaf5..d258d67dca 100644
@@ -550,6 +550,7 @@ static uint16_t default_GEN14_GA1[] = {
     S390_FEAT_GROUP_MSA_EXT_6,
     S390_FEAT_GROUP_MSA_EXT_7,
     S390_FEAT_GROUP_MSA_EXT_8,
+    S390_FEAT_MULTIPLE_EPOCH,
 };
 
 /* QEMU (CPU model) features */