Re: [edk2] [PATCH 1/2] MdePkg: Fix bug in CatVSPrint introduced by r17742

2015-07-03 Thread Qiu, Shumin
Reviewed-by: Qiu Shumin -Original Message- From: Heyi Guo [mailto:heyi@linaro.org] Sent: Friday, July 03, 2015 5:35 PM To: edk2-devel@lists.sourceforge.net Subject: [edk2] [PATCH 1/2] MdePkg: Fix bug in CatVSPrint introduced by r17742 SVN r17742 uses AllocateCopyPool to replace All

Re: [edk2] [PATCH 2/2] ShellPkg: Fix bug introduced by r17730

2015-07-03 Thread Qiu, Shumin
Reviewed-by: Qiu Shumin -Original Message- From: Heyi Guo [mailto:heyi@linaro.org] Sent: Friday, July 03, 2015 5:35 PM To: edk2-devel@lists.sourceforge.net Subject: [edk2] [PATCH 2/2] ShellPkg: Fix bug introduced by r17730 CurrentFilePattern is only part of FilePattern and will be

Re: [edk2] [PATCH] CryptoPkg: Allow the depth zero self-signed certificate

2015-07-03 Thread Long, Qin
Gary, I couldn't find the rpm binary from the link you provided. Please help to double-check the repository or share me the binary directly. Locally, I created one self-signed cert (using makecert utility) for testing, and the test result looks good under openssl 1.0.2c build. Bypassing X509

[edk2] [Patch 10/28] UefiCpuPkg: Add PcdCpuApInitTimeOutInMicroSeconds

2015-07-03 Thread Jeff Fan
This PCD is used to specify timeout value for BSP to detect all APs for the first time. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/UefiCpuPkg.dec | 7 ++- 1 file changed, 6 insertions(+), 1

[edk2] [Patch 08/28] UefiCpuPkg/CpuMpPei: Get AP reset code size and far jump information

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.h| 23 +++ UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm | 16 UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.

[edk2] [Patch 07/28] UefiCpuPkg/CpuMpPei: Initialize FPU per UEFI specification

2015-07-03 Thread Jeff Fan
Invoke InitializeFloatingPointUnits() to initialize FPU per UEFI specification before call C function in assembly code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.h| 1

[edk2] [Patch 25/28] UefiCpuPkg/CpuMpPei: Implementation of PeiEnableDisableAP ()

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/PeiMpServices.c | 87 + UefiCpuPkg/CpuMpPei/PeiMpServices.h | 50 + 2 files changed, 1

[edk2] [Patch 15/28] UefiCpuPkg: Add some CPUID definitions

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/Include/Register/LocalApic.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/Include/Register/LocalApic.h b/UefiCp

[edk2] [Patch 00/28] UefiCpuPkg: Add CpuMpPei install PI CPU MP PPI

2015-07-03 Thread Jeff Fan
PI 1.4 introduced CPU MP PPI to provide MP service in PEI. This serial patches include: A. Added three PCDs in UefiCpuPkg: PcdCpuApInitTimeOutInMicroSeconds, PcdCpuMicrocodePatchAddress and PcdCpuMicrocodePatchRegionSize. B. Added some CPU ID definitions in Include\Register\LocalApic.h. C. Added

[edk2] [Patch 09/28] UefiCpuPkg/CpuMpPei: Prepare for buffer for AP wakeup and CPU MP data

2015-07-03 Thread Jeff Fan
Get AP wakeup buffer and copy AP reset code into it. Allocate APs' stack and CPU MP data buffer. Fill CPU MP data fields accordingly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPe

[edk2] [Patch 14/28] UefiCpuPkg: Add microcode PCDs

2015-07-03 Thread Jeff Fan
Add PCDs PcdCpuMicrocodePatchAddress and PcdCpuMicrocodePatchRegionSize that are used to detect microcode patch from microcode region. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/UefiCpuPkg.dec

[edk2] [Patch 18/28] UefiCpuPkg/CpuMpPei: Update and publish CPU BIST information

2015-07-03 Thread Jeff Fan
Get CPU BIST information from SEC Platform Information(2) PPIs and update them accordingly. Install(Reinstall) SEC Platform Information2 PPI to published the new CPU BIST. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Ki

[edk2] [Patch 13/28] UefiCpuPkg/CpuMpPei: Sync BPS's mtrr setting to APs

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 8 UefiCpuPkg/CpuMpPei/CpuMpPei.h | 2 ++ UefiCpuPkg/CpuMpPei/CpuMpPei.inf | 1 + 3 files changed, 11 insertions(+)

