From: "Kuo, Ted" <ted.kuo@intel.com>
To: "Ni, Ray" <ray.ni@intel.com>,
"devel@edk2.groups.io" <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] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
Date: Thu, 10 Mar 2022 11:44:01 +0000 [thread overview]
Message-ID: <MW5PR11MB5932B420EE74B03EC52ACBADE50B9@MW5PR11MB5932.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MWHPR11MB163119A323C59A419B3433D58C0B9@MWHPR11MB1631.namprd11.prod.outlook.com>
Hi Ray,
Please find my inline comments with [Ted].
Thanks,
Ted
-----Original Message-----
From: Ni, Ray <ray.ni@intel.com>
Sent: Thursday, March 10, 2022 12:15 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] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm
3 comments starting with "[Ray]".
;#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
[Ray] 1. I am not sure if it's the best representation of GUID in NASM? I am not the NASM expert. If there is no recommendation, I am ok with this.
[Ted] Somehow the diff doesn't reflect the actual representation in my editor. I'll check and update the patch.
BITS 32
@@ -25,6 +32,7 @@ BITS 32
Flat32SearchForBfvBase:
xor eax, eax
+ mov ecx, 2 ; 2: FFS3 GUID, 1: FFS2 GUID, 0: Not Found
[Ray] 2. Can you map ECX 2 to FFS2 GUID, ECX 3 to FFS3 GUID?
[Ted] Yes, will update in next patch.
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:
[Ray] 3. Why is this label added?
[Ted] You meant searchingForBfvWithOtherFfsGuid? This is used to restart a new search with a new target guid before reaching the end of the supported ffs guid list.
;
; 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
prev parent reply other threads:[~2022-03-10 11:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MW5PR11MB5932B420EE74B03EC52ACBADE50B9@MW5PR11MB5932.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox