diff options
author | Andrea Arcangeli <andrea@qumranet.com> | 2008-01-30 19:57:35 +0100 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-04-27 11:53:18 +0300 |
commit | 0aac03f07b37da96e00371e66973d5ffaae578a4 (patch) | |
tree | f744219287c43ea0ff356cd84baa206a43fd903f /virt/kvm | |
parent | 31bb117eb48f2629e030ca547ca89a1c34150183 (diff) | |
download | linux-3.10-0aac03f07b37da96e00371e66973d5ffaae578a4.tar.gz linux-3.10-0aac03f07b37da96e00371e66973d5ffaae578a4.tar.bz2 linux-3.10-0aac03f07b37da96e00371e66973d5ffaae578a4.zip |
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 7972e3aa2ca..cf6df5167af 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, 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; |