On Thu, Apr 04, 2024, David Matlack wrote: > > I don't love the idea of adding more arch specific MMU behavior (going the wrong > > direction), but it doesn't seem like an unreasonable approach in this case. > > I wonder if this is being overly cautious. Probably. "Lazy" is another word for it ;-) > I would expect only more benefit on architectures that more aggressively take > the mmu_lock on vCPU threads during faults. The more lock acquisition on vCPU > threads, the more this patch will help reduce vCPU starvation during > CLEAR_DIRTY_LOG. > > Hm, perhaps testing with ept=N (which will use the write-lock for even > dirty logging faults) would be a way to increase confidence in the > effect on other architectures? Turning off the TDP MMU would be more representative, just manually disable the fast-path, e.g. diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 992e651540e8..532c24911f39 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -3371,7 +3371,7 @@ static bool page_fault_can_be_fast(struct kvm_page_fault *fault) * Note, instruction fetches and writes are mutually exclusive, ignore * the "exec" flag. */ - return fault->write; + return false;//fault->write; } /*