[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <878rn4vpvy.fsf@mpe.ellerman.id.au>
Date: Wed, 31 Aug 2022 17:22:25 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Nicholas Piggin <npiggin@...il.com>,
Sathvika Vasireddy <sv@...ux.ibm.com>,
linuxppc-dev@...ts.ozlabs.org
Cc: jpoimboe@...hat.com, peterz@...radead.org,
linux-kernel@...r.kernel.org, aik@...abs.ru, mingo@...hat.com,
christophe.leroy@...roup.eu, rostedt@...dmis.org, mbenes@...e.cz,
chenzhongjin@...wei.com, naveen.n.rao@...ux.vnet.ibm.com
Subject: Re: [PATCH v2 02/16] powerpc: override __ALIGN() and __ALIGN_STR()
macros
"Nicholas Piggin" <npiggin@...il.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
Powered by blists - more mailing lists