Skip to content

RFC KVM: arm64: vgic-its: Enhance debugging with debugfs and tracepoints

Jing Zhang kvmarm linux-arm-kernel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: arm64: vgic-its: Add debugfs interface to expose ITS tablesarch/arm64/kvm/Makefile arch/arm64/kvm/vgic/vgic-its-debug.c arch/arm64/kvm/vgic/vgic-its.c +1 more+276 -320 replies
2/2KVM: arm64: vgic-its: Add tracepoints for VGIC ITS commandsarch/arm64/kvm/vgic/trace.h arch/arm64/kvm/vgic/vgic-its.c+154 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] KVM: arm64: vgic-its: Enhance debugging with debugfs and tracepoints

This patch introduces two significant enhancements to the debugging capabilities of the KVM VGIC ITS for ARM64 systems:

* Debugfs Interface for ITS Tables:
A new debugfs interface is added, accessible at /sys/kernel/debug/kvm/<vm_name>/vgic-its-state@<its_base_address>. This interface exposes the internal ITS tables, allowing developers to inspect the mappings between Event IDs, Interrupt IDs, and their associated target processors. The information is presented in a clear, tabular format, making it easy to understand the current state of the ITS configuration.
* Tracepoints for ITS Commands:
Tracepoints have been added to cover all major ITS commands. These tracepoints provide detailed information about each command execution, including device IDs, event IDs, collection IDs, and other relevant parameters. This allows for fine-grained monitoring of ITS activity and facilitates debugging of complex interrupt routing scenarios.

Motivation:

The ITS is a critical component for interrupt routing in virtualized environments, but its complexity can make it difficult to debug and optimize. The current lack of visibility into its internal state hinders the ability to diagnose issues related to interrupt delivery, performance bottlenecks, and configuration errors.

This patch addresses these challenges by providing tools to:

* Inspect ITS Table Mappings:
The debugfs interface allows developers to directly examine the ITS tables, verify the correctness of mappings, and identify potential misconfigurations.
* Monitor ITS Command Execution:
The tracepoints provide a detailed log of ITS command activity, making it easier to understand the flow of interrupt routing and pinpoint the root cause of issues.
* Improve Debuggability:
By combining the static view of the ITS tables with the dynamic information from tracepoints, developers gain a comprehensive understanding of the ITS's behavior.

Implementation Details:

The debugfs interface is implemented using the seq_file interface to present the ITS table data in a user-friendly format. Tracepoints are defined using TRACE_EVENT and DECLARE_EVENT_CLASS macros for efficient tracing. Tracepoints are strategically placed within each ITS command handler function to capture relevant information. The patch includes necessary modifications to the KVM Makefile and VGIC header files to incorporate the new functionality.

---

Jing Zhang (2):
KVM: arm64: vgic-its: Add debugfs interface to expose ITS tables
KVM: arm64: vgic-its: Add tracepoints for VGIC ITS commands

 arch/arm64/kvm/Makefile              |   2 +-
 arch/arm64/kvm/vgic/trace.h          | 135 ++++++++++++++++
 arch/arm64/kvm/vgic/vgic-its-debug.c | 234 +++++++++++++++++++++++++++
 arch/arm64/kvm/vgic/vgic-its.c       |  58 ++++---
 arch/arm64/kvm/vgic/vgic.h           |  33 ++++
 5 files changed, 430 insertions(+), 32 deletions(-)
 create mode 100644 arch/arm64/kvm/vgic/vgic-its-debug.c

base-commit: 9d89551994a430b50c4fffcb1e617a057fa76e20

Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog