[PATCH 15/40] KVM: Disable pagefaults during copy_from_user_inatomic()
- From: Avi Kivity <avi@xxxxxxxxxxxx>
- Date: Mon, 31 Mar 2008 17:36:59 +0300
From: Andrea Arcangeli <andrea@xxxxxxxxxxxx>
With CONFIG_PREEMPT=n, this is needed in order to disable the fault-in
code from sleeping.
Signed-off-by: Andrea Arcangeli <andrea@xxxxxxxxxxxx>
Signed-off-by: Avi Kivity <avi@xxxxxxxxxxxx>
---
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 7972e3a..cf6df51 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;
--
1.5.4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH 00/40] KVM updates for the 2.6.26 merge window (part I)
- From: Avi Kivity
- [PATCH 00/40] KVM updates for the 2.6.26 merge window (part I)
- Prev by Date: [PATCH 14/40] KVM: Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier
- Next by Date: [PATCH 17/40] KVM: align valid EFER bits with the features of the host system
- Previous by thread: [PATCH 14/40] KVM: Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier
- Next by thread: [PATCH 17/40] KVM: align valid EFER bits with the features of the host system
- Index(es):
Relevant Pages
|