Skip to content

KVM: arm64: pkvm: Extend hypervisor entering tracing reasons

Vincent Donnefort kvmarm linux-arm-kernel 2 versions – Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 2 repliesApplied
  2. v13 patches 8 repliesSuperseded

Changes in v2 from the cover letter

* 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

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/5KVM: arm64: Add missing exception classes to kvm_arm_exception_classarch/arm64/include/asm/kvm_arm.h+7 -60 replies
2/5KVM: arm64: Use HYP_REASON_ERET_HOST on trace_hyp_exit from PSCI_CPU_ONarch/arm64/kvm/hyp/nvhe/psci-relay.c+1 -10 replies
3/5KVM: arm64: Add ESR class to the hyp_enter hyp eventarch/arm64/include/asm/kvm_hypevents.h arch/arm64/kvm/hyp/nvhe/hyp-main.c arch/arm64/kvm/hyp/nvhe/psci-relay.c +2 more+66 -300 replies
4/5KVM: arm64: Add guest_hvc hyp eventarch/arm64/include/asm/kvm_hypevents.h arch/arm64/kvm/hyp/nvhe/pkvm.c+23 -20 replies
5/5KVM: arm64: Add host_hvc hyp eventarch/arm64/include/asm/kvm_hypevents.h arch/arm64/kvm/hyp/nvhe/hyp-main.c+15 -00 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFuad Tabba
SeriesR-b T-b
1/5
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] KVM: arm64: pkvm: Extend hypervisor entering tracing reasons

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/[email protected]/). (Fuad)

* Rebased on top of v7.4-rc1.

v1 (https://lore.kernel.org/all/[email protected]/)

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

Signature · 1 line
2.56.0.455.g6c5a503b38-goog