Andrey Konovalov
01d92c7f35
kasan, vmalloc, arm64: mark vmalloc mappings as pgprot_tagged
...
HW_TAGS KASAN relies on ARM Memory Tagging Extension (MTE). With MTE, a
memory region must be mapped as MT_NORMAL_TAGGED to allow setting memory
tags via MTE-specific instructions.
Add proper protection bits to vmalloc() allocations. These allocations
are always backed by page_alloc pages, so the tags will actually be
getting set on the corresponding physical memory.
Link: https://lkml.kernel.org/r/983fc33542db2f6b1e77b34ca23448d4640bbb9e.1643047180.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <[email protected] >
Co-developed-by: Vincenzo Frascino <[email protected] >
Signed-off-by: Vincenzo Frascino <[email protected] >
Acked-by: Marco Elver <[email protected] >
Cc: Alexander Potapenko <[email protected] >
Cc: Andrey Ryabinin <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Dmitry Vyukov <[email protected] >
Cc: Evgenii Stepanov <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Peter Collingbourne <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
Signed-off-by: Linus Torvalds <[email protected] >
2022-03-24 19:06:47 -07:00
Anshuman Khandual
f8b46c4b51
arm64/mm: Add pud_sect_supported()
...
Section mapping at PUD level is supported only on 4K pages and currently it
gets verified with explicit #ifdef or IS_ENABLED() constructs. This adds a
new helper pud_sect_supported() for this purpose, which particularly cleans
up the HugeTLB code path. It updates relevant switch statements with checks
for __PAGETABLE_PMD_FOLDED in order to avoid build failures caused with two
identical switch case values in those code blocks.
Cc: Catalin Marinas <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: [email protected]
Cc: [email protected]
Suggested-by: Mark Rutland <[email protected] >
Signed-off-by: Anshuman Khandual <[email protected] >
Reviewed-by: Catalin Marinas <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected] >
2021-09-29 16:54:33 +01:00
Nicholas Piggin
6f680e70b6
mm/vmalloc: provide fallback arch huge vmap support functions
...
If an architecture doesn't support a particular page table level as a huge
vmap page size then allow it to skip defining the support query function.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Nicholas Piggin <[email protected] >
Suggested-by: Christoph Hellwig <[email protected] >
Cc: Borislav Petkov <[email protected] >
Cc: Catalin Marinas <[email protected] >
Cc: Ding Tianhong <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Miaohe Lin <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Russell King <[email protected] >
Cc: Thomas Gleixner <[email protected] >
Cc: Uladzislau Rezki (Sony) <[email protected] >
Cc: Will Deacon <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
Signed-off-by: Linus Torvalds <[email protected] >
2021-04-30 11:20:40 -07:00
Nicholas Piggin
168a633314
arm64: inline huge vmap supported functions
...
This allows unsupported levels to be constant folded away, and so
p4d_free_pud_page can be removed because it's no longer linked to.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Nicholas Piggin <[email protected] >
Acked-by: Catalin Marinas <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: Borislav Petkov <[email protected] >
Cc: Christoph Hellwig <[email protected] >
Cc: Ding Tianhong <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Miaohe Lin <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Russell King <[email protected] >
Cc: Thomas Gleixner <[email protected] >
Cc: Uladzislau Rezki (Sony) <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
Signed-off-by: Linus Torvalds <[email protected] >
2021-04-30 11:20:40 -07:00
Nicholas Piggin
bbc180a5ad
mm: HUGE_VMAP arch support cleanup
...
This changes the awkward approach where architectures provide init
functions to determine which levels they can provide large mappings for,
to one where the arch is queried for each call.
This removes code and indirection, and allows constant-folding of dead
code for unsupported levels.
This also adds a prot argument to the arch query. This is unused
currently but could help with some architectures (e.g., some powerpc
processors can't map uncacheable memory with large pages).
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Nicholas Piggin <[email protected] >
Reviewed-by: Ding Tianhong <[email protected] >
Acked-by: Catalin Marinas <[email protected] > [arm64]
Cc: Will Deacon <[email protected] >
Cc: Thomas Gleixner <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Borislav Petkov <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Christoph Hellwig <[email protected] >
Cc: Miaohe Lin <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Russell King <[email protected] >
Cc: Uladzislau Rezki (Sony) <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
Signed-off-by: Linus Torvalds <[email protected] >
2021-04-30 11:20:40 -07:00
Ingo Molnar
1f059dfdf5
mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h>
...
In the x86 MM code we'd like to untangle various types of historic
header dependency spaghetti, but for this we'd need to pass to
the generic vmalloc code various vmalloc related defines that
customarily come via the <asm/page.h> low level arch header.
Signed-off-by: Ingo Molnar <[email protected] >
2019-12-10 10:12:55 +01:00