Merge tag 'lkdtm-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux...
[linux-2.6-microblaze.git] / arch / s390 / kvm / pv.c
index 00d272d..cc7c959 100644 (file)
@@ -116,7 +116,6 @@ static int kvm_s390_pv_alloc_vm(struct kvm *kvm)
        unsigned long base = uv_info.guest_base_stor_len;
        unsigned long virt = uv_info.guest_virt_var_stor_len;
        unsigned long npages = 0, vlen = 0;
-       struct kvm_memory_slot *memslot;
 
        kvm->arch.pv.stor_var = NULL;
        kvm->arch.pv.stor_base = __get_free_pages(GFP_KERNEL_ACCOUNT, get_order(base));
@@ -130,8 +129,7 @@ static int kvm_s390_pv_alloc_vm(struct kvm *kvm)
         * Slots are sorted by GFN
         */
        mutex_lock(&kvm->slots_lock);
-       memslot = kvm_memslots(kvm)->memslots;
-       npages = memslot->base_gfn + memslot->npages;
+       npages = kvm_s390_get_gfn_end(kvm_memslots(kvm));
        mutex_unlock(&kvm->slots_lock);
 
        kvm->arch.pv.guest_len = npages * PAGE_SIZE;
@@ -139,12 +137,7 @@ static int kvm_s390_pv_alloc_vm(struct kvm *kvm)
        /* Allocate variable storage */
        vlen = ALIGN(virt * ((npages * PAGE_SIZE) / HPAGE_SIZE), PAGE_SIZE);
        vlen += uv_info.guest_virt_base_stor_len;
-       /*
-        * The Create Secure Configuration Ultravisor Call does not support
-        * using large pages for the virtual memory area.
-        * This is a hardware limitation.
-        */
-       kvm->arch.pv.stor_var = vmalloc_no_huge(vlen);
+       kvm->arch.pv.stor_var = vzalloc(vlen);
        if (!kvm->arch.pv.stor_var)
                goto out_err;
        return 0;