From nobody Sat May 18 22:31:26 2024 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+90106+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+90106+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1654007501; cv=none; d=zohomail.com; s=zohoarc; b=Gaigid+KEKW1M0BbB67MtbfJ97xik6fQvIF1g72X3InVh8dBIKAa/1folXLNoQ/XpLKvhsMEDqFJCMtOZ12RgHXMhCUNGtd3spemIM7PQtBPO8y+s9bWqmB080o3M1JLVyJD9S8tjjSHV64IyVOe0rcheS7tokcIhp4Hr0Fjm3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654007501; 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=p4r5LH+jlRE7DBzkIbqpBi8cGvcNSZxQP5mG7IDd3p0=; b=ILt01BPkxXaGIADR/kckWvQT+9+68V4TtA8lolsXFoA4hMYwPnHU8MZs21gjESV1QFjaQMSbu2KP5jOecl8n9ZWRNIMpmPTz12a7UQiPF4kXimo2bTVC04MbZ48A3HtOBQqUZEZTKEIxuN00cC8NVAT6wZKAhDxFERI29OLKJJc= 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+90106+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 1654007501970777.5075658478886; Tue, 31 May 2022 07:31:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jOTsYY1788612xTccn2HKmsz; Tue, 31 May 2022 07:31:41 -0700 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web09.50062.1654007499473969845 for ; Tue, 31 May 2022 07:31:40 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="272837682" X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="272837682" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 07:31:37 -0700 X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="605697653" 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:32 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [edk2-devel] [PATCH 1/2] OvmfPkg: Fix TDVMCALL error in ApRunLoop.nasm Date: Tue, 31 May 2022 22:31:16 +0800 Message-Id: <7afc1c0752f09c2c53ff5b2c78c3e064838f3778.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: VbW1DfXpMolmFGd6wqezVcFRx1787277AA= 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=DqgthpVrqAQCazSpJyEnJFDwF+SaU2PlV91f+JSiPGY=; h=Cc:Date:From:Reply-To:Subject:To; b=lcFXIxcdZUNdm5V3vHexBGHx9s29VwM5lm5W5Vozg0EmvOt/CS0uZR7u2PP9EOUxp3x iu/rReHYEe5MeMkKiB0Bngn3uCORRdLGYPsxXfjmofpq4ROvliSOMV9KgdkgJq1RN3kB9 obCXy0ai/uVJozdkn0ozWJ7S0K89xK9p70k= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1654007504132100009 Content-Type: text/plain; charset="utf-8" According to GHCI Spec Table 2-1, in TDVMCALL R10 should be cleared to 0 in input operands, and be checked for the return result. https://cdrdv2.intel.com/v1/dl/getContent/726790 Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Reviewed-by: Jiewen Yao --- OvmfPkg/TdxDxe/X64/ApRunLoop.nasm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm b/OvmfPkg/TdxDxe/X64/ApRunLo= op.nasm index 52fb3b4944bf..0bef89c48552 100644 --- a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm +++ b/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm @@ -42,10 +42,11 @@ AsmRelocateApMailBoxLoopStart: =20 mov rax, TDVMCALL mov rcx, TDVMCALL_EXPOSE_REGS_MASK + xor r10, r10 mov r11, EXIT_REASON_CPUID mov r12, 0xb tdcall - test rax, rax + test r10, r10 jnz Panic mov r8, r15 =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 (#90106): https://edk2.groups.io/g/devel/message/90106 Mute This Topic: https://groups.io/mt/91452353/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- From nobody Sat May 18 22:31:26 2024 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 Reviewed-by: Jiewen Yao --- 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-