From nobody Tue Feb 10 06:58:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+112377+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112377+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1702373392; cv=none; d=zohomail.com; s=zohoarc; b=L6t+TZcQEkSXxN/y2BAlQPUAongFGwqQGTDBGlDIiC5G9hbxx6yVgX/4jrtVKfQHMbtusF0zAAW3+uNFCpmOFHas2QFyLwb/jn+L1y7b3jxubdK9mTaN+OaHTulFaZVpItwPRPQRJOgeA9cd6vvRUXdsjXLbqhDbvYL+bGoXieg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1702373392; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=+Q6dBlN9E3Li1zZjM+icTmU6yRy7lkzr+zyze9KDQEU=; b=JIBvJKtd7hzQmJs4Eki/Nca+g+ZnY+j7bXo/SeSMGiaGdEr/dCP1kV/1BssxSBjYPE+xFln4anY96JSZR9KGxQ9oJ+AaZwbfTzDmnan4Sdy9kPiWjP9Nb4QrZnuzMlth4+51kQnTJiX78yJSqJT+DLanpS3LbDhg2DqEvbevO5s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112377+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1702373392249170.0640262311572; Tue, 12 Dec 2023 01:29:52 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=fK/8gl5wc081XpAF4TxJbympEO4t619GhQMFmLA3O90=; 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=hxS/yIMhrDVh3lcHYeju/KMdLbmjuNTEz1rPwaFQsrZ9vfFABis9zYUpYOKFPy1ADzcseuEo gQgxmfg3ucrH1LvPElO0ACuMi7uHKuBY6aZn6djfUU9zNhh/qfShii3L/FcqelkSOLMyNrG8W6F PpmI7yeJiSfdrhfCO6xgim20= X-Received: by 127.0.0.2 with SMTP id vfQOYY1788612xHW8Ugk10a7; 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: S1wmAOotNXjb6eouOyaj0WSfx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1702373393783100042 Content-Type: text/plain; charset="utf-8" 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; } =20 + // The following fields are theoretically mandatory, but not supported + // by some platforms. Just warn if they are missing: + // - PerformanceLimitedRegister + // - ReferencePerformanceCounterRegister + // - DeliveredPerformanceCounterRegister + if (IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister) || + IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegister)= || + IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegister)) + { + DEBUG (( + DEBUG_WARN, + "Missing PerformanceLimited|ReferencePerformanceCounter|" + "DeliveredPerformanceCounter field in _CPC object\n" + )); + } + if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) && (CpcInfo->HighestPerformanceInteger =3D=3D 0)) || (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) && @@ -3539,13 +3555,19 @@ AmlCreateCpcNode ( (CpcInfo->LowestNonlinearPerformanceInteger =3D=3D 0)) || (IsNullGenericAddress (&CpcInfo->LowestPerformanceBuffer) && (CpcInfo->LowestPerformanceInteger =3D=3D 0)) || - IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister) || - IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegister)= || - IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegister)= || - 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 (#112377): https://edk2.groups.io/g/devel/message/112377 Mute This Topic: https://groups.io/mt/103127056/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-