All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: Remove AArch64 X30 redundant register alias
@ 2021-07-13 13:29 Naohiro Tamura
  2021-07-14  9:54 ` Marc Zyngier
  0 siblings, 1 reply; 4+ messages in thread
From: Naohiro Tamura @ 2021-07-13 13:29 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Naohiro Tamura, Catalin Marinas, Will Deacon, Ard Biesheuvel,
	Mark Rutland, Marc Zyngier, Fuad Tabba, Andrey Konovalov,
	David Brazdil

This trivial patch is my first one to the kernel community.
Please advice me if something is not right.

-- >8 --
Subject: arm64: Remove AArch64 X30 redundant register alias

This patch removes a redundant AArch64 register alias of X30.
According to the GNU as manual [1], "ip0, ip1, lr and fp are
automatically defined to alias to X16, X17, X30 and X29
respectively".

[1] https://sourceware.org/binutils/docs/as/AArch64-Directives.html

Signed-off-by: Naohiro Tamura <naohirot@fujitsu.com>
---
 arch/arm64/include/asm/assembler.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index 89faca0e740d..c66efc1b5406 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -155,11 +155,6 @@ alternative_endif
 9999:	x;					\
 	_asm_extable	9999b, l
 
-/*
- * Register aliases.
- */
-lr	.req	x30		// link register
-
 /*
  * Vector entry
  */
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: Remove AArch64 X30 redundant register alias
  2021-07-13 13:29 [PATCH] arm64: Remove AArch64 X30 redundant register alias Naohiro Tamura
@ 2021-07-14  9:54 ` Marc Zyngier
  2021-07-14 11:38   ` Robin Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2021-07-14  9:54 UTC (permalink / raw)
  To: Naohiro Tamura
  Cc: linux-arm-kernel, Catalin Marinas, Will Deacon, Ard Biesheuvel,
	Mark Rutland, Fuad Tabba, Andrey Konovalov, David Brazdil

On Tue, 13 Jul 2021 14:29:45 +0100,
Naohiro Tamura <naohirot@fujitsu.com> wrote:
> 
> This trivial patch is my first one to the kernel community.
> Please advice me if something is not right.
> 
> -- >8 --
> Subject: arm64: Remove AArch64 X30 redundant register alias
> 
> This patch removes a redundant AArch64 register alias of X30.
> According to the GNU as manual [1], "ip0, ip1, lr and fp are
> automatically defined to alias to X16, X17, X30 and X29
> respectively".
> 
> [1] https://sourceware.org/binutils/docs/as/AArch64-Directives.html
> 
> Signed-off-by: Naohiro Tamura <naohirot@fujitsu.com>
> ---
>  arch/arm64/include/asm/assembler.h | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
> index 89faca0e740d..c66efc1b5406 100644
> --- a/arch/arm64/include/asm/assembler.h
> +++ b/arch/arm64/include/asm/assembler.h
> @@ -155,11 +155,6 @@ alternative_endif
>  9999:	x;					\
>  	_asm_extable	9999b, l
>  
> -/*
> - * Register aliases.
> - */
> -lr	.req	x30		// link register
> -
>  /*
>   * Vector entry
>   */

I seem to vaguely remember that this isn't always defined, see [1] for
a recent example. Dropping it altogether may end-up being pretty
disruptive.

Thanks,

	M.

[1] https://lore.kernel.org/linux-arm-kernel/20210526213128.GB20442@willie-the-truck

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: Remove AArch64 X30 redundant register alias
  2021-07-14  9:54 ` Marc Zyngier
@ 2021-07-14 11:38   ` Robin Murphy
  2021-07-15  1:29     ` naohirot
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Murphy @ 2021-07-14 11:38 UTC (permalink / raw)
  To: Marc Zyngier, Naohiro Tamura
  Cc: linux-arm-kernel, Catalin Marinas, Will Deacon, Ard Biesheuvel,
	Mark Rutland, Fuad Tabba, Andrey Konovalov, David Brazdil

