From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Leon Romanovsky <leon@kernel.org>, Matt Evans <mattev@meta.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Logan Gunthorpe <logang@deltatee.com>,
Ankit Agrawal <ankita@nvidia.com>,
Alex Williamson <alex@shazbot.org>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI/P2PDMA: Avoid returning a provider for non_mappable_bars
Date: Thu, 23 Apr 2026 16:55:29 +0200 [thread overview]
Message-ID: <9803c500aead703be8ebbae9d8514d1359784e20.camel@linux.ibm.com> (raw)
In-Reply-To: <20260422151906.GB28413@unreal>
On Wed, 2026-04-22 at 18:19 +0300, Leon Romanovsky wrote:
> On Wed, Apr 22, 2026 at 03:22:53PM +0100, Matt Evans wrote:
> > Hi Leon,
> >
> > On 21/04/2026 20:49, Leon Romanovsky wrote:
> > >
> > > On Tue, Apr 21, 2026 at 10:43:51AM -0700, Matt Evans wrote:
> > > > Extend pcim_p2pdma_provider()'s checks to exclude functions that have
> > > > pdev->non_mappable_bars set.
> > > >
> > > > Consumers such as VFIO were previously able to map these for access by
> > > > the CPU or P2P. Update the comment on non_mappable_bars to show it
> > > > refers to any access, not just userspace CPU access.
> > > >
> > > > Fixes: 372d6d1b8ae3c ("PCI/P2PDMA: Refactor to separate core P2P functionality from memory allocation")
> > >
> > > I don't object to the patch, but this Fixes line doesn't look correct.
> > > non_mappable_bars applies only to s390, which doesn't support p2p. That
> > > wasn't prevented before 372d6d1b8ae3c refactoring too.
> >
> > Thanks; I'd chosen that commit as it adds the function that the additional
> > test is being added to.
>
> Can I suggest slightly different solution?
> If CONFIG_..._S390 is set, we will unset CONFIG_PCI_P2PDMA and pcim_p2pdma_provider()
> will be compiled to return NULL, without changing non_mappable_bars
> description.
>
> Thanks
Hi Leon,
I'm not sure this is an ideal solution for the longer term. While ISM
definitely can't do P2P and is more akin to an emulated PCI device in
its actual implementation, other PCI devices on the platform such as
ConnectX family NICs, NVMes and the IBM Spyre Accelerator are much more
run off the mill.
So, I'd prefer not to create restrictions unnecessarily. Now there are
other unusual properties like the fact that all OSs on s390 run
virtualized with PCI functions passed-through by a machine level
hypervisor. That and firmware also control root ports and PCIe
switches. Still, I don't believe there is anything fundamentally
preventing P2P to work in the future. While we could then take this
restriction out again, I'd prefer not to introduce it in the first
place unless we have to.
Thanks,
Niklas Schnelle
next prev parent reply other threads:[~2026-04-23 14:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 17:43 [PATCH] PCI/P2PDMA: Avoid returning a provider for non_mappable_bars Matt Evans
2026-04-21 18:14 ` Logan Gunthorpe
2026-04-21 19:49 ` Leon Romanovsky
2026-04-22 14:22 ` Matt Evans
2026-04-22 15:19 ` Leon Romanovsky
2026-04-23 14:55 ` Niklas Schnelle [this message]
2026-04-26 11:22 ` Leon Romanovsky
2026-04-23 15:48 ` Matt Evans
2026-04-22 9:19 ` Niklas Schnelle
2026-04-22 15:01 ` Alex Williamson
2026-04-23 16:46 ` Matt Evans
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=9803c500aead703be8ebbae9d8514d1359784e20.camel@linux.ibm.com \
--to=schnelle@linux.ibm.com \
--cc=alex@shazbot.org \
--cc=ankita@nvidia.com \
--cc=bhelgaas@google.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=mattev@meta.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