]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/boot: Convert detect_diag9c() to extable
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 24 Feb 2025 14:59:10 +0000 (15:59 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 4 Mar 2025 16:34:03 +0000 (17:34 +0100)
Shorten detect_diag9c() and use regular EX_TABLE program check handling.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/boot/startup.c

index 978a779a6d47c027d7b9ceb0103a21e37ae21b42..099b2327c781f60ec271908310ca67edc3537949 100644 (file)
@@ -73,30 +73,17 @@ static void detect_machine_type(void)
 
 static void detect_diag9c(void)
 {
-       unsigned long reg1, reg2;
        unsigned int cpu;
        int rc = 1;
-       psw_t old;
 
        cpu = stap();
        asm volatile(
-               "       mvc     0(16,%[psw_old]),0(%[psw_pgm])\n"
-               "       epsw    %[reg1],%[reg2]\n"
-               "       st      %[reg1],0(%[psw_pgm])\n"
-               "       st      %[reg2],4(%[psw_pgm])\n"
-               "       larl    %[reg1],1f\n"
-               "       stg     %[reg1],8(%[psw_pgm])\n"
-               "       diag    %[cpu],0,0x9c\n"
-               "       lhi     %[rc],0\n"
-               "1:     mvc     0(16,%[psw_pgm]),0(%[psw_old])\n"
-               : [reg1] "=&d" (reg1),
-                 [reg2] "=&a" (reg2),
-                 [rc] "+&d" (rc),
-                 "+Q" (get_lowcore()->program_new_psw),
-                 "=Q" (old)
-               : [psw_old] "a" (&old),
-                 [psw_pgm] "a" (&get_lowcore()->program_new_psw),
-                 [cpu] "d" (cpu)
+               "       diag    %[cpu],%%r0,0x9c\n"
+               "0:     lhi     %[rc],0\n"
+               "1:\n"
+               EX_TABLE(0b, 1b)
+               : [rc] "+d" (rc)
+               : [cpu] "d" (cpu)
                : "cc", "memory");
        if (!rc)
                set_machine_feature(MFEATURE_DIAG9C);