From nobody Tue May 14 18:40:03 2024 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+98164+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+98164+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1673235483; cv=none; d=zohomail.com; s=zohoarc; b=OOCDZX8EX9daY3QuEVyaAfh0JPhSiU33BPJ91eOY4Cu3s1zfBGhp036sUDxcgXAzVEPoKrS7GLe2HPPPmsPOGPBOOYJJfQJQ5M7NfnUFl1FROTK/O0+MnCThKbSntZh1m4tHsb94GdJd5bV7OuNn1j9IJaVwQogNNsma/NTg98s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673235483; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=7wgTgokrOAMOtTYIIKNYf1CX4zo6ZGPMTY16Jf8xxKc=; b=QOwmklHu4fJWCCtWYxm9K4ns42APicJ0jzmNdh91AkvirKtb4oPNusYiE5GebzsZFMzWlpPi2JxqA1O1aoMFtRlKuXzMg7vo+u/iiq9fj0Cgt7cjEcGOeltS3zQ+W/oMeH/03GuvMP3ZWfxSNw4Afy5Ow1tj1Wrjt5pJkdD1Gz0= 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+98164+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 1673235483843711.2617697365921; Sun, 8 Jan 2023 19:38:03 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Xk81YY1788612xLNIus0OTiI; Sun, 08 Jan 2023 19:38:03 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.63067.1673235482935403958 for ; Sun, 08 Jan 2023 19:38:03 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="306306797" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="306306797" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 19:38:02 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="764170030" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="764170030" X-Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.182.166]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 19:38:00 -0800 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann Subject: [edk2-devel] [PATCH 1/4] Revert "UefiCpuPkg: Has APs in 64 bit long-mode before booting to OS." Date: Mon, 9 Jan 2023 11:37:21 +0800 Message-Id: <20230109033724.1130-2-yuanhao.xie@intel.com> In-Reply-To: <20230109033724.1130-1-yuanhao.xie@intel.com> References: <20230109033724.1130-1-yuanhao.xie@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,yuanhao.xie@intel.com X-Gm-Message-State: KXcmZZqRkcPKfBiWEC4NNJCTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1673235483; bh=V77YtulCvWXyfvTHbXwKwPUi91nFT9pTas8zgYzBE98=; h=Cc:Date:From:Reply-To:Subject:To; b=gYe4CRdeR3Srt5d/x0FkofSmIdp4piQB0nmn6fEjJFxUyJiAJn7E1quWkPUTnkUeLtu j0nPIL9igy+Gwr4G5xE+ayWcQlQXkGP+ba6TdfNU6ykE8Vd2TqeKQpRm6orjAml2vKcFO uouio/2rIDvfVwUU3O5t+9m44IfsCu0t9Tg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1673235485329100002 Content-Type: text/plain; charset="utf-8" This reverts commit 73ccde8f6d04a246377cabaed2875e69d4b6b719 since it results in a hang of the IA32 processor and needs further clean-up. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4234 Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Yuanhao Xie Reviewed-by: Laszlo Ersek --- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 7 +- UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 84 +++++---- .../Library/MpInitLib/Ia32/CreatePageTable.c | 27 --- UefiCpuPkg/Library/MpInitLib/MpLib.h | 19 +- .../Library/MpInitLib/X64/CreatePageTable.c | 75 -------- UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 171 +++++++++++++++--- UefiCpuPkg/UefiCpuPkg.dsc | 1 - 7 files changed, 200 insertions(+), 184 deletions(-) delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Lib= rary/MpInitLib/DxeMpInitLib.inf index 8c8b81d933..cd07de3a3c 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf @@ -1,7 +1,7 @@ ## @file # MP Initialize Library instance for DXE driver. # -# Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.
+# Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -24,11 +24,9 @@ [Sources.IA32] Ia32/AmdSev.c Ia32/MpFuncs.nasm - Ia32/CreatePageTable.c =20 [Sources.X64] X64/AmdSev.c - X64/CreatePageTable.c X64/MpFuncs.nasm =20 [Sources.common] @@ -59,9 +57,6 @@ CcExitLib MicrocodeLib =20 -[LibraryClasses.X64] - CpuPageTableLib - [Protocols] gEfiTimerArchProtocolGuid ## SOMETIMES_CONSUMES =20 diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/M= pInitLib/DxeMpLib.c index beab06a5b1..445e0853d2 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c @@ -28,7 +28,6 @@ volatile BOOLEAN mStopCheckAllApsStatus =3D TRUE; VOID *mReservedApLoopFunc =3D NULL; UINTN mReservedTopOfApStack; volatile UINT32 mNumberToFinish =3D 0; -UINTN mApPageTable; =20 // // Begin wakeup buffer allocation below 0x88000 @@ -408,9 +407,12 @@ RelocateApLoop ( AsmRelocateApLoopFunc ( MwaitSupport, CpuMpData->ApTargetCState, + CpuMpData->PmCodeSegment, StackStart - ProcessorNumber * AP_SAFE_STACK_SIZE, (UINTN)&mNumberToFinish, - mApPageTable + CpuMpData->Pm16CodeSegment, + CpuMpData->SevEsAPBuffer, + CpuMpData->WakeupBuffer ); } =20 @@ -475,6 +477,7 @@ InitMpGlobalData ( ) { EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS Address; UINTN ApSafeBufferSize; UINTN Index; EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc; @@ -542,45 +545,60 @@ InitMpGlobalData ( // Allocating it in advance since memory services are not available in // Exit Boot Services callback function. // - // +------------+ - // | Ap Loop | - // +------------+ - // | Stack * N | - // +------------+ (low address) - // ApSafeBufferSize =3D EFI_PAGES_TO_SIZE ( EFI_SIZE_TO_PAGES ( - CpuMpData->CpuCount * AP_SAFE_STACK_SIZE - + CpuMpData->AddressMap.RelocateApLoopFuncSize + CpuMpData->AddressMap.RelocateApLoopFuncSize ) ); + Address =3D BASE_4GB - 1; + Status =3D gBS->AllocatePages ( + AllocateMaxAddress, + EfiReservedMemoryType, + EFI_SIZE_TO_PAGES (ApSafeBufferSize), + &Address + ); + ASSERT_EFI_ERROR (Status); =20 - mReservedTopOfApStack =3D (UINTN)AllocateReservedPages (EFI_SIZE_TO_PAGE= S (ApSafeBufferSize)); - ASSERT (mReservedTopOfApStack !=3D 0); - ASSERT ((mReservedTopOfApStack & (UINTN)(CPU_STACK_ALIGNMENT - 1)) =3D= =3D 0); - ASSERT ((AP_SAFE_STACK_SIZE & (CPU_STACK_ALIGNMENT - 1)) =3D=3D 0); - - mReservedApLoopFunc =3D (VOID *)(mReservedTopOfApStack + CpuMpData->CpuC= ount * AP_SAFE_STACK_SIZE); - if (StandardSignatureIsAuthenticAMD ()) { - CopyMem ( - mReservedApLoopFunc, - CpuMpData->AddressMap.RelocateApLoopFuncAddressAmd, - CpuMpData->AddressMap.RelocateApLoopFuncSizeAmd - ); - } else { - CopyMem ( - mReservedApLoopFunc, - CpuMpData->AddressMap.RelocateApLoopFuncAddress, - CpuMpData->AddressMap.RelocateApLoopFuncSize - ); + mReservedApLoopFunc =3D (VOID *)(UINTN)Address; + ASSERT (mReservedApLoopFunc !=3D NULL); =20 - mApPageTable =3D CreatePageTable ( - mReservedTopOfApStack, - ApSafeBufferSize - ); + // + // Make sure that the buffer memory is executable if NX protection is en= abled + // for EfiReservedMemoryType. + // + // TODO: Check EFI_MEMORY_XP bit set or not once it's available in DXE G= CD + // service. + // + Status =3D gDS->GetMemorySpaceDescriptor (Address, &MemDesc); + if (!EFI_ERROR (Status)) { + gDS->SetMemorySpaceAttributes ( + Address, + ApSafeBufferSize, + MemDesc.Attributes & (~EFI_MEMORY_XP) + ); } =20 - mReservedTopOfApStack +=3D CpuMpData->CpuCount * AP_SAFE_STACK_SIZE; + ApSafeBufferSize =3D EFI_PAGES_TO_SIZE ( + EFI_SIZE_TO_PAGES ( + CpuMpData->CpuCount * AP_SAFE_STACK_SIZE + ) + ); + Address =3D BASE_4GB - 1; + Status =3D gBS->AllocatePages ( + AllocateMaxAddress, + EfiReservedMemoryType, + EFI_SIZE_TO_PAGES (ApSafeBufferSize), + &Address + ); + ASSERT_EFI_ERROR (Status); + + mReservedTopOfApStack =3D (UINTN)Address + ApSafeBufferSize; + ASSERT ((mReservedTopOfApStack & (UINTN)(CPU_STACK_ALIGNMENT - 1)) =3D= =3D 0); + CopyMem ( + mReservedApLoopFunc, + CpuMpData->AddressMap.RelocateApLoopFuncAddress, + CpuMpData->AddressMap.RelocateApLoopFuncSize + ); =20 Status =3D gBS->CreateEvent ( EVT_TIMER | EVT_NOTIFY_SIGNAL, diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c b/UefiCpuP= kg/Library/MpInitLib/Ia32/CreatePageTable.c deleted file mode 100644 index 525885b77d..0000000000 --- a/UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c +++ /dev/null @@ -1,27 +0,0 @@ -/** @file - Function to create page talbe. - Only create page table for x64, and leave the CreatePageTable empty for = Ia32. - - Copyright (c) 2022, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include - -/** - Only create page table for x64, and leave the CreatePageTable empty for = Ia32. - - @param[in] LinearAddress The start of the linear address range. - @param[in] Length The length of the linear address range. - - @return The page table to be created. -**/ -UINTN -CreatePageTable ( - IN UINTN Address, - IN UINTN Length - ) -{ - return 0; -} diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpIn= itLib/MpLib.h index 13d515c2df..1102003a93 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h @@ -392,9 +392,12 @@ typedef (EFIAPI *ASM_RELOCATE_AP_LOOP)( IN BOOLEAN MwaitSupport, IN UINTN ApTargetCState, + IN UINTN PmCodeSegment, IN UINTN TopOfApStack, IN UINTN NumberToFinish, - IN UINTN Cr3 + IN UINTN Pm16CodeSegment, + IN UINTN SevEsAPJumpTable, + IN UINTN WakeupBuffer ); =20 /** @@ -509,20 +512,6 @@ WakeUpAP ( IN BOOLEAN WakeUpDisabledAps ); =20 -/** - Create 1:1 mapping page table in reserved memory to map the specified ad= dress range. - - @param[in] LinearAddress The start of the linear address range. - @param[in] Length The length of the linear address range. - - @return The page table to be created. -**/ -UINTN -CreatePageTable ( - IN UINTN Address, - IN UINTN Length - ); - /** Initialize global data for MP support. =20 diff --git a/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c b/UefiCpuPk= g/Library/MpInitLib/X64/CreatePageTable.c deleted file mode 100644 index 548ef3f2c8..0000000000 --- a/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c +++ /dev/null @@ -1,75 +0,0 @@ -/** @file - Function to create page talbe. - Only create page table for x64, and leave the CreatePageTable empty for = Ia32. - - Copyright (c) 2022, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ -#include -#include -#include -#include -#include - -/** - Create 1:1 mapping page table in reserved memory to map the specified ad= dress range. - - @param[in] LinearAddress The start of the linear address range. - @param[in] Length The length of the linear address range. - - @return The page table to be created. -**/ -UINTN -CreatePageTable ( - IN UINTN Address, - IN UINTN Length - ) -{ - EFI_STATUS Status; - VOID *PageTableBuffer; - UINTN PageTableBufferSize; - UINTN PageTable; - - IA32_MAP_ATTRIBUTE MapAttribute; - IA32_MAP_ATTRIBUTE MapMask; - - MapAttribute.Uint64 =3D Address; - MapAttribute.Bits.Present =3D 1; - MapAttribute.Bits.ReadWrite =3D 1; - - MapMask.Bits.PageTableBaseAddress =3D 1; - MapMask.Bits.Present =3D 1; - MapMask.Bits.ReadWrite =3D 1; - - PageTable =3D 0; - PageTableBufferSize =3D 0; - - Status =3D PageTableMap ( - &PageTable, - Paging4Level, - NULL, - &PageTableBufferSize, - Address, - Length, - &MapAttribute, - &MapMask - ); - ASSERT (Status =3D=3D EFI_BUFFER_TOO_SMALL); - DEBUG ((DEBUG_INFO, "AP Page Table Buffer Size =3D %x\n", PageTableBuffe= rSize)); - - PageTableBuffer =3D AllocateReservedPages (EFI_SIZE_TO_PAGES (PageTableB= ufferSize)); - ASSERT (PageTableBuffer !=3D NULL); - Status =3D PageTableMap ( - &PageTable, - Paging4Level, - PageTableBuffer, - &PageTableBufferSize, - Address, - Length, - &MapAttribute, - &MapMask - ); - ASSERT_EFI_ERROR (Status); - return PageTable; -} diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Lib= rary/MpInitLib/X64/MpFuncs.nasm index 8ae287dd8d..39c3e8606a 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm @@ -279,42 +279,120 @@ CProcedureInvoke: RendezvousFunnelProcEnd: =20 ;-------------------------------------------------------------------------= ------------ -; AsmRelocateApLoop (MwaitSupport, ApTargetCState, TopOfApStack, CountTof= inish, Cr3); -; This function is called during the finalizaiton of Mp initialization be= fore booting -; to OS, and aim to put Aps either in Mwait or HLT. +; AsmRelocateApLoop (MwaitSupport, ApTargetCState, PmCodeSegment, TopOfAp= Stack, CountTofinish, Pm16CodeSegment, SevEsAPJumpTable, WakeupBuffer); ;-------------------------------------------------------------------------= ------------ -; +----------------+ -; | Cr3 | rsp+40 -; +----------------+ -; | CountTofinish | r9 -; +----------------+ -; | TopOfApStack | r8 -; +----------------+ -; | ApTargetCState | rdx -; +----------------+ -; | MwaitSupport | rcx -; +----------------+ -; | the return | -; +----------------+ low address - AsmRelocateApLoopStart: - mov rax, r9 ; CountTofinish +BITS 64 + cmp qword [rsp + 56], 0 ; SevEsAPJumpTable + je NoSevEs + + ; + ; Perform some SEV-ES related setup before leaving 64-bit mode + ; + push rcx + push rdx + + ; + ; Get the RDX reset value using CPUID + ; + mov rax, 1 + cpuid + mov rsi, rax ; Save off the reset value for RDX + + ; + ; Prepare the GHCB for the AP_HLT_LOOP VMGEXIT call + ; - Must be done while in 64-bit long mode so that writes to + ; the GHCB memory will be unencrypted. + ; - No NAE events can be generated once this is set otherwise + ; the AP_RESET_HOLD SW_EXITCODE will be overwritten. + ; + mov rcx, 0xc0010130 + rdmsr ; Retrieve current GHCB address + shl rdx, 32 + or rdx, rax + + mov rdi, rdx + xor rax, rax + mov rcx, 0x800 + shr rcx, 3 + rep stosq ; Clear the GHCB + + mov rax, 0x80000004 ; VMGEXIT AP_RESET_HOLD + mov [rdx + 0x390], rax + mov rax, 114 ; Set SwExitCode valid bit + bts [rdx + 0x3f0], rax + inc rax ; Set SwExitInfo1 valid bit + bts [rdx + 0x3f0], rax + inc rax ; Set SwExitInfo2 valid bit + bts [rdx + 0x3f0], rax + + pop rdx + pop rcx + +NoSevEs: + cli ; Disable interrupt before switching to 3= 2-bit mode + mov rax, [rsp + 40] ; CountTofinish lock dec dword [rax] ; (*CountTofinish)-- =20 - mov rax, [rsp + 40] ; Cr3 - ; Do not push on old stack, since old stack is not mapped - ; in the page table pointed by cr3 - mov cr3, rax - mov rsp, r8 ; TopOfApStack + mov r10, [rsp + 48] ; Pm16CodeSegment + mov rax, [rsp + 56] ; SevEsAPJumpTable + mov rbx, [rsp + 64] ; WakeupBuffer + mov rsp, r9 ; TopOfApStack + + push rax ; Save SevEsAPJumpTable + push rbx ; Save WakeupBuffer + push r10 ; Save Pm16CodeSegment + push rcx ; Save MwaitSupport + push rdx ; Save ApTargetCState + + lea rax, [PmEntry] ; rax <- The start address of transition = code + + push r8 + push rax + + ; + ; Clear R8 - R15, for reset, before going into 32-bit mode + ; + xor r8, r8 + xor r9, r9 + xor r10, r10 + xor r11, r11 + xor r12, r12 + xor r13, r13 + xor r14, r14 + xor r15, r15 + + ; + ; Far return into 32-bit mode + ; + retfq + +BITS 32 +PmEntry: + mov eax, cr0 + btr eax, 31 ; Clear CR0.PG + mov cr0, eax ; Disable paging and caches + + mov ecx, 0xc0000080 + rdmsr + and ah, ~ 1 ; Clear LME + wrmsr + mov eax, cr4 + and al, ~ (1 << 5) ; Clear PAE + mov cr4, eax + + pop edx + add esp, 4 + pop ecx, + add esp, 4 =20 MwaitCheck: cmp cl, 1 ; Check mwait-monitor support jnz HltLoop - mov rbx, rdx ; Save C-State to ebx - + mov ebx, edx ; Save C-State to ebx MwaitLoop: cli - mov rax, rsp ; Set Monitor Address + mov eax, esp ; Set Monitor Address xor ecx, ecx ; ecx =3D 0 xor edx, edx ; edx =3D 0 monitor @@ -324,10 +402,49 @@ MwaitLoop: jmp MwaitLoop =20 HltLoop: + pop edx ; PM16CodeSegment + add esp, 4 + pop ebx ; WakeupBuffer + add esp, 4 + pop eax ; SevEsAPJumpTable + add esp, 4 + cmp eax, 0 ; Check for SEV-ES + je DoHlt + + cli + ; + ; SEV-ES is enabled, use VMGEXIT (GHCB information already + ; set by caller) + ; +BITS 64 + rep vmmcall +BITS 32 + + ; + ; Back from VMGEXIT AP_HLT_LOOP + ; Push the FLAGS/CS/IP values to use + ; + push word 0x0002 ; EFLAGS + xor ecx, ecx + mov cx, [eax + 2] ; CS + push cx + mov cx, [eax] ; IP + push cx + push word 0x0000 ; For alignment, will be discarded + + push edx + push ebx + + mov edx, esi ; Restore RDX reset value + + retf + +DoHlt: cli hlt - jmp HltLoop + jmp DoHlt =20 +BITS 64 AsmRelocateApLoopEnd: =20 ;-------------------------------------------------------------------------= ------------ diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc index 781acedfc5..f9a46089d2 100644 --- a/UefiCpuPkg/UefiCpuPkg.dsc +++ b/UefiCpuPkg/UefiCpuPkg.dsc @@ -94,7 +94,6 @@ MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuE= xceptionHandlerLib.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf RegisterCpuFeaturesLib|UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegi= sterCpuFeaturesLib.inf CpuCacheInfoLib|UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf --=20 2.36.1.windows.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 (#98164): https://edk2.groups.io/g/devel/message/98164 Mute This Topic: https://groups.io/mt/96145515/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- From nobody Tue May 14 18:40:03 2024 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+98165+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+98165+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1673235489; cv=none; d=zohomail.com; s=zohoarc; b=hyZOqLVn3jxrnfAaGzHCu7Ge6KV4p9g7ChZYHEs7sZIxkrmZ0RiIIyefK4OXa+8zHGsk9O/ByQB6YjwN+0XWO5bLOEcb94JLpwqKtcrQS4ilhch4qGW4ig+yXlG8eISkVr16mMZUjic5Tp53w04exKs2IjTHcURL30B47QKijYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673235489; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=BYHwJjx5hC8Ds2tPX2XURdI794YA2nOayo31L/hVW0Y=; b=ABTt2bY7SNIS70ul2vrzzzFunN5r17gSy/3t36AwJFASLyUiVonT94JoSkN0dcwDfuvyYQNHO48RT7DsX+yGd1i7oC0M1DS+JDFG1bvMxkp34/9OCyE3Lkoc76ZgA3II3xHtjzOQA5xiOoZPoYFn2jOaMTW0o1/wG7l1CL5Q/1g= 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+98165+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 1673235489614827.127218845966; Sun, 8 Jan 2023 19:38:09 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id EzQ8YY1788612xWlspal5Zfe; Sun, 08 Jan 2023 19:38:09 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.63069.1673235488854194681 for ; Sun, 08 Jan 2023 19:38:08 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="306306821" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="306306821" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 19:38:07 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="764170058" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="764170058" X-Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.182.166]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 19:38:03 -0800 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [edk2-devel] [PATCH 2/4] Revert "UefiPayloadPkg: Add CpuPageTableLib required by MpInitLib." Date: Mon, 9 Jan 2023 11:37:22 +0800 Message-Id: <20230109033724.1130-3-yuanhao.xie@intel.com> In-Reply-To: <20230109033724.1130-1-yuanhao.xie@intel.com> References: <20230109033724.1130-1-yuanhao.xie@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,yuanhao.xie@intel.com X-Gm-Message-State: Vyl3tCydl96J9hwypdNugjnfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1673235489; bh=L0vhUFsO0fa6DHOv/DkvGp//QW4rjy0lFCEZOQC4Vc4=; h=Cc:Date:From:Reply-To:Subject:To; b=gvF0FeYtaFzHVjsnH2CRwnOGjeFhILVXJjffdHgq/kqNT/Tix6ba7WjCoIte3OuXFxJ PBchrj3v0iU6MIZmM5tlJPrLzlFnwtkkMzO5UVXHA8aKjP/+eO5cVdWG7yGn60BO7YoLw 8cMwjzMm/sv8zbe3Kv8Zw90HE6H4lrFlIVc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1673235491030100001 Content-Type: text/plain; charset="utf-8" This reverts commit 3f378450dfafc11754bfdb64af28060ec8466acb, since the commit 73ccde8 introduced CpuPageTableLib dependency which resolved for UefiPayloadPkg need to be reverted. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4234 Cc: Guo Dong Cc: Ray Ni Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Signed-off-by: Yuanhao Xie Reviewed-by: Gua Guo Reviewed-by: Laszlo Ersek --- UefiPayloadPkg/UefiPayloadPkg.dsc | 1 - 1 file changed, 1 deletion(-) diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index a1a3c74290..2dbd875f37 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -340,7 +340,6 @@ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf !endif CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuE= xceptionHandlerLib.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf !if $(PERFORMANCE_MEASUREMENT_ENABLE) PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.= inf --=20 2.36.1.windows.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 (#98165): https://edk2.groups.io/g/devel/message/98165 Mute This Topic: https://groups.io/mt/96145517/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- From nobody Tue May 14 18:40:03 2024 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+98166+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+98166+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1673235491; cv=none; d=zohomail.com; s=zohoarc; b=fO2urnaxDSgw6W751dHIx32j5IJNXBTU68AaitfyZzcOVOO49UzocVyvHhOxur+qMZBXYSUJcDyCHDQYINHFyk9Qe42KGnYi3Oqm4bnUmh1Ed/ZtaZxWeTLvEKIX3vIQkgVABsu/U3TbRqi7om82PMu96wHS3YPVRzSg8W52uOo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673235491; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=WeZW/fIm0AWfLIideyXtJ8NszfAbGfb5bEEmrsBVimo=; b=dNBVjwCJZZ6tlaY4SIuRwlz9+eNzozZf9hEt9Hq+gn4a91StYXrHAEnvm2zy/8DhFuJ3bQszA7bjmgGOnog+Ux8hk5GJexmKssuh+2CTkU6mLfrJoELr/ITpZR1MOArJ2wjZeFVaCgox9mlLyAUcFytSSnZHnaYdlgP2wartcfw= 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+98166+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 1673235491758571.7741630251317; Sun, 8 Jan 2023 19:38:11 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id pGg1YY1788612xyjq7BVjOmx; Sun, 08 Jan 2023 19:38:11 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.63069.1673235488854194681 for ; Sun, 08 Jan 2023 19:38:10 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="306306841" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="306306841" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 19:38:10 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="764170065" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="764170065" X-Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.182.166]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 19:38:08 -0800 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann Subject: [edk2-devel] [PATCH 3/4] Revert "OvmfPkg: Add CpuPageTableLib required by MpInitLib." Date: Mon, 9 Jan 2023 11:37:23 +0800 Message-Id: <20230109033724.1130-4-yuanhao.xie@intel.com> In-Reply-To: <20230109033724.1130-1-yuanhao.xie@intel.com> References: <20230109033724.1130-1-yuanhao.xie@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,yuanhao.xie@intel.com X-Gm-Message-State: 108opL8GpDQfWg3rCUxOtfa1x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1673235491; bh=0HD7ES3/J7aNg5ldWtUtVfgE2OtTVR4WHQWSqrYKHls=; h=Cc:Date:From:Reply-To:Subject:To; b=hEvBSQZKJGu+zl2bYu90KS9H5BC76T50d9URQi+G4Y5uFNKWNWZaA+XCi7PxmD150yJ QycR9rhzRsyrjkQwJahNZdyFKnXX5BJCy+pq7MQqsPS2NfJAJtDzZceOLoi2+e9FqF0Jw fvfpTLBuK9UCIB7Sc4gFbP6at0TaNR5nMCo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1673235493069100005 Content-Type: text/plain; charset="utf-8" This reverts commit 4a8642422460635462d315defe4ca84bf6d33351 as the commit 73ccde8 introduced CpuPageTableLib dependency which resolved for OvmfPkg is to be reverted. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4234 Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Signed-off-by: Yuanhao Xie Reviewed-by: Laszlo Ersek --- OvmfPkg/AmdSev/AmdSevX64.dsc | 3 +-- OvmfPkg/CloudHv/CloudHvX64.dsc | 1 - OvmfPkg/IntelTdx/IntelTdxX64.dsc | 4 +--- OvmfPkg/Microvm/MicrovmX64.dsc | 3 +-- OvmfPkg/OvmfPkgIa32X64.dsc | 1 - OvmfPkg/OvmfPkgX64.dsc | 2 -- OvmfPkg/OvmfXen.dsc | 3 +-- 7 files changed, 4 insertions(+), 13 deletions(-) diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index 1cafe0d5b3..36100f5fdc 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -3,7 +3,7 @@ # virtual machine remote attestation and secret injection # # Copyright (c) 2020 James Bottomley, IBM Corporation. -# Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -353,7 +353,6 @@ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf !endif PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterr= uptTplLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc index dc2509c39e..03b7a5cc6b 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -404,7 +404,6 @@ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf !endif PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterr= uptTplLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX6= 4.dsc index 5bd74639b4..81511e3556 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -1,7 +1,7 @@ ## @file # EFI/Framework Open Virtual Machine Firmware (OVMF) platform # -# Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# Copyright (c) Microsoft Corporation. # @@ -313,7 +313,6 @@ CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuE= xceptionHandlerLib.inf LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterr= uptTplLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf @@ -579,7 +578,6 @@ =20 UefiCpuPkg/CpuDxe/CpuDxe.inf { - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.i= nf # # Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib which # checks the Protocol of gEfiMpInitLibMpDepProtocolGuid. diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index f92a321fc2..d5bdcbb983 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -1,7 +1,7 @@ ## @file # EFI/Framework Open Virtual Machine Firmware (OVMF) platform # -# Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# Copyright (c) Microsoft Corporation. # @@ -403,7 +403,6 @@ PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExp= ressLib.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterr= uptTplLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index f21b78299f..a9d422bd91 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -414,7 +414,6 @@ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf !endif PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterr= uptTplLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index e24bb442cb..8401d73900 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -434,7 +434,6 @@ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf !endif PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterr= uptTplLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf @@ -815,7 +814,6 @@ =20 UefiCpuPkg/CpuDxe/CpuDxe.inf { - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.i= nf # # Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib which # checks the Protocol of gEfiMpInitLibMpDepProtocolGuid. diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index bfa08c08e3..c328987e84 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -1,7 +1,7 @@ ## @file # EFI/Framework Open Virtual Machine Firmware (OVMF) platform # -# Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# Copyright (c) 2019, Citrix Systems, Inc. # Copyright (c) Microsoft Corporation. @@ -339,7 +339,6 @@ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf !endif PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterr= uptTplLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf --=20 2.36.1.windows.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 (#98166): https://edk2.groups.io/g/devel/message/98166 Mute This Topic: https://groups.io/mt/96145519/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- From nobody Tue May 14 18:40:03 2024 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+98167+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+98167+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1673235494; cv=none; d=zohomail.com; s=zohoarc; b=MEF4y/fe7pFSWHIamyVMNxnue5qixK0h1rotcVP3hvDrCgM14wDsI8JTeXIUnetHjVcCPEKhAQ2JuuNYJcWMfRBbv7bebsSjNtjlO3uW6pAUbFHaEdNkPFqatIcPP7x6xMBt+yHspQxHKUTq23gMelGkDVeCETlTNddlyTl45lo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673235494; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=XvpzZGsmszKjzz1IEPCfyI+N4sq1z4t9b6Zy3w08d34=; b=hHIw2JpNB1eaTZJrxPQnZHHUZ1yANVXePZI+kiq2o+949M2AgLk/1DhVFSm2F8KChf331B6Zq1bd/saK/v+l6OyHqw/1ZQMcxDwB9aoHEXVT3G+1lkIUZE8o0okxNUCGlUeRPpK2zw/PGCPKU+v73BgqEElm7FpXpJFVOM46tts= 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+98167+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 1673235494467867.951615263616; Sun, 8 Jan 2023 19:38:14 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id dEqTYY1788612xgdY7FNXjgT; Sun, 08 Jan 2023 19:38:14 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.63069.1673235488854194681 for ; Sun, 08 Jan 2023 19:38:13 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="306306869" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="306306869" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 19:38:13 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="764170100" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="764170100" X-Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.182.166]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 19:38:11 -0800 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [edk2-devel] [PATCH 4/4] Revert "UefiCpuPkg: Duplicated AsmRelocateApLoop as AsmRelocateApLoopAmd" Date: Mon, 9 Jan 2023 11:37:24 +0800 Message-Id: <20230109033724.1130-5-yuanhao.xie@intel.com> In-Reply-To: <20230109033724.1130-1-yuanhao.xie@intel.com> References: <20230109033724.1130-1-yuanhao.xie@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,yuanhao.xie@intel.com X-Gm-Message-State: 6vzvJlPNvmHfatorefXBtBAZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1673235494; bh=YBjtAF0FYkCT8EaC0IBDbaxcNU1mzsBebsr8i9Q+gS4=; h=Cc:Date:From:Reply-To:Subject:To; b=t0e5+vwYp0bsy1e5r5MWiRR30WD/N76761edGnVFLQlCqkB/ZJyH5in4UgIuwkY0fsf SHJIhYhdj/jho0iM3UgsFEH6wqhuup/adDTd37kiGf3X5DKvW7W7fmm19JrmDDS+ZsuY2 1Y2YS0rsZkf4OwxCH2aPMqpLY4r7DPJ2E8k= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1673235495085100010 Content-Type: text/plain; charset="utf-8" This reverts commit 7bda8c648192d76f7b3f7cee54bd7b1c86a6a84f. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4234 Cc: Guo Dong Cc: Ray Ni Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Signed-off-by: Yuanhao Xie Reviewed-by: Laszlo Ersek --- UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 52 +++--- UefiCpuPkg/Library/MpInitLib/MpEqu.inc | 2 - UefiCpuPkg/Library/MpInitLib/MpLib.h | 27 --- UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm | 169 ------------------ UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 5 - 5 files changed, 20 insertions(+), 235 deletions(-) diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/M= pInitLib/DxeMpLib.c index 445e0853d2..a84e9e33ba 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c @@ -1,7 +1,7 @@ /** @file MP initialize support functions for DXE phase. =20 - Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -378,44 +378,32 @@ RelocateApLoop ( IN OUT VOID *Buffer ) { - CPU_MP_DATA *CpuMpData; - BOOLEAN MwaitSupport; - ASM_RELOCATE_AP_LOOP AsmRelocateApLoopFunc; - ASM_RELOCATE_AP_LOOP_AMD AsmRelocateApLoopFuncAmd; - UINTN ProcessorNumber; - UINTN StackStart; + CPU_MP_DATA *CpuMpData; + BOOLEAN MwaitSupport; + ASM_RELOCATE_AP_LOOP AsmRelocateApLoopFunc; + UINTN ProcessorNumber; + UINTN StackStart; =20 MpInitLibWhoAmI (&ProcessorNumber); CpuMpData =3D GetCpuMpData (); MwaitSupport =3D IsMwaitSupport (); - if (StandardSignatureIsAuthenticAMD ()) { - StackStart =3D CpuMpData->UseSevEsAPMethod ? CpuMpData->= SevEsAPResetStackStart : mReservedTopOfApStack; - AsmRelocateApLoopFuncAmd =3D (ASM_RELOCATE_AP_LOOP_AMD)(UINTN)mReserve= dApLoopFunc; - AsmRelocateApLoopFuncAmd ( - MwaitSupport, - CpuMpData->ApTargetCState, - CpuMpData->PmCodeSegment, - StackStart - ProcessorNumber * AP_SAFE_STACK_SIZE, - (UINTN)&mNumberToFinish, - CpuMpData->Pm16CodeSegment, - CpuMpData->SevEsAPBuffer, - CpuMpData->WakeupBuffer - ); + if (CpuMpData->UseSevEsAPMethod) { + StackStart =3D CpuMpData->SevEsAPResetStackStart; } else { - StackStart =3D mReservedTopOfApStack; - AsmRelocateApLoopFunc =3D (ASM_RELOCATE_AP_LOOP)(UINTN)mReservedApLoop= Func; - AsmRelocateApLoopFunc ( - MwaitSupport, - CpuMpData->ApTargetCState, - CpuMpData->PmCodeSegment, - StackStart - ProcessorNumber * AP_SAFE_STACK_SIZE, - (UINTN)&mNumberToFinish, - CpuMpData->Pm16CodeSegment, - CpuMpData->SevEsAPBuffer, - CpuMpData->WakeupBuffer - ); + StackStart =3D mReservedTopOfApStack; } =20 + AsmRelocateApLoopFunc =3D (ASM_RELOCATE_AP_LOOP)(UINTN)mReservedApLoopFu= nc; + AsmRelocateApLoopFunc ( + MwaitSupport, + CpuMpData->ApTargetCState, + CpuMpData->PmCodeSegment, + StackStart - ProcessorNumber * AP_SAFE_STACK_SIZE, + (UINTN)&mNumberToFinish, + CpuMpData->Pm16CodeSegment, + CpuMpData->SevEsAPBuffer, + CpuMpData->WakeupBuffer + ); // // It should never reach here // diff --git a/UefiCpuPkg/Library/MpInitLib/MpEqu.inc b/UefiCpuPkg/Library/Mp= InitLib/MpEqu.inc index ea202d4aef..ebadcc6fb3 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpEqu.inc +++ b/UefiCpuPkg/Library/MpInitLib/MpEqu.inc @@ -26,8 +26,6 @@ struc MP_ASSEMBLY_ADDRESS_MAP .RendezvousFunnelSize CTYPE_UINTN 1 .RelocateApLoopFuncAddress CTYPE_UINTN 1 .RelocateApLoopFuncSize CTYPE_UINTN 1 - .RelocateApLoopFuncAddressAmd CTYPE_UINTN 1 - .RelocateApLoopFuncSizeAmd CTYPE_UINTN 1 .ModeTransitionOffset CTYPE_UINTN 1 .SwitchToRealNoNxOffset CTYPE_UINTN 1 .SwitchToRealPM16ModeOffset CTYPE_UINTN 1 diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpIn= itLib/MpLib.h index 1102003a93..f5086e497e 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h @@ -179,8 +179,6 @@ typedef struct { UINTN RendezvousFunnelSize; UINT8 *RelocateApLoopFuncAddress; UINTN RelocateApLoopFuncSize; - UINT8 *RelocateApLoopFuncAddressAmd; - UINTN RelocateApLoopFuncSizeAmd; UINTN ModeTransitionOffset; UINTN SwitchToRealNoNxOffset; UINTN SwitchToRealPM16ModeOffset; @@ -348,31 +346,6 @@ typedef =20 extern EFI_GUID mCpuInitMpLibHobGuid; =20 -/** - Assembly code to place AP into safe loop mode for Amd. - Place AP into targeted C-State if MONITOR is supported, otherwise - place AP into hlt state. - Place AP in protected mode if the current is long mode. Due to AP maybe - wakeup by some hardware event. It could avoid accessing page table that - may not available during booting to OS. - @param[in] MwaitSupport TRUE indicates MONITOR is supported. - FALSE indicates MONITOR is not supported. - @param[in] ApTargetCState Target C-State value. - @param[in] PmCodeSegment Protected mode code segment value. -**/ -typedef - VOID -(EFIAPI *ASM_RELOCATE_AP_LOOP_AMD)( - IN BOOLEAN MwaitSupport, - IN UINTN ApTargetCState, - IN UINTN PmCodeSegment, - IN UINTN TopOfApStack, - IN UINTN NumberToFinish, - IN UINTN Pm16CodeSegment, - IN UINTN SevEsAPJumpTable, - IN UINTN WakeupBuffer - ); - /** Assembly code to place AP into safe loop mode. =20 diff --git a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm b/UefiCpuPkg/Libr= ary/MpInitLib/X64/AmdSev.nasm index b2d95adf6d..7c2469f9c5 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm +++ b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm @@ -346,172 +346,3 @@ PM16Mode: iret =20 SwitchToRealProcEnd: -;-------------------------------------------------------------------------= ------------ -; AsmRelocateApLoopAmd (MwaitSupport, ApTargetCState, PmCodeSegment, TopO= fApStack, CountTofinish, Pm16CodeSegment, SevEsAPJumpTable, WakeupBuffer); -;-------------------------------------------------------------------------= ------------ - -AsmRelocateApLoopStartAmd: -BITS 64 - cmp qword [rsp + 56], 0 ; SevEsAPJumpTable - je NoSevEsAmd - - ; - ; Perform some SEV-ES related setup before leaving 64-bit mode - ; - push rcx - push rdx - - ; - ; Get the RDX reset value using CPUID - ; - mov rax, 1 - cpuid - mov rsi, rax ; Save off the reset value for RDX - - ; - ; Prepare the GHCB for the AP_HLT_LOOP VMGEXIT call - ; - Must be done while in 64-bit long mode so that writes to - ; the GHCB memory will be unencrypted. - ; - No NAE events can be generated once this is set otherwise - ; the AP_RESET_HOLD SW_EXITCODE will be overwritten. - ; - mov rcx, 0xc0010130 - rdmsr ; Retrieve current GHCB address - shl rdx, 32 - or rdx, rax - - mov rdi, rdx - xor rax, rax - mov rcx, 0x800 - shr rcx, 3 - rep stosq ; Clear the GHCB - - mov rax, 0x80000004 ; VMGEXIT AP_RESET_HOLD - mov [rdx + 0x390], rax - mov rax, 114 ; Set SwExitCode valid bit - bts [rdx + 0x3f0], rax - inc rax ; Set SwExitInfo1 valid bit - bts [rdx + 0x3f0], rax - inc rax ; Set SwExitInfo2 valid bit - bts [rdx + 0x3f0], rax - - pop rdx - pop rcx - -NoSevEsAmd: - cli ; Disable interrupt before switching to 3= 2-bit mode - mov rax, [rsp + 40] ; CountTofinish - lock dec dword [rax] ; (*CountTofinish)-- - - mov r10, [rsp + 48] ; Pm16CodeSegment - mov rax, [rsp + 56] ; SevEsAPJumpTable - mov rbx, [rsp + 64] ; WakeupBuffer - mov rsp, r9 ; TopOfApStack - - push rax ; Save SevEsAPJumpTable - push rbx ; Save WakeupBuffer - push r10 ; Save Pm16CodeSegment - push rcx ; Save MwaitSupport - push rdx ; Save ApTargetCState - - lea rax, [PmEntryAmd] ; rax <- The start address of transiti= on code - - push r8 - push rax - - ; - ; Clear R8 - R15, for reset, before going into 32-bit mode - ; - xor r8, r8 - xor r9, r9 - xor r10, r10 - xor r11, r11 - xor r12, r12 - xor r13, r13 - xor r14, r14 - xor r15, r15 - - ; - ; Far return into 32-bit mode - ; -o64 retf - -BITS 32 -PmEntryAmd: - mov eax, cr0 - btr eax, 31 ; Clear CR0.PG - mov cr0, eax ; Disable paging and caches - - mov ecx, 0xc0000080 - rdmsr - and ah, ~ 1 ; Clear LME - wrmsr - mov eax, cr4 - and al, ~ (1 << 5) ; Clear PAE - mov cr4, eax - - pop edx - add esp, 4 - pop ecx, - add esp, 4 - -MwaitCheckAmd: - cmp cl, 1 ; Check mwait-monitor support - jnz HltLoopAmd - mov ebx, edx ; Save C-State to ebx -MwaitLoopAmd: - cli - mov eax, esp ; Set Monitor Address - xor ecx, ecx ; ecx =3D 0 - xor edx, edx ; edx =3D 0 - monitor - mov eax, ebx ; Mwait Cx, Target C-State per eax[7:4] - shl eax, 4 - mwait - jmp MwaitLoopAmd - -HltLoopAmd: - pop edx ; PM16CodeSegment - add esp, 4 - pop ebx ; WakeupBuffer - add esp, 4 - pop eax ; SevEsAPJumpTable - add esp, 4 - cmp eax, 0 ; Check for SEV-ES - je DoHltAmd - - cli - ; - ; SEV-ES is enabled, use VMGEXIT (GHCB information already - ; set by caller) - ; -BITS 64 - rep vmmcall -BITS 32 - - ; - ; Back from VMGEXIT AP_HLT_LOOP - ; Push the FLAGS/CS/IP values to use - ; - push word 0x0002 ; EFLAGS - xor ecx, ecx - mov cx, [eax + 2] ; CS - push cx - mov cx, [eax] ; IP - push cx - push word 0x0000 ; For alignment, will be discarded - - push edx - push ebx - - mov edx, esi ; Restore RDX reset value - - retf - -DoHltAmd: - cli - hlt - jmp DoHltAmd - -BITS 64 -AsmRelocateApLoopEndAmd: diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Lib= rary/MpInitLib/X64/MpFuncs.nasm index 39c3e8606a..5d71995bf8 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm @@ -460,11 +460,6 @@ ASM_PFX(AsmGetAddressMap): mov qword [rcx + MP_ASSEMBLY_ADDRESS_MAP.RelocateApLoopFuncAddr= ess], rax mov qword [rcx + MP_ASSEMBLY_ADDRESS_MAP.RelocateApLoopFuncSize= ], AsmRelocateApLoopEnd - AsmRelocateApLoopStart mov qword [rcx + MP_ASSEMBLY_ADDRESS_MAP.ModeTransitionOffset],= Flat32Start - RendezvousFunnelProcStart - - lea rax, [AsmRelocateApLoopStartAmd] - mov qword [rcx + MP_ASSEMBLY_ADDRESS_MAP.RelocateApLoopFuncAddr= essAmd], rax - mov qword [rcx + MP_ASSEMBLY_ADDRESS_MAP.RelocateApLoopFuncSize= Amd], AsmRelocateApLoopEndAmd - AsmRelocateApLoopStartAmd - mov qword [rcx + MP_ASSEMBLY_ADDRESS_MAP.SwitchToRealNoNxOffset= ], SwitchToRealProcStart - Flat32Start mov qword [rcx + MP_ASSEMBLY_ADDRESS_MAP.SwitchToRealPM16ModeOf= fset], PM16Mode - RendezvousFunnelProcStart mov qword [rcx + MP_ASSEMBLY_ADDRESS_MAP.SwitchToRealPM16ModeSi= ze], SwitchToRealProcEnd - PM16Mode --=20 2.36.1.windows.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 (#98167): https://edk2.groups.io/g/devel/message/98167 Mute This Topic: https://groups.io/mt/96145521/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-