diff mbox series

[kvm-unit-tests,1/2] arm64: argc is an int

Message ID 20210325155657.600897-2-drjones@redhat.com (mailing list archive)
State New, archived
Headers show
Series arm64: One fix and one improvement | expand

Commit Message

Andrew Jones March 25, 2021, 3:56 p.m. UTC
If argc isn't aligned to eight bytes then loading it as if it's
eight bytes wide is a bad idea. It's only four bytes wide, so we
should only load four bytes.

Reported-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 arm/cstart64.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nikos Nikoleris March 25, 2021, 4:15 p.m. UTC | #1
On 25/03/2021 15:56, Andrew Jones wrote:
> If argc isn't aligned to eight bytes then loading it as if it's
> eight bytes wide is a bad idea. It's only four bytes wide, so we
> should only load four bytes.
> 
> Reported-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
> Signed-off-by: Andrew Jones <drjones@redhat.com>

Thanks for fixing this.

Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>

> ---
>   arm/cstart64.S | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arm/cstart64.S b/arm/cstart64.S
> index 89321dad7aba..0a85338bcdae 100644
> --- a/arm/cstart64.S
> +++ b/arm/cstart64.S
> @@ -100,7 +100,7 @@ start:
>   1:
>   	/* run the test */
>   	adrp	x0, __argc
> -	ldr	x0, [x0, :lo12:__argc]
> +	ldr	w0, [x0, :lo12:__argc]
>   	adrp	x1, __argv
>   	add	x1, x1, :lo12:__argv
>   	adrp	x2, __environ
>
diff mbox series

Patch

diff --git a/arm/cstart64.S b/arm/cstart64.S
index 89321dad7aba..0a85338bcdae 100644
--- a/arm/cstart64.S
+++ b/arm/cstart64.S
@@ -100,7 +100,7 @@  start:
 1:
 	/* run the test */
 	adrp	x0, __argc
-	ldr	x0, [x0, :lo12:__argc]
+	ldr	w0, [x0, :lo12:__argc]
 	adrp	x1, __argv
 	add	x1, x1, :lo12:__argv
 	adrp	x2, __environ