aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm/gmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/mm/gmap.c')
-rw-r--r--arch/s390/mm/gmap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
index 736ed32a83c5..bb44990c8212 100644
--- a/arch/s390/mm/gmap.c
+++ b/arch/s390/mm/gmap.c
@@ -2,8 +2,10 @@
2/* 2/*
3 * KVM guest address space mapping code 3 * KVM guest address space mapping code
4 * 4 *
5 * Copyright IBM Corp. 2007, 2016 5 * Copyright IBM Corp. 2007, 2016, 2018
6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> 6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7 * David Hildenbrand <david@redhat.com>
8 * Janosch Frank <frankja@linux.vnet.ibm.com>
7 */ 9 */
8 10
9#include <linux/kernel.h> 11#include <linux/kernel.h>
@@ -588,8 +590,8 @@ int __gmap_link(struct gmap *gmap, unsigned long gaddr, unsigned long vmaddr)
588 return -EFAULT; 590 return -EFAULT;
589 pmd = pmd_offset(pud, vmaddr); 591 pmd = pmd_offset(pud, vmaddr);
590 VM_BUG_ON(pmd_none(*pmd)); 592 VM_BUG_ON(pmd_none(*pmd));
591 /* large pmds cannot yet be handled */ 593 /* Are we allowed to use huge pages? */
592 if (pmd_large(*pmd)) 594 if (pmd_large(*pmd) && !gmap->mm->context.allow_gmap_hpage_1m)
593 return -EFAULT; 595 return -EFAULT;
594 /* Link gmap segment table entry location to page table. */ 596 /* Link gmap segment table entry location to page table. */
595 rc = radix_tree_preload(GFP_KERNEL); 597 rc = radix_tree_preload(GFP_KERNEL);
@@ -1632,6 +1634,7 @@ struct gmap *gmap_shadow(struct gmap *parent, unsigned long asce,
1632 unsigned long limit; 1634 unsigned long limit;
1633 int rc; 1635 int rc;
1634 1636
1637 BUG_ON(parent->mm->context.allow_gmap_hpage_1m);
1635 BUG_ON(gmap_is_shadow(parent)); 1638 BUG_ON(gmap_is_shadow(parent));
1636 spin_lock(&parent->shadow_lock); 1639 spin_lock(&parent->shadow_lock);
1637 sg = gmap_find_shadow(parent, asce, edat_level); 1640 sg = gmap_find_shadow(parent, asce, edat_level);