]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv: Fix boot on Power8 bare metal due to opal_configure_cores()
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 17 Jul 2017 11:19:01 +0000 (21:19 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 17 Jul 2017 11:30:32 +0000 (21:30 +1000)
commit9dbf0cca7f003037036fce69bd450d1a46707f3d
treec6a8ab47fb925a86a2f8f2ee5a14c8bce802c137
parent4f60fde4ec5f19576b69a77610deb854bcb8da3a
powerpc/powernv: Fix boot on Power8 bare metal due to opal_configure_cores()

In commit 0999b387f365 ("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: 0999b387f365 ("powerpc/powernv: Tell OPAL about our MMU mode on POWER9")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/opal.c