lkml.org 
[lkml]   [2021]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 23/28] KVM: x86/mmu: Allow parallel page faults for the TDP MMU
Date
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

\
 
 \ /
  Last update: 2021-02-03 13:43    [W:1.773 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site