2019-09-16 10:51:17 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 ARM Ltd.
|
|
|
|
*/
|
|
|
|
#ifndef __ASM_MTE_H
|
|
|
|
#define __ASM_MTE_H
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
2020-05-04 13:42:36 +00:00
|
|
|
#include <linux/page-flags.h>
|
|
|
|
|
|
|
|
#include <asm/pgtable-types.h>
|
|
|
|
|
|
|
|
void mte_clear_page_tags(void *addr);
|
|
|
|
|
2019-09-16 10:51:17 +00:00
|
|
|
#ifdef CONFIG_ARM64_MTE
|
|
|
|
|
2020-05-04 13:42:36 +00:00
|
|
|
/* track which pages have valid allocation tags */
|
|
|
|
#define PG_mte_tagged PG_arch_2
|
|
|
|
|
|
|
|
void mte_sync_tags(pte_t *ptep, pte_t pte);
|
2019-08-06 10:37:53 +00:00
|
|
|
void mte_copy_page_tags(void *kto, const void *kfrom);
|
2019-09-16 10:51:17 +00:00
|
|
|
void flush_mte_state(void);
|
2019-11-27 10:30:15 +00:00
|
|
|
void mte_thread_switch(struct task_struct *next);
|
2020-04-17 17:29:35 +00:00
|
|
|
void mte_suspend_exit(void);
|
2019-11-27 10:30:15 +00:00
|
|
|
long set_mte_ctrl(unsigned long arg);
|
|
|
|
long get_mte_ctrl(void);
|
2019-09-16 10:51:17 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
2020-05-04 13:42:36 +00:00
|
|
|
/* 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)
|
|
|
|
{
|
|
|
|
}
|
2019-08-06 10:37:53 +00:00
|
|
|
static inline void mte_copy_page_tags(void *kto, const void *kfrom)
|
|
|
|
{
|
|
|
|
}
|
2019-09-16 10:51:17 +00:00
|
|
|
static inline void flush_mte_state(void)
|
|
|
|
{
|
|
|
|
}
|
2019-11-27 10:30:15 +00:00
|
|
|
static inline void mte_thread_switch(struct task_struct *next)
|
|
|
|
{
|
|
|
|
}
|
2020-04-17 17:29:35 +00:00
|
|
|
static inline void mte_suspend_exit(void)
|
|
|
|
{
|
|
|
|
}
|
2019-11-27 10:30:15 +00:00
|
|
|
static inline long set_mte_ctrl(unsigned long arg)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline long get_mte_ctrl(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2019-09-16 10:51:17 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
#endif /* __ASM_MTE_H */
|