[PATCH v3 16/18] powerpc/64s: Move hash MMU support code under CONFIG_PPC_64S_HASH_MMU

Christophe Leroy christophe.leroy at csgroup.eu
Fri Oct 22 20:39:35 AEDT 2021



Le 22/10/2021 à 11:34, Nicholas Piggin a écrit :
> Excerpts from Christophe Leroy's message of October 22, 2021 5:18 pm:
>>
>>
>> Le 22/10/2021 à 00:30, Nicholas Piggin a écrit :

>>> diff --git a/arch/powerpc/mm/book3s64/pgtable.c b/arch/powerpc/mm/book3s64/pgtable.c
>>> index 7d556b5513e4..57d2d797c4f6 100644
>>> --- a/arch/powerpc/mm/book3s64/pgtable.c
>>> +++ b/arch/powerpc/mm/book3s64/pgtable.c
>>> @@ -535,7 +535,7 @@ static int __init pgtable_debugfs_setup(void)
>>>    }
>>>    arch_initcall(pgtable_debugfs_setup);
>>>    
>>> -#ifdef CONFIG_ZONE_DEVICE
>>> +#if defined(CONFIG_ZONE_DEVICE) && defined(ARCH_HAS_MEMREMAP_COMPAT_ALIGN)
>>
>> Patch 12 does
>>
>> 	select ARCH_HAS_MEMREMAP_COMPAT_ALIGN	if PPC_BOOK3S_64
> 
> Ah, I meant to change that to PPC_64S_HASH_MMU.

You did it later yes.

What I meant is that as you are in book3s64/pgtable.c, you are sure that 
ARCH_HAS_MEMREMAP_COMPAT_ALIGN is selected so you don't need to check.

> 
>>
>> So this change is not needed
>>
>>>    /*
>>>     * Override the generic version in mm/memremap.c.
>>>     *
>>
>>> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
>>> index dd8241c009e5..30f764476c30 100644
>>> --- a/arch/powerpc/xmon/xmon.c
>>> +++ b/arch/powerpc/xmon/xmon.c
>>> @@ -1160,9 +1160,11 @@ cmds(struct pt_regs *excp)
>>>    			show_tasks();
>>>    			break;
>>>    #ifdef CONFIG_PPC_BOOK3S
>>> +#if defined(CONFIG_PPC32) || defined(CONFIG_PPC_64S_HASH_MMU)
>>
>> I think you'll get a build failure here.
>>
>> dump_segments() is defined only with CONFIG_PPC_BOOK3S_64 and
>> CONFIG_PPC_BOOK3S_32, see
>>
>> https://elixir.bootlin.com/linux/v5.15-rc5/source/arch/powerpc/xmon/xmon.c#L3745
>>
>> and
>>
>> https://elixir.bootlin.com/linux/v5.15-rc5/source/arch/powerpc/xmon/xmon.c#L3784
> 
> AFAIKS it is okay because it still has ifdef BOOK3S?
> 

Ah, I missed it.

But why keep a double ifdef ? instead of just :

	#if defined(CONFIG_PPC_BOOK3S_32) || defined(CONFIG_PPC_64S_HASH_MMU)


More information about the Linuxppc-dev mailing list