Re: [PATCH v6 0/9] coco: guest: Enforce host page-size alignment for shared buffers
From: Catalin Marinas
Date: Fri Sep 18 2026 - 13:57:36 EST
On Fri, Sep 18, 2026 at 01:57:54PM -0300, Jason Gunthorpe wrote:
> On Fri, Sep 18, 2026 at 05:52:31PM +0100, Catalin Marinas wrote:
>
> > TBH, I'm tempted not to support this configuration at all, just fail
> > gracefully if the realm page size doesn't match the host's. However, if
> > that's a real world configuration,
>
> realm != host is going to be fairly common.
>
> host > realm is probably not that common, I would guess.
It's the latter that's problematic. If we don't think it's common, maybe
not worth solving.
> > I wonder whether could we leverage the swiotlb mechanism but with a
> > separate io_tlb_mem as a shared coco allocator with the right
> > alignment and use this pool when force_dma_unencrypted() instead of
> > specific alloc_pages() with adjusted order.
>
> I propose we fix the far too low level set memory decrypted apis into
> proper allocators, with APIs that can handle a round up. Then see
> where we end up after that.
I fully agree. As you said, it also solves the double zeroing problem
and we can wire up the granule difference handling.
--
Catalin