]> xenbits.xensource.com Git - xen.git/commit
x86/cpuid: Fix handling of XSAVE dynamic leaves
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 30 Apr 2021 19:17:55 +0000 (20:17 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 19 Jun 2024 12:00:06 +0000 (13:00 +0100)
commit71cacfb035f4a78ee10970dc38a3baa04d387451
treea18fbdf59bb030e181c70ddddb3c93d3c05f7757
parentfdb7e77fea4cb1c98dc51dd891a47f7e94612ad4
x86/cpuid: Fix handling of XSAVE dynamic leaves

First, if XSAVE is available in hardware but not visible to the guest, the
dynamic leaves shouldn't be filled in.

Second, the comment concerning XSS state is wrong.  VT-x doesn't manage
host/guest state automatically, but there is provision for "host only" bits to
be set, so the implications are still accurate.

Introduce xstate_compressed_size() to mirror the uncompressed one.  Cross
check it at boot.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
xen/arch/x86/cpuid.c
xen/arch/x86/include/asm/xstate.h
xen/arch/x86/xstate.c