Skip to content

hw/nmi: Disconnect of vCPU and disentangle Monitor code

Philippe Mathieu-Daudé qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest7 patches 1 replyIn review
  2. v47 patches 6 repliesSuperseded
  3. v37 patches 6 repliesSuperseded

Changes in v5 from the cover letter

- Fixed typos reported in v3

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7hw/nmi: Use object_child_foreach_recursive() in nmi_children()hw/core/nmi.c+4 -80 replies
2/7hw/s390x/virtio-ccw: Always inject NMI to first CPUhmp-commands.hx hw/s390x/s390-virtio-ccw.c qapi/machine.json +1 more+12 -100 replies
3/7hw/nmi: Remove @cpu_index argument from NMIClass::nmi_monitor_handler()hw/core/nmi.c hw/hppa/machine.c hw/i386/x86.c +7 more+16 -100 replies
4/7hw/nmi: Remove @cpu_index argument from nmi_inject()hmp-commands.hx hw/core/nmi.c hw/ipmi/ipmi.c +3 more+31 -120 replies
5/7hw/nmi: Rename nmi_monitor_handler() -> raise_nmi()hw/core/nmi.c hw/hppa/machine.c hw/i386/x86.c +7 more+15 -130 replies
6/7hw/nmi: Remove unused @errp argument from raise_nmi()hw/core/nmi.c hw/hppa/machine.c hw/i386/x86.c +7 more+15 -360 replies
7/7hw/nmi: Raise NMI line only oncehw/core/nmi.c+5 -00 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchPeter MaydellMarc-André LureauDavid HildenbrandEric Farman
1/7R-b R-b
2/7R-b R-b R-b R-b
3/7R-b R-b
4/7R-b R-b
5/7R-b
6/7R-b
7/7R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/7] hw/nmi: Disconnect of vCPU and disentangle Monitor code

Series fully reviewed. I plan to queue/pull via my hw-misc tree.

Since v4:
- Fixed typos reported in v3

Since v3:
- Rename trigger -> inject (API entry point)
- Rename deliver -> raise (machine-specific handler)
- Do not mention 'cpu' in HMP doc

Cover:

- Have s390x always deliver NMI to the first CPU.
- Remove the @cpu_index / @errp arguments from handler.
- Rename API as nmi_trigger() (since not monitor specific).
- Only deliver NMI once

Rationale described by Peter in v1 [*]:

Quoted 10 lines

The current hw/core/nmi.c code is a bit odd because it's partly working with a cpu_index and partly not: the code passes cpu_index around, but in practice for the QMP command the user can't set which CPU to operate on, and for everything except s390 the implementation doesn't care anyway. My impression from the IRC discussion is that it's not really necessary for the S390 that the monitor user be able to specify which CPU to NMI (and in any case you can only do that from the HMP command, not the QMP command, AIUI), so getting rid of that weird inconsistency makes sense to me: and that's what this patchset is doing.

[*] https://lore.kernel.org/qemu-devel/CAFEAcA_0qUFW0MewHC+v+pSOisE-kQDt9Wv4F3RafEkyQ0DGJA@mail.gmail.com/:

Philippe Mathieu-Daudé (7):
hw/nmi: Use object_child_foreach_recursive() in nmi_children() hw/s390x/virtio-ccw: Always inject NMI to first CPU hw/nmi: Remove @cpu_index argument from
NMIClass::nmi_monitor_handler()
hw/nmi: Remove @cpu_index argument from nmi_inject() hw/nmi: Rename nmi_monitor_handler() -> raise_nmi() hw/nmi: Remove unused @errp argument from raise_nmi() hw/nmi: Raise NMI line only once

 qapi/machine.json          |  7 +++---
 qapi/run-state.json        |  6 +++--
 include/hw/core/nmi.h      | 33 ++++++++++++++++++++++++--
 hw/core/nmi.c              | 48 +++++++++++---------------------------
 hw/hppa/machine.c          |  4 ++--
 hw/i386/x86.c              |  4 ++--
 hw/intc/m68k_irqc.c        |  4 ++--
 hw/ipmi/ipmi.c             |  3 +--
 hw/m68k/q800-glue.c        |  4 ++--
 hw/misc/macio/gpio.c       |  4 ++--
 hw/ppc/pnv.c               |  4 ++--
 hw/ppc/spapr.c             |  4 ++--
 hw/s390x/s390-virtio-ccw.c |  8 +++----
 hw/watchdog/watchdog.c     |  2 +-
 system/cpus.c              |  3 +--
 hmp-commands.hx            |  7 +++---
 16 files changed, 77 insertions(+), 68 deletions(-)
Signature · 1 line
2.53.0