From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBF1A3CA4B2 for ; Fri, 13 Mar 2026 16:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773421105; cv=none; b=GGKXspgJV3AIgceo1tDMbjBSFPVFGz2RvndkWvwstZJWF6J1VXhb5agEuGauFyYHi2dR5WCzST4DT6gYNfX1zpU3E0XXghv2DSSpBtNgeTjJTsmdMGittRTQR7KufKK+UWYZ9UWJ5bZ4GoRWl5vEi6CUPzfzCbX2y4q/gZ8vluU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773421105; c=relaxed/simple; bh=JotDbto36hMeejAjHcf798lMGCVYXdIVc/vM24Y9foM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FjLNBbgQ17e92XcD2V3k06vOOsm1nkH8l2Wc8iEHOoUcBpzYbXKwq0lDcZ+FMb1e9rc/l4HpCRepSSF9eR277H/2N7HE+eY5Zt1Z6QmYWJmz+FMawf68mFcDwLFXyQir7bVjT9D76UnuTuoKXhkHAM/HbXSDtZ8kxXTeYA/CBAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=nN+ROohp; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nN+ROohp" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2aea4ebb048so2445ad.1 for ; Fri, 13 Mar 2026 09:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773421103; x=1774025903; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vAIKhwXtibYOylihf36AZt2CKCO3X/rqMIMWFfZghRs=; b=nN+ROohpXNtkLMF3dkuiJASy8Ejguhaf1SubRcq5srk67SCpdqjeuZJ8C5tn5nuLgx X4PAD+IbAxK7MrGm099cLzg5yZFkymp7eWPh4eSKgrBw2POVIhvngiR2p/rbm2guXw+a r4RzushMNoCV1zZdyAthbNglEJ2UeHCdiyzR5wcKzRpGICIM2WYtnxHYan8VOS1A3FmM DeK/GSNyJRuB+BuItFcAuqJZWbe1mIcOARL22ylrUeQo91ZAclaJlWcZYAdlGaBjMW/L G+UW+H/Xy4HkUuNDd1r2dplcYneTpMXW3sc728jR3xVK8wuMgvbhbmGVxwErF1qwOAM4 Wpkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773421103; x=1774025903; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vAIKhwXtibYOylihf36AZt2CKCO3X/rqMIMWFfZghRs=; b=C8hd1iuEz9GSiavGDprsKlXxlEsYMIHHJ8aFI36AVQfaW/4TC4tVt2j1uoqrp38nyq 9IzKMByjUV/faRuBhTXbZR+KdYMZipKbq6xCqavoqq32yEX9aX34kED53yiH2QKc/5re 9HN49scGRwOLGXtaDInXukYY1PNHxIeQPGaZvClo45AKdgSrDtWBiwfew78UXAk/lZO0 9G4+uHdcdkxMdCOG0mK24+/lJdxn8Neok6wPHsc5QIppXSFVEkHrgkiphv7tY/E0Hv34 3O3mJd0Ib6rXBXN3aGAxW3jWG1Cmp4JjNLjNDM+IrGVqG1+8R5ggoNbXk91iwRy23TId +N/w== X-Forwarded-Encrypted: i=1; AJvYcCVznSfvlsYX6wjIF6z9/szEXrdez6guDV60jj37M85EhYGAOvE9fRNMA2xusD5ijxBWjBHtayj7gSGiJDY=@vger.kernel.org X-Gm-Message-State: AOJu0Yyn2a6hbZyltRt3G3bygDbyy9wV+foOB8EStpsf/2mPVYSRwwC8 nMjJwvmkdzffa6xa1aq0O7R0kr3oM759bVgpKlcwC8MI81fJYO1+zAJWbdgnElSbdQ== X-Gm-Gg: ATEYQzwvb5461ryCvFvgwVaqo9SiQmBFMNu36dyL81MCYebn4LImYsmYmGIjj2nIhPd lMbnzv5noOthwPqsrvOgtaMVbvv9M/QAH6ncIAepomgexTvWD+zsqfEvu0/G6sesimmCWvAoURq GQnuwxkoK85OMp8UYNoVBesQf5vsbwzx69GyM8VkVS7wuWZKbk91SG5gkUHvzU5xb9iubnJZ8+G RRe50zAMYdV322yJ7X1BYLTDHGzWmADmCJqM8vm7BLi+0SeXcxVnPAmhtXMFEamYi9NgX6rbj1B /WijjmxfjfvsGKS2LRTQpdbD2yqyH9z+LGqa6hI0T0HCWbNDbIa/PYQ5pW9XSDEzRflvrR3xtXI haUAZbd3d2lHq0k2fW24YYGhOJvvYI69uCTzXEC7MteuTS+DrTvu1qutTuQeV+Fe+Fq/RBQKDDu jQxjU+9LgttCFNGUetCZBt1hB9OPd0Qa28LwIOStj3fSSancvRKvjUcjQLiDdvsA== X-Received: by 2002:a17:902:d2d0:b0:2ad:ab68:f2c3 with SMTP id d9443c01a7336-2aecd606615mr2781505ad.13.1773421102229; Fri, 13 Mar 2026 09:58:22 -0700 (PDT) Received: from google.com (168.136.83.34.bc.googleusercontent.com. [34.83.136.168]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aece8629bbsm26159985ad.88.2026.03.13.09.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 09:58:21 -0700 (PDT) Date: Fri, 13 Mar 2026 16:58:17 +0000 From: Samiullah Khawaja To: Pranjal Shrivastava Cc: David Woodhouse , Lu Baolu , Joerg Roedel , Will Deacon , Jason Gunthorpe , Robin Murphy , Kevin Tian , Alex Williamson , Shuah Khan , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Saeed Mahameed , Adithya Jayachandran , Parav Pandit , Leon Romanovsky , William Tu , Pratyush Yadav , Pasha Tatashin , David Matlack , Andrew Morton , Chris Li , Vipin Sharma , YiFei Zhu Subject: Re: [PATCH 01/14] iommu: Implement IOMMU LU FLB callbacks Message-ID: References: <20260203220948.2176157-1-skhawaja@google.com> <20260203220948.2176157-2-skhawaja@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: On Fri, Mar 13, 2026 at 03:36:33PM +0000, Pranjal Shrivastava wrote: >On Thu, Mar 12, 2026 at 04:43:00PM +0000, Samiullah Khawaja wrote: >> On Wed, Mar 11, 2026 at 09:07:00PM +0000, Pranjal Shrivastava wrote: >> > On Tue, Feb 03, 2026 at 10:09:35PM +0000, Samiullah Khawaja wrote: >> > > Add liveupdate FLB for IOMMU state preservation. Use KHO preserve memory >> > > alloc/free helper functions to allocate memory for the IOMMU LU FLB >> > > object and the serialization structs for device, domain and iommu. >> > > >> > > During retrieve, walk through the preserved objs nodes and restore each >> > > folio. Also recreate the FLB obj. >> > > >> > > Signed-off-by: Samiullah Khawaja >> > > --- >> > > drivers/iommu/Kconfig | 11 +++ >> > > drivers/iommu/Makefile | 1 + >> > > drivers/iommu/liveupdate.c | 177 ++++++++++++++++++++++++++++++++++ >> > > include/linux/iommu-lu.h | 17 ++++ >> > > include/linux/kho/abi/iommu.h | 119 +++++++++++++++++++++++ >> > > 5 files changed, 325 insertions(+) >> > > create mode 100644 drivers/iommu/liveupdate.c >> > > create mode 100644 include/linux/iommu-lu.h >> > > create mode 100644 include/linux/kho/abi/iommu.h >> > > >> > > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig >> > > index f86262b11416..fdcfbedee5ed 100644 >> > > --- a/drivers/iommu/Kconfig >> > > +++ b/drivers/iommu/Kconfig >> > > @@ -11,6 +11,17 @@ config IOMMUFD_DRIVER >> > > bool >> > > default n >> > > > >[ snip ---- >8 -----] > >> > >> > > +enum iommu_lu_type { >> > > + IOMMU_INVALID, >> > > + IOMMU_INTEL, >> > > +}; >> > > + >> > > +struct iommu_obj_ser { >> > > + u32 idx; >> > > + u32 ref_count; >> > > + u32 deleted:1; >> > > + u32 incoming:1; >> > > +} __packed; >> > > + >> > > +struct iommu_domain_ser { >> > > + struct iommu_obj_ser obj; >> > > + u64 top_table; >> > > + u64 top_level; >> > > + struct iommu_domain *restored_domain; >> > > +} __packed; >> > > + >> > > +struct device_domain_iommu_ser { >> > > + u32 did; >> > > + u64 domain_phys; >> > > + u64 iommu_phys; >> > > +} __packed; >> > > + >> > > +struct device_ser { >> > > + struct iommu_obj_ser obj; >> > > + u64 token; >> > > + u32 devid; >> > > + u32 pci_domain; >> > > + struct device_domain_iommu_ser domain_iommu_ser; >> > > + enum iommu_lu_type type; >> > > +} __packed; >> > > + >> > > +struct iommu_intel_ser { >> > > + u64 phys_addr; >> > > + u64 root_table; >> > > +} __packed; >> > > + > >One more thing here, let's add the "intel" stuff with the intel patches Agreed. Will move these to intel specific patches. > >Thanks, >Praan > >> > > +struct iommu_ser { >> > > + struct iommu_obj_ser obj; >> > > + u64 token; >> > > + enum iommu_lu_type type; >> > > + union { >> > > + struct iommu_intel_ser intel; >> > > + }; >> > > +} __packed; >> > > + >> > > +struct iommu_objs_ser { >> > > + u64 next_objs; >> > > + u64 nr_objs; >> > > +} __packed; >> > > + >> > > +struct iommus_ser { >> > > + struct iommu_objs_ser objs; >> > > + struct iommu_ser iommus[]; >> > > +} __packed; >> > > + >> > > +struct iommu_domains_ser { >> > > + struct iommu_objs_ser objs; >> > > + struct iommu_domain_ser iommu_domains[]; >> > > +} __packed; >> > > + >> > > +struct devices_ser { >> > > + struct iommu_objs_ser objs; >> > > + struct device_ser devices[]; >> > > +} __packed; >> > > + > >Thanks, >Praan Thanks, Sami