Skip to content

Commit

Permalink
i386/cpu: Clear FEAT_XSAVE_XSS_LO/HI leafs when CPUID_EXT_XSAVE is no…
Browse files Browse the repository at this point in the history
…t available

Leaf FEAT_XSAVE_XSS_LO and FEAT_XSAVE_XSS_HI also need to be cleared
when CPUID_EXT_XSAVE is not set.

Fixes: 301e906 ("target/i386: Enable support for XSAVES based features")
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Yang Weijiang <weijiang.yang@intel.com>
Message-ID: <20240115091325.1904229-2-xiaoyao.li@intel.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 81f5cad)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
calmisi authored and Michael Tokarev committed Feb 20, 2024
1 parent 4d9dc11 commit 0766f13
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions target/i386/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6927,6 +6927,8 @@ static void x86_cpu_enable_xsave_components(X86CPU *cpu)
if (!(env->features[FEAT_1_ECX] & CPUID_EXT_XSAVE)) {
env->features[FEAT_XSAVE_XCR0_LO] = 0;
env->features[FEAT_XSAVE_XCR0_HI] = 0;
env->features[FEAT_XSAVE_XSS_LO] = 0;
env->features[FEAT_XSAVE_XSS_HI] = 0;
return;
}

Expand Down

0 comments on commit 0766f13

Please sign in to comment.