Skip to contentSkip to conversation

s390x: spec_ex: load full register

PATCH In review Nico Boehr 4 participants 4 messages Aug 11, 2023 – Aug 22, 2023

Subsystems (2)
lore
Share & tools
lore

Nico Boehr

author
#0 lore raw

PATCH 1/1 s390x: spec_ex: load full register

There may be contents left in the upper 32 bits of executed_addr; hence we should use a 64-bit load to make sure they are overwritten.

---
 s390x/spec_ex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
s390x/spec_ex.c +1 -1
index e3dd85dcb153..72b942576369 100644
@@ -142,7 +142,7 @@ static int psw_odd_address(void)
 		"	larl	%%r1,0f\n"
 		"	stg	%%r1,%[fixup_addr]\n"
 		"	lpswe	%[odd_psw]\n"
-		"0:	lr	%[executed_addr],%%r0\n"
+		"0:	lgr	%[executed_addr],%%r0\n"
 	: [fixup_addr] "=&T" (fixup_psw.addr),
 	  [executed_addr] "=d" (executed_addr)
 	: [odd_psw] "Q" (odd)
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Fri, 11 Aug 2023 13:29:36 +0200 Nico Boehr <[email protected]> wrote:

There may be contents left in the upper 32 bits of executed_addr; hence we should use a 64-bit load to make sure they are overwritten.

Quoted 17 lines
---
 s390x/spec_ex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
s390x/spec_ex.c +1 -1
index e3dd85dcb153..72b942576369 100644
@@ -142,7 +142,7 @@ static int psw_odd_address(void)
 		"	larl	%%r1,0f\n"
 		"	stg	%%r1,%[fixup_addr]\n"
 		"	lpswe	%[odd_psw]\n"
-		"0:	lr	%[executed_addr],%%r0\n"
+		"0:	lgr	%[executed_addr],%%r0\n"
 	: [fixup_addr] "=&T" (fixup_psw.addr),
 	  [executed_addr] "=d" (executed_addr)
 	: [odd_psw] "Q" (odd)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Nico Boehr
Quoted 13 lines · Nico Boehr

There may be contents left in the upper 32 bits of executed_addr; hence we should use a 64-bit load to make sure they are overwritten.

---
  s390x/spec_ex.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
s390x/spec_ex.c +0 -0
index e3dd85dcb153..72b942576369 100644

s390x/spec_ex.c static int psw_odd_address(void) · line 148

Quoted 8 lines
s390x/spec_ex.c +1 -1
@@ -142,7 +142,7 @@ static int psw_odd_address(void)
  		"	larl	%%r1,0f\n"
  		"	stg	%%r1,%[fixup_addr]\n"
  		"	lpswe	%[odd_psw]\n"
-		"0:	lr	%[executed_addr],%%r0\n"
+		"0:	lgr	%[executed_addr],%%r0\n"
  	: [fixup_addr] "=&T" (fixup_psw.addr),
  	  [executed_addr] "=d" (executed_addr)
  	: [odd_psw] "Q" (odd)
#3 lore raw
In reply to Nico Boehr
Quoted 4 lines · Nico Boehr

There may be contents left in the upper 32 bits of executed_addr; hence we should use a 64-bit load to make sure they are overwritten.

I've pushed this to devel since it seems you didn't do that yourself.

Quoted 17 lines
---
  s390x/spec_ex.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
s390x/spec_ex.c +1 -1
index e3dd85dcb153..72b942576369 100644
@@ -142,7 +142,7 @@ static int psw_odd_address(void)
  		"	larl	%%r1,0f\n"
  		"	stg	%%r1,%[fixup_addr]\n"
  		"	lpswe	%[odd_psw]\n"
-		"0:	lr	%[executed_addr],%%r0\n"
+		"0:	lgr	%[executed_addr],%%r0\n"
  	: [fixup_addr] "=&T" (fixup_psw.addr),
  	  [executed_addr] "=d" (executed_addr)
  	: [odd_psw] "Q" (odd)