summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg/DxeCore: set ImageContext Handle and ImageRead() fieldsArd Biesheuvel2016-04-291-0/+2
| | | | | | | | | | | | | | Set the ImageContext.Handle and ImageContext.ImageRead() fields so that PeCoffLoaderRelocateImageExtraAction() can invoke PeCoffLoaderGetImageInfo or PeCoffLoaderGetPeHeader if desired to obtain additional metadata. We will use this to create a PeCoffLoaderRelocateImageExtraAction() implementation that applies boot time strict mapping permissions to PE/COFF modules. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/PciBusDxe: don't create bogus descriptor if no resources neededArd Biesheuvel2016-04-291-5/+2
| | | | | | | | | | | | | | | | | | | | | | | If the current PCI configuration requires no resources to be allocated at all (i.e., unpopulated bus), the PCI enumeration code creates a single ACPI_ADDRESS_SPACE_DESCRIPTOR memory descriptor with all fields cleared. This is rejected by the SubmitResources() implementation of the generic PciHostBridgeDxe in the following way: PciHostBridge: SubmitResources for PcieRoot(0x0) Mem: Granularity/SpecificFlag = 0 / 00 Length/Alignment = 0x0 / 0x0 PciBus: HostBridge->SubmitResources() - Invalid Parameter ASSERT_EFI_ERROR (Status = Invalid Parameter) ASSERT [PciBusDxe] .../PciBusDxe/PciLib.c(561): !EFI_ERROR (Status) So instead, create the empty configuration as a single entry of type EFI_ACPI_END_TAG_DESCRIPTOR. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* BaseTools/Build: Better DSC arch filteringThomas Palmer2016-04-292-21/+26
| | | | | | | | | | | | | | | | | Description: When building for any specific architecture, the build script today is loading DSC sections for other architectures not in the build. The build process should disregard DSC sections that are not relevant to the build. My previous patch only fixed issue for one section type (Components). This patch will handle all section types by updating the MetaFileParser class, which now takes a Arch argument and will filter the DSC table results as they are returned from the database. The database still contains all information from DSCs for when builds support multiple arch's Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: fix the bug for FMP to support use Macro as path descriptionYonghong Zhu2016-04-291-3/+2
| | | | | | | | | | Fix the bug for FMP image to support to use Macro as path description, eg: FILE DATA = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/test.efi Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ShellPkg: Add NULL pointer check.Qiu Shumin2016-04-291-3/+17
| | | | | | | | | | Add pointer check to avoid NULL pointer dereferenced. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Tapan Shah <tapandshah@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Tapan Shah <tapandshah@hpe.com>
* MdePkg-SmmMemLib: Enhance SmmIsBufferOutsideSmmValid() check for fixed comm ↵Jiewen Yao2016-04-292-3/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | buffer. This patch adds more check in SmmIsBufferOutsideSmmValid(), to make sure that SMM communication buffer is only EfiReservedMemoryType/EfiRuntimeServicesCode/ EfiRuntimeServicesData/EfiACPIMemoryNVS. So that the communication buffer will not touch any OS memory. The assumption is that a platform reports valid SMM communication buffer at EndOfDxe, because EndOfDxe is last hook point that SMM code can call-out to get memory map information. A platform MUST finish SMM communication buffer allocation before EndOfDxe. If a DXE or OS driver need do communication after EndOfDxe, it can either allocate SMM communication buffer before EndOfDxe and save it, or consume EDKII_PI_SMM_COMMUNICATION_REGION_TABLE table to get general fixed comm buffer. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* SecurityPkg-Opal(2): Enhance AHCI Bar MMIO region check.Eric Dong2016-04-294-4/+84
| | | | | | | | | | | | | | | This patch enhance OPAL password SMM driver to check SMM bar is valid MMIO besides outside of SMRAM. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* SecurityPkg-Opal(1): Use fixed SMM communication buffer in OPAL password lib.Eric Dong2016-04-293-4/+34
| | | | | | | | | | | | | | | | | | This patch enhance OPAL password lib SMM communication by using fixed SMM communication buffer. Update OPAL password lib to consume EDKII_PI_SMM_COMMUNICATION_REGION_TABLE as fixed communication buffer for SMM communication. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg-FPDT(4): Use fixed buffer for SMM_PERF_COMMUNICATE in PerfLib.Liming Gao2016-04-292-35/+122
| | | | | | | | | | | | | | | | | | This patch enhance performance data SMM communication by using fixed SMM communication buffer. Update PerformanceLib to use fixed SMM communication buffer to get performance data by SMM_PERF_COMMUNICATE API. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg-FPDT(3): Use SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET ↵Liming Gao2016-04-292-42/+79
| | | | | | | | | | | | | | | | | | | | in FpdtDxe. This patch enhance performance data SMM communication by using fixed SMM communication buffer. Update FpdtDxe to use fixed SMM communication buffer to get performance data by SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET API. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg-FPDT(2): Add SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET ↵Liming Gao2016-04-291-27/+36
| | | | | | | | | | | | | | | | | | | | in FpdtSmm Handler. This patch enhance performance data SMM communication by using fixed SMM communication buffer. Update FpdtSmm to handle SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET request. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg-FPDT(1): Add SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET ↵Liming Gao2016-04-291-3/+5
| | | | | | | | | | | | | | | | | | | | | | | definition. This patch enhance performance data SMM communication by using fixed SMM communication buffer. A new command SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET is added, because we need to support get partial PerformanceData to fixed SMM communication buffer. If performance data is bigger than fixed SMM communication buffer, the DXE agent need to call SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET multiple times to get all data out. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg-MemoryProfile(3): Use ↵Star Zeng2016-04-292-31/+75
| | | | | | | | | | | | | | | | | | | | SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET in MemoryProfileInfo. This patch enhance SMM memory profile SMM communication by using fixed SMM communication buffer. Update MemoryProfileInfo APP to use fixed SMM communication buffer to get profile data by SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET API. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Star Zeng <star.zeng@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg-MemoryProfile(2): Add ↵Star Zeng2016-04-291-43/+204
| | | | | | | | | | | | | | | | | | | | | SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET in PiSmmCore. This patch enhance SMM memory profile SMM communication by using fixed SMM communication buffer. Update PiSmmCore to handle SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET request. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Star Zeng <star.zeng@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg-MemoryProfile(1): Add ↵Star Zeng2016-04-291-5/+22
| | | | | | | | | | | | | | | | | | | | | | | SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET definition. This patch enhance SMM memory profile SMM communication by using fixed SMM communication buffer. A new command SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET is added, because we need to support get partial ProfileData to fixed SMM communication buffer. If profile data is bigger than fixed SMM communication buffer, the DXE agent need to call SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET multiple times to get all data out. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Star Zeng <star.zeng@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Add new driver to publish EDKII_PI_SMM_COMMUNICATION_REGION_TABLE.Jiewen Yao2016-04-295-0/+204
| | | | | | | | | | | | | | | | | Add a driver to publish EDKII_PI_SMM_COMMUNICATION_REGION_TABLE, so that other DXE driver can consume this table directly. NOTE: This is sample driver. A platform may uses its own way to define default SMM communication buffer region and publish information in its own EDKII_PI_SMM_COMMUNICATION_REGION_TABLE. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Feng, Tian <feng.tian@intel.com>
* MdeModulePkg: Add EDKII_PI_SMM_COMMUNICATION_REGION_TABLE definition.Jiewen Yao2016-04-292-0/+65
| | | | | | | | | | | | | | | | This configuration table is used to describe platform pre-allocated memory for SMM communication buffer. If DXE driver wants to communicate with SMM agent, it can use this memory as SMM communication buffer instead of allocate new memory region. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* ShellPkg: Enhance ping6 to select the interface automaticallyJiaxin Wu2016-04-291-71/+95
| | | | | | | | | | | | | | | | | | | | v2: * Refine the code to make it more readable. This patch is used to support no source IP specified case while multiple NICs existed in the platform. The command will select the first both connected and configured interface automatically. Note: Source address is always required when pinging a link-local address. Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* ShellPkg: Enhance ping to select the interface automaticallyJiaxin Wu2016-04-292-101/+129
| | | | | | | | | | | | | | | | | | | | | | | v2: * A. Refine the code to make it more readable. * B. Add hint message for link local address case. This patch is used to support no source IP specified case while multiple NICs existed in the platform. The command will select the first both connected and configured interface automatically. Note: Source address is always required when pinging a link-local address. Cc: David Van Arnem <dvanarnem@cmlab.biz> Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/NvmExpressDxe: comments update to meet implementationFeng Tian2016-04-291-7/+5
| | | | | | | | | Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Wu, Hao A <hao.a.wu@intel.com> Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
* MdePkg: Add WSMT definition.Jiewen Yao2016-04-291-0/+39
| | | | | | | | | | | This patch adds Windows SMM Security Mitigation Table @ http://download.microsoft.com/download/1/8/A/18A21244-EB67-4538-BAA2-1A54E0E490B6/WSMT.docx Cc: "Gao, Liming" <liming.gao@intel.com> Cc: "Kinney, Michael D" <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com>
* SecuritPkg: DxeImageVerificationLib: Fix wrong verification logic in DBX & DBTZhang, Chao B2016-04-291-2/+9
| | | | | | | | | In image verification, if image verified pass in DBT, still need to verify if it is blocked by any other cert/cert hash from DBX. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Long Qin <qin.long@intel.com> Reviewed-by: Dick Wilkins <dick_wilkins@phoenix.com>
* UefiCpuPkg/MtrrLib: Remove the loop of calculating Fixed-MTRR MaskJeff Fan2016-04-291-16/+23
| | | | | | | | | | | Introduce the 32bit mask seeds to calculate Fixed-MTRR or&and mask values. It could avoid the loop operation and 64bit shift operations. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* UefiCpuPkg/MtrrLib: Remove the loop of calculating byte offset in MSRJeff Fan2016-04-291-11/+3
| | | | | | | | | | Calculate byte offset in MSR directly and removing the loop. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* UefiCpuPkg/MtrrLib: Reduce the loop time to get fixed-MTRR MSR indexJeff Fan2016-04-291-6/+8
| | | | | | | | | | | Add input fixed-MTRR MSR index to be start MSR index to avoid finding fixed-MTRR MSR index from 0 at each time. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* ShellPkg: Update smbiosview for latest Type 17 devicesSamer El-Haj-Mahmoud2016-04-281-0/+21
| | | | | | | | | Update smbiosview to understand latest SMBIOS Type 17 devices from SMBIOS 3.0.0 spec Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* OvmfPkg: PlatformBdsLib: lock down SMM regardless of S3Laszlo Ersek2016-04-281-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, the EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL is only installed if S3 is enabled -- at the end of SaveS3BootScript(). While a runtime OS is never booted with SMM unlocked (because the SMM IPL locks down SMM as a last resort: > SMM IPL! DXE SMM Ready To Lock Protocol not installed before Ready To > Boot signal > SmmInstallProtocolInterface: [EfiSmmReadyToLockProtocol] 0 > Patch page table start ... > Patch page table done! > SMM IPL locked SMRAM window ), we shouldn't allow UEFI drivers and applications either to mess with SMM just because S3 is disabled. So install EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL in PlatformBdsInit() unconditionally. Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: PlatformBdsLib: lock down SMM in PlatformBdsInit()Laszlo Ersek2016-04-281-25/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OVMF's PlatformBdsLib currently makes SMM vulnerable to the following attack: (1) a malicious guest OS copies a UEFI driver module to the EFI system partition, (2) the OS adds the driver as a Driver#### option, and references it from DriverOrder, (3) at next boot, the BdsEntry() function in "IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c" processes Driver#### and DriverOrder between the calls to PlatformBdsInit() and PlatformBdsPolicyBehavior(), (4) OVMF locks down SMM only in PlatformBdsPolicyBehavior(), hence the driver runs with SMM unlocked. The BdsEntry() function of the MdeModulePkg BDS driver (in file "MdeModulePkg/Universal/BdsDxe/BdsEntry.c") recommends to "Signal ReadyToLock event" in PlatformBootManagerBeforeConsole() -- which corresponds to PlatformBdsInit() --, not in PlatformBootManagerAfterConsole() -- which corresponds to PlatformBdsPolicyBehavior(). Albeit an independent question, but it's worth mentioning: this patch also brings OvmfPkg's PlatformBdsInit() closer to ArmVirtPkg's. Namely, the latter signals End-of-Dxe in PlatformBdsInit() already. Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* MdeModulePkg: PiDxeS3BootScriptLib: honor PcdAcpiS3EnableLaszlo Ersek2016-04-282-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the edk2 tree, there are currently four drivers that consume PcdAcpiS3Enable: IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.inf From these, AcpiS3SaveDxe is the only one that isn't also a client of the S3BootScriptLib class; all the others (BootScriptExecutorDxe, S3SaveStateDxe, SmmS3SaveState) are clients of the S3BootScriptLib class. In turn, the edk2 tree contains only one non-Null instance of the S3BootScriptLib class: MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf Therefore we can safely state that BootScriptExecutorDxe, S3SaveStateDxe, and SmmS3SaveState are all linked against PiDxeS3BootScriptLib. Now, if PcdAcpiS3Enable is FALSE when either of BootScriptExecutorDxe, SmmS3SaveState, or SmmS3SaveState is dispatched, then the following happens: - The constructor of PiDxeS3BootScriptLib, function S3BootScriptLibInitialize(), registers a protocol installation callback for gEfiDxeSmmReadyToLockProtocolGuid. Namely, the function S3BootScriptEventCallBack(). - The driver immediately exits with EFI_UNSUPPORTED from its entry point function, upon seeing PcdAcpiS3Enable == FALSE. (See commits 800c02fbe2da6, 125e093876414, and d2d38610603f6.) - This leaves a dangling callback pointer in the DXE core. - When Platform BDS installs gEfiDxeSmmReadyToLockProtocolGuid (which is a valid thing to do for locking down SMM, even in the absence of S3 support!), things blow up. Fix this issue by returning immediately from S3BootScriptLibInitialize() if PcdAcpiS3Enable is FALSE -- it is useless to initialize the library instance if the containing driver module exits first thing in its entry point. Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* NetworkPkg: Fix incorrect buffer free in HttpDxeJiaxin Wu2016-04-281-22/+22
| | | | | | | | | | | | | | FragmentBuffer of each TcpWrap in HttpDxe should not be freed in HttpTcpTokenCleanup(). This buffer points to HttpMsg body actually, which is the responsibility of the caller to allocate a buffer for Body. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* NetworkPkg: Avoid the indefinite wait case in HttpDxeJiaxin Wu2016-04-283-17/+117
| | | | | | | | | | | | | | | | | Need the timer check to avoid the indefinite wait case in HttpDxe driver A.HTTP receive Header process in HttpTcpReceiveHeader(); B.HTTP receive Body process in HttpTcpReceiveBody(); Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg: DxeCore MemoryPool Algorithm UpdateLiming Gao2016-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Use 128 bytes as the start size region to be same to previous one. 64 bytes is small as the first range. On X64 arch, POOL_OVERHEAD takes 40 bytes, the pool data less than 24 bytes can be fit into it. But, the real allocation is few that can't reduce its free pool link list. And, the second range (64~128) has more allocation that also increases the free pool link list of the first range. Then, the link list will become longer and longer. When LinkList check enable in DEBUG tip, the long link list will bring the additional overhead and bad performance. Here is the performance data collected in our X64 platform with DEBUG enable. 64 byte: 22 seconds in BDS phase 128 byte: 19.6 seconds in BDS phase Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* ShellPkg: Fix typos and EDK2 coding style issuesTapan Shah2016-04-271-10/+10
| | | | | | | | | Fixing typos and EDK2 coding style issues found from previous submit Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Fix pci command for '_e' optionAbdul Lateef Attar2016-04-271-0/+1
| | | | | | | | | | | | | ShellPkg: Fix pci command for '_e' option Processing of '_e' argument was missing. Added fix, to process the '_e' option for printing additional AER information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Abdul Lateef Attar <abdul-lateef.attar@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* MdeModulePkg: Export ConfigResp only for form Package after ReadyToBootDandan Bi2016-04-272-8/+58
| | | | | | | | | | | | | | | | | | | | | The Hii runtime support feature will export the content of HiiDatabase and the ConfigResp string to runtime buffer after ReadyToBoot event is triggered. If some drivers add/update/remove packages from Hiidatabase after ReadyToBoot: Originally we will both export the content of HiiDatabase and the ConfigResp string for all packages. But now after investigation, we found only for form packages need to export the content of HiiDatabase and the ConfigResp string, for other packages just need to export the content of HiiDatabase. Now to enhance this logic. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
* MdeModulePkg: BOOLEAN type needn't to compare to TRUE/FALSE explicitlyDandan Bi2016-04-271-1/+1
| | | | | | | | | | Fix this issue to follow the coding style. Cc: Qiu Shumin <shumin.qiu@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* MdeModulePkg: Add description to MdeModulePkg AcpiTable driver.Liming Gao2016-04-272-5/+6
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* NetworkPkg:HttpDxe:Consume DxeHttpLib API changesNagaraj Hegde2016-04-273-21/+17
| | | | | | | | | | | | | HttpGenRequestString is updated to HttpGenRequestMessage, with an additional argument. This patch updates the caller of the DxeHttpLib API. Also, we will avoid adding any '\0' to the string, which was added to make AsciiStrLen to work on the string. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
* MdeModulePkg:DxeHttpLib: Update to DxeHttpLib APINagaraj Hegde2016-04-272-18/+44
| | | | | | | | | | | | | Rename and update the logic of HttpGenRequestString API provided by DxeHttpLib. The RequestString size is returned as an argument. The user is not expected to do a AsciiStrLen anymore, and is not logical too, since request string can contain message body and using AsciiStrLen on such a string can provide truncated lengths. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
* NetworkPkg: Allow user to create a HTTP corporate boot option in setup page.Fu Siyuan2016-04-272-5/+6
| | | | | | | | | | | | This patch updates the HTTP Boot Configuration page to allow the user to create a corporate mode HTTP boot option, by leaving the URI string empty. The patch also fix a bug that the L"https://" should use StrnCmp() with Length 8. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdePkg:Http11.h: Add defines for "Expect" headerNagaraj Hegde2016-04-271-0/+14
| | | | | | | | | | | Add #defines for "Expect" header, which is a part of RFC 2616 and used for HTTP PUT/POST operations. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* BaseTools: Fix the bug for .aml to use ASL binary type in Asbuilt infYonghong Zhu2016-04-271-21/+16
| | | | | | | | | | | | Per build spec, the .aml file should use ASL binary type in the Asbuilt inf file. the original bug is .aml file may use BIN as binary type when the module type is not BASE or USER_DEFINED. This patch 1) fix this bug. 2) fix some indent coding style issue. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update FMP Capsule support to follow FDF specYonghong Zhu2016-04-271-26/+34
| | | | | | | | | | | | Current the FMP Capsule feature is supported, but its format has a little different with FDF spec. so this patch 1) Align the FMP Capsule with FDF spec. 2) fix some style issue, eg: Tab. 3) Add a SectionParser function to check the section header info since this method is used in 7 places. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* OvmfPkg: SataControllerDxe: SataControllerStop: fix use after freeLaszlo Ersek2016-04-261-6/+11
| | | | | | | | | | | | | | | | | | It would be possible to remove the UAF without local variables, by calling SataPrivateData->PciIo->Attributes() before releasing SataPrivateData. However, by keeping the location of the call (for which temporary variables are necessary), we continue to match the error path logic in SataControllerStart(), which is always recommended. Reported-by: wang xiaofeng <winggundum82@163.com> Fixes: bcab71413407e61c144994925556725dd65eede9 Cc: wang xiaofeng <winggundum82@163.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: SataControllerDxe: SataControllerStop: remove useless null checkLaszlo Ersek2016-04-261-11/+9
| | | | | | | | | "ASSERT (SataPrivateData != NULL)" is just a few lines higher up. Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* MdeModulePkg DxeCore: Check free memory type by CoreUpdateProfile()Star Zeng2016-04-264-12/+7
| | | | | | | | | | | | | It can improve profile performance, especially when PcdMemoryProfileMemoryType configured without EfiBootServicesData. CoreUpdateProfile() can return quickly, but not depend on the further code to find the buffer not recorded and then return. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/NvmExpress: Clean Phase/CqHdbl/SqTdbl fields to restart HCTian Feng2016-04-262-4/+12
| | | | | | | | | | | | | Phase Tag, SqTdbl/CqHdbl and SqBuffer/CqBuffer should be cleared in NvmeControllerInit() to make HC functionality work when user invokes NvmeBlockIoReset(). Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
* MdeModulePkg/NvmExpress: Fix bug of handling not null-terminated stringsFeng Tian2016-04-262-6/+15
| | | | | | | | | | | | | | In EnumerateNvmeDevNamespace(), when Private->ControllerData->Sn and/or Private->ControllerData->Mn are NOT null-terminated strings, UnicodeSPrintAsciiFormat(…) may generate unexpected (garbage) output string. Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/NvmExpress: Fix mem leak in error handling of Start()Tian Feng2016-04-261-0/+4
| | | | | | | | | | | | Memory pointed to by Private->ControllerData has not been freed up correctly at error handling path. Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
* MdeModulePkg/EmmcDxe: Fix wrong coding style on close braceFeng Tian2016-04-261-2/+3
| | | | | | | | | | The close brace of EmmcDxeComponentNameGetControllerName should be at the beginning of a line. Cc: Qiu Shumin <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>