From nobody Sun Feb 8 21:29:04 2026 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+78059+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+78059+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1626933192; cv=none; d=zohomail.com; s=zohoarc; b=R7fqlJneb0uHvEO8+89ex87oxCaSQbA/yOhtenDRXOzav6CCFRrJb+HOw9aWOCnyT7URaqxYEpuk82KuOfaVoVJgdMCVoiLPX3rXT65YOXLEEcxj5GPgSjV0dq6pNhklHoaQdgvubdzuVEa9/ebFgd5PPaLq0OBrcLq0qGx/WF0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626933192; 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=es5IP9qHxOjqpPAsYmUtkrRwIZ1Wt/y/crVJ9MHgSwo=; b=IbuEvwGXC40VWZoCFrzaxdCrEZsbFYXvKPnR2jLkoWUozZEEVUUmjfDSzZkrYDEuSH8+E9CCNH9IPsYVuMOVORgmbbsXjOGJ5HORUk3xeZ6Kr4uZZ4pY34mxVw3OurARcprDnLjWP96GJKsRZ4rYEVPqtiTlYN6962quf6qPum8= 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+78059+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 1626933192927142.52911400317862; Wed, 21 Jul 2021 22:53:12 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ghQUYY1788612xpxH3cGGhW3; Wed, 21 Jul 2021 22:53:12 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web08.4239.1626933190759000499 for ; Wed, 21 Jul 2021 22:53:12 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10052"; a="275391637" X-IronPort-AV: E=Sophos;i="5.84,260,1620716400"; d="scan'208";a="275391637" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2021 22:53:11 -0700 X-IronPort-AV: E=Sophos;i="5.84,260,1620716400"; d="scan'208";a="512374772" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.4.4]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2021 22:53:10 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Eric Dong , Ray Ni , Jiewen Yao Subject: [edk2-devel] [PATCH V2 3/4] UefiCpuPkg/ResetVector: Add Main32 entry point in Main.asm Date: Thu, 22 Jul 2021 13:52:15 +0800 Message-Id: <385d5e4bc26eb601a1ee6eeb982d5cde06ceab2a.1626931332.git.min.m.xu@intel.com> In-Reply-To: References: 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,min.m.xu@intel.com X-Gm-Message-State: cq58gdxJXroolbzabjodx9pqx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1626933192; bh=wPMQjzLJPtDcziyYK2QkwzC09NtwCOchKrLu3/z09AU=; h=Cc:Date:From:Reply-To:Subject:To; b=H30BW0bBBuJtiuFMDy7h8dnvMe7Z/qBCUjKZ+NFWagbu6amBgHVuLoYW4yT2EkoAGLr MOyikjjSGVMQC9e4p8nLJv/kPCeHcDCQiKsUoaCwJs0CnIlnw86NvGJwUO0jPtEdlHivs rRPKE5zzguz2qE+Ajq7DUcidu7OPxMp3k3Y= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1626933194061100011 Content-Type: text/plain; charset="utf-8" RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3429 In Tdx all CPUs "reset" to run on 32-bit protected mode with flat descriptor (paging disabled). Main32 entry point is added in UefiCpuPkg/ResetVector/Vtf0/Main.asm so that Main.asm can support the 32-bit protected mode. Init32.asm is the 32-bit initialization code. It is a null stub in UefiCpuPkg. The actual initialization can be implemented in the platform (OvmfPkg/ResetVector/Ia32/Init32.asm is the example.) Cc: Eric Dong Cc: Ray Ni Cc: Jiewen Yao Signed-off-by: Min Xu Reviewed-by: Ray Ni --- UefiCpuPkg/ResetVector/Vtf0/Ia32/Init32.asm | 13 +++++++++++++ UefiCpuPkg/ResetVector/Vtf0/Main.asm | 14 ++++++++++++++ UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Ia32/Init32.asm diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia32/Init32.asm b/UefiCpuPkg/Reset= Vector/Vtf0/Ia32/Init32.asm new file mode 100644 index 000000000000..0cdae4a4a84a --- /dev/null +++ b/UefiCpuPkg/ResetVector/Vtf0/Ia32/Init32.asm @@ -0,0 +1,13 @@ +;-------------------------------------------------------------------------= ----- +; @file +; 32-bit initialization code. +; Copyright (c) 2021, Intel Corporation. All rights reserved.
+; SPDX-License-Identifier: BSD-2-Clause-Patent +; +;-------------------------------------------------------------------------= ----- + +BITS 32 + +Init32: + nop + OneTimeCallRet Init32 diff --git a/UefiCpuPkg/ResetVector/Vtf0/Main.asm b/UefiCpuPkg/ResetVector/= Vtf0/Main.asm index 19d08482f831..4920c6937e1b 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/Main.asm +++ b/UefiCpuPkg/ResetVector/Vtf0/Main.asm @@ -36,6 +36,20 @@ Main16: =20 BITS 32 =20 +%ifdef ARCH_X64 + + jmp SearchBfv + +; +; Entry point of Main32 +; +Main32: + + OneTimeCall Init32 + +%endif + +SearchBfv: ; ; Search for the Boot Firmware Volume (BFV) ; diff --git a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb b/UefiCpuPkg/ResetVecto= r/Vtf0/Vtf0.nasmb index 493738c79c1c..6493b9863c48 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb +++ b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb @@ -51,7 +51,7 @@ %include "Ia32/SearchForSecEntry.asm" =20 %ifdef ARCH_X64 -%include "Ia32/Flat32ToFlat64.asm" +%include "Ia32/Init32.asm" %include "Ia32/PageTables64.asm" %endif =20 --=20 2.29.2.windows.2 -=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 (#78059): https://edk2.groups.io/g/devel/message/78059 Mute This Topic: https://groups.io/mt/84373829/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-