Skip to content

Commit a70b487

Browse files
committed
powerpc/powernv: Fix boot on Power8 bare metal due to opal_configure_cores()
In commit 1c0eaf0 ("powerpc/powernv: Tell OPAL about our MMU mode on POWER9"), we added additional flags to the OPAL call to configure CPUs at boot. These flags only work on Power9 firmwares, and worse can cause boot failures on Power8 machines, so we check for CPU_FTR_ARCH_300 (aka POWER9) before adding the extra flags. Unfortunately we forgot that opal_configure_cores() is called before the CPU feature checks are dynamically patched, meaning the check always returns true. We definitely need to do something to make the CPU feature checks less prone to bugs like this, but for now the minimal fix is to use early_cpu_has_feature(). Reported-and-tested-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com> Fixes: 1c0eaf0 ("powerpc/powernv: Tell OPAL about our MMU mode on POWER9") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 01e6a61 commit a70b487

File tree

1 file changed

+1
-1
lines changed
  • arch/powerpc/platforms/powernv

1 file changed

+1
-1
lines changed

arch/powerpc/platforms/powernv/opal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void opal_configure_cores(void)
7878
* ie. Host hash supports hash guests
7979
* Host radix supports hash/radix guests
8080
*/
81-
if (cpu_has_feature(CPU_FTR_ARCH_300)) {
81+
if (early_cpu_has_feature(CPU_FTR_ARCH_300)) {
8282
reinit_flags |= OPAL_REINIT_CPUS_MMU_HASH;
8383
if (early_radix_enabled())
8484
reinit_flags |= OPAL_REINIT_CPUS_MMU_RADIX;

0 commit comments

Comments
 (0)