Skip to content

Commit

Permalink
cpu: Better handle unknown flags in opal_reinit_cpus()
Browse files Browse the repository at this point in the history
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 <benh@kernel.crashing.org>
[stewart@linux.vnet.ibm.com: retain OPAL_UNSUPPORTED]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
ozbenh authored and stewartsmith committed Jul 12, 2017
1 parent 537b7a7 commit c0bdf1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/cpu.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c0bdf1d

Please sign in to comment.