]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
7 years agoSecurityPkg DxeTpmMeasureBootLib: Add comments in TcgMeasurePeImage()
Liming Gao [Wed, 13 Jul 2016 12:28:19 +0000 (20:28 +0800)]
SecurityPkg DxeTpmMeasureBootLib: Add comments in TcgMeasurePeImage()

The input PeImage in TcgMeasurePeImage() has been checked.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg DxeImageVerificationLib: Add comments in HashPeImage()
Liming Gao [Wed, 13 Jul 2016 12:28:18 +0000 (20:28 +0800)]
SecurityPkg DxeImageVerificationLib: Add comments in HashPeImage()

The input PeImage in HashPeImage() has been checked.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg Tcg2Dxe: Add check for the PE/COFF image
Liming Gao [Wed, 13 Jul 2016 12:28:17 +0000 (20:28 +0800)]
SecurityPkg Tcg2Dxe: Add check for the PE/COFF image

Use BasePeCoffLib PeCoffLoaderGetImageInfo() to check the PE/COFF image.

In V2, add specific ImageRead() to make sure the PE/COFF image content
read is within the image buffer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg TrEEDxe: Add check for the PE/COFF image.
Liming Gao [Wed, 13 Jul 2016 12:28:16 +0000 (20:28 +0800)]
SecurityPkg TrEEDxe: Add check for the PE/COFF image.

Use BasePeCoffLib PeCoffLoaderGetImageInfo() to check the PE/COFF image.

In V2, add specific ImageRead() to make sure the PE/COFF image content
read is within the image buffer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg SecureBootConfigDxe: Add check for the external PE/COFF image.
Liming Gao [Wed, 13 Jul 2016 12:28:15 +0000 (20:28 +0800)]
SecurityPkg SecureBootConfigDxe: Add check for the external PE/COFF image.

Use BasePeCoffLib PeCoffLoaderGetImageInfo() to check the PE/COFF image.

In V2, add specific ImageRead() to make sure the PE/COFF image content
read is within the image buffer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoIntelFsp2WrapperPkg: Remove unused header files from Fspm and Fsps WrapperPeim
Liming Gao [Thu, 14 Jul 2016 02:16:29 +0000 (10:16 +0800)]
IntelFsp2WrapperPkg: Remove unused header files from Fspm and Fsps WrapperPeim

PlatformSecLib.h is not used and removed.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoMdePkg/BaseSynchronizationLib: spin lock alignment is 32 at least
Jeff Fan [Tue, 12 Jul 2016 03:10:27 +0000 (11:10 +0800)]
MdePkg/BaseSynchronizationLib: spin lock alignment is 32 at least

Some processor may return small cache line size, we should return 32 bytes at
least for spin lock alignment.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoUefiCpuPkg/CpuMpPei: Remove PmodeOffset and LmodeOffset
Jeff Fan [Tue, 12 Jul 2016 00:49:33 +0000 (08:49 +0800)]
UefiCpuPkg/CpuMpPei: Remove PmodeOffset and LmodeOffset

Remove Pmode(Entry)Offset/Lmode(Entry)Offset and use unified Mode(Entry)Offset
to clean up the definition of MP_ASSEMBLY_ADDRESS_MAP and MP_CPU_EXCHANGE_INFO.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.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>
7 years agoUefiCpuPkg/CpuMpPei: Remove un-used variables and functions
Jeff Fan [Mon, 11 Jul 2016 11:52:00 +0000 (19:52 +0800)]
UefiCpuPkg/CpuMpPei: Remove un-used variables and functions

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.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>
7 years agoUefiCpuPkg/CpuMpPei: Do not load new GDT table
Jeff Fan [Mon, 11 Jul 2016 11:46:36 +0000 (19:46 +0800)]
UefiCpuPkg/CpuMpPei: Do not load new GDT table

Do not load the new GDT table and just to use the exiting BSP's GDT table set up
by SEC phase.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.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>
7 years agoUefiCpuPkg/CpuMpPei/X64: Use CodeSegment and DataSegment fields
Jeff Fan [Mon, 11 Jul 2016 11:40:05 +0000 (19:40 +0800)]
UefiCpuPkg/CpuMpPei/X64: Use CodeSegment and DataSegment fields

Using CodeSegment and DataSegment fields in ExchangeInfo instead of the hardcode
MACROs for x64 arch. Switch AP from real mode to long mode directly, so needn't
the CS/DS of protected mode.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.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>
7 years agoUefiCpuPkg/CpuMpPei/X64: Remove hard code CPU BIST value
Jeff Fan [Mon, 11 Jul 2016 06:35:26 +0000 (14:35 +0800)]
UefiCpuPkg/CpuMpPei/X64: Remove hard code CPU BIST value

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.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>
7 years agoUefiCpuPkg/CpuMpPei/Ia32: Use CodeSegment and DataSegment fields
Jeff Fan [Mon, 11 Jul 2016 05:21:10 +0000 (13:21 +0800)]
UefiCpuPkg/CpuMpPei/Ia32: Use CodeSegment and DataSegment fields

Using CodeSegment and DataSegment fields in ExchangeInfo instead of the hardcode
MACROs.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.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>
7 years agoUefiCpuPkg/CpuMpPei: Add CodeSegment and DataSegment fields
Jeff Fan [Mon, 11 Jul 2016 05:08:06 +0000 (13:08 +0800)]
UefiCpuPkg/CpuMpPei: Add CodeSegment and DataSegment fields

Added CodeSegment and DataSegment fields in MP_CPU_EXCHANGE_INFO. They are set
to the values of current BSP's CS and DS.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.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>
7 years agoBaseTools: Update the FV region name as upper letter
Yonghong Zhu [Mon, 11 Jul 2016 07:52:09 +0000 (15:52 +0800)]
BaseTools: Update the FV region name as upper letter

Since in the GenFds phase, the FV is generated as upper letter. This
patch update the FV region name as upper letter, it can fix the build
report generate failure on case sensitive file system.

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>
Reviewed-by: Andrew Fish <afish@apple.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: remove stale FvFile boot options
Laszlo Ersek [Wed, 13 Jul 2016 15:40:15 +0000 (17:40 +0200)]
ArmVirtPkg/PlatformBootManagerLib: remove stale FvFile boot options

(This patch ports OvmfPkg commit 2eb358986052 to ArmVirtPkg. That
functionality was not added to QemuBootOrderLib, because it was (and is)
independent from QEMU and fw_cfg.)

Remove any boot options that point to binaries built into the firmware and
have become stale due to any of the following:
- FvMain's base address or size changed (historical -- see commit
  e191a3114f4c),
- FvMain's FvNameGuid changed,
- the FILE_GUID of the pointed-to binary changed,
- the referenced binary is no longer built into the firmware.

For example, multiple such "EFI Internal Shell" boot options can coexist.
They technically differ from each other, but may not describe any built-in
shell binary exactly. Such options can accumulate in a varstore over time,
and while they remain generally bootable (thanks to the efforts of
BmGetFileBufferByFvFilePath()), they look bad.

Filter out any stale options.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: https://github.com/tianocore/edk2/issues/107
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoOvmfPkg/PlatformPei: add missing auto variable initialization
Ard Biesheuvel [Wed, 13 Jul 2016 14:50:35 +0000 (16:50 +0200)]
OvmfPkg/PlatformPei: add missing auto variable initialization

The E820EntriesCount variable in XenPublishRamRegions() may be
referenced without being initialized on RELEASE builds, since the
ASSERT that fires if the call to XenGetE820Map() fails is compiled
out in that case. So initialize it to 0.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmPkg/ArmGicLib: manage GICv3 SPI state at the distributor
Ard Biesheuvel [Thu, 7 Jul 2016 17:18:39 +0000 (19:18 +0200)]
ArmPkg/ArmGicLib: manage GICv3 SPI state at the distributor

Unlike SGIs and PPIs, which are private to the CPU and are managed at
the redistributor level (which is also a per-CPU construct), shared
interrupts (SPIs) are shared between all CPUs, and therefore managed at
the distributor level (just as on GICv2).

Reported-by: Narinder Dhillon <ndhillonv2@gmail.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmMmuLib: avoid type promotion in TCR_EL1 assignment
Ard Biesheuvel [Wed, 13 Jul 2016 07:06:49 +0000 (09:06 +0200)]
ArmPkg/ArmMmuLib: avoid type promotion in TCR_EL1 assignment

Commit fafb7e9c110e ("ArmPkg: correct TTBR1_EL1 settings in TCR_EL1")
introduced a symbolic constant TCR_TG1_4KB which resolves to (2 << 30),
and ORs it into the value to be written into TCR_EL1 (if executing at
EL1). Since the constant is implicitly typed as signed int, and has the
sign bit set, the promotion that occurs when casting to UINT64 results
in a TCR value that has bits [63:32] all set, which includes mostly
RES0 bits but also the TBIn, AS and IPS fields.

So explicitly redefine all TCR related constants as 'unsigned long'
types, using the UL suffix. To avoid confusion in the future, the
inappropriately named VTCR_EL23_xxx constants have the leading V
removed, and the actual VTCR_EL2 related constants are dropped, given
that we never configure stage 2 translation in UEFI.

Reported-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
7 years agoUefiCpuPkg/CpuMpPei: Remove unnecessary variable
Jeff Fan [Fri, 1 Jul 2016 06:27:26 +0000 (14:27 +0800)]
UefiCpuPkg/CpuMpPei: Remove unnecessary variable

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.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>
7 years agoUefiCpuPkg/CpuMpPei: Dump message if microcode signature not matched
Jeff Fan [Fri, 1 Jul 2016 06:52:12 +0000 (14:52 +0800)]
UefiCpuPkg/CpuMpPei: Dump message if microcode signature not matched

Verification microcode signature is one enhancement and not one requirement from
IA32 SDM. This update is just to dump debug message instead of ASSERT() if the
updated microcode signature does not match the loaded microcode signature.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.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>
7 years agoUefiCpuPkg/CpuMpPei: Skip microcode check/load if it has been loaded
Jeff Fan [Fri, 1 Jul 2016 06:51:10 +0000 (14:51 +0800)]
UefiCpuPkg/CpuMpPei: Skip microcode check/load if it has been loaded

Actually, there is only one microcode region in platform. If microcode has been
loaded, its signature will not be zero and should be loaded successfully.
We needn't to check microcode region and load microcode again. This update is to
skip checking/loading microcode if current microcode signature is not zero.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.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>
7 years agoOvmfPkg: add PciHotPlugInitDxe
Laszlo Ersek [Thu, 30 Jun 2016 18:16:06 +0000 (20:16 +0200)]
OvmfPkg: add PciHotPlugInitDxe

After IncompatiblePciDeviceSupportDxe, this is another small driver /
protocol implementation that tweaks the behavior of the PCI bus driver in
edk2.

The protocol is specified in the Platform Init Spec v1.4a, Volume 5,
Chapter 12.6 "PCI Hot Plug PCI Initialization Protocol". This
implementation steers the PCI bus driver to reserve the following
resources ("padding") for each PCI bus, in addition to the BARs of the
devices on that PCI bus:
- 2MB of 64-bit non-prefetchable MMIO aperture,
- 512B of IO port space.

The goal is to reserve room for devices hot-plugged at runtime even if the
bridge receiving the device is empty at boot time.

The 2MB MMIO size is inspired by SeaBIOS. The 512B IO port size is
actually only 1/8th of the PCI spec mandated reservation, but the
specified size of 4096 has proved wasteful (given the limited size of our
IO port space -- see commit bba734ab4c7c). Especially on Q35, where every
PCIe root port and downstream port qualifies as a separate bridge (capable
of accepting a single device).

Test results for this patch:
- regardless of our request for 64-bit MMIO reservation, it is downgraded
  to 32-bit,
- although we request 512B alignment for the IO port space reservation,
  the next upstream bridge rounds it up to 4096B.

Cc: "Johnson, Brian J." <bjohnson@sgi.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Suggested-by: Andrew Fish <afish@apple.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoMdeModulePkg/PciBusDxe: recognize hotplug-capable PCIe ports
Laszlo Ersek [Thu, 30 Jun 2016 23:12:29 +0000 (01:12 +0200)]
MdeModulePkg/PciBusDxe: recognize hotplug-capable PCIe ports

Section 7.8.2 of the PCI Express specification (r4.0 v0.3), entitled "PCI
Express Capabilities Register (Offset 02h)", and section 7.8.9 "Slot
Capabilities Register (Offset 14h)" of the same, describe the conditions
when a PCIe port should be considered "supporting hotplug":

- it should be a root complex port or a switch downstream port, and

- it should have the "Slot Implemented" bit set in the Express
  Capabilities Register, and

- it should have the "Hot-Plug Capable" bit set in the Slot Capabilities
  Register.

The first two sub-conditions are already implemented in at least two open
source projects I could find:

- in SeaBIOS by Marcel Apfelbaum: "hw/pci: reserve IO and mem for pci
  express downstream ports with no devices attached"
  <https://code.coreboot.org/p/seabios/source/commit/3aa31d7d6375>,

- in edk2 itself, in the implementation of the "PCI" UEFI Shell command:
  see the "PcieExplainTypeSlot" case label in function
  PciExplainPciExpress(), file
  "ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c".

PciBusDxe recognizes such PCIe ports as bridges, but it doesn't realize
they support hotplug. In turn PciBusDxe omits getting any resource padding
information from the platform's EFI_PCI_HOT_PLUG_INIT_PROTOCOL for these
bridges:

  GatherPpbInfo()                [PciEnumeratorSupport.c]
    GetResourcePaddingPpb()      [PciResourceSupport.c]
      GetResourcePaddingForHpb() [PciHotPlugSupport.c]
        IsPciHotPlugBus()        [PciHotPlugSupport.c]
          //
          // returns FALSE
          //
        //
        // the following is not reached:
        //
        gPciHotPlugInit->GetResourcePadding()

Implement a function called SupportsPcieHotplug() for identifying such
ports, and call it from IsPciHotPlugBus() (after the call to IsSHPC()).

Cc: "Johnson, Brian J." <bjohnson@sgi.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Michael Kinney <michael.d.kinney@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: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoMdeModulePkg/PciBusDxe: look for the right capability in IsSHPC()
Laszlo Ersek [Thu, 30 Jun 2016 23:44:38 +0000 (01:44 +0200)]
MdeModulePkg/PciBusDxe: look for the right capability in IsSHPC()

The PCI Hot Plug capability register block is marked with capability ID
0x0C (EFI_PCI_CAPABILITY_ID_SHPC), not 0x06
(EFI_PCI_CAPABILITY_ID_HOTPLUG).

This bug prevents PciBusDxe from recognizing whether a PCI-to-PCI bridge
supports hotplug. In turn the platform's EFI_PCI_HOT_PLUG_INIT_PROTOCOL is
not consulted for resource padding information:

  GatherPpbInfo()                [PciEnumeratorSupport.c]
    GetResourcePaddingPpb()      [PciResourceSupport.c]
      GetResourcePaddingForHpb() [PciHotPlugSupport.c]
        IsPciHotPlugBus()        [PciHotPlugSupport.c]
          IsSHPC()               [PciHotPlugSupport.c]
            //
            // returns FALSE
            //
        //
        // the following is not reached:
        //
        gPciHotPlugInit->GetResourcePadding()

Look for the correct capability ID.

Cc: "Johnson, Brian J." <bjohnson@sgi.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Michael Kinney <michael.d.kinney@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: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoMdePkg/IndustryStandard: introduce EFI_PCI_CAPABILITY_ID_SHPC
Laszlo Ersek [Thu, 30 Jun 2016 23:35:19 +0000 (01:35 +0200)]
MdePkg/IndustryStandard: introduce EFI_PCI_CAPABILITY_ID_SHPC

The "Pci22.h" header file defines the macro EFI_PCI_CAPABILITY_ID_HOTPLUG
with value 0x06. According to all of:
- later parts of the same header file,
- Appendix H ("Capability IDs") of the PCI Local Bus Specification
  Revision 2.3,
- and Chapter 2 ("Capability IDs") of the PCI Code and ID Assignment
  Specification Revision 0.9,

0x06 means "CompactPCI Hot Swap". It does not mean "PCI Hot-Plug": that
capability is described by ID 0x0C:

  0Ch  PCI Hot-Plug -- This Capability ID indicates that the associated
       device conforms to the Standard Hot-Plug Controller model.

Therefore EFI_PCI_CAPABILITY_ID_HOTPLUG is arguably a misnomer. PciBusDxe
(mis-)uses EFI_PCI_CAPABILITY_ID_HOTPLUG in the IsSHPC() helper function
to identify PCI Hot-Plug capability.

In order to preserve compatibility with existent code, leave
EFI_PCI_CAPABILITY_ID_HOTPLUG alone, and introduce
EFI_PCI_CAPABILITY_ID_SHPC with the right ID value.

Cc: "Johnson, Brian J." <bjohnson@sgi.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Michael Kinney <michael.d.kinney@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: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoOvmfPkg/PlatformBootManagerLib: remove stale FvFile boot options
Laszlo Ersek [Fri, 8 Jul 2016 00:49:45 +0000 (02:49 +0200)]
OvmfPkg/PlatformBootManagerLib: remove stale FvFile boot options

Removes any boot options that point to binaries built into the firmware
and have become stale due to any of the following:
- DXEFV's base address or size changed (historical),
- DXEFV's FvNameGuid changed,
- the FILE_GUID of the pointed-to binary changed,
- the referenced binary is no longer built into the firmware.

For example, multiple such "EFI Internal Shell" boot options can coexist.
They technically differ from each other, but may not describe any built-in
shell binary exactly. Such options can accumulate in a varstore over time,
and while they remain generally bootable (thanks to the efforts of
BmGetFileBufferByFvFilePath()), they look bad.

Filter out any stale options.

This functionality is not added to QemuBootOrderLib, because it is
independent from QEMU and fw_cfg.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gary Lin <glin@suse.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>
7 years agoOvmfPkg: add a Name GUID to each Firmware Volume
Laszlo Ersek [Tue, 12 Jul 2016 14:48:47 +0000 (16:48 +0200)]
OvmfPkg: add a Name GUID to each Firmware Volume

The FDF spec mentions the FvNameGuid statement for [FV.xxxx] sections, but
the detailed description can be found in Volume 3 of the Platform Init
spec (which is at 1.4a currently).

Adding an FvNameGuid statement to [FV.xxx] has the following effects
(implemented by "BaseTools/Source/C/GenFv/GenFvInternalLib.c"):

- The EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset field is set to a nonzero
  value, pointing after EFI_FIRMWARE_VOLUME_HEADER itself (although not
  directly, see below).

- An EFI_FIRMWARE_VOLUME_EXT_HEADER object is created at the pointed-to
  address. This object is not followed by any
  EFI_FIRMWARE_VOLUME_EXT_ENTRY (= extension) entries, so it only
  specifies the Name GUID for the firmware volume.

  The EFI_FIRMWARE_VOLUME_EXT_HEADER for each firmware volume can be found
  in the Build directory as a separate file (20 bytes in size):

  Build/Ovmf*/*_GCC*/FV/*.ext

- The new data consume 48 bytes in the following volumes: SECFV,
  FVMAIN_COMPACT, DXEFV. They comprise:

  - 16 padding bytes,

  - EFI_FFS_FILE_HEADER2 (8 bytes in total: no Name and ExtendedSize
    fields, and Type=EFI_FV_FILETYPE_FFS_PAD),

  - EFI_FIRMWARE_VOLUME_EXT_HEADER (20 bytes, see above),

  - 4 padding bytes.

  (The initial 16 padding bytes and the EFI_FFS_FILE_HEADER2 structure are
  the reason why EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset does not point
  immediately past EFI_FIRMWARE_VOLUME_HEADER.)

  The sizes of the firmware volumes don't change, only their internal
  usages grow by 48 bytes. I verified that the statements and calculations
  in "OvmfPkg/DecomprScratchEnd.fdf.inc" are unaffected and remain valid.

- The new data consume 0 bytes in PEIFV. This is because PEIFV has enough
  internal padding at the moment to accomodate the above structures
  without a growth in usage.

In the future, firmware volumes can be identified by Name GUID (Fv(...)
device path nodes), rather than memory location (MemoryMapped(...) device
path nodes). This is supposed to improve stability for persistent device
paths that refer to FFS files; for example, UEFI boot options.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Suggested-by: 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>
7 years agoBaseTools/GenFds: unbreak Region.PadBuffer
Laszlo Ersek [Tue, 12 Jul 2016 13:52:38 +0000 (15:52 +0200)]
BaseTools/GenFds: unbreak Region.PadBuffer

In its current form, Region.PadBuffer() fills every second byte with 0x20,
the default separator string of Python's string.join():

https://docs.python.org/2/library/string.html#string.join

This corrupts some firmware because (a) 0x20 never corresponds to any
ErasePolarity, (b) the PadData produced are actually longer than Size.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: bd907fb6386560e621112beca7b7d381d0003967
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoArmVirtPkg: add name GUIDs to FvMain instances
Ard Biesheuvel [Tue, 12 Jul 2016 09:08:52 +0000 (11:08 +0200)]
ArmVirtPkg: add name GUIDs to FvMain instances

Assign name GUIDs to the FVs that may appear in DevicePath references to
things like the UiApp and the UEFI Shell. This prevents these device
paths from changing inadvertently when the FV ends up in a different
memory location due to external occurrences such as, e.g., a change in
the amount of system memory.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmVirtPkg: factor out Rules FDF section
Ard Biesheuvel [Tue, 12 Jul 2016 09:01:24 +0000 (11:01 +0200)]
ArmVirtPkg: factor out Rules FDF section

All three current ArmVirtPkg have identical [Rules] sections in their
FDF definitions, and ideally, they should remain that way. So factor
out the definitions into a separate include file, and replace the
existing definitions with !include directives.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmVirtPkg/ArmVirtQemu: factor out shared FV.FvMain definition
Ard Biesheuvel [Tue, 12 Jul 2016 08:59:57 +0000 (10:59 +0200)]
ArmVirtPkg/ArmVirtQemu: factor out shared FV.FvMain definition

The FDF definition of [FV.FvMain] is identical between ArmVirtQemu and
ArmVirtQemuKernel, and needs to remain that way. So factor it out into
a separate include file, and replace both definitions with an !include
directive.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmVirtPkg: align ArmVirtQemuKernel with ArmVirtQemu
Ard Biesheuvel [Tue, 12 Jul 2016 08:49:55 +0000 (10:49 +0200)]
ArmVirtPkg: align ArmVirtQemuKernel with ArmVirtQemu

The platform ArmVirtQemuKernel is intended as an alternative for
ArmVirtQemu that only deviates in the way it is invoked by QEMU, either
from flash address 0x0 (the default ARM reset vector) or via the Linux
kernel boot protocol. So add VirtioRngDxe and HighMemDxe here as well.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmVirtPkg: ArmVirtQemuKernel: make ACPI support AARCH64 only
Ard Biesheuvel [Tue, 12 Jul 2016 11:08:11 +0000 (13:08 +0200)]
ArmVirtPkg: ArmVirtQemuKernel: make ACPI support AARCH64 only

The reasoning of patch 8e2efec6b206:

  No ARM support for ACPI is planned under any OS we intend to run under
  ArmVirtQemu-ARM, so remove the drivers from the ARM build.

applies equally to ArmVirtQemuKernel, so apply the same change there.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmVirtPkg/HighMemDxe: allow patchable PCD for PcdSystemMemoryBase
Ard Biesheuvel [Tue, 12 Jul 2016 12:54:28 +0000 (14:54 +0200)]
ArmVirtPkg/HighMemDxe: allow patchable PCD for PcdSystemMemoryBase

Redefine the reference to PcdSystemMemoryBase in HighMemDxe.inf as
a plain [Pcd] rather than [FixedPcd] (and fix up the code as
appropriate). This allows us to align ArmVirtQemuKernel with
ArmVirtQemu, given that the former uses a patchable PCD not a fixed
PCD.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdeModulePkg AtaBusDxe: Fix ATA commands cannot be sent to some devices
Hao Wu [Mon, 11 Jul 2016 04:56:48 +0000 (12:56 +0800)]
MdeModulePkg AtaBusDxe: Fix ATA commands cannot be sent to some devices

If there is no port multiplier (PortMultiplierPort = 0xFFFF), current code
in functions TransferAtaDevice() and TrustTransferAtaDevice() will always
set the DEV bit of the ATA device register. It causes that ATA commands
cannot be sent to some ATA hard drives.

Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoBaseTools/GenFds: speed up Region.PadBuffer()
Laszlo Ersek [Mon, 11 Jul 2016 14:26:31 +0000 (16:26 +0200)]
BaseTools/GenFds: speed up Region.PadBuffer()

The current implementation calls both pack() and Buffer.write() Size
times. The new implementation calls both of these methods only once; the
full data to write are constructed locally [1]. The range() function is
replaced by xrange() because the latter is supposed to be faster / lighter
weight [2].

On my laptop, I tested the change as follows: I pre-built the series at
[3] with

  build -a X64 -p OvmfPkg/OvmfPkgX64.dsc -t GCC48 -b DEBUG \
      -D HTTP_BOOT_ENABLE -D SECURE_BOOT_ENABLE

(The series at [3] is relevant because it increases the size of one of the
padded regions by 8.5 MB, slowing down the build quite a bit.)

With all source code already compiled, repeating the above command takes
approximately 45 seconds. With the patch applied, it goes down to 29
seconds.

[1] http://stackoverflow.com/questions/27384093/fastest-way-to-write-huge-data-in-file
[2] https://docs.python.org/2/library/functions.html?highlight=xrange#xrange
[3] http://thread.gmane.org/gmane.comp.bios.edk2.devel/14214

We can also measure the impact with a synthetic test:

> import timeit
>
> test_old = """
> import struct, string, StringIO
> Size = (8 * 1024 + 512) * 1024
> Buffer = StringIO.StringIO()
> PadData = 0xFF
> for i in range(0, Size):
>     Buffer.write(struct.pack('B', PadData))
> """
>
> test_new = """
> import struct, string, StringIO
> Size = (8 * 1024 + 512) * 1024
> Buffer = StringIO.StringIO()
> PadByte = struct.pack('B', 0xFF)
> PadData = string.join(PadByte for i in xrange(0, Size))
> Buffer.write(PadData)
> """
>
> print(timeit.repeat(stmt=test_old, number=1, repeat=3))
> print(timeit.repeat(stmt=test_new, number=1, repeat=3))

The output is

[8.231637001037598, 8.81188416481018, 8.948754072189331]
[0.5503702163696289, 0.5461571216583252, 0.578315019607544]

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools/GenFds: factor out Region.PadBuffer() method
Laszlo Ersek [Mon, 11 Jul 2016 14:17:23 +0000 (16:17 +0200)]
BaseTools/GenFds: factor out Region.PadBuffer() method

The same logic is used in five places; factor it out to a common method.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoShellBinPkg: Ia32/X64 Shell binary update.
Ruiyu Ni [Tue, 12 Jul 2016 07:10:09 +0000 (15:10 +0800)]
ShellBinPkg: Ia32/X64 Shell binary update.

The binaries of ShellBinPkg are generated with ShellPkg project c882bdc6712314f255c92d7c951eaf9760a9de38.
The binaries are built with no debug information by building with "RELEASE" target.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg: Fix build error in the PXE driver.
Fu Siyuan [Tue, 12 Jul 2016 01:58:46 +0000 (09:58 +0800)]
MdeModulePkg: Fix build error in the PXE driver.

Fix the build error introduced by 0a28d02d9fb5293757c507e592a4d0404a7ecf74.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoCryptoPkg BaseCryptLib: Init the content of struct 'CertCtx' before use
Hao Wu [Sun, 10 Jul 2016 01:24:53 +0000 (09:24 +0800)]
CryptoPkg BaseCryptLib: Init the content of struct 'CertCtx' before use

Some fields in structure 'CertCtx' might be used uninitialized in function
Pkcs7GetCertificatesList().

This commit makes sure that 'CertCtx' gets initialized before being used.

Cc: Long Qin <qin.long@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoCryptoPkg BaseCryptLib: Avoid passing NULL ptr to function BN_bn2bin()
Hao Wu [Fri, 1 Jul 2016 07:12:40 +0000 (15:12 +0800)]
CryptoPkg BaseCryptLib: Avoid passing NULL ptr to function BN_bn2bin()

This commit modifies the code logic to avoid passing NULL pointer to
function BN_bn2bin().

Cc: Long Qin <qin.long@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: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
7 years agoMdeModulePkg MemoryProfile: ASSERT to ensure 'DriverInfoData' is not NULL
Hao Wu [Thu, 7 Jul 2016 00:49:38 +0000 (08:49 +0800)]
MdeModulePkg MemoryProfile: ASSERT to ensure 'DriverInfoData' is not NULL

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>
7 years agoNetworkPkg: Update PXE driver to follow edk2 coding standards.
Fu Siyuan [Thu, 30 Jun 2016 01:57:56 +0000 (09:57 +0800)]
NetworkPkg: Update PXE driver to follow edk2 coding standards.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <smahmoud@lenovo.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
7 years agoMdeModulePkg: Update PXE driver to follow edk2 coding standards.
Fu Siyuan [Thu, 30 Jun 2016 01:57:23 +0000 (09:57 +0800)]
MdeModulePkg: Update PXE driver to follow edk2 coding standards.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <smahmoud@lenovo.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
7 years agoIntelFsp2Pkg SecFspSecPlatformLibNull: Remove MASM/GAS files
Liming Gao [Fri, 8 Jul 2016 14:49:23 +0000 (22:49 +0800)]
IntelFsp2Pkg SecFspSecPlatformLibNull: Remove MASM/GAS files

Keep NASM file only for new added modules.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoIntelFsp2Pkg BaseFspSwitchStackLib: Remove MASM/GAS files
Liming Gao [Fri, 8 Jul 2016 14:49:22 +0000 (22:49 +0800)]
IntelFsp2Pkg BaseFspSwitchStackLib: Remove MASM/GAS files

Keep NASM file only for new added modules.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoIntelFsp2Pkg BaseFspDebugLibSerialPort: Remove MASM/GAS files
Liming Gao [Fri, 8 Jul 2016 14:49:21 +0000 (22:49 +0800)]
IntelFsp2Pkg BaseFspDebugLibSerialPort: Remove MASM/GAS files

Keep NASM file only for new added modules.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoIntelFsp2WrapperPkg SecFspWrapperPlatformSecLibSample: Remove MASM/GAS files
Liming Gao [Fri, 8 Jul 2016 14:49:20 +0000 (22:49 +0800)]
IntelFsp2WrapperPkg SecFspWrapperPlatformSecLibSample: Remove MASM/GAS files

Keep NASM file only for new added modules.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoIntelFsp2WrapperPkg BaseFspWrapperApiLib: Remove MASM/GAS files
Liming Gao [Fri, 8 Jul 2016 14:49:19 +0000 (22:49 +0800)]
IntelFsp2WrapperPkg BaseFspWrapperApiLib: Remove MASM/GAS files

Keep NASM file only for new added modules.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoUefiCpuPkg CpuMpPei: Update INF to refer to NASM source file
Liming Gao [Mon, 11 Jul 2016 03:14:21 +0000 (11:14 +0800)]
UefiCpuPkg CpuMpPei: Update INF to refer to NASM source file

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoUefiCpuPkg CpuIo2Dxe: Update INF to refer to NASM source file
Liming Gao [Mon, 11 Jul 2016 03:13:57 +0000 (11:13 +0800)]
UefiCpuPkg CpuIo2Dxe: Update INF to refer to NASM source file

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoUefiCpuPkg SecCore: Update SecCore inf to refer to nasmb source
Liming Gao [Mon, 11 Jul 2016 02:59:58 +0000 (10:59 +0800)]
UefiCpuPkg SecCore: Update SecCore inf to refer to nasmb source

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoNetworkPkg: Fix Assert issue in iSCSI driver.
Zhang, Lubo [Fri, 8 Jul 2016 07:50:46 +0000 (15:50 +0800)]
NetworkPkg: Fix Assert issue in iSCSI driver.

The bug existed in replacing AsciiStrToUnicodeStr with AsciiStrToUnicodeStrS,
since MacString now is a pointer, the value sizeof(MacString)/sizeof (MacString[0])
is not correct here as the third parameter.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoSecurityPkg OpalPasswordSmm: Remove useless code.
Eric Dong [Fri, 8 Jul 2016 02:51:10 +0000 (10:51 +0800)]
SecurityPkg OpalPasswordSmm: Remove useless code.

EdkII not allow to use #if in source code, also
the code in it already unused. so just remove this
code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:21:08 +0000 (14:21 +0800)]
UefiCpuPkg: Fix typos in comments

- becasue to because

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoNetworkPkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:21:06 +0000 (14:21 +0800)]
NetworkPkg: Fix typos in comments

- abstrated to abstracted
- apropriate to appropriate
- availabe to available
- ptototypes to prototypes
- prococol protocol

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
7 years agoMdePkg: Fix typos in comments
Mudusuru, Giri P [Fri, 8 Jul 2016 06:21:05 +0000 (14:21 +0800)]
MdePkg: Fix typos in comments

- availabe to available
- EFI_UNSUPPORTEDT to EFI_UNSUPPORTED

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg: Fix typos in comments and variables
Giri P Mudusuru [Fri, 8 Jul 2016 06:21:04 +0000 (14:21 +0800)]
MdeModulePkg: Fix typos in comments and variables

  - abstrated to abstracted
  - accessibla to accessible
  - addres to address
  - apropriate to appropriate
  - arry to array
  - availabe to available
  - avaliable to available
  - becasue to because
  - correponding to corresponding
  - etablished to established
  - exeuction to execution
  - extensiable to extensible
  - fileds to fields
  - loadding to loading
  - ptototypes to prototypes
  - prococol protocol
  - requried to required
  - resoruce to resource
  - runing to running
  - uild to build

Cc: Star Zeng <star.zeng@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoIntelFrameworkModulePkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:21:03 +0000 (14:21 +0800)]
IntelFrameworkModulePkg: Fix typos in comments

- requried to required

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoPcAtChipsetPkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:21:02 +0000 (14:21 +0800)]
PcAtChipsetPkg: Fix typos in comments

- EFI_UNSUPPORTEDT to EFI_UNSUPPORTED

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoOptionRomPkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:21:01 +0000 (14:21 +0800)]
OptionRomPkg: Fix typos in comments

- EFI_OUT_OF_RESORUCES to EFI_OUT_OF_RESOURCES

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoSecurityPkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:21:00 +0000 (14:21 +0800)]
SecurityPkg: Fix typos in comments

- availabe to available

Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoCryptoPkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:20:59 +0000 (14:20 +0800)]
CryptoPkg: Fix typos in comments

- availabe to available

Cc: Qin Long <qin.long@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
7 years agoNt32Pkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:20:58 +0000 (14:20 +0800)]
Nt32Pkg: Fix typos in comments

- EFI_UNSUPPORTEDT to EFI_UNSUPPORTED

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoEdkCompatibilityPkg: Fix typos in comments
Mudusuru, Giri P [Fri, 8 Jul 2016 06:20:56 +0000 (14:20 +0800)]
EdkCompatibilityPkg: Fix typos in comments

  - availabe to available
  - consummer to consumer
  - EFI_UNSUPPORTEDT to EFI_UNSUPPORTED
  - extensiable to extensible

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmPkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:20:55 +0000 (14:20 +0800)]
ArmPkg: Fix typos in comments

EFI_UNSUPPORTEDT to EFI_UNSUPPORTED

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoMdeModulePkg SdBlockIoPei: Initialize 'SwitchResp' elements before using
Hao Wu [Thu, 7 Jul 2016 06:53:58 +0000 (14:53 +0800)]
MdeModulePkg SdBlockIoPei: Initialize 'SwitchResp' elements before using

The commit makes sure that the elements in array 'SwitchResp' get
initialized before being used.

Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg MemoryProfile.h:two bytes of Reserved[4] as ActionStringOffset
Star Zeng [Fri, 8 Jul 2016 02:37:46 +0000 (10:37 +0800)]
MdeModulePkg MemoryProfile.h:two bytes of Reserved[4] as ActionStringOffset

At 94092aa60341a3e4b1e1ea7c362781b8404ac538, we extended
MEMORY_PROFILE_ALLOC_INFO to add ActionStringOffset and
Reserved2[6] fields, that was not aware the Reserved[4]
field can be reused to have better memory profile database
size efficiency.

With the patch, PcdMemoryProfilePropertyMask|0x3 and
PcdMemoryProfileMemoryType|0xffff, the memory profile
database size can be reduced as below on my sample platform.

UefiMemoryProfileSize - 0x1597A8 -> UefiMemoryProfileSize - 0x12AB28
SmramProfileSize - 0xCF68 -> SmramProfileSize - 0xB8E8

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>
7 years agoMdePkg Base.h: Fix typo funcation to function
Star Zeng [Fri, 8 Jul 2016 01:31:13 +0000 (09:31 +0800)]
MdePkg Base.h: Fix typo funcation to function

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@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: Liming Gao <liming.gao@intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: Postpone the shell registration
Laszlo Ersek [Fri, 8 Jul 2016 09:20:32 +0000 (11:20 +0200)]
ArmVirtPkg/PlatformBootManagerLib: Postpone the shell registration

This patch ports Gary's OvmfPkg commit 14b2ebc30c8b to ArmVirtPkg.

Turns out Gary's argument in 14b2ebc30c8b is not only valid for Xen. The
same situation arises with QEMU if:
- the user specifies no boot order via fw_cfg at all (so QemuBootOrderLib
  won't touch the boot order), and
- the varstore file has just been created from the varstore template.

In this case the user is dropped to the UEFI shell (because the shell is
registered earlier than all the auto-generated options), which is likely
not what the user wants.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gary Lin <glin@suse.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoOvmfPkg: Fix typos in comments
Giri P Mudusuru [Fri, 8 Jul 2016 06:21:07 +0000 (23:21 -0700)]
OvmfPkg: Fix typos in comments

  - accessibla to accessible
  - exeuction to execution

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoCryptoPkg: update openssl to ignore RVCT 3079
Eugene Cohen [Fri, 8 Jul 2016 07:53:16 +0000 (15:53 +0800)]
CryptoPkg: update openssl to ignore RVCT 3079

Getting openssl 1.0.2g building with ARM RVCT requires a change to
ignore an unset variable used before set was necessary.
(NOTE: This was fixed in OpenSSL 1.1 HEAD with commit
       d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.)

corrects x509_vfy.c(875): error C3017: ok may be used before being set

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Qin Long <qin.long@intel.com>
7 years agoRevert "ShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'."
Ruiyu Ni [Tue, 5 Jul 2016 05:28:53 +0000 (13:28 +0800)]
Revert "ShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'."

This reverts commit ee60bd2b6aa473fdff6af3bfc62203ed8ca5c52a and
e36ed7a84b2768443de22371f0aad5cf502328b1.
The two commits enhanced 'edit' to support text selection through
mouse. But the code introduced some bugs resulting the text
selection behavior is not very usable and potentially hang in
certain platforms.

So I'd like to revert them firstly. If there is strong
requirement for the text selection through mouse in 'edit'
I will refine and re-add the code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jarben.carsey@intel.com>
7 years agoShellPkg: Series of patches to fix typos - apropriate to appropriate
Mudusuru, Giri P [Thu, 7 Jul 2016 07:47:45 +0000 (00:47 -0700)]
ShellPkg: Series of patches to fix typos - apropriate to appropriate

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-By: Jaben Carsey <jaben.carsey@intel.com>
7 years agoStdLib: Series of patches to fix typos - availabe to available
Mudusuru, Giri P [Thu, 7 Jul 2016 07:47:35 +0000 (00:47 -0700)]
StdLib: Series of patches to fix typos - availabe to available

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-By: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-By: Daryl McDaniel <edk2-lists@mc2research.org>
7 years agoArmPlatformPkg: Set Juno debug serial port defaults
Evan Lloyd [Mon, 20 Jun 2016 18:43:04 +0000 (19:43 +0100)]
ArmPlatformPkg: Set Juno debug serial port defaults

Juno has several serial ports, one of which may be used for a remote
debug interface (e.g. gdb, WinDbg).  The debug serial port needs to
be distinct from that used for UEFI trace to prevent corruption of
debugger protocol messaging.
The UEFI spec requires that serial devices be initialised to default
settings. (11.8 Serial I/O Protocol - "The default attributes for all
UART-style serial device interfaces are: 115,200 baud, ..."
and 17.3.3 EFI Debugport Variable - "These defaults must be used in the
absence of a DEBUGPORT variable...")

This change adds initialization of the serial device reported in the
ACPI DBG2 table.  The initialisation is done early in the boot to allow
the possibility of remote debug of UEFI itself.

NOTE: This is functionally dependent on the DBG2 table being updated in
OpenPlatformPkg, but is required as a precursor to that change.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoShellPkg:Ping: Ping command hangs with intermittent packet losses
Subramanian, Sriram (EG Servers Platform SW) [Thu, 7 Jul 2016 08:13:54 +0000 (01:13 -0700)]
ShellPkg:Ping: Ping command hangs with intermittent packet losses

When we have intermittent loss of packets, ping command doesnt
return to Shell prompt. It keeps looping in the while (Status
==EFI_NOT_READY) since Private->RxCount will never reach
Private->SendNum. Addresses the issue with the use of a new varibale
in the PRIVATE structure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoArmPkg/ArmMmuLib: add PEI specific version of ArmMmuLib
Ard Biesheuvel [Thu, 16 Jun 2016 10:21:50 +0000 (12:21 +0200)]
ArmPkg/ArmMmuLib: add PEI specific version of ArmMmuLib

This introduces a special version of ArmMmuLib for PEIMs that takes care
only to perform cache maintenance on the live entry replacement routine
if the module is not executing in place. Not only is such cache maintenance
unnecessary in that case, it may be actively harmful on some systems that
fail to tolerate cache maintenance operations on NOR flash regions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg ArmVirtPkg MdeModulePkg: switch to separate ArmMmuLib
Ard Biesheuvel [Thu, 16 Jun 2016 09:51:10 +0000 (11:51 +0200)]
ArmPkg ArmVirtPkg MdeModulePkg: switch to separate ArmMmuLib

Switch all users of ArmLib that depend on the MMU routines to the new,
separate ArmMmuLib. This needs to occur in one go, since the MMU
routines are removed from ArmLib build at the same time, to prevent
conflicting symbols.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoArmPkg: introduce base ArmMmuLib implementation
Ard Biesheuvel [Wed, 15 Jun 2016 16:49:09 +0000 (18:49 +0200)]
ArmPkg: introduce base ArmMmuLib implementation

This base library encapsulates the MMU manipulation routines that have been
factored out of ArmLib. The functionality covers initial creation of the 1:1
mapping in the page tables, and remapping regions to change permissions or
cacheability attributes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg: introduce ArmMmuLib library class
Ard Biesheuvel [Wed, 15 Jun 2016 15:54:10 +0000 (17:54 +0200)]
ArmPkg: introduce ArmMmuLib library class

Introduce the library class ArmMmuLib, which encapsulates the functionality
to set up and modify page table entries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoIntelFrameworkModulePkg/LegacyUi: Get legacy options when open legacy form
Dandan Bi [Thu, 7 Jul 2016 02:58:14 +0000 (10:58 +0800)]
IntelFrameworkModulePkg/LegacyUi: Get legacy options when open legacy form

The LegacyBootMaintUiLib depends on the LegacyBootManagerLib to realize its
functionality, the LegacyBootManagerLib may initialize after
LegacyBootMaintUiLib, so the functionality of LegacyBootMaintUiLib may
be incorrect. Now we fix this issue by executing the related codes when
opening the legacy forminstead in its the constructor function. Because
when opening the legacy form, the LegacyBootManagerLib must have been
initialized.

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>
7 years agoMdeModulePkg/BootMaintUiLib: Update menus when open BMM form
Dandan Bi [Thu, 30 Jun 2016 03:37:56 +0000 (11:37 +0800)]
MdeModulePkg/BootMaintUiLib: Update menus when open BMM form

BootMaintenanceManagerUiLib depend on the LeagcyBootMaintUiLib to show the
legacy menus. So we need to do the actions related to LegacyUi in BMM
after the LeagcyBootMaintUiLib have been initialized. So now : 1). update
menus (including legacy menus), 2) re-scan boot options (including legacy
boot option) when opening the BMM form. We think when opening BMM form,
the LeagcyBootMaintUiLib must have been initialized.

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>
7 years agoMdeModulePkg/HiiDB: Record fail info if fail to save data for EfiVarStore
Dandan Bi [Mon, 20 Jun 2016 10:24:34 +0000 (18:24 +0800)]
MdeModulePkg/HiiDB: Record fail info if fail to save data for EfiVarStore

HiiConfigRoutingRouteConfig function returns 'Progress' to indicate
the failure info in the ConfigResp string. But when fail to route the
ConfigResp for EfiVarStore, it doesn't return the correct failure info.
Now this patch is to fix this issue and add debug info let user know the
reason of failure.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Chao Zhang <chao.b.zhang@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: Chao Zhang <chao.b.zhang@intel.com>
7 years agoMdeModulePkg/Bds: MemoryTypeInformation excludes boot option mem use
Ruiyu Ni [Tue, 5 Jul 2016 09:46:07 +0000 (17:46 +0800)]
MdeModulePkg/Bds: MemoryTypeInformation excludes boot option mem use

The patch re-orders the sequences by putting updating memory type
information before loading the boot option so that the reserved
memory usage by HTTP RAM disk boot can be excluded by the memory
type information updating.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg: Fix IPv4 stack potential disappeared issue
Jiaxin Wu [Thu, 30 Jun 2016 07:53:01 +0000 (15:53 +0800)]
MdeModulePkg: Fix IPv4 stack potential disappeared issue

IP4_CONFIG2_INSTANCE->DataItem is used to save the configuration
data to NV variable. When the policy is changed from static to
DHCP, DnsServers info will be cleaned from DataItem first
(See Ip4Config2SetPolicy), it's correct because DnsServers info
should not be saved to NV variable.
But if there is any DnsServers info received from DHCP message, it
will be reset to DataItem again (See Ip4Config2SetDnsServerWorker),
which may cause the NV variable contain the DnsServers info while
the policy is DHCP (See Ip4Config2WriteConfigData).
Then, while the platform is reset, the issue happened. Because
Ip4Config2DataTypeDnsServer is set under DHCP policy, which is not
allowed by UEFI Spec and error returned.

This patch is used to resolve this potential issue.

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: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoFix GUID dereference
Thomas Palmer [Tue, 28 Jun 2016 18:21:32 +0000 (11:21 -0700)]
Fix GUID dereference

Print's "%g" argument requires a EFI_GUID pointer, not the EFI_GUID
value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-By: Jaben Carsey <jaben.carsey@intel.com>
7 years agoChange ShellPkg&ShellBinPkg maintainer
Ni, Ruiyu [Tue, 5 Jul 2016 07:35:48 +0000 (00:35 -0700)]
Change ShellPkg&ShellBinPkg maintainer

Since Shumin has left Intel to pursue a better job, I will temporary
be on his position to maintain ShellPkg and ShellBinPkg with Jaben.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-By: Jaben Carsey <jaben.carsey@intel.com>
7 years agoEmbeddedPkg/AcpiLib: add GICC table init macro for ACPI 6.0
Graeme Gregory [Tue, 5 Jul 2016 20:15:39 +0000 (21:15 +0100)]
EmbeddedPkg/AcpiLib: add GICC table init macro for ACPI 6.0

ACPI 6.0 added a processor efficiency field and 3 reserved bytes at the
end of the GICC structure so add a new macro to initialise the new
field.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoMdeModulePkg/BootMaintUi: Add error handling codes when AllocatePool fail
Bi, Dandan [Tue, 5 Jul 2016 08:53:11 +0000 (16:53 +0800)]
MdeModulePkg/BootMaintUi: Add error handling codes when AllocatePool fail

The AllocateCopyPool in function ExtractFileNameFromDevicePath
may return NULL, so need to do error handling. This patch is to
add error handling codes for function ExtractFileNameFromDevicePath
and its caller functions.

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: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
7 years agoMdeModulePkg/UefiHiiLib: Add error handling codes when AllocatePool fail
Bi, Dandan [Tue, 5 Jul 2016 03:19:22 +0000 (11:19 +0800)]
MdeModulePkg/UefiHiiLib: Add error handling codes when AllocatePool fail

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>
7 years agoMdeModulePkg UefiPxeBcDxe: Fix build error for lastest VS2015 compiler
Hao Wu [Tue, 5 Jul 2016 02:30:51 +0000 (10:30 +0800)]
MdeModulePkg UefiPxeBcDxe: Fix build error for lastest VS2015 compiler

The UefiPxeBcDxe module encounters a build error for IA32 arch using the
latest version of VS2015:

UefiPxe4BcDxe.lib(PxeBcDhcp.obj) : error LNK2001: unresolved external
symbol __allmul

The cause is line 1659 in file
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c. The third
parameter for gBS->SetTimer() function is of type UINT64, so the
multiplication should use the MultU64x32() function.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@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>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoMdeModulePkg: Skip registering BootManagerMenu if absent
Sunny Wang [Fri, 1 Jul 2016 02:38:24 +0000 (10:38 +0800)]
MdeModulePkg: Skip registering BootManagerMenu if absent

This is a enhancement to support the case when platform firmware
doesn't support Boot Manager Menu. For now, if BootManagerMenu FFS
can not be retrieved from FV, BDS core code will still register a
boot option for it. Then, this non-functional boot option will
still be booted by user's request (like HotKey or Exit from shell)
to cause additional boot time and error status code reported.
Therefore, it would be good to skip BootManagerMenu boot option
registration and then return error status and Invalid BootOption
data for this case so that the BootManagerBoot() or other consumers
can directly return without doing anything.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoBaseTools MemoryProfileSymbolGen.py: Handle 64bits rva from "nm -l xxx.dll"
Star Zeng [Mon, 4 Jul 2016 10:39:34 +0000 (18:39 +0800)]
BaseTools MemoryProfileSymbolGen.py: Handle 64bits rva from "nm -l xxx.dll"

Current MemoryProfileSymbolGen.py assumes the rva is 32bits,
the patch is to remove the restriction to match any lengths
of rva.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@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>
7 years agoMdeModulePkg MemoryProfileInfo: Handle "/" character in the PDB path
Star Zeng [Mon, 4 Jul 2016 10:27:29 +0000 (18:27 +0800)]
MdeModulePkg MemoryProfileInfo: Handle "/" character in the PDB path

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>
7 years agoShellPkg: Update the error prompt for ping6 command.
Zhang Lubo [Fri, 1 Jul 2016 06:12:31 +0000 (14:12 +0800)]
ShellPkg: Update the error prompt for ping6 command.

when we use the ping6 command without configuring the network
interface, it should give correct prompt to users.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoBaseTools: Add support for $(FAMILY) macro
Yonghong Zhu [Mon, 4 Jul 2016 08:34:28 +0000 (16:34 +0800)]
BaseTools: Add support for $(FAMILY) macro

Build spec mentions $(FAMILY) macro be used in DSC/FDF to specify the tool
chain family, like GCC, MSFT. This patch add the support for this macro.

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>
7 years agoMdeModulePkg DxeIplPeim: Add ASSERTs for unexpected AllocatePages failure
Hao Wu [Mon, 4 Jul 2016 04:56:51 +0000 (12:56 +0800)]
MdeModulePkg DxeIplPeim: Add ASSERTs for unexpected AllocatePages failure

Cc: Star Zeng <star.zeng@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: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg MemoryProfile: Add ASSERTs to make sure pointers are not NULL
Hao Wu [Mon, 4 Jul 2016 04:38:28 +0000 (12:38 +0800)]
MdeModulePkg MemoryProfile: Add ASSERTs to make sure pointers are not NULL

Code logic ensures that both pointers 'DriverInfoData' and 'AllocInfoData'
will not be NULL when they are used.

Add ASSERTs as warning for cases 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>