Re: [edk2-devel] Flush on main exit?

2019-10-18 Thread Doran, Mark
I think the ISO C standard is actually the governing spec for exit() now.  
However, it more or less says the same thing as POSIX.1.

I actually recall some of the early input to POSIX discussions about exit() and 
flushing behavior (fflush() got lumped in to the same conversation).  It was 
somewhat of a hot topic with the X/Open work group especially because ICL 
mainframes were "virtual" enough that the meaning of flushing was somewhat in 
question (for files at any rate) when there weren't actual disks to receive the 
flush.

In any case the C standard now seems quite clear to my eye: you ought to get 
your message on standard out or error regardless of newline or not.  That 
should apply as I read the spec whether you have code that does an explicit 
exit() from main(), or a return or even if execution just reaches the closing 
brace on the main() function.  Not knowing anything else, I'd say you are 
seeing a bug in the implementation.

--
Cheers,

Mark.

From: devel@edk2.groups.io  On Behalf Of Tim Lewis
Sent: Friday, October 18, 2019 2:13 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] Flush on main exit?

I have noticed recently, when porting BSD applications, that if main exits 
normally, the buffers are not flushed. This is most obvious when using StdLib 
along with printf or fprintf to stdout.

Has anyone else noticed this? If there is a \n in the output, it gets flushed 
to stdout, but if the string does not contain a \n then often nothing happens. 
This is most obvious with 1-line help or logo strings that never show up. Of 
course, most BSD apps use stderr for their usage, but even this doesn't go 
anywhere

static void
usage(void)
{

   (void)fprintf(stderr, "usage: which [-as] program ...\n");
   exit(EXIT_FAILURE);
}

Per the posix standard:

OpenGroup says:
https://pubs.opengroup.org/onlinepubs/009695399/functions/exit.html

The exit() function shall then flush all open streams with unwritten buffered 
data, close all open streams, and remove all files created by 
tmpfile().
 Finally, control shall be terminated with the consequences described below.

I have seen similar behavior with CURL and printf.

Any thoughts here?

Tim



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49250): https://edk2.groups.io/g/devel/message/49250
Mute This Topic: https://groups.io/mt/35145254/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] Recent changes to EsrtFmp causing ASSERTs

2019-10-18 Thread Michael D Kinney
Devices with FMP instances below version 3 do not support a HardwareInstance so 
they can only support single device for each GUID.  FMP implementations with 
versions below 3 that want to support multiple devices need to use multiple 
GUIDs.

The ASSERT() is still be correct if there are multiple FMP instances with the 
same GUID and their version is below 3 that uses an assumed HardwareInstance of 
0.

Mike

From: devel@edk2.groups.io  On Behalf Of 
scott.wigin...@hpe.com
Sent: Friday, October 18, 2019 2:52 PM
To: Kinney, Michael D ; devel@edk2.groups.io
Subject: Re: [edk2-devel] Recent changes to EsrtFmp causing ASSERTs

Hi Michael,

I'm not sure that I agree with your last statement.  The says that 
HardwareInstance is "Only present in version 3 or higher" in reference to the 
EFI_FIRMWARE_IMAGE_DESCRIPTOR.  Isn't that the point of the DescriptorVersion 
parameter in FMP.GetImageInfo?  To know if that field is event valid or not.  
The function in question even looks at this passed in FW image descriptor 
version (though the parameter is called FmpVersion).  The code just sets it to 
0 if the FmpVersion is < 3.  If one or more devices producing FMPs in the 
system do not support FW image descriptor 3 or later, then this will cause an 
ASSERT.

Thanks,
SWig


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49249): https://edk2.groups.io/g/devel/message/49249
Mute This Topic: https://groups.io/mt/34350126/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] Flush on main exit?

2019-10-18 Thread Tim Lewis
I have noticed recently, when porting BSD applications, that if main exits
normally, the buffers are not flushed. This is most obvious when using
StdLib along with printf or fprintf to stdout.

 

Has anyone else noticed this? If there is a \n in the output, it gets
flushed to stdout, but if the string does not contain a \n then often
nothing happens. This is most obvious with 1-line help or logo strings that
never show up. Of course, most BSD apps use stderr for their usage, but even
this doesn't go anywhere

 

static void

usage(void)

{

 

   (void)fprintf(stderr, "usage: which [-as] program ...\n");

   exit(EXIT_FAILURE);

}

 

Per the posix standard:

 

OpenGroup says:

https://pubs.opengroup.org/onlinepubs/009695399/functions/exit.html

 

The exit() function shall then flush all open streams with unwritten
buffered data, close all open streams, and remove all files created by

tmpfile(). Finally, control shall be terminated with the consequences
described below.

 

I have seen similar behavior with CURL and printf. 

 

Any thoughts here?

 

Tim

 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49247): https://edk2.groups.io/g/devel/message/49247
Mute This Topic: https://groups.io/mt/35145254/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch] MdePkg: Add UefiFileHandleLib to DSC file

2019-10-18 Thread Michael D Kinney
From: Sean Brogan 

https://bugzilla.tianocore.org/show_bug.cgi?id=2261

Add the UefiFileHandleLib to the [Components] section of the
MdePkg DSC file to support full build testing of the MdePkg.

Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
---
 MdePkg/MdePkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index a2ff12fe75..c1278e7907 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -27,6 +27,7 @@ [PcdsFixedAtBuild]
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000
 
 [Components]
+  MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
   MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
   MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
   MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49246): https://edk2.groups.io/g/devel/message/49246
Mute This Topic: https://groups.io/mt/35114289/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch] FmpDevicePkg: Fix spelling errors

2019-10-18 Thread Michael D Kinney
From: Sean Brogan 

https://bugzilla.tianocore.org/show_bug.cgi?id=2262

Cc: Liming Gao 
Cc: Michael D Kinney 
Signed-off-by: Michael D Kinney 
---
 .../CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c  |  4 ++--
 .../CapsuleUpdatePolicyDxe.inf   |  2 +-
 FmpDevicePkg/FmpDevicePkg.dec|  4 ++--
 FmpDevicePkg/FmpDevicePkg.dsc|  2 +-
 FmpDevicePkg/FmpDevicePkg.uni|  2 +-
 FmpDevicePkg/FmpDxe/FmpDxe.c | 12 ++--
 FmpDevicePkg/Include/Library/FmpDeviceLib.h  |  4 ++--
 .../CapsuleUpdatePolicyLibOnProtocol.c   |  2 +-
 .../CapsuleUpdatePolicyLibOnProtocol.inf |  2 +-
 FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c |  4 ++--
 .../PrivateInclude/Protocol/CapsuleUpdatePolicy.h|  2 +-
 11 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c 
b/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c
index d2571fd0e6..1035fd67dd 100644
--- a/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c
+++ b/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c
@@ -161,10 +161,10 @@ CapsuleUpdatePolicyInitialize (
 {
   EFI_STATUS Status;
 
-  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, 
);
+  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, 
);
   Status = gBS->InstallMultipleProtocolInterfaces (
   ,
-  , ,
+  , 
,
   NULL
   );
   ASSERT_EFI_ERROR (Status);
diff --git a/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf 
b/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf
index d168780eb9..5ed7086b91 100644
--- a/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf
+++ b/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf
@@ -39,7 +39,7 @@ [LibraryClasses]
   CapsuleUpdatePolicyLib
 
 [Protocols]
-  gEdkiiCapuleUpdatePolicyProtocolGuid  ## PRODUCES
+  gEdkiiCapsuleUpdatePolicyProtocolGuid  ## PRODUCES
 
 [Depex]
   TRUE
diff --git a/FmpDevicePkg/FmpDevicePkg.dec b/FmpDevicePkg/FmpDevicePkg.dec
index 8312b7cb22..55671878dd 100644
--- a/FmpDevicePkg/FmpDevicePkg.dec
+++ b/FmpDevicePkg/FmpDevicePkg.dec
@@ -50,12 +50,12 @@ [Guids]
 
 [Protocols.Common.Private]
   ## Capsule Update Policy Protocol
-  gEdkiiCapuleUpdatePolicyProtocolGuid = { 0x487784c5, 0x6299, 0x4ba6, { 0xb0, 
0x96, 0x5c, 0xc5, 0x27, 0x7c, 0xf7, 0x57 } }
+  gEdkiiCapsuleUpdatePolicyProtocolGuid = { 0x487784c5, 0x6299, 0x4ba6, { 
0xb0, 0x96, 0x5c, 0xc5, 0x27, 0x7c, 0xf7, 0x57 } }
 
 [PcdsFeatureFlag]
   ## Indicates if the Firmware Management Protocol supports access to
   #  to a firmware storage device.  If set to FALSE, then only GetImageInfo()
-  #  is supported.  This is used by FMP drivers that require the samllest
+  #  is supported.  This is used by FMP drivers that require the smallest
   #  possible Firmware Management Protocol implementation that supports
   #  advertising the updatable firmware device in the ESRT.
   #TRUE  - All Firmware Management Protocol services supported.
diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc
index bf283b93ea..67b5aa7a32 100644
--- a/FmpDevicePkg/FmpDevicePkg.dsc
+++ b/FmpDevicePkg/FmpDevicePkg.dsc
@@ -60,7 +60,7 @@ [LibraryClasses]
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #
   # It is not possible to prevent the ARM compiler for generic intrinsic 
functions.
-  # This library provides the instrinsic functions generate by a given 
compiler.
+  # This library provides the intrinsic functions generate by a given compiler.
   # [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this 
library
   # into all ARM and AARCH64 images.
   #
diff --git a/FmpDevicePkg/FmpDevicePkg.uni b/FmpDevicePkg/FmpDevicePkg.uni
index 9e21130fae..263f88078b 100644
--- a/FmpDevicePkg/FmpDevicePkg.uni
+++ b/FmpDevicePkg/FmpDevicePkg.uni
@@ -19,7 +19,7 @@
 #string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceStorageAccessEnable_PROMPT 
 #language en-US "Firmware Device Storage Access Enabled."
 #string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceStorageAccessEnable_HELP   
 #language en-US "Indicates if the Firmware Management Protocol supports access 
to"

 "to a firmware storage device.  If set to FALSE, then only 
GetImageInfo()"
-   
 "is supported.  This is used by FMP drivers that require the 
samllest"
+   
 "is supported.  This is used by FMP drivers that require the 
smallest"

 "possible Firmware Management Protocol implementation that 
supports"

[edk2-devel] [Patch] PcAtChipsetPkg: Fix spelling errors

2019-10-18 Thread Michael D Kinney
From: Sean Brogan 

https://bugzilla.tianocore.org/show_bug.cgi?id=2263

Cc: Ray Ni 
Signed-off-by: Michael D Kinney 
---
 PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c  | 12 ++--
 PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf |  2 +-
 PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.uni |  2 +-
 PcAtChipsetPkg/Include/Library/IoApicLib.h   |  2 +-
 PcAtChipsetPkg/Include/Register/Hpet.h   |  6 +++---
 PcAtChipsetPkg/Library/BaseIoApicLib/IoApicLib.c |  2 +-
 PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c   |  8 
 PcAtChipsetPkg/PcAtChipsetPkg.dec|  2 +-
 PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c   |  4 ++--
 PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h   |  8 
 .../PcatRealTimeClockRuntimeDxe/PcRtcEntry.c |  2 +-
 11 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c 
b/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c
index ded3b53619..cbe986ebfd 100644
--- a/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c
+++ b/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c
@@ -1,5 +1,5 @@
 /** @file
-  Timer Architectural Protocol module using High Precesion Event Timer (HPET)
+  Timer Architectural Protocol module using High Precision Event Timer (HPET)
 
   Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -246,7 +246,7 @@ HpetRead (
 /**
   Write a 64-bit HPET register.
 
-  @param  Offset  Specifies the ofsfert of the HPET register to write.
+  @param  Offset  Specifies the offset of the HPET register to write.
   @param  Value   Specifies the value to write to the HPET register specified 
by Offset.
 
   @return  The 64-bit value written to HPET register specified by Offset.
@@ -530,7 +530,7 @@ TimerDriverSetTimerPeriod (
 // If TimerPeriod is 0, then mask HPET Timer interrupts
 //
 
-if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0 && FeaturePcdGet 
(PcdHpetMsiEnable)) {
+if (mTimerConfiguration.Bits.MsiInterruptCapability != 0 && FeaturePcdGet 
(PcdHpetMsiEnable)) {
   //
   // Disable HPET MSI interrupt generation
   //
@@ -576,7 +576,7 @@ TimerDriverSetTimerPeriod (
 //
 // Enable HPET Timer interrupt generation
 //
-if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0 && FeaturePcdGet 
(PcdHpetMsiEnable)) {
+if (mTimerConfiguration.Bits.MsiInterruptCapability != 0 && FeaturePcdGet 
(PcdHpetMsiEnable)) {
   //
   // Program MSI Address and MSI Data values in the selected HPET Timer
   // Program HPET register with APIC ID of current BSP in case BSP has 
been switched
@@ -834,7 +834,7 @@ TimerDriverInitialize (
 //
 // Check to see if this HPET Timer supports MSI
 //
-if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0) {
+if (mTimerConfiguration.Bits.MsiInterruptCapability != 0) {
   //
   // Save the index of the first HPET Timer that supports MSI interrupts
   //
@@ -959,7 +959,7 @@ TimerDriverInitialize (
   // Show state of enabled HPET timer
   //
   DEBUG_CODE (
-if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0 && FeaturePcdGet 
(PcdHpetMsiEnable)) {
+if (mTimerConfiguration.Bits.MsiInterruptCapability != 0 && FeaturePcdGet 
(PcdHpetMsiEnable)) {
   DEBUG ((DEBUG_INFO, "HPET Interrupt Mode MSI\n"));
 } else {
   DEBUG ((DEBUG_INFO, "HPET Interrupt Mode I/O APIC\n"));
diff --git a/PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf 
b/PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
index ba2e075118..125eea0aab 100644
--- a/PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
+++ b/PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
@@ -1,5 +1,5 @@
 ## @file
-# Timer Architectural Protocol module using High Precesion Event Timer (HPET).
+# Timer Architectural Protocol module using High Precision Event Timer (HPET).
 #
 # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
diff --git a/PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.uni 
b/PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.uni
index e2320653b6..7d1797b1df 100644
--- a/PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.uni
+++ b/PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.uni
@@ -1,5 +1,5 @@
 // /** @file
-// Timer Architectural Protocol module using High Precesion Event Timer (HPET).
+// Timer Architectural Protocol module using High Precision Event Timer (HPET).
 //
 // Timer Architectural Protocol module using High Precision Event Timer (HPET).
 //
diff --git a/PcAtChipsetPkg/Include/Library/IoApicLib.h 
b/PcAtChipsetPkg/Include/Library/IoApicLib.h
index 200ef731fb..4ee092c0f2 100644
--- a/PcAtChipsetPkg/Include/Library/IoApicLib.h
+++ b/PcAtChipsetPkg/Include/Library/IoApicLib.h
@@ -63,7 +63,7 @@ IoApicEnableInterrupt (
   Configures an I/O APIC interrupt.
 
   Configure an I/O APIC Redirection Table Entry to deliver an interrupt in 
physical
-  mode to the Local APIC of the currntly executing CPU.  

[edk2-devel] [Patch] FatPkg: Fix spelling errors

2019-10-18 Thread Michael D Kinney
From: Sean Brogan 

https://bugzilla.tianocore.org/show_bug.cgi?id=2264

Cc: Ray Ni 
Signed-off-by: Michael D Kinney 
---
 FatPkg/EnhancedFatDxe/DirectoryManage.c |  8 
 FatPkg/EnhancedFatDxe/DiskCache.c   |  2 +-
 FatPkg/EnhancedFatDxe/Fat.h | 20 ++--
 FatPkg/EnhancedFatDxe/FileName.c|  2 +-
 FatPkg/EnhancedFatDxe/FileSpace.c   |  6 +++---
 FatPkg/EnhancedFatDxe/Info.c|  2 +-
 FatPkg/EnhancedFatDxe/Init.c|  2 +-
 FatPkg/EnhancedFatDxe/Misc.c|  6 +++---
 FatPkg/EnhancedFatDxe/Open.c|  2 +-
 FatPkg/FatPei/FatLiteApi.c  |  6 +++---
 FatPkg/FatPei/FatLitePeim.h |  4 ++--
 FatPkg/FatPei/Gpt.c |  2 +-
 FatPkg/FatPei/Mbr.c |  2 +-
 13 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/FatPkg/EnhancedFatDxe/DirectoryManage.c 
b/FatPkg/EnhancedFatDxe/DirectoryManage.c
index 21656883bd..93772dba09 100644
--- a/FatPkg/EnhancedFatDxe/DirectoryManage.c
+++ b/FatPkg/EnhancedFatDxe/DirectoryManage.c
@@ -17,7 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
   @param  EntryPos  - The position of the directory entry to be 
accessed.
   @param  Entry - The directory entry read or written.
 
-  @retval EFI_SUCCESS   - Access the directory entry sucessfully.
+  @retval EFI_SUCCESS   - Access the directory entry successfully.
   @return other - An error occurred when reading the directory 
entry.
 
 **/
