diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2025-02-24 15:59:10 +0100 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2025-03-04 17:34:03 +0100 |
commit | 097cf5d57f1fce25bf9c840bc033ff95e5a9234a (patch) | |
tree | 68fcde21421862be2974e1a8aa650267283f9374 | |
parent | b1879e7ee7e2c1c93d5353829f4e71a6f70ffd47 (diff) |
s390/boot: Convert detect_diag9c() to extable
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>
-rw-r--r-- | arch/s390/boot/startup.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index 978a779a6d47..099b2327c781 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -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); |