[PATCH v1 1/3] powerpc/code-patching: Test patch_instructions() during boot

Michael Ellerman mpe at ellerman.id.au
Mon Mar 18 13:25:56 AEDT 2024


Benjamin Gray <bgray at linux.ibm.com> writes:
> On Mon, 2024-03-18 at 08:38 +1100, Benjamin Gray wrote:
>> On Fri, 2024-03-15 at 07:14 +0000, Christophe Leroy wrote:
>> > Le 15/03/2024 à 03:57, Benjamin Gray a écrit :
>> > > diff --git a/arch/powerpc/lib/test-code-patching.c
>> > > b/arch/powerpc/lib/test-code-patching.c
>> > > index c44823292f73..35a3756272df 100644
>> > > --- a/arch/powerpc/lib/test-code-patching.c
>> > > +++ b/arch/powerpc/lib/test-code-patching.c
>> > > @@ -347,6 +347,97 @@ static void __init
>> > > test_prefixed_patching(void)
>> > >   	check(!memcmp(iptr, expected, sizeof(expected)));
>> > >   }
>> > >   
>> > > +static void __init test_multi_instruction_patching(void)
>> > > +{
>> > > +	u32 code[256];
>> > 
>> > Build failure:
>> > 
>> >    CC      arch/powerpc/lib/test-code-patching.o
>> > arch/powerpc/lib/test-code-patching.c: In function 
>> > 'test_multi_instruction_patching':
>> > arch/powerpc/lib/test-code-patching.c:439:1: error: the frame size
>> > of
>> > 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
>> >    439 | }
>> >        | ^
>> > cc1: all warnings being treated as errors
>> > make[4]: *** [scripts/Makefile.build:243: 
>> > arch/powerpc/lib/test-code-patching.o] Error 1
>> > 
>> > 
>> > I have to avoid big arrays on the stack.
>> 
>> All good, I can do that.
>> 
>> I do run my patches through a couple of 32-bit configs, but I didn't
>> see this error. Is this a standard config I should be testing with?
>
> Specifically pmac32_defconfig and ppc44x_defconfig

Both of those have CONFIG_FRAME_WARN=1024, so should have caught this.

But neither have CONFIG_CODE_PATCHING_SELFTEST=y, so I suspect that's
why you didn't see it.

I recommend ppc32_allmodconfig.

cheers


More information about the Linuxppc-dev mailing list