From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.18315.1677175578044889092 for ; Thu, 23 Feb 2023 10:06:18 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=k0nuSWKb; spf=pass (domain: intel.com, ip: 192.55.52.115, 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=1677175578; x=1708711578; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=oSiJq7Ss9MlzLsxHV7wdZ3uFj3NqGucc0zPZvmwya/U=; b=k0nuSWKb608l71RGR8U6c6UvhqfJczx3AT8MDFuqfcut9CEwfHvZBBV2 ltSn6a/msIpIg+xaGyB1wd+bGp1E7dRASE3uJSSvcRk6gm1ltVn74+BJH eJbon1D2kzmqiJlGA6LfromnRFdPrxMrpN8oHK4hoF0C1+xawL4YBt0w8 rvHR6OZRNPychVlxQ9J87El/68MThrYVKRkFF9CYac0JVJdH7TkVAtWCd fWjMcdpQn2sXzU6rB7P52EXrLwDoJ3XNGeOJ+R1/2tE75CkiDr6HkB7ry 9tpUyYp1YeuqLzHtUyoH+6nXHYFrikAMzs+KShbciahy9Kjl4m0JGWJbZ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="333288043" X-IronPort-AV: E=Sophos;i="5.97,322,1669104000"; d="scan'208";a="333288043" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 10:05:53 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="918106760" X-IronPort-AV: E=Sophos;i="5.97,322,1669104000"; d="scan'208";a="918106760" Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.182.166]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 10:05:53 -0800 From: "Yuanhao Xie" To: devel@edk2.groups.io Subject: [Patch V3 0/6] Put APs in 64 bit mode before handoff to OS. Date: Fri, 24 Feb 2023 02:05:29 +0800 Message-Id: <20230223180535.10383-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 AP in 64-bit mode before handing off the boot process to the OS. To do this, duplicate relocateApLoop for processors with SEV-ES, allocate contiguous memory, then create page tables and keep AP in 64-bit mode. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4234 Yuanhao Xie (6): UefiCpuPkg: Move AsmRelocateApLoop to AmdSev.nasm. UefiCpuPkg: Duplicate AsmRelocateApLoopAmd. UefiCpuPkg: Contiguous memory allocation and code clean-up. OvmfPkg: Add CpuPageTableLib required by MpInitLib. UefiPayloadPkg: Add CpuPageTableLib required by MpInitLib. UefiCpuPkg: Put APs in 64 bit mode before handoff to OS. 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 | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------ UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c | 23 +++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm | 11 ++++------- UefiCpuPkg/Library/MpInitLib/MpEqu.inc | 22 ++++++++++++---------- UefiCpuPkg/Library/MpInitLib/MpLib.h | 46 ++++++++++++++++++++++++++++++++++++++++++++-- UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 178 ++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------- UefiCpuPkg/UefiCpuPkg.dsc | 3 ++- UefiPayloadPkg/UefiPayloadPkg.dsc | 3 ++- 18 files changed, 486 insertions(+), 241 deletions(-) create mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c create mode 100644 UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c -- 2.36.1.windows.1