qemu-cr16/util
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
..
aio-posix.c include: Move QemuLockCnt APIs to their own header 2024-10-15 15:16:17 +01:00
aio-posix.h
aio-wait.c
aio-win32.c include: Move QemuLockCnt APIs to their own header 2024-10-15 15:16:17 +01:00
aiocb.c
async.c include: Move QemuLockCnt APIs to their own header 2024-10-15 15:16:17 +01:00
atomic64.c
base64.c
bitmap.c
bitops.c
block-helpers.c block: Adjust check_block_size() signature 2024-10-18 15:03:35 +02:00
block-helpers.h block: Adjust check_block_size() signature 2024-10-18 15:03:35 +02:00
buffer.c
bufferiszero.c
cacheflush.c
chardev_open.c
compatfd.c
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-windows.c
cpuinfo-aarch64.c util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD 2024-07-30 07:59:23 +10:00
cpuinfo-i386.c target/i386/hvf: fix handling of XSAVE-related CPUID bits 2024-10-31 18:28:32 +01:00
cpuinfo-loongarch.c
cpuinfo-ppc.c util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD 2024-07-30 07:59:23 +10:00
cpuinfo-riscv.c util: Add RISC-V vector extension probe in cpuinfo 2024-10-22 11:57:25 -07:00
crc-ccitt.c
crc32c.c
cutils.c util/cutils: Remove unused qemu_get_exec_dir 2024-09-20 10:04:34 +03:00
dbus.c
defer-call.c
drm.c
envlist.c envlist: Remove unused envlist_parse 2024-09-20 10:00:27 +03:00
error-report.c
error.c
event_notifier-posix.c
event_notifier-win32.c
fdmon-epoll.c include: Move QemuLockCnt APIs to their own header 2024-10-15 15:16:17 +01:00
fdmon-io_uring.c
fdmon-poll.c
fifo8.c fifo8: introduce fifo8_peek() function 2024-09-13 20:11:13 +02:00
filemonitor-inotify.c
filemonitor-stub.c
getauxval.c util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD 2024-07-30 07:59:23 +10:00
guest-random.c
hbitmap.c qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix 2024-09-10 14:02:16 +02:00
hexdump.c
host-utils.c
id.c
int128.c
interval-tree.c
iov.c util/iov: Introduce iov_send_recv_with_flags() 2024-10-10 12:33:31 +01:00
iova-tree.c util/iova-tree: Remove deadcode 2024-10-08 15:28:55 -04:00
keyval.c
lockcnt.c include: Move QemuLockCnt APIs to their own header 2024-10-15 15:16:17 +01:00
log.c
main-loop.c
memalign.c
memfd.c util/memfd: report potential errors on free 2024-10-14 17:34:09 +04:00
meson.build util/cpuinfo-riscv: Support host/cpuinfo.h for riscv 2024-07-03 10:24:12 -07:00
mmap-alloc.c
module.c module: Prevent crash by resetting local_err in module_load_qom_all() 2024-08-13 16:35:47 +02:00
notify.c
nvdimm-utils.c
osdep.c
oslib-posix.c qemu/osdep: Add excluded fd parameter to qemu_close_all_open_fd() 2024-08-05 08:21:59 +10:00
oslib-win32.c
path.c
qdist.c
qemu-co-shared-resource.c util/co-shared-resource: Remove unused co_try_get_from_shres 2024-09-30 10:53:18 +03:00
qemu-co-timeout.c
qemu-config.c
qemu-coroutine-io.c
qemu-coroutine-lock.c
qemu-coroutine-sleep.c
qemu-coroutine.c util/coroutine: fix -Werror=maybe-uninitialized false-positive 2024-10-02 16:14:29 +04:00
qemu-option.c
qemu-print.c
qemu-progress.c
qemu-sockets.c util: don't set SO_REUSEADDR on client sockets 2024-10-22 11:44:23 +01:00
qemu-thread-common.h
qemu-thread-posix.c
qemu-thread-win32.c
qemu-timer-common.c
qemu-timer.c -Werror=maybe-uninitialized fixes 2024-10-03 10:32:54 +01:00
qht.c
qsp.c
qtree.c
range.c
rcu.c
readline.c
reserved-region.c
selfmap.c
stats64.c
sys_membarrier.c
systemd.c
thread-context.c
thread-pool.c
throttle.c
timed-average.c license: Simplify GPL-2.0-or-later license descriptions 2024-09-20 10:11:59 +03:00
trace-events
trace.h
transactions.c
unicode.c
userfaultfd.c util/userfaultfd: Remove unused uffd_poll_events 2024-10-08 15:28:55 -04:00
uuid.c
vfio-helpers.c
vhost-user-server.c
yank.c