On 2021-07-14 10:54, Marc Zyngier wrote:
> On Tue, 13 Jul 2021 14:29:45 +0100,
> Naohiro Tamura <naohirot@fujitsu.com> wrote:
>>
>> This trivial patch is my first one to the kernel community.
>> Please advice me if something is not right.
>>
>> -- >8 --
>> Subject: arm64: Remove AArch64 X30 redundant register alias
>>
>> This patch removes a redundant AArch64 register alias of X30.
>> According to the GNU as manual [1], "ip0, ip1, lr and fp are
>> automatically defined to alias to X16, X17, X30 and X29
>> respectively".
>>
>> [1] https://sourceware.org/binutils/docs/as/AArch64-Directives.html
>>
>> Signed-off-by: Naohiro Tamura <naohirot@fujitsu.com>
>> ---
>>   arch/arm64/include/asm/assembler.h | 5 -----
>>   1 file changed, 5 deletions(-)
>>
>> diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
>> index 89faca0e740d..c66efc1b5406 100644
>> --- a/arch/arm64/include/asm/assembler.h
>> +++ b/arch/arm64/include/asm/assembler.h
>> @@ -155,11 +155,6 @@ alternative_endif
>>   9999:	x;					\
>>   	_asm_extable	9999b, l
>>   
>> -/*
>> - * Register aliases.
>> - */
>> -lr	.req	x30		// link register
>> -
>>   /*
>>    * Vector entry
>>    */
> 
> I seem to vaguely remember that this isn't always defined, see [1] for
> a recent example. Dropping it altogether may end-up being pretty
> disruptive.

Right, the built-in alias was only introduced a few years ago in 
binutils 2.29 (where it initially caused problems itself by being a bit 
overzealous[2]), but our current minimum version is 2.23, so we still 
need this for older but still-supported toolchains (e.g. I expect the 
Linaro GCC 7-based releases with binutils 2.28 are still being used).

Robin.

[2] https://www.spinics.net/lists/arm-kernel/msg599929.html

> 
> Thanks,
> 
> 	M.
> 
> [1] https://lore.kernel.org/linux-arm-kernel/20210526213128.GB20442@willie-the-truck
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] arm64: Remove AArch64 X30 redundant register alias
  2021-07-14 11:38   ` Robin Murphy
@ 2021-07-15  1:29     ` naohirot
  0 siblings, 0 replies; 4+ messages in thread
From: naohirot @ 2021-07-15  1:29 UTC (permalink / raw)
  To: 'Robin Murphy', Marc Zyngier
  Cc: linux-arm-kernel, Catalin Marinas, Will Deacon, Ard Biesheuvel,
	Mark Rutland, Fuad Tabba, Andrey Konovalov, David Brazdil

Hi Robin, Marc,

Thank you for your quick feedbacks!

> From: Robin Murphy <robin.murphy@arm.com>
> Sent: Wednesday, July 14, 2021 8:39 PM

> On 2021-07-14 10:54, Marc Zyngier wrote:
> > On Tue, 13 Jul 2021 14:29:45 +0100,
> > Naohiro Tamura <naohirot@fujitsu.com> wrote:

> >> -/*
> >> - * Register aliases.
> >> - */
> >> -lr	.req	x30		// link register
> >> -
> >>   /*
> >>    * Vector entry
> >>    */
> >
> > I seem to vaguely remember that this isn't always defined, see [1] for
> > a recent example. Dropping it altogether may end-up being pretty
> > disruptive.
> 
> Right, the built-in alias was only introduced a few years ago in
> binutils 2.29 (where it initially caused problems itself by being a bit
> overzealous[2]), but our current minimum version is 2.23, so we still
> need this for older but still-supported toolchains (e.g. I expect the
> Linaro GCC 7-based releases with binutils 2.28 are still being used).

I confirmed that binutils 2.23 doesn't have the alias [3].
So I withdraw this patch.

[3] https://sourceware.org/binutils/docs-2.23/as/AArch64-Directives.html#AArch64-Directives

p.s. I have learned how to submit a patch 😊
Thanks.
Naohiro

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-15  1:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 13:29 [PATCH] arm64: Remove AArch64 X30 redundant register alias Naohiro Tamura
2021-07-14  9:54 ` Marc Zyngier
2021-07-14 11:38   ` Robin Murphy
2021-07-15  1:29     ` naohirot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.