Skip to content

Commit 7063bb2

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/boot: Convert tprot() to extable
Shorten tprot() 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 0b4bf77 commit 7063bb2

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

arch/s390/boot/physmem_info.c

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -137,31 +137,17 @@ static int diag500_storage_limit(unsigned long *max_physmem_end)
137137

138138
static int tprot(unsigned long addr)
139139
{
140-
unsigned long reg1, reg2;
141140
int cc, exception;
142-
psw_t old;
143141

144142
exception = 1;
145143
asm volatile(
146-
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
147-
" epsw %[reg1],%[reg2]\n"
148-
" st %[reg1],0(%[psw_pgm])\n"
149-
" st %[reg2],4(%[psw_pgm])\n"
150-
" larl %[reg1],1f\n"
151-
" stg %[reg1],8(%[psw_pgm])\n"
152144
" tprot 0(%[addr]),0\n"
153-
" lhi %[exc],0\n"
154-
"1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
145+
"0: lhi %[exc],0\n"
146+
"1:\n"
155147
CC_IPM(cc)
156-
: CC_OUT(cc, cc),
157-
[exc] "+d" (exception),
158-
[reg1] "=&d" (reg1),
159-
[reg2] "=&a" (reg2),
160-
"=Q" (get_lowcore()->program_new_psw.addr),
161-
"=Q" (old)
162-
: [psw_old] "a" (&old),
163-
[psw_pgm] "a" (&get_lowcore()->program_new_psw),
164-
[addr] "a" (addr)
148+
EX_TABLE(0b, 1b)
149+
: CC_OUT(cc, cc), [exc] "+d" (exception)
150+
: [addr] "a" (addr)
165151
: CC_CLOBBER_LIST("memory"));
166152
cc = exception ? -EFAULT : CC_TRANSFORM(cc);
167153
return cc;

0 commit comments

Comments
 (0)