[Skiboot] [PATCH] hdata: indicate when booted with elevated risk level

Oliver O'Halloran oohall at gmail.com
Thu Apr 20 11:41:10 AEST 2017


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 at us.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 hdata/spira.c | 5 +++++
 hdata/spira.h | 1 +
 2 files changed, 6 insertions(+)

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;
-- 
2.9.3



More information about the Skiboot mailing list