Re: [GIT PULL] KVM: Generic changes for 6.20
From: Paolo Bonzini
Date: Sat Feb 28 2026 - 08:57:17 EST
On Sat, Feb 28, 2026 at 12:21 AM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
> Finally got around to prepping a v2, and I realized that vcpu->mutex isn't held
> when kvm_alloc_apic_access_page() is called, and thus isn't (currently) taken
> outside kvm->slots_arch_lock.
It is, via kvm_mmu_new_pgd (kvm_mmu_reload -> kvm_mmu_load ->
mmu_alloc_shadow_roots -> mmu_first_shadow_root_alloc). In fact
commit b10a038e added slots_arch_lock exactly to have something that
could be taken within the SRCU critical section, and thus within
vcpu->mutex :)
(slots_arch_lock is also taken inside slots_lock, and therefore it
must be taken inside vcpu->mutex transitively; but more to the point
it exists specifically to be taken during KVM_RUN).
> But update the changelog to not claim that the behavior is "arguablyh wrong".
That too, yes.
Paolo