linux/arch/arm64
Marc Zyngier db69415c3f arm64: KVM: Do not use pgd_index to index stage-2 pgd
commit 04b8dc85bf upstream.

The kernel's pgd_index macro is designed to index a normal, page
sized array. KVM is a bit diffferent, as we can use concatenated
pages to have a bigger address space (for example 40bit IPA with
4kB pages gives us an 8kB PGD.

In the above case, the use of pgd_index will always return an index
inside the first 4kB, which makes a guest that has memory above
0x8000000000 rather unhappy, as it spins forever in a page fault,
whist the host happilly corrupts the lower pgd.

The obvious fix is to get our own kvm_pgd_index that does the right
thing(tm).

Tested on X-Gene with a hacked kvmtool that put memory at a stupidly
high address.

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
[ luis: backported to 3.16: used shannon's backport to 3.14 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-05-20 13:25:54 +01:00
..
boot arm64: dts: Add more serial port nodes in APM X-Gene device tree 2014-06-18 12:41:55 +01:00
configs arm64: defconfig update for LTP 2014-06-18 12:40:52 +01:00
crypto crypto: prefix module autoloading with "crypto-" 2015-02-04 10:57:48 +00:00
include arm64: KVM: Do not use pgd_index to index stage-2 pgd 2015-05-20 13:25:54 +01:00
kernel arm64: head.S: ensure visibility of page tables 2015-05-06 11:33:01 +01:00
kvm arm64: KVM: Fix HCR setting for 32bit guests 2015-05-20 13:25:53 +01:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-27 11:21:47 +00:00
mm arm64: dma-mapping: always clear allocated buffers 2015-05-12 09:36:36 +01:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig locking/mutex: Disable optimistic spinning on some architectures 2014-07-16 14:57:07 +02:00
Kconfig.debug arm64: remove arch specific earlyprintk 2014-04-24 16:32:27 -07:00
Makefile arm64/crypto: SHA-1 using ARMv8 Crypto Extensions 2014-05-14 10:03:17 -07:00