From nobody Sun Feb 8 22:22:39 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+81793+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+81793+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1634006417; cv=none; d=zohomail.com; s=zohoarc; b=YGl28BKM5dXh9Fu5H6hZRyJks5auIpCPLZQLp9ducnEJsa5aVUm7DJ0JLBx6efGqOYHabZcbgaZDNNH9vthrSfv+RVehXfxbt3viFpXF5XaJ2dr75M4gkyDAs0ty+VZAHBSFA20tWr/4nqPG+laXFqULdefD6XZ/xSHc+lnr7ZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634006417; 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=DnEI9pYYR8uUkk93ZuoY+DMHU+QoITPzgA/ittSHyEQ=; b=k21GLn7jLtSqaEqz50XWxD6alCOLWPuimhWzJHqmGpqkDsoeDd+ZUkUGeNZMBLjF6S6k/cXMk1mUH48Vk8PjG6peKNIguyNzWIWQY/MXXR0510VwK/A+pHC91M/M6bsRCQn00GqPcP6F59u5diUo8fBsu2Wz5YMcb/xMet73g4A= 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+81793+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 1634006417306728.0246646695491; Mon, 11 Oct 2021 19:40:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tEe1YY1788612xXJRVufyxOJ; Mon, 11 Oct 2021 19:40:16 -0700 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.8319.1634006416198781358 for ; Mon, 11 Oct 2021 19:40:16 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="313215094" X-IronPort-AV: E=Sophos;i="5.85,366,1624345200"; d="scan'208";a="313215094" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 19:39:57 -0700 X-IronPort-AV: E=Sophos;i="5.85,366,1624345200"; d="scan'208";a="490739044" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.4.37]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 19:39:55 -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 V9 2/4] OvmfPkg: Clear WORK_AREA_GUEST_TYPE in Main.asm Date: Tue, 12 Oct 2021 10:37:48 +0800 Message-Id: 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: nR2qKeiwTcqXRPtFcONYno16x1787277AA= 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=1634006416; bh=qHLdMTbFnkw4qw2CaFbHyR2zPY+te5X3Dvr8rtCA7ZY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=G4++F9EcRqeKPVrwBKtuVpgJPDsSOmmITfLLCWgLcIjUVrOUNoNLLNIT2l8tK1P0Cbg Bd4dxCQDNB5u8i87q1yx/yOM2+ETwcoe4d9YoHnFxnERGPanmJ9NQcotbWtkCOSK/TFsR OrtogNO1JEl/kz87xI/Ecvf8G+fBL7Vfbx8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634006418642100001 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 Acked-by: Gerd Hoffmann --- 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 (#81793): https://edk2.groups.io/g/devel/message/81793 Mute This Topic: https://groups.io/mt/86253724/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-