mm: remove the pgprot argument to __vmalloc
[linux-2.6-microblaze.git] / arch / x86 / kvm / svm / sev.c
index cf912b4..5573a97 100644 (file)
@@ -336,8 +336,7 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr,
        /* Avoid using vmalloc for smaller buffers. */
        size = npages * sizeof(struct page *);
        if (size > PAGE_SIZE)
-               pages = __vmalloc(size, GFP_KERNEL_ACCOUNT | __GFP_ZERO,
-                                 PAGE_KERNEL);
+               pages = __vmalloc(size, GFP_KERNEL_ACCOUNT | __GFP_ZERO);
        else
                pages = kmalloc(size, GFP_KERNEL_ACCOUNT);
 
@@ -345,7 +344,7 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr,
                return NULL;
 
        /* Pin the user virtual address. */
-       npinned = get_user_pages_fast(uaddr, npages, FOLL_WRITE, pages);
+       npinned = get_user_pages_fast(uaddr, npages, write ? FOLL_WRITE : 0, pages);
        if (npinned != npages) {
                pr_err("SEV: Failure locking %lu pages.\n", npages);
                goto err;