]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blobdiff - virt/kvm/kvm_main.c
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[mirror_ubuntu-kernels.git] / virt / kvm / kvm_main.c
index b838c8f71349e078986d1fda6b5a9a68c96cc415..dfbaafbe3a00991bd40e21bc19dcf606ec553e4a 100644 (file)
@@ -2477,7 +2477,7 @@ static inline int check_user_page_hwpoison(unsigned long addr)
 {
        int rc, flags = FOLL_HWPOISON | FOLL_WRITE;
 
-       rc = get_user_pages(addr, 1, flags, NULL, NULL);
+       rc = get_user_pages(addr, 1, flags, NULL);
        return rc == -EHWPOISON;
 }
 
@@ -2578,6 +2578,7 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,
 {
        kvm_pfn_t pfn;
        pte_t *ptep;
+       pte_t pte;
        spinlock_t *ptl;
        int r;
 
@@ -2601,14 +2602,16 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,
                        return r;
        }
 
-       if (write_fault && !pte_write(*ptep)) {
+       pte = ptep_get(ptep);
+
+       if (write_fault && !pte_write(pte)) {
                pfn = KVM_PFN_ERR_RO_FAULT;
                goto out;
        }
 
        if (writable)
-               *writable = pte_write(*ptep);
-       pfn = pte_pfn(*ptep);
+               *writable = pte_write(pte);
+       pfn = pte_pfn(pte);
 
        /*
         * Get a reference here because callers of *hva_to_pfn* and
@@ -2626,7 +2629,7 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,
         * tail pages of non-compound higher order allocations, which
         * would then underflow the refcount when the caller does the
         * required put_page. Don't allow those pages here.
-        */ 
+        */
        if (!kvm_try_get_pfn(pfn))
                r = -EFAULT;