]> Git Repo - qemu.git/commitdiff
ipmi: Fix watchdog NMI handling
authorCorey Minyard <[email protected]>
Fri, 16 Aug 2019 14:09:21 +0000 (09:09 -0500)
committerCorey Minyard <[email protected]>
Fri, 20 Sep 2019 19:08:10 +0000 (14:08 -0500)
The wrong logic was used for detection (so it wouldn't work at all)
and the wrong interface was used to inject the NMI if the detection
logic was correct.

Signed-off-by: Corey Minyard <[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
hw/ipmi/ipmi.c
hw/ipmi/ipmi_bmc_sim.c

index 136c86b7a7952b1018764d295f23ffb6074e017c..cbe158f8159cd927439401b002be0c73807993e8 100644 (file)
@@ -28,9 +28,8 @@
 #include "qom/object_interfaces.h"
 #include "sysemu/runstate.h"
 #include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
-#include "qapi/visitor.h"
 #include "qemu/module.h"
+#include "hw/nmi.h"
 
 static uint32_t ipmi_current_uuid = 1;
 
@@ -60,7 +59,8 @@ static int ipmi_do_hw_op(IPMIInterface *s, enum ipmi_op op, int checkonly)
         if (checkonly) {
             return 0;
         }
-        qmp_inject_nmi(NULL);
+        /* We don't care what CPU we use. */
+        nmi_monitor_handle(0, NULL);
         return 0;
 
     case IPMI_SHUTDOWN_VIA_ACPI_OVERTEMP:
index 246a6d390c17776ac8207ccfe629d67d382baed3..8f63bb71819b52df2b1afa97f5215b9568e84e6f 100644 (file)
@@ -1194,7 +1194,7 @@ static void set_watchdog_timer(IPMIBmcSim *ibs,
         break;
 
     case IPMI_BMC_WATCHDOG_PRE_NMI:
-        if (!k->do_hw_op(s, IPMI_SEND_NMI, 1)) {
+        if (k->do_hw_op(s, IPMI_SEND_NMI, 1)) {
             /* NMI not supported. */
             rsp_buffer_set_error(rsp, IPMI_CC_INVALID_DATA_FIELD);
             return;
This page took 0.026122 seconds and 4 git commands to generate.