linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasily Gorbik <gor@linux.ibm.com>
To: Niklas Schnelle <schnelle@linux.ibm.com>
Cc: Matthew Rosato <mjrosato@linux.ibm.com>,
	Joerg Roedel <jroedel@suse.de>, Will Deacon <will@kernel.org>,
	Gerd Bayer <gbayer@linux.ibm.com>, Jason Gunthorpe <jgg@ziepe.ca>,
	Heiko Carstens <hca@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH v2] s390/pci: Fix dev.dma_range_map missing sentinel element
Date: Thu, 27 Mar 2025 15:51:50 +0100	[thread overview]
Message-ID: <your-ad-here.call-01743087110-ext-9280@work.hours> (raw)
In-Reply-To: <c6bcb10536005fd36966a97574e424c17cde1105.camel@linux.ibm.com>

On Thu, Mar 27, 2025 at 10:45:40AM +0100, Niklas Schnelle wrote:
> On Wed, 2025-03-12 at 11:32 +0100, Niklas Schnelle wrote:
> > The fixed commit sets up dev.dma_range_map but missed that this is
> > supposed to be an array of struct bus_dma_region with a sentinel element
> > with the size field set to 0 at the end. This would lead to overruns in
> > e.g. dma_range_map_min(). It could also result in wrong translations
> > instead of DMA_MAPPING_ERROR in translate_phys_to_dma() if the paddr
> > were to not fit in the aperture. Fix this by using the
> > dma_direct_set_offset() helper which creates a sentinel for us.
> > 
> > Fixes: d236843a6964 ("s390/pci: store DMA offset in bus_dma_region")
> > Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
> > Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
> > ---
> > Note: Based on iommu/next
> > 
> > v1 -> v2:
> > - Fixed typo, added trailers
> > - Link to v1: https://lore.kernel.org/r/20250306-fix_dma_map_alloc-v1-1-b4fa44304eac@linux.ibm.com
> > ---
> >  arch/s390/pci/pci_bus.c | 24 +++++++++++-------------
> >  1 file changed, 11 insertions(+), 13 deletions(-)
> > 
> 
> With the IOMMU pull request for Linux v6.15 the fixed commit is now in
> Linus tree (with the SHA as cited) but this fix isn't. Since this fix
> only touches s390 specific code I think it could go through the s390
> tree but that currently doesn't carry the fixed commit so would have to
> wait until the s390 tree pulls in v6.15-rc1. 
> 
> I don't think any breakage from the missing sentinel is visible outside
> of guests using the new IOMMU passthrough mode so I guess waiting until
> after v6.15-rc1 would be okay.
> 
> Heiko, Vasily, Alexander what do you think?

Sure, I'll pick it up in the s390 tree for rc1 or rc2, depending on
whether there will be a second s390 tree pull request during the merge
window.

  reply	other threads:[~2025-03-27 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 10:32 [PATCH v2] s390/pci: Fix dev.dma_range_map missing sentinel element Niklas Schnelle
2025-03-27  9:45 ` Niklas Schnelle
2025-03-27 14:51   ` Vasily Gorbik [this message]
2025-03-31 10:58     ` Vasily Gorbik

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=your-ad-here.call-01743087110-ext-9280@work.hours \
    --to=gor@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gbayer@linux.ibm.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=schnelle@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    --cc=will@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).