[PATCH v2 0/5] KVM: arm64: pkvm: Extend hypervisor entering tracing reasons
Vincent Donnefort
vdonnefort at google.com
Wed Nov 4 06:06:07 PST 2026
This series makes the hyp_enter event more detailed by adding a "from="
field and by using the ESR class when relevant. This is interesting for
example to know when the guest has exited for an HVC.
Speaking of HVCs, protected VMs issue an HVC to share memory with the
host. Without this memory sharing, it is impossible to get logs. So if
for any reason it fails, debugging is quite cumbersome. Add a specific
guest_hvc event that will give even more details than hyp_enter
provides.
Also, add a host_hvc event, so that the host gets similar coverage to a
protected VM.
Changelog:
v2:
* Add missing exception classes to kvm_arm_exception_class (Fuad)
* Split the HYP_REASON_PSCI -> HYP_REASON_ERET_HOST fix in
__kvm_host_psci_cpu_entry() into a separate patch.
* Add missing <asm/esr.h> (Fuad)
* Read ESR_EL2 only when hyp_enter is enabled (Fuad)
* Drop the handled field from guest_hvc and trace only
hypervisor-handled HVCs.
* Rename ret to x1 in host_hvc (Fuad) and val to x0 in guest_hvc.
* Log the SMCCC function ID in host_hvc instead of the host_hcall[]
index. (Fuad)
* remote_event_format_show() field alignment fixed
separately (https://lore.kernel.org/all/20261009132848.709379-1-vdonnefort@google.com/). (Fuad)
* Rebased on top of v7.4-rc1.
v1 (https://lore.kernel.org/all/20261009084529.462577-1-vdonnefort@google.com/)
Vincent Donnefort (5):
KVM: arm64: Add missing exception classes to kvm_arm_exception_class
KVM: arm64: Use HYP_REASON_ERET_HOST on trace_hyp_exit from
PSCI_CPU_ON
KVM: arm64: Add ESR class to the hyp_enter hyp event
KVM: arm64: Add guest_hvc hyp event
KVM: arm64: Add host_hvc hyp event
arch/arm64/include/asm/kvm_arm.h | 13 +++---
arch/arm64/include/asm/kvm_hypevents.h | 55 ++++++++++++++++++++------
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 9 ++---
arch/arm64/kvm/hyp/nvhe/pkvm.c | 12 +++++-
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 2 +-
arch/arm64/kvm/hyp/nvhe/switch.c | 6 ++-
arch/arm64/kvm/hyp_trace.c | 52 ++++++++++++++++++------
7 files changed, 111 insertions(+), 38 deletions(-)
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.56.0.455.g6c5a503b38-goog
More information about the linux-arm-kernel
mailing list