diff options
author | Sami Tolvanen <[email protected]> | 2021-04-08 11:28:28 -0700 |
---|---|---|
committer | Kees Cook <[email protected]> | 2021-04-08 16:04:21 -0700 |
commit | 5caf968262df0ec7a3377fb67d4a6bfa979cb028 (patch) | |
tree | da8b0f692f2d79604ef9c9731e1b1ed0fe640251 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | ff301ceb5299551c3650d0e07ba879b766da4cc0 (diff) |
mm: add generic function_nocfi macro
With CONFIG_CFI_CLANG, the compiler replaces function addresses
in instrumented C code with jump table addresses. This means that
__pa_symbol(function) returns the physical address of the jump table
entry instead of the actual function, which may not work as the jump
table code will immediately jump to a virtual address that may not be
mapped.
To avoid this address space confusion, this change adds a generic
definition for function_nocfi(), which architectures that support CFI
can override. The typical implementation of would use inline assembly
to take the function address, which avoids compiler instrumentation.
Signed-off-by: Sami Tolvanen <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Acked-by: Mark Rutland <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions