public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel][PATCH] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
@ 2022-03-07 14:43 Kuo, Ted
  2022-03-10  4:15 ` Ni, Ray
  0 siblings, 1 reply; 3+ messages in thread
From: Kuo, Ted @ 2022-03-07 14:43 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..ccb5fb9d28d295dabdf41113e959d4a04823e917 100644
GIT binary patch
delta 227
zcmaFDyo9BG0uUG;*vZ7ez@W<@z`$S&Wc)9RYyQbps@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}OY2Sto!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@OhHhCMP9spGwYxn>F

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..45ef6ccbcb61368711b3d1e90fd9f0633a8424dd 100644
GIT binary patch
delta 225
zcmcb@+`>{n0SF8a>||nKV9;d{U|_HXGX59EHUDHPRcoves5(#_Qu?g1LgcjVDc{n&
zjTI7m^W~<MUTLh5>3nW7tMv416`-n$r#(HT2Y{+<yJY-Jw*ytpH0?|*T?bUvdRX^z
z>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/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw
index 6503a988abdac06f9aa88f0a65f2525e12233b0a..16143454c0b6df93468bcde510289e43b343d8fd 100644
GIT binary patch
delta 214
zcmaFDwuF6xY`rV9;enk@3=9mq3<3-cwm`=JqPXUtOr>g#6#`WUibG1DHCBk6wms!r
zdbhDcVsF0Ow9+e$6*8UAO=gvzeysvjRq?c^r}O|&m2H=df9ZChs+p#piKXj+s#*{0
zUM^kQT%p2HI=}NUbA&?ajMssN2Rxg9GL-hE?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**C}5Y

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..fb9532ac7a27852955dd149980344084f6b91e4b 100644
GIT binary patch
delta 289
zcmZokXi3<>rcl3=iGhJZmqCDm!4}B)UliB;lc`j#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@PKFYPlnRI4I7>{?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~uO04Ifs@&Et;

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..fdd701d32388447bee7688ec17e951e500ec1362 100644
GIT binary patch
delta 300
zcmZokXi3<>rcl3=iGhJZmqCDm!4}B)UliB;lc`j#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@PKFYPlnRI9s7Zx^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;}&#6$oBQj$Rc

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..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;%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=hAJ^6Hf

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..4acf69533a7b60ad0902e9b3dc320e32baa79d23 100644
GIT binary patch
delta 291
zcmZp9z}WJDaRXaI{Z1wZ1_oUQ0R{$JAme{gT=P$+QnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYf-}kp3OfQO8Yi!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{$nfs8Z&

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..bce83b542268a5cbb241df8ae1d249cd3350b700 100644
GIT binary patch
delta 302
zcmZp9z}WJDaRXaI{Z1wZ1_oUQ0R{$JAme{gT=P$+QnkhkfvN+=A*Ih6D@0D)p7Jfd
z+gKs7H(zdA>6OL`na<}Xvr13DRspK2c-qrbdH|@(woAspbURShOw-Q9(se*pt%r3l
zmo9CtP+=&Y-+7ohLZNiVYeB;Up3OfQO8a)~2ZGL{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_Lgb6R1AtDeH0n{XvLjV8(

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..f729be41702719a6f63bf758078335cb22207034 100644
GIT binary patch
delta 261
zcmZp9z}WJDaf56^{a$9n13Q@*7#MUJ1Q-}>fsFq}am_!OO4S-G1gZ`chm<~RtPnYE
zd&;-;ZexYS-h8=frB@m&WICUl%ql(oS_P=8;%QG$=>ecB+b$XZ((OQ1Gfg`aOV<Ha
zwI0^JT)MQmLWQApe&=E42!+xauLBJacsBoJDD6wz^_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{K3vpwZFyZB8hzMAC0suJ(
BcfSAt

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..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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-10 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-07 14:43 [edk2-devel][PATCH] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm Kuo, Ted
2022-03-10  4:15 ` Ni, Ray
2022-03-10 11:44   ` Kuo, Ted

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox