From nobody Sun Feb 8 23:54:22 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+78577+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+78577+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1627960916; cv=none; d=zohomail.com; s=zohoarc; b=Dm3L8a9/nWn45kBhkAfBMoNVV4EqCB8N68wMYDQGN5+YCmrVLmTSYALtRG4C47311J+7BOtBGUSoePqcPnb/JX2O5h+RNmc0WXZDQCV7h6hzReK7pBbDJU/kENLLdtJVvw4Y04EMHKSuHI1+7iiinIyFvftF6peSIEkP6LeW614= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627960916; 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=MZQ+Qa/cv6ahlz8MoR1R8YUcj2uHOTH4C/qOP0eAsYc=; b=WA3nOAfIR8SjXA1XsmTs/27m1wc/ldpr6LRUvMLX/q4Et9pNUe0TKLJwpnWMO24MmE6hM+TQ0HAHr144eDCsY9OzT74p5dzv0EeBsQytlmLW4m/mklLo/c43OELQdPpj4kU4sFl5Ji9C/t2ViiMrqLt31p1Cs0YpG16UAsuShHc= 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+78577+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 1627960916119406.4493634915076; Mon, 2 Aug 2021 20:21:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id enLXYY1788612xkyzavxM2m8; Mon, 02 Aug 2021 20:21:55 -0700 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web09.224.1627960913828255270 for ; Mon, 02 Aug 2021 20:21:54 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10064"; a="210455620" X-IronPort-AV: E=Sophos;i="5.84,290,1620716400"; d="scan'208";a="210455620" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2021 18:18:41 -0700 X-IronPort-AV: E=Sophos;i="5.84,290,1620716400"; d="scan'208";a="479145649" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.4.4]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2021 18:18:39 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [edk2-devel] [PATCH V4 2/3] OvmfPkg/Sec: Update the check logic in SevEsIsEnabled Date: Tue, 3 Aug 2021 09:18:21 +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: 6pskGsmkPqgVAuR4GJe9vRcbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1627960915; bh=t5PlgNJZWOTt1e3MI/3N8+1Vh+TabaB3GPCqBHnFxYk=; h=Cc:Date:From:Reply-To:Subject:To; b=Pedh/AhDBJ06sovqsrbVh2J038SkdaWX461v5C//dbIvcQvCRWSZYIv0C46q58IhaBd 8QN4mu+3jJyP7yQp5bAioop8vBtTs1YSCFFV8yN93soBBPjIAbz6frfCDiFybWiWJdWW3 7f3o+Suwyqkl240BgVAqGEOkhrxK2wWF2U4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627960917016100001 Content-Type: text/plain; charset="utf-8" RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3429 SevEsIsEnabled return TRUE if SevEsWorkArea->SevEsEnabled is non-zero. It is correct when SevEsWorkArea is only used by SEV. After Intel TDX is enabled in Ovmf, the SevEsWorkArea is shared by TDX and SEV. (This is to avoid the waist of memory region in MEMFD). The value of SevEsWorkArea->SevEsEnabled now is : 0 if in Legacy guest 1 if in SEV 2 if in Tdx guest That's why the changes is made. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Min Xu --- OvmfPkg/Sec/SecMain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c index 9db67e17b2aa..e166a9389a1a 100644 --- a/OvmfPkg/Sec/SecMain.c +++ b/OvmfPkg/Sec/SecMain.c @@ -828,7 +828,7 @@ SevEsIsEnabled ( =20 SevEsWorkArea =3D (SEC_SEV_ES_WORK_AREA *) FixedPcdGet32 (PcdSevEsWorkAr= eaBase); =20 - return ((SevEsWorkArea !=3D NULL) && (SevEsWorkArea->SevEsEnabled !=3D 0= )); + return ((SevEsWorkArea !=3D NULL) && (SevEsWorkArea->SevEsEnabled =3D=3D= 1)); } =20 VOID --=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 (#78577): https://edk2.groups.io/g/devel/message/78577 Mute This Topic: https://groups.io/mt/84631105/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-