From: Bjorn Helgaas <helgaas@kernel.org>
To: Keith Busch <keith.busch@intel.com>
Cc: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
Jon Derrick <jonathan.derrick@intel.com>
Subject: Re: [PATCH 2/2] vmd: Synchronize with RCU freeing msi irq descs
Date: Wed, 14 Sep 2016 17:10:40 -0500 [thread overview]
Message-ID: <20160914221040.GF16581@localhost> (raw)
In-Reply-To: <1470348549-10855-2-git-send-email-keith.busch@intel.com>
On Thu, Aug 04, 2016 at 04:09:09PM -0600, Keith Busch wrote:
> This patch fixes a potential race when disabling MSI/MSI-x on a VMD domain
> device. If the vmd interrupt service is running, it may see a disabled
> irq. We can synchronize rcu just before freeing the msi descriptor. This
> is safe since the irq_desc lock isn't held, and the descriptor is valid
> even though it is disabled. After vmd_msi_free, though, the handler is
> reinitialiazed to handle_bad_irq, so we can't let the vmd isr's list
> iteration see the disabled irq after this.
>
> Signed-off-by: Keith Busch <keith.busch@intel.com>
Applied with Jon's ack to pci/host-vmd for v4.9, thanks!
If anybody else reads this, this patch got lost for a while because it
was posted as the second patch of a series. I had some comments on
the first patch that led to a little rework. When that happens, I
mark the *entire* series as "Changes requested" or "Superseded"
because I'm expecting a complete repost with the rework.
It's too much work for me to track individual patches within a series.
So if you update one patch in a series, please just repost the entire
series, including other patches that may be unmodified.
Bjorn
> ---
> arch/x86/pci/vmd.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/pci/vmd.c b/arch/x86/pci/vmd.c
> index 2294907..e3c9b9e 100644
> --- a/arch/x86/pci/vmd.c
> +++ b/arch/x86/pci/vmd.c
> @@ -213,6 +213,8 @@ static void vmd_msi_free(struct irq_domain *domain,
> struct vmd_irq *vmdirq = irq_get_chip_data(virq);
> unsigned long flags;
>
> + synchronize_rcu();
> +
> /* XXX: Potential optimization to rebalance */
> raw_spin_lock_irqsave(&list_lock, flags);
> vmdirq->irq->count--;
> --
> 2.7.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-09-14 22:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-04 22:09 [PATCH 1/2] vmd: Fix infinite loop executing irq's Keith Busch
2016-08-04 22:09 ` [PATCH 2/2] vmd: Synchronize with RCU freeing msi irq descs Keith Busch
2016-08-08 16:47 ` Jon Derrick
2016-08-29 16:07 ` Jon Derrick
2016-09-14 22:10 ` Bjorn Helgaas [this message]
2016-08-04 22:48 ` [PATCH 1/2] vmd: Fix infinite loop executing irq's Myron Stowe
2016-08-04 23:12 ` Derrick, Jonathan
2016-08-05 17:03 ` Bjorn Helgaas
2016-08-05 21:02 ` Keith Busch
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=20160914221040.GF16581@localhost \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=jonathan.derrick@intel.com \
--cc=keith.busch@intel.com \
--cc=linux-pci@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).