qemu/host/include
Paolo Bonzini 7cac7aa704 target/i386/hvf: fix handling of XSAVE-related CPUID bits
The call to xgetbv() is passing the ecx value for cpuid function 0xD,
index 0. The xgetbv call thus returns false (OSXSAVE is bit 27, which is
well out of the range of CPUID[0xD,0].ECX) and eax is not modified. While
fixing it, cache the whole computation of supported XCR0 bits since it
will be used for more than just CPUID leaf 0xD.

Furthermore, unsupported subleafs of CPUID 0xD (including all those
corresponding to zero bits in host's XCR0) must be hidden; if OSXSAVE
is not set at all, the whole of CPUID leaf 0xD plus the XSAVE bit must
be hidden.

Finally, unconditionally drop XSTATE_BNDREGS_MASK and XSTATE_BNDCSR_MASK;
real hardware will only show them if the MPX bit is set in CPUID;
this is never the case for hvf_get_supported_cpuid() because QEMU's
Hypervisor.framework support does not handle the VMX fields related to
MPX (even in the unlikely possibility that the host has MPX enabled).
So hide those bits in the new cache_host_xcr0().

Cc: Phil Dennis-Jordan <lists@philjordan.eu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-10-31 18:28:32 +01:00
..
aarch64/host util/bufferiszero: Split out host include files 2024-06-19 12:47:11 -07:00
generic/host util/bufferiszero: Split out host include files 2024-06-19 12:47:11 -07:00
i386/host target/i386/hvf: fix handling of XSAVE-related CPUID bits 2024-10-31 18:28:32 +01:00
loongarch64/host util/bufferiszero: Add loongarch64 vector acceleration 2024-06-19 12:47:11 -07:00
ppc/host ppc: spelling fixes 2023-09-20 07:54:34 +03:00
ppc64/host host/include/ppc: Implement aes-round.h 2023-07-08 07:30:17 +01:00
riscv/host util: Add RISC-V vector extension probe in cpuinfo 2024-10-22 11:57:25 -07:00
x86_64/host util/bufferiszero: Split out host include files 2024-06-19 12:47:11 -07:00