]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
7 years agoCorebootPayloadPkg/ResetSystemLib: Implement ResetPlatformSpecific
Ruiyu Ni [Wed, 10 Aug 2016 05:25:08 +0000 (13:25 +0800)]
CorebootPayloadPkg/ResetSystemLib: Implement ResetPlatformSpecific

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
7 years agoMdeModulePkg/BaseResetSystemLibNull: Implement ResetPlatformSpecific
Ruiyu Ni [Wed, 10 Aug 2016 05:23:31 +0000 (13:23 +0800)]
MdeModulePkg/BaseResetSystemLibNull: Implement ResetPlatformSpecific

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
7 years agoMdeModulePkg: Add API ResetPlatformSpecific() to ResetSystemLib.h
Ruiyu Ni [Wed, 10 Aug 2016 05:21:47 +0000 (13:21 +0800)]
MdeModulePkg: Add API ResetPlatformSpecific() to ResetSystemLib.h

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
7 years agoMdePkg/UefiSpec.h: Align function header of ResetSystem to UEFI Spec
Ruiyu Ni [Wed, 27 Jul 2016 02:22:37 +0000 (10:22 +0800)]
MdePkg/UefiSpec.h: Align function header of ResetSystem to UEFI Spec

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmVirtPkg: remove PcdKludgeMapPciMmioAsCached
Laszlo Ersek [Thu, 18 Aug 2016 09:51:33 +0000 (11:51 +0200)]
ArmVirtPkg: remove PcdKludgeMapPciMmioAsCached

In ARM/AARCH64 guests that run on KVM, we can now use virtio-gpu-pci, so
PcdKludgeMapPciMmioAsCached is no longer necessary. Standard VGA continues
to work on TCG without the kludge.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoOvmfPkg/VirtioGpuDxe: implement EFI_GRAPHICS_OUTPUT_PROTOCOL
Laszlo Ersek [Wed, 17 Aug 2016 20:45:02 +0000 (22:45 +0200)]
OvmfPkg/VirtioGpuDxe: implement EFI_GRAPHICS_OUTPUT_PROTOCOL

In this patch we replace our "dummy" Graphics Output Protocol interface
with the real one. We exploit that EFI_GRAPHICS_OUTPUT_BLT_PIXEL and
VirtioGpuFormatB8G8R8X8Unorm have identical representations; this lets us
forego any pixel format conversions in the guest. For messaging the VirtIo
GPU device, we use the primitives introduced in the previous patch.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
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/VirtioGpuDxe: provide functions for sending VirtIo GPU commands
Laszlo Ersek [Thu, 18 Aug 2016 15:00:03 +0000 (17:00 +0200)]
OvmfPkg/VirtioGpuDxe: provide functions for sending VirtIo GPU commands

In this patch we add a "workhorse" function called VirtioGpuSendCommand(),
and implement seven simple RPCs atop, for the command types listed in
"OvmfPkg/Include/IndustryStandard/VirtioGpu.h".

These functions will be called by our EFI_GRAPHICS_OUTPUT_PROTOCOL
implementation.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
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/VirtioGpuDxe: initialize and tear down VirtIo GPU device
Laszlo Ersek [Wed, 17 Aug 2016 23:31:27 +0000 (01:31 +0200)]
OvmfPkg/VirtioGpuDxe: initialize and tear down VirtIo GPU device

This patch implements the steps listed in section "3.1.1 Driver
Requirements: Device Initialization" of the Virtio V1.0 Committee Spec 04.
The VirtIo GPU is brought up in VirtioGpuDriverBindingStart(), and down in
VirtioGpuDriverBindingStop().

We also add an ExitBootServices() callback that resets the device. This
ensures that the device model abandons any guest memory areas when we
transfer control to the guest OS.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
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 agoArmVirtPkg/ArmVirtQemu: include VirtioGpuDxe in the platform DSC/FDF files
Laszlo Ersek [Tue, 16 Aug 2016 15:53:33 +0000 (17:53 +0200)]
ArmVirtPkg/ArmVirtQemu: include VirtioGpuDxe in the platform DSC/FDF files

At this stage, the driver builds, and suffices for testing binding and
unbinding.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoOvmfPkg: include VirtioGpuDxe in the platform DSC/FDF files
Laszlo Ersek [Tue, 16 Aug 2016 15:35:52 +0000 (17:35 +0200)]
OvmfPkg: include VirtioGpuDxe in the platform DSC/FDF files

At this stage, the driver builds, and suffices for testing binding and
unbinding.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
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/VirtioGpuDxe: introduce with Component Name 2 and Driver Binding
Laszlo Ersek [Mon, 15 Aug 2016 13:34:32 +0000 (15:34 +0200)]
OvmfPkg/VirtioGpuDxe: introduce with Component Name 2 and Driver Binding

This patch adds the skeleton of the driver: it implements the Component
Name 2 Protocol and the Driver  Binding Protocol, in accordance with the
generic and GOP-specific requirements set forth in the UEFI spec and the
Driver Writers' Guide.

The basic idea is that VGPU_DEV abstracts the virtio GPU device, while the
single VGPU_GOP that we intend to support at this point stands for "head"
(aka "scanout") #0.

For now, the Virtio Device Protocol is only used for driver binding; no
actual virtio operations are done yet. Similarly, we use a "dummy" GOP
GUID and protocol structure (a plain UINT8 object) for now, so that
GOP-consuming drivers don't look at what we produce just yet.

The driver is a bit different from the other virtio device drivers written
thus far:

- It implements the GetControllerName() member of the Component Name 2
  Protocol. (Formatting helpful names is recommended by UEFI.) As a "best
  effort", we format the PCI BDF into the name (a PCI backend is not
  guaranteed by VIRTIO_DEVICE_PROTOCOL). It should provide a more friendly
  experience in the shell and elsewhere.

- This driver seeks to support all RemainingDevicePath cases:
  - NULL: produce all (= one) child handles (= VGPU_GOP heads) at once,
  - End of Device Path Node: produce no child handles,
  - specific ACPI ADR Node: check if it's supportable, and produce it
    (only one specific child controller is supported).
  This is one of the reasons for separating VGPU_GOP from VGPU_DEV.

The driver is a hybrid driver: it produces both child handles (one, to be
exact), but also installs a structure (VGPU_DEV) directly on the VirtIo
controller handle, using gEfiCallerIdGuid as protocol GUID. This is a
trick I've seen elsewhere in edk2 (for example, TerminalDxe), and it is
necessary for the following reason:

In EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName(), we must be able to
"cast down" a VirtIo ControllerHandle to our own private data structure
(VGPU_DEV). That's only possible if we install the structure directly on
the VirtIo ControllerHandle (thereby rendering the driver a hybrid
driver), because a child controller with our GOP implementation on it may
not exist / be passed in there.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
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/IndustryStandard: add type definitions for the virtio GPU device
Laszlo Ersek [Mon, 15 Aug 2016 14:26:29 +0000 (16:26 +0200)]
OvmfPkg/IndustryStandard: add type definitions for the virtio GPU device

The GPU additions to VirtIo 1.0 are a work in progress. Mark the relevant
URLs in the source code. Incorporate the absolute minimum from the WIP
spec that is necessary for implementing a GOP driver.

Add the VIRTIO_SUBSYSTEM_GPU_DEVICE macro to
"IndustryStandard/Virtio10.h", since all other such macros (dating back to
VirtIo 0.9.5) are part of "IndustryStandard/Virtio095.h".

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
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/PlatformBootManagerLib: relax device class requirement for ConOut
Laszlo Ersek [Thu, 18 Aug 2016 09:33:39 +0000 (11:33 +0200)]
OvmfPkg/PlatformBootManagerLib: relax device class requirement for ConOut

This will add virtio-gpu-pci devices to ConOut automatically.

For further benefit, the change also allows OVMF to use the legacy-free /
secondary VGA adapter (added in QEMU commit 63e3e24d, "vga: add secondary
stdvga variant") as console.

ArmVirtPkg's PlatformBootManagerLib already filters with IS_PCI_DISPLAY();
see IsPciDisplay().

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
Originally-suggested-by: Gerd Hoffmann <kraxel@redhat.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/Virtio10Dxe: don't bind virtio-vga
Laszlo Ersek [Thu, 18 Aug 2016 11:52:26 +0000 (13:52 +0200)]
OvmfPkg/Virtio10Dxe: don't bind virtio-vga

Commit 9399f68ae359 ("OvmfPkg: Virtio10Dxe: non-transitional driver for
virtio-1.0 PCI devices") created a "competition" between Virtio10Dxe and
QemuVideoDxe for virtio-vga devices. The binding order between these
drivers is unspecified, and the wrong order effectively breaks commit
94210dc95e9f ("OvmfPkg: QemuVideoDxe: add virtio-vga support").

Thus, never bind virtio-vga in Virtio10Dxe; QemuVideoDxe provides better
compatibility for guest OSes that insist on inheriting a linear
framebuffer. Users who prefer the VirtIo GPU interface at boot time should
specify virtio-gpu-pci, which is exactly virtio-vga, minus the VGA
compatibility (such as the framebuffer).

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
Fixes: 9399f68ae359234b142c293ad1bef75f470ced30
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/QemuVideoDxe: don't incorrectly bind virtio-gpu-pci
Laszlo Ersek [Thu, 18 Aug 2016 09:01:56 +0000 (11:01 +0200)]
OvmfPkg/QemuVideoDxe: don't incorrectly bind virtio-gpu-pci

The PCI (Vendor ID, Device ID) pair (0x1af4, 0x1050) stands for both the
virtio-vga and the virtio-gpu-pci device models of QEMU. They differ in
two things:

- the former has a VGA-compatibility linear framebuffer on top of the
  latter,

- the former has PCI_CLASS_DISPLAY_VGA device class, while the latter has
  PCI_CLASS_DISPLAY_OTHER.

In commit 94210dc95e9f ("OvmfPkg: QemuVideoDxe: add virtio-vga support"),
we enabled QemuVideoDxe to drive virtio-vga simply by adding its (Vendor
ID, Device ID) pair to gQemuVideoCardList. This change inadvertently
allowed QemuVideoDxe to bind virtio-gpu-pci, which it cannot drive though.

Restrict QemuVideoDxe to PCI_CLASS_DISPLAY_VGA, in order to exclude
virtio-gpu-pci. For the other cards that QemuVideoDxe drives, this makes
no difference. (Note that OvmfPkg's PlatformBootManagerLib instance has
always only added PCI_CLASS_DISPLAY_VGA devices to ConOut; see
DetectAndPreparePlatformPciDevicePath().)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66
Fixes: 94210dc95e9f7c6ff4066a9b35a288e6f1c271bf
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 agoUefiCpuPkg/PiSmmCpuDxeSmm: Consume PcdAcpiS3Enable to control the code
Star Zeng [Wed, 20 Jul 2016 02:24:58 +0000 (10:24 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Consume PcdAcpiS3Enable to control the code

if PcdAcpiS3Enable is disabled, then skip S3 related logic.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Move S3 related code to CpuS3.c
Star Zeng [Tue, 19 Jul 2016 08:44:16 +0000 (16:44 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Move S3 related code to CpuS3.c

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
7 years agoUefiCpuPkg/CpuS3DataDxe: Consume PcdAcpiS3Enable to control the code
Star Zeng [Mon, 18 Jul 2016 03:31:28 +0000 (11:31 +0800)]
UefiCpuPkg/CpuS3DataDxe: Consume PcdAcpiS3Enable to control the code

If PcdAcpiS3Enable is disabled, then return an EFI_UNSUPPORTED
error which forces the module to be unloaded.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmPkg: remove BaseMemoryLibVstm implementation of BaseMemoryLib
Ard Biesheuvel [Wed, 31 Aug 2016 08:50:23 +0000 (09:50 +0100)]
ArmPkg: remove BaseMemoryLibVstm implementation of BaseMemoryLib

The BaseMemoryLibVstm implementation of BaseMemoryLib is ARM only, uses
the NEON register file despite the fact that the UEFI spec does not allow
it, and is currently not used anywhere. So remove it.

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/CompilerIntrinsicsLib: replace memcpy and memset with C code
Ard Biesheuvel [Thu, 11 Aug 2016 14:01:24 +0000 (16:01 +0200)]
ArmPkg/CompilerIntrinsicsLib: replace memcpy and memset with C code

This replaces the various implementations of memset and memcpy,
including the ARM RTABI ones (__aeabi_mem[set|clr]_[|4|8]) with
a single C implementation for each. The ones we have are either not
very sophisticated (ARM), or they are too sophisticated (memcpy() on
AARCH64, which may perform unaligned accesses) or already coded in C
(memset on AArch64).

The Tianocore codebase mandates the explicit use of its SetMem() and
CopyMem() equivalents, of which various implementations exist for use
in different contexts (PEI, DXE). Few compiler generated references to
these functions should remain, and so our implementations in this BASE
library should be small and usable with the MMU off.

So replace them with a simple C implementation that builds correctly
on GCC/AARCH64, CLANG/AARCH64, GCC/ARM, CLANG/ARM and RVCT/ARM.

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 agoShellPkg: Fix the incorrect return status in function FindFiles()
Dandan Bi [Tue, 23 Aug 2016 02:29:08 +0000 (10:29 +0800)]
ShellPkg: Fix the incorrect return status in function FindFiles()

According to the latest shell spec, in function FindFiles(),
when no files were found, it should return EFI_NOT_FOUND.
But current codes don't follow the spec.
This patch is to fix this issue.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoShellPkg: Add the check of parameter number in "DrvCfg" command
Dandan Bi [Wed, 31 Aug 2016 05:09:26 +0000 (13:09 +0800)]
ShellPkg: Add the check of parameter number in "DrvCfg" command

In shell spec, the usage of "Drvcfg" command is: drvcfg [-l XXX] [-c]
[-f <Type>|-v|-s] [DriverHandle [DeviceHandle [ChildHandle]]]
[-i filename] [-o filename]. The parameter number(doesn't include the flags)
cannot exceed 4, now we add this point to check whether using the command
correctly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoShellPkg: Add check for "dump" parameter in "bcfg" command
Dandan Bi [Thu, 25 Aug 2016 01:37:05 +0000 (09:37 +0800)]
ShellPkg: Add check for "dump" parameter in "bcfg" command

When user uses the command "bcfg driver|boot [dump [-v]]",
the number of command line value parameters (doesn't include the
flag) must be three. We can add this point to check whether using
this command correctly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoSecurityPkg: TPM12CommandLib: Add Response returnCode Check
Zhang, Chao B [Wed, 31 Aug 2016 01:26:08 +0000 (09:26 +0800)]
SecurityPkg: TPM12CommandLib: Add Response returnCode Check

   Check response return code before return from Tpm12Extend and
Tpm12PhysicalPresence.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
7 years agoMdeModulePkg VarCheck: #### in L"Boot####" are upper case hex
Star Zeng [Fri, 26 Aug 2016 09:25:03 +0000 (17:25 +0800)]
MdeModulePkg VarCheck: #### in L"Boot####" are upper case hex

UEFI spec:
Each load option entry resides in a Boot####, Driver####, SysPrep####,
OsRecovery#### or PlatformRecovery#### variable where #### is replaced
by a unique option number in printable hexadecimal representation using
the digits 0-9, and the upper case versions of the characters A-F
(0000-FFFF).

The patch also makes L"HwErrRec####" follow this rule.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoIntelFsp2Pkg: Fix typo and comments
Giri P Mudusuru [Mon, 29 Aug 2016 23:31:15 +0000 (07:31 +0800)]
IntelFsp2Pkg: Fix typo and comments

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Cc: Michael 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: Jiewen Yao <jiewen.yao@intel.com>
7 years agoSecurityPkg: Use IsZeroGuid API for zero GUID checking
Hao Wu [Tue, 30 Aug 2016 01:59:02 +0000 (09:59 +0800)]
SecurityPkg: Use IsZeroGuid API for zero GUID checking

Instead of comparing a GUID with gZeroGuid via the CompareGuid API, the
commit uses the IsZeroGuid API to check if the given GUID is a zero GUID.

Cc: Chao Zhang <chao.b.zhang@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>
7 years agoMdeModulePkg: Use IsZeroGuid API for zero GUID checking
Hao Wu [Tue, 30 Aug 2016 01:57:59 +0000 (09:57 +0800)]
MdeModulePkg: Use IsZeroGuid API for zero GUID checking

Instead of comparing a GUID with gZeroGuid via the CompareGuid API, the
commit uses the IsZeroGuid API to check if the given GUID is a zero GUID.

Cc: Feng Tian <feng.tian@intel.com>
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: Feng Tian <feng.tian@Intel.com>
7 years agoIntelFrameworkModulePkg: Use IsZeroGuid API for zero GUID checking
Hao Wu [Tue, 30 Aug 2016 01:51:40 +0000 (09:51 +0800)]
IntelFrameworkModulePkg: Use IsZeroGuid API for zero GUID checking

Instead of comparing a GUID with gZeroGuid via the CompareGuid API, the
commit uses the IsZeroGuid API to check if the given GUID is a zero GUID.

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoBaseTools: UpdateImageSize include Image auth info for FMP Auth capsule
Yonghong Zhu [Mon, 29 Aug 2016 07:44:59 +0000 (15:44 +0800)]
BaseTools: UpdateImageSize include Image auth info for FMP Auth capsule

Per UEFI spec UpdateImageSize may or may not include Firmware Image
Authentication information. so for FMP auth capsule, UpdateImageSize
should include the Image auth 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>
7 years agoMaintainers.txt: Add IntelFsp2Pkg, IntelFsp2WrapperPkg and IntelSiliconPkg.
Jiewen Yao [Tue, 23 Aug 2016 02:02:27 +0000 (10:02 +0800)]
Maintainers.txt: Add IntelFsp2Pkg, IntelFsp2WrapperPkg and IntelSiliconPkg.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoIntelSiliconPkg: Add Firmware Interface Table (FIT) definitions
Giri P Mudusuru [Fri, 26 Aug 2016 22:07:06 +0000 (06:07 +0800)]
IntelSiliconPkg: Add Firmware Interface Table (FIT) definitions

Adding Processor Firmware Interface Table (FIT) related defines & structures

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael 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: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoIntelFrameworkModulePkg FwVolDxe: Return correct AuthStatus for FvReadFile
Star Zeng [Fri, 26 Aug 2016 08:27:06 +0000 (16:27 +0800)]
IntelFrameworkModulePkg FwVolDxe: Return correct AuthStatus for FvReadFile

Inherit the authentication status from FV.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@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>
Reviewed by: Chao Zhang <chao.b.zhang@intel.com>

7 years agoMdeModulePkg DxeCore: Return correct AuthStatus for FvReadFile
Star Zeng [Fri, 12 Aug 2016 08:21:17 +0000 (16:21 +0800)]
MdeModulePkg DxeCore: Return correct AuthStatus for FvReadFile

Inherit the authentication status from FV.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@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>
Reviewed by: Chao Zhang <chao.b.zhang@intel.com>

7 years agoArmVirtPkg: enable EBC interpreter for AArch64
Leif Lindholm [Fri, 29 Jul 2016 15:06:52 +0000 (16:06 +0100)]
ArmVirtPkg: enable EBC interpreter for AArch64

Since we now have EBC support for AArch64, enable it by default
on both QEMU and Xen platforms.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoMdeModulePkg/EbcDxe: Add AARCH64 EBC VM support
Jeff Brasen [Wed, 17 Feb 2016 19:13:48 +0000 (12:13 -0700)]
MdeModulePkg/EbcDxe: Add AARCH64 EBC VM support

Adds support for the EBC VM for AARCH64 platforms

Submitted on behalf of a third-party: The Linux Foundation
This contribution is licensed under the BSD license as found at
http://opensource.org/licenses/bsd-license.php

[Taken from https://source.codeaurora.org/external/server/edk2-blue/]
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoUefiCpuPkg/MpInitLib: Don't allocate reset vector in Exit Boot Service
Jeff Fan [Wed, 24 Aug 2016 14:42:32 +0000 (22:42 +0800)]
UefiCpuPkg/MpInitLib: Don't allocate reset vector in Exit Boot Service

In Exit Boot Services callback function, we cannot use allocate memory services
because it may change the memory map that has been gotten by OS.

This fix is not to allocate reset vector buffer after SaveRestoreFlag is set to
TRUE in MpInitExitBootServicesCallback(). Instead AllocateResetVector() will use
the previous allocated buffer address and save the contents before copying reset
vector code. At the same time, FreeResetVector() will restore original contents
after if SaveRestoreFlag is TRUE.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@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>
7 years agoUefiCpuPkg/MpInitLib: Move two functions location
Jeff Fan [Wed, 24 Aug 2016 14:41:40 +0000 (22:41 +0800)]
UefiCpuPkg/MpInitLib: Move two functions location

Just move BackupAndPrepareWakeupBuffer() and RestoreWakeupBuffer() from
PeiMpLib.c to MpLib.c.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@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>
7 years agoUefiCpuPkg/MpInitLib: Fix function header comments typo
Jeff Fan [Wed, 24 Aug 2016 14:12:52 +0000 (22:12 +0800)]
UefiCpuPkg/MpInitLib: Fix function header comments typo

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@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>
7 years agoUefiCpuPkg/MpInitLib: Rename EndOfPeiFlag to SaveRestoreFlag
Jeff Fan [Wed, 24 Aug 2016 14:02:48 +0000 (22:02 +0800)]
UefiCpuPkg/MpInitLib: Rename EndOfPeiFlag to SaveRestoreFlag

It will be used by DxePeiLib also.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@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>
7 years agoUefiCpuPkg/MpInitLib: Move allocating reserved memory for AP loop code
Jeff Fan [Wed, 24 Aug 2016 13:58:04 +0000 (21:58 +0800)]
UefiCpuPkg/MpInitLib: Move allocating reserved memory for AP loop code

In Exit Boot Services callback function, we cannot use allocate memory services
because it may change the memory map that has been gotten by OS.

This fix is to move allocating reserved memory for AP loop code to
InitMpGlobalData() and save the memory address in one global variable.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@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>
7 years agoUefiCpuPkg/MpInitLib: Move timeout delay to WakupAp()
Jeff Fan [Wed, 24 Aug 2016 13:37:14 +0000 (21:37 +0800)]
UefiCpuPkg/MpInitLib: Move timeout delay to WakupAp()

After sending the 1st broadcast INIT-SIPI-SIPI, BSP will collect APs count after
one specified timeout delay. However, WakupAp() will restore reset vector
immediately after sending 1st broadcast INIT-SIPI-SIPI. Some processors may not
complete executing reset vector code.

This fix is to move MicroSecondDelay() from CollectProcessorCount() to the place
that is after sending 1st broadcast INIT-SIPI-SIPI and before FreeResetVector()
in WakupAp().

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@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>
7 years agoRevert "ShellPkg: Move FindFirstCharacter/GetNextParameter to ShellCommandLib"
Ruiyu Ni [Tue, 23 Aug 2016 02:40:55 +0000 (10:40 +0800)]
Revert "ShellPkg: Move FindFirstCharacter/GetNextParameter to ShellCommandLib"

This reverts commit c0bcd3433f33876c519bf5567e0ab69261b57fe9.
The above commit causes several regression of "echo" command:
1. Double quotes are not being stripped from the final text. UEFI Shell 2.2 section 3.4.5 chops out the quotes.
2. Output redirection is not working as expected. Text is being redirected, but the ‘> …’ text should not be.
3. Inconsistent special character handling.  For example, comments with # seem to be parsed out correctly, but handing of ^ is incorrect.
In summary, ‘echo “You are ^#1” > t.txt’ results in the below content in t.txt:
 “You are ^#1” > t.txt

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoRevert "ShellPkg: Add Shell[Get|Set]RawCmdLine to ShellCommandLib"
Ruiyu Ni [Tue, 23 Aug 2016 02:40:42 +0000 (10:40 +0800)]
Revert "ShellPkg: Add Shell[Get|Set]RawCmdLine to ShellCommandLib"

This reverts commit 0fcf8d4df85d861b6e721bd1d8abb449f05e15ed.
The above commit causes several regression of "echo" command:
1. Double quotes are not being stripped from the final text. UEFI Shell 2.2 section 3.4.5 chops out the quotes.
2. Output redirection is not working as expected. Text is being redirected, but the ‘> …’ text should not be.
3. Inconsistent special character handling.  For example, comments with # seem to be parsed out correctly, but handing of ^ is incorrect.
In summary, ‘echo “You are ^#1” > t.txt’ results in the below content in t.txt:
 “You are ^#1” > t.txt

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoRevert "ShellPkg: Fix echo to support displaying special characters"
Ruiyu Ni [Tue, 23 Aug 2016 02:40:02 +0000 (10:40 +0800)]
Revert "ShellPkg: Fix echo to support displaying special characters"

This reverts commit 95fc5a877502a6e6324300eed0136243d359fa96.
The above commit causes several regression of "echo" command:
1. Double quotes are not being stripped from the final text. UEFI Shell 2.2 section 3.4.5 chops out the quotes.
2. Output redirection is not working as expected. Text is being redirected, but the ‘> …’ text should not be.
3. Inconsistent special character handling.  For example, comments with # seem to be parsed out correctly, but handing of ^ is incorrect.
In summary, ‘echo “You are ^#1” > t.txt’ results in the below content in t.txt:
 “You are ^#1” > t.txt

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoMdeModulePkg:Fix bug in function AsciiStrToIp4.
Zhang Lubo [Fri, 19 Aug 2016 07:38:20 +0000 (15:38 +0800)]
MdeModulePkg:Fix bug in function AsciiStrToIp4.

If a FQDN contains 3 dots '.' like "a.b.c.com", the AsciiStrToIp4
will return success as the HostName has a valid IP address. So we
need to check if it is a decimal character before using AsciiStrDecimalToUintn.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
7 years agoBaseTools/GenFw: ignore dynamic RELA sections
Ard Biesheuvel [Mon, 22 Aug 2016 10:00:08 +0000 (12:00 +0200)]
BaseTools/GenFw: ignore dynamic RELA sections

When building PIE (ET_DYN) executables, an additional RELA section is
emitted (in addition to the per-section .rela.text and .rela.data sections)
that is intended to be resolved at runtime by a ET_DYN compatible loader.

At the moment, due to the fact that we don't support GOT based relocations,
this dynamic RELA section only contains relocations that are redundant,
i.e., each R_xxx_RELATIVE relocation it contains duplicates a R_xxx_xx64
relocation appearing in .rela.text or .rela.data, and so we can simply
ignore this section (and we already ignore it in practice due to the fact
that it points to the NULL section, which has the SHF_ALLOC bit cleared).

For example,

  Section Headers:
    [Nr] Name              Type             Address           Offset
         Size              EntSize          Flags  Link  Info  Align
    [ 0]                   NULL             0000000000000000  00000000
         0000000000000000  0000000000000000           0     0     0
    [ 1] .text             PROGBITS         0000000000000240  000000c0
         000000000000427c  0000000000000008  AX       0     0     64
    [ 2] .rela.text        RELA             0000000000000000  00009310
         0000000000001bf0  0000000000000018   I       7     1     8
    [ 3] .data             PROGBITS         00000000000044c0  00004340
         00000000000046d0  0000000000000000  WA       0     0     64
    [ 4] .rela.data        RELA             0000000000000000  0000af00
         0000000000000600  0000000000000018   I       7     3     8
    [ 5] .rela             RELA             0000000000008bc0  00008a10
         0000000000000600  0000000000000018           0     0     8
    [ 6] .shstrtab         STRTAB           0000000000000000  0000b500
         0000000000000037  0000000000000000           0     0     1
    [ 7] .symtab           SYMTAB           0000000000000000  00009010
         0000000000000210  0000000000000018           8    17     8
    [ 8] .strtab           STRTAB           0000000000000000  00009220
         00000000000000eb  0000000000000000           0     0     1

  Relocation section '.rela.data' at offset 0xaf00 contains 64 entries:
    Offset          Info           Type           Sym. Value    Sym. Name + Addend
  000000004800  000100000001 R_X86_64_64       0000000000000240 .text + 3f5b
  000000004808  000100000001 R_X86_64_64       0000000000000240 .text + 3f63
  000000004810  000100000001 R_X86_64_64       0000000000000240 .text + 3f79
  000000004818  000100000001 R_X86_64_64       0000000000000240 .text + 3f90
  000000004820  000100000001 R_X86_64_64       0000000000000240 .text + 3fa6
  ...

  Relocation section '.rela' at offset 0x8a10 contains 64 entries:
    Offset          Info           Type           Sym. Value    Sym. Name + Addend
  000000004800  000000000008 R_X86_64_RELATIVE                    419b
  000000004808  000000000008 R_X86_64_RELATIVE                    41a3
  000000004810  000000000008 R_X86_64_RELATIVE                    41b9
  000000004818  000000000008 R_X86_64_RELATIVE                    41d0
  000000004820  000000000008 R_X86_64_RELATIVE                    41e6
  000000004828  000000000008 R_X86_64_RELATIVE                    41ff
  ...

Note that GOT based relocations result in entries that *only* appear in the
dynamic .rela section and not in .rela.text or .rela.data. This means two
things if we intend to add support for GOT based relocations:
- we must check that a dynamic RELA section exists;
- we must filter out duplicates between .rela and .rela.xxx, to prevent
  emitting duplicate fixups into the PE/COFF .reloc section.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg/Browser: Fix conflicting policy in getting default of checkbox
Liming Gao [Thu, 18 Aug 2016 11:51:21 +0000 (19:51 +0800)]
MdeModulePkg/Browser: Fix conflicting policy in getting default of checkbox

We have added a new policy to get default value for question:
get default from other default id if current default is not specified.
But when getting default value for checkbox, if the default
flag is not set, it will set the default value to FALSE for checkbox.
This behavior in checkbox conflicts with the new added policy,
so now we move this behavior to the end of getting default form other
default id.

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: Liming Gao <liming.gao@intel.com>
7 years agoIntelSiliconPkg: Fixed VBT size bug, typos and updated comments
Mudusuru, Giri P [Mon, 22 Aug 2016 05:19:00 +0000 (13:19 +0800)]
IntelSiliconPkg: Fixed VBT size bug, typos and updated comments

1) Fixed the VBT size from 0x1C00(7KB) to 0x1800(6KB) and typos, indentation
2) Updated offsets in hex values and offset from start of OPREGION

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoBaseTools GnuMakefile: Update GCC Flags to the specific one with BUILD_ prefix
Liming Gao [Mon, 22 Aug 2016 06:32:23 +0000 (14:32 +0800)]
BaseTools GnuMakefile: Update GCC Flags to the specific one with BUILD_ prefix

To avoid the conflict with the default GCC flag name, BUILD_ prefix is added.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
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>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoBaseTools GNU Makefile: Add the missing rules for cpp source file
Liming Gao [Mon, 22 Aug 2016 06:28:50 +0000 (14:28 +0800)]
BaseTools GNU Makefile: Add the missing rules for cpp source file

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
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>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoIntelFsp2Pkg: Add function to get FspInfoHeader before stack is ready
Yarlagadda, Satya P [Thu, 18 Aug 2016 05:20:31 +0000 (13:20 +0800)]
IntelFsp2Pkg: Add function to get FspInfoHeader before stack is ready

we need to locate the FSP Info Header before the stack is initialized to
access the cfg region for any UPD. Hence adding the
AsmGetFspInfoHeaderNoStack function to support it.

Note: This function is there in IntelFspPkg but got removed in IntelFsp2Pkg

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoBaseTools: update BinaryFiles.txt file to add Pkcs7Sign Tool
Yonghong Zhu [Mon, 22 Aug 2016 23:44:20 +0000 (07:44 +0800)]
BaseTools: update BinaryFiles.txt file to add Pkcs7Sign Tool

add Pkcs7Sign.exe and related pem file into BinaryFiles.txt for build
server to automatically build the binary win32 files.

Cc: Liming Gao <liming.gao@intel.com>
CC: Erik Bjorge <erik.c.bjorge@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
7 years agoBaseTools: add capsule image header for auth FMP capsule file
Yonghong Zhu [Mon, 22 Aug 2016 07:08:24 +0000 (15:08 +0800)]
BaseTools: add capsule image header for auth FMP capsule file

in last commit 91ae29, it missed to add the
EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER for the auth FMP capsule.

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 agoBaseTools/UserManuals: update with new report bug mail address
Yonghong Zhu [Tue, 9 Aug 2016 02:41:42 +0000 (10:41 +0800)]
BaseTools/UserManuals: update with new report bug mail address

The .rtf files in BaseTools/UserManuals still tell users to Report bugs
to sourceforge mail address. Since we no longer use the sourceforge
mailing lists we should update it.

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 agoSecurityPkg Tcg2: Remove use of module internal API InternalIsZeroBuffer()
Hao Wu [Wed, 17 Aug 2016 13:28:39 +0000 (21:28 +0800)]
SecurityPkg Tcg2: Remove use of module internal API InternalIsZeroBuffer()

This commit removes the internal implementation of the function
InternalIsZeroBuffer(). Instead, it will use the API IsZeroBuffer() from
BaseMemoryLib in MdePkg.

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>
7 years agoMdePkg BaseMemoryLibSse2: Add SSE2 implementation of API IsZeroBuffer()
Hao Wu [Wed, 17 Aug 2016 06:27:49 +0000 (14:27 +0800)]
MdePkg BaseMemoryLibSse2: Add SSE2 implementation of API IsZeroBuffer()

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>
7 years agoMdePkg BaseMemoryLib: Add assembly implementation of API IsZeroBuffer()
Hao Wu [Wed, 17 Aug 2016 06:26:25 +0000 (14:26 +0800)]
MdePkg BaseMemoryLib: Add assembly implementation of API IsZeroBuffer()

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>
7 years agoMdePkg BaseMemoryLib: Add C implementation of API IsZeroBuffer()
Hao Wu [Wed, 17 Aug 2016 06:24:04 +0000 (14:24 +0800)]
MdePkg BaseMemoryLib: Add C implementation of API IsZeroBuffer()

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>
7 years agoSecurityPkg Tcg2: Rename internal API IsZeroBuffer to InternalIsZeroBuffer
Hao Wu [Wed, 17 Aug 2016 13:12:57 +0000 (21:12 +0800)]
SecurityPkg Tcg2: Rename internal API IsZeroBuffer to InternalIsZeroBuffer

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>
7 years agoMdePkg BaseMemoryLib: Add implementation of API IsZeroGuid()
Hao Wu [Wed, 3 Aug 2016 07:29:50 +0000 (15:29 +0800)]
MdePkg BaseMemoryLib: Add implementation of API IsZeroGuid()

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>
7 years agoBaseTools/GccBase.lds: don't copy RELA section to PE/COFF
Ard Biesheuvel [Wed, 10 Aug 2016 08:55:30 +0000 (10:55 +0200)]
BaseTools/GccBase.lds: don't copy RELA section to PE/COFF

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>
7 years agoArmVirtPkg: Fix build breakage of ArmVirtXen platform
Vikas C Sajjan [Mon, 22 Aug 2016 10:04:35 +0000 (15:34 +0530)]
ArmVirtPkg: Fix build breakage of ArmVirtXen platform

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>
7 years agoBaseTools PeCoffLib: Fix the issue to get RelocationsStripped from TE image
Liming Gao [Mon, 22 Aug 2016 03:09:01 +0000 (11:09 +0800)]
BaseTools PeCoffLib: Fix the issue to get RelocationsStripped from TE image

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>
7 years agoArmVirtPkg: Add Ramdisk support to ArmVirtPkg platforms
Vikas C Sajjan [Fri, 19 Aug 2016 06:55:55 +0000 (12:25 +0530)]
ArmVirtPkg: Add Ramdisk support to ArmVirtPkg platforms

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>
7 years agoArmVirtPkg: Move inclusion of AcpiTableDxe.inf to ArmVirt.dsc.inc
Vikas C Sajjan [Fri, 19 Aug 2016 06:55:54 +0000 (12:25 +0530)]
ArmVirtPkg: Move inclusion of AcpiTableDxe.inf to ArmVirt.dsc.inc

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>
7 years agoBaseTools: Fix a bug use 'COMMON' as CodeBase in BuildOptions section
Yonghong Zhu [Wed, 17 Aug 2016 10:52:51 +0000 (18:52 +0800)]
BaseTools: Fix a bug use 'COMMON' as CodeBase in BuildOptions section

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>
7 years agoBaseTools: FMP capsule add the support to generate auth info
Yonghong Zhu [Mon, 15 Aug 2016 05:52:12 +0000 (13:52 +0800)]
BaseTools: FMP capsule add the support to generate auth info

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>
7 years agoBaseTools: Rsa2048Sha256Sign add new option to support Monotonic count
Yonghong Zhu [Mon, 15 Aug 2016 05:39:32 +0000 (13:39 +0800)]
BaseTools: Rsa2048Sha256Sign add new option to support Monotonic count

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>
7 years agoBaseTools: Add the PKCS7 tool
Yonghong Zhu [Mon, 15 Aug 2016 09:12:12 +0000 (17:12 +0800)]
BaseTools: Add the PKCS7 tool

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>
7 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Revert 7503cd70fb86
Jeff Fan [Fri, 19 Aug 2016 02:28:28 +0000 (10:28 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Revert 7503cd70fb86

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>
7 years agoUefiCpuPkg/MpInitLib: MicrocodeData used but maybe uninitialized
Jeff Fan [Fri, 19 Aug 2016 02:32:30 +0000 (10:32 +0800)]
UefiCpuPkg/MpInitLib: MicrocodeData used but maybe uninitialized

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>
7 years agoDuetPkg: Add DxeMpInitLib instance reference
Jeff Fan [Fri, 19 Aug 2016 02:36:37 +0000 (10:36 +0800)]
DuetPkg: Add DxeMpInitLib instance reference

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>
7 years agoBaseTools-CLANG38: Add -O3 in DLINK2 flag
Shi, Steven [Fri, 19 Aug 2016 02:46:20 +0000 (10:46 +0800)]
BaseTools-CLANG38: Add -O3 in DLINK2 flag

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>
7 years agoBaseTools: check CONF_PATH env to get the configure files
Yonghong Zhu [Thu, 18 Aug 2016 02:07:36 +0000 (10:07 +0800)]
BaseTools: check CONF_PATH env to get the configure files

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>
7 years agoNetworkPkg/IpSecDxe: Fix wrong IKE header "FLAG" update
Jiaxin Wu [Mon, 15 Aug 2016 03:49:56 +0000 (11:49 +0800)]
NetworkPkg/IpSecDxe: Fix wrong IKE header "FLAG" update

*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>
7 years agoNetworkPkg/IpSecDxe: Fix UEFI IKE Initial Exchange failure
Jiaxin Wu [Mon, 15 Aug 2016 03:27:59 +0000 (11:27 +0800)]
NetworkPkg/IpSecDxe: Fix UEFI IKE Initial Exchange failure

*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>
7 years agoCorebootPayloadPkg: fixed GCC49 and GCC5 hang in PeiCore
Prince Agyeman [Wed, 17 Aug 2016 17:55:22 +0000 (10:55 -0700)]
CorebootPayloadPkg: fixed GCC49 and GCC5 hang in PeiCore

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>

7 years agoCorebootPayloadPkg : Added MpInitLib to CorebootPayloadPkg.dsc
Prince Agyeman [Wed, 17 Aug 2016 16:32:12 +0000 (09:32 -0700)]
CorebootPayloadPkg : Added MpInitLib to CorebootPayloadPkg.dsc

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>

7 years agoMdeModulePkg: Fix potential failure if UseDefaultAddress configured
Jiaxin Wu [Mon, 15 Aug 2016 02:34:49 +0000 (10:34 +0800)]
MdeModulePkg: Fix potential failure if UseDefaultAddress configured

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>
7 years agoNetworkPkg: Fix assert issue in iSCSI driver
Zhang Lubo [Mon, 1 Aug 2016 08:33:26 +0000 (16:33 +0800)]
NetworkPkg: Fix assert issue in iSCSI driver

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>
7 years agoNetworkPkg: Refine codes of iSCSI driver
Zhang Lubo [Thu, 11 Aug 2016 02:14:55 +0000 (10:14 +0800)]
NetworkPkg: Refine codes of iSCSI driver

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>
7 years agoMdeModulePkg: Refine codes of iSCSI driver
Zhang Lubo [Thu, 11 Aug 2016 02:24:10 +0000 (10:24 +0800)]
MdeModulePkg: Refine codes of iSCSI driver

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>
7 years agoPcAtChipsetPkg AcpiTimerLib: Wait 363 ACPI timer counts to get TSC Freq
Star Zeng [Wed, 17 Aug 2016 02:08:31 +0000 (10:08 +0800)]
PcAtChipsetPkg AcpiTimerLib: Wait 363 ACPI timer counts to get TSC Freq

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>
7 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Add gEfiVariableArchProtocolGuid dependency
Jeff Fan [Tue, 2 Aug 2016 05:52:28 +0000 (13:52 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Add gEfiVariableArchProtocolGuid dependency

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>
7 years agoUefiCpuPkg/CpuDxe: Fixed typo in function header to match PI spec
Jeff Fan [Fri, 29 Jul 2016 17:43:17 +0000 (01:43 +0800)]
UefiCpuPkg/CpuDxe: Fixed typo in function header to match PI spec

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>
7 years agoMdePkg/MpService.h: Trim whitespace at end of line
Jeff Fan [Fri, 29 Jul 2016 17:38:26 +0000 (01:38 +0800)]
MdePkg/MpService.h: Trim whitespace at end of line

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>
7 years agoMdePkg/MpService.h: Fixed typo in function header to match PI spec
Jeff Fan [Fri, 29 Jul 2016 01:10:27 +0000 (09:10 +0800)]
MdePkg/MpService.h: Fixed typo in function header to match PI spec

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>
7 years agoUefiCpuPkg/CpuDxe: Remove PcdCpuMaxLogicalProcessorNumber consuming
Jeff Fan [Tue, 2 Aug 2016 07:04:28 +0000 (15:04 +0800)]
UefiCpuPkg/CpuDxe: Remove PcdCpuMaxLogicalProcessorNumber consuming

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>
7 years agoUefiCpuPkg/CpuDxe: Remove unused codes and files
Jeff Fan [Fri, 29 Jul 2016 17:32:25 +0000 (01:32 +0800)]
UefiCpuPkg/CpuDxe: Remove unused codes and files

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>
7 years agoUefiCpuPkg/CpuDxe: Move SetMtrrsFromBuffer() location.
Jeff Fan [Fri, 29 Jul 2016 17:23:52 +0000 (01:23 +0800)]
UefiCpuPkg/CpuDxe: Move SetMtrrsFromBuffer() location.

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>
7 years agoUefiCpuPkg/CpuDxe: Consume MpInitLib to produce CPU MP Protocol services
Jeff Fan [Fri, 22 Jul 2016 02:42:47 +0000 (10:42 +0800)]
UefiCpuPkg/CpuDxe: Consume MpInitLib to produce CPU MP Protocol services

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>
7 years agoUefiCpuPkg/CpuMpPei: Delete PeiMpServices.c and PeiMpServices.h
Jeff Fan [Fri, 22 Jul 2016 02:31:12 +0000 (10:31 +0800)]
UefiCpuPkg/CpuMpPei: Delete PeiMpServices.c and PeiMpServices.h

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>
7 years agoUefiCpuPkg/CpuMpPei: Remove unused files and codes
Jeff Fan [Fri, 22 Jul 2016 02:28:14 +0000 (10:28 +0800)]
UefiCpuPkg/CpuMpPei: Remove unused files and codes

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>
7 years agoUefiCpuPkg/CpuMpPei: Consume MpInitLib to produce CPU MP PPI services
Jeff Fan [Fri, 22 Jul 2016 02:12:51 +0000 (10:12 +0800)]
UefiCpuPkg/CpuMpPei: Consume MpInitLib to produce CPU MP PPI services

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>
7 years agoQuarkPlatformPkg: Add MpInitLib reference in DSC files.
Jeff Fan [Thu, 21 Jul 2016 14:57:12 +0000 (22:57 +0800)]
QuarkPlatformPkg: Add MpInitLib reference in DSC files.

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>
7 years agoOvmfPkg: Add MpInitLib reference in DSC files.
Jeff Fan [Thu, 21 Jul 2016 07:10:40 +0000 (15:10 +0800)]
OvmfPkg: Add MpInitLib reference in DSC files.

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>
7 years agoUefiCpuPkg/MpInitLib: Place APs in safe loop before hand-off to OS
Jeff Fan [Sun, 24 Jul 2016 15:03:12 +0000 (23:03 +0800)]
UefiCpuPkg/MpInitLib: Place APs in safe loop before hand-off to OS

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>
7 years agoUefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupAllAPs()
Jeff Fan [Thu, 21 Jul 2016 13:33:11 +0000 (21:33 +0800)]
UefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupAllAPs()

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>
7 years agoUefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupThisAP()
Jeff Fan [Thu, 21 Jul 2016 13:31:47 +0000 (21:31 +0800)]
UefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupThisAP()

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>