Skip to content

Commit 0b4bf77

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/boot: Convert __diag260() to extable
Shorten __diag260() and use regular EX_TABLE program check handling. Acked-by: Alexander Gordeev <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 68d6996 commit 0b4bf77

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

arch/s390/boot/physmem_info.c

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,36 +59,22 @@ void add_physmem_online_range(u64 start, u64 end)
5959

6060
static int __diag260(unsigned long rx1, unsigned long rx2)
6161
{
62-
unsigned long reg1, reg2, ry;
6362
union register_pair rx;
6463
int cc, exception;
65-
psw_t old;
64+
unsigned long ry;
6665

6766
rx.even = rx1;
6867
rx.odd = rx2;
6968
ry = 0x10; /* storage configuration */
7069
exception = 1;
7170
asm volatile(
72-
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
73-
" epsw %[reg1],%[reg2]\n"
74-
" st %[reg1],0(%[psw_pgm])\n"
75-
" st %[reg2],4(%[psw_pgm])\n"
76-
" larl %[reg1],1f\n"
77-
" stg %[reg1],8(%[psw_pgm])\n"
7871
" diag %[rx],%[ry],0x260\n"
79-
" lhi %[exc],0\n"
80-
"1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
72+
"0: lhi %[exc],0\n"
73+
"1:\n"
8174
CC_IPM(cc)
82-
: CC_OUT(cc, cc),
83-
[exc] "+d" (exception),
84-
[reg1] "=&d" (reg1),
85-
[reg2] "=&a" (reg2),
86-
[ry] "+&d" (ry),
87-
"+Q" (get_lowcore()->program_new_psw),
88-
"=Q" (old)
89-
: [rx] "d" (rx.pair),
90-
[psw_old] "a" (&old),
91-
[psw_pgm] "a" (&get_lowcore()->program_new_psw)
75+
EX_TABLE(0b, 1b)
76+
: CC_OUT(cc, cc), [exc] "+d" (exception), [ry] "+d" (ry)
77+
: [rx] "d" (rx.pair)
9278
: CC_CLOBBER_LIST("memory"));
9379
cc = exception ? -1 : CC_TRANSFORM(cc);
9480
return cc == 0 ? ry : -1;

0 commit comments

Comments
 (0)