]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.31/s390-setup-fix-boot-crash-for-machine-without-edat-1.patch
Linux 4.14.108
[thirdparty/kernel/stable-queue.git] / releases / 4.19.31 / s390-setup-fix-boot-crash-for-machine-without-edat-1.patch
1 From 86a86804e4f18fc3880541b3d5a07f4df0fe29cb Mon Sep 17 00:00:00 2001
2 From: Martin Schwidefsky <schwidefsky@de.ibm.com>
3 Date: Mon, 18 Feb 2019 18:10:08 +0100
4 Subject: s390/setup: fix boot crash for machine without EDAT-1
5
6 From: Martin Schwidefsky <schwidefsky@de.ibm.com>
7
8 commit 86a86804e4f18fc3880541b3d5a07f4df0fe29cb upstream.
9
10 The fix to make WARN work in the early boot code created a problem
11 on older machines without EDAT-1. The setup_lowcore_dat_on function
12 uses the pointer from lowcore_ptr[0] to set the DAT bit in the new
13 PSWs. That does not work if the kernel page table is set up with
14 4K pages as the prefix address maps to absolute zero.
15
16 To make this work the PSWs need to be changed with via address 0 in
17 form of the S390_lowcore definition.
18
19 Reported-by: Guenter Roeck <linux@roeck-us.net>
20 Tested-by: Cornelia Huck <cohuck@redhat.com>
21 Fixes: 94f85ed3e2f8 ("s390/setup: fix early warning messages")
22 Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25 ---
26 arch/s390/kernel/setup.c | 13 ++++++-------
27 1 file changed, 6 insertions(+), 7 deletions(-)
28
29 --- a/arch/s390/kernel/setup.c
30 +++ b/arch/s390/kernel/setup.c
31 @@ -387,13 +387,12 @@ static void __init setup_lowcore_dat_off
32
33 static void __init setup_lowcore_dat_on(void)
34 {
35 - struct lowcore *lc;
36 -
37 - lc = lowcore_ptr[0];
38 - lc->external_new_psw.mask |= PSW_MASK_DAT;
39 - lc->svc_new_psw.mask |= PSW_MASK_DAT;
40 - lc->program_new_psw.mask |= PSW_MASK_DAT;
41 - lc->io_new_psw.mask |= PSW_MASK_DAT;
42 + __ctl_clear_bit(0, 28);
43 + S390_lowcore.external_new_psw.mask |= PSW_MASK_DAT;
44 + S390_lowcore.svc_new_psw.mask |= PSW_MASK_DAT;
45 + S390_lowcore.program_new_psw.mask |= PSW_MASK_DAT;
46 + S390_lowcore.io_new_psw.mask |= PSW_MASK_DAT;
47 + __ctl_set_bit(0, 28);
48 }
49
50 static struct resource code_resource = {