Thread (79 messages) 79 messages, 10 authors, 2025-10-07

Re: [PATCH 03/34] KVM: Use gfn instead of hva for mmu_notifier_retry

From: Huang, Kai <hidden>
Date: 2023-11-06 09:29:48
Also in: kvm, kvm-riscv, kvmarm, linux-arm-kernel, linux-fsdevel, linux-mips, linux-mm, linux-riscv, lkml

On Sun, 2023-11-05 at 17:30 +0100, Paolo Bonzini wrote:
From: Chao Peng <redacted>

Currently in mmu_notifier invalidate path, hva range is recorded and then
checked against by mmu_invalidate_retry_hva() in the page fault handling
path. However, for the soon-to-be-introduced private memory, a page fault
may not have a hva associated, checking gfn(gpa) makes more sense.

For existing hva based shared memory, gfn is expected to also work. The
only downside is when aliasing multiple gfns to a single hva, the
current algorithm of checking multiple ranges could result in a much
larger range being rejected. Such aliasing should be uncommon, so the
impact is expected small.

Suggested-by: Sean Christopherson <seanjc@google.com>
Cc: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Chao Peng <redacted>
Reviewed-by: Fuad Tabba <redacted>
Tested-by: Fuad Tabba <redacted>
[sean: convert vmx_set_apic_access_page_addr() to gfn-based API]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Xu Yilun <redacted>
Message-Id: [ref]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Kai Huang <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help