diff options
author | Yang Shi <yang@os.amperecomputing.com> | 2024-10-01 15:52:19 -0700 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2024-10-16 14:50:47 +0100 |
commit | 25c17c4b55def92a01e3eecc9c775a6ee25ca20f (patch) | |
tree | 2ce5cdf56b30e77683c9ffe80402930e14e1e413 /arch/arm64/include/asm/hugetlb.h | |
parent | 9852d85ec9d492ebef56dc5f229416c925758edc (diff) | |
download | linux-25c17c4b55def92a01e3eecc9c775a6ee25ca20f.tar.gz linux-25c17c4b55def92a01e3eecc9c775a6ee25ca20f.tar.bz2 linux-25c17c4b55def92a01e3eecc9c775a6ee25ca20f.zip |
hugetlb: arm64: add mte support
Enable MTE support for hugetlb.
The MTE page flags will be set on the folio only. When copying
hugetlb folio (for example, CoW), the tags for all subpages will be copied
when copying the first subpage.
When freeing hugetlb folio, the MTE flags will be cleared.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Yang Shi <yang@os.amperecomputing.com>
Link: https://lore.kernel.org/r/20241001225220.271178-1-yang@os.amperecomputing.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/hugetlb.h')
-rw-r--r-- | arch/arm64/include/asm/hugetlb.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 293f880865e8..c6dff3e69539 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -11,6 +11,7 @@ #define __ASM_HUGETLB_H #include <asm/cacheflush.h> +#include <asm/mte.h> #include <asm/page.h> #ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION @@ -21,6 +22,13 @@ extern bool arch_hugetlb_migration_supported(struct hstate *h); static inline void arch_clear_hugetlb_flags(struct folio *folio) { clear_bit(PG_dcache_clean, &folio->flags); + +#ifdef CONFIG_ARM64_MTE + if (system_supports_mte()) { + clear_bit(PG_mte_tagged, &folio->flags); + clear_bit(PG_mte_lock, &folio->flags); + } +#endif } #define arch_clear_hugetlb_flags arch_clear_hugetlb_flags |