From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mx.groups.io with SMTP id smtpd.web10.2531.1639776859028316603 for ; Fri, 17 Dec 2021 13:34:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ty1plCL9; spf=pass (domain: kernel.org, ip: 145.40.68.75, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D7AB3B82AE0; Fri, 17 Dec 2021 21:34:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D41EC36AE5; Fri, 17 Dec 2021 21:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639776854; bh=JtDSFYeHeqJ2ZNUI0fTziDKolUijWo46FLjyfsrRYOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ty1plCL98sxfE6W7Aj8V5cXPKUZS4V+Z6fKjwfkG7vHjhwllyzOJjQTO7lDUkwT5B l6Sigey1WPB8sVf92WArructTULlgrt8wL89vvsHt58RrEHQsxvp5iBsVG62S2nXg4 WimM5u0pT0+EQFN5sdU/gfvpdBy/tS8i/xra48GtjuW8h9wI2COF3Ud8JWwRSAbsLH XsWyaJjlkUhcCHVR1jmTEvnqtyrwoUfsB09N0sDlbK9rcXswwHQdfFurgOpE1jUmrZ J7raMZg/+i86T7YzTvAR50H6B/M6z3TvevsvRNP9mqmhGPiimkxqOIbJCa4/wdy+tO 0qegAfxH/+lWQ== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Rebecca Cran , Leif Lindholm , Sami Mujawar Subject: [PATCH v2 1/2] ArmPkg/MpInitLib: avoid ARM_PROCESSOR_TABLE Date: Fri, 17 Dec 2021 22:34:02 +0100 Message-Id: <20211217213403.15585-2-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211217213403.15585-1-ardb@kernel.org> References: <20211217213403.15585-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Pass ARM_CORE_INFO[] directly into the MpInitLib init function so we don't need to rely on an obsolete and unrelated data structure. Signed-off-by: Ard Biesheuvel --- ArmPkg/Include/Library/MpInitLib.h | 2 +- ArmPkg/Drivers/CpuDxe/CpuMpInit.c | 10 ++++------ ArmPkg/Library/MpInitLib/DxeMpLib.c | 6 +++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ArmPkg/Include/Library/MpInitLib.h b/ArmPkg/Include/Library/Mp= InitLib.h index 582bb788fd59..7a29fe3e367e 100644 --- a/ArmPkg/Include/Library/MpInitLib.h +++ b/ArmPkg/Include/Library/MpInitLib.h @@ -356,7 +356,7 @@ MpInitLibWhoAmI ( VOID=0D MpInitLibInitialize (=0D IN UINTN NumberOfProcessors,=0D - IN ARM_PROCESSOR_TABLE *CpuInfo=0D + IN CONST ARM_CORE_INFO *CoreInfo=0D );=0D =0D #endif /* MP_INITLIB_H_ */=0D diff --git a/ArmPkg/Drivers/CpuDxe/CpuMpInit.c b/ArmPkg/Drivers/CpuDxe/CpuM= pInit.c index 876a29e09b1b..4f5b4268aee5 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuMpInit.c +++ b/ArmPkg/Drivers/CpuDxe/CpuMpInit.c @@ -570,10 +570,9 @@ InitializeMpSupport ( EFI_HOB_GENERIC_HEADER *Hob;=0D VOID *HobData;=0D UINTN HobDataSize;=0D - ARM_PROCESSOR_TABLE CpuInfo;=0D + CONST ARM_CORE_INFO *CoreInfo;=0D =0D MaxCpus =3D 1;=0D - ZeroMem (&CpuInfo, sizeof (ARM_PROCESSOR_TABLE));=0D =0D DEBUG ((DEBUG_INFO, "Starting MP services"));=0D =0D @@ -581,9 +580,8 @@ InitializeMpSupport ( if (Hob !=3D NULL) {=0D HobData =3D GET_GUID_HOB_DATA (Hob);=0D HobDataSize =3D GET_GUID_HOB_DATA_SIZE (Hob);=0D - CpuInfo.ArmCpus =3D (ARM_CORE_INFO *)HobData;=0D - CpuInfo.NumberOfEntries =3D HobDataSize / sizeof (ARM_CORE_INFO);=0D - MaxCpus =3D CpuInfo.NumberOfEntries;=0D + CoreInfo =3D (ARM_CORE_INFO *)HobData;=0D + MaxCpus =3D HobDataSize / sizeof (ARM_CORE_INFO);=0D }=0D =0D if (MaxCpus =3D=3D 1) {=0D @@ -592,7 +590,7 @@ InitializeMpSupport ( return;=0D }=0D =0D - MpInitLibInitialize (MaxCpus, &CpuInfo);=0D + MpInitLibInitialize (MaxCpus, CoreInfo);=0D =0D //=0D // Now install the MP services protocol.=0D diff --git a/ArmPkg/Library/MpInitLib/DxeMpLib.c b/ArmPkg/Library/MpInitLib= /DxeMpLib.c index b00893a5ea7a..5ecd5a2b3366 100644 --- a/ArmPkg/Library/MpInitLib/DxeMpLib.c +++ b/ArmPkg/Library/MpInitLib/DxeMpLib.c @@ -1380,7 +1380,7 @@ FillInProcessorInformation ( VOID=0D MpInitLibInitialize (=0D IN UINTN NumberOfProcessors,=0D - IN ARM_PROCESSOR_TABLE *CpuInfo=0D + IN CONST ARM_CORE_INFO *CoreInfo=0D )=0D {=0D EFI_STATUS Status;=0D @@ -1407,7 +1407,7 @@ MpInitLibInitialize ( gProcessorIDs =3D AllocatePool ((mCpuMpData.NumberOfProcessors + 1) * si= zeof (UINT64));=0D ASSERT (gProcessorIDs !=3D NULL);=0D =0D - FillInProcessorInformation (TRUE, CpuInfo->ArmCpus[0].Mpidr, 0);=0D + FillInProcessorInformation (TRUE, CoreInfo[0].Mpidr, 0);=0D gProcessorIDs[0] =3D mCpuMpData.CpuData[0].Info.ProcessorId;=0D =0D Status =3D gBS->CreateEvent (=0D @@ -1431,7 +1431,7 @@ MpInitLibInitialize ( continue;=0D }=0D =0D - FillInProcessorInformation (FALSE, CpuInfo->ArmCpus[Index].Mpidr, Inde= x);=0D + FillInProcessorInformation (FALSE, CoreInfo[Index].Mpidr, Index);=0D =0D gProcessorIDs[Index] =3D mCpuMpData.CpuData[Index].Info.ProcessorId;=0D =0D --=20 2.30.2