All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-s390x@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Corey Minyard" <minyard@acm.org>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PATCH v4 7/7] hw/nmi: Raise NMI line only once
Date: Tue, 11 Aug 2026 17:49:30 +0200	[thread overview]
Message-ID: <20260811154930.13915-8-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260811154930.13915-1-philmd@oss.qualcomm.com>

We only expect one device in the system to implement the
TYPE_NMI interface (typically the machine, but in a few cases
for e.g. m68k and ppc this is an interrupt controller or
similar device); so we don't need to keep walking the whole
QOM tree once we've found it. As no machine type creates more
than one object implementing TYPE_NMI, this is not a behaviour
change.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/core/nmi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/core/nmi.c b/hw/core/nmi.c
index c44b0cf892d..84f21665987 100644
--- a/hw/core/nmi.c
+++ b/hw/core/nmi.c
@@ -31,6 +31,11 @@ static int do_nmi(Object *o, void *opaque)
     if (n) {
         *handled = true;
         NMI_GET_CLASS(n)->raise_nmi(n);
+        /*
+         * We expect only one object to implement TYPE_NMI, so once
+         * we've asked it to deliver the NMI we can stop looking.
+         */
+        return 1;
     }
 
     return 0;
-- 
2.53.0



  parent reply	other threads:[~2026-08-11 15:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 15:49 [PATCH v4 0/7] hw/nmi: Disconnect of vCPU and disentangle Monitor code Philippe Mathieu-Daudé
2026-08-11 15:49 ` [PATCH v4 1/7] hw/nmi: Use object_child_foreach_recursive() in nmi_children() Philippe Mathieu-Daudé
2026-08-11 15:49 ` [PATCH v4 2/7] hw/s390x/virtio-ccw: Always inject NMI to first CPU Philippe Mathieu-Daudé
2026-08-11 20:53   ` Eric Farman
2026-08-12 12:28   ` Cornelia Huck
2026-08-11 15:49 ` [PATCH v4 3/7] hw/nmi: Remove @cpu_index argument from NMIClass::nmi_monitor_handler() Philippe Mathieu-Daudé
2026-08-11 15:49 ` [PATCH v4 4/7] hw/nmi: Remove @cpu_index argument from nmi_inject() Philippe Mathieu-Daudé
2026-08-11 16:38   ` Peter Maydell
2026-08-12  8:51   ` Philippe Mathieu-Daudé
2026-08-11 15:49 ` [PATCH v4 5/7] hw/nmi: Rename nmi_monitor_handler() -> raise_nmi() Philippe Mathieu-Daudé
2026-08-11 15:49 ` [PATCH v4 6/7] hw/nmi: Remove unused @errp argument from raise_nmi() Philippe Mathieu-Daudé
2026-08-11 16:34   ` Peter Maydell
2026-08-11 15:49 ` Philippe Mathieu-Daudé [this message]
2026-08-11 18:40 ` [PATCH v4 0/7] hw/nmi: Disconnect of vCPU and disentangle Monitor code marcandre.lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260811154930.13915-8-philmd@oss.qualcomm.com \
    --to=philmd@oss.qualcomm.com \
    --cc=armbru@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=minyard@acm.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.