linux-stable/arch/powerpc
Paul Mackerras 18569c1f13 powerpc/64: Don't try to use radix MMU under a hypervisor
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: 2bfd65e45e ("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>
2017-01-31 19:11:43 +11:00
..
boot powerpc updates for 4.10 2016-12-16 09:26:42 -08:00
configs powerpc updates for 4.10 2016-12-16 09:26:42 -08:00
crypto crypto: crc32c-vpmsum - Rename CRYPT_CRC32C_VPMSUM option 2016-11-28 21:23:17 +08:00
include KVM: PPC: Book3S: 64-bit CONFIG_RELOCATABLE support for interrupts 2017-01-31 19:07:39 +11:00
kernel KVM: PPC: Book3S: 64-bit CONFIG_RELOCATABLE support for interrupts 2017-01-31 19:07:39 +11:00
kvm KVM: PPC: Book3S: 64-bit CONFIG_RELOCATABLE support for interrupts 2017-01-31 19:07:39 +11:00
lib Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
math-emu Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
mm powerpc/64: Don't try to use radix MMU under a hypervisor 2017-01-31 19:11:43 +11:00
net bpf: xdp: Allow head adjustment in XDP prog 2016-12-08 14:25:13 -05:00
oprofile ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
perf cpu/hotplug: Cleanup state names 2016-12-25 10:47:44 +01:00
platforms Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
purgatory powerpc: Add purgatory for kexec_file_load() implementation. 2016-11-30 23:15:26 +11:00
scripts powerpc/ftrace: Add Kconfig & Make glue for mprofile-kernel 2016-03-07 14:53:56 +11:00
sysdev Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
xmon powerpc/xmon: Add 'dt' command to dump trace buffers 2016-11-25 14:30:27 +11:00
Kconfig powerpc: ima: get the kexec buffer passed by the previous kernel 2016-12-20 09:48:40 -08:00
Kconfig.debug powerpc/mm: Fix page table dump build on non-Book3S 2016-12-01 16:20:18 +11:00
Makefile powerpc: Add purgatory for kexec_file_load() implementation. 2016-11-30 23:15:26 +11:00
relocs_check.sh powerpc/64: whitelist unresolved modversions CRCs 2016-09-22 14:46:31 +02:00