Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / virt / kvm / async_pf.c
index f0d061f..8035cc1 100644 (file)
@@ -79,7 +79,14 @@ static void async_pf_execute(struct work_struct *work)
 
        might_sleep();
 
-       get_user_pages_unlocked(NULL, mm, addr, 1, 1, 0, NULL);
+       /*
+        * This work is run asynchromously to the task which owns
+        * mm and might be done in another context, so we must
+        * use FOLL_REMOTE.
+        */
+       __get_user_pages_unlocked(NULL, mm, addr, 1, NULL,
+                       FOLL_WRITE | FOLL_REMOTE);
+
        kvm_async_page_present_sync(vcpu, apf);
 
        spin_lock(&vcpu->async_pf.lock);