kernel-hacking-2024-linux-s.../arch/x86
Michael S. Tsirkin 9fc77441e5 KVM: make processes waiting on vcpu mutex killable
vcpu mutex can be held for unlimited time so
taking it with mutex_lock on an ioctl is wrong:
one process could be passed a vcpu fd and
call this ioctl on the vcpu used by another process,
it will then be unkillable until the owner exits.

Call mutex_lock_killable instead and return status.
Note: mutex_lock_interruptible would be even nicer,
but I am not sure all users are prepared to handle EINTR
from these ioctls. They might misinterpret it as an error.

Cleanup paths expect a vcpu that can't be used by
any userspace so this will always succeed - catch bugs
by calling BUG_ON.

Catch callers that don't check return state by adding
__must_check.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2012-09-17 13:46:32 -03:00
..
boot x86, build: Globally set -fno-pic 2012-08-10 16:12:30 -07:00
configs
crypto
ia32
include/asm KVM: emulator: optimize "rep ins" handling 2012-09-06 18:07:38 +03:00
kernel Merge remote-tracking branch 'upstream/master' into queue 2012-08-26 13:58:41 -03:00
kvm KVM: make processes waiting on vcpu mutex killable 2012-09-17 13:46:32 -03:00
lguest
lib
math-emu
mm mm: hugetlbfs: correctly populate shared pmd 2012-08-21 16:45:02 -07:00
net
oprofile
pci
platform Revert "x86-64/efi: Use EFI to deal with platform wall clock" 2012-08-14 09:58:25 -07:00
power
realmode x86, build: Globally set -fno-pic 2012-08-10 16:12:30 -07:00
syscalls x32: Use compat shims for {g,s}etsockopt 2012-08-18 14:15:39 -07:00
tools
um um: switch UPT_SET_RETURN_VALUE and regs_return_value to pt_regs 2012-08-01 23:33:16 +02:00
vdso
video
xen Three bug-fixes: 2012-08-25 17:31:59 -07:00
.gitignore
Kbuild
Kconfig x86: KVM guest: merge CONFIG_KVM_CLOCK into CONFIG_KVM_GUEST 2012-08-23 04:57:54 -03:00
Kconfig.cpu
Kconfig.debug
Makefile x86, build: Globally set -fno-pic 2012-08-10 16:12:30 -07:00
Makefile.um
Makefile_32.cpu