🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
5 messages
5 total messages Started by Jason Gunthorpe Fri, 20 Nov 2026 13:50
Re: [RFC PATCH v3 00/25] PISA: Pre-mapped IOVA Superpage Allocator for DMA and CoCo
#19823
Author: Jason Gunthorpe
Date: Fri, 20 Nov 2026 13:50
23 lines
13880 bytes
On Fri, Nov 20, 2026 at 01:06:30AM +0000, Luigi Rizzo wrote:
> This is v3 of the RFC previously posted as DMA_PMD [0], now renamed PISA
> ("Pre-mapped IOVA Superpage Allocator"). The text below follows
> Documentation/core-api/pisa.rst (patch 25/25), which has the details.

I thought the conclusion was to just do this stuff in netdev pagepool,
now you come with an enormous AI series spread across the entire
kernel?

> - Needs bounce buffers: in Confidential Computing VMs, PISA allocators
>   pre-decrypt 2MB pages in place, avoiding swiotlb bounce-buffer copies.

It seems this was ignored too. We want the bounce buffers in CC. They
serve a security purpose. You cannot loose control of the shared
memory buffers have have them leak into SKBs, user mappings and so
on. It is not secure.

I don't see how any of this is valuable or necessary for CC,
especially when we really don't even expect to have an vIOMMU for CC
very often..

Jason
Re: [RFC PATCH v3 00/25] PISA: Pre-mapped IOVA Superpage Allocator for DMA and CoCo
#19830
Author: "Lorenzo Stoakes (ARM)"
Date: Fri, 20 Nov 2026 14:18
34 lines
10837 bytes
On Fri, Nov 20, 2026 at 09:50:13AM -0400, Jason Gunthorpe wrote:
> On Fri, Nov 20, 2026 at 01:06:30AM +0000, Luigi Rizzo wrote:
> > This is v3 of the RFC previously posted as DMA_PMD [0], now renamed PISA
> > ("Pre-mapped IOVA Superpage Allocator"). The text below follows
> > Documentation/core-api/pisa.rst (patch 25/25), which has the details.
>
> I thought the conclusion was to just do this stuff in netdev pagepool,
> now you come with an enormous AI series spread across the entire
> kernel?

Welcome to 2026 :) It's so exhausting.

>
> > - Needs bounce buffers: in Confidential Computing VMs, PISA allocators
> >   pre-decrypt 2MB pages in place, avoiding swiotlb bounce-buffer copies.
>
> It seems this was ignored too. We want the bounce buffers in CC. They
> serve a security purpose. You cannot loose control of the shared
> memory buffers have have them leak into SKBs, user mappings and so
> on. It is not secure.
>
> I don't see how any of this is valuable or necessary for CC,
> especially when we really don't even expect to have an vIOMMU for CC
> very often..
>
> Jason

Agreed, this whole thing needs to be rethought.

Will reply separately to the cover I think :)

--
Cheers, Lorenzo
Re: [RFC PATCH v3 00/25] PISA: Pre-mapped IOVA Superpage Allocator for DMA and CoCo
#19835
Author: "Lorenzo Stoakes (ARM)"
Date: Fri, 20 Nov 2026 14:36
47 lines
11819 bytes
On Fri, Nov 20, 2026 at 03:19:34PM +0100, Luigi Rizzo wrote:
> On Fri, Nov 20, 2026 at 2:50 PM Jason Gunthorpe <jgg@ziepe.ca> wrote:
> >
> > On Fri, Nov 20, 2026 at 01:06:30AM +0000, Luigi Rizzo wrote:
> > > This is v3 of the RFC previously posted as DMA_PMD [0], now renamed PISA
> > > ("Pre-mapped IOVA Superpage Allocator"). The text below follows
> > > Documentation/core-api/pisa.rst (patch 25/25), which has the details.
> >
> > I thought the conclusion was to just do this stuff in netdev pagepool,
> > now you come with an enormous AI series spread across the entire
> > kernel?
>
> There were surely comments claiming nothing outside net/ cares or needs this.
>
> I respectfully disagree, witness is the fact that e.g. there was already an
> io_uring proposal which is smaller, but does not address applications
> that want to use the standard disk I/O paths (libaio, buffer cache etc)
>
> Nothing has changed from the initial series in terms of size, use cases or
> subsystems involved. Large files are placed where they should,
> the series covers the same three use cases (disk, network, CoCo), and
> touches three parts which it has to touch: mm (most of it; it is a
> memory allocator
> extension after all), dma (it hooks into map and unmap, not a large change)
> and net (the pagepool change is a couple of lines; the tx path needs to
> touch more places because the current stack assumes all paths have
> the same I/O requirements).
>
> For CoCo, there are very fine grained controls so the bounce buffers
> can be enabled only when they don't pose a risk, which in turn
> depends on the threat model.
>
> Specifically, for network tx buffers or disk writes, the user-to-kernel copy
> is basically a bounce buffer provided it is used correctly and not leaked
> elsewhere (which is the design; of course the implementation
> needs to be verified and possibly fixed so that it matches the design).
>
> cheers
> luigi

NAK.

Cheers, Lorenzo

--
Cheers, Lorenzo
Re: [RFC PATCH v3 00/25] PISA: Pre-mapped IOVA Superpage Allocator for DMA and CoCo
#20878
Author: Niklas Schnelle
Date: Mon, 23 Nov 2026 10:09
96 lines
23560 bytes
On Fri, 2026-11-20 at 15:19 +0100, Luigi Rizzo wrote:
> On Fri, Nov 20, 2026 at 2:50 PM Jason Gunthorpe <jgg@ziepe.ca> wrote:
> > 
> > On Fri, Nov 20, 2026 at 01:06:30AM +0000, Luigi Rizzo wrote:
> > > This is v3 of the RFC previously posted as DMA_PMD [0], now renamed PISA
> > > ("Pre-mapped IOVA Superpage Allocator"). The text below follows
> > > Documentation/core-api/pisa.rst (patch 25/25), which has the details.
> > 
> > I thought the conclusion was to just do this stuff in netdev pagepool,
> > now you come with an enormous AI series spread across the entire
> > kernel?
> 
> There were surely comments claiming nothing outside net/ cares or needs this.
> 
> I respectfully disagree, witness is the fact that e.g. there was already an
> io_uring proposal which is smaller, but does not address applications
> that want to use the standard disk I/O paths (libaio, buffer cache etc)
> 
> Nothing has changed from the initial series in terms of size, use cases or
> subsystems involved. Large files are placed where they should,
> the series covers the same three use cases (disk, network, CoCo), and
> touches three parts which it has to touch: mm (most of it; it is a
> memory allocator
> extension after all), dma (it hooks into map and unmap, not a large change)
> and net (the pagepool change is a couple of lines; the tx path needs to
> touch more places because the current stack assumes all paths have
> the same I/O requirements).
> 
> For CoCo, there are very fine grained controls so the bounce buffers
> can be enabled only when they don't pose a risk, which in turn
> depends on the threat model.
> 
> Specifically, for network tx buffers or disk writes, the user-to-kernel copy
> is basically a bounce buffer provided it is used correctly and not leaked
> elsewhere (which is the design; of course the implementation
> needs to be verified and possibly fixed so that it matches the design).
> 
> cheers
> luigi

Hi Luigi, Hi Jason,

I've been lurking but following this series since the start. I am torn.
On s390 where the IOMMU is always enabled on our closest equivalent to
bare metal (non paging LPAR hypervisor), and where we also default to
an emulated IOMMU in KVM guests, the underlying problem is a real pain.
We're also in the process of enabling large IOMMU mappings via the
generic_pt API which are 1M and 2G on s390. So, the idea of making
better use of larger mappings is very attractive to us and I applaud
you for trying to tackle this very real issue.

That said I do have to agree with the critique. This series is too
invasive, too unclear in its layering, and most importantly it feels
like you're trying to do everything in a big swoop ignoring advice from
the maintainers just because it would limit the scope of a first step.

I also don't think Jason's point is that nothing outside net/ cares, I
think, it's rather that the IOMMU and DMA layers already offer the
tools and each subsystem needs to use the right combination for its
specific requirements. And if a tool is missing this needs to be stated
very precisely including how the addition keeps layering intact.

I don't claim to have a simple solution to offer, if I did I would have
sent patches already, but let me state my thoughts. First I think this
really needs an iterative approach with much smaller self contained
steps and focus on specific issues. With that, I think this should
focus on the network stack, while the io_uring specific proposal can go
after the block layer. Also in my experience networking is where this
hurts most.

Now, I wonder if we can't start with something simple. What if the page
pool could start by allocating in batches of PMD sized and aligned
folios of contiguous pages that can share a single large IOMMU
translation. The page pool can then still hand out pages from that
batch without having to do sub-page allocation but would already use
much fewer IOTLB entries and the locality might even help non IOMMU
workloads. So, I'd even hope this could be enabled by default and this
is actually something I don't like about this series, I really don't
like having a tunable when we know that larger IOMMU mappings are
strictly better when you have an IOMMU that supports them.

I think that approach would also align with Jason's idea to keep things
within the network stack and to work with the tools we have until their
limits become very clear.

Thanks,
Niklas
> > 
Re: [RFC PATCH v3 00/25] PISA: Pre-mapped IOVA Superpage Allocator for DMA and CoCo
#23235
Author: Niklas Schnelle
Date: Thu, 26 Nov 2026 20:45
79 lines
22863 bytes
On Mon, 2026-11-23 at 09:50 -0800, Naman Gulati wrote:
> On Mon, Nov 23, 2026 at 2:10 AM Niklas Schnelle <schnelle@linux.ibm.com> wrote:
> > 
> > On Fri, 2026-11-20 at 15:19 +0100, Luigi Rizzo wrote:
> > > On Fri, Nov 20, 2026 at 2:50 PM Jason Gunthorpe <jgg@ziepe.ca> wrote:
> > > > 
> > > > On Fri, Nov 20, 2026 at 01:06:30AM +0000, Luigi Rizzo wrote:
> > > > > This is v3 of the RFC previously posted as DMA_PMD [0], now renamed PISA
> > > > > ("Pre-mapped IOVA Superpage Allocator"). The text below follows
> > > > > Documentation/core-api/pisa.rst (patch 25/25), which has the details.
> > > > 
> > > > I thought the conclusion was to just do this stuff in netdev pagepool,
> > > > now you come with an enormous AI series spread across the entire
> > > > kernel?
> > 
--- snip ---
> > Now, I wonder if we can't start with something simple. What if the page
> > pool could start by allocating in batches of PMD sized and aligned
> > folios of contiguous pages that can share a single large IOMMU
> > translation. The page pool can then still hand out pages from that
> > batch without having to do sub-page allocation but would already use
> > much fewer IOTLB entries and the locality might even help non IOMMU
> > workloads. So, I'd even hope this could be enabled by default and this
> > is actually something I don't like about this series, I really don't
> > like having a tunable when we know that larger IOMMU mappings are
> > strictly better when you have an IOMMU that supports them.
> > 
> > I think that approach would also align with Jason's idea to keep things
> > within the network stack and to work with the tools we have until their
> > limits become very clear.
> 
> Hi Niklas,
> 
> I have been working on this idea exactly - extending the network
> page-pool with a memory provider that allocates large pages, splitting
> them into N smaller pages that all share a single IOMMU entry. I
> breifly shared my approach in the v1 PMD series [1]. I'm readying a
> short RFC to share shortly, would appreciate your feedback.
> 
> 
> [1] https://lore.kernel.org/netdev/CAMP57yWvHO0pWCR3-9q1gtwVe8WV4Y6i69trmw+BJRVYf3JB1g@mail.gmail.com/
> 

Hi Naman,

This does look more contained, but I'd say you should still go simpler
and fewer steps per series. Some thoughts:

- Drop the CoCo aspect for now. The shadowing / virtio-iommu and IOTLB
performance aspects stand on their own in my opinion and the focus
makes it easier to review too. As Jason said it's then really just
normal memory that was pre-mapped for DMA.
- I'm not a network stack expert but I think using the page pool for TX
warrants its own series. Maybe just start with RX, this is also where
we see the biggest performance issues and it would hopefully make the
patches at least a bit more manageable.
- This is still a LOT of churn, my gut says much of the benefit should
be possible with much less churn. It's really too much to follow but a
cursory look makes me feel like there is duplication between rx and tx,
which is weird since for the pre-mapping they should be quite similar.
There also seems to be very little integration with the existing page
pool, rather it seems to set up a parallel mechanism for the pre-mapped
buffers. Really in a first step I think we "just" want to use a more
efficient DMA mapping and contiguous memory chunks for the page pool
and also keep the page pool API unchanged as much as possible.

These are only guesses from looking at the GitHub branch a bit, I did
not dive super deep.

Thanks,
Niklas
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads