summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-12-08ArmPlatformPkg: remove unused PL301Axi driverArd Biesheuvel3-156/+0
No platforms use this driver so remove it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08ArmPlatformPkg/LcdGraphicsOutputDxe: move headers into driver directoryArd Biesheuvel4-4/+2
The HdLcd.h and PL111Lcd.h header files are internal headers that should not be used by other drivers. So move them from Include/Drivers into the driver directory instead. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08ArmPlatformPkg: add missing library class declarations to .dec fileArd Biesheuvel1-0/+3
Add ArmPlatformLib, LcdPlatformlib and NorFlashPlatformLib to the [LibraryClasses] section of ArmPlatformPkg.dec. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08ArmPlatformPkg: remove old PL011UartLib implementationArd Biesheuvel3-802/+0
Remove the PL011UartLib implementation that has been superseded by the one under Library/ Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08ArmPlatformPkg: remove BootMonFs and ArmShellCmdRunAxfArd Biesheuvel24-6215/+0
These modules have been imported into edk2-platforms where they belong so remove them from the main EDK2 branch. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08ArmPlatformPkg: remove ArmPlatformSysConfigLib library classArd Biesheuvel3-176/+0
The only remaining user of ArmPlatformSysConfigLib has absorbed this definition into its own edk2-platforms package, so let's remove it from the shared code. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08ArmPlatformPkg: remove ArmVExpressPkgArd Biesheuvel32-4064/+0
Remove ArmVExpressPkg from EDK2 now that its contents have moved into edk2-platforms/Platform/ARM where they belong. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08ArmPlatformPkg: remove NorFlashArmVExpressLibArd Biesheuvel2-116/+0
Remove NorFlashArmVExpressLib now that it has been moved into edk2-platforms where it belongs. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08BaseTool/tools_def GCC5: enable optimization for ARM/AARCH64 DEBUG buildsArd Biesheuvel1-4/+4
Enable optimization for DEBUG builds, to make it more usable in terms of performance, and to give more coverage to the LTO builds. Also, some diagnostics are only enabled when optimization is enabled. NOOPT builds can now also be created, which will retain the behavior DEBUG builds had previously. Note that this aligns ARM and AARCH64 with the x86 architectures, which already use optimization for DEBUG builds. In order to preserve existing behavior for users of older toolchains, keep GCC49 and older as-is. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-08BaseTools/tools_def CLANG38: add -Wno-unused-const-variableArd Biesheuvel1-1/+1
Commit 8b6366f87584 ("BaseTools/GCC: set -Wno-unused-const-variable on RELEASE builds") suppresses warnings about unused constant variables in RELEASE builds when building with GCC, given that they break the build under our warnings-as-errors policy. Do the same for CLANG38. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=790 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Shi Steven <steven.shi@intel.com> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-08BaseTools/tools_def: add CLANG38 LTO versions for AARCH64 and ARMArd Biesheuvel1-3/+95
Extend the CLANG38 toolchain definition so it can be used for ARM and AARCH64 as well. Note that this requires llvm-ar and the LLVMgold.so linker plugin. In preparation of doing the same for GCC5, this toolchain version also departs from the custom of using -O0 for DEBUG builds, which makes them needlessly slow. Instead, let's add a NOOPT flavor as well, and enable optimization for DEBUG like the other architectures do. (Note that this will require some trivial changes to the platform description files) Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-08BaseTools: align ERROR/WARNING/RETURN macros with MdePkg versionsLeif Lindholm2-4/+5
BaseTools' BaseTypes.h defined the ENCODE_ERROR macro as #define ENCODE_ERROR(a) ((RETURN_STATUS)(MAX_BIT | (a))) whereas MdePkg defines it as #define ENCODE_ERROR(StatusCode) ((RETURN_STATUS)(MAX_BIT | (StatusCode))) When building with GCC 6.3 (at least) the former triggers "error: overflow in implicit constant conversion [-Werror=overflow]" Resolve this by aligning it with the latter one. This also requires aligning the BaseTools typedef of RETURN_STATUS with the MdePkg one: INTN -> UINTN. While at it, update adjacent ENCODE_WARNING and RETURN_ERROR as well. Add an explicit initialization of *Alignment to 0 in GenFfs.c GetAlignmentFromFile to get rid of a warning occuring with GCC after this change (-Werror=maybe-uninitialized). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-08MdeModulePkg/DxeIpl: Enable paging for Stack GuardJian J Wang4-15/+46
Stack guard feature makes use of paging mechanism to monitor if there's a stack overflow occurred during boot. This patch will check setting of PCD PcdCpuStackGuard. If it's TRUE, DxeIpl will setup page table and set the page at which the stack base locates to be NOT PRESENT. If stack is used up and memory access cross into the last page of it, #PF exception will be triggered. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08MdeModulePkg/Core/Dxe: Call new API InitializeCpuExceptionHandlersEx insteadJian J Wang1-1/+1
Original API InitializeCpuExceptionHandlers is used in DxeMain to initialize exception handlers but it does not support setting up stack switch required by Stack Guard feature. Using the new API instead to make sure Stack Guard feature is applicable to most part of code. Since this API is called before memory service initialization, there's no way to call AllocateXxx API to reserve memory. Global variables are used for this special case. GDT table is reserved at least 2KB which should be big enough for all current use cases. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08UefiCpuPkg/CpuDxe: Initialize stack switch for MPJian J Wang2-0/+192
In current MP implementation, BSP and AP shares the same exception configuration. Stack switch required by Stack Guard feature needs that BSP and AP have their own configuration. This patch adds code to ask BSP and AP to do exception handler initialization separately. Since AP is not supposed to do memory allocation, all memory needed to setup stack switch will be reserved in BSP and pass to AP via new API EFI_STATUS EFIAPI InitializeCpuExceptionHandlersEx ( IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL, IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL ); Following two new PCDs are introduced to configure how to setup new stack for specified exception handlers. gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08UefiCpuPkg/MpLib: Add GDTR, IDTR and TR in saved AP dataJian J Wang2-0/+20
In current implementation of CPU MP service, AP is initialized with data copied from BSP. Stack switch required by Stack Guard feature needs different GDT, IDT table and task gates for each logic processor. This patch adds GDTR, IDTR and TR into structure CPU_VOLATILE_REGISTERS and related code in save and restore methods. This can make sure that any changes to GDT, IDT and task gate for an AP will be kept from overwritten by BSP settings. Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08ArmPkg/ArmExceptionLib: Add implementation of new APIJian J Wang1-0/+33
This patch add implementation of following new API introduced into CpuExceptionHandlerLib. Since this lib hasn't support Stack Guard and stack switch, the new method just calls original InitializeCpuExceptionHandlers. EFI_STATUS EFIAPI InitializeCpuExceptionHandlersEx ( IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL, IN CPU_EXCEPTION_INIT_DATA *InitDataEx OPTIONAL ); Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jiewen Yao <jiewen.yao@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2017-12-08MdeModulePkg/CpuExceptionHandlerLibNull: Add new API implementationJian J Wang1-0/+34
This patch add implementation of new API InitializeCpuExceptionHandlersEx introduced into CpuExceptionHandlerLib on behalf of Stack Guard feature. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08UefiCpuPkg/CpuExceptionHandlerLib: Add stack switch supportJian J Wang14-3/+984
If Stack Guard is enabled and there's really a stack overflow happened during boot, a Page Fault exception will be triggered. Because the stack is out of usage, the exception handler, which shares the stack with normal UEFI driver, cannot be executed and cannot dump the processor information. Without those information, it's very difficult for the BIOS developers locate the root cause of stack overflow. And without a workable stack, the developer cannot event use single step to debug the UEFI driver with JTAG debugger. In order to make sure the exception handler to execute normally after stack overflow. We need separate stacks for exception handlers in case of unusable stack. IA processor allows to switch to a new stack during handling interrupt and exception. But X64 and IA32 provides different ways to make it. X64 provides interrupt stack table (IST) to allow maximum 7 different exceptions to have new stack for its handler. IA32 doesn't have IST mechanism and can only use task gate to do it since task switch allows to load a new stack through its task-state segment (TSS). The new API, InitializeCpuExceptionHandlersEx, is implemented to complete extra initialization for stack switch of exception handler. Since setting up stack switch needs allocating new memory for new stack, new GDT table and task-state segment but the initialization method will be called in different phases which have no consistent way to reserve those memory, this new API is allowed to pass the reserved resources to complete the extra works. This is cannot be done by original InitializeCpuExceptionHandlers. Considering exception handler initialization for MP situation, this new API is also necessary, because AP is not supposed to allocate memory. So the memory needed for stack switch have to be reserved in BSP before waking up AP and then pass them to InitializeCpuExceptionHandlersEx afterwards. Since Stack Guard feature is available only for DXE phase at this time, the new API is fully implemented for DXE only. Other phases implement a dummy one which just calls InitializeCpuExceptionHandlers(). Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08MdePkg/BaseLib: Add stack switch related definitions for IA32Jian J Wang4-0/+193
The new definitions include two structures IA32_TASK_STATE_SEGMENT IA32_TSS_DESCRIPTOR two macros IA32_GDT_TYPE_TSS IA32_GDT_ALIGNMENT and one API VOID EFIAPI AsmWriteTr ( IN UINT16 Selector ); They're needed to setup task gate and interrupt stack table for stack switch. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08MdeModulePkg/CpuExceptionHandlerLib.h: Add a new API ↵Jian J Wang1-0/+97
InitializeCpuExceptionHandlersEx A new API InitializeCpuExceptionHandlersEx() is introduced to support initializing exception handlers with extra functionalities which need extra init data, such as stack switch for Stack Guard feature. EFI_STATUS EFIAPI InitializeCpuExceptionHandlersEx ( IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL, IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL ); By default, this method should include all functionalities implemented by InitializeCpuExceptionHandlers(), plus extra initialization works, if any. This is could be done by calling InitializeCpuExceptionHandlers() directly in this method besides the extra works. InitData is optional and its use and content are processor arch dependent. The typical usage of it is to convey resources which have to be reserved elsewhere and are necessary for the extra initialization of exception. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08UefiCpuPkg/UefiCpuPkg.dec: Add two new PCDs for stack switchJian J Wang1-0/+12
Stack switch is required by Stack Guard feature. Following two PCDs are introduced to simplify the resource allocation for initializing stack switch. gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize PcdCpuStackSwitchExceptionList is used to specify which exception will have separate stack for its handler. For Stack Guard feature, #PF must be specified at least. PcdCpuKnownGoodStackSize is used to specify the size of knwon good stack for an exception handler. Cpu driver or other drivers should use this PCD to reserve new stack memory for exceptions specified by above PCD. Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08MdeModulePkg/metafile: Add PCD PcdCpuStackGuardJian J Wang2-0/+14
PcdCpuStackGuard is introduced to enable/disable Stack Guard feature. Its value is FALSE by default. This feature is suggested to be enabled only if the cpu driver and CpuExceptionHandlerLib have supported stack switch for the processor used in platform. Otherwise the exception dump message won't be printed out when there's a stack overflow happened. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
2017-12-08IntelFrameworkModulePkg/KeyboardDxe: Use macro to enable/disable page 0Jian J Wang2-109/+10
Current implementation uses following two methods EnableNullDetection() DisableNullDetection() to enable/disable page 0. These two methods will check PCD PcdNullPointerDetectionPropertyMask to know if the page 0 is disabled or not. This is due to the fact that old GCD service doesn't provide paging related attributes of memory block. Since this issue has been fixed, GCD services can be used to determine the paging status of page 0. This is also make it possible to just use a new macro ACCESS_PAGE0_CODE( <code accessing page 0> ); to replace above methods to do the same job, which also makes code more readability. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-12-08IntelFrameworkModulePkg/LegacyBios: Use macro to enable/disable page 0Jian J Wang7-273/+135
Current implementation uses following two methods EnableNullDetection() DisableNullDetection() to enable/disable page 0. These two methods will check PCD PcdNullPointerDetectionPropertyMask to know if the page 0 is disabled or not. This is due to the fact that old GCD service doesn't provide paging related attributes of memory block. Since this issue has been fixed, GCD services can be used to determine the paging status of page 0. This is also make it possible to just use a new macro ACCESS_PAGE0_CODE( <code accessing page 0> ); to replace above methods to do the same job, which also makes code more readability. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-12-08IntelFrameworkPkg/LegacyBios.h: Add a macro to guarantee page 0 accessJian J Wang1-0/+36
Due to the introduction of NULL pointer detection feature, page 0 will be disabled if the feature is enabled, which will cause legacy code failed to update legacy data in page 0. This macro is introduced to make sure the page 0 is enabled before those code and restore the original status of it afterwards. Another reason to introduce this macro is to eliminate the dependency on the PcdNullPointerDetectionPropertyMask. Because this is a new PCD, it could cause some backward compatibility issue for some old packages. This macro will simply check if the page 0 is disabled or not. If it's disabled, it will enable it before code updating page 0 and disable it afterwards. Otherwise, this macro will do nothing to page 0. The usage of the macro will be look like (similar to DEBUG_CODE macro): ACCESS_PAGE0_CODE( <code accessing page 0> ); Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-12-08SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate symbolMichael Kinney1-2/+2
https://bugzilla.tianocore.org/show_bug.cgi?id=573 https://bugzilla.tianocore.org/show_bug.cgi?id=796 The same issue is reported again by GCC. Resend this patch again. This patch renames the duplicated function name to fix it. The SecPeiDebugAgentLib uses the global variable mMemoryDiscoveredNotifyList for a PPI notification on the Memory Discovered PPI. This same variable name is used in the DxeIplPeim for the same PPI notification. The XCODE5 tool chain detects this duplicate symbol when the OVMF platform is built with the flag -D SOURCE_DEBUG_ENABLE. The fix is to rename this global variable in the SecPeiDebugAgentLib library. Cc: Andrew Fish <afish@apple.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2017-12-08SignedCapsulePkg: Update EdkiiSystemCapsuleLib to check PCD valueLiming Gao2-2/+87
If PCD value is not set, register PcdCallBack to hook PCD value set Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-12-08UefiCpuPkg: Update SecCore to get BFV size based on BFV header FvLengthLiming Gao1-1/+1
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-08UefiCpuPkg: SmmCpuFeaturesLib Add the missing ASM_PFX in nasm codeLiming Gao1-3/+3
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2017-12-08UefiCpuPkg: PiSmmCpuDxeSmm Add the missing ASM_PFX in nasm codeLiming Gao1-5/+5
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2017-12-08UefiCpuPkg PiSmmCpuDxeSmm: SMM profile and static paging mutual exclusionStar Zeng4-9/+35
SMM profile and static paging could not be enabled at the same time, this patch is to add check and comments to make sure it. Similar comments are also added for the case of static paging and heap guard for SMM. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2017-12-08MdeModulePkg/NetLib: Fix an error when AIP doesn't support network media ↵fanwang21-0/+18
state detection AIP may not support detecting network media state, in this case, should call NetLibDetectMedia to get media state. This patch is to fix this issue. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2017-12-08UefiCpuPkg PiSmmCpuDxeSmm: Only DumpCpuContext in error caseStar Zeng2-4/+8
Only DumpCpuContext in error case, otherwise there will be too many debug messages from DumpCpuContext() when SmmProfile feature is enabled by setting PcdCpuSmmProfileEnable to TRUE. Those debug messages are not needed for SmmProfile feature as it will record those information to buffer for further dump. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
2017-12-08BaseTools: Fix GenSec can't found the depex fileYunhua Feng2-4/+5
Filter the FileList when multiple genfds thread options is not enabled. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-07MdePkg: Arm/AArch64 - filter #pragma pack() when __ASSEMBLER__Leif Lindholm2-2/+2
clang, when used as a preprocessor for dtc, does not discard #pragma statements although -x assembler-with-cpp is specified. This causes dtc to barf at a #pragma pack() statement that is already filtered out for __GNUC__. So add a check to also filter this out if __ASSEMBLER__. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-07MdeModulePkg PiSmmIpl: Handle CommSize OPTIONAL caseStar Zeng2-23/+40
Handle CommSize OPTIONAL case for SmmCommunicate. And return EFI_ACCESS_DENIED when CommunicationBuffer is not valid for SMM to access. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-12-07MdePkg MmCommunication.h: Follow PI spec to update EFI_MM_COMMUNICATEStar Zeng1-2/+12
Follow PI spec (>= 1.5) to add new return status code description and make CommSize OPTIONAL. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-12-07EmulatorPkg: Fix build failure due to Tftp library removalRuiyu Ni2-5/+8
The TFTP command was converted from a NULL class library instance to a dynamic shell command in commit 0961002352e9. The ShellLib and FileHandleLib resolutions are moved from Shell app <LibraryClasses> to [LibraryClasses.common] because dynamic shell commands implemented as DXE_DRIVER modules also depend on these libraries. PcdShellLibAutoInitialize must be set to FALSE for both the shell app itself and the dynamic shell command modules. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Andrew Fish <afish@apple.com>
2017-12-06EmbeddedPkg: AndroidBootApp: fix clang compilationLeif Lindholm2-6/+7
Address an incorrect function prototype (using ; instead of ,) in AndroidBootImg.h. Also restructure code slightly to avoid a "may be used uninitialized" warning. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2017-12-06ArmVirtPkg: add NOOPT target to platform .DSCsArd Biesheuvel3-3/+3
In order to allow the ArmVirtPkg platforms to be built using the NOOPT target, add it explicitly to the BUILD_TARGETS define. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2017-12-06MdeModulePkg/NetLib: Add NetLibDetectMediaWaitTimeout() API to support ↵fanwang23-0/+205
EFI_NOT_READY media state detection In wireless connection, connecting state needs to be cared more about. ECR 1772 redefined the state EFI_NOT_READY to represent connecting state and can be retrieved from Aip protocol. This patch adds a new API to check media state at a specified time interval when network is connecting until the connection process finishes or timeout. V2: * Return error status code directly when Aip protocol falied to detect media rather than wait for another time's check. * Set media state default value to EFI_SUCCESS since some platforms may not support retrieving media state from Aip protocol. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2017-12-06BaseTools: Fix GenSec GCC make failureYonghong Zhu1-3/+3
It is a regression bug introduced by the patch b37b108, it cause GenSec make failure on GCC Env. Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-06MdeModulePkg/DisplayEngineDxe: Remove unnecessary parentheses in 'if'Hao Wu1-1/+1
This commit removes unnecessary parentheses in 'if' statements to resolve the build failures by the XCODE5 tool chain. Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-06MdeModulePkg/PartitionDxe: Remove unnecessary parentheses in 'if'Hao Wu1-1/+1
This commit removes unnecessary parentheses in 'if' statements to resolve the build failures by the XCODE5 tool chain. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-12-05MdeModulePkg/Core/Dxe: log informative memprotect msgs at DEBUG_INFO levelLaszlo Ersek1-4/+9
In commit 7eb927db3e25 ("MdeModulePkg/DxeCore: implement memory protection policy", 2017-02-24), we added two informative messages with the InitializeDxeNxMemoryProtectionPolicy() function: > InitializeDxeNxMemoryProtectionPolicy: applying strict permissions to > active memory regions and > InitializeDxeNxMemoryProtectionPolicy: applying strict permissions to > inactive memory regions The messages don't report errors or warnings, thus downgrade their log masks from DEBUG_ERROR to DEBUG_INFO. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1520485 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-05NetworkPkg: Update IScsiDxe to pass XCODE buildLiming Gao2-3/+3
Fix the warning equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liang Vincent <vincent.liang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2017-12-05MdeModulePkg: Update PeiCore to pass XCODE tool chainLiming Gao1-1/+2
It fixes the warning for loop has empty body [-Werror,-Wempty-body]. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liang Vincent <vincent.liang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-05MdeModulePkg CapsulePei: Sort and merge memory resource entriesStar Zeng1-0/+90
Sort and merge memory resource entries to handle the case that the memory resource HOBs are reported differently between BOOT_ON_FLASH_UPDATE boot mode and normal boot mode, and the capsule buffer from UpdateCapsule at normal boot sits across two memory resource descriptors at BOOT_ON_FLASH_UPDATE boot mode. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Cc: Dakota Chiang <dakota.chiang@intel.com> Tested-by: Dakota Chiang <dakota.chiang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2017-12-05BaseTools: Update Makefile to support FFS file generationYonghong Zhu24-411/+793
Update Makefile to support FFS file generation with new build option --genfds-multi-thread. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>