From nobody Mon Sep 16 18:57:06 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=1720782595; cv=none; d=zohomail.com; s=zohoarc; b=k0x/lQF4X0jqRBtP5Sh+r3jCUZIDEuXzTggpcAKXx3yvzSAzzBnFjXONW0ov81bpDMymSADQvSDJFiQ5F/iGKnA7zI1vLEn1EqugxWvYvjgQ/rqSvHVP7OI5aG92dfNMfrUYgjOQiBFLMtPupLq/DuoMAw0oCR/M10ejtkQYcU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782595; 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=t+ch8oY2SNT5KmIehFEPNtRsFO6VKgfVnfKu7RT+Xz4=; b=TSgLQv3IWwTO0b8LwtBnrvrFNcpMiIVuocNEq6/d6bmQONU2h6p8S9GoW466UowUBRARyRzaaGFyJLQSH6kWboc6GtxVzeXto0ol7eU6tWQbFYAMxtcR23HU4CSKzTGLjFp1y/m2bQtIEEsGWjWoJkudGmQBtqJRGtIXdPuaWT8= 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 1720782595395764.6324172955716; Fri, 12 Jul 2024 04:09:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSE9M-0000lj-Ju; Fri, 12 Jul 2024 07:09: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 1sSE9L-0000kq-7Y for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:09:15 -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 1sSE9G-0005LR-Am for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:09:14 -0400 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL82J553Pz6K61q; Fri, 12 Jul 2024 19:07:36 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 843AF140A86; Fri, 12 Jul 2024 19:09:08 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:09:08 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 01/13] hw/acpi: Fix ordering of BDF in Generic Initiator PCI Device Handle. Date: Fri, 12 Jul 2024 12:08:05 +0100 Message-ID: <20240712110837.1439736-2-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782597063116600 Content-Type: text/plain; charset="utf-8" The ordering in ACPI specification [1] has bus number in the lowest byte. As ACPI tables are little endian this is the reverse of the ordering used by PCI_BUILD_BDF(). As a minimal fix split the QEMU BDF up into bus and devfn and write them as single bytes in the correct order. [1] ACPI Spec 6.3, Table 5.80 Fixes: 0a5b5acdf2d8 ("hw/acpi: Implement the SRAT GI affinity structure") Reviewed-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron --- v5: No change --- hw/acpi/acpi_generic_initiator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initia= tor.c index 17b9a052f5..3d2b567999 100644 --- a/hw/acpi/acpi_generic_initiator.c +++ b/hw/acpi/acpi_generic_initiator.c @@ -92,7 +92,8 @@ build_srat_generic_pci_initiator_affinity(GArray *table_d= ata, int node, =20 /* 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, PCI_BUS_NUM(handle->bdf), 1); + build_append_int_noprefix(table_data, PCI_BDF_TO_DEVFN(handle->bdf), 1= ); for (index =3D 0; index < 12; index++) { build_append_int_noprefix(table_data, 0, 1); } --=20 2.43.0 From nobody Mon Sep 16 18:57:06 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=1720782630; cv=none; d=zohomail.com; s=zohoarc; b=bhkvF4XUldHXqFomevlF4B5Y1xo9r1729tH1QjeecQETenaRWWV2SYS2xMqDPuHD9TVwLliGJGoReICWPvhwhc/7wSP02/pOjo7vTmy3TilHAU/OJ2575frSDZX2iprpDAoOl3B4RY3bOSAncKMfQJyHUET9Ra83YbTR1CUVadA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782630; 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=8SXZYzU/BBvAVx/E9decsJ93Cze7ImU1sPifFhR/jLU=; b=LH7+D2jE4yrB835tDgwnS07SQpETRMnnnWgVcaYyDBe6YXLydscKUCPSvat8BraHHMF73CTH2sgcgzOiBaZo1lOBrKUUz0+fuYaZhPBFaJjN91WW7uTn2tnLM6/GtwYTB7NCpKV8v6oj9LuS8qXkGAWlo6kwmsBEYa8W/ggRBKM= 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 1720782630409332.23080062786346; Fri, 12 Jul 2024 04:10:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSE9y-00025H-5O; Fri, 12 Jul 2024 07:09:54 -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 1sSE9n-0001Xk-2j for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:09:46 -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 1sSE9l-0005Nv-4o for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:09:42 -0400 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL82D45Wdz6K98N; Fri, 12 Jul 2024 19:07:32 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 477EE1400D9; Fri, 12 Jul 2024 19:09:39 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:09:38 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 02/13] hw/acpi/GI: Fix trivial parameter alignment issue. Date: Fri, 12 Jul 2024 12:08:06 +0100 Message-ID: <20240712110837.1439736-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782631417116600 Content-Type: text/plain; charset="utf-8" Before making additional modification, tidy up this misleading indentation. Reviewed-by: Ankit Agrawal Reviewed-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron --- v5: No change --- 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 3d2b567999..4a02c19468 100644 --- a/hw/acpi/acpi_generic_initiator.c +++ b/hw/acpi/acpi_generic_initiator.c @@ -133,7 +133,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.43.0 From nobody Mon Sep 16 18:57:06 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=1720782632; cv=none; d=zohomail.com; s=zohoarc; b=lK8kWEWR1i9Of5LZ04jLV7hVOQ8n63ghaBAaka6ZqsGkc2RWAArQGW4RuF4PVcFqtBzV1E0zv5Qjt2f8KiRo8gDxEWMAQdwO4rUI2OE/F/V53a0Uj4Fl0X6hyC38HNzgfV1qhQ5u+qI5wgqYsrgvtTLzcXI31XLGJwx/5C3PMqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782632; 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=imiImwRhn+3unxOp8aIWNeWSsPOijR4NwoICtXEHBe8=; b=nuu2FMU0VV+fxrtysAVYolXm6PDczq5i8nlwtTIH+tUNlupmt0NZtHH6ZCT2Yt78Qct1zwdTO4+aVlDVxn0Y2PSa4nLsGWqcE/f1/j88++hcJGgt76ph62sJBcRQVMmDaFPJN7CPNmCUwy5A9LJ8VTTHehuGESUSxbz1BKUywH8= 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 1720782632800468.97085561024403; Fri, 12 Jul 2024 04:10:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEAN-0004FU-9U; Fri, 12 Jul 2024 07:10: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 1sSEAK-0003rj-6i for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:10:16 -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 1sSEAG-0005cC-Qk for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:10:15 -0400 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL8420NRDz6JB1G; Fri, 12 Jul 2024 19:09:06 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 02C941400D9; Fri, 12 Jul 2024 19:10:10 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:10:09 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 03/13] hw/acpi: Move AML building code for Generic Initiators to aml_build.c Date: Fri, 12 Jul 2024 12:08:07 +0100 Message-ID: <20240712110837.1439736-4-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-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.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782633279116600 Rather than attempting to create a generic function with mess of the two different device handle types, use a PCI handle specific variant. If the ACPI handle form is needed then that can be introduced alongside this with little duplicated code. Drop the PCIDeviceHandle in favor of just passing the bus, devfn and segment directly. devfn kept as a single byte because ARI means that in this case it is just an 8 bit function number. Suggested-by: Igor Mammedov Link: https://lore.kernel.org/qemu-devel/20240618142333.102be976@imammedo.u= sers.ipa.redhat.com/ Tested-by: "Huang, Ying" Reviewed-by: Igor Mammedov Signed-off-by: Jonathan Cameron --- v5: No change --- include/hw/acpi/acpi_generic_initiator.h | 23 ------------- include/hw/acpi/aml-build.h | 4 +++ hw/acpi/acpi_generic_initiator.c | 39 ++------------------- hw/acpi/aml-build.c | 44 ++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 59 deletions(-) diff --git a/include/hw/acpi/acpi_generic_initiator.h b/include/hw/acpi/acp= i_generic_initiator.h index a304bad73e..7b98676713 100644 --- a/include/hw/acpi/acpi_generic_initiator.h +++ b/include/hw/acpi/acpi_generic_initiator.h @@ -19,29 +19,6 @@ typedef struct AcpiGenericInitiator { uint16_t node; } AcpiGenericInitiator; =20 -/* - * ACPI 6.3: - * Table 5-81 Flags =E2=80=93 Generic Initiator Affinity Structure - */ -typedef enum { - /* - * If clear, the OSPM ignores the contents of the Generic - * Initiator/Port Affinity Structure. This allows system firmware - * to populate the SRAT with a static number of structures, but only - * enable them as necessary. - */ - GEN_AFFINITY_ENABLED =3D (1 << 0), -} GenericAffinityFlags; - -/* - * ACPI 6.3: - * Table 5-80 Device Handle - PCI - */ -typedef struct PCIDeviceHandle { - uint16_t segment; - uint16_t bdf; -} PCIDeviceHandle; - void build_srat_generic_pci_initiator(GArray *table_data); =20 #endif diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index a3784155cb..33eef85791 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -486,6 +486,10 @@ Aml *build_crs(PCIHostState *host, CrsRangeSet *range_= set, uint32_t io_offset, void build_srat_memory(GArray *table_data, uint64_t base, uint64_t len, int node, MemoryAffinityFlags flags); =20 +void build_srat_pci_generic_initiator(GArray *table_data, int node, + uint16_t segment, uint8_t bus, + uint8_t devfn); + void build_slit(GArray *table_data, BIOSLinker *linker, MachineState *ms, const char *oem_id, const char *oem_table_id); =20 diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initia= tor.c index 4a02c19468..7665b16107 100644 --- a/hw/acpi/acpi_generic_initiator.c +++ b/hw/acpi/acpi_generic_initiator.c @@ -74,40 +74,11 @@ static void acpi_generic_initiator_class_init(ObjectCla= ss *oc, void *data) acpi_generic_initiator_set_node, NULL, NULL); } =20 -/* - * ACPI 6.3: - * Table 5-78 Generic Initiator Affinity Structure - */ -static void -build_srat_generic_pci_initiator_affinity(GArray *table_data, int node, - PCIDeviceHandle *handle) -{ - uint8_t index; - - build_append_int_noprefix(table_data, 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 */ - build_append_int_noprefix(table_data, node, 4); /* Proximity Domain */ - - /* Device Handle - PCI */ - build_append_int_noprefix(table_data, handle->segment, 2); - build_append_int_noprefix(table_data, PCI_BUS_NUM(handle->bdf), 1); - build_append_int_noprefix(table_data, PCI_BDF_TO_DEVFN(handle->bdf), 1= ); - for (index =3D 0; index < 12; index++) { - build_append_int_noprefix(table_data, 0, 1); - } - - build_append_int_noprefix(table_data, GEN_AFFINITY_ENABLED, 4); /* Fla= gs */ - build_append_int_noprefix(table_data, 0, 4); /* Reserved */ -} - 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; PCIDevice *pci_dev; Object *o; =20 @@ -130,13 +101,9 @@ static int build_all_acpi_generic_initiators(Object *o= bj, void *opaque) } =20 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_pci_initiator_affinity(table_data, - gi->node, &dev_handle); + build_srat_pci_generic_initiator(table_data, gi->node, 0, + pci_bus_num(pci_get_bus(pci_dev)), + pci_dev->devfn); =20 return 0; } diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 6d4517cfbe..968b654e58 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1938,6 +1938,50 @@ void build_srat_memory(GArray *table_data, uint64_t = base, build_append_int_noprefix(table_data, 0, 8); /* Reserved */ } =20 +/* + * ACPI Spec Revision 6.3 + * Table 5-80 Device Handle - PCI + */ +static void build_append_srat_pci_device_handle(GArray *table_data, + uint16_t segment, + uint8_t bus, uint8_t devfn) +{ + /* PCI segment number */ + build_append_int_noprefix(table_data, segment, 2); + /* PCI Bus Device Function */ + build_append_int_noprefix(table_data, bus, 1); + build_append_int_noprefix(table_data, devfn, 1); + /* Reserved */ + build_append_int_noprefix(table_data, 0, 12); +} + +/* + * ACPI spec, Revision 6.3 + * 5.2.16.6 Generic Initiator Affinity Structure + * With PCI Device Handle. + */ +void build_srat_pci_generic_initiator(GArray *table_data, int node, + uint16_t segment, uint8_t bus, + uint8_t devfn) +{ + /* Type */ + build_append_int_noprefix(table_data, 5, 1); + /* Length */ + build_append_int_noprefix(table_data, 32, 1); + /* Reserved */ + build_append_int_noprefix(table_data, 0, 1); + /* Device Handle Type: PCI */ + build_append_int_noprefix(table_data, 1, 1); + /* Proximity Domain */ + build_append_int_noprefix(table_data, node, 4); + /* Device Handle */ + build_append_srat_pci_device_handle(table_data, segment, bus, devfn); + /* Flags - GI Enabled */ + build_append_int_noprefix(table_data, 1, 4); + /* Reserved */ + build_append_int_noprefix(table_data, 0, 4); +} + /* * ACPI spec 5.2.17 System Locality Distance Information Table * (Revision 2.0 or later) --=20 2.43.0 From nobody Mon Sep 16 18:57:06 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=1720782657; cv=none; d=zohomail.com; s=zohoarc; b=FuiHianpDto/Z4Qg1/X+kNpJfzqnLZfDBwh6k4KuIcWsC0Jga5CFNwYIILPU8DXum9PCqE4iuxV6ceD5BfMcXOaHJQJ5gTj43KEj3snZ7JmYYoADUwefCSXXO58K/wl2GhnBadEjIk96b50xIMCZHMQO4p2vqfcK00FXWuSvcuo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782657; 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=/09yxEl7cOpTznGeg9fdzK0U2hg3U/nNgTkTM2S/HR8=; b=TfOdI5PWZGeo4ND77VZSUHe2I1OQQHIVt+UbcdSoNFhcZXDeA3u1Ol+jdq+3HJdb8SqkvLyei7cpqOPUcvoj3OvL4LCwEXzPaU3HOAmwRxRaQ4EAQjUkMLyLFNSkdl1tq7lTJXoWUReOCDf94Oib0/uve9QINdRSdHcjWfSk5ss= 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 1720782657943876.3571925314044; Fri, 12 Jul 2024 04:10:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEAn-00071j-RG; Fri, 12 Jul 2024 07:10: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 1sSEAm-0006uf-3W for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:10:44 -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 1sSEAk-0005mM-Hl for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:10:43 -0400 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL83P5Brlz6K92L; Fri, 12 Jul 2024 19:08:33 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 80DDD140B2A; Fri, 12 Jul 2024 19:10:40 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:10:40 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 04/13] hw/acpi: Rename build_all_acpi_generic_initiators() to build_acpi_generic_initiator() Date: Fri, 12 Jul 2024 12:08:08 +0100 Message-ID: <20240712110837.1439736-5-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782659328116600 Content-Type: text/plain; charset="utf-8" Igor noted that this function only builds one instance, so was rather misleadingly named. Fix that. Suggested-by: Igor Mammedov Reviewed-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron --- v5: No change --- hw/acpi/acpi_generic_initiator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initia= tor.c index 7665b16107..73bafaaaea 100644 --- a/hw/acpi/acpi_generic_initiator.c +++ b/hw/acpi/acpi_generic_initiator.c @@ -74,7 +74,7 @@ static void acpi_generic_initiator_class_init(ObjectClass= *oc, void *data) acpi_generic_initiator_set_node, NULL, NULL); } =20 -static int build_all_acpi_generic_initiators(Object *obj, void *opaque) +static int build_acpi_generic_initiator(Object *obj, void *opaque) { MachineState *ms =3D MACHINE(qdev_get_machine()); AcpiGenericInitiator *gi; @@ -111,6 +111,6 @@ static int build_all_acpi_generic_initiators(Object *ob= j, void *opaque) void build_srat_generic_pci_initiator(GArray *table_data) { object_child_foreach_recursive(object_get_root(), - build_all_acpi_generic_initiators, + build_acpi_generic_initiator, table_data); } --=20 2.43.0 From nobody Mon Sep 16 18:57:06 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=1720782688; cv=none; d=zohomail.com; s=zohoarc; b=fZ5kmTgoTYkWdyEdHYAexGHgkem5/CdLW5toNYI4lp3sOZIfCDa76Z14XJVLph3wp58Ddc5Tx/LQUdVOcCID6/WHz546/yBU2DGB+sPdrEiumXWDRz8K05p3QBAX3nQB1ZlglfolBr2UIzlmt5/Tl+wauTR01VPjWFcBjMph4p4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782688; 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=Kdf9Q0WROKXT5By4y4ARNtYl0cTCsHXdGiHDWr9Ck0w=; b=gJCp+bTUTxbdCMdViKFu4c/GbIQGPsWoHq+QawhCTfmfsjnW5tNo7R8j/X4F1pFgVh6ssUysb/+7tzEDUuNGsM7/F3q0+WlU18XrraMdLggM/zXHH/iA1aRblYYbrDOiWGXgQUVc4UCodDgWTkLMushwkMKOX/sWnkYxCb5gcu8= 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 1720782688733901.4961041866568; Fri, 12 Jul 2024 04:11:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEBN-0001FO-Nd; Fri, 12 Jul 2024 07:11:21 -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 1sSEBL-00014Z-6e for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:11:19 -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 1sSEBF-0005nl-Ph for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:11:18 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL85C0qbqz6JB4X; Fri, 12 Jul 2024 19:10:07 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 122B014058E; Fri, 12 Jul 2024 19:11:11 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:11:10 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 05/13] hw/pci: Add a busnr property to pci_props and use for acpi/gi Date: Fri, 12 Jul 2024 12:08:09 +0100 Message-ID: <20240712110837.1439736-6-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782689431116600 Content-Type: text/plain; charset="utf-8" Using a property allows us to hide the internal details of the PCI device from the code to build a SRAT Generic Initiator Affinity Structure with PCI Device Handle. Suggested-by: Igor Mammedov Reviewed-by: Igor Mammedov Signed-off-by: Jonathan Cameron --- V5: Add assert() to catch if devfn is out of permissible range of 0 to 255. --- hw/acpi/acpi_generic_initiator.c | 14 +++++++++----- hw/pci/pci.c | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initia= tor.c index 73bafaaaea..365feb527f 100644 --- a/hw/acpi/acpi_generic_initiator.c +++ b/hw/acpi/acpi_generic_initiator.c @@ -9,6 +9,7 @@ #include "hw/boards.h" #include "hw/pci/pci_device.h" #include "qemu/error-report.h" +#include "qapi/error.h" =20 typedef struct AcpiGenericInitiatorClass { ObjectClass parent_class; @@ -79,7 +80,8 @@ static int build_acpi_generic_initiator(Object *obj, void= *opaque) MachineState *ms =3D MACHINE(qdev_get_machine()); AcpiGenericInitiator *gi; GArray *table_data =3D opaque; - PCIDevice *pci_dev; + int32_t devfn; + uint8_t bus; Object *o; =20 if (!object_dynamic_cast(obj, TYPE_ACPI_GENERIC_INITIATOR)) { @@ -100,10 +102,12 @@ static int build_acpi_generic_initiator(Object *obj, = void *opaque) exit(1); } =20 - pci_dev =3D PCI_DEVICE(o); - build_srat_pci_generic_initiator(table_data, gi->node, 0, - pci_bus_num(pci_get_bus(pci_dev)), - pci_dev->devfn); + bus =3D object_property_get_uint(o, "busnr", &error_fatal); + devfn =3D object_property_get_int(o, "addr", &error_fatal); + /* devfn is constrained in PCI to be 8 bit but storage is an int32_t */ + assert(devfn >=3D 0 && devfn < PCI_DEVFN_MAX); + + build_srat_pci_generic_initiator(table_data, gi->node, 0, bus, devfn); =20 return 0; } diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 4c7be52951..e3d1a83e31 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -67,6 +67,19 @@ static char *pcibus_get_fw_dev_path(DeviceState *dev); static void pcibus_reset_hold(Object *obj, ResetType type); static bool pcie_has_upstream_port(PCIDevice *dev); =20 +static void prop_pci_busnr_get(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + uint8_t busnr =3D pci_dev_bus_num(PCI_DEVICE(obj)); + + visit_type_uint8(v, name, &busnr, errp); +} + +static const PropertyInfo prop_pci_busnr =3D { + .name =3D "busnr", + .get =3D prop_pci_busnr_get, +}; + static Property pci_props[] =3D { DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1), DEFINE_PROP_STRING("romfile", PCIDevice, romfile), @@ -85,6 +98,7 @@ static Property pci_props[] =3D { QEMU_PCIE_ERR_UNC_MASK_BITNR, true), DEFINE_PROP_BIT("x-pcie-ari-nextfn-1", PCIDevice, cap_present, QEMU_PCIE_ARI_NEXTFN_1_BITNR, false), + { .name =3D "busnr", .info =3D &prop_pci_busnr }, DEFINE_PROP_END_OF_LIST() }; =20 --=20 2.43.0 From nobody Mon Sep 16 18:57:06 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=1720782730; cv=none; d=zohomail.com; s=zohoarc; b=S64JoH5E/in2NHbZDhKEGOXrA8oP9aUUYvzZDUrKTNby3IEKN6QS+tSJJ2gaE/s0eMSZDWMnTlDTF6LrxupsFlIhRzwNnD1fOCPjTVMc42eb9wyxY3NyvKKdiVPhpx0vI9uVso9xn0rz2zoRsB5IkaK07dvRu5MPK0vI8s2FdNQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782730; 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=zhVfleD7EtnjTrsBQSrGiVR79RMNzntAQUo7SUR4QdQ=; b=L0xrGWvFsSbBleA/EVj4MUlJf8TUW+KelfB1Qx4BrA92sjbc49YkeuUcYBCd+YTRkn6nS0o/niq/ewTY9Z9st802RnA5wva8bOLxMJ1v+h7+qjyvvDCtaNRw/nEobWPlTr8RGbhHTSA9c6Bd9LdsS5I9lurYMDQ1UwlmT958juw= 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 1720782730693424.5995586845388; Fri, 12 Jul 2024 04:12:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEBq-0003Lz-F2; Fri, 12 Jul 2024 07:11:50 -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 1sSEBo-00038E-2b for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:11:48 -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 1sSEBk-0006C3-A1 for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:11:47 -0400 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL85G0T6Zz6K5wl; Fri, 12 Jul 2024 19:10:10 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id DBE6A140B2A; Fri, 12 Jul 2024 19:11:41 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:11:41 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 06/13] acpi/pci: Move Generic Initiator object handling into acpi/pci.* Date: Fri, 12 Jul 2024 12:08:10 +0100 Message-ID: <20240712110837.1439736-7-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782731701116600 Content-Type: text/plain; charset="utf-8" Whilst ACPI SRAT Generic Initiator Afinity Structures are able to refer to both PCI and ACPI Device Handles, the QEMU implementation only implements the PCI Device Handle case. For now move the code into the existing hw/acpi/pci.c file and header. If support for ACPI Device Handles is added in the future, perhaps this will be moved again. Also push the struct AcpiGenericInitiator down into the c file as not used outside pci.c. Suggested-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- v5: Carry forward changes from previous patch. Move the TYPE_ACPI_GENERIC_INTIATOR define down into the c file along with include qom/object_interfaces.h --- include/hw/acpi/acpi_generic_initiator.h | 24 ----- include/hw/acpi/pci.h | 3 + hw/acpi/acpi_generic_initiator.c | 120 ---------------------- hw/acpi/pci.c | 124 +++++++++++++++++++++++ hw/arm/virt-acpi-build.c | 1 - hw/i386/acpi-build.c | 1 - hw/acpi/meson.build | 1 - 7 files changed, 127 insertions(+), 147 deletions(-) diff --git a/include/hw/acpi/acpi_generic_initiator.h b/include/hw/acpi/acp= i_generic_initiator.h deleted file mode 100644 index 7b98676713..0000000000 --- a/include/hw/acpi/acpi_generic_initiator.h +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved - */ - -#ifndef ACPI_GENERIC_INITIATOR_H -#define ACPI_GENERIC_INITIATOR_H - -#include "qom/object_interfaces.h" - -#define TYPE_ACPI_GENERIC_INITIATOR "acpi-generic-initiator" - -typedef struct AcpiGenericInitiator { - /* private */ - Object parent; - - /* public */ - char *pci_dev; - uint16_t node; -} AcpiGenericInitiator; - -void build_srat_generic_pci_initiator(GArray *table_data); - -#endif diff --git a/include/hw/acpi/pci.h b/include/hw/acpi/pci.h index 467a99461c..3015a8171c 100644 --- a/include/hw/acpi/pci.h +++ b/include/hw/acpi/pci.h @@ -40,4 +40,7 @@ Aml *aml_pci_device_dsm(void); =20 void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus); void build_pci_bridge_aml(AcpiDevAmlIf *adev, Aml *scope); + +void build_srat_generic_pci_initiator(GArray *table_data); + #endif diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initia= tor.c deleted file mode 100644 index 365feb527f..0000000000 --- a/hw/acpi/acpi_generic_initiator.c +++ /dev/null @@ -1,120 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved - */ - -#include "qemu/osdep.h" -#include "hw/acpi/acpi_generic_initiator.h" -#include "hw/acpi/aml-build.h" -#include "hw/boards.h" -#include "hw/pci/pci_device.h" -#include "qemu/error-report.h" -#include "qapi/error.h" - -typedef struct AcpiGenericInitiatorClass { - ObjectClass parent_class; -} AcpiGenericInitiatorClass; - -OBJECT_DEFINE_TYPE_WITH_INTERFACES(AcpiGenericInitiator, acpi_generic_init= iator, - ACPI_GENERIC_INITIATOR, OBJECT, - { TYPE_USER_CREATABLE }, - { NULL }) - -OBJECT_DECLARE_SIMPLE_TYPE(AcpiGenericInitiator, ACPI_GENERIC_INITIATOR) - -static void acpi_generic_initiator_init(Object *obj) -{ - AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); - - gi->node =3D MAX_NODES; - gi->pci_dev =3D NULL; -} - -static void acpi_generic_initiator_finalize(Object *obj) -{ - AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); - - g_free(gi->pci_dev); -} - -static void acpi_generic_initiator_set_pci_device(Object *obj, const char = *val, - Error **errp) -{ - AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); - - gi->pci_dev =3D g_strdup(val); -} - -static void acpi_generic_initiator_set_node(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) -{ - AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); - MachineState *ms =3D MACHINE(qdev_get_machine()); - uint32_t value; - - if (!visit_type_uint32(v, name, &value, errp)) { - return; - } - - if (value >=3D MAX_NODES) { - error_printf("%s: Invalid NUMA node specified\n", - TYPE_ACPI_GENERIC_INITIATOR); - exit(1); - } - - gi->node =3D value; - ms->numa_state->nodes[gi->node].has_gi =3D true; -} - -static void acpi_generic_initiator_class_init(ObjectClass *oc, void *data) -{ - object_class_property_add_str(oc, "pci-dev", NULL, - acpi_generic_initiator_set_pci_device); - object_class_property_add(oc, "node", "int", NULL, - acpi_generic_initiator_set_node, NULL, NULL); -} - -static int build_acpi_generic_initiator(Object *obj, void *opaque) -{ - MachineState *ms =3D MACHINE(qdev_get_machine()); - AcpiGenericInitiator *gi; - GArray *table_data =3D opaque; - int32_t devfn; - uint8_t bus; - Object *o; - - if (!object_dynamic_cast(obj, TYPE_ACPI_GENERIC_INITIATOR)) { - return 0; - } - - gi =3D ACPI_GENERIC_INITIATOR(obj); - if (gi->node >=3D ms->numa_state->num_nodes) { - error_printf("%s: Specified node %d is invalid.\n", - TYPE_ACPI_GENERIC_INITIATOR, gi->node); - exit(1); - } - - o =3D object_resolve_path_type(gi->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); - } - - bus =3D object_property_get_uint(o, "busnr", &error_fatal); - devfn =3D object_property_get_int(o, "addr", &error_fatal); - /* devfn is constrained in PCI to be 8 bit but storage is an int32_t */ - assert(devfn >=3D 0 && devfn < PCI_DEVFN_MAX); - - build_srat_pci_generic_initiator(table_data, gi->node, 0, bus, devfn); - - return 0; -} - -void build_srat_generic_pci_initiator(GArray *table_data) -{ - object_child_foreach_recursive(object_get_root(), - build_acpi_generic_initiator, - table_data); -} diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index 20b70dcd81..3e1db161cc 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -24,8 +24,13 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qom/object_interfaces.h" +#include "qapi/error.h" +#include "hw/boards.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pcie_host.h" =20 /* @@ -59,3 +64,122 @@ void build_mcfg(GArray *table_data, BIOSLinker *linker,= AcpiMcfgInfo *info, =20 acpi_table_end(linker, &table); } + +typedef struct AcpiGenericInitiator { + /* private */ + Object parent; + + /* public */ + char *pci_dev; + uint16_t node; +} AcpiGenericInitiator; + +typedef struct AcpiGenericInitiatorClass { + ObjectClass parent_class; +} AcpiGenericInitiatorClass; + +#define TYPE_ACPI_GENERIC_INITIATOR "acpi-generic-initiator" + +OBJECT_DEFINE_TYPE_WITH_INTERFACES(AcpiGenericInitiator, acpi_generic_init= iator, + ACPI_GENERIC_INITIATOR, OBJECT, + { TYPE_USER_CREATABLE }, + { NULL }) + +OBJECT_DECLARE_SIMPLE_TYPE(AcpiGenericInitiator, ACPI_GENERIC_INITIATOR) + +static void acpi_generic_initiator_init(Object *obj) +{ + AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); + + gi->node =3D MAX_NODES; + gi->pci_dev =3D NULL; +} + +static void acpi_generic_initiator_finalize(Object *obj) +{ + AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); + + g_free(gi->pci_dev); +} + +static void acpi_generic_initiator_set_pci_device(Object *obj, const char = *val, + Error **errp) +{ + AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); + + gi->pci_dev =3D g_strdup(val); +} + +static void acpi_generic_initiator_set_node(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + AcpiGenericInitiator *gi =3D ACPI_GENERIC_INITIATOR(obj); + MachineState *ms =3D MACHINE(qdev_get_machine()); + uint32_t value; + + if (!visit_type_uint32(v, name, &value, errp)) { + return; + } + + if (value >=3D MAX_NODES) { + error_printf("%s: Invalid NUMA node specified\n", + TYPE_ACPI_GENERIC_INITIATOR); + exit(1); + } + + gi->node =3D value; + ms->numa_state->nodes[gi->node].has_gi =3D true; +} + +static void acpi_generic_initiator_class_init(ObjectClass *oc, void *data) +{ + object_class_property_add_str(oc, "pci-dev", NULL, + acpi_generic_initiator_set_pci_device); + object_class_property_add(oc, "node", "int", NULL, + acpi_generic_initiator_set_node, NULL, NULL); +} + +static int build_acpi_generic_initiator(Object *obj, void *opaque) +{ + MachineState *ms =3D MACHINE(qdev_get_machine()); + AcpiGenericInitiator *gi; + GArray *table_data =3D opaque; + int32_t devfn; + uint8_t bus; + Object *o; + + if (!object_dynamic_cast(obj, TYPE_ACPI_GENERIC_INITIATOR)) { + return 0; + } + + gi =3D ACPI_GENERIC_INITIATOR(obj); + if (gi->node >=3D ms->numa_state->num_nodes) { + error_printf("%s: Specified node %d is invalid.\n", + TYPE_ACPI_GENERIC_INITIATOR, gi->node); + exit(1); + } + + o =3D object_resolve_path_type(gi->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); + } + + bus =3D object_property_get_uint(o, "busnr", &error_fatal); + devfn =3D object_property_get_uint(o, "addr", &error_fatal); + /* devfn is constrained in PCI to be 8 bit but storage is an int32_t */ + assert(devfn >=3D 0 && devfn < PCI_DEVFN_MAX); + + build_srat_pci_generic_initiator(table_data, gi->node, 0, bus, devfn); + + return 0; +} + +void build_srat_generic_pci_initiator(GArray *table_data) +{ + object_child_foreach_recursive(object_get_root(), + build_acpi_generic_initiator, + table_data); +} diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index e10cad86dd..a50b00b7c1 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -57,7 +57,6 @@ #include "migration/vmstate.h" #include "hw/acpi/ghes.h" #include "hw/acpi/viot.h" -#include "hw/acpi/acpi_generic_initiator.h" #include "hw/virtio/virtio-acpi.h" #include "target/arm/multiprocessing.h" =20 diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index f4e366f64f..ee92783836 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -68,7 +68,6 @@ #include "hw/acpi/utils.h" #include "hw/acpi/pci.h" #include "hw/acpi/cxl.h" -#include "hw/acpi/acpi_generic_initiator.h" =20 #include "qom/qom-qobject.h" #include "hw/i386/amd_iommu.h" diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index fa5c07db90..5441c9b1e4 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -1,6 +1,5 @@ acpi_ss =3D ss.source_set() acpi_ss.add(files( - 'acpi_generic_initiator.c', 'acpi_interface.c', 'aml-build.c', 'bios-linker-loader.c', --=20 2.43.0 From nobody Mon Sep 16 18:57:06 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=1720782757; cv=none; d=zohomail.com; s=zohoarc; b=bAvpUedsbYZaNTY1PhVi98ShxrfElkrM2NvvIlB6dV8NpEp30pUJlgn8WcLy6R1EbSD3i75sTu04gF+OXyLguEsGuT/wmY/MQoWPDaOdCmRYRGxUu2hv2gPiNk3P65gCUYQfufRlDPC5NH9Kr6vRzDtdsPC0DF6hXAhBpVMk0JQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782757; 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=dKWoQpGgep0qVZytROqoA4sebHeGW5vA47HYmBkgVwg=; b=V5TVd+/EAVvb8z6jTWBv73aPcp7gxCxHLwt8okJmFUP7xenAV+K6FiNbVK2efAKkzHYpMUVIBVeJQZI8ViOvQKnEKfS/tanprgEhwZlW637DPDS9Kxf95wYiJYF8KWS4HJLR6106/Wu+CEvC3qMFFHEKmiO4i4csZ+Z97M3gkLI= 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 1720782757921512.1860110385157; Fri, 12 Jul 2024 04:12:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSECO-0005tL-44; Fri, 12 Jul 2024 07:12:24 -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 1sSECM-0005o6-Os for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:12:22 -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 1sSECE-0006jE-8k for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:12:22 -0400 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL85r5Cd5z6K61v; Fri, 12 Jul 2024 19:10:40 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 8BAA31400D9; Fri, 12 Jul 2024 19:12:12 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:12:11 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 07/13] hw/pci-bridge: Add acpi_uid property to TYPE_PXB_BUS Date: Fri, 12 Jul 2024 12:08:11 +0100 Message-ID: <20240712110837.1439736-8-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782759832116600 Content-Type: text/plain; charset="utf-8" Enable ACPI table creation for PCI Expander Bridges to be independent of PCI internals. Note that the UID is currently the PCI bus number. This is motivated by the forthcoming ACPI Generic Port SRAT entries which can be made completely independent of PCI internals. Suggested-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- v5: Add missing property description. --- hw/pci-bridge/pci_expander_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index 0411ad31ea..b94cb85cfb 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -85,12 +85,25 @@ static uint16_t pxb_bus_numa_node(PCIBus *bus) return pxb->numa_node; } =20 +static void prop_pxb_uid_get(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + uint32_t uid =3D pci_bus_num(PCI_BUS(obj)); + + visit_type_uint32(v, name, &uid, errp); +} + static void pxb_bus_class_init(ObjectClass *class, void *data) { PCIBusClass *pbc =3D PCI_BUS_CLASS(class); =20 pbc->bus_num =3D pxb_bus_num; pbc->numa_node =3D pxb_bus_numa_node; + + object_class_property_add(class, "acpi_uid", "uint32", + prop_pxb_uid_get, NULL, NULL, NULL); + object_class_property_set_description(class, "acpi_uid", + "ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI000= 16"); } =20 static const TypeInfo pxb_bus_info =3D { --=20 2.43.0 From nobody Mon Sep 16 18:57:06 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=1720782790; cv=none; d=zohomail.com; s=zohoarc; b=iY415PglSIMIvfFTUL54hTLIqOWolGwou7IXWgQ/vHaF+c3utvcqJcULHnww1rkOE+zH6Hdx5OFimG4iq0EBCrkN86ih8A6jm3dw456ZU+C+RzpRrbX/sd8l1jE5obl1F7gZ0jK22Mvi206kmt6zsRHlgA83Jch2CVOSv/MNveI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782790; 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=gqQYMZkErS/obxvuj2GB9Fp4+yHrofmK6ofnCYLzfxo=; b=b3k3xz98rblCI7LYM+x311jpyQvumP+UfGUeR7J0hSWLlXC6SS2FV+5kbVLuxZlwB9dL+bVp5awaOyh+YSry5q8j3gxE+J87vJ/p1u6eCnL8eu5i/bh/kjyLr/mvBJteMWLGYfYjXX9fVeV+PgM3CyxW8K4nOxjuPXHGVbRSgUQ= 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 1720782790076827.9187157616193; Fri, 12 Jul 2024 04:13:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSECm-0008Fg-Nl; Fri, 12 Jul 2024 07:12: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 1sSECk-00085q-SA for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:12:46 -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 1sSECj-00071c-5A for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:12:46 -0400 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL86y6w9vz6JB6M; Fri, 12 Jul 2024 19:11:38 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id E686E1400CF; Fri, 12 Jul 2024 19:12:42 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:12:42 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 08/13] hw/i386/acpi: Use TYPE_PXB_BUS property acpi_uid for DSDT Date: Fri, 12 Jul 2024 12:08:12 +0100 Message-ID: <20240712110837.1439736-9-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782792073116600 Content-Type: text/plain; charset="utf-8" Rather than relying on PCI internals, use the new acpi_property to obtain the ACPI _UID values. These are still the same as the PCI Bus numbers so no functional change. Suggested-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- v5: Leave the device naming as using bus_num so that we can relax assumption of the UID being only 8 bits (it is but we don't need to assume that) --- hw/i386/acpi-build.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index ee92783836..2eaa4c9203 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1550,6 +1550,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, QLIST_FOREACH(bus, &bus->child, sibling) { uint8_t bus_num =3D pci_bus_num(bus); uint8_t numa_node =3D pci_bus_numa_node(bus); + uint32_t uid; =20 /* look only for expander root buses */ if (!pci_bus_is_root(bus)) { @@ -1560,6 +1561,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, root_bus_limit =3D bus_num - 1; } =20 + uid =3D object_property_get_uint(OBJECT(bus), "acpi_uid", + &error_fatal); scope =3D aml_scope("\\_SB"); =20 if (pci_bus_is_cxl(bus)) { @@ -1567,7 +1570,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, } else { dev =3D aml_device("PC%.02X", bus_num); } - aml_append(dev, aml_name_decl("_UID", aml_int(bus_num))); + aml_append(dev, aml_name_decl("_UID", aml_int(uid))); aml_append(dev, aml_name_decl("_BBN", aml_int(bus_num))); if (pci_bus_is_cxl(bus)) { struct Aml *aml_pkg =3D aml_package(2); --=20 2.43.0 From nobody Mon Sep 16 18:57:06 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=1720782804; cv=none; d=zohomail.com; s=zohoarc; b=i4O+3EIcaYeKBeQ0N4qKcdaAkd6/M/pEo8SFnROO+hfmM0Y7ZxkY9PKn/IgHPuFtuDnL+fNJuhL8FgYFld6LJNpFt98o2F61fZ9RMMctK0eb/78GlR3cJTTz/9g6y0yYaJonkf9FZ+3/HH1x2yb6hM9X8FEQcVrPXJxmIUHssH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782804; 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=mzx0lNFGU/82STHcbvlmZ5q9J8C3Mbd+rkrmPgD/RDo=; b=gxQsEXj0kmi5rY4Wo0Him6iqt5FuYrAGtSQB5eZ5e0y0faPVM+uXaqXGOM+8fHeX0bX0VQbrw7inetgL41293nobcsxeNdaOsZJX474I7VUJDITakFqa1v5xp2QC4PSpjA9s/7cVflK9k8dciQa6tNt1Dn9IPSnPkF+Zj5I0pek= 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 1720782804739326.59925623661354; Fri, 12 Jul 2024 04:13:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEDH-0002GR-3F; Fri, 12 Jul 2024 07:13: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 1sSEDF-00025I-O3 for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:13: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 1sSEDD-000760-4w for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:13:16 -0400 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL87149Tsz67M6q; Fri, 12 Jul 2024 19:11:41 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 61E6B140B2A; Fri, 12 Jul 2024 19:13:13 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:13:12 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 09/13] hw/pci-host/gpex-acpi: Use acpi_uid property. Date: Fri, 12 Jul 2024 12:08:13 +0100 Message-ID: <20240712110837.1439736-10-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782806051116600 Content-Type: text/plain; charset="utf-8" Reduce the direct use of PCI internals inside ACPI table creation. Suggested-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- v5: Similar to previous, use bus number, not uid in ACPI device naming so that uid can be 32 bits and we don't need checks to ensure it is only 8 bits. Not change to the actual numbers as the UID =3D=3D bus_num --- hw/pci-host/gpex-acpi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/pci-host/gpex-acpi.c b/hw/pci-host/gpex-acpi.c index f69413ea2c..f271817ef5 100644 --- a/hw/pci-host/gpex-acpi.c +++ b/hw/pci-host/gpex-acpi.c @@ -140,6 +140,7 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *= cfg) QLIST_FOREACH(bus, &bus->child, sibling) { uint8_t bus_num =3D pci_bus_num(bus); uint8_t numa_node =3D pci_bus_numa_node(bus); + uint32_t uid; bool is_cxl =3D pci_bus_is_cxl(bus); =20 if (!pci_bus_is_root(bus)) { @@ -155,6 +156,8 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *= cfg) nr_pcie_buses =3D bus_num; } =20 + uid =3D object_property_get_uint(OBJECT(bus), "acpi_uid", + &error_fatal); dev =3D aml_device("PC%.02X", bus_num); if (is_cxl) { struct Aml *pkg =3D aml_package(2); @@ -167,7 +170,7 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *= cfg) aml_append(dev, aml_name_decl("_CID", aml_string("PNP0A03"= ))); } aml_append(dev, aml_name_decl("_BBN", aml_int(bus_num))); - aml_append(dev, aml_name_decl("_UID", aml_int(bus_num))); + aml_append(dev, aml_name_decl("_UID", aml_int(uid))); aml_append(dev, aml_name_decl("_STR", aml_unicode("pxb Device"= ))); aml_append(dev, aml_name_decl("_CCA", aml_int(1))); if (numa_node !=3D NUMA_NODE_UNASSIGNED) { --=20 2.43.0 From nobody Mon Sep 16 18:57:06 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=1720782842; cv=none; d=zohomail.com; s=zohoarc; b=L4imRt4Yu0ofs23dEoMZYGXgsz2zci1MGzuTS8jArILYg39IY7Oo3zMj0r/LLGiSW83nQU40LKMhRJDMR840n//AOqr5baq7t4VX/Cu2K9arAPFmtIb2z6srcrMzrbcSRJLmKJ5ZeADv++dzl9jw+HCI8h8tekI3AzZfrWHEi/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782842; 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=ZeuMOjBZSxuSmgqMDZWZWYLl338dx8UPFR65/ffz4c8=; b=NGNxFbzPMcwuWOgECWxTLLjnM6xG2HFhPmz12fSKvqukZMejIKHitoaLRhzEqIJCCoLf1WAXxDf+K7rG6/z6YCP9nj5zdflxEBTD9onGvukuwgRV+UwPlGatZszo8eOb7yA7jwJE4IIM4jF9LwY9XoBkkFsTXFIdTG3lFwAHW6g= 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 172078284203745.244679705714816; Fri, 12 Jul 2024 04:14:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEDo-0004nV-Ib; Fri, 12 Jul 2024 07:13:52 -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 1sSEDm-0004f3-5h for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:13:51 -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 1sSEDh-0007CG-Ul for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:13:49 -0400 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL8881dD8z6JB6Q; Fri, 12 Jul 2024 19:12:40 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 30947140A86; Fri, 12 Jul 2024 19:13:44 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:13:43 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 10/13] hw/acpi: Generic Port Affinity Structure support Date: Fri, 12 Jul 2024 12:08:14 +0100 Message-ID: <20240712110837.1439736-11-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782842290116600 Content-Type: text/plain; charset="utf-8" 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 discoverable mechanism such as UEFI CDAT read from CXL devices and switches is used to discover the remainder of the path, and the OS can build up full latency and bandwidth numbers as need for work and data placement decisions. Acked-by: Markus Armbruster Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron --- v5: Push the definition of TYPE_ACPI_GENERIC_PORT down into the c file (similar to TYPE_ACPI_GENERIC_INITIATOR in earlier patch) --- qapi/qom.json | 34 +++++++++ include/hw/acpi/aml-build.h | 4 + include/hw/acpi/pci.h | 2 +- include/hw/pci/pci_bridge.h | 1 + hw/acpi/aml-build.c | 40 ++++++++++ hw/acpi/pci.c | 112 +++++++++++++++++++++++++++- hw/arm/virt-acpi-build.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 1 - 9 files changed, 193 insertions(+), 5 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index 8e75a419c3..b97c031b73 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -838,6 +838,38 @@ '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: # @@ -1031,6 +1063,7 @@ { 'enum': 'ObjectType', 'data': [ 'acpi-generic-initiator', + 'acpi-generic-port', 'authz-list', 'authz-listfile', 'authz-pam', @@ -1106,6 +1139,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/aml-build.h b/include/hw/acpi/aml-build.h index 33eef85791..9e30c735bb 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -490,6 +490,10 @@ void build_srat_pci_generic_initiator(GArray *table_da= ta, int node, uint16_t segment, uint8_t bus, uint8_t devfn); =20 +void build_srat_acpi_generic_port(GArray *table_data, int node, + const char *hid, + uint32_t uid); + void build_slit(GArray *table_data, BIOSLinker *linker, MachineState *ms, const char *oem_id, const char *oem_table_id); =20 diff --git a/include/hw/acpi/pci.h b/include/hw/acpi/pci.h index 3015a8171c..6359d574fd 100644 --- a/include/hw/acpi/pci.h +++ b/include/hw/acpi/pci.h @@ -41,6 +41,6 @@ Aml *aml_pci_device_dsm(void); void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus); void build_pci_bridge_aml(AcpiDevAmlIf *adev, Aml *scope); =20 -void build_srat_generic_pci_initiator(GArray *table_data); +void build_srat_generic_affinity_structures(GArray *table_data); =20 #endif 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/aml-build.c b/hw/acpi/aml-build.c index 968b654e58..4067100dd6 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1955,6 +1955,19 @@ static void build_append_srat_pci_device_handle(GArr= ay *table_data, build_append_int_noprefix(table_data, 0, 12); } =20 +static void build_append_srat_acpi_device_handle(GArray *table_data, + const char *hid, + uint32_t uid) +{ + assert(strlen(hid) =3D=3D 8); + /* Device Handle - ACPI */ + for (int i =3D 0; i < sizeof(hid); i++) { + build_append_int_noprefix(table_data, hid[i], 1); + } + build_append_int_noprefix(table_data, uid, 4); + build_append_int_noprefix(table_data, 0, 4); +} + /* * ACPI spec, Revision 6.3 * 5.2.16.6 Generic Initiator Affinity Structure @@ -1982,6 +1995,33 @@ void build_srat_pci_generic_initiator(GArray *table_= data, int node, build_append_int_noprefix(table_data, 0, 4); } =20 +/* + * ACPI spec, Revision 6.5 + * 5.2.16.7 Generic Port Affinity Structure + * With ACPI Device Handle. + */ +void build_srat_acpi_generic_port(GArray *table_data, int node, + const char *hid, + uint32_t uid) +{ + /* Type */ + build_append_int_noprefix(table_data, 6, 1); + /* Length */ + build_append_int_noprefix(table_data, 32, 1); + /* Reserved */ + build_append_int_noprefix(table_data, 0, 1); + /* Device Handle Type: ACPI */ + build_append_int_noprefix(table_data, 0, 1); + /* Proximity Domain */ + build_append_int_noprefix(table_data, node, 4); + /* Device Handle */ + build_append_srat_acpi_device_handle(table_data, hid, uid); + /* Flags - GP Enabled */ + build_append_int_noprefix(table_data, 1, 4); + /* Reserved */ + build_append_int_noprefix(table_data, 0, 4); +} + /* * ACPI spec 5.2.17 System Locality Distance Information Table * (Revision 2.0 or later) diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index 3e1db161cc..020ad53c03 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -30,6 +30,7 @@ #include "hw/boards.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/pci.h" +#include "hw/pci/pci_bridge.h" #include "hw/pci/pci_device.h" #include "hw/pci/pcie_host.h" =20 @@ -177,9 +178,118 @@ static int build_acpi_generic_initiator(Object *obj, = void *opaque) return 0; } =20 -void build_srat_generic_pci_initiator(GArray *table_data) +typedef struct AcpiGenericPort { + /* private */ + Object parent; + + /* public */ + char *pci_bus; + uint16_t node; +} AcpiGenericPort; + +typedef struct AcpiGenericPortClass { + ObjectClass parent_class; +} AcpiGenericPortClass; + +#define TYPE_ACPI_GENERIC_PORT "acpi-generic-port" + +OBJECT_DEFINE_TYPE_WITH_INTERFACES(AcpiGenericPort, acpi_generic_port, + ACPI_GENERIC_PORT, OBJECT, + { TYPE_USER_CREATABLE }, + { NULL }) + +OBJECT_DECLARE_SIMPLE_TYPE(AcpiGenericPort, ACPI_GENERIC_PORT) + +static void acpi_generic_port_init(Object *obj) +{ + AcpiGenericPort *gp =3D ACPI_GENERIC_PORT(obj); + + gp->node =3D MAX_NODES; + gp->pci_bus =3D NULL; +} + +static void acpi_generic_port_finalize(Object *obj) +{ + AcpiGenericPort *gp =3D ACPI_GENERIC_PORT(obj); + + g_free(gp->pci_bus); +} + +static void acpi_generic_port_set_pci_bus(Object *obj, const char *val, + Error **errp) +{ + AcpiGenericPort *gp =3D ACPI_GENERIC_PORT(obj); + + gp->pci_bus =3D g_strdup(val); +} + +static void acpi_generic_port_set_node(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + AcpiGenericPort *gp =3D ACPI_GENERIC_PORT(obj); + uint32_t value; + + if (!visit_type_uint32(v, name, &value, errp)) { + return; + } + + if (value >=3D MAX_NODES) { + error_printf("%s: Invalid NUMA node specified\n", + TYPE_ACPI_GENERIC_INITIATOR); + exit(1); + } + + gp->node =3D value; +} + +static void acpi_generic_port_class_init(ObjectClass *oc, void *data) +{ + object_class_property_add_str(oc, "pci-bus", NULL, + acpi_generic_port_set_pci_bus); + object_class_property_add(oc, "node", "int", NULL, + acpi_generic_port_set_node, NULL, NULL); +} + +static int build_acpi_generic_port(Object *obj, void *opaque) +{ + MachineState *ms =3D MACHINE(qdev_get_machine()); + const char *hid =3D "ACPI0016"; + GArray *table_data =3D opaque; + AcpiGenericPort *gp; + uint32_t uid; + Object *o; + + if (!object_dynamic_cast(obj, TYPE_ACPI_GENERIC_PORT)) { + return 0; + } + + gp =3D ACPI_GENERIC_PORT(obj); + + if (gp->node >=3D ms->numa_state->num_nodes) { + error_printf("%s: node %d is invalid.\n", + TYPE_ACPI_GENERIC_PORT, gp->node); + exit(1); + } + + o =3D object_resolve_path_type(gp->pci_bus, TYPE_PXB_CXL_BUS, NULL); + if (!o) { + error_printf("%s: device must be a CXL host bridge.\n", + TYPE_ACPI_GENERIC_PORT); + exit(1); + } + + uid =3D object_property_get_uint(o, "acpi_uid", &error_fatal); + build_srat_acpi_generic_port(table_data, gp->node, hid, uid); + + return 0; +} + +void build_srat_generic_affinity_structures(GArray *table_data) { object_child_foreach_recursive(object_get_root(), build_acpi_generic_initiator, table_data); + object_child_foreach_recursive(object_get_root(), build_acpi_generic_p= ort, + table_data); } diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index a50b00b7c1..d98651df55 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -510,7 +510,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) } } =20 - build_srat_generic_pci_initiator(table_data); + build_srat_generic_affinity_structures(table_data); =20 if (ms->nvdimms_state->is_enabled) { nvdimm_build_srat(table_data); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2eaa4c9203..7f5ca188c1 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2048,7 +2048,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, Ma= chineState *machine) build_srat_memory(table_data, 0, 0, 0, MEM_AFFINITY_NOFLAGS); } =20 - build_srat_generic_pci_initiator(table_data); + build_srat_generic_affinity_structures(table_data); =20 /* * Entry is required for Windows to enable memory hotplug in OS diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index b94cb85cfb..cd7f2d5423 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.43.0 From nobody Mon Sep 16 18:57:06 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=1720782875; cv=none; d=zohomail.com; s=zohoarc; b=mDYFuZ3nwarV75KEpfb2YIeLI2+irlMt+lJbzjsG4OWdV2wHkTJUnjXW7DaYUJSSsoB8MXX8JDEKlkfU8TXCHc9OJ0apHsRbPkxNFEGFePljHtcqnkYBrg5h3TBEZjBf5+MBivqHvKn4IM/oHCQg2D9YWOGgl6CqBMFFudfXqoM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782875; 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=zOGz0tSzMRxQuR3OnPgMi2qQDR6SyLJXxGweQJ2DWt0=; b=i1arQIXgqEqQtHiYCjjubKdq0VVttQprfBKu3CQTiOijNhKif1Zl9Rnj38gaSzaYTPMt4fUFUOyf+0bbn8nYkCPTOLado7oJzK/6fGA5ZNmOxiiySmhkAJufaeXWqEs7CF1Oi0rM0W6x7GFs5C9S5+w5ujCvo7gJrTt2WbeLlBY= 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 172078287563739.67574577392884; Fri, 12 Jul 2024 04:14:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEEN-0007V1-M2; Fri, 12 Jul 2024 07:14:27 -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 1sSEEK-0007JS-O4 for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:14:25 -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 1sSEEI-0007MN-Vf for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:14:24 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL87X0kRwz6K982; Fri, 12 Jul 2024 19:12:08 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id D4564140B63; Fri, 12 Jul 2024 19:14:14 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:14:14 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 11/13] bios-tables-test: Allow for new acpihmat-generic-x test data. Date: Fri, 12 Jul 2024 12:08:15 +0100 Message-ID: <20240712110837.1439736-12-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782877112116600 Content-Type: text/plain; charset="utf-8" The test to be added exercises many corner cases of the SRAT and HMAT table generation. Signed-off-by: Jonathan Cameron --- v5: No change. --- tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++ tests/data/acpi/x86/q35/APIC.acpihmat-generic-x | 0 tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x | 0 tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x | 0 tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x | 0 tests/data/acpi/x86/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..3c0967078f 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/x86/q35/APIC.acpihmat-generic-x", +"tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x", +"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x", +"tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x", +"tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x", diff --git a/tests/data/acpi/x86/q35/APIC.acpihmat-generic-x b/tests/data/a= cpi/x86/q35/APIC.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x b/tests/data/a= cpi/x86/q35/CEDT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x b/tests/data/a= cpi/x86/q35/DSDT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x b/tests/data/a= cpi/x86/q35/HMAT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x b/tests/data/a= cpi/x86/q35/SRAT.acpihmat-generic-x new file mode 100644 index 0000000000..e69de29bb2 --=20 2.43.0 From nobody Mon Sep 16 18:57:06 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=1720782910; cv=none; d=zohomail.com; s=zohoarc; b=jOh7ryWSQFFgK+ElT525jjMMY5s2VPFFZDs85OSjVqcfr8RxaAzOjFyTYPlv9wPTPH4HOL6nye7Mw9j4oquvIInsDA5+uOLS5j7rQAc00h0Dc5y+7/2NzgEEgA3BInCWIzJqJuoI5Zkd2zfR/ygvuQGr40rF6qH51YYXTKFos7k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782910; 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=FO05azqwrFgn8wC0qVm690g/MlxNaYg+7QynvFhCU40=; b=gfRwf7dj9kDFpFTuw7bHcAW/k2uiFwfzNR/vCIl2IWLJoubQxtKWR0eT9KAdu5NiuwohTe3QfD/7gcm4+ROBvfJvbeMJJ252quo/ypRrhkt0J24xwjWPU/xHcmL44tONKX9HlOJTlrk6aouOvvy94H7J9ka0Dch97xtbRG/5npM= 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 1720782910668175.0770872865504; Fri, 12 Jul 2024 04:15:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEEm-0000qr-C3; Fri, 12 Jul 2024 07:14:52 -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 1sSEEj-0000eT-2Y for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:14:49 -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 1sSEEh-0007VO-0q for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:14:48 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL89K2hcrz6JB3x; Fri, 12 Jul 2024 19:13:41 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 5666B140B63; Fri, 12 Jul 2024 19:14:45 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:14:44 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 12/13] bios-tables-test: Add complex SRAT / HMAT test for GI GP Date: Fri, 12 Jul 2024 12:08:16 +0100 Message-ID: <20240712110837.1439736-13-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782912559116600 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 --- v5: No change --- tests/qtest/bios-tables-test.c | 97 ++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index f4c4704bab..ff2e4c030c 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1924,6 +1924,101 @@ 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.arch =3D "x86"; + 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 pcie-root-port,chassis=3D1,id=3Dpci.1" + " -device pci-testdev,bus=3Dpci.1," + "multifunction=3Don,addr=3D00.0" + " -device pci-testdev,bus=3Dpci.1,addr=3D00.1" + " -device pci-testdev,bus=3Dpci.1,id=3Dgidev,addr=3D00.2" + " -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, const char *arch) { @@ -2380,6 +2475,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.43.0 From nobody Mon Sep 16 18:57:06 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=1720782950; cv=none; d=zohomail.com; s=zohoarc; b=jOkrWQjWLw9iz+KMICUFZrf1EWiusz7uxFNtmjeD7uiGgb4U3ZMZB3sUnW6jQCCWK04ktPlO1f97F0oTNLFzHWuZL+dVbIy7fvuA8NXcm/JqMoRjPXH2iWLcOC/Kepf7/PTm/eZTAdB36gNMsC7iWwPL5qVc0zqbTOyW743HrXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720782950; 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=Bwid2e+FHrWz95cc6Z2+HkV9dZ3j9/dKZ5Ka0c0CZ34=; b=B2zS0jxvatigghMZxn8ZFu1acmTuZgx9bmPJ8j3Yl7NhppV5Tu7JBdolU2rfynhpSYGIIUTwzYSQlv10j81hi8Qp8P/6J5pO3myKnF6WPwYF6IV/9fmMi1rjulcLyodYZjO0Z41+QBZ4Qqb8MiW/IkkDnCeE1ORc4QJXIiNPE90= 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 1720782950046823.9706773390577; Fri, 12 Jul 2024 04:15:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEFQ-0003Tk-4I; Fri, 12 Jul 2024 07:15:32 -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 1sSEFF-0003ER-Jz for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:15:21 -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 1sSEFC-0007yw-EW for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:15:21 -0400 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WL89N0y04z6K5xG; Fri, 12 Jul 2024 19:13:44 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id E18C5140CB1; Fri, 12 Jul 2024 19:15:15 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.19.247) 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, 12 Jul 2024 12:15:15 +0100 To: , , Markus Armbruster , , CC: , , , , Richard Henderson , Dave Jiang , Huang Ying , Paolo Bonzini , , Michael Roth , Ani Sinha Subject: [PATCH v5 13/13] bios-tables-test: Add data for complex numa test (GI, GP etc) Date: Fri, 12 Jul 2024 12:08:17 +0100 Message-ID: <20240712110837.1439736-14-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> References: <20240712110837.1439736-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.19.247] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) 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_H3=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: 1720782950790116600 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 ... [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 ... some zero length entries follow... [1A0h 0416 001h] Subtable Type : 05 [Generic Initiator Affini= ty] [1A1h 0417 001h] Length : 20 [1A2h 0418 001h] Reserved1 : 00 [1A3h 0419 001h] Device Handle Type : 01 [1A4h 0420 004h] Proximity Domain : 00000001 [1A8h 0424 010h] Device Handle : 00 00 01 02 00 00 00 00 00 0= 0 00 00 00 00 00 00 [1B8h 0440 004h] Flags (decoded below) : 00000001 Enabled : 1 Architectural Transactions : 0 [1BCh 0444 004h] Reserved2 : 00000000 [1C0h 0448 001h] Subtable Type : 06 [Generic Port Affinity] [1C1h 0449 001h] Length : 20 [1C2h 0450 001h] Reserved1 : 00 [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 [1D8h 0472 004h] Flags (decoded below) : 00000001 Enabled : 1 Architectural Transactions : 0 [1DCh 0476 004h] Reserved2 : 00000000 [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 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] Length : 00000078 [0F8h 0248 001h] Flags (decoded below) : 00 Memory Hierarchy : 0 Use Minimum 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 --- v5: No change --- tests/qtest/bios-tables-test-allowed-diff.h | 5 ----- tests/data/acpi/x86/q35/APIC.acpihmat-generic-x | Bin 0 -> 136 bytes tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x | Bin 0 -> 68 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 0 -> 10849 bytes tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x | Bin 0 -> 360 bytes tests/data/acpi/x86/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 3c0967078f..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/x86/q35/APIC.acpihmat-generic-x", -"tests/data/acpi/x86/q35/CEDT.acpihmat-generic-x", -"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x", -"tests/data/acpi/x86/q35/HMAT.acpihmat-generic-x", -"tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x", diff --git a/tests/data/acpi/x86/q35/APIC.acpihmat-generic-x b/tests/data/a= cpi/x86/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/x86/q35/CEDT.acpihmat-generic-x b/tests/data/a= cpi/x86/q35/CEDT.acpihmat-generic-x index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..31c9011663639b4a0f4816f3b2b= 06398f94682f7 100644 GIT binary patch literal 68 zcmZ>EbqR4{U|?Xhb@F%i2v%^42yj*a0!E-1hz+6{7!(*BfFy(s;xkNuupuM>Q=3Dd{4os07s24o#@ar}_>j&abw(FZ2&Tl-M-Er@~Sp?xz@6g{9ofjsmjj}3~rKoRx# z&Fs=3DMBn8AkY6H}Kv)}Lg<~KV#zuDRGnqI5>CS&|(#dWvR%oVTJ-5maL#u%09uU$=3DD zW9>b!SnlvlBE{SHGop;2qTzhqD{hqeU+o0n4}uTB9q?|*HoveRZFa*?9t4|=3DoNjN1 zrbz|+(qgAs?6mi*^L4kHH#(K7XBD2BhS70lDQR>zsvdJ{)1CFEn|gSYx!!xr{k3#& zXJOH_+y1|w`Q@n-7ry`AhlMBK{I@@Tc+*V5VFiB;{5=3D!WPjELdPX>Ma^WHAMM{sd% zxxe^%Ph6IDHeCq=3Ds(Eb5DhjncxanLn?=3DduA$-}&eNY@Ykr z|Lo|`{g-~?`h%c9{b<)r41&UlT6%)q|UTsUQ(`1Vo8Eb4Ol_xA?}2S1iYX5V3U&3TJDk2m8^qjP`F)^?*5FD*!Xei(-ZJ6GXm&Q=3DF-b{`96^ zs6)|fltgqOemL92ZMfIlWW7xbeRII>b$Rz*_YOCwpLcNob*=3DYD0)(6LHW>A)yUHA^ zgTFl7AfT(z}JB__)p{qgl`cse>y zm@3aB8qXsd&m%fdm@3aDjpvfab4lk3Q{@R6lXI4sm5ypWkLo;OsyvTrJdbHSkLf&N zsyts3$U-y|z9f*vXtH}rBHiaEA-%}=3DxQ0BgA&=3D`wm@4vR4f(Q$d|5}rRFNk%k*{dTS2W}+IufReJSmXz9Dh=3DKGeX7f<47u9hXM*SrUn6(zOjHRt|Xw+ zbts@P(VAF5rEg?WPDG6rlaO(bk$}QPi-a!(RQg6%#8DtgK&5MJsyrc}GOR#CKowUK zP?)hQl7PaDc|t&?uRuaT6;~2a=3D_+!PfWnM z5KzUH1XQ{TBnc?Y_|PL0!ac2Gv)~amA(QA0aaW{K&7idl7PaDc|t&?uRuaT6;~2a=3D_-&U zpfF>e5K!qWkPuMCl>}6}3M2_A%$O$xRQd`e1XOV)0hO)-NdgKp<_Q6nz5)pWRa{9x zrK>=3DafWnM5KzUH1XQ{TBnc?Ym?s2O`U)fj zRBN)5>V+XkR+fmW1bLD z=3D_`;BP{ox5RJsZz2`J2%Cj?ab3M2$naU}tjt^!E{3Nz*j0hPW22?14HNkFBmK$3vM zjCn#pVJQL%OBGONH1XMwi zfGS85Pz4DARge%+1xW&`AW1+KBm@*ze0L$BuyDsjXOe)z#BGR8LdJay0fiO!Ed&%+ z+_xm4Fyp=3D@0fmV@kmDUlDC=3D82@v=3DIg7t+U5^rzq~RxjiIzdv)=3D+}mLTb7o*>oU_%- zZes?r+sH4>nVIiQu^F+IaECplIx~&mYIt|YoM%)*phmvEUz>)`7vh~5YhLcZ7)ae* zSTYyCGsk9da94I7e})57sy^zvKK}6BHE{BFFKR67u)+jahH2B*oBI?n~4`l?<(nC zk=3D`9i?;eugjnaD~Z)2Ck`{i>3FRis}XNxynX`qe0Xc{Kgh3#2bA>B}O0c_e-Lko4s!ePuNL^b4e~ zDCsLAePtwl<&g9hq)*XwG@9O)>Ep=3D*O9MRaa&uCzbEd>2k3aNWN8v^vV{<_dhxNi( zI9WF_+}LxO)x%*CF&0kNO$;~ooGt3%u(B8nC+jAL8+&dXJsg%BW8q}o#BgKJ!4W+i z)*xfyWZlGYW8->B4~K=3DxSU6cXG2GZVJ*tPpYGo{(tkc8Uz9F~&OGc$$YQ@8kW6GmV z|Mp&`-trk%-cNs(Vc5F1$zHrtTJv)ChS$kC=3DY{fwR1<_$)%`dy?VxXc)(coKz<%t2 z_2)k8b=3Dmj27W>(Mrw0&6NE&UgFPL+m;uVB~GrX)}L*40=3D>+(L%7TkI@pU-L}IZe9Q2{oA*;u7AMV+^yFxMGwua zX_ony)|VEy?tmSpb?n)HX_;30{u^WzSkA4N*0@_;YjU^YU*Xt!&(qH;XGz!fJ?!ph z$usFTOSK%_y+SL8ZR_e<)d(3?w)Zc-drf>8K!ao>BR0!aO@l{iBaYYjL}_e$b!kbMNn)Udd{<$$XF=3DB9Asi9*%gNwl3-lETOrIh?0M*%n477c|hBxo;BCN~xf z?YX@5xz=3D83IqfAR-3*6FEd^tA^A z+ZfRB#*^U}S_>J|VA#;0WwJAe500%2kzqT#H!#6n^;!FqT8f?!v5wXPV2wHqz_|#J z=3D|m52o-4t49L!9%KUt?}E7+c*gtO0^Lu<}qxI{vPvxec!1cW_qoS7H~Ogk^*$;TYl zDdksKG+ogwKqDWboK|KqzfzY9C_XwCFw@Cd%)kDp@87zU+Zmh4h#x3SMbwxa}GX1 zV*ucxq&6{9h)kRN;?rkg%175J*YNzeU!`jY2VeaDqks@$Kmq%UJ((SkQouvel*dbb zrze|3we(Pubt~YQ11ZRWJHPFd2q(|{TA6=3DR4#~0{^78ON;SGx z>wD8Zs>T3noLL!uA|FyFszj403VLT&OcUWd;Dq8Fuu*Xd4eErHnJ$MEoGymcPP!D` zA%YEy=3Dg&H?VI2B=3D^ag}9I^&xfIB#HJwNhhFyEN#+8#L-AEE5hkyA;bHB?>w6j$bR9Mge-Axf*i2Y!jvvB)CK#Q6|ASLFAnSC(J5?J-K3;0iJjJ5fCTHfw*+Qoya-QahaGb6`6 zHoe~I;ADx_&&&S$;s0F!#ee+GpI!LjjeoE*>)&l)lE1+QIKjjFbG;jUkTnuKn@TWl z`$wdDiK8Ck{orE8{KvQJ0cI64K{6%!->Da9Pgcbzw__26@iQMQ9)-LF*_P(3KDnK5m z8c|`YS6)x>{?#g&8AaT4Q@JUQ<3)InNYyL#hU{uOne=3D>-fKHn5sxuzziS@+dSSZ+E zy@rRdd8U({O3~T~<+Givkunn)X=3DI(FD@4Hlz2~=3D~z5mwgd#-#Fp1oZ1H?VSBA@7kE z+i5#ZFI0A6Ma&6yb(!vBdq306=3DQ~EH;5ESJ&1U`^(!d?#46oo`rjTQ>VvJ8c-4y&18kp>oRMXUrcR#PHzp}DcfoUe)j8PX`jy8}5q2r&HV z;)8&*0iA@xM0_(qJIFsPCS*EtMZQ!g;vwO0G#=3DXgn~LYW>0McCCHk4WJDhz=3D)bRp2 zx!m5LZ!SN-4M`ehPIL8n%_({h7^=3Dxrccuey!QS|t=3D@uG%GfE4O{gl~1QcJ}oGtT@k{=3D}vr14D!kS;)9?nsI8*d~>xR$D);B=3Dt`<6Miog^ zP=3D^lB4BD^LAa_pH-L)2i(5XJUkLc$O9u+(@>EJLSuK&?nh pJ=3Dk8L!N~R^yOS7uPXNsZ*=3DNL%!XOExQ-JsckOiV);t2K$1^{D&4*>uG literal 0 HcmV?d00001 diff --git a/tests/data/acpi/x86/q35/SRAT.acpihmat-generic-x b/tests/data/a= cpi/x86/q35/SRAT.acpihmat-generic-x index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b45838adb7d304f8a36c38c90d8= 9f3629ec48353 100644 GIT binary patch literal 520 zcmWFzatz^MVqjn_cJg=3Dj2v%^42yj*a0!9V~1`r!WgD@Njp!1m-QRP{gkok-naGg*F z7hC|lI-mt$@PQeo5LF!uOc=3D(1(J1c3v=3D^ogl^*QsSQQwc;mZh&B?N$l37Y}~14zQr eIl$Avz|hPAsstv_sKE*qfydhfm;gM0fdT+OoeTj0 literal 0 HcmV?d00001 --=20 2.43.0