[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+CK2bA7LK2i-AOyTwx1KNUoF5fUWEWBA49i8T_wYXBApKkUBw@mail.gmail.com>
Date: Mon, 29 Sep 2025 13:45:37 -0400
From: Pasha Tatashin <pasha.tatashin@...een.com>
To: Samiullah Khawaja <skhawaja@...gle.com>
Cc: Jason Gunthorpe <jgg@...pe.ca>, David Woodhouse <dwmw2@...radead.org>,
Lu Baolu <baolu.lu@...ux.intel.com>, Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>, iommu@...ts.linux.dev, YiFei Zhu <zhuyifei@...gle.com>,
Robin Murphy <robin.murphy@....com>, Pratyush Yadav <pratyush@...nel.org>,
Kevin Tian <kevin.tian@...el.com>, linux-kernel@...r.kernel.org,
Saeed Mahameed <saeedm@...dia.com>, Adithya Jayachandran <ajayachandra@...dia.com>,
Parav Pandit <parav@...dia.com>, Leon Romanovsky <leonro@...dia.com>, William Tu <witu@...dia.com>,
Vipin Sharma <vipinsh@...gle.com>, dmatlack@...gle.com, Chris Li <chrisl@...nel.org>,
praan@...gle.com
Subject: Re: [RFC PATCH 13/15] iommufd: Persist iommu domains for live update
On Mon, Sep 29, 2025 at 1:32 PM Samiullah Khawaja <skhawaja@...gle.com> wrote:
>
> On Mon, Sep 29, 2025 at 9:00 AM Jason Gunthorpe <jgg@...pe.ca> wrote:
> >
> > On Sun, Sep 28, 2025 at 07:06:21PM +0000, Samiullah Khawaja wrote:
> > > +static int iommufd_save_ioas(struct iommufd_ctx *ictx,
> > > + struct iommufd_lu *iommufd_lu)
> > > +{
> > > + struct iommufd_hwpt_paging *hwpt_paging;
> > > + struct iommufd_ioas *ioas = NULL;
> > > + struct iommufd_object *obj;
> > > + unsigned long index;
> > > + int rc;
> > > +
> > > + /* Iterate each ioas. */
> > > + xa_for_each(&ictx->objects, index, obj) {
> > > + if (obj->type != IOMMUFD_OBJ_IOAS)
> > > + continue;
> >
> > Wrong locking
> >
> > > +
> > > + ioas = (struct iommufd_ioas *)obj;
> > > + mutex_lock(&ioas->mutex);
> > > +
> > > + /*
> > > + * TODO: Iterate over each device of this iommufd and only save
> > > + * hwpt/domain if the device is persisted.
> > > + */
> > > + list_for_each_entry(hwpt_paging, &ioas->hwpt_list, hwpt_item) {
> > > + if (!hwpt_paging->common.domain)
> > > + continue;
> >
> > I don't think this should be automatic. The user should directly
> > serialize/unserialize HWPTs by ID.
> Interesting. So the user should be able to serialize/unserialize HWPTs
> before the Live Update PREPARE event? But what if a device was marked
> for preservation but the user never serialized the attached HWPT,
> would that be considered an error during LUO PREPARE or should iommufd
> serialize the remaining HWPTs here?
Users ~can~ serialize their sessions before system-wide prepare event.
During prepare event all unserialized sessions and their FDs are going
to be serialized anyways.
Pasha
> >
> > Jason
Powered by blists - more mailing lists