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 D5833941518 for ; Mon, 29 Jan 2024 12:13:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ErAfTJKp0SLBke/rB2JVBEHiDBFdx+fKf/vuJpLsoQM=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706530437; v=1; b=HXh+VHZ7haZdx2noxUFCWzarnlQF3Rnw7IdfJF1SatbUL5qsD2uhIBae/tNf81ax9yxJucIb G/WjY5PXsq6x+iID2AN6HgCGGsDRUi89+h2we/1SN95fyhq7bgtff/C9KD6pwLjpBJASFr2AItF F0qW8/D9XSCC1UQw4mNqtLvA= X-Received: by 127.0.0.2 with SMTP id z1SwYY7687511xBW8ZEG22AH; Mon, 29 Jan 2024 04:13:57 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.13320.1706530436711147697 for ; Mon, 29 Jan 2024 04:13:56 -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 1DAE61FB; Mon, 29 Jan 2024 04:14:40 -0800 (PST) X-Received: from [10.34.100.129] (e126645.nice.arm.com [10.34.100.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F24203F5A1; Mon, 29 Jan 2024 04:13:55 -0800 (PST) Message-ID: <6dd2fae9-21bf-4a0a-974b-14e589150e4c@arm.com> Date: Mon, 29 Jan 2024 13:13:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v6 1/1] DynamicTablesPkg: Exempt some _CPC field from checks To: devel@edk2.groups.io Cc: Sami Mujawar References: <20240129120935.139976-1-pierre.gondois@arm.com> From: "PierreGondois" In-Reply-To: <20240129120935.139976-1-pierre.gondois@arm.com> 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: 1pSjfEXgQBY1GfhWObKntCU9x7686176AA= 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=20140610 header.b=HXh+VHZ7; 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 Hello Sami, Instead of re-sending the whole serie, only this patch was updated/re-submi= tted. The v5 of this patch is at: https://edk2.groups.io/g/devel/message/114421 Regards, Pierre On 1/29/24 13:09, Pierre Gondois wrote: > 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, rely on the > PcdDevelopmentPlatformRelaxations Pcd to either: > - warn about the missing fields and and let the OS handle the > missing information > - consider the missing fields as an error >=20 > _CPC fields that are exempted from checks when the Pcd is set: > - PerformanceLimitedRegister > - ReferencePerformanceCounterRegister > - DeliveredPerformanceCounterRegister >=20 > [1] Cf. non-optional fields in: > ACPI 6.5, s8.4.6.1 '_CPC (Continuous Performance Control)' >=20 > Signed-off-by: Pierre Gondois > --- >=20 > Notes: > v6: > Do not warn if one of the following fields is missing: > - HighestPerformanceBuffer > - NominalPerformanceBuffer > An error code should just be returned. >=20 > .../Library/Common/AmlLib/AmlLib.inf | 3 ++ > .../Common/AmlLib/CodeGen/AmlCodeGen.c | 28 ++++++++++++++++--- > 2 files changed, 27 insertions(+), 4 deletions(-) >=20 > diff --git a/DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf b/DynamicT= ablesPkg/Library/Common/AmlLib/AmlLib.inf > index 6d0aa6ff934c..f269691864d4 100644 > --- a/DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf > +++ b/DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf > @@ -71,6 +71,9 @@ [LibraryClasses] > BaseLib > MemoryAllocationLib > =20 > +[FixedPcd] > + gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdDevelopmentPlatformRelaxations > + > [BuildOptions] > *_*_*_CC_FLAGS =3D -DAML_HANDLE > =20 > diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c = b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > index 6f3f46e3b1ed..22c2d598d0d8 100644 > --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > @@ -3532,6 +3532,29 @@ AmlCreateCpcNode ( > return EFI_INVALID_PARAMETER; > } > =20 > + /// The following fields are theoretically mandatory, but not supporte= d > + /// by some platforms. > + /// - PerformanceLimitedRegister > + /// - ReferencePerformanceCounterRegister > + /// - DeliveredPerformanceCounterRegister > + /// Warn if BIT0 in PcdDevelopmentPlatformRelaxations is set, otherwis= e > + /// return an error. > + if (IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister) || > + IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegiste= r) || > + IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegiste= r)) > + { > + if ((PcdGet64 (PcdDevelopmentPlatformRelaxations) & BIT0) !=3D 0) { > + DEBUG (( > + DEBUG_WARN, > + "Missing PerformanceLimited|ReferencePerformanceCounter|" > + "DeliveredPerformanceCounter field in _CPC object\n" > + )); > + } else { > + ASSERT (0); > + return EFI_INVALID_PARAMETER; > + } > + } > + > if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) && > (CpcInfo->HighestPerformanceInteger =3D=3D 0)) || > (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) && > @@ -3540,10 +3563,7 @@ AmlCreateCpcNode ( > (CpcInfo->LowestNonlinearPerformanceInteger =3D=3D 0)) || > (IsNullGenericAddress (&CpcInfo->LowestPerformanceBuffer) && > (CpcInfo->LowestPerformanceInteger =3D=3D 0)) || > - IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister) || > - IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegiste= r) || > - IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegiste= r) || > - IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister)) > + IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister)) > { > ASSERT (0); > return EFI_INVALID_PARAMETER; -=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 (#114696): https://edk2.groups.io/g/devel/message/114696 Mute This Topic: https://groups.io/mt/104029707/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-