]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: Disable pagefaults during copy_from_user_inatomic()
authorAndrea Arcangeli <andrea@qumranet.com>
Wed, 30 Jan 2008 18:57:35 +0000 (19:57 +0100)
committerAvi Kivity <avi@qumranet.com>
Sun, 27 Apr 2008 08:53:18 +0000 (11:53 +0300)
With CONFIG_PREEMPT=n, this is needed in order to disable the fault-in
code from sleeping.

Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
virt/kvm/kvm_main.c

index 7972e3aa2caedd85f47ed7a8aef7e9ff1b455918..cf6df5167af62fd0f9b89b2e52f10aacab4a181f 100644 (file)
@@ -554,7 +554,9 @@ int kvm_read_guest_atomic(struct kvm *kvm, gpa_t gpa, void *data,
        addr = gfn_to_hva(kvm, gfn);
        if (kvm_is_error_hva(addr))
                return -EFAULT;
+       pagefault_disable();
        r = __copy_from_user_inatomic(data, (void __user *)addr + offset, len);
+       pagefault_enable();
        if (r)
                return -EFAULT;
        return 0;