diff mbox series

[v8,10/11] skiboot/imc: Disable IMC node when UV enabled

Message ID 20200826183749.143980-11-grimm@linux.ibm.com
State Changes Requested
Headers show
Series Ultravisor support in skiboot | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (abe4c4799ffee4be12674ad59fc0bc521b0724f3)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Ryan Grimm Aug. 26, 2020, 6:37 p.m. UTC
From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>

Don't create the IMC nodes when the ultravisor is enabled.  Hypervisor
IMC initialization requires access to HOMER and IMC scoms which are
protected and only accessable via ultra calls.  So, don't create them
until the kernel supports the ultra calls.

Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
[ grimm: move S bit check to beginning of function ]
[ grimm: comments and commit message ]
Signed-off-by: Ryan Grimm <grimm@linux.ibm.com>
---
 hw/imc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/hw/imc.c b/hw/imc.c
index 927fba0b..f6351225 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -527,6 +527,16 @@  void imc_init(void)
 	struct dt_node *dev;
 	int err_flag = -1;
 
+	/*
+	 * If MSR(S) bit is set, HOMER and IMC scoms are only accessible via
+	 * ultra call.  The kernels lacks support, so don't create them.
+	 *
+	 * At this point uv_present can't be used since uv_init()
+	 * is called much later, so check the MSR bit.
+	 */
+	if (is_msr_bit_set(MSR_S))
+		return;
+
 	if (proc_chip_quirks & QUIRK_MAMBO_CALLOUTS) {
 		dev = dt_find_compatible_node(dt_root, NULL,
 					"ibm,opal-in-memory-counters");