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. The same issue happens when passing function pointers to hypervisor code running at EL2. This change adds __va_function and __pa_function macros, which use inline assembly to take the actual function address instead, and changes the relevant code to use these macros. Bug: 145210207 Change-Id: Ie3079c10427bde705a2244cfb3cb5fb954e5e065 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2.6 KiB
2.6 KiB