arm/arm64: KVM: Fix hyp mappings of vmalloc regions
authorChristoffer Dall <christoffer.dall@linaro.org>
Fri, 15 Nov 2013 21:14:12 +0000 (13:14 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2013 19:11:50 +0000 (11:11 -0800)
commit9cce2a8756944a83dee2b687800bcca369ecbbed
treef995179086cd68f6094d0c2892cc0f5c9aeb72d0
parentac18077a4150ab4ecddea135e466c55cc6c551ab
arm/arm64: KVM: Fix hyp mappings of vmalloc regions

commit 40c2729bab48e2832b17c1fa8af9db60e776131b upstream.

Using virt_to_phys on percpu mappings is horribly wrong as it may be
backed by vmalloc.  Introduce kvm_kaddr_to_phys which translates both
types of valid kernel addresses to the corresponding physical address.

At the same time resolves a typing issue where we were storing the
physical address as a 32 bit unsigned long (on arm), truncating the
physical address for addresses above the 4GB limit.  This caused
breakage on Keystone.

Reported-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kvm/mmu.c