KVM: RISC-V: Mark "struct page" pfns dirty iff a stage-2 PTE is installed
authorSean Christopherson <seanjc@google.com>
Thu, 10 Oct 2024 18:23:59 +0000 (11:23 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Oct 2024 17:00:48 +0000 (13:00 -0400)
commit9b3639bb02fb98a664110836147a03b45c83ed94
treec161ecd80a7a8fc8925778a5512cbee29920ba67
parent85c7869e30b770082b78134e61c1c7db5a903ea4
KVM: RISC-V: Mark "struct page" pfns dirty iff a stage-2 PTE is installed

Don't mark pages dirty if KVM bails from the page fault handler without
installing a stage-2 mapping, i.e. if the page is guaranteed to not be
written by the guest.

In addition to being a (very) minor fix, this paves the way for converting
RISC-V to use kvm_release_faultin_page().

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Acked-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20241010182427.1434605-58-seanjc@google.com>
arch/riscv/kvm/mmu.c