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 A1D4C740054 for ; Thu, 2 Nov 2023 10:20:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Hfqeu3KqvVGZq/JeUv9rss9eF4RQRaA9iQ20gL6Chlg=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:From:Subject:To:Cc:References: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=1698920421; v=1; b=W5ALKYtY341rUYN1G2Mf9mOz+Nc0FKWNEs6b2lrqm/tAK8L39JMPo90886j1fEhrYEVe5/ym qLStpWR0AwcDdWRNUBBy3Yl8LFWNsvBXEGOKT7oBT6rknA/tDafZE6cH7DpxiT5AMnA/Pi1BPvo h1P+/XieLyu6bQ5zLg7n1GPc= X-Received: by 127.0.0.2 with SMTP id 6HVEYY7687511xBfb8B830C5; Thu, 02 Nov 2023 03:20:21 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.27688.1698920420756065997 for ; Thu, 02 Nov 2023 03:20:20 -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 89B732F4; Thu, 2 Nov 2023 03:21:02 -0700 (PDT) X-Received: from [10.34.100.114] (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 75BC33F67D; Thu, 2 Nov 2023 03:20:19 -0700 (PDT) Message-ID: Date: Thu, 2 Nov 2023 11:20:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: "PierreGondois" Subject: Re: [edk2-devel] [PATCH v2 11/11] DynamicTablesPkg: Remove check for _CPC field To: Leif Lindholm Cc: devel@edk2.groups.io, Sami Mujawar , Ard Biesheuvel , Michael D Kinney , Liming Gao References: <20231025112540.1654844-1-pierre.gondois@arm.com> <20231025112540.1654844-12-pierre.gondois@arm.com> In-Reply-To: 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: dghLyYdZgkixOaDI6QLtEv9Fx7686176AA= 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=W5ALKYtY; 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 On 10/26/23 13:05, Leif Lindholm wrote: > On Wed, Oct 25, 2023 at 13:25:40 +0200, pierre.gondois@arm.com wrote: >> From: Pierre Gondois >> >> When generating _CPC objects, some fields are mandatory. >=20 > Mandatory by spec or mandatory by current API? > If the former, could we either warn or add a Pcd to enable the more > lenient behaviour? They are mandatory by spec. These are actually the fields that are not described as optional in: 8.4.6.1 _CPC (Continuous Performance Control) E.g.: 'Time Window Register': 'Optional. If supported, contains ...' I will add a warning to signal them. Regards, Pierre >=20 > / > Leif >=20 >> Some fields cannot be supported by a the Juno platform, which is used >> to test the _CPC generation. Therefore, don't prevent from generating >> _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 >> >> Signed-off-by: Pierre Gondois >> --- >> .../Common/AmlLib/CodeGen/AmlCodeGen.c | 19 +++++++++++++++---- >> 1 file changed, 15 insertions(+), 4 deletions(-) >> >> diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c= b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c >> index f350083b148c..423e64f12606 100644 >> --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c >> +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c >> @@ -3531,6 +3531,11 @@ AmlCreateCpcNode ( >> return EFI_INVALID_PARAMETER; >> } >> =20 >> + // The following fields are theoretically mandatory, but not supporte= d >> + // by some platforms. Don't check them: >> + // - PerformanceLimitedRegister >> + // - ReferencePerformanceCounterRegister >> + // - DeliveredPerformanceCounterRegister >> if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) && >> (CpcInfo->HighestPerformanceInteger =3D=3D 0)) || >> (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) && >> @@ -3539,13 +3544,19 @@ AmlCreateCpcNode ( >> (CpcInfo->LowestNonlinearPerformanceInteger =3D=3D 0)) || >> (IsNullGenericAddress (&CpcInfo->LowestPerformanceBuffer) && >> (CpcInfo->LowestPerformanceInteger =3D=3D 0)) || >> - IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister) || >> - IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegist= er) || >> - IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegist= er) || >> - IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister)) >> + IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister)) >> { >> ASSERT (0); >> return EFI_INVALID_PARAMETER; >> + } else if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer)= && >> + (CpcInfo->HighestPerformanceInteger =3D=3D 0)) || >> + (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer)= && >> + (CpcInfo->NominalPerformanceInteger =3D=3D 0))) >> + { >> + DEBUG (( >> + DEBUG_WARN, >> + "Missing Reference|Delivered performance field in _CPC object\n" >> + )); >> } >> =20 >> CpcPackage =3D NULL; >> --=20 >> 2.25.1 >> -=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 (#110517): https://edk2.groups.io/g/devel/message/110517 Mute This Topic: https://groups.io/mt/102175822/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-