mirror_edk2.git
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agoMdeModulePkg-FPDT(4): Use fixed buffer for SMM_PERF_COMMUNICATE in PerfLib.
Liming Gao [Fri, 22 Apr 2016 07:32:30 +0000 (15:32 +0800)]
MdeModulePkg-FPDT(4): Use fixed buffer for SMM_PERF_COMMUNICATE in PerfLib.

This patch enhance performance data SMM communication by using fixed
SMM communication buffer.

Update PerformanceLib to use fixed SMM communication buffer to get
performance data by SMM_PERF_COMMUNICATE API.

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

Cc: Liming Gao <liming.gao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
6 years agoMdeModulePkg-FPDT(3): Use SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET in FpdtDxe.
Liming Gao [Fri, 22 Apr 2016 07:31:07 +0000 (15:31 +0800)]
MdeModulePkg-FPDT(3): Use SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET in FpdtDxe.

This patch enhance performance data SMM communication by using fixed
SMM communication buffer.

Update FpdtDxe to use fixed SMM communication buffer to get
performance data by SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET API.

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

Cc: Liming Gao <liming.gao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
6 years agoMdeModulePkg-FPDT(2): Add SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET in FpdtSmm...
Liming Gao [Fri, 22 Apr 2016 07:27:26 +0000 (15:27 +0800)]
MdeModulePkg-FPDT(2): Add SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET in FpdtSmm Handler.

This patch enhance performance data SMM communication by using fixed
SMM communication buffer.

Update FpdtSmm to handle SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET
request.

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

Cc: Liming Gao <liming.gao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
6 years agoMdeModulePkg-FPDT(1): Add SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET definition.
Liming Gao [Fri, 22 Apr 2016 07:22:43 +0000 (15:22 +0800)]
MdeModulePkg-FPDT(1): Add SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET definition.

This patch enhance performance data SMM communication by using fixed
SMM communication buffer.

A new command SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET is added,
because we need to support get partial PerformanceData to fixed SMM communication
buffer. If performance data is bigger than fixed SMM communication buffer,
the DXE agent need to call SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET
multiple times to get all data out.

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

Cc: Liming Gao <liming.gao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
6 years agoMdeModulePkg-MemoryProfile(3): Use SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET...
Star Zeng [Fri, 22 Apr 2016 07:18:35 +0000 (15:18 +0800)]
MdeModulePkg-MemoryProfile(3): Use SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET in MemoryProfileInfo.

This patch enhance SMM memory profile SMM communication by using fixed
SMM communication buffer.

Update MemoryProfileInfo APP to use fixed SMM communication buffer to get
profile data by SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET API.

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

Cc: Star Zeng <star.zeng@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
6 years agoMdeModulePkg-MemoryProfile(2): Add SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET...
Star Zeng [Fri, 22 Apr 2016 07:16:46 +0000 (15:16 +0800)]
MdeModulePkg-MemoryProfile(2): Add SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET in PiSmmCore.

This patch enhance SMM memory profile SMM communication by using fixed
SMM communication buffer.

Update PiSmmCore to handle SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET
request.

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

Cc: Star Zeng <star.zeng@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
6 years agoMdeModulePkg-MemoryProfile(1): Add SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET...
Star Zeng [Fri, 22 Apr 2016 07:13:47 +0000 (15:13 +0800)]
MdeModulePkg-MemoryProfile(1): Add SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET definition.

This patch enhance SMM memory profile SMM communication by using fixed
SMM communication buffer.

A new command SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET is added,
because we need to support get partial ProfileData to fixed SMM communication
buffer. If profile data is bigger than fixed SMM communication buffer,
the DXE agent need to call SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET
multiple times to get all data out.

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

Cc: Star Zeng <star.zeng@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
6 years agoMdeModulePkg: Add new driver to publish EDKII_PI_SMM_COMMUNICATION_REGION_TABLE.
Jiewen Yao [Fri, 22 Apr 2016 07:04:45 +0000 (15:04 +0800)]
MdeModulePkg: Add new driver to publish EDKII_PI_SMM_COMMUNICATION_REGION_TABLE.

Add a driver to publish EDKII_PI_SMM_COMMUNICATION_REGION_TABLE, so that
other DXE driver can consume this table directly. NOTE: This is sample driver.
A platform may uses its own way to define default SMM communication buffer
region and publish information in its own
EDKII_PI_SMM_COMMUNICATION_REGION_TABLE.

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

Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Feng, Tian <feng.tian@intel.com>
6 years agoMdeModulePkg: Add EDKII_PI_SMM_COMMUNICATION_REGION_TABLE definition.
Jiewen Yao [Fri, 22 Apr 2016 06:59:49 +0000 (14:59 +0800)]
MdeModulePkg: Add EDKII_PI_SMM_COMMUNICATION_REGION_TABLE definition.

This configuration table is used to describe platform pre-allocated memory
for SMM communication buffer. If DXE driver wants to communicate with SMM
agent, it can use this memory as SMM communication buffer instead of allocate
new memory region.

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

Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
6 years agoShellPkg: Enhance ping6 to select the interface automatically
Jiaxin Wu [Fri, 22 Apr 2016 02:55:03 +0000 (10:55 +0800)]
ShellPkg: Enhance ping6 to select the interface automatically

v2:
* Refine the code to make it more readable.

This patch is used to support no source IP specified case while
multiple NICs existed in the platform. The command will select the
first both connected and configured interface automatically.
Note: Source address is always required when pinging a
link-local address.

Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoShellPkg: Enhance ping to select the interface automatically
Jiaxin Wu [Tue, 19 Apr 2016 01:49:01 +0000 (09:49 +0800)]
ShellPkg: Enhance ping to select the interface automatically

v2:
* A. Refine the code to make it more readable.
* B. Add hint message for link local address case.

This patch is used to support no source IP specified case
while multiple NICs existed in the platform. The command
will select the first both connected and configured interface
automatically.
Note: Source address is always required when pinging a
link-local address.

Cc: David Van Arnem <dvanarnem@cmlab.biz>
Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoMdeModulePkg/NvmExpressDxe: comments update to meet implementation
Feng Tian [Tue, 26 Apr 2016 06:49:53 +0000 (14:49 +0800)]
MdeModulePkg/NvmExpressDxe: comments update to meet implementation

Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
Cc: Wu, Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Wu, Hao A <hao.a.wu@intel.com>
Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
6 years agoMdePkg: Add WSMT definition.
Jiewen Yao [Fri, 22 Apr 2016 02:23:19 +0000 (10:23 +0800)]
MdePkg: Add WSMT definition.

This patch adds Windows SMM Security Mitigation
Table @ http://download.microsoft.com/download/1/8/A/18A21244-EB67-4538-BAA2-1A54E0E490B6/WSMT.docx

Cc: "Gao, Liming" <liming.gao@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Gao, Liming" <liming.gao@intel.com>
6 years agoSecuritPkg: DxeImageVerificationLib: Fix wrong verification logic in DBX & DBT
Zhang, Chao B [Wed, 13 Apr 2016 08:25:50 +0000 (16:25 +0800)]
SecuritPkg: DxeImageVerificationLib: Fix wrong verification logic in DBX & DBT

In image verification, if image verified pass in DBT, still need to verify if it is blocked by any other cert/cert hash from DBX.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Reviewed-by: Dick Wilkins <dick_wilkins@phoenix.com>
6 years agoUefiCpuPkg/MtrrLib: Remove the loop of calculating Fixed-MTRR Mask
Jeff Fan [Thu, 21 Apr 2016 02:28:17 +0000 (10:28 +0800)]
UefiCpuPkg/MtrrLib: Remove the loop of calculating Fixed-MTRR Mask

Introduce the 32bit mask seeds to calculate Fixed-MTRR or&and mask values. It
could avoid the loop operation and 64bit shift operations.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@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>
6 years agoUefiCpuPkg/MtrrLib: Remove the loop of calculating byte offset in MSR
Jeff Fan [Wed, 20 Apr 2016 08:58:24 +0000 (16:58 +0800)]
UefiCpuPkg/MtrrLib: Remove the loop of calculating byte offset in MSR

Calculate byte offset in MSR directly and removing the loop.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@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>
6 years agoUefiCpuPkg/MtrrLib: Reduce the loop time to get fixed-MTRR MSR index
Jeff Fan [Wed, 20 Apr 2016 08:51:46 +0000 (16:51 +0800)]
UefiCpuPkg/MtrrLib: Reduce the loop time to get fixed-MTRR MSR index

Add input fixed-MTRR MSR index to be start MSR index to avoid finding fixed-MTRR
MSR index from 0 at each time.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@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>
6 years agoShellPkg: Update smbiosview for latest Type 17 devices
Samer El-Haj-Mahmoud [Wed, 27 Apr 2016 22:55:09 +0000 (15:55 -0700)]
ShellPkg: Update smbiosview for latest Type 17 devices

Update smbiosview to understand latest SMBIOS Type 17 devices from
SMBIOS 3.0.0 spec

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoOvmfPkg: PlatformBdsLib: lock down SMM regardless of S3
Laszlo Ersek [Wed, 27 Apr 2016 16:01:02 +0000 (18:01 +0200)]
OvmfPkg: PlatformBdsLib: lock down SMM regardless of S3

At the moment, the EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL is only installed if
S3 is enabled -- at the end of SaveS3BootScript().

While a runtime OS is never booted with SMM unlocked (because the SMM IPL
locks down SMM as a last resort:

> SMM IPL!  DXE SMM Ready To Lock Protocol not installed before Ready To
> Boot signal
> SmmInstallProtocolInterface: [EfiSmmReadyToLockProtocol] 0
> Patch page table start ...
> Patch page table done!
> SMM IPL locked SMRAM window

), we shouldn't allow UEFI drivers and applications either to mess with
SMM just because S3 is disabled. So install
EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL in PlatformBdsInit() unconditionally.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoOvmfPkg: PlatformBdsLib: lock down SMM in PlatformBdsInit()
Laszlo Ersek [Wed, 27 Apr 2016 15:37:42 +0000 (17:37 +0200)]
OvmfPkg: PlatformBdsLib: lock down SMM in PlatformBdsInit()

OVMF's PlatformBdsLib currently makes SMM vulnerable to the following
attack:

(1) a malicious guest OS copies a UEFI driver module to the EFI system
    partition,

(2) the OS adds the driver as a Driver#### option, and references it from
    DriverOrder,

(3) at next boot, the BdsEntry() function in
    "IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c" processes
    Driver#### and DriverOrder between the calls to PlatformBdsInit() and
    PlatformBdsPolicyBehavior(),

(4) OVMF locks down SMM only in PlatformBdsPolicyBehavior(), hence the
    driver runs with SMM unlocked.

The BdsEntry() function of the MdeModulePkg BDS driver (in file
"MdeModulePkg/Universal/BdsDxe/BdsEntry.c") recommends to "Signal
ReadyToLock event" in PlatformBootManagerBeforeConsole() -- which
corresponds to PlatformBdsInit() --, not in
PlatformBootManagerAfterConsole() -- which corresponds to
PlatformBdsPolicyBehavior().

Albeit an independent question, but it's worth mentioning: this patch also
brings OvmfPkg's PlatformBdsInit() closer to ArmVirtPkg's. Namely, the
latter signals End-of-Dxe in PlatformBdsInit() already.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoMdeModulePkg: PiDxeS3BootScriptLib: honor PcdAcpiS3Enable
Laszlo Ersek [Wed, 27 Apr 2016 17:28:44 +0000 (19:28 +0200)]
MdeModulePkg: PiDxeS3BootScriptLib: honor PcdAcpiS3Enable

In the edk2 tree, there are currently four drivers that consume
PcdAcpiS3Enable:

  IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf
  MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf
  MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf
  MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.inf

From these, AcpiS3SaveDxe is the only one that isn't also a client of the
S3BootScriptLib class; all the others (BootScriptExecutorDxe,
S3SaveStateDxe, SmmS3SaveState) are clients of the S3BootScriptLib class.

In turn, the edk2 tree contains only one non-Null instance of the
S3BootScriptLib class:

  MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf

Therefore we can safely state that BootScriptExecutorDxe, S3SaveStateDxe,
and SmmS3SaveState are all linked against PiDxeS3BootScriptLib.

Now, if PcdAcpiS3Enable is FALSE when either of BootScriptExecutorDxe,
SmmS3SaveState, or SmmS3SaveState is dispatched, then the following
happens:

- The constructor of PiDxeS3BootScriptLib, function
  S3BootScriptLibInitialize(), registers a protocol installation callback
  for gEfiDxeSmmReadyToLockProtocolGuid. Namely, the function
  S3BootScriptEventCallBack().

- The driver immediately exits with EFI_UNSUPPORTED from its entry point
  function, upon seeing PcdAcpiS3Enable == FALSE. (See commits
  800c02fbe2da6125e093876414, and d2d38610603f6.)

- This leaves a dangling callback pointer in the DXE core.

- When Platform BDS installs gEfiDxeSmmReadyToLockProtocolGuid (which is a
  valid thing to do for locking down SMM, even in the absence of S3
  support!), things blow up.

Fix this issue by returning immediately from S3BootScriptLibInitialize()
if PcdAcpiS3Enable is FALSE -- it is useless to initialize the library
instance if the containing driver module exits first thing in its entry
point.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoNetworkPkg: Fix incorrect buffer free in HttpDxe
Jiaxin Wu [Wed, 27 Apr 2016 06:29:29 +0000 (14:29 +0800)]
NetworkPkg: Fix incorrect buffer free in HttpDxe

FragmentBuffer of each TcpWrap in HttpDxe should not be
freed in HttpTcpTokenCleanup(). This buffer points to
HttpMsg body actually, which is the responsibility of the
caller to allocate a buffer for Body.

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>
6 years agoNetworkPkg: Avoid the indefinite wait case in HttpDxe
Jiaxin Wu [Tue, 26 Apr 2016 08:46:33 +0000 (16:46 +0800)]
NetworkPkg: Avoid the indefinite wait case in HttpDxe

Need the timer check to avoid the indefinite wait case
in HttpDxe driver
A.HTTP receive Header process in HttpTcpReceiveHeader();
B.HTTP receive Body process in HttpTcpReceiveBody();

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
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: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoMdeModulePkg: DxeCore MemoryPool Algorithm Update
Liming Gao [Fri, 8 Apr 2016 06:34:03 +0000 (14:34 +0800)]
MdeModulePkg: DxeCore MemoryPool Algorithm Update

Use 128 bytes as the start size region to be same to previous one.

64 bytes is small as the first range. On X64 arch, POOL_OVERHEAD
takes 40 bytes, the pool data less than 24 bytes can be fit into
it. But, the real allocation is few that can't reduce its free pool
link list. And, the second range (64~128) has more allocation
that also increases the free pool link list of the first range.
Then, the link list will become longer and longer. When LinkList
check enable in DEBUG tip, the long link list will bring the
additional overhead and bad performance. Here is the performance
data collected in our X64 platform with DEBUG enable.
64  byte: 22 seconds in BDS phase
128 byte: 19.6 seconds in BDS phase

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
6 years agoShellPkg: Fix typos and EDK2 coding style issues
Tapan Shah [Wed, 27 Apr 2016 14:55:39 +0000 (07:55 -0700)]
ShellPkg: Fix typos and EDK2 coding style issues

Fixing typos and EDK2 coding style issues found from previous submit

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg: Fix pci command for '_e' option
Abdul Lateef Attar [Thu, 21 Apr 2016 11:24:14 +0000 (04:24 -0700)]
ShellPkg: Fix pci command for '_e' option

    ShellPkg: Fix pci command for '_e' option

    Processing of '_e' argument was missing.
    Added fix, to process the '_e' option
    for printing additional AER information.

    Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Abdul Lateef Attar <abdul-lateef.attar@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
6 years agoMdeModulePkg: Export ConfigResp only for form Package after ReadyToBoot
Dandan Bi [Wed, 20 Apr 2016 04:59:47 +0000 (12:59 +0800)]
MdeModulePkg: Export ConfigResp only for form Package after ReadyToBoot

The Hii runtime support feature will export the content of
HiiDatabase and the ConfigResp string to runtime buffer
after ReadyToBoot event is triggered. If some drivers
add/update/remove packages from Hiidatabase after ReadyToBoot:
Originally we will both export the content of HiiDatabase and
the ConfigResp string for all packages.
But now after investigation, we found only for form packages need
to export the content of HiiDatabase and the ConfigResp string,
for other packages just need to export the content of HiiDatabase.
Now to enhance this logic.

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>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
6 years agoMdeModulePkg: BOOLEAN type needn't to compare to TRUE/FALSE explicitly
Dandan Bi [Tue, 26 Apr 2016 08:17:11 +0000 (16:17 +0800)]
MdeModulePkg: BOOLEAN type needn't to compare to TRUE/FALSE explicitly

Fix this issue to follow the coding style.

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: Qiu Shumin <shumin.qiu@intel.com>
6 years agoMdeModulePkg: Add description to MdeModulePkg AcpiTable driver.
Liming Gao [Mon, 18 Apr 2016 01:39:19 +0000 (09:39 +0800)]
MdeModulePkg: Add description to MdeModulePkg AcpiTable driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoNetworkPkg:HttpDxe:Consume DxeHttpLib API changes
Nagaraj Hegde [Mon, 4 Apr 2016 10:09:28 +0000 (18:09 +0800)]
NetworkPkg:HttpDxe:Consume DxeHttpLib API changes

HttpGenRequestString is updated to HttpGenRequestMessage,
with an additional argument. This patch updates the caller
of the DxeHttpLib API. Also, we will avoid adding any '\0'
to the string, which was added to make AsciiStrLen to
work on the string.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
6 years agoMdeModulePkg:DxeHttpLib: Update to DxeHttpLib API
Nagaraj Hegde [Mon, 4 Apr 2016 10:09:27 +0000 (18:09 +0800)]
MdeModulePkg:DxeHttpLib: Update to DxeHttpLib API

Rename and update the logic of HttpGenRequestString API provided
by DxeHttpLib. The RequestString size is returned as an argument.
The user is not expected to do a AsciiStrLen anymore, and is not
logical too, since request string can contain message body and
using AsciiStrLen on such a string can provide truncated lengths.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
6 years agoNetworkPkg: Allow user to create a HTTP corporate boot option in setup page.
Fu Siyuan [Mon, 25 Apr 2016 07:29:26 +0000 (15:29 +0800)]
NetworkPkg: Allow user to create a HTTP corporate boot option in setup page.

This patch updates the HTTP Boot Configuration page to allow the user to create
a corporate mode HTTP boot option, by leaving the URI string empty.
The patch also fix a bug that the L"https://" should use StrnCmp() with Length 8.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
6 years agoMdePkg:Http11.h: Add defines for "Expect" header
Nagaraj Hegde [Tue, 26 Apr 2016 03:46:45 +0000 (11:46 +0800)]
MdePkg:Http11.h: Add defines for "Expect" header

Add #defines for "Expect" header, which is a part of RFC 2616
and used for HTTP PUT/POST operations.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoBaseTools: Fix the bug for .aml to use ASL binary type in Asbuilt inf
Yonghong Zhu [Fri, 22 Apr 2016 07:08:47 +0000 (15:08 +0800)]
BaseTools: Fix the bug for .aml to use ASL binary type in Asbuilt inf

Per build spec, the .aml file should use ASL binary type in the Asbuilt
inf file. the original bug is .aml file may use BIN as binary type when
the module type is not BASE or USER_DEFINED. This patch 1) fix this bug.
2) fix some indent coding style issue.

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>
6 years agoBaseTools: Update FMP Capsule support to follow FDF spec
Yonghong Zhu [Thu, 21 Apr 2016 06:50:30 +0000 (14:50 +0800)]
BaseTools: Update FMP Capsule support to follow FDF spec

Current the FMP Capsule feature is supported, but its format has a little
different with FDF spec. so this patch 1) Align the FMP Capsule with FDF
spec. 2) fix some style issue, eg: Tab. 3) Add a SectionParser function to
check the section header info since this method is used in 7 places.

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>
6 years agoOvmfPkg: SataControllerDxe: SataControllerStop: fix use after free
Laszlo Ersek [Tue, 26 Apr 2016 11:57:32 +0000 (13:57 +0200)]
OvmfPkg: SataControllerDxe: SataControllerStop: fix use after free

It would be possible to remove the UAF without local variables, by calling
SataPrivateData->PciIo->Attributes() before releasing SataPrivateData.

However, by keeping the location of the call (for which temporary
variables are necessary), we continue to match the error path logic in
SataControllerStart(), which is always recommended.

Reported-by: wang xiaofeng <winggundum82@163.com>
Fixes: bcab71413407e61c144994925556725dd65eede9
Cc: wang xiaofeng <winggundum82@163.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoOvmfPkg: SataControllerDxe: SataControllerStop: remove useless null check
Laszlo Ersek [Tue, 26 Apr 2016 11:51:55 +0000 (13:51 +0200)]
OvmfPkg: SataControllerDxe: SataControllerStop: remove useless null check

"ASSERT (SataPrivateData != NULL)" is just a few lines higher up.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoMdeModulePkg DxeCore: Check free memory type by CoreUpdateProfile()
Star Zeng [Fri, 22 Apr 2016 06:31:10 +0000 (14:31 +0800)]
MdeModulePkg DxeCore: Check free memory type by CoreUpdateProfile()

It can improve profile performance, especially when
PcdMemoryProfileMemoryType configured without EfiBootServicesData.
CoreUpdateProfile() can return quickly, but not depend on the further
code to find the buffer not recorded and then return.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Feng Tian <feng.tian@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>
6 years agoMdeModulePkg/NvmExpress: Clean Phase/CqHdbl/SqTdbl fields to restart HC
Tian Feng [Tue, 24 Nov 2015 08:45:44 +0000 (16:45 +0800)]
MdeModulePkg/NvmExpress: Clean Phase/CqHdbl/SqTdbl fields to restart HC

Phase Tag, SqTdbl/CqHdbl and SqBuffer/CqBuffer should be cleared in
NvmeControllerInit() to make HC functionality work when user invokes
NvmeBlockIoReset().

Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
6 years agoMdeModulePkg/NvmExpress: Fix bug of handling not null-terminated strings
Feng Tian [Tue, 26 Apr 2016 07:16:26 +0000 (15:16 +0800)]
MdeModulePkg/NvmExpress: Fix bug of handling not null-terminated strings

In EnumerateNvmeDevNamespace(), when Private->ControllerData->Sn and/or
Private->ControllerData->Mn are NOT null-terminated strings,
UnicodeSPrintAsciiFormat(…) may generate unexpected (garbage) output
string.

Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/NvmExpress: Fix mem leak in error handling of Start()
Tian Feng [Tue, 24 Nov 2015 06:35:28 +0000 (14:35 +0800)]
MdeModulePkg/NvmExpress: Fix mem leak in error handling of Start()

Memory pointed to by Private->ControllerData has not been freed up
correctly at error handling path.

Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
6 years agoMdeModulePkg/EmmcDxe: Fix wrong coding style on close brace
Feng Tian [Fri, 15 Apr 2016 07:48:22 +0000 (15:48 +0800)]
MdeModulePkg/EmmcDxe: Fix wrong coding style on close brace

The close brace of EmmcDxeComponentNameGetControllerName should be
at the beginning of a line.

Cc: Qiu Shumin <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
6 years agoMdeModulePkg/EmmcDxe: Fix wrong typo on function comments
Feng Tian [Fri, 15 Apr 2016 07:45:20 +0000 (15:45 +0800)]
MdeModulePkg/EmmcDxe: Fix wrong typo on function comments

Cc: Qiu Shumin <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
6 years agoMdeModulePkg/Sd: Not explicitly compare BOOLEAN type with TRUE/FALSE
Feng Tian [Fri, 15 Apr 2016 07:43:31 +0000 (15:43 +0800)]
MdeModulePkg/Sd: Not explicitly compare BOOLEAN type with TRUE/FALSE

It's coding style update to follow EDKII coding style doc.

Cc: Qiu Shumin <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
6 years agoMdeModulePkg/MdeModulePkg.uni: Add SD related PCD description
Feng Tian [Fri, 1 Apr 2016 08:37:53 +0000 (16:37 +0800)]
MdeModulePkg/MdeModulePkg.uni: Add SD related PCD description

Cc: Shumin Qiu <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
6 years agoShellPkg: Fix Shell treats every .EFI file as an executable application.
Qiu Shumin [Mon, 25 Apr 2016 02:08:30 +0000 (10:08 +0800)]
ShellPkg: Fix Shell treats every .EFI file as an executable application.

UEFI Shell 2.x cannot recognize whether a .EFI file is an application or
a driver. This means when we typed in a driver image in Shell command
line, Shell will load the driver image and try to run the entry point
function of the driver.
This patch check the ImageCodeType to fix the issue.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
6 years agoBaseTools/UPT: UPT to Support UTF-8
Hess Chen [Fri, 22 Apr 2016 05:23:38 +0000 (13:23 +0800)]
BaseTools/UPT: UPT to Support UTF-8

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools/ECC: Remove UNI checkpoint from ECC
Hess Chen [Fri, 22 Apr 2016 05:18:42 +0000 (13:18 +0800)]
BaseTools/ECC: Remove UNI checkpoint from ECC

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoUpdate ECC to support more doxygen keywords
Hess Chen [Fri, 22 Apr 2016 04:50:23 +0000 (12:50 +0800)]
Update ECC to support more doxygen keywords

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoShellPkg: Enahance 'dh' command to add more protocols decoding support
Tapan Shah [Fri, 22 Apr 2016 16:32:26 +0000 (09:32 -0700)]
ShellPkg: Enahance 'dh' command to add more protocols decoding support

Adding EdidDiscovered, EdidActive protocol decode support a in 'dh' command.
Extending GraphicsOutput protocol decoding to list all supported GOP resolutions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>