From nobody Mon Feb 9 09:00:09 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+90104+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+90104+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1654007502; cv=none; d=zohomail.com; s=zohoarc; b=YYswhK6IhP04In4aelE13PNR1ecs4SARiluvnWDZ6X+qWTW0J50muxafWGuByFq3jLo2YS2yrsSfXdTougK2WQ7dY85rrkCncjSVaAbXCMse8mc292DFB7I6/V6iOLwbK5wzHiKFVV9bbzjH9V/f2b8JglyMDqw4LSGDto5XL0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654007502; 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=+wqDMaktxukBZfVfvNE1GvicMN6FMT1HEIPW3+jh6dQ=; b=UIu81ZZXjgvs5k8KNrIqy1h6tF0UJfidLXs3Q5KeRFf4T7g1wcd/+0TKJDRG28yaRLtaJa6WGB/+avowdN/8xc5sfqnkF0Ip2jr2kkNbjIyOad16LebaPiL6UQqTkmVvs3GWPsPvJ7UIlZFui5mmDdyywCD/HUhId5hVmr8AHCE= 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+90104+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 165400750202138.029992581355486; Tue, 31 May 2022 07:31:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id p2vSYY1788612xilYoOO2goS; Tue, 31 May 2022 07:31:41 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.50468.1654007497740690682 for ; Tue, 31 May 2022 07:31:38 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="335928102" X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="335928102" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 07:31:36 -0700 X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="605697664" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.6]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 07:31:34 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky Subject: [edk2-devel] [PATCH 2/2] OvmfPkg: Search EFI_RESOURCE_MEMORY_UNACCEPTED for Fw hoblist Date: Tue, 31 May 2022 22:31:17 +0800 Message-Id: <4a4fc3a0e4084dbadcacac95b11d246c6b3b7539.1654007213.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: se2k8vQhjKz175F3auuMrR0Sx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1654007501; bh=pjRoin0QkjhkjraQFMmUJ6XiWWTokYA/BJsHaXbdgxc=; h=Cc:Date:From:Reply-To:Subject:To; b=LGx6VXi2lfi/ChLZTvl3kqKon4WKVtzjmamw0yFnbdH+sUICwyo3T8HhyyB75pg2Je4 EVBoyTzFR2bJcnMDR72lbbk4pCGHSGsrEBLZxB0pO8G5/o7sk7gzK5F4KQxNZ7m2olmcj T7guoJeCmyBMqZmP1itjt10+ckjX1N8zvHk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1654007504233100010 Content-Type: text/plain; charset="utf-8" In current TDVF implementation all unaccepted memory passed in Hoblist are tagged as EFI_RESOURCE_MEMORY_UNACCEPTED. They're all accepted before they can be accessed. After accepting memory region, the Hob ResourceType is unchanged (still be EFI_RESOURCE_MEMORY_UNACCEPTED). TDVF Config-B skip PEI phase and it tries to find a memory region which is the largest one below 4GB. Then this memory region will be used as the firmware hoblist. So we should walk thru the input hoblist and search for the memory region with the type of EFI_RESOURCE_MEMORY_UNACCEPTED. Because EFI_RESOURCE_MEMORY_UNACCEPTED has not been officially in PI spec. So it cannot be defined in MdePkg/Include/Pi/PiHob.h. As a temporary solution it is defined in Hob.c. There is a patch-set for lazy-accept very soon. In that patch-set EFI_RESOURCE_MEMORY_UNACCEPTED will be defined in MdeModulePkg. Config-B: https://edk2.groups.io/g/devel/message/76367 Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Ccigned-off-by: Min Xu Acked-by: Gerd Hoffmann --- OvmfPkg/Library/PeilessStartupLib/Hob.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PeilessStartupLib/Hob.c b/OvmfPkg/Library/Peil= essStartupLib/Hob.c index 3c544ca1f67d..5fc84a809025 100644 --- a/OvmfPkg/Library/PeilessStartupLib/Hob.c +++ b/OvmfPkg/Library/PeilessStartupLib/Hob.c @@ -22,6 +22,8 @@ #include #include "PeilessStartupInternal.h" =20 +#define EFI_RESOURCE_MEMORY_UNACCEPTED 7 + /** * Construct the HobList in SEC phase. * @@ -90,7 +92,7 @@ ConstructFwHobList ( // while (!END_OF_HOB_LIST (Hob)) { if (Hob.Header->HobType =3D=3D EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) { - if (Hob.ResourceDescriptor->ResourceType =3D=3D EFI_RESOURCE_SYSTEM_= MEMORY) { + if (Hob.ResourceDescriptor->ResourceType =3D=3D EFI_RESOURCE_MEMORY_= UNACCEPTED) { PhysicalEnd =3D Hob.ResourceDescriptor->PhysicalStart + Hob.Res= ourceDescriptor->ResourceLength; ResourceLength =3D Hob.ResourceDescriptor->ResourceLength; =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 (#90104): https://edk2.groups.io/g/devel/message/90104 Mute This Topic: https://groups.io/mt/91452351/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-