From nobody Mon Nov 25 09:58:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1716545289; cv=none; d=zohomail.com; s=zohoarc; b=KuLFYeSAwbs9aUH0N5yCFVl35L6zyni/gCLGR0oR0MUt+g/dsM4yyNY5OpdCENkenPru0heTwqi8AnJ7VVZOvuLs/6VY9RwfEj87hF4s4IJuLgjKlfVa7mJOQpZk8o8gCeTpj8ZQt2pe/nqRiuVbVN75VCfAX+Hh2ycEP5PrhAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716545289; h=Content-Type: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:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=78koXdj0DF801ycvenMx+wZVx1tq0irkczIDjADu2yM=; b=VsO9oQW0JakxxfdqL7BM89HyBwkyh8uaka42eJAf0VM1wQjWYPbHf2dR4TkvevoAbDK/9e00vZYrLGzpobpT8RMyivULmK7oCZDoY1oZ2+18p6jS3Wccj8GRyZdZJMK6E3xqkR9TLYxNz7/w5hJnksJFBxNZ3JvpRW0CTTgQxE8= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 1716545289454469.2771283629521; Fri, 24 May 2024 03:08:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sARq0-0001Y8-4p; Fri, 24 May 2024 06:07:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sARpx-0001Rg-P8 for qemu-devel@nongnu.org; Fri, 24 May 2024 06:07:45 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sARpv-0007a4-LG for qemu-devel@nongnu.org; Fri, 24 May 2024 06:07:45 -0400 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Vm10n1DXKz6K9Bl; Fri, 24 May 2024 18:06:49 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id D4B2A140B35; Fri, 24 May 2024 18:07:41 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 24 May 2024 11:07:41 +0100 To: , Markus Armbruster , , , , CC: Dave Jiang , Huang Ying , Paolo Bonzini , , , , , Michael Roth , Ani Sinha Subject: [PATCH v2 5/6] bios-tables-test: Add complex SRAT / HMAT test for GI GP Date: Fri, 24 May 2024 11:05:06 +0100 Message-ID: <20240524100507.32106-6-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240524100507.32106-1-Jonathan.Cameron@huawei.com> References: <20240524100507.32106-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.247.231] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) 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=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Reply-to: Jonathan Cameron From: Jonathan Cameron via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1716545291066100003 Content-Type: text/plain; charset="utf-8" Add a test with 6 nodes to exercise most interesting corner cases of SRAT and HMAT generation including the new Generic Initiator and Generic Port Affinity structures. More details of the set up in the following patch adding the table data. Signed-off-by: Jonathan Cameron --- tests/qtest/bios-tables-test.c | 92 ++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index d1ff4db7a2..1651d06b7b 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1862,6 +1862,96 @@ static void test_acpi_q35_tcg_acpi_hmat_noinitiator(= void) free_test_data(&data); } =20 +/* Test intended to hit corner cases of SRAT and HMAT */ +static void test_acpi_q35_tcg_acpi_hmat_generic_x(void) +{ + test_data data =3D {}; + + data.machine =3D MACHINE_Q35; + data.variant =3D ".acpihmat-generic-x"; + test_acpi_one(" -machine hmat=3Don,cxl=3Don" + " -smp 3,sockets=3D3" + " -m 128M,maxmem=3D384M,slots=3D2" + " -device virtio-rng-pci,id=3Dgidev" + " -device pxb-cxl,bus_nr=3D64,bus=3Dpcie.0,id=3Dcxl.1" + " -object memory-backend-ram,size=3D64M,id=3Dram0" + " -object memory-backend-ram,size=3D64M,id=3Dram1" + " -numa node,nodeid=3D0,cpus=3D0,memdev=3Dram0" + " -numa node,nodeid=3D1" + " -object acpi-generic-initiator,id=3Dgi0,pci-dev=3Dgide= v,node=3D1" + " -numa node,nodeid=3D2" + " -object acpi-generic-port,id=3Dgp0,pci-bus=3Dcxl.1,nod= e=3D2" + " -numa node,nodeid=3D3,cpus=3D1" + " -numa node,nodeid=3D4,memdev=3Dram1" + " -numa node,nodeid=3D5,cpus=3D2" + " -numa hmat-lb,initiator=3D0,target=3D0,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D10" + " -numa hmat-lb,initiator=3D0,target=3D0,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D800M" + " -numa hmat-lb,initiator=3D0,target=3D2,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D100" + " -numa hmat-lb,initiator=3D0,target=3D2,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D200M" + " -numa hmat-lb,initiator=3D0,target=3D4,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D100" + " -numa hmat-lb,initiator=3D0,target=3D4,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D200M" + " -numa hmat-lb,initiator=3D0,target=3D5,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D200" + " -numa hmat-lb,initiator=3D0,target=3D5,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D400M" + " -numa hmat-lb,initiator=3D1,target=3D0,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D500" + " -numa hmat-lb,initiator=3D1,target=3D0,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D100M" + " -numa hmat-lb,initiator=3D1,target=3D2,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D50" + " -numa hmat-lb,initiator=3D1,target=3D2,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D400M" + " -numa hmat-lb,initiator=3D1,target=3D4,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D50" + " -numa hmat-lb,initiator=3D1,target=3D4,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D800M" + " -numa hmat-lb,initiator=3D1,target=3D5,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D500" + " -numa hmat-lb,initiator=3D1,target=3D5,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D100M" + " -numa hmat-lb,initiator=3D3,target=3D0,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D20" + " -numa hmat-lb,initiator=3D3,target=3D0,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D400M" + " -numa hmat-lb,initiator=3D3,target=3D2,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D80" + " -numa hmat-lb,initiator=3D3,target=3D2,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D200M" + " -numa hmat-lb,initiator=3D3,target=3D4,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D80" + " -numa hmat-lb,initiator=3D3,target=3D4,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D200M" + " -numa hmat-lb,initiator=3D3,target=3D5,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D20" + " -numa hmat-lb,initiator=3D3,target=3D5,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D400M" + " -numa hmat-lb,initiator=3D5,target=3D0,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D20" + " -numa hmat-lb,initiator=3D5,target=3D0,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D400M" + " -numa hmat-lb,initiator=3D5,target=3D2,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D80" + " -numa hmat-lb,initiator=3D5,target=3D4,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D200M" + " -numa hmat-lb,initiator=3D5,target=3D4,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D80" + " -numa hmat-lb,initiator=3D5,target=3D2,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D200M" + " -numa hmat-lb,initiator=3D5,target=3D5,hierarchy=3Dmem= ory," + "data-type=3Daccess-latency,latency=3D10" + " -numa hmat-lb,initiator=3D5,target=3D5,hierarchy=3Dmem= ory," + "data-type=3Daccess-bandwidth,bandwidth=3D800M", + &data); + free_test_data(&data); +} + #ifdef CONFIG_POSIX static void test_acpi_erst(const char *machine) { @@ -2304,6 +2394,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/nohpet", test_acpi_q35_tcg_nohpet); qtest_add_func("acpi/q35/acpihmat-noinitiator", test_acpi_q35_tcg_acpi_hmat_noinitiator); + qtest_add_func("acpi/q35/acpihmat-genericx", + test_acpi_q35_tcg_acpi_hmat_generic_x); =20 /* i386 does not support memory hotplug */ if (strcmp(arch, "i386")) { --=20 2.39.2