aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Abbott <labbott@redhat.com>2017-01-10 13:35:42 -0800
committerAlex Shi <alex.shi@linaro.org>2018-03-22 16:43:44 +0800
commitc73cf78fef4f53aedf1499f64483a859a0d5dde3 (patch)
treeea58d9766b47217fc1be0f4c611416434fa8d971
parent06eb38abaf83b589a5e66ca4749eee16fa0d9854 (diff)
mm: Introduce lm_alias
commit 568c5fe5a54 upstream. Certain architectures may have the kernel image mapped separately to alias the linear map. Introduce a macro lm_alias to translate a kernel image symbol into its linear alias. This is used in part with work to add CONFIG_DEBUG_VIRTUAL support for arm64. Reviewed-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--include/linux/mm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5c2bf9096b7a..7634d8a7006f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -59,6 +59,14 @@ extern int sysctl_legacy_va_layout;
#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))
#endif
+#ifndef page_to_virt
+#define page_to_virt(x) __va(PFN_PHYS(page_to_pfn(x)))
+#endif
+
+#ifndef lm_alias
+#define lm_alias(x) __va(__pa_symbol(x))
+#endif
+
/*
* To prevent common memory management code establishing
* a zero page mapping on a read fault.