From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BAE2606A332 for ; Wed, 2 Dec 2026 00:40:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=SfA4VORI; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=kXFnVXLl; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=bUbxiFE3 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=6ewUa3jtiGGljmZxCR8w4agPfMhxXUOYidH9JWFsA3U=; b=SfA4VORIsx1dVvSv/kPQ04F4CE GM0rVcqol37CKfsVUKKmzZoKNxccS7ShlxdVglWQRcyxXrR89DaXcSjMwiRthLZR+QkbHszXA7nNH RIoR+oBtQkFpQbOOpkG1kBWRqnSCdCSwsTUPcBECwogG85Va3QN8SlKS9dTtnlqu61kF1IwQm6y2F o4yTk3TyIxFxJH85WUDVX3yZKA7QaFytgJKS6Jlfa6ZxklWGXWWcewi5ebpGUm4cIq6L13Tge1Jh+ Go8hHgPovF4BTvhDoW0bULuwgWNXpgLsO3wTCR306awt+Rv9ud2K1WaCM9r9kyByDcxiNl4IO7jzD 7FwfdFCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYYOu-00000009n9p-1roi; Wed, 02 Dec 2026 00:40:48 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYYOa-00000009mW4-0Rdb for kexec@bombadil.infradead.org; Wed, 02 Dec 2026 00:40:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:Cc:To:From:Subject: Message-ID:References:Mime-Version:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6ewUa3jtiGGljmZxCR8w4agPfMhxXUOYidH9JWFsA3U=; b=kXFnVXLlC8nIfKrCff0vT3lwHe yPnxsSKIhlU81USoHc+f/cjhHbUDVAZBSJK7riJ7HBpwAp8oJmcmw5Go5xsMBwEY2393JIkjjWreu KftMxDKzNfT22V+b9dakIcPqpmID9KQqTOGJoZxDHQBUjcfajFjQvif4nrsRhJJtomfUGdTwGn51H 9tuYISTtTUK65hXKwQ7bITS+YNphhWEUaTg43fYrvsqM8iHwlU0OTOAy1fNM+icMx2NouDhPSdWrv RX3UjjeRCHWd7UDRRTw8oQ9tSVMRFYDReia9O2qzDlJU9LVeiVsJ4me2eFwZLRyr3O2fguE7T25N0 iHJ4GwyA==; Received: from mail-oi1-f200.google.com ([209.85.167.200]) by casper.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYYOU-0000000HKoP-3Wik for kexec@lists.infradead.org; Wed, 02 Dec 2026 00:40:27 +0000 Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-4f8281066c4so14835090b6e.2 for ; Tue, 01 Dec 2026 16:40:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796172019; x=1796776819; darn=lists.infradead.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=bUbxiFE3w55OJIGHTdMjHCbaoDN+fS4wTO0jZUBMsIYC2EWbs+BJdKzNRNWzSTGqbA f/XYOmtT50ATYN+RXa1NpH+tBj8nvOYDlkwSQB+crt7lv415wYNGlKD3oIoYfnAMCswm BgXUIzOTGbpeYKYbEPqCBb3wLWi4li0IJINblicalh78wX8bnpYhSOnLyY3MAmhdRpVr VO9v8nBYZ0NY/1Type0lxS02sEakVyH3l7cUG1EJBixqY/gcGGmX7YEjBdCaGenieU9F VBiyIDSSfbDAVCOjIIT3k1YA77yOfBRwxrrXuQda07hWIjbcbk5B5BbSe60SwhC+/f87 eanw== 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=tWyrKaytAg7E7AaHvXYi6qrSYUHR0FurPs/fR7c3m8ORv6YTHK59FfvfUswWNbTI2O QfJm6ERwUZ0X/wkuN0lnFj7jnwX6fr6MkzZpUAPbsf3c0GAoBZWqJSAtEfggOPRcQ8i9 hZtWRlG9lpWbH9YObxGtneI3OA76LE8TYJDIjBwf+R2CCs8M5EZ9KGFvwCHsFYFmVsSZ xIAgi5EUWEF9EJzfS8Tmc7iU7h6Aip6rTzcWbLC0ufifw0rsA32ya+t8Vo/WBEsctbhy ExV9uwTSM+kCPGMPqqPfSRxk/bt41ybwAT8shMpBpue3KGRkFlrtmuGFCd7ZcGGNgpVu 9VTg== X-Gm-Message-State: APuU4Z+GYJp2Sw8EEzNj0VMHGtRNUENRKAD50Ue7Oorxk8nlNw/9Iar/ oQtIPsK9nhKk/fDJcdiBXX3q0fNSgsu5gbZgc66qvkHQYpQS1MIpyCr2eU/DvT/X6kcZSco79cf NXwD9/4VEqy0oVvu4vW5avxI0HSg8QZy9knq7094zdrCWdb6ducHpUbzyjeLQCldV/8vUdEOTFr RUtloLl8UW2UlvWBHJBvIN2dvmeyW5UIed3Hti8xAKeGqqrUPbEYA= 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-Archived-By: 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" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261202_004022_944301_79D495FA X-CRM114-Status: GOOD ( 14.34 ) X-Spam-Score: -9.5 (---------) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-26.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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