Vincenzo Frascino | 637ec83 | 2019-09-16 11:51:17 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (C) 2020 ARM Ltd. |
| 4 | */ |
| 5 | #ifndef __ASM_MTE_H |
| 6 | #define __ASM_MTE_H |
| 7 | |
| 8 | #ifndef __ASSEMBLY__ |
| 9 | |
Catalin Marinas | 34bfeea | 2020-05-04 14:42:36 +0100 | [diff] [blame^] | 10 | #include <linux/page-flags.h> |
| 11 | |
| 12 | #include <asm/pgtable-types.h> |
| 13 | |
| 14 | void mte_clear_page_tags(void *addr); |
| 15 | |
Vincenzo Frascino | 637ec83 | 2019-09-16 11:51:17 +0100 | [diff] [blame] | 16 | #ifdef CONFIG_ARM64_MTE |
| 17 | |
Catalin Marinas | 34bfeea | 2020-05-04 14:42:36 +0100 | [diff] [blame^] | 18 | /* track which pages have valid allocation tags */ |
| 19 | #define PG_mte_tagged PG_arch_2 |
| 20 | |
| 21 | void mte_sync_tags(pte_t *ptep, pte_t pte); |
Vincenzo Frascino | 637ec83 | 2019-09-16 11:51:17 +0100 | [diff] [blame] | 22 | void flush_mte_state(void); |
| 23 | |
| 24 | #else |
| 25 | |
Catalin Marinas | 34bfeea | 2020-05-04 14:42:36 +0100 | [diff] [blame^] | 26 | /* unused if !CONFIG_ARM64_MTE, silence the compiler */ |
| 27 | #define PG_mte_tagged 0 |
| 28 | |
| 29 | static inline void mte_sync_tags(pte_t *ptep, pte_t pte) |
| 30 | { |
| 31 | } |
Vincenzo Frascino | 637ec83 | 2019-09-16 11:51:17 +0100 | [diff] [blame] | 32 | static inline void flush_mte_state(void) |
| 33 | { |
| 34 | } |
| 35 | |
| 36 | #endif |
| 37 | |
| 38 | #endif /* __ASSEMBLY__ */ |
| 39 | #endif /* __ASM_MTE_H */ |