KVM: arm64: nvhe: Improve CFI failure reporting
Report (at EL1) the branch target that caused an nVHE hypervisor
CONFIG_CFI_CLANG failure (at EL2) and the type that was expected by
recording them during hyp_panic() and making them available through
per-CPU variable.
As handlers for CFI failures are expected to extract the target and type
from CPU registers (KCFI encodes the indices in the BRK instruction,
resulting in them being available through the ESR comment), hyp_panic()
must have access to the hypervisor CPU context so populate the GPRs of
the per-CPU kvm_hyp_ctxt before branching to the function from the
"invalid" EL2 vector handlers (although only doing so from the
synchrnous ones should suffice).
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
3 files changed