Re: [PATCH v2 23/28] KVM: x86/mmu: Allow parallel page faults for the TDP MMU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/02/21 19:57, Ben Gardon wrote:

-	write_lock(&vcpu->kvm->mmu_lock);
+
+	if (is_tdp_mmu_root(vcpu->kvm, vcpu->arch.mmu->root_hpa))
+		read_lock(&vcpu->kvm->mmu_lock);
+	else
+		write_lock(&vcpu->kvm->mmu_lock);
+

I'd like to make this into two helper functions, but I'm not sure about the naming:

- kvm_mmu_read_lock_for_root/kvm_mmu_read_unlock_for_root: not precise because it's really write-locked for shadow MMU roots

- kvm_mmu_lock_for_root/kvm_mmu_unlock_for_root: not clear that TDP MMU operations will need to operate in shared-lock mode

I prefer the first because at least it's the conservative option, but I'm open to other opinions and suggestions.

Paolo




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux