From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.15979.1677651005289052489 for ; Tue, 28 Feb 2023 22:10:05 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=LdGGHWYe; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: yuanhao.xie@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677651005; x=1709187005; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=ImXocMOCrZ6tZPzefNsHeP6cchbx8NVmJLgFvLk0/mQ=; b=LdGGHWYet17RHwEuqimXQs0wm3pYd/4J6naL/Tpu08afOPRtDrmEZzFx 1jc7fnduZiRg2u1h9dpt39TB4hLQ2xpaqtyJlNX66wZ9WyUvMEb1edTnl bxWbKdde3Mfr07vD4UdyGCeKt4yDJy7GSikKpZ0FsUgglyR4h1yAUcxJf CULKnAdJtq1LxRR8941htlIWSShCEePnXvuttivoVjZG8ntEsS4NvD+qM t7ggHceLG6OioFD1HL9UYyC5CDJUR99eJ8D7wzFt54DoCdswpTshVwfV/ eF0veHWpgDLwSI3TzSusntdQpkDNnRQUr0Ru6nBQG4VFSLwnPqPvmi9IS g==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="420590629" X-IronPort-AV: E=Sophos;i="5.98,224,1673942400"; d="scan'208";a="420590629" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 22:10:04 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="1003533708" X-IronPort-AV: E=Sophos;i="5.98,224,1673942400"; d="scan'208";a="1003533708" Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.55.55]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 22:10:03 -0800 From: "Yuanhao Xie" To: devel@edk2.groups.io Subject: [Patch V4 0/8] Put APs in 64 bit mode before handoff to OS. Date: Wed, 1 Mar 2023 14:09:46 +0800 Message-Id: <20230301060954.1464-1-yuanhao.xie@intel.com> X-Mailer: git-send-email 2.36.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The purpose of this patch series is to put the APs in 64-bit mode before handing off the boot process to the OS, AMD 64-bit processors with SEV-ES follows the original logic. Ref:https://bugzilla.tianocore.org/show_bug.cgi?id=4234 Yuanhao Xie (8): UefiCpuPkg: Check AP_SAFE_STACK_SIZE during build time. UefiCpuPkg: Split the path in RelocateApLoop into two. UefiCpuPkg: Allocate contiguous memory for stacks and APs loop. OvmfPkg: Add CpuPageTableLib required by MpInitLib. UefiPayloadPkg: Add CpuPageTableLib required by MpInitLib. UefiCpuPkg: Put APs in 64 bit mode before handoff to OS. UefiCpuPkg: Rename AsmRelocateApLoopStart. UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm OvmfPkg/AmdSev/AmdSevX64.dsc | 3 ++- OvmfPkg/CloudHv/CloudHvX64.dsc | 3 ++- OvmfPkg/IntelTdx/IntelTdxX64.dsc | 4 +++- OvmfPkg/Microvm/MicrovmX64.dsc | 3 ++- OvmfPkg/OvmfPkgIa32X64.dsc | 3 ++- OvmfPkg/OvmfPkgX64.dsc | 4 +++- OvmfPkg/OvmfXen.dsc | 3 ++- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 6 +++++- UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------- UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c | 23 +++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm | 26 +++++++++++++------------- UefiCpuPkg/Library/MpInitLib/MpEqu.inc | 22 ++++++++++++---------- UefiCpuPkg/Library/MpInitLib/MpLib.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 198 ++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------ UefiPayloadPkg/UefiPayloadPkg.dsc | 3 ++- 17 files changed, 504 insertions(+), 254 deletions(-) create mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c create mode 100644 UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c -- 2.36.1.windows.1