From nobody Sat Jul 25 10:15:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1784590464; cv=none; d=zohomail.com; s=zohoarc; b=h/RkL1Uz5iqmZooyb2JaxCff4knfEpfpUcSs0k+g4OQzDV7x6+kcs0uUZEFzwRzhQ86GFoOcRL8y2zTSbTRZw/yaPgYGUmbPRNf8cksda7CtwZAvJ8NBDTPGKIvw4Zm30D/GI6AU98tCl3SGOQO8Za+B6Qk1UWCn1seinX2qzP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784590464; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OMIOmwFct7Bvsigsxau0j7OtTsPfP7cD/QiB88tlONg=; b=Z7P8S/p22Phw6tyJedy5uBCxsmkPSr8RcG3Y8KFxvmrTYvKsxKdH/169zGBIVA+hFq5+QIGocshzuBMJic6A/cbPzrJqCeYWjwiDZYl0n0BzI9hdmrcx/0pMN6/Tn+uV6sWb4xNd/aUAZ6Iw47A0jyb2WU1mq+51GxX0akJuToc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784590464026929.5221993442259; Mon, 20 Jul 2026 16:34:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlxU6-0002PF-DZ; Mon, 20 Jul 2026 19:33:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxU3-0002N4-Il for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:15 -0400 Received: from fly.ash.relay.mailchannels.net ([23.83.222.61]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxTz-00050L-Pg for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:15 -0400 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 82A0180270D; Mon, 20 Jul 2026 23:33:08 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (100-104-243-177.trex-nlb.outbound.svc.cluster.local [100.104.243.177]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7EF55802BCA; Mon, 20 Jul 2026 23:33:07 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.104.243.177 (trex/8.0.2); Mon, 20 Jul 2026 23:33:07 +0000 Received: from offworld.lan (unknown [76.167.199.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a216.dreamhost.com (Postfix) with ESMTPSA id 4h3xdv02rpz1P9; Mon, 20 Jul 2026 16:33:06 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Whispering-Bitter: 7d61d5b35271f909_1784590387770_910987872 X-MC-Loop-Signature: 1784590387770:750604934 X-MC-Ingress-Time: 1784590387769 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1784590387; bh=OMIOmwFct7Bvsigsxau0j7OtTsPfP7cD/QiB88tlONg=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=ojRTW46VnMvqW441pkcsACYeRrh7pfXSWzf6w2FufXdcVa+8Ko0uCYfyhRkU2E7aa rn1Y4v5DPqjW27qStJWhWW5DNvN9TzT+7NVYM2lugTrHr98tmbfsph8P6meOtv5F/s S59p1fwlflkDU9ythsFVu6gQTErPB2Gd4DMy3qvKszETr/EbZzO+2pwCcNmzHTGNtR v0DQFjfVVYCWcmT2Bbj2Ik3s2TIx5CoSWD2JSvxAISQkj07iPA91xY8Syb8x9HQ+Lz LRIK/QWdFX4Qnv/9KXuoptyt4/Ga5ctZrsWCvU2ZjyiYlzjIViRm+rUMYjA7j4RJkt UNj0zVrq0oPDA== From: Davidlohr Bueso To: jic23@kernel.org, mst@redhat.com Cc: linux-cxl@vger.kernel.org, qemu-devel@nongnu.org, dave@stgolabs.net Subject: [PATCH v2 1/5] tests/bios-tables-test: Exclude CEDT.cxl for the CFMW restriction change Date: Mon, 20 Jul 2026 16:32:38 -0700 Message-Id: <20260720233242.901544-2-dave@stgolabs.net> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260720233242.901544-1-dave@stgolabs.net> References: <20260720233242.901544-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: softfail client-ip=23.83.222.61; envelope-from=dave@stgolabs.net; helo=fly.ash.relay.mailchannels.net X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.01, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @stgolabs.net) X-ZM-MESSAGEID: 1784590464608158500 Content-Type: text/plain; charset="utf-8" The next patch changes the default CXL Fixed Memory Window restrictions, dropping Back-Invalidate. Add CEDT.cxl to the allowed-diff list so the comparison passes until the expected blob is regenerated. Signed-off-by: Davidlohr Bueso --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8bf4..b4646b5b3147 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/q35/CEDT.cxl", --=20 2.39.5 From nobody Sat Jul 25 10:15:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1784590478; cv=none; d=zohomail.com; s=zohoarc; b=NKk92qtMfjDfV71Jd1lB1LVq00Z2svwb6+vlQCzZjk0/YmESpCHIboImD2Y1sQPYQTUrDzV+1lF1qpTWk4rObobo+Lr14s3nE7/xblkhUDRm/AsnXZqDhboexJRdp8P5bN6Gsso534syJ8TYKP9mmd0n4xSiUuRH31KgVAK9jiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784590478; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hnKcICFiOcSlluv0YXDs2SsxD7mzY5SwQEcsVTozuQI=; b=GPzFIAYyZVw9d68/dXOC56iJhT4gMcKpM0465Lamh8vKAwmkhVfZ8Ms1hYHjZNkBjpS6Xl3qDnilQc1lLy8+zu+bf5vEjevqU/qgXqtOSPKW2HjT/pjhyGpZTG1AhRhANWTxZWy4AHt0HMrB2CyMd16qufdGsFzhhXp+JEg+LQE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784590478187219.12570600052186; Mon, 20 Jul 2026 16:34:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlxU7-0002Pp-6l; Mon, 20 Jul 2026 19:33:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxU3-0002N3-Hu for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:15 -0400 Received: from cyan.elm.relay.mailchannels.net ([23.83.212.47]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxTz-00050K-VA for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:15 -0400 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 6714F462DC5; Mon, 20 Jul 2026 23:33:08 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (trex-green-4.trex.outbound.svc.cluster.local [100.103.95.92]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 0ADD8462D36; Mon, 20 Jul 2026 23:33:08 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.95.92 (trex/8.0.2); Mon, 20 Jul 2026 23:33:08 +0000 Received: from offworld.lan (unknown [76.167.199.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a216.dreamhost.com (Postfix) with ESMTPSA id 4h3xdv3slCz1Pv; Mon, 20 Jul 2026 16:33:07 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Oafish-Duck: 2aab881147c254fa_1784590388283_1795428076 X-MC-Loop-Signature: 1784590388283:2343086391 X-MC-Ingress-Time: 1784590388283 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1784590387; bh=hnKcICFiOcSlluv0YXDs2SsxD7mzY5SwQEcsVTozuQI=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=gZkm89AAhy3ELFaf5S+nJeWWtKrnIQncNTCzAwyNdynoMjU7dHheW128gUlJCOxsk IvBXols7dF6i+T5YZ+w7mv/CvbyjuGrBDcapfvz9rtePgLN84wlvrts34oRxLuHJbt Ycpq/aSK+xswY+BoPmJei+7EmMxMfs+PKnIMFGneVuKreSQX7oUU2DalHnvVYc6cyM Uougnw93g09EVNpCUNywqBzFgkIBN0kijQamny9rMDrLTqdRIPe6A5SCaMwcZxEu3I zNZsfy0KjXa8KOIvaqsNItCYyX90Hy/m6vM+qBu8a2Zfw8ZMw0UavYN7+e2S7ICka7 eUY/OHB9v8LPQ== From: Davidlohr Bueso To: jic23@kernel.org, mst@redhat.com Cc: linux-cxl@vger.kernel.org, qemu-devel@nongnu.org, dave@stgolabs.net Subject: [PATCH v2 2/5] hw/cxl: Drop Back-Invalidate from default CFMW window restrictions Date: Mon, 20 Jul 2026 16:32:39 -0700 Message-Id: <20260720233242.901544-3-dave@stgolabs.net> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260720233242.901544-1-dave@stgolabs.net> References: <20260720233242.901544-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: softfail client-ip=23.83.212.47; envelope-from=dave@stgolabs.net; helo=cyan.elm.relay.mailchannels.net X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @stgolabs.net) X-ZM-MESSAGEID: 1784590478468158500 Content-Type: text/plain; charset="utf-8" The default CXL Fixed Memory Window restrictions advertised host-only coherent together with Back-Invalidate. A window advertising both simultaneously is undefined behavior per CXL r4.0 9.18.1.3. Drop Back-Invalidate from the default, leaving device-coherent + host-only + volatile + persistent. Signed-off-by: Davidlohr Bueso --- hw/acpi/cxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/cxl.c b/hw/acpi/cxl.c index f92f7fa3d558..75edb2c0a652 100644 --- a/hw/acpi/cxl.c +++ b/hw/acpi/cxl.c @@ -172,7 +172,7 @@ static void cedt_build_cfmws(CXLFixedWindow *fw, Aml *c= edt) build_append_int_noprefix(table_data, fw->enc_int_gran, 4); =20 /* Window Restrictions */ - build_append_int_noprefix(table_data, 0x2f, 2); + build_append_int_noprefix(table_data, 0x0f, 2); =20 /* QTG ID */ build_append_int_noprefix(table_data, 0, 2); --=20 2.39.5 From nobody Sat Jul 25 10:15:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1784590458; cv=none; d=zohomail.com; s=zohoarc; b=Ypqf+vszSUJWv3HlA5pguxC2dKuIHU4ZFM/nmvTd4toOsA35p5xPh8RaL/t1dzDoTRWQYUYZVf1jZMNLREGSHVJTgU1kW19MgR6rmSLIw9N/BXpWowH0x88RSNDyB2VVH4V2o9HqsnwN+BQ35busxhQAy1nf0Cq4oyspcVQOSXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784590458; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ttj+PI4T1KYb/sma3Tc4KkN36biy0tYu1idHgYObEdc=; b=lD8TxzzVnlHa1zerqebNBhxoddVZRXpFOfkAXsnlka4nPIZTvYiiqqod7criS6brDBumVSobof1LGORKTDFN5IHAzjws/YgJ+uNP4chr/8aa/Vh+6cwxq1dLVYiDtITaUnEXzz+KomiOSJGHAZnMa7OAJfsnjpRBWW/tt1cUJM8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784590458814726.6820741479974; Mon, 20 Jul 2026 16:34:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlxU7-0002QZ-S7; Mon, 20 Jul 2026 19:33:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxU3-0002N5-Mg for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:15 -0400 Received: from butterfly.birch.relay.mailchannels.net ([23.83.209.27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxU0-00050a-F0 for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:15 -0400 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D27FA942807; Mon, 20 Jul 2026 23:33:08 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (trex-green-6.trex.outbound.svc.cluster.local [100.104.248.19]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 80B439427F3; Mon, 20 Jul 2026 23:33:08 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.104.248.19 (trex/8.0.2); Mon, 20 Jul 2026 23:33:08 +0000 Received: from offworld.lan (unknown [76.167.199.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a216.dreamhost.com (Postfix) with ESMTPSA id 4h3xdw0ChPz1RB; Mon, 20 Jul 2026 16:33:07 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Juvenile-Bored: 580ed5b52595c1cc_1784590388774_387277786 X-MC-Loop-Signature: 1784590388774:2841013375 X-MC-Ingress-Time: 1784590388773 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1784590388; bh=Ttj+PI4T1KYb/sma3Tc4KkN36biy0tYu1idHgYObEdc=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=I0zyqnbAERcAeOxyp5NjcUWrwgQCGcvynq4plPoRGx47Vhax2vt4qDtu7Eyg3X2DV 5WS7fOGEQGraGF9rG1Sv6gl9EAuoL1zlTsuH8bgKWnjfYY8QfrE++eZBP0zlWcoBsM nJUmRQt/FV3AY7K+ge/cSyssZObRXZT5sTcvloa9aseWhFFzf9ynFD3Z6wxDnIfCiF m2C/l3k57dkBDFUR5NHmlCTsAhJNe9Io4bsncm3I2wCFv0GHjd3PldgTYmAmpcfm+c 0CNoZle/rcHt5Ar0EC3EejeopGmqov0LkR1vhvfFsgB+yZQ2x+qRHrfOatsiKYdP4c 90gdz04fk3fZg== From: Davidlohr Bueso To: jic23@kernel.org, mst@redhat.com Cc: linux-cxl@vger.kernel.org, qemu-devel@nongnu.org, dave@stgolabs.net Subject: [PATCH v2 3/5] tests/acpi/cxl: Update CEDT.cxl for the default CFMW restrictions Date: Mon, 20 Jul 2026 16:32:40 -0700 Message-Id: <20260720233242.901544-4-dave@stgolabs.net> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260720233242.901544-1-dave@stgolabs.net> References: <20260720233242.901544-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: softfail client-ip=23.83.209.27; envelope-from=dave@stgolabs.net; helo=butterfly.birch.relay.mailchannels.net X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @stgolabs.net) X-ZM-MESSAGEID: 1784590460962158500 Content-Type: text/plain; charset="utf-8" With the default CXL Fixed Memory Window restrictions changed to drop Back-Invalidate (keeping device-coherent and host-only), update the expected CEDT to advertise 0x0f instead of 0x2f. [064h 0100 001h] Subtable Type : 01 [CXL Fixed Memory Window = Structure] [065h 0101 001h] Reserved : 00 [066h 0102 002h] Length : 0028 [068h 0104 004h] Reserved : 00000000 [06Ch 0108 008h] Window base address : 0000000110000000 [074h 0116 008h] Window size : 0000000100000000 [07Ch 0124 001h] Interleave Members : 00 [07Dh 0125 001h] Interleave Arithmetic : 00 [07Eh 0126 002h] Reserved : 0000 [080h 0128 004h] Granularity : 00000005 [084h 0132 002h] Restrictions : 000F [086h 0134 002h] QtgId : 0000 [088h 0136 004h] First Target : 0000000C Signed-off-by: Davidlohr Bueso --- tests/data/acpi/x86/q35/CEDT.cxl | Bin 184 -> 184 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/x86/q35/CEDT.cxl b/tests/data/acpi/x86/q35/CED= T.cxl index c35f3882eee67aa5613af427234d1ccd196aa249..ff8203af070241bd23dd0eb8a51= 460692bb7d229 100644 GIT binary patch delta 36 ncmdnNxPy_)+0`Xv2Ll5G Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784590480404746.8971586403803; Mon, 20 Jul 2026 16:34:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlxU9-0002R6-2L; Mon, 20 Jul 2026 19:33:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxU4-0002NY-82 for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:16 -0400 Received: from iguana.tulip.relay.mailchannels.net ([23.83.218.253]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxTz-00050P-Nx for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:15 -0400 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 46A76461B1A; Mon, 20 Jul 2026 23:33:09 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (trex-green-1.trex.outbound.svc.cluster.local [100.103.88.67]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id EDB5F462DE4; Mon, 20 Jul 2026 23:33:08 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.88.67 (trex/8.0.2); Mon, 20 Jul 2026 23:33:09 +0000 Received: from offworld.lan (unknown [76.167.199.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a216.dreamhost.com (Postfix) with ESMTPSA id 4h3xdw3fGPz1Pv; Mon, 20 Jul 2026 16:33:08 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Eyes-Average: 5cf431fd61ee96b3_1784590389242_2078510123 X-MC-Loop-Signature: 1784590389242:1416080239 X-MC-Ingress-Time: 1784590389242 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1784590388; bh=E1eHHKVEeF+gxzLlnh1E3junCmhJURdEk0+x5v55XeA=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=MPd03N1ldJdv7Ig8Tvmc8/BTW6kj1rPD6rjQtaYX0N/RLAahQytypmN970wIJXtjV azCMUTgW09ME908a1K4ezHdlo0gaPFY+DrlwnIA/0N5IeqxpfoJHxHCIlDnJAnsRhx 5np+C3jasFY/3ii4NmnLmBheOB6sSRSEQ2v14lAtEEeAz9ISMUZZi+K4W9thRXDRKC oDymF1/ekrOY6Guhoece8GfKTQ2gkOG9fV0yGaFv8YoXuE9iZPT1tTIrCwDz+hQDeR bvfrL/3j6I2F3R6H4lJxeXXG6gdkItODO+0VUBAWY7AvElHsSaZSBi4gwGTqwerP5m vdCdokvckHaCg== From: Davidlohr Bueso To: jic23@kernel.org, mst@redhat.com Cc: linux-cxl@vger.kernel.org, qemu-devel@nongnu.org, dave@stgolabs.net Subject: [PATCH v2 4/5] hw/cxl: Add configurable CXL Fixed Memory Window restriction flags Date: Mon, 20 Jul 2026 16:32:41 -0700 Message-Id: <20260720233242.901544-5-dave@stgolabs.net> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260720233242.901544-1-dave@stgolabs.net> References: <20260720233242.901544-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: softfail client-ip=23.83.218.253; envelope-from=dave@stgolabs.net; helo=iguana.tulip.relay.mailchannels.net X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_BL_SPAMCOP_NET=1.347, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @stgolabs.net) X-ZM-MESSAGEID: 1784590482590158500 Content-Type: text/plain; charset="utf-8" Expose the CFMWS "Window Restrictions" (CXL r4.0 9.18.1.3) as named per-window machine properties -- device-coherent, host-only, volatile, persistent, fixed-config and back-invalidate -- so the advertised restrictions can be configured per window rather than left at the default. No changes in default options. HDM-D and HDM-H are advertised by default; disabling one (device-coherent=3Doff or host-only=3Doff) narrows the window= to the other. back-invalidate implies device-coherent (HDM-DB) and suppresses the host-only default. host-only coherent combined with back-invalidate is rejected as undefined behavior per the spec. Signed-off-by: Davidlohr Bueso --- docs/system/devices/cxl.rst | 25 ++++++++++++-------- hw/acpi/cxl.c | 2 +- hw/cxl/cxl-host.c | 46 +++++++++++++++++++++++++++++++++++++ include/hw/cxl/cxl.h | 12 ++++++++++ qapi/machine.json | 28 ++++++++++++++++++++++ 5 files changed, 102 insertions(+), 11 deletions(-) diff --git a/docs/system/devices/cxl.rst b/docs/system/devices/cxl.rst index 9d0771cdfd73..6bee339cea72 100644 --- a/docs/system/devices/cxl.rst +++ b/docs/system/devices/cxl.rst @@ -384,8 +384,13 @@ An example of 4 devices below a switch suitable for 1,= 2 or 4 way interleave:: -device cxl-type3,bus=3Dswport3,persistent-memdev=3Dcxl-mem3,lsa=3Dcxl-l= sa3,id=3Dcxl-pmem3,sn=3D0x4 \ -M cxl-fmw.0.targets.0=3Dcxl.1,cxl-fmw.0.size=3D4G,cxl-fmw.0.interleave-= granularity=3D4k =20 -An example of 4 type3 devices with volatile memory below a switch. Two of = the devices -use HDM-DB for coherence, which requires operating in Flit mode:: +An example of a mixed configuration across two host bridges, each with its +own CXL window. Below cxl.1, two type3 volatile devices behind a switch use +HDM-DB for coherence, which requires operating in Flit mode and a window +that permits the device-coherent Back-Invalidate model. Below cxl.2, two +plain host-only devices are directly attached and use the default window. +Because a window targets a host bridge, giving each coherency model its own +bridge keeps the window-to-device mapping explicit:: =20 qemu-system-x86_64 -M q35,cxl=3Don -m 4G,maxmem=3D8G,slots=3D8 -smp 4 \ ... @@ -395,17 +400,17 @@ use HDM-DB for coherence, which requires operating in= Flit mode:: -object memory-backend-ram,id=3Dcxl-mem3,share=3Don,size=3D256M \ -device pxb-cxl,bus_nr=3D12,bus=3Dpcie.0,id=3Dcxl.1 \ -device cxl-rp,port=3D0,bus=3Dcxl.1,id=3Droot_port0,chassis=3D0,slot=3D0= \ - -device cxl-rp,port=3D1,bus=3Dcxl.1,id=3Droot_port1,chassis=3D0,slot=3D1= \ -device cxl-upstream,bus=3Droot_port0,id=3Dus0,x-256b-flit=3Don \ -device cxl-downstream,port=3D0,bus=3Dus0,id=3Dswport0,chassis=3D0,slot= =3D4 \ - -device cxl-type3,bus=3Dswport0,volatile-memdev=3Dcxl-mem0,id=3Dcxl-mem0= ,sn=3D0x1,x-256b-flit=3Don,hdm-db=3Don \ + -device cxl-type3,bus=3Dswport0,volatile-memdev=3Dcxl-mem0,id=3Dcxl-vmem= 0,sn=3D0x1,x-256b-flit=3Don,hdm-db=3Don \ -device cxl-downstream,port=3D1,bus=3Dus0,id=3Dswport1,chassis=3D0,slot= =3D5 \ - -device cxl-type3,bus=3Dswport1,volatile-memdev=3Dcxl-mem1,id=3Dcxl-mem1= ,sn=3D0x2,x-256b-flit=3Don,hdm-db=3Don \ - -device cxl-downstream,port=3D2,bus=3Dus0,id=3Dswport2,chassis=3D0,slot= =3D6 \ - -device cxl-type3,bus=3Dswport2,volatile-memdev=3Dcxl-mem2,id=3Dcxl-mem2= ,sn=3D0x3 \ - -device cxl-downstream,port=3D3,bus=3Dus0,id=3Dswport3,chassis=3D0,slot= =3D7 \ - -device cxl-type3,bus=3Dswport3,volatile-memdev=3Dcxl-mem3,id=3Dcxl-mem3= ,sn=3D0x4 \ - -M cxl-fmw.0.targets.0=3Dcxl.1,cxl-fmw.0.size=3D4G,cxl-fmw.0.interleave-= granularity=3D4k + -device cxl-type3,bus=3Dswport1,volatile-memdev=3Dcxl-mem1,id=3Dcxl-vmem= 1,sn=3D0x2,x-256b-flit=3Don,hdm-db=3Don \ + -device pxb-cxl,bus_nr=3D222,bus=3Dpcie.0,id=3Dcxl.2 \ + -device cxl-rp,port=3D0,bus=3Dcxl.2,id=3Droot_port1,chassis=3D0,slot=3D6= \ + -device cxl-type3,bus=3Droot_port1,volatile-memdev=3Dcxl-mem2,id=3Dcxl-v= mem2,sn=3D0x3 \ + -device cxl-rp,port=3D1,bus=3Dcxl.2,id=3Droot_port2,chassis=3D0,slot=3D7= \ + -device cxl-type3,bus=3Droot_port2,volatile-memdev=3Dcxl-mem3,id=3Dcxl-v= mem3,sn=3D0x4 \ + -M cxl-fmw.0.targets.0=3Dcxl.1,cxl-fmw.0.size=3D4G,cxl-fmw.0.interleave-= granularity=3D4k,cxl-fmw.0.back-invalidate=3Don,cxl-fmw.1.targets.0=3Dcxl.2= ,cxl-fmw.1.size=3D4G,cxl-fmw.1.interleave-granularity=3D4k =20 A simple arm/virt example featuring a single direct connected CXL Type 3 Volatile Memory device:: diff --git a/hw/acpi/cxl.c b/hw/acpi/cxl.c index 75edb2c0a652..77c1db6561b4 100644 --- a/hw/acpi/cxl.c +++ b/hw/acpi/cxl.c @@ -172,7 +172,7 @@ static void cedt_build_cfmws(CXLFixedWindow *fw, Aml *c= edt) build_append_int_noprefix(table_data, fw->enc_int_gran, 4); =20 /* Window Restrictions */ - build_append_int_noprefix(table_data, 0x0f, 2); + build_append_int_noprefix(table_data, fw->restrictions, 2); =20 /* QTG ID */ build_append_int_noprefix(table_data, 0, 2); diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 7e744312f1d8..c26247dcfa8a 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -61,6 +61,52 @@ static void cxl_fixed_memory_window_config(CXLFixedMemor= yWindowOptions *object, fw->enc_int_gran =3D 0; } =20 + /* + * HDM-D and HDM-H are advertised by default; disabling one + * (host-only=3Doff or device-coherent=3Doff) narrows the window to the + * other. + */ + if (!object->has_device_coherent || object->device_coherent) { + fw->restrictions |=3D CXL_FMW_DEVICE_COHERENT; + } + if (object->has_host_only ? object->host_only : !object->back_invalida= te) { + fw->restrictions |=3D CXL_FMW_HOST_ONLY; + } + if (object->back_invalidate) { + fw->restrictions |=3D CXL_FMW_DEVICE_COHERENT | CXL_FMW_BI; + } + + if (!(fw->restrictions & (CXL_FMW_DEVICE_COHERENT | CXL_FMW_HOST_ONLY)= )) { + error_setg(errp, "CFMW coherency model required"); + return; + } + + if (object->fixed_config) { + fw->restrictions |=3D CXL_FMW_FIXED_CONFIG; /* no-op */ + } + + /* Volatile and persistent are permitted unless explicitly disabled. */ + if (!object->has_q_volatile || object->q_volatile) { + fw->restrictions |=3D CXL_FMW_VOLATILE; + } + if (!object->has_persistent || object->persistent) { + fw->restrictions |=3D CXL_FMW_PERSISTENT; + } + if (!(fw->restrictions & (CXL_FMW_VOLATILE | CXL_FMW_PERSISTENT))) { + error_setg(errp, "CFMW volatile and/or persistent memory required"= ); + return; + } + + /* + * Reject the undefined and conflicting coherency combinations, + * per CXL r4.0 9.18.1.3. + */ + if ((fw->restrictions & CXL_FMW_HOST_ONLY) && + (fw->restrictions & CXL_FMW_BI)) { + error_setg(errp, "CFMW host-only coherency + BI is undefined behav= ior"); + return; + } + fw->targets =3D g_malloc0_n(fw->num_targets, sizeof(*fw->targets)); for (i =3D 0, target =3D object->targets; target; i++, target =3D targ= et->next) { /* This link cannot be resolved yet, so stash the name for now */ diff --git a/include/hw/cxl/cxl.h b/include/hw/cxl/cxl.h index d8cd8359d2ec..7cf3dc622c07 100644 --- a/include/hw/cxl/cxl.h +++ b/include/hw/cxl/cxl.h @@ -27,6 +27,17 @@ =20 typedef struct PXBCXLDev PXBCXLDev; =20 +/* + * CEDT CFMWS "Window Restrictions" bits (CXL r4.0 9.18.1.3), advertising + * which capabilities the host bridges below this window support. + */ +#define CXL_FMW_DEVICE_COHERENT (1 << 0) /* HDM-D */ +#define CXL_FMW_HOST_ONLY (1 << 1) /* HDM-H */ +#define CXL_FMW_VOLATILE (1 << 2) +#define CXL_FMW_PERSISTENT (1 << 3) +#define CXL_FMW_FIXED_CONFIG (1 << 4) +#define CXL_FMW_BI (1 << 5) /* HDM-DB, Back-Invalidate */ + typedef struct CXLFixedWindow { SysBusDevice parent_obj; int index; @@ -36,6 +47,7 @@ typedef struct CXLFixedWindow { uint8_t num_targets; uint8_t enc_int_ways; uint8_t enc_int_gran; + uint16_t restrictions; /* Todo: XOR based interleaving */ MemoryRegion mr; hwaddr base; diff --git a/qapi/machine.json b/qapi/machine.json index 9b2248038fcb..7f6ffa82a551 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -551,15 +551,43 @@ # accesses will go to a given interleave target. Accepted values # [256, 512, 1k, 2k, 4k, 8k, 16k] # +# @device-coherent: Window permits device-coherent (minimally HDM-D) +# accesses. (since 11.1) +# +# @host-only: Window permits host-only coherent (HDM-H) accesses. +# (since 11.1) +# +# @volatile: Window permits volatile memory. (since 11.1) +# +# @persistent: Window permits persistent memory. (since 11.1) +# +# @fixed-config: Window has a fixed device configuration. Advertised +# in the CEDT only; not otherwise emulated. (since 11.1) +# +# @back-invalidate: Window permits Back-Invalidate (HDM-DB). Implies +# @device-coherent. (since 11.1) +# # @targets: Target root bridge IDs from -device ...,id=3D for each # root bridge. # +# Coherency defaults to both device-coherent and host-only; disabling +# one (host-only=3Doff or device-coherent=3Doff) narrows to the other. +# @back-invalidate implies device-coherent and is not host-only. +# @volatile and @persistent default on. host-only coherent combined +# with @back-invalidate is rejected as undefined behavior. +# # Since: 7.1 ## { 'struct': 'CXLFixedMemoryWindowOptions', 'data': { 'size': 'size', '*interleave-granularity': 'size', + '*device-coherent': 'bool', + '*host-only': 'bool', + '*volatile': 'bool', + '*persistent': 'bool', + '*fixed-config': 'bool', + '*back-invalidate': 'bool', 'targets': ['str'] }} =20 ## --=20 2.39.5 From nobody Sat Jul 25 10:15:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1784590459; cv=none; d=zohomail.com; s=zohoarc; b=bA+M3zfyLwhm1DLR0vxweMZE0KGMLX+rQw89d+f4YLw2iCDqeRgehADn472diiYv69fxsDj6mgUTy9TVaWDRy7F78p3CBrpgF5MXXp1hJ7ed//fSY5RVtEnjvu2Nzw7KD61obz5rP1IJDv2xKYKauo3DQRy/l1KsYJqo44HgW/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784590459; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iZqxenwoIt6yu+IkNTihBz891cvUJGF++ChizIyZjAk=; b=DQ5Yrl43pw9vYyiJtGgGsyiuqQ3f1C75/NxfvJUYW+GTBtPDT3nZGRzhhAjL37MxrMzZ0coJDD9foBh3MlfniJyb1nBQDBTyqYE202ma7l5J+Zr/dCxmiG/I5c3VCAcjUId6dHCH9XXlZUfhxeNh4X57D0V8u0Oi1XKi7KYESp0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784590458986945.8953141477787; Mon, 20 Jul 2026 16:34:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlxU9-0002SB-C0; Mon, 20 Jul 2026 19:33:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxU4-0002OG-Vc for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:17 -0400 Received: from fly.ash.relay.mailchannels.net ([23.83.222.61]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlxU0-00050W-GT for qemu-devel@nongnu.org; Mon, 20 Jul 2026 19:33:16 -0400 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id BEF4D4014BA; Mon, 20 Jul 2026 23:33:09 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (trex-green-7.trex.outbound.svc.cluster.local [100.103.92.160]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 70169400F61; Mon, 20 Jul 2026 23:33:09 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.92.160 (trex/8.0.2); Mon, 20 Jul 2026 23:33:09 +0000 Received: from offworld.lan (unknown [76.167.199.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a216.dreamhost.com (Postfix) with ESMTPSA id 4h3xdx00fSz1P9; Mon, 20 Jul 2026 16:33:08 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Average-Fearful: 0a1c7e6066406f08_1784590389702_758826701 X-MC-Loop-Signature: 1784590389702:1016739499 X-MC-Ingress-Time: 1784590389702 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1784590389; bh=iZqxenwoIt6yu+IkNTihBz891cvUJGF++ChizIyZjAk=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=IBvmN7VylmNt50oIZ1RwmEGGarPNxbbsk94Ci+zUz2WiHJGXuBYDHYCQkU5LcWaXh OoNkOZPkbF2uGGAZB1KUhz/gnO+RBqmRblNCqwvsGT/CPgQCIzE8l2sWZCYmu6d/01 PXOc+e2iUCMVo12sJ5enJjyvmSNgj9Y4wjJbX7fS8qukujrUy/4fyTnddiIwuLP23z s4G6VHywSWEZWImH6QktPbhx7y/VzMV/6ddSrVzoudTM9HMxZn74vo1T8cAiQ+kTtm wVxJ3TqCfVVCVE6/LKX29Zj1pkZqmLXdfX9x5sLnhd11TkD3awWt6JML9h3ulWHGdR m0F5u2gUCyhZQ== From: Davidlohr Bueso To: jic23@kernel.org, mst@redhat.com Cc: linux-cxl@vger.kernel.org, qemu-devel@nongnu.org, dave@stgolabs.net Subject: [PATCH v2 5/5] tests/qtest/cxl: Add CXL Fixed Memory Window restriction flag tests Date: Mon, 20 Jul 2026 16:32:42 -0700 Message-Id: <20260720233242.901544-6-dave@stgolabs.net> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260720233242.901544-1-dave@stgolabs.net> References: <20260720233242.901544-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: softfail client-ip=23.83.222.61; envelope-from=dave@stgolabs.net; helo=fly.ash.relay.mailchannels.net X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.01, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @stgolabs.net) X-ZM-MESSAGEID: 1784590460978158500 Content-Type: text/plain; charset="utf-8" Add a /pci/cxl/cfmw group exercising the configurable CFMWS Window Restrictions. Signed-off-by: Davidlohr Bueso --- tests/qtest/cxl-test.c | 95 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c index 8fb7e58d4f17..49d820cde16f 100644 --- a/tests/qtest/cxl-test.c +++ b/tests/qtest/cxl-test.c @@ -81,6 +81,13 @@ "-object memory-backend-file,id=3Dlsa3,mem-path=3D%s,size=3D256M " \ "-device cxl-type3,bus=3Drp3,persistent-memdev=3Dcxl-mem3,lsa=3Dlsa3,i= d=3Dpmem3 " =20 +/* Single pxb + volatile type3 + one window; base for the CFMW tests. */ +#define QEMU_CFMW \ + "-machine q35,cxl=3Don " \ + "-device pxb-cxl,id=3Dcxl.0,bus=3Dpcie.0,bus_nr=3D52 " \ + QEMU_RP QEMU_T3D_VMEM \ + "-M cxl-fmw.0.targets.0=3Dcxl.0,cxl-fmw.0.size=3D4G" + static void cxl_basic_hb(void) { qtest_start("-machine q35,cxl=3Don"); @@ -117,6 +124,81 @@ static void cxl_2root_port(void) qtest_end(); } =20 +/* + * CFMWS "Window Restrictions" (CXL r4.0 9.18.1.3) are configurable per + * window; check that valid restriction sets are accepted. + */ +static void cxl_cfmw_default(void) +{ + /* No coherency flag advertises both HDM-D and HDM-H. */ + qtest_start(QEMU_CFMW); + qtest_end(); +} + +static void cxl_cfmw_host_only_off(void) +{ + /* Disabling host-only leaves device-coherent (HDM-D). */ + qtest_start(QEMU_CFMW ",cxl-fmw.0.host-only=3Doff"); + qtest_end(); +} + +static void cxl_cfmw_device_coherent_off(void) +{ + /* Disabling device-coherent leaves host-only (HDM-H). */ + qtest_start(QEMU_CFMW ",cxl-fmw.0.device-coherent=3Doff"); + qtest_end(); +} + +static void cxl_cfmw_back_invalidate(void) +{ + /* Back-Invalidate implies device-coherent (HDM-DB). */ + qtest_start(QEMU_CFMW ",cxl-fmw.0.back-invalidate=3Don"); + qtest_end(); +} + +static void cxl_cfmw_fixed_config(void) +{ + qtest_start(QEMU_CFMW ",cxl-fmw.0.fixed-config=3Don"); + qtest_end(); +} + +static void cxl_cfmw_device_and_host(void) +{ + /* + * device-coherent and host-only may both be advertised (the spec + * permits multiple bits set); this must be accepted -- a regression + * guard against reinstating a device/host-only mutual exclusion. + */ + qtest_start(QEMU_CFMW + ",cxl-fmw.0.device-coherent=3Don,cxl-fmw.0.host-only=3Don"= ); + qtest_end(); +} + +static void cxl_cfmw_volatile_only(void) +{ + qtest_start(QEMU_CFMW ",cxl-fmw.0.persistent=3Doff"); + qtest_end(); +} + +static void cxl_cfmw_persistent_only(void) +{ + qtest_start(QEMU_CFMW ",cxl-fmw.0.volatile=3Doff"); + qtest_end(); +} + +/* Two windows in one VM: a Back-Invalidate window and a host-only window.= */ +static void cxl_cfmw_two_windows(void) +{ + qtest_start("-machine q35,cxl=3Don " + "-device pxb-cxl,id=3Dcxl.0,bus=3Dpcie.0,bus_nr=3D52 " + "-device pxb-cxl,id=3Dcxl.1,bus=3Dpcie.0,bus_nr=3D53 " + QEMU_RP QEMU_T3D_VMEM + "-M cxl-fmw.0.targets.0=3Dcxl.0,cxl-fmw.0.size=3D4G," + "cxl-fmw.0.back-invalidate=3Don," + "cxl-fmw.1.targets.0=3Dcxl.1,cxl-fmw.1.size=3D4G"); + qtest_end(); +} + #ifdef CONFIG_POSIX static void cxl_t3d_deprecated(void) { @@ -233,6 +315,19 @@ int main(int argc, char **argv) qtest_add_func("/pci/cxl/pxb_x2_with_window", cxl_2pxb_with_window= ); qtest_add_func("/pci/cxl/rp", cxl_root_port); qtest_add_func("/pci/cxl/rp_x2", cxl_2root_port); + qtest_add_func("/pci/cxl/cfmw/default", cxl_cfmw_default); + qtest_add_func("/pci/cxl/cfmw/host_only_off", cxl_cfmw_host_only_o= ff); + qtest_add_func("/pci/cxl/cfmw/device_coherent_off", + cxl_cfmw_device_coherent_off); + qtest_add_func("/pci/cxl/cfmw/back_invalidate", + cxl_cfmw_back_invalidate); + qtest_add_func("/pci/cxl/cfmw/fixed_config", cxl_cfmw_fixed_config= ); + qtest_add_func("/pci/cxl/cfmw/device_and_host", + cxl_cfmw_device_and_host); + qtest_add_func("/pci/cxl/cfmw/volatile_only", cxl_cfmw_volatile_on= ly); + qtest_add_func("/pci/cxl/cfmw/persistent_only", + cxl_cfmw_persistent_only); + qtest_add_func("/pci/cxl/cfmw/two_windows", cxl_cfmw_two_windows); #ifdef CONFIG_POSIX qtest_add_func("/pci/cxl/type3_device", cxl_t3d_deprecated); qtest_add_func("/pci/cxl/type3_device_pmem", cxl_t3d_persistent); --=20 2.39.5