1# Design proposal for issuing NMI on servers that use OpenBMC 2 3Author: Lakshminarayana Kammath 4 5Other contributors: Jayanth Othayoth 6 7Created: 2019-05-21 8 9 10## Problem Description 11Currently, servers that use OpenBMC cannot have the ability to capture relevant 12debug data when the host is unresponsive or hung. These systems need the ability 13to diagnose the root cause of hang and perform recovery along with debugging 14data collected. 15 16 17## Background and References 18There is a situation at customer places/lab where the host goes unresponsive 19causing system hang(https://github.com/ibm-openbmc/dev/issues/457). 20This means there is no way to figure out what went wrong with the host in a hung 21state. One has to recover the system with no relevant debug data captured. 22 23Whenever the host is unresponsive/running, Admin needs to trigger an NMI event 24which, in turn, triggers an architecture-dependent procedure that fires an 25interrupt on all the available processors on the system. 26 27## Proposed Design for servers that use OpenBMC 28This proposal aims to trigger NMI, which in turn will invoke an 29architecture-specific procedure that enables data collection followed by recovery 30of the Host. This will enable Host/OS development teams to analyze and fix any 31issues where they see host hang and unresponsive system. 32 33### D-Bus 34Introducing new D-Bus interface in the control.host namespace 35(/openbmc/phosphor-dbus-interfaces/xyz/openbmc_project/Control/Host/ 36NMI.interface.yaml) 37and implement the new D-Bus back-end for respective processor specific targets. 38 39### BMC Support 40Enable NMI D-Bus phosphor interface and support this via Redfish 41 42### Redfish Schema used 43* Reference: DSP2046 2018.3, 44* ComputerSystem 1.6.0 schema provides an action called #ComputerSystem.Reset, 45 This action is used to reset the system. 46 The ResetType parameter is used for indicating the type of reset needs to be 47 performed. In this case, we can use 48 An NMI type 49 * Nmi: Generate a Diagnostic Interrupt (usually an NMI on x86 systems) 50 to cease normal operations, perform diagnostic actions and typically 51 halt the system. 52 53## High-Level Flow 541. Host/OS is hung or unresponsive or one need to take kernel dump 55 to debug some error conditions. 562. Admin/User can use the Redfish URI ComputerSystem.Reset that allows 57 POST operations and change the Action and ResetType properties to 58 {"Action":"ComputerSystem.Reset","ResetType":"Nmi"} to trigger NMI. 593. Redfish URI will invoke a D-Bus NMI back-end call which will use an arch 60 specific back-end implementation of xyz.openbmc_project.Control.Host.NMI 61 to trigger an NMI on all the processors on the system. 624. On receiving the NMI, the host will automatically invoke Architecture specific 63 actions. One such action could be; invoking the kdump followed by the reboot. 64 65* Note: NMI can be sent to the host in any state, not just at an unresponsive 66 state. 67 68## Alternatives Considered 69Extending the existing D-Bus interface state.Host namespace 70(/openbmc/phosphor-dbus-interfaces/xyz/openbmc_project/State/Host.interface.yaml) 71to support new RequestedHostTransition property called Nmi. 72D-Bus back-end can internally invoke processor-specific target to invoke NMI 73and do associated actions. 74 75There were strong reasons to move away from the above approach. 76phosphor-state-manager has always been focused on the states of the BMC, 77Chassis, and Host. NMI will be more of action against the host than 78a state. 79 80## Impacts 81This implementation only needs to make some changes to the system state when 82NMI is initiated irrespective of what host OS state is in, so it has minimal 83impact on the rest of the system. 84 85## Testing 86Depending on the platform hardware design, this test requires a host OS kernel 87module driver to create hard lockup/hang and then check the scenario is good. 88Also, one can invoke NMI to get the crash dump and confirm HOST received NMI 89via console logs. 90 91