Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/hugetlb: add hugepages_supported define

On s390 we only can enable hugepages if the underlying hardware/hypervisor
also does support this. Common code now would assume this to be
signaled by setting HPAGE_SHIFT to 0. But on s390, where we only
support one hugepage size, there is a link between HPAGE_SHIFT and
pageblock_order.

So instead of setting HPAGE_SHIFT to 0, we will implement the check for
the hardware capability.

Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Dominik Dingel and committed by
Linus Torvalds
7f9be775 2531c8cf

+1
+1
arch/s390/include/asm/hugetlb.h
··· 14 14 15 15 #define is_hugepage_only_range(mm, addr, len) 0 16 16 #define hugetlb_free_pgd_range free_pgd_range 17 + #define hugepages_supported() (MACHINE_HAS_HPAGE) 17 18 18 19 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, 19 20 pte_t *ptep, pte_t pte);