hdata: indicate when booted with elevated risk level

Submitted by Oliver O'Halloran on April 20, 2017, 1:41 a.m.

Details

Message ID 20170420014110.22683-1-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran April 20, 2017, 1:41 a.m.
When the system is IPLed with an elevated risk level Hostboot will
set a flag in the IPL parameters structure. Parse and export this
in the device tree at: /ipl-params/sys-params/elevated-risk-level

Cc: Adrian Barrera <abarrera@us.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hdata/spira.c | 5 +++++
 hdata/spira.h | 1 +
 2 files changed, 6 insertions(+)

Comments

Stewart Smith May 3, 2017, 6:49 a.m.
Oliver O'Halloran <oohall@gmail.com> writes:
> When the system is IPLed with an elevated risk level Hostboot will
> set a flag in the IPL parameters structure. Parse and export this
> in the device tree at: /ipl-params/sys-params/elevated-risk-level
>
> Cc: Adrian Barrera <abarrera@us.ibm.com>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Thanks, merged to master as of 44790c6f751935682e739b243cd9e36c0dcbf144

Patch hide | download patch | download mbox

diff --git a/hdata/spira.c b/hdata/spira.c
index 3340a096f257..3284326a3173 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -798,6 +798,7 @@  static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
 	const struct HDIF_common_hdr *hdif = iplp;
 	u16 version = be16_to_cpu(hdif->version);
 	const char *vendor = NULL;
+	u32 sys_attributes;
 
 	p = HDIF_get_idata(iplp, IPLPARAMS_SYSPARAMS, NULL);
 	if (!CHECK_SPPTR(p)) {
@@ -873,6 +874,10 @@  static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
 		vendor = "IBM";
 
 	dt_add_property_string(dt_root, "vendor", vendor);
+
+	sys_attributes = be32_to_cpu(p->sys_attributes);
+	if (sys_attributes & SYS_ATTR_RISK_LEVEL)
+		dt_add_property(node, "elevated-risk-level", NULL, 0);
 }
 
 static void add_iplparams_ipl_params(const void *iplp, struct dt_node *node)
diff --git a/hdata/spira.h b/hdata/spira.h
index 01adf8abfc1f..abf5da8c76d6 100644
--- a/hdata/spira.h
+++ b/hdata/spira.h
@@ -353,6 +353,7 @@  struct iplparams_sysparams {
 	__be32		abc_bus_speed;
 	__be32		wxyz_bus_speed;
 	__be32		sys_eco_mode;
+#define SYS_ATTR_RISK_LEVEL PPC_BIT32(3)
 	__be32		sys_attributes;
 	__be32		mem_scrubbing;
 	__be16		cur_spl_value;