]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: RISC-V: Mark "struct page" pfns accessed before dropping mmu_lock
authorSean Christopherson <seanjc@google.com>
Thu, 10 Oct 2024 18:24:00 +0000 (11:24 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Oct 2024 17:00:48 +0000 (13:00 -0400)
commit9c902aee686979d9460d8bd0cabcf2fa0195d7d9
tree5692c719da6addbea3a086c49fa466a2a30b414c
parent9b3639bb02fb98a664110836147a03b45c83ed94
KVM: RISC-V: Mark "struct page" pfns accessed before dropping mmu_lock

Mark pages accessed before dropping mmu_lock when faulting in guest memory
so that RISC-V can convert to kvm_release_faultin_page() without tripping
its lockdep assertion on mmu_lock being held.  Marking pages accessed
outside of mmu_lock is ok (not great, but safe), but marking pages _dirty_
outside of mmu_lock can make filesystems unhappy (see the link below).
Do both under mmu_lock to minimize the chances of doing the wrong thing in
the future.

Link: https://lore.kernel.org/all/cover.1683044162.git.lstoakes@gmail.com
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-59-seanjc@google.com>
arch/riscv/kvm/mmu.c