Set Enabled to trigger NMI_OUT BSOD
When user invokes "Set NMI source" command, BMC will trigger host BSOD
if the 'source' parameter is not 'NONE'. And it will save NMI source in
dbus property.
There is case that same NMI source occurs twice in a row. If we use dbus
value 'source' only, it is impossible to tell if source is changed. To
avoid this issue, NMI_OUT handler also introduces an 'enabled' dbus property.
Command will set 'Enabled' property to true every time. Once MNI approach
finishes, it will reset 'Enabled' to false.
tested:
it's tested in system for IPMI OEM command - set NMI source
Set: ipmitool raw 0x30 0xed 1
Windows BSOD is triggered after the command is issued.
Change-Id: I4e4054ea8afb09a1aa67f91b6250b6d71e9bcc7e
Signed-off-by: Chen Yugang <yugang.chen@linux.intel.com>
diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index 9cbdfed..2d3c5c6 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -2541,6 +2541,16 @@
oemNmiBmcSourceObjPathProp,
sdbusplus::com::intel::Control::server::convertForMessage(
bmcSourceSignal));
+ // set Enabled property to inform NMI source handling
+ // to trigger a NMI_OUT BSOD.
+ // if it's triggered by NMI source property changed,
+ // NMI_OUT BSOD could be missed if the same source occurs twice in a row
+ if (bmcSourceSignal != nmi::NMISource::BMCSourceSignal::None)
+ {
+ setDbusProperty(*dbus, service, oemNmiSourceObjPath,
+ oemNmiSourceIntf, oemNmiEnabledObjPathProp,
+ static_cast<bool>(true));
+ }
}
catch (sdbusplus::exception_t& e)
{