[edk2] [Patch 05/28] UefiCpuPkg/CpuMpPei: Add AP reset IA32 assembly code

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/Ia32/MpEqu.inc| 12 UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm | 117 ++ UefiCpuPkg/CpuMpPei/Ia32/MpFuncs

[edk2] [Patch 20/28] UefiCpuPkg/CpuMpPei: Implementation of PeiGetNumberOfProcessors ()

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/PeiMpServices.c | 82 + UefiCpuPkg/CpuMpPei/PeiMpServices.h | 46 + 2 files changed, 1

[edk2] [Patch 23/28] UefiCpuPkg/CpuMpPei: Implementation of PeiStartupThisAP ()

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/PeiMpServices.c | 126 UefiCpuPkg/CpuMpPei/PeiMpServices.h | 62 ++ 2 files changed, 188

[edk2] [Patch 01/28] UefiCpuPkg: Add CpuMpPei module

2015-07-03 Thread Jeff Fan
This module is to provide MP PPI services defined in PI 1.4. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.c| 41 +++ UefiCpuPkg/CpuMpPei/CpuMpPe

[edk2] [Patch 22/28] UefiCpuPkg/CpuMpPei: Implementation of PeiStartupAllAPs ()

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 14 +++ UefiCpuPkg/CpuMpPei/CpuMpPei.h | 34 +++ UefiCpuPkg/CpuMpPei/PeiMpServices.c | 188 ++

[edk2] [Patch 16/28] UefiCpuPkg/CpuMpPei: Load microcode on BSP and APs

2015-07-03 Thread Jeff Fan
Add DetectMicrocode() to load microcode on BSP and APs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 8 +- UefiCpuPkg/CpuMpPei/CpuMpPei.h | 5 + UefiCpuPkg/CpuMpPei/

[edk2] [Patch 04/28] UefiCpuPkg/CpuMpPei: Add MP exchange structure definition

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.h b/UefiCpuPkg/CpuMpPei/CpuMp

[edk2] [Patch 24/28] UefiCpuPkg/CpuMpPei: Implementation of PeiSwitchBSP ()

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.h| 12 UefiCpuPkg/CpuMpPei/Ia32/MpEqu.inc| 4 ++ UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm | 79

[edk2] [Patch 17/28] UefiCpuPkg/CpuMpPei: Build one GUIDed HOB to save CPU MP Data

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 33 + 1 file changed, 33 insertions(+) diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/UefiCpuPkg/

[edk2] [Patch 12/28] UefiCpuPkg/CpuMpPei: Sort APIC ID in ascending order

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 60 ++ 1 file changed, 60 insertions(+) diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/Ue

[edk2] [Patch 28/28] UefiCpuPkg/CpuMpPei: Register callback on End Of Pei PPI

2015-07-03 Thread Jeff Fan
Add CpuMpEndOfPeiCallback () to restore wakeup buffer data on S3 path and flag flag wakeup buffer to be un-used type on normal boot path. Set one EndOfPei flag save/restore wakeup buffer when wakeup APs every time. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC

[edk2] [Patch 02/28] UefiCpuPkg/CpuMpPei: Load GDT table on BSP

2015-07-03 Thread Jeff Fan
Load new GDT table and update segment accordingly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.c| 28 ++ UefiCpuPkg/CpuMpPei/CpuMpPei.h| 30

[edk2] [Patch 21/28] UefiCpuPkg/CpuMpPei: Implementation of PeiGetProcessorInfo ()

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/PeiMpServices.c | 191 UefiCpuPkg/CpuMpPei/PeiMpServices.h | 36 +++ 2 files changed, 227 insertions

[edk2] [Patch 19/28] UefiCpuPkg/CpuMpPei: Implementation of PeiWhoAmI ()

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.h | 1 + UefiCpuPkg/CpuMpPei/CpuMpPei.inf| 2 + UefiCpuPkg/CpuMpPei/PeiMpServices.c | 94 +

[edk2] [Patch 26/28] UefiCpuPkg/CpuMpPei: Install PI CPU MP PPI

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 9 +++-- UefiCpuPkg/CpuMpPei/CpuMpPei.h | 2 ++ UefiCpuPkg/CpuMpPei/CpuMpPei.inf| 1 + UefiCpuPkg/CpuMpPei/P

[edk2] [Patch 27/28] UefiCpuPkg/CpuMpPei: Add AsmHltLoop ()

2015-07-03 Thread Jeff Fan
Add AsmHltLoop () in assembly code, it will not be copied into AP wakeup buffer and invoked at end of ApCFunction (). To make sure AP work in case AP wakeup buffer is restored to original data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiew

[edk2] [Patch 03/28] UefiCpuPkg/CpuMpPei: Find available memory < 1MB for AP reset code

2015-07-03 Thread Jeff Fan
Search memory resource HOB list to find one available system memory under 1MB for AP reset code and exchange information between BSP and APs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei

[edk2] [Patch 06/28] UefiCpuPkg/CpuMpPei: Add AP reset x64 assembly code

2015-07-03 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/X64/MpEqu.inc| 17 UefiCpuPkg/CpuMpPei/X64/MpFuncs.asm | 154 +++ UefiCpuPkg/CpuMpPei/X64/MpFuncs.n

[edk2] [Patch 11/28] UefiCpuPkg/CpuMpPei: Wakeup APs and collect AP count

2015-07-03 Thread Jeff Fan
BSP will send broadcast INIT Startup IPI to all APs and collect APs count and BIST information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan CC: Feng Tian CC: Jiewen Yao CC: Michael Kinney --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 119 ++

Re: [edk2] [PATCH 2/2] ShellPkg: Fix bug introduced by r17730

2015-07-03 Thread Ard Biesheuvel
On 3 July 2015 at 11:34, Heyi Guo wrote: > CurrentFilePattern is only part of FilePattern and will be less than > or equal to FilePattern. If we use StrCpyS to replace StrnCpy, it > will cause assert when FilePattern is longer. > > The bug can be replayed when we cd to one directory and run ls > c

Re: [edk2] [PATCH 1/2] MdePkg: Fix bug in CatVSPrint introduced by r17742

2015-07-03 Thread Heyi Guo
BufferToReturn = AllocateCopyPool(SizeRequired, String); It will touch the address out of the scope of String. Though it is only read operation, I think we'd better not touch it, once the String were allocated at the boundary of memory region. Also the patch reverts part of the changes in r17

Re: [edk2] [PATCH 1/2] MdePkg: Fix bug in CatVSPrint introduced by r17742

2015-07-03 Thread Ard Biesheuvel
On 3 July 2015 at 11:34, Heyi Guo wrote: > SVN r17742 uses AllocateCopyPool to replace AllocateZeroPool, however > String can be NULL and this will trigger assert in AllocateCopyPool. > Error Can be replayed when we use "cd " command under Shell. > > Just use a more conservative way to replace uns

[edk2] [PATCH 1/6] MdePkg/BasePeCoffLib: remove redundant PeCoffLoaderEx.c for AARCH64

2015-07-03 Thread Ard Biesheuvel
The AARCH64 specific implementations of PeCoffLoaderRelocateImageEx and PeHotRelocateImageEx only handle EFI_IMAGE_REL_BASED_DIR64 relocations. Since these are already handled by the respective callers, this is essentially dead code and can be removed. So add IMAGE_FILE_MACHINE_ARM64 support to th

[edk2] [PATCH 3/6] MdePkg/BasePeCoffLib: account for carry in high/low relocation pairs

2015-07-03 Thread Ard Biesheuvel
Relocations of types EFI_IMAGE_REL_BASED_HIGH and EFI_IMAGE_REL_BASED_LOW occur in pairs, where each of the pair relocates a 16-bit word half of a 32-bit dword. Since the target of the relocation arithmetic is a 32-bit quantity, we should handle a carry that may occur in the low word relocation, b

[edk2] [PATCH 6/6] MdeModulePkg/RuntimeDxe: update to new RelocateImageForRuntime() prototype

2015-07-03 Thread Ard Biesheuvel
When reapplying PE/COFF relocations for the switch to virtual mode, we should not assume that the virtual memory image is identical to the PE/COFF file image, since PE/COFF sections may no longer be adjacent in virtual memory. The prototype and implementation of PeCoffLoaderRelocateImageForRuntime

[edk2] [PATCH 5/6] MdePkg/BasePeCoffLib: relocate for runtime using ConvertPointer callback

2015-07-03 Thread Ard Biesheuvel
The OS is not required to preserve the relative offsets between RuntimeServicesCode and RuntimeServicesData memory regions when switching to virtual mode. This does not present any problems as long as PE/COFF images in memory are covered by only a single region. However, with the introduction of t

[edk2] [PATCH 2/6] MdePkg/BasePeCoffLib: remove redundant handling of EFI_IMAGE_REL_BASED_DIR64

2015-07-03 Thread Ard Biesheuvel
The IPF implementation of PeHotRelocateImageEx () handles relocations of type EFI_IMAGE_REL_BASED_DIR64. However, since the caller already handles this type, this is essentially dead code and can be removed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ---

[edk2] [PATCH 4/6] MdePkg/BasePeCoffLib: fix handling of high/low relocation pairs

2015-07-03 Thread Ard Biesheuvel
PeCoffLoaderRelocateImageForRuntime () reapplies relocations to prepare PE/COFF images for being invoked via a runtime virtual mapping. Since the image has already been executed at this point, it takes care to only update pointers that hold the same value they held at image load time. However, thi

[edk2] [PATCH 0/6] fix runtime relocation of disjoint PE/COFF images

2015-07-03 Thread Ard Biesheuvel
This is a followup to the patch I sen yesterday: http://article.gmane.org/gmane.comp.bios.tianocore.devel/16647 I should know better than to propose changes to MdePkg, but in this case, I think the issues around the MemoryProtectionAttribute are severe enough to warrant drastic measures. Patches

[edk2] [PATCH 1/2] MdePkg: Fix bug in CatVSPrint introduced by r17742

2015-07-03 Thread Heyi Guo
SVN r17742 uses AllocateCopyPool to replace AllocateZeroPool, however String can be NULL and this will trigger assert in AllocateCopyPool. Error Can be replayed when we use "cd " command under Shell. Just use a more conservative way to replace unsafe StrCpy. Contributed-under: TianoCore Contribut

[edk2] [PATCH 0/2] Fix some bugs of replacing unsafe string functions

2015-07-03 Thread Heyi Guo
I found EFI Shell triggers ASSERT on QEMU AARCH64 when I run "cd" command and then "ls" command, with EDK2 DEBUG version. These are 2 bugs I found which were introduced by unsafe string functions replacement. We may need more review on these commits, especially for using Str***S to replace Strn**

[edk2] [PATCH 2/2] ShellPkg: Fix bug introduced by r17730

2015-07-03 Thread Heyi Guo
CurrentFilePattern is only part of FilePattern and will be less than or equal to FilePattern. If we use StrCpyS to replace StrnCpy, it will cause assert when FilePattern is longer. The bug can be replayed when we cd to one directory and run ls command. Contributed-under: TianoCore Contribution Ag

Re: [edk2] [PATCH v2 1/2] MdeModulePkg: Add HttpLib to MdeModulePkg.

2015-07-03 Thread Ye, Ting
Reviewed-by: Ye Ting -Original Message- From: Fu Siyuan [mailto:siyuan...@intel.com] Sent: Thursday, July 02, 2015 5:03 PM To: edk2-devel@lists.sourceforge.net Subject: [edk2] [PATCH v2 1/2] MdeModulePkg: Add HttpLib to MdeModulePkg. This patch add the header file and DXE implementatio

Re: [edk2] [PATCH] CryptoPkg: Allow the depth zero self-signed certificate

2015-07-03 Thread Gary Ching-Pang Lin
On Fri, Jul 03, 2015 at 06:05:53AM +, Long, Qin wrote: > Hi, Gary, > > Is it one new issue brought by 1.0.2c? > X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT will also be issued in 0.9.8xx. The > 1.0.2c just add one new function cert_self_signed() to simplify the > self-signed certificate checking

Re: [edk2] [PATCH] CryptoPkg: Allow the depth zero self-signed certificate

2015-07-03 Thread Long, Qin
Gary, Could you provide more information about this patch? E.g. What's the real scenario? X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT will be issued when the image signer is one self-signed certificate, and this cert could not be found at the trusted store. In my opinion, the simple ignore about t

[edk2] [patch] IntelFspWrapperPkg: FspInitPei GetStackInfo() function calling parameters not match with the function definition

2015-07-03 Thread Yao, Jiewen
In the EDKII open source package: IntelFspWrapperPkg, In the file FspInitPeiV1.c and FspInitPeiV2.c, there are function calling: GetStackInfo (BootMode, FALSE, &StackBase, &StackSize); But the function GetStackInfo() defined as EFI_STATUS EFIAPI GetStackInfo ( IN UINT32 BootM