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

Philippe Mathieu-Daudé posted 7 patches 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260811154930.13915-1-philmd@oss.qualcomm.com
Maintainers: "Dr. David Alan Gilbert" <dave@treblig.org>, Richard Henderson <richard.henderson@linaro.org>, Helge Deller <deller@gmx.de>, Paolo Bonzini <pbonzini@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Laurent Vivier <laurent@vivier.eu>, Corey Minyard <minyard@acm.org>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Nicholas Piggin <npiggin@gmail.com>, Aditya Gupta <adityag@linux.ibm.com>, Glenn Miles <milesg@linux.ibm.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, "Philippe Mathieu-Daudé" <philmd@mailo.com>, Zhao Liu <zhao1.liu@intel.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
There is a newer version of this series
qapi/machine.json          |  7 +++---
qapi/run-state.json        |  6 +++--
include/hw/core/nmi.h      | 34 +++++++++++++++++++++++++--
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              |  2 +-
hmp-commands.hx            |  7 +++---
16 files changed, 78 insertions(+), 67 deletions(-)
[PATCH v4 0/7] hw/nmi: Disconnect of vCPU and disentangle Monitor code
Posted by Philippe Mathieu-Daudé 2 weeks ago
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 [*]:

> 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      | 34 +++++++++++++++++++++++++--
 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              |  2 +-
 hmp-commands.hx            |  7 +++---
 16 files changed, 78 insertions(+), 67 deletions(-)

-- 
2.53.0


Re: [PATCH v4 0/7] hw/nmi: Disconnect of vCPU and disentangle Monitor code
Posted by marcandre.lureau@redhat.com 2 weeks ago
On Tue, 11 Aug 2026 17:49:23 +0200, Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> wrote:
> hw/nmi: Disconnect of vCPU and disentangle Monitor code
> 
> Since v3:
> - Rename trigger -> inject (API entry point)
> - Rename deliver -> raise (machine-specific handler)
> - Do not mention 'cpu' in HMP doc
> 
> [...]

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

-- 
Marc-André Lureau <marcandre.lureau@redhat.com>