i386/cpu: Clear FEAT_XSAVE_COMP_{LO,HI} when XSAVE is not available

Per Intel SDM vol 1, 13.2, if CPUID.1:ECX.XSAVE[bit 26] is 0, the
processor provides no further enumeration through CPUID function 0DH.
QEMU does not do this for "-cpu host,-xsave".

Backports 19ca8285fcd61a8f60f2f44f789a561e0958e8e6
This commit is contained in:
Xiaoyao Li 2021-03-01 19:03:52 -05:00 committed by Lioncash
parent 5e6196ea6b
commit d9d68cc128

View File

@ -5363,6 +5363,8 @@ static void x86_cpu_enable_xsave_components(X86CPU *cpu)
uint64_t mask;
if (!(env->features[FEAT_1_ECX] & CPUID_EXT_XSAVE)) {
env->features[FEAT_XSAVE_COMP_LO] = 0;
env->features[FEAT_XSAVE_COMP_HI] = 0;
return;
}