[PATCH 3/5] mm: add vaddr param to pmd_populate_kernel

2024-04-16 Thread Maxwell Bland
is not readily accessible, i.e. dynamic vmalloc calls on arm64. To achieve this goal, it modifies every call and implementation of the pmd_populate_kernel function across architectures, ensuring uniform adoption across all kernel deployments. Signed-off-by: Maxwell Bland --- Hi all, Thank you for taking

Re: [PATCH 5/5] ptdump: add state parameter for non-leaf callback

2024-04-16 Thread Maxwell Bland
> On Tuesday, April 16, 2024 3:11 PM, Andrew Morton wrote: > On Mon, 15 Apr 2024 14:51:32 -0500 Maxwell Bland > wrote: > > > arch/arm64/mm/ptdump.c | 6 -- > > arch/powerpc/mm/ptdump/ptdump.c | 2 ++ > > arch/riscv/mm/ptdump.c

[PATCH 5/5 RESEND] ptdump: add state parameter for non-leaf callback

2024-04-16 Thread Maxwell Bland
ptdump can now note non-leaf descriptor entries, a useful addition for debugging table descriptor permissions when working on related code Signed-off-by: Maxwell Bland --- arch/arm64/mm/ptdump.c | 6 -- arch/powerpc/mm/ptdump/ptdump.c | 2 ++ arch/riscv/mm/ptdump.c | 6

[PATCH 0/5 RESEND] mm: code and data partitioning improvements

2024-04-16 Thread Maxwell Bland
an be more easily noted in debug output by setting a note_non_leaf bool in the ptdump state. Signed-off-by: Maxwell Bland --- Zero-eth, apologies for the triple mail of these patches. I am in the process of setting up a new SMTP/mail server for Motorola, but until then I've needed to script th

Re: [PATCH 0/4] arm64: mm: support dynamic vmalloc/pmd configuration

2024-02-21 Thread Maxwell Bland
> On Wednesday, February 21, 2024 at 1:32 AM, Christophe Leroy wrote: > > On powerpc (book3s/32) we have more or less the same although it is not > directly linked to PMDs: the virtual 4G address space is split in > segments of 256M. On each segment there's a bit called NX to forbit > execution.

Re: [PATCH 1/4] mm/vmalloc: allow arch-specific vmalloc_node overrides

2024-02-21 Thread Maxwell Bland
> On Wednesday, February 21, 2024 12:59 AM, Christophe Leroy wrote: > > In the code you add __weak for that. But you also add the flags to the > parameters and I can't understand why when reading the above description. This change was made to allow most kernel interfaces use vmalloc_node and

RE: [External] Re: [PATCH 2/4] mm: pgalloc: support address-conditional pmd allocation

2024-02-21 Thread Maxwell Bland
> On February 21, 2024 3:27 AM David Hildenbrand wrote > On 21.02.24 08:13, Christophe Leroy wrote: > > Le 20/02/2024 à 21:32, Maxwell Bland a écrit : > >> > >> While other descriptors (e.g. pud) allow allocations conditional on > >> which virtual address i

RE: [External] Re: [PATCH 0/4] arm64: mm: support dynamic vmalloc/pmd configuration

2024-02-21 Thread Maxwell Bland
> From: Conor Dooley > FYI: > > > mm/vmalloc: allow arch-specific vmalloc_node overrides > > mm: pgalloc: support address-conditional pmd allocation > > With these two arch/riscv/configs/* are broken with calls to undeclared > functions. Will fix, thanks! I will also figure out how to make

[PATCH 4/4] arm64: dynamic enforcement of pmd-level PXNTable

2024-02-20 Thread Maxwell Bland
outside of a known code region, and if so, marks the pmd as PXNTable, protecting over 100 last-level page tables from manipulation in the process. Signed-off-by: Maxwell Bland --- arch/arm64/include/asm/pgalloc.h | 11 +-- arch/arm64/include/asm/vmalloc.h | 5 + arch/arm64/mm/trans_pgd.c

[PATCH 1/4] mm/vmalloc: allow arch-specific vmalloc_node overrides

2024-02-20 Thread Maxwell Bland
__vmalloc_node_range for more specialized cases, such as kasan's shadow memory. Signed-off-by: Maxwell Bland --- arch/arm/kernel/irq.c | 2 +- arch/arm64/include/asm/vmap_stack.h | 2 +- arch/arm64/kernel/efi.c | 2 +- arch/powerpc/kernel/irq.c | 2 +- arch

[PATCH 2/4] mm: pgalloc: support address-conditional pmd allocation

2024-02-20 Thread Maxwell Bland
of allocation between PMD and other table descriptor types and (2) the capability of address-specific PMD allocation. Signed-off-by: Maxwell Bland --- include/asm-generic/pgalloc.h | 18 ++ include/linux/mm.h| 4 ++-- mm/hugetlb_vmemmap.c | 4 ++-- mm/kasan/init.c

[PATCH 0/4] arm64: mm: support dynamic vmalloc/pmd configuration

2024-02-20 Thread Maxwell Bland
pmd_populate function is modified to set the PXNTable bit appropriately. Signed-off-by: Maxwell Bland --- After Mark Rutland's feedback last week on my more minimal patch, see I adopted a more sweeping and more correct overhaul of ARM's virtual memory allocation infrastructure to support

[PATCH 3/4] arm64: separate code and data virtual memory allocation

2024-02-20 Thread Maxwell Bland
-level tracking. Signed-off-by: Maxwell Bland --- arch/arm64/include/asm/vmalloc.h | 3 ++ arch/arm64/kernel/module.c | 7 arch/arm64/kernel/probes/kprobes.c | 2 +- arch/arm64/mm/Makefile | 3 +- arch/arm64/mm/vmalloc.c| 57