opal/xstop: Use nvram option to enable/disable sw checkstop.
opal/xstop: Use nvram option to enable/disable sw checkstop.

Add a mechanism to enable/disable sw checkstop by looking at nvram option
opal-sw-xstop=<enable/disable>.

For now this patch disables the sw checkstop trigger unless explicitly
enabled through nvram option 'opal-sw-xstop=enable'i for p9. This will allow
an opportunity to get host kernel in panic path or xmon for unrecoverable
HMIs or MCE, to be able to debug the issue effectively.

To enable sw checkstop in opal issue following command:

# nvram -p ibm,skiboot --update-config opal-sw-xstop=enable

NOTE: This is a workaround patch to disable sw checkstop by default to gain
control in host kernel for better checkstop debugging. Once we have most of
the checkstop issues stabilized/resolved, revisit this patch to enable sw
checkstop by default.

For p8 platform it will remain enabled by default unless explicitly disabled.

To disable sw checkstop on p8 issue following command:

# nvram -p ibm,skiboot --update-config opal-sw-xstop=disable

Signed-off-by: Mahesh Salgaonkar <6a890e1065a1d4e8df9dcf1d9a2c9c740bbcf8aa@linux.vnet.ibm.com>
Reviewed-by: Balbir Singh <ac7b77b73f9d2cc0faddd296218dde0558e170e3@gmail.com>
Signed-off-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.vnet.ibm.com>

open-power/skiboot,qemu/skiboot,shenki/skiboot,shenki/skiboot,stewart-ibm/skiboot,legoater/skiboot,legoater/skiboot,open-power/skiboot,stewart-ibm/skiboot,shenki/skiboot,open-power/skiboot,legoater/skiboot,qemu/skiboot,open-power/skiboot,legoater/skiboot,shenki/skiboot,open-power/skiboot,legoater/skiboot,qemu/skiboot,stewart-ibm/skiboot,shenki/skiboot,qemu/skiboot,qemu/skiboot