diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-10-27 15:12:36 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-11-06 00:34:57 +0300 |
commit | 468a3bc2b7b955a7cf97d47c6022bf1ae4a538a3 (patch) | |
tree | a180e3f87155fc16e260c1527235d080b6c9fed6 /arch/s390/mm | |
parent | 92b519f3bc1c90e098bb3f12d8e739fc56c2d444 (diff) | |
download | linux-468a3bc2b7b955a7cf97d47c6022bf1ae4a538a3.tar.xz |
s390/cmma: move parsing of cmma kernel parameter to early boot code
The "cmma=" kernel command line parameter needs to be parsed early for
upcoming changes. Therefore move the parsing code.
Note that EX_TABLE handling of cmma_test_essa() needs to be open-coded,
since the early boot code doesn't have infrastructure for handling expected
exceptions.
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r-- | arch/s390/mm/init.c | 2 | ||||
-rw-r--r-- | arch/s390/mm/page-states.c | 40 |
2 files changed, 1 insertions, 41 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 7eca10c32caa..c322d09624bc 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -164,8 +164,6 @@ void __init mem_init(void) pv_init(); kfence_split_mapping(); - /* Setup guest page hinting */ - cmma_init(); /* this will put all low memory onto the freelists */ memblock_free_all(); diff --git a/arch/s390/mm/page-states.c b/arch/s390/mm/page-states.c index 202dacdf17db..b68fef3d1230 100644 --- a/arch/s390/mm/page-states.c +++ b/arch/s390/mm/page-states.c @@ -18,45 +18,7 @@ #include <asm/facility.h> #include <asm/page-states.h> -static int cmma_flag = 1; - -static int __init cmma(char *str) -{ - bool enabled; - - if (!kstrtobool(str, &enabled)) - cmma_flag = enabled; - return 1; -} -__setup("cmma=", cmma); - -static inline int cmma_test_essa(void) -{ - unsigned long tmp = 0; - int rc = -EOPNOTSUPP; - - /* test ESSA_GET_STATE */ - asm volatile( - " .insn rrf,0xb9ab0000,%[tmp],%[tmp],%[cmd],0\n" - "0: la %[rc],0\n" - "1:\n" - EX_TABLE(0b, 1b) - : [rc] "+&d" (rc), [tmp] "+&d" (tmp) - : [cmd] "i" (ESSA_GET_STATE)); - return rc; -} - -void __init cmma_init(void) -{ - if (!cmma_flag) - return; - if (cmma_test_essa()) { - cmma_flag = 0; - return; - } - if (test_facility(147)) - cmma_flag = 2; -} +int __bootdata_preserved(cmma_flag); static __always_inline void essa(unsigned long paddr, unsigned char cmd) { |