From: Michal Luczaj <mhal@rbox.co>
To: Paolo Bonzini <pbonzini@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: seanjc@google.com, David Woodhouse <dwmw@amazon.co.uk>
Subject: Re: [PATCH] KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET
Date: Fri, 24 Feb 2023 19:18:02 +0100 [thread overview]
Message-ID: <747f1eac-c620-d7cb-86a1-a2c575cd2ef9@rbox.co> (raw)
In-Reply-To: <20221228110410.1682852-1-pbonzini@redhat.com>
On 28/12/2022 12:04, Paolo Bonzini wrote:
> While KVM_XEN_EVTCHN_RESET is usually called with no vCPUs running,
> if that happened it could cause a deadlock. This is due to
> kvm_xen_eventfd_reset() doing a synchronize_srcu() inside
> a kvm->lock critical section.
>
> [...]
>
> + /*
> + * Because synchronize_srcu() cannot be called inside the
> + * critical section, first collect all the evtchnfd objects
> + * in an array as they are removed from evtchn_ports.
> + */
With the recent changes regarding the locking order (locking.rst:
"synchronize_srcu(&kvm->srcu) is called inside critical sections for kvm->lock,
vcpu->mutex and kvm->slots_lock"), is this comment still valid?
Or is there a rule that forbids synchronize_srcu() under the newly introduced
kvm->arch.xen.xen_lock?
thanks,
Michal
next prev parent reply other threads:[~2023-02-24 18:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-28 11:04 [PATCH] KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET Paolo Bonzini
2023-01-19 15:58 ` Yu Zhang
2023-01-19 17:57 ` Sean Christopherson
2023-01-19 18:00 ` Paolo Bonzini
2023-01-19 18:04 ` Sean Christopherson
2023-01-19 18:12 ` Paolo Bonzini
2023-01-19 18:14 ` Sean Christopherson
2023-01-19 18:16 ` Paolo Bonzini
2023-02-24 18:18 ` Michal Luczaj [this message]
[not found] <62d7c91f-1486-4aea-8764-352efb383326@email.android.com>
2022-12-28 13:21 ` Paolo Bonzini
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=747f1eac-c620-d7cb-86a1-a2c575cd2ef9@rbox.co \
--to=mhal@rbox.co \
--cc=dwmw@amazon.co.uk \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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