lkml.org 
[lkml]   [2022]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 02/16] powerpc: override __ALIGN() and __ALIGN_STR() macros
Date
"Nicholas Piggin" <npiggin@gmail.com> writes:
> On Mon Aug 29, 2022 at 3:52 PM AEST, Sathvika Vasireddy wrote:
>> Powerpc instructions must be word-aligned. Currently,
>> there is an alignment of 16 bytes (by default), and it is
>> much more than what is required for powerpc (4 bytes).
>>
>> The default expansion of __ALIGN() macro is:
>> #define __ALIGN .align 4,0x90
>>
>> Since Powerpc Linux does not require a 16 byte alignment,
>> override __ALIGN() and __ALIGN_STR() macros to use required
>> 4 byte alignment.
>
> Alignment can be desirable beyond the minimum requirement, for
> example 16 byte alignment for functions could be helpful for
> instruction fetch. So it should be explained why possible
> benefits of the larger alignment are not worth it.

Using ".align 2" matches what our existing _GLOBAL macro does. So this
change basically just propagates that existing alignment into this new
macro, which is used for similar purposes.

So if we want to increase the alignment we should do that explicitly,
and update _GLOBAL at the same time.

The change log should probably just say ~= "use the same alignment as
the existing _GLOBAL macro".

What's more important, but not mentioned in the change log, is that we
don't want to pad with 0x90, because repeated 0x90s are not a nop or
trap on powerpc.

cheers

\
 
 \ /
  Last update: 2022-08-31 09:23    [W:0.093 / U:1.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site