[PATCH v2 1/2] powerpc: Add Power11 architected and raw mode

Michael Ellerman mpe at ellerman.id.au
Wed Feb 7 12:54:45 AEDT 2024


Madhavan Srinivasan <maddy at linux.ibm.com> writes:
> On 2/5/24 2:13 PM, Aneesh Kumar K.V wrote:
>> Madhavan Srinivasan <maddy at linux.ibm.com> writes:
>>
>>> reg.h is updated with Power11 pvr. pvr_mask value of 0x0F000007
>>> means we are arch v3.1 compliant.
...
>>> diff --git a/arch/powerpc/kernel/cpu_setup_power.c b/arch/powerpc/kernel/cpu_setup_power.c
>>> index 98bd4e6c1770..8c24fc67d90f 100644
>>> --- a/arch/powerpc/kernel/cpu_setup_power.c
>>> +++ b/arch/powerpc/kernel/cpu_setup_power.c
>>> @@ -286,3 +286,13 @@ void __restore_cpu_power10(void)
>>>   	init_HFSCR();
>>>   	init_PMU_HV();
>>>   }
>>> +
>>> +void __setup_cpu_power11(unsigned long offset, struct cpu_spec *t)
>>> +{
>>> +	return __setup_cpu_power10(offset, t);
>>> +}
>>> +
>>> +void __restore_cpu_power11(void)
>>> +{
>>> +	return __restore_cpu_power10();
>>> +}
>>>
>> Do we need to duplicate these functions if they don't add anything
>> extra?
>
> What will be the preference in case of macros? Should we re-use
> power10 macros in the table instead of defining new macros.

I guess I would say yes to defining new macros, eg.

+#define CPU_FTRS_POWER11	CPU_FTRS_POWER10

That is good to have because someone will eventually grep for
CPU_FTRS_POWER11 and expect to find it.

On the other hand global functions that do nothing but call the power10
version are not the best, because they will (slightly) bloat the binary
for no real gain.

cheers


More information about the Linuxppc-dev mailing list