From nobody Thu Dec 18 14:44:53 2025 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652701585; cv=none; d=zohomail.com; s=zohoarc; b=Vke3OHbWINBnGjOr1PR3lrXc8ERJxg9St8oYmv++TQDfXMI/pxWcvKfRoYIsfcbyt4PUGXdaJegb+tCMsUZFdqFKGqG3uSAaF+HifxQaGeCE1MZm1l7BJljO6fd9f7phV3AdQ57YTCxGyJIFOsR40RJqT/D5C6MLi/9PkSfdrOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652701585; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hmAqjrNwcz/n9dDfLQEkci2IFR8H57pNgW0hXHwtPIo=; b=cqNbuhHAPEtThyvRcG7eXGdZNR8FH0w+YvFvQl+28LhsA7IcuMkLQ/rFgQxfdTdfYmxfmIUHiOUkYdZsw5Vr9o6cmBa2LTE2XS/ONueMzTe+D+9TlP6fkBUNmIDE2rytj2YmIzSlFS+QxcfRGWzhmlNYS3m8JwGEAPggWQAHXZM= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652701585383360.1923999428069; Mon, 16 May 2022 04:46:25 -0700 (PDT) Received: from localhost ([::1]:59428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqZBA-0008SU-9K for importer@patchew.org; Mon, 16 May 2022 07:46:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqY6z-0007Z9-9i for qemu-devel@nongnu.org; Mon, 16 May 2022 06:38:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqY6x-0005QQ-O1 for qemu-devel@nongnu.org; Mon, 16 May 2022 06:38:01 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-478-Y7F5SOsjMjivHXJFYviewA-1; Mon, 16 May 2022 06:37:58 -0400 Received: by mail-wm1-f71.google.com with SMTP id m26-20020a7bcb9a000000b0039455e871b6so5437349wmi.8 for ; Mon, 16 May 2022 03:37:58 -0700 (PDT) Received: from redhat.com ([2.55.141.66]) by smtp.gmail.com with ESMTPSA id q22-20020adfb196000000b0020cfed0bb7fsm5781451wra.53.2022.05.16.03.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 03:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652697479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hmAqjrNwcz/n9dDfLQEkci2IFR8H57pNgW0hXHwtPIo=; b=aNnNpIWI8ADZ2h80m4b8FEhnnI/APuDdBuuVF/2WmJ+THG1/I59lngR/lzISer8AjEstlw CzOsYFCOOQuVlvLlzKkGSDLCOAPl+0wfNpTyc6EP5lhLSX9EMBbdNm/KHF2rfmIPQpEnKn aNYAzK5ZBLzeherCAZSCvyj/9yhGe1E= X-MC-Unique: Y7F5SOsjMjivHXJFYviewA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hmAqjrNwcz/n9dDfLQEkci2IFR8H57pNgW0hXHwtPIo=; b=pqC7dnMZf/w3hSwK6bSMP6ZJiUOiRb/ncDDWIy1h2gEMLTAQvQGY4PLRje4lchqTGC UdoVTX4dbazSYoyk3bvSkF77+LnWzgysxr3iiIadhAMmP6lNCUjl/HX6yNV7dIH2+p8t KJoeB+W3hDIQLTcQyo0AuJ2b/kKOHmiX+yvurGwrK/EqAYOWzU/wtouOmW86FNGx39XL 5itMQ695QyLb5e0RJ3NdGtdxga6jvYFhWoqkw5to8Fp4oBe/LEfBkBTOzVyZ20Q1RCyl Uy780pOQqcXyQZ4yew4YkQzolkihS8l0mihP5eRrIXEEa6pZHFQUOEbWPDuDy8g/8PG4 yQVw== X-Gm-Message-State: AOAM5318NhlzYHz1U6MI9dEE3+vPL+v9oY3ts8ooSPQBOXHednGU+y1L FQuBFyzyVBuWdhn7SAix6V32WlNQQ1xfGv/M81UWDL3RgkvhbtOEqQ7gYMDi35Ljj9IgVuarYkB UQ21nxmdxsxMd/wkJpWPQ0OH9ccecH0waM1VfiPA/hD+uyN3PRSqCqE9RvSO0 X-Received: by 2002:adf:dd8a:0:b0:20d:ff7:ce01 with SMTP id x10-20020adfdd8a000000b0020d0ff7ce01mr1065719wrl.242.1652697476707; Mon, 16 May 2022 03:37:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTPMLgGnu4kL1uVx3zKVe1R9fQqlLQ+akagqjyYw8FYmiv9Gfd1k+IQoDcZguaEDsoSu41aA== X-Received: by 2002:adf:dd8a:0:b0:20d:ff7:ce01 with SMTP id x10-20020adfdd8a000000b0020d0ff7ce01mr1065703wrl.242.1652697476458; Mon, 16 May 2022 03:37:56 -0700 (PDT) Date: Mon, 16 May 2022 06:37:53 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Igor Mammedov , Ani Sinha Subject: [PULL 39/91] qtests/bios-tables-test: Add a test for CXL emulation. Message-ID: <20220516095448.507876-40-mst@redhat.com> References: <20220516095448.507876-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220516095448.507876-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652701586835100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jonathan Cameron The DSDT includes several CXL specific elements and the CEDT table is only present if we enable CXL. The test exercises all current functionality with several CFMWS, CHBS structures in CEDT and ACPI0016/ACPI00017 and _OSC entries in DSDT. Signed-off-by: Jonathan Cameron Message-Id: <20220429144110.25167-38-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 5dddedabcd..a4a46e97f0 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1536,6 +1536,49 @@ static void test_acpi_q35_viot(void) free_test_data(&data); } =20 +static void test_acpi_q35_cxl(void) +{ + gchar *tmp_path =3D g_dir_make_tmp("qemu-test-cxl.XXXXXX", NULL); + gchar *params; + + test_data data =3D { + .machine =3D MACHINE_Q35, + .variant =3D ".cxl", + }; + /* + * A complex CXL setup. + */ + params =3D g_strdup_printf(" -machine cxl=3Don" + " -object memory-backend-file,id=3Dcxl-mem1,m= em-path=3D%s,size=3D256M" + " -object memory-backend-file,id=3Dcxl-mem2,m= em-path=3D%s,size=3D256M" + " -object memory-backend-file,id=3Dcxl-mem3,m= em-path=3D%s,size=3D256M" + " -object memory-backend-file,id=3Dcxl-mem4,m= em-path=3D%s,size=3D256M" + " -object memory-backend-file,id=3Dlsa1,mem-p= ath=3D%s,size=3D256M" + " -object memory-backend-file,id=3Dlsa2,mem-p= ath=3D%s,size=3D256M" + " -object memory-backend-file,id=3Dlsa3,mem-p= ath=3D%s,size=3D256M" + " -object memory-backend-file,id=3Dlsa4,mem-p= ath=3D%s,size=3D256M" + " -device pxb-cxl,bus_nr=3D12,bus=3Dpcie.0,id= =3Dcxl.1" + " -device pxb-cxl,bus_nr=3D222,bus=3Dpcie.0,i= d=3Dcxl.2" + " -device cxl-rp,port=3D0,bus=3Dcxl.1,id=3Drp= 1,chassis=3D0,slot=3D2" + " -device cxl-type3,bus=3Drp1,memdev=3Dcxl-me= m1,lsa=3Dlsa1" + " -device cxl-rp,port=3D1,bus=3Dcxl.1,id=3Drp= 2,chassis=3D0,slot=3D3" + " -device cxl-type3,bus=3Drp2,memdev=3Dcxl-me= m2,lsa=3Dlsa2" + " -device cxl-rp,port=3D0,bus=3Dcxl.2,id=3Drp= 3,chassis=3D0,slot=3D5" + " -device cxl-type3,bus=3Drp3,memdev=3Dcxl-me= m3,lsa=3Dlsa3" + " -device cxl-rp,port=3D1,bus=3Dcxl.2,id=3Drp= 4,chassis=3D0,slot=3D6" + " -device cxl-type3,bus=3Drp4,memdev=3Dcxl-me= m4,lsa=3Dlsa4" + " -cxl-fixed-memory-window targets.0=3Dcxl.1,= size=3D4G,interleave-granularity=3D8k" + " -cxl-fixed-memory-window targets.0=3Dcxl.1,= targets.1=3Dcxl.2,size=3D4G,interleave-granularity=3D8k", + tmp_path, tmp_path, tmp_path, tmp_path, + tmp_path, tmp_path, tmp_path, tmp_path); + test_acpi_one(params, &data); + + g_free(params); + g_assert(g_rmdir(tmp_path) =3D=3D 0); + g_free(tmp_path); + free_test_data(&data); +} + static void test_acpi_virt_viot(void) { test_data data =3D { @@ -1741,6 +1784,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar); } qtest_add_func("acpi/q35/viot", test_acpi_q35_viot); + qtest_add_func("acpi/q35/cxl", test_acpi_q35_cxl); qtest_add_func("acpi/q35/slic", test_acpi_q35_slic); } else if (strcmp(arch, "aarch64") =3D=3D 0) { if (has_tcg) { --=20 MST