diff options
author | Jason J. Herne <jjherne@linux.vnet.ibm.com> | 2017-04-10 09:39:00 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-07-14 12:29:47 +0200 |
commit | c9ad8a7a53b9f167626a32fe7c1116f8844156db (patch) | |
tree | 26cfa2ad3a77956c9ad7ca170c7d97062d3cba63 /target/s390x/cpu_models.c | |
parent | ec3aadb13ed601f8d77bd4efd80b545ddc84c697 (diff) |
s390x/cpumodel: provide compat handling for new cpu features
Provide a mechanism to disable features in compatibility machines.
Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target/s390x/cpu_models.c')
-rw-r--r-- | target/s390x/cpu_models.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 7cb55dc7e3..fd3f459caa 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -77,6 +77,32 @@ static S390CPUDef s390_cpu_defs[] = { CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"), }; +void s390_cpudef_featoff(uint8_t gen, uint8_t ec_ga, S390Feat feat) +{ + const S390CPUDef *def; + + def = s390_find_cpu_def(0, gen, ec_ga, NULL); + clear_bit(feat, (unsigned long *)&def->default_feat); +} + +void s390_cpudef_featoff_greater(uint8_t gen, uint8_t ec_ga, S390Feat feat) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(s390_cpu_defs); i++) { + const S390CPUDef *def = &s390_cpu_defs[i]; + + if (def->gen < gen) { + continue; + } + if (def->gen == gen && def->ec_ga < ec_ga) { + continue; + } + + clear_bit(feat, (unsigned long *)&def->default_feat); + } +} + uint32_t s390_get_hmfai(void) { static S390CPU *cpu; |