ANDROID: KVM: arm64: Add Ftrace patching for pKVM hyp
Ftrace for the pKVM hypervisor needs 3 instructions:
1. mov x9 LR # Setup in the kernel
2. mov x10 offset_idx # Setup in the hypervisor
3. bl trampoline # Enablement in the hypervisor
The first instruction allows saving the parent address of the traced
function. The second is to know what conversion hyp-to-kern VA apply
(useful for modules). The last one is the actual jump to the ftrace
trampoline.
Functions are patched according to the __patchable_function_entries ELF
section which store the list of traceable functions. In this list, the
first bit can be set to indicate ftrace must be enabled for that
function. At the moment all functions are enabled by default.
Bug: 357781595
Change-Id: Ia946b6d9c3d739fd19ff5f496f99fbc611972078
Signed-off-by:
Vincent Donnefort <vdonnefort@google.com>
Loading
Please sign in to comment