From nobody Mon Feb 9 09:21:16 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+81151+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+81151+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1632708338; cv=none; d=zohomail.com; s=zohoarc; b=HzBYTgfxIOC7GGyXY+Ev/NYF8+PxC/H8VNVxdA4NwXoxn8/IncoR4yJrfn3Y4M3Y9qAB6zT5RgHfgRsHNPRO28uEXHwNuc5wTd64maVnqcAT+sQpgp10T5vX51IbrNmk5GhkGUPqc+veYUnMmHwP+IzK3O2fIeBWDfne8LNfhWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632708338; h=Content-Type: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=ntJF0OSFT5NGXS9hUX6aICemREo+hEW2tYZYzwr9Vqk=; b=GJnwogGMgmJ9dXn5+/EWH5VaGBmkWeh9x9TiuGduzLwH6GjDoGRsv9/DVKdeC1NBwdANS9l5Q+Xe4k+17xapOWFIeeYUyOA49QmjseSaCB5hCPqUHCMNamH90jxIqFGpOD8NqIx53VnfPlZsbfX0Y4t+FBs+8DkrUyNiSaT6mcA= 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+81151+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 163270833815642.54569923807992; Sun, 26 Sep 2021 19:05:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8i5CYY1788612xt54PEy4hEv; Sun, 26 Sep 2021 19:05:37 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web08.26102.1632708330461172734 for ; Sun, 26 Sep 2021 19:05:37 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10119"; a="224420856" X-IronPort-AV: E=Sophos;i="5.85,325,1624345200"; d="scan'208";a="224420856" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2021 19:05:36 -0700 X-IronPort-AV: E=Sophos;i="5.85,325,1624345200"; d="scan'208";a="560913373" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.13.198]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2021 19:05:33 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Ard Biesheuvel , Jordan Justen , Gerd Hoffmann , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [edk2-devel] [PATCH V8 2/3] OvmfPkg: Clear WORK_AREA_GUEST_TYPE in Main.asm Date: Mon, 27 Sep 2021 10:05:11 +0800 Message-Id: <36b3457a7820cb21ec635d6bbec950998422352a.1632707635.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: QVS95owU7hLJRFmLrgo0IxCpx1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1632708337; bh=wVZBU5QCpOf8gJYzxcJ05Gwxldg7eCUAaRU3h5+O5c8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=EzKtQAc0l4kickASboQ3wuhj8KUkO29GDEmbiQ5F06bB5VS7L6S6rPvgH6sPYYiib3K Zo8zMjLkExiVbu3RvsW609xm+RO3ibumQBTY3f1B+1vKdV6oEStAQvrz0Wo+PxtxAYWOi FxZhwUEA9vxiVfPOIxlhhrFJvXgVagg7ABI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1632708338587100001 RFC=EF=BC=9A https://bugzilla.tianocore.org/show_bug.cgi?id=3D3429 Previously WORK_AREA_GUEST_TYPE was cleared in SetCr3ForPageTables64. This is workable for Legacy guest and SEV guest. But it doesn't work after Intel TDX is introduced. It is because all TDX CPUs (BSP and APs) start to run from 0xfffffff0, thus WORK_AREA_GUEST_TYPE will be cleared multi-times if it is TDX guest. So the clearance of WORK_AREA_GUEST_TYPE is moved to Main16 entry point in Main.asm. Note: WORK_AREA_GUEST_TYPE is only defined for ARCH_X64. For Intel TDX, its corresponding entry point is Main32 (which will be introduced in next commit in this patch-set). WORK_AREA_GUEST_TYPE will be cleared there. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Min Xu --- OvmfPkg/ResetVector/Ia32/PageTables64.asm | 4 ---- OvmfPkg/ResetVector/Main.asm | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/ResetVector/Ia32/PageTables64.asm b/OvmfPkg/ResetVecto= r/Ia32/PageTables64.asm index 07b6ca070909..02528221e560 100644 --- a/OvmfPkg/ResetVector/Ia32/PageTables64.asm +++ b/OvmfPkg/ResetVector/Ia32/PageTables64.asm @@ -42,10 +42,6 @@ BITS 32 ; SetCr3ForPageTables64: =20 - ; Clear the WorkArea header. The SEV probe routines will populate the - ; work area when detected. - mov byte[WORK_AREA_GUEST_TYPE], 0 - ; Check whether the SEV is active and populate the SevEsWorkArea OneTimeCall CheckSevFeatures =20 diff --git a/OvmfPkg/ResetVector/Main.asm b/OvmfPkg/ResetVector/Main.asm index ae90a148fce7..a501fbe880f2 100644 --- a/OvmfPkg/ResetVector/Main.asm +++ b/OvmfPkg/ResetVector/Main.asm @@ -36,6 +36,14 @@ Main16: =20 BITS 32 =20 +%ifdef ARCH_X64 + + ; Clear the WorkArea header. The SEV probe routines will populate the + ; work area when detected. + mov byte[WORK_AREA_GUEST_TYPE], 0 + +%endif + ; ; Search for the Boot Firmware Volume (BFV) ; --=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 (#81151): https://edk2.groups.io/g/devel/message/81151 Mute This Topic: https://groups.io/mt/85891882/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-