linux/arch
Suraj Jitindar Singh da0ef93310 powerpc/mm: Limit rma_size to 1TB when running without HV mode
The virtual real mode addressing (VRMA) mechanism is used when a
partition is using HPT (Hash Page Table) translation and performs real
mode accesses (MSR[IR|DR] = 0) in non-hypervisor mode. In this mode
effective address bits 0:23 are treated as zero (i.e. the access is
aliased to 0) and the access is performed using an implicit 1TB SLB
entry.

The size of the RMA (Real Memory Area) is communicated to the guest as
the size of the first memory region in the device tree. And because of
the mechanism described above can be expected to not exceed 1TB. In
the event that the host erroneously represents the RMA as being larger
than 1TB, guest accesses in real mode to memory addresses above 1TB
will be aliased down to below 1TB. This means that a memory access
performed in real mode may differ to one performed in virtual mode for
the same memory address, which would likely have unintended
consequences.

To avoid this outcome have the guest explicitly limit the size of the
RMA to the current maximum, which is 1TB. This means that even if the
first memory block is larger than 1TB, only the first 1TB should be
accessed in real mode.

Fixes: c610d65c0a ("powerpc/pseries: lift RTAS limit for hash")
Cc: stable@vger.kernel.org # v4.16+
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190710052018.14628-1-sjitindarsingh@gmail.com
2019-07-15 12:41:17 +10:00
..
alpha Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
arc Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
arm ARM: 2019-07-12 15:35:14 -07:00
arm64 This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
c6x Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2019-07-10 21:42:03 -07:00
csky Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
h8300 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2019-07-10 21:42:03 -07:00
hexagon Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2019-07-08 21:48:15 -07:00
ia64 TTY / Serial driver updates for 5.3-rc1 2019-07-11 15:38:21 -07:00
m68k Merge branch 'akpm' (patches from Andrew) 2019-07-12 11:40:28 -07:00
microblaze clone3-v5.3 2019-07-11 10:09:44 -07:00
mips asm-generic: remove ptrace.h 2019-07-12 15:41:33 -07:00
nds32 Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
nios2 nios2 update for v5.3-rc1 2019-07-12 15:38:05 -07:00
openrisc dma-mapping updates for Linux 5.3 2019-07-12 15:13:55 -07:00
parisc Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
powerpc powerpc/mm: Limit rma_size to 1TB when running without HV mode 2019-07-15 12:41:17 +10:00
riscv Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
s390 Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
sh asm-generic: remove ptrace.h 2019-07-12 15:41:33 -07:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2019-07-13 16:04:19 -07:00
um Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
unicore32 Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
x86 asm-generic: remove ptrace.h 2019-07-12 15:41:33 -07:00
xtensa dma-mapping updates for Linux 5.3 2019-07-12 15:13:55 -07:00
.gitignore
Kconfig dma-direct: provide generic support for uncached kernel segments 2019-06-03 16:00:08 +02:00