]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
7 years agoArmVirtPkg/ArmVirtQemu: use MdeModulePkg/BDS
Laszlo Ersek [Thu, 5 May 2016 17:12:09 +0000 (19:12 +0200)]
ArmVirtPkg/ArmVirtQemu: use MdeModulePkg/BDS

Based on OvmfPkg commit 79c098b6d25d.

Unlike in OVMF, no USE_OLD_BDS fallback is introduced; I think that
ArmVirtPkg is less widely used by non-developers than OvmfPkg.

ArmVirtXen is not modified, as it uses PlatformIntelBdsLib from
ArmPlatformPkg.

About this patch:

- DxeServicesLib and SortLib are resolved generally (they have broad
  client module type lists).

- ReportStatusCodeLib is resolved for UEFI_APPLICATION modules.

- GenericBdsLib and PlatformBdsLib are replaced with UefiBootManagerLib
  and PlatformBootManagerLib, and resolved from under MdeModulePkg and
  ArmVirtPkg, respectively.

- QemuBootOrderLib is pointed to the QemuNewBootOrderLib instance.

- FileExplorerLib no longer depends on SECURE_BOOT_ENABLE, it is nedeed by
  BootMaintenanceManagerUiLib, which we link into UiApp.

- PcdBootManagerMenuFile carries the FILE_GUID of
  "MdeModulePkg/Application/UiApp/UiApp.inf". The default PCD value from
  "MdeModulePkg/MdeModulePkg.dec" points to
  "MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf",
  which, according to the commit that introduced it (a382952f8255), only
  'provides a very simple UI showing all the boot options recorded by
  "BootOrder" and user can select any of them to boot'.

- Include the new core BDS driver, and include the boot manager
  application, with the usual main menu entries.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Fixes: https://github.com/tianocore/edk2/issues/83
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: add EnableQuietBoot & DisableQuietBoot
Laszlo Ersek [Thu, 5 May 2016 16:44:25 +0000 (18:44 +0200)]
ArmVirtPkg/PlatformBootManagerLib: add EnableQuietBoot & DisableQuietBoot

UefiBootManagerLib does not provide these functions, we have to implement
them. (EnableQuietBoot() puts up the nice TianoCore logo.)

OvmfPkg commits 817fb3ac2a78 and 8e8fd3037788 have extracted these
functions already,
- from "IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c"
- to "OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c".

Copy the latter file, with minimal changes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: rebase boot order manipulation
Laszlo Ersek [Thu, 5 May 2016 15:45:42 +0000 (17:45 +0200)]
ArmVirtPkg/PlatformBootManagerLib: rebase boot order manipulation

QemuBootOrderLib can only filter out and reorder boot options; it cannot
create boot options. It relies on Platform BDS to auto-generate all
possible boot options first (for example, for new virtual devices that
have been configured since the last run of the virtual machine). Then it
will decide, case-by-case, whether each of those auto-generated boot
options should be preserved (and at what position), or removed.

Thus far, the only implementation of SetBootOrderFromQemu(), used in
connection with IntelFrameworkModulePkg BDS, has expected said complete
boot option list as an input parameter:

BdsEntry()                         [IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c]
  // create empty list
  InitializeListHead (
    &BootOptionList
    )

  PlatformBdsPolicyBehavior(       [ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c]
    BootOptionList
    )

    BdsLibConnectAll()
    BdsLibEnumerateAllBootOption(
      BootOptionList
      )

    // at this point, BootOptionList starts with the preexistent boot
    // options, and ends with the auto-generated options

    SetBootOrderFromQemu(          [OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c]
      BootOptionList
      )

      // write out changed boot order to UEFI variables

    // The "BootOrder" variable may have changed. Refresh BootOptionList
    // from it, and return it to BdsEntry().

With MdeModulePkg BDS, a BootOptionList is not propagated from BdsEntry()
to SetBootOrderFromQemu() and back. All processing is based directly on
the underlying "BootOrder" and "Boot####" variables.

In OvmfPkg, commit d27ec22d1189 introduced a new instance of
QemuBootOrderLib, called QemuNewBootOrderLib. It is based on
UefiBootManagerLib, and rather than taking a complete BootOptionList as a
parameter, it expects that the "BootOrder" and "Boot####" variables are
complete in the above sense.

Rebase the boot order manipulation to UefiBootManagerLib and
QemuNewBootOrderLib, while keeping the requirement satisfied, like this:

BdsEntry()                               [MdeModulePkg/Universal/BdsDxe/BdsEntry.c]
  PlatformBootManagerAfterConsole()      [ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c]
    EfiBootManagerConnectAll()
    EfiBootManagerRefreshAllBootOption()

    // at this point all auto-generated options exist at the end of
    // "BootOrder"

    SetBootOrderFromQemu()               [OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c]

      // read boot options from "BootOrder" and "Boot####", then
      // manipulate them

This patch parallels OvmfPkg commit 04fe914ba53e.

Once the USE_OLD_BDS fallback is removed from OvmfPkg, the parameter list
of the SetBootOrderFromQemu() prototype can be updated to VOID.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: use UefiBootManagerLib ConnectAll() API
Laszlo Ersek [Thu, 5 May 2016 15:38:33 +0000 (17:38 +0200)]
ArmVirtPkg/PlatformBootManagerLib: use UefiBootManagerLib ConnectAll() API

This patch parallels OvmfPkg commit fed691a6f913.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: remove empty PlatformBdsLib hooks
Laszlo Ersek [Thu, 5 May 2016 15:31:08 +0000 (17:31 +0200)]
ArmVirtPkg/PlatformBootManagerLib: remove empty PlatformBdsLib hooks

Namely,
- PlatformBdsBootSuccess,
- PlatformBdsBootFail,
- PlatformBdsLockNonUpdatableFlash.

This patch parallels OvmfPkg commit 7f89929f7fb2.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: register boot options and hot keys
Laszlo Ersek [Thu, 5 May 2016 15:22:33 +0000 (17:22 +0200)]
ArmVirtPkg/PlatformBootManagerLib: register boot options and hot keys

Register the Enter key as the continue key (hot key to skip the boot
timeout). Map the F2 and ESC keys to the UI. Register the memory-mapped
Shell boot option.

The patch parallels OvmfPkg commit 07dd96e82032. The
PlatformRegisterFvBootOption() and PlatformRegisterOptionsAndKeys()
functions are copied almost verbatim. The only changes are: internal
linkage for these functions (i.e., STATIC), and mentioning the ESC key in
the comments.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: don't launch the Boot Manager Menu
Laszlo Ersek [Thu, 5 May 2016 15:09:04 +0000 (17:09 +0200)]
ArmVirtPkg/PlatformBootManagerLib: don't launch the Boot Manager Menu

MdeModulePkg/BDS doesn't launch the UI (Boot Manager Menu) from the
platform side. The platform is expected to store the boot timeout only, in
PcdPlatformBootTimeOut. This is usually done in
PlatformBootManagerBeforeConsole().

(ArmVirtXen is not modified, as it uses PlatformIntelBdsLib from
ArmPlatformPkg, not ArmVirtPkg.)

The patch parallels OvmfPkg commit 8dc0f0a6aab0.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: init console vars in BeforeConsole()
Laszlo Ersek [Thu, 5 May 2016 14:24:00 +0000 (16:24 +0200)]
ArmVirtPkg/PlatformBootManagerLib: init console vars in BeforeConsole()

With IntelFrameworkModulePkg BDS, the platform code is responsible for
updating console variables (e.g., with BdsLibUpdateConsoleVariable()), and
then connecting them (e.g., with BdsLibConnectAllDefaultConsoles()). This
is usually (although not necessarily) done in PlatformBdsPolicyBehavior().

With MdeModulePkg BDS, the platform is responsible for updating the
console variables in PlatformBootManagerBeforeConsole(). When that
function returns, BdsEntry() will automatically connect the consoles; the
platform is not responsible for the connection.

IntelFrameworkModulePkg               MdeModulePkg
  BdsEntry                              BdsEntry
    PlatformBdsInit                       PlatformBootManagerBeforeConsole
                                     +----> EfiBootManagerUpdateConsoleVariable
                                     |
    dispatch Driver####              |    dispatch Driver####
                                     | +> connect consoles
                                     | |
    PlatformBdsPolicyBehavior        | |  PlatformBootManagerAfterConsole
      BdsLibUpdateConsoleVariable <--+ |
      BdsLibConnectAllDefaultConsoles <+
      display splash screen                 display splash screen

Thus, move the console variable massaging from the beginning of
PlatformBootManagerAfterConsole() (originally PlatformBdsPolicyBehavior())
to the end of PlatformBootManagerBeforeConsole(), and drop the explicit
BdsLibConnectAllDefaultConsoles() call.

This patch parallels OvmfPkg commit e9e9ad644fab.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: link against UefiBootManagerLib
Laszlo Ersek [Thu, 5 May 2016 14:08:11 +0000 (16:08 +0200)]
ArmVirtPkg/PlatformBootManagerLib: link against UefiBootManagerLib

The general BDS helper functions are now provided by MdeModulePkg's
UefiBootManagerLib, and no longer by IntelFrameworkModulePkg's
GenericBdsLib.

This patch parallels OvmfPkg commit 2b23b8d45b62.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariable
Laszlo Ersek [Thu, 5 May 2016 13:58:56 +0000 (15:58 +0200)]
ArmVirtPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariable

In this rather mechanical patch, we replace the calls to GenericBdsLib's
BdsLibUpdateConsoleVariable() with calls to UefiBootManagerLib's
EfiBootManagerUpdateConsoleVariable(), which has the same purpose.

The latter uses CONSOLE_TYPE enum constants from
"MdeModulePkg/Include/Library/UefiBootManagerLib.h", for identifying the
console type / underlying UEFI variable in the first parameter.

This patch parallels OvmfPkg commit 9dc08ec6574b.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: follow PlatformBootManagerLib interfaces
Laszlo Ersek [Thu, 5 May 2016 13:39:59 +0000 (15:39 +0200)]
ArmVirtPkg/PlatformBootManagerLib: follow PlatformBootManagerLib interfaces

"IntelFrameworkModulePkg/Include/Library/PlatformBdsLib.h" declares the
following interfaces:

- PlatformBdsInit
- PlatformBdsPolicyBehavior
- PlatformBdsBootFail
- PlatformBdsBootSuccess
- PlatformBdsLockNonUpdatableFlash
- LockKeyboards

From these, we've been using PlatformBdsInit() and
PlatformBdsPolicyBehavior().

"MdeModulePkg/Include/Library/PlatformBootManagerLib.h" declares the three
interfaces below:

- PlatformBootManagerBeforeConsole
- PlatformBootManagerAfterConsole
- PlatformBootManagerWaitCallback

Comparing the BdsEntry() functions between
- "IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c" and
- "MdeModulePkg/Universal/BdsDxe/BdsEntry.c",
we can establish the following mapping:

IntelFrameworkModulePkg              MdeModulePkg
  BdsEntry()                           BdsEntry()
    PlatformBdsInit()   <--------------> PlatformBootManagerBeforeConsole()
    dispatch Driver#### <--------------> dispatch Driver####
                                         connect consoles
    PlatformBdsPolicyBehavior() <------> PlatformBootManagerAfterConsole()

The difference in connecting the consoles will be addressed in a later
patch, now we just rename the functions according to the mapping above,
and copy the call site comments from MdeModulePkg's BdsEntry().

For the third interface, PlatformBootManagerWaitCallback(), add an empty
implementation (and copy the comment from the library class header).
Platform BDS can use this callback to draw a progress bar, for example.

This patch parallels OvmfPkg commit a7566234e92c.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg: duplicate PlatformIntelBdsLib to PlatformBootManagerLib
Laszlo Ersek [Thu, 5 May 2016 13:12:09 +0000 (15:12 +0200)]
ArmVirtPkg: duplicate PlatformIntelBdsLib to PlatformBootManagerLib

Create a copy of PlatformIntelBdsLib under the name
PlatformBootManagerLib, with the following initial changes:
- replace PlatformBdsLib references with PlatformBootManagerLib in
  comments,
- replace "IntelBdsPlatform" with "PlatformBm" in file names and their
  references,
- generate a new FILE_GUID.

PlatformBootManagerLib will be linked into the BDS driver from
MdeModulePkg.

This patch parallels OvmfPkg commit 305418818959.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoShellBinPkg: Ia32/X64 Shell binary update.
Qiu Shumin [Fri, 6 May 2016 07:43:36 +0000 (15:43 +0800)]
ShellBinPkg: Ia32/X64 Shell binary update.

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

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
7 years agoShellPkg: Remove debug message in release binaries.
Qiu Shumin [Thu, 5 May 2016 05:35:42 +0000 (13:35 +0800)]
ShellPkg: Remove debug message in release binaries.

Use BaseDebugLibNull instance instead of UefiDebugLibConOut to
remove the debug message in release Shell binaries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoNetworkPkg: Ignore BootFileName if it is overloaded.
Fu Siyuan [Tue, 3 May 2016 05:29:52 +0000 (13:29 +0800)]
NetworkPkg: Ignore BootFileName if it is overloaded.

Make sure "File" field is not overloaded to carry other DHCP options before use
it in PXE driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNetworkPkg: Ignore BootFileName if it is overloaded.
Fu Siyuan [Tue, 3 May 2016 05:29:23 +0000 (13:29 +0800)]
NetworkPkg: Ignore BootFileName if it is overloaded.

Make sure "File" field is not overloaded to carry other DHCP options before use
it in HTTP boot driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoMdeModulePkg: Ignore BootFileName if it is overloaded.
Heyi Guo [Sat, 23 Apr 2016 07:01:16 +0000 (15:01 +0800)]
MdeModulePkg: Ignore BootFileName if it is overloaded.

Make sure "BootFileName" is not overloaded before use it in PXE driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: chenzhihui <chenzhihui4@huawei.com>
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoNetworkPkg: Fix a memory leak in HTTP boot driver.
Fu Siyuan [Thu, 5 May 2016 02:15:47 +0000 (10:15 +0800)]
NetworkPkg: Fix a memory leak in HTTP boot driver.

We always need to call EfiBootManagerFreeLoadOption because the memory allocated
for NewOption (description and device path) is no longer needed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoMdeModulePkg/FileExplore: Make LibraryClass & Depex module type consistent
Dandan Bi [Thu, 5 May 2016 02:25:03 +0000 (10:25 +0800)]
MdeModulePkg/FileExplore: Make LibraryClass & Depex module type consistent

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 agoMdeModulePkg/HiiDatabaseDxe: Fix memory leak issues in HiiDatabaseDxe
Dandan Bi [Wed, 27 Apr 2016 10:00:02 +0000 (18:00 +0800)]
MdeModulePkg/HiiDatabaseDxe: Fix memory leak issues in HiiDatabaseDxe

Cc: Qiu Shumin <shumin.qiu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
7 years agoMdeModulePkg/SetupBrowser: Call submit callback function when no failure
Dandan Bi [Tue, 26 Apr 2016 11:52:02 +0000 (19:52 +0800)]
MdeModulePkg/SetupBrowser: Call submit callback function when no failure

In current code will always call submit callback function,
but we should call submit callback function when has no failure
in the submit action. This patch to fix this issues.

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: Restore question base on the fail info when submit fail
Dandan Bi [Fri, 22 Apr 2016 05:51:04 +0000 (13:51 +0800)]
MdeModulePkg: Restore question base on the fail info when submit fail

When RouteConfig function fail in SubmitForForm or SubmitForFormSet
function, we should restore the question value base on the failure
information, should not restore all the question.
This patch to fix this issue.

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 agoBaseTools: Support \x####\ in UNI files to specify non-ascii characters
Yonghong Zhu [Tue, 3 May 2016 07:44:27 +0000 (15:44 +0800)]
BaseTools: Support \x####\ in UNI files to specify non-ascii characters

UNI spec updated to allow using \x####\ to specify non-ascii characters,
# is a hex digit.

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/HttpBootDxe: Fix for the issue that the HTTP boot option can't be booted...
Sunny Wang [Thu, 5 May 2016 02:05:00 +0000 (10:05 +0800)]
NetworkPkg/HttpBootDxe: Fix for the issue that the HTTP boot option can't be booted more than once

This issue can be reproduced by the following steps:
1. Boot to HTTP boot option and the boot file is a ISO file like Ubuntu PE image.
2. Exit from boot option (GRUB) and then back to boot manager menu.
3. Boot to the same HTTP boot option again or a HTTP boot option pointing to the same HTTP ISO file. It will fail to boot.
Root cause:
When booting a HTTP boot option, the HTTP boot driver will save the Boot File's information in its private data as cache data for skipping the Boot file discovery from next time boot. However, the cache data doesn't include ImageType data, which would cause HTTP boot driver using the invalid ImageType (ImageTypeMax) and then fail to boot the cached boot file. In other words, for the second time boot, the HttpBootLoadFile() doesn't update ImageType (it returns a valid ImageType), which causes that the HttpBootDxeLoadFile() skips to Register a RAM Disk for downloaded HTTP ISO file and then BDS code can't find the RAM disk to boot.
Solution:
Save ImageType to private data for next time HTTP boot.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoMdeModulePkg NvmExpressDxe: Initialize IoAlign info for an NVMe device
Hao Wu [Wed, 4 May 2016 08:22:30 +0000 (16:22 +0800)]
MdeModulePkg NvmExpressDxe: Initialize IoAlign info for an NVMe device

The "IoAlign" field in EFI_BLOCK_IO_MEDIA of an NVMe device is not
initialized properly, leading to a zero value for this field.

It should be initialized from the "IoAlign" field in the
EFI_NVM_EXPRESS_PASS_THRU_MODE structure maintained by the NVMe
controller.

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: Refine SNP driver's media status check logic.
Fu Siyuan [Tue, 3 May 2016 09:11:22 +0000 (17:11 +0800)]
MdeModulePkg: Refine SNP driver's media status check logic.

Some UNDI drivers may not support the cable detect in UNDI INITIALIZE command,
but support the media present check in UNDI GET_STATUS command. Current SNP
driver will set the MediaPresentSupported field to FALSE in EFI_SIMPLE_NETWORK_MODE
for such case, which forbid the media detect from the callers.

This patch updates the SNP driver to support such kind of UNDIs for media detect.
MediaPresentSupported will be set to TRUE, and a GET_STATUS command will be issued
immediately after INITIALIZE command in SNP->Initialize() function, to refresh
the value of MediaPresent in SNP mode data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Ye Ting <ting.ye@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoCorebootPayloadPkg: Use serial drivers with PlatformHookLib
Leahy, Leroy P [Thu, 5 May 2016 00:38:55 +0000 (17:38 -0700)]
CorebootPayloadPkg: Use serial drivers with PlatformHookLib

Use the serial drivers which update the serial PCDs from
PlatformHookLib.

Change-Id: Ie6a3526d56332ee1cf07edb24ff39634a981183f
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootModulePkg/SerialDxe: Use PlatformHookLib
Leahy, Leroy P [Thu, 5 May 2016 00:38:41 +0000 (17:38 -0700)]
CorebootModulePkg/SerialDxe: Use PlatformHookLib

Copy the driver from MdeModulePkg/Universal/SerialDxe.  Add
PlatformHookLib to the Library section of the .inf file to adjust the
PCDs for the UART.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootModulePkg/PciSioSerialDxe: Use PlatformHookLib
Leahy, Leroy P [Thu, 5 May 2016 00:38:29 +0000 (17:38 -0700)]
CorebootModulePkg/PciSioSerialDxe: Use PlatformHookLib

Copy the driver from MdeModulePkg/Bus/Pci/PciSioSerialDxe.  Add
PlatformHookLib to the Library section of the .inf file to adjust the
PCDs for the UART.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg: Allow MaxLogicalProcessorNumber to be changed
Leahy, Leroy P [Thu, 5 May 2016 00:38:17 +0000 (17:38 -0700)]
CorebootPayloadPkg: Allow MaxLogicalProcessorNumber to be changed

Add a define and use it with MaxLogicalProcessorNumber to enable this
PCD to be changed via the command line.  Quark needs to set this value
to one during the builds.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg: Make serial I/O configurable
Leahy, Leroy P [Thu, 5 May 2016 00:38:00 +0000 (17:38 -0700)]
CorebootPayloadPkg: Make serial I/O configurable

Allow the serial port configuration to be overriden from the command
line.
Make the debug serial PCDs patchable in module.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg: Make shell selectable
Leahy, Leroy P [Thu, 5 May 2016 00:37:45 +0000 (17:37 -0700)]
CorebootPayloadPkg: Make shell selectable

Add all of the shell options from ShellBinPkg including building the
shell from source.

Enable link time optimization for GCC debug builds to keep the size
under 0x3e0000.

Test: Use -DSHELL_TYPE=BUILD_SHELL command line options to build the
shell from source.  Run the result on Galileo Gen2.

Change-Id: I1e12adb57960ac5e75e682073540a9322aa03081
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg/PlatformHelperLib: Remove unreferenced function
Leahy, Leroy P [Thu, 5 May 2016 00:37:26 +0000 (17:37 -0700)]
CorebootPayloadPkg/PlatformHelperLib: Remove unreferenced function

Remove the PlatformFlashEraseWrite function which is not used within
CorebootPayloadPkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoMdeModulePkg: ScsiDiskDxe: cope with broken "Supported VPD Pages" VPD page
Laszlo Ersek [Tue, 3 May 2016 14:41:31 +0000 (16:41 +0200)]
MdeModulePkg: ScsiDiskDxe: cope with broken "Supported VPD Pages" VPD page

The USB flash drive with Vendor ID 0x1516 (CompUSA) and Product ID 0x6221
returns a broken "Supported VPD Pages" VPD page. In particular, the
PageLength field has the invalid value 0x0602 (decimal 1538).

This prevents the loop from terminating that scans for the Block Limits
VPD page code in ScsiDiskInquiryDevice():

        for (Index = 0; Index < PageLength; Index++) {

because the Index variable has type UINT8, and it wraps from 255 to 0,
without ever reaching PageLength (1538), and because
EFI_SCSI_PAGE_CODE_BLOCK_LIMITS_VPD does not occur at offsets 0 through
255.

* The fix is not to change the type of Index to UINT16 or a wider type.
  Namely, section

    7.8.14 Supported VPD Pages VPD page

  in the "SCSI Primary Commands - 4" (SPC-4) specification names the
  following requirement:

    The supported VPD page list shall contain a list of all VPD page codes
    (see 7.8) implemented by the logical unit in ascending order beginning
    with page code 00h.

  Since page codes are 8-bit unsigned quantities, it follows that the
  maximum size for the Supported VPD Pages VPD page is 0x100 bytes, in
  which every possible page code (0x00 through 0xFF) will be found, before
  the UINT8 offset wraps around.

  (EFI_SCSI_SUPPORTED_VPD_PAGES_VPD_PAGE.SupportedVpdPageList is correctly
  sized as well, in "MdePkg/Include/IndustryStandard/Scsi.h".)

* Instead, add sanity checks that enforce the above requirement. If the
  device breaks the spec, simply fall back to the "Block Limits page
  absent" case.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1330955
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoSecurityPkg OpalPasswordSmm: Always execute BlockSid command.
Eric Dong [Wed, 4 May 2016 04:50:48 +0000 (12:50 +0800)]
SecurityPkg OpalPasswordSmm: Always execute BlockSid command.

The BlockSid feature is not depend on lock status,
so move the send BlockSid command out of unlock process.

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 agoSecurityPkg OpalPasswordSmm: Enhance BlockSid Logic.
Eric Dong [Wed, 4 May 2016 04:48:50 +0000 (12:48 +0800)]
SecurityPkg OpalPasswordSmm: Enhance BlockSid Logic.

BlockSid feature can be retrieve from the header info.
Update the logic, check BlockSid capability before use it.

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 agoSecurityPkg OpalPasswordDxe: Check BlockSid capability before send command.
Eric Dong [Fri, 22 Apr 2016 02:59:34 +0000 (10:59 +0800)]
SecurityPkg OpalPasswordDxe: Check BlockSid capability before send command.

Not all opal device support BlockSid feature. So Add
code logic to check the capability before send BlockSid
command.

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 agoSecurityPkg OpalPasswordDxe: Change BlockSid position.
Eric Dong [Fri, 22 Apr 2016 02:56:36 +0000 (10:56 +0800)]
SecurityPkg OpalPasswordDxe: Change BlockSid position.

The BlockSid feature is a global level feature instead
of device level feature. So move the menu from device page
to the main page.

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 agoSecurityPkg TcgStorageOpalLib: Check BlockSid capability.
Eric Dong [Fri, 22 Apr 2016 02:54:05 +0000 (10:54 +0800)]
SecurityPkg TcgStorageOpalLib: Check BlockSid capability.

Check the BlockSid feature capability through check
BlockSid header in the DiscoveryHeader.

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 agoMdePkg: Add TCG_BLOCK_SID_FEATURE_DESCRIPTOR definition.
Eric Dong [Fri, 22 Apr 2016 02:50:50 +0000 (10:50 +0800)]
MdePkg: Add TCG_BLOCK_SID_FEATURE_DESCRIPTOR definition.

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 agoSecurityPkg TcgStorageOpalLib: Update ComId for Block SID command.
Eric Dong [Fri, 15 Apr 2016 03:05:27 +0000 (11:05 +0800)]
SecurityPkg TcgStorageOpalLib: Update ComId for Block SID command.

The ComId for Block SID authentication command is
0x0005 according to "TCG Storage Feature Set: Block
SID Authentication Specification Version 1.0.0". Update code to
follow this spec requirement.

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 agoMdeModulePkg FileExplorerLib: Add UefiHiiServicesLib dependency.
Dong, Eric [Wed, 4 May 2016 06:27:39 +0000 (14:27 +0800)]
MdeModulePkg FileExplorerLib: Add UefiHiiServicesLib dependency.

FileExplorerLib depends on UefiHiiServicesLib, so add this missing
library dependency back.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoSecurityPkg: SecureBootConfigDxe: Disable SecureBoot Enable/Disable in some case
Zhang, Chao B [Wed, 4 May 2016 02:32:09 +0000 (10:32 +0800)]
SecurityPkg: SecureBootConfigDxe: Disable SecureBoot Enable/Disable in some case

Disable SecureBoot Enable/Disable feature when PhysicalPresence is not available,
Since SecureBootEnable is protected with PhysicalPresence.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoMdeModulePkg: Do not use hard coded TTL/ToS in PXE driver.
Fu Siyuan [Fri, 29 Apr 2016 07:09:20 +0000 (15:09 +0800)]
MdeModulePkg: Do not use hard coded TTL/ToS in PXE driver.

EFI_PXE_BASE_CODE_PROTOCOL has interface to set the TTL and ToS value, but
not used by the UdpWrite() interface. The code always use a hard coded 16
for the TTL and 0 for ToS.
This patch update the UpdWrite() to use the TTL and ToS which have been set
by the SetParameters().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-By: Samer El-Haj-Mahmoud <elhaj@hpe.com>
7 years agoNetworkPkg: Do not use hard coded TTL/ToS in PXE driver.
Fu Siyuan [Fri, 29 Apr 2016 07:08:58 +0000 (15:08 +0800)]
NetworkPkg: Do not use hard coded TTL/ToS in PXE driver.

EFI_PXE_BASE_CODE_PROTOCOL has interface to set the TTL and ToS value, but
not used by the UdpWrite() interface. The code always use a hard coded 16
for the TTL and 0 for ToS.
This patch update the UpdWrite() to use the TTL and ToS which have been set
by the SetParameters().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-By: Samer El-Haj-Mahmoud <elhaj@hpe.com>
7 years agoNt32Pkg: Fix SnpNt32 GetStatus bug
Zhang Lubo [Thu, 28 Apr 2016 07:51:42 +0000 (15:51 +0800)]
Nt32Pkg: Fix SnpNt32 GetStatus bug

According to UEFI spec, the Snp.GetStatus should
return the recycled transmit buffer address, while
the NT32 SNP always return value 1 for the Txbuffer.

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: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
7 years agoNetworkPkg: Use UefiBootManagerLib API to create load option.
Fu Siyuan [Wed, 4 May 2016 02:02:41 +0000 (10:02 +0800)]
NetworkPkg: Use UefiBootManagerLib API to create load option.

This patch updates the HTTP boot driver to use the API in UefiBootManagerLib to
create new load option, to avoid duplicate code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: : Ye Ting <ting.ye@intel.com>
Reviewed-by: : Ni Ruiyu <ruiyu.ni@intel.com>
7 years agoSecurityPkg OpalPasswordDxe: Install menu without device dependency.
Eric Dong [Wed, 4 May 2016 02:29:26 +0000 (10:29 +0800)]
SecurityPkg OpalPasswordDxe: Install menu without device dependency.

Change design to always install opal menu.
Current implementation only install menu when device connect.

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 agoSecurityPkg: SecureBootConfigDxe: Remove SecureBoot UI change for Customized Secure...
Zhang, Chao B [Thu, 28 Apr 2016 07:27:09 +0000 (15:27 +0800)]
SecurityPkg: SecureBootConfigDxe: Remove SecureBoot UI change for Customized Secure Boot

  Remove SecureBoot UI support for Customized SecureBoot Mode transition according to Mantis 1263.
The feature has been moved to
  https://github.com/tianocore/edk2-staging/tree/Customized-Secure-Boot
Previous check-in hash is
  SHA-1: 96832eefea1025c130979dec9b7da069f77bcd96

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoSecurityPkg: AuthVariableLib: Remove Customized SecureBoot Mode transition.
Zhang, Chao B [Thu, 28 Apr 2016 05:28:39 +0000 (13:28 +0800)]
SecurityPkg: AuthVariableLib: Remove Customized SecureBoot Mode transition.

  Remove Customized SecureBoot Mode transition logic for Mantis 1263, including AuditMode/DeployedMode/PK update management.
  Also remove image verification logic in AuditMode.
The feature has been moved to
  https://github.com/tianocore/edk2-staging/tree/Customized-Secure-Boot
Previous check-in hash is
  SHA-1: 4fc08e8d683522f255727626197d919a40d4836c

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoSecurityPkg: Remove gEdkiiSecureBootModeGuid definition
Zhang, Chao B [Thu, 28 Apr 2016 05:15:03 +0000 (13:15 +0800)]
SecurityPkg: Remove gEdkiiSecureBootModeGuid definition

Remove gEdkiiSecureBootModeGuid definition for Customized Secure Boot feature defined in
UEFI2.5 Mantis 1263. It is a private variable GUID.
The feature has been moved to
  https://github.com/tianocore/edk2-staging/tree/Customized-Secure-Boot
Previous check-in hash is
  SHA-1: af9af05bec5b1880f8e4f9142ecc0044fd0acb33

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoMdeModulePkg: VarCheckUefiLib: Remove DeployedMode/AuditMode var check logic
Zhang, Chao B [Thu, 28 Apr 2016 05:12:09 +0000 (13:12 +0800)]
MdeModulePkg: VarCheckUefiLib: Remove DeployedMode/AuditMode var check logic

Remove DeployedMode & AuditMode Global variable check for Customized Secure Boot feature defined in UEFI2.5 Mantis 1263.
The feature has been moved to
  https://github.com/tianocore/edk2-staging/tree/Customized-Secure-Boot
Previous check-in hash is
  SHA-1: 0f4f6d202a47e3882c6a7fb7ab9e55dda78a8113

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoMdePkg: Revert AuditMode/DeployedMode name definition
Zhang, Chao B [Thu, 28 Apr 2016 05:07:59 +0000 (13:07 +0800)]
MdePkg: Revert AuditMode/DeployedMode name definition

Revert AuditMode/DeployedMode definition from Customized Secure Boot feature defined in UEFI2.5 Mantis 1263.
The feature has been moved to
  https://github.com/tianocore/edk2-staging/tree/Customized-Secure-Boot
Previous check-in hash is
  SHA-1: 79e7b6472797f156d1ff28f3022b25d9c6f250f9

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoOvmfPkg/OvmfPkgIa32X64.dsc: Move PcdShellFile to [PcdsFixedAtBuild.X64]
Ruiyu Ni [Fri, 29 Apr 2016 06:20:31 +0000 (14:20 +0800)]
OvmfPkg/OvmfPkgIa32X64.dsc: Move PcdShellFile to [PcdsFixedAtBuild.X64]

PcdShellFile is never used in the PEI phase.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg: Use MdeModulePkg/BDS
Ruiyu Ni [Mon, 18 Apr 2016 01:47:55 +0000 (09:47 +0800)]
OvmfPkg: Use MdeModulePkg/BDS

By default the new MdeModulePkg/BDS is used.
If USE_OLD_BDS is defined to TRUE, IntelFrameworkModulePkg/BDS
is used.

Fixes: https://github.com/tianocore/edk2/issues/62
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Remove unused C structures definitions
Ruiyu Ni [Thu, 21 Apr 2016 02:15:02 +0000 (10:15 +0800)]
OvmfPkg/PlatformBootManagerLib: Remove unused C structures definitions

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Fix gcc-4.8 Ia32 build failure
Ruiyu Ni [Tue, 3 May 2016 03:05:36 +0000 (11:05 +0800)]
OvmfPkg/PlatformBootManagerLib: Fix gcc-4.8 Ia32 build failure

The Width and Height assignment suppresses an invalid gcc-4.8 warning
on Ia32.
These warnings look unjustified to me. Namely, near the beginning of
the function, there is a while(1) loop. In that loop,
ConvertBmpToGopBlt() is called unconditionally. If the call fails,
the rest of the loop body is not reached (where the Height and Width
variables are used -- the compiler warns about their use in the
switch statement). If the call succeeds, then the variables are set.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Add EnableQuietBoot & DisableQuietBoot
Ruiyu Ni [Wed, 20 Apr 2016 10:28:39 +0000 (18:28 +0800)]
OvmfPkg/PlatformBootManagerLib: Add EnableQuietBoot & DisableQuietBoot

EnableQuietBoot and DisableQuietBoot are copied from
IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c.
Because these two functions are not in UefiBootManagerLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Remove unused vars and func prototypes
Ruiyu Ni [Wed, 20 Apr 2016 10:23:04 +0000 (18:23 +0800)]
OvmfPkg/PlatformBootManagerLib: Remove unused vars and func prototypes

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Remove unnecessary memory test
Ruiyu Ni [Thu, 21 Apr 2016 06:25:53 +0000 (14:25 +0800)]
OvmfPkg/PlatformBootManagerLib: Remove unnecessary memory test

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Use GetBootModeHob() in HobLib
Ruiyu Ni [Wed, 20 Apr 2016 10:15:17 +0000 (18:15 +0800)]
OvmfPkg/PlatformBootManagerLib: Use GetBootModeHob() in HobLib

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Remove PlatformBdsGetDriverOption()
Ruiyu Ni [Wed, 20 Apr 2016 10:10:48 +0000 (18:10 +0800)]
OvmfPkg/PlatformBootManagerLib: Remove PlatformBdsGetDriverOption()

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Use EfiBootManagerRefreshAllBootOption()
Ruiyu Ni [Wed, 20 Apr 2016 10:09:21 +0000 (18:09 +0800)]
OvmfPkg/PlatformBootManagerLib: Use EfiBootManagerRefreshAllBootOption()

The patch uses EfiBootManagerRefreshAllBootOption() to collect
all boot options and uses SetBootOrderFromQemu exposed by
QemuNewBootOrderLib to adjust the boot option order.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: port PlatformBdsConnectSequence to UefiBootManagerLib
Ruiyu Ni [Wed, 20 Apr 2016 10:05:26 +0000 (18:05 +0800)]
OvmfPkg/PlatformBootManagerLib: port PlatformBdsConnectSequence to UefiBootManagerLib

The patch changes PlatformBdsConnectSequence() to use library API
exposed from UefiBootManagerLib and removes the additional
connect ALL action.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Remove unused local functions.
Ruiyu Ni [Wed, 20 Apr 2016 09:53:27 +0000 (17:53 +0800)]
OvmfPkg/PlatformBootManagerLib: Remove unused local functions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Register boot options and hot keys
Ruiyu Ni [Wed, 20 Apr 2016 09:49:15 +0000 (17:49 +0800)]
OvmfPkg/PlatformBootManagerLib: Register boot options and hot keys

The patch registers "Enter" key as the continue key (hot key to skip
the boot timeout wait), maps "F2" key to UI, and registers Shell
boot option.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Do not launch Boot Manager Menu
Ruiyu Ni [Wed, 20 Apr 2016 09:44:26 +0000 (17:44 +0800)]
OvmfPkg/PlatformBootManagerLib: Do not launch Boot Manager Menu

MdeModulePkg/BDS doesn't launch UI (Boot Manager Menu) from platform
side.
The change removes the code which launches the UI but still set the
boot timeout.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Init console vars in *BeforeConsole()
Ruiyu Ni [Wed, 20 Apr 2016 09:36:14 +0000 (17:36 +0800)]
OvmfPkg/PlatformBootManagerLib: Init console vars in *BeforeConsole()

The major difference between IntelFrameworkModulePkg/BDS and
MdeModulePkg/BDS is the latter connects the consoles in core
code while the former connects in platform code.
The change initializes the console variables in
PlatformBootManagerBeforeConsole() and removes the console
connection code.
It also removes unused functions: PlatformBdsNoConsoleAction()
and LockKeyboards().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Use ConvertDevicePathToText()
Ruiyu Ni [Wed, 20 Apr 2016 09:24:38 +0000 (17:24 +0800)]
OvmfPkg/PlatformBootManagerLib: Use ConvertDevicePathToText()

The DevicePathToStr() function (in
"IntelFrameworkModulePkg/Library/GenericBdsLib/DevicePath.c") is a
simple wrapper around ConvertDevicePathToText().

DevicePathToStr() passes DisplayOnly=TRUE and AllowShortcuts=TRUE to
ConvertDevicePathToText(), whereas in this patch, both parameters are
flipped to FALSE.

The formatted devpaths are used only for debugging purposes, so this
change is safe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: link to UefiBootManagerLib
Ruiyu Ni [Wed, 20 Apr 2016 09:20:31 +0000 (17:20 +0800)]
OvmfPkg/PlatformBootManagerLib: link to UefiBootManagerLib

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariable
Ruiyu Ni [Wed, 20 Apr 2016 09:19:14 +0000 (17:19 +0800)]
OvmfPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariable

Call EfiBootManagerUpdateConsoleVariable in UefiBootManagerLib
instead of BdsLibUpdateConsoleVariable in GenericBdsLib.

Still cannot pass build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformBootManagerLib: Follow PlatformBootManagerLib interfaces
Ruiyu Ni [Wed, 20 Apr 2016 07:46:46 +0000 (15:46 +0800)]
OvmfPkg/PlatformBootManagerLib: Follow PlatformBootManagerLib interfaces

Change the function name to follow new library class
PlatformBootManagerLib interfaces.

NOTE: There is no progress bar during BDS timeout waiting.
In order to show the progress bar, PlatformBootManagerWaitCallback ()
needs to change to draw it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg: Duplicate PlatformBdsLib to PlatformBootManagerLib
Ruiyu Ni [Mon, 3 Aug 2015 05:26:01 +0000 (13:26 +0800)]
OvmfPkg: Duplicate PlatformBdsLib to PlatformBootManagerLib

It will be changed to build with MdeModulePkg/BDS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/QemuNewBootOrderLib: Build with UefiBootManagerLib
Ruiyu Ni [Wed, 20 Apr 2016 07:27:48 +0000 (15:27 +0800)]
OvmfPkg/QemuNewBootOrderLib: Build with UefiBootManagerLib

NOTE: SetBootOrderFromQemu() interface is not changed.
But when the old IntelFrameworkModulePkg/BDS is no longer used in
OVMF and ArmVirtPkg, additional patch will be submitted to change
this interface to remove parameter BootOptionList.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg: Duplicate QemuBootOrderLib to QemuNewBootOrderLib
Ruiyu Ni [Fri, 15 Apr 2016 10:19:29 +0000 (18:19 +0800)]
OvmfPkg: Duplicate QemuBootOrderLib to QemuNewBootOrderLib

QemuNewBootOrderLib will be changed to work with MdeModulePkg/BDS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PlatformPei: Add memory above 4GB as tested
Ruiyu Ni [Thu, 21 Apr 2016 06:31:55 +0000 (14:31 +0800)]
OvmfPkg/PlatformPei: Add memory above 4GB as tested

Since PlatformBootManagerLib do not run memory test
to convert untested memory to tested.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdeModulePkg/UefiBootManagerLib: Expose *GetLoadOptionBuffer() API
Ruiyu Ni [Thu, 21 Apr 2016 05:28:31 +0000 (13:28 +0800)]
MdeModulePkg/UefiBootManagerLib: Expose *GetLoadOptionBuffer() API

Expose EfiBootManagerGetLoadOptionBuffer() API.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoShellPkg UefiDpLib: Delete one comment introduced by 196ccda08fc4
Star Zeng [Mon, 2 May 2016 08:45:33 +0000 (16:45 +0800)]
ShellPkg UefiDpLib: Delete one comment introduced by 196ccda08fc4

Cc: Cinnamon Shia <cinnamon.shia@hpe.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoPerformancePkg Dp_App: Delete InitCumulativeData()
Star Zeng [Mon, 2 May 2016 08:40:54 +0000 (16:40 +0800)]
PerformancePkg Dp_App: Delete InitCumulativeData()

InitCumulativeData is introduced by d28f77df0f51f84b0af79f09abe2c27b1f1aaa69,
it is needed by ShellPkg UefiDpLib, but not needed by PerformancePkg Dp_App.

This patch is to delete it.

Cc: Cinnamon Shia <cinnamon.shia@hpe.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoPerformancePkg/Dp_App: Fix the error message "Timer library instance error!"
Cinnamon Shia [Mon, 2 May 2016 04:34:09 +0000 (12:34 +0800)]
PerformancePkg/Dp_App: Fix the error message "Timer library instance error!"

When executing shell dp command, there is an error message "Timer library
instance error!"

The error message "Timer library instance error!" should be for the case about
duration > EndTimeStamp if CountUp or duration > StartTimeStamp if CountDown.

But if the EndTimeStamp of an entry is not added, it should not the case to catch.

This change fixes the error message "Timer library instance error!" from the
"BdsAttempt" entry which is logged when trying to boot a boot option.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg/UefiDpLib: Fix the error message "Timer library instance error!"
Cinnamon Shia [Mon, 2 May 2016 04:34:08 +0000 (12:34 +0800)]
ShellPkg/UefiDpLib: Fix the error message "Timer library instance error!"

When executing shell dp command, there is an error message "Timer library
instance error!"

The error message "Timer library instance error!" should be for the case about
duration > EndTimeStamp if CountUp or duration > StartTimeStamp if CountDown.

But if the EndTimeStamp of an entry is not added, it should not the case to catch.

This change fixes the error message "Timer library instance error!" from the
"BdsAttempt" entry which is logged when trying to boot a boot option.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoSecurityPkg: Update servers TCG ACPI Table template to TCG 1.2
Samer El-Haj-Mahmoud [Thu, 28 Apr 2016 20:41:28 +0000 (04:41 +0800)]
SecurityPkg: Update servers TCG ACPI Table template to TCG 1.2

Update the TCG Spec in the the EFI_TCG_SERVER_ACPI_TABLE from TCG 1.0 to
TCG 1.2

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoSecurityPkg: Reduce DEBUG verbosity in Tcg2Dxe
Derek Lin [Fri, 29 Apr 2016 11:09:23 +0000 (19:09 +0800)]
SecurityPkg: Reduce DEBUG verbosity in Tcg2Dxe

Reduce several DEBUG messages verbosity from INFO to VERBOSE, so that will not see debug message around each driver loading when TPM 2.0 part present.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoSecurityPkg: Fix TPM 1.2 NV Storage Command Size byte order
Samer El-Haj-Mahmoud [Thu, 28 Apr 2016 20:24:04 +0000 (04:24 +0800)]
SecurityPkg: Fix TPM 1.2 NV Storage Command Size byte order

Fix Tpm12NvWriteValue() command/response length byte order.
Tpm12SubmitCommand() was using the value from Command.Hdr.paramSize
which was swapped to be Big Endian, but the function was
expecting it in UINT32 Little Endian

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoSecurityPkg: Fix bug in TPM 1.2 SelfTest
Samer El-Haj-Mahmoud [Thu, 28 Apr 2016 20:29:27 +0000 (04:29 +0800)]
SecurityPkg: Fix bug in TPM 1.2 SelfTest

Fix uninitialized command Length variable in TPM1.2 Self Test command

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoSecurityPkg: Add DEBUG messages for TPM12Startup
Samer El-Haj-Mahmoud [Thu, 28 Apr 2016 20:32:55 +0000 (04:32 +0800)]
SecurityPkg: Add DEBUG messages for TPM12Startup

Add DEBUG messages for TPM12Startup to distinguish between TPM_SUCCESS
and
TPM_INVALID_POSTINIT. This helps debugging some hardware problems.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoSecurityPkg: Add DEBUG messages for TPM2Startup
Samer El-Haj-Mahmoud [Thu, 28 Apr 2016 20:04:20 +0000 (04:04 +0800)]
SecurityPkg: Add DEBUG messages for TPM2Startup

Add DEBUG messages for TPM2Startup to distinguish between TPM_RC_SUCCESS
and TPM_RC_INITIALIZE. This helps debugging some hardware problems.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoCorebootModulePkg: Remove DuetPkg references
Leahy, Leroy P [Mon, 2 May 2016 19:59:17 +0000 (12:59 -0700)]
CorebootModulePkg: Remove DuetPkg references

Remove the references to DuetPkg.  Copy the files from revision
ffea0a2ce21e8e9878587de2419959a7bfea4021 of DuetPkg into
CorebootModulePkg.  The components include:
* PciBusNoEnumerationDxe
* PciRootBridgeNoEnumerationDxe
* SataControllerDxe

TEST=Build and run on Galileo Gen2

Change-Id: Id07185f7e226749e5f7c6b6cb427bcef7eac8496
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg: Remove trailing white space
Leahy, Leroy P [Mon, 2 May 2016 17:22:15 +0000 (10:22 -0700)]
CorebootPayloadPkg: Remove trailing white space

Remove trailing white space from existing .dsc and .fdf files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoArmPlatformPkg/PrePi: allow unicore version to be used on MP hardware
Ard Biesheuvel [Tue, 19 Apr 2016 07:22:38 +0000 (09:22 +0200)]
ArmPlatformPkg/PrePi: allow unicore version to be used on MP hardware

When combining UEFI firmware built from Tianocore with ARM Trusted
Firmware running in EL3, it is the responsibility of ATF that only
a single core enters the UEFI firmware in EL2, and the remaining cores
are released directly to the OS via PSCI SMC calls.

In this case, we don't need the MpCore flavor of PrePi or PrePeiCore,
but the UniCore flavor currently checks the CPU identification registers
directly, and refuses to proceed if the boot CPU is part of a MpCore
system.

So drop the ASSERT()'s that implement this check.

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: implement CpuIo2 protocol driver specific for PCI
Ard Biesheuvel [Wed, 27 Apr 2016 12:52:05 +0000 (14:52 +0200)]
ArmPkg: implement CpuIo2 protocol driver specific for PCI

The CpuIo2 protocol is required by the generic PciHostBridgeDxe driver,
which relies on it to back its own I/O and MMIO operations.

Since ARM has no native I/O port equivalent, such accesses can only
originate from PCI drivers, and the PCI I/O space is translated to MMIO
in this case.

So we can implement this protocol using MMIO operations only, and take
the PCI I/O translation offset into account when performing I/O port
accesses.

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 agoArmPlatformPkg: move PCI related PCD definitions to ArmPkg
Ard Biesheuvel [Fri, 29 Apr 2016 15:32:21 +0000 (17:32 +0200)]
ArmPlatformPkg: move PCI related PCD definitions to ArmPkg

The PCI related PCDs are not platform specific, and architectural
protocols such as CpuIo2 are based on PCI provided MMIO to IO
translation, so these PCDs belong in ArmPkg not ArmPlatformPkg.

NOTE: this *WILL* break some out-of-tree platforms, the fix is changing
all consumers of gArmPlatformTokenSpaceGuid.PcdPci* to
gArmTokenSpaceGuid.PcdPci*

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 agoMdeModulePkg/DxeCore: set ImageContext Handle and ImageRead() fields
Ard Biesheuvel [Fri, 29 Apr 2016 07:39:18 +0000 (09:39 +0200)]
MdeModulePkg/DxeCore: set ImageContext Handle and ImageRead() fields

Set the ImageContext.Handle and ImageContext.ImageRead() fields so that
PeCoffLoaderRelocateImageExtraAction() can invoke PeCoffLoaderGetImageInfo
or PeCoffLoaderGetPeHeader if desired to obtain additional metadata.

We will use this to create a PeCoffLoaderRelocateImageExtraAction()
implementation that applies boot time strict mapping permissions to
PE/COFF modules.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg/PciBusDxe: don't create bogus descriptor if no resources needed
Ard Biesheuvel [Thu, 28 Apr 2016 15:51:28 +0000 (23:51 +0800)]
MdeModulePkg/PciBusDxe: don't create bogus descriptor if no resources needed

If the current PCI configuration requires no resources to be allocated at
all (i.e., unpopulated bus), the PCI enumeration code creates a single
ACPI_ADDRESS_SPACE_DESCRIPTOR memory descriptor with all fields cleared.
This is rejected by the SubmitResources() implementation of the generic
PciHostBridgeDxe in the following way:

  PciHostBridge: SubmitResources for PcieRoot(0x0)
   Mem: Granularity/SpecificFlag = 0 / 00
        Length/Alignment = 0x0 / 0x0
  PciBus: HostBridge->SubmitResources() - Invalid Parameter

  ASSERT_EFI_ERROR (Status = Invalid Parameter)
  ASSERT [PciBusDxe] .../PciBusDxe/PciLib.c(561): !EFI_ERROR (Status)

So instead, create the empty configuration as a single entry of type
EFI_ACPI_END_TAG_DESCRIPTOR.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoBaseTools/Build: Better DSC arch filtering
Thomas Palmer [Wed, 27 Apr 2016 22:32:17 +0000 (06:32 +0800)]
BaseTools/Build: Better DSC arch filtering

Description:
When building for any specific architecture, the build script today is loading
DSC sections for other architectures not in the build. The build process should
disregard DSC sections that are not relevant to the build.

My previous patch only fixed issue for one section type (Components). This
patch will handle all section types by updating the MetaFileParser class, which
now takes a Arch argument and will filter the DSC table results as they are
returned from the database.  The database still contains all information from
DSCs for when builds support multiple arch's

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTools: fix the bug for FMP to support use Macro as path description
Yonghong Zhu [Thu, 28 Apr 2016 06:42:26 +0000 (14:42 +0800)]
BaseTools: fix the bug for FMP to support use Macro as path description

Fix the bug for FMP image to support to use Macro as path description,
eg: FILE DATA = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/test.efi

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoShellPkg: Add NULL pointer check.
Qiu Shumin [Thu, 28 Apr 2016 05:28:53 +0000 (13:28 +0800)]
ShellPkg: Add NULL pointer check.

Add pointer check to avoid NULL pointer dereferenced.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Tapan Shah <tapandshah@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoMdePkg-SmmMemLib: Enhance SmmIsBufferOutsideSmmValid() check for fixed comm buffer.
Jiewen Yao [Fri, 22 Apr 2016 07:49:28 +0000 (15:49 +0800)]
MdePkg-SmmMemLib: Enhance SmmIsBufferOutsideSmmValid() check for fixed comm buffer.

This patch adds more check in SmmIsBufferOutsideSmmValid(), to make sure that
SMM communication buffer is only EfiReservedMemoryType/EfiRuntimeServicesCode/
EfiRuntimeServicesData/EfiACPIMemoryNVS. So that the communication buffer will
not touch any OS memory.

The assumption is that a platform reports valid SMM communication buffer at
EndOfDxe, because EndOfDxe is last hook point that SMM code can call-out to
get memory map information.
A platform MUST finish SMM communication buffer allocation before EndOfDxe.
If a DXE or OS driver need do communication after EndOfDxe, it can either
allocate SMM communication buffer before EndOfDxe and save it, or consume
EDKII_PI_SMM_COMMUNICATION_REGION_TABLE table to get general fixed comm buffer.

This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS
requirement.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoSecurityPkg-Opal(2): Enhance AHCI Bar MMIO region check.
Eric Dong [Fri, 22 Apr 2016 07:40:46 +0000 (15:40 +0800)]
SecurityPkg-Opal(2): Enhance AHCI Bar MMIO region check.

This patch enhance OPAL password SMM driver to check SMM bar is valid MMIO
besides outside of SMRAM.

This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS
requirement.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoSecurityPkg-Opal(1): Use fixed SMM communication buffer in OPAL password lib.
Eric Dong [Fri, 22 Apr 2016 07:36:36 +0000 (15:36 +0800)]
SecurityPkg-Opal(1): Use fixed SMM communication buffer in OPAL password lib.

This patch enhance OPAL password lib SMM communication by using fixed
SMM communication buffer.

Update OPAL password lib to consume EDKII_PI_SMM_COMMUNICATION_REGION_TABLE
as fixed communication buffer for SMM communication.

This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS
requirement.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>