From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id AE0357803D9 for ; Tue, 21 Nov 2023 16:50:50 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=XUSuIXi3jlbMQeoRGeUikO0CzWDoFnSv0x7I96aoyHg=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1700585449; v=1; b=qbWHbE2zh/BmL6K4KPdYjx9Se2f3s+biRUAwmlirMmWeWUHnkpokqg9sVB8AeCDoNlpFgmaK frmLsye41KaRofQ1nlKhmp0tC0tfoVxLlA91MS2AlzJ66kamdyYJ3Df0GdGWtXMy2jpimkwjV9d J3aULMWg8zts4i2XHMuECAWM= X-Received: by 127.0.0.2 with SMTP id lRQiYY7687511xAes8GfwXy7; Tue, 21 Nov 2023 08:50:49 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.46878.1700585448803493903 for ; Tue, 21 Nov 2023 08:50:49 -0800 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 41276168F; Tue, 21 Nov 2023 08:51:35 -0800 (PST) X-Received: from e126645.nice.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 06B443F6C4; Tue, 21 Nov 2023 08:50:46 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v3 11/11] DynamicTablesPkg: Remove check for _CPC field Date: Tue, 21 Nov 2023 17:50:07 +0100 Message-Id: <20231121165007.1546858-12-pierre.gondois@arm.com> In-Reply-To: <20231121165007.1546858-1-pierre.gondois@arm.com> References: <20231121165007.1546858-1-pierre.gondois@arm.com> MIME-Version: 1.0 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 Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: lCpzC5unhegFz1HUTE8tEtCMx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=qbWHbE2z; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io When generating _CPC objects, some fields are mandatory by spec [1]. Some fields cannot be supported by a the Juno platform, which is used to test the _CPC generation. Therefore, don't prevent the generation of _CPC objects if the fields below are missing, and let the OS handle the missing information. _CPC fields that are exempted from checks: - PerformanceLimitedRegister - ReferencePerformanceCounterRegister - DeliveredPerformanceCounterRegister Also warn if one of the following optional fields is missing: - HighestPerformance[Buffer|Integer] - NominalPerformance[Buffer|Integer] [1] Cf. non-optional fields in: ACPI 6.5, s8.4.6.1 '_CPC (Continuous Performance Control)' Signed-off-by: Pierre Gondois --- .../Common/AmlLib/CodeGen/AmlCodeGen.c | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index a96d2b8a048a..9b72c4408016 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -3531,6 +3531,21 @@ AmlCreateCpcNode ( return EFI_INVALID_PARAMETER;=0D }=0D =0D + // The following fields are theoretically mandatory, but not supported=0D + // by some platforms. Just warn if they are missing:=0D + // - PerformanceLimitedRegister=0D + // - ReferencePerformanceCounterRegister=0D + // - DeliveredPerformanceCounterRegister=0D + if (IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister) ||=0D + IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegister)= ||=0D + IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegister)= ) {=0D + DEBUG ((=0D + DEBUG_WARN,=0D + "Missing PerformanceLimited|ReferencePerformanceCounter|"=0D + "DeliveredPerformanceCounter field in _CPC object\n"=0D + ));=0D + }=0D +=0D if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) &&=0D (CpcInfo->HighestPerformanceInteger =3D=3D 0)) ||=0D (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) &&=0D @@ -3539,13 +3554,19 @@ AmlCreateCpcNode ( (CpcInfo->LowestNonlinearPerformanceInteger =3D=3D 0)) ||=0D (IsNullGenericAddress (&CpcInfo->LowestPerformanceBuffer) &&=0D (CpcInfo->LowestPerformanceInteger =3D=3D 0)) ||=0D - IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister) ||=0D - IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegister)= ||=0D - IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegister)= ||=0D - IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister))=0D + IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister))=0D {=0D ASSERT (0);=0D return EFI_INVALID_PARAMETER;=0D + } else if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) &&= =0D + (CpcInfo->HighestPerformanceInteger =3D=3D 0)) ||=0D + (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) &&= =0D + (CpcInfo->NominalPerformanceInteger =3D=3D 0)))=0D + {=0D + DEBUG ((=0D + DEBUG_WARN,=0D + "Missing Reference|Delivered performance field in _CPC object\n"=0D + ));=0D }=0D =0D CpcPackage =3D NULL;=0D --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111578): https://edk2.groups.io/g/devel/message/111578 Mute This Topic: https://groups.io/mt/102732035/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-