KVM: PPC: Book3S HV: Remove user-triggerable WARN_ON
authorPaul Mackerras <paulus@ozlabs.org>
Thu, 28 May 2020 00:48:18 +0000 (10:48 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 28 May 2020 00:48:18 +0000 (10:48 +1000)
commit3d89c2ef24f0772b7806ed289bef482b24083de6
treebea4b52aeb9a98926a963f6d6d1f577370e879ec
parente3326ae3d59e443a379367c6936941d6ab55d316
KVM: PPC: Book3S HV: Remove user-triggerable WARN_ON

Although in general we do not expect valid PTEs to be found in
kvmppc_create_pte when we are inserting a large page mapping, there
is one situation where this can occur.  That is when dirty page
logging is turned off for a memslot while the VM is running.
Because the new memslots are installed before the old memslot is
flushed in kvmppc_core_commit_memory_region_hv(), there is a
window where a hypervisor page fault can try to install a 2MB
(or 1GB) page where there are already small page mappings which
were installed while dirty page logging was enabled and which
have not yet been flushed.

Since we have a situation where valid PTEs can legitimately be
found by kvmppc_unmap_free_pte, and which can be triggered by
userspace, just remove the WARN_ON_ONCE, since it is undesirable
to have userspace able to trigger a kernel warning.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_64_mmu_radix.c