From nobody Wed Aug 26 07:24:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1786463480; cv=none; d=zohomail.com; s=zohoarc; b=F/jM9ly+c+rN57KQ8yJiHfe3iN2a5U9LmRXjNUxGLTCao3+q/GGgJeyqP4F1ugU95W9/0O6jhFu4yptK0nQs0Gmwa9YclxcOUYCSN0rnIQedyiHNdBcNt3NYemOWT5F6QNWjOnUyIm+hDd9jr34isac6EuNDs60PsXfwEkWDjuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786463480; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yK3vNt1t/PS+GzsEVTsPCWTVujnrwF/VrOO9PtMQReQ=; b=DboiPmi+DyedHOfCZK0iKqBK2Z+vGECWRIUPnRMAiWP9sOO+OaPfpE4bET+L0kIjvvKv+G34lGzgWfLfb+oplFGxmgtH+Efbv2PnmtS4jK9GCa/+3JwOYy5ub+7fpIhPEJuixCikQS0smg0TuNEAlWRMZKN2GCKfixFEMmnMn3I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786463480075619.7714548356935; Tue, 11 Aug 2026 08:51:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtokZ-0003ab-1F; Tue, 11 Aug 2026 11:50:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtokW-0003Yy-OZ for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:50:45 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtojY-0001tf-FZ for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:50:42 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67BDWXmT1914347 for ; Tue, 11 Aug 2026 15:49:43 GMT Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g049brryk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 15:49:42 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-51c1c7f135bso1117451cf.0 for ; Tue, 11 Aug 2026 08:49:42 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4997abebacfsm948305e9.10.2026.08.11.08.49.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 08:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= yK3vNt1t/PS+GzsEVTsPCWTVujnrwF/VrOO9PtMQReQ=; b=VZeWk0cpZimDgZ9C Bdd88hxXu5zFiGDum2X6kYjpQgIdmm4TFSe6sJvNdi1lNO2YXZR5r2KjR16BxGzd eHFOXqoiG5l3Y2JiKS/o+jTvFNBw5JUyYrCWDi6Fzpi2MEzvOVDnM47qj50aPHdr vSpQ4ga5HyfVwg04BnAbqgMKGkSQe5wgtY6rnTc5olyjX8etRS/IbKR0J8FYaFzZ aLQXYoqtorOjED9PG9oMZB+wFeZpYR8GnRCtz3uAYERoyizACatEvoo6pcytueFC H8XrRirK0QM+VN/2w/E1uFmRtXwSKVvyYqTdKU+RVEOvQQC8yN7hemyABikmv+pz LJ5jPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786463382; x=1787068182; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=yK3vNt1t/PS+GzsEVTsPCWTVujnrwF/VrOO9PtMQReQ=; b=W0vkM7oRQKSR05bDReqX2ESIfkAX4rEidNfCi0OStq7wQEWY+9q0SDJ/K3SCWT/558 Yww+h/lJ3Pmi/1TNMu6zbD7jHAtLcMGDRZVKu1QcJPhU68yCHyEsBGNsFBtJzhuH7XOt O9PP1R2QVJUJYdt1KxY0NSyGLwjCPjBWNmCTj9u8z+odRlWswjWnhZS/OdPsZsGU21bL 8Ua1iPs5XkEhhhc8iOOJJYZYXGNfvcGhMVELzeN7EVlKrHutw4rb+g+e0HA6IKEVgmT1 sF35MYi9KI6Jd0zw2gDkTMkOFqHosBOe5TkeyPiO+Vj7UT3c/wUr+CWg4jhdeCDIglaH nTXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786463382; x=1787068182; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yK3vNt1t/PS+GzsEVTsPCWTVujnrwF/VrOO9PtMQReQ=; b=cAbRMnUV87qauZUEJi+YyP9nftKGX+v8WFlTCF9VATncqUOHmEqHDdSCdOdowDaoCO lSiQeHLBeEbeAV+aiU7JT21g74/sGgQFXtqzji8r+5ZISETPOgbg58tWdcW2bG1IBvmP 2wz3PzX5+jsw2RY2aoTMijF3VFYUtdOK33VvwAPgXq419HmXBqb29dgP39/Lo7VSmMS0 hQEIfKUHOp5jpdIEDet3qTW0afz5GyQmMnTXOa8wLg3RWfSqkb2xZRHNKr1VB+uyogNi LkL/1YPMhyPfZPmZNGbiIykw9ocs8BXj3dC16u50yJZvLar63ZGaYIExNo79LfiBdD8I YiNQ== X-Gm-Message-State: AOJu0YxHI+HRhWmBnzMw7ZnySyR9Cm27fPSHM0qQAKCrecbSoUE1Pf5k rIUo5JF1qkiUmj6/Fr4oAIBStSyNivsEpMhZGTb+VfLPHxiggWPADGjT1KeffaX+T62YA7nvu6b 8ypp/XoeVkfBiLY6UeNHBnEZ5R2dYvu0a9BQj/4h5MGp0OxenOsPFdj/bNkmrPW2UpA== X-Gm-Gg: AR+sD10zyGh9k7S1JiaBY8JhiDBjr0NyQdUPu7uXKBA+0IIpko06annh8uMFCjCGO2I 1navck9+3/f4fEtCqWYWt4g6gk5WVC5MntiX7diFsM2OLt3HZAlNS2E5isKEDd4SO7cyBX/+vxq mbE9XRa2OSNtHHhdER6Lp2mJo5zreK7e0WIAcItgRK6h4IZWJ48AK221Kw9nVenY6SNALpC9DE2 1wKWj8eowT1LYZzUjlQ1vUq0UnqgQpo7PZXRNZz/i8Ksn4XV1dS56iBi/ix6zkDt9piSOjcje6K bQAzXHYjBLbnTPLbors9Hp1WZa0Fy7JOtWq8Y1s4gESEsv9soRiEbxZJiu0dDLj8AiuCQ8fG2ps o7u7LnC0a8ilfXRpMX4SGk84ssRD8ABtUN6vaCiyATA== X-Received: by 2002:ac8:5887:0:b0:51b:ef2c:7bf0 with SMTP id d75a77b69052e-52d5860de3emr39039251cf.35.1786463381750; Tue, 11 Aug 2026 08:49:41 -0700 (PDT) X-Received: by 2002:ac8:5887:0:b0:51b:ef2c:7bf0 with SMTP id d75a77b69052e-52d5860de3emr39038711cf.35.1786463381344; Tue, 11 Aug 2026 08:49:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Peter Maydell , Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Thomas Huth , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 1/7] hw/nmi: Use object_child_foreach_recursive() in nmi_children() Date: Tue, 11 Aug 2026 17:49:24 +0200 Message-ID: <20260811154930.13915-2-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260811154930.13915-1-philmd@oss.qualcomm.com> References: <20260811154930.13915-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: o_OEJUJ6NGTzggeBJyT7_2G9ptb4L8ld X-Authority-Analysis: v=2.4 cv=ENg2FVZC c=1 sm=1 tr=0 ts=6a7b4496 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=jmNSRpmTyL3U9imlh2kA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: o_OEJUJ6NGTzggeBJyT7_2G9ptb4L8ld X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfXxJ1yIXwQmEey iemdC72DyMI27xQ4WTIK7UhkrYJkG3KYTlJhSDaYBBmhogxPlbpdgOa4E6rGOOI0THolxqFkHUv Ne/AbYJA58wJclkejMPVaoqn3fa6nxukfWdCVkpQMz0eioD7zW4pem/9vN30gjITNBHThjCkaOC dPfcXRea/6sN6f+PX3vHAVz8G9Dnrb6Ykv1oJXNkGmR4lNXUWVS32eJ6sCeJ60PI//5/zbEhoKf K/oOXxHKJCKtD2TgX52JHdc3FHD/TOOXfqA4m30+QB0OLGu/4Tl0bqvEu6DJJYhZz870hNwhGCG yCQJhgXElVTHXVLu+i5ISyXaOdLEzmxX6CfSigKyEO+7kIY9kUZwPNq3RDBtl4dQh059s61Cj7m k0FVxVB3f0tDZoFBIUMWp13phhYoH9Xuskh144xvZYuwWeIR7qmNcK8D401GxG/9V0x9UmneMma 40oOkwVNqkN/mYlvC7g== X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX97Bz83mq7mbN umMrwYzHoj6K5PGMlkRMij5hdV55Q/vy2W1gHFKNZfEASEtBgUL+RIZZKjuNu/dQP2lfmCqSu+R BNamWrDRQua5sp/4aGWV0NTvVNSPGiE= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-11_03,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110132 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1786463481761158500 From: Philippe Mathieu-Daud=C3=A9 Replace object_child_foreach() and recursion by a single object_child_foreach_recursive() call. Propagate the returned value so callers can check it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- hw/core/nmi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/core/nmi.c b/hw/core/nmi.c index 4b447e126ba..22724046575 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -31,8 +31,6 @@ struct do_nmi_s { bool handled; }; =20 -static void nmi_children(Object *o, struct do_nmi_s *ns); - static int do_nmi(Object *o, void *opaque) { struct do_nmi_s *ns =3D opaque; @@ -47,14 +45,13 @@ static int do_nmi(Object *o, void *opaque) return -1; } } - nmi_children(o, ns); =20 return 0; } =20 -static void nmi_children(Object *o, struct do_nmi_s *ns) +static int nmi_children(Object *o, struct do_nmi_s *ns) { - object_child_foreach(o, do_nmi, ns); + return object_child_foreach_recursive(o, do_nmi, ns); } =20 void nmi_monitor_handle(int cpu_index, Error **errp) @@ -65,10 +62,9 @@ void nmi_monitor_handle(int cpu_index, Error **errp) .handled =3D false }; =20 - nmi_children(object_get_root(), &ns); - if (ns.handled) { + if (nmi_children(object_get_root(), &ns)) { error_propagate(errp, ns.err); - } else { + } else if (!ns.handled) { error_setg(errp, "machine does not provide NMIs"); } } --=20 2.53.0 From nobody Wed Aug 26 07:24:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1786463491; cv=none; d=zohomail.com; s=zohoarc; b=MC65av8LR2XZu7IjyxcYdENLEUix2Ihf/CQ2v3zoW51EFqya4ACBlXayH+kVSN2Tf43RAeZli0Rdi7CGh8kOfHlqirR3gtVjUmANAANyOAXYwUr+q1bK9uOL1oh+d5bd0/U9zY7JwSE6b1b13NyjszirOVYcSVdBMrKoopzu+WQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786463491; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZNPVG0pKMHrN58VHLVnd6gBqWmgUFYW3CfavPyrN/lk=; b=IyB4VKdRhtLhTAjr3wjY+BvRu9nihdEg2t9fjgUAk0dUr4kFGYtkvccoX4LwsR/sPBgjT8a4gaTglX6U6qMI5glnPTENdorIE4bkt6yk2/slmIt/RF6ijV/M+cg/KKPmV/nf/S1bxHtTgNLoxKQLSkLvY/mtznG1CCHl+k6AkKg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178646349144975.44262337125906; Tue, 11 Aug 2026 08:51:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtoki-0003fc-NC; Tue, 11 Aug 2026 11:50:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtoke-0003bY-4z for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:50:53 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtojg-00023C-5O for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:50:50 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67BDWXmU1914347 for ; Tue, 11 Aug 2026 15:49:51 GMT Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g049brs03-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 15:49:50 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-5276aa86d00so600721cf.2 for ; Tue, 11 Aug 2026 08:49:50 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4814a709594sm5364913f8f.18.2026.08.11.08.49.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 08:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ZNPVG0pKMHrN58VHLVnd6gBqWmgUFYW3CfavPyrN/lk=; b=g+s4IhTILG6XVyKU 7A9PWFf5tgTZVMh7YgEElFjWziN4ZbzkL5qigb21Jwc1iCLfvmsTc99m9lGZyOEt wAauAhR7eQbRaI9AQmoR+hvLQvq8VgcxAn3XF5+mEqUA+QEiYSCeG8tk6dRGmWxh wtjA1vvT1f2zZ7SIW0xfCDOjyBmN3dFhdeZiZWAsrIoKfvTJuMUg9i4b6IT7azEa ZXeRSB4R5aqwwc/aTruxS2ckzzioQRibY9t2n1RQXoBTFXPy3m8Atxk+W759xcPW 3q4vzO1poUDiOM3B52wNiWXphCZgcrEDwf9bUDNCmChwGHIMzZFjD9418y97lpNx u5e2jw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786463390; x=1787068190; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ZNPVG0pKMHrN58VHLVnd6gBqWmgUFYW3CfavPyrN/lk=; b=ZSqwP2fdIB9DBi5Op3y6QYwrZzWIFASkbju0WTeAXJXZaF1TKB7tGczSwIXrDivA5j UpIYesYfGn+UB7Zw21tNrGqvGrhjjUXYWkzlkU25My//DzatIq1d8QLbMst5Crhf7kuV un2AlnvdA/JSzauz9T+ajtMEYJJLFB2oathzT5eylx9rDynKN1HmurwT7y5hPnEyg7RH oekHZ39GlqeJjHc13N/Xj91ULuV1/S3joe0NPqcMZ9o7RhZUw9U8hp1wB5EyJ6/enAxU Kckulddpiyvja0H20Wc+2pMJCeLdALfHhhX1JIQKn/rwTAxDesyyz4UrLhIQ8H2OVZMj b6DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786463390; x=1787068190; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ZNPVG0pKMHrN58VHLVnd6gBqWmgUFYW3CfavPyrN/lk=; b=gmH9TWDZ7nbDnWdIBIx7DEtDxUH1Wb2SYJEpyJLpe65gwPSh41F2st3QjRx1d/BVh7 zGnRAIvjlm3TK/KbTyb6qMrmV3F35rmmey1wI+8NZ8Ltm3aewIVSgcsQOYj4wZr7sxCB cgEmGoZHSKcHhXgT47/SIwddjMX1CTUCOWQ68GyCI15wiC1nEDwL23FT+1hWkn32I4Uj RupCzuj88kEhE3Ko8qozAg2Qioi9fSZO2mQS8Uo5ZdUjkgzYlS5WxUJiKpyFA2T68K46 4aVH0qppjxhiEcEj5b/RBuCW+vjqvwoUHYwVCWfiEf3kXrp6+t//7ugozW8/xWm5dEWu qM+A== X-Gm-Message-State: AOJu0YzpDCr5TGTxleS/T6AV5a61iezsMt5VZZsy4uRlTgAN87UlVsIS Iirjlq5XfUwX91MLNNYccl6iKU3uC3ZXuoZNEGiBoMDQMIePGjwomKG8MY4mZcn2L4q/TsjlVvh aAoKrwgEiJFpJtqTOAYWnB58hrTbPsTgB+wAJZcSarDPyJYaLcWmdx9RduEDoulRVUw== X-Gm-Gg: AR+sD10/lOejKO35FggMzM3hcFKK8pbnTPS0JhBkiSeyxkV+aTAf6+M7EiqOJBRX3fQ mrT5Ybjsi1Vredof3dygnepH7B/zDxcsswELvUFwOXvzHUQCvS0sDbcaG2vv9Dbc3GiQh0bIEAO R0fLaJ8eMucWPbdb1lAmqLgytS9jfVHvRGtr7bQElTM1R2YVVkwZm6JHsHYE9cRtULbYlvBzhuw 2xgx8oj55Cv0sklR/KCJ8m6e7DYQhKmunZjYlew9d6Dx3CFKVK3Zn4qJClwGV/wI5kOsaQzPKxs Mx59Z54vXgh6VDL1wVcrDzJAgf/2FfX2JeBa1OwK0PED1SHmoOdRvRvLw4zz0ZnEBEYi8fQygkX iigFZEtI8UaBtsOBV05jhitZqi4WYSvg/xeeBpda1zQ== X-Received: by 2002:ac8:5c85:0:b0:517:c65c:488b with SMTP id d75a77b69052e-52d582aeecfmr36666691cf.0.1786463389531; Tue, 11 Aug 2026 08:49:49 -0700 (PDT) X-Received: by 2002:ac8:5c85:0:b0:517:c65c:488b with SMTP id d75a77b69052e-52d582aeecfmr36666051cf.0.1786463388991; Tue, 11 Aug 2026 08:49:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Peter Maydell , Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Thomas Huth , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Hildenbrand , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Halil Pasic , Christian Borntraeger , Eric Farman , Matthew Rosato , Cornelia Huck , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Eric Blake , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Paolo Bonzini Subject: [PATCH v4 2/7] hw/s390x/virtio-ccw: Always inject NMI to first CPU Date: Tue, 11 Aug 2026 17:49:25 +0200 Message-ID: <20260811154930.13915-3-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260811154930.13915-1-philmd@oss.qualcomm.com> References: <20260811154930.13915-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: uc25wsfe7cTpj6vP7qN5izVc5e7RK5eW X-Authority-Analysis: v=2.4 cv=ENg2FVZC c=1 sm=1 tr=0 ts=6a7b449e cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=KKAkSRfTAAAA:8 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=43zqHlSF2DfHiYptYdwA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: uc25wsfe7cTpj6vP7qN5izVc5e7RK5eW X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX7yOkG9cOsut1 O576sPA0i31YAS2/nCOwlw4DTIXdYz71lytSwtR7IYd51TjlQUns6Y1FHyqOBHxO9x9Ni588wy3 OW7aZFqM+osajP6n1vJ6dSqnXaU1U5eoAx3s8xDnHPRjuApfxW+aYSz4Pxiz9u1HKaDg0HImzNQ LVRsH7G/eRgY7/TrsBBn1z5LUgBzmDsmmnxqKTPoWcw+4UMBOF3dSUnETird463MtAOqVZyABTZ 5NZmNr8a35P4VgpryFUqsIFPuIu+mIsPGuXp+Wcd1D2FsySmOX1+qgSynjmfMKBRf2FYauGa40j DdJJ6xi5sAEhF1+Dquol7BjEoAh81sQm7D+k6kfPfydkgbchNvKEWuE37JNnACJhNzUtcpU8A0q QaNw5MAdhIyHUSgAoILrGPr6ofsbryouK0OG33iAV0Wt/ByrFN0KoF06u2/8H7LdGfDDIm4uPJT 7B0psPuYruwDE++VQdg== X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX8ib22UlhDbup m3YeolTYhEJPDuzZ9EpsdlF9hPmvQTrkTxMSm0yAQDm2fienGiCiQV+XwTHbAXC1Vf4JdZ4hLXx 6HaIQKjFnbDWfkLSD10VuIiMKfhKCBc= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-11_03,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110132 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1786463494344158500 From: Philippe Mathieu-Daud=C3=A9 We can trigger NMI from HMP or QMP. QEMU maps the NMI to the s390x per-CPU 'RESTART' interrupt. Linux guests usually setup this interrupt to trigger kdump or crash. Such crashdump can be triggered in QEMU by HMP "nmi" or QMP "inject-nmi" commands. Using QMP, since we can not select a particular CPU, the first CPU is used (CPU#0). See the documentation from commit 795dc6e4 ("watchdog: Add new Virtual Watchdog action INJECT-NMI"): @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all VCPUS on x86) (since 2.4) While we can select a particular CPU on HMP, the guest behavior is expected to be the same if using CPU #N or CPU #0. Since always using CPU#0 simplifies API maintainance, update s390_nmi() to inject NMI to the first CPU. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Reviewed-by: David Hildenbrand Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Cornelia Huck Reviewed-by: Eric Farman Reviewed-by: Marc-Andr=C3=A9 Lureau --- qapi/machine.json | 7 ++++--- qapi/run-state.json | 6 ++++-- hw/s390x/s390-virtio-ccw.c | 4 +--- hmp-commands.hx | 5 +++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 9b2248038fc..2d63c1bac3b 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -432,9 +432,10 @@ ## # @inject-nmi: # -# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or -# all CPUs (ppc64). The command fails when the guest doesn't support -# injecting. +# Injects a Non-Maskable Interrupt (machine specific: for example on +# s390x CCW only the first vCPU receives the NMI, but on x86 machines +# all vCPUs receive it). The command fails when the guest doesn't +# support injecting. # # Since: 0.14 # diff --git a/qapi/run-state.json b/qapi/run-state.json index a5771ad4681..e4fdead1e0b 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -317,8 +317,10 @@ # # @none: nothing is done # -# @inject-nmi: a non-maskable interrupt is injected into the first -# VCPU (all VCPUS on x86) (since 2.4) +# @inject-nmi: a non-maskable interrupt is injected (machine +# specific: for example on s390x CCW only the first vCPU +# receives the NMI, but on x86 machines all vCPUs receive +# it). (since 2.4) # # Since: 2.1 ## diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 25a9fa49554..4f7861dbbb7 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -727,9 +727,7 @@ static HotplugHandler *s390_get_hotplug_handler(Machine= State *machine, =20 static void s390_nmi(NMIState *n, int cpu_index, Error **errp) { - CPUState *cs =3D qemu_get_cpu(cpu_index); - - s390_cpu_restart(S390_CPU(cs)); + s390_cpu_restart(S390_CPU(first_cpu)); } =20 static inline bool machine_get_aes_key_wrap(Object *obj, Error **errp) diff --git a/hmp-commands.hx b/hmp-commands.hx index 7ae2468a3d9..a1b77ae4044 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -865,12 +865,13 @@ ERST .name =3D "nmi", .args_type =3D "", .params =3D "", - .help =3D "inject an NMI", + .help =3D "Inject an NMI, in a machine-specific way", .cmd =3D hmp_nmi, }, SRST ``nmi`` *cpu* - Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64). + Inject an NMI, in a machine-specific way. + Not all machines implement NMI handling. ERST =20 { --=20 2.53.0 From nobody Wed Aug 26 07:24:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1786464706; cv=none; d=zohomail.com; s=zohoarc; b=cs6HKySgyk+81SO6SGKY2WoiRdDJ/QNo56ttnKTqDr/CZL9uzmQB+9FlY+OFF4DsNiLQnBcU4xXks3PSbmFNbtZLaWLo7i/uBXwARAMSVqlQDHoBwWhUriEO4AJ8oHmhE+D89ubTrBzyr64cEaSvgUysAPHhQNbTd5vSXE7Tjpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786464706; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jqAk9IvSPfgz7bsMCJKg5NL2Zwfd00WMYGreeaB3SyY=; b=IlgObfRNJ4TIeAwBORH2Ap6mc3JAeGhEEWTuqOGxpwjgluqYcHmm1s7UsHySR37SNBjsUqLjzqm/SwAumiyKGsE5AvD213Fb367u3WGkdwrpsigoj/gw0iO03odBK6vjWwCbxqZKoNgSiTGP/MsA6LdKGQsGW78bMsUg42UV47U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786464706258564.6877309774087; Tue, 11 Aug 2026 09:11:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtp4G-0001vF-NI; Tue, 11 Aug 2026 12:11:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtp4E-0001uE-OM for qemu-devel@nongnu.org; Tue, 11 Aug 2026 12:11:06 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtp42-0002Gf-9O for qemu-devel@nongnu.org; Tue, 11 Aug 2026 12:11:05 -0400 Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67BDWjAM1317223 for ; Tue, 11 Aug 2026 15:49:58 GMT Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fyqmk3jv5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 15:49:58 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-51c1d137a68so813301cf.3 for ; Tue, 11 Aug 2026 08:49:58 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4814a70976csm5176021f8f.19.2026.08.11.08.49.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 08:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= jqAk9IvSPfgz7bsMCJKg5NL2Zwfd00WMYGreeaB3SyY=; b=XdVOrhgZckSHPI6x A2uXAv5dGDDzonxiq1o75SQmdhi1oYqTgKEG4dykAyXtsixQAuTrlnwvTECRKnAq 5ozqGqLkTVQdQNVfW+dDmIsMRGmpCrzPNZ4H0nSxSuTjQOWlwVVnRO1IvcmVau10 Zlx5MxR1Xw/jc5RX8EE/8Hpfy2obJeb+70GUoCM4mxbi1kV/nP6kct13u2F82+z2 0n1gYZbA4Y8YemB/9IMsUFIwIg2KvMZCxBaANhS3kDcV1AnXdXknutVMMhxU7I++ YT31i0/PTK2C2yIn4FcsJH2TS6/0gXz81Hdyx91c5xQXZO26jDCQhCd8kMAuCavY RGGYag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786463397; x=1787068197; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=jqAk9IvSPfgz7bsMCJKg5NL2Zwfd00WMYGreeaB3SyY=; b=FE2JRhtFhXsdnj7Bz5HU+cP7pRLabKdtn3ZsD2NEhmvpIIQcv/M1UBOtkavpFeAyIr rGdvQv4eo2BnEcPwzIqpn5G73ucPLbdI4b4hxY+uvVlcHvAGNPRghuj5zuKctd0TOxPu /s6l2ckw5SPtHhTUe/GfBjefCbE5MI6EYWNKcGY5RrNrAmIOsYKKHCQf9DsJK8VjUNDt OJqtB0hbk2CgyA1qm17p9ji39uygG7O3NGC/mBCapJdWuf7EcMur0Y5SAe6rzhcinzUY kqDhd84t7HJY9Ox5yKBzA0Fjqd1lkxdtaqdkh5+v5WTkBe8oCkMm8ID8usZSmtq/RmC4 QUeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786463397; x=1787068197; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=jqAk9IvSPfgz7bsMCJKg5NL2Zwfd00WMYGreeaB3SyY=; b=RMVIWcAeD46fiiPv3knigtT2q3VqMeGsOKTWzUYxLePcn3gGJAYsjhqH/eSGNbwa2c dwxQIofQ6JGnqAB5+sobMkjro389VaY9SfR1TkzicSiUdwDxI2qbilCZ+Nw6ZEhn+4eW vAMNqVjIVmYYXPPcd52azDvGHlpY8B+elgO7Dn+azvpG21oZ9sQ4zIcYVG7ucb5kDKhN xgfEvkDQMDKai0ikFtV18wfpUm73Gz9vrquXMinyGsqHJKV+EyXKZUp1s3gTmPb5PbMM wdPCf2jVoZLlzWVLINobrmw3ufEG5iRGtCAxW/63wsNmQgg7l1/smoKWFzmR2gxQRX/D qweA== X-Gm-Message-State: AOJu0YzMBMzQWdLivHZlXvDQYgxZJiSEvJxZhGKylC5FtigZJe+RQ7YF uiMRLL52Y1w5T84bOfkoLpMlUFi9dk6MyrLMdzcxIVh00Eyd+EDFgRb2nc/Uo9W9/JL9QLbP+ND 3/BHwgBJBwVMWJDr7xZS5A+kw+Ul+YEF1xXxNixWm5hy12N4Yj/XvRmnVUNOYUOvW3w== X-Gm-Gg: AR+sD11vt41Fyq9jPZQSa8L588BhEx9zv1DXB5WTWRPzI2gkzkbspFHgqaTGh2Og6Lv OBour6F4PpBnSp/N4UbZdwFgW1SMta+AGkkD052XDhd5DGGrM0pVckH2hOWsLYIQlOtHp5zcZkt CMwoLSB5nAA+xE6erVG8dvuzvVvLScE1Ht0xlqODP0ksAy6Hbow4dwXsWvqwr1VMqAO+iawutZs G6IorljPiH8CA7KPmuZrDFqsIuYIHHzrcexhiCktcv0ECzETbW91YE/Ie/KrqN3CPpkRx0gMtZM JOvTaKgkuv2tPBk/1JJikN+lHjTSsLNLYvkhny00O2uzZ239816RulGooWI48PiUKKgKyIAXkX1 yVlsjoT2hsM/qjBQRo3e+EVOcpocivA1KGA9PAPCeWQ== X-Received: by 2002:ac8:7d53:0:b0:52d:354c:5b91 with SMTP id d75a77b69052e-52d58500711mr37561751cf.16.1786463397445; Tue, 11 Aug 2026 08:49:57 -0700 (PDT) X-Received: by 2002:ac8:7d53:0:b0:52d:354c:5b91 with SMTP id d75a77b69052e-52d58500711mr37561231cf.16.1786463396871; Tue, 11 Aug 2026 08:49:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Peter Maydell , Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Thomas Huth , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , "Michael S. Tsirkin" , Paolo Bonzini , Laurent Vivier , Mark Cave-Ayland , Nicholas Piggin , Aditya Gupta , Glenn Miles , Harsh Prateek Bora , Ilya Leoshkevich , David Hildenbrand , Halil Pasic , Christian Borntraeger , Eric Farman , Matthew Rosato , Cornelia Huck Subject: [PATCH v4 3/7] hw/nmi: Remove @cpu_index argument from NMIClass::nmi_monitor_handler() Date: Tue, 11 Aug 2026 17:49:26 +0200 Message-ID: <20260811154930.13915-4-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260811154930.13915-1-philmd@oss.qualcomm.com> References: <20260811154930.13915-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX43eiSHk95cpA nBeBCUrBz3G80Ot5J8Yvc20RVmE/jymvhtOeFr/uLCYq1UxM4+BWTtxGhxN8r2O9qdoR79RXVcR qd1+t0J+75aDZX8qEDHP2C3C/fhXOcv26u0LoYr35GAtfY5KpqOk/VoUWjftsdRqdN3icpnjOLz MMurU7H9q69T9XtrOwegKmHDgdRPdtA4yhb398aY1zU9YoOuGonRx8ZYm0F2jVrX92ecw8eHgMl IidIJS5BhUkfjRzdS7btYmjs2bxWMrmiFYHxp1FXIOxOQCcfs/5XHSydUct3FHAiz1l1s4LqVul W/io09Uupx77vgIyPoQAYUsm2rZpxoRKzSyJl75DdUwXsVRxv+IIPNeVJpCl91Tj9EtAVj1AmC6 UzTUXmTHJjb74VspzyI7EC7K2TW2/Bx09/PlgzRemhUmbUe2/Cjsm6dHH12+a5qLKXHHx3bL0zh WwQKEQbDUHWbdvMWFMg== X-Authority-Analysis: v=2.4 cv=O4YJeh9W c=1 sm=1 tr=0 ts=6a7b44a6 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=KpD7k0r93PjNlcRUnYkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX41O270SUVvWM l6aN+m4VMilmtKI6e9RY3hYutnjGOxZ4LHwfspAdIHeAPMQBTdNiS1wK84qsZefivd1FmohtZmj 3qzXMsxrl8P1j/McKP/4yutoi6qs2kI= X-Proofpoint-GUID: 53bzyR-uygKjAv7DNkraKzcxGd3YTI5T X-Proofpoint-ORIG-GUID: 53bzyR-uygKjAv7DNkraKzcxGd3YTI5T X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-11_03,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 spamscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110132 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1786464708787158500 From: Philippe Mathieu-Daud=C3=A9 Only s390x was using the 'cpu_index' argument, but since the previous commit it isn't anymore (it use the first cpu). Since this argument is now completely unused, remove it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/hw/core/nmi.h | 8 +++++++- hw/core/nmi.c | 2 +- hw/hppa/machine.c | 2 +- hw/i386/x86.c | 2 +- hw/intc/m68k_irqc.c | 2 +- hw/m68k/q800-glue.c | 2 +- hw/misc/macio/gpio.c | 2 +- hw/ppc/pnv.c | 2 +- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- 10 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/hw/core/nmi.h b/include/hw/core/nmi.h index fff41bebc69..4c4ce79071d 100644 --- a/include/hw/core/nmi.h +++ b/include/hw/core/nmi.h @@ -37,7 +37,13 @@ typedef struct NMIState NMIState; struct NMIClass { InterfaceClass parent_class; =20 - void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp); + /** + * nmi_monitor_handler: Callback to handle NMI notifications. + * + * @ns: Class #NMIState state + * @errp: pointer to error object + */ + void (*nmi_monitor_handler)(NMIState *ns, Error **errp); }; =20 void nmi_monitor_handle(int cpu_index, Error **errp); diff --git a/hw/core/nmi.c b/hw/core/nmi.c index 22724046575..ff6454437c1 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -40,7 +40,7 @@ static int do_nmi(Object *o, void *opaque) NMIClass *nc =3D NMI_GET_CLASS(n); =20 ns->handled =3D true; - nc->nmi_monitor_handler(n, ns->cpu_index, &ns->err); + nc->nmi_monitor_handler(n, &ns->err); if (ns->err) { return -1; } diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index d762163ddf5..2b44debc388 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -829,7 +829,7 @@ static void hppa_machine_reset(MachineState *ms, ResetT= ype type) cpu[0]->env.cmdline_or_bootorder =3D 'c'; } =20 -static void hppa_nmi(NMIState *n, int cpu_index, Error **errp) +static void hppa_nmi(NMIState *ns, Error **errp) { CPUState *cs; =20 diff --git a/hw/i386/x86.c b/hw/i386/x86.c index dc7f0d56b01..0ea5453403d 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -147,7 +147,7 @@ static const CPUArchIdList *x86_possible_cpu_arch_ids(M= achineState *ms) return ms->possible_cpus; } =20 -static void x86_nmi(NMIState *n, int cpu_index, Error **errp) +static void x86_nmi(NMIState *ns, Error **errp) { /* cpu index isn't used */ CPUState *cs; diff --git a/hw/intc/m68k_irqc.c b/hw/intc/m68k_irqc.c index 68ddb5351be..bc41b44d455 100644 --- a/hw/intc/m68k_irqc.c +++ b/hw/intc/m68k_irqc.c @@ -70,7 +70,7 @@ static void m68k_irqc_instance_init(Object *obj) qdev_init_gpio_in(DEVICE(obj), m68k_set_irq, M68K_IRQC_LEVEL_NUM); } =20 -static void m68k_nmi(NMIState *n, int cpu_index, Error **errp) +static void m68k_nmi(NMIState *n, Error **errp) { m68k_set_irq(n, M68K_IRQC_LEVEL_7, 1); } diff --git a/hw/m68k/q800-glue.c b/hw/m68k/q800-glue.c index ac9062c6488..b13e5ef95f1 100644 --- a/hw/m68k/q800-glue.c +++ b/hw/m68k/q800-glue.c @@ -159,7 +159,7 @@ static void glue_auxmode_set_irq(void *opaque, int irq,= int level) s->auxmode =3D level; } =20 -static void glue_nmi(NMIState *n, int cpu_index, Error **errp) +static void glue_nmi(NMIState *n, Error **errp) { GLUEState *s =3D GLUE(n); =20 diff --git a/hw/misc/macio/gpio.c b/hw/misc/macio/gpio.c index 1a7c534d652..1bdca728f97 100644 --- a/hw/misc/macio/gpio.c +++ b/hw/misc/macio/gpio.c @@ -188,7 +188,7 @@ static void macio_gpio_reset(DeviceState *dev) macio_set_gpio(s, 1, true); } =20 -static void macio_gpio_nmi(NMIState *n, int cpu_index, Error **errp) +static void macio_gpio_nmi(NMIState *n, Error **errp) { macio_set_gpio(MACIO_GPIO(n), 9, true); macio_set_gpio(MACIO_GPIO(n), 9, false); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index c0cb45dbfbc..8676be7bbb1 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -3552,7 +3552,7 @@ static void pnv_cpu_do_nmi(PnvChip *chip, PowerPCCPU = *cpu, void *opaque) async_run_on_cpu(CPU(cpu), pnv_cpu_do_nmi_on_cpu, RUN_ON_CPU_HOST_INT(= 0)); } =20 -static void pnv_nmi(NMIState *n, int cpu_index, Error **errp) +static void pnv_nmi(NMIState *ns, Error **errp) { PnvMachineState *pnv =3D PNV_MACHINE(qdev_get_machine()); int i; diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index b79828b4e90..189334b9f0a 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3550,7 +3550,7 @@ void spapr_do_system_reset_on_cpu(CPUState *cs, run_o= n_cpu_data arg) } } =20 -static void spapr_nmi(NMIState *n, int cpu_index, Error **errp) +static void spapr_nmi(NMIState *ns, Error **errp) { CPUState *cs; =20 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 4f7861dbbb7..5d8a73a63df 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -725,7 +725,7 @@ static HotplugHandler *s390_get_hotplug_handler(Machine= State *machine, return NULL; } =20 -static void s390_nmi(NMIState *n, int cpu_index, Error **errp) +static void s390_nmi(NMIState *ns, Error **errp) { s390_cpu_restart(S390_CPU(first_cpu)); } --=20 2.53.0 From nobody Wed Aug 26 07:24:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1786463443; cv=none; d=zohomail.com; s=zohoarc; b=SpdbbybGxTkjyjITLQvlBm/qt2GCbgbpq5FzHy7YSV6+dCZXhc1R7/rOnmOnjFMbd9yCdsrV0YKwf9CPocXX4Mu8zs7XCRvMnToCegcnGl3eeHeUEpnLBchCvLb5PVCaz957tPXsomNU1WxILokVEQEWeSFd/hSc6U7dj8vsXvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786463443; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9SNNbFWXkO5xJkw3gfIEyPOGK5pvSUHYIpq0lvVOhio=; b=Ah0PbOGU/rIXe9Fsv2/FeG++q49Awy8oUM4wOsjDtSZnkId697LMOcnbO6NaVDBq+ge57RDrgX4OK9kthjkIryBVRwT/WSXpgT7XgxnzjM4RCoLxkZCs6oms7aN95KSHGbGAAR0sLW4OHli1TKXPYRpID0mOaW5CikGii6omyw8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178646344373354.39115891323547; Tue, 11 Aug 2026 08:50:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtok3-00039l-7W; Tue, 11 Aug 2026 11:50:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtok1-00037k-Jq for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:50:13 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtojv-0002OS-Mh for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:50:13 -0400 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67BDX5uR767022 for ; Tue, 11 Aug 2026 15:50:05 GMT Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g01nc1b0g-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 15:50:05 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-526da7e3c9dso577951cf.1 for ; Tue, 11 Aug 2026 08:50:05 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4997abeba23sm1000755e9.11.2026.08.11.08.50.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 08:50:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 9SNNbFWXkO5xJkw3gfIEyPOGK5pvSUHYIpq0lvVOhio=; b=HYmjksLXzooWgt8W TpKz2FICNvmYrnM49L5MdXjaDEt95qpYTYrPh/RwUtYXoL/jjgl3obxJJzNPBCLl mG1pPCnHizA2jLfCdBlxJdrM+ZZi6q3jUgizCJCEyzY0/3LI9U1j9+rjBPEHkCod 6BsvjXx7pwBSd0NcL5TusvtEq3rmpRsmgbjHm4pQNFzpT3fNrp6PuWF5wHVoVEYV RAtbKmxt/q/E3th/7WYHDmQtbNs/f7gBC7bQHUsWVkKDYiBiDKHdvMB3XKDESp3y dhMCxGAnypUPmL/ajjzIfSOAgYjUOqSgmORRUK56PgNduMgMsIMp/9rOw4kQSOy+ pne08A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786463405; x=1787068205; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=9SNNbFWXkO5xJkw3gfIEyPOGK5pvSUHYIpq0lvVOhio=; b=TCJW6mRyNtPozimHigfrBroey9OOBxrbXr9QyIjBiAlxFViIye7cNShAcrjZgo0eHi pbN8e93qHJll3vVc8aEKfUKyGWDYLC6vHUTXKNanw8jYXk5JnwiBhvYJ2ed5JKO/LNnv Y9pRluOsw/C8qxmTnPjEqiWciUJaoR48cFq5ctnLdS18pzExBSsHw95fRc/GQi5VxA5S Ys+i1huzgA57Wstj/MbLA1MZzQIuii6FBbLAJgwd2zHNu8dn8HP9FxqRkRNfI/WPmjPA TNT7b2AkJxqCW0ZcLQ73au1o9SdqRXFBt9WIU+f9UxSyPQrVaT4tNiA6jgpXQm4M9o1b Q7QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786463405; x=1787068205; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9SNNbFWXkO5xJkw3gfIEyPOGK5pvSUHYIpq0lvVOhio=; b=tXBnan5mojKi+PHgkcBF5bQ42HfbA00dI40hG2AVOSQy794EaZsy3gtmjCgJ5YFyid Rze5JsiDXjM+C/goJBN5q0eNtfVk0p2myZIkg/OsOMy7+uu4WWB0oYvo4FMu9bzPmI2n xvUT6rWwW+BsvYbZptvWJEyVh9SrcO6Nq3EZl3sCzGswUZjziM/n+S9u3FAIGCOQ0rY3 Bp6SC6TtbjzzPZV4rFa1FzS8ewtF9Vctt2DU9u4/Mi3Mbd8ir25sDjbpZUX0aLv6DlYT tZ1c+/pTE9BaOjfZWW/TW/xhDAGpsDNWk7TaEg6e54Fzklkca+TwRlC0au660F1JgagT 4b9A== X-Gm-Message-State: AOJu0Yx5LTwkR7/VcWgKzrWy6RHrG5xD9TTdIbnyKHIOtFpHJr47xczu pDAmqaGaf6L512HaOcX2PUpnPONySvTrCTyAGzgwdYqPSIhGtNuDhqWVWQLFL9rkhUgpJdX9wcs DNm8ZKn1gZMYUHY+4/QnPMNzsa2Ey4EGVhpouoPaKX4OAYVG/NhFH5rGObxQfDC9S0w== X-Gm-Gg: AR+sD13w3UYFjktsY+T3XisbfxLJWvfIgykYkL/Wp6cbQYb8ylwlEQjvCC5KeVyzC2T fuO6+As90PKXWXATjXPoGa5gMLJSR3pfCSGPVKaVic16mQW1CgdFMhJzVCA9JzJE+Rzfrl+3pv+ S+uNeBtvBffgLKZdiB2zIPVktWGOs7xAse/ma+S2apSI429ddbV4ed4+CnhbG3eKVEwiz2FMjl2 VPKMvyRathVz4J9Xh1H7H4FJ/1UxYBUrg4BS9FYpPkwYAkdz2+9ty9ILHn7JAjXDR2MXaZcNrrx dIfwMA3zpKZG3+C4NLPGX0WYIykofsy1XbDsuQLOfLXzuGtlpOnRs+6GexyI+4NcCBVj3ShgS1L 7jqIs/BU3nUa3HcNDlDWhnobxYfENB8dKsBKEZapxxw== X-Received: by 2002:a05:622a:11d0:b0:51b:f40b:2fb3 with SMTP id d75a77b69052e-52d584aa4aamr36648411cf.9.1786463405071; Tue, 11 Aug 2026 08:50:05 -0700 (PDT) X-Received: by 2002:a05:622a:11d0:b0:51b:f40b:2fb3 with SMTP id d75a77b69052e-52d584aa4aamr36648001cf.9.1786463404618; Tue, 11 Aug 2026 08:50:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Peter Maydell , Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Thomas Huth , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Richard Henderson , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 4/7] hw/nmi: Remove @cpu_index argument from nmi_inject() Date: Tue, 11 Aug 2026 17:49:27 +0200 Message-ID: <20260811154930.13915-5-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260811154930.13915-1-philmd@oss.qualcomm.com> References: <20260811154930.13915-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX/TwU7ho6UKyj AtnEgmsqwRTFvupT5f6dsT+mXSAsCQG8zNJJ0kTkI/Z8qD/AIjN8ZZCGkhy8FIfaPFufU2G0/dn nCz/tXbQ56MyOeRQtXjlAflBSBjH2Zs= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX7xMOqA0c3H5p G2KCOWtoX1C7Pa2bVXNqr0opuVT4dhX9feZAjQ2NboRxSdFyT7uJFPFwwXqbNPDXMohZ5qvW6qw wObZymjUzr1b4DGMmpvboNI08+KWmtNbRyez9Jm6vKH/CzsqmWaVY6K65VO7vPFhqLa/YrSeNYY JsUJohZgJUvq5hpNwJqHbvRbEKiS+iVpPIfP2EpDqlhfpS+3A0yh65hog+DDEvF4duN4Zy9RXcI J+HP+Yp3ru9KorFBfzy77cW6cpcNmnt/8jzDrG3XjW1+FmWAfSjuBsqY1Mf3jMCmPlUjwCD8jV/ peREdo2xkcZRKMfX+q+Fs5bCCO5vochGPan+GOsd2f7d3bd7mWSiVV0xYV3Y1w/Txs64HEiw3cd sP+Um9d7jHdf3RqgideGHung4DN3tZB0YKrgwQgtztq1D0gmHq/Nnb4gF9JCcjHwbTLhwTc9wkp /Wytq10M+gjXiKFY/sg== X-Authority-Analysis: v=2.4 cv=RY6gzVtv c=1 sm=1 tr=0 ts=6a7b44ad cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=VwQbUJbxAAAA:8 a=pGLkceISAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=FcA89Dn81BW4c7i3JskA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: JED8ha7-aXB-w87pWi4YUzIjN3r7zgDw X-Proofpoint-GUID: JED8ha7-aXB-w87pWi4YUzIjN3r7zgDw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-11_03,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 suspectscore=0 spamscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110132 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1786463448569158500 From: Philippe Mathieu-Daud=C3=A9 nmi_monitor_handle() is not related to the monitor, rename it as nmi_inject(). Return a boolean value indicating success / failure as recommended by the Error API since commit e3fe3988d7 ("error: Document Error API usage rules"). The 'cpu_index' argument is not used, remove it. This officially drops the current CPU for HMP command. Document nmi_inject() as suggested by Peter Maydell in https://lore.kernel.org/qemu-devel/CAFEAcA-yALySmCJLbitCmYpiZKUXJNOavGJG9RY= eo8fKqz7gcw@mail.gmail.com/. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Peter Maydell --- include/hw/core/nmi.h | 25 ++++++++++++++++++++++++- hw/core/nmi.c | 9 ++++----- hw/ipmi/ipmi.c | 3 +-- hw/watchdog/watchdog.c | 2 +- system/cpus.c | 2 +- hmp-commands.hx | 2 +- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/include/hw/core/nmi.h b/include/hw/core/nmi.h index 4c4ce79071d..2ff5be1e214 100644 --- a/include/hw/core/nmi.h +++ b/include/hw/core/nmi.h @@ -46,6 +46,29 @@ struct NMIClass { void (*nmi_monitor_handler)(NMIState *ns, Error **errp); }; =20 -void nmi_monitor_handle(int cpu_index, Error **errp); +/** + * nmi_inject: Inject an NMI, in a machine-specific way + * @errp: pointer to error object + * + * This function injects an NMI, in a machine-specific way. The + * intention is that this should typically trigger a guest kernel + * dump or reboot, and might happen as a result of user request + * from the monitor, watchdog timeouts, and similar events. + * (For example on the x86 PC it triggers an NMI on all CPUs, + * and on s390 it triggers the RESTART interrupt on the first CPU.) + * + * The NMI is injected by looking for QOM objects which + * implement the TYPE_NMI interface, and calling their nmi_monitor_handler + * method. Usually it is the machine model class that implements + * this interface. + * + * Not all machines implement NMI handling; this function + * will return an error if used on a machine which does not + * implement NMIs. + * + * On success, return %true. + * On failure, store an error through @errp and return %false. + */ +bool nmi_inject(Error **errp); =20 #endif /* NMI_H */ diff --git a/hw/core/nmi.c b/hw/core/nmi.c index ff6454437c1..2d890f2995d 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -22,11 +22,8 @@ #include "qemu/osdep.h" #include "hw/core/nmi.h" #include "qapi/error.h" -#include "qemu/module.h" -#include "monitor/monitor.h" =20 struct do_nmi_s { - int cpu_index; Error *err; bool handled; }; @@ -54,19 +51,21 @@ static int nmi_children(Object *o, struct do_nmi_s *ns) return object_child_foreach_recursive(o, do_nmi, ns); } =20 -void nmi_monitor_handle(int cpu_index, Error **errp) +bool nmi_inject(Error **errp) { struct do_nmi_s ns =3D { - .cpu_index =3D cpu_index, .err =3D NULL, .handled =3D false }; =20 if (nmi_children(object_get_root(), &ns)) { error_propagate(errp, ns.err); + return false; } else if (!ns.handled) { error_setg(errp, "machine does not provide NMIs"); + return false; } + return true; } =20 static const TypeInfo nmi_info =3D { diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c index 74818ff3cea..dedf23cb997 100644 --- a/hw/ipmi/ipmi.c +++ b/hw/ipmi/ipmi.c @@ -59,8 +59,7 @@ static int ipmi_do_hw_op(IPMIInterface *s, enum ipmi_op o= p, int checkonly) if (checkonly) { return 0; } - /* We don't care what CPU we use. */ - nmi_monitor_handle(0, NULL); + nmi_inject(NULL); return 0; =20 case IPMI_SHUTDOWN_VIA_ACPI_OVERTEMP: diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 0842fe373ae..5f764a0c1b8 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -81,7 +81,7 @@ void watchdog_perform_action(void) =20 case WATCHDOG_ACTION_INJECT_NMI: qapi_event_send_watchdog(WATCHDOG_ACTION_INJECT_NMI); - nmi_monitor_handle(0, NULL); + nmi_inject(NULL); break; =20 default: diff --git a/system/cpus.c b/system/cpus.c index 97e5a5edee2..04809698de4 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -926,6 +926,6 @@ exit: =20 void qmp_inject_nmi(Error **errp) { - nmi_monitor_handle(monitor_get_cpu_index(monitor_cur()), errp); + nmi_inject(errp); } =20 diff --git a/hmp-commands.hx b/hmp-commands.hx index a1b77ae4044..b21f361ada0 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -869,7 +869,7 @@ ERST .cmd =3D hmp_nmi, }, SRST -``nmi`` *cpu* +``nmi`` Inject an NMI, in a machine-specific way. Not all machines implement NMI handling. ERST --=20 2.53.0 From nobody Wed Aug 26 07:24:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1786463513; cv=none; d=zohomail.com; s=zohoarc; b=QEk05bdKnbU7Zp4TCeNFZF0Ri63FsrSKxg27FPPCEN0jLufKr6vqPTkuNyCCiiWTuxcv7fHpiU0q/HG4mWEbxKAU6tLaNDUpm+fXtUPaxdYWEM7Ib4XiSbm8ujRXToGUuMbnGH3Y0XKazU5WGfgyu8qNau6+A047BElWgcn9SO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786463513; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0edfJ/cchANNWiukKnZOf9OSLonHl948sTIY1UKAj1Y=; b=MJp7nGaJmW0MiM2XyRBftpEgxDm5sjpy2qjV+zLDXTSLt6SGDWGqef/XwaB+HY8C5TxabRJXHlQpOEY+YUzUYvJhKJo2pWJjA9orODlRiUp8muvIFNPAkKtUyFzptZJ2f5/1cDfUwTuMT8gHQ6qWAqchWuCsJOtgJa+Y50mpWRM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786463513624536.758957085157; Tue, 11 Aug 2026 08:51:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtolH-0003xP-R3; Tue, 11 Aug 2026 11:51:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtoky-0003lU-Es for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:51:13 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtok2-0002et-Iu for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:51:09 -0400 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67BDX5uT767022 for ; Tue, 11 Aug 2026 15:50:13 GMT Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g01nc1b12-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 15:50:13 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-52ce3c7cb2eso758771cf.3 for ; Tue, 11 Aug 2026 08:50:13 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4997abeba30sm1307555e9.9.2026.08.11.08.50.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 08:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 0edfJ/cchANNWiukKnZOf9OSLonHl948sTIY1UKAj1Y=; b=ABVZCzW7tbiA6S/G 01R+5ADQJHZXvp1qb0zb3jwZ/ov50hAvSGZuAlTlgwEtVMxUzjnI8s3rPaJ6XIRB C6dwKrEYFfYzM0tfGPda9b6IBc78CKjtcXG7Tlfkq4pzcOPNXTRjCfU5hzHb4rHr t3nyV6qxxFy7rnfjI85yryGv/TYeptmWxgxetYVtbdvP2OnIZmhrKb1njSRbV1hk DrkAT3XeYYU+KZi5CLniKkLEMtHpQcu3/WXeg9e2LH49qTncGtQplBHF4LlWcNPX c8wggd7yjlgXKlBoe61bvbHpOH59mJep4Bm2L4z3t0mU41pfd0aoJf5kOR3tYEmd RPqNBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786463413; x=1787068213; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=0edfJ/cchANNWiukKnZOf9OSLonHl948sTIY1UKAj1Y=; b=Kp9XwsqJPyyffCbHyz0VBowHWvWBEgXrxeH6V7b136PU9BmRLZHhHwiGpOQkReyS+n o8qOFo9XGV8VniLfo6rrhueawnvG9vRSmFFZpTa035XZNzAcUO+wrEVb8xnHk/v4pi6C +/cQqs1CKeLY9z2i73EQqOeb+qgvufbpGxp4x0IdB9gID3C+MN2bigmYL1sMcH8IgtiW hfrWTWCQB8ZaNbMqrkyv8R4TgGDvG5meeH2JC6LttwtwhauAgHLPfx232p9Y5YT55cD2 tvCgGGFmCba+eolB/yFTNwgbtu6IW/42Qafh5yu9c2FWo53Hm90T6uivCmrORGJ+k+C0 t89Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786463413; x=1787068213; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=0edfJ/cchANNWiukKnZOf9OSLonHl948sTIY1UKAj1Y=; b=AZmDi2+V/ZBGuGK49F0FqBWZeSyntE+L5S8e1BMgps5EVROUradvn3U4GvDxT0J/SR XnhTwZYoA+VOQ8TYn9vQxcXaUTZ8LxEdi+rRq88hIdEbb1k8KYt2K4HVYxmajJz32A9c w1NonImzXqFnHZQwfL8uMrQmEgf27LxhLIMNfk5aC1PjxnYNn5+h19ChapmF37bBJbuJ Z9LhvjuNboBngXWw5NHZ0rCvJ0+RYoYuJAd7LtbjgJdLZTSaZNh+ZaGGB8xRvjxJ8sWL Wk9dLXfkTh5zOaxpHg/WIByvf09IV+/jWdJ2TFvzPUiS+725KRb4vmxmJCYNkZKFqyaF mevg== X-Gm-Message-State: AOJu0YzSpHIYNbgJNKj2V4PBIzT+R4uOB0iaYcInPK8DlZYmDfexUZ1o Y0uQfFyQe0gRiHUbWa0WgOlluwXHHaDX6NGa4NEzkqs4DlI0GumTxPp55B5fF49uzJ8nzX+N4kb ofZT3Quh+AV8NR6Mw1zzlqB1olIk+hFck4V7/0DuJHJfHEGr+MlJ05jsjm1xN5KttCA== X-Gm-Gg: AR+sD11M0X8rF8s3Cev+cL6KZV4893WMMqv+f1v8sy6nWUrqHwBJjtznAngIS+ihu3s IyGZTeovjlMJUJWeFzBJgqMpvisiTzbSbmihf1VoJTY1SadFu48voJYhJVw4WWzzlmXKJsXqR3c Pd913TB/5KX7+q5tclu52Eh2rfyi6JlBZwWKCqwjiofjV8Dy1vFaRkfDwe9U8l4AoAEgZRavgt8 9eMzyPFkrlXlWPiroD5IIelbkgzfSctvMbEnUG8FMdRcNUiN/LgAElu9NXAASB6Z0Eoity21UA8 Z18GIj8gBfUqdjdRUtqI9HW6eAUhb1nI7yeKiAOJzpCCXlYu+0WaIB14z/AcjjheW1vNr6dhWjG q65OgXu+tAkPnyMd38j7JwKof6M2Xa8PgXDoAaNPozQ== X-Received: by 2002:a05:622a:2508:b0:51e:47a4:4851 with SMTP id d75a77b69052e-52d58498252mr40396331cf.8.1786463412548; Tue, 11 Aug 2026 08:50:12 -0700 (PDT) X-Received: by 2002:a05:622a:2508:b0:51e:47a4:4851 with SMTP id d75a77b69052e-52d58498252mr40395881cf.8.1786463412125; Tue, 11 Aug 2026 08:50:12 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Peter Maydell , Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Thomas Huth , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , "Michael S. Tsirkin" , Paolo Bonzini , Laurent Vivier , Mark Cave-Ayland , Nicholas Piggin , Aditya Gupta , Glenn Miles , Harsh Prateek Bora , Ilya Leoshkevich , David Hildenbrand , Halil Pasic , Christian Borntraeger , Eric Farman , Matthew Rosato , Cornelia Huck Subject: [PATCH v4 5/7] hw/nmi: Rename nmi_monitor_handler() -> raise_nmi() Date: Tue, 11 Aug 2026 17:49:28 +0200 Message-ID: <20260811154930.13915-6-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260811154930.13915-1-philmd@oss.qualcomm.com> References: <20260811154930.13915-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX1SyVqNVq85+G YnFyTe+MTN3Ob0DD/9930f0+UC7t2inXhS3zb+V/+zC6CbsEicBSC2dNytCFFV3JPsdi2zs/yTs zMb7ZGbeHNJGwYxbrFITJlF168XjlYw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX4nzVvEZ6m6ie R2V+Op6ptyAdUbCjmYaJV6beY01a/dQy9hoUydk4x8YHBqXh7KDJJOFQxvhW5ipaml5jf7VNynJ ozrPgbJdjqxDzEgrEMqGUp/NvyWo9JJ/Qakh2bj+eYBcxHUZhkUlw004nVZwN4N1/xIl5ZBOff0 uK6/qdwWNEz/0MbH815wxon3Etyc2gzM5eB3vrXW3/2Gmj7ojLqmmP4LIuKhRpLbaY29oKo4u3v h4X86uWs9YkHe+5y8lA3DI8wdffnsYV+PpKrvrEEJb+vimSFLoWGgW2MS2StxZbgJJKHGc0PVAe lmxXrJQftDq1rfUYtxrOepAJkbxqNwRFnG43hGX+OFaDUdbBNqeNMfUAkHsZFQ/yylstGluxJwX +uWU1Nv5+haQldeUbvmbaeFF4GZYQJB6Yf+LeECHg86/rXMmacxGfPPtFIp39H/o8BZbpdDEM16 lRG41d7B1LTdjleemcA== X-Authority-Analysis: v=2.4 cv=RY6gzVtv c=1 sm=1 tr=0 ts=6a7b44b5 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=XQsbmRuMgCUMduHJsesA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-ORIG-GUID: LGF2EdLzD7X8OcyZu4rYHAiSCDckoCzI X-Proofpoint-GUID: LGF2EdLzD7X8OcyZu4rYHAiSCDckoCzI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-11_03,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 suspectscore=0 spamscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110132 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1786463515869158500 nmi_monitor_handler() is not related to the monitor, rename it as raise_nmi(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/hw/core/nmi.h | 10 ++++++---- hw/core/nmi.c | 2 +- hw/hppa/machine.c | 2 +- hw/i386/x86.c | 2 +- hw/intc/m68k_irqc.c | 2 +- hw/m68k/q800-glue.c | 2 +- hw/misc/macio/gpio.c | 2 +- hw/ppc/pnv.c | 2 +- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- 10 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/hw/core/nmi.h b/include/hw/core/nmi.h index 2ff5be1e214..1ba6f393449 100644 --- a/include/hw/core/nmi.h +++ b/include/hw/core/nmi.h @@ -38,12 +38,14 @@ struct NMIClass { InterfaceClass parent_class; =20 /** - * nmi_monitor_handler: Callback to handle NMI notifications. - * + * raise_nmi: Callback to handle NMI notifications. * @ns: Class #NMIState state * @errp: pointer to error object + * + * Called by nmi_inject() to perform the machine-specific + * action when a NMI is requested. */ - void (*nmi_monitor_handler)(NMIState *ns, Error **errp); + void (*raise_nmi)(NMIState *ns, Error **errp); }; =20 /** @@ -58,7 +60,7 @@ struct NMIClass { * and on s390 it triggers the RESTART interrupt on the first CPU.) * * The NMI is injected by looking for QOM objects which - * implement the TYPE_NMI interface, and calling their nmi_monitor_handler + * implement the TYPE_NMI interface, and calling their raise_nmi * method. Usually it is the machine model class that implements * this interface. * diff --git a/hw/core/nmi.c b/hw/core/nmi.c index 2d890f2995d..a6edf4fbf01 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -37,7 +37,7 @@ static int do_nmi(Object *o, void *opaque) NMIClass *nc =3D NMI_GET_CLASS(n); =20 ns->handled =3D true; - nc->nmi_monitor_handler(n, &ns->err); + nc->raise_nmi(n, &ns->err); if (ns->err) { return -1; } diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 2b44debc388..717cfde61da 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -851,7 +851,7 @@ static void hppa_machine_common_class_init(ObjectClass = *oc, const void *data) mc->default_ram_id =3D "hppa.ram"; mc->default_nic =3D "tulip"; =20 - nc->nmi_monitor_handler =3D hppa_nmi; + nc->raise_nmi =3D hppa_nmi; } =20 static void HP_B160L_machine_init_class_init(ObjectClass *oc, const void *= data) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 0ea5453403d..d1414ff63db 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -389,7 +389,7 @@ static void x86_machine_class_init(ObjectClass *oc, con= st void *data) mc->get_default_cpu_node_id =3D x86_get_default_cpu_node_id; mc->possible_cpu_arch_ids =3D x86_possible_cpu_arch_ids; mc->kvm_type =3D x86_kvm_type; - nc->nmi_monitor_handler =3D x86_nmi; + nc->raise_nmi =3D x86_nmi; =20 object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", x86_machine_get_smm, x86_machine_set_smm, diff --git a/hw/intc/m68k_irqc.c b/hw/intc/m68k_irqc.c index bc41b44d455..29f758dafd1 100644 --- a/hw/intc/m68k_irqc.c +++ b/hw/intc/m68k_irqc.c @@ -97,7 +97,7 @@ static void m68k_irqc_class_init(ObjectClass *oc, const v= oid *data) InterruptStatsProviderClass *ic =3D INTERRUPT_STATS_PROVIDER_CLASS(oc); =20 device_class_set_props(dc, m68k_irqc_properties); - nc->nmi_monitor_handler =3D m68k_nmi; + nc->raise_nmi =3D m68k_nmi; device_class_set_legacy_reset(dc, m68k_irqc_reset); dc->vmsd =3D &vmstate_m68k_irqc; ic->get_statistics =3D m68k_irqc_get_statistics; diff --git a/hw/m68k/q800-glue.c b/hw/m68k/q800-glue.c index b13e5ef95f1..265af90a8e6 100644 --- a/hw/m68k/q800-glue.c +++ b/hw/m68k/q800-glue.c @@ -237,7 +237,7 @@ static void glue_class_init(ObjectClass *klass, const v= oid *data) dc->vmsd =3D &vmstate_glue; device_class_set_props(dc, glue_properties); rc->phases.hold =3D glue_reset_hold; - nc->nmi_monitor_handler =3D glue_nmi; + nc->raise_nmi =3D glue_nmi; } =20 static const TypeInfo glue_info_types[] =3D { diff --git a/hw/misc/macio/gpio.c b/hw/misc/macio/gpio.c index 1bdca728f97..db0c4ecb3cf 100644 --- a/hw/misc/macio/gpio.c +++ b/hw/misc/macio/gpio.c @@ -201,7 +201,7 @@ static void macio_gpio_class_init(ObjectClass *oc, cons= t void *data) =20 device_class_set_legacy_reset(dc, macio_gpio_reset); dc->vmsd =3D &vmstate_macio_gpio; - nc->nmi_monitor_handler =3D macio_gpio_nmi; + nc->raise_nmi =3D macio_gpio_nmi; } =20 static const TypeInfo macio_gpio_init_info =3D { diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 8676be7bbb1..a9f74245866 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -3583,7 +3583,7 @@ static void pnv_machine_class_init(ObjectClass *oc, c= onst void *data) mc->default_ram_size =3D 1 * GiB; mc->default_ram_id =3D "pnv.ram"; ispc->print_info =3D pnv_pic_print_info; - nc->nmi_monitor_handler =3D pnv_nmi; + nc->raise_nmi =3D pnv_nmi; =20 object_class_property_add_bool(oc, "hb-mode", pnv_machine_get_hb, pnv_machine_set_hb); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 189334b9f0a..ad571481c44 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4652,7 +4652,7 @@ static void spapr_machine_class_init(ObjectClass *oc,= const void *data) mc->nvdimm_supported =3D true; smc->resize_hpt_default =3D SPAPR_RESIZE_HPT_ENABLED; fwc->get_dev_path =3D spapr_get_fw_dev_path; - nc->nmi_monitor_handler =3D spapr_nmi; + nc->raise_nmi =3D spapr_nmi; vhc->cpu_in_nested =3D spapr_cpu_in_nested; vhc->deliver_hv_excp =3D spapr_exit_nested; vhc->hypercall =3D emulate_spapr_hypercall; diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 5d8a73a63df..a59346a2120 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -830,7 +830,7 @@ static void ccw_machine_class_init(ObjectClass *oc, con= st void *data) hc->plug =3D s390_machine_device_plug; hc->unplug_request =3D s390_machine_device_unplug_request; hc->unplug =3D s390_machine_device_unplug; - nc->nmi_monitor_handler =3D s390_nmi; + nc->raise_nmi =3D s390_nmi; mc->default_ram_id =3D "s390.ram"; mc->default_nic =3D "virtio-net-ccw"; dsi->qmp_dump_skeys =3D s390_qmp_dump_skeys; --=20 2.53.0 From nobody Wed Aug 26 07:24:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1786463466; cv=none; d=zohomail.com; s=zohoarc; b=es3KjRxuXKXXfJhk+acsAMpWPFGJ+AyFSyjNeKkmaQ3saxkP5k0vgKatOWWr3bVE/UiUE+/N1MeAEwGDve7RDwTjABbxHt3t3zWaFcnUVwEZrVayYc5z8cm5LqNFaOCajzYl3mtCEOhBEht60l0T75dpafF71PFnwC0xgQtMO1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786463466; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=x57BgP3ZuV25AGgYimgmWz0gswBw1JGdpZFwZdSIK+M=; b=Rv0L52WSKOaSxpixznTDcCB1XYwGbNOjrfp/oP6orz5HfnCac5GPfiJoShpZYm2zpNdqYb8FugH3UeWJ8ntJb6DdAUY7gGlLAlcIGucBxXWKerZmnLRtYBzoAKXzcAxCBpi4EVTh2kFd9HmkioD95tfUYySQRXJyaO9EYb8b0t0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786463466705926.3908912471325; Tue, 11 Aug 2026 08:51:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtokJ-0003Q4-51; Tue, 11 Aug 2026 11:50:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtokG-0003Om-Vc for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:50:28 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtokB-0002pv-DM for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:50:28 -0400 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67BDX7Q5694276 for ; Tue, 11 Aug 2026 15:50:22 GMT Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g049grt06-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 15:50:21 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-52827090cc5so313001cf.0 for ; Tue, 11 Aug 2026 08:50:21 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4997aaa4d2fsm1674885e9.1.2026.08.11.08.50.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 08:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= x57BgP3ZuV25AGgYimgmWz0gswBw1JGdpZFwZdSIK+M=; b=SQ0Mq6QcM/b9JjLq 5A4Xa7VosO8vmvSeuczpIAlER1OyyM9ctiHgac5eAVkcpd++zFzEhsa+TwNJdPXf iaY3F5vPb52QBRJbLJ0sGrNIF7NeSoyUvQpoGgXZ4RgDKpNFjAp0cPow0k1XSnET avjxktrSjz1L5XI77t3JeBc4fbkY48IgCFmQqV/XWDSuE1e2KIv2Ybhm7ZQ2kcyK 0xVRXUOyZr7RIgSQc8Xw1D5qSqO9Znj/Xb3VIHgyTWAKfvd3g5hO6J3TcrIYiPBk hlkmKY4YjBcfzLaWJKQe1xMNgxJloZsJwtrSKYbXRxR94qAgm0I0kBfDb9dYLf33 twDo4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786463421; x=1787068221; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=x57BgP3ZuV25AGgYimgmWz0gswBw1JGdpZFwZdSIK+M=; b=gC6OSVGcjpGYc3BU/1ujPcW+vfOYb6PIYwzxwwwYCjpbFidULJsQFI0t5BnF8ebp2o cT7aD8ptf8IO5ZmoZ0H7p/vUB5EIrLrC/27Um1VKmNLkAEiEcun8Y8aVG7buGMgtQZ89 7lAxKD85K5xxrG4FbDfpO9aUyPHmLa2o5vskLFHU2LSLhOmTTSls8VHyiZObAAAou4bz K8klKz1FEi4sY3JlxmxjfwWPwXnw2v3SUXVoo50fjBgcKutLKcIxgal+Qqi0bxUGdoVU s+U/OQ/9+DHrfeq3mkw4hrbNzbR/l3MfxsOZSA2sq6iqpKJmBQG+48DuOO8h1P9FyiGl xCIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786463421; x=1787068221; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=x57BgP3ZuV25AGgYimgmWz0gswBw1JGdpZFwZdSIK+M=; b=tWCFQPh3x7UyHu8vOxjSw9p8vkO5HagzuQq5n1Q2BcxRAsleJnxDx+umCHB2dwqbFP +KYDMFRP8WUVjcBPZykYTjEsZzgYEVpiS0ZNs2tmph5WArlhwCxayrszkcghlUMsvTnb eUvx+1/hQ0JBBS1yEAw/3I6Iy4OFpL6SuYxiUeeLavZa2Cq/wuY/8BoT9mQJxq0mc2KA IzOEJmftfZ6boJBl6CVNyEsOpCVroUDkhhE3N9fGu72k/hvJvCiEDyiiMm1EtgBsRIG0 BrbPVY2W2Drn0MxyMcie24ekXZOMS1OtBowQ1VeGyGPNbnKBl52VTYSvqnavbTZONyca ueFg== X-Gm-Message-State: AOJu0YzxdfCjnzMpQisOl6WociqraIEiSEr7+ubYCsgmRRocgs1eIskg 3BCGACDzMUEulsnsytmo1oqy7A2A8+D8zvASbWdsxLrYE46QyiHtHmX8qfTlcjct6zoRzr1tW9L Um0jCbYxmExrt8OBjAQXV8Yh7BAnfPWINryUIEMr8aao2gWnwlNDH3G1NeBLY5+xOTA== X-Gm-Gg: AR+sD10ma+wws7+gLJICQKFYIKZE2kPt1wN6Mxy082HruryH5v/ssQRWGhYa5Y93/oY M/Q0g5Jf2St9/GM8ws2O7t756qylXGcShBR1AJh0g4TXVF6STOO1IoDApJBRLs/pVCYaJe+wjkf Ms+qSnnGgrLr50TtD1HnPzm1dZbglOIQqyrfK+T9tdQpv3rIQVdJSdsI0R/WFNOoXwBMS1ppPbj NUhC6hYlpkNdBrhfL6wQV6eqLWlDrWTF4Ck7VS5VqNdHuotyorCYhku7CXkocH9aaCDKgne3Cc5 Z0edf3p0QJ0Ke4eAgV1DCZ0f7yxneoNkGGXccf7/DnYrFpivdSw7b2G3gadXaPhtjTIj5sDomDi B14l4kQNetMAtU8L/Df+YE5gaqvsM4zQQPoPd5MRLQw== X-Received: by 2002:ac8:5850:0:b0:516:d83d:b28 with SMTP id d75a77b69052e-52d6030e8e6mr11912361cf.17.1786463421142; Tue, 11 Aug 2026 08:50:21 -0700 (PDT) X-Received: by 2002:ac8:5850:0:b0:516:d83d:b28 with SMTP id d75a77b69052e-52d6030e8e6mr11911651cf.17.1786463420680; Tue, 11 Aug 2026 08:50:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Peter Maydell , Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Thomas Huth , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , "Michael S. Tsirkin" , Paolo Bonzini , Laurent Vivier , Mark Cave-Ayland , Nicholas Piggin , Aditya Gupta , Glenn Miles , Harsh Prateek Bora , Ilya Leoshkevich , David Hildenbrand , Halil Pasic , Christian Borntraeger , Eric Farman , Matthew Rosato , Cornelia Huck Subject: [PATCH v4 6/7] hw/nmi: Remove unused @errp argument from raise_nmi() Date: Tue, 11 Aug 2026 17:49:29 +0200 Message-ID: <20260811154930.13915-7-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260811154930.13915-1-philmd@oss.qualcomm.com> References: <20260811154930.13915-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfXzjXNHKqOdz+L AXLW2hHybvVH7edgCBPOUuSwRvHYjfkbjHOu/NF2U0Ocf3Fy3htf2gSfLoU3yJDqdg8dOouv36m 6XW++okuP4M0bk/Jw9W1EO/a8FR0VRA= X-Proofpoint-ORIG-GUID: 3UH6673fSB0vwdcuqbyoz30vwyQAbhIY X-Proofpoint-GUID: 3UH6673fSB0vwdcuqbyoz30vwyQAbhIY X-Authority-Analysis: v=2.4 cv=cvarVV4i c=1 sm=1 tr=0 ts=6a7b44bd cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=799TcV0OOjXjlcq3EAkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX63S0laspn6fR pRFNAeXD6CVISBKnAT4P78u31noEYpI0SqFentyh0p5xOlYVsuOAC0x8lhPVOASPHxwJqaQ9cNi pvfrF4lLt1NfxRG8ErewDma9zRsr0YD9yoA22w9K1CoavPWOKoGrScL/h05sg5b8tJKubP4zvOo lpo7x+1Zp+XDeDMRkUBPCEm154KQLDK1zI9tb2J9ngmstn/uoeRgfFc0uwweJocTy+XbpdRYYLk p0J507JF1ju2kJh1D0FN9xxOAyyN/+3MagP6k/GQMM7wOiNYVRNplJjgIkH2LK4MgLobLeXdszn mZ9niBkITurA/6nZayOWK3goTiOis8r1I+D5+LUR3Lx9navC9D7EHu8C0qlOJAk48ftDOOpAGJ8 0aTKtDsZVtIU6iivQudy1oDeMfJOZYCeMwWoAT/sx5DZxw4bRJqPAipLlnqAWVmaAnlCAisBVCm Dqw+xAblTzGDTdL15XA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-11_03,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 impostorscore=0 adultscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110132 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1786463467801158500 Not a single handler update @errp. The single user is nmi_inject() filling with "machine does not provide NMIs". Remove the unused argument from the raise_nmi() callback, simplifying the methods in hw/core/nmi.c. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/hw/core/nmi.h | 3 +-- hw/core/nmi.c | 32 ++++++-------------------------- hw/hppa/machine.c | 2 +- hw/i386/x86.c | 2 +- hw/intc/m68k_irqc.c | 2 +- hw/m68k/q800-glue.c | 2 +- hw/misc/macio/gpio.c | 2 +- hw/ppc/pnv.c | 2 +- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- 10 files changed, 15 insertions(+), 36 deletions(-) diff --git a/include/hw/core/nmi.h b/include/hw/core/nmi.h index 1ba6f393449..d900d85e40c 100644 --- a/include/hw/core/nmi.h +++ b/include/hw/core/nmi.h @@ -40,12 +40,11 @@ struct NMIClass { /** * raise_nmi: Callback to handle NMI notifications. * @ns: Class #NMIState state - * @errp: pointer to error object * * Called by nmi_inject() to perform the machine-specific * action when a NMI is requested. */ - void (*raise_nmi)(NMIState *ns, Error **errp); + void (*raise_nmi)(NMIState *ns); }; =20 /** diff --git a/hw/core/nmi.c b/hw/core/nmi.c index a6edf4fbf01..c44b0cf892d 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -23,45 +23,25 @@ #include "hw/core/nmi.h" #include "qapi/error.h" =20 -struct do_nmi_s { - Error *err; - bool handled; -}; - static int do_nmi(Object *o, void *opaque) { - struct do_nmi_s *ns =3D opaque; + bool *handled =3D opaque; NMIState *n =3D (NMIState *) object_dynamic_cast(o, TYPE_NMI); =20 if (n) { - NMIClass *nc =3D NMI_GET_CLASS(n); - - ns->handled =3D true; - nc->raise_nmi(n, &ns->err); - if (ns->err) { - return -1; - } + *handled =3D true; + NMI_GET_CLASS(n)->raise_nmi(n); } =20 return 0; } =20 -static int nmi_children(Object *o, struct do_nmi_s *ns) -{ - return object_child_foreach_recursive(o, do_nmi, ns); -} - bool nmi_inject(Error **errp) { - struct do_nmi_s ns =3D { - .err =3D NULL, - .handled =3D false - }; + bool handled =3D false; =20 - if (nmi_children(object_get_root(), &ns)) { - error_propagate(errp, ns.err); - return false; - } else if (!ns.handled) { + object_child_foreach_recursive(object_get_root(), do_nmi, &handled); + if (!handled) { error_setg(errp, "machine does not provide NMIs"); return false; } diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 717cfde61da..98931481b20 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -829,7 +829,7 @@ static void hppa_machine_reset(MachineState *ms, ResetT= ype type) cpu[0]->env.cmdline_or_bootorder =3D 'c'; } =20 -static void hppa_nmi(NMIState *ns, Error **errp) +static void hppa_nmi(NMIState *ns) { CPUState *cs; =20 diff --git a/hw/i386/x86.c b/hw/i386/x86.c index d1414ff63db..f8ba3244e22 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -147,7 +147,7 @@ static const CPUArchIdList *x86_possible_cpu_arch_ids(M= achineState *ms) return ms->possible_cpus; } =20 -static void x86_nmi(NMIState *ns, Error **errp) +static void x86_nmi(NMIState *ns) { /* cpu index isn't used */ CPUState *cs; diff --git a/hw/intc/m68k_irqc.c b/hw/intc/m68k_irqc.c index 29f758dafd1..47f626c0fa0 100644 --- a/hw/intc/m68k_irqc.c +++ b/hw/intc/m68k_irqc.c @@ -70,7 +70,7 @@ static void m68k_irqc_instance_init(Object *obj) qdev_init_gpio_in(DEVICE(obj), m68k_set_irq, M68K_IRQC_LEVEL_NUM); } =20 -static void m68k_nmi(NMIState *n, Error **errp) +static void m68k_nmi(NMIState *n) { m68k_set_irq(n, M68K_IRQC_LEVEL_7, 1); } diff --git a/hw/m68k/q800-glue.c b/hw/m68k/q800-glue.c index 265af90a8e6..223e7d9019c 100644 --- a/hw/m68k/q800-glue.c +++ b/hw/m68k/q800-glue.c @@ -159,7 +159,7 @@ static void glue_auxmode_set_irq(void *opaque, int irq,= int level) s->auxmode =3D level; } =20 -static void glue_nmi(NMIState *n, Error **errp) +static void glue_nmi(NMIState *n) { GLUEState *s =3D GLUE(n); =20 diff --git a/hw/misc/macio/gpio.c b/hw/misc/macio/gpio.c index db0c4ecb3cf..ba001f7b206 100644 --- a/hw/misc/macio/gpio.c +++ b/hw/misc/macio/gpio.c @@ -188,7 +188,7 @@ static void macio_gpio_reset(DeviceState *dev) macio_set_gpio(s, 1, true); } =20 -static void macio_gpio_nmi(NMIState *n, Error **errp) +static void macio_gpio_nmi(NMIState *n) { macio_set_gpio(MACIO_GPIO(n), 9, true); macio_set_gpio(MACIO_GPIO(n), 9, false); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index a9f74245866..f0413639f98 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -3552,7 +3552,7 @@ static void pnv_cpu_do_nmi(PnvChip *chip, PowerPCCPU = *cpu, void *opaque) async_run_on_cpu(CPU(cpu), pnv_cpu_do_nmi_on_cpu, RUN_ON_CPU_HOST_INT(= 0)); } =20 -static void pnv_nmi(NMIState *ns, Error **errp) +static void pnv_nmi(NMIState *ns) { PnvMachineState *pnv =3D PNV_MACHINE(qdev_get_machine()); int i; diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ad571481c44..e0678156e73 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3550,7 +3550,7 @@ void spapr_do_system_reset_on_cpu(CPUState *cs, run_o= n_cpu_data arg) } } =20 -static void spapr_nmi(NMIState *ns, Error **errp) +static void spapr_nmi(NMIState *ns) { CPUState *cs; =20 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index a59346a2120..c1ce7825650 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -725,7 +725,7 @@ static HotplugHandler *s390_get_hotplug_handler(Machine= State *machine, return NULL; } =20 -static void s390_nmi(NMIState *ns, Error **errp) +static void s390_nmi(NMIState *ns) { s390_cpu_restart(S390_CPU(first_cpu)); } --=20 2.53.0 From nobody Wed Aug 26 07:24:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1786463519; cv=none; d=zohomail.com; s=zohoarc; b=OvdtxZIHR7z2J8Y6PTznx4tLELHHiRChq9RHV2Zp699TLLI97fWaxPZF4/RLbj6nyat+0xjG51+5gKHp+bO7VGKoOYWskiHuQ3V7kDAQrq+3T43DTQawzLm9tN3P0v7jNcaj/y/BWDe69xnYbhi/fBlXL6xaaWO7ZDYVVkrLL5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786463519; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZbUZg/TBDW7F3x6+B7KTdUWQTRD7wzFTUQxMFnpy2VY=; b=WoUSsJX8KhJ9oDfK44LkdXf9ByHQCqoVievrfB+mvGAok/PNsAszoUG/6AXdy5mdPJNzEpnny8JWR0TozT1SRZonD0YVwHQCEo1K8mEdW6NEZ3oYJix02gZcHZhdMfphCuuJ9oJ/ciVRbOEEW4fREDLqRDIOmxwJ7z/tLJqbMBw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17864635193841007.2438709140526; Tue, 11 Aug 2026 08:51:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtolK-00046Y-5n; Tue, 11 Aug 2026 11:51:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtolC-0003uh-SJ for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:51:28 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtokI-0002xp-Dp for qemu-devel@nongnu.org; Tue, 11 Aug 2026 11:51:23 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67BDX3rS462323 for ; Tue, 11 Aug 2026 15:50:29 GMT Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g049mgrm1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 15:50:28 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-5174a236220so398931cf.3 for ; Tue, 11 Aug 2026 08:50:28 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4814a72a1fcsm5422065f8f.33.2026.08.11.08.50.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 08:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ZbUZg/TBDW7F3x6+B7KTdUWQTRD7wzFTUQxMFnpy2VY=; b=m6ZTWngV8ldItTH6 77FQsuOlMecSt2UXmDJhMr1Hq+GcBN5wvzCMQzncyg0h9NhGVYwOr7n4FL3Opaly dLFauk4CcU3CX7EikVZoziyUXkYvQhnVuz+WbjfUgnJRccJw5i6UEBU/hvRaEdCG Z7MGN2uRdvvj7e9gl32Wr+2BsA+HSh2aoeUjJ6UaU1HhRKQ8oA/GXdf2p3nnaiGB xyZ6tB+iaQhXBxMtLRZkevDInm8x7IFYI+OoRzitbuLvYxBEnspf/OwGg6YoTmjE ZY05Xv55T0mRnT6XS05BYGn+44N8Opr/bG3cDIe1BUngAWqC/5CLd6cyWSpM39qd xXWNxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786463428; x=1787068228; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ZbUZg/TBDW7F3x6+B7KTdUWQTRD7wzFTUQxMFnpy2VY=; b=OQ+iZj3JuDD2oOS5lM+0mZwI6b8a8uxWaG7hUpfQG7FA2pJZeJmTN3xlrUO3rmyU33 FAcX7XtuyCQqHQY07IpxiIH5Bpd5R3uk686I8DONJWEzj+zf9XxRv+z9Ioy2wMg3oJD0 8rcjh1DclofMvDYTUtCvmifp13Z6+EiwmITBvbaG5q6kxCyWovvt+RDLvT5wnZfwFT5f UBPCH5BObMo6W9VU61i1kNvzl+vLb0YSoWndMw8O7/65tjKe0vyI7Zrwmc/7ewvs7MlX adUzFw7mShRK1c4/Gp3r3CgtDLAv5iUj2f+JBHC5VrB04AHLP1kmc73tfBH2L4svUoFY tx6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786463428; x=1787068228; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ZbUZg/TBDW7F3x6+B7KTdUWQTRD7wzFTUQxMFnpy2VY=; b=kcNDv/GZT195FDdC19KIh70fxlj6xmL4HxKRcHpY9xyPxjimPYgSfLUgmwWiCQnXSV 87cF+5vaRfXuFwZ3muVn3FcnyM3kVrsqQH9WNVBbZ5HV5nQ5zkgVdke33vcN7gPIPGm/ sbNjzX53uCDBUdoYg5ARQay9GirP/P31YMACs41zTgaSlGKcdz3U9DPL+asoZAdqmGrK PdSnzS5eY8CjJp64CmiZpRNXVyKUiAvVmnkq7A+50VUkrjUWo8Y4sevIntKyjL3r0oaE P9fial69zsLwC9hDp8SMvl5tIg/0/daPiwwwPnkMtrJOi+RIfFO0X+ACwzvJzB4JNVnw MOlw== X-Gm-Message-State: AOJu0YxUhpSz2WkT9iCAdUkFBFmZeaI58GFN9b78gCSEVtHTeTC3SFCe VbnDIucU6WMjHHnBUpIi9Q1+F6b4IDRMiJGsBZ73w+ku+7SnDxwuv38tcpDoIyc7xuPfilkg1Be ZkdrFet6OkSYQg/lUEf9xrJus28Gr8B+GlFi+ecM/HyxBhwOcHeAgpKz+rRa++d1x+w== X-Gm-Gg: AR+sD10RlDCHyzSEvac8eEAGWr2WGGEU4rdS7sqXpNvhUFHBv1la1OEE1ZLXwT+lNuG HwI4lzJezZ/Ah7Y0rx8w04lOgXHZEyYXyRuYMpOQAvPGDI58Xs44gM2Ti9+e1unSlENCwoX4H/I bP0bHMiu3qghWX5rueEQ2feP0KfK3/Wt2nIAAhGJe+CVjdzT4NUPBmNIbVSpOd/ZhZMfNoThxTW ds5piAJGXTIq+48CWhSidpCXZ43VPUdPjioJ7IHJqiQzEio6K3aWa8/gu2PJ7QKv2d/VY57hTEp IMfR/oDu7iImkYWyRLmrsxNUR+oXHENrh0gKrsWta/gYFElfDZu+vvu6okaupsahsA1kIGdEPn3 ps6+Cuv32G9pJODJShFJRrUtb4+xmk/V/CODvFBdnxA== X-Received: by 2002:a05:622a:4296:b0:517:8011:3a4b with SMTP id d75a77b69052e-52d601ec2c4mr15047061cf.21.1786463428239; Tue, 11 Aug 2026 08:50:28 -0700 (PDT) X-Received: by 2002:a05:622a:4296:b0:517:8011:3a4b with SMTP id d75a77b69052e-52d601ec2c4mr15046401cf.21.1786463427782; Tue, 11 Aug 2026 08:50:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Peter Maydell , Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Thomas Huth , Corey Minyard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 7/7] hw/nmi: Raise NMI line only once Date: Tue, 11 Aug 2026 17:49:30 +0200 Message-ID: <20260811154930.13915-8-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260811154930.13915-1-philmd@oss.qualcomm.com> References: <20260811154930.13915-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: gIewaW-XosgKg06s_opzmx4kiQQS5ZNV X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX0RDecYrKl0PX I3LUzPYfI7OgNHQARU9mz5oOjdSN3zXI+fBf3m24UA2XREAPKWFWtKP7mNLpipstbgZLQJ6wmkX zuqt+YWU/JFa4oxcuva9/p6qLU+tgd5wGJ4kJOr33JF9wNNOrxSs2oKNV5xvQ8ddv0CgFVkCiSd sIdH0rB2xIMh8zjwmBfORbxED4QA51B3s25DYspF5hMw70cp7qgpLbI4dvu9QQ3PjUc+lQYwQhK WJzeagjPZQ1Pv8ys7Dro+g3iB+/9A7xqQcvuFWqPu+8fwHLMbXCRp9LhNyWj7fQdiTw6rEHs2W/ osF1Y2NvNg5O3nuQzCZ+t3cA3wGO4eGYz59lulNaE+OsFxxc85SwYqRmOC6A1XdsPvzCZzzg28B 9JuePiKWKPDIkJuuoZEdDjqR7/bMVLUpijqJ64kept+Lb7qp8xqZZf9Cv1RUFc9SXSJdGEvVB2g 16VOkFrFCKu2X+xbYwg== X-Proofpoint-ORIG-GUID: gIewaW-XosgKg06s_opzmx4kiQQS5ZNV X-Authority-Analysis: v=2.4 cv=FbkHAp+6 c=1 sm=1 tr=0 ts=6a7b44c4 cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=HZQsDzxzLdBvz1sOA9cA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=dawVfQjAaf238kedN5IG:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDEzMiBTYWx0ZWRfX10EwuiXuajOD Hg0/CmC6PtPX1GAxczzuWLJfac/e2xkMfvsElaF1z4h94RB4lkH2HUUUhhaZ3qHHFsKcq/vUnts 7zrox3Lxxwkcy8ACY6nys+XapSaxE3o= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-11_03,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 clxscore=1015 bulkscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110132 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1786463519818158500 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 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 =3D 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; } =20 return 0; --=20 2.53.0