[RFC PATCH 4/6] powerpc/64s: Make hash MMU code build configurable

Nicholas Piggin npiggin at gmail.com
Mon Aug 30 16:51:48 AEST 2021


Excerpts from Christophe Leroy's message of August 28, 2021 7:34 pm:
> 
> 
> Le 27/08/2021 à 18:34, Nicholas Piggin a écrit :
>> Introduce a new option CONFIG_PPC_64S_HASH_MMU which allows the 64s hash
>> MMU code to be compiled out if radix is selected and the minimum
>> supported CPU type is POWER9 or higher, and KVM is not selected.
>> 
>> This saves 128kB kernel image size (90kB text) on powernv_defconfig
>> minus KVM, 350kB on pseries_defconfig minus KVM, 40kB on a tiny config.
>> 
>> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
>> ---
> 
> ...
> 
>> @@ -324,6 +330,7 @@ static inline void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
>>   }
>>   #endif /* !CONFIG_DEBUG_VM */
>>   
>> +#if defined(CONFIG_PPC_RADIX_MMU) && defined(CONFIG_PPC_64S_HASH_MMU)
>>   static inline bool radix_enabled(void)
>>   {
>>   	return mmu_has_feature(MMU_FTR_TYPE_RADIX);
>> @@ -333,6 +340,27 @@ static inline bool early_radix_enabled(void)
>>   {
>>   	return early_mmu_has_feature(MMU_FTR_TYPE_RADIX);
>>   }
>> +#elif defined(CONFIG_PPC_64S_HASH_MMU)
>> +static inline bool radix_enabled(void)
>> +{
>> +	return false;
>> +}
>> +
>> +static inline bool early_radix_enabled(void)
>> +{
>> +	return false;
>> +}
>> +#else
>> +static inline bool radix_enabled(void)
>> +{
>> +	return true;
>> +}
>> +
>> +static inline bool early_radix_enabled(void)
>> +{
>> +	return true;
>> +}
>> +#endif
> 
> You don't need something that complex. You don't need to change that at all indeed, just have to 
> ensure that when CONFIG_PPC_64S_HASH_MMU is not selected you have MMU_FTR_TYPE_RADIX included in 
> MMU_FTRS_ALWAYS and voila.

Yeah I had that as a later patch that fixes up the MMU ftrs for 64s 
which does that, I think was required before some of your patches were 
upstreamed.

But looks like it is now trivial so I should just pull that in here.

Thanks,
Nick


More information about the Linuxppc-dev mailing list