linux-stable/virt/kvm
Suzuki K Poulose 3c3736cd32 KVM: arm/arm64: Fix handling of stage2 huge mappings
We rely on the mmu_notifier call backs to handle the split/merge
of huge pages and thus we are guaranteed that, while creating a
block mapping, either the entire block is unmapped at stage2 or it
is missing permission.

However, we miss a case where the block mapping is split for dirty
logging case and then could later be made block mapping, if we cancel the
dirty logging. This not only creates inconsistent TLB entries for
the pages in the the block, but also leakes the table pages for
PMD level.

Handle this corner case for the huge mappings at stage2 by
unmapping the non-huge mapping for the block. This could potentially
release the upper level table. So we need to restart the table walk
once we unmap the range.

Fixes : ad361f093c ("KVM: ARM: Support hugetlbfs backed huge pages")
Reported-by: Zheng Xiang <zhengxiang9@huawei.com>
Cc: Zheng Xiang <zhengxiang9@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>
2019-03-20 17:29:55 +00:00
..
arm KVM: arm/arm64: Fix handling of stage2 huge mappings 2019-03-20 17:29:55 +00:00
async_pf.c KVM: fix some typos 2018-12-21 11:28:26 +01:00
async_pf.h KVM: fix checkpatch.pl errors in kvm/async_pf.h 2015-06-19 17:16:25 +02:00
coalesced_mmio.c kvm: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01:00
coalesced_mmio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
eventfd.c kvm: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01:00
irqchip.c kvm: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01:00
Kconfig KVM: arm64: Prevent KVM_COMPAT from being selected 2018-06-21 17:17:50 +01:00
kvm_main.c ARM: some cleanups, direct physical timer assignment, cache sanitization 2019-03-15 15:00:28 -07:00
vfio.c kvm: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01:00
vfio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00