]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/boot: Convert diag500_storage_limit() to extable
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 24 Feb 2025 14:59:09 +0000 (15:59 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 4 Mar 2025 16:34:02 +0000 (17:34 +0100)
Shorten diag500_storage_limit() 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/physmem_info.c

index 99f17efbf7d3e2f665a1e8288d30646dccdee0ed..eb1badb93c40b25117d39a56e5ac1ac7ae484ffd 100644 (file)
@@ -104,29 +104,15 @@ static int diag260(void)
 static int diag500_storage_limit(unsigned long *max_physmem_end)
 {
        unsigned long storage_limit;
-       unsigned long reg1, reg2;
-       psw_t old;
 
        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"
-               "       lghi    1,%[subcode]\n"
-               "       lghi    2,0\n"
-               "       diag    2,4,0x500\n"
-               "1:     mvc     0(16,%[psw_pgm]),0(%[psw_old])\n"
-               "       lgr     %[slimit],2\n"
-               : [reg1] "=&d" (reg1),
-                 [reg2] "=&a" (reg2),
-                 [slimit] "=d" (storage_limit),
-                 "=Q" (get_lowcore()->program_new_psw),
-                 "=Q" (old)
-               : [psw_old] "a" (&old),
-                 [psw_pgm] "a" (&get_lowcore()->program_new_psw),
-                 [subcode] "i" (DIAG500_SC_STOR_LIMIT)
+               "       lghi    %%r1,%[subcode]\n"
+               "       lghi    %%r2,0\n"
+               "       diag    %%r2,%%r4,0x500\n"
+               "0:     lgr     %[slimit],%%r2\n"
+               EX_TABLE(0b, 0b)
+               : [slimit] "=d" (storage_limit)
+               : [subcode] "i" (DIAG500_SC_STOR_LIMIT)
                : "memory", "1", "2");
        if (!storage_limit)
                return -EINVAL;