From: "Roger Pau Monné" <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH 1/4] x86/physdev: use less heavy locking in physdev_unmap_pirq()
Date: Tue, 17 Nov 2026 11:29:44 +0100 [thread overview]
Message-ID: <avwsmDrigjFrE6RT@Mac.lan> (raw)
In-Reply-To: <7dc9e911-73f7-4efb-8132-b9f6a5fafc0a@suse.com>
On Thu, Oct 29, 2026 at 03:23:56PM +0100, Jan Beulich wrote:
> Like its mapping counterpart, in the GSI case no (PCI-related) lock would
> be needed at all, while in the MSI cases the domain's PCI lock is
> sufficient to hold.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/physdev.c
> +++ b/xen/arch/x86/physdev.c
> @@ -156,11 +156,11 @@ int physdev_unmap_pirq(struct domain *d,
> return ret;
> }
>
> - pcidevs_lock();
> + read_lock(&d->pci_lock);
> write_lock(&d->event_lock);
> ret = unmap_domain_pirq(d, pirq);
> write_unlock(&d->event_lock);
> - pcidevs_unlock();
> + read_unlock(&d->pci_lock);
I think there's possibly one pre-patch that would be needed before
making this change. Callers of pci_restore_msi_state() only hold the
pcidevs lock, dropping pcidevs lock here we would be allowing changes
to the list while there's possibly a concurrent access by
pci_restore_msi_state().
I think pci_restore_msi_state() (or its callers) need to hold the
d->event_lock, and this likely wants to be a pre-patch. Not holding
d->event_lock while iterating over pdev->msi_list in
pci_restore_msi_state() seems like a pre-existing issue that would be
uncovered by this patch, albeit it's not clear what d->event_lock is
supposed to protect exactly.
Thanks, Roger.
next prev parent reply other threads:[~2026-11-17 10:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 14:22 [PATCH 0/4] x86: yet more PCI locking adjustments Jan Beulich
2026-10-29 14:23 ` [PATCH 1/4] x86/physdev: use less heavy locking in physdev_unmap_pirq() Jan Beulich
2026-11-17 10:29 ` Roger Pau Monné [this message]
2026-10-29 14:24 ` [PATCH 2/4] x86/IRQ: use less heavy locking in free_domain_pirqs() Jan Beulich
2026-11-17 10:31 ` Roger Pau Monné
2026-11-17 10:38 ` Jan Beulich
2026-11-17 11:35 ` Roger Pau Monné
2026-10-29 14:24 ` [PATCH 3/4] x86/MSI: drop redundant checking Jan Beulich
2026-11-17 10:34 ` Roger Pau Monné
2026-10-29 14:25 ` [PATCH 4/4] x86: tighten PCI-related locking assertions Jan Beulich
2026-11-17 10:41 ` Roger Pau Monné
2026-11-17 11:11 ` Jan Beulich
2026-11-17 11:27 ` Roger Pau Monné
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=avwsmDrigjFrE6RT@Mac.lan \
--to=roger@xenproject.org \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.