diff mbox series

[v2,09/10] s390x/cpumodel: disable csske and bpb from gen15 cpu models onwards

Message ID 20190426111003.21246-10-borntraeger@de.ibm.com
State New
Headers show
Series s390x: new guest features | expand

Commit Message

Christian Borntraeger April 26, 2019, 11:10 a.m. UTC
These facilities are deprecated and no longer needed.

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

Comments

David Hildenbrand April 26, 2019, 11:18 a.m. UTC | #1
On 26.04.19 13:10, Christian Borntraeger wrote:
> These facilities are deprecated and no longer needed.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  target/s390x/gen-features.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
> index 6260f56dc1..c346b76bdf 100644
> --- a/target/s390x/gen-features.c
> +++ b/target/s390x/gen-features.c
> @@ -13,6 +13,7 @@
>  
>  #include <inttypes.h>
>  #include <stdio.h>
> +#include <string.h>
>  #include "cpu_features_def.h"
>  
>  #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
> @@ -833,6 +834,11 @@ static void set_bits(uint64_t list[], BitSpec bits)
>      }
>  }
>  
> +static inline void clear_bit(uint64_t list[], unsigned long nr)
> +{
> +    list[nr / 64] &= ~(1ULL << (nr % 64));
> +}
> +
>  static void print_feature_defs(void)
>  {
>      uint64_t base_feat[S390_FEAT_MAX / 64 + 1] = {};
> @@ -843,6 +849,12 @@ static void print_feature_defs(void)
>      printf("\n/* CPU model feature list data */\n");
>  
>      for (i = 0; i < ARRAY_SIZE(CpuFeatDef); i++) {
> +        /* With gen15 CSSKE and BPB are deprecated */
> +        if (strcmp(CpuFeatDef[i].name, "S390_FEAT_LIST_GEN15_GA1") == 0) {
> +            clear_bit(base_feat, S390_FEAT_CONDITIONAL_SSKE);
> +            clear_bit(default_feat, S390_FEAT_CONDITIONAL_SSKE);
> +            clear_bit(default_feat, S390_FEAT_BPB);
> +        }
>          set_bits(base_feat, CpuFeatDef[i].base_bits);
>          /* add the base to the default features */
>          set_bits(default_feat, CpuFeatDef[i].base_bits);
> 

Can you squash that into the previous patch, so it doesn't look like the
case model is suddenly changed?
Christian Borntraeger April 26, 2019, 11:18 a.m. UTC | #2
On 26.04.19 13:18, David Hildenbrand wrote:
> On 26.04.19 13:10, Christian Borntraeger wrote:
>> These facilities are deprecated and no longer needed.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>>  target/s390x/gen-features.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
>> index 6260f56dc1..c346b76bdf 100644
>> --- a/target/s390x/gen-features.c
>> +++ b/target/s390x/gen-features.c
>> @@ -13,6 +13,7 @@
>>  
>>  #include <inttypes.h>
>>  #include <stdio.h>
>> +#include <string.h>
>>  #include "cpu_features_def.h"
>>  
>>  #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
>> @@ -833,6 +834,11 @@ static void set_bits(uint64_t list[], BitSpec bits)
>>      }
>>  }
>>  
>> +static inline void clear_bit(uint64_t list[], unsigned long nr)
>> +{
>> +    list[nr / 64] &= ~(1ULL << (nr % 64));
>> +}
>> +
>>  static void print_feature_defs(void)
>>  {
>>      uint64_t base_feat[S390_FEAT_MAX / 64 + 1] = {};
>> @@ -843,6 +849,12 @@ static void print_feature_defs(void)
>>      printf("\n/* CPU model feature list data */\n");
>>  
>>      for (i = 0; i < ARRAY_SIZE(CpuFeatDef); i++) {
>> +        /* With gen15 CSSKE and BPB are deprecated */
>> +        if (strcmp(CpuFeatDef[i].name, "S390_FEAT_LIST_GEN15_GA1") == 0) {
>> +            clear_bit(base_feat, S390_FEAT_CONDITIONAL_SSKE);
>> +            clear_bit(default_feat, S390_FEAT_CONDITIONAL_SSKE);
>> +            clear_bit(default_feat, S390_FEAT_BPB);
>> +        }
>>          set_bits(base_feat, CpuFeatDef[i].base_bits);
>>          /* add the base to the default features */
>>          set_bits(default_feat, CpuFeatDef[i].base_bits);
>>
> 
> Can you squash that into the previous patch, so it doesn't look like the
> case model is suddenly changed?

can do. I wanted it to be separate for better review.
David Hildenbrand April 26, 2019, 11:20 a.m. UTC | #3
On 26.04.19 13:18, Christian Borntraeger wrote:
> 
> 
> On 26.04.19 13:18, David Hildenbrand wrote:
>> On 26.04.19 13:10, Christian Borntraeger wrote:
>>> These facilities are deprecated and no longer needed.
>>>
>>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>>> ---
>>>  target/s390x/gen-features.c | 12 ++++++++++++
>>>  1 file changed, 12 insertions(+)
>>>
>>> diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
>>> index 6260f56dc1..c346b76bdf 100644
>>> --- a/target/s390x/gen-features.c
>>> +++ b/target/s390x/gen-features.c
>>> @@ -13,6 +13,7 @@
>>>  
>>>  #include <inttypes.h>
>>>  #include <stdio.h>
>>> +#include <string.h>
>>>  #include "cpu_features_def.h"
>>>  
>>>  #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
>>> @@ -833,6 +834,11 @@ static void set_bits(uint64_t list[], BitSpec bits)
>>>      }
>>>  }
>>>  
>>> +static inline void clear_bit(uint64_t list[], unsigned long nr)
>>> +{
>>> +    list[nr / 64] &= ~(1ULL << (nr % 64));
>>> +}
>>> +
>>>  static void print_feature_defs(void)
>>>  {
>>>      uint64_t base_feat[S390_FEAT_MAX / 64 + 1] = {};
>>> @@ -843,6 +849,12 @@ static void print_feature_defs(void)
>>>      printf("\n/* CPU model feature list data */\n");
>>>  
>>>      for (i = 0; i < ARRAY_SIZE(CpuFeatDef); i++) {
>>> +        /* With gen15 CSSKE and BPB are deprecated */
>>> +        if (strcmp(CpuFeatDef[i].name, "S390_FEAT_LIST_GEN15_GA1") == 0) {
>>> +            clear_bit(base_feat, S390_FEAT_CONDITIONAL_SSKE);
>>> +            clear_bit(default_feat, S390_FEAT_CONDITIONAL_SSKE);
>>> +            clear_bit(default_feat, S390_FEAT_BPB);
>>> +        }
>>>          set_bits(base_feat, CpuFeatDef[i].base_bits);
>>>          /* add the base to the default features */
>>>          set_bits(default_feat, CpuFeatDef[i].base_bits);
>>>
>>
>> Can you squash that into the previous patch, so it doesn't look like the
>> case model is suddenly changed?
> 
> can do. I wanted it to be separate for better review.
> 

Makes perfect sense.
diff mbox series

Patch

diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index 6260f56dc1..c346b76bdf 100644
--- a/target/s390x/gen-features.c
+++ b/target/s390x/gen-features.c
@@ -13,6 +13,7 @@ 
 
 #include <inttypes.h>
 #include <stdio.h>
+#include <string.h>
 #include "cpu_features_def.h"
 
 #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
@@ -833,6 +834,11 @@  static void set_bits(uint64_t list[], BitSpec bits)
     }
 }
 
+static inline void clear_bit(uint64_t list[], unsigned long nr)
+{
+    list[nr / 64] &= ~(1ULL << (nr % 64));
+}
+
 static void print_feature_defs(void)
 {
     uint64_t base_feat[S390_FEAT_MAX / 64 + 1] = {};
@@ -843,6 +849,12 @@  static void print_feature_defs(void)
     printf("\n/* CPU model feature list data */\n");
 
     for (i = 0; i < ARRAY_SIZE(CpuFeatDef); i++) {
+        /* With gen15 CSSKE and BPB are deprecated */
+        if (strcmp(CpuFeatDef[i].name, "S390_FEAT_LIST_GEN15_GA1") == 0) {
+            clear_bit(base_feat, S390_FEAT_CONDITIONAL_SSKE);
+            clear_bit(default_feat, S390_FEAT_CONDITIONAL_SSKE);
+            clear_bit(default_feat, S390_FEAT_BPB);
+        }
         set_bits(base_feat, CpuFeatDef[i].base_bits);
         /* add the base to the default features */
         set_bits(default_feat, CpuFeatDef[i].base_bits);