You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/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>
1 month ago
..
aio-posix.c include: Move QemuLockCnt APIs to their own header 2 months ago
aio-posix.h aio: remove aio_disable_external() API 2 years ago
aio-wait.c aio-wait: avoid AioContext lock in aio_wait_bh_oneshot() 2 years ago
aio-win32.c include: Move QemuLockCnt APIs to their own header 2 months ago
aiocb.c
async.c include: Move QemuLockCnt APIs to their own header 2 months ago
atomic64.c osdep: Move memalign-related functions to their own header 3 years ago
base64.c nomaintainer: Fix Lesser GPL version number 4 years ago
bitmap.c migration: Use non-atomic ops for clear log bitmap 2 years ago
bitops.c replace TABs with spaces 2 years ago
block-helpers.c block: Adjust check_block_size() signature 2 months ago
block-helpers.h block: Adjust check_block_size() signature 2 months ago
buffer.c nomaintainer: Fix Lesser GPL version number 4 years ago
bufferiszero.c util/bufferiszero: Split out host include files 6 months ago
cacheflush.c util/cacheflush: Avoid possible redundant dcache flush on Darwin 1 year ago
chardev_open.c util/char_dev: Add open_cdev() 12 months ago
compatfd.c util: replace pipe()+cloexec with g_unix_open_pipe() 3 years ago
coroutine-sigaltstack.c osdep: set _FORTIFY_SOURCE=2 when optimization is enabled 1 year ago
coroutine-ucontext.c coroutine-ucontext: Save fake stack for pooled coroutine 11 months ago
coroutine-windows.c build: move coroutine backend selection to meson 2 years ago
cpuinfo-aarch64.c util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD 4 months ago
cpuinfo-i386.c target/i386/hvf: fix handling of XSAVE-related CPUID bits 1 month ago
cpuinfo-loongarch.c util/loongarch64: Detect LASX vector support 6 months ago
cpuinfo-ppc.c util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD 4 months ago
cpuinfo-riscv.c util: Add RISC-V vector extension probe in cpuinfo 1 month ago
crc-ccitt.c util: Add CRC16 (CCITT) calculation routines 4 years ago
crc32c.c igb: Implement Rx SCTP CSO 2 years ago
cutils.c util/cutils: Remove unused qemu_get_exec_dir 3 months ago
dbus.c util: add dbus helper unit 5 years ago
defer-call.c util/defer-call: move defer_call() to util/ 1 year ago
drm.c util/drm: make portable by avoiding struct dirent d_type 4 years ago
envlist.c envlist: Remove unused envlist_parse 3 months ago
error-report.c Remove glib compatibility code that is not required anymore 7 months ago
error.c util/error: Fix use-after-free errors reported by Coverity 2 years ago
event_notifier-posix.c Replace qemu_pipe() with g_unix_open_pipe() 3 years ago
event_notifier-win32.c Remove qemu-common.h include from most units 3 years ago
fdmon-epoll.c include: Move QemuLockCnt APIs to their own header 2 months ago
fdmon-io_uring.c remove unnecessary casts from uintptr_t 11 months ago
fdmon-poll.c aio: remove aio_disable_external() API 2 years ago
fifo8.c fifo8: introduce fifo8_peek() function 3 months ago
filemonitor-inotify.c util/filemonitor-inotify.c: spelling fix: kenel 1 year ago
filemonitor-stub.c nomaintainer: Fix Lesser GPL version number 4 years ago
getauxval.c util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD 4 months ago
guest-random.c util/guest-random: Clean up global variable shadowing 1 year ago
hbitmap.c qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix 3 months ago
hexdump.c util/hexdump: Inline g_string_append_printf "%02x" 6 months ago
host-utils.c host-utils: Implemented signed 256-by-128 division 2 years ago
id.c net: Use id_generate() in the network subsystem, too 4 years ago
int128.c include/qemu/int128: Use Int128 structure for TCI 2 years ago
interval-tree.c util/interval-tree: Check root for null in interval_tree_iter_first 1 year ago
iov.c util/iov: Introduce iov_send_recv_with_flags() 2 months ago
iova-tree.c util/iova-tree: Remove deadcode 2 months ago
keyval.c include: add qemu/keyval.h 3 years ago
lockcnt.c include: Move QemuLockCnt APIs to their own header 2 months ago
log.c plugins: Replace pr_ops with a proper debug dump flag 7 months ago
main-loop.c system/cpus: rename qemu_mutex_lock_iothread() to bql_lock() 11 months ago
memalign.c osdep: Move memalign-related functions to their own header 3 years ago
memfd.c util/memfd: report potential errors on free 2 months ago
meson.build util/cpuinfo-riscv: Support host/cpuinfo.h for riscv 5 months ago
mmap-alloc.c util/mmap-alloc: qemu_fd_getfs() 2 years ago
module.c module: Prevent crash by resetting local_err in module_load_qom_all() 4 months ago
notify.c notify: pass error to notifier with return 9 months ago
nvdimm-utils.c Clean up includes 4 years ago
osdep.c migration: Add direct-io parameter 6 months ago
oslib-posix.c qemu/osdep: Add excluded fd parameter to qemu_close_all_open_fd() 4 months ago
oslib-win32.c oslib-posix: initialize backend memory objects in parallel 10 months ago
path.c util/path: Do not cache all filenames at startup 6 years ago
qdist.c util: spelling fixes 1 year ago
qemu-co-shared-resource.c util/co-shared-resource: Remove unused co_try_get_from_shres 2 months ago
qemu-co-timeout.c util: add qemu-co-timeout 2 years ago
qemu-config.c util/qemu-config: Extract QMP commands to qemu-config-qmp.c 8 months ago
qemu-coroutine-io.c aio: remove aio_disable_external() API 2 years ago
qemu-coroutine-lock.c atomics: eliminate mb_read/mb_set 2 years ago
qemu-coroutine-sleep.c coroutine: Clean up superfluous inclusion of qemu/coroutine.h 2 years ago
qemu-coroutine.c util/coroutine: fix -Werror=maybe-uninitialized false-positive 2 months ago
qemu-option.c qapi: Inline and remove QERR_INVALID_PARAMETER definition 7 months ago
qemu-print.c monitor: Use getter/setter functions for cur_mon 4 years ago
qemu-progress.c include: move progress API to qemu-progress.h 3 years ago
qemu-sockets.c util: don't set SO_REUSEADDR on client sockets 1 month ago
qemu-thread-common.h Clean up includes 6 years ago
qemu-thread-posix.c qemu-thread-posix: cleanup, fix, document QemuEvent 2 years ago
qemu-thread-win32.c qemu-thread-win32: cleanup, fix, document QemuEvent 2 years ago
qemu-timer-common.c semihosting: Implement SYS_ELAPSED and SYS_TICKFREQ 4 years ago
qemu-timer.c -Werror=maybe-uninitialized fixes 2 months ago
qht.c util/qht: use striped locks under TSAN 2 years ago
qsp.c system/cpus: rename qemu_mutex_lock_iothread() to bql_lock() 11 months ago
qtree.c tcg: use QTree instead of GTree 2 years ago
range.c util/range.c: spelling fix: inbetween 1 year ago
rcu.c Replace "iothread lock" with "BQL" in comments 11 months ago
readline.c util/readline: Add C-u shortcut 6 months ago
reserved-region.c util/reserved-region: Add new ReservedRegion helpers 1 year ago
selfmap.c util/selfmap: Use dev_t and ino_t in MapInfo 1 year ago
stats64.c stat64: Add stat64_set() operation 2 years ago
sys_membarrier.c
systemd.c systemd: Also clear LISTEN_FDNAMES during systemd socket activation 2 years ago
thread-context.c qapi: Use returned bool to check for failure (again) 2 years ago
thread-pool.c virtio: use defer_call() in virtio_irqfd_notify() 1 year ago
throttle.c throttle: use THROTTLE_MAX/ARRAY_SIZE for hard code 1 year ago
timed-average.c license: Simplify GPL-2.0-or-later license descriptions 3 months ago
trace-events console/win32: allocate shareable display surface 1 year ago
trace.h trace: switch position of headers to what Meson requires 4 years ago
transactions.c transactions: Invoke clean() after everything else 3 years ago
unicode.c json: Reject invalid UTF-8 sequences 6 years ago
userfaultfd.c util/userfaultfd: Remove unused uffd_poll_events 2 months ago
uuid.c util/uuid: Add UUID_STR_LEN definition 1 year ago
vfio-helpers.c util/vfio-helpers: Use g_file_read_link() 2 years ago
vhost-user-server.c vhost-user-server: do not set memory fd non-blocking 5 months ago
yank.c qapi: Fix dangling references to docs/devel/qapi-code-gen.txt 10 months ago