From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 DB1DC3B8921 for ; Fri, 13 Mar 2026 15:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773416208; cv=none; b=ZDA5mlNHIq9nDsDy8BqfnwI/rjkioYv5d6ft+yjzXT6OgEHaUET5oqZCBWnGmi0Yy25thGg2IaMAcYEYZ4FyQWBCgi79I9/5uF4jUZT5OXuaFDyDMteb7lP8PzezCqc3p9V/Zb3ABIbJEug8er+t7JfKVVR1SC2KnlwbB7Y4AvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773416208; c=relaxed/simple; bh=mVJqAoGCdzDxY6EScXWW6YPCOZawlS/f85uqEYbM+Io=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=U125buNfkScL9s3pDtBp9HKgxlQFWi5W8UvTbTk7/2gk9NFVM9StMWzKc5VRHgLd/FovouF2WoXCmk1eBEnP4TeTUWrapBk1OufkDiQXZbibxKTNBDtjdMTToQrOHaR+ybT+VBsZ6Rl5Fpt+eGAycidUxuDzuPC9DBTAbJWFFJ8= 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=mrPerPN8; arc=none smtp.client-ip=209.85.214.180 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="mrPerPN8" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2aeab6ff148so87515ad.1 for ; Fri, 13 Mar 2026 08:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773416202; x=1774021002; 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=QnL4RthXjRr5EwbDeuhNCTPnFU8J1byxNF4coj8lpk8=; b=mrPerPN8okX5d0ruZqEPfEvotCwy/Ge651w1ElNmrleLuoE4md0XpFeWfT6g2XVq1Y q2sj7SkccFHRbfEbNj5Zj9du2fruXEb13SmB9L2+gR+OQTX20P6QtBRkYqXLQWGBKurg WbPUT6gG9jRu3tEtqHk4UXo3oELJuXRh5K36kDTsMg+/gC59vEG8RBfFjy6g1L1HwxTa PLCINWgd+uQ6FkCjq7sLYF38eeo5iMM95AJrnOXMEIpdV9S1DTRV6AEWFNNpY/pag2AI bi8lwZ9quiyum4iG9RG+E7ce1tPoWL8VOgkEJ+lXfgPHf9lShTVlrOgez2l2Jb0z6Scw a7YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773416202; x=1774021002; 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=QnL4RthXjRr5EwbDeuhNCTPnFU8J1byxNF4coj8lpk8=; b=Jjq0FukZuW9X1zSF/vstUy7hMoQowZGBsnOQvRpROTjACygXIVgobxWN7DREOXlKNd tBqwt0ZRdAlp9/ph/q15PLNGAv3g/tNo35BAf6bEYidnncfF8twmwcgkWsXJcoqkIaxT OmxxQfONfm/6J8QU6uuyEkptG/nt41VpvVX1oJ8qG1PNNgmO2eIOZzLF6X5c4l3LEQ2o tyr4L6BFcUNYIEyMlhyJqG92O0BqAcsokR6dhd3M8koht1GsYQE4NkmS0MuHsVXZw9+r 05RwK59s+e3ob9Q6GnNqjF4kSYiR0UGcerZMFBX0LNMsUKeLJhpjCi6CWJhMoxByvUG8 cHQw== X-Forwarded-Encrypted: i=1; AJvYcCX2umzHsf5iIeYNVczupJnl0qGU61+kpIEBjhjGp3HnGaVxCgCFNa+KRD9SeNQAdhm9Z+dNnjp//C9sC44=@vger.kernel.org X-Gm-Message-State: AOJu0YwOyn2wsnUEHsXbQRqLL0lzeJzvMAlsmqBG8Ku7UsdhJVSmbhPV 05VDLbuorqsQjVOfSpdgQnCo4RJEHAGNj5IN5ms5K6JDZKCTPmAM/e3br+KzkNBajg== X-Gm-Gg: ATEYQzzEhJ2BYJuJdDLNnP7ItslcpX+/+1UnupSRVJMMLEQf1vVbVQh1rakyZl3dk+E 1R2iKq/KQQ40hbEriTEn8CWt4xOQMXklAYpCud+RmGnmfQO6B6mWpEbueAuFnnP/GHEZLLouQJb W54JkaQUbn6Iw4HTIokGzCV0YZpFwpCdX0FlVrH7ihwntnOAG9IVQtcmUc/zWYllBpJ0XCeEVdT lj91kVjCVM7A+J0bJO1l8oERxzmzmtkEc+xj9c7Z4Fy6XSVCIMqh6Z1EwPX8wUOwMyAGSITY8+4 iGSa9w5Z7ypFXKB8wSpn3tyl0DUaHCJE5L/TZ/rTccGYt+m7R0BzETU1CJoo8cTgoNvDmCim92L wUhcUpUwwIyLkG7QJ3DqeZkekXenKMyR265eb2rcUMEsOS5S/VH7mXssqoYzscCc1WUTbVx0Cln 9xC0TKCMQNurh0H9cVtLYOB9wx0zQGGwSpT8FyvyqdrKaBmicpqKSfZhsYpSzpCBLD+v1B X-Received: by 2002:a17:902:ec82:b0:2ad:6f9b:7818 with SMTP id d9443c01a7336-2aecd67598fmr2482035ad.23.1773416201213; Fri, 13 Mar 2026 08:36:41 -0700 (PDT) Received: from google.com (10.129.124.34.bc.googleusercontent.com. [34.124.129.10]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c73ebb62f0esm2233230a12.17.2026.03.13.08.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 08:36:40 -0700 (PDT) Date: Fri, 13 Mar 2026 15:36:33 +0000 From: Pranjal Shrivastava To: Samiullah Khawaja 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 Content-Disposition: inline In-Reply-To: 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 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