Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2227524/?format=api
{ "id": 2227524, "url": "http://patchwork.ozlabs.org/api/patches/2227524/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260423212316.3431746-9-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-9-dmatlack@google.com>", "list_archive_url": null, "date": "2026-04-23T21:23:12", "name": "[v4,08/11] PCI: liveupdate: Require preserved devices are in immutable singleton IOMMU groups", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "cd4163f84c07ec417fe484b6c050ea95d8f425b6", "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-9-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/2227524/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2227524/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-53074-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=VA1+2JWS;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-53074-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=\"VA1+2JWS\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.215.202", "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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g1q0M3mxQz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 07:26:27 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 48AAD303B8EA\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 21:24:39 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6FD963C3BE6;\n\tThu, 23 Apr 2026 21:23:41 +0000 (UTC)", "from mail-pg1-f202.google.com (mail-pg1-f202.google.com\n [209.85.215.202])\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 CCEBE3C1976\n\tfor <linux-pci@vger.kernel.org>; Thu, 23 Apr 2026 21:23:35 +0000 (UTC)", "by mail-pg1-f202.google.com with SMTP id\n 41be03b00d2f7-c7ada7b25f0so1043581a12.2\n for <linux-pci@vger.kernel.org>; Thu, 23 Apr 2026 14:23:35 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776979420; cv=none;\n b=qeJ0AoE9SNTd4QWVcROiGVPpKqauW2jwfxQP49y5D9nAmzpsN7jUPJOUprpQWTPHuc+pcuddtWFzDy8b92aJDXu6kIfggOExqZZEevpKXZnwRWLDr3udQF1orPBZdb/BzprHveVISla7a5UCY5IOAXskwEDFdhXuZxdE1cHSUFM=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776979420; c=relaxed/simple;\n\tbh=GLaesJwUwri2XBQC98JUEA4yA/xfrELrLuoXDywngTA=;\n\th=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:\n\t To:Cc:Content-Type;\n b=V7a2vVSXMCp6Rs6k3xGM98r8KELi/KzAE0WLXqcwcCzRLk8BuXvHvXDbPEvX3J/8zO1sJh2dy6Hc5TCc/7M+gthhAdOqHQ/1BoiopBXrshk26wnVbSxG295GQNwevWQQBbXUSMiK2+2p36NL7Ra9zAvLUoqqw3vgNS4oCQxxvEk=", "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=VA1+2JWS; arc=none smtp.client-ip=209.85.215.202", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=google.com; s=20251104; t=1776979414; x=1777584214;\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=Xzr76OgKRSVyLlNPZ4BBmoEisHfu3frnnsSEc+2qgNA=;\n b=VA1+2JWS7IZk/6jE0kqswLqR5jApMuOYqzkzFNJ3x+Q9JgNdA45/321J5I4rX11z+g\n slDC3Fq8zkBjz1Svs0kAN+Mt1Oho1BMZh6UBZ9SGs/KViObuW7J/7vEUGTUgaoRjXRDt\n tiQzTejOANkIfN5m+y9o6ARdNe1BqyJXHGz+ObRIV34TbXJUC4f8FFWfXcwGLAz20+7f\n 8ZLtTXFotDyJ+SHn+fC1whXylunliysds+0xQLPSnvqfsZk55z6rjWLlz/3QwUD+ww1H\n YtjFH2fzBtLFUYixCMMwt6OSRVn0WC1XFFWri5xC6OomH0gAIJbU0CoxQflYDM5NvsnO\n t/lA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776979414; x=1777584214;\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=Xzr76OgKRSVyLlNPZ4BBmoEisHfu3frnnsSEc+2qgNA=;\n b=lzBqdzkGclnCVA0GR6S257kgbT6T+HFm+prj0SvqO7e2AZ3Xx/ioj9mMiKo+oj8kIz\n z0+x5hqZk6Fyz/SFl81xwxWNQlFNiJpseyAYr66chNvR344IEz83+56iGcMUBcoEsvTI\n 1E+rFE9bdU+K9KSgwacOTWWxXp9ABsYiiCtSRpjbh3yLnXzy4Ju0/HlNSkSkv2ce2l94\n uQyB5GqeIMII6VZbMvHp1TnDeMJaDbUEwc3lQVIxjYlHT4uE6L8zAouHeRgFMYHWckes\n aG3X4DnU65P2OYu0UQBayBxO/7c0eShnP89FXj0GTPaYduKRX9wbRC5WeZWbGIkne+XO\n QWoA==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ+IiUbG6btAMu/POZJSaHW7j0ksJOBI3zXNHhj32k2UI0ogin04NeKB8CLU07yBPfkyBhT/v64QHeA=@vger.kernel.org", "X-Gm-Message-State": "AOJu0Yz+wB/FGuS7beGo6VOf/aKf+fAEbT7Cbx/LAdtEoDj9yXrdX6WY\n\tCj/Xc0UMTBG7wIyBWRpD+KbaEPJtBhHTQ0OgMAnEfAjj5FJHlODaDyukd4BsVyCXzlz4M3UlQ6d\n\tomh2/eaaD+5ZvfA==", "X-Received": "from pgbda7.prod.google.com\n ([2002:a05:6a02:2387:b0:c79:9058:b77e])\n (user=dmatlack job=prod-delivery.src-stubby-dispatcher) by\n 2002:a05:6a21:6da2:b0:3a0:b781:4c8b with SMTP id\n adf61e73a8af0-3a0b78155d5mr25116879637.2.1776979414052;\n Thu, 23 Apr 2026 14:23:34 -0700 (PDT)", "Date": "Thu, 23 Apr 2026 21:23:12 +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-9-dmatlack@google.com>", "Subject": "[PATCH v4 08/11] PCI: liveupdate: Require preserved devices are in\n immutable singleton IOMMU groups", "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": "Restrict support for preserving PCI devices across Live Update to\ndevices in immutable singleton IOMMU groups. A device's group is\nconsidered immutable if all bridges upstream from the device up to the\nroot port have the required ACS features enabled.\n\nSince ACS flags are inherited across a Live Update for preserved devices\nand all the way up to the root port, the preserved device should be in a\nsingleton IOMMU group after kexec in the new kernel.\n\nThis change should still permit all the current use-cases for PCI device\npreservation across Live Update, since it is intended to be used in\nCloud enviroments which should have the required ACS features enabled\nfor virtualization purposes.\n\nIf a device is part of a multi-device IOMMU group, preserving it will\nnow fail with an error. This restriction may be lifted in the future if\nsupport for preserving multi-device groups is desired.\n\nSigned-off-by: David Matlack <dmatlack@google.com>\n---\n drivers/iommu/iommu.c | 35 +++++++++++++++++++++++++++++++++++\n drivers/pci/liveupdate.c | 6 ++++++\n include/linux/iommu.h | 7 +++++++\n 3 files changed, 48 insertions(+)", "diff": "diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c\nindex 61c12ba78206..782e73a9d45f 100644\n--- a/drivers/iommu/iommu.c\n+++ b/drivers/iommu/iommu.c\n@@ -1664,6 +1664,41 @@ struct iommu_group *pci_device_group(struct device *dev)\n }\n EXPORT_SYMBOL_GPL(pci_device_group);\n \n+bool pci_device_group_immutable_singleton(struct pci_dev *dev)\n+{\n+\tstruct iommu_group *group;\n+\tstruct group_device *d;\n+\tstruct pci_bus *bus;\n+\tint nr_devices = 0;\n+\n+\tgroup = iommu_group_get(&dev->dev);\n+\tif (!group)\n+\t\treturn false;\n+\n+\tmutex_lock(&group->mutex);\n+\n+\tfor_each_group_device(group, d)\n+\t\tnr_devices++;\n+\n+\tmutex_unlock(&group->mutex);\n+\tiommu_group_put(group);\n+\n+\tif (nr_devices != 1)\n+\t\treturn false;\n+\n+\tfor (bus = dev->bus; !pci_is_root_bus(bus); bus = bus->parent) {\n+\t\tif (!bus->self)\n+\t\t\tcontinue;\n+\n+\t\tif (!pci_acs_path_enabled(bus->self, NULL, REQ_ACS_FLAGS))\n+\t\t\treturn false;\n+\n+\t\tbreak;\n+\t}\n+\n+\treturn true;\n+}\n+\n /* Get the IOMMU group for device on fsl-mc bus */\n struct iommu_group *fsl_mc_device_group(struct device *dev)\n {\ndiff --git a/drivers/pci/liveupdate.c b/drivers/pci/liveupdate.c\nindex a9a89f7bd3e5..54a90ff02bdd 100644\n--- a/drivers/pci/liveupdate.c\n+++ b/drivers/pci/liveupdate.c\n@@ -133,6 +133,7 @@\n #define pr_fmt(fmt) \"PCI: liveupdate: \" fmt\n \n #include <linux/io.h>\n+#include <linux/iommu.h>\n #include <linux/kexec_handover.h>\n #include <linux/kho/abi/pci.h>\n #include <linux/liveupdate.h>\n@@ -359,6 +360,11 @@ int pci_liveupdate_preserve(struct pci_dev *dev)\n \tif (dev->is_virtfn)\n \t\treturn -EINVAL;\n \n+\tif (!pci_device_group_immutable_singleton(dev)) {\n+\t\tpci_warn(dev, \"Device preservation limited to immutable singleton iommu groups\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (dev->liveupdate_outgoing)\n \t\treturn -EBUSY;\n \ndiff --git a/include/linux/iommu.h b/include/linux/iommu.h\nindex e587d4ac4d33..6f5d1dec3f89 100644\n--- a/include/linux/iommu.h\n+++ b/include/linux/iommu.h\n@@ -1096,6 +1096,8 @@ extern struct iommu_group *generic_device_group(struct device *dev);\n struct iommu_group *fsl_mc_device_group(struct device *dev);\n extern struct iommu_group *generic_single_device_group(struct device *dev);\n \n+bool pci_device_group_immutable_singleton(struct pci_dev *dev);\n+\n /**\n * struct iommu_fwspec - per-device IOMMU instance data\n * @iommu_fwnode: firmware handle for this device's IOMMU\n@@ -1528,6 +1530,11 @@ static inline int pci_dev_reset_iommu_prepare(struct pci_dev *pdev)\n static inline void pci_dev_reset_iommu_done(struct pci_dev *pdev)\n {\n }\n+\n+static inline bool pci_device_group_immutable_singleton(struct pci_dev *dev)\n+{\n+\treturn false;\n+}\n #endif /* CONFIG_IOMMU_API */\n \n #ifdef CONFIG_IRQ_MSI_IOMMU\n", "prefixes": [ "v4", "08/11" ] }