summaryrefslogtreecommitdiff
path: root/MdeModulePkg
AgeCommit message (Collapse)Author
2016-07-18MdeModulePkg/PciHostBridgeDxe: Fix VS tool chain build failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com> (cherry picked from commit 26bd6437ca574c6285d4c47d147f96630fa5f837)
2016-07-18MdeModulePkg/PciHostBridgeDxe: Add CpuArch protocol dependencyRuiyu Ni
The driver entry point calls gDS->SetMemorySpaceAttributes(). This interface may return EFI_NOT_AVAILABLE_YET when CPU Arch protocol is not available. So we need to list CpuArch protocol in its INF dependency section. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 0b58c4894dad03100c17ce5b1124c624f002700f)
2016-07-18MdeModulePkg/PciHostBridgeDxe: Honor ResourceAssignedRuiyu Ni
Change PciHostBridgeDxe driver to not install the PciHostBridgeResourceAllocation protocol and let PciRootBridgeIo.Configuration() return the correct PCI resource assignment information when the ResourceAssigned is TRUE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit 401f8cd110f7eec7684d948df29e00b44b1468d9)
2016-07-18MdeModulePkg/PciHostBridgeLib: Add ResourceAssigned fieldRuiyu Ni
Some platform doesn't require PciBus driver to assign resource to PCI devices which causes PciRootBridgeIo.Configuration() cannot return correct resource information to caller. When resource assignment by PciBus is not mandatory, only light version of PCI bus enumeration is performed, which only collects the device resource consumption and publishes the PciIo instance. The corresponding logic is in PciEnumeratorLight() in PciBus driver. But PciEnumeratorLight() still depends on PciRootBridgeIo.Configuration() returns the starting bus number in order to search down to find all PCI devices under the root bridge. When ResourceAssigned in PCI_ROOT_BRIDGE returned by PciHostBridgeGetRootBridges() is TRUE, PciHostBridge driver treats the Bus/Io/Mem/MemAbove4G/PMem/PMemAbove4G as the resource that are *actually assigned* to the root bridge, instead of the resource that *can be assigned* to the root bridge. So that PciRootBridgeIo.Configuration() can return the correct information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit c5be19f378216a07c7783e07973d976407885e75)
2016-07-18MdeModulePkg/PciHostBridgeDxe: Fix a Base/Limit comparing bugRuiyu Ni
When the aperture base equals to aperture limit, the old code treats the aperture as non-existent. It's not correct because it indicates a range starting with base and the length is 1. The new code corrects the comparing bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit f9607bef04a9abb698f9f8b4518b7955dc326521)
2016-07-18MdeModulePkg/PciHostBridgeDxe: Don't miss prefetchable MMIO apertureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit 814f4306d8f72c56512765de4de36bce774ce62a)
2016-07-18MdeModulePkg/PciBus: Should reserve enough bus number for HPCRuiyu Ni
When there is no bridge before the HPC (hot plug controller), the issue cannot be seen. But when there are bridges before the HPC, the PciBus will only use the value (= <CurrentBusNumber> + <ReservedBusNumber>) as the sub-ordinary bus number for HPC. The correct sub-ordinary bus number should be: <CurrentBusNumber> + <OccupiedBusNumber>(by earlier bridges) + <ReservedBusNumber>. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> (cherry picked from commit f6830005bb1a2fc225c89cdb1367b5058e939acc)
2016-07-14MdeModulePkg BootMaint: remove set but unused variablesHao Wu
(Integrate commit 8192be265ee142d4a71cc9024a2ce0060a3d686d from master branch) Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@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: Eric Dong <eric.dong@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-07-14MdeModulePkg DeviceMngr: remove set but unused variablesHao Wu
(Integrate commit 3b93b8070d450eb15679c3454c8329a6a31d8081 from master branch) Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@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: Eric Dong <eric.dong@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-07-14MdeModulePkg: BootManagerMenuApp: remove set but unused variablesLaszlo Ersek
Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@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> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> (cherry picked from commit c1df8b889d4a9d8316d707e3ba8728f2628d5788)
2016-07-14MdeModulePkg: UfsPassThruDxe: remove set but unused variablesLaszlo Ersek
Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@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> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> (cherry picked from commit 59ddab7e6e7397736f89355ccbaa2e1817992fec)
2016-07-14MdeModulePkg/PciHostBridgeDxe: remove unused but set variablesArd Biesheuvel
Remove variables that are declared, assigned but never referenced. This fixes a warning emitted by GCC when -Wunused-but-set-variable is in effect. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> (cherry picked from commit 3a9dcf9f28ef6cd62c7eaade706adbe435262fa8)
2016-07-12MdeModulePkg MemoryProfile: ASSERT to ensure 'DriverInfoData' is not NULLHao Wu
Code logic ensures that the pointer 'DriverInfoData' will not be NULL when it is used. Add ASSERT as warning for case that will not happen. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit d8162f5b3283a06a6dc4e2e05cd0c45fc4358eb0)
2016-07-07MdeModulePkg VariableInfo: Fix GCC build failureStar Zeng
GCC build failure: 'RealCommSize' may be used uninitialized Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> (cherry picked from commit 05b39efb669eaa173a76e58daf8e65bce2e0299e)
2016-07-07MdeModulePkg DxeSmmPerformanceLib: Add missing UefiLib in *.inf at de2459dStar Zeng
Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@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> (cherry picked from commit fd3fac0fb29dd093fc89cdbdd5de925a82595c5b)
2016-07-07MdeModulePkg VariableInfo: Use fixed buffer for smm comm bufferStar Zeng
Cc: Jiewen Yao <jiewen.yao@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> (cherry picked from commit faf3de9bd036cd2a387c1e44d403d24386fadb49)
2016-07-07MdeModulePkg/HiiDatabaseDxe: Add ASSERT before using the pointer 'String'Dandan Bi
The 'Sting' is returned by the function GetUnicodeStringTextAndSize. If it is NULL, function GetUnicodeStringTextAndSize will return EFI_OUT_OF_RESOURCES, and error handling codes will cover it. So the pointer 'Sting' can not be NULL when using it. So we can add the ASSERT codes. Cc: Eric Dong <eric.dong@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> (cherry picked from commit 763cfa739b1733715fe6700a29ec078c36453f5e)
2016-07-07MdeModulePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStrStar Zeng
It is the follow up of 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49 to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS. (We integrate the change for FrontPageCustomizedUiSupport.c in commit b68ccac17c7e6340ab7b3654ea51c86ad6b4201d on master to FrontPage.c on UDK2015 branch) (We integrate the change for BmBootDescription.c in commit b68ccac17c7e6340ab7b3654ea51c86ad6b4201d on master to BmBoot.c on UDK2015 branch) Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit b68ccac17c7e6340ab7b3654ea51c86ad6b4201d)
2016-07-06MdeModulePkg PiDxeS3BootScriptLib: Use a specific name for mSmstStar Zeng
When a driver also uses a same name, there will be a link error: one or more multiply defined symbols found. Use a specific name for mSmst to avoid the link error. Cc: Jiewen Yao <jiewen.yao@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> (cherry picked from commit a7636346cb59538c70be301c60c0cb0a320abb95)
2016-07-06MdeModulePkg DxeS3BootScriptLib: Check (mSmst != NULL) before freeing SMRAMStar Zeng
There is static scan tool reports BootScriptSave.c:628:'mSmst' is explicitly dereferenced. The patch is to check (mSmst != NULL) before freeing SMRAM at BootScriptSave.c:628. Cc: Shumin Qiu <shumin.qiu@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com> (cherry picked from commit d6f38e374ece00f1f8176007c9d3e8eff1f2308f)
2016-07-06MdeModulePkg DxeS3BootScriptLib: Add DESTRUCTOR S3BootScriptLibDeinitializeStar Zeng
PiDxeS3BootScriptLib has a constructor S3BootScriptLibInitialize() that registers ready-to-lock callback S3BootScriptSmmEventCallBack() and several more. The library is linked to SMM modules. If the module entry-point function returns error (because of lack of resources, unsupported, whatever), the module will be unloaded and the notify callback pointers will point to undefined memory. On ready-to-lock exception occurs when calling S3BootScriptSmmEventCallBack(), and probably all the other callbacks registered by the constructor would also cause exception. This patch is to implement library Destructor to free the resources allocated by S3BootScriptLibInitialize() and unregister callbacks. Cc: Jiewen Yao <jiewen.yao@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: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit cfd79783d603bb2db98ffa0a370bea572724d51c)
2016-07-06MdeModulePkg SmmLockBoxSmmLib: Add DESTRUCTOR SmmLockBoxSmmDestructorStar Zeng
SmmLockBoxSmmLib is linked to SMM modules. If the module entry-point function returns error, the module will be unloaded and the global variables will point to undefined memory. This patch is to add DESTRUCTOR SmmLockBoxSmmDestructor to uninstall SmmLockBoxCommunication configuration table if it has been installed in Constructor. Cc: Jiewen Yao <jiewen.yao@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: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit 738df706c1192a546bd88f017dc00d263f2bc1c2)
2016-07-06MdeModulePkg SmmLockBoxSmmLib: Fix typo in SmmLockBoxSmmConstructuorStar Zeng
SmmLockBoxSmmConstructuor should be SmmLockBoxSmmConstructor. Cc: Jiewen Yao <jiewen.yao@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: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit da9d39c28ee24dde172616fe05ce3c252223b01c)
2016-07-06MdeModulePkg/SetupBrowser: Correct the incorrect variable nameDandan Bi
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> (cherry picked from commit bef778c1fe67ceddc03a3ac34c8cef9157e01c91)
2016-07-06MdeModulePkg-FPDT(4): Use fixed buffer for SMM_PERF_COMMUNICATE in PerfLib.Liming Gao
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> (cherry picked from commit de2459d66d87eb526e3a21f1e6682fac8e1926c5)
2016-07-06MdeModulePkg-FPDT(3): Use SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET ↵Liming Gao
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> (cherry picked from commit d158ba675b95c9f07455d77d0ef68ce22e7f65d0)
2016-07-06MdeModulePkg-FPDT(2): Add SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET ↵Liming Gao
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> (cherry picked from commit 77a6e6c4f966bd618196ba7196964515228a84e1)
2016-07-06MdeModulePkg-FPDT(1): Add SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET ↵Liming Gao
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> (cherry picked from commit 7110e306faaf713ca644719685a7cb21f3c17d8b)
2016-07-06MdeModulePkg-MemoryProfile(3): Use ↵Star Zeng
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> (cherry picked from commit 2f7961c7d67faad52449ec8d5c71b2cd891bd7b6)
2016-07-06MdeModulePkg-MemoryProfile(2): Add ↵Star Zeng
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> (cherry picked from commit c3592c86ee39c3582f1d4c6b31cf91113e9d4c5f)
2016-07-06MdeModulePkg-MemoryProfile(1): Add ↵Star Zeng
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> (cherry picked from commit 73e0de62826dffe8f9e32d6d0d18b54a8a5d3f38)
2016-07-06MdeModulePkg: Add new driver to publish EDKII_PI_SMM_COMMUNICATION_REGION_TABLE.Jiewen Yao
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> (cherry picked from commit 6e4e6ffda448b77a3b2f3549137aca5c1b62cb4a)
2016-07-06MdeModulePkg: Add EDKII_PI_SMM_COMMUNICATION_REGION_TABLE definition.Jiewen Yao
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> (cherry picked from commit 1e01ea240e67aacd0e6b99012ac4ab3b68be8215)
2016-07-06MdeModulePkg: DxeCore MemoryPool Algorithm UpdateLiming Gao
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> (cherry picked from commit 467d5f6b30bcd2bb73bfaafc31118944d95ec28e)
2016-07-04MdeModulePkg: Add ASSERT to make sure pointer 'MemoryMap' is not NULL.Qiu Shumin
If 'CoreGetMemoryMap' return success the 'MemoryMap' shouldn't be NULL. Add code to make sure this. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com> (cherry picked from commit 4cb6375ca6ddf73577758a72b1464896c3eae767)
2016-07-04MdeModulePkg: Fix Memory Attributes table type issueJiewen Yao
According to the spec, each entry in the Memory Attributes table shall have the same type as the region it was carved out of in the UEFI memory map. The current attribute uses RTData for PE Data, but it should be RTCode. This patch fixed the issue. It is validated with or without PropertiesTable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 82f0f411c7912de105d1484fd294bde8aacb6c1e)
2016-07-04MdePkg: Change PcdPropertiesTableEnable default value toJiewen Yao
FALSE UEFI2.6 specification does not recommend to use BIT0 attribute for PropertiesTable, so we change default value to FALSE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com> Reviewed-by: "Ard Biesheuvel" <ard.biesheuvel@linaro.org> Reviewed-by: "Laszlo Ersek" <lersek@redhat.com> (cherry picked from commit cc260e629ce130d316cb4a9a6ea1d3f47301b6bd)
2016-07-04MdePkg: Update DxeCore INF for MemoryAttributesTable.jiewen yao
Update DxeCore INF for MemoryAttributesTable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com> (cherry picked from commit 47eb798d3619dc525c3c4594a0df388b84a85c7f)
2016-07-04MdePkg: Call CoreInitializeMemoryAttributesTable() in DXE Entrypoint.jiewen yao
Call CoreInitializeMemoryAttributesTable() in DXE Entrypoint. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com> (cherry picked from commit a94d51bde5e8dd55a5916ba75c9938b5796633f6)
2016-07-04MdeModulePkg: Add CoreInitializeMemoryAttributesTable() to header file.jiewen yao
Add CoreInitializeMemoryAttributesTable() to DXE Core header file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com> (cherry picked from commit 67ab389a76abd3e7c1dbab7b478440b84504b930)
2016-07-04MdeModulePkg: Update PropertiesTable for MemoryAttributesTable.jiewen yao
MemoryAttributesTable generation need information in PropertiesTable. In memory attributes table generation path, PropertiesTable need record original memory map and do not merge the new memory map entry cross original memory map boundary. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com> (cherry picked from commit f5a91bba6f5dd102c3ae022e878f22b5856ada96)
2016-07-04MdeModulePkg: Add MemoryAttributesTable generation.jiewen yao
Add MemoryAttributesTable generation in DxeCore. We leverage the information collected by original PropertiesTable, and publish runtime code/data to another standalone table. So that this is a compatible solution to report more PE Code/Data information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Gao, Liming" <liming.gao@intel.com> (cherry picked from commit 98c4b005c87921646da53a1e3ac01c94cf87139a)
2016-07-04MdeModulePkg: HiiDatabase: Refine the code to make it more safely.Eric Dong
Refine the code to avoid potential buffer overflow or use NULL pointer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19735 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 2a244a5d9f1b16517caf92114ec3e09bdb9c37a5)
2016-05-19MdeModulePkg: Revert 54707a6bc7a627660f742c1111763d9e093184a6Jeff Fan
MdeModulePkg: VarCheckUefiLib: Add DeployedMode/AuditMode var check logic DeployedMode & AuditMode are UINT8 Global variable according to Enable Secure Boot feature defined in UEFI2.5 Mantis 1263. Add them to var check list. https://mantis.uefi.org/mantis/view.php?id=1263 (Sync patch r19131 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Zeng Star <star.zeng@intel.com>
2016-03-09MdeModulePkg/PciHostBridge: Don't assert when setting UC to MMIO failsRuiyu Ni
Failing to set EFI_MEMORY_UC to MMIO aperture is not a fatal error. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit 13be90faafdfe2a053090b99644a246680687166)
2016-03-04MdeModulePkg/PciHostBridgeLib: Correct the function header commentsRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Shumin Qiu <shumin.qiu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> (cherry picked from commit eea222ced0f8b40b2b02e9da31cca33ca6688faf)
2016-03-04MdeModulePkg: PciHostBridgeDxe: don't assume extended config spaceLaszlo Ersek
The "pc" ("pc-i440fx-*") machine types of QEMU don't support extended config space. Accordingly, OVMF will use the following library instances in connection with the core PciHostBridgeDxe driver: BasePciSegmentLibPci [class: PciSegmentLib] BasePciLibCf8 [class: PciLib] BasePciCf8Lib [class: PciCf8Lib] Add a new field to the PCI_ROOT_BRIDGE structure so that RootBridgeIoCheckParameter() can catch config space offsets above 0xFF on such old (emulated) platforms. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> (cherry picked from commit 014b472053ae31e6b9fcdb5d4ee01e29b4d44fd4)
2016-03-04MdeModulePkg: PciHostBridgeDxe: insert horizontal whitespaceLaszlo Ersek
... in preparation for the next patch. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> (cherry picked from commit 3da829657e67d01e39eb6cf8ef9754043271e2e7)
2016-03-04MdeModulePkg: PciHostBridgeLibNull: rewrap source to 79 charactersLaszlo Ersek
Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> (cherry picked from commit 9b6b938538076116768ee9b8e4d52d0cb51dcc8c)
2016-03-04MdeModulePkg/PciHostBridge: Don't assume resources are fully NonExistentRuiyu Ni
The patch removes the assumption that the resources claimed by root bridges should not exist. Because resources might have been added: 1. by platform modules either in PEI through resource HOB, or in DXE, before the PCI host bridge driver runs. 2. Resources claimed by different root bridges may overlap so that resource adding operation for latter root bridges may fail if we assume the resource should not exist. In real world, this patch is to fit OVMF platform needs because different root bridges in OVMF platform shares the same resources. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> [lersek@redhat.com: intersection-based implementation] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> (cherry picked from commit 6474f1f156eefa6886e594039f4d562e374ba344)