From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from flow-b3-smtp.messagingengine.com (flow-b3-smtp.messagingengine.com [202.12.124.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80310348445; Fri, 27 Feb 2026 18:25:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772216714; cv=none; b=o5/rOFKBETLNfEKtUA2y2tleeMIcY3tQBX98/F4C4tRsa7eZyvt/JY665JKA2RnuchjikW8e4psSeLA8G27JRAtTEROVKYa8Wgv5L3Sblzfrw0Cy1mi0u/olQKWdPkDhjYmmk2JsCAU1fRP++tWQ8V3oisPZOGdc+TbW5zcks6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772216714; c=relaxed/simple; bh=ij3/uuF1IJxXf2afJj9FRKZNyAbuS7zCH04NXX5F1y8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=g1dSxeDlqSmgkJQmpJDltnQE1GIvlbGMgu0J8rSlKJ16C2OhGUrwzlHvDGgIVSx/KZPvEIaEXm5TvxqR6CmVzKcRgk/YQKmcIOXV5/eQoZheLB4C/2Sg1HY3mwXwYy9Ded5h+5pS1ZVcAfexHYWM7SvYo5ep7xVa7MWivN8W8VI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org; spf=pass smtp.mailfrom=shazbot.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b=M5HcbGYu; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Gqh9tuzf; arc=none smtp.client-ip=202.12.124.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shazbot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b="M5HcbGYu"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Gqh9tuzf" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailflow.stl.internal (Postfix) with ESMTP id E683C13014A3; Fri, 27 Feb 2026 13:25:08 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Fri, 27 Feb 2026 13:25:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shazbot.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1772216708; x=1772223908; bh=h2MIetHNFq+qTvq+cXYYK0YgcuU2lcFpP3MOKL3SGt4=; b= M5HcbGYuV2I6ExGXjWjOd4SeeCigxt2cqKKirjhfZh06/QH5jWk5Z0JXXsThF4Fa 7RNYoPp8Q5eAqiRc4MvFU9TfVLtKQF2soXn5Oi+wy5mVV02Y9V6al1nzNE0dM4Kf WM/D1Xyoo09YEP+zJELM7kvTK/Ul5KUP+3qr1TPLZTPStNtbStFcdz+hWfflEMCR eQDCZ0Ft8O0kf3j2MmhqyBxK+mhdOncmKEF4Dp4ercNY5ApAahSRV2An/RJEd4i7 BdyHODrQLIwkBu6mJDWJbQjY2nSQJaubJmCsA0WpqDsoj1gNpOHZWdqR9igUU03x BT+8ghQY6qxqc1r0rOqLpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1772216708; x= 1772223908; bh=h2MIetHNFq+qTvq+cXYYK0YgcuU2lcFpP3MOKL3SGt4=; b=G qh9tuzfCH3lGFGrRjjXpdIFarDbZ9CPj/YT4lwdF5h6EzJZsS7JvnCF0Ks8Fnt0K LLfTOS7cdqhASypxTn6RzcsJBbGS38oM2wwz7RMuVfeRK5coZnlcRuACt2MXtpC7 oHxISpVXtMqtiuv/OOXKhaJEtt7KniH7T4QEfK6G5L7z1cX/ZSU5pv5LbVF42vgh Zas7Cla0p33GtwfHxAEvLwtGrQiXgWNPpsRDMpMBUt041aDFgywssveH5+UbFKfk +EdQzATJOuDsuK2NDYiJdTUMuhVhgtTwQOO6Zr5EeJ3shSuZkI0NQLDWzZr01fnv 3H57jQf4QaTibPhvtFDqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgeeljedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkjghfofggtgfgsehtqhertdertdejnecuhfhrohhmpeetlhgvgicu hghilhhlihgrmhhsohhnuceorghlvgigsehshhgriigsohhtrdhorhhgqeenucggtffrrg htthgvrhhnpeetuefgleefhfdvueegffdtffevhfffgfffiedutdetgffhheejtdekfeek ieehgfenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvgigsehshhgriigsohhtrdhorhhg pdhnsggprhgtphhtthhopeegiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepug hmrghtlhgrtghksehgohhoghhlvgdrtghomhdprhgtphhtthhopehhvghlghgrrghssehk vghrnhgvlhdrohhrghdprhgtphhtthhopegrjhgrhigrtghhrghnughrrgesnhhvihguih grrdgtohhmpdhrtghpthhtohepghhrrghfsegrmhgriihonhdrtghomhdprhgtphhtthho pegrmhgrshhtrhhosehfsgdrtghomhdprhgtphhtthhopegrphhophhplhgvsehnvhhiug hirgdrtghomhdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhn rdhorhhgpdhrtghpthhtoheprghnkhhithgrsehnvhhiughirgdrtghomhdprhgtphhtth hopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhm X-ME-Proxy: Feedback-ID: i03f14258:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Feb 2026 13:25:03 -0500 (EST) Date: Fri, 27 Feb 2026 11:25:01 -0700 From: Alex Williamson To: David Matlack Cc: Bjorn Helgaas , Adithya Jayachandran , Alexander Graf , Alex Mastro , Alistair Popple , Andrew Morton , Ankit Agrawal , Bjorn Helgaas , Chris Li , David Rientjes , Jacob Pan , Jason Gunthorpe , Jason Gunthorpe , Jonathan Corbet , Josh Hilke , Kevin Tian , kexec@lists.infradead.org, kvm@vger.kernel.org, Leon Romanovsky , Leon Romanovsky , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-pci@vger.kernel.org, Lukas Wunner , =?UTF-8?B?TWlj?= =?UTF-8?B?aGHFgg==?= Winiarski , Mike Rapoport , Parav Pandit , Pasha Tatashin , Pranjal Shrivastava , Pratyush Yadav , Raghavendra Rao Ananta , Rodrigo Vivi , Saeed Mahameed , Samiullah Khawaja , Shuah Khan , Thomas =?UTF-8?B?SGVsbHN0csO2bQ==?= , Tomita Moeko , Vipin Sharma , Vivek Kasireddy , William Tu , Yi Liu , Zhu Yanjun , alex@shazbot.org Subject: Re: [PATCH v2 02/22] PCI: Add API to track PCI devices preserved across Live Update Message-ID: <20260227112501.465e2a86@shazbot.org> In-Reply-To: References: <20260129212510.967611-3-dmatlack@google.com> <20260225224651.GA3711085@bhelgaas> <20260227093233.45891424@shazbot.org> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 27 Feb 2026 09:19:28 -0800 David Matlack wrote: > On Fri, Feb 27, 2026 at 8:32=E2=80=AFAM Alex Williamson wrote: > > > > On Thu, 26 Feb 2026 00:28:28 +0000 > > David Matlack wrote: =20 > > > > > +static int pci_flb_preserve(struct liveupdate_flb_op_args *args) > > > > > +{ > > > > > + struct pci_dev *dev =3D NULL; > > > > > + int max_nr_devices =3D 0; > > > > > + struct pci_ser *ser; > > > > > + unsigned long size; > > > > > + > > > > > + for_each_pci_dev(dev) > > > > > + max_nr_devices++; =20 > > > > > > > > How is this protected against hotplug? =20 > > > > > > Pranjal raised this as well. Here was my reply: > > > > > > . Yes, it's possible to run out space to preserve devices if devices= are > > > . hot-plugged and then preserved. But I think it's better to defer > > > . handling such a use-case exists (unless you see an obvious simple > > > . solution). So far I am not seeing preserving hot-plugged devices > > > . across Live Update as a high priority use-case to support. > > > > > > I am going to add a comment here in the next revision to clarify that. > > > I will also add a comment clarifying why this code doesn't bother to > > > account for VFs created after this call (preserving VFs are explicitly > > > disallowed to be preserved in this patch since they require additional > > > support). =20 > > > > TBH, without SR-IOV support and some examples of in-kernel PF > > preservation in support of vfio-pci VFs, it seems like this only > > supports a very niche use case. =20 >=20 > The intent is to start by supporting a simple use-case and expand to > more complex scenarios over time, including preserving VFs. Full GPU > passthrough is common at cloud providers so even non-VF preservation > support is valuable. >=20 > > I expect the majority of vfio-pci > > devices are VFs and I don't think we want to present a solution where > > the requirement is to move the PF driver to userspace. =20 >=20 > JasonG recommended the upstream support for VF preservation be limited > to cases where the PF is also bound to VFIO: >=20 > https://lore.kernel.org/lkml/20251003120358.GL3195829@ziepe.ca/ >=20 > Within Google we have a way to support in-kernel PF drivers but we are > trying to focus on simpler use-cases first upstream. >=20 > > It's not clear, > > for example, how we can have vfio-pci variant drivers relying on > > in-kernel channels to PF drivers to support migration in this model. =20 >=20 > Agree this still needs to be fleshed out and designed. I think the > roadmap will be something like: >=20 > 1. Get non-VF preservation working end-to-end (device fully preserved > and doing DMA continuously during Live Update). > 2. Extend to support VF preservation where the PF is also bound to vfio-= pci. > 3. (Maybe) Extend to support in-kernel PF drivers. >=20 > This series is the first step of #1. I have line of sight to how #2 > could work since it's all VFIO. Without 3, does this become a mainstream feature? There's obviously a knee jerk reaction that moving PF drivers into userspace is a means to circumvent the GPL that was evident at LPC, even if the real reason is "in-kernel is hard". Related to that, there's also not much difference between a userspace driver and an out-of-tree driver when it comes to adding in-kernel code for their specific support requirements. Therefore, unless migration is entirely accomplished via a shared dmabuf between PF and VF, orchestrated through userspace, I'm not sure how we get to migration, making KHO vs migration a binary choice. I have trouble seeing how that's a viable intermediate step. Thanks, Alex