Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796172020; b=ad+kl0WhDWdPnvatqkTLTVLWyrgCM0g2fNuLOTeFrTcYWMulPGqKeg96zfb4fGl/6Pw9 3HLS9zcltEhvq4WnUK6NhEbIquAOfu0UvxW4lM/G8ry51ozJs9pzBpVwSTyj04Vt22zo8 fTX+0u9duolNOe8GLqSMiEZCaEAkClmir9y1EVOem+it18yKwZTIyM3GSEa0Ds3/RiJRw up2CFMAsojmLf16hGBBw7Zjo4Gb2g5dpmmdpr+G7Xe7kwzCmNn2J6QCaUYI8V6G9iim7Z FSI98jsH4JNss3II7MQtWP73M9JdTzYzpiHusPP0fZt9TeSO/bdim5N8v+MkDfAZ2bg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796172020; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=6ewUa3jtiGGljmZxCR8w4agPfMhxXUOYidH9JWFsA3U=; b=WtdQCq3Kg9eltqJmLUgpU3mSfblioX84I8szDZGyU0IBKWXXpRrhoPnjgZGOQ/Ng5bdx c9DIbd06iu8thO5b917RP+1j/nCfck2olMSk/qFM/d1Xe9YbHP4bMr6/rupMtUNJF0+jZ M+vQBfVh3ZarJL3VvM9m7a5dMuA4r1uoKy7pocrUSLEflbKMnHthj2RTrHojwAgMqb0u6 p2FyU7pIXQ/skLsWD2FuvWxtmzvutbZvcaE31sYFTB4wh3mywyU3iZxZGoPqp+ozd4bCB Fc3pUsIPNzEVW5wM3Fle2suljEHx5/z5Fph9FivwuR0zhDlULwrf6nj9jyllrsVsj+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=k93pKaci; arc=none smtp.remote-ip=209.85.167.200 Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8173E60A6F7B for ; Wed, 2 Dec 2026 00:40:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8173E60A6F7B 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=flex--dmatlack.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=k93pKaci Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-4a7de733fa9so12698060b6e.3 for ; Tue, 01 Dec 2026 16:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796172019; x=1796776819; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6ewUa3jtiGGljmZxCR8w4agPfMhxXUOYidH9JWFsA3U=; b=k93pKacixVCr1qx09o9ZSFpbebERyIaeshdjCfaaxYsHS8lXPPGiAoiqMGBlfrr4ue s5AgPEWYX1I+GqUBNlnfmYoQ6cPUOIstFHHYx5rqHZS+b84KuU6poqYE50yLVcELhtau 9VnDEsioUftAajwXM3Z9wc6aVLjFZqDJLUVxvxWQmx1s4wgiJ7LPBkeP8I2+8ExxS/AP Nownzqq2IK6K2y5LsGd0QWD+jeKZNCZevVjNS9lRT2YAJMsOoUIFVNeoYeB8IML81k3n KL9yihVQtFYFfDOCDmbOp4H77vUt++HUhLh+QLy2vsaI+IkWF1M8W53QWdewb++rsOkR heZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796172019; x=1796776819; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6ewUa3jtiGGljmZxCR8w4agPfMhxXUOYidH9JWFsA3U=; b=rYZ+f8L02G0FW9xCHoF/QP3VvXrrffh8hjrQjyjDXeeQLVVKdTR5Wx5IKOevW608M1 JWWp2LAEuQ+eTn40khy7jkbOZ0vsWSemHmUptFbPrhY0yrH/ViUgeMMH8cZzTuDP/OSX yUizdoiPQQTfCLW8MWdCa/zhaVPWmFCAXIXSW3rc5N4q68GmgYrAZ8gV7mG+iQfvV1xc VFxnD2H9e5ohZYXByGBAxq3C1UpueYblM2PS0kXTVEaJvHMTgkh079qaYn6tbkDYkCt/ q27gWuCMoa5tfKYX/wY4Rkpc9jX1zhQTYTDLMlfjiQuPusoSJJ4671Rn8fK9Mr/S0OnF R4aQ== X-Forwarded-Encrypted: i=1; AL+hErHZ00cwKLNobpR/CTlB+KbUVyjZJ9oidNDu73W7hV4aODjvvJUiErZtPir1+ras92oU9a6MNSg7u/0+bJbIgO0=@vger.kernel.org X-Gm-Message-State: APuU4Z9w68z5tWi7hVpmyaOoOrtCx3Rl3os4jjXeicLakECBr4V6Lzw4 2wrRYsb5YrplEfFZXw427eA2ysRbXxAjHIOi0PYpr7Io8tNcY2Oc1M9LuRqidJ235AKUcyfR6hv cAejNEng8Xn1OGA== X-Received: from iox15.prod.google.com ([2002:a05:6602:490f:b0:9e0:ddf2:d76c]) (user=dmatlack job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6808:1801:b0:4e8:721f:2824 with SMTP id 5614622812f47-57a0ccdfd83mr37137346b6e.60.1796172019083; Tue, 01 Dec 2026 16:40:19 -0800 (PST) Date: Wed, 2 Dec 2026 00:39:55 +0000 In-Reply-To: <20261202003955.3607156-1-dmatlack@google.com> X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261202003955.3607156-1-dmatlack@google.com> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog Message-ID: <20261202003955.3607156-19-dmatlack@google.com> Subject: [PATCH 18/18] selftests/liveupdate: pci: Test ACS with pci=config_acs From: David Matlack To: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Albert Ou , Alexandre Ghiti , Alex Williamson , Bjorn Helgaas , David Matlack , Jacob Pan , Jason Gunthorpe , Josh Hilke , Lukas Wunner , Mike Rapoport , Palmer Dabbelt , Parav Pandit , Pasha Tatashin , Paul Walmsley , Pranjal Shrivastava , Pratyush Yadav , Samiullah Khawaja , Shuah Khan , Vipin Sharma Content-Type: text/plain; charset="UTF-8" Add a PCI Live Update test that configures different ACS controls in each kernel with pci=config_acs=. The next kernel must keep the ACS controls of the root port above the preserved endpoint, and apply its own to the root port above the control endpoint, which the test checks with -x acs. Signed-off-by: David Matlack --- .../testing/selftests/liveupdate/pci/acs.vmtest.sh | 14 ++++++++++++++ .../selftests/liveupdate/pci/luo_pci_test.c | 10 ++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/liveupdate/pci/acs.vmtest.sh diff --git a/tools/testing/selftests/liveupdate/pci/acs.vmtest.sh b/tools/testing/selftests/liveupdate/pci/acs.vmtest.sh new file mode 100644 index 000000000000..6bc7f0980cbd --- /dev/null +++ b/tools/testing/selftests/liveupdate/pci/acs.vmtest.sh @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Configure different ACS controls in each kernel. The next kernel must adopt +# the ACS controls of bridges above a preserved endpoint, and apply its own to +# the root port above the control endpoint. + +source "$test_dir/pci/pci_vmtest_lib.sh" + +pci_topology_root_ports + +# Bits, from most to least significant: DT EC UF CR RR TB SV +TEST_ARGS+=(-x acs) +TEST_CMDLINE_STAGE1="pci=config_acs=xx11101@pci:0:0" +TEST_CMDLINE_STAGE2="pci=config_acs=xx00000@pci:0:0" diff --git a/tools/testing/selftests/liveupdate/pci/luo_pci_test.c b/tools/testing/selftests/liveupdate/pci/luo_pci_test.c index 4ee6f3a5f307..304f3b3ef1c9 100644 --- a/tools/testing/selftests/liveupdate/pci/luo_pci_test.c +++ b/tools/testing/selftests/liveupdate/pci/luo_pci_test.c @@ -12,8 +12,8 @@ * preserve. * -x [,...] Optional. Registers that must change across the Live * Update on bridges above the control endpoint (and not - * above the preserved endpoint): "ari" for ARI Forwarding - * Enable. + * above the preserved endpoint): "acs" for the ACS + * controls, "ari" for ARI Forwarding Enable. * -m Optional device whose config space is written to mark the * phases of the test in a QEMU trace of config writes. * @@ -546,6 +546,12 @@ static void check_devices(const char *when, const struct pci_snapshot *taken) check(!(now.command & PCI_COMMAND_MASTER), "%s: Bus Master still enabled on control device", dev->bdf); + if (dev->bridge && control_changes("acs")) { + check(dev->acs, "%s: No ACS capability", dev->bdf); + check(!dev->acs || now.acs_ctrl != dev->acs_ctrl, + "%s: ACS controls did not change (0x%04x)", + dev->bdf, now.acs_ctrl); + } if (dev->bridge && control_changes("ari")) { check(dev->pcie, "%s: Not a PCIe device", dev->bdf); check(!dev->pcie || -- 2.56.1.911.g883d8bcb20-goog