FROMGIT: arm64: mte: Conditionally compile mte_enable_kernel_*()
mte_enable_kernel_*() are not needed if KASAN_HW is disabled. Add ash defines around the functions to conditionally compile the functions. Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/20210315132019.33202-7-vincenzo.frascino@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Bug: 170327579 Bug: 172318110 (cherry picked from commit d8969752cc4e3294074ff0582de42d0e3c982eba git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/ for-next/mte-async-kernel-mode) Signed-off-by: Alexander Potapenko <glider@google.com> Change-Id: If6ce3c28e970efda838b5f0112c409953265d083
This commit is contained in:
committed by
Alexander Potapenko
parent
a2f1f07ff4
commit
c3ca7ea141
@@ -26,9 +26,11 @@ u64 gcr_kernel_excl __ro_after_init;
|
||||
|
||||
static bool report_fault_once = true;
|
||||
|
||||
#ifdef CONFIG_KASAN_HW_TAGS
|
||||
/* Whether the MTE asynchronous mode is enabled. */
|
||||
DEFINE_STATIC_KEY_FALSE(mte_async_mode);
|
||||
EXPORT_SYMBOL_GPL(mte_async_mode);
|
||||
#endif
|
||||
|
||||
static void mte_sync_page_tags(struct page *page, pte_t *ptep, bool check_swap)
|
||||
{
|
||||
@@ -120,6 +122,7 @@ static inline void __mte_enable_kernel(const char *mode, unsigned long tcf)
|
||||
pr_info_once("MTE: enabled in %s mode at EL1\n", mode);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_KASAN_HW_TAGS
|
||||
void mte_enable_kernel_sync(void)
|
||||
{
|
||||
/*
|
||||
@@ -147,6 +150,7 @@ void mte_enable_kernel_async(void)
|
||||
if (!system_uses_mte_async_mode())
|
||||
static_branch_enable(&mte_async_mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
void mte_set_report_once(bool state)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user