public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Sasha Levin <sashal@kernel.org>,
	stable@vger.kernel.org, stable-commits@vger.kernel.org,
	reinette.chatre@intel.com
Subject: Re: Patch "vfio/pci: Prepare for dynamic interrupt context storage" has been added to the 6.1-stable tree
Date: Sat, 30 Mar 2024 09:44:53 +0100	[thread overview]
Message-ID: <2024033048-succulent-dirtiness-a1c8@gregkh> (raw)
In-Reply-To: <20240329110433.156ff56c.alex.williamson@redhat.com>

On Fri, Mar 29, 2024 at 11:04:33AM -0600, Alex Williamson wrote:
> On Wed, 27 Mar 2024 07:41:33 -0400
> Sasha Levin <sashal@kernel.org> wrote:
> > This is a note to let you know that I've just added the patch titled
> > 
> >     vfio/pci: Prepare for dynamic interrupt context storage
> > 
> > to the 6.1-stable tree which can be found at:
> >     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> > 
> > The filename of the patch is:
> >      vfio-pci-prepare-for-dynamic-interrupt-context-stora.patch
> > and it can be found in the queue-6.1 subdirectory.
> > 
> > If you, or anyone else, feels it should not be added to the stable tree,
> > please let <stable@vger.kernel.org> know about it.
> > 
> > 
> > 
> > commit bca808da62c6a87ef168554caa318c2801d19b70
> > Author: Reinette Chatre <reinette.chatre@intel.com>
> > Date:   Thu May 11 08:44:30 2023 -0700
> > 
> >     vfio/pci: Prepare for dynamic interrupt context storage
> >     
> >     [ Upstream commit d977e0f7663961368f6442589e52d27484c2f5c2 ]
> >     
> >     Interrupt context storage is statically allocated at the time
> >     interrupts are allocated. Following allocation, the interrupt
> >     context is managed by directly accessing the elements of the
> >     array using the vector as index.
> >     
> >     It is possible to allocate additional MSI-X vectors after
> >     MSI-X has been enabled. Dynamic storage of interrupt context
> >     is needed to support adding new MSI-X vectors after initial
> >     allocation.
> >     
> >     Replace direct access of array elements with pointers to the
> >     array elements. Doing so reduces impact of moving to a new data
> >     structure. Move interactions with the array to helpers to
> >     mostly contain changes needed to transition to a dynamic
> >     data structure.
> >     
> >     No functional change intended.
> >     
> >     Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> >     Reviewed-by: Kevin Tian <kevin.tian@intel.com>
> >     Acked-by: Thomas Gleixner <tglx@linutronix.de>
> >     Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> >     Link: https://lore.kernel.org/r/eab289693c8325ede9aba99380f8b8d5143980a4.1683740667.git.reinette.chatre@intel.com
> >     Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> >     Stable-dep-of: fe9a7082684e ("vfio/pci: Disable auto-enable of exclusive INTx IRQ")
> >     Signed-off-by: Sasha Levin <sashal@kernel.org>
> ...
> > @@ -171,15 +225,24 @@ static irqreturn_t vfio_intx_handler(int irq, void *dev_id)
> >  
> >  static int vfio_intx_enable(struct vfio_pci_core_device *vdev)
> >  {
> > +	struct vfio_pci_irq_ctx *ctx;
> > +	int ret;
> > +
> >  	if (!is_irq_none(vdev))
> >  		return -EINVAL;
> >  
> >  	if (!vdev->pdev->irq)
> >  		return -ENODEV;
> >  
> > -	vdev->ctx = kzalloc(sizeof(struct vfio_pci_irq_ctx), GFP_KERNEL_ACCOUNT);
> > -	if (!vdev->ctx)
> > -		return -ENOMEM;
> > +	ret = vfio_irq_ctx_alloc_num(vdev, 1);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ctx = vfio_irq_ctx_get(vdev, 0);
> > +	if (!ctx) {
> > +		vfio_irq_ctx_free_all(vdev);
> > +		return -EINVAL;
> > +	}
> >  
> >  	vdev->num_ctx = 1;
> 
> This is broken on it's own, vfio_irq_ctx_get() depends on a valid
> num_ctx, therefore this function always returns -EINVAL.  This was
> resolved upstream by b156e48fffa9 ("vfio/pci: Use xarray for interrupt
> context storage") which was from the same series, so this issue was
> never apparent upstream.  Suggest dropping this and fe9a7082684e
> ("vfio/pci: Disable auto-enable of exclusive INTx IRQ") for now and
> we'll try to rework the latter to remove the dependency.  Thanks,

Ok, I'll go drop both of these and take the series you just sent,
thanks.

greg k-h

      reply	other threads:[~2024-03-30  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240327114133.2806020-1-sashal@kernel.org>
2024-03-29 17:04 ` Patch "vfio/pci: Prepare for dynamic interrupt context storage" has been added to the 6.1-stable tree Alex Williamson
2024-03-30  8:44   ` Greg KH [this message]

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=2024033048-succulent-dirtiness-a1c8@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=alex.williamson@redhat.com \
    --cc=reinette.chatre@intel.com \
    --cc=sashal@kernel.org \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@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