mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
ANDROID: mm: add generic __va_function and __pa_function
We use non-canonical CFI jump tables with CONFIG_CFI_CLANG, which means the compiler replaces function address references with the address of the function's CFI jump table entry. This results in __pa_symbol(function), for example, returning the physical address of the jump table entry, which can lead to address space confusion since the jump table itself points to a virtual address. This change adds generic definitions for __pa/va_function, which architectures that support CFI can override. Bug: 166220312 Change-Id: If4a162de7854547d8437bf59be03eb6d16220832 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Git-commit: d509371db88a829fa13fbb066423b20fc4698845 Git-repo: https://android.googlesource.com/kernel/common/ Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
This commit is contained in:
parent
653a9c02c2
commit
2c0cdded94
1 changed files with 8 additions and 0 deletions
|
|
@ -116,6 +116,14 @@ extern int mmap_rnd_compat_bits __read_mostly;
|
|||
#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))
|
||||
#endif
|
||||
|
||||
#ifndef __va_function
|
||||
#define __va_function(x) (x)
|
||||
#endif
|
||||
|
||||
#ifndef __pa_function
|
||||
#define __pa_function(x) __pa_symbol(x)
|
||||
#endif
|
||||
|
||||
#ifndef page_to_virt
|
||||
#define page_to_virt(x) __va(PFN_PHYS(page_to_pfn(x)))
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue