aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorAndrea Arcangeli <andrea@qumranet.com>2008-01-30 13:57:35 -0500
committerAvi Kivity <avi@qumranet.com>2008-04-27 04:53:18 -0400
commit0aac03f07b37da96e00371e66973d5ffaae578a4 (patch)
treef744219287c43ea0ff356cd84baa206a43fd903f /virt/kvm
parent31bb117eb48f2629e030ca547ca89a1c34150183 (diff)
KVM: Disable pagefaults during copy_from_user_inatomic()
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>
Diffstat (limited to 'virt/kvm')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 7972e3aa2cae..cf6df5167af6 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -554,7 +554,9 @@ int kvm_read_guest_atomic(struct kvm *kvm, gpa_t gpa, void *data,
554 addr = gfn_to_hva(kvm, gfn); 554 addr = gfn_to_hva(kvm, gfn);
555 if (kvm_is_error_hva(addr)) 555 if (kvm_is_error_hva(addr))
556 return -EFAULT; 556 return -EFAULT;
557 pagefault_disable();
557 r = __copy_from_user_inatomic(data, (void __user *)addr + offset, len); 558 r = __copy_from_user_inatomic(data, (void __user *)addr + offset, len);
559 pagefault_enable();
558 if (r) 560 if (r)
559 return -EFAULT; 561 return -EFAULT;
560 return 0; 562 return 0;