KVM: arm/arm64: Enforce PTE mappings at stage2 when needed
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 12 Mar 2019 09:52:51 +0000 (09:52 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Tue, 19 Mar 2019 18:01:57 +0000 (18:01 +0000)
commita80868f398554842b14d07060012c06efb57c456
tree86a4c1704fc2d2b4287dd72cf6eca94ed8359f44
parent7494cec6cb3ba7385a6a223b81906384f15aae34
KVM: arm/arm64: Enforce PTE mappings at stage2 when needed

commit 6794ad5443a2118 ("KVM: arm/arm64: Fix unintended stage 2 PMD mappings")
made the checks to skip huge mappings, stricter. However it introduced
a bug where we still use huge mappings, ignoring the flag to
use PTE mappings, by not reseting the vma_pagesize to PAGE_SIZE.

Also, the checks do not cover the PUD huge pages, that was
under review during the same period. This patch fixes both
the issues.

Fixes : 6794ad5443a2118 ("KVM: arm/arm64: Fix unintended stage 2 PMD mappings")
Reported-by: Zenghui Yu <yuzenghui@huawei.com>
Cc: Zenghui Yu <yuzenghui@huawei.com>
Cc: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
virt/kvm/arm/mmu.c