[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241002185520.GL1369530@ziepe.ca>
Date: Wed, 2 Oct 2024 15:55:20 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: James Gowans <jgowans@...zon.com>
Cc: linux-kernel@...r.kernel.org, Kevin Tian <kevin.tian@...el.com>,
Joerg Roedel <joro@...tes.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
Mike Rapoport <rppt@...nel.org>,
"Madhavan T. Venkataraman" <madvenka@...ux.microsoft.com>,
iommu@...ts.linux.dev, Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
David Woodhouse <dwmw2@...radead.org>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Alexander Graf <graf@...zon.de>, anthony.yznaga@...cle.com,
steven.sistare@...cle.com, nh-open-source@...zon.com,
"Saenz Julienne, Nicolas" <nsaenz@...zon.es>
Subject: Re: [RFC PATCH 05/13] iommufd: Serialise persisted iommufds and ioas
On Mon, Sep 16, 2024 at 01:30:54PM +0200, James Gowans wrote:
> Now actually implementing the serialise callback for iommufd.
> On KHO activate, iterate through all persisted domains and write their
> metadata to the device tree format. For now just a few fields are
> serialised to demonstrate the concept. To actually make this useful a
> lot more field and related objects will need to be serialised too.
But isn't that a rather difficult problem? The "a lot more fields"
include things like pointers to the mm struct, the user_struct and
task_struct, then all the pinning accounting as well.
Coming work extends this to memfds and more is coming. I would expect
this KHO stuff to use the memfd-like path to access the physical VM
memory too.
I think expecting to serialize and restore everything like this is
probably much too complicated.
If you could just retain a small portion and then directly reconstruct
the missing parts it seems like it would be more maintainable.
Ie "recover" a HWPT from a KHO on a manually created a IOAS with the
right "memfd" for the backing storage. Then the recovery can just
validate that things are correct and adopt the iommu_domain as the
hwpt.
Eventually you'll want this to work for the viommus as well, and that
seems like a lot more tricky complexity..
Jason
Powered by blists - more mailing lists