@@ -896,7 +896,7 @@ FatNewEntryPos (
   @param  Volume- FAT file system volume.
   @param  Name  - The file name of the volume.
 
-  @retval EFI_SUCCESS   - Update the volume with the directory entry 
sucessfully.
+  @retval EFI_SUCCESS   - Update the volume with the directory entry 
successfully.
   @return others- An error occurred when getting volume label.
 
 **/
@@ -927,7 +927,7 @@ FatGetVolumeEntry (
   @param  Volume  - FAT file system volume.
   @param  Name- The new file name of the volume.
 
-  @retval EFI_SUCCESS - Update the Volume sucessfully.
+  @retval EFI_SUCCESS - Update the Volume successfully.
   @retval EFI_UNSUPPORTED - The input label is not a valid volume label.
   @return other   - An error occurred when setting volume label.
 
@@ -1246,7 +1246,7 @@ FatCloseDirEnt (
   not be created either).
   @retval EFI_INVALID_PARAMETER - The parameter is not valid.
   @retval EFI_SUCCESS   - Open the file successfully.
-  @return other - An error occured when locating the OFile.
+  @return other - An error occurred when locating the OFile.
 
 **/
 EFI_STATUS
diff --git a/FatPkg/EnhancedFatDxe/DiskCache.c 
b/FatPkg/EnhancedFatDxe/DiskCache.c
index 2df0aa09f1..df587810fb 100644
--- a/FatPkg/EnhancedFatDxe/DiskCache.c
+++ b/FatPkg/EnhancedFatDxe/DiskCache.c
@@ -16,7 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
   are older than the contents in disk, so they are invalid; just mark them 
invalid.
 
   When this function is called by read command, if any entry in this range
-  is dirty, it means that the relative info directly readed from media is 
older than
+  is dirty, it means that the relative info directly read from media is older 
than
   than the info in the cache; So need to update the relative info in the 
Buffer.
 
   @param  Volume- FAT file system volume.
diff --git a/FatPkg/EnhancedFatDxe/Fat.h b/FatPkg/EnhancedFatDxe/Fat.h
index 98ead5a0fb..46c185c3a9 100644
--- a/FatPkg/EnhancedFatDxe/Fat.h
+++ b/FatPkg/EnhancedFatDxe/Fat.h
@@ -865,7 +865,7 @@ FatCleanupVolume (
 
   @param  OFile - The open file.
 
-  @retval EFI_SUCCESS   - Shrinked sucessfully.
+  @retval EFI_SUCCESS   - Shrinked successfully.
   @retval EFI_VOLUME_CORRUPTED  - There are errors in the file's clusters.
 
 **/
@@ -881,7 +881,7 @@ FatShrinkEof (
   @param  OFile - The open file.
   @param  NewSizeInBytes- The new size in bytes of the open file.
 
-  @retval EFI_SUCCESS   - The file is grown sucessfully.
+  @retval EFI_SUCCESS   - The file is grown successfully.
   @retval EFI_UNSUPPORTED   - The file size is larger than 4GB.
   @retval EFI_VOLUME_CORRUPTED  - There are errors in the files' clusters.
   @retval EFI_VOLUME_FULL   - The volume is full and can not grow the file.
@@ -969,7 +969,7 @@ FatComputeFreeInfo (
   @param  Handle- The handle of parent device.
   @param  DiskIo- The DiskIo of parent device.
   @param  DiskIo2   - The DiskIo2 of parent device.
-  @param  BlockIo   - The BlockIo of parent devicel
+  @param  BlockIo   - The BlockIo of parent device.
 
   @retval EFI_SUCCESS   - Allocate a new volume successfully.
   

[edk2-devel] [Patch] SecurityPkg: Fix spelling errors

2019-10-18 Thread Michael D Kinney
From: Sean Brogan 

https://bugzilla.tianocore.org/show_bug.cgi?id=2265

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Chao Zhang 
Signed-off-by: Michael D Kinney 
---
 SecurityPkg/FvReportPei/FvReportPei.c |  4 ++--
 SecurityPkg/Hash2DxeCrypto/Driver.c   |  6 ++---
 SecurityPkg/Hash2DxeCrypto/Driver.h   |  4 ++--
 SecurityPkg/HddPassword/HddPasswordDxe.c  | 10 
 SecurityPkg/HddPassword/HddPasswordDxe.h  |  2 +-
 .../HddPassword/HddPasswordStrings.uni|  2 +-
 .../Guid/AuthenticatedVariableFormat.h|  2 +-
 .../Include/Library/Tcg2PhysicalPresenceLib.h |  4 ++--
 .../Include/Library/TcgStorageCoreLib.h   | 12 +-
 SecurityPkg/Include/Library/Tpm2CommandLib.h  |  2 +-
 SecurityPkg/Include/Library/TpmCommLib.h  |  2 +-
 .../Ppi/FirmwareVolumeInfoPrehashedFV.h   |  4 ++--
 .../Library/AuthVariableLib/AuthService.c |  4 ++--
 .../AuthVariableLib/AuthServiceInternal.h |  2 +-
 .../Library/AuthVariableLib/AuthVariableLib.c |  4 ++--
 .../DxeImageAuthenticationStatusLib.c |  2 +-
 .../DxeImageVerificationLib.c | 10 
 .../DxeRsa2048Sha256GuidedSectionExtractLib.c |  4 ++--
 ...xeRsa2048Sha256GuidedSectionExtractLib.inf |  2 +-
 ...xeRsa2048Sha256GuidedSectionExtractLib.uni |  2 +-
 .../DxeTpm2MeasureBootLib.c   |  4 ++--
 .../DxeTpmMeasureBootLib.c|  4 ++--
 .../DxeTpmMeasurementLib.c|  2 +-
 .../HashInstanceLibSha1/HashInstanceLibSha1.c |  2 +-
 .../HashInstanceLibSha256.c   |  2 +-
 .../HashInstanceLibSha384.c   |  2 +-
 .../HashInstanceLibSha512.c   |  2 +-
 SecurityPkg/Library/HashLibTpm2/HashLibTpm2.c |  2 +-
 .../PeiRsa2048Sha256GuidedSectionExtractLib.c |  4 ++--
 ...eiRsa2048Sha256GuidedSectionExtractLib.inf |  2 +-
 ...eiRsa2048Sha256GuidedSectionExtractLib.uni |  2 +-
 .../TcgStorageCoreLib/TcgStorageCore.c| 10 
 .../TcgStorageCoreLib/TcgStorageUtil.c|  2 +-
 .../TcgStorageOpalLib/TcgStorageOpalUtil.c|  6 ++---
 .../Library/Tpm12CommandLib/Tpm12NvStorage.c  |  2 +-
 .../Library/Tpm12DeviceLibDTpm/Tpm12Tis.c |  2 +-
 .../Library/Tpm2CommandLib/Tpm2Capability.c   |  4 ++--
 .../Library/Tpm2CommandLib/Tpm2Hierarchy.c|  2 +-
 .../Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c |  2 +-
 .../Tpm2DeviceLibDTpm/Tpm2InstanceLibDTpm.c   |  2 +-
 .../Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c   |  4 ++--
 .../Library/Tpm2DeviceLibDTpm/Tpm2Tis.c   |  4 ++--
 SecurityPkg/Library/TpmCommLib/CommonHeader.h |  2 +-
 SecurityPkg/Library/TpmCommLib/TisPc.c|  2 +-
 .../Pkcs7VerifyDxe/Pkcs7VerifyDxe.c   | 18 +++---
 .../RandomNumberGenerator/RngDxe/RdRand.c |  2 +-
 SecurityPkg/SecurityPkg.dec   | 18 +++---
 SecurityPkg/SecurityPkg.dsc   |  2 +-
 SecurityPkg/SecurityPkg.uni   | 12 +-
 .../Tcg/MemoryOverwriteControl/TcgMor.c   |  6 ++---
 .../Tcg/MemoryOverwriteControl/TcgMor.inf |  2 +-
 .../Tcg/MemoryOverwriteControl/TcgMor.uni |  2 +-
 .../TcgMorLock.c  |  4 ++--
 .../TcgMorLock.h  |  2 +-
 .../TcgMorLock.uni|  4 ++--
 .../TcgMorLockSmm.inf |  2 +-
 .../Tcg/Opal/OpalPassword/OpalDriver.c|  6 ++---
 .../Tcg/Opal/OpalPassword/OpalDriver.h|  6 ++---
 SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c   | 10 
 SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.h   |  8 +++
 .../PhysicalPresencePei/PhysicalPresencePei.c |  2 +-
 SecurityPkg/Tcg/Tcg2Config/Tcg2Config.vfr |  6 ++---
 SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c |  2 +-
 SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c   |  4 ++--
 SecurityPkg/Tcg/Tcg2Dxe/MeasureBootPeCoff.c   |  2 +-
 SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c |  2 +-
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 16 ++---
 SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 22 -
 SecurityPkg/Tcg/Tcg2Smm/Tpm.asl   |  6 ++---
 .../Tcg/TcgConfigDxe/TcgConfigDriver.c|  2 +-
 SecurityPkg/Tcg/TcgDxe/TcgDxe.c   |  6 ++---
 SecurityPkg/Tcg/TcgPei/TcgPei.c   | 18 +++---
 SecurityPkg/Tcg/TcgSmm/Tpm.asl|  6 ++---
 .../SecureBootConfigDriver.c  |  2 +-
 .../SecureBootConfigDxe.inf   |  2 +-
 .../SecureBootConfigDxe.uni   |  2 +-
 .../SecureBootConfigImpl.c| 24 +--
 .../SecureBootConfigImpl.h| 10 
 .../SecureBootConfigMisc.c|  8 +++
 .../SecureBootConfigNvData.h  |  4 ++--
 .../SecureBootConfigStrings.uni   |  4 ++--
 81 files changed, 205 insertions(+), 205 deletions(-)

diff --git a/SecurityPkg/FvReportPei/FvReportPei.c 
b/SecurityPkg/FvReportPei/FvReportPei.c
index d24470af6b..d709760ea3 100644

[edk2-devel] [v8 v8] IntelSiliconPkg-Vtd: A new PMR interface

2019-10-18 Thread Evelyn Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1770

1) IOMMU PMR feature should be generic to support different hardware
architecture. Platforms may request no overlap between PMR regions
and system reserve memory. Create an interface to publish PLMR/PHMR
regions. It allows silicon code to adjust PLMR/PHMR region base on
the project needs.

2) A new GetVtdPmrAlignmentLib for silicon code to get
PMR alignment values.

Signed-off-by: Evelyn Wang 
Cc: Jenny Huang 
Cc: More Shih 
Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Jiewen Yao 

---
In V2:
1) Fixed the EFIAPI is missing in library API issue
2) Logs will be provided to make sure the backwards compatibility
3) Replaced BIT0 with EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL
4) Renamed GetVtdPmrAlignmentLib to PeiGetVtdPmrAlignmentLib
5) Fixed the indent in IntelVTdPmrPei.c
6) Follow VTd spec to define the data type of the SYSTEM_MEM_INFO_HOB
   Applied few changes coordinately

