Re: [RFC PATCH kernel] iommufd: Allow mapping from KVM's guest_memfd
From: Jason Gunthorpe
Date: Thu Feb 26 2026 - 20:09:22 EST
On Thu, Feb 26, 2026 at 04:28:53PM -0800, Sean Christopherson wrote:
> > I'm confused though - I thought in-place conversion ment that
> > private<->shared re-used the existing memory allocation? Why does it
> > "remove" memory?
> >
> > Or perhaps more broadly, where is the shared memory kept/accessed in
> > these guest memfd systems?
>
> Oh, the physical memory doesn't change, but the IOMMU might care that memory is
> being converted from private<=>shared. AMD IOMMU probably doesn't? But unless
> Intel IOMMU reuses S-EPT from the VM itself, the IOMMU page tables will need to
> be updated.
Okay, so then it is probably OK for AMD and ARM to just let
shared/private happen and whatever userspace does or doesn't do is not
important. The IOPTE will point at guaranteed allocated memory and any
faults caused by imporerly putting private in a shared slot will be
contained.
I have no idea what happens to Intel if the shared IOMMU points to a
private page? The machine catches fire and daemons spawn from a
fissure?
Or maybe we are lucky and it generates a nice contained fault like the
other two so we don't need to build something elaborate and special to
make up for horrible hardware? Pretty please?
Jason