]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Mark the page dirty only if the fault is handled successfully
authorYanan Wang <wangyanan55@huawei.com>
Thu, 14 Jan 2021 12:13:50 +0000 (20:13 +0800)
committerMarc Zyngier <maz@kernel.org>
Mon, 25 Jan 2021 16:30:20 +0000 (16:30 +0000)
commitc829866aa9d55bcb5e18b5d65dc92699227d3bf7
treef58f24f7a80c8a7de5fb9cfc8dfa4d33eb9252dd
parente4c54936d30da03730acc2eb18e1c9952e2c38e5
KVM: arm64: Mark the page dirty only if the fault is handled successfully

We now set the pfn dirty and mark the page dirty before calling fault
handlers in user_mem_abort(), so we might end up having spurious dirty
pages if update of permissions or mapping has failed. Let's move these
two operations after the fault handlers, and they will be done only if
the fault has been handled successfully.

When an -EAGAIN errno is returned from the map handler, we hope to the
vcpu to enter guest directly instead of exiting back to userspace, so
adjust the return value at the end of function.

Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210114121350.123684-4-wangyanan55@huawei.com
arch/arm64/kvm/mmu.c