]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
parisc: Prevent booting 64-bit kernels on PA1.x machines
authorHelge Deller <deller@gmx.de>
Fri, 10 Nov 2023 15:13:15 +0000 (16:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:45:45 +0000 (16:45 +0000)
commit a406b8b424fa01f244c1aab02ba186258448c36b upstream.

Bail out early with error message when trying to boot a 64-bit kernel on
32-bit machines. This fixes the previous commit to include the check for
true 64-bit kernels as well.

Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: 591d2108f3abc ("parisc: Add runtime check to prevent PA2.0 kernels on PA1.x machines")
Cc: <stable@vger.kernel.org> # v6.0+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/parisc/kernel/head.S

index 2f570a5205866fa0a29a0c896615a8073d1ff20d..2f552ff3a75f7b73c8b0c7e2e7950d476540a919 100644 (file)
@@ -69,9 +69,8 @@ $bss_loop:
        stw,ma          %arg2,4(%r1)
        stw,ma          %arg3,4(%r1)
 
-#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20)
-       /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU
-        * and halt kernel if we detect a PA1.x CPU. */
+#if defined(CONFIG_PA20)
+       /* check for 64-bit capable CPU as required by current kernel */
        ldi             32,%r10
        mtctl           %r10,%cr11
        .level 2.0
@@ -84,7 +83,7 @@ $bss_loop:
 $iodc_panic:
        copy            %arg0, %r10
        copy            %arg1, %r11
-       load32          PA(init_stack),%sp
+       load32          PA(__bss_stop),%sp
 #define MEM_CONS 0x3A0
        ldw             MEM_CONS+32(%r0),%arg0  // HPA
        ldi             ENTRY_IO_COUT,%arg1