]> xenbits.xensource.com Git - xen.git/commit
x86/CPUID: surface suitable value in EBX of XSTATE subleaf 1
authorJan Beulich <jbeulich@suse.com>
Tue, 11 Oct 2022 13:14:05 +0000 (15:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Oct 2022 13:14:05 +0000 (15:14 +0200)
commit7923ea47e578bca30a6e45951a9da09e827ff028
tree8cae49cac305ba7b0070ddaa082fb1bdb9cdaded
parentd65ebacb78901b695bc5e8a075ad1ad865a78928
x86/CPUID: surface suitable value in EBX of XSTATE subleaf 1

While the SDM isn't very clear about this, our present behavior make
Linux 5.19 unhappy. As of commit 8ad7e8f69695 ("x86/fpu/xsave: Support
XSAVEC in the kernel") they're using this CPUID output also to size
the compacted area used by XSAVEC. Getting back zero there isn't really
liked, yet for PV that's the default on capable hardware: XSAVES isn't
exposed to PV domains.

Considering that the size reported is that of the compacted save area,
I view Linux'es assumption as appropriate (short of the SDM properly
considering the case). Therefore we need to populate the field also when
only XSAVEC is supported for a guest.

Fixes: 460b9a4b3630 ("x86/xsaves: enable xsaves/xrstors for hvm guest")
Fixes: 8d050ed1097c ("x86: don't expose XSAVES capability to PV guests")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: c3bd0b83ea5b7c0da6542687436042eeea1e7909
master date: 2022-08-24 14:23:59 +0200
xen/arch/x86/cpuid.c