aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/mman.h
diff options
context:
space:
mode:
authorYang Shi <[email protected]>2024-10-01 15:52:19 -0700
committerCatalin Marinas <[email protected]>2024-10-16 14:50:47 +0100
commit25c17c4b55def92a01e3eecc9c775a6ee25ca20f (patch)
tree2ce5cdf56b30e77683c9ffe80402930e14e1e413 /arch/arm64/include/asm/mman.h
parent9852d85ec9d492ebef56dc5f229416c925758edc (diff)
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 <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Signed-off-by: Yang Shi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
Diffstat (limited to 'arch/arm64/include/asm/mman.h')
-rw-r--r--arch/arm64/include/asm/mman.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/mman.h b/arch/arm64/include/asm/mman.h
index 9e39217b4afb..65bc2b07f666 100644
--- a/arch/arm64/include/asm/mman.h
+++ b/arch/arm64/include/asm/mman.h
@@ -38,7 +38,8 @@ static inline unsigned long arch_calc_vm_flag_bits(unsigned long flags)
* backed by tags-capable memory. The vm_flags may be overridden by a
* filesystem supporting MTE (RAM-based).
*/
- if (system_supports_mte() && (flags & MAP_ANONYMOUS))
+ if (system_supports_mte() &&
+ (flags & (MAP_ANONYMOUS | MAP_HUGETLB)))
return VM_MTE_ALLOWED;
return 0;