]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
powerpc/64: Don't try to use radix MMU under a hypervisor
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 30 Jan 2017 10:21:34 +0000 (21:21 +1100)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 6 Mar 2017 21:20:10 +0000 (14:20 -0700)
commit2fc652ad97cb8d3b6b268a27d7c5954db02901be
treec644dbc58bd44627d0ffb7370a4dceb895b9f810
parent228d3e6be2b7a669a624e5df83e6dbd3168f34a2
powerpc/64: Don't try to use radix MMU under a hypervisor

BugLink: http://bugs.launchpad.net/bugs/1670315
Currently, if the kernel is running on a POWER9 processor under a
hypervisor, it will try to use the radix MMU even though it doesn't have
the necessary code to use radix under a hypervisor (it doesn't negotiate
use of radix, and it doesn't do the H_REGISTER_PROC_TBL hcall). The
result is that the guest kernel will crash when it tries to turn on the
MMU.

This fixes it by looking for the /chosen/ibm,architecture-vec-5
property, and if it exists, clears the radix MMU feature bit, before we
decide whether to initialize for radix or HPT. This property is created
by the hypervisor as a result of the guest calling the
ibm,client-architecture-support method to indicate its capabilities, so
it will indicate whether the hypervisor agreed to us using radix.

Systems without a hypervisor may have this property also (for example,
skiboot creates it), so we check the HV bit in the MSR to see whether we
are running as a guest or not. If we are in hypervisor mode, then we can
do whatever we like including using the radix MMU.

The reason for using this property is that in future, when we have
support for using radix under a hypervisor, we will need to check this
property to see whether the hypervisor agreed to us using radix.

Fixes: 2bfd65e45e87 ("powerpc/mm/radix: Add radix callbacks for early init routines")
Cc: stable@vger.kernel.org # v4.7+
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 18569c1f134e1c5c88228f043c09678ae6052b7c)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/powerpc/mm/init_64.c