Re: [PATCH 24/24] kvm: x86/mmu: Allow parallel page faults for the TDP MMU

Paolo Bonzini
2021-01-26T13:40:22Z

On 12/01/21 19:10, Ben Gardon wrote:
> + if (is_tdp_mmu_root(vcpu->kvm, vcpu->arch.mmu->root_hpa))
> + kvm_mmu_lock_shared(vcpu->kvm);
> + else
> + kvm_mmu_lock(vcpu->kvm);

Perhaps the better API would be kvm_mmu_lock/unlock_root; not exposing
kvm_mmu_lock/unlock_shared and kvm_mmu_lock/unlock_exclusive at all,
just like you use rwlock_needbreak directly in kvm_mmu_lock_needbreak.

Paolo