From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id B81CCAC1416 for ; Tue, 15 Apr 2025 15:31:00 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=1c1wIx+L7K2C1yebq/2zzNmpECmowA80SbjW8nbAyw0=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240830; t=1744731060; v=1; x=1744990259; b=kDPdFC+x1fGT+j7BWPTtRVyRHAf3otyuDk0vHHAIcpmnwiW6eHRAWaHDphYex9H42iXh/ydj JqVfH9+LXJsTXjwMizVG4YZzRpISBBrn294czfCb7j8YpyWA8nXP/b8ECBPsKCkU+tplU96dZGj fH75uAvvdFHTmTYY7uePWfrsNt4oW+Vw2rJDfInrJKkAwJuh0LW9ETN9nqN2FZfAB8PrNXalIII xrEduhvjgDuJOsb9zfE72MvAM1QNmKEzAztRkHWxcnAQGrGWPg1AY4gmRqJ877KpFopzGgb/M7w IBPPShZCQV8+2z7mvjt+NJWDXGP10BiUn8scFgju8VWDQ== X-Received: by 127.0.0.2 with SMTP id 96vtYY7687511xdKBRmMt5Ag; Tue, 15 Apr 2025 08:30:59 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.23181.1744731058447667442 for ; Tue, 15 Apr 2025 08:30:58 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2DE1415A1; Tue, 15 Apr 2025 08:30:56 -0700 (PDT) X-Received: from [10.34.111.157] (e126645.nice.Arm.com [10.34.111.157]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 43C1E3F59E; Tue, 15 Apr 2025 08:30:57 -0700 (PDT) Message-ID: <093b6132-098d-4a97-9a14-21458deec2d1@arm.com> Date: Tue, 15 Apr 2025 17:30:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] ACPI table generator unit test To: yodagump@google.com, devel@edk2.groups.io References: <682dc0ef-849b-4d94-b86e-1a0b80518a13@arm.com> <2395.1744303612205599529@groups.io> From: "PierreGondois via groups.io" In-Reply-To: <2395.1744303612205599529@groups.io> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 15 Apr 2025 08:30:58 -0700 Resent-From: pierre.gondois@arm.com Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: uc5evBnyQfBfAAKu8uR9f84px7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=kDPdFC+x; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Hello Sophia On 4/10/25 18:46, Sophia Wang via Groups.Io wrote: > Hi Pierre, > RegisterAcpiTableGenerator() never get called in Dbg2GeneratorGoogleTest.= cpp > In addition, in order to get the generator by calling RegisterAcpiTableGe= nerator() -> then call the BuildAcpiTableEx() callback, we need to define D= bg2Generator as non-static, however, in current upstream code, Dbg2Generato= r is defined as STATIC, please see the code below. > *STATIC* > CONST > ACPI_TABLE_GENERATOR =C2=A0Dbg2Generator =3D { > =C2=A0 // Generator ID > =C2=A0 CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdDbg2), > =C2=A0 // Generator Description > =C2=A0 L"ACPI.STD.DBG2.GENERATOR", > =C2=A0 // ACPI Table Signature > =C2=A0 EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE, > =C2=A0 // ACPI Table Revision supported by this Generator > =C2=A0 EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, > =C2=A0 // Minimum supported ACPI Table Revision > =C2=A0 EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, > =C2=A0 // Creator ID > =C2=A0 TABLE_GENERATOR_CREATOR_ID, > =C2=A0 // Creator Revision > =C2=A0 DBG2_GENERATOR_REVISION, > =C2=A0 // Build table function. Use the extended version instead. > =C2=A0 NULL, > =C2=A0 // Free table function. Use the extended version instead. > =C2=A0 NULL, > =C2=A0 // Extended Build table function. > =C2=A0 BuildDbg2TableEx, > =C2=A0 // Extended free function. > =C2=A0 FreeDbg2TableEx > }; > I doubt Dbg2GeneratorGoogleTest.cpp really tests the BuildAcpiTableEx() c= allback, please correct me if I am wrong. When modifying the test file, the test fails, so I assume the Generator is = registered --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/GoogleTest/Dbg2Gener= atorGoogleTest.cpp +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/GoogleTest/Dbg2Gener= atorGoogleTest.cpp @@ -577,7 +577,7 @@ protected: for (UINT32 i =3D 0; i < config.DeviceCount; i++) { CM_ARCH_COMMON_DBG2_DEVICE_INFO device =3D { 0 }; device.AddressResourceToken =3D mDevices.size () + 1; - device.PortType =3D EFI_ACPI_DBG2_PORT_TYPE_NET; + device.PortType =3D 999; device.PortSubtype =3D 0; device.AccessSize =3D EFI_ACPI_6_3_DWORD; CopyMem (device.ObjectName, "DBG2", sizeof (device.ObjectName) - 1)= ; and I think you can see the results in Build/CI_BUILDLOG.txt or Build/Dynam= icTablesPkg/BUILDLOG_DynamicTablesPkg.txt: """ INFO - [----------] 6 tests from Dbg2GeneratorAdversarialTest INFO - [ RUN ] Dbg2GeneratorAdversarialTest.InvalidMemoryRangeBaseAddr= ess INFO - DBG2: Register Generator. Status =3D Success INFO - INFO: GetEArchCommonObjSerialDebugPortInfo: Platform does not implem= ent EArchCommonObjSerialDebugPortInfo. Status =3D Not Found INFO - ERROR: DBG2: Memory range base address is 0. Index =3D 0 INFO - ERROR: DBG2: Failed to populate device 0. Status =3D Invalid Paramet= er INFO - DBG2: Deregister Generator. Status =3D Success INFO - [ OK ] Dbg2GeneratorAdversarialTest.InvalidMemoryRangeBaseAddr= ess (0 ms) INFO - [ RUN ] Dbg2GeneratorAdversarialTest.MemoryRangeTooLarge INFO - DBG2: Register Generator. Status =3D Success INFO - INFO: GetEArchCommonObjSerialDebugPortInfo: Platform does not implem= ent EArchCommonObjSerialDebugPortInfo. Status =3D Not Found INFO - ERROR: DBG2: Memory range length too large. Length =3D 0 INFO - ERROR: DBG2: Failed to populate device 0. Status =3D Invalid Paramet= er INFO - DBG2: Deregister Generator. Status =3D Success """ -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#121258): https://edk2.groups.io/g/devel/message/121258 Mute This Topic: https://groups.io/mt/111930977/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-