qemu-cr16/accel
Markus Armbruster 88be119fb1 kvm: Fix kvm_vm_ioctl() and kvm_device_ioctl() return value
These functions wrap ioctl().  When ioctl() fails, it sets @errno.
The wrappers then return that @errno negated.

Except they call accel_ioctl_end() between calling ioctl() and reading
@errno.  accel_ioctl_end() can clobber @errno, e.g. when a futex()
system call fails.  Seems unlikely, but it's a bug all the same.

Fix by retrieving @errno before calling accel_ioctl_end().

Fixes: a27dd2de68 (KVM: keep track of running ioctls)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251128152050.3417834-1-armbru@redhat.com>
2025-12-02 07:46:21 +01:00
..
hvf accel/hvf: Rename hvf_put|get_registers -> hvf_arch_put|get_registers 2025-10-31 16:26:45 +00:00
kvm kvm: Fix kvm_vm_ioctl() and kvm_device_ioctl() return value 2025-12-02 07:46:21 +01:00
mshv accel/mshv: initialize thread name 2025-10-28 14:50:06 +01:00
qtest accel: Extract AccelClass definition to 'accel/accel-ops.h' 2025-07-15 19:34:33 +02:00
stubs accel/mshv: Initialize VM partition 2025-10-08 19:17:30 +02:00
tcg accel/tcg: Trace tb_gen_code() buffer overflow 2025-11-10 11:55:54 +01:00
xen accel: Extract AccelClass definition to 'accel/accel-ops.h' 2025-07-15 19:34:33 +02:00
accel-blocker.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
accel-common.c accel: Extract AccelClass definition to 'accel/accel-ops.h' 2025-07-15 19:34:33 +02:00
accel-internal.h accel: Include missing 'qemu/accel.h' header in accel-internal.h 2025-04-25 17:09:58 +02:00
accel-irq.c hw/intc: Generalize APIC helper names from kvm_* to accel_* 2025-10-08 19:17:29 +02:00
accel-qmp.c accel/system: Introduce @x-accel-stats QMP command 2025-07-15 19:34:33 +02:00
accel-system.c accel/system: Add 'info accel' on human monitor 2025-07-15 19:34:33 +02:00
accel-target.c accel: Move target-agnostic code from accel-target.c -> accel-common.c 2025-04-25 17:09:58 +02:00
accel-user.c accel: Implement accel_init_ops_interfaces() for both system/user mode 2025-04-25 17:09:58 +02:00
dummy-cpus.c accel: make all calls to qemu_process_cpu_events look the same 2025-09-17 19:00:56 +02:00
dummy-cpus.h accel/dummy: Extract 'dummy-cpus.h' header from 'system/cpus.h' 2025-07-04 14:43:46 +02:00
Kconfig accel: Add Meson and config support for MSHV accelerator 2025-10-08 19:17:27 +02:00
meson.build accel/mshv: Add accelerator skeleton 2025-10-08 19:17:29 +02:00