]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Fix HYP idmap unmap when using 52bit PA
authorMarc Zyngier <marc.zyngier@arm.com>
Wed, 14 Mar 2018 15:17:33 +0000 (15:17 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Mon, 19 Mar 2018 13:04:26 +0000 (13:04 +0000)
commit29e05ef9260c7b0f3b35d93f144fbb7e50191428
treed55a4a8f85e969183d096700813b83bb676fc591
parent0ceb885468242eaf8c5fbdc039ec6d6ed6fd931c
KVM: arm64: Fix HYP idmap unmap when using 52bit PA

Unmapping the idmap range using 52bit PA is quite broken, as we
don't take into account the right number of PGD entries, and rely
on PTRS_PER_PGD. The result is that pgd_index() truncates the
address, and we end-up in the weed.

Let's introduce a new unmap_hyp_idmap_range() that knows about this,
together with a kvm_pgd_index() helper, which hides a bit of the
complexity of the issue.

Fixes: 9ef1a5b71db3 ("KVM: arm/arm64: fix HYP ID map extension to 52 bits")
Reported-by: James Morse <james.morse@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
virt/kvm/arm/mmu.c