From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web12.27018.1646664233189913163 for ; Mon, 07 Mar 2022 06:43:53 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=DFdAmGWb; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ted.kuo@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646664233; x=1678200233; h=from:to:cc:subject:date:message-id; bh=DbG9onyWrowO6MWOkM5Xb6eJYkhElYiNmzEVFGbwdIQ=; b=DFdAmGWbHUWHzBRYGTyRzhv7AW75yr6Oi5V0VbLFrwQMAM2uR4YsB9jn Ir8V29g2LfQ8Vaczri7sskbbQTj1yliTI3Q5rf4WHt9mC4IaTHVw49ZjR Pvi0JEErvTAC/Ul9l1NaD/2ED0tUE9Z6yrNhvhtugEuVeOGpwmmTrGPQl 18jBna2iJx/FuGB5NQWPOdT99rJrjATO2gPCv7V3DMR9piQOZ3BSXEr03 o+5Mr8s9mgmqDO9S0N9Csq8R3tobtrLS+fQnurYjLvg+WB1D6QWZLEtfP jvPZoPTUAIS1zu9TbDuVv6dkcnlA5ITESrBbTNv37N3oCfe72p/WGDDB/ w==; X-IronPort-AV: E=McAfee;i="6200,9189,10278"; a="234360550" X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="234360550" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 06:43:52 -0800 X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="711128075" Received: from tedkuo1-win10.gar.corp.intel.com ([10.5.215.13]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 06:43:50 -0800 From: "Kuo, Ted" To: devel@edk2.groups.io Cc: Ray Ni , Debkumar De , Harry Han , Catharine West Subject: [edk2-devel][PATCH] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm Date: Mon, 7 Mar 2022 22:43:27 +0800 Message-Id: <5a3a880ffa4a521565192ca5eda35d0b93625067.1646664121.git.ted.kuo@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3862 The new algorithm searches BFV address with FFS3 GUID first. If not found, it will search BFV address with FFS2 GUID. Cc: Ray Ni Cc: Debkumar De Cc: Harry Han Cc: Catharine West Signed-off-by: Ted Kuo --- .../Vtf0/Bin/IA32/ResetVector.ia32.port80.raw | Bin 484 -> 548 bytes .../ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw | Bin 468 -> 516 bytes .../Vtf0/Bin/IA32/ResetVector.ia32.serial.raw | Bin 868 -> 932 bytes .../Bin/X64/PageTable1G/ResetVector.x64.port80.raw | Bin 12292 -> 12292 bytes .../Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw | Bin 12292 -> 12292 bytes .../Bin/X64/PageTable1G/ResetVector.x64.serial.raw | Bin 12292 -> 12292 bytes .../Bin/X64/PageTable2M/ResetVector.x64.port80.raw | Bin 28676 -> 28676 bytes .../Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw | Bin 28676 -> 28676 bytes .../Bin/X64/PageTable2M/ResetVector.x64.serial.raw | Bin 28676 -> 28676 bytes .../ResetVector/Vtf0/Ia32/SearchForBfvBase.asm | 51 +++++++++++++++++---- 10 files changed, 41 insertions(+), 10 deletions(-) diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.port80.raw index 79b23c047bdc6e552d77d5c9e9aeae21ff04d91d..ccb5fb9d28d295dabdf41113e959d4a04823e917 100644 GIT binary patch delta 227 zcmaFDyo9BG0uUG;*vZ7ez@W<@z`$S&Wc)9RYyQbps@7N`P<5a2DnL~gPkVYw4**r!cFFjcZU?HGY1)}sx(=wS^|0>c z(xuH6Dh#FbI}bBQD3s24Eoykcv-u}OY2Sto!p|CZ><5C*qp$yU9^J6F delta 158 zcmV;P0Ac^61mpu+kdTm&F~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31 zHHl$$*@1W*g~Kh=b;8$wu(9TV=}(c8 zUjg)y@_Q48|1M?^0T*VtBLDzE4S>dJ0U!uIkRJe$|NsA!umLp*>x1c7{{R2! Mtds8n6_W!3A^UepbpQYW diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw index ce7faa502b858e99908bcdb397b776258205e1d5..45ef6ccbcb61368711b3d1e90fd9f0633a8424dd 100644 GIT binary patch delta 225 zcmcb@+`>{n0SF8a>||nKV9;d{U|_HXGX59EHUDHPRcoves5(#_Qu?g1LgcjVDc{n& zjTI7m^W~3nW7tMv416`-n$r#(HT2Y{+C)y36^7FJorjqt6iR2j7BoEI+5D5Cv~S0L?*04scOHHHuk+|j`-wr}jBh5cDmQQY zub0NpD4w=MnSsH9U+F;FtK9$p{|hkeaA0F#;8%K(wu6JA??&H&z6X6T`Yyb-n;_3H Z0jOYd0;3s6_e+a^|Np<-GkG4P833l9W|#l~ delta 153 zcmZo+xxySY0SF8a=rRZ}FxWCMF#InvZmbZfc-qrb`ns_~#I{Suzw}XKg~UwL&cxE2 zjTJJjhjlNPUTCgRVJJP-d6+puq4e-;&K>)Kp!4YKf1O8Px=-v1XZ$kpQMqv4f4ww* zM)9;A$_xw+{7MJXUZqaXVU!VYn;_3H;s5{tAge)O@&raRj^>vc|Nj4fxn=S>Ml%58 CZbm== diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw b/UefiCpuPkg/ResetVector/Vt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sR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z- z$h02Tysxk81Z^i=0z<_Lw-!>>7a><5C*qp$yU9(`Fqxl19OQD^cag(*P}AOHWC zV0bwdXz&h(3;+M~E8Tc~^4D&L4}G_Hw|&%0<7X64+o8{ z27aXnX*)O=`fl_c=zGxjqVK|MS9OL7K>5iR6m9ulx4bm?_y7OP8W3SKSw=~Mal%Hy e54;L5Z+)Bq0zms1!b02_CQNvF7$O1|o&W$orgJI) diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.serial.raw index d9b051ff06d1d30b0dfd585e05e75c98ebd88b03..45e8a5f25e082462e79ef894749fc02a8f5e112c 100644 GIT binary patch delta 259 zcmZokXi3;0t5Cm}+3>(lCI$uuT?PRL23sKGe^FfXPo`3}#tMO|1H~bw&l)R4PTQXH zExp@VA+a}KZd&P;#tNCv=O(jCPrp_Hs;YR}(^Gl?sLHlW#=mqsP}NM+&cxDnKvk`W zbuX7LZLUyZD4pMVm^nhBbjIsI!vmhpKN(8<(suo2o}8l4!FXWuTZLPUuO^>RoWeM5 za;%aYqwwSrau&;S2V&QrD#)%f$8 z>GijlZ2w=H|M~y_rS)GRQMY-&@>gz!m#;og00E$%7{Wr_7$!`3c^M)C7M=hAJ^6Hf delta 209 zcmZokXi3;0tKi(rY; zmfmcvkZC=vd%5&NbA<{+>8Z}c%n=HuhhKY6o}tjgcw(}u;w{Ecla!_~#!a58nO}3=aHC2hv`#Otw~z;SW}4DER#U{{$$QJWtt1G~&-|rq|zI x{`>bb{m=jZFOB~KiL%Y_mA`UNR4`C@x$84nG0>R|VIgh|6DGV|3=x5t0RVO0UcCSS diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.port80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Z`chm<~RtPnYE zd&;-;ZexYS-h8=frB@m&WICUl%ql(oS_P=8;%QG$=>ecB+b$XZ((OQ1Gfg`aOVu0bK?G1_oOO28RDd#*GyM6;FG5N?$ith}d??_?JFvtdN*# z+L>5-v#~;^^|0>c(hJQMDh#EkIuA2PD3l(4?KycyLJ#AK$*PIB7(Y!)n!*@2d1{gy zqx9rENj}0cpY_uC8O76fC^IlP@GBiid&M%@Iyr_vSe>EZ^Z)-7pkVU6WE;_lKd+fy ze|!1w-^=tr|Np-<{tG0^Hos5)$~{rRK;h-C&tSzsXEKC^xG_wa@NzLk1Y!mNLy2Mk diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForBfvBase.asm b/UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForBfvBase.asm index 10f8e3e8bb..9d21aa6da9 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForBfvBase.asm +++ b/UefiCpuPkg/ResetVector/Vtf0/Ia32/SearchForBfvBase.asm @@ -9,10 +9,17 @@ ;#define EFI_FIRMWARE_FILE_SYSTEM2_GUID \ ; { 0x8c8ce578, 0x8a3d, 0x4f1c, { 0x99, 0x35, 0x89, 0x61, 0x85, 0xc3, 0x2d, 0xd3 } } -%define FFS_GUID_DWORD0 0x8c8ce578 -%define FFS_GUID_DWORD1 0x4f1c8a3d -%define FFS_GUID_DWORD2 0x61893599 -%define FFS_GUID_DWORD3 0xd32dc385 +%define FFS2_GUID_DWORD0 0x8c8ce578 +%define FFS2_GUID_DWORD1 0x4f1c8a3d +%define FFS2_GUID_DWORD2 0x61893599 +%define FFS2_GUID_DWORD3 0xd32dc385 + +;#define EFI_FIRMWARE_FILE_SYSTEM3_GUID \ +; { 0x8c8ce578, 0x3dcb, 0x4dca, { 0xbd, 0x6f, 0x1e, 0x96, 0x89, 0xe7, 0x34, 0x9a } } +%define FFS3_GUID_DWORD0 0x5473c07a +%define FFS3_GUID_DWORD1 0x4dca3dcb +%define FFS3_GUID_DWORD2 0x961e6fbd +%define FFS3_GUID_DWORD3 0x9a34e789 BITS 32 @@ -25,6 +32,7 @@ BITS 32 Flat32SearchForBfvBase: xor eax, eax + mov ecx, 2 ; 2: FFS3 GUID, 1: FFS2 GUID, 0: Not Found searchingForBfvHeaderLoop: ; ; We check for a firmware volume at every 4KB address in the top 16MB @@ -32,20 +40,37 @@ searchingForBfvHeaderLoop: ; sub eax, 0x1000 cmp eax, 0xff000000 - jb searchedForBfvHeaderButNotFound + jb searchingForBfvWithOtherFfsGuid + cmp ecx, 2 + jne searchingForFfs2Guid ; - ; Check FFS GUID + ; Check FFS3 GUID ; - cmp dword [eax + 0x10], FFS_GUID_DWORD0 + cmp dword [eax + 0x10], FFS3_GUID_DWORD0 jne searchingForBfvHeaderLoop - cmp dword [eax + 0x14], FFS_GUID_DWORD1 + cmp dword [eax + 0x14], FFS3_GUID_DWORD1 jne searchingForBfvHeaderLoop - cmp dword [eax + 0x18], FFS_GUID_DWORD2 + cmp dword [eax + 0x18], FFS3_GUID_DWORD2 jne searchingForBfvHeaderLoop - cmp dword [eax + 0x1c], FFS_GUID_DWORD3 + cmp dword [eax + 0x1c], FFS3_GUID_DWORD3 jne searchingForBfvHeaderLoop + jmp checkingFvLength +searchingForFfs2Guid: + ; + ; Check FFS2 GUID + ; + cmp dword [eax + 0x10], FFS2_GUID_DWORD0 + jne searchingForBfvHeaderLoop + cmp dword [eax + 0x14], FFS2_GUID_DWORD1 + jne searchingForBfvHeaderLoop + cmp dword [eax + 0x18], FFS2_GUID_DWORD2 + jne searchingForBfvHeaderLoop + cmp dword [eax + 0x1c], FFS2_GUID_DWORD3 + jne searchingForBfvHeaderLoop + +checkingFvLength: ; ; Check FV Length ; @@ -57,6 +82,12 @@ searchingForBfvHeaderLoop: jmp searchedForBfvHeaderAndItWasFound +searchingForBfvWithOtherFfsGuid: + xor eax, eax + dec ecx + cmp ecx, 0 + jne searchingForBfvHeaderLoop + searchedForBfvHeaderButNotFound: ; ; Hang if the SEC entry point was not found -- 2.16.2.windows.1