---
In V3:
1) Fixed the EFIAPI is missing in library API issue
2) Fixed the S3 resume assert

---
In V4:
Fixed the missing EFIAPI in .h file and added few more comments

---
In V5:
In order to align with the future planning,
changed the hob name from SYSTEM_MEM_INFO_HOB to VTD_PMR_INFO_HOB

---
In V6:
1) Revised comments
2) Moved VtdPmrInfoHob.h under Guid folder
3) Separated to few commits

---
In V7:
1) Only the functions declared in library header file should have EFIAPI
2) Added a few comments to avoid confusion
3) Fixed a case error

---
In V8:
1) Fixed a typo and commit message
---
 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c 
 |   4 ++--
 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c  
 |  84 
+---
 
Silicon/Intel/IntelSiliconPkg/Library/PeiGetVtdPmrAlignmentLib/PeiGetVtdPmrAlignmentLib.c
   | 164 

 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf
 |   5 -
 Silicon/Intel/IntelSiliconPkg/Include/Guid/VtdPmrInfoHob.h 
 |  29 +
 Silicon/Intel/IntelSiliconPkg/Include/Library/PeiGetVtdPmrAlignmentLib.h   
 |  22 ++
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec  
 |  11 +--
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc  
 |   3 ++-
 
Silicon/Intel/IntelSiliconPkg/Library/PeiGetVtdPmrAlignmentLib/PeiGetVtdPmrAlignmentLib.inf
 |  32 
 9 files changed, 325 insertions(+), 29 deletions(-)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c
index 37283f0fab..9103e53922 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -294,7 +294,7 @@ SetDmaProtectedRange (
   UINTN   Index;
   EFI_STATUS  Status;
 
-  DEBUG ((DEBUG_INFO, "SetDmaProtectedRange(0x%lx) - [0x%x, 0x%x] [0x%lx, 
0x%lx]\n", EngineMask, LowMemoryBase, LowMemoryLength, HighMemoryBase, 
HighMemoryLength));
+  DEBUG ((DEBUG_INFO, "SetDmaProtectedRange(0x%lx) - [0x%x, 0x%x] [0x%016lx, 
0x%016lx]\n", EngineMask, LowMemoryBase, LowMemoryLength, HighMemoryBase, 
HighMemoryLength));
 
   for (Index = 0; Index < VTdInfo->VTdEngineCount; Index++) {
 if ((EngineMask & LShiftU64(1, Index)) == 0) {
diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
index ca099ed71d..ea944aa40c 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -20,7 +20,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include "IntelVTdPmrPei.h"
 
 EFI_GUID mVTdInfoGuid = {
@@ -424,37 +424,79 @@ InitDmaProtection (
   UINTN   MemoryAlignment;
   UINTN   LowBottom;
   UINTN   LowTop;
-  UINTN   HighBottom;
+  UINT64  HighBottom;
   UINT64  HighTop;
   DMA_BUFFER_INFO   

[edk2-devel] [v9 v9] IntelSiliconPkg-Vtd: A new PMR interface

2019-10-18 Thread Evelyn Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1770

1) IOMMU PMR feature should be generic to support different hardware
architecture. Platforms may request no overlap between PMR regions
and system reserve memory. Create an interface to publish PLMR/PHMR
regions. It allows silicon code to adjust PLMR/PHMR region base on
the project needs.

2) A new GetVtdPmrAlignmentLib for silicon code to get
PMR alignment values.

Signed-off-by: Evelyn Wang 
Cc: Jenny Huang 
Cc: More Shih 
Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Jiewen Yao 

---
In V2:
1) Fixed the EFIAPI is missing in library API issue
2) Logs will be provided to make sure the backwards compatibility
3) Replaced BIT0 with EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL
4) Renamed GetVtdPmrAlignmentLib to PeiGetVtdPmrAlignmentLib
5) Fixed the indent in IntelVTdPmrPei.c
6) Follow VTd spec to define the data type of the SYSTEM_MEM_INFO_HOB
   Applied few changes coordinately

---
In V3:
1) Fixed the EFIAPI is missing in library API issue
2) Fixed the S3 resume assert

---
In V4:
Fixed the missing EFIAPI in .h file and added few more comments

---
In V5:
In order to align with the future planning,
changed the hob name from SYSTEM_MEM_INFO_HOB to VTD_PMR_INFO_HOB

---
In V6:
1) Revised comments
2) Moved VtdPmrInfoHob.h under Guid folder
3) Separated to few commits

---
In V7:
1) Only the functions declared in library header file should have EFIAPI
2) Added a few comments to avoid confusion
3) Fixed a case error

---
In V8:
1) Fixed a typo and commit message

---
In V9:
1) Fixed a typo and articles
---
 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c 
 |   4 ++--
 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c  
 |  84 
+---
 
Silicon/Intel/IntelSiliconPkg/Library/PeiGetVtdPmrAlignmentLib/PeiGetVtdPmrAlignmentLib.c
   | 164 

 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf
 |   5 -
 Silicon/Intel/IntelSiliconPkg/Include/Guid/VtdPmrInfoHob.h 
 |  29 +
 Silicon/Intel/IntelSiliconPkg/Include/Library/PeiGetVtdPmrAlignmentLib.h   
 |  22 ++
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec  
 |  11 +--
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc  
 |   3 ++-
 
Silicon/Intel/IntelSiliconPkg/Library/PeiGetVtdPmrAlignmentLib/PeiGetVtdPmrAlignmentLib.inf
 |  32 
 9 files changed, 325 insertions(+), 29 deletions(-)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c
index 37283f0fab..9103e53922 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -294,7 +294,7 @@ SetDmaProtectedRange (
   UINTN   Index;
   EFI_STATUS  Status;
 
-  DEBUG ((DEBUG_INFO, "SetDmaProtectedRange(0x%lx) - [0x%x, 0x%x] [0x%lx, 
0x%lx]\n", EngineMask, LowMemoryBase, LowMemoryLength, HighMemoryBase, 
HighMemoryLength));
+  DEBUG ((DEBUG_INFO, "SetDmaProtectedRange(0x%lx) - [0x%x, 0x%x] [0x%016lx, 
0x%016lx]\n", EngineMask, LowMemoryBase, LowMemoryLength, HighMemoryBase, 
HighMemoryLength));
 
   for (Index = 0; Index < VTdInfo->VTdEngineCount; Index++) {
 if ((EngineMask & LShiftU64(1, Index)) == 0) {
diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
index ca099ed71d..ea944aa40c 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -20,7 +20,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include "IntelVTdPmrPei.h"
 
 EFI_GUID mVTdInfoGuid = {
@@ -424,37 +424,79 @@ InitDmaProtection (
   UINTN   MemoryAlignment;
   UINTN   LowBottom;
   UINTN   LowTop;
-  UINTN   HighBottom;
+  UINT64  HighBottom;
   UINT64   

Re: [edk2-devel] [edk2-platforms][PATCH v2 1/1] Platform/RPi3: Add TFTP command to UEFI Shell

2019-10-18 Thread Leif Lindholm
On Fri, Oct 18, 2019 at 04:05:59PM +0200, Philippe Mathieu-Daudé wrote:
> On 10/18/19 3:25 PM, Pete Batard wrote:
> > On 2019.10.18 13:52, Leif Lindholm wrote:
> > > On Fri, Oct 18, 2019 at 01:41:30PM +0100, Pete Batard wrote:
> > > > TFTP support, which is enabled by default, can be disabled by setting
> > > > INCLUDE_TFTP_COMMAND to FALSE.
> > > 
> > > Would you be OK with flipping the default to FALSE?
> > 
> > Yes, I have no issue with a default set to FALSE.
> > 
> > > It is a custom extension not described by the UEFI Shell
> > > Specification.
> > > 
> > > I could flip the logic in the DEFINE and commit message if so, no need
> > > for a v3.
> > 
> > If you can do that, that would be great. Thanks!
> 
> Reviewed-by: Philippe Mathieu-Daude 

Thanks.
Reviewed-by: Leif Lindholm 
Pushed as f8c5d83e0042.

> > 
> > /Pete
> > 
> > > 
> > > Regards,
> > > 
> > > Leif
> > > 
> > > > Signed-off-by: Pete Batard 
> > > > ---
> > > >   Platform/RaspberryPi/RPi3/RPi3.dsc | 8 
> > > >   Platform/RaspberryPi/RPi3/RPi3.fdf | 3 +++
> > > >   2 files changed, 11 insertions(+)
> > > > 
> > > > diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc
> > > > b/Platform/RaspberryPi/RPi3/RPi3.dsc
> > > > index bc424a06bb45..2289ad8c2ed2 100644
> > > > --- a/Platform/RaspberryPi/RPi3/RPi3.dsc
> > > > +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc
> > > > @@ -36,6 +36,7 @@ [Defines]
> > > >     # -D FLAG=VALUE
> > > >     #
> > > >     DEFINE SECURE_BOOT_ENABLE  = FALSE
> > > > +  DEFINE INCLUDE_TFTP_COMMAND    = TRUE
> > > >     DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x804F
> > > >
> > > > 
> > > > 
> > > > @@ -181,6 +182,10 @@ [LibraryClasses.common.DXE_DRIVER]
> > > >  
> > > > SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
> > > > 
> > > >  
> > > > PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
> > > > 
> > > >  
> > > > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
> > > > 
> > > > +!if $(INCLUDE_TFTP_COMMAND) == TRUE
> > > > +  ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> > > > +  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
> > > > +!endif
> > > >   [LibraryClasses.common.UEFI_APPLICATION]
> > > >  
> > > > PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
> > > > 
> > > > @@ -616,3 +621,6 @@ [Components.common]
> > > >     gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
> > > >     gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20
> > > >     }
> > > > +!if $(INCLUDE_TFTP_COMMAND) == TRUE
> > > > +  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
> > > > +!endif
> > > > diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf
> > > > b/Platform/RaspberryPi/RPi3/RPi3.fdf
> > > > index 17c0094ac1cf..b06a15fb8ec3 100644
> > > > --- a/Platform/RaspberryPi/RPi3/RPi3.fdf
> > > > +++ b/Platform/RaspberryPi/RPi3/RPi3.fdf
> > > > @@ -232,6 +232,9 @@ [FV.FvMain]
> > > >     # UEFI application (Shell Embedded Boot Loader)
> > > >     #
> > > >     INF ShellPkg/Application/Shell/Shell.inf
> > > > +!if $(INCLUDE_TFTP_COMMAND) == TRUE
> > > > +  INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
> > > > +!endif
> > > >     #
> > > >     # ACPI Support
> > > > -- 
> > > > 2.21.0.windows.1
> > > > 
> > 
> > 
> > 
> > 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49239): https://edk2.groups.io/g/devel/message/49239
Mute This Topic: https://groups.io/mt/35014112/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch v3 10/11] EmulatorPkg: Enable CLANG9 tool chain

2019-10-18 Thread Liming Gao
Andrew:
 Here is the cover letter on CLANG9 introduction. 
https://edk2.groups.io/g/devel/message/49157


1)  Yes. CLANG9 tool chain is added to directly generate PE/COFF image (EFI 
image).
This tool chain uses LLVM clang C compiler and lld linker, generates PE/COFF
image and PDB compatible debug symbol format. Now, it supports IA32/X64 Archs.

LLVM clang C compiler and lld linker are the standalone tool set. They don't 
depend other lib to generate PE/COFF image.


2)  Yes. CLANG9 is the cross OS tool chain. It can work on 
Windows/Linux/Mac host OS.

LLVM LLD linker uses Windows style arguments. I verify CLANG9 for Ovmf3264 in 
Windows/Linux host OS.


3) This patch enables WinHost in Windows. It doesn't enable UnixHost. Now, 
EmulatorPkg with CLANG9 only works on Windows Host.

This patch can make other modules pass build in Windows/Linux/Mac only if LLVM9 
tool set is installed.

But, the generated image may not work on Linux/Mac. I agree below linker flags 
are specific to windows host.

So, I suggest to add the conditional statement of $(WIN_HOST_BUILD) == TRUE for 
them.

!if $(WIN_HOST_BUILD) == TRUE
  GCC:*_CLANG9_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096 
/SUBSYSTEM:CONSOLE
  GCC:DEBUG_CLANG9_*_DLINK_FLAGS = 
/EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x1
  GCC:NOOPT_CLANG9_*_DLINK_FLAGS = 
/EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x1
!endif

Thanks
Liming
From: af...@apple.com 
Sent: Friday, October 18, 2019 1:15 AM
To: Ni, Ray 
Cc: Gao, Liming ; devel@edk2.groups.io; Justen, Jordan L 

Subject: Re: [Patch v3 10/11] EmulatorPkg: Enable CLANG9 tool chain

Ray,

Sorry I'm coming a little late to this and I'm confused. I have some questions?
1) Does CLANG9 imply CLANGPE?
2) Does CLANGPE work on Linux and macOS? Can you pass the Windows style 
arguments to CLANGPE linker on Linux and macOS?
3) For the EmulatorPkg don't you have the extra requirement that compiler needs 
a standard C lib (or platform specific libs) to function?
   a) GCC:*_CLANG9_*_DLINK_FLAGS in EmulatorPkg.dsc seems to imply the 
Linux and macOS systems will have a Windows SKD dir and a lot of Windows DLLs? 
Does all that come when you install CLANG9 when you install it on Linux or 
macOS?


So I guess I'm asking is the linker really the same for CLANG9 on all systems? 
I guess the answer could be yes, but it seems the C lib for the Host App is 
still an App for that OS and is OS dependent?


Sorry if I'm missing something fundamental and this is a dumb question.


Thanks,


Andrew Fish





On Oct 17, 2019, at 12:27 AM, Ni, Ray 
mailto:ray...@intel.com>> wrote:

Liming,
Emulator is using a generic SEC module. The host specific module is called 
"Host".
So I prefer to change the macro to "WIN_HOST_BUILD", with this change, 
Reviewed-by: Ray Ni mailto:ray...@intel.com>>


-Original Message-
From: Gao, Liming mailto:liming@intel.com>>
Sent: Thursday, October 17, 2019 2:56 PM
To: devel@edk2.groups.io
Cc: Justen, Jordan L 
mailto:jordan.l.jus...@intel.com>>; Andrew Fish
mailto:af...@apple.com>>; Ni, Ray 
mailto:ray...@intel.com>>
Subject: [Patch v3 10/11] EmulatorPkg: Enable CLANG9 tool chain

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603
1. Add WIN_SEC_BUILD macro check for CLANG9 tool chain build -p
EmulatorPkg\EmulatorPkg.dsc -a IA32 -DWIN_SEC_BUILD=TRUE -t CLANG9
build -p EmulatorPkg\EmulatorPkg.dsc -a X64 -DWIN_SEC_BUILD=TRUE -t
CLANG9 2. Append CLANG CC and LINK flags to generate windows HOST.
3. Fix WinHost issue to call GetProcessAffinityMask() API.
  The input parameter should be UINTN pointer instead of UINT32 pointer.

Cc: Jordan Justen mailto:jordan.l.jus...@intel.com>>
Cc: Andrew Fish mailto:af...@apple.com>>
Cc: Ray Ni mailto:ray...@intel.com>>
Signed-off-by: Liming Gao mailto:liming@intel.com>>
---
EmulatorPkg/Win/Host/WinHost.c   | 6 +++---
EmulatorPkg/EmulatorPkg.dsc  | 7 ++-
EmulatorPkg/Win/Host/WinHost.inf | 6 ++
3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/EmulatorPkg/Win/Host/WinHost.c
b/EmulatorPkg/Win/Host/WinHost.c index 9aba3c8959..e40ce32548 100644
--- a/EmulatorPkg/Win/Host/WinHost.c
+++ b/EmulatorPkg/Win/Host/WinHost.c
@@ -356,7 +356,7 @@ Returns:
INTN
EFIAPI
main (
-  IN  INTN  Argc,
+  IN  INT  Argc,
  IN  CHAR8 **Argv,
  IN  CHAR8 **Envp
  )
@@ -391,8 +391,8 @@ Returns:
  VOID  *SecFile;
  CHAR16*MemorySizeStr;
  CHAR16*FirmwareVolumesStr;
-  UINT32ProcessAffinityMask;
-  UINT32SystemAffinityMask;
+  UINTN ProcessAffinityMask;
+  UINTN SystemAffinityMask;
  INT32 LowBit;

  //
diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 20f1187713..72532f5daf 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -237,9 +237,10 @@

[Components]
!if "IA32" in $(ARCH) || "X64" in $(ARCH)
-  !if "MSFT" in 

Re: [edk2-devel] [edk2-platforms][PATCH v2 1/1] Platform/RPi3: Add TFTP command to UEFI Shell

2019-10-18 Thread Philippe Mathieu-Daudé

On 10/18/19 3:25 PM, Pete Batard wrote:

On 2019.10.18 13:52, Leif Lindholm wrote:

On Fri, Oct 18, 2019 at 01:41:30PM +0100, Pete Batard wrote:

TFTP support, which is enabled by default, can be disabled by setting
INCLUDE_TFTP_COMMAND to FALSE.


Would you be OK with flipping the default to FALSE?


Yes, I have no issue with a default set to FALSE.


It is a custom extension not described by the UEFI Shell
Specification.

I could flip the logic in the DEFINE and commit message if so, no need
for a v3.


If you can do that, that would be great. Thanks!


Reviewed-by: Philippe Mathieu-Daude 



/Pete



Regards,

Leif


Signed-off-by: Pete Batard 
---
  Platform/RaspberryPi/RPi3/RPi3.dsc | 8 
  Platform/RaspberryPi/RPi3/RPi3.fdf | 3 +++
  2 files changed, 11 insertions(+)

diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc 
b/Platform/RaspberryPi/RPi3/RPi3.dsc

index bc424a06bb45..2289ad8c2ed2 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.dsc
+++ b/Platform/RaspberryPi/RPi3/RPi3.dsc
@@ -36,6 +36,7 @@ [Defines]
    # -D FLAG=VALUE
    #
    DEFINE SECURE_BOOT_ENABLE  = FALSE
+  DEFINE INCLUDE_TFTP_COMMAND    = TRUE
    DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x804F
  
 


@@ -181,6 +182,10 @@ [LibraryClasses.common.DXE_DRIVER]

SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf 


PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf 


MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 


+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
+  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+!endif
  [LibraryClasses.common.UEFI_APPLICATION]

PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf 


@@ -616,3 +621,6 @@ [Components.common]
    gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
    gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20
    }
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
+!endif
diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf 
b/Platform/RaspberryPi/RPi3/RPi3.fdf

index 17c0094ac1cf..b06a15fb8ec3 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.fdf
+++ b/Platform/RaspberryPi/RPi3/RPi3.fdf
@@ -232,6 +232,9 @@ [FV.FvMain]
    # UEFI application (Shell Embedded Boot Loader)
    #
    INF ShellPkg/Application/Shell/Shell.inf
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
+!endif
    #
    # ACPI Support
--
2.21.0.windows.1









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49237): https://edk2.groups.io/g/devel/message/49237
Mute This Topic: https://groups.io/mt/35014112/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms][PATCH v2 1/1] Platform/RPi3: Add TFTP command to UEFI Shell

2019-10-18 Thread Pete Batard

On 2019.10.18 13:52, Leif Lindholm wrote:

On Fri, Oct 18, 2019 at 01:41:30PM +0100, Pete Batard wrote:

TFTP support, which is enabled by default, can be disabled by setting
INCLUDE_TFTP_COMMAND to FALSE.


Would you be OK with flipping the default to FALSE?


Yes, I have no issue with a default set to FALSE.


It is a custom extension not described by the UEFI Shell
Specification.

I could flip the logic in the DEFINE and commit message if so, no need
for a v3.


If you can do that, that would be great. Thanks!

/Pete



Regards,

Leif


Signed-off-by: Pete Batard 
---
  Platform/RaspberryPi/RPi3/RPi3.dsc | 8 
  Platform/RaspberryPi/RPi3/RPi3.fdf | 3 +++
  2 files changed, 11 insertions(+)

diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc 
b/Platform/RaspberryPi/RPi3/RPi3.dsc
index bc424a06bb45..2289ad8c2ed2 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.dsc
+++ b/Platform/RaspberryPi/RPi3/RPi3.dsc
@@ -36,6 +36,7 @@ [Defines]
# -D FLAG=VALUE
#
DEFINE SECURE_BOOT_ENABLE  = FALSE
+  DEFINE INCLUDE_TFTP_COMMAND= TRUE
DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x804F
  
  

@@ -181,6 +182,10 @@ [LibraryClasses.common.DXE_DRIVER]

SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf

MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
+  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+!endif
  
  [LibraryClasses.common.UEFI_APPLICATION]

PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
@@ -616,3 +621,6 @@ [Components.common]
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20
}
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
+!endif
diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf 
b/Platform/RaspberryPi/RPi3/RPi3.fdf
index 17c0094ac1cf..b06a15fb8ec3 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.fdf
+++ b/Platform/RaspberryPi/RPi3/RPi3.fdf
@@ -232,6 +232,9 @@ [FV.FvMain]
# UEFI application (Shell Embedded Boot Loader)
#
INF ShellPkg/Application/Shell/Shell.inf
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
+!endif
  
#

# ACPI Support
--
2.21.0.windows.1




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49235): https://edk2.groups.io/g/devel/message/49235
Mute This Topic: https://groups.io/mt/35014112/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [RFC v1 5/4] CryptoPkg/TlsLib: accept peer certs via both DNS names and IP addresses

2019-10-18 Thread Laszlo Ersek
On 10/17/19 17:49, David Woodhouse wrote:
> On Thu, 2019-10-17 at 17:35 +0200, Laszlo Ersek wrote:
>> Reference [2] advises to put the IP address in both CN and
>> SAN.iPAddress
>> for best compatibility, and that would be fine, for
>> X509_VERIFY_PARAM_set1_ip(). But the word "only" in [3] is really bad
>> for X509_VERIFY_PARAM_set1_ip().
> 
> I don't believe it's true, and it conflicts with what's in [2] which
> suggests that you do it properly *and* put it in the legacy CN for the
> benefit of broken clients.
> 
> None of this convinces me that EDK2 should deliberately be one of those
> "broken clients". Just fix it. Let people worry about compatibility
> with historical buggy versions of proprietary operating systems when
> they issue their certs.
> 

Personally I'm OK with this.

Thanks
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49236): https://edk2.groups.io/g/devel/message/49236
Mute This Topic: https://groups.io/mt/34551672/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch v3 00/11] New Cross OS tool chain CLANG9

2019-10-18 Thread Liming Gao
Leif:

>-Original Message-
>From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
>Sent: Friday, October 18, 2019 12:31 AM
>To: devel@edk2.groups.io; Gao, Liming 
>Cc: Yao, Jiewen ; Shi, Steven
>; Justen, Jordan L ; Laszlo
>Ersek ; Andrew Fish ; Ni, Ray
>; Ard Biesheuvel ; Wang, Jian
>J ; Wu, Hao A ; Feng, Bob C
>; Kinney, Michael D 
>Subject: Re: [edk2-devel] [Patch v3 00/11] New Cross OS tool chain CLANG9
>
>Hi Liming,
>
>I had missed that this set was out for review (I would appreciate a cc
>on any future revisions).
Yes. 

>
>On Thu, Oct 17, 2019 at 02:55:44PM +0800, Liming Gao wrote:
>> In v3, add the detail commit message for patch 3.
>> Update the fix in EmulatorPkg based on the comments.
>>
>> In v2, drop patch 12, and update commit message for 5 & 11.
>>
>> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603
>> Code: https://github.com/lgao4/edk2/tree/CLANG9
>
>This branch does not appear to have been updated since 5 September, so
>it does not contain the version of the code sent out in this set. (And
>I can find no other obvious branch in that repository that may hold
>it.) Could you push an updated one please?
>
Done
Code: https://github.com/lgao4/edk2/tree/CLANG9_v3

>One thing that strikes me as problematic with the version on the
>branch is that the set imports bits from GCC48 *and* GCC5. That seems
>like a maintenance hazard, but may no longer be the case for the
>current version of the set?
>
CLANG9 tool chain refers to CLANG38 tool chain. So, it refers to GCC48 and GCC5 
flags.
1. CLANG9 CC flags reuses GCC48_ALL_CC_FLAGS. GCC48_ALL_CC_FLAGS is common GCC 
flags 
for GCC48, GCC49, GCC5 and CLANG38. So, I think it is fine to reuse it in new 
CLANG9 tool chain. 
2. CLANG9 ASM_FLAGS reuses GCC5_ASM_FLAGS. It is same to common GCC_ASM_FLAGS. 
I 
Can use GCC_ASM_FLAGS. 

Thanks
Liming
>Best Regards,
>
>Leif
>
>> Wiki: https://github.com/lgao4/edk2/wiki/CLANG9-Tools-Chain
>>
>> CLANG9 tool chain is added to directly generate PE/COFF image (EFI image).
>> This tool chain uses LLVM clang C compiler and lld linker, generates PE/COFF
>> image and PDB compatible debug symbol format. Now, it supports IA32/X64
>Archs.
>> It must use LLVM 9 or above release. LLVM 9 is ready on
>> http://releases.llvm.org/download.html#9.0.0.
>>
>> CLANG9 is the cross OS tool chain. It can work on Windows/Linux/Mac host
>OS.
>> For the same source code, with the same version LLVM tool chain,
>> CLANG9 can generate the same binary image. So, the developer can
>> choose the different development environment and work on the same
>> code base. Besides, EDKII project build also requires third party
>> tools: nasm and iasl. They both keep the same version. If so, the same
>> binary image can be generated on the different host OS.
>>
>> LLVM tool chain provides the compiler and linker. To build EDK2 project,
>> some other tools are still required. On Windows OS, nmake and Visual
>Studio
>> are required to call Makefile and compile BaseTools C tools.
>> On Linux/Mac, binutils and gcc are required to make and compile BaseTools
>> C tools. Because VS or GCC are mainly used to compile BaseTools and
>provide
>> nmake/make tool, they can keep on the stable version without update.
>>
>> To build source code, CLANG9 tool chain (-t CLANG9) can be specified
>> on Windows OS, set CLANG_HOST_BIN=n, set CLANG9_BIN=LLVM installed
>directory
>> CLANG_HOST_BIN is used CLANG_HOST_PREFIX. Prefix n is for nmake.
>> For example:
>> *  set CLANG_HOST_BIN=n
>> *  set CLANG9_BIN=C:\Program Files\LLVM\bin\
>> *  set IASL_PREFIX=C:\Asl\
>>
>> On Linux/Mac, export CLANG9_BIN=LLVM installed directory,
>CLANG_HOST_BIN is
>> not required, because there is no prefix for make.
>> For example:
>> *  export CLANG9_BIN=/home/clang9/bin/
>>
>> Now, CLANG9 tool chain has been verified in Edk2 packages and
>Ovmf/Emulator
>> with LLVM 9.0.0 on Windows and Linux OS.
>> OVMF IA32/X64/IA32X64 all boots to Shell on Windows and Linux OS.
>> Emulator can boot to Shell on Windows only with CLANG9.
>> OVMF Ia32X64 RELEASE build generates the same BIOS images on Windows
>and Linux OS.
>>
>> Cc: Jiewen Yao 
>> Cc: Steven Shi 
>> Cc: Jordan Justen 
>> Cc: Laszlo Ersek 
>> Cc: Andrew Fish 
>> Cc: Ray Ni 
>> Cc: Ard Biesheuvel 
>> Cc: Jian J Wang 
>> Cc: Hao A Wu 
>> Cc: Bob Feng 
>> Cc: Michael D Kinney 
>>
>> Liming Gao (11):
>>   BaseTools tools_def.template: Remove unnecessary $(DEST_DIR_DEBUG)
>> path
>>   BaseTools tools_def: Add CLANG9 tool chain to directly generate PE
>> image
>>   BaseTools GenFw: Fix the issue to update the wrong size as SectionSize
>>   MdePkg Base.h: Add definition for CLANG9 tool chain
>>   MdePkg BaseIoLibIntrinsic: Remove __inline__ attribute for IO
>> functions
>>   MdeModulePkg LzmaCustomDecompressLib: Update macro to be same in
>CLANG
>> tool
>>   MdeModulePkg RegularExpressionDxe: Disable warning for CLANG9 tool
>> chain
>>   CryptoPkg: Append options to make CLANG9 tool chain pass build
>>   CryptoPkg 

