From nobody Tue Apr 23 16:13:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1533713684864653.4431506576835; Wed, 8 Aug 2018 00:34:44 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1F266210DF766; Wed, 8 Aug 2018 00:34:42 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 571A1210DC1BB for ; Wed, 8 Aug 2018 00:34:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2018 00:34:40 -0700 Received: from ydong10-win10.ccr.corp.intel.com ([10.239.9.125]) by orsmga001.jf.intel.com with ESMTP; 08 Aug 2018 00:34:30 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,456,1526367600"; d="scan'208";a="79896533" From: Eric Dong To: edk2-devel@lists.01.org Date: Wed, 8 Aug 2018 15:34:26 +0800 Message-Id: <20180808073427.11008-2-eric.dong@intel.com> X-Mailer: git-send-email 2.15.0.windows.1 In-Reply-To: <20180808073427.11008-1-eric.dong@intel.com> References: <20180808073427.11008-1-eric.dong@intel.com> MIME-Version: 1.0 Subject: [edk2] [Patch 1/2] UefiCpuPkg/RegisterCpuFeaturesLib: Combine implementation. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Ruiyu Ni Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RDMRC_1 RSF_4 Z_629925259 SPT_0 V1 changes: > Current code logic can't confirm CpuS3DataDxe driver start before > CpuFeaturesDxe driver. So the assumption in CpuFeaturesDxe not valid. > Add implementation for AllocateAcpiCpuData function to remove this > assumption. V2 changes: > Because CpuS3Data memory will be copy to smram at SmmReadToLock point, > so the memory type no need to be ACPI NVS type, also the address not > limit to below 4G. > This change remove the limit of ACPI NVS memory type and below 4G. Pass OS boot and resume from S3 test. Bugz: https://bugzilla.tianocore.org/show_bug.cgi?id=3D959 Reported-by: Marvin H=C3=A4user Suggested-by: Fan Jeff Cc: Marvin H=C3=A4user Cc: Fan Jeff Cc: Laszlo Ersek Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- .../DxeRegisterCpuFeaturesLib.c | 67 ----------- .../PeiRegisterCpuFeaturesLib.c | 131 -----------------= ---- .../RegisterCpuFeaturesLib.c | 90 ++++++++++++++ 3 files changed, 90 insertions(+), 198 deletions(-) diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeatur= esLib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesL= ib.c index 902a339529..1f34a3f489 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c @@ -197,70 +197,3 @@ GetNumberOfProcessor ( ASSERT_EFI_ERROR (Status); } =20 -/** - Allocates ACPI NVS memory to save ACPI_CPU_DATA. - - @return Pointer to allocated ACPI_CPU_DATA. -**/ -ACPI_CPU_DATA * -AllocateAcpiCpuData ( - VOID - ) -{ - // - // CpuS3DataDxe will do it. - // - ASSERT (FALSE); - return NULL; -} - -/** - Enlarges CPU register table for each processor. - - @param[in, out] RegisterTable Pointer processor's CPU register table -**/ -VOID -EnlargeRegisterTable ( - IN OUT CPU_REGISTER_TABLE *RegisterTable - ) -{ - EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS Address; - UINTN AllocatePages; - - Address =3D BASE_4GB - 1; - AllocatePages =3D RegisterTable->AllocatedSize / EFI_PAGE_SIZE; - Status =3D gBS->AllocatePages ( - AllocateMaxAddress, - EfiACPIMemoryNVS, - AllocatePages + 1, - &Address - ); - ASSERT_EFI_ERROR (Status); - - // - // If there are records existing in the register table, then copy its co= ntents - // to new region and free the old one. - // - if (RegisterTable->AllocatedSize > 0) { - CopyMem ( - (VOID *) (UINTN) Address, - (VOID *) (UINTN) RegisterTable->RegisterTableEntry, - RegisterTable->AllocatedSize - ); - // - // RegisterTableEntry is allocated by gBS->AllocatePages() service. - // So, gBS->FreePages() service is used to free it. - // - gBS->FreePages ( - RegisterTable->RegisterTableEntry, - AllocatePages - ); - } - - // - // Adjust the allocated size and register table base address. - // - RegisterTable->AllocatedSize +=3D EFI_PAGE_SIZE; - RegisterTable->RegisterTableEntry =3D Address; -} diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeatur= esLib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesL= ib.c index 6804eddf65..82fe268812 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c @@ -257,134 +257,3 @@ GetNumberOfProcessor ( ); ASSERT_EFI_ERROR (Status); } - -/** - Allocates ACPI NVS memory to save ACPI_CPU_DATA. - - @return Pointer to allocated ACPI_CPU_DATA. -**/ -ACPI_CPU_DATA * -AllocateAcpiCpuData ( - VOID - ) -{ - EFI_STATUS Status; - EFI_PEI_MP_SERVICES_PPI *CpuMpPpi; - UINTN NumberOfCpus; - UINTN NumberOfEnabledProcessors; - ACPI_CPU_DATA *AcpiCpuData; - EFI_PHYSICAL_ADDRESS Address; - UINTN TableSize; - CPU_REGISTER_TABLE *RegisterTable; - UINTN Index; - EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer; - - Status =3D PeiServicesAllocatePages ( - EfiACPIMemoryNVS, - EFI_SIZE_TO_PAGES (sizeof (ACPI_CPU_DATA)), - &Address - ); - ASSERT_EFI_ERROR (Status); - AcpiCpuData =3D (ACPI_CPU_DATA *) (UINTN) Address; - ASSERT (AcpiCpuData !=3D NULL); - - // - // Get MP Services Protocol - // - Status =3D PeiServicesLocatePpi ( - &gEfiPeiMpServicesPpiGuid, - 0, - NULL, - (VOID **)&CpuMpPpi - ); - ASSERT_EFI_ERROR (Status); - - // - // Get the number of CPUs - // - Status =3D CpuMpPpi->GetNumberOfProcessors ( - GetPeiServicesTablePointer (), - CpuMpPpi, - &NumberOfCpus, - &NumberOfEnabledProcessors - ); - ASSERT_EFI_ERROR (Status); - AcpiCpuData->NumberOfCpus =3D (UINT32)NumberOfCpus; - - // - // Allocate buffer for empty RegisterTable and PreSmmInitRegisterTable f= or all CPUs - // - TableSize =3D 2 * NumberOfCpus * sizeof (CPU_REGISTER_TABLE); - Status =3D PeiServicesAllocatePages ( - EfiACPIMemoryNVS, - EFI_SIZE_TO_PAGES (TableSize), - &Address - ); - ASSERT_EFI_ERROR (Status); - RegisterTable =3D (CPU_REGISTER_TABLE *) (UINTN) Address; - - for (Index =3D 0; Index < NumberOfCpus; Index++) { - Status =3D CpuMpPpi->GetProcessorInfo ( - GetPeiServicesTablePointer (), - CpuMpPpi, - Index, - &ProcessorInfoBuffer - ); - ASSERT_EFI_ERROR (Status); - - RegisterTable[Index].InitialApicId =3D (UINT32)ProcessorInfoBuffe= r.ProcessorId; - RegisterTable[Index].TableLength =3D 0; - RegisterTable[Index].AllocatedSize =3D 0; - RegisterTable[Index].RegisterTableEntry =3D 0; - - RegisterTable[NumberOfCpus + Index].InitialApicId =3D (UINT32)Pro= cessorInfoBuffer.ProcessorId; - RegisterTable[NumberOfCpus + Index].TableLength =3D 0; - RegisterTable[NumberOfCpus + Index].AllocatedSize =3D 0; - RegisterTable[NumberOfCpus + Index].RegisterTableEntry =3D 0; - } - AcpiCpuData->RegisterTable =3D (EFI_PHYSICAL_ADDRESS)(UINTN)Re= gisterTable; - AcpiCpuData->PreSmmInitRegisterTable =3D (EFI_PHYSICAL_ADDRESS)(UINTN)(R= egisterTable + NumberOfCpus); - - return AcpiCpuData; -} - -/** - Enlarges CPU register table for each processor. - - @param[in, out] RegisterTable Pointer processor's CPU register table -**/ -VOID -EnlargeRegisterTable ( - IN OUT CPU_REGISTER_TABLE *RegisterTable - ) -{ - EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS Address; - UINTN AllocatePages; - - AllocatePages =3D RegisterTable->AllocatedSize / EFI_PAGE_SIZE; - Status =3D PeiServicesAllocatePages ( - EfiACPIMemoryNVS, - AllocatePages + 1, - &Address - ); - ASSERT_EFI_ERROR (Status); - - // - // If there are records existing in the register table, then copy its co= ntents - // to new region and free the old one. - // - if (RegisterTable->AllocatedSize > 0) { - CopyMem ( - (VOID *) (UINTN) Address, - (VOID *) (UINTN) RegisterTable->RegisterTableEntry, - RegisterTable->AllocatedSize - ); - } - - // - // Adjust the allocated size and register table base address. - // - RegisterTable->AllocatedSize +=3D EFI_PAGE_SIZE; - RegisterTable->RegisterTableEntry =3D Address; -} diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesL= ib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c index dd6a82be7a..b87eb280f8 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c @@ -488,6 +488,96 @@ RegisterCpuFeature ( return RETURN_SUCCESS; } =20 +/** + Allocates ACPI NVS memory to save ACPI_CPU_DATA. + + @return Pointer to allocated ACPI_CPU_DATA. +**/ +ACPI_CPU_DATA * +AllocateAcpiCpuData ( + VOID + ) +{ + EFI_STATUS Status; + UINTN NumberOfCpus; + UINTN NumberOfEnabledProcessors; + ACPI_CPU_DATA *AcpiCpuData; + UINTN TableSize; + CPU_REGISTER_TABLE *RegisterTable; + UINTN Index; + EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer; + + AcpiCpuData =3D AllocatePages (EFI_SIZE_TO_PAGES (sizeof (ACPI_CPU_DATA= ))); + ASSERT (AcpiCpuData !=3D NULL); + + GetNumberOfProcessor (&NumberOfCpus, &NumberOfEnabledProcessors); + AcpiCpuData->NumberOfCpus =3D (UINT32) NumberOfCpus; + + // + // Allocate buffer for empty RegisterTable and PreSmmInitRegisterTable f= or all CPUs + // =20 + TableSize =3D 2 * NumberOfCpus * sizeof (CPU_REGISTER_TABLE); + RegisterTable =3D AllocatePages (EFI_SIZE_TO_PAGES (TableSize)); + ASSERT (RegisterTable !=3D NULL); + + for (Index =3D 0; Index < NumberOfCpus; Index++) { + Status =3D GetProcessorInformation (Index, &ProcessorInfoBuffer); + ASSERT_EFI_ERROR (Status); + + RegisterTable[Index].InitialApicId =3D (UINT32)ProcessorInfoBuffe= r.ProcessorId; + RegisterTable[Index].TableLength =3D 0; + RegisterTable[Index].AllocatedSize =3D 0; + RegisterTable[Index].RegisterTableEntry =3D 0; + + RegisterTable[NumberOfCpus + Index].InitialApicId =3D (UINT32)Pro= cessorInfoBuffer.ProcessorId; + RegisterTable[NumberOfCpus + Index].TableLength =3D 0; + RegisterTable[NumberOfCpus + Index].AllocatedSize =3D 0; + RegisterTable[NumberOfCpus + Index].RegisterTableEntry =3D 0; + } + AcpiCpuData->RegisterTable =3D (EFI_PHYSICAL_ADDRESS)(UINTN) R= egisterTable; + AcpiCpuData->PreSmmInitRegisterTable =3D (EFI_PHYSICAL_ADDRESS)(UINTN) (= RegisterTable + NumberOfCpus); + + return AcpiCpuData; +} + +/** + Enlarges CPU register table for each processor. + + @param[in, out] RegisterTable Pointer processor's CPU register table +**/ +VOID +EnlargeRegisterTable ( + IN OUT CPU_REGISTER_TABLE *RegisterTable + ) +{ + EFI_PHYSICAL_ADDRESS Address; + UINTN UsedPages; + + UsedPages =3D RegisterTable->AllocatedSize / EFI_PAGE_SIZE; + Address =3D (UINTN) AllocatePages (UsedPages + 1); + ASSERT (Address !=3D 0); + + // + // If there are records existing in the register table, then copy its co= ntents + // to new region and free the old one. + // + if (RegisterTable->AllocatedSize > 0) { + CopyMem ( + (VOID *) (UINTN) Address, + (VOID *) (UINTN) RegisterTable->RegisterTableEntry, + RegisterTable->AllocatedSize + ); + + FreePages ((VOID *) (UINTN) RegisterTable->RegisterTableEntry, UsedPag= es); + } + + // + // Adjust the allocated size and register table base address. + // + RegisterTable->AllocatedSize +=3D EFI_PAGE_SIZE; + RegisterTable->RegisterTableEntry =3D Address; +} + /** Add an entry in specified register table. =20 --=20 2.15.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue Apr 23 16:13:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1533713687845953.8371697389373; Wed, 8 Aug 2018 00:34:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5010821BADAB9; Wed, 8 Aug 2018 00:34:42 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7BCB7210DC1AF for ; Wed, 8 Aug 2018 00:34:41 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2018 00:34:40 -0700 Received: from ydong10-win10.ccr.corp.intel.com ([10.239.9.125]) by orsmga001.jf.intel.com with ESMTP; 08 Aug 2018 00:34:31 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,456,1526367600"; d="scan'208";a="79896544" From: Eric Dong To: edk2-devel@lists.01.org Date: Wed, 8 Aug 2018 15:34:27 +0800 Message-Id: <20180808073427.11008-3-eric.dong@intel.com> X-Mailer: git-send-email 2.15.0.windows.1 In-Reply-To: <20180808073427.11008-1-eric.dong@intel.com> References: <20180808073427.11008-1-eric.dong@intel.com> MIME-Version: 1.0 Subject: [edk2] [Patch 2/2] UefiCpuPkg/CpuS3DataDxe: Change Memory Type and address limitation. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Ruiyu Ni Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RDMRC_1 RSF_4 Z_629925259 SPT_0 Because CpuS3Data memory will be copy to smram at SmmReadToLock point, so the memory type no need to be ACPI NVS type, also the address not limit to below 4G. This change remove the limit of ACPI NVS memory type and below 4G. Pass OS boot and resume from S3 test. Bugz: https://bugzilla.tianocore.org/show_bug.cgi?id=3D959 Reported-by: Marvin H=C3=A4user Suggested-by: Fan Jeff Cc: Marvin H=C3=A4user Cc: Fan Jeff Cc: Laszlo Ersek Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c | 60 +++++++---------------------= ---- UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf | 1 + 2 files changed, 14 insertions(+), 47 deletions(-) diff --git a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c b/UefiCpuPkg/CpuS3DataDxe/= CpuS3Data.c index dccb406b8d..d8eb8c976f 100644 --- a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c +++ b/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c @@ -31,6 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. #include #include #include +#include =20 #include #include @@ -45,42 +46,6 @@ typedef struct { IA32_DESCRIPTOR IdtrProfile; } ACPI_CPU_DATA_EX; =20 -/** - Allocate EfiACPIMemoryNVS below 4G memory address. - - This function allocates EfiACPIMemoryNVS below 4G memory address. - - @param[in] Size Size of memory to allocate. - - @return Allocated address for output. - -**/ -VOID * -AllocateAcpiNvsMemoryBelow4G ( - IN UINTN Size - ) -{ - EFI_PHYSICAL_ADDRESS Address; - EFI_STATUS Status; - VOID *Buffer; - - Address =3D BASE_4GB - 1; - Status =3D gBS->AllocatePages ( - AllocateMaxAddress, - EfiACPIMemoryNVS, - EFI_SIZE_TO_PAGES (Size), - &Address - ); - if (EFI_ERROR (Status)) { - return NULL; - } - - Buffer =3D (VOID *)(UINTN)Address; - ZeroMem (Buffer, Size); - - return Buffer; -} - /** Callback function executed when the EndOfDxe event group is signaled. =20 @@ -150,7 +115,6 @@ CpuS3DataInitialize ( EFI_MP_SERVICES_PROTOCOL *MpServices; UINTN NumberOfCpus; UINTN NumberOfEnabledProcessors; - VOID *Stack; UINTN TableSize; CPU_REGISTER_TABLE *RegisterTable; UINTN Index; @@ -171,10 +135,7 @@ CpuS3DataInitialize ( // OldAcpiCpuData =3D (ACPI_CPU_DATA *) (UINTN) PcdGet64 (PcdCpuS3DataAddre= ss); =20 - // - // Allocate ACPI NVS memory below 4G memory for use on ACPI S3 resume. - // - AcpiCpuDataEx =3D AllocateAcpiNvsMemoryBelow4G (sizeof (ACPI_CPU_DATA_EX= )); + AcpiCpuDataEx =3D AllocatePages (EFI_SIZE_TO_PAGES (sizeof (ACPI_CPU_DAT= A_EX))); ASSERT (AcpiCpuDataEx !=3D NULL); AcpiCpuData =3D &AcpiCpuDataEx->AcpiCpuData; =20 @@ -210,11 +171,16 @@ CpuS3DataInitialize ( AcpiCpuData->MtrrTable =3D (EFI_PHYSICAL_ADDRESS)(UINTN)&AcpiCpuDataE= x->MtrrTable; =20 // - // Allocate stack space for all CPUs + // Allocate stack space for all CPUs, use ACPI NVS memory type because i= t will + // not copy to smram at Smm ready to lock point. // - Stack =3D AllocateAcpiNvsMemoryBelow4G (NumberOfCpus * AcpiCpuData->Stac= kSize); - ASSERT (Stack !=3D NULL); - AcpiCpuData->StackAddress =3D (EFI_PHYSICAL_ADDRESS)(UINTN)Stack; + Status =3D gBS->AllocatePages ( + AllocateAnyPages, + EfiACPIMemoryNVS, + EFI_SIZE_TO_PAGES (NumberOfCpus * AcpiCpuData->StackSiz= e), + &AcpiCpuData->StackAddress + ); + ASSERT_EFI_ERROR (Status); =20 // // Get the boot processor's GDT and IDT @@ -227,7 +193,7 @@ CpuS3DataInitialize ( // GdtSize =3D AcpiCpuDataEx->GdtrProfile.Limit + 1; IdtSize =3D AcpiCpuDataEx->IdtrProfile.Limit + 1; - Gdt =3D AllocateAcpiNvsMemoryBelow4G (GdtSize + IdtSize); + Gdt =3D AllocatePages (EFI_SIZE_TO_PAGES (GdtSize + IdtSize)); ASSERT (Gdt !=3D NULL); Idt =3D (VOID *)((UINTN)Gdt + GdtSize); CopyMem (Gdt, (VOID *)AcpiCpuDataEx->GdtrProfile.Base, GdtSize); @@ -243,7 +209,7 @@ CpuS3DataInitialize ( // Allocate buffer for empty RegisterTable and PreSmmInitRegisterTable= for all CPUs // TableSize =3D 2 * NumberOfCpus * sizeof (CPU_REGISTER_TABLE); - RegisterTable =3D (CPU_REGISTER_TABLE *)AllocateAcpiNvsMemoryBelow4G (= TableSize); + RegisterTable =3D AllocatePages (EFI_SIZE_TO_PAGES (TableSize)); ASSERT (RegisterTable !=3D NULL); =20 for (Index =3D 0; Index < NumberOfCpus; Index++) { diff --git a/UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf b/UefiCpuPkg/CpuS3Dat= aDxe/CpuS3DataDxe.inf index 480c98ebcd..c16731529c 100644 --- a/UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf +++ b/UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf @@ -51,6 +51,7 @@ DebugLib BaseLib MtrrLib + MemoryAllocationLib =20 [Guids] gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event --=20 2.15.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel