From: Andrea Arcangeli Date: Wed, 30 Jan 2008 18:57:35 +0000 (+0100) Subject: KVM: Disable pagefaults during copy_from_user_inatomic() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0aac03f07b37da96e00371e66973d5ffaae578a4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Avi Kivity --- 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, 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;