From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.5910.1662979098582409478 for ; Mon, 12 Sep 2022 03:38:18 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) 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 9A07A113E; Mon, 12 Sep 2022 03:38:24 -0700 (PDT) Received: from [192.168.1.11] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1D0E53F71A; Mon, 12 Sep 2022 03:38:16 -0700 (PDT) Message-ID: Date: Mon, 12 Sep 2022 12:37:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [edk2-devel] [PATCH 3/3] DynamicTablesPkg: SSDT CPU _CPC generator To: devel@edk2.groups.io, jbrasen@nvidia.com Cc: ardb+tianocore@kernel.org, Sami.Mujawar@arm.com, Alexei.Fedorov@arm.com References: <6bca55eda775212fa16aa8a45e82bb981f1ee8df.1662563529.git.jbrasen@nvidia.com> From: "PierreGondois" In-Reply-To: <6bca55eda775212fa16aa8a45e82bb981f1ee8df.1662563529.git.jbrasen@nvidia.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello Jeff, Please find some remarks inline: On 9/7/22 17:15, Jeff Brasen via groups.io wrote: > Add code to use a token attached to GICC to generate _CPC object on cpus. > > > > Signed-off-by: Jeff Brasen > > --- > > .../SsdtCpuTopologyGenerator.c | 211 +++++++++++++++++- > > 1 file changed, 206 insertions(+), 5 deletions(-) > > > > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c > > index 8561f48e1f..ba1f1bd436 100644 > > --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c > > +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c > [snip] > > @@ -584,6 +770,13 @@ CreateAmlCpuFromProcHierarchy ( > > ASSERT_EFI_ERROR (Status); > I think a 'return Status;' needs to be added here. > } > > > > + // If a CPC info is associated with the > > + // GicCinfo, create an _CPC method returning them. > > + if (GicCInfo->CpcToken != CM_NULL_TOKEN) { > > + Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo, CpuNode); > > + ASSERT_EFI_ERROR (Status); > > + } > > + > > return Status; > > } > > > > @@ -934,10 +1127,11 @@ CreateTopologyFromGicC ( > > IN AML_OBJECT_NODE_HANDLE ScopeNode > > ) > > { > > - EFI_STATUS Status; > > - CM_ARM_GICC_INFO *GicCInfo; > > - UINT32 GicCInfoCount; > > - UINT32 Index; > > + EFI_STATUS Status; > > + CM_ARM_GICC_INFO *GicCInfo; > > + UINT32 GicCInfoCount; > > + UINT32 Index; > > + AML_OBJECT_NODE_HANDLE CpuNode; > > > > ASSERT (Generator != NULL); > > ASSERT (CfgMgrProtocol != NULL); > > @@ -961,12 +1155,19 @@ CreateTopologyFromGicC ( > > ScopeNode, > > &GicCInfo[Index], > > Index, > > - NULL > > + &CpuNode > > ); > > if (EFI_ERROR (Status)) { > > ASSERT (0); > > break; > > } > > + > > + // If a CPC info is associated with the > > + // GicCinfo, create an _CPC method returning them. > > + if (GicCInfo->CpcToken != CM_NULL_TOKEN) { > > + Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[Index], CpuNode); > > + ASSERT_EFI_ERROR (Status); Shouln't we consider this as an error and break ? As: if (EFI_ERROR (Status)) { ASSERT_EFI_ERROR (Status); break; } > > + } > > } // for > > > > return Status; >