diff mbox series

[10/10] s390x/cpumodel: do not claim csske for expanded models in qmp

Message ID 20190418113110.160664-11-borntraeger@de.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: new guest features | expand

Commit Message

Christian Borntraeger April 18, 2019, 11:31 a.m. UTC
While we have removed csske and bpb from the default model, the very
common case of "host-model" in libvirt (expanded to a base model
+ features) would still contain bpb and csske. This can prevent
migration to a future machine for a host-model machine. Let us fence
bpb and csske when we run on a generation 15. If necessary the
user can still use -cpu 8561,csske=on,bpb=on to force enable these
features.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 target/s390x/cpu_models.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

David Hildenbrand April 18, 2019, 12:48 p.m. UTC | #1
On 18.04.19 13:31, Christian Borntraeger wrote:
> While we have removed csske and bpb from the default model, the very
> common case of "host-model" in libvirt (expanded to a base model
> + features) would still contain bpb and csske. This can prevent
> migration to a future machine for a host-model machine. Let us fence
> bpb and csske when we run on a generation 15. If necessary the
> user can still use -cpu 8561,csske=on,bpb=on to force enable these
> features.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  target/s390x/cpu_models.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index e727519686..03bdca1fb8 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -629,6 +629,17 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
>          return NULL;
>      }
>  
> +    /*
> +     * Do not claim CSSKE and BPB if the host model expands to
> +     * generation 15 or newer
> +     */
> +    if (s390_model.def->gen >= 15) {
> +        clear_bit(S390_FEAT_CONDITIONAL_SSKE,
> +                  (unsigned long *) &s390_model.features);
> +        clear_bit(S390_FEAT_BPB,
> +                  (unsigned long *) &s390_model.features);
> +    }
> +
>      if (type == CPU_MODEL_EXPANSION_TYPE_STATIC) {
>          delta_changes = true;
>      } else if (type != CPU_MODEL_EXPANSION_TYPE_FULL) {
> 

The bad thing about it is, it hinders migration *to* this hw generation.
Will have to think about this some more. As alternative, simply ignore
S390_FEAT_CONDITIONAL_SSKE and S390_FEAT_BPB when baselining/comparing.
Christian Borntraeger April 18, 2019, 12:54 p.m. UTC | #2
On 18.04.19 14:48, David Hildenbrand wrote:
> On 18.04.19 13:31, Christian Borntraeger wrote:
>> While we have removed csske and bpb from the default model, the very
>> common case of "host-model" in libvirt (expanded to a base model
>> + features) would still contain bpb and csske. This can prevent
>> migration to a future machine for a host-model machine. Let us fence
>> bpb and csske when we run on a generation 15. If necessary the
>> user can still use -cpu 8561,csske=on,bpb=on to force enable these
>> features.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>>  target/s390x/cpu_models.c | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
>> index e727519686..03bdca1fb8 100644
>> --- a/target/s390x/cpu_models.c
>> +++ b/target/s390x/cpu_models.c
>> @@ -629,6 +629,17 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
>>          return NULL;
>>      }
>>  
>> +    /*
>> +     * Do not claim CSSKE and BPB if the host model expands to
>> +     * generation 15 or newer
>> +     */
>> +    if (s390_model.def->gen >= 15) {
>> +        clear_bit(S390_FEAT_CONDITIONAL_SSKE,
>> +                  (unsigned long *) &s390_model.features);
>> +        clear_bit(S390_FEAT_BPB,
>> +                  (unsigned long *) &s390_model.features);
>> +    }
>> +
>>      if (type == CPU_MODEL_EXPANSION_TYPE_STATIC) {
>>          delta_changes = true;
>>      } else if (type != CPU_MODEL_EXPANSION_TYPE_FULL) {
>>
> 
> The bad thing about it is, it hinders migration *to* this hw generation.

It does not, at least not with todays libvirt. It will happily ask for
-cpu z14,bpb=on and the guest will have it. the current checking is done
by starting a qemu with a "wished" model and then check for success. 

PS: I tested that with managedsave


> Will have to think about this some more. As alternative, simply ignore
> S390_FEAT_CONDITIONAL_SSKE and S390_FEAT_BPB when baselining/comparing.
diff mbox series

Patch

diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index e727519686..03bdca1fb8 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -629,6 +629,17 @@  CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
         return NULL;
     }
 
+    /*
+     * Do not claim CSSKE and BPB if the host model expands to
+     * generation 15 or newer
+     */
+    if (s390_model.def->gen >= 15) {
+        clear_bit(S390_FEAT_CONDITIONAL_SSKE,
+                  (unsigned long *) &s390_model.features);
+        clear_bit(S390_FEAT_BPB,
+                  (unsigned long *) &s390_model.features);
+    }
+
     if (type == CPU_MODEL_EXPANSION_TYPE_STATIC) {
         delta_changes = true;
     } else if (type != CPU_MODEL_EXPANSION_TYPE_FULL) {