From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.198 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796172021; b=USqAB7F3SPyMb7HKyxhSIj8F4LMcKIV3BBIuHpFeRosGmLtVkqBzG4y++NDcZzQxH6Lb jlLo5AAGH6HzcpmX8ZM5gCw8vYyLkNwwXN4SMuEKYjMyvaisB+oAPuBt+/MP0YHmDPaTA 90M2dtuPbttnr5erYhkU3Y2GXb9ZTZS+jQws69crkqwrwEUOZYQ+sXDMAoGLw6yr/fmgb qLQRidOwYkDPSMZwDhJmkB1DTFFWdhHwRtp8RWYdQkM+ZfYFLD9G182Y/3fHmJ2VAnHcf eL9vFy1RwjAQNoh5B95mrVN3Umc/8Q46rmeHc1kOabWaXTYDWCvJHEU5fEedCnEEJAg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796172021; 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=byoFKvI9fSTVuv9uSGwGe6/+wMINMTGc3tbnA5/weNEy4VNcclpY1GwdFF4eWzBPDmsJ uvlxRYnThelkLHSs/+Lf1qPYBUAeh26VcEFIgCQ6oX3Ob3lCyyfqacyU/omJJljXOQ5QN EVMC6Cjtjav25t+i3lmDDbqtS5zQ/HqmMuoF09fA5r1JsYyHGVm4Pg5uVF8YlU5O+lMmd +qgQlinC0gB4OM6mzSrFHtPmhCteiYRDA/eMyGK0OSoS1bqLMqhgU9xTI2jD6WqCiMP0Q JWmIUP6+x1lxt+LasU8JlvDkUqL/XIjkEWiOPfTP+IThSc0UGlfIKLSNeIwYhTG+F0g== 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.198 Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) (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 3813960A6F73 for ; Wed, 2 Dec 2026 00:40:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3813960A6F73 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-f198.google.com with SMTP id 5614622812f47-4f8281066c4so14835076b6e.2 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=J02DQSz6fXeSBWdEmc/rJWPvfe7eNs3p5t0nDXezWLI95rCLhTnkzS/t6M/jzHBouv 2wqgBwtVe5GeP97yxEjqKaUHzrIfVWggCNuhIX4ZI7fIkLop587euxkuPZEdxEmcE+mc Quk+0keGRzQL2YO5JuSMyIXtloPdcXlqZcwtnt0YbWvpn4R5L8Jrz0IdBKH7kdTK4uFm ue9u7OQ0dVIiRc/UOQadL0QAw1qCqmKnHW78jYwrOjvCNHNKmGQYvtAMQQ0hr1/2zpoP lb4lXs7HIM0Ea1DLRk4VDfJPEgKvkCOv4sMyIH7KzOEv6Cb26prM5g0Dzg8XKHAm1524 habQ== X-Forwarded-Encrypted: i=1; AL+hErFS+3vvMN2HVnwZV2paOE40tMDOKDAzk8M0qVf7dV2eHQ4FHvSgpbgSRmHfUtiFULAwDxDD6E1rzf8=@vger.kernel.org X-Gm-Message-State: APuU4Z+HNmCzPPiu1m+usynAp/Eoffq8BSDNW9MEFyWcqR5/hYtVd/YL BRxaR/eNQnd0tM9/wGA6J42JHdnR6ub0uY0ss0mXpVKHJ6z46aRsLiq0Zh8YFsFjjZPkzYv0AB4 lANxaPtUTasyCKQ== 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-pci@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