[edk2] [PATCH 3/3] MdeModulePkg CapsuleApp: Fix typo EFI_CAPSULE_RPORT_GUID
Cc: Michael D Kinney Cc: Jiewen Yao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c index 27a38667797a..bc727279c5b0 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c @@ -738,7 +738,7 @@ PrintUsage ( Print(L" with CAPSULE_FLAGS_PERSIST_ACROSS_RESET and without CAPSULE_FLAGS_INITIATE_RESET.\n"); Print(L" -S: Dump capsule report variable (EFI_CAPSULE_REPORT_GUID),\n"); Print(L" which is defined in UEFI specification.\n"); - Print(L" -C: Clear capsule report variable (EFI_CAPSULE_RPORT_GUID),\n"); + Print(L" -C: Clear capsule report variable (EFI_CAPSULE_REPORT_GUID),\n"); Print(L" which is defined in UEFI specification.\n"); Print(L" -P: Dump UEFI FMP protocol info.\n"); Print(L" -E: Dump UEFI ESRT table info.\n"); -- 2.7.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH 0/3] CapsuleApp: Some enhancements
Cc: Michael D Kinney Cc: Jiewen Yao Cc: Yonghong Zhu Star Zeng (3): MdeModulePkg CapsuleApp: Check Arg count for -D option MdeModulePkg CapsuleApp: Refine -D option help information MdeModulePkg CapsuleApp: Fix typo EFI_CAPSULE_RPORT_GUID MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.7.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH 2/3] MdeModulePkg CapsuleApp: Refine -D option help information
Cc: Michael D Kinney Cc: Jiewen Yao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c index 90f1a02d9af6..27a38667797a 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c @@ -747,8 +747,8 @@ PrintUsage ( Print(L" -N: Append a Capsule Header to an existing capsule image,\n"); Print(L" according to Windows Firmware Update document\n"); Print(L" -O: Output new Capsule file name\n"); - Print(L" -D: Dump Capsule image header information and FMP header information,\n"); - Print(L" if it is an FMP capsule.\n"); + Print(L" -D: Dump Capsule image header information, image payload information if it is UX capsule\n"); + Print(L" and FMP header information if it is a FMP capsule.\n"); } /** -- 2.7.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH 1/3] MdeModulePkg CapsuleApp: Check Arg count for -D option
Cc: Michael D Kinney Cc: Jiewen Yao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 4 1 file changed, 4 insertions(+) diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c index 3a1a0a1cb2e6..90f1a02d9af6 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c @@ -792,6 +792,10 @@ UefiMain ( return EFI_INVALID_PARAMETER; } if (StrCmp(Argv[1], L"-D") == 0) { +if (Argc < 3) { + Print(L"CapsuleApp: NO input capsule name.\n"); + return EFI_INVALID_PARAMETER; +} Status = DumpCapsule(Argv[2]); return Status; } -- 2.7.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH v2] SecurityPkg: Fix assert when setting key from eMMC/SD/USB
From: Roman Bacik When secure boot is enabled, if one loads keys from a FAT formatted eMMC/SD/USB when trying to provision PK/KEK/DB keys via the menu, an assert in StrLen() occurs. This is because the filename starts on odd address, which is not a uint16 aligned boundary: https://bugzilla.tianocore.org/show_bug.cgi?id=1003 Cc: Chao Zhang Cc: Jiewen Yao Cc: Laszlo Ersek Cc: Vladimir Olovyannikov Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Roman Bacik --- SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c index 1b6f88804275..19b13a5569a6 100644 --- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c +++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c @@ -123,6 +123,8 @@ OpenFileByDevicePath( EFI_FILE_PROTOCOL *Handle1; EFI_FILE_PROTOCOL *Handle2; EFI_HANDLE DeviceHandle; + CHAR16 *PathName; + UINTN PathLength; if ((FilePath == NULL || FileHandle == NULL)) { return EFI_INVALID_PARAMETER; @@ -173,6 +175,11 @@ OpenFileByDevicePath( // Handle2 = Handle1; Handle1 = NULL; +PathLength = DevicePathNodeLength(*FilePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL); +PathName = AllocateCopyPool(PathLength, ((FILEPATH_DEVICE_PATH*)*FilePath)->PathName); +if (PathName == NULL) { + return EFI_OUT_OF_RESOURCES; +} // // Try to test opening an existing file @@ -180,7 +187,7 @@ OpenFileByDevicePath( Status = Handle2->Open ( Handle2, , - ((FILEPATH_DEVICE_PATH*)*FilePath)->PathName, + PathName, OpenMode &~EFI_FILE_MODE_CREATE, 0 ); @@ -192,7 +199,7 @@ OpenFileByDevicePath( Status = Handle2->Open ( Handle2, , -((FILEPATH_DEVICE_PATH*)*FilePath)->PathName, +PathName, OpenMode, Attributes ); @@ -202,6 +209,8 @@ OpenFileByDevicePath( // Handle2->Close (Handle2); +FreePool (PathName); + if (EFI_ERROR(Status)) { return (Status); } -- 2.17.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH] BaseTool: Fixed the incorrect cache key.
From: "bob.c.f...@intel.com" This patch is to fix the incorrect cache key of skip ModuleAutoGen cache. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao --- BaseTools/Source/Python/AutoGen/AutoGen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index b27290989e..54c6b7330f 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -4320,7 +4320,7 @@ class ModuleAutoGen(AutoGen): # If any source file is newer than the module than we cannot skip # def CanSkip(self): -if self.MetaFile in GlobalData.gSikpAutoGenCache: +if self.MakeFileDir in GlobalData.gSikpAutoGenCache: return True if not os.path.exists(self.GetTimeStampPath()): return False @@ -4340,7 +4340,7 @@ class ModuleAutoGen(AutoGen): ModuleAutoGen.TimeDict[source] = os.stat(source)[8] if ModuleAutoGen.TimeDict[source] > DstTimeStamp: return False -GlobalData.gSikpAutoGenCache.add(self.MetaFile) +GlobalData.gSikpAutoGenCache.add(self.MakeFileDir) return True def GetTimeStampPath(self): -- 2.18.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [Patch edk2-platforms\devel-MinPlatform] PurleyOpenBoardPkg: Update batch file not to check the return value of timeout
timeout command may not work well in some environment. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Cc: Jiewen Yao --- Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat index a6e0605..4c4aec3 100644 --- a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat +++ b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat @@ -111,13 +111,13 @@ echo. echo echo. call postbuild.bat +if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% timeout 1 echo echo. echo PostBuild End echo. echo -if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% echo %date% %time% echo. @@ -128,7 +128,6 @@ echoPurley Build End echo. echo -if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% :done endlocal & EXIT /b %SCRIPT_ERROR% -- 2.10.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] question about armclang support
Hello Sau Kae, On 07/10/18 11:14, Tan, Sau Kae wrote: > Hi All, > > May I know is armclang already supported in EDK2? > Or only armcc is supported currently? > Thanks. Looking at "BaseTools/Conf/tools_def.template", the following toolchains appear supported for both ARM and AARCH64: - CLANG35 - CLANG38 They are documented (in the same file) as: # CLANG35 -Linux,Windows- Requires: # Clang v3.5 or later, and GNU binutils targeting aarch64-linux-gnu or arm-linux-gnueabi #Optional: # Required to build platforms or ACPI tables: # Intel(r) ACPI Compiler from # https://acpica.org/downloads # CLANG38 -Linux- Requires: # Clang v3.8, LLVMgold plugin and GNU binutils 2.26 targeting x86_64-linux-gnu, aarch64-linux-gnu or arm-linux-gnueabi # Clang v3.9 or later, LLVMgold plugin and GNU binutils 2.28 targeting x86_64-linux-gnu, aarch64-linux-gnu or arm-linux-gnueabi #Optional: # Required to build platforms or ACPI tables: # Intel(r) ACPI Compiler from # https://acpica.org/downloads Thanks Laszlo ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] Platform/ARM: Correct LevelID in PLPI packages of DSDT
Reviewed-by: Evan Lloyd > -Original Message- > From: AlexeiFedorov > Sent: 04 July 2018 14:05 > To: edk2-devel@lists.01.org > Cc: Arvind Chauhan ; Thomas Abraham > ; ard.biesheu...@linaro.org; > leif.lindh...@linaro.org; Matteo Carlini ; > Stephanie Hughes-Fitt ; nd > ; Thomas Abraham ; Evan > Lloyd ; Sami Mujawar > Subject: [PATCH] Platform/ARM: Correct LevelID in PLPI packages of DSDT > > From: Alexei Fedorov > > Juno's DSDT contains 2 PLPI packages in Clusters #0 and #1 and _OSC method > reports support for platform coordinated mode only. > According to the description of LevelID field in ACPI 6.2 Errata A > Specification > #8.4.4.3, "In a platform that only supports platform coordinated mode, this > field must be 0." > > This patch fixes the above issue by changing value of LevelID fields from 1 to > 0. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Alexei Fedorov > --- > All the changes can be reviewed at: > https://github.com/AlexeiFedorov/edk2- > platforms/tree/282_correct_levelid_v1 > > Notes: > v1: > - Change LevelID Value of PLPI package from 1 to 0. > > Platform/ARM/JunoPkg/AcpiTables/Dsdt.asl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/Platform/ARM/JunoPkg/AcpiTables/Dsdt.asl > b/Platform/ARM/JunoPkg/AcpiTables/Dsdt.asl > index > 07e32bae21f891461fde0183028e4c0f817e45a7..702b057757457fee40ddfc10 > e91d38c5dd7ca0b8 100644 > --- a/Platform/ARM/JunoPkg/AcpiTables/Dsdt.asl > +++ b/Platform/ARM/JunoPkg/AcpiTables/Dsdt.asl > @@ -1,7 +1,7 @@ > /** @file >Differentiated System Description Table Fields (DSDT) > > - Copyright (c) 2014-2015, ARM Ltd. All rights reserved. > + Copyright (c) 2014-2018, ARM Ltd. All rights reserved. > This program and the accompanying materials >are licensed and made available under the terms and conditions of the BSD > License >which accompanies this distribution. The full text of the license may be > found at @@ -65,7 +65,7 @@ DefinitionBlock("DsdtTable.aml", "DSDT", 1, > "ARMLTD", "ARM-JUNO", EFI_ACPI_ARM_O >}) >Name(PLPI, Package() { > 0, // Version > -1, // Level Index > +0, // Level Index > 2, // Count > Package() { // WFI for CPU >1, // Min residency (uS) > @@ -157,7 +157,7 @@ DefinitionBlock("DsdtTable.aml", "DSDT", 1, > "ARMLTD", "ARM-JUNO", EFI_ACPI_ARM_O >}) >Name(PLPI, Package() { > 0, // Version > -1, // Level Index > +0, // Level Index > 2, // Count > Package() { // WFI for CPU >1, // Min residency (uS) > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' > ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH] MdeModulePkg CapsuleApp: Fix NestedCapsuleHeader->Flags assigned wrong
(FwType == ESRT_FW_TYPE_DEVICEFIRMWARE) ? system : device should be (FwType == ESRT_FW_TYPE_SYSTEMFIRMWARE) ? system : device Cc: Michael D Kinney Cc: Jiewen Yao Cc: Ming Shao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c index e1e48befc2de..3a1a0a1cb2e6 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c @@ -431,7 +431,7 @@ CreateNestedFmp ( ZeroMem(NestedCapsuleHeader, NESTED_CAPSULE_HEADER_SIZE); CopyGuid(>CapsuleGuid, ImageTypeId); NestedCapsuleHeader->HeaderSize = NESTED_CAPSULE_HEADER_SIZE; - NestedCapsuleHeader->Flags = (FwType == ESRT_FW_TYPE_DEVICEFIRMWARE) ? SYSTEM_FIRMWARE_FLAG : DEVICE_FIRMWARE_FLAG; + NestedCapsuleHeader->Flags = (FwType == ESRT_FW_TYPE_SYSTEMFIRMWARE) ? SYSTEM_FIRMWARE_FLAG : DEVICE_FIRMWARE_FLAG; NestedCapsuleHeader->CapsuleImageSize = (UINT32)FullCapsuleBufferSize; CopyMem((UINT8 *)NestedCapsuleHeader + NestedCapsuleHeader->HeaderSize, CapsuleBuffer, FileSize); -- 2.7.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH 2/2] SignedCapsulePkg RecoveryModuleLoadPei: Fix typo 'Press' to 'Process'
Cc: Michael D Kinney Cc: Jiewen Yao Cc: Ming Shao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- .../Universal/RecoveryModuleLoadPei/RecoveryModuleLoadPei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SignedCapsulePkg/Universal/RecoveryModuleLoadPei/RecoveryModuleLoadPei.c b/SignedCapsulePkg/Universal/RecoveryModuleLoadPei/RecoveryModuleLoadPei.c index c22e3a487f3b..e14427cf5bb0 100644 --- a/SignedCapsulePkg/Universal/RecoveryModuleLoadPei/RecoveryModuleLoadPei.c +++ b/SignedCapsulePkg/Universal/RecoveryModuleLoadPei/RecoveryModuleLoadPei.c @@ -9,7 +9,7 @@ ProcessRecoveryCapsule(), ProcessFmpCapsuleImage(), ProcessRecoveryImage(), ValidateFmpCapsule() will receive untrusted input and do basic validation. -Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved. +Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -703,7 +703,7 @@ ProcessRecoveryCapsule ( } // -// Press EFI FMP Capsule +// Process EFI FMP Capsule // DEBUG((DEBUG_INFO, "ProcessFmpCapsuleImage ...\n")); Status = ProcessFmpCapsuleImage(CapsuleHeader, IsSystemFmp); -- 2.7.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH 0/2] Capsule: Fix typo 'Press' to 'Process'
Cc: Michael D Kinney Cc: Jiewen Yao Cc: Ming Shao Star Zeng (2): MdeModulePkg DxeCapsuleLibFmp: Fix typo 'Press' to 'Process' SignedCapsulePkg RecoveryModuleLoadPei: Fix typo 'Press' to 'Process' MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 2 +- .../Universal/RecoveryModuleLoadPei/RecoveryModuleLoadPei.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.7.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH 1/2] MdeModulePkg DxeCapsuleLibFmp: Fix typo 'Press' to 'Process'
Cc: Michael D Kinney Cc: Jiewen Yao Cc: Ming Shao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c index ab41df0eb0a4..a1347b5ce67c 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c @@ -1425,7 +1425,7 @@ ProcessCapsuleImage ( } // -// Press EFI FMP Capsule +// Process EFI FMP Capsule // DEBUG((DEBUG_INFO, "ProcessFmpCapsuleImage ...\n")); Status = ProcessFmpCapsuleImage(CapsuleHeader); -- 2.7.0.windows.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2] BaseTools/GenFw: Disable support for R_X86_64_32S
Reviewed-by: Liming Gao >-Original Message- >From: Zenith432 [mailto:zenith...@users.sourceforge.net] >Sent: Tuesday, July 10, 2018 4:51 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [PATCH v2] BaseTools/GenFw: Disable support for R_X86_64_32S > > >REF:https://bugzilla.tianocore.org/show_bug.cgi?id=999 > >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Zenith432 >--- > BaseTools/Source/C/GenFw/Elf64Convert.c | 23 >++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c >b/BaseTools/Source/C/GenFw/Elf64Convert.c >index 4636cfee..e42cc3f7 100644 >--- a/BaseTools/Source/C/GenFw/Elf64Convert.c >+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c >@@ -993,7 +993,28 @@ WriteRelocations64 ( > + (Rel->r_offset - SecShdr->sh_addr)), > EFI_IMAGE_REL_BASED_DIR64); > break; >-case R_X86_64_32S: >+// >+// R_X86_64_32 and R_X86_64_32S are ELF64 relocations emitted >when using >+// the SYSV X64 ABI small non-position-independent code model. >+// R_X86_64_32 is used for unsigned 32-bit immediates with a >32-bit >operand >+// size. The value is either not extended, or zero-extended to >64 bits. >+// R_X86_64_32S is used for either signed 32-bit >non-rip-relative >displacements >+// or signed 32-bit immediates with a 64-bit operand size. The >value is >+// sign-extended to 64 bits. >+// EFI_IMAGE_REL_BASED_HIGHLOW is a PE relocation that uses 32- >bit arithmetic >+// for rebasing an image. >+// EFI PE binaries declare themselves >EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE and >+// may load above 2GB. If an EFI PE binary with a converted >R_X86_64_32S >+// relocation is loaded above 2GB, the value will get >sign-extended to >the >+// negative part of the 64-bit address space. The negative >part of the >64-bit >+// address space is unmapped, so accessing such an address page- >faults. >+// In order to support R_X86_64_32S, it is necessary to unset >+// EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE, and the EFI PE loader >must implement >+// this flag and abstain from loading such a PE binary above >2GB. >+// Since this feature is not supported, support for >R_X86_64_32S (and >hence >+// the small non-position-independent code model) is disabled. >+// >+// case R_X86_64_32S: > case R_X86_64_32: > VerboseMsg ("EFI_IMAGE_REL_BASED_HIGHLOW Offset: 0x%08X", > mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - > SecShdr- >>sh_addr)); >-- >2.17.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] question about armclang support
Hi All, May I know is armclang already supported in EDK2? Or only armcc is supported currently? Thanks. Regards, Sau Kae ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH v2] BaseTools/GenFw: Disable support for R_X86_64_32S
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=999 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zenith432 --- BaseTools/Source/C/GenFw/Elf64Convert.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c index 4636cfee..e42cc3f7 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -993,7 +993,28 @@ WriteRelocations64 ( + (Rel->r_offset - SecShdr->sh_addr)), EFI_IMAGE_REL_BASED_DIR64); break; -case R_X86_64_32S: +// +// R_X86_64_32 and R_X86_64_32S are ELF64 relocations emitted when using +// the SYSV X64 ABI small non-position-independent code model. +// R_X86_64_32 is used for unsigned 32-bit immediates with a 32-bit operand +// size. The value is either not extended, or zero-extended to 64 bits. +// R_X86_64_32S is used for either signed 32-bit non-rip-relative displacements +// or signed 32-bit immediates with a 64-bit operand size. The value is +// sign-extended to 64 bits. +// EFI_IMAGE_REL_BASED_HIGHLOW is a PE relocation that uses 32-bit arithmetic +// for rebasing an image. +// EFI PE binaries declare themselves EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE and +// may load above 2GB. If an EFI PE binary with a converted R_X86_64_32S +// relocation is loaded above 2GB, the value will get sign-extended to the +// negative part of the 64-bit address space. The negative part of the 64-bit +// address space is unmapped, so accessing such an address page-faults. +// In order to support R_X86_64_32S, it is necessary to unset +// EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE, and the EFI PE loader must implement +// this flag and abstain from loading such a PE binary above 2GB. +// Since this feature is not supported, support for R_X86_64_32S (and hence +// the small non-position-independent code model) is disabled. +// +// case R_X86_64_32S: case R_X86_64_32: VerboseMsg ("EFI_IMAGE_REL_BASED_HIGHLOW Offset: 0x%08X", mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr)); -- 2.17.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] question about uefi shell pipe.
Hi,liming: the files attached to this mail may be missed,so I had made a copy here: https://github.com/testcheng307/UEFI-TEST the question is in first mail,I repeat it here: # test-1,the follow two command should has the same output ,but infact not the same in QEMU,and the second command failed WriteFile in real machine(AMI bios uefi 2.6): # the smalltest.efi 's fullsource code is in my first mail; ls | smalltest.efi ls | smalltest.efi | smalltest.efi #test-2 run smalltest.efi, just key in some chars, and I can not end input by press Enter or[Ctrl+C] or [Ctrl+Z], so nothing output,why? #test-3,the follow two command will be the same. ls | grep -trim-last 0 ls | grep -trim-last 0 | grep -trim-last 0 # my grep.efi tool will process input buffer like this: 1,before pipe out the buffer,trim off all in-visible wchars at end of this buffer, (the trimed of wchar is "like ASCII's range of" 0x~0x0020. ) 2,always make sure outputBuffer[lastTwoWchar] = { 0x000A,0x000D },it will also bypass many other strange result. thank you, by krishna. At 2018-07-09 15:17:56, "Gao, Liming" wrote: >Krishna: > Sorry, I am not clear what's your question here? Would you like to share this > grep.efi tool? Or you meet with the problem in this grep.efi tool? > >Thanks >Liming >>-Original Message- >>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of >>krishnaLee >>Sent: Friday, July 06, 2018 11:35 AM >>To: krishnaLee >>Cc: edk2-devel@lists.01.org >>Subject: Re: [edk2] question about uefi shell pipe. >> >> >> >>Hi,All: >>may be I should reply this to EDK2 group,I had attached my file again. >> >> >>After many test,my right key of "ls | grep -trim-last 0 | grep -trim-last 0" >>is: >> 1,before pipe out the buffer,trim off all in-visible wchars at end of this >> buffer, >>(the trimed of wchar is "like ASCII's range of" 0x~0x0020. ) >> 2,always make sure outputBuffer[lastTwoWchar] = { 0x000A,0x000D },it will >>also bypass many other strange result. >> >> >>thank you, >>by krishna. >> >> >> >> >> >>At 2018-07-06 11:07:05, "krishnaLee" wrote: >> >>Jim, >>I attached the smalltest.efi if you have not compiled the test code. >> >> >>I am in developing of this grep.efi tool,I can now bypass the test-1 question >>by follow command: >>ls | grep -trim-last 0 >>ls | grep -trim-last 0 | grep -trim-last 0 >> >> >>I also attached this grep.efi tool, it almost ok :) >> >> >>//draft usage guide- >> >> >>//if find ok,returncode 1,Print(string);else returncode 0; >>grep.efi -find string >> >> >>//get first word, >>//the front and the end in-visible chars of this word will be trimed off; >>grep.efi -first >> >> >>//get back part after the string. >> >>grep.efi -begin-at string >> >> >>//get front part before the string >>grep.efi -end-at string >> >> >>//trim off first n chars at front >>//before start -trim-first,the front in-visible chars will be trimed off; >>grep.efi -trim-first n >> >> >>//trim off back n chars at end, >>//before start -trim-last,the end in-visible chars will be trimed off; >>grep.efi -trim-last n >> >> >>//trim off whitespace at front and end, >>//trim off in-visible chars infact; >>grep.efi -trim-space >> >> >> >> >>thank you, >>by krishna. >>___ >>edk2-devel mailing list >>edk2-devel@lists.01.org >>https://lists.01.org/mailman/listinfo/edk2-devel ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch 0/2] Fixed correct password not works issue
The series looks good to me. Reviewed-by: Hao Wu Best Regards, Hao Wu > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Eric > Dong > Sent: Tuesday, July 10, 2018 12:02 PM > To: edk2-devel@lists.01.org > Subject: [edk2] [Patch 0/2] Fixed correct password not works issue > > Opal device may have an count in firmware to decide whether to resistent > user input password. If yes, even correct password will be reject by device > firmware. This count will be reset only after an cold reboot or user input > correct password. > > Opal driver also has an internal count to decide whether allowed user to input > password. A reboot (code or hot) action will reset this count. > > Current implementation just base on the count in opal driver to decide whether > allow user to input password again. In this case, if the count in opal device > already exceeded, even an correct password will be rejected. > > New solution will check both count, either cout exceed will cause opal driver > report count exceed and a shutdown required. > > Eric Dong (2): > SecurityPkg/TcgStorageOpalLib: Return AUTHORITY_LOCKED_OUT error. > SecurityPkg/OpalPassword: Fixed input correct password not works issue > > SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c | 10 +- > SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 9 + > 2 files changed, 18 insertions(+), 1 deletion(-) > > -- > 2.15.0.windows.1 > > ___ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch] BaseTools: Fix the bug that incorrect size info in the Lib autogen
Reviewed-by: Liming Gao >-Original Message- >From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of >Yonghong Zhu >Sent: Monday, July 09, 2018 8:16 PM >To: edk2-devel@lists.01.org >Subject: [edk2] [Patch] BaseTools: Fix the bug that incorrect size info in the >Lib >autogen > >The case is a PCD used in one library only, and in DSC component >section the PCD value is override in one of module inf. Then it cause >the bug the PCD size in the Lib autogen use the PCD value in the DSC >PCD section, but not use the override value. > >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/AutoGen/AutoGen.py | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py >b/BaseTools/Source/Python/AutoGen/AutoGen.py >index 6d76afd..3908697 100644 >--- a/BaseTools/Source/Python/AutoGen/AutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py >@@ -1291,16 +1291,21 @@ class PlatformAutoGen(AutoGen): > for LibAuto in self.LibraryAutoGenList: > FixedAtBuildPcds = {} > ShareFixedAtBuildPcdsSameValue = {} > for Module in LibAuto._ReferenceModules: > for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds: >+DefaultValue = Pcd.DefaultValue >+# Cover the case: DSC component override the Pcd value >and the >Pcd only used in one Lib >+if Pcd in Module.LibraryPcdList: >+Index = Module.LibraryPcdList.index(Pcd) >+DefaultValue = >Module.LibraryPcdList[Index].DefaultValue > key = ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) > if key not in FixedAtBuildPcds: > ShareFixedAtBuildPcdsSameValue[key] = True >-FixedAtBuildPcds[key] = Pcd.DefaultValue >+FixedAtBuildPcds[key] = DefaultValue > else: >-if FixedAtBuildPcds[key] != Pcd.DefaultValue: >+if FixedAtBuildPcds[key] != DefaultValue: > ShareFixedAtBuildPcdsSameValue[key] = False > for Pcd in LibAuto.FixedAtBuildPcds: > key = ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) > if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in >self.NonDynamicPcdDict: > continue >-- >2.6.1.windows.1 > >___ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v4] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw
Reviewed-by: Liming Gao >-Original Message- >From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of >Zenith432 >Sent: Monday, July 09, 2018 8:58 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [edk2] [PATCH v4] BaseTools/GenFw: Add X64 GOTPCREL Support to >GenFw > > >Adds support for the following X64 ELF relocations to GenFw > R_X86_64_GOTPCREL > R_X86_64_GOTPCRELX > R_X86_64_REX_GOTPCRELX > >Background: >The GCC49 and GCC5 toolchains use the small pie model for X64. In the >small pie model, gcc emits a GOTPCREL relocation whenever C code takes >the address of a global function. The emission of GOTPCREL is mitigated >by several factors >1. In GCC49, all global symbols are declared hidden thereby eliminating >the emission of GOTPCREL. >2. In GCC5, LTO is used. In LTO, the complier first creates intermediate >representation (IR) files. During the static link stage, the LTO compiler >combines all IR files as a single compilation unit, using linker symbol >assistance to generate code. Any global symbols defined in the IR that >are not referenced from outside the IR are converted to local symbols - >thereby eliminating the emission of GOTPCREL for them. >3. The linker (binutils ld) further transforms any GOTPCREL used with >the movq opcode to a direct rip-relative relocation used with the leaq >opcode. This linker optimization can be disabled with the option >-Wl,--no-relax. Furthermore, gcc is able to emit GOTPCREL with other >opcodes > - pushq opcode for passing arguments to functions. > - addq/subq opcodes for pointer arithmetic. >These other opcode uses are not transformed by the linker. >Ultimately, in GCC5 there are some emissions of GOTPCREL that survive >all these mitigations - if C code takes the address of a global function >defined in assembly code - and performs pointer arithmetic on the >address - then the GOTPCREL remains in the final linker product. >A GOTPCREL relocation today causes the build to stop since GenFw does >not handle them. It is possible to eliminate any remaining GOTPCREL >emissions by manually declaring the global symbols causing them to have >hidden visibility. This patch is offered instead to allow GenFw to >handle any residual GOTPCREL. > >Cc: Shi Steven >Cc: Yonghong Zhu >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Zenith432 >--- > BaseTools/Source/C/GenFw/Elf64Convert.c | 203 >+++- > BaseTools/Source/C/GenFw/elf_common.h | 17 ++ > 2 files changed, 219 insertions(+), 1 deletion(-) > >diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c >b/BaseTools/Source/C/GenFw/Elf64Convert.c >index 4636cfee..90351125 100644 >--- a/BaseTools/Source/C/GenFw/Elf64Convert.c >+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c >@@ -94,6 +94,15 @@ STATIC Elf_Ehdr *mEhdr; > STATIC Elf_Shdr *mShdrBase; > STATIC Elf_Phdr *mPhdrBase; > >+// >+// GOT information >+// >+STATIC Elf_Shdr *mGOTShdr = NULL; >+STATIC UINT32 mGOTShindex = 0; >+STATIC UINT32 *mGOTCoffEntries = NULL; >+STATIC UINT32 mGOTMaxCoffEntries = 0; >+STATIC UINT32 mGOTNumCoffEntries = 0; >+ > // > // Coff information > // >@@ -322,6 +331,134 @@ GetSymName ( > return StrtabContents + Sym->st_name; > } > >+// >+// Find the ELF section hosting the GOT from an ELF Rva >+// of a single GOT entry. Normally, GOT is placed in >+// ELF .text section, so assume once we find in which >+// section the GOT is, all GOT entries are there, and >+// just verify this. >+// >+STATIC >+VOID >+FindElfGOTSectionFromGOTEntryElfRva ( >+ Elf64_Addr GOTEntryElfRva >+ ) >+{ >+ UINT32 i; >+ if (mGOTShdr != NULL) { >+if (GOTEntryElfRva >= mGOTShdr->sh_addr && >+GOTEntryElfRva < mGOTShdr->sh_addr + mGOTShdr->sh_size) { >+ return; >+} >+Error (NULL, 0, 3000, "Unsupported", >"FindElfGOTSectionFromGOTEntryElfRva: GOT entries found in multiple >sections."); >+exit(EXIT_FAILURE); >+ } >+ for (i = 0; i < mEhdr->e_shnum; i++) { >+Elf_Shdr *shdr = GetShdrByIndex(i); >+if (GOTEntryElfRva >= shdr->sh_addr && >+GOTEntryElfRva < shdr->sh_addr + shdr->sh_size) { >+ mGOTShdr = shdr; >+ mGOTShindex = i; >+ return; >+} >+ } >+ Error (NULL, 0, 3000, "Invalid", "FindElfGOTSectionFromGOTEntryElfRva: >ElfRva 0x%016LX for GOT entry not found in any section.", GOTEntryElfRva); >+ exit(EXIT_FAILURE); >+} >+ >+// >+// Stores locations of GOT entries in COFF image. >+// Returns TRUE if GOT entry is new. >+// Simple implementation as number of GOT >+// entries is expected to be low. >+// >+ >+STATIC >+BOOLEAN >+AccumulateCoffGOTEntries ( >+ UINT32 GOTCoffEntry >+ ) >+{ >+ UINT32 i; >+ if (mGOTCoffEntries != NULL) { >+for (i = 0; i < mGOTNumCoffEntries; i++) { >+ if (mGOTCoffEntries[i] == GOTCoffEntry) { >+return FALSE; >+ } >+} >+ } >+ if (mGOTCoffEntries == NULL) { >+mGOTCoffEntries = (UINT32*)malloc(5 * sizeof *mGOTCoffEntries); >+if
Re: [edk2] [PATCH] BaseTools/GenFw: Disable support for R_X86_64_32S
Zenith: Thanks for your contribution. Please comment case R_X86_64_32S: instead of #if 0 xxx #endif. Thanks Liming >-Original Message- >From: Zenith432 [mailto:zenith...@users.sourceforge.net] >Sent: Monday, July 09, 2018 5:37 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [PATCH] BaseTools/GenFw: Disable support for R_X86_64_32S > > >REF:https://bugzilla.tianocore.org/show_bug.cgi?id=999 > >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Zenith432 >--- > BaseTools/Source/C/GenFw/Elf64Convert.c | 23 >+++ > 1 file changed, 23 insertions(+) > >diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c >b/BaseTools/Source/C/GenFw/Elf64Convert.c >index 4636cfee..a4feaf7c 100644 >--- a/BaseTools/Source/C/GenFw/Elf64Convert.c >+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c >@@ -993,7 +993,30 @@ WriteRelocations64 ( > + (Rel->r_offset - SecShdr->sh_addr)), > EFI_IMAGE_REL_BASED_DIR64); > break; >+#if 0 >+// >+// R_X86_64_32 and R_X86_64_32S are ELF64 relocations emitted >when using >+// the SYSV X64 ABI small non-position-independent code model. >+// R_X86_64_32 is used for unsigned 32-bit immediates with a >32-bit >operand >+// size. The value is either not extended, or zero-extended to >64 bits. >+// R_X86_64_32S is used for either signed 32-bit >non-rip-relative >displacements >+// or signed 32-bit immediates with a 64-bit operand size. The >value is >+// sign-extended to 64 bits. >+// EFI_IMAGE_REL_BASED_HIGHLOW is a PE relocation that uses 32- >bit arithmetic >+// for rebasing an image. >+// EFI PE binaries declare themselves >EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE and >+// may load above 2GB. If an EFI PE binary with a converted >R_X86_64_32S >+// relocation is loaded above 2GB, the value will get >sign-extended to >the >+// negative part of the 64-bit address space. The negative >part of the >64-bit >+// address space is unmapped, so accessing such an address page- >faults. >+// In order to support R_X86_64_32S, it is necessary to unset >+// EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE, and the EFI PE loader >must implement >+// this flag and abstain from loading such a PE binary above >2GB. >+// Since this feature is not supported, support for >R_X86_64_32S (and >hence >+// the small non-position-independent code model) is disabled. >+// > case R_X86_64_32S: >+#endif > case R_X86_64_32: > VerboseMsg ("EFI_IMAGE_REL_BASED_HIGHLOW Offset: 0x%08X", > mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - > SecShdr- >>sh_addr)); >-- >2.17.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel