]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: arm/arm64: Move HYP IO VAs to the "idmap" range
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 4 Dec 2017 17:04:38 +0000 (17:04 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Mon, 19 Mar 2018 13:04:56 +0000 (13:04 +0000)
commite3f019b37b580c3b954419212da26ac5db412a08
tree401fbc48e10dfb2585d7123bd4b0a79975a44045
parent3ddd45565373604d4f49cb0496fc0168e3863c1f
KVM: arm/arm64: Move HYP IO VAs to the "idmap" range

We so far mapped our HYP IO (which is essentially the GICv2 control
registers) using the same method as for memory. It recently appeared
that is a bit unsafe:

We compute the HYP VA using the kern_hyp_va helper, but that helper
is only designed to deal with kernel VAs coming from the linear map,
and not from the vmalloc region... This could in turn cause some bad
aliasing between the two, amplified by the upcoming VA randomisation.

A solution is to come up with our very own basic VA allocator for
MMIO. Since half of the HYP address space only contains a single
page (the idmap), we have plenty to borrow from. Let's use the idmap
as a base, and allocate downwards from it. GICv2 now lives on the
other side of the great VA barrier.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/include/asm/kvm_mmu.h
virt/kvm/arm/mmu.c