Re: [edk2-devel] [edk2-platforms][PATCH v2 1/1] Platform/RPi3: Add TFTP command to UEFI Shell

2019-10-18 Thread Leif Lindholm
On Fri, Oct 18, 2019 at 01:41:30PM +0100, Pete Batard wrote:
> TFTP support, which is enabled by default, can be disabled by setting
> INCLUDE_TFTP_COMMAND to FALSE.

Would you be OK with flipping the default to FALSE?
It is a custom extension not described by the UEFI Shell
Specification.

I could flip the logic in the DEFINE and commit message if so, no need
for a v3.

Regards,

Leif

> Signed-off-by: Pete Batard 
> ---
>  Platform/RaspberryPi/RPi3/RPi3.dsc | 8 
>  Platform/RaspberryPi/RPi3/RPi3.fdf | 3 +++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc 
> b/Platform/RaspberryPi/RPi3/RPi3.dsc
> index bc424a06bb45..2289ad8c2ed2 100644
> --- a/Platform/RaspberryPi/RPi3/RPi3.dsc
> +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc
> @@ -36,6 +36,7 @@ [Defines]
># -D FLAG=VALUE
>#
>DEFINE SECURE_BOOT_ENABLE  = FALSE
> +  DEFINE INCLUDE_TFTP_COMMAND= TRUE
>DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x804F
>  
>  
> 
> @@ -181,6 +182,10 @@ [LibraryClasses.common.DXE_DRIVER]
>
> SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
>PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
>
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
> +!if $(INCLUDE_TFTP_COMMAND) == TRUE
> +  ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> +  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
> +!endif
>  
>  [LibraryClasses.common.UEFI_APPLICATION]
>PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
> @@ -616,3 +621,6 @@ [Components.common]
>gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
>gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20
>}
> +!if $(INCLUDE_TFTP_COMMAND) == TRUE
> +  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
> +!endif
> diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf 
> b/Platform/RaspberryPi/RPi3/RPi3.fdf
> index 17c0094ac1cf..b06a15fb8ec3 100644
> --- a/Platform/RaspberryPi/RPi3/RPi3.fdf
> +++ b/Platform/RaspberryPi/RPi3/RPi3.fdf
> @@ -232,6 +232,9 @@ [FV.FvMain]
># UEFI application (Shell Embedded Boot Loader)
>#
>INF ShellPkg/Application/Shell/Shell.inf
> +!if $(INCLUDE_TFTP_COMMAND) == TRUE
> +  INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
> +!endif
>  
>#
># ACPI Support
> -- 
> 2.21.0.windows.1
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49233): https://edk2.groups.io/g/devel/message/49233
Mute This Topic: https://groups.io/mt/35014112/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms][PATCH v2 0/1] Platform/RPi3: Add TFTP command to UEFI Shell

2019-10-18 Thread Pete Batard
Previous version had '!ifdef $(INCLUDE_TFTP_COMMAND)' in the .fdf whereas
it was supposed to be '!if $(INCLUDE_TFTP_COMMAND) == TRUE'.

This v2 fixes that.

Pete Batard (1):
  Platform/RPi3: Add TFTP command to UEFI Shell

 Platform/RaspberryPi/RPi3/RPi3.dsc | 8 
 Platform/RaspberryPi/RPi3/RPi3.fdf | 3 +++
 2 files changed, 11 insertions(+)

-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49231): https://edk2.groups.io/g/devel/message/49231
Mute This Topic: https://groups.io/mt/35014111/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms][PATCH v2 1/1] Platform/RPi3: Add TFTP command to UEFI Shell

2019-10-18 Thread Pete Batard
TFTP support, which is enabled by default, can be disabled by setting
INCLUDE_TFTP_COMMAND to FALSE.

Signed-off-by: Pete Batard 
---
 Platform/RaspberryPi/RPi3/RPi3.dsc | 8 
 Platform/RaspberryPi/RPi3/RPi3.fdf | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc 
b/Platform/RaspberryPi/RPi3/RPi3.dsc
index bc424a06bb45..2289ad8c2ed2 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.dsc
+++ b/Platform/RaspberryPi/RPi3/RPi3.dsc
@@ -36,6 +36,7 @@ [Defines]
   # -D FLAG=VALUE
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
+  DEFINE INCLUDE_TFTP_COMMAND= TRUE
   DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x804F
 
 

@@ -181,6 +182,10 @@ [LibraryClasses.common.DXE_DRIVER]
   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
   PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
+  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+!endif
 
 [LibraryClasses.common.UEFI_APPLICATION]
   PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
@@ -616,3 +621,6 @@ [Components.common]
   gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
   gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20
   }
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
+!endif
diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf 
b/Platform/RaspberryPi/RPi3/RPi3.fdf
index 17c0094ac1cf..b06a15fb8ec3 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.fdf
+++ b/Platform/RaspberryPi/RPi3/RPi3.fdf
@@ -232,6 +232,9 @@ [FV.FvMain]
   # UEFI application (Shell Embedded Boot Loader)
   #
   INF ShellPkg/Application/Shell/Shell.inf
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
+!endif
 
   #
   # ACPI Support
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49232): https://edk2.groups.io/g/devel/message/49232
Mute This Topic: https://groups.io/mt/35014112/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms][PATCH 1/1] Platform/RPi3: Add TFTP command to UEFI Shell

2019-10-18 Thread Pete Batard
TFTP support, which is enabled by default, can be disabled by setting
INCLUDE_TFTP_COMMAND to FALSE.

Signed-off-by: Pete Batard 
---
 Platform/RaspberryPi/RPi3/RPi3.dsc | 8 
 Platform/RaspberryPi/RPi3/RPi3.fdf | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc 
b/Platform/RaspberryPi/RPi3/RPi3.dsc
index bc424a06bb45..2289ad8c2ed2 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.dsc
+++ b/Platform/RaspberryPi/RPi3/RPi3.dsc
@@ -36,6 +36,7 @@ [Defines]
   # -D FLAG=VALUE
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
+  DEFINE INCLUDE_TFTP_COMMAND= TRUE
   DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x804F
 
 

@@ -181,6 +182,10 @@ [LibraryClasses.common.DXE_DRIVER]
   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
   PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
+  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+!endif
 
 [LibraryClasses.common.UEFI_APPLICATION]
   PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
@@ -616,3 +621,6 @@ [Components.common]
   gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
   gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20
   }
+!if $(INCLUDE_TFTP_COMMAND) == TRUE
+  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
+!endif
diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf 
b/Platform/RaspberryPi/RPi3/RPi3.fdf
index 17c0094ac1cf..cb6522c14736 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.fdf
+++ b/Platform/RaspberryPi/RPi3/RPi3.fdf
@@ -232,6 +232,9 @@ [FV.FvMain]
   # UEFI application (Shell Embedded Boot Loader)
   #
   INF ShellPkg/Application/Shell/Shell.inf
+!ifdef $(INCLUDE_TFTP_COMMAND)
+  INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
+!endif #$(INCLUDE_TFTP_COMMAND)
 
   #
   # ACPI Support
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49230): https://edk2.groups.io/g/devel/message/49230
Mute This Topic: https://groups.io/mt/35014002/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/1] SignedCapsulePkg: fix AARCH64 build

2019-10-18 Thread Leif Lindholm
On Fri, Oct 18, 2019 at 11:20:19AM +, Yao, Jiewen wrote:
> Reviewed-by: Jiewen Yao 

Thanks!
Pushed as 0f28c513d392.

BZ closed.

/
Leif

> > -Original Message-
> > From: Leif Lindholm 
> > Sent: Friday, October 18, 2019 5:43 PM
> > To: devel@edk2.groups.io
> > Cc: Yao, Jiewen ; Zhang, Chao B
> > ; Laszlo Ersek 
> > Subject: [PATCH 1/1] SignedCapsulePkg: fix AARCH64 build
> > 
> > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2252
> > 
> > Add NULL library resolution of CompilerIntrinsicsLib and
> > BaseStackCheckLib for AARCH64 as well as ARM in order to
> > fix "undefined reference to `memcpy'" build errors.
> > 
> > Cc: Jiewen Yao 
> > Cc: Chao Zhang 
> > Cc: Laszlo Ersek 
> > Signed-off-by: Leif Lindholm 
> > ---
> >  SignedCapsulePkg/SignedCapsulePkg.dsc | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc
> > b/SignedCapsulePkg/SignedCapsulePkg.dsc
> > index 4d4232d6e003..03f714f9a799 100644
> > --- a/SignedCapsulePkg/SignedCapsulePkg.dsc
> > +++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
> > @@ -97,6 +97,7 @@ [LibraryClasses]
> >  [LibraryClasses.ARM]
> >ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
> > 
> > +[LibraryClasses.AARCH64, LibraryClasses.ARM]
> >#
> ># It is not possible to prevent the ARM compiler for generic intrinsic 
> > functions.
> ># This library provides the instrinsic functions generate by a given 
> > compiler.
> > --
> > 2.20.1
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49229): https://edk2.groups.io/g/devel/message/49229
Mute This Topic: https://groups.io/mt/35012889/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/1] SignedCapsulePkg: fix AARCH64 build

2019-10-18 Thread Yao, Jiewen
Reviewed-by: Jiewen Yao 

> -Original Message-
> From: Leif Lindholm 
> Sent: Friday, October 18, 2019 5:43 PM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen ; Zhang, Chao B
> ; Laszlo Ersek 
> Subject: [PATCH 1/1] SignedCapsulePkg: fix AARCH64 build
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2252
> 
> Add NULL library resolution of CompilerIntrinsicsLib and
> BaseStackCheckLib for AARCH64 as well as ARM in order to
> fix "undefined reference to `memcpy'" build errors.
> 
> Cc: Jiewen Yao 
> Cc: Chao Zhang 
> Cc: Laszlo Ersek 
> Signed-off-by: Leif Lindholm 
> ---
>  SignedCapsulePkg/SignedCapsulePkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc
> b/SignedCapsulePkg/SignedCapsulePkg.dsc
> index 4d4232d6e003..03f714f9a799 100644
> --- a/SignedCapsulePkg/SignedCapsulePkg.dsc
> +++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
> @@ -97,6 +97,7 @@ [LibraryClasses]
>  [LibraryClasses.ARM]
>ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
> 
> +[LibraryClasses.AARCH64, LibraryClasses.ARM]
>#
># It is not possible to prevent the ARM compiler for generic intrinsic 
> functions.
># This library provides the instrinsic functions generate by a given 
> compiler.
> --
> 2.20.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49228): https://edk2.groups.io/g/devel/message/49228
Mute This Topic: https://groups.io/mt/35012889/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/1] SignedCapsulePkg: fix AARCH64 build

2019-10-18 Thread Leif Lindholm
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2252

Add NULL library resolution of CompilerIntrinsicsLib and
BaseStackCheckLib for AARCH64 as well as ARM in order to
fix "undefined reference to `memcpy'" build errors.

Cc: Jiewen Yao 
Cc: Chao Zhang 
Cc: Laszlo Ersek 
Signed-off-by: Leif Lindholm 
---
 SignedCapsulePkg/SignedCapsulePkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc 
b/SignedCapsulePkg/SignedCapsulePkg.dsc
index 4d4232d6e003..03f714f9a799 100644
--- a/SignedCapsulePkg/SignedCapsulePkg.dsc
+++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
@@ -97,6 +97,7 @@ [LibraryClasses]
 [LibraryClasses.ARM]
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
 
+[LibraryClasses.AARCH64, LibraryClasses.ARM]
   #
   # It is not possible to prevent the ARM compiler for generic intrinsic 
functions.
   # This library provides the instrinsic functions generate by a given 
compiler.
-- 
2.20.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49227): https://edk2.groups.io/g/devel/message/49227
Mute This Topic: https://groups.io/mt/35012889/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [plaforms/devel-riscv-v2 PATCHv2 09/14] U500Pkg/Library: Initial version of PlatformBootManagerLib

2019-10-18 Thread Abner Chang



> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Leif Lindholm
> Sent: Thursday, October 3, 2019 6:03 AM
> To: devel@edk2.groups.io; Chen, Gilbert 
> Cc: Palmer Dabbelt 
> Subject: Re: [edk2-devel] [plaforms/devel-riscv-v2 PATCHv2 09/14]
> U500Pkg/Library: Initial version of PlatformBootManagerLib
> 
> On Thu, Sep 19, 2019 at 11:51:26AM +0800, Gilbert Chen wrote:
> > SiFive RISC-V U500 Platform Boot Manager library.
> 
> First of all, let me say that I think before upstreaming to master, you ought 
> to
> look into merging PlatformBootManagerLibs for all Risc-V platforms. Like we
> have for *most* ARM/AARCH64 platforms with
> ArmPkg/Library/PlatformBootManagerLib/.
> 
> (Longer-term we should merge them all together into a single one.)
> 
> > Signed-off-by: Gilbert Chen 
> > ---
> >  .../Library/PlatformBootManagerLib/MemoryTest.c| 682
> +
> >  .../PlatformBootManagerLib/PlatformBootManager.c   | 274 +
> >  .../PlatformBootManagerLib/PlatformBootManager.h   | 135 
> >  .../PlatformBootManagerLib.inf |  63 ++
> >  .../Library/PlatformBootManagerLib/PlatformData.c  |  49 ++
> >  .../Library/PlatformBootManagerLib/Strings.uni |  28 +
> >  6 files changed, 1231 insertions(+)
> >  create mode 100644
> >
> Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/MemoryT
> es
> > t.c  create mode 100644
> >
> Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/PlatformB
> > ootManager.c  create mode 100644
> >
> Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/PlatformB
> > ootManager.h  create mode 100644
> >
> Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/PlatformB
> > ootManagerLib.inf  create mode 100644
> >
> Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/PlatformD
> > ata.c  create mode 100644
> > Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/Strings.u
> > ni
> >
> > diff --git
> >
> a/Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/Memory
> T
> > est.c
> >
> b/Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/Memor
> yT
> > est.c
> > new file mode 100644
> > index ..8c6d89e9
> > --- /dev/null
> > +++
> b/Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/Mem
> > +++ oryTest.c
> 
> Why build a MemoryTest into the PlatformBootManagerLib?
Why not to do memory if platform provides memory test protocol?
> 
> > @@ -0,0 +1,682 @@
> > +/** @file
> > +  Perform the RISC-V platform memory test
> > +
> > +Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All
> > +rights reserved. Copyright (c) 2004 - 2015, Intel Corporation.
> > +All rights reserved.
> > +
> > +SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#include "PlatformBootManager.h"
> > +
> > +EFI_HII_HANDLE gStringPackHandle = NULL;
> > +EFI_GUID   mPlatformBootManagerStringPackGuid = {
> > +  0x154dd51, 0x9079, 0x4a10, { 0x89, 0x5c, 0x9c, 0x7, 0x72, 0x81,
> > +0x57, 0x88 }
> > +  };
> > +// extern UINT8  BdsDxeStrings[];
> 
> No need to keep commented-out code in.
> 
> > +
> > +//
> > +// BDS Platform Functions
> > +//
> > +/**
> > +
> > +  Show progress bar with title above it. It only works in Graphics mode.
> > +
> > +  @param TitleForeground Foreground color for Title.
> > +  @param TitleBackground Background color for Title.
> > +  @param Title   Title above progress bar.
> > +  @param ProgressColor   Progress bar color.
> > +  @param ProgressProgress (0-100)
> > +  @param PreviousValue   The previous value of the progress.
> > +
> > +  @retval  EFI_STATUS   Success update the progress bar
> > +
> > +**/
> > +EFI_STATUS
> > +PlatformBootManagerShowProgress (
> 
> I'm not a super fan of how this file integrates a custom memory test with a
> direct (copy) graphical progress indicator. There are both common memory
> test and common progress indicators - please use those instead. And
> improve them if they are currently insufficient for your needs.

Could you indicate where are those common libraries? Thanks.

> 
> > diff --git
> > a/Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/Platfor
> > mBootManager.c
> > b/Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/Platfor
> > mBootManager.c
> > new file mode 100644
> > index ..9ef85089
> > --- /dev/null
> > +++
> b/Platform/RiscV/SiFive/U500Pkg/Library/PlatformBootManagerLib/Pla
> > +++ tformBootManager.c
> > @@ -0,0 +1,274 @@
> > +/** @file
> > +  This file include all platform action which can be customized
> > +  by IBV/OEM.
> > +
> > +Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All
> > +rights reserved. Copyright (c) 2015, Intel Corporation. All
> > +rights reserved.
> > +
> > +SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#include "PlatformBootManager.h"
> > +
> > +
> > +EFI_GUID mUefiShellFileGuid = { 0x7C04A583, 0x9E3E, 0x4f1c, {0xAD,
> >