Commit 41318bfe authored by Dominik Dingel's avatar Dominik Dingel Committed by Linus Torvalds

revert "s390/mm: make hugepages_supported a boot time decision"

Heiko noticed that the current check for hugepage support on s390 is a
little bit too harsh as systems which do not support will crash.

The reason is that pageblock_order can now get negative when we set
HPAGE_SHIFT to 0.  To avoid all this and to avoid opening another can of
worms with enabling HUGETLB_PAGE_SIZE_VARIABLE I think it would be best
to simply allow architectures to define their own hugepages_supported().

Revert bea41197 ("s390/mm: make hugepages_supported a boot time
decision") in preparation.
Signed-off-by: default avatarDominik Dingel <dingel@linux.vnet.ibm.com>
Acked-by: default avatarMartin 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ad4f99e8
...@@ -17,10 +17,7 @@ ...@@ -17,10 +17,7 @@
#define PAGE_DEFAULT_ACC 0 #define PAGE_DEFAULT_ACC 0
#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4) #define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)
#include <asm/setup.h> #define HPAGE_SHIFT 20
#ifndef __ASSEMBLY__
extern unsigned int HPAGE_SHIFT;
#define HPAGE_SIZE (1UL << HPAGE_SHIFT) #define HPAGE_SIZE (1UL << HPAGE_SHIFT)
#define HPAGE_MASK (~(HPAGE_SIZE - 1)) #define HPAGE_MASK (~(HPAGE_SIZE - 1))
#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
...@@ -30,6 +27,9 @@ extern unsigned int HPAGE_SHIFT; ...@@ -30,6 +27,9 @@ extern unsigned int HPAGE_SHIFT;
#define ARCH_HAS_PREPARE_HUGEPAGE #define ARCH_HAS_PREPARE_HUGEPAGE
#define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH #define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH
#include <asm/setup.h>
#ifndef __ASSEMBLY__
static inline void storage_key_init_range(unsigned long start, unsigned long end) static inline void storage_key_init_range(unsigned long start, unsigned long end)
{ {
#if PAGE_DEFAULT_KEY #if PAGE_DEFAULT_KEY
......
...@@ -885,8 +885,6 @@ void __init setup_arch(char **cmdline_p) ...@@ -885,8 +885,6 @@ void __init setup_arch(char **cmdline_p)
*/ */
setup_hwcaps(); setup_hwcaps();
HPAGE_SHIFT = MACHINE_HAS_HPAGE ? 20 : 0;
/* /*
* Create kernel page tables and switch to virtual addressing. * Create kernel page tables and switch to virtual addressing.
*/ */
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#define ALLOC_ORDER 2 #define ALLOC_ORDER 2
#define FRAG_MASK 0x03 #define FRAG_MASK 0x03
unsigned int HPAGE_SHIFT;
unsigned long *crst_table_alloc(struct mm_struct *mm) unsigned long *crst_table_alloc(struct mm_struct *mm)
{ {
struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER); struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment