Le 14/05/2025 à 04:06, Paul Mackerras a écrit :
> On Sun, May 11, 2025 at 06:32:25PM +0530, Madhavan Srinivasan wrote:
>>
>> Can you try with this patch, I am testing this in my setup.
>>
>> Maddy
>>
>>
>> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
>> index a0e8b998c9b5..2ce7a4f2b2fb 100644
>> --- a/arch/powerpc/kernel/irq.c
>> +++ b/arch/powerpc/kernel/irq.c
>> @@ -276,7 +276,11 @@ static __always_inline void call_do_irq(struct pt_regs 
>> *regs, void *sp)
>>                     [callee] "i" (__do_irq)
>>                   : // Clobbers
>>                     "lr", "xer", "ctr", "memory", "cr0", "cr1", "cr5", "cr6",
>> +#if __GNUC__ >= 15
>> +                  "cr7", "r0", "r2", "r4", "r5", "r6", "r7", "r8", "r9", 
>> "r10",
>> +#else
>>                     "cr7", "r0", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
>> +#endif
>>                     "r11", "r12"
>>          );
>>   }
> 
> That works as long as I have CONFIG_PPC_KERNEL_PCREL enabled, but with
> it disabled, it fails to compile.  With PCREL disabled, the kernel
> runs just fine without the r2 clobber.  I guess it needs to be:
> 
> #if __GNUC__ >= 15 && IS_ENABLED(CONFIG_PPC_KERNEL_PCREL)
> 
> or something like that.
> 

I have now done some tests with both gcc 14 and gcc 15 and they behave 
the same, so at the end I think all we need is:

#ifdef CONFIG_PPC_KERNEL_PCREL

without any mention to GCC version.

Reply via email to