Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2227518/?format=api
{ "id": 2227518, "url": "http://patchwork.ozlabs.org/api/patches/2227518/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260423212316.3431746-2-dmatlack@google.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api", "name": "Linux PCI development", "link_name": "linux-pci", "list_id": "linux-pci.vger.kernel.org", "list_email": "linux-pci@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260423212316.3431746-2-dmatlack@google.com>", "list_archive_url": null, "date": "2026-04-23T21:23:05", "name": "[v4,01/11] PCI: liveupdate: Set up FLB handler for the PCI core", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "a023c70dcab2a178e9114397f18a13e8dea6792d", "submitter": { "id": 69449, "url": "http://patchwork.ozlabs.org/api/people/69449/?format=api", "name": "David Matlack", "email": "dmatlack@google.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260423212316.3431746-2-dmatlack@google.com/mbox/", "series": [ { "id": 501248, "url": "http://patchwork.ozlabs.org/api/series/501248/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=501248", "date": "2026-04-23T21:23:04", "name": "PCI: liveupdate: PCI core support for Live Update", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/501248/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2227518/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2227518/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-53069-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-pci@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256\n header.s=20251104 header.b=Fuy+fWls;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-pci+bounces-53069-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=\"Fuy+fWls\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.215.201", "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com" ], "Received": [ "from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g1pxH0KL9z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 07:23:47 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 1E0A83003BE8\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 21:23:43 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id AE34C3BFE4A;\n\tThu, 23 Apr 2026 21:23:30 +0000 (UTC)", "from mail-pg1-f201.google.com (mail-pg1-f201.google.com\n [209.85.215.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D6933BED5C\n\tfor <linux-pci@vger.kernel.org>; Thu, 23 Apr 2026 21:23:23 +0000 (UTC)", "by mail-pg1-f201.google.com with SMTP id\n 41be03b00d2f7-c76b69fb9d6so4451887a12.1\n for <linux-pci@vger.kernel.org>; Thu, 23 Apr 2026 14:23:22 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776979409; cv=none;\n b=p1WIxn59gQrOE9sCEDEaSnenSb+NAtK6ZpXFjiy3X+sE4dxIgPAhp05/DUkIHnx2IFrV2sh8kmpU5KulV52MBY066CaT4tr5dpzD91j8/nAyQOkhnyG5555D0V/IWezwdAJBl9uGfw9zSkrGG02H+EBFrtkq8Q7ZiQwA3ZOdaOw=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776979409; c=relaxed/simple;\n\tbh=lmCH11RetuzuaSSML9d3XWPKOuj/Ox/xuKogjwWNArY=;\n\th=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:\n\t To:Cc:Content-Type;\n b=BLL+OYlLUvQGc2t+mggHYbF/fsb2kjNpU4g11/iwG2tYDNAsADxtBGgjlKUR0K8Zjs1qGpSD6UoKrMpW1r7fF8YCG0e1OAbOqettBaKoLU1N3PwLbMQwY2NOzgLBAAZ6NcBHYzVKp+NHO87ZPkA+ADMbsN29ChXswUFV1/HlZ7c=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com;\n spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com;\n dkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=Fuy+fWls; arc=none smtp.client-ip=209.85.215.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=google.com; s=20251104; t=1776979402; x=1777584202;\n darn=vger.kernel.org;\n h=cc:to:from:subject:message-id:references:mime-version:in-reply-to\n :date:from:to:cc:subject:date:message-id:reply-to;\n bh=gjMaEBohopo2Yfkm1Hw1N9aZDGPCAerYqbSdZNNS1LM=;\n b=Fuy+fWls4dtCpSL2XnbO3JFl88Kq3jXSQN5QTNaog979hA3L08Fm3+PJJ7Lcw2ptNN\n 4MuQ1lNnRCtm6xp8gcH9f0QY+54zScvYGEjQnOMbB1HK39OW8Wn0MNffX1AlGh/O3cfo\n lG9WEkavKIyCWaJK1Up+lpP2sSvdajtiYN2EEoy06kSx5KFAppcnhhg3ECkfQLsWwkFC\n 9jei27zHtMGoFZLTqcSLellhK/oiN4ngzIboKIBkmoM4+KrPGofw9d5uvEtTUq2pd3nl\n tzbbsF/WbfC4izmm496Oz25avJMtJGCkCRvh7sc0s0tDLQxh7QJsPJtQkCkKjxEaJWq/\n yhqw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776979402; x=1777584202;\n h=cc:to:from:subject:message-id:references:mime-version:in-reply-to\n :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=gjMaEBohopo2Yfkm1Hw1N9aZDGPCAerYqbSdZNNS1LM=;\n b=KN+A3QTELK2uBVKQNQn4EOcIuFxfcpeAQp54WP6iqRbmuSZdGnf1D4+exj8FzHUbve\n yRZenG46EhJGJ3JW1SzzPhrrDAEqv0iVNPZrj+owMk1yepBf18XrL9v4GjoGgKyHtmJl\n cO7C1tPpPqLshQ2fNTQLz0FWbxWpPH0axOBC7d3juoyuJGrmGZFiH7Cqbdz2yViQH7df\n UkMOGcr4ZhrUx9qPGRe1Qy7v5ZkgkrjiFDNvMmI1GchkMkUOGNAaVXFJVonFbhb90Wgu\n 9G0Zk5aNJUMmgIa3unK8D3uLPEnPFZomsF1k8oQrlCvK0bux1jvvyBzCWIN0O7aOvqG4\n JD/w==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ9eCjlrBk9Nt0JFDeC7u4XEEc8TIBmuoUIHpatcD055OwwkvU2j7gcNSYtUw5TNQrWo//7OEc1/VdY=@vger.kernel.org", "X-Gm-Message-State": "AOJu0YwGPObQAkzmjhbPczyqY43KrJpr6aj4Rte/ktL9T9h07ACatr0Y\n\tB9ni7tTCHr4hpFFFMB43G0r9MYAUS2VoO/Jlt2+B4aq02rOpZWaJSwH3qCs7qdvLnoFO2uypTGO\n\tW6iHM0nWbjQJv5Q==", "X-Received": "from pgge8.prod.google.com ([2002:a63:db08:0:b0:c79:6636:f4c1])\n (user=dmatlack job=prod-delivery.src-stubby-dispatcher) by\n 2002:a05:6a20:158a:b0:3a2:c9a1:2c26 with SMTP id\n adf61e73a8af0-3a2c9a2b9ebmr18927671637.7.1776979401541;\n Thu, 23 Apr 2026 14:23:21 -0700 (PDT)", "Date": "Thu, 23 Apr 2026 21:23:05 +0000", "In-Reply-To": "<20260423212316.3431746-1-dmatlack@google.com>", "Precedence": "bulk", "X-Mailing-List": "linux-pci@vger.kernel.org", "List-Id": "<linux-pci.vger.kernel.org>", "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>", "Mime-Version": "1.0", "References": "<20260423212316.3431746-1-dmatlack@google.com>", "X-Mailer": "git-send-email 2.54.0.rc2.544.gc7ae2d5bb8-goog", "Message-ID": "<20260423212316.3431746-2-dmatlack@google.com>", "Subject": "[PATCH v4 01/11] PCI: liveupdate: Set up FLB handler for the PCI core", "From": "David Matlack <dmatlack@google.com>", "To": "iommu@lists.linux.dev, kexec@lists.infradead.org,\n\tlinux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org,\n\tlinux-pci@vger.kernel.org", "Cc": "Adithya Jayachandran <ajayachandra@nvidia.com>,\n Alexander Graf <graf@amazon.com>,\n\tAlex Williamson <alex@shazbot.org>, Bjorn Helgaas <bhelgaas@google.com>,\n Chris Li <chrisl@kernel.org>,\n\tDavid Matlack <dmatlack@google.com>, David Rientjes <rientjes@google.com>,\n\tJacob Pan <jacob.pan@linux.microsoft.com>, Jason Gunthorpe <jgg@nvidia.com>,\n\tJoerg Roedel <joro@8bytes.org>, Jonathan Corbet <corbet@lwn.net>,\n Josh Hilke <jrhilke@google.com>,\n\tLeon Romanovsky <leonro@nvidia.com>, Lukas Wunner <lukas@wunner.de>,\n Mike Rapoport <rppt@kernel.org>,\n\tParav Pandit <parav@nvidia.com>, Pasha Tatashin <pasha.tatashin@soleen.com>,\n\tPranjal Shrivastava <praan@google.com>, Pratyush Yadav <pratyush@kernel.org>,\n\tRobin Murphy <robin.murphy@arm.com>, Saeed Mahameed <saeedm@nvidia.com>,\n\tSamiullah Khawaja <skhawaja@google.com>,\n Shuah Khan <skhan@linuxfoundation.org>,\n\tWill Deacon <will@kernel.org>, William Tu <witu@nvidia.com>,\n Yi Liu <yi.l.liu@intel.com>", "Content-Type": "text/plain; charset=\"UTF-8\"" }, "content": "Set up a File-Lifecycle-Bound (FLB) handler for the PCI core to enable\nit to participate in the preservation of PCI devices across Live Update.\nEssentially, this commit enables the PCI core to allocate a struct\n(struct pci_ser) and preserve it across a Live Update whenever at least\none device is preserved.\n\nPreserving PCI devices across Live Update is built on top of the Live\nUpdate Orchestrator's (LUO) support for file preservation. Drivers are\nexpected to expose a file to userspace to represent a single PCI device\nand support preservation of that file. This is itended primarily to\nsupport preservation of PCI devices bound to VFIO drivers.\n\nThis commit enables drivers to register their liveupdate_file_handler\nwith the PCI core so that the PCI core can do its own tracking and\nenforcement of which devices are preserved.\n\n pci_liveupdate_register_flb(driver_file_handler);\n pci_liveupdate_unregister_flb(driver_file_handler);\n\nWhen the first file (with a handler registered with the PCI core) is\npreserved, the PCI core will be notified to allocate its tracking struct\n(pci_ser). When the last file is unpreserved (i.e. preservation\ncancelled) the PCI core will be notified to free struct pci_ser.\n\nThis struct is preserved across a Live Update using KHO and can be\nfetched by the PCI core during early boot (e.g. during device\nenumeration) so that it knows which devices were preserved.\n\nNote that this commit only allocates struct pci_ser and preserves it\nacross Live Update. A subsequent commit will add an API for drivers to\ntell the PCI core exactly which devices are being preserved.\n\nSigned-off-by: David Matlack <dmatlack@google.com>\n---\n MAINTAINERS | 12 ++++\n drivers/pci/Kconfig | 14 ++++\n drivers/pci/Makefile | 1 +\n drivers/pci/liveupdate.c | 139 ++++++++++++++++++++++++++++++++++++\n include/linux/kho/abi/pci.h | 61 ++++++++++++++++\n include/linux/pci.h | 15 ++++\n 6 files changed, 242 insertions(+)\n create mode 100644 drivers/pci/liveupdate.c\n create mode 100644 include/linux/kho/abi/pci.h", "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex c9b7b6f9828e..94af31837375 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -20555,6 +20555,18 @@ L:\tlinux-pci@vger.kernel.org\n S:\tSupported\n F:\tDocumentation/PCI/pci-error-recovery.rst\n \n+PCI LIVE UPDATE\n+M:\tBjorn Helgaas <bhelgaas@google.com>\n+M:\tDavid Matlack <dmatlack@google.com>\n+L:\tlinux-pci@vger.kernel.org\n+S:\tSupported\n+Q:\thttps://patchwork.kernel.org/project/linux-pci/list/\n+B:\thttps://bugzilla.kernel.org\n+C:\tirc://irc.oftc.net/linux-pci\n+T:\tgit git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git\n+F:\tdrivers/pci/liveupdate.c\n+F:\tinclude/linux/kho/abi/pci.h\n+\n PCI MSI DRIVER FOR ALTERA MSI IP\n L:\tlinux-pci@vger.kernel.org\n S:\tOrphan\ndiff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig\nindex 33c88432b728..08398cbe970c 100644\n--- a/drivers/pci/Kconfig\n+++ b/drivers/pci/Kconfig\n@@ -328,6 +328,20 @@ config VGA_ARB_MAX_GPUS\n \t Reserves space in the kernel to maintain resource locking for\n \t multiple GPUS. The overhead for each GPU is very small.\n \n+config PCI_LIVEUPDATE\n+\tbool \"PCI Live Update Support (EXPERIMENTAL)\"\n+\tdepends on PCI && LIVEUPDATE\n+\thelp\n+\t Enable PCI core support for preserving PCI devices across Live\n+\t Update. This, in combination with support in a device's driver,\n+\t enables PCI devices to run and perform memory transactions\n+\t uninterrupted during a kexec for Live Update.\n+\n+\t This option should only be enabled by developers working on\n+\t implementing this support.\n+\n+\t If unsure, say N.\n+\n source \"drivers/pci/hotplug/Kconfig\"\n source \"drivers/pci/controller/Kconfig\"\n source \"drivers/pci/endpoint/Kconfig\"\ndiff --git a/drivers/pci/Makefile b/drivers/pci/Makefile\nindex 41ebc3b9a518..e8d003cb6757 100644\n--- a/drivers/pci/Makefile\n+++ b/drivers/pci/Makefile\n@@ -16,6 +16,7 @@ obj-$(CONFIG_PROC_FS)\t\t+= proc.o\n obj-$(CONFIG_SYSFS)\t\t+= pci-sysfs.o slot.o\n obj-$(CONFIG_ACPI)\t\t+= pci-acpi.o\n obj-$(CONFIG_GENERIC_PCI_IOMAP) += iomap.o\n+obj-$(CONFIG_PCI_LIVEUPDATE)\t+= liveupdate.o\n endif\n \n obj-$(CONFIG_OF)\t\t+= of.o\ndiff --git a/drivers/pci/liveupdate.c b/drivers/pci/liveupdate.c\nnew file mode 100644\nindex 000000000000..d4fa61625d56\n--- /dev/null\n+++ b/drivers/pci/liveupdate.c\n@@ -0,0 +1,139 @@\n+// SPDX-License-Identifier: GPL-2.0\n+\n+/*\n+ * Copyright (c) 2026, Google LLC.\n+ * David Matlack <dmatlack@google.com>\n+ */\n+\n+/**\n+ * DOC: PCI Live Update\n+ *\n+ * The PCI subsystem participates in the Live Update process to enable drivers\n+ * to preserve their PCI devices across kexec.\n+ *\n+ * .. note::\n+ * The support for preserving PCI devices across Live Update is currently\n+ * *partial* and should be considered *experimental*. It should only be\n+ * used by developers working on the implementation for the time being.\n+ *\n+ * To enable the support, enable ``CONFIG_PCI_LIVEUPDATE``.\n+ *\n+ * File-Lifecycle-Bound (FLB) Data\n+ * ===============================\n+ *\n+ * PCI device preservation across Live Update is built on top of the Live Update\n+ * Orchestrator's (LUO) support for file preservation across kexec. Drivers\n+ * are expected to expose a file to represent a single PCI device and support\n+ * preservation of that file with ``ioctl(LIVEUPDATE_SESSION_PRESERVE_FD)``.\n+ * This allows userspace to control the preservation of devices and ensure\n+ * proper lifecycle management while a device is preserved. The first intended\n+ * use-case is preserving vfio-pci device files.\n+ *\n+ * The PCI core maintains its own state about what devices are being preserved\n+ * across Live Update using a feature called File-Lifecycle-Bound (FLB) data in\n+ * LUO. Essentially, this allows the PCI core to allocate struct pci_ser when\n+ * the first device (file) is preserved and free it when the last device (file)\n+ * is unpreserved. After kexec, the PCI core can fetch the struct pci_ser (which\n+ * was constructed by the previous kernel) from LUO at any time (e.g. during\n+ * enumeration) so that it knows which devices were preserved.\n+ *\n+ * To enable the PCI core to be notified whenever a file representing a device\n+ * is preserved, drivers must register their struct liveupdate_file_handler with\n+ * the PCI core by using the following APIs:\n+ *\n+ * * ``pci_liveupdate_register_flb(driver_file_handler)``\n+ * * ``pci_liveupdate_unregister_flb(driver_file_handler)``\n+ */\n+\n+#define pr_fmt(fmt) \"PCI: liveupdate: \" fmt\n+\n+#include <linux/bsearch.h>\n+#include <linux/io.h>\n+#include <linux/kexec_handover.h>\n+#include <linux/kho/abi/pci.h>\n+#include <linux/liveupdate.h>\n+#include <linux/mutex.h>\n+#include <linux/mm.h>\n+#include <linux/pci.h>\n+#include <linux/sort.h>\n+\n+static int pci_flb_preserve(struct liveupdate_flb_op_args *args)\n+{\n+\tstruct pci_dev *dev = NULL;\n+\tu32 max_nr_devices = 0;\n+\tstruct pci_ser *ser;\n+\tunsigned long size;\n+\n+\t/*\n+\t * Allocate enough space to preserve all of the devices that are\n+\t * currently present on the system. Extra padding can be added to this\n+\t * in the future to increase the chances that there is enough room to\n+\t * preserve devices that are not yet present on the system (e.g. VFs,\n+\t * hot-plugged devices).\n+\t */\n+\tfor_each_pci_dev(dev)\n+\t\tmax_nr_devices++;\n+\n+\tsize = struct_size_t(struct pci_ser, devices, max_nr_devices);\n+\n+\tpr_debug(\"Preserving struct pci_ser with room for %u devices\\n\",\n+\t\t max_nr_devices);\n+\n+\tser = kho_alloc_preserve(size);\n+\tif (IS_ERR(ser))\n+\t\treturn PTR_ERR(ser);\n+\n+\tser->max_nr_devices = max_nr_devices;\n+\tser->nr_devices = 0;\n+\n+\targs->obj = ser;\n+\targs->data = virt_to_phys(ser);\n+\treturn 0;\n+}\n+\n+static void pci_flb_unpreserve(struct liveupdate_flb_op_args *args)\n+{\n+\tstruct pci_ser *ser = args->obj;\n+\n+\tpr_debug(\"Unpreserving struct pci_ser\\n\");\n+\tWARN_ON_ONCE(ser->nr_devices);\n+\tkho_unpreserve_free(ser);\n+}\n+\n+static int pci_flb_retrieve(struct liveupdate_flb_op_args *args)\n+{\n+\targs->obj = phys_to_virt(args->data);\n+\treturn 0;\n+}\n+\n+static void pci_flb_finish(struct liveupdate_flb_op_args *args)\n+{\n+\tkho_restore_free(args->obj);\n+}\n+\n+static struct liveupdate_flb_ops pci_liveupdate_flb_ops = {\n+\t.preserve = pci_flb_preserve,\n+\t.unpreserve = pci_flb_unpreserve,\n+\t.retrieve = pci_flb_retrieve,\n+\t.finish = pci_flb_finish,\n+\t.owner = THIS_MODULE,\n+};\n+\n+static struct liveupdate_flb pci_liveupdate_flb = {\n+\t.ops = &pci_liveupdate_flb_ops,\n+\t.compatible = PCI_LUO_FLB_COMPATIBLE,\n+};\n+\n+int pci_liveupdate_register_flb(struct liveupdate_file_handler *fh)\n+{\n+\tpr_debug(\"Registering file handler \\\"%s\\\"\\n\", fh->compatible);\n+\treturn liveupdate_register_flb(fh, &pci_liveupdate_flb);\n+}\n+EXPORT_SYMBOL_GPL(pci_liveupdate_register_flb);\n+\n+void pci_liveupdate_unregister_flb(struct liveupdate_file_handler *fh)\n+{\n+\tpr_debug(\"Unregistering file handler \\\"%s\\\"\\n\", fh->compatible);\n+\tliveupdate_unregister_flb(fh, &pci_liveupdate_flb);\n+}\n+EXPORT_SYMBOL_GPL(pci_liveupdate_unregister_flb);\ndiff --git a/include/linux/kho/abi/pci.h b/include/linux/kho/abi/pci.h\nnew file mode 100644\nindex 000000000000..5c0e92588c00\n--- /dev/null\n+++ b/include/linux/kho/abi/pci.h\n@@ -0,0 +1,61 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+\n+/*\n+ * Copyright (c) 2026, Google LLC.\n+ * David Matlack <dmatlack@google.com>\n+ */\n+\n+#ifndef _LINUX_KHO_ABI_PCI_H\n+#define _LINUX_KHO_ABI_PCI_H\n+\n+#include <linux/bug.h>\n+#include <linux/compiler.h>\n+#include <linux/types.h>\n+\n+/**\n+ * DOC: PCI File-Lifecycle Bound (FLB) Live Update ABI\n+ *\n+ * This header defines the ABI for preserving core PCI state across kexec using\n+ * Live Update File-Lifecycle Bound (FLB) data.\n+ *\n+ * This interface is a contract. Any modification to any of the serialization\n+ * structs defined here constitutes a breaking change. Such changes require\n+ * incrementing the version number in the PCI_LUO_FLB_COMPATIBLE string.\n+ */\n+\n+#define PCI_LUO_FLB_COMPATIBLE \"pci-v1\"\n+\n+/**\n+ * struct pci_dev_ser - Serialized state about a single PCI device.\n+ *\n+ * @domain: The device's PCI domain number (segment).\n+ * @bdf: The device's PCI bus, device, and function number.\n+ * @reserved: Reserved (to naturally align struct pci_dev_ser).\n+ */\n+struct pci_dev_ser {\n+\tu32 domain;\n+\tu16 bdf;\n+\tu16 reserved;\n+} __packed;\n+\n+/**\n+ * struct pci_ser - PCI Subsystem Live Update State\n+ *\n+ * This struct tracks state about all devices that are being preserved across\n+ * a Live Update for the next kernel.\n+ *\n+ * @max_nr_devices: The length of the devices[] flexible array.\n+ * @nr_devices: The number of devices that were preserved.\n+ * @devices: Flexible array of pci_dev_ser structs for each device.\n+ */\n+struct pci_ser {\n+\tu32 max_nr_devices;\n+\tu32 nr_devices;\n+\tstruct pci_dev_ser devices[];\n+} __packed;\n+\n+/* Ensure all elements of devices[] are naturally aligned. */\n+static_assert(offsetof(struct pci_ser, devices) % sizeof(unsigned long) == 0);\n+static_assert(sizeof(struct pci_dev_ser) % sizeof(unsigned long) == 0);\n+\n+#endif /* _LINUX_KHO_ABI_PCI_H */\ndiff --git a/include/linux/pci.h b/include/linux/pci.h\nindex 2c4454583c11..d70080babd52 100644\n--- a/include/linux/pci.h\n+++ b/include/linux/pci.h\n@@ -40,6 +40,7 @@\n #include <linux/resource_ext.h>\n #include <linux/msi_api.h>\n #include <uapi/linux/pci.h>\n+#include <linux/liveupdate.h>\n \n #include <linux/pci_ids.h>\n \n@@ -2876,4 +2877,18 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type);\n \tWARN_ONCE(condition, \"%s %s: \" fmt, \\\n \t\t dev_driver_string(&(pdev)->dev), pci_name(pdev), ##arg)\n \n+#ifdef CONFIG_PCI_LIVEUPDATE\n+int pci_liveupdate_register_flb(struct liveupdate_file_handler *fh);\n+void pci_liveupdate_unregister_flb(struct liveupdate_file_handler *fh);\n+#else\n+static inline int pci_liveupdate_register_flb(struct liveupdate_file_handler *fh)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static inline void pci_liveupdate_unregister_flb(struct liveupdate_file_handler *fh)\n+{\n+}\n+#endif\n+\n #endif /* LINUX_PCI_H */\n", "prefixes": [ "v4", "01/11" ] }