mte.h 806 字节
Newer Older
1 2 3 4 5 6 7 8 9
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2020 ARM Ltd.
 */
#ifndef __ASM_MTE_H
#define __ASM_MTE_H

#ifndef __ASSEMBLY__

10 11 12 13 14 15
#include <linux/page-flags.h>

#include <asm/pgtable-types.h>

void mte_clear_page_tags(void *addr);

16 17
#ifdef CONFIG_ARM64_MTE

18 19 20 21
/* track which pages have valid allocation tags */
#define PG_mte_tagged	PG_arch_2

void mte_sync_tags(pte_t *ptep, pte_t pte);
22
void mte_copy_page_tags(void *kto, const void *kfrom);
23 24 25 26
void flush_mte_state(void);

#else

27 28 29 30 31 32
/* unused if !CONFIG_ARM64_MTE, silence the compiler */
#define PG_mte_tagged	0

static inline void mte_sync_tags(pte_t *ptep, pte_t pte)
{
}
33 34 35
static inline void mte_copy_page_tags(void *kto, const void *kfrom)
{
}
36 37 38 39 40 41 42 43
static inline void flush_mte_state(void)
{
}

#endif

#endif /* __ASSEMBLY__ */
#endif /* __ASM_MTE_H  */