Thread (13 messages) flat view 13 messages, 4 authors, 2021-08-02

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

From: LEROY Christophe <hidden>
Date: 2021-08-02 11:43:56


Le 20/07/2021 à 13:27, Will Deacon a écrit :
On Mon, Jul 19, 2021 at 06:58:43PM +0200, Christophe Leroy wrote:
quoted
Ard Biesheuvel [off-list ref] a écrit :
quoted
On Mon, 19 Jul 2021 at 17:45, Christophe Leroy
[off-list ref] wrote:
quoted
Ard Biesheuvel [off-list ref] a écrit :
quoted
On Mon, 19 Jul 2021 at 15:58, Ard Biesheuvel [off-list ref] wrote:
quoted
On Mon, 19 Jul 2021 at 12:49, Will Deacon [off-list ref] wrote:
quoted
For 4k pages with 3 levels of walk, we want to be able to use
1GB mappings
quoted
quoted
quoted
at level 1 (pgd), 2MB mappings at level 2 (pmd) as well as the usual 4k
page mappings at level 3 (pte).
Yes, we appear to use PUDs for 4k pages kernel regardless of whether
they are folded into PGDs to refer to level 1/1GB block mappings.
And that's probably the source of the misunderstanding, because a 3
level architecture is supposed to only have pgd, pmd and pud.
Is this requirement documented somewhere? Having folded PUDs does not
necessarily mean that PUDs don't exist, but simply that PUDs and PGDs
are the same.
If you look at linux/pgtable.h you can see that p4d_set_huge and
p4d_clear_huge are only for 5 level MMUs. Why shouldn't the same principle
apply to PUD and PMD ?
Prior to your patch, you could make the opposite argument. Why are
p4x_{set_clear}_huge() guarded? Those were introduced after the others
as well.
Why are they guarded ? Probably because when they aren't, with ARM64 
defconfig we get:

   LD      vmlinux.o
   MODPOST vmlinux.symvers
   MODINFO modules.builtin.modinfo
   GEN     modules.builtin
   LD      .tmp_vmlinux.kallsyms1
aarch64-linux-gnu-ld: Unexpected GOT/PLT entries detected!
aarch64-linux-gnu-ld: Unexpected run-time procedure linkages detected!
aarch64-linux-gnu-ld: mm/vmalloc.o: in function `vunmap_p4d_range':
/home/chleroy/linux-powerpc/mm/vmalloc.c:385: undefined reference to 
`p4d_clear_huge'
aarch64-linux-gnu-ld: /home/chleroy/linux-powerpc/mm/vmalloc.c:385: 
undefined reference to `p4d_clear_huge'
make: *** [Makefile:1177: vmlinux] Error 1


Christophe

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help