From patchwork Mon May 23 15:09:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9132005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4423D60761 for ; Mon, 23 May 2016 15:15:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AC472822B for ; Mon, 23 May 2016 15:15:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F9E928239; Mon, 23 May 2016 15:15:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CE6182822B for ; Mon, 23 May 2016 15:15:14 +0000 (UTC) Received: from localhost ([::1]:48818 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rZa-0006I7-0Q for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 May 2016 11:15:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rUw-0002Lu-PU for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4rUv-00049t-N2 for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:26 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:33599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rUv-00049l-GF for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:25 -0400 Received: by mail-wm0-x243.google.com with SMTP id 67so16037708wmg.0 for ; Mon, 23 May 2016 08:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=zxBmKefXN8uotDcZaLMLzwf23ToLJ+OsT6VKQl9/mzI=; b=pVAhlI5WEmmZF2mku+SBiHXuKjBpkT2346y1TcrHm+KpbsUfu76Zrx+sQSf+N1sj6i oZAgCl5NxhZLkb+EJYqNcKgB1E7reipuGI9Bg9o5NMTllNzwwVHUB0WIMjIdQclSePF3 V9YnJ+Nznu9C6YBNIzP3olg175DPzOcM2D9sOzM9RlI2g9wMsuFbTxV94Ithn1rd9zGt HPNy7EC+2nG5p3YVK9BGQZTVzJKGysHHWA8wUsP2gfDRhtz/23XQoLm9gbXCM0P6s+W4 3quBN0EBvRvPudFt9cDT6I6QgL2c0w01uMkEVLXv6ne6pV01f27bNMlKBYm07fjWv0Qt dx+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=zxBmKefXN8uotDcZaLMLzwf23ToLJ+OsT6VKQl9/mzI=; b=IuzYuwcK8XokWHbVeTBsEENiD+s2pJjYFuYnHnHfRR9TuzxH/PUv0eUUK9wHUyHAcz n3DAemzr64LaarQHjKhu+hIg4l17/lqoE/Ew/qf0bBY5uWljYTU0LkqTLchzZKVhlxqv hvVPzfAdxG1kMh7pOjXT7TYbhkhUnTQ4fU4UUdsvTHlA8JMt1bF9rv++PdDZoSsR3zfq z4RwBF+6H0mlz772WWqrl3bUpRfWZW/xlyfyJ7PCvtFTk18tVjei8RpHHxIZyJkazlXB 2AQAUIwcuVRYDGNy5FT+FhVT6TOzFfqyEGtcMcrcRQg+v2lMDXIqnVJ9ZQFNTCKdbSRI LBwg== X-Gm-Message-State: AOPr4FXhjsMPZUZi2CApM2MMuzA9tUDh0p51jFWDA6weFhww8ynqJmGH/MNwpcgqmtkGKQ== X-Received: by 10.194.3.84 with SMTP id a20mr16903602wja.77.1464016224935; Mon, 23 May 2016 08:10:24 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-252-58.clienti.tiscali.it. [78.12.252.58]) by smtp.gmail.com with ESMTPSA id ac2sm19250359wjc.35.2016.05.23.08.10.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 May 2016 08:10:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 23 May 2016 17:09:58 +0200 Message-Id: <1464016199-43768-24-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1464016199-43768-1-git-send-email-pbonzini@redhat.com> References: <1464016199-43768-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 23/24] nmi: remove x86 specific nmi handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bandan Das Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Bandan Das nmi_monitor_handle is wired to call the x86 nmi handler. So, we can directly use it at call sites. Signed-off-by: Bandan Das Message-Id: <1463761717-26558-3-git-send-email-bsd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/nmi.c | 24 ------------------------ hw/watchdog/watchdog.c | 2 +- include/hw/nmi.h | 1 - 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/hw/core/nmi.c b/hw/core/nmi.c index f616a79..bfd0896 100644 --- a/hw/core/nmi.c +++ b/hw/core/nmi.c @@ -20,16 +20,11 @@ */ #include "qemu/osdep.h" -#include "qom/cpu.h" #include "hw/nmi.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" #include "monitor/monitor.h" -#if defined(TARGET_I386) -#include "cpu.h" -#endif - struct do_nmi_s { int cpu_index; Error *err; @@ -78,25 +73,6 @@ void nmi_monitor_handle(int cpu_index, Error **errp) } } -void inject_nmi(void) -{ -#if defined(TARGET_I386) - CPUState *cs; - - CPU_FOREACH(cs) { - X86CPU *cpu = X86_CPU(cs); - - if (!cpu->apic_state) { - cpu_interrupt(cs, CPU_INTERRUPT_NMI); - } else { - apic_deliver_nmi(cpu->apic_state); - } - } -#else - nmi_monitor_handle(0, NULL); -#endif -} - static const TypeInfo nmi_info = { .name = TYPE_NMI, .parent = TYPE_INTERFACE, diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index bbf3646..2aeaf1f 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -143,7 +143,7 @@ void watchdog_perform_action(void) case WDT_NMI: qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_INJECT_NMI, &error_abort); - inject_nmi(); + nmi_monitor_handle(0, NULL); break; } } diff --git a/include/hw/nmi.h b/include/hw/nmi.h index f4cec62..b541772 100644 --- a/include/hw/nmi.h +++ b/include/hw/nmi.h @@ -45,6 +45,5 @@ typedef struct NMIClass { } NMIClass; void nmi_monitor_handle(int cpu_index, Error **errp); -void inject_nmi(void); #endif /* NMI_H */