Skip to content

hw/arm/virt: Simulate NMI Injection

Gavin Shan qemu-arm qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 3 repliesIn review
  2. v32 patches 4 repliesSuperseded
  3. v1 RFC1 patch 24 repliesSuperseded

Changes in v4 from the cover letter

* Correct the flag in arm_cpu_has_work() (Richard Henderson)
* Check CPU_INTERRUPT_SERROR in arm_cpu_exec_interrupt()
and arm_v7m_cpu_exec_interrupt() (Richard Henderson)
* Introduce ARM_CPU_NUM_IRQ to make the code of initializing

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3target/arm: Support SError injectiontarget/arm/cpu.c target/arm/cpu.h target/arm/helper.c +2 more+91 -213 replies
2/3target/arm: Support VSError injectiontarget/arm/cpu.c target/arm/cpu.h target/arm/helper.c +2 more+85 -80 replies
3/3hw/arm/virt: Simulate NMI injectionhw/arm/virt.c hw/intc/arm_gic_common.c hw/intc/arm_gicv3_common.c +2 more+41 -10 replies

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH v4 0/3] hw/arm/virt: Simulate NMI Injection

This series simulates the behavior of receiving NMI interrupt for "virt" board. First of all, a new interrupt (SError) is supported for each CPU. The backend is either sending error events through kvm module or emulating the bahavior when TCG is enabled. The outcome is SError or data abort is raised to crash guest. In the mean while, the virtual SError interrupt is also supported, but there is no users yet.

For GICv2 or GICv3, a new IRQ line is added for each CPU and it's connected to the (above) introduced SError interrupt. The IRQ line of CPU#0 is raised when HMP/QMP "nmi" is issued, to crash the guest.

Testing
=======

After the HMP/QMP "nmi" is issued in the following 4 environment, the guest is crashed as expected.

Accel Mode Crashed Parameter
------------------------------------------------------------------------

   kvm       aarch64               yes        -machine virt -cpu host
   kvm       aarch32(cortex-a15)   yes        -machine virt -cpu host,aarch64=off
   tcg       aarch64               yes        -machine virt -cpu max
   tcg       aarch32(cortex-a15)   yes        -machine virt -cpu cortex-a15

Changelog
=========
v4:
* Correct the flag in arm_cpu_has_work() (Richard Henderson)
* Check CPU_INTERRUPT_SERROR in arm_cpu_exec_interrupt()
and arm_v7m_cpu_exec_interrupt() (Richard Henderson)
* Introduce ARM_CPU_NUM_IRQ to make the code of initializing

     the CPU's inbound IRQ lines atomic                   (Richard Henderson)
   * Correct comments about ARM_CPU_IRQ                   (Richard Henderson)
   * Update ISR.EL1 with SError state                     (Gavin Shan)
   * Include SError state during migration                (Gavin Shan)
   * Added PATCH[2/3] to support VSError injection        (Marc Zyngier)
v3:
   * Support SError injection for aarch32                 (Richard Henderson)
   * Export the SError injection through IRQ line         (Peter Maydell)
   * Removed RFC tag as it seems in correct track         (Gavin Shan)

v2:
* Redesigned to fully exploit SError interrupt

Gavin Shan (3):
target/arm: Support SError injection
target/arm: Support VSError injection
hw/arm/virt: Simulate NMI injection

 hw/arm/virt.c                      |  34 ++++++++-
 hw/intc/arm_gic_common.c           |   3 +
 hw/intc/arm_gicv3_common.c         |   3 +
 include/hw/intc/arm_gic_common.h   |   1 +
 include/hw/intc/arm_gicv3_common.h |   1 +
 target/arm/cpu.c                   | 113 ++++++++++++++++++++++++++---
 target/arm/cpu.h                   |  23 ++++--
 target/arm/helper.c                |  30 ++++++++
 target/arm/internals.h             |  10 +++
 target/arm/m_helper.c              |   8 ++
 target/arm/machine.c               |   3 +-
 11 files changed, 208 insertions(+), 21 deletions(-)
Signature · 1 line
2.23.0