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 34282941282 for ; Tue, 12 Dec 2023 09:29:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3PlrPT20Y57FsP8CMXzCFDwQkcIir2BDIyZGmflZdNw=; 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=1702373391; v=1; b=m8Xp4K4BbT+MTwEnkmnz5JX0bvxU0jXnQ2cg0cEMLlRuuqJSsK4F6O4/zh3mogV6/wfsOpA5 fdTn9a6FvzX0QPCsNr/8XEGGxeV9T+UTIcNujVdshH77epTkg/pYFMk1iLw/WU94DpjUdbMJGpI wTnd/Tov8GGbQhCJbsp1iqrg= X-Received: by 127.0.0.2 with SMTP id CTjYYY7687511x1G2Plh8KPF; Tue, 12 Dec 2023 01:29:51 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.13010.1702373391225165940 for ; Tue, 12 Dec 2023 01:29:51 -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 51E87150C; Tue, 12 Dec 2023 01:30:37 -0800 (PST) X-Received: from e126645.arm.com (unknown [10.57.44.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6E8393F5A1; Tue, 12 Dec 2023 01:29:49 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ray Ni , Sami Mujawar , Leif Lindholm , Ard Biesheuvel Subject: [edk2-devel] [PATCH v4 10/10] DynamicTablesPkg: Remove check for _CPC field Date: Tue, 12 Dec 2023 10:28:47 +0100 Message-Id: <20231212092847.1253756-11-pierre.gondois@arm.com> In-Reply-To: <20231212092847.1253756-1-pierre.gondois@arm.com> References: <20231212092847.1253756-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: tiIWVBJKh4r9fscWYRVWZTjsx7686176AA= 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=m8Xp4K4B; 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 | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index 2b370320d244..cc258127b62e 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -3531,6 +3531,22 @@ 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 + {=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 +3555,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 (#112377): https://edk2.groups.io/g/devel/message/112377 Mute This Topic: https://groups.io/mt/103127056/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-