]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 18 Jul 2017 07:38:51 +0000 (09:38 +0200)
In commit 1c0eaf0f56d6 ("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: 1c0eaf0f56d6 ("powerpc/powernv: Tell OPAL about our MMU mode on POWER9")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
BugLink: http://bugs.launchpad.net/bugs/1702159
(cherry-picked from commit a70b487b07cf4201bc6702e7f646fa593b23009f linux-next)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/platforms/powernv/opal.c

index 142ddc61bae281200227f390d1ae564184674220..26b290c1c91674eeeb05b3067487e7e34433b8a6 100644 (file)
@@ -78,7 +78,7 @@ void opal_configure_cores(void)
         *  ie. Host hash  supports  hash guests
         *      Host radix supports  hash/radix guests
         */
-       if (cpu_has_feature(CPU_FTR_ARCH_300)) {
+       if (early_cpu_has_feature(CPU_FTR_ARCH_300)) {
                reinit_flags |= OPAL_REINIT_CPUS_MMU_HASH;
                if (early_radix_enabled())
                        reinit_flags |= OPAL_REINIT_CPUS_MMU_RADIX;