From c0bdf1dac1dd97ed6cbf8008edbcac8dc6e23874 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Fri, 7 Jul 2017 16:08:41 -0500 Subject: cpu: Better handle unknown flags in opal_reinit_cpus() At the moment, if we get passed flags we don't know about, we return OPAL_UNSUPPORTED but we still perform whatever actions was requied by the flags we do support. Additionally, on P8, we attempt a SLW re-init which hasn't been supported since Murano DD2.0 and will crash your system. It's too late to fix on existing systems so Linux will have to be careful at least on P8, but to avoid future issues let's clean that up, make sure we only use slw_reinit() when HILE isn't supported. Signed-off-by: Benjamin Herrenschmidt [stewart@linux.vnet.ibm.com: retain OPAL_UNSUPPORTED] Signed-off-by: Stewart Smith --- core/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/cpu.c b/core/cpu.c index 6c00bca..bcf84ad 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -1,4 +1,4 @@ -/* Copyright 2013-2014 IBM Corp. +/* Copyright 2013-2017 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1216,8 +1216,8 @@ static int64_t opal_reinit_cpus(uint64_t flags) flags &= ~(OPAL_REINIT_CPUS_HILE_BE | OPAL_REINIT_CPUS_HILE_LE); } - /* Any flags left ? */ - if (flags != 0 && proc_gen == proc_gen_p8) + /* Handle P8 DD1 SLW reinit */ + if (flags != 0 && proc_gen == proc_gen_p8 && !hile_supported) rc = slw_reinit(flags); else if (flags != 0) rc = OPAL_UNSUPPORTED; -- cgit v1.1