diff options
Diffstat (limited to 'target/s390x/cpu_features.c')
-rw-r--r-- | target/s390x/cpu_features.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index fa887d9b6f..1d3a036393 100644 --- a/target/s390x/cpu_features.c +++ b/target/s390x/cpu_features.c @@ -336,18 +336,39 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type, S390Feat feat; int bit_nr; - if (type == S390_FEAT_TYPE_STFL && test_bit(S390_FEAT_ZARCH, features)) { - /* Features that are always active */ - data[0] |= 0x20; /* z/Architecture */ - data[17] |= 0x20; /* Configuration-z-architectural-mode */ - } + switch (type) { + case S390_FEAT_TYPE_STFL: + if (test_bit(S390_FEAT_ZARCH, features)) { + /* Features that are always active */ + set_be_bit(2, data); /* z/Architecture */ + set_be_bit(138, data); /* Configuration-z-architectural-mode */ + } + break; + case S390_FEAT_TYPE_PTFF: + case S390_FEAT_TYPE_KMAC: + case S390_FEAT_TYPE_KMC: + case S390_FEAT_TYPE_KM: + case S390_FEAT_TYPE_KIMD: + case S390_FEAT_TYPE_KLMD: + case S390_FEAT_TYPE_PCKMO: + case S390_FEAT_TYPE_KMCTR: + case S390_FEAT_TYPE_KMF: + case S390_FEAT_TYPE_KMO: + case S390_FEAT_TYPE_PCC: + case S390_FEAT_TYPE_PPNO: + case S390_FEAT_TYPE_KMA: + set_be_bit(0, data); /* query is always available */ + break; + default: + break; + }; feat = find_first_bit(features, S390_FEAT_MAX); while (feat < S390_FEAT_MAX) { if (s390_features[feat].type == type) { bit_nr = s390_features[feat].bit; /* big endian on uint8_t array */ - data[bit_nr / 8] |= 0x80 >> (bit_nr % 8); + set_be_bit(bit_nr, data); } feat = find_next_bit(features, S390_FEAT_MAX, feat + 1); } |