From nobody Mon Nov 25 07:54:50 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=1716545163; cv=none; d=zohomail.com; s=zohoarc; b=Ffm1zclbkQeCtb5j+L7nbH932BRfEfP1WSRo/e9nRWcPmLKibpaDNaT5TPEQ0iYTartyVV+wwOuS84EVwyw5OO42vZHMpfU62tQruM3BaU3o/Q7QPl+2TxSfljHnBI2yooUkasA2TPdwoUwotghNVW2NaHcAsSdgJ0rPkdkBKvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716545163; 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=7OgOWNOff4YWnyEFo2jhHZB+xLurx/D7TFvo+i9+dXU=; b=M2UrKWPLRtzmkWiegwLUDVRkNA7UTrqN+fHrIG7bFfLHt6CXaVWxzHFX0etpsxY0MxcIGfBbMyqizvVgBcXxoFJhLQd91WdtdAhB6UmGeYhYJ7/3SC0l52qtTkT2cA3DxUtFkeMbc2hO6rxkSub5O7lHW1U9WkRDGkDVrmUBWhw= 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 1716545163032712.0143135492535; Fri, 24 May 2024 03:06:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sARo0-00078E-UP; Fri, 24 May 2024 06:05:44 -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 1sARnz-00077j-MK for qemu-devel@nongnu.org; Fri, 24 May 2024 06:05:43 -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 1sARny-00075W-0b for qemu-devel@nongnu.org; Fri, 24 May 2024 06:05:43 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Vm0v64RmYz6JBVs; Fri, 24 May 2024 18:01:54 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 3F15D140B54; Fri, 24 May 2024 18:05:39 +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:05:38 +0100 To: , Markus Armbruster , , , , CC: Dave Jiang , Huang Ying , Paolo Bonzini , , , , , Michael Roth , Ani Sinha Subject: [PATCH v2 1/6] hw/acpi/GI: Fix trivial parameter alignment issue. Date: Fri, 24 May 2024 11:05:02 +0100 Message-ID: <20240524100507.32106-2-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: 1716545164489100003 Content-Type: text/plain; charset="utf-8" Before making additional modification, tidy up this misleading indentation. Reviewed-by: Ankit Agrawal Signed-off-by: Jonathan Cameron --- hw/acpi/acpi_generic_initiator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initia= tor.c index 17b9a052f5..18a939b0e5 100644 --- a/hw/acpi/acpi_generic_initiator.c +++ b/hw/acpi/acpi_generic_initiator.c @@ -132,7 +132,7 @@ static int build_all_acpi_generic_initiators(Object *ob= j, void *opaque) =20 dev_handle.segment =3D 0; dev_handle.bdf =3D PCI_BUILD_BDF(pci_bus_num(pci_get_bus(pci_dev)), - pci_dev->devfn); + pci_dev->devfn); =20 build_srat_generic_pci_initiator_affinity(table_data, gi->node, &dev_handle); --=20 2.39.2 From nobody Mon Nov 25 07:54:50 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=1716545216; cv=none; d=zohomail.com; s=zohoarc; b=iyKyqDn6gOUKU9aYpHqrYP8/pSqHFwU85tyH/JbYAj9fI8HOA/Wnrriy+8bkSCpMcTgHjdSJlv9EJ8XXvoQkEpXSFXLmvYg/Aueogk0RHRzOuRvfHB9sCNHcepcUZ82RuH6W6hg/jNj4eUTjbsmtIn9JgH9FP/qL3n7CIiFwwTM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716545216; 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=WT343yttPTo5TTD5CRiLSQqNck1hW7+V87a942iSxoM=; b=D8WS6GS5t0DyGG3xpbIb+35e1AGDAM4Q1gTRTGQ8Wj1Tpb6fQd7UPUzPI9jlUONQOdGkxI5dNlYybfMu71JTT2REbpkfOQtNPC2WRRUfqvFhzn774NaudCn/EM2S9od7hvxX8pHNaMekdaGf1mEbYwwgyL7aRR0YHW0Z9zUsH3Q= 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 1716545216342635.4819806993148; Fri, 24 May 2024 03:06:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sARoz-0008Pk-5d; Fri, 24 May 2024 06:06:45 -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 1sARoU-0008LF-RP for qemu-devel@nongnu.org; Fri, 24 May 2024 06:06:43 -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 1sARoR-0007DY-Vu for qemu-devel@nongnu.org; Fri, 24 May 2024 06:06:14 -0400 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Vm0vj2jYqz6JBV9; Fri, 24 May 2024 18:02:25 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id ECA3F1400C9; Fri, 24 May 2024 18:06:09 +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:06:09 +0100 To: , Markus Armbruster , , , , CC: Dave Jiang , Huang Ying , Paolo Bonzini , , , , , Michael Roth , Ani Sinha Subject: [PATCH v2 2/6] hw/acpi: Insert an acpi-generic-node base under acpi-generic-initiator Date: Fri, 24 May 2024 11:05:03 +0100 Message-ID: <20240524100507.32106-3-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: 1716545216841100001 Content-Type: text/plain; charset="utf-8" This will simplify reuse when adding acpi-generic-port. Note that some error_printf() messages will now print acpi-generic-node whereas others will move to type specific cases in next patch so are left alone for now. Signed-off-by: Jonathan Cameron --- v2: Fix a typo in comment. --- include/hw/acpi/acpi_generic_initiator.h | 15 ++++- hw/acpi/acpi_generic_initiator.c | 78 +++++++++++++++--------- 2 files changed, 62 insertions(+), 31 deletions(-) diff --git a/include/hw/acpi/acpi_generic_initiator.h b/include/hw/acpi/acp= i_generic_initiator.h index a304bad73e..dd4be19c8f 100644 --- a/include/hw/acpi/acpi_generic_initiator.h +++ b/include/hw/acpi/acpi_generic_initiator.h @@ -8,15 +8,26 @@ =20 #include "qom/object_interfaces.h" =20 -#define TYPE_ACPI_GENERIC_INITIATOR "acpi-generic-initiator" +/* + * Abstract type to be used as base for + * - acpi-generic-initiator + * - acpi-generic-port + */ +#define TYPE_ACPI_GENERIC_NODE "acpi-generic-node" =20 -typedef struct AcpiGenericInitiator { +typedef struct AcpiGenericNode { /* private */ Object parent; =20 /* public */ char *pci_dev; uint16_t node; +} AcpiGenericNode; + +#define TYPE_ACPI_GENERIC_INITIATOR "acpi-generic-initiator" + +typedef struct AcpiGenericInitiator { + AcpiGenericNode parent; } AcpiGenericInitiator; =20 /* diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initia= tor.c index 18a939b0e5..c054e0e27d 100644 --- a/hw/acpi/acpi_generic_initiator.c +++ b/hw/acpi/acpi_generic_initiator.c @@ -10,45 +10,61 @@ #include "hw/pci/pci_device.h" #include "qemu/error-report.h" =20 -typedef struct AcpiGenericInitiatorClass { +typedef struct AcpiGenericNodeClass { ObjectClass parent_class; +} AcpiGenericNodeClass; + +typedef struct AcpiGenericInitiatorClass { + AcpiGenericNodeClass parent_class; } AcpiGenericInitiatorClass; =20 +OBJECT_DEFINE_ABSTRACT_TYPE(AcpiGenericNode, acpi_generic_node, + ACPI_GENERIC_NODE, OBJECT) + +OBJECT_DECLARE_SIMPLE_TYPE(AcpiGenericNode, ACPI_GENERIC_NODE) + OBJECT_DEFINE_TYPE_WITH_INTERFACES(AcpiGenericInitiator, acpi_generic_init= iator, - ACPI_GENERIC_INITIATOR, OBJECT, + ACPI_GENERIC_INITIATOR, ACPI_GENERIC_NODE, { TYPE_USER_CREATABLE }, { NULL }) =20 OBJECT_DECLARE_SIMPLE_TYPE(AcpiGenericInitiator, ACPI_GENERIC_INITIATOR) =20 +static void acpi_generic_node_init(Object *obj) +{ + AcpiGenericNode *gn =3D ACPI_GENERIC_NODE(obj); + + gn->node =3D MAX_NODES; + gn->pci_dev =3D NULL; +} + static void acpi_generic_initiator_init(Object *obj) { - AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); +} + +static void acpi_generic_node_finalize(Object *obj) +{ + AcpiGenericNode *gn =3D ACPI_GENERIC_NODE(obj); =20 - gi->node =3D MAX_NODES; - gi->pci_dev =3D NULL; + g_free(gn->pci_dev); } =20 static void acpi_generic_initiator_finalize(Object *obj) { - AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); - - g_free(gi->pci_dev); } =20 -static void acpi_generic_initiator_set_pci_device(Object *obj, const char = *val, - Error **errp) +static void acpi_generic_node_set_pci_device(Object *obj, const char *val, + Error **errp) { - AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); + AcpiGenericNode *gn =3D ACPI_GENERIC_NODE(obj); =20 - gi->pci_dev =3D g_strdup(val); + gn->pci_dev =3D g_strdup(val); } - -static void acpi_generic_initiator_set_node(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void acpi_generic_node_set_node(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { - AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); + AcpiGenericNode *gn =3D ACPI_GENERIC_NODE(obj); MachineState *ms =3D MACHINE(qdev_get_machine()); uint32_t value; =20 @@ -58,20 +74,24 @@ static void acpi_generic_initiator_set_node(Object *obj= , Visitor *v, =20 if (value >=3D MAX_NODES) { error_printf("%s: Invalid NUMA node specified\n", - TYPE_ACPI_GENERIC_INITIATOR); + TYPE_ACPI_GENERIC_NODE); exit(1); } =20 - gi->node =3D value; - ms->numa_state->nodes[gi->node].has_gi =3D true; + gn->node =3D value; + ms->numa_state->nodes[gn->node].has_gi =3D true; } =20 -static void acpi_generic_initiator_class_init(ObjectClass *oc, void *data) +static void acpi_generic_node_class_init(ObjectClass *oc, void *data) { object_class_property_add_str(oc, "pci-dev", NULL, - acpi_generic_initiator_set_pci_device); + acpi_generic_node_set_pci_device); object_class_property_add(oc, "node", "int", NULL, - acpi_generic_initiator_set_node, NULL, NULL); + acpi_generic_node_set_node, NULL, NULL); +} + +static void acpi_generic_initiator_class_init(ObjectClass *oc, void *data) +{ } =20 /* @@ -104,9 +124,9 @@ build_srat_generic_pci_initiator_affinity(GArray *table= _data, int node, static int build_all_acpi_generic_initiators(Object *obj, void *opaque) { MachineState *ms =3D MACHINE(qdev_get_machine()); - AcpiGenericInitiator *gi; GArray *table_data =3D opaque; PCIDeviceHandle dev_handle; + AcpiGenericNode *gn; PCIDevice *pci_dev; Object *o; =20 @@ -114,14 +134,14 @@ static int build_all_acpi_generic_initiators(Object *= obj, void *opaque) return 0; } =20 - gi =3D ACPI_GENERIC_INITIATOR(obj); - if (gi->node >=3D ms->numa_state->num_nodes) { + gn =3D ACPI_GENERIC_NODE(obj); + if (gn->node >=3D ms->numa_state->num_nodes) { error_printf("%s: Specified node %d is invalid.\n", - TYPE_ACPI_GENERIC_INITIATOR, gi->node); + TYPE_ACPI_GENERIC_INITIATOR, gn->node); exit(1); } =20 - o =3D object_resolve_path_type(gi->pci_dev, TYPE_PCI_DEVICE, NULL); + o =3D object_resolve_path_type(gn->pci_dev, TYPE_PCI_DEVICE, NULL); if (!o) { error_printf("%s: Specified device must be a PCI device.\n", TYPE_ACPI_GENERIC_INITIATOR); @@ -135,7 +155,7 @@ static int build_all_acpi_generic_initiators(Object *ob= j, void *opaque) pci_dev->devfn); =20 build_srat_generic_pci_initiator_affinity(table_data, - gi->node, &dev_handle); + gn->node, &dev_handle); =20 return 0; } --=20 2.39.2 From nobody Mon Nov 25 07:54:50 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=1716545247; cv=none; d=zohomail.com; s=zohoarc; b=Dc3NdBLMq8bBbQ3RB31rkDa5uXPAnO6e1DgOVQDh2PHr+gf92LezP8m6k5WhOkTMJCN3TAGdiXHq4eo5q36Ntw2uY4lZ4/szxS4iuAE/Enf8XbXfHOYr9OeLFAa/+VxzaAYpS+83ANMnBvCTq7tFKDFW2a6WxaUDAjRe9nIw7u4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716545247; 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=dWPdOFWrLHILQ6Kug+F2/FGd4jFthzJREe2U1i5xvy0=; b=PJY35pVaUkr+pqvgEu8HGGjeSao3PMM7SOGZYWRd7TDJBgllaOGN70tfLDpp/nPS2TwyT40X7sooMwXwaF0KHKKpqu4M+qCUsQf3StXTUy7AiBb/crOo3VwtobRr48SBPqARMAuuSwqDiEGaznb4RIQUchjOWdoXE8aekN2de6I= 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 1716545247104744.9643362282554; Fri, 24 May 2024 03:07:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sARpU-0000RU-7d; Fri, 24 May 2024 06:07:16 -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 1sARpQ-0000NP-Ik for qemu-devel@nongnu.org; Fri, 24 May 2024 06:07:12 -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 1sARpK-0007Tt-Ox for qemu-devel@nongnu.org; Fri, 24 May 2024 06:07:12 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Vm0zc0bqsz6K6J4; Fri, 24 May 2024 18:05:48 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id BF024140B54; Fri, 24 May 2024 18:06:40 +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:06:40 +0100 To: , Markus Armbruster , , , , CC: Dave Jiang , Huang Ying , Paolo Bonzini , , , , , Michael Roth , Ani Sinha Subject: [PATCH v2 3/6] hw/acpi: Generic Port Affinity Structure support Date: Fri, 24 May 2024 11:05:04 +0100 Message-ID: <20240524100507.32106-4-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-Type: text/plain; charset="utf-8" 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: 1716545248874100003 These are very similar to the recently added Generic Initiators but instead of representing an initiator of memory traffic they represent an edge point beyond which may lie either targets or initiators. Here we add these ports such that they may be targets of hmat_lb records to describe the latency and bandwidth from host side initiators to the port. A descoverable mechanism such as UEFI CDAT read from CXL devices and switches is used to discover the remainder fo the path and the OS can build up full latency and bandwidth numbers as need for work and data placement decisions. Signed-off-by: Jonathan Cameron Acked-by: Markus Armbruster --- v2: Updates to QMP documentation to provide a lot more information on the parameters. --- qapi/qom.json | 35 ++++++ include/hw/acpi/acpi_generic_initiator.h | 18 ++- include/hw/pci/pci_bridge.h | 1 + hw/acpi/acpi_generic_initiator.c | 141 +++++++++++++++++------ hw/pci-bridge/pci_expander_bridge.c | 1 - 5 files changed, 158 insertions(+), 38 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index 38dde6d785..9d1d86bdad 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -826,6 +826,39 @@ 'data': { 'pci-dev': 'str', 'node': 'uint32' } } =20 + +## +# @AcpiGenericPortProperties: +# +# Properties for acpi-generic-port objects. +# +# @pci-bus: QOM path of the PCI bus of the hostbridge associated with +# this SRAT Generic Port Affinity Structure. This is the same as +# the bus parameter for the root ports attached to this host bridge. +# The resulting SRAT Generic Port Affinity Structure will refer to +# the ACPI object in DSDT that represents the host bridge (e.g. +# ACPI0016 for CXL host bridges.) See ACPI 6.5 Section 5.2.16.7 for +# more information. +# +# @node: Similar to a NUMA node ID, but instead of providing a reference +# point used for defining NUMA distances and access characteristics +# to memory or from an initiator (e.g. CPU), this node defines the +# boundary point between non-discoverable system buses which must be +# described by firmware, and a discoverable bus. NUMA distances +# and access characteristics are defined to and from that point. +# For system software to establish full initiator to target +# characteristics this information must be combined with information +# retrieved from the discoverable part of the path. An example would +# use CDAT (see UEFI.org) information read from devices and switches +# in conjunction with link characteristics read from PCIe +# Configuration space. +# +# Since: 9.1 +## +{ 'struct': 'AcpiGenericPortProperties', + 'data': { 'pci-bus': 'str', + 'node': 'uint32' } } + ## # @RngProperties: # @@ -953,6 +986,7 @@ { 'enum': 'ObjectType', 'data': [ 'acpi-generic-initiator', + 'acpi-generic-port', 'authz-list', 'authz-listfile', 'authz-pam', @@ -1025,6 +1059,7 @@ 'discriminator': 'qom-type', 'data': { 'acpi-generic-initiator': 'AcpiGenericInitiatorProperties', + 'acpi-generic-port': 'AcpiGenericPortProperties', 'authz-list': 'AuthZListProperties', 'authz-listfile': 'AuthZListFileProperties', 'authz-pam': 'AuthZPAMProperties', diff --git a/include/hw/acpi/acpi_generic_initiator.h b/include/hw/acpi/acp= i_generic_initiator.h index dd4be19c8f..1a899af30f 100644 --- a/include/hw/acpi/acpi_generic_initiator.h +++ b/include/hw/acpi/acpi_generic_initiator.h @@ -30,6 +30,12 @@ typedef struct AcpiGenericInitiator { AcpiGenericNode parent; } AcpiGenericInitiator; =20 +#define TYPE_ACPI_GENERIC_PORT "acpi-generic-port" + +typedef struct AcpiGenericPort { + AcpiGenericInitiator parent; +} AcpiGenericPort; + /* * ACPI 6.3: * Table 5-81 Flags =E2=80=93 Generic Initiator Affinity Structure @@ -49,8 +55,16 @@ typedef enum { * Table 5-80 Device Handle - PCI */ typedef struct PCIDeviceHandle { - uint16_t segment; - uint16_t bdf; + union { + struct { + uint16_t segment; + uint16_t bdf; + }; + struct { + uint64_t hid; + uint32_t uid; + }; + }; } PCIDeviceHandle; =20 void build_srat_generic_pci_initiator(GArray *table_data); diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h index 5cd452115a..5456e24883 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -102,6 +102,7 @@ typedef struct PXBPCIEDev { PXBDev parent_obj; } PXBPCIEDev; =20 +#define TYPE_PXB_CXL_BUS "pxb-cxl-bus" #define TYPE_PXB_DEV "pxb" OBJECT_DECLARE_SIMPLE_TYPE(PXBDev, PXB_DEV) =20 diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initia= tor.c index c054e0e27d..85191e90ab 100644 --- a/hw/acpi/acpi_generic_initiator.c +++ b/hw/acpi/acpi_generic_initiator.c @@ -7,6 +7,7 @@ #include "hw/acpi/acpi_generic_initiator.h" #include "hw/acpi/aml-build.h" #include "hw/boards.h" +#include "hw/pci/pci_bridge.h" #include "hw/pci/pci_device.h" #include "qemu/error-report.h" =20 @@ -18,6 +19,10 @@ typedef struct AcpiGenericInitiatorClass { AcpiGenericNodeClass parent_class; } AcpiGenericInitiatorClass; =20 +typedef struct AcpiGenericPortClass { + AcpiGenericInitiatorClass parent; +} AcpiGenericPortClass; + OBJECT_DEFINE_ABSTRACT_TYPE(AcpiGenericNode, acpi_generic_node, ACPI_GENERIC_NODE, OBJECT) =20 @@ -30,6 +35,13 @@ OBJECT_DEFINE_TYPE_WITH_INTERFACES(AcpiGenericInitiator,= acpi_generic_initiator, =20 OBJECT_DECLARE_SIMPLE_TYPE(AcpiGenericInitiator, ACPI_GENERIC_INITIATOR) =20 +OBJECT_DEFINE_TYPE_WITH_INTERFACES(AcpiGenericPort, acpi_generic_port, + ACPI_GENERIC_PORT, ACPI_GENERIC_NODE, + { TYPE_USER_CREATABLE }, + { NULL }) + +OBJECT_DECLARE_SIMPLE_TYPE(AcpiGenericPort, ACPI_GENERIC_PORT) + static void acpi_generic_node_init(Object *obj) { AcpiGenericNode *gn =3D ACPI_GENERIC_NODE(obj); @@ -53,6 +65,14 @@ static void acpi_generic_initiator_finalize(Object *obj) { } =20 +static void acpi_generic_port_init(Object *obj) +{ +} + +static void acpi_generic_port_finalize(Object *obj) +{ +} + static void acpi_generic_node_set_pci_device(Object *obj, const char *val, Error **errp) { @@ -79,42 +99,61 @@ static void acpi_generic_node_set_node(Object *obj, Vis= itor *v, } =20 gn->node =3D value; - ms->numa_state->nodes[gn->node].has_gi =3D true; + if (object_dynamic_cast(obj, TYPE_ACPI_GENERIC_INITIATOR)) { + ms->numa_state->nodes[gn->node].has_gi =3D true; + } } =20 static void acpi_generic_node_class_init(ObjectClass *oc, void *data) { - object_class_property_add_str(oc, "pci-dev", NULL, - acpi_generic_node_set_pci_device); object_class_property_add(oc, "node", "int", NULL, acpi_generic_node_set_node, NULL, NULL); } =20 static void acpi_generic_initiator_class_init(ObjectClass *oc, void *data) { + object_class_property_add_str(oc, "pci-dev", NULL, + acpi_generic_node_set_pci_device); +} + +static void acpi_generic_port_class_init(ObjectClass *oc, void *data) +{ + /* + * Despite the ID representing a root bridge bus, same storage + * can be used. + */ + object_class_property_add_str(oc, "pci-bus", NULL, + acpi_generic_node_set_pci_device); } =20 /* * ACPI 6.3: * Table 5-78 Generic Initiator Affinity Structure + * ACPI 6.5: + * Table 5-67 Generic Port Affinity Structure */ static void -build_srat_generic_pci_initiator_affinity(GArray *table_data, int node, - PCIDeviceHandle *handle) +build_srat_generic_node_affinity(GArray *table_data, int node, + PCIDeviceHandle *handle, bool gp, bool pc= i) { - uint8_t index; - - build_append_int_noprefix(table_data, 5, 1); /* Type */ + build_append_int_noprefix(table_data, gp ? 6 : 5, 1); /* Type */ build_append_int_noprefix(table_data, 32, 1); /* Length */ build_append_int_noprefix(table_data, 0, 1); /* Reserved */ - build_append_int_noprefix(table_data, 1, 1); /* Device Handle Type: P= CI */ + /* Device Handle Type: PCI / ACPI */ + build_append_int_noprefix(table_data, pci ? 1 : 0, 1); build_append_int_noprefix(table_data, node, 4); /* Proximity Domain */ =20 /* Device Handle - PCI */ - build_append_int_noprefix(table_data, handle->segment, 2); - build_append_int_noprefix(table_data, handle->bdf, 2); - for (index =3D 0; index < 12; index++) { - build_append_int_noprefix(table_data, 0, 1); + if (pci) { + /* Device Handle - PCI */ + build_append_int_noprefix(table_data, handle->segment, 2); + build_append_int_noprefix(table_data, handle->bdf, 2); + build_append_int_noprefix(table_data, 0, 12); + } else { + /* Device Handle - ACPI */ + build_append_int_noprefix(table_data, handle->hid, 8); + build_append_int_noprefix(table_data, handle->uid, 4); + build_append_int_noprefix(table_data, 0, 4); } =20 build_append_int_noprefix(table_data, GEN_AFFINITY_ENABLED, 4); /* Fla= gs */ @@ -127,37 +166,69 @@ static int build_all_acpi_generic_initiators(Object *= obj, void *opaque) GArray *table_data =3D opaque; PCIDeviceHandle dev_handle; AcpiGenericNode *gn; - PCIDevice *pci_dev; Object *o; =20 - if (!object_dynamic_cast(obj, TYPE_ACPI_GENERIC_INITIATOR)) { + if (!object_dynamic_cast(obj, TYPE_ACPI_GENERIC_NODE)) { return 0; } =20 gn =3D ACPI_GENERIC_NODE(obj); - if (gn->node >=3D ms->numa_state->num_nodes) { - error_printf("%s: Specified node %d is invalid.\n", - TYPE_ACPI_GENERIC_INITIATOR, gn->node); - exit(1); - } =20 - o =3D object_resolve_path_type(gn->pci_dev, TYPE_PCI_DEVICE, NULL); - if (!o) { - error_printf("%s: Specified device must be a PCI device.\n", - TYPE_ACPI_GENERIC_INITIATOR); - exit(1); - } - - pci_dev =3D PCI_DEVICE(o); - - dev_handle.segment =3D 0; - dev_handle.bdf =3D PCI_BUILD_BDF(pci_bus_num(pci_get_bus(pci_dev)), - pci_dev->devfn); + if (object_dynamic_cast(OBJECT(gn), TYPE_ACPI_GENERIC_INITIATOR)) { + PCIDevice *pci_dev; + + if (gn->node >=3D ms->numa_state->num_nodes) { + error_printf("%s: Specified node %d is invalid.\n", + TYPE_ACPI_GENERIC_INITIATOR, gn->node); + exit(1); + } + + o =3D object_resolve_path_type(gn->pci_dev, TYPE_PCI_DEVICE, NULL); + if (!o) { + error_printf("%s: Specified device must be a PCI device.\n", + TYPE_ACPI_GENERIC_INITIATOR); + exit(1); + } + pci_dev =3D PCI_DEVICE(o); + + dev_handle.segment =3D 0; + dev_handle.bdf =3D PCI_BUILD_BDF(pci_bus_num(pci_get_bus(pci_dev)), + pci_dev->devfn); + build_srat_generic_node_affinity(table_data, + gn->node, &dev_handle, false, tru= e); =20 - build_srat_generic_pci_initiator_affinity(table_data, - gn->node, &dev_handle); + return 0; + } else { /* TYPE_ACPI_GENERIC_PORT */ + PCIBus *bus; + const char *hid =3D "ACPI0016"; + + if (gn->node >=3D ms->numa_state->num_nodes) { + error_printf("%s: Specified node %d is invalid.\n", + TYPE_ACPI_GENERIC_PORT, gn->node); + exit(1); + } + + o =3D object_resolve_path_type(gn->pci_dev, TYPE_PCI_BUS, NULL); + if (!o) { + error_printf("%s: Specified device must be a PCI Host Bridge.\= n", + TYPE_ACPI_GENERIC_PORT); + exit(1); + } + bus =3D PCI_BUS(o); + /* Need to know if this is a PXB Bus so below an expander bridge */ + if (!object_dynamic_cast(OBJECT(bus), TYPE_PXB_CXL_BUS)) { + error_printf("%s: Specified device is not a bus below a host b= ridge.\n", + TYPE_ACPI_GENERIC_PORT); + exit(1); + } + /* Copy without trailing NULL */ + memcpy(&dev_handle.hid, hid, sizeof(dev_handle.hid)); + dev_handle.uid =3D pci_bus_num(bus); + build_srat_generic_node_affinity(table_data, + gn->node, &dev_handle, true, fals= e); =20 - return 0; + return 0; + } } =20 void build_srat_generic_pci_initiator(GArray *table_data) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index 0411ad31ea..f5431443b9 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -38,7 +38,6 @@ DECLARE_INSTANCE_CHECKER(PXBBus, PXB_BUS, DECLARE_INSTANCE_CHECKER(PXBBus, PXB_PCIE_BUS, TYPE_PXB_PCIE_BUS) =20 -#define TYPE_PXB_CXL_BUS "pxb-cxl-bus" DECLARE_INSTANCE_CHECKER(PXBBus, PXB_CXL_BUS, TYPE_PXB_CXL_BUS) =20 --=20 2.39.2 From nobody Mon Nov 25 07:54:50 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=1716545251; cv=none; d=zohomail.com; s=zohoarc; b=hcIRMLsCwKPjUw19LDBZ4n/PtTvxaqv5vEPX8QdDMwL7qtyrw9ZlUpVsdLzuT+bJ2PQ35NHvd9vzuLkMKrUETzxNWtcrC9rtPaJoRddjjqTNbqkUFnLcZKL7B+iFLLau593F3nntDDb0RCnnvVdAtKaB2/mEg3n48Jr4TcMusLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716545251; 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=NYAQA2+DkiOWlDADxbbibv18b02szj71zyVHRJ0TUH0=; b=RKCPuwlckmDs+ocHhNtzFlTx7r0TQ+4Tw9ADCEtmP5m9z1pjSRPTOnX3JkSG1DV9sx/yyObRElTu35+MUFKoaVgaqhYizRgW0LnRJ7utT8ZX78TT/KZ0yJxfb5RLrHCUm/edudyUGjZvGH4D1BqFef6GWrsFQpOPhkVWBmGymVw= 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 1716545251197813.539635190671; Fri, 24 May 2024 03:07:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sARpX-0000UW-PI; Fri, 24 May 2024 06:07:19 -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 1sARpU-0000Ru-8y for qemu-devel@nongnu.org; Fri, 24 May 2024 06:07:17 -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 1sARpS-0007Ul-3e for qemu-devel@nongnu.org; Fri, 24 May 2024 06:07:15 -0400 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Vm0wd5YTXz6K5sF; Fri, 24 May 2024 18:03:13 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 55F4D1400C9; Fri, 24 May 2024 18:07:11 +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:10 +0100 To: , Markus Armbruster , , , , CC: Dave Jiang , Huang Ying , Paolo Bonzini , , , , , Michael Roth , Ani Sinha Subject: [PATCH v2 4/6] bios-tables-test: Allow for new acpihmat-generic-x test data. Date: Fri, 24 May 2024 11:05:05 +0100 Message-ID: <20240524100507.32106-5-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: 1716545252767100003 Content-Type: text/plain; charset="utf-8" The test to be added exercises many corners of the SRAT and HMAT table generation. Signed-off-by: Jonathan Cameron --- tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++ tests/data/acpi/q35/APIC.acpihmat-generic-x | 0 tests/data/acpi/q35/CEDT.acpihmat-generic-x | 0 tests/data/acpi/q35/DSDT.acpihmat-generic-x | 0 tests/data/acpi/q35/HMAT.acpihmat-generic-x | 0 tests/data/acpi/q35/SRAT.acpihmat-generic-x | 0 6 files changed, 5 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..a5aa801c99 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,6 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/APIC.acpihmat-generic-x", +"tests/data/acpi/q35/CEDT.acpihmat-generic-x", +"tests/data/acpi/q35/DSDT.acpihmat-generic-x", +"tests/data/acpi/q35/HMAT.acpihmat-generic-x", +"tests/data/acpi/q35/SRAT.acpihmat-generic-x", diff --git a/tests/data/acpi/q35/APIC.acpihmat-generic-x b/tests/data/acpi/= q35/APIC.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/q35/CEDT.acpihmat-generic-x b/tests/data/acpi/= q35/CEDT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/q35/DSDT.acpihmat-generic-x b/tests/data/acpi/= q35/DSDT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/q35/HMAT.acpihmat-generic-x b/tests/data/acpi/= q35/HMAT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/q35/SRAT.acpihmat-generic-x b/tests/data/acpi/= q35/SRAT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 --=20 2.39.2 From nobody Mon Nov 25 07:54:50 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 From nobody Mon Nov 25 07:54:50 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=1716545310; cv=none; d=zohomail.com; s=zohoarc; b=VpEzK9e/Yv0XQpsewbjD1G7BPDJw68AXmrq4AXtzvSqB7hrv+aX8CJtwod506BdyQn0XUqdbwJP0MVbHyjB5P28NP4pcZde3uNKcZO/Oh++xbwG0w3+auYFQRPEziOQJCGz9zSLjUJ47lzjZ3Wx213iyFnDXsR1gLmFmGC+bkKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716545310; 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=hsvTG1asZyvyLEc5FjAJXy/MHLs9teOaFOYsbkcsYVU=; b=WzCYVncUUyFjMAUyBppxnES8r7brY/JBGarPxfjgE1EwLKkBaDbzzEoT7vLh7tVjQjuAEcLfOSb3Rlc8JS3IxjmBWdf50o5XVVBSkqyAzMjNtP9Czhq7yF18GpaSKKB8RaZh/A+mGKmmrZJHA1n6WVC5OZSHdZoJTN4RIp6gEAo= 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 17165453106331016.1761216314826; Fri, 24 May 2024 03:08:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sARqU-0002FH-Gr; Fri, 24 May 2024 06:08:18 -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 1sARqT-0002Cz-SY for qemu-devel@nongnu.org; Fri, 24 May 2024 06:08:17 -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 1sARqR-0007eV-42 for qemu-devel@nongnu.org; Fri, 24 May 2024 06:08:17 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Vm0xp5FNQz6K5xc; Fri, 24 May 2024 18:04:14 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 4ABF0140B54; Fri, 24 May 2024 18:08:12 +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:08:11 +0100 To: , Markus Armbruster , , , , CC: Dave Jiang , Huang Ying , Paolo Bonzini , , , , , Michael Roth , Ani Sinha Subject: [PATCH v2 6/6] bios-tables-test: Add data for complex numa test (GI, GP etc) Date: Fri, 24 May 2024 11:05:07 +0100 Message-ID: <20240524100507.32106-7-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: 1716545311115100001 Content-Type: text/plain; charset="utf-8" Given this is a new configuration, there are affects on APIC, CEDT and DSDT, but the key elements are in SRAT (plus related data in HMAT). The configuration has node to exercise many different combinations. 0) CPUs + Memory 1) GI only 2) GP only 3) CPUS only 4) Memory only 5) CPUs + HP memory GI node, GP Node, Memory only node, hotplug memory only node, latency and bandwidth such that in Linux Access0 (any initiator) and Access1 (CPU initiators only) given different answers. Following cropped to remove details of each entry. [000h 0000 004h] Signature : "SRAT" [System Resource A= ffinity Table] [030h 0048 001h] Subtable Type : 00 [Processor Local APIC/SAP= IC Affinity] [032h 0050 001h] Proximity Domain Low(8) : 00 [033h 0051 001h] Apic ID : 00 [040h 0064 001h] Subtable Type : 00 [Processor Local APIC/SAP= IC Affinity] [042h 0066 001h] Proximity Domain Low(8) : 03 = = = [043h 0067 001h] = Apic ID : 01 [050h 0080 001h] Subtable Type : 00 [Processor Local APIC/SAP= IC Affinity] [052h 0082 001h] Proximity Domain Low(8) : 05 [053h 0083 001h] Apic ID : 02 [060h 0096 001h] Subtable Type : 01 [Memory Affinity] [062h 0098 004h] Proximity Domain : 00000000 [068h 0104 008h] Base Address : 0000000000000000 [070h 0112 008h] Address Length : 00000000000A0000 [088h 0136 001h] Subtable Type : 01 [Memory Affinity] [08Ah 0138 004h] Proximity Domain : 00000000 [090h 0144 008h] Base Address : 0000000000100000 [098h 0152 008h] Address Length : 0000000003F00000 [0A8h 0168 008h] Reserved3 : 0000000000000000 [0B0h 0176 001h] Subtable Type : 01 [Memory Affinity] [0B2h 0178 004h] Proximity Domain : 00000004 [0B8h 0184 008h] Base Address : 0000000004000000 [0C0h 0192 008h] Address Length : 0000000004000000 //Comment in hw/i386/aml-build.c on why these exist - not part of //ACPI requirements. [0D8h 0216 001h] Subtable Type : 01 [Memory Affinity] [0DAh 0218 004h] Proximity Domain : 00000000 [0E0h 0224 008h] Base Address : 0000000000000000 [0E8h 0232 008h] Address Length : 0000000000000000 [100h 0256 001h] Subtable Type : 01 [Memory Affinity] [102h 0258 004h] Proximity Domain : 00000000 [108h 0264 008h] Base Address : 0000000000000000 [110h 0272 008h] Address Length : 0000000000000000 [128h 0296 001h] Subtable Type : 01 [Memory Affinity] [12Ah 0298 004h] Proximity Domain : 00000000 [130h 0304 008h] Base Address : 0000000000000000 [138h 0312 008h] Address Length : 0000000000000000 [150h 0336 001h] Subtable Type : 01 [Memory Affinity] [152h 0338 004h] Proximity Domain : 00000000 [158h 0344 008h] Base Address : 0000000000000000 [160h 0352 008h] Address Length : 0000000000000000 [178h 0376 001h] Subtable Type : 01 [Memory Affinity] [17Ah 0378 004h] Proximity Domain : 00000000 [180h 0384 008h] Base Address : 0000000000000000 [188h 0392 008h] Address Length : 0000000000000000 // End of strange empty Memory Affinity structures. [1A0h 0416 001h] Subtable Type : 05 [Generic Initiator Affini= ty] [1A3h 0419 001h] Device Handle Type : 01 [1A4h 0420 004h] Proximity Domain : 00000001 [1A8h 0424 010h] Device Handle : 00 00 10 00 00 00 00 00 00 0= 0 00 00 00 00 00 00 [1C0h 0448 001h] Subtable Type : 06 [Generic Port Affinity] [1C3h 0451 001h] Device Handle Type : 00 [1C4h 0452 004h] Proximity Domain : 00000002 [1C8h 0456 010h] Device Handle : 41 43 50 49 30 30 31 36 40 0= 0 00 00 00 00 00 00 [1E0h 0480 001h] Subtable Type : 01 [Memory Affinity] [1E2h 0482 004h] Proximity Domain : 00000005 [1E8h 0488 008h] Base Address : 0000000100000000 [1F0h 0496 008h] Address Length : 0000000090000000 [1FCh 0508 004h] Flags (decoded below) : 00000003 Enabled : 1 Hot Pluggable : 1 Non-Volatile : 0 Example block from HMAT: [0F0h 0240 002h] Structure Type : 0001 [System Locality Latenc= y and Bandwidth Information] = = [0F2h 0242 002h] = Reserved : 0000 = = = [0F4h 0244 004h] Le= ngth : 00000078 = = = [0F8h 0248 001h] Flags (decoded below) : 00 = = = = Memory Hierarchy : 0 = = = Use Mi= nimum Transfer Size : 0 = = = Non-sequential Transfers = : 0 [0F9h 0249 001h] Data Type : 03 [0FAh 0250 001h] Minimum Transfer Size : 00 [0FBh 0251 001h] Reserved1 : 00 [0FCh 0252 004h] Initiator Proximity Domains # : 00000004 [100h 0256 004h] Target Proximity Domains # : 00000006 [104h 0260 004h] Reserved2 : 00000000 [108h 0264 008h] Entry Base Unit : 0000000000000004 [110h 0272 004h] Initiator Proximity Domain List : 00000000 [114h 0276 004h] Initiator Proximity Domain List : 00000001 [118h 0280 004h] Initiator Proximity Domain List : 00000003 [11Ch 0284 004h] Initiator Proximity Domain List : 00000005 [120h 0288 004h] Target Proximity Domain List : 00000000 [124h 0292 004h] Target Proximity Domain List : 00000001 [128h 0296 004h] Target Proximity Domain List : 00000002 [12Ch 0300 004h] Target Proximity Domain List : 00000003 [130h 0304 004h] Target Proximity Domain List : 00000004 [134h 0308 004h] Target Proximity Domain List : 00000005 [138h 0312 002h] Entry : 00C8 [13Ah 0314 002h] Entry : 0000 [13Ch 0316 002h] Entry : 0032 [13Eh 0318 002h] Entry : 0000 [140h 0320 002h] Entry : 0032 [142h 0322 002h] Entry : 0064 [144h 0324 002h] Entry : 0019 [146h 0326 002h] Entry : 0000 [148h 0328 002h] Entry : 0064 [14Ah 0330 002h] Entry : 0000 [14Ch 0332 002h] Entry : 00C8 [14Eh 0334 002h] Entry : 0019 [150h 0336 002h] Entry : 0064 [152h 0338 002h] Entry : 0000 [154h 0340 002h] Entry : 0032 [156h 0342 002h] Entry : 0000 [158h 0344 002h] Entry : 0032 [15Ah 0346 002h] Entry : 0064 [15Ch 0348 002h] Entry : 0064 [15Eh 0350 002h] Entry : 0000 [160h 0352 002h] Entry : 0032 [162h 0354 002h] Entry : 0000 [164h 0356 002h] Entry : 0032 [166h 0358 002h] Entry : 00C8 Note the zeros represent entries where the target node has no memory. These could be surpressed but it isn't 'wrong' to provide them and it is (probably) permissible under ACPI to hotplug memory into these nodes later. Signed-off-by: Jonathan Cameron --- tests/qtest/bios-tables-test-allowed-diff.h | 5 ----- tests/data/acpi/q35/APIC.acpihmat-generic-x | Bin 0 -> 136 bytes tests/data/acpi/q35/CEDT.acpihmat-generic-x | Bin 0 -> 68 bytes tests/data/acpi/q35/DSDT.acpihmat-generic-x | Bin 0 -> 10400 bytes tests/data/acpi/q35/HMAT.acpihmat-generic-x | Bin 0 -> 360 bytes tests/data/acpi/q35/SRAT.acpihmat-generic-x | Bin 0 -> 520 bytes 6 files changed, 5 deletions(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index a5aa801c99..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,6 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/q35/APIC.acpihmat-generic-x", -"tests/data/acpi/q35/CEDT.acpihmat-generic-x", -"tests/data/acpi/q35/DSDT.acpihmat-generic-x", -"tests/data/acpi/q35/HMAT.acpihmat-generic-x", -"tests/data/acpi/q35/SRAT.acpihmat-generic-x", diff --git a/tests/data/acpi/q35/APIC.acpihmat-generic-x b/tests/data/acpi/= q35/APIC.acpihmat-generic-x index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..317ddb3fbed94e4f49a87976fdc= 7f23b1a6c3fdc 100644 GIT binary patch literal 136 zcmZ<^@O18AU|?WQaPoKd2v%^42yj*a0!E-1hz+6{7#{os(;N&85Soz@LNhUeXht58 ongjnpBoh}9gBTzdD=3DU!Z1+h3eVJt470*DwlH<-o3_8({j09efo0RR91 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/q35/CEDT.acpihmat-generic-x b/tests/data/acpi/= q35/CEDT.acpihmat-generic-x index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..31c9011663639b4a0f4816f3b2b= 06398f94682f7 100644 GIT binary patch literal 68 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 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/q35/SRAT.acpihmat-generic-x b/tests/data/acpi/= q35/SRAT.acpihmat-generic-x index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cbf45a31ba6d2c06f2bb0e203d4= b40100522ac08 100644 GIT binary patch literal 520 zcmWFzatz^MVqjoQbMklg2v%^42yj*a0!9V~1`r!WgD@Njp!1m-QRP{gkok-naGg*F z7hC|lI-mt$@PQeo5LF!uOc=3D(1(J1c3v=3D^ogl^*QsSQQwc;R_2Fi2Gq-!luB$0E|8c gN9O=3Df0|P@d2Z%I0EEqLdp(5~jn*bAl2QW|o04j0}0RR91 literal 0 HcmV?d00001 --=20 2.39.2