android_kernel_google_msm/virt/kvm
David Matlack 21ff5d9355 kvm: don't take vcpu mutex for obviously invalid vcpu ioctls
commit 2ea75be321 upstream.

vcpu ioctls can hang the calling thread if issued while a vcpu is running.
However, invalid ioctls can happen when userspace tries to probe the kind
of file descriptors (e.g. isatty() calls ioctl(TCGETS)); in that case,
we know the ioctl is going to be rejected as invalid anyway and we can
fail before trying to take the vcpu mutex.

This patch does not change functionality, it just makes invalid ioctls
fail faster.

Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-02-02 17:04:42 +08:00
..
assigned-dev.c
async_pf.c
async_pf.h
coalesced_mmio.c KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio() 2014-02-22 10:32:46 -08:00
coalesced_mmio.h
eventfd.c
ioapic.c
ioapic.h
iodev.h
iommu.c kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601) 2014-09-25 11:49:10 +08:00
irq_comm.c KVM: Fix buffer overflow in kvm_set_irq() 2014-02-20 10:45:33 -08:00
Kconfig
kvm_main.c kvm: don't take vcpu mutex for obviously invalid vcpu ioctls 2015-02-02 17:04:42 +08:00