From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [GIT PULL] KVM: Generic changes for 6.20
Date: Mon, 2 Mar 2026 06:53:30 -0800 [thread overview]
Message-ID: <aaWkaoEemeI3rYal@google.com> (raw)
In-Reply-To: <CABgObfaV27kPyGH1dDa-f1XaiqP_uM1cCFmSfnrakFD68u0hPg@mail.gmail.com>
On Sat, Feb 28, 2026, Paolo Bonzini wrote:
> On Sat, Feb 28, 2026 at 12:21 AM Sean Christopherson <seanjc@google.com> 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 :)
Oh, right, duh. I was fixated on kvm_alloc_apic_access_page() and didn't think
about the "other" side of the lock (i.e. the whole reason the lock exists...).
Oof, and it's also taken via
kvm_inhibit_apic_access_page()
|
-> __x86_set_memory_region()
|
-> kvm_set_internal_memslot()
|
-> kvm_set_memory_region()
|
-> kvm_set_memslot()
So I was right about kvm_alloc_apic_access_page(), and wrong about everything
else. Go me.
> (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).
next prev parent reply other threads:[~2026-03-02 14:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 4:10 [GIT PULL] KVM: x86 pull requests for 6.20 Sean Christopherson
2026-02-07 4:10 ` [GIT PULL] KVM: x86: APIC related changes " Sean Christopherson
2026-02-09 18:33 ` Paolo Bonzini
2026-02-07 4:10 ` [GIT PULL] KVM: Generic " Sean Christopherson
2026-02-09 17:38 ` Paolo Bonzini
2026-02-09 17:42 ` Paolo Bonzini
2026-02-10 0:33 ` Sean Christopherson
2026-02-27 23:21 ` Sean Christopherson
2026-02-28 13:56 ` Paolo Bonzini
2026-03-02 14:53 ` Sean Christopherson [this message]
2026-02-07 4:10 ` [GIT PULL] KVM: guest_memfd " Sean Christopherson
2026-02-07 4:10 ` [GIT PULL] KVM: x86: Misc " Sean Christopherson
2026-02-09 17:56 ` Paolo Bonzini
2026-02-09 21:19 ` Sean Christopherson
2026-02-07 4:10 ` [GIT PULL] KVM: x86: Mediated PMU " Sean Christopherson
2026-02-09 16:44 ` Sean Christopherson
2026-02-07 4:10 ` [GIT PULL] KVM: selftests changes " Sean Christopherson
2026-02-09 17:46 ` Paolo Bonzini
2026-02-07 4:10 ` [GIT PULL] KVM: x86: SVM " Sean Christopherson
2026-02-09 17:51 ` Paolo Bonzini
2026-02-07 4:10 ` [GIT PULL] KVM: x86: VMX " Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aaWkaoEemeI3rYal@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox