Message ID | 20170509151730.o3un5fkhdlka2qz3@aurel32.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 05/09/2017 08:17 AM, Aurelien Jarno wrote: > Ok, thanks for the detailed explanations. Then I guess you should fold > the following patch to correctly set the zArch active bit as done in > s390_fill_feat_block: > > --- a/target/s390x/misc_helper.c > +++ b/target/s390x/misc_helper.c > @@ -693,6 +693,11 @@ static unsigned do_stfle(CPUS390XState *env, uint64_t words[MAX_STFL_WORDS]) > > memset(words, 0, sizeof(uint64_t) * MAX_STFL_WORDS); > > + if (test_bit(S390_FEAT_ZARCH, features)) { > + /* z/Architecture is always active if around */ > + words[0] |= 1ull << 61; > + } Oops, yes, good catch. >> Which means that we cannot mask *anything* from TCG, including the useless >> stuff like hexadecimal floating point, and still have the kernel boot. So >> in practice a feature mask for TCG will be not only useless but actively >> harmful. > > That's true if you want to boot an optimized kernel. Well, yes. But the last time I was really looking at this (2 years ago?) Fedora was built to use z9-109. I guess maybe Debian is the only distribution that doesn't force some later cpu? > As soon as you try to > use a newer CPU like the z990, the DAT-enhancement facility bit is set > in STFL, and the kernel try to use the idte instruction which is not > emulated by QEMU. Good to know. Thanks, r~
--- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -693,6 +693,11 @@ static unsigned do_stfle(CPUS390XState *env, uint64_t words[MAX_STFL_WORDS]) memset(words, 0, sizeof(uint64_t) * MAX_STFL_WORDS); + if (test_bit(S390_FEAT_ZARCH, features)) { + /* z/Architecture is always active if around */ + words[0] |= 1ull << 61; + } + for (feat = find_first_bit(features, S390_FEAT_MAX); feat < S390_FEAT_MAX; feat = find_next_bit(features, S390_FEAT_MAX, feat + 1)) {