From nobody Mon Feb 9 06:00:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1602504947; cv=none; d=zohomail.com; s=zohoarc; b=TmmG+HMgUFLqPiXtdJwtpnQqFgdeOZUo27LBq4gZrKIpL6Y5FsTh/8lLVXQIJDYMC8O8OYBJkvNfwMT2lgXsp7m/DZLeTlt4J1nrkRbj/pkI2LtTK2DowiTlGJOIh+8lEbxMepLab9ymeP8CtylH0pzpJOtFx5HJQlyeqoZR0QI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602504947; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=VljrrgYZ6yThKHfd9uj04aHsD9sMK+domcRaiReXGvI=; b=TiCTHi6CHVBgAC1XXi+KneMERh6X1pvLJ+2/oS37mM2B/83FB7iFAFYAEKlrLHQU0ihz8l18gyq3oR9T5mhPatiOEK4dfqlers60M3vPKkC4spFwI8vK6SJrfLM05YicWTd904zMovSyxjI1Jf2DjBJwdDvC7V/HtA3FKsBFyvw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1602504947252743.821416804419; Mon, 12 Oct 2020 05:15:47 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-189-4-P-tBiQMJKHI65Q19woBQ-1; Mon, 12 Oct 2020 08:15:44 -0400 Received: by mail-wm1-f70.google.com with SMTP id u5so5165774wme.3 for ; Mon, 12 Oct 2020 05:15:44 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id h3sm20166066wrw.78.2020.10.12.05.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 05:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602504946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VljrrgYZ6yThKHfd9uj04aHsD9sMK+domcRaiReXGvI=; b=iuqZaVzudq/K6FBVu3V0a78Wc21ASZy24F4bka6ZKpfiJ4c6MPE4y93U2cRJz1eAqI7/fQ yVTC3xuJ2aeOOhkW8AnwK1/g1k+EPGYs34tBorqFpDPNzhbt+E+rGYGLE4AoOxyHE1zF2R tvD91WYDf36gOjp9W5vosw8tj7hIiIs= X-MC-Unique: 4-P-tBiQMJKHI65Q19woBQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VljrrgYZ6yThKHfd9uj04aHsD9sMK+domcRaiReXGvI=; b=kWZeVqLoym3PQRHAt3UBzSnRGlVxEcHbnb05KCTntUPBUvWXDCuragy0ii0oUdLat1 QREn5E7QjSN3ai/409x8ly/JwnfpoJwMgTTPBpyj61TF8af0Qo+lYhiP6M71tbmYwNKo 8VE3sPvCwaJNG1Dtif9CPJVqa+KdmjFPHX6JVhKm4emT8eZ2ie6PJEJCe7jNeyFadmDT WoKNNbRS4rsRbSViTjtneAvtUVC3DKpzJ7gMk0YLnpKNV1MENg0a/UvHEAvE5FgA9Kmp F+s4PP+WKgvamhbE9KmproopUOA1sPdT8UrvVvh2u93Qr7Oe9MQGqOe73uaUFqE05Y13 IZ/Q== X-Gm-Message-State: AOAM533EMKZ69cw49/Tyq/C/0HYoD7VgQeERwdu7rdRU0/WT+3MgqGQ0 6oY/2qaMtJDJ6a6LGVY7WZqDHilVno3jedrXxsNTeRYnvGhJxZMS/nlh1J3L7MVlSQxzXP88mvC ZJBh322DT3qBYgA== X-Received: by 2002:a1c:8106:: with SMTP id c6mr10246646wmd.115.1602504943466; Mon, 12 Oct 2020 05:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh3ZneB/UaUdSoyR60V43L1kyczsgzSaFKhjYzwTNzI2F3Pio1H9f6yUbIk64TiICjXP1PeA== X-Received: by 2002:a1c:8106:: with SMTP id c6mr10246635wmd.115.1602504943284; Mon, 12 Oct 2020 05:15:43 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Marcel Apfelbaum , Eduardo Habkost Cc: Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH v2 1/5] qapi: Restrict 'inject-nmi' command to machine code Date: Mon, 12 Oct 2020 14:15:32 +0200 Message-Id: <20201012121536.3381997-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201012121536.3381997-1-philmd@redhat.com> References: <20201012121536.3381997-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Restricting 'inject-nmi' to machine.json pulls slightly less QAPI-generated code into user-mode and tools. Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine.json | 20 ++++++++++++++++++++ qapi/misc.json | 20 -------------------- softmmu/cpus.c | 1 + 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 756dacb06fd..073b1c98b26 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -484,6 +484,26 @@ { 'enum': 'LostTickPolicy', 'data': ['discard', 'delay', 'slew' ] } =20 +## +# @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. +# +# Returns: If successful, nothing +# +# Since: 0.14.0 +# +# Note: prior to 2.1, this command was only supported for x86 and s390 VMs +# +# Example: +# +# -> { "execute": "inject-nmi" } +# <- { "return": {} } +# +## +{ 'command': 'inject-nmi' } + ## # @NumaOptionsType: # diff --git a/qapi/misc.json b/qapi/misc.json index 7d1e2e9aaef..3fe9cc21b4b 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -341,26 +341,6 @@ ## { 'command': 'system_wakeup' } =20 -## -# @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. -# -# Returns: If successful, nothing -# -# Since: 0.14.0 -# -# Note: prior to 2.1, this command was only supported for x86 and s390 VMs -# -# Example: -# -# -> { "execute": "inject-nmi" } -# <- { "return": {} } -# -## -{ 'command': 'inject-nmi' } - ## # @human-monitor-command: # diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 47cceddd805..e46ac68ad09 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -26,6 +26,7 @@ #include "qemu-common.h" #include "monitor/monitor.h" #include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-events-run-state.h" #include "qapi/qmp/qerror.h" --=20 2.26.2