summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* MdePkg BaseMemoryLibSse2: Add SSE2 implementation of API IsZeroBuffer()Hao Wu2016-08-225-2/+226
| | | | | | | | | | | | | | Add the implementation of API IsZeroBuffer() via assembly in BaseMemoryLibSse2. The assembly codes use SSE2 XMM registers and related instructions. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg BaseMemoryLib: Add assembly implementation of API IsZeroBuffer()Hao Wu2016-08-2220-8/+746
| | | | | | | | | | | | | | | | Add the implementation of API IsZeroBuffer() via assembly for the following library instances: BaseMemoryLibMmx BaseMemoryLibOptDxe BaseMemoryLibOptPei BaseMemoryLibRepStr Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg BaseMemoryLib: Add C implementation of API IsZeroBuffer()Hao Wu2016-08-2213-9/+335
| | | | | | | | | | | | | | | Add the implementation of API IsZeroBuffer() via C language for the following library instances: BaseMemoryLib PeiMemoryLib UefiMemoryLib Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* SecurityPkg Tcg2: Rename internal API IsZeroBuffer to InternalIsZeroBufferHao Wu2016-08-223-14/+14
| | | | | | | | | | | | | | Before adding API IsZeroBuffer() in BaseMemoryLib at MdePkg, rename the internal implementations of IsZeroBuffer() within SecurityPkg/Tcg modules to avoid breaking bisection. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg BaseMemoryLib: Add implementation of API IsZeroGuid()Hao Wu2016-08-229-9/+261
| | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/GccBase.lds: don't copy RELA section to PE/COFFArd Biesheuvel2016-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CLANG38 toolchain creates a PIE binary at link time. This is necessary since the LTO code generation may otherwise result in code that cannot execute correctly when loaded above 2 GB. PIE executables contain a RELA section consisting of dynamic relocation entries that are intended for consumption by the loader at runtime. For this reason, it has the SHF_ALLOC attribute set by default, and will be identified by GenFw as a section that needs to be copied into the PE/COFF binary, resulting in waste of space since the PE/COFF loader does not use this data at all. So mark the RELA section as informational: this will prevent the linker from setting the SHF_ALLOC attribute, causing GenFw to ignore it. DxeCore.efi before: Detected 'X64' type PE/COFF image consisting of 3 sections Section alignment: 0x40 File alignment: 0x40 Section '.text' @ 0x00000240 File offset: 0x240 Virtual size: 0x21000 Raw size: 0x21000 Section '.data' @ 0x00021240 File offset: 0x21240 Virtual size: 0x3640 Raw size: 0x3640 Section '.reloc' @ 0x00024880 File offset: 0x24880 Virtual size: 0x280 Raw size: 0x280 DxeCore.efi after: Detected 'X64' type PE/COFF image consisting of 3 sections Section alignment: 0x40 File alignment: 0x40 Section '.text' @ 0x00000240 File offset: 0x240 Virtual size: 0x1f440 Raw size: 0x1f440 Section '.data' @ 0x0001f680 File offset: 0x1f680 Virtual size: 0x3640 Raw size: 0x3640 Section '.reloc' @ 0x00022cc0 File offset: 0x22cc0 Virtual size: 0x280 Raw size: 0x280 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ArmVirtPkg: Fix build breakage of ArmVirtXen platformVikas C Sajjan2016-08-221-0/+4
| | | | | | | | | Added missing dependency of FileExplorerLib, which was causing build error for ArmVirtXen, due to inclusion of ramdisk support. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Vikas C Sajjan <vikas.cha.sajjan@hpe.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* BaseTools PeCoffLib: Fix the issue to get RelocationsStripped from TE imageLiming Gao2016-08-221-2/+2
| | | | | | | | | | | | | | | If PE image has no relocation section, and has not set RELOCS_STRIPPED, after it is converted to TE image, GenFw will set its relocation section VirtualAddress to non-zero address, and keep Size value as Zero. MdePkg BasePeCoffLib applied this rule to get RelocationsStripped attribute. But, it is missing in BaseTools BasePeCoffLib. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* ArmVirtPkg: Add Ramdisk support to ArmVirtPkg platformsVikas C Sajjan2016-08-224-0/+23
| | | | | | | | | | Adds the RAMDisk support to ArmVirtPkg platforms. This patch actually ports OvmfPkg commit 259d87146b07 to ArmVirtPkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Vikas C Sajjan <vikas.cha.sajjan@hpe.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: Move inclusion of AcpiTableDxe.inf to ArmVirt.dsc.incVikas C Sajjan2016-08-224-3/+6
| | | | | | | | | Since ArmVirt.dsc.inc is included in all the ArmVirt dsc files, move inclusion of AcpiTableDxe.inf to ArmVirt.dsc.inc. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Vikas C Sajjan <vikas.cha.sajjan@hpe.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools: Fix a bug use 'COMMON' as CodeBase in BuildOptions sectionYonghong Zhu2016-08-192-2/+9
| | | | | | | | | | | | | Current BaseTools query the BuildOptions not cover the case that use 'COMMON' as CodeBase, while DSC spec allow this usage. This Patch add support for such 'common.DXE_RUNTIME_DRIVER' as the Scope2 in the query Condition. Cc: Liming Gao <liming.gao@intel.com> Cc: Kurt Kennett <Kurt.Kennett@microsoft.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: FMP capsule add the support to generate auth infoYonghong Zhu2016-08-195-72/+194
| | | | | | | | | | | | | Current BaseTools cannot generate EFI_FIRMWARE_IMAGE_AUTHENTICATION for FMP capsule. this patch fix it by FDF spec's update to add the definition for CERTIFICATE_GUID and MONOTONIC_COUNT. BaseTools call the tool by CERTIFICATE_GUID to generate the certdata and fill the header info. 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: Rsa2048Sha256Sign add new option to support Monotonic countYonghong Zhu2016-08-191-6/+25
| | | | | | | | | | | the EFI_FIRMWARE_IMAGE_AUTHENTICATION struct require the AuthInfo which is a signature across the image data and the Monotonic Count value, so we add the new option to support Monotonic count. 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: Add the PKCS7 toolYonghong Zhu2016-08-199-3/+538
| | | | | | | | | | | Provide the PKCS7 Tool to support the CertType - EFI_CERT_TYPE_PKCS7_GUID, then user can use this tool to add EFI_FIRMWARE_IMAGE_AUTHENTICATION for a binary. Cc: Liming Gao <liming.gao@intel.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>
* UefiCpuPkg/PiSmmCpuDxeSmm: Revert 7503cd70fb86Jeff Fan2016-08-191-2/+2
| | | | | | | | | Revert "UefiCpuPkg/PiSmmCpuDxeSmm: Add gEfiVariableArchProtocolGuid dependency" This reverts commit 7503cd70fb864a5663edb121c9b2488b4c69e7f5. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com>
* UefiCpuPkg/MpInitLib: MicrocodeData used but maybe uninitializedJeff Fan2016-08-191-0/+2
| | | | | | | | Cc: Feng Tian <feng.tian@intel.com> Cc: Dandan Bi <dandan.bi@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>
* DuetPkg: Add DxeMpInitLib instance referenceJeff Fan2016-08-192-0/+2
| | | | | | | | Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* BaseTools-CLANG38: Add -O3 in DLINK2 flagShi, Steven2016-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | CLANG38 build fail after CC_FLAG is added in the link rule. This failure is because the CLANG38 enable the LTO through LLVMgold.so linker plugin, but the LLVMgold.so plugin cannot accept the clang -Oz CC flag as build option. After CC_FLAG is added in the link rule, the LLVMgold.so plugin reports linking error. LLVMgold.so only accept -O0 ~ -O3, and you can see it in the LLVM gold plugin source code in below: http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_380/final/tools/gold/ gold-plugin.cpp line173: if (opt[1] < '0' || opt[1] > '3') message(LDPL_FATAL, "Optimization level must be between 0 and 3"); Add -O3 in the *_CLANG38_*_DLINK2_FLAGS to override the -Oz flag in *_CLANG38_*_CC_FLAGS to pass LLVMgold.so linking. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: check CONF_PATH env to get the configure filesYonghong Zhu2016-08-192-5/+11
| | | | | | | | | | | | Add CONF_PATH env check. First priority is user set the conf dir by --conf option, then the CONF_PATH env, the last one is the standard WORKSPACE(PACKAGE_PATH)/Conf. Also print the conf path directory in the build log. 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>
* NetworkPkg/IpSecDxe: Fix wrong IKE header "FLAG" updateJiaxin Wu2016-08-184-16/+28
| | | | | | | | | | | | | | | | | | | | | *v2: update the commit log and refine the code comments. There are three kinds of IKE Exchange process: #1. Initial Exchange #2. CREATE_CHILD_SA_Exchange #3. Information Exchange The IKE header "FLAG" update is incorrect in #2 and #3 exchange, which may cause the continue session failure. This patch is used to correct the updates of IKE header "FLAG" according the RFC4306 section 3.1. 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/IpSecDxe: Fix UEFI IKE Initial Exchange failureJiaxin Wu2016-08-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | *v2: update the commit log. IKE Initial Exchange message should cover below process: Initiator Responder Message1 HDR,SAil,KEi,Ni ------> Message2 <------ HDR,SArl,KEr,Nr,[CERTREQ] Message3 HDR,SK{} ------> Message4 <------ HDR,SK{} If Initial Exchange message is initiated by Linux IKE, it works well. But the failure will happen if it's initiated by UEFI IKE. This issue is caused by the no status check of NotifyCookiePayload. While parsing the IKEv2 packet for IKE_SA_INIT exchange, if the packet doesn't contain COOKIE Notify payload, EFI_INVALID_PARAMETER will be returned from Ikev2ParserNotifyCookiePayload(). Current implementation return this error status directly, then the session will be broken. The correct behavior should check this status. If no COOKIE Notify payload, initiator don't need to retry the IKE_SA_INIT. 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>
* CorebootPayloadPkg: fixed GCC49 and GCC5 hang in PeiCorePrince Agyeman2016-08-171-2/+2
| | | | | | | | | | Section alignment of .data in GCC49 and GCC5 are 0x40 rather than 0x20 in GCC48 and below. This causes a hang in PeiCore. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Prince Agyeman <prince.agyeman@intel.com> Reviewed by: Maurice Ma <maurice.ma@intel.com>
* CorebootPayloadPkg : Added MpInitLib to CorebootPayloadPkg.dscPrince Agyeman2016-08-172-0/+2
| | | | | | | | MpInitLib is consumed by CpuDxe Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Prince Agyeman <prince.agyeman@intel.com> Reviewed by: Maurice Ma <maurice.ma@intel.com>
* MdeModulePkg: Fix potential failure if UseDefaultAddress configuredJiaxin Wu2016-08-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IpSb->Reconfig should not be set to TRUE to focal the reconfiguration during the policy changes from Static to DHCP. It's redundancy because the default router table and default addresses have been freed ahead ( Detailed see Ip4Config2OnPolicyChanged() function). Otherwise, the potential failure will appear if UseDefaultAddress configured. Reproduce steps see below: #1. Set policy to DHCP. #2. If DHCP process is not complete yet, then run one APP to invoke UDP4 Configure with "UseDefaultAddress = TRUE" (loop to call UDP4 Configure until Ip4Mode.IsConfigured changes to TRUE). #3. Even DHCP succeed but Ip4Mode.IsConfigured flag never set to TRUE Concrete analysis is as follows: In #1, the policy will be set to DHCP, and then Ip4Config2OnPolicyChanged() will be called. In this function, if "IpSb->Reconfig" flag is set to TRUE, the original "IpSb->DefaultInterface" will be abandoned/freed once the DHCP process finished. In #2, UDP4 Configure with "UseDefaultAddress = TRUE" is called, that means the default interface (IpSb->DefaultInterface) will be selected as current instance's interface. In #3, when DHCP process finished, the original DefaultInterface will be abandoned/freed because "IpSb->Reconfig" flag is true. Meanwhile, one new interface is assigned to "IpSb->DefaultInterface". This new interface is different to the original one assigned to the UDP4 Configured instance. So, even DHCP process succeed, the up caller will never have the chance to get it's truly status. Cc: Cohen Eugene <eugene@hp.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> Tested-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* NetworkPkg: Fix assert issue in iSCSI driverZhang Lubo2016-08-181-0/+2
| | | | | | | | | | | | | | | | | | The bug is caused by using already freed memory. If there is already an attempt and execute 'reconnect -r' command, all the AttemptConfig structure will be freed, but the mCallbackInfo->Current is not configured as null and this pointer will be used again in IScsiFormExtractConfig. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* NetworkPkg: Refine codes of iSCSI driverZhang Lubo2016-08-181-15/+20
| | | | | | | | | | | | | | The RSDT is only used when the bios need to support ACPI 1.0 version. When change PcdAcpiExposedTableVersions to 0x3C, it will not support ACPI 1.0. The default is 0x3E. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg: Refine codes of iSCSI driverZhang Lubo2016-08-181-15/+20
| | | | | | | | | | | | | | The RSDT is only used when the bios need to support ACPI 1.0 version. When change PcdAcpiExposedTableVersions to 0x3C, it will not support ACPI 1.0. The default is 0x3E. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* PcAtChipsetPkg AcpiTimerLib: Wait 363 ACPI timer counts to get TSC FreqStar Zeng2016-08-183-27/+33
| | | | | | | | | | | | | | | | | | Compute the number of ticks to wait to measure TSC frequency. Instead of (ACPI_TIMER_FREQUENCY / 10000) = 357 and 357 * 10000 = 3570000, use 363 * 9861 = 3579543 Hz which is within 2 Hz of ACPI_TIMER_FREQUENCY. 363 counts is a calibration time of 101.4 uS. The idea comes from Michael and Paolo. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Paul A Lohr <paul.a.lohr@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/PiSmmCpuDxeSmm: Add gEfiVariableArchProtocolGuid dependencyJeff Fan2016-08-171-2/+2
| | | | | | | | | | | | | | | | | | | PiSmmCpuDxeSmm driver's entry point will get some PCDs supported dynamic type. In case those PCDs are set as DynamicHii type in platform DSC File, it implies that EFI Variable Arch protocol is required. This fix is to add gEfiVariableArchProtocolGuid dependency on PiSmmCpuDxeSmm driver to make sure those DynamicHii PCDs could be read correctly. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/CpuDxe: Fixed typo in function header to match PI specJeff Fan2016-08-171-18/+18
| | | | | | | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* MdePkg/MpService.h: Trim whitespace at end of lineJeff Fan2016-08-171-235/+235
| | | | | | | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* MdePkg/MpService.h: Fixed typo in function header to match PI specJeff Fan2016-08-171-17/+17
| | | | | | | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/CpuDxe: Remove PcdCpuMaxLogicalProcessorNumber consumingJeff Fan2016-08-172-16/+5
| | | | | | | | | | | | | | | | | | | v5: If PcdCpuMaxLogicalProcessorNumber is set to 1 on UP system, MpInitLibInitialize() will be invoked. This is one bug, we need to call MpInitLibInitialize() always and get the BSP information. Just to remove PcdCpuMaxLogicalProcessorNumber() consuming from this driver. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/CpuDxe: Remove unused codes and filesJeff Fan2016-08-179-1359/+1
| | | | | | | | | | | | | | | | | | v5: 1. Remove unused PcdCpuApStackSize and PcdCpuApInitTimeOutInMicroSeconds. v4: 1. Keep GDT table setup to fix IA32 S3 boot issue. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/CpuDxe: Move SetMtrrsFromBuffer() location.Jeff Fan2016-08-172-16/+15
| | | | | | | | | | | | Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/CpuDxe: Consume MpInitLib to produce CPU MP Protocol servicesJeff Fan2016-08-178-815/+77
| | | | | | | | | | | | | | | | | | | | | | | | | Consume MP Initialize library to produce CPU MP Protocol services to simply the code. v4: 1. Update CpuDxe.c file header to mention it produces CPU Arch protocol. 2. Update BistData type from UINT32 to EFI_HEALTH_FLAG. 3. Move some header location from CpuMp.h to CpuDxe.h. v3: 1. Move the code Consume MpInitLib APIs to produce CPU MP Protocol from patch #40 to this patch. 2. Add DxeMpInitLib.inf in DSC file Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/CpuMpPei: Delete PeiMpServices.c and PeiMpServices.hJeff Fan2016-08-175-766/+727
| | | | | | | | | | | | | | | | | | Move the code in PeiMpServices.c & PeiMpServices.h to CpuMpPei.c & CpuMpPei.h. v3: 1. Rename MpInitLibSwitchBSP to MpInitLibSwitchBSP 2. Add PeiMpInitLib.inf in DSC file Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/CpuMpPei: Remove unused files and codesJeff Fan2016-08-1713-2669/+0
| | | | | | | | | | | | Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/CpuMpPei: Consume MpInitLib to produce CPU MP PPI servicesJeff Fan2016-08-176-491/+113
| | | | | | | | | | | | | | | | | | | | | | | | Consume MP initialize library to produce CPU MP PPI, it could simply the code. Add STATIC for some internal functions to avoid build issue with the same functions name in PeiMpInit instance. They will be removed by the next patch. v4: 1. Update BistData type from UINT32 to EFI_HEALTH_FLAGS. v3: 1. Rename MpInitLibSwitchBSP to MpInitLibSwitchBSP 2. Add PeiMpInitLib.inf in DSC file Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* QuarkPlatformPkg: Add MpInitLib reference in DSC files.Jeff Fan2016-08-172-1/+5
| | | | | | | | | | | | | | | This update is for CpuDxe consuming MP Initialize library. v5: 1. Update Quark DSC files to add PeiMpInitLib. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Kelly Steele <kelly.steele@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* OvmfPkg: Add MpInitLib reference in DSC files.Jeff Fan2016-08-173-0/+6
| | | | | | | | | | | | | | This update is for CpuMpPei&CpuDxe consuming MP Initialize library. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* UefiCpuPkg/MpInitLib: Place APs in safe loop before hand-off to OSJeff Fan2016-08-172-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | Register Exit Boot Service callback function MpInitExitBootServicesCallback() to place AP one safe loop before hand-off to OS. Allocated one reserved memory and copy the AsmRellocateApLoop() code into it. It could avoid the CPU Dxe driver (located in Boot Service data range) crashed after Exit Boot Service event. Place AP into the target Cx-State (specified by PcdCpuApTargetCstate) could save power if Monitor-mwait feature supported. In long mode, switch AP into protected mode could let AP not require page table when executing this safe loop. Page Table (located in Boot Service data range) may crashed after Exit Boot Service event. v3: 1. Rename *RellocateAp* to *RelocateAp* Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupAllAPs()Jeff Fan2016-08-174-2/+233
| | | | | | | | | | | | | | | | | | | v4: 1. Simply the internal function StartupAllAPsWorker()'s function header due to it is duplicated with MpInitLibStartupAllAPs(). v3: 1. Use CamelCase for mStopCheckAllApsStatus and CheckAndUpdateApsStatus() Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupThisAP()Jeff Fan2016-08-174-2/+176
| | | | | | | | | | | | | | | | | | | | v4: 1. Simply the internal function StartupThisAPWorker()'s comment header due to it is duplicated with MpInitLibStartupThisAP(). v3: 1. Use CamelCase for mStopCheckAllApsStatus and CheckAndUpdateApsStatus(). Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/MpInitLib: Check APs Status and update APs statusJeff Fan2016-08-174-1/+415
| | | | | | | | | | | | | | | v3: 1. Use CamelCase for CheckAndUpdateApsStatus(). Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/MpInitLib: Implementation of MpInitLibEnableDisableAP()Jeff Fan2016-08-174-2/+97
| | | | | | | | | | | | | | | | | | v4: 1. Simply the internal function MpInitLibEnableDisableAP()'s function header due to it is duplicated with MpInitLibEnableDisableAP(). v3: 1. Use CamelCase for mCheckAllAPsEvent, mStopCheckAllApsStatus. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/MpInitLib: Implementation of MpInitLibSwitchBSP()Jeff Fan2016-08-174-7/+218
| | | | | | | | | | | | | | | | | | | v4: 1. Simply the internal function SwitchBSPWorker()'s comment header due to it is duplicated with MpInitLibSwitchBSP(). v3: 1. Rename MpInitLibSwitchBsp to MpInitLibSwitchBSP. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/MpInitLib: Implementation of MpInitLibWhoAmI()Jeff Fan2016-08-171-1/+9
| | | | | | | | | | | | | | | v5: 1. Move checking ProcessNumber before calling GetCpuMpData. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/MpInitLib: Implementation of MpInitLibGetProcessorInfo()Jeff Fan2016-08-171-1/+173
| | | | | | | | | | | | | | | | | | | v5: 1. Remove (-1) and use the clean code to calculate the Location->Thread and Location->Core. v4: 1. Update HealthData type from UINT32 to EFI_HEALTH_FLAGS Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg/MpInitLib: Implementation of MpInitLibGetNumberOfProcessors()Jeff Fan2016-08-171-1/+38
| | | | | | | | | | | | Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>