* [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
@ 2022-03-11 7:28 Kuo, Ted
2022-03-11 7:41 ` Ni, Ray
[not found] ` <16DB43B094343574.10972@groups.io>
0 siblings, 2 replies; 5+ messages in thread
From: Kuo, Ted @ 2022-03-11 7:28 UTC (permalink / raw)
To: devel; +Cc: Ray Ni, Debkumar De, Harry Han, Catharine West
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 <ray.ni@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
---
.../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..23254e83bf1a17dee9f38c235fcc9948624a7536 100644
GIT binary patch
delta 227
zcmaFDyo9BG0uUG;*vZVmz@W<@z`$S&Wc)9RYyQbxs@7N`P<5a<r1V*1g~(~!Q@*8l
z8!IIC=F3ehz0z1A)A`(FR_W>2DnL~gPkVYw4**r!cFFjcZU?HGY1)}sx(=wS^|0>c
z(xuH6Dh#FbI}bBQD3s24Eoykcv-u}uY2Sto!p|CZ><5C*qp$yU9^J6<S;NbSiBa*4
ze<$v$7OwlRm&VU1p0-1ofx&@a=|I}6#K|6v3IgsE<QXRX|NkH4b`Y3cz-TJ?vg-d!
V@qhpSzg!F?Iv@OhHhCMP9spMyYx@8I
delta 158
zcmV;P0Ac^61mpu+kdTm&F~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*4Y080fVjWEzrTsa>;8$wu(9TV=}(c8
zUjg)y@_Q48|1M?^0T*VtBLDzE4<f*3>S>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..18562d8f1f58601f66fcb0cbf2f994046ce48fde 100644
GIT binary patch
delta 225
zcmcb@+`>{n0SF8a>||zOV9;d{U|_HXGX59EHUDHTRcoves5(#_Qu?g1LgcjVDc{n&
zjTI7m^W~<MUTLh5>3nW7tMv416`-n$r#(HT2Y{+<yJY-Jw*ytpH0?|*T?bUvdRX^z
z>C)y36^7FJorjqt6iR2j7BoEI+5D5Sv~S0L?*04scOHHHuk+|j`-wr}jBh5cDmQQY
zub0NpD4w=MnSsH9U+F;FtK9$p{|hkeaA0F#;8%K(wu6JA??&H&z6X6T`Yyb-n;_3H
Z0jOYd0;3s6_e+a^|Np<-GkG4P833r5W}5&2
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/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw
index 6503a988abdac06f9aa88f0a65f2525e12233b0a..e4aa4fc30a32bc3d4d8d0e1726c43fdafef4a374 100644
GIT binary patch
delta 214
zcmaFDwuF6xY`rV9;enmZ3=9mq3<3-cwm`=JqPXUt%%y6L6#`WUibG1DHCBk6wms!r
zdbhDcVsF0Ow9+e$6*8UAO=gvzeysvjRq?c^r}O|&m2H=df9ZChs+p#piKXj+s#*{0
zUM^kQT%p2HI=}NUbA&?ajMssN2Rxg9GM4tG?fT0+F{OjiW8&Lej75`AFs>J_`LCD8
z&nTX@Lz#iWfnVuB+AHPBT}&|oJ`>~_Cj9^Ze*zRte#c}Yu;9;Yrq|zIvi^U${?Gsa
LFE>v%Vm1N**#ci0
delta 146
zcmV;D0B!%I2jm8j9YX~JF~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*Ns*Y00YH-_0onm-k^-+2g#RvP4*?fu
zxFY}nKo26oX6h@G!U9|fM35f<kpKVxlP&`^5a9gl0_*na4gcxy{Qv*yyOVMQG7+~v
AVgLXD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw
index 279ba03b0c01f552a0d3ed8900e06b91f2555901..51ad3ecde0e4e02e91ed299ec207e9f7460524b3 100644
GIT binary patch
delta 289
zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@K@PKFYPsY-|4I7>{?AX75Kkxp|qp$yU9^J6<S;Ncz$x#aN
zj3$$JDNHf%`1t?71jB|Dpzutf!*(!S`2U|@>Bj4$8^oS9{Mya%q3`zYTOak(_!-61
zb|^D2IPfbSNPD$!a;u^OyQ4b81EBWFTNEw%UN^ja@b~}!mpT7{gvsPTiV}<yHVQ7_
cRd}iOX#xlU4QB`oabuV;;iWJ{1S~uO04hj{^#A|>
delta 259
zcmZokXi3<>rVygbAi%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>@TaY<SkNV?Pjd9)10<^XP_+&l+CNm^?`#p3!#l
zCxt2I0U!VWmtfeC0u){Zv}6avh5!Hgm2SK~x<Tw&!>`>8ANp?ZUi48fjh|6GZHF=g
zg9E?PfwWg`llLkr@O!B<YyfJX00onuC|at&EdT$K|KI=rFOxxp_W%F?cL4E!55;31
ribp*Zk9c%G`2TFegpGn1cokm$`Uutvw3i_)#EoIXgqM#YA`lY+x&4KD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw
index 9b09a80f225736a413b7146b0e7bd4aafc73abe1..eec88b1c9cbd2f87951762b6db2be79c8dd73656 100644
GIT binary patch
delta 300
zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@G@PKFYPsY-|9s7Zx^XO~Vf1O8Pc1#XZ2xl~%yh>q;e#OWC
z|0Nh+&I3AT2g8N`|M`_}ygvDBH^Ya%+q?ID)Jx-M6i?fs%)sEluXG^o)w0RCiZc9u
z>I@fv+9p83<Ozzl>MyJRzkL7q|Noc8|A2(?|NsAY0P%kh#bX|dM?DmecyvDa|7^m9
eje;9^6<$hx0&4}@$q*Le#xP;ROJ;}$oEHj+dD
delta 239
zcmZokXi3<>rr@K?Ai%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>>7a><5C*qp$yU9(`Fqxl19OQD^cag(*P}AOHWC
zV0bwdXz&h(3;+M~E8Tc~^4D&L4}G_Hw|&%0<7X64+o8<B;J~kRAnjEiP_+QV4hJ>{
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..de97b858ddd03171114aa0efb1929796b1aa5435 100644
GIT binary patch
delta 259
zcmZokXi3;0t5Cm}+3>(lW(EcZT?PRL23sKGe^FfXPv%m!#tMO|1H~bw&l)R4PTQXH
zExp@VA+a}KZd&P;#tNCv=O(jCPrp_Hs;YR}(^Gl?sLHlW#=mqsP}NM+&cxDnKvk`W
zbuX7LZLUyZD4pMVm^nhBbjIsI!vmhpKN(B=(suo2o}8l4!FXWuTZLPUuO^>RoWeM5
za;%aYqwwS<N<P9<KI^6NGm59}P-b9o;8!}3_R3~5vvLf(w>rau&;S2V&QrD#)%f$8
z>GijlZ2w=H|M~y_rS)GRQMY-&@>gz!m#;og00E$%7{Wr_7$!`3c^M)C7M=hAKvr~s
delta 209
zcmZokXi3;0tKi(rY<NJIL4bk5mVtrcf01!xg+RsAo}SXzjTIucT{8Zqj~Xi^W}0>;
zmfmcvkZC=vd%5&NbA<{+>8Z}c%n=HuhhKY6o}tjgcw(}u;w{Ecla!_~#!a58<i;pH
z`Hqs0aLi}DG=4_$v>nO}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.raw
index 0e53a574fab74db6973d7ea41a6a495266a4d0ae..23c58501b5a48448ffcd2757310442ef33f45fa0 100644
GIT binary patch
delta 291
zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYf-}kp3OfQOZzr#c-F9E|Ni~F`#X=m{?~bQ!^UR~FZ(A)
zCB!qDOx~3+#k}L=|NjyU8&ZJ6Gl34<!7$<fe}1JKua9mJd)Dx4H^Ya%+q-Xl)Jx-M
z6i?fs%)sEluXG^o)xOECi3;qF>I@Hn+9z*GwB&o;@bbam|Nmd+`~wmulm8@2FizMg
exPVvTrPikjAOJL+AuPm=VZwx$!VnR#@B{$qM2t58
delta 261
zcmZp9z}WJDaRXaIh%SQw1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=H0O2S;LO~K+t*g^}o)e8#X>`csXP8q=a}z
z+sU62rkDqO{QqBqVM7W~coEQ&9Sjrx|L0e_@%rcnv1bjxb~AkFyS;nSN4+$DM)9;A
z$_xw+{7MJXUbRi$o2bC=rOvPcsC@zyOn#DRss6J3|4aUV|Np;C1`*o-|Nq|s#Q!}M
uk9jB_^-w(G(fQ#2vk4P63SQt<c=_uiSS!$8hOiJfh6xj1K8A=uOauU1Oow~`
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw
index 865846da42a45c16b69746f16963d47a6c6e71b0..3438dabefee950826a0541e9549f48311f194d43 100644
GIT binary patch
delta 302
zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYeB;Up3OfQOZ#^02ZGL{uUY?f9(~y{IVd5V(RA{vgem$J
zAOHWCV0bwX=$IW06aN3_SGw`~<geWfANp?Z-uF>2jh|6GZHF=gg9E?PfwWi4Cg&!~
z@cXGVTmWjD00omLB-*OKtp5M<{onupUl#uZ62|}k|K9<`|2-6sc_<$BP(0$%`QZPv
g2@^I7Zs1jTDfJ1g6=)|zScn_Lgb6R1AtDeH0oMqWMgRZ+
delta 241
zcmZp9z}WJDaRXa|k1m4%1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=G?I#2s)3x{?~c*W&Px?gm6Zk$&V7I1UY>C
z|6hXP<y4@-I~XSX|Ie><<Mqj3yBR+8-QL~yQ7?_3Q9NyjG6RDHztVxUS9w6y0t`DG
z*ccf2l^&$+;9%&x(RZNlLEnqM3$I<(872VbCtpak<$K-o(%|3!|1WDmgw14`Bnid|
g8wEe`D!jb)aRLYc?PCZFabuV;;pJh72v~Rm0Iz;^EC2ui
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw
index f1d6536cec924d0e167cf1ee4e9309ed5fd7ad60..5ee3012482de343cfae8af590a49170c5b7f1d65 100644
GIT binary patch
delta 261
zcmZp9z}WJDaf56^{a$9n13Q@+7#MUJ1Q-}>fsFq}am_!OOVt`H1gZ`chm<~RtPnYE
zd&;-;ZexYS-h8=frB@m&WICUl%ql(oS_P=8;%QG$=>ecB+b$XZ((OQ1Gfg`aOV<Ha
zwI0^JT)MQmLWQApe&=E42!+xauLBJacsBoJEbU9%^_O{aN<s(Yfyr+ZZZW=^d?IlQ
z<Fv`KNp6h7lb0m<2v7N}m&VU1p0-1ofx&@a=|I{mo5{?{G3?&z3=2O0|35h|*+x|3
z&ugaF-(Ir)e`)^b|NocPe}P2Z=KaZExfNc%`aA&yfPP{K3vpwZFyZB8hzMAC0suQ@
BcftSw
delta 211
zcmZp9z}WJDaf57vb1$>u0bK?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..786239325d 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, 3 ; 3: FFS3 GUID, 2: FFS2 GUID, 1: 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, 3
+ 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, 1
+ jne searchingForBfvHeaderLoop
+
searchedForBfvHeaderButNotFound:
;
; Hang if the SEC entry point was not found
--
2.16.2.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
2022-03-11 7:28 [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm Kuo, Ted
@ 2022-03-11 7:41 ` Ni, Ray
[not found] ` <16DB43B094343574.10972@groups.io>
1 sibling, 0 replies; 5+ messages in thread
From: Ni, Ray @ 2022-03-11 7:41 UTC (permalink / raw)
To: Kuo, Ted, devel@edk2.groups.io; +Cc: De, Debkumar, Han, Harry, West, Catharine
Reviewed-by: Ray Ni <ray.ni@intel.com>
-----Original Message-----
From: Kuo, Ted <ted.kuo@intel.com>
Sent: Friday, March 11, 2022 3:29 PM
To: devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@intel.com>; De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>
Subject: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
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 <ray.ni@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
---
.../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..23254e83bf1a17dee9f38c235fcc9948624a7536 100644
GIT binary patch
delta 227
zcmaFDyo9BG0uUG;*vZVmz@W<@z`$S&Wc)9RYyQbxs@7N`P<5a<r1V*1g~(~!Q@*8l
z8!IIC=F3ehz0z1A)A`(FR_W>2DnL~gPkVYw4**r!cFFjcZU?HGY1)}sx(=wS^|0>c
z(xuH6Dh#FbI}bBQD3s24Eoykcv-u}uY2Sto!p|CZ><5C*qp$yU9^J6<S;NbSiBa*4
ze<$v$7OwlRm&VU1p0-1ofx&@a=|I}6#K|6v3IgsE<QXRX|NkH4b`Y3cz-TJ?vg-d!
V@qhpSzg!F?Iv@OhHhCMP9spMyYx@8I
delta 158
zcmV;P0Ac^61mpu+kdTm&F~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*4Y080fVjWEzrTsa>;8$wu(9TV=}(c8
zUjg)y@_Q48|1M?^0T*VtBLDzE4<f*3>S>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..18562d8f1f58601f66fcb0cbf2f994046ce48fde 100644
GIT binary patch
delta 225
zcmcb@+`>{n0SF8a>||zOV9;d{U|_HXGX59EHUDHTRcoves5(#_Qu?g1LgcjVDc{n&
zjTI7m^W~<MUTLh5>3nW7tMv416`-n$r#(HT2Y{+<yJY-Jw*ytpH0?|*T?bUvdRX^z
z>C)y36^7FJorjqt6iR2j7BoEI+5D5Sv~S0L?*04scOHHHuk+|j`-wr}jBh5cDmQQY
zub0NpD4w=MnSsH9U+F;FtK9$p{|hkeaA0F#;8%K(wu6JA??&H&z6X6T`Yyb-n;_3H
Z0jOYd0;3s6_e+a^|Np<-GkG4P833r5W}5&2
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/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw
index 6503a988abdac06f9aa88f0a65f2525e12233b0a..e4aa4fc30a32bc3d4d8d0e1726c43fdafef4a374 100644
GIT binary patch
delta 214
zcmaFDwuF6xY`rV9;enmZ3=9mq3<3-cwm`=JqPXUt%%y6L6#`WUibG1DHCBk6wms!r
zdbhDcVsF0Ow9+e$6*8UAO=gvzeysvjRq?c^r}O|&m2H=df9ZChs+p#piKXj+s#*{0
zUM^kQT%p2HI=}NUbA&?ajMssN2Rxg9GM4tG?fT0+F{OjiW8&Lej75`AFs>J_`LCD8
z&nTX@Lz#iWfnVuB+AHPBT}&|oJ`>~_Cj9^Ze*zRte#c}Yu;9;Yrq|zIvi^U${?Gsa
LFE>v%Vm1N**#ci0
delta 146
zcmV;D0B!%I2jm8j9YX~JF~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*Ns*Y00YH-_0onm-k^-+2g#RvP4*?fu
zxFY}nKo26oX6h@G!U9|fM35f<kpKVxlP&`^5a9gl0_*na4gcxy{Qv*yyOVMQG7+~v
AVgLXD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw
index 279ba03b0c01f552a0d3ed8900e06b91f2555901..51ad3ecde0e4e02e91ed299ec207e9f7460524b3 100644
GIT binary patch
delta 289
zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@K@PKFYPsY-|4I7>{?AX75Kkxp|qp$yU9^J6<S;Ncz$x#aN
zj3$$JDNHf%`1t?71jB|Dpzutf!*(!S`2U|@>Bj4$8^oS9{Mya%q3`zYTOak(_!-61
zb|^D2IPfbSNPD$!a;u^OyQ4b81EBWFTNEw%UN^ja@b~}!mpT7{gvsPTiV}<yHVQ7_
cRd}iOX#xlU4QB`oabuV;;iWJ{1S~uO04hj{^#A|>
delta 259
zcmZokXi3<>rVygbAi%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>@TaY<SkNV?Pjd9)10<^XP_+&l+CNm^?`#p3!#l
zCxt2I0U!VWmtfeC0u){Zv}6avh5!Hgm2SK~x<Tw&!>`>8ANp?ZUi48fjh|6GZHF=g
zg9E?PfwWg`llLkr@O!B<YyfJX00onuC|at&EdT$K|KI=rFOxxp_W%F?cL4E!55;31
ribp*Zk9c%G`2TFegpGn1cokm$`Uutvw3i_)#EoIXgqM#YA`lY+x&4KD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw
index 9b09a80f225736a413b7146b0e7bd4aafc73abe1..eec88b1c9cbd2f87951762b6db2be79c8dd73656 100644
GIT binary patch
delta 300
zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@G@PKFYPsY-|9s7Zx^XO~Vf1O8Pc1#XZ2xl~%yh>q;e#OWC
z|0Nh+&I3AT2g8N`|M`_}ygvDBH^Ya%+q?ID)Jx-M6i?fs%)sEluXG^o)w0RCiZc9u
z>I@fv+9p83<Ozzl>MyJRzkL7q|Noc8|A2(?|NsAY0P%kh#bX|dM?DmecyvDa|7^m9
eje;9^6<$hx0&4}@$q*Le#xP;ROJ;}$oEHj+dD
delta 239
zcmZokXi3<>rr@K?Ai%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>>7a><5C*qp$yU9(`Fqxl19OQD^cag(*P}AOHWC
zV0bwdXz&h(3;+M~E8Tc~^4D&L4}G_Hw|&%0<7X64+o8<B;J~kRAnjEiP_+QV4hJ>{
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..de97b858ddd03171114aa0efb1929796b1aa5435 100644
GIT binary patch
delta 259
zcmZokXi3;0t5Cm}+3>(lW(EcZT?PRL23sKGe^FfXPv%m!#tMO|1H~bw&l)R4PTQXH
zExp@VA+a}KZd&P;#tNCv=O(jCPrp_Hs;YR}(^Gl?sLHlW#=mqsP}NM+&cxDnKvk`W
zbuX7LZLUyZD4pMVm^nhBbjIsI!vmhpKN(B=(suo2o}8l4!FXWuTZLPUuO^>RoWeM5
za;%aYqwwS<N<P9<KI^6NGm59}P-b9o;8!}3_R3~5vvLf(w>rau&;S2V&QrD#)%f$8
z>GijlZ2w=H|M~y_rS)GRQMY-&@>gz!m#;og00E$%7{Wr_7$!`3c^M)C7M=hAKvr~s
delta 209
zcmZokXi3;0tKi(rY<NJIL4bk5mVtrcf01!xg+RsAo}SXzjTIucT{8Zqj~Xi^W}0>;
zmfmcvkZC=vd%5&NbA<{+>8Z}c%n=HuhhKY6o}tjgcw(}u;w{Ecla!_~#!a58<i;pH
z`Hqs0aLi}DG=4_$v>nO}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.raw
index 0e53a574fab74db6973d7ea41a6a495266a4d0ae..23c58501b5a48448ffcd2757310442ef33f45fa0 100644
GIT binary patch
delta 291
zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYf-}kp3OfQOZzr#c-F9E|Ni~F`#X=m{?~bQ!^UR~FZ(A)
zCB!qDOx~3+#k}L=|NjyU8&ZJ6Gl34<!7$<fe}1JKua9mJd)Dx4H^Ya%+q-Xl)Jx-M
z6i?fs%)sEluXG^o)xOECi3;qF>I@Hn+9z*GwB&o;@bbam|Nmd+`~wmulm8@2FizMg
exPVvTrPikjAOJL+AuPm=VZwx$!VnR#@B{$qM2t58
delta 261
zcmZp9z}WJDaRXaIh%SQw1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=H0O2S;LO~K+t*g^}o)e8#X>`csXP8q=a}z
z+sU62rkDqO{QqBqVM7W~coEQ&9Sjrx|L0e_@%rcnv1bjxb~AkFyS;nSN4+$DM)9;A
z$_xw+{7MJXUbRi$o2bC=rOvPcsC@zyOn#DRss6J3|4aUV|Np;C1`*o-|Nq|s#Q!}M
uk9jB_^-w(G(fQ#2vk4P63SQt<c=_uiSS!$8hOiJfh6xj1K8A=uOauU1Oow~`
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw
index 865846da42a45c16b69746f16963d47a6c6e71b0..3438dabefee950826a0541e9549f48311f194d43 100644
GIT binary patch
delta 302
zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYeB;Up3OfQOZ#^02ZGL{uUY?f9(~y{IVd5V(RA{vgem$J
zAOHWCV0bwX=$IW06aN3_SGw`~<geWfANp?Z-uF>2jh|6GZHF=gg9E?PfwWi4Cg&!~
z@cXGVTmWjD00omLB-*OKtp5M<{onupUl#uZ62|}k|K9<`|2-6sc_<$BP(0$%`QZPv
g2@^I7Zs1jTDfJ1g6=)|zScn_Lgb6R1AtDeH0oMqWMgRZ+
delta 241
zcmZp9z}WJDaRXa|k1m4%1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=G?I#2s)3x{?~c*W&Px?gm6Zk$&V7I1UY>C
z|6hXP<y4@-I~XSX|Ie><<Mqj3yBR+8-QL~yQ7?_3Q9NyjG6RDHztVxUS9w6y0t`DG
z*ccf2l^&$+;9%&x(RZNlLEnqM3$I<(872VbCtpak<$K-o(%|3!|1WDmgw14`Bnid|
g8wEe`D!jb)aRLYc?PCZFabuV;;pJh72v~Rm0Iz;^EC2ui
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw
index f1d6536cec924d0e167cf1ee4e9309ed5fd7ad60..5ee3012482de343cfae8af590a49170c5b7f1d65 100644
GIT binary patch
delta 261
zcmZp9z}WJDaf56^{a$9n13Q@+7#MUJ1Q-}>fsFq}am_!OOVt`H1gZ`chm<~RtPnYE
zd&;-;ZexYS-h8=frB@m&WICUl%ql(oS_P=8;%QG$=>ecB+b$XZ((OQ1Gfg`aOV<Ha
zwI0^JT)MQmLWQApe&=E42!+xauLBJacsBoJEbU9%^_O{aN<s(Yfyr+ZZZW=^d?IlQ
z<Fv`KNp6h7lb0m<2v7N}m&VU1p0-1ofx&@a=|I{mo5{?{G3?&z3=2O0|35h|*+x|3
z&ugaF-(Ir)e`)^b|NocPe}P2Z=KaZExfNc%`aA&yfPP{K3vpwZFyZB8hzMAC0suQ@
BcftSw
delta 211
zcmZp9z}WJDaf57vb1$>u0bK?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..786239325d 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, 3 ; 3: FFS3 GUID, 2: FFS2 GUID, 1: 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, 3
+ 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, 1
+ jne searchingForBfvHeaderLoop
+
searchedForBfvHeaderButNotFound:
;
; Hang if the SEC entry point was not found
--
2.16.2.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
[not found] ` <16DB43B094343574.10972@groups.io>
@ 2022-03-17 5:21 ` Ni, Ray
2022-03-17 6:05 ` Kuo, Ted
0 siblings, 1 reply; 5+ messages in thread
From: Ni, Ray @ 2022-03-17 5:21 UTC (permalink / raw)
To: devel@edk2.groups.io, Ni, Ray, Kuo, Ted
Cc: De, Debkumar, Han, Harry, West, Catharine, Xu, Min M
Ted,
Have you considered a case that BFV is a FFS2 FV and the logic may find a FFS3 FV just below the BFV?
Thanks,
Ray
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ni, Ray
Sent: Friday, March 11, 2022 3:42 PM
To: Kuo, Ted <ted.kuo@intel.com>; devel@edk2.groups.io
Cc: De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>
Subject: Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
Reviewed-by: Ray Ni <ray.ni@intel.com>
-----Original Message-----
From: Kuo, Ted <ted.kuo@intel.com>
Sent: Friday, March 11, 2022 3:29 PM
To: devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@intel.com>; De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>
Subject: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
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 <ray.ni@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
---
.../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..23254e83bf1a17dee9f38c235fcc9948624a7536 100644 GIT binary patch delta 227 zcmaFDyo9BG0uUG;*vZVmz@W<@z`$S&Wc)9RYyQbxs@7N`P<5a<r1V*1g~(~!Q@*8l
z8!IIC=F3ehz0z1A)A`(FR_W>2DnL~gPkVYw4**r!cFFjcZU?HGY1)}sx(=wS^|0>c
z(xuH6Dh#FbI}bBQD3s24Eoykcv-u}uY2Sto!p|CZ><5C*qp$yU9^J6<S;NbSiBa*4
ze<$v$7OwlRm&VU1p0-1ofx&@a=|I}6#K|6v3IgsE<QXRX|NkH4b`Y3cz-TJ?vg-d!
V@qhpSzg!F?Iv@OhHhCMP9spMyYx@8I
delta 158
zcmV;P0Ac^61mpu+kdTm&F~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*4Y080fVjWEzrTsa>;8$wu(9TV=}(c8
zUjg)y@_Q48|1M?^0T*VtBLDzE4<f*3>S>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..18562d8f1f58601f66fcb0cbf2f994046ce48fde 100644 GIT binary patch delta 225 zcmcb@+`>{n0SF8a>||zOV9;d{U|_HXGX59EHUDHTRcoves5(#_Qu?g1LgcjVDc{n&
zjTI7m^W~<MUTLh5>3nW7tMv416`-n$r#(HT2Y{+<yJY-Jw*ytpH0?|*T?bUvdRX^z
z>C)y36^7FJorjqt6iR2j7BoEI+5D5Sv~S0L?*04scOHHHuk+|j`-wr}jBh5cDmQQY
zub0NpD4w=MnSsH9U+F;FtK9$p{|hkeaA0F#;8%K(wu6JA??&H&z6X6T`Yyb-n;_3H
Z0jOYd0;3s6_e+a^|Np<-GkG4P833r5W}5&2
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/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw
index 6503a988abdac06f9aa88f0a65f2525e12233b0a..e4aa4fc30a32bc3d4d8d0e1726c43fdafef4a374 100644 GIT binary patch delta 214 zcmaFDwuF6xY`rV9;enmZ3=9mq3<3-cwm`=JqPXUt%%y6L6#`WUibG1DHCBk6wms!r
zdbhDcVsF0Ow9+e$6*8UAO=gvzeysvjRq?c^r}O|&m2H=df9ZChs+p#piKXj+s#*{0
zUM^kQT%p2HI=}NUbA&?ajMssN2Rxg9GM4tG?fT0+F{OjiW8&Lej75`AFs>J_`LCD8
z&nTX@Lz#iWfnVuB+AHPBT}&|oJ`>~_Cj9^Ze*zRte#c}Yu;9;Yrq|zIvi^U${?Gsa
LFE>v%Vm1N**#ci0
delta 146
zcmV;D0B!%I2jm8j9YX~JF~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*Ns*Y00YH-_0onm-k^-+2g#RvP4*?fu
zxFY}nKo26oX6h@G!U9|fM35f<kpKVxlP&`^5a9gl0_*na4gcxy{Qv*yyOVMQG7+~v
AVgLXD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw
index 279ba03b0c01f552a0d3ed8900e06b91f2555901..51ad3ecde0e4e02e91ed299ec207e9f7460524b3 100644 GIT binary patch delta 289 zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@K@PKFYPsY-|4I7>{?AX75Kkxp|qp$yU9^J6<S;Ncz$x#aN
zj3$$JDNHf%`1t?71jB|Dpzutf!*(!S`2U|@>Bj4$8^oS9{Mya%q3`zYTOak(_!-61
zb|^D2IPfbSNPD$!a;u^OyQ4b81EBWFTNEw%UN^ja@b~}!mpT7{gvsPTiV}<yHVQ7_
cRd}iOX#xlU4QB`oabuV;;iWJ{1S~uO04hj{^#A|>
delta 259
zcmZokXi3<>rVygbAi%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>@TaY<SkNV?Pjd9)10<^XP_+&l+CNm^?`#p3!#l
zCxt2I0U!VWmtfeC0u){Zv}6avh5!Hgm2SK~x<Tw&!>`>8ANp?ZUi48fjh|6GZHF=g
zg9E?PfwWg`llLkr@O!B<YyfJX00onuC|at&EdT$K|KI=rFOxxp_W%F?cL4E!55;31
ribp*Zk9c%G`2TFegpGn1cokm$`Uutvw3i_)#EoIXgqM#YA`lY+x&4KD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw
index 9b09a80f225736a413b7146b0e7bd4aafc73abe1..eec88b1c9cbd2f87951762b6db2be79c8dd73656 100644 GIT binary patch delta 300 zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@G@PKFYPsY-|9s7Zx^XO~Vf1O8Pc1#XZ2xl~%yh>q;e#OWC
z|0Nh+&I3AT2g8N`|M`_}ygvDBH^Ya%+q?ID)Jx-M6i?fs%)sEluXG^o)w0RCiZc9u
z>I@fv+9p83<Ozzl>MyJRzkL7q|Noc8|A2(?|NsAY0P%kh#bX|dM?DmecyvDa|7^m9
eje;9^6<$hx0&4}@$q*Le#xP;ROJ;}$oEHj+dD
delta 239
zcmZokXi3<>rr@K?Ai%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>>7a><5C*qp$yU9(`Fqxl19OQD^cag(*P}AOHWC
zV0bwdXz&h(3;+M~E8Tc~^4D&L4}G_Hw|&%0<7X64+o8<B;J~kRAnjEiP_+QV4hJ>{
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..de97b858ddd03171114aa0efb1929796b1aa5435 100644 GIT binary patch delta 259 zcmZokXi3;0t5Cm}+3>(lW(EcZT?PRL23sKGe^FfXPv%m!#tMO|1H~bw&l)R4PTQXH
zExp@VA+a}KZd&P;#tNCv=O(jCPrp_Hs;YR}(^Gl?sLHlW#=mqsP}NM+&cxDnKvk`W
zbuX7LZLUyZD4pMVm^nhBbjIsI!vmhpKN(B=(suo2o}8l4!FXWuTZLPUuO^>RoWeM5
za;%aYqwwS<N<P9<KI^6NGm59}P-b9o;8!}3_R3~5vvLf(w>rau&;S2V&QrD#)%f$8
z>GijlZ2w=H|M~y_rS)GRQMY-&@>gz!m#;og00E$%7{Wr_7$!`3c^M)C7M=hAKvr~s
delta 209
zcmZokXi3;0tKi(rY<NJIL4bk5mVtrcf01!xg+RsAo}SXzjTIucT{8Zqj~Xi^W}0>;
zmfmcvkZC=vd%5&NbA<{+>8Z}c%n=HuhhKY6o}tjgcw(}u;w{Ecla!_~#!a58<i;pH
z`Hqs0aLi}DG=4_$v>nO}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.raw
index 0e53a574fab74db6973d7ea41a6a495266a4d0ae..23c58501b5a48448ffcd2757310442ef33f45fa0 100644 GIT binary patch delta 291 zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYf-}kp3OfQOZzr#c-F9E|Ni~F`#X=m{?~bQ!^UR~FZ(A)
zCB!qDOx~3+#k}L=|NjyU8&ZJ6Gl34<!7$<fe}1JKua9mJd)Dx4H^Ya%+q-Xl)Jx-M
z6i?fs%)sEluXG^o)xOECi3;qF>I@Hn+9z*GwB&o;@bbam|Nmd+`~wmulm8@2FizMg
exPVvTrPikjAOJL+AuPm=VZwx$!VnR#@B{$qM2t58
delta 261
zcmZp9z}WJDaRXaIh%SQw1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=H0O2S;LO~K+t*g^}o)e8#X>`csXP8q=a}z
z+sU62rkDqO{QqBqVM7W~coEQ&9Sjrx|L0e_@%rcnv1bjxb~AkFyS;nSN4+$DM)9;A
z$_xw+{7MJXUbRi$o2bC=rOvPcsC@zyOn#DRss6J3|4aUV|Np;C1`*o-|Nq|s#Q!}M
uk9jB_^-w(G(fQ#2vk4P63SQt<c=_uiSS!$8hOiJfh6xj1K8A=uOauU1Oow~`
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw
index 865846da42a45c16b69746f16963d47a6c6e71b0..3438dabefee950826a0541e9549f48311f194d43 100644 GIT binary patch delta 302 zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYeB;Up3OfQOZ#^02ZGL{uUY?f9(~y{IVd5V(RA{vgem$J
zAOHWCV0bwX=$IW06aN3_SGw`~<geWfANp?Z-uF>2jh|6GZHF=gg9E?PfwWi4Cg&!~
z@cXGVTmWjD00omLB-*OKtp5M<{onupUl#uZ62|}k|K9<`|2-6sc_<$BP(0$%`QZPv
g2@^I7Zs1jTDfJ1g6=)|zScn_Lgb6R1AtDeH0oMqWMgRZ+
delta 241
zcmZp9z}WJDaRXa|k1m4%1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=G?I#2s)3x{?~c*W&Px?gm6Zk$&V7I1UY>C
z|6hXP<y4@-I~XSX|Ie><<Mqj3yBR+8-QL~yQ7?_3Q9NyjG6RDHztVxUS9w6y0t`DG
z*ccf2l^&$+;9%&x(RZNlLEnqM3$I<(872VbCtpak<$K-o(%|3!|1WDmgw14`Bnid|
g8wEe`D!jb)aRLYc?PCZFabuV;;pJh72v~Rm0Iz;^EC2ui
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw
index f1d6536cec924d0e167cf1ee4e9309ed5fd7ad60..5ee3012482de343cfae8af590a49170c5b7f1d65 100644 GIT binary patch delta 261 zcmZp9z}WJDaf56^{a$9n13Q@+7#MUJ1Q-}>fsFq}am_!OOVt`H1gZ`chm<~RtPnYE
zd&;-;ZexYS-h8=frB@m&WICUl%ql(oS_P=8;%QG$=>ecB+b$XZ((OQ1Gfg`aOV<Ha
zwI0^JT)MQmLWQApe&=E42!+xauLBJacsBoJEbU9%^_O{aN<s(Yfyr+ZZZW=^d?IlQ
z<Fv`KNp6h7lb0m<2v7N}m&VU1p0-1ofx&@a=|I{mo5{?{G3?&z3=2O0|35h|*+x|3
z&ugaF-(Ir)e`)^b|NocPe}P2Z=KaZExfNc%`aA&yfPP{K3vpwZFyZB8hzMAC0suQ@
BcftSw
delta 211
zcmZp9z}WJDaf57vb1$>u0bK?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..786239325d 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, 3 ; 3: FFS3 GUID, 2: FFS2 GUID, 1: 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, 3
+ 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, 1
+ jne searchingForBfvHeaderLoop
+
searchedForBfvHeaderButNotFound:
;
; Hang if the SEC entry point was not found
--
2.16.2.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
2022-03-17 5:21 ` Ni, Ray
@ 2022-03-17 6:05 ` Kuo, Ted
2022-03-17 7:16 ` Ni, Ray
0 siblings, 1 reply; 5+ messages in thread
From: Kuo, Ted @ 2022-03-17 6:05 UTC (permalink / raw)
To: Ni, Ray, devel@edk2.groups.io
Cc: De, Debkumar, Han, Harry, West, Catharine, Xu, Min M
Hi Ray,
No, I'll send patch to update the searching algorithm.
Thanks,
Ted
-----Original Message-----
From: Ni, Ray <ray.ni@intel.com>
Sent: Thursday, March 17, 2022 1:21 PM
To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Kuo, Ted <ted.kuo@intel.com>
Cc: De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>; Xu, Min M <min.m.xu@intel.com>
Subject: RE: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
Ted,
Have you considered a case that BFV is a FFS2 FV and the logic may find a FFS3 FV just below the BFV?
Thanks,
Ray
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ni, Ray
Sent: Friday, March 11, 2022 3:42 PM
To: Kuo, Ted <ted.kuo@intel.com>; devel@edk2.groups.io
Cc: De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>
Subject: Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
Reviewed-by: Ray Ni <ray.ni@intel.com>
-----Original Message-----
From: Kuo, Ted <ted.kuo@intel.com>
Sent: Friday, March 11, 2022 3:29 PM
To: devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@intel.com>; De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>
Subject: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
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 <ray.ni@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
---
.../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..23254e83bf1a17dee9f38c235fcc9948624a7536 100644 GIT binary patch delta 227 zcmaFDyo9BG0uUG;*vZVmz@W<@z`$S&Wc)9RYyQbxs@7N`P<5a<r1V*1g~(~!Q@*8l
z8!IIC=F3ehz0z1A)A`(FR_W>2DnL~gPkVYw4**r!cFFjcZU?HGY1)}sx(=wS^|0>c
z(xuH6Dh#FbI}bBQD3s24Eoykcv-u}uY2Sto!p|CZ><5C*qp$yU9^J6<S;NbSiBa*4
ze<$v$7OwlRm&VU1p0-1ofx&@a=|I}6#K|6v3IgsE<QXRX|NkH4b`Y3cz-TJ?vg-d!
V@qhpSzg!F?Iv@OhHhCMP9spMyYx@8I
delta 158
zcmV;P0Ac^61mpu+kdTm&F~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*4Y080fVjWEzrTsa>;8$wu(9TV=}(c8
zUjg)y@_Q48|1M?^0T*VtBLDzE4<f*3>S>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..18562d8f1f58601f66fcb0cbf2f994046ce48fde 100644 GIT binary patch delta 225 zcmcb@+`>{n0SF8a>||zOV9;d{U|_HXGX59EHUDHTRcoves5(#_Qu?g1LgcjVDc{n&
zjTI7m^W~<MUTLh5>3nW7tMv416`-n$r#(HT2Y{+<yJY-Jw*ytpH0?|*T?bUvdRX^z
z>C)y36^7FJorjqt6iR2j7BoEI+5D5Sv~S0L?*04scOHHHuk+|j`-wr}jBh5cDmQQY
zub0NpD4w=MnSsH9U+F;FtK9$p{|hkeaA0F#;8%K(wu6JA??&H&z6X6T`Yyb-n;_3H
Z0jOYd0;3s6_e+a^|Np<-GkG4P833r5W}5&2
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/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw
index 6503a988abdac06f9aa88f0a65f2525e12233b0a..e4aa4fc30a32bc3d4d8d0e1726c43fdafef4a374 100644 GIT binary patch delta 214 zcmaFDwuF6xY`rV9;enmZ3=9mq3<3-cwm`=JqPXUt%%y6L6#`WUibG1DHCBk6wms!r
zdbhDcVsF0Ow9+e$6*8UAO=gvzeysvjRq?c^r}O|&m2H=df9ZChs+p#piKXj+s#*{0
zUM^kQT%p2HI=}NUbA&?ajMssN2Rxg9GM4tG?fT0+F{OjiW8&Lej75`AFs>J_`LCD8
z&nTX@Lz#iWfnVuB+AHPBT}&|oJ`>~_Cj9^Ze*zRte#c}Yu;9;Yrq|zIvi^U${?Gsa
LFE>v%Vm1N**#ci0
delta 146
zcmV;D0B!%I2jm8j9YX~JF~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*Ns*Y00YH-_0onm-k^-+2g#RvP4*?fu
zxFY}nKo26oX6h@G!U9|fM35f<kpKVxlP&`^5a9gl0_*na4gcxy{Qv*yyOVMQG7+~v
AVgLXD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw
index 279ba03b0c01f552a0d3ed8900e06b91f2555901..51ad3ecde0e4e02e91ed299ec207e9f7460524b3 100644 GIT binary patch delta 289 zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@K@PKFYPsY-|4I7>{?AX75Kkxp|qp$yU9^J6<S;Ncz$x#aN
zj3$$JDNHf%`1t?71jB|Dpzutf!*(!S`2U|@>Bj4$8^oS9{Mya%q3`zYTOak(_!-61
zb|^D2IPfbSNPD$!a;u^OyQ4b81EBWFTNEw%UN^ja@b~}!mpT7{gvsPTiV}<yHVQ7_
cRd}iOX#xlU4QB`oabuV;;iWJ{1S~uO04hj{^#A|>
delta 259
zcmZokXi3<>rVygbAi%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>@TaY<SkNV?Pjd9)10<^XP_+&l+CNm^?`#p3!#l
zCxt2I0U!VWmtfeC0u){Zv}6avh5!Hgm2SK~x<Tw&!>`>8ANp?ZUi48fjh|6GZHF=g
zg9E?PfwWg`llLkr@O!B<YyfJX00onuC|at&EdT$K|KI=rFOxxp_W%F?cL4E!55;31
ribp*Zk9c%G`2TFegpGn1cokm$`Uutvw3i_)#EoIXgqM#YA`lY+x&4KD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw
index 9b09a80f225736a413b7146b0e7bd4aafc73abe1..eec88b1c9cbd2f87951762b6db2be79c8dd73656 100644 GIT binary patch delta 300 zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@G@PKFYPsY-|9s7Zx^XO~Vf1O8Pc1#XZ2xl~%yh>q;e#OWC
z|0Nh+&I3AT2g8N`|M`_}ygvDBH^Ya%+q?ID)Jx-M6i?fs%)sEluXG^o)w0RCiZc9u
z>I@fv+9p83<Ozzl>MyJRzkL7q|Noc8|A2(?|NsAY0P%kh#bX|dM?DmecyvDa|7^m9
eje;9^6<$hx0&4}@$q*Le#xP;ROJ;}$oEHj+dD
delta 239
zcmZokXi3<>rr@K?Ai%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>>7a><5C*qp$yU9(`Fqxl19OQD^cag(*P}AOHWC
zV0bwdXz&h(3;+M~E8Tc~^4D&L4}G_Hw|&%0<7X64+o8<B;J~kRAnjEiP_+QV4hJ>{
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..de97b858ddd03171114aa0efb1929796b1aa5435 100644 GIT binary patch delta 259 zcmZokXi3;0t5Cm}+3>(lW(EcZT?PRL23sKGe^FfXPv%m!#tMO|1H~bw&l)R4PTQXH
zExp@VA+a}KZd&P;#tNCv=O(jCPrp_Hs;YR}(^Gl?sLHlW#=mqsP}NM+&cxDnKvk`W
zbuX7LZLUyZD4pMVm^nhBbjIsI!vmhpKN(B=(suo2o}8l4!FXWuTZLPUuO^>RoWeM5
za;%aYqwwS<N<P9<KI^6NGm59}P-b9o;8!}3_R3~5vvLf(w>rau&;S2V&QrD#)%f$8
z>GijlZ2w=H|M~y_rS)GRQMY-&@>gz!m#;og00E$%7{Wr_7$!`3c^M)C7M=hAKvr~s
delta 209
zcmZokXi3;0tKi(rY<NJIL4bk5mVtrcf01!xg+RsAo}SXzjTIucT{8Zqj~Xi^W}0>;
zmfmcvkZC=vd%5&NbA<{+>8Z}c%n=HuhhKY6o}tjgcw(}u;w{Ecla!_~#!a58<i;pH
z`Hqs0aLi}DG=4_$v>nO}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.raw
index 0e53a574fab74db6973d7ea41a6a495266a4d0ae..23c58501b5a48448ffcd2757310442ef33f45fa0 100644 GIT binary patch delta 291 zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYf-}kp3OfQOZzr#c-F9E|Ni~F`#X=m{?~bQ!^UR~FZ(A)
zCB!qDOx~3+#k}L=|NjyU8&ZJ6Gl34<!7$<fe}1JKua9mJd)Dx4H^Ya%+q-Xl)Jx-M
z6i?fs%)sEluXG^o)xOECi3;qF>I@Hn+9z*GwB&o;@bbam|Nmd+`~wmulm8@2FizMg
exPVvTrPikjAOJL+AuPm=VZwx$!VnR#@B{$qM2t58
delta 261
zcmZp9z}WJDaRXaIh%SQw1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=H0O2S;LO~K+t*g^}o)e8#X>`csXP8q=a}z
z+sU62rkDqO{QqBqVM7W~coEQ&9Sjrx|L0e_@%rcnv1bjxb~AkFyS;nSN4+$DM)9;A
z$_xw+{7MJXUbRi$o2bC=rOvPcsC@zyOn#DRss6J3|4aUV|Np;C1`*o-|Nq|s#Q!}M
uk9jB_^-w(G(fQ#2vk4P63SQt<c=_uiSS!$8hOiJfh6xj1K8A=uOauU1Oow~`
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw
index 865846da42a45c16b69746f16963d47a6c6e71b0..3438dabefee950826a0541e9549f48311f194d43 100644 GIT binary patch delta 302 zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYeB;Up3OfQOZ#^02ZGL{uUY?f9(~y{IVd5V(RA{vgem$J
zAOHWCV0bwX=$IW06aN3_SGw`~<geWfANp?Z-uF>2jh|6GZHF=gg9E?PfwWi4Cg&!~
z@cXGVTmWjD00omLB-*OKtp5M<{onupUl#uZ62|}k|K9<`|2-6sc_<$BP(0$%`QZPv
g2@^I7Zs1jTDfJ1g6=)|zScn_Lgb6R1AtDeH0oMqWMgRZ+
delta 241
zcmZp9z}WJDaRXa|k1m4%1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=G?I#2s)3x{?~c*W&Px?gm6Zk$&V7I1UY>C
z|6hXP<y4@-I~XSX|Ie><<Mqj3yBR+8-QL~yQ7?_3Q9NyjG6RDHztVxUS9w6y0t`DG
z*ccf2l^&$+;9%&x(RZNlLEnqM3$I<(872VbCtpak<$K-o(%|3!|1WDmgw14`Bnid|
g8wEe`D!jb)aRLYc?PCZFabuV;;pJh72v~Rm0Iz;^EC2ui
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw
index f1d6536cec924d0e167cf1ee4e9309ed5fd7ad60..5ee3012482de343cfae8af590a49170c5b7f1d65 100644 GIT binary patch delta 261 zcmZp9z}WJDaf56^{a$9n13Q@+7#MUJ1Q-}>fsFq}am_!OOVt`H1gZ`chm<~RtPnYE
zd&;-;ZexYS-h8=frB@m&WICUl%ql(oS_P=8;%QG$=>ecB+b$XZ((OQ1Gfg`aOV<Ha
zwI0^JT)MQmLWQApe&=E42!+xauLBJacsBoJEbU9%^_O{aN<s(Yfyr+ZZZW=^d?IlQ
z<Fv`KNp6h7lb0m<2v7N}m&VU1p0-1ofx&@a=|I{mo5{?{G3?&z3=2O0|35h|*+x|3
z&ugaF-(Ir)e`)^b|NocPe}P2Z=KaZExfNc%`aA&yfPP{K3vpwZFyZB8hzMAC0suQ@
BcftSw
delta 211
zcmZp9z}WJDaf57vb1$>u0bK?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..786239325d 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, 3 ; 3: FFS3 GUID, 2: FFS2 GUID, 1: 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, 3
+ 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, 1
+ jne searchingForBfvHeaderLoop
+
searchedForBfvHeaderButNotFound:
;
; Hang if the SEC entry point was not found
--
2.16.2.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
2022-03-17 6:05 ` Kuo, Ted
@ 2022-03-17 7:16 ` Ni, Ray
0 siblings, 0 replies; 5+ messages in thread
From: Ni, Ray @ 2022-03-17 7:16 UTC (permalink / raw)
To: Kuo, Ted, devel@edk2.groups.io
Cc: De, Debkumar, Han, Harry, West, Catharine, Xu, Min M
Ted, thank you for the fix in advance!
-----Original Message-----
From: Kuo, Ted <ted.kuo@intel.com>
Sent: Thursday, March 17, 2022 2:05 PM
To: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io
Cc: De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>; Xu, Min M <min.m.xu@intel.com>
Subject: RE: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
Hi Ray,
No, I'll send patch to update the searching algorithm.
Thanks,
Ted
-----Original Message-----
From: Ni, Ray <ray.ni@intel.com>
Sent: Thursday, March 17, 2022 1:21 PM
To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Kuo, Ted <ted.kuo@intel.com>
Cc: De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>; Xu, Min M <min.m.xu@intel.com>
Subject: RE: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
Ted,
Have you considered a case that BFV is a FFS2 FV and the logic may find a FFS3 FV just below the BFV?
Thanks,
Ray
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ni, Ray
Sent: Friday, March 11, 2022 3:42 PM
To: Kuo, Ted <ted.kuo@intel.com>; devel@edk2.groups.io
Cc: De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>
Subject: Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
Reviewed-by: Ray Ni <ray.ni@intel.com>
-----Original Message-----
From: Kuo, Ted <ted.kuo@intel.com>
Sent: Friday, March 11, 2022 3:29 PM
To: devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@intel.com>; De, Debkumar <debkumar.de@intel.com>; Han, Harry <harry.han@intel.com>; West, Catharine <catharine.west@intel.com>
Subject: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
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 <ray.ni@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
---
.../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..23254e83bf1a17dee9f38c235fcc9948624a7536 100644 GIT binary patch delta 227 zcmaFDyo9BG0uUG;*vZVmz@W<@z`$S&Wc)9RYyQbxs@7N`P<5a<r1V*1g~(~!Q@*8l
z8!IIC=F3ehz0z1A)A`(FR_W>2DnL~gPkVYw4**r!cFFjcZU?HGY1)}sx(=wS^|0>c
z(xuH6Dh#FbI}bBQD3s24Eoykcv-u}uY2Sto!p|CZ><5C*qp$yU9^J6<S;NbSiBa*4
ze<$v$7OwlRm&VU1p0-1ofx&@a=|I}6#K|6v3IgsE<QXRX|NkH4b`Y3cz-TJ?vg-d!
V@qhpSzg!F?Iv@OhHhCMP9spMyYx@8I
delta 158
zcmV;P0Ac^61mpu+kdTm&F~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*4Y080fVjWEzrTsa>;8$wu(9TV=}(c8
zUjg)y@_Q48|1M?^0T*VtBLDzE4<f*3>S>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..18562d8f1f58601f66fcb0cbf2f994046ce48fde 100644 GIT binary patch delta 225 zcmcb@+`>{n0SF8a>||zOV9;d{U|_HXGX59EHUDHTRcoves5(#_Qu?g1LgcjVDc{n&
zjTI7m^W~<MUTLh5>3nW7tMv416`-n$r#(HT2Y{+<yJY-Jw*ytpH0?|*T?bUvdRX^z
z>C)y36^7FJorjqt6iR2j7BoEI+5D5Sv~S0L?*04scOHHHuk+|j`-wr}jBh5cDmQQY
zub0NpD4w=MnSsH9U+F;FtK9$p{|hkeaA0F#;8%K(wu6JA??&H&z6X6T`Yyb-n;_3H
Z0jOYd0;3s6_e+a^|Np<-GkG4P833r5W}5&2
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/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw
index 6503a988abdac06f9aa88f0a65f2525e12233b0a..e4aa4fc30a32bc3d4d8d0e1726c43fdafef4a374 100644 GIT binary patch delta 214 zcmaFDwuF6xY`rV9;enmZ3=9mq3<3-cwm`=JqPXUt%%y6L6#`WUibG1DHCBk6wms!r
zdbhDcVsF0Ow9+e$6*8UAO=gvzeysvjRq?c^r}O|&m2H=df9ZChs+p#piKXj+s#*{0
zUM^kQT%p2HI=}NUbA&?ajMssN2Rxg9GM4tG?fT0+F{OjiW8&Lej75`AFs>J_`LCD8
z&nTX@Lz#iWfnVuB+AHPBT}&|oJ`>~_Cj9^Ze*zRte#c}Yu;9;Yrq|zIvi^U${?Gsa
LFE>v%Vm1N**#ci0
delta 146
zcmV;D0B!%I2jm8j9YX~JF~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=b<l%&Bmi~FiNga}Aa%p*Ns*Y00YH-_0onm-k^-+2g#RvP4*?fu
zxFY}nKo26oX6h@G!U9|fM35f<kpKVxlP&`^5a9gl0_*na4gcxy{Qv*yyOVMQG7+~v
AVgLXD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.port80.raw
index 279ba03b0c01f552a0d3ed8900e06b91f2555901..51ad3ecde0e4e02e91ed299ec207e9f7460524b3 100644 GIT binary patch delta 289 zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@K@PKFYPsY-|4I7>{?AX75Kkxp|qp$yU9^J6<S;Ncz$x#aN
zj3$$JDNHf%`1t?71jB|Dpzutf!*(!S`2U|@>Bj4$8^oS9{Mya%q3`zYTOak(_!-61
zb|^D2IPfbSNPD$!a;u^OyQ4b81EBWFTNEw%UN^ja@b~}!mpT7{gvsPTiV}<yHVQ7_
cRd}iOX#xlU4QB`oabuV;;iWJ{1S~uO04hj{^#A|>
delta 259
zcmZokXi3<>rVygbAi%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>@TaY<SkNV?Pjd9)10<^XP_+&l+CNm^?`#p3!#l
zCxt2I0U!VWmtfeC0u){Zv}6avh5!Hgm2SK~x<Tw&!>`>8ANp?ZUi48fjh|6GZHF=g
zg9E?PfwWg`llLkr@O!B<YyfJX00onuC|at&EdT$K|KI=rFOxxp_W%F?cL4E!55;31
ribp*Zk9c%G`2TFegpGn1cokm$`Uutvw3i_)#EoIXgqM#YA`lY+x&4KD
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw
index 9b09a80f225736a413b7146b0e7bd4aafc73abe1..eec88b1c9cbd2f87951762b6db2be79c8dd73656 100644 GIT binary patch delta 300 zcmZokXi3<>rcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t<Iu|lTvxyh{3)2~&4sw$rL^pqX|s<Q2p@h{yDR5jDIGqH3XP*v+;-OHs*
zn=4cpO6PYTW{yxOo$*@G@PKFYPsY-|9s7Zx^XO~Vf1O8Pc1#XZ2xl~%yh>q;e#OWC
z|0Nh+&I3AT2g8N`|M`_}ygvDBH^Ya%+q?ID)Jx-M6i?fs%)sEluXG^o)w0RCiZc9u
z>I@fv+9p83<Ozzl>MyJRzkL7q|Noc8|A2(?|NsAY0P%kh#bX|dM?DmecyvDa|7^m9
eje;9^6<$hx0&4}@$q*Le#xP;ROJ;}$oEHj+dD
delta 239
zcmZokXi3<>rr@K?Ai%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Ty<B>sxk81Z^i=0z<_Lw-!>>7a><5C*qp$yU9(`Fqxl19OQD^cag(*P}AOHWC
zV0bwdXz&h(3;+M~E8Tc~^4D&L4}G_Hw|&%0<7X64+o8<B;J~kRAnjEiP_+QV4hJ>{
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..de97b858ddd03171114aa0efb1929796b1aa5435 100644 GIT binary patch delta 259 zcmZokXi3;0t5Cm}+3>(lW(EcZT?PRL23sKGe^FfXPv%m!#tMO|1H~bw&l)R4PTQXH
zExp@VA+a}KZd&P;#tNCv=O(jCPrp_Hs;YR}(^Gl?sLHlW#=mqsP}NM+&cxDnKvk`W
zbuX7LZLUyZD4pMVm^nhBbjIsI!vmhpKN(B=(suo2o}8l4!FXWuTZLPUuO^>RoWeM5
za;%aYqwwS<N<P9<KI^6NGm59}P-b9o;8!}3_R3~5vvLf(w>rau&;S2V&QrD#)%f$8
z>GijlZ2w=H|M~y_rS)GRQMY-&@>gz!m#;og00E$%7{Wr_7$!`3c^M)C7M=hAKvr~s
delta 209
zcmZokXi3;0tKi(rY<NJIL4bk5mVtrcf01!xg+RsAo}SXzjTIucT{8Zqj~Xi^W}0>;
zmfmcvkZC=vd%5&NbA<{+>8Z}c%n=HuhhKY6o}tjgcw(}u;w{Ecla!_~#!a58<i;pH
z`Hqs0aLi}DG=4_$v>nO}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.raw
index 0e53a574fab74db6973d7ea41a6a495266a4d0ae..23c58501b5a48448ffcd2757310442ef33f45fa0 100644 GIT binary patch delta 291 zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYf-}kp3OfQOZzr#c-F9E|Ni~F`#X=m{?~bQ!^UR~FZ(A)
zCB!qDOx~3+#k}L=|NjyU8&ZJ6Gl34<!7$<fe}1JKua9mJd)Dx4H^Ya%+q-Xl)Jx-M
z6i?fs%)sEluXG^o)xOECi3;qF>I@Hn+9z*GwB&o;@bbam|Nmd+`~wmulm8@2FizMg
exPVvTrPikjAOJL+AuPm=VZwx$!VnR#@B{$qM2t58
delta 261
zcmZp9z}WJDaRXaIh%SQw1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=H0O2S;LO~K+t*g^}o)e8#X>`csXP8q=a}z
z+sU62rkDqO{QqBqVM7W~coEQ&9Sjrx|L0e_@%rcnv1bjxb~AkFyS;nSN4+$DM)9;A
z$_xw+{7MJXUbRi$o2bC=rOvPcsC@zyOn#DRss6J3|4aUV|Np;C1`*o-|Nq|s#Q!}M
uk9jB_^-w(G(fQ#2vk4P63SQt<c=_uiSS!$8hOiJfh6xj1K8A=uOauU1Oow~`
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw
index 865846da42a45c16b69746f16963d47a6c6e71b0..3438dabefee950826a0541e9549f48311f194d43 100644 GIT binary patch delta 302 zcmZp9z}WJDaRXaI{Z3{E1_oUQ0R{$JAme{gT=P%nQnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYeB;Up3OfQOZ#^02ZGL{uUY?f9(~y{IVd5V(RA{vgem$J
zAOHWCV0bwX=$IW06aN3_SGw`~<geWfANp?Z-uF>2jh|6GZHF=gg9E?PfwWi4Cg&!~
z@cXGVTmWjD00omLB-*OKtp5M<{onupUl#uZ62|}k|K9<`|2-6sc_<$BP(0$%`QZPv
g2@^I7Zs1jTDfJ1g6=)|zScn_Lgb6R1AtDeH0oMqWMgRZ+
delta 241
zcmZp9z}WJDaRXa|k1m4%1A{FC1H=C!<Hibsil;q2rLP++L~Ofc{7WA-R!Gb=?My7a
z*;paddRX^z>4oMB6^7DNorjqt6iN@j=G?I#2s)3x{?~c*W&Px?gm6Zk$&V7I1UY>C
z|6hXP<y4@-I~XSX|Ie><<Mqj3yBR+8-QL~yQ7?_3Q9NyjG6RDHztVxUS9w6y0t`DG
z*ccf2l^&$+;9%&x(RZNlLEnqM3$I<(872VbCtpak<$K-o(%|3!|1WDmgw14`Bnid|
g8wEe`D!jb)aRLYc?PCZFabuV;;pJh72v~Rm0Iz;^EC2ui
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable2M/ResetVector.x64.serial.raw
index f1d6536cec924d0e167cf1ee4e9309ed5fd7ad60..5ee3012482de343cfae8af590a49170c5b7f1d65 100644 GIT binary patch delta 261 zcmZp9z}WJDaf56^{a$9n13Q@+7#MUJ1Q-}>fsFq}am_!OOVt`H1gZ`chm<~RtPnYE
zd&;-;ZexYS-h8=frB@m&WICUl%ql(oS_P=8;%QG$=>ecB+b$XZ((OQ1Gfg`aOV<Ha
zwI0^JT)MQmLWQApe&=E42!+xauLBJacsBoJEbU9%^_O{aN<s(Yfyr+ZZZW=^d?IlQ
z<Fv`KNp6h7lb0m<2v7N}m&VU1p0-1ofx&@a=|I{mo5{?{G3?&z3=2O0|35h|*+x|3
z&ugaF-(Ir)e`)^b|NocPe}P2Z=KaZExfNc%`aA&yfPP{K3vpwZFyZB8hzMAC0suQ@
BcftSw
delta 211
zcmZp9z}WJDaf57vb1$>u0bK?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..786239325d 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, 3 ; 3: FFS3 GUID, 2: FFS2 GUID, 1: 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, 3
+ 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, 1
+ jne searchingForBfvHeaderLoop
+
searchedForBfvHeaderButNotFound:
;
; Hang if the SEC entry point was not found
--
2.16.2.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-17 7:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-11 7:28 [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm Kuo, Ted
2022-03-11 7:41 ` Ni, Ray
[not found] ` <16DB43B094343574.10972@groups.io>
2022-03-17 5:21 ` Ni, Ray
2022-03-17 6:05 ` Kuo, Ted
2022-03-17 7:16 ` Ni, Ray
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox