From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796172020; b=jrT16mW8qtT+7VMHsKENNl6yt13D55/PQK1AWUJ2Quo8WONlP/cZsht7hYrokkSVDwSt bQ0JTxlMbpOnoKn7uIsBEhnAU0UnqZyZ9Ksg31mmGn73trq9z2qTdIGVcvrnSHvdp8YBJ STUBCf1N4HsdacL1fN8638AptWDaaVPZWANuCOTETKX4xgI9hDrNeGmGyUE0opIOnthKd WZC4/coF+8yzB7SO91fUWpXPgw/PhukWpy69Le1Z/k+0cp5vPJZaHHF3M2pzR+uF99lBa n0SpYg9gBuzvQZPedqDR3T0f1FbXZi85FKpGPV/aI5uva9EFYQV4WWuGhXlaMABcJ9w== 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=jhgnBXpaXhgzVxzOoCOE1XHag6WHO9Um6uROsLISWe8QyapHOkEwIk7VctqTm1UlTtso FtWAYrQRusHVUIS07kArbrRFcdgwQPuA3D+lgkktkn4Ps2lVp1A1Gpq0Z6vLQ3Q+u9cF/ pjER/ZUD/6yWfk575aCppurb45sFAQzz+UrzVSg27ZZPUcJFBDevWZF4GX0Yi8ZSJSu/5 /bPU6/rx8zuwrJwY/By6c1z7OU6uX2eY6N9xRdXDt2jG71JG0E/+Dbv4MIzONB4W+ytAV IutlstVxmtmpqlWcREWSVXLTjPV+mOiFZgs0kL4hWMwAQTD4tTS20jFt+Q4hib1WTpQ== 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.197 Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) (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 4210A60A6F75 for ; Wed, 2 Dec 2026 00:40:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4210A60A6F75 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-f197.google.com with SMTP id 5614622812f47-4f8281066c4so14835074b6e.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=q3wpZ2WYsxQbQBzpafOo47sM7evbQJVew4LZktPmswDRmxseoweXjmc90gUY4MSfHZ FNrcffjjkVWSQsJNpeT4TI6K5e8EtkoqmhFsb5e7bqf2NPb60HnDQ6u96vHRmJ+wc9uy nWBvr0aPx0RnuLEOAJFZJJzZmI9/Nrs0DsfHc7Q9p/LDn9IanC2AA20Xvfc3kk0hmxLH MdPk9LU12NLBVtJBXihmplvvZSMGZf10APBJ+FiEhrPxethu79IJUhRgqhKWPROpRdI2 W2OyC5PuMF/326OAuCMvJDIpAFLqdQQbV1a/Bi2IPLwxO3Qy0lUl8DoWeHHk1IZWbF5f nsnQ== X-Forwarded-Encrypted: i=1; AL+hErGaUOaQVGGnutrhEVi12QjvjLC7AjCWYlTihhGvt98GU9qBINA4E5ZA6hZNBy66Ueia8BOB5TDSe1zo1+M=@vger.kernel.org X-Gm-Message-State: APuU4Z/UNlGHyFp2b+oJ15J9UShh/hIdEbvCEzZa9bMHbXOQ1K14vmXt xpN0ACEVwfuVvBG9yEKp9pbHP1gdtTVKsGed1JxaWOUQIt1GNjJBcbrVGH5b9yAqmeyGWzrqWaF Yc+ivzWpVD4ixMw== 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-kernel@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