diff mbox series

[kvm-unit-tests,v1] s390x: spec_ex: load full register

Message ID 20230811112949.888903-1-nrb@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests,v1] s390x: spec_ex: load full register | expand

Commit Message

Nico Boehr Aug. 11, 2023, 11:29 a.m. UTC
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.

Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
 s390x/spec_ex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Claudio Imbrenda Aug. 11, 2023, 12:02 p.m. UTC | #1
On Fri, 11 Aug 2023 13:29:36 +0200
Nico Boehr <nrb@linux.ibm.com> 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.
> 
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

> ---
>  s390x/spec_ex.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/s390x/spec_ex.c b/s390x/spec_ex.c
> index e3dd85dcb153..72b942576369 100644
> --- a/s390x/spec_ex.c
> +++ b/s390x/spec_ex.c
> @@ -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)
Thomas Huth Aug. 14, 2023, 10:23 a.m. UTC | #2
On 11/08/2023 13.29, Nico Boehr 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.
> 
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
> ---
>   s390x/spec_ex.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/s390x/spec_ex.c b/s390x/spec_ex.c
> index e3dd85dcb153..72b942576369 100644
> --- a/s390x/spec_ex.c
> +++ b/s390x/spec_ex.c
> @@ -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: Thomas Huth <thuth@redhat.com>
Janosch Frank Aug. 22, 2023, 7:26 a.m. UTC | #3
On 8/11/23 13:29, Nico Boehr 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.
> 
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>

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

> ---
>   s390x/spec_ex.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/s390x/spec_ex.c b/s390x/spec_ex.c
> index e3dd85dcb153..72b942576369 100644
> --- a/s390x/spec_ex.c
> +++ b/s390x/spec_ex.c
> @@ -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)
diff mbox series

Patch

diff --git a/s390x/spec_ex.c b/s390x/spec_ex.c
index e3dd85dcb153..72b942576369 100644
--- a/s390x/spec_ex.c
+++ b/s390x/spec_ex.c
@@ -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)