qemu-cr16/accel/kvm
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
..
kvm-accel-ops.c accel: make all calls to qemu_process_cpu_events look the same 2025-09-17 19:00:56 +02:00
kvm-all.c kvm: Fix kvm_vm_ioctl() and kvm_device_ioctl() return value 2025-12-02 07:46:21 +01:00
kvm-cpus.h accel/kvm: Remove unused 'system/cpus.h' header in kvm-cpus.h 2025-03-06 15:46:18 +01:00
meson.build target/i386/kvm: Restrict SEV stubs to x86 architecture 2021-10-13 10:47:49 +02:00
trace-events KVM: Dynamic sized kvm memslots array 2024-10-17 19:41:30 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00