linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte
@ 2017-08-31  9:56 Masahiro Yamada
  2017-08-31 10:23 ` Lothar Waßmann
  2017-09-07 16:46 ` Catalin Marinas
  0 siblings, 2 replies; 6+ messages in thread
From: Masahiro Yamada @ 2017-08-31  9:56 UTC (permalink / raw)
  To: linux-arm-kernel, Will Deacon, Catalin Marinas
  Cc: Olof Johansson, Arnd Bergmann, Rob Herring, Russell King,
	Marc Zyngier, Masahiro Yamada, linux-kernel

Aarch64 instructions must be word aligned.  The current 16 byte
alignment is more than enough.  Relax it into 4 byte alignment.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

I do not know why arm64 Linux requires 16 byte alignment.

I dug git-history of arch/arm64/include/asm/linkage.h
and the only commit I see is:

  commit aeed41a9371ee02257b608eb06a9058507a7d0f4
  Author: Marc Zyngier <Marc.Zyngier@arm.com>
  Date:   Fri Oct 19 17:33:27 2012 +0100

      arm64: fix alignment padding in assembly code

It just opt out of the asm-generic variant to remove 0x90.
So, the amount of alignment might not be not optimized yet.

Please correct me if I am missing something.


 arch/arm64/include/asm/linkage.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h
index 636c1bc..1b26629 100644
--- a/arch/arm64/include/asm/linkage.h
+++ b/arch/arm64/include/asm/linkage.h
@@ -1,7 +1,7 @@
 #ifndef __ASM_LINKAGE_H
 #define __ASM_LINKAGE_H
 
-#define __ALIGN		.align 4
-#define __ALIGN_STR	".align 4"
+#define __ALIGN		.align 2
+#define __ALIGN_STR	".align 2"
 
 #endif
-- 
2.7.4

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

* Re: [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte
  2017-08-31  9:56 [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte Masahiro Yamada
@ 2017-08-31 10:23 ` Lothar Waßmann
  2017-08-31 10:38   ` Robin Murphy
  2017-09-07 16:46 ` Catalin Marinas
  1 sibling, 1 reply; 6+ messages in thread
From: Lothar Waßmann @ 2017-08-31 10:23 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-arm-kernel, Will Deacon, Catalin Marinas, Rob Herring,
	Arnd Bergmann, Marc Zyngier, Russell King, linux-kernel,
	Olof Johansson

Hi,

On Thu, 31 Aug 2017 18:56:23 +0900 Masahiro Yamada wrote:
> Aarch64 instructions must be word aligned.  The current 16 byte
> alignment is more than enough.  Relax it into 4 byte alignment.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
> I do not know why arm64 Linux requires 16 byte alignment.
> 
> I dug git-history of arch/arm64/include/asm/linkage.h
> and the only commit I see is:
> 
>   commit aeed41a9371ee02257b608eb06a9058507a7d0f4
>   Author: Marc Zyngier <Marc.Zyngier@arm.com>
>   Date:   Fri Oct 19 17:33:27 2012 +0100
> 
>       arm64: fix alignment padding in assembly code
> 
> It just opt out of the asm-generic variant to remove 0x90.
> So, the amount of alignment might not be not optimized yet.
> 
> Please correct me if I am missing something.
> 
> 
>  arch/arm64/include/asm/linkage.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h
> index 636c1bc..1b26629 100644
> --- a/arch/arm64/include/asm/linkage.h
> +++ b/arch/arm64/include/asm/linkage.h
> @@ -1,7 +1,7 @@
>  #ifndef __ASM_LINKAGE_H
>  #define __ASM_LINKAGE_H
>  
> -#define __ALIGN		.align 4
> -#define __ALIGN_STR	".align 4"
> +#define __ALIGN		.align 2
> +#define __ALIGN_STR	".align 2"
>  
>  #endif
>
My math tells me, that 2 is one half of 4 but 4 is one fourth of 16, so
this change doesn't line up with your commit message, or am I missing
something?


Lothar Waßmann

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

* Re: [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte
  2017-08-31 10:23 ` Lothar Waßmann
@ 2017-08-31 10:38   ` Robin Murphy
  0 siblings, 0 replies; 6+ messages in thread
From: Robin Murphy @ 2017-08-31 10:38 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: Masahiro Yamada, Rob Herring, Arnd Bergmann, Marc Zyngier,
	Catalin Marinas, Will Deacon, Russell King, linux-kernel,
	Olof Johansson, linux-arm-kernel

On 31/08/17 11:23, Lothar Waßmann wrote:
> Hi,
> 
> On Thu, 31 Aug 2017 18:56:23 +0900 Masahiro Yamada wrote:
>> Aarch64 instructions must be word aligned.  The current 16 byte
>> alignment is more than enough.  Relax it into 4 byte alignment.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> ---
>>
>> I do not know why arm64 Linux requires 16 byte alignment.
>>
>> I dug git-history of arch/arm64/include/asm/linkage.h
>> and the only commit I see is:
>>
>>   commit aeed41a9371ee02257b608eb06a9058507a7d0f4
>>   Author: Marc Zyngier <Marc.Zyngier@arm.com>
>>   Date:   Fri Oct 19 17:33:27 2012 +0100
>>
>>       arm64: fix alignment padding in assembly code
>>
>> It just opt out of the asm-generic variant to remove 0x90.
>> So, the amount of alignment might not be not optimized yet.
>>
>> Please correct me if I am missing something.
>>
>>
>>  arch/arm64/include/asm/linkage.h | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h
>> index 636c1bc..1b26629 100644
>> --- a/arch/arm64/include/asm/linkage.h
>> +++ b/arch/arm64/include/asm/linkage.h
>> @@ -1,7 +1,7 @@
>>  #ifndef __ASM_LINKAGE_H
>>  #define __ASM_LINKAGE_H
>>  
>> -#define __ALIGN		.align 4
>> -#define __ALIGN_STR	".align 4"
>> +#define __ALIGN		.align 2
>> +#define __ALIGN_STR	".align 2"
>>  
>>  #endif
>>
> My math tells me, that 2 is one half of 4 but 4 is one fourth of 16, so
> this change doesn't line up with your commit message, or am I missing
> something?

2^4 = 16
2^2 = 4

The ARM behaviour of the .align directive is a bit funky...

Robin.

> 
> 
> Lothar Waßmann
> 
> _______________________________________________
> 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] 6+ messages in thread

* Re: [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte
  2017-08-31  9:56 [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte Masahiro Yamada
  2017-08-31 10:23 ` Lothar Waßmann
@ 2017-09-07 16:46 ` Catalin Marinas
  2017-09-20 10:58   ` Masahiro Yamada
  1 sibling, 1 reply; 6+ messages in thread
From: Catalin Marinas @ 2017-09-07 16:46 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-arm-kernel, Will Deacon, Rob Herring, Arnd Bergmann,
	Marc Zyngier, Russell King, linux-kernel, Olof Johansson

On Thu, Aug 31, 2017 at 06:56:23PM +0900, Masahiro Yamada wrote:
> Aarch64 instructions must be word aligned.  The current 16 byte
> alignment is more than enough.  Relax it into 4 byte alignment.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
> I do not know why arm64 Linux requires 16 byte alignment.
> 
> I dug git-history of arch/arm64/include/asm/linkage.h
> and the only commit I see is:
> 
>   commit aeed41a9371ee02257b608eb06a9058507a7d0f4
>   Author: Marc Zyngier <Marc.Zyngier@arm.com>
>   Date:   Fri Oct 19 17:33:27 2012 +0100
> 
>       arm64: fix alignment padding in assembly code
> 
> It just opt out of the asm-generic variant to remove 0x90.
> So, the amount of alignment might not be not optimized yet.
> 
> Please correct me if I am missing something.

Not sure why we ended up with 4. Possibly because we forgot the power of
2 difference for arm/arm64.

Queued for 4.14. Thanks.

-- 
Catalin

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

* Re: [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte
  2017-09-07 16:46 ` Catalin Marinas
@ 2017-09-20 10:58   ` Masahiro Yamada
  2017-09-20 12:19     ` Catalin Marinas
  0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2017-09-20 10:58 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: linux-arm-kernel, Will Deacon, Rob Herring, Arnd Bergmann,
	Marc Zyngier, Russell King, Linux Kernel Mailing List,
	Olof Johansson

Hi Catalin,


2017-09-08 1:46 GMT+09:00 Catalin Marinas <catalin.marinas@arm.com>:
> On Thu, Aug 31, 2017 at 06:56:23PM +0900, Masahiro Yamada wrote:
>> Aarch64 instructions must be word aligned.  The current 16 byte
>> alignment is more than enough.  Relax it into 4 byte alignment.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> ---
>>
>> I do not know why arm64 Linux requires 16 byte alignment.
>>
>> I dug git-history of arch/arm64/include/asm/linkage.h
>> and the only commit I see is:
>>
>>   commit aeed41a9371ee02257b608eb06a9058507a7d0f4
>>   Author: Marc Zyngier <Marc.Zyngier@arm.com>
>>   Date:   Fri Oct 19 17:33:27 2012 +0100
>>
>>       arm64: fix alignment padding in assembly code
>>
>> It just opt out of the asm-generic variant to remove 0x90.
>> So, the amount of alignment might not be not optimized yet.
>>
>> Please correct me if I am missing something.
>
> Not sure why we ended up with 4. Possibly because we forgot the power of
> 2 difference for arm/arm64.
>
> Queued for 4.14. Thanks.


I still do not see this patch in linux-next.

Where was it queued?





-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte
  2017-09-20 10:58   ` Masahiro Yamada
@ 2017-09-20 12:19     ` Catalin Marinas
  0 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2017-09-20 12:19 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Rob Herring, Arnd Bergmann, Marc Zyngier, Will Deacon,
	Russell King, Linux Kernel Mailing List, Olof Johansson,
	linux-arm-kernel

On Wed, Sep 20, 2017 at 07:58:34PM +0900, Masahiro Yamada wrote:
> 2017-09-08 1:46 GMT+09:00 Catalin Marinas <catalin.marinas@arm.com>:
> > On Thu, Aug 31, 2017 at 06:56:23PM +0900, Masahiro Yamada wrote:
> >> Aarch64 instructions must be word aligned.  The current 16 byte
> >> alignment is more than enough.  Relax it into 4 byte alignment.
> >>
> >> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> >> ---
> >>
> >> I do not know why arm64 Linux requires 16 byte alignment.
> >>
> >> I dug git-history of arch/arm64/include/asm/linkage.h
> >> and the only commit I see is:
> >>
> >>   commit aeed41a9371ee02257b608eb06a9058507a7d0f4
> >>   Author: Marc Zyngier <Marc.Zyngier@arm.com>
> >>   Date:   Fri Oct 19 17:33:27 2012 +0100
> >>
> >>       arm64: fix alignment padding in assembly code
> >>
> >> It just opt out of the asm-generic variant to remove 0x90.
> >> So, the amount of alignment might not be not optimized yet.
> >>
> >> Please correct me if I am missing something.
> >
> > Not sure why we ended up with 4. Possibly because we forgot the power of
> > 2 difference for arm/arm64.
> >
> > Queued for 4.14. Thanks.
> 
> I still do not see this patch in linux-next.

It won't make it into linux-next now, I'll push it as a fix for -rc2
(sorry, I've been away at Plumbers and didn't get the chance to send any
pull request). I'll push the patch out on fixes/core once I investigate
some unrelated failures.

-- 
Catalin

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

end of thread, other threads:[~2017-09-20 12:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-31  9:56 [PATCH] arm64: relax assembly code alignment from 16 byte to 4 byte Masahiro Yamada
2017-08-31 10:23 ` Lothar Waßmann
2017-08-31 10:38   ` Robin Murphy
2017-09-07 16:46 ` Catalin Marinas
2017-09-20 10:58   ` Masahiro Yamada
2017-09-20 12:19     ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).