summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/hugetlb.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-09-03 13:17:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-09-03 13:17:33 -0700
commitcda9a8486c48f09dabfec0c17ab109e352fe368e (patch)
tree342721fd437ae0159bddd35648b19a51228c6a2f /arch/s390/include/asm/hugetlb.h
parent6433fe06f698936e02f79bf18f69be766e4f53aa (diff)
parent7c8d42fdf1a84b1a0dd60d6528309c8ec127e87c (diff)
Merge tag 's390-6.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Vasily Gorbik: - Update defconfigs - Fix linker script to align nospec tables correctly to avoid potentially unbootable kernel with some config options - Fix alignment check in prepare_hugepage_range() for 2GB hugepages to avoid BUG in __unmap_hugepage_range() for unaligned mappings later - Remove useless hugepage address alignment in hugetlb fault handling * tag 's390-6.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/hugetlb: fix prepare_hugepage_range() check for 2 GB hugepages s390: update defconfigs s390: fix nospec table alignments s390/mm: remove useless hugepage address alignment
Diffstat (limited to 'arch/s390/include/asm/hugetlb.h')
-rw-r--r--arch/s390/include/asm/hugetlb.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
index f22beda9e6d5..ccdbccfde148 100644
--- a/arch/s390/include/asm/hugetlb.h
+++ b/arch/s390/include/asm/hugetlb.h
@@ -28,9 +28,11 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
static inline int prepare_hugepage_range(struct file *file,
unsigned long addr, unsigned long len)
{
- if (len & ~HPAGE_MASK)
+ struct hstate *h = hstate_file(file);
+
+ if (len & ~huge_page_mask(h))
return -EINVAL;
- if (addr & ~HPAGE_MASK)
+ if (addr & ~huge_page_mask(h))
return -EINVAL;
return 0;
}