[PATCH] Revert "mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge"

Christophe Leroy christophe.leroy at csgroup.eu
Mon Jul 19 08:06:15 PDT 2021


Will Deacon <will at kernel.org> a écrit :

> On Sat, Jul 17, 2021 at 06:31:08PM +0200, Christophe Leroy wrote:
>> Jonathan Marek <jonathan at marek.ca> a écrit :
>>
>> > c742199a breaks arm64 for some configs because it stubs out  
>> functions which
>> > should not have been stubbed out.
>> >
>> > With 4K pages and ARM64_VA_BITS_39=y, the kernel crashes early on unmapped
>> > 1G pages in the linear map caused by pud_set_huge() in alloc_init_pud()
>> > being stubbed out. Reverting c742199a fixes the crash.
>>
>> This patch is there for a reason. Reverting it will break some other config.
>
> Which config? Not reverting it breaks arm64.

Build will fail at least on powerpc 8xx without the stubs in linux/pgtable.h
That's the reason why I say that we need to find a common fix that  
works for both arm64 and powerpc

>
>> The fix needs to allow it work with all platforms.
>
> Hmm, there was already a report that selftests were failing with this
> change:
>
> https://lore.kernel.org/linux-arm-kernel/CAMuHMdXShORDox-xxaeUfDW3wx2PeggFSqhVSHVZNKCGK-y_vQ@mail.gmail.com/
>
> That was a week ago and doesn't seem to have progressed, so I'm inclined to
> revert this if it's not resolved this week as we usually use -rc3 as a base
> for queuing patches for the next release.

I have been on hollydays for 10 days and for another 2 weeks, with  
only my phone to play with. I pplan to look at it  first week of august.


>
>> I don't understand, why does arm64 needs these PUD helpers when it defines
>> __PAGETABLE_PUD_FOLDED ?
>
> Probably for the huge vmap code; see arch_vmap_pXd_supported(). That also
> lines up with the failing selftests afaict.
>
> For 4k pages with 3 levels of walk, we want to be able to use 1GB mappings
> at level 1 (pgd), 2MB mappings at level 2 (pmd) as well as the usual 4k
> page mappings at level 3 (pte).

The initial issue was a conflict between pud_clear_huge in arm64 and  
the generic stub I had introduced for configs having no PUD . We  
thought that it was a left over from config with 4 levels that was  
left unused for 3 levels config. It seems not. That's strange that the  
problem pops up only now, the change have been in the mm tree for one  
cycle.

Christophe

>
> Will





More information about the linux-arm-kernel mailing list