From nobody Mon Sep 28 01:12:49 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=1786397936; cv=none; d=zohomail.com; s=zohoarc; b=hdG5AK4PVe6QQ+yOELb/zBIMFCy8HglTJgrkXzi3TJGuQNuuVdktGtVl3XWsi6G2snm4CP5eMBAYeD/2QtTizkG86K2/R/dyHD85ThGd2Nnn1BPBPcmLxLtHsivGLgem70BcMGXsPi7xA7AA/j+AUvREnvCdTSW7K9PI6VWaF8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786397936; 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=ol77T8GehyKLtS9AocZPaQqwE24TlcK48M7K2nWNaHw=; b=a4pEE1wnh/2QAVKpxkR8ozKzkZmOsGSHNAxND12CSjUhQCp7YSWfHsKy3d+5kDdEKzTOb9HJDtTvfaGRN9v2d3NOsMRwhQEHzy0t1/FfV69D/e/pocr8qm6dHwncr568yBNP5bkp+6i6Mq/LHCpVZf0l1He2a8H2N8mcCYqI9r0= 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 1786397936696233.69825835884853; Mon, 10 Aug 2026 14:38:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtXgh-0003t8-5Z; Mon, 10 Aug 2026 17:37:39 -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 1wtXgg-0003sv-Fi for qemu-devel@nongnu.org; Mon, 10 Aug 2026 17:37:38 -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 1wtXgd-00080s-SB for qemu-devel@nongnu.org; Mon, 10 Aug 2026 17:37:38 -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 67ALXNJ62542025 for ; Mon, 10 Aug 2026 21:37:34 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 4fyjk61494-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Aug 2026 21:37:33 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51c21c01cf3so43696051cf.2 for ; Mon, 10 Aug 2026 14:37:33 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4995c69c777sm333715155e9.2.2026.08.10.14.37.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Aug 2026 14:37:32 -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= ol77T8GehyKLtS9AocZPaQqwE24TlcK48M7K2nWNaHw=; b=Xu5laDj49pqQVthN 6ZbwbYLasEYOkAf+EzIkwy6eCSTddMlTS2J8KYgbkD1+pC/dhrupJU06IoZZ54vT 7TLsWHKw4pplhtxmuMMWjT+b44JbVYQl46H8Fsxq3Ohges9GyDdQXyzp9KLPq2cA 8v743AFbN1sC7E3nYljSAaGHQJlRTNUuF+qUfLpwPYJQKVszb1f1Et1buTPOm9Rs dahbqFFbhMZLumOoNL1ClNbyOOwjP5Cl2rWIhCrEbCeWw/dDwK+EHsqyzByZ2IfO qjoeoE7gf5FySSDvHRiXeKGLLLZ4DpX0zfxNdRl/MQhRQ6xh/taJTKj/vgSna5qk Kvpc1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786397853; x=1787002653; 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=ol77T8GehyKLtS9AocZPaQqwE24TlcK48M7K2nWNaHw=; b=eXE9LU/1kilb+WJnRxtNQAf3CHa/RYs2OTOfbNAD66BZpP7fSW/xNSB+a26Q9yozJh GnDAujH2HwKypREBj/FPC7sGJiYaiLbB4KCjMn9N7fvrkP4YNeFfVeJ7pVvFTM01mYez mYr7KYxnRJg2O/f9tUqY4n2GqT3HFq2cYpWKxYuL1cUnKDt8jva7B3+L0Ir4bWpfeqGS Zv8HcSyqEIMXc6VtcPJfaH86AUMz7Bp5cigbCSjMH3dOL+j9d9WJ6Y98LTxuyqfozXfE Wpiv74MzDcrZ2rXnGcJI7oB9Y3KEpkc3w8p7nbqDMlPIpgwmsayHy/4FrYoMryLEVbmZ 22xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786397853; x=1787002653; 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=ol77T8GehyKLtS9AocZPaQqwE24TlcK48M7K2nWNaHw=; b=snghwvn5zjB0KVElvJFElRxh/vLDEyfKrQ7wMbGELmeto3Gm1QtSWUCZ0IIqIndZ8A ln+DPBkdIKtSnm+1NGPSuRqhbpw/bbJCSdv5Yq0y6R1Qb8jkuzfHBD5WZSuiGL8shxii 22tUY2qCvGNCZRQbCmIbeRFHMpyWrOdxiYzDjTV+h8E+xWvG5JZbNaZYrAgazmtDZt5I ubCtrWGaaE+0lDnKihiV48yfUaKz1oiri+HjB8FwrbRDJhLx5IkhjLY/bULX0wf185Pw pQRLfurftHrN0SHDkcTvfu2Ajlds65/nDgi0EjdjUolrKumUExiFi3aOzw4my+jeG5Tk nZ7Q== X-Gm-Message-State: AOJu0YxSHi/8iNeijxdu2uspWEHS9wqsXjd7wPkiYJUq1ztIsj81LesZ Sm1+cObyEz1dNgaPL2064eVorKxKDozIDyZGKnPhOdGP37/DDvv/BN8paAnxDxaHjdGByrWCpra 3gR0Us6nlAwxfVKQn/DVO7vwNKpXaqsFuvPwE/HbCEtzjUKqgPBkx6GSa07yMOp24Fw== X-Gm-Gg: AR+sD11Sj6rslDJqFL4+MwYaSKgsB5sHcsocjHAYwLrMb0sCaEFI0VNkvkKnzOq8mnq 2zU09FvAuP+x6YDnOeRaLywe1UqPeEux5Ltn2h3EISAxW5ipmm+5PPeVegPGJnKRvVueba7JNGN JZ/EXtEH5vupTzZP1X54o0k47cJqEJp6tH3+FDHoZ/gz4HbRkUqAzTXIVzijwPdjJFPheQOeuef oBfxw6018zucIuJTaL40wQF4mgAYK9A1k7eKs6diEgU9HU7npzdg7FM+EKoU8Ajc+/cp2xnsMZf 0xYl/YJIAC+drDuDweEIhtki99OAk9j2+36TYb3Yf9EZzRlwmlqSBzs8l0SAFASRyuZwMhv2qNJ d9HqjD+KR8BqY1fF0otcT6SU+tgtV5bFTLAe7hKtYnU5JM/E= X-Received: by 2002:ac8:588c:0:b0:51c:1291:911c with SMTP id d75a77b69052e-52d0b070becmr345851121cf.14.1786397853241; Mon, 10 Aug 2026 14:37:33 -0700 (PDT) X-Received: by 2002:ac8:588c:0:b0:51c:1291:911c with SMTP id d75a77b69052e-52d0b070becmr345850691cf.14.1786397852819; Mon, 10 Aug 2026 14:37:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Corey Minyard , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org Subject: [PATCH 1/4] hw/nmi: Allow delivering to first available vCPU (not by index) Date: Mon, 10 Aug 2026 23:37:19 +0200 Message-ID: <20260810213723.58467-2-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260810213723.58467-1-philmd@oss.qualcomm.com> References: <20260810213723.58467-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=Nb3WEWD4 c=1 sm=1 tr=0 ts=6a7a449d 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=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=7d5GJacPjx8SozUiw04A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-ORIG-GUID: wn2Qm3np2ADDlVc2gkpEh299I7FlPzVU X-Proofpoint-Spam-Info: AW1haW4tMjYwODEwMDE4MiBTYWx0ZWRfX8pcSPHC6NCgs k4CWchPzk4xp6EyEXiS0XuZgqHqxu4bKXL1xX5yuHwSKrLh3wqVHpsIS+/HIe2yxhE2oiRYtP6E YrCBClwnBFMc8lkl3niKJb2s1At/Id4= X-Proofpoint-GUID: wn2Qm3np2ADDlVc2gkpEh299I7FlPzVU X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODEwMDE4MiBTYWx0ZWRfX6qZPTer0/PIg KAPNI3FH8WDXtp7NzyzmXkeQYdDgh+RNsoDWZQxHjylRLbpPo8z4L9/8P94/nm7dZufRYfRGYQ2 XibGch/mkupPoKFppbuye44d0oKNUmZa14aRbhQfyOCgr9sMO9XCPwKLbAeDIW3GqusYp0zVym/ m6V7nGDPDBb7JWc6aUuXebCroEbqqqx6h62sTV5OCVksPyMnyo0M61crMRAQUAQTEHYpMEhZJ0G 1GK1wChuF0PuCL1iTO4Z6ysK4TbLPQU/t2h3rXrL1mmEbLGxdZTBLwvj/Gk03XMslj/JGBFIu9T 4jnv/JAa+ixiBpPazJZdzyFRlAYcQcORBm3VXbzUOeY9DHsvXurpuU6pOncV9SPbD9xHCseJsa7 zTig4JMsKeY6vnLk3G0dTXNr3FGMFa9EcmuUpkAky9/IqIH1IUkrvwyLkb2t/uZsSi6BRYFfIQh gez1nKg4OcS7rk5qDRw== 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-10_05,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608100182 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: 1786397937914158500 Allow callers to deliver on any vCPU (for example when the vCPU index is not known). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/nmi.h | 7 +++++++ hw/core/nmi.c | 5 +++++ hw/ipmi/ipmi.c | 2 +- hw/watchdog/watchdog.c | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/hw/core/nmi.h b/include/hw/core/nmi.h index fff41bebc69..6136290f4fe 100644 --- a/include/hw/core/nmi.h +++ b/include/hw/core/nmi.h @@ -40,6 +40,13 @@ struct NMIClass { void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp); }; =20 +/** + * nmi_monitor_handle: + * @cpu_index: Index of the CPU to deliver the NMI + * @errp: pointer to a NULL-initialized error object + * + * Note: cpu_index =3D -1 can be used to deliver to the first vCPU availab= le. + */ void nmi_monitor_handle(int cpu_index, Error **errp); =20 #endif /* NMI_H */ diff --git a/hw/core/nmi.c b/hw/core/nmi.c index 4b447e126ba..67213631c04 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -20,6 +20,7 @@ */ =20 #include "qemu/osdep.h" +#include "hw/core/cpu.h" #include "hw/core/nmi.h" #include "qapi/error.h" #include "qemu/module.h" @@ -42,6 +43,10 @@ static int do_nmi(Object *o, void *opaque) NMIClass *nc =3D NMI_GET_CLASS(n); =20 ns->handled =3D true; + if (ns->cpu_index =3D=3D -1) { + /* Any vCPU is OK, take the first one */ + ns->cpu_index =3D first_cpu->cpu_index; + } nc->nmi_monitor_handler(n, ns->cpu_index, &ns->err); if (ns->err) { return -1; diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c index 74818ff3cea..8c492271f90 100644 --- a/hw/ipmi/ipmi.c +++ b/hw/ipmi/ipmi.c @@ -60,7 +60,7 @@ static int ipmi_do_hw_op(IPMIInterface *s, enum ipmi_op o= p, int checkonly) return 0; } /* We don't care what CPU we use. */ - nmi_monitor_handle(0, NULL); + nmi_monitor_handle(-1, NULL); return 0; =20 case IPMI_SHUTDOWN_VIA_ACPI_OVERTEMP: diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 0842fe373ae..0c1b94a62f3 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_monitor_handle(-1, NULL); break; =20 default: --=20 2.53.0 From nobody Mon Sep 28 01:12:49 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=1786397920; cv=none; d=zohomail.com; s=zohoarc; b=H0Z+fA4WC3P9q/PdXPIhJIR9cAQ890EKiVQ5HFLxBb+0KzJttk0MZPYNgU3enuuoFnRmMezgEnnLWG9bTBEGvGGCtlzEeSZZNXzOUg2zf8oBJ0GtCQOXUKHSLaca1K2olinfzXlLDGwUDMjTnLSv7bv+g0GzcN4Rp35PMYp39kY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786397920; 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=EkHAG1isir9zwagZcGqjNbfgPjAbo4jbzh7Lag2tGpI=; b=GZVXcm0vbs4pBbUf0X3bec3qheku9Dujh/KzKXohoWgzJzAjD46wswpgsTUsxS9rDT2T+mPw8mNkXeFEiEZ/1A6DSTDU0Etv5HXG9N+KDr3x7hdh5nS+hrZvsFD/WnQhG9jF84wu3QfkxHE3kUT0bLi1ytZFbp/ZtgLJYe+Io4M= 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 1786397920478838.1678000049374; Mon, 10 Aug 2026 14:38:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtXgn-0003vV-3X; Mon, 10 Aug 2026 17:37:45 -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 1wtXgl-0003ud-HK for qemu-devel@nongnu.org; Mon, 10 Aug 2026 17:37:43 -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 1wtXgj-00082J-Vv for qemu-devel@nongnu.org; Mon, 10 Aug 2026 17:37:43 -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 67ALXCXN2772929 for ; Mon, 10 Aug 2026 21:37:41 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 4fyjjv145x-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Aug 2026 21:37:41 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-51c21c01cf3so43697461cf.2 for ; Mon, 10 Aug 2026 14:37:40 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4997415e45dsm19021665e9.14.2026.08.10.14.37.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Aug 2026 14:37:39 -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= EkHAG1isir9zwagZcGqjNbfgPjAbo4jbzh7Lag2tGpI=; b=AVOicCP76ZIHvGHF 0SD1EXMFat1X0j4K7CXMTgVF6Ui6venThmsnGSACJLB2ZGDvn5XKJjZO9f/wJIOT Img8D/fpLKX6I1FLS+bxIPfbmr15EOoRg382JeIVYNmwm2q5Atq73k/OGxO014XK JbqW7vRW7V6Isp1KL8AJ/x1/Rc1xhSjjl0S516CFM8+Qiur0MAHRnEEc2n+5dYL9 wYsMRlHBRYdm0jxmnfLLMZXKni7qiMzUZCmFnpdy2EHVNEzf4m4xpF7uyY0YA8Zo iZLIR3i7Vq0020JCyH+aBFn5yILsIPHeon1E3rBNQvYjRqt6WObfBO7uhNhhpAEQ RUHq5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786397860; x=1787002660; 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=EkHAG1isir9zwagZcGqjNbfgPjAbo4jbzh7Lag2tGpI=; b=RB6npKLHilnl1CsjhAR4kK0LWc4NbKwj3l9gpqdpgJlx6L9Lsb6CihnqQVd7OVmCVp cDMmycFxg3xa+SRnAIDr38zMgEG/U3yueWw06AGI7EYwIH/HOgvpA4gpayqz0yyZ1MM6 BMb+I37bqXxIzMvSZYi+7QyPc5bp6K1Uaa5SfnDO4vo7ZU7N5OpDLTRRz89p6xlZGJS2 go9DFUzhuoznS2sucWmrF89t61GZE6avuv0gGJ31HJ+vPziYMlCh+BSSvinhP9Nqr8I5 eSo+hCQ3X9FkpwJ/rKaJ1uUHoT5ZJtXvrh3N1WccxHVHpDqbT5JRI3o2xrgfQUSHBE7s tLRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786397860; x=1787002660; 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=EkHAG1isir9zwagZcGqjNbfgPjAbo4jbzh7Lag2tGpI=; b=GxhCSnnuxiE3RcZwN4POr4NipksvLa2KEJHJGIeUApWhad4BThgdHznd47txVOjLn4 iMEEW0BFAP9Ccfc/CVBip01ZqM9qAhqUGtaUXZiLL0Bx+qcTEgl/6mv2NKtE2SN2OsGQ Mg8zJw2SWknpxC8SVItHfusykAawCDiSY6FIiHpZxPkxNM8Ce99Tw835wu9L//19n6aX Sc1sYRq+P7vhQnBdB4dwADCHK6m7UJV6ytJ10uA6M5+R32gYhgjHaDS1LAWh5/K2g1ax bkT14tiBKBdqfaLRcKGwPLku0b1RCU10ZkM8PEdWWBE+C2S/3WIAhGQB95R635y7Zbbs 39/Q== X-Gm-Message-State: AOJu0YzJTmHpCIbzsBgWTmADA92EZnvZmDeKukhQZDml3M6Le4ko4vob oS+OQujrrEUKzFoTdgbAAswW9YSjWil8cupKW3E0TPQyAyLXSA9aZaIB5QmZEFwHdxV/daknuKu 24zwy79RVmtkG3pC9O4qBoghDszgkO3ZDyQGe/+1Gsq8OXYk6tz/OX6B01DO8l7DNjA== X-Gm-Gg: AR+sD13ZJoyX0I3jGZ8BgGCswator4RkfTyw2B9sQIJjYvGUFTBulNREjcajowB5wKK XtQM811y+cuzke6O0JtxOxdhzaH9oLd3leV8CglYGH1moA67ZbOYjsexW2d8tlzDGdDERM0E33X r8xjLxxzBaQoqGGzDlLysvgsfZ2W4mqPpneXG8Jjmk7OPB8Iiae8FsZBmJJWDo7hDNHOBv4U51U 8duMi+odmq8Yw/vDmWYreoDIIxwOPgxvcQnk5L9W4Feu3Z6wxbUuH7qlJ+w7Gaw/lnQeSF0hWiB SnUK/u5VIbUSeCmIYJPnxlNtXIZGvEWlAAsR8Gy3+Fu6bC+56hqzZ/NsSFOnqG7vVJkvSUqAJLu 8pD71tij/0rIvg8/b+IqRwGVk/NlQ+w2Bi+GBbrQzgO4ymzA= X-Received: by 2002:ac8:7d0f:0:b0:51e:47a4:4851 with SMTP id d75a77b69052e-52d0b003eafmr329799771cf.8.1786397860493; Mon, 10 Aug 2026 14:37:40 -0700 (PDT) X-Received: by 2002:ac8:7d0f:0:b0:51e:47a4:4851 with SMTP id d75a77b69052e-52d0b003eafmr329799401cf.8.1786397860108; Mon, 10 Aug 2026 14:37:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Corey Minyard , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org Subject: [PATCH 2/4] hw/nmi: Introduce nmi_cpu_handler() for vcpu-specific delivery Date: Mon, 10 Aug 2026 23:37:20 +0200 Message-ID: <20260810213723.58467-3-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260810213723.58467-1-philmd@oss.qualcomm.com> References: <20260810213723.58467-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: AW1haW4tMjYwODEwMDE4MiBTYWx0ZWRfX0VojyTF+j9o9 vu5eSr7s0AcKfF1y1k8C5K/qTbKTFYo794HgK0rJlXnsVLrxpuii/mZhJ+dHr7QI5HoqBlwtg/0 yA3ZJylvVq6gm2hEcGRJ+AaxB8dDttXSmYfUdqFW2SVNzDXoVjMioWFBIoXFYtPFS9XDckmVsb4 wsL1YMqHfuj3ggiBKjcC514B1s3O5v1D4zkqPi6YuezZ2IFcgo2fLVzpXUn9QPf6dic7wK+eK1u KfHcxMCWA14npqERl9y5OcW08m/jmnIDPTTiCojo3k+NHU1wbfBmeb04TOivA+skyIRv4dmuXXr +bDKHS+gpmci2cwjW9/uWeb7bYWvqWxb6S/qWeLI9J5jN9/k3U2fom2QelhJ6tM4fiA71sg65Yy 75O20/LAJMQt7GCgP+IS1oRBJWnOceXDBUDvqiUetagQ3ep664nbFRg/iUFYfIAftxF33WuIjSw W/C5n87cIckZvnHjUWA== X-Proofpoint-ORIG-GUID: 1WqYkmXaqmgysFtVAtVP-BjRsMK69Xjk X-Authority-Analysis: v=2.4 cv=KLtqylFo c=1 sm=1 tr=0 ts=6a7a44a5 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=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=xoifrTKpydK2y5XimCYA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-GUID: 1WqYkmXaqmgysFtVAtVP-BjRsMK69Xjk X-Proofpoint-Spam-Info: AW1haW4tMjYwODEwMDE4MiBTYWx0ZWRfXxDUkHCZmrP9K QpisbH47Wtien+K2WFGRZt+UlFU/A+zR21Kpf5mhoGBhK9Kj3HG4Rng1Yi8V39OCZJIBPynqBBl 2k/24Bw82d8wmcCQ+Eo8Bx1qHA20p9s= 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-10_05,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608100182 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: 1786397921747158500 No need to have handlers check for existing CPU index, lookup the CPUState once in the core do_nmi() code and pass along. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/nmi.h | 1 + hw/core/nmi.c | 29 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/include/hw/core/nmi.h b/include/hw/core/nmi.h index 6136290f4fe..2f554d58b7f 100644 --- a/include/hw/core/nmi.h +++ b/include/hw/core/nmi.h @@ -38,6 +38,7 @@ struct NMIClass { InterfaceClass parent_class; =20 void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp); + void (*nmi_cpu_handler)(NMIState *ns, CPUState *cs); }; =20 /** diff --git a/hw/core/nmi.c b/hw/core/nmi.c index 67213631c04..fb623fd00be 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -43,13 +43,30 @@ static int do_nmi(Object *o, void *opaque) NMIClass *nc =3D NMI_GET_CLASS(n); =20 ns->handled =3D true; - if (ns->cpu_index =3D=3D -1) { - /* Any vCPU is OK, take the first one */ - ns->cpu_index =3D first_cpu->cpu_index; + + /* Generic handler */ + if (nc->nmi_monitor_handler) { + nc->nmi_monitor_handler(n, ns->cpu_index, &ns->err); + if (ns->err) { + return -1; + } } - nc->nmi_monitor_handler(n, ns->cpu_index, &ns->err); - if (ns->err) { - return -1; + /* Per vCPU handler */ + if (nc->nmi_cpu_handler) { + CPUState *cs; + + if (ns->cpu_index >=3D 0) { + /* Specific vCPU requested */ + cs =3D qemu_get_cpu(ns->cpu_index); + } else { + /* Any vCPU is OK, take the first one */ + cs =3D first_cpu; + } + if (!cs) { + error_setg(&ns->err, "CPU %d does not exist", ns->cpu_inde= x); + return -1; + } + nc->nmi_cpu_handler(n, cs); } } nmi_children(o, ns); --=20 2.53.0 From nobody Mon Sep 28 01:12:49 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=1786397894; cv=none; d=zohomail.com; s=zohoarc; b=FdKFBw7ummrWjli3dk9Gq/PvTKaAOz5Fx26F5ezA85hTV1PYwYqSacIH/vMs2o/IrQvz38UP2EN+Vb+pu3thV+m0UE9duuOF0Nv9FncAadcX0EC1vsU4enW1C8zUpKb0urAyguglRz/rrfrwZA4mJy8YeMAHR0CFz57xaw2n8CE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786397894; 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=ATcBrG2yeZMCHfljDwPMFnFAKAfIn2nijZT8vQgsxbw=; b=T9ixYHTlDJ7JYInENgtmJuo563LCDfvXxkZHTGGUe71hrYJfJ2QDYOOtOSp0nNsAbMMIFxPIxUImwqGoTS/XH772+Jcq2YzrPNOEeTWUSO7sCGaduyzAX2ImLMZ40zTuSxN93+V7s8RAFMnYCiHyIf9n/V++YZVTItcq6nUhaEQ= 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 1786397893902820.9119386085649; Mon, 10 Aug 2026 14:38:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtXgw-0003wT-Jx; Mon, 10 Aug 2026 17:37:54 -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 1wtXgu-0003wB-Jw for qemu-devel@nongnu.org; Mon, 10 Aug 2026 17:37:52 -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 1wtXgt-00083U-3X for qemu-devel@nongnu.org; Mon, 10 Aug 2026 17:37:52 -0400 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67ALY1YZ2488349 for ; Mon, 10 Aug 2026 21:37:49 GMT Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fyccqu0ks-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Aug 2026 21:37:49 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-8e934385db1so1656256d6.0 for ; Mon, 10 Aug 2026 14:37:49 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-480021457ebsm37416160f8f.6.2026.08.10.14.37.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Aug 2026 14:37:47 -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= ATcBrG2yeZMCHfljDwPMFnFAKAfIn2nijZT8vQgsxbw=; b=mKMZG/x7eSH0HUmM /U4d9obHxtRatBuqoJvd2YPlGSHYWiRyVitDORYucwz/E8rAhlgXlxEeC46sI7Rf xOL2ke4gDD2r7wSd9xPQP8gzQ9Ingv92T2V9xTrM2gBRs+ur0TjXmA9aedvdClGc F3AoqkFmUc9+LTAiuLk1AO+I5mDV4PqaNfFZ9BN+KTMBvibOp0B8XmYBpg9CwLan i0ZmTeYCns2F29lQNKZkPUS1YKxop0g4yaks1au7PCCby6G6QX+cdL7gL4FgNDCU Y3xTmKGQTrSCtaC+usggUSsORWKfPhYq9Hq2dYSCd4NfPZlk6//29cA9YhTHrkPM fEqzIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786397869; x=1787002669; 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=ATcBrG2yeZMCHfljDwPMFnFAKAfIn2nijZT8vQgsxbw=; b=N6MosynIuYiVQVBh69fYQnp96Xb9/wb+XcXeyLB54EKflrZ/K1ntmszGQPBxIdsgXf a1Czp5d4JuLP/3kXn817v9J9JGf2aVRZ7qbC/xQYmlv/AaPS+csiWhUg6EfTCUVSnxNE wE4EiPc86yQ6UirlyGzTDrAV9IBzKW4O8ZPRK3iHdw6OjUFBujh1pP9mQ6cdhzMBMIc7 6rx6FN6zyO0se4pf7gHASkJRItwxS1anuZMCGgJZgsPRtpACX818qxuXynlbL9ogLwWQ 0h6cUEXcFPqnMayLMAAEYPN2hWYU21Zcy9lSnBezsrrqpkbJe7bYOdA3VD406WDoA214 bgBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786397869; x=1787002669; 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=ATcBrG2yeZMCHfljDwPMFnFAKAfIn2nijZT8vQgsxbw=; b=Odb1RuPjtnLQKYOd8Yza65ovzaulILCVIbLFvkAfJUYrhl3IxyAI25EvqxIOkzAUIZ /FDDWtOOtK1DQvdw8Fiz5emBgX5Wdv/jfaYR6uAm+M97tRG8IegAt8WncrZOUChwr7GU hRb0jOnMh8Kmy4jTeOz6fjLi39GC8SuXW1ye3dQf3a+9Jdsub864ZEVzqvyiOUFlSlLY tBxoz+IsgIcQHiB+7cBIjLAfLv1UwH2xAbSvPtT9OW+1jS0uNMtOrOU9UgQNVQkHC9yq ieneWrRJ8Xqsm2A1Jxlzd6WcWwyXXsblNBZi0yOiYDMZSxlJDHK3WKxb7nbymbWs/Vl7 mlGA== X-Gm-Message-State: AOJu0YyeS8JrUAoLvmUBljLKxN494D79HrH7wNV0oj/2y0VoHAKHsCNI K8pkRXjmLAj8hnIsOxR+P5JVSmIVGOK7tu+9+yq+7nrM6EQ46uGSRMNxysHePYHTL+yUzwnXCJ5 /mbRFdfHnpSqcN/bLw6zD/aRQWnuJXqk2uVlSc6zzuArBTTRz/KOZ2DTNYqNNPYYWVg== X-Gm-Gg: AR+sD10UeVZykaZCLAeDPAPSgqy9eCHZBFxfvKccgxlF7QHAE++zsTXh2Z+82vycnAF XWsw0usQLZhsNDZp0oS6XlOKN6xRoj21cgcIdfnRdiCr1F3uL4qOPrE8xD/pIIjN0wJ/KAuf5GG 0IArG9qDihXxjPNvbAXexpoe/dlbaw++yioPsrAQBDYbhBVIOvCk8GtzYfP3nNQ2D9FOQ4l/7Bb nvyKWZoXEmj75nm+A4OBJFf2jf3R0ci1cwFoYmCyKueEWhhaeKkGxoexx8mk2Ez1fiS0+9YxFj1 bEu/A7zPfZlTN4W8x63infQgZTMKN7nnRhtncyV2wypNnI1xVjSaQA0oLRgU3W7HL17v07XKEo4 w/Ufcief+AkQuoAnK2/a/qheAlAJi7S1z01OYikf0dAWiqCA= X-Received: by 2002:a05:622a:998:b0:51f:20e1:137f with SMTP id d75a77b69052e-52ce6035ce7mr544736931cf.19.1786397868759; Mon, 10 Aug 2026 14:37:48 -0700 (PDT) X-Received: by 2002:a05:622a:998:b0:51f:20e1:137f with SMTP id d75a77b69052e-52ce6035ce7mr544736431cf.19.1786397868289; Mon, 10 Aug 2026 14:37:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Corey Minyard , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org Subject: [PATCH 3/4] hw/s390x: Deliver per-vcpu NMI using nmi_cpu_handler Date: Mon, 10 Aug 2026 23:37:21 +0200 Message-ID: <20260810213723.58467-4-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260810213723.58467-1-philmd@oss.qualcomm.com> References: <20260810213723.58467-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: AbSnmWz-Mr_Q5Ch2IPBw1H2s4UVx6T90 X-Proofpoint-ORIG-GUID: AbSnmWz-Mr_Q5Ch2IPBw1H2s4UVx6T90 X-Authority-Analysis: v=2.4 cv=WNVPmHsR c=1 sm=1 tr=0 ts=6a7a44ad cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==: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=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=H2vGOfxKvbjFiM68sVQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=iYH6xdkBrDN1Jqds4HTS:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODEwMDE4MiBTYWx0ZWRfX6ocF7UOADBK3 cnyZ+hJ3Smi6oUvY5ux6WLDbUlQ0nUPutX5fgw/Cnd6CKzh38VzOWBOWWUjJYFK6bR6MmZp98+B yevRQxsoEr7o5GTrtLdFlj0gs9muDayVlvX508dWCey02riftwX2G6G0kJsPZIE74hB+X1O1xvq /M6SFxSi2e72cFylgMYp1bj2I8rMOB6cy9RMW7EICSqmErAqZ2npKIXTA9UTAMCQ5q18x6qUxFw IlgD0+IcRPeNieQyh9K0tXgy3wLOBjEGDrhFkwJF1N9AcP11Kcb5SPn1QPLXdx6O7yx1XUYwO39 3Vsy8gN7XYIvPlB4hAnMr5bhWLEfixxEehLPlRqfecUqGj4M/zrbab0M/1X3SO4gZ2C7zqZY2lD LlV9EwprULkLPiu+PSQ9KtlpJoutvyaBt2tyneGPtlefMIocwgeD/v9HLw1g05TDJQrbbzA1Iam gwE4W+GDfETPRJQZnng== X-Proofpoint-Spam-Info: AW1haW4tMjYwODEwMDE4MiBTYWx0ZWRfX8BmkRfvfbA2r FPEIlpAmIRsEwGh/Lzqt0uu1qJK2A/kLxha3GGMCJD6Z9BcriQRx0pMNr4sikzh7Ii+jvAYgkwW P3Wu045+3JchosyiPy/x1xWwFDgVjUQ= 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-10_05,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 impostorscore=0 phishscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608100182 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: 1786397895862158500 NMIClass::nmi_cpu_handler() handler is safer because the CPUState argument has been checked to be valid. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/s390x/s390-virtio-ccw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 25a9fa49554..b71086c254a 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -725,10 +725,8 @@ static HotplugHandler *s390_get_hotplug_handler(Machin= eState *machine, return NULL; } =20 -static void s390_nmi(NMIState *n, int cpu_index, Error **errp) +static void s390_nmi(NMIState *ns, CPUState *cs) { - CPUState *cs =3D qemu_get_cpu(cpu_index); - s390_cpu_restart(S390_CPU(cs)); } =20 @@ -832,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->nmi_cpu_handler =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 Mon Sep 28 01:12:49 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=1786397935; cv=none; d=zohomail.com; s=zohoarc; b=V4Ubj36JOZ1BXIQgfqAarEO1DAk+FUCw+lPpRaBeOA7CbNiDUsd+WoMXigNraygRIt3vPBo/VHndF7jDLdd2mZvxE4hIEuZXR9bBVl+M5O5YkHp775fwX04Htb8CTcPOLosewQSgvz9yhGji62wz3LUv9hAArIIUwW47Jdykksc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786397935; 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=lB6nNj707NuJjIyuK1uCPtMJPjvc61I/WcRZHId+tQM=; b=Uf+HMbp0b63+SXr8iVDCVNE+W6CgesMniGNTF+dMd3VlOjy+i45BBShV9+VetSnLxpW0oIME0tAaxPg+ial1YxjxV9guaDr58/2DHCpIsaXVM5jiQmI1ze1ZTyR+iXJY6C9puz8uI6xp+MsVP1Osgr6tVHsEY5LxbyS0kfVxPZQ= 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 1786397935957385.23956799874975; Mon, 10 Aug 2026 14:38:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtXh3-0003xs-Gt; Mon, 10 Aug 2026 17:38:01 -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 1wtXh1-0003x9-II for qemu-devel@nongnu.org; Mon, 10 Aug 2026 17:37:59 -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 1wtXgz-00083x-L6 for qemu-devel@nongnu.org; Mon, 10 Aug 2026 17:37:59 -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 67ALXCPj2772961 for ; Mon, 10 Aug 2026 21:37:56 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 4fyjjv146n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Aug 2026 21:37:56 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c1d7886cdso45812991cf.1 for ; Mon, 10 Aug 2026 14:37:56 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-480021fb89bsm35835876f8f.30.2026.08.10.14.37.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Aug 2026 14:37:54 -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= lB6nNj707NuJjIyuK1uCPtMJPjvc61I/WcRZHId+tQM=; b=QmUfQr116GbnLVWw 8/WUXLwI/R59VN+6/Pi7FZQepwHpuNjS5oNJCYjmCQtkhKLW48z9CDZhaIvjegu9 IyF/IhboFWw7/VXqYCVrWTRlk3t+ZzQ8ioP0jY767k05j5IETx26i5/x8vD8SVNc fmg3GcqiypoLQ2LxluzeF2rR/vWfnTYSOfxqsK44j3/p7fmjg/X/g8D0fqACOjOM PVWgKe8HEu73Rf2T8CH2SWct3qWJKc4KuTlSC2Jkr1kb8iuBbmWREYKU6VA6pJlB kke8FrJ4hWEF3+rmlYctWNFst7JkCAwGbi/TLvuwtHKvJDdjZeW7EeobA7m2fsKU mFzq1Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786397876; x=1787002676; 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=lB6nNj707NuJjIyuK1uCPtMJPjvc61I/WcRZHId+tQM=; b=APVJyEm4aOe3vtSis/KmKEykq4Ni6FEYMfA/xbIHc7aE3vksQahUFc/ctYHYkcVW2m VPdWTnRfnh7ltAarThIflikBHb62u6WwMN6Bnvu49K4gK0YFlerSXnubrYUKvNB5BYyh Raf124RwwLQr3dpUkckudbmxpjD2LCc5pKjQZTI0R9Jh0IAq4XUkL3LkrIaO9RkWdxdJ H+D3jkxTp6IYnOS30yA5dZzKESvvYS6T818e+A9vQaHxAM5obsxJMMj4mwFdsW9sHudR 1eXjA2MbfSAIISp6bnS9NbEYOUZ2EEJyO35/tvKXq1dGiKKKvP7MJcsSD7ZXjX4fPd+e BdXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786397876; x=1787002676; 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=lB6nNj707NuJjIyuK1uCPtMJPjvc61I/WcRZHId+tQM=; b=R2AseD8HczXAc0aVw4CmnnefaxEkbGExscuxCDoYP7mJUrDARszRROiuljmAAeHcqe 2+vDzze9hAVoqcXtk3py82wrQO+/XfgpsIrdeCWPFzpFSwF6T4s/ZRSOZ0cXZVOXmsoP 4UH2I39FUGGO6qWjCDGdtLctYijT8SgcaF8jW3wvL4cTwGxUKn1lVuqOi0XakACwlLlu tnFwacxg/zffR3CHgAVeO5dKaNa1/7OlRdMjo7Nb+JLtHUIfUz5P1G0tQ4Mjr8nG9bNP knMpxWRkaHPJWTjpLWzYqUdtYlG+2QE0fM6ZO8OV/4YMAl8+QqQIXSu1fwbPyVTIF4Kr wCrw== X-Gm-Message-State: AOJu0YxpjZVQrrFWVfOc0WeN4J2Hf3RhrhFP61k41Ih1LXOiTjAKl9VA fmUiIcKrKJmga3vJv4ba9ht4fyW2N6tcHLgg3k6QcM1lpSSdlFkELmznybG+EScP9OHwv/y8vl1 O1EA+eq2Jsth0eaUaQv15O+KO1KS5MdZL1T5jr10stfuYwDYVdkx9KlJL2Z7mNVDniw== X-Gm-Gg: AR+sD13h5fpe+NzfjwL2KmGuxeGYW4DK0hBEpS/rIyoru4qR6Zu0CgtkTXLokRsf7RI /A//dSKfs9Hlf18x0QJ1lYM9eNW7GAiUHcWLOImlh/15WLszQQyVEnp4QnTFSjs2a5mwtGXTqZs bGymxt2KC0po/Zql3m2NfB34lUYfTJoa8++b9e3R/IA44M1DCbeScku9cvccaJtZEqSYwpb829Y EqHTqGm/6GFcJtbaaG1aHQC6pikCt3jC4Q6jp/3oRyiHQ/8NyfFT907p2m321Tk8VrIDPOUGLmU B8p50BdKGKu3oy4vSprk6xEhyFarcv+LaPf1N0wEm4SwTveeQDn/eFJY958fpceFy/nYGq3NNQB xakdFa9j2CkIYWfa00PrhNqSJDgeNDp0mgSu/F2VAqKGp1mc= X-Received: by 2002:ac8:58c2:0:b0:51c:9ab2:dfd2 with SMTP id d75a77b69052e-52d4bc9da8emr50686321cf.33.1786397876013; Mon, 10 Aug 2026 14:37:56 -0700 (PDT) X-Received: by 2002:ac8:58c2:0:b0:51c:9ab2:dfd2 with SMTP id d75a77b69052e-52d4bc9da8emr50685871cf.33.1786397875556; Mon, 10 Aug 2026 14:37:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Corey Minyard , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org Subject: [PATCH 4/4] hw/nmi: Remove unused @cpu_index and @errp arguments Date: Mon, 10 Aug 2026 23:37:22 +0200 Message-ID: <20260810213723.58467-5-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260810213723.58467-1-philmd@oss.qualcomm.com> References: <20260810213723.58467-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: AW1haW4tMjYwODEwMDE4MiBTYWx0ZWRfX6oCB4BxqxpXf CN9uBtYmY5OeTphJCBdLKM7u5enKLGCiV4GH741sH3zoybVOOdBWEBmFbkM+xo8aHlK7B3BEHfx jqvQX/hBgBmLSfIOv3FsNeC4qqYaZbYkcwl7Gm40V5Rkh+YmDO2JLxNjVSdyNlL51bvUuEyN3qu EvSlLw/k+B08s+CYX6kMoX3Kw6FGStaM4T1cxL6QA1yPyj0JLk7vj0NOGxvvkY1DzDY1mslQM1M RQQpqscYo7/Gn/fVCCJcI7vAOTl+Y7LLtB2i4fuQBpW3vPHEMYigqfg7aonNER4rc7OQprq0sCC zSDW8e5fOFq2NEuCM0tJ4Psj9XxLhgFFKkV2E0V0gE8Cl3JGr1raf6teF3PI/sx+/7srNi6iuCl MPf8IPKNOlytvlHpM2jX/XEKPRMQbXNugurCqdUUITai01Z/s56Bwn9ysQysk23NZAvjoBnFqkP ja98lfY2ToO29+k368Q== X-Proofpoint-ORIG-GUID: GQ_EEpCdRns190S6qePCdT_rbDJSCtiN X-Authority-Analysis: v=2.4 cv=KLtqylFo c=1 sm=1 tr=0 ts=6a7a44b4 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=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=l7mRzedawI2mqaqXN0wA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-GUID: GQ_EEpCdRns190S6qePCdT_rbDJSCtiN X-Proofpoint-Spam-Info: AW1haW4tMjYwODEwMDE4MiBTYWx0ZWRfX6Qf75V8JLApu ukvh5rTEeeBw/0pQ7nIiILf4P/K43fAF36Wyj4G3++NgWpJKGd628yx1fS3ADyIrPL5SRqztxTK tXxrGf2IRD9SVfWqyGNKF0hBqRghDzg= 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-10_05,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608100182 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: 1786397937887158500 NMI delivery never fails: remove the unused @errp argument. nmi_handler() neither use the @cpu_index argument, remove it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/nmi.h | 2 +- hw/core/nmi.c | 7 ++----- hw/hppa/machine.c | 4 ++-- hw/i386/x86.c | 5 ++--- hw/intc/m68k_irqc.c | 4 ++-- hw/m68k/q800-glue.c | 4 ++-- hw/misc/macio/gpio.c | 4 ++-- hw/ppc/pnv.c | 7 +++---- hw/ppc/spapr.c | 4 ++-- 9 files changed, 18 insertions(+), 23 deletions(-) diff --git a/include/hw/core/nmi.h b/include/hw/core/nmi.h index 2f554d58b7f..476b5d02fa1 100644 --- a/include/hw/core/nmi.h +++ b/include/hw/core/nmi.h @@ -37,7 +37,7 @@ typedef struct NMIState NMIState; struct NMIClass { InterfaceClass parent_class; =20 - void (*nmi_monitor_handler)(NMIState *n, int cpu_index, Error **errp); + void (*nmi_handler)(NMIState *ns); void (*nmi_cpu_handler)(NMIState *ns, CPUState *cs); }; =20 diff --git a/hw/core/nmi.c b/hw/core/nmi.c index fb623fd00be..3f4ef5b2094 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -45,11 +45,8 @@ static int do_nmi(Object *o, void *opaque) ns->handled =3D true; =20 /* Generic handler */ - if (nc->nmi_monitor_handler) { - nc->nmi_monitor_handler(n, ns->cpu_index, &ns->err); - if (ns->err) { - return -1; - } + if (nc->nmi_handler) { + nc->nmi_handler(n); } /* Per vCPU handler */ if (nc->nmi_cpu_handler) { diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index d762163ddf5..93874b5d5c9 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) { CPUState *cs; =20 @@ -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->nmi_handler =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 dc7f0d56b01..201746945d5 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -147,9 +147,8 @@ 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) { - /* cpu index isn't used */ CPUState *cs; =20 CPU_FOREACH(cs) { @@ -389,7 +388,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->nmi_handler =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 68ddb5351be..5d4e5a10ab8 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) { m68k_set_irq(n, M68K_IRQC_LEVEL_7, 1); } @@ -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->nmi_handler =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 ac9062c6488..6a9592182a4 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) { GLUEState *s =3D GLUE(n); =20 @@ -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->nmi_handler =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 1a7c534d652..f6fce5b3532 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) { macio_set_gpio(MACIO_GPIO(n), 9, true); macio_set_gpio(MACIO_GPIO(n), 9, false); @@ -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->nmi_handler =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 c0cb45dbfbc..817f2ed7ae4 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -3552,12 +3552,11 @@ static void pnv_cpu_do_nmi(PnvChip *chip, PowerPCCP= U *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) { PnvMachineState *pnv =3D PNV_MACHINE(qdev_get_machine()); - int i; =20 - for (i =3D 0; i < pnv->num_chips; i++) { + for (int i =3D 0; i < pnv->num_chips; i++) { pnv_chip_foreach_cpu(pnv->chips[i], pnv_cpu_do_nmi, NULL); } } @@ -3583,7 +3582,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->nmi_handler =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 b79828b4e90..a2195796efe 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) { CPUState *cs; =20 @@ -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->nmi_handler =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; --=20 2.53.0