From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web09.5830.1608601024049506952 for ; Mon, 21 Dec 2020 17:37:05 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 22 Dec 2020 09:37:00 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Bob Feng'" References: <20201221062546.10545-1-aaron.li@intel.com> In-Reply-To: <20201221062546.10545-1-aaron.li@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHYyIDEvMV0gU2lsaWNvbi9GaXRHZW46IEVuaGFuY2UgU2xvdCBtb2RlIHN1cHBvcnQgZm9yY2UgbW9kZSBmb3IgbXVsdGlwbGUgRlYu?= Date: Tue, 22 Dec 2020 09:37:01 +0800 Message-ID: <004001d6d802$f247e320$d6d7a960$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHQMeOugSfCG7Gk7sT8rbsP88GJUKoPoPFg Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Aaron: I add my comment.=20 Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: bounce+27952+69301+4905953+8761045@groups.io > =B4=FA=B1=ED Aaron Li > =B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA12=D4=C221=C8=D5 14:26 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Bob Feng ; Liming Gao > > =D6=F7=CC=E2: [edk2-devel] [PATCH v2 1/1] Silicon/FitGen: Enhance Slot = mode support > force mode for multiple FV. >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3122 >=20 > Adding "-LF"/"-lf" option to support slot mode without FFS GUID check. > It will support the scenario that multiple Microcode FV with different = FFS > GUID enable slot mode. > The size of slot should be 16 byte-aligned, and larger than every > microcode. >=20 > Signed-off-by: Aaron Li > Cc: Bob Feng > Cc: Liming Gao > --- > Silicon/Intel/Tools/FitGen/FitGen.c | 39 +++++++++++++------- > Silicon/Intel/Tools/FitGen/FitGen.h | 2 +- > 2 files changed, 27 insertions(+), 14 deletions(-) >=20 > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c > b/Silicon/Intel/Tools/FitGen/FitGen.c > index e9541c1e95cb..6f7ddedf7e5f 100644 > --- a/Silicon/Intel/Tools/FitGen/FitGen.c > +++ b/Silicon/Intel/Tools/FitGen/FitGen.c > @@ -333,9 +333,10 @@ Returns: > "\t[-F ] [-F = ] [-V > ]\n" >=20 > "\t[-NA]\n" >=20 > "\t[-A ]\n" >=20 > - "\t[-REMAP \n" >=20 > + "\t[-REMAP \n" >=20 > "\t[-CLEAR]\n" >=20 > "\t[-L ]\n" >=20 > + "\t[-LF ]\n" >=20 > "\t[-I ]\n" >=20 > "\t[-S StartupAcmSize>|] [-V ]\n" >=20 > "\t[-U |]\n" >=20 > @@ -366,6 +367,7 @@ Returns: > printf ("\tMicrocodeGuid - Guid of Microcode Module.\n"); >=20 > printf ("\tMicrocodeSlotSize - Occupied region size of each > Microcode binary.\n"); >=20 > printf ("\tMicrocodeFfsGuid - Guid of FFS which is used to = save > Microcode binary"); >=20 > + printf ("\t-LF - Microcode Slot mode without FFS > check, treat all Microcode FV as slot mode. In this case the Microcode = FV > should only contain one FFS.\n"); >=20 > printf ("\t-NA - No 0x800 aligned Microcode > requirement. No -NA means Microcode is aligned with option > MicrocodeAlignment value.\n"); >=20 > printf ("\tMicrocodeAlignment - HEX value of Microcode = alignment. > Ignored if \"-NA\" is specified. Default value is 0x800. The Microcode update > data must start at a 16-byte aligned linear address.\n"); >=20 > printf ("\tRecordType - FIT entry record type. User = should > ensure it is ordered.\n"); >=20 > @@ -882,11 +884,13 @@ Returns: > UINTN FitEntryNumber; >=20 > BOOLEAN BiosInfoExist; >=20 > BOOLEAN SlotMode; >=20 > + BOOLEAN SlotModeForce; >=20 > BIOS_INFO_HEADER *BiosInfo; >=20 > BIOS_INFO_STRUCT *BiosInfoStruct; >=20 > UINTN BiosInfoIndex; >=20 >=20 >=20 > - SlotMode =3D FALSE; >=20 > + SlotMode =3D FALSE; >=20 > + SlotModeForce =3D FALSE; >=20 >=20 >=20 > // >=20 > // Init index >=20 > @@ -1031,7 +1035,9 @@ Returns: > // >=20 > if ((Index + 1 >=3D argc) || >=20 > ((strcmp (argv[Index], "-L") !=3D 0) && >=20 > - (strcmp (argv[Index], "-l") !=3D 0)) ) { >=20 > + (strcmp (argv[Index], "-l") !=3D 0) && >=20 > + (strcmp (argv[Index], "-LF") !=3D 0) && >=20 > + (strcmp (argv[Index], "-lf") !=3D 0))) { >=20 > // >=20 > // Bypass >=20 > // >=20 > @@ -1039,18 +1045,21 @@ Returns: > } else { >=20 > SlotSize =3D xtoi (argv[Index + 1]); >=20 >=20 >=20 > - if (SlotSize =3D=3D 0) { >=20 > - printf ("Invalid slotsize =3D %d\n", SlotSize); >=20 > + if (SlotSize & 0xF) { >=20 > + printf ("Invalid slotsize =3D 0x%x, Microcode data must start = at a > 16-byte aligned linear address!\n", SlotSize); >=20 > return 0; >=20 > } >=20 If SlotSize is zero, is it valid or not? > - >=20 > - SlotMode =3D IsGuidData(argv[Index + 2], &MicrocodeFfsGuid); >=20 > - if (!SlotMode) { >=20 > - printf ("Need a ffs GUID for search uCode ffs\n"); >=20 > - return 0; >=20 > + if (strcmp (argv[Index], "-LF") =3D=3D 0 || strcmp (argv[Index], = "-lf") =3D=3D 0) { >=20 > + SlotModeForce =3D TRUE; >=20 > + Index +=3D 2; >=20 > + } else { >=20 > + SlotMode =3D IsGuidData(argv[Index + 2], &MicrocodeFfsGuid); >=20 > + if (!SlotMode) { >=20 > + printf ("Need a ffs GUID for search uCode ffs\n"); >=20 > + return 0; >=20 > + } >=20 > + Index +=3D 3; >=20 > } >=20 > - >=20 > - Index +=3D 3; >=20 > } >=20 >=20 >=20 > // >=20 > @@ -1219,6 +1228,10 @@ Returns: > gFitTableContext.FitEntryNumber++; >=20 >=20 >=20 > if (SlotSize !=3D 0) { >=20 > + if (SlotSize < MicrocodeSize) { >=20 > + printf ("Parameter incorrect, Slot size: %x is too small > for Microcode size: %x!\n", SlotSize, MicrocodeSize); >=20 > + return 0; >=20 > + } What purpose is for this new check? Thanks Liming >=20 > MicrocodeBuffer +=3D SlotSize; >=20 > } else { >=20 > MicrocodeBuffer +=3D MicrocodeSize; >=20 > @@ -1228,7 +1241,7 @@ Returns: > /// >=20 > /// Check the remaining buffer >=20 > /// >=20 > - if (((UINT32)(MicrocodeBuffer - MicrocodeFileBuffer) < > MicrocodeFileSize) && SlotMode !=3D 0) { >=20 > + if (((UINT32)(MicrocodeBuffer - MicrocodeFileBuffer) < > MicrocodeFileSize) && (SlotMode || SlotModeForce)) { >=20 > for (Walker =3D MicrocodeBuffer; Walker < > MicrocodeFileBuffer + MicrocodeFileSize; Walker++) { >=20 > if (*Walker !=3D 0xFF) { >=20 > printf ("Error: detect non-spare space after uCode > array, please check uCode array!\n"); >=20 > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.h > b/Silicon/Intel/Tools/FitGen/FitGen.h > index 435fc26209da..5add6a8870e9 100644 > --- a/Silicon/Intel/Tools/FitGen/FitGen.h > +++ b/Silicon/Intel/Tools/FitGen/FitGen.h > @@ -31,7 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > // Utility version information >=20 > // >=20 > #define UTILITY_MAJOR_VERSION 0 >=20 > -#define UTILITY_MINOR_VERSION 63 >=20 > +#define UTILITY_MINOR_VERSION 64 >=20 > #define UTILITY_DATE __DATE__ >=20 >=20 >=20 > // >=20 > -- > 2.29.2.windows.2 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#69301): = https://edk2.groups.io/g/devel/message/69301 > Mute This Topic: https://groups.io/mt/79120990/4905953 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [gaoliming@byosoft.com.cn] > -=3D-=3D-=3D-=3D-=3D-=3D >=20