arm64: KVM: Configure TCR_EL2.PS at runtime
authorTirumalesh Chalamarla <tchalamarla@caviumnetworks.com>
Wed, 10 Feb 2016 18:46:53 +0000 (10:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:27:43 +0000 (08:27 +0200)
commit849e28efb04c4c46f6189f75e30d3f541eb6dfb4
tree806f80f7d4f2fa4cecc79d08e0f6fb5008515e1c
parentd5251a1952bff1148ceeea5283e34d07a502da62
arm64: KVM: Configure TCR_EL2.PS at runtime

[ Upstream commit 3c5b1d92b3b02be07873d611a27950addff544d3 ]

Setting TCR_EL2.PS to 40 bits is wrong on systems with less that
less than 40 bits of physical addresses. and breaks KVM on systems
where the RAM is above 40 bits.

This patch uses ID_AA64MMFR0_EL1.PARange to set TCR_EL2.PS dynamically,
just like we already do for VTCR_EL2.PS.

[Marc: rewrote commit message, patch tidy up]

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Tirumalesh Chalamarla <tchalamarla@caviumnetworks.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/kvm_arm.h
arch/arm64/kvm/hyp-init.S