]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
7 years agoMdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead of PCI_BAR_ALL
Ruiyu Ni [Wed, 25 Jan 2017 07:22:54 +0000 (15:22 +0800)]
MdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead of PCI_BAR_ALL

When BarIndex equals to 0xFF, default value 0 is used as the BAR
index. Though PCI_BAR_ALL and MAX_UINT8 shares the same value,
using PCI_BAR_ALL is like to match any BAR not BAR 0, it's more
proper to use MAX_UINT8 here.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoShellPkg SmbiosView: Correct some outputs for Type 0/3/10
Star Zeng [Thu, 9 Feb 2017 09:06:24 +0000 (17:06 +0800)]
ShellPkg SmbiosView: Correct some outputs for Type 0/3/10

Type 0: Update "EDD Enhanced Disk Driver)..." to
"EDD (Enhanced Disk Driver)..." for
STR_SMBIOSVIEW_PRINTINFO_EDD_ENHANCED_DRIVER

Type 3: Use L"  Laptop" instead of L"  LapTop" in
SystemEnclosureTypeTable to match SMBIOS spec.

Type 10: The BIT7 of Device Type is representing the
status of device whether it is enabled or disabled.
But current code is not considering the BIT7 and will
print "Undefined Value" for enabled device. Type 41
has same definition of Device Type, the code is
correct and will be applied to Type 10 by this patch.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg SmbiosView: Eliminate trailing " | " in PrintBitsInfo()
Star Zeng [Wed, 18 Jan 2017 08:53:33 +0000 (16:53 +0800)]
ShellPkg SmbiosView: Eliminate trailing " | " in PrintBitsInfo()

Current PrintBitsInfo() will always print an additional trailing
" | " for the bit flags, for example,

Base Board Feature Flags: Hosting board |  Replaceable |

Th patch is to eliminate trailing " | " in PrintBitsInfo(), then
the output will be like below

Base Board Feature Flags: Hosting board |  Replaceable

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoMdeModulePkg PiSmmIpl: Update SmmCommunication comments to match code logic
Liming Gao [Thu, 9 Feb 2017 07:03:18 +0000 (15:03 +0800)]
MdeModulePkg PiSmmIpl: Update SmmCommunication comments to match code logic

Cc: Star Zeng <star.zeng@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg PeiCore: Don't cache GUIDED section with AUTH_NOT_TESTED
Liming Gao [Sat, 4 Feb 2017 06:41:50 +0000 (14:41 +0800)]
MdeModulePkg PeiCore: Don't cache GUIDED section with AUTH_NOT_TESTED

If GUIDED section authentication has EFI_AUTH_STATUS_NOT_TESTED, its
matched extraction ppi may not be installed. So, don't cache its data.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg PeiCore: Reset PeimNeedingDispatch when its security violation
Liming Gao [Sat, 4 Feb 2017 06:36:40 +0000 (14:36 +0800)]
MdeModulePkg PeiCore: Reset PeimNeedingDispatch when its security violation

When PEIM is security violation, its matched extraction ppi may not be
installed. So, its PeimNeedingDispatch will still reset to TRUE.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoOvmfPkg/QemuBootOrderLib: Fix NOOPT build failure
Dandan Bi [Wed, 8 Feb 2017 05:39:40 +0000 (13:39 +0800)]
OvmfPkg/QemuBootOrderLib: Fix NOOPT build failure

This patch is to fix the IA32/NOOPT/VS Toolchain build failure.
The VS2015 failure log as below:
QemuBootOrderLib.lib(ExtraRootBusMap.obj) :
error LNK2001: unresolved external symbol __allmul
s:\..\Build\OvmfIa32\NOOPT_VS2015\IA32\MdeModulePkg\
Universal\BdsDxe\BdsDxe\DEBUG\BdsDxe.dll :
fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077:
'"C:\Program Files\Microsoft Visual Studio 14.0\Vc\bin\link.exe"' :
return code '0x460'
Stop.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoSignedCapsulePkg/EdkiiSystemCapsuleLib: Fix logic error.
Jiewen Yao [Tue, 7 Feb 2017 06:32:49 +0000 (22:32 -0800)]
SignedCapsulePkg/EdkiiSystemCapsuleLib: Fix logic error.

This patch fixes https://bugzilla.tianocore.org/show_bug.cgi?id=367

Cc: Wang Cloud <winggundum82@163.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Wang Cloud <winggundum82@163.com>
7 years agoNetworkPkg/NetworkPkg.uni: Define the prompt and help information for PcdAllowHttpCon...
Jiaxin Wu [Wed, 8 Feb 2017 04:56:54 +0000 (12:56 +0800)]
NetworkPkg/NetworkPkg.uni: Define the prompt and help information for PcdAllowHttpConnections

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoMdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength
Jiaxin Wu [Wed, 8 Feb 2017 03:56:54 +0000 (11:56 +0800)]
MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength

Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to
return the correct status for the HTTP Port/ContentLength.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoSecurityPkg HashLibRouter: Avoid incorrect PcdTcg2HashAlgorithmBitmap
Star Zeng [Tue, 17 Jan 2017 09:58:26 +0000 (17:58 +0800)]
SecurityPkg HashLibRouter: Avoid incorrect PcdTcg2HashAlgorithmBitmap

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=244

Currently, when software HashLib (HashLibBaseCryptoRouter) and related
HashInstanceLib instances are used, PcdTcg2HashAlgorithmBitmap is
expected to be configured to 0 in platform dsc.
But PcdTcg2HashAlgorithmBitmap has default value 0xFFFFFFFF in
SecurityPkg.dec, and some platforms forget to configure it to 0 or
still configure it to 0xFFFFFFFF in platform dsc, that will make final
PcdTcg2HashAlgorithmBitmap value incorrect.

This patch is to add CONSTRUCTOR in HashLib (HashLibBaseCryptoRouter)
and PcdTcg2HashAlgorithmBitmap will be set to 0 in the CONSTRUCTOR.

Current HASH_LIB_PEI_ROUTER_GUID HOB created in
HashLibBaseCryptoRouterPei is shared between modules that link
HashLibBaseCryptoRouterPei.
To avoid mutual interference, separated HASH_LIB_PEI_ROUTER_GUID HOBs
with gEfiCallerIdGuid Identifier will be created for those modules.

This patch is also to add check in HashLib (HashLibBaseCryptoRouter)
for the mismatch of supported HashMask between modules that may link
different HashInstanceLib instances, warning will be reported if
mismatch is found.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoMdeModulePkg/UefiBootManagerLib: Initialize Handle before using it
Ruiyu Ni [Mon, 6 Feb 2017 02:00:33 +0000 (10:00 +0800)]
MdeModulePkg/UefiBootManagerLib: Initialize Handle before using it

BmExpandMediaDevicePath contains a bug that it uses the
uninitialized Handle.

Since the function is called when the Handle supports BlockIo
or SimpleFileSystem, when there is no SimpleFileSystem installed
on the Handle, BlockIo is *guaranteed* to be installed on the Handle.
The fix initializes the Handle by locating the BlockIo protocol
from the device path.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoVlv2DeviceRefCodePkg: Fixed thermal issue.
lushifex [Wed, 8 Feb 2017 02:42:35 +0000 (10:42 +0800)]
Vlv2DeviceRefCodePkg: Fixed thermal issue.

Fixed System auto shutdown when it reached minus 20 degree.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoEdkCompatibilityPkg: Fix some typos of "according"
Liming Gao [Wed, 8 Feb 2017 06:49:21 +0000 (14:49 +0800)]
EdkCompatibilityPkg: Fix some typos of "according"

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Rebecca Cran <rebecca@bluestop.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: He Junjie <junjie.he@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoNetworkPkg: Fix some typos of "according"
Liming Gao [Wed, 8 Feb 2017 06:48:44 +0000 (14:48 +0800)]
NetworkPkg: Fix some typos of "according"

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Rebecca Cran <rebecca@bluestop.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: He Junjie <junjie.he@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoMdeModulePkg: Fix some typos of "according"
Liming Gao [Wed, 8 Feb 2017 06:48:02 +0000 (14:48 +0800)]
MdeModulePkg: Fix some typos of "according"

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Rebecca Cran <rebecca@bluestop.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: He Junjie <junjie.he@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoBaseTools: Fix the bug to parse the short varname in map file
Yonghong Zhu [Tue, 7 Feb 2017 08:05:13 +0000 (16:05 +0800)]
BaseTools: Fix the bug to parse the short varname in map file

current in the map file, there have two ways for var to save its offset,
if the varname is short, then the offset will in the same line with
varname, otherwise, it saved in the next line.

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 agoOvmfPkg/SmmControl2Dxe: select broadcast SMI if available
Laszlo Ersek [Wed, 30 Nov 2016 19:06:34 +0000 (20:06 +0100)]
OvmfPkg/SmmControl2Dxe: select broadcast SMI if available

When writing to IO port 0xB2 (ICH9_APM_CNT), QEMU by default injects an
SMI only on the VCPU that is writing the port. This has exposed corner
cases and strange behavior with edk2 code, which generally expects a
software SMI to affect all CPUs at once. We've experienced instability
despite the fact that OVMF sets PcdCpuSmmApSyncTimeout and
PcdCpuSmmSyncMode differently from the UefiCpuPkg defaults, such that they
match QEMU's unicast SMIs better. (Refer to edk2 commits 9b1e378811ff and
bb0f18b0bce6.)

Using the new fw_cfg-based SMI feature negotiation in QEMU (see commits
50de920b372b "hw/isa/lpc_ich9: add SMI feature negotiation via fw_cfg" and
5ce45c7a2b15 "hw/isa/lpc_ich9: add broadcast SMI feature"), we can ask
QEMU to broadcast SMIs. Extensive testing from earlier proves that
broadcast SMIs are only reliable if we use the UefiCpuPkg defaults for the
above PCDs. With those settings however, the broadcast is very reliable --
the most reliable configuration encountered thus far.

Therefore negotiate broadcast SMIs with QEMU, and if the negotiation is
successful, dynamically revert the PCDs to the UefiCpuPkg defaults.

Setting the PCDs in this module is safe:

- only PiSmmCpuDxeSmm consumes them,

- PiSmmCpuDxeSmm is a DXE_SMM_DRIVER, launched by the SMM_CORE
  (MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf),

- the SMM_CORE is launched by the SMM IPL runtime DXE driver
  (MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf),

- the SMM IPL has a DEPEX on EFI_SMM_CONTROL2_PROTOCOL,

- OvmfPkg/SmmControl2Dxe produces that protocol.

The end result is that PiSmmCpuDxeSmm cannot be dispatched before
SmmControl2Dxe installs EFI_SMM_CONTROL2_PROTOCOL and returns from its
entry point. Hence we can set the PCD's consumed by PiSmmCpuDxeSmm in
SmmControl2Dxe.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=230
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoOvmfPkg: dynamic defaults for PcdCpuSmmApSyncTimeout, PcdCpuSmmSyncMode
Laszlo Ersek [Thu, 17 Nov 2016 21:21:35 +0000 (22:21 +0100)]
OvmfPkg: dynamic defaults for PcdCpuSmmApSyncTimeout, PcdCpuSmmSyncMode

Move the platform-specific default values for these PCDs from the
[PcdsFixedAtBuild] / [PcdsFixedAtBuild.X64] sections to the
[PcdsDynamicDefault] section.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=230
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoArmPkg/GenericWatchdogDxe: Declare MMIO PCDs as UINT64
Alexei [Mon, 6 Feb 2017 19:05:54 +0000 (19:05 +0000)]
ArmPkg/GenericWatchdogDxe: Declare MMIO PCDs as UINT64

PcdGenericWatchdogControlBase & PcdGenericWatchdogRefreshBase
are declared as UINT32 values in ArmPkg.dec, but for platforms
with addresses in the memory range above 4GB this causes build
error F000: Too large PCD value for datum type [UINT32]
of PCD gArmTokenSpaceGuid.PcdGenericWatchdogControlBase

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Alexei Fedorov <alexei.fedorov@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=361
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoBaseTools: Update top VS Makefile with the absolute path
Liming Gao [Fri, 3 Feb 2017 06:49:47 +0000 (14:49 +0800)]
BaseTools: Update top VS Makefile with the absolute path

After this update, BaseTools/Makefile can be trig at the other directory.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoMdePkg: UefiTcgPlatform.h: Add TCG_PCR_EVENT2_HDR definition
Zhang, Chao B [Sat, 4 Feb 2017 01:19:00 +0000 (09:19 +0800)]
MdePkg: UefiTcgPlatform.h: Add TCG_PCR_EVENT2_HDR definition

Add TCG_PCR_EVENT2_HDR definition.
Follow TCG EFI Spec 2.0 00.13 Section 5.2 Crypto Agile Log Entry Format
https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf
Cc: Long Qin <qin.long@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
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>
7 years agoSecurityPkg: Tcg2Dxe: Log EV_NO_ACTION event in TCG_PCR_EVENT2 format
Zhang, Chao B [Sat, 4 Feb 2017 01:17:19 +0000 (09:17 +0800)]
SecurityPkg: Tcg2Dxe: Log EV_NO_ACTION event in TCG_PCR_EVENT2 format

All the event log entry in TCG2 Event log format should be TCG_PCR_EVENT2
except event log header. Defined by TCG EFI Spec 2.0 00.13
https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf

Cc: Long Qin <qin.long@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
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>
7 years agoShellPkg/cd: Do not print the destination dir when CD exits
Ruiyu Ni [Thu, 26 Jan 2017 04:32:33 +0000 (12:32 +0800)]
ShellPkg/cd: Do not print the destination dir when CD exits

Before the "cd fs0:dir" fix, CD only prints destination directory
when the destination contains ":".
However, the "cd fs0:dir" fix changed CD to always print destination
directory.

This patch changes CD to never print destination directory.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Cc: Chris J Phillips <chrisp@hpe.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoArmVirtPkg/QemuFwCfgLib: implement QemuFwCfgSkipBytes() API
Laszlo Ersek [Fri, 27 Jan 2017 07:10:15 +0000 (08:10 +0100)]
ArmVirtPkg/QemuFwCfgLib: implement QemuFwCfgSkipBytes() API

We are now sufficiently equipped to implement the new QemuFwCfgSkipBytes()
API.

The previous patch and this one enable ArmVirtPkg/QemuFwCfgLib to
overwrite part of a writeable fw_cfg file, which will be particularly
useful for the upcoming QEMU_LOADER_WRITE_POINTER command in
OvmfPkg/AcpiPlatformDxe.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoArmVirtPkg/QemuFwCfgLib: use DMA for QemuFwCfgWriteBytes() if available
Laszlo Ersek [Fri, 27 Jan 2017 06:29:12 +0000 (07:29 +0100)]
ArmVirtPkg/QemuFwCfgLib: use DMA for QemuFwCfgWriteBytes() if available

We use the "InternalQemuFwCfgReadBytes" static function pointer to
dispatch the reading of fw_cfg bytes between MMIO and DMA. This pointer is
initialized to MMIO, and we set it to DMA in the library constructor if
DMA is available.

Unlike the above, we write fw_cfg bytes only with MMIO at the moment.
Extend the write functionality so that it follows the read pattern:
- introduce the new function typedef WRITE_BYTES_FUNCTION,
- extract the current (MMIO-only) write internals from
  QemuFwCfgWriteBytes() to MmioWriteBytes(),
- provide a DMA-based implementation in DmaWriteBytes() -- a thin wrapper
  around DmaTransferBytes(),
- set the new static function pointer "InternalQemuFwCfgWriteBytes"
  according to the DMA feature provided by QEMU,
- In QemuFwCfgWriteBytes(), call the best available method through
  "InternalQemuFwCfgWriteBytes".

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoArmVirtPkg/QemuFwCfgLib: extract generic DmaTransferBytes() function
Laszlo Ersek [Fri, 27 Jan 2017 05:56:19 +0000 (06:56 +0100)]
ArmVirtPkg/QemuFwCfgLib: extract generic DmaTransferBytes() function

The DmaReadBytes() function that we currently use only for reading --
through the InternalQemuFwCfgReadBytes function pointer, in case the DMA
interface is available -- is suitable with minimal changes for two more
operations provided by the DMA interface, WRITE and SKIP. Expose the
Control parameter in the function prototype, rename the function to
DmaTransferBytes(), and rebase DmaReadBytes() to it.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoOvmfPkg/QemuFwCfgLib: add QemuFwCfgSkipBytes()
Laszlo Ersek [Fri, 27 Jan 2017 05:35:41 +0000 (06:35 +0100)]
OvmfPkg/QemuFwCfgLib: add QemuFwCfgSkipBytes()

Introduce the new public API QemuFwCfgSkipBytes(), for advancing over
bytes in the selected firmware configuration item without transferring
data between the item and the caller.

When the DMA interface is available (the common case), the operation is
instantaneous. As a fallback, provide a loop of chunked reads into a small
stack-allocated scratch buffer.

This patch enables OvmfPkg/QemuFwCfgLib to overwrite part of a writeable
fw_cfg file, which will be particularly useful for the upcoming
QEMU_LOADER_WRITE_POINTER command in OvmfPkg/AcpiPlatformDxe.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoOvmfPkg/QemuFwCfgLib: generalize InternalQemuFwCfgDmaBytes() to SKIP op
Laszlo Ersek [Fri, 27 Jan 2017 04:49:03 +0000 (05:49 +0100)]
OvmfPkg/QemuFwCfgLib: generalize InternalQemuFwCfgDmaBytes() to SKIP op

The fw_cfg DMA interface provides a simple method to skip over bytes in an
fw_cfg blob before reading or writing more bytes.
InternalQemuFwCfgDmaBytes() can support it easily, we just have to expose
the Control parameter more flexibly than the current "Write" BOOLEAN.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoArmPlatformPkg/TZASC: Allow specifying subregions to be disabled
Bhupesh Sharma [Fri, 20 Jan 2017 11:40:45 +0000 (17:10 +0530)]
ArmPlatformPkg/TZASC: Allow specifying subregions to be disabled

ARM TZASC-380 IP provides a mechanism to split memory regions being
protected via it into eight equal-sized sub-regions. A bit-setting
allows the corresponding subregion to be disabled.

Several NXP/FSL SoCs support the TZASC-380 IP block and allow
the DDR connected via the TZASC to be partitioned into regions
having different security settings and also allow subregions
to be disabled.

This patch enables this support and can be used for SoCs which
support such a partition of DDR regions.

Details of the 'subregion_disable' register can be viewed here:
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0431c/CHDIGDCI.html

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@nxp.com>
[bhupesh.linux@gmail.com : Added gmail ID as NXP one is no longer valid]
Signed-off-by: Bhupesh Sharma <bhupesh.linux@gmail.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoSecurityPkg: Tcg2Dxe: Update PCR[4] measure logic
Zhang, Chao B [Wed, 25 Jan 2017 04:50:55 +0000 (12:50 +0800)]
SecurityPkg: Tcg2Dxe: Update PCR[4] measure logic

Update PCR[4] measure logic for each boot attempt.
1. Measure event to PCR[4] instead of PCR[5]
2. Measure “Calling UEFI Application from Boot Option”
http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoSecurityPkg/Tpm12CommandLib: Always check response returnCode
Michael Kinney [Tue, 10 Jan 2017 16:46:20 +0000 (08:46 -0800)]
SecurityPkg/Tpm12CommandLib: Always check response returnCode

https://bugzilla.tianocore.org/show_bug.cgi?id=338

Update the Tpm12CommandLib to consistently check the returnCode
field of a response packet.  These checks are missing from the
GetCapability and SelfTest commands.  The functions
Tpm12ContinueSelfTest(), Tpm12GetCapabilityFlagPermanent(), and
Tpm12GetCapabilityFlagVolatile() are updated to verify that the
response returnCode is not an error.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe: Fixed crash on Juno R0
Daniil Egranov [Tue, 24 Jan 2017 02:01:06 +0000 (20:01 -0600)]
ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe: Fixed crash on Juno R0

The Marvell Yukon MAC address load supported only on Juno R1 and R2.
It disabled for Juno R0 due to PCI issues on this board.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daniil Egranov <daniil.egranov@arm.com>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoShellPkg/pci: Fix extended register dumping for MFVC capability
Ruiyu Ni [Tue, 24 Jan 2017 06:40:30 +0000 (14:40 +0800)]
ShellPkg/pci: Fix extended register dumping for MFVC capability

https://bugzilla.tianocore.org/show_bug.cgi?id=355

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg/pci: Support interpreting specific PCIE ext cap thru "-ec"
Ruiyu Ni [Mon, 23 Jan 2017 10:49:33 +0000 (18:49 +0800)]
ShellPkg/pci: Support interpreting specific PCIE ext cap thru "-ec"

The implementation was already there but through a private flag
"-_e". The patch removes "-_e" support and add "-ec" support.
Removing old "-_e" support makes the pci command more clean.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg/pci: Use PCI definitions defined in MdePkg
Ruiyu Ni [Mon, 23 Jan 2017 10:43:26 +0000 (18:43 +0800)]
ShellPkg/pci: Use PCI definitions defined in MdePkg

https://bugzilla.tianocore.org/show_bug.cgi?id=354

The patch removes the local PCI definitions and uses the definitions
defined in MdePkg/Include/IndustryStandard folder.
There is no functionality impact.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jarben.carsey@intel.com>
7 years agoSecurityPkg: Tcg2Dxe: Use UEFI_VARIABLE_DATA
Zhang, Chao B [Tue, 24 Jan 2017 07:31:23 +0000 (15:31 +0800)]
SecurityPkg: Tcg2Dxe: Use UEFI_VARIABLE_DATA

Use UEFI_VARIABLE_DATA data structure according to TCG PC-Client PFP Spec
00.21.
http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoMdeModulePkg: VariableDxe: Use UEFI_VARIABLE_DATA
Zhang, Chao B [Tue, 24 Jan 2017 07:29:54 +0000 (15:29 +0800)]
MdeModulePkg: VariableDxe: Use UEFI_VARIABLE_DATA

Use UEFI_VARIABLE_DATA data structure according to TCG PC-Client PFP Spec
00.21.
http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoMdePkg: UefiTcgPlatform.h: Add UEFI_VARIABLE_DATA
Zhang, Chao B [Tue, 24 Jan 2017 07:28:01 +0000 (15:28 +0800)]
MdePkg: UefiTcgPlatform.h: Add UEFI_VARIABLE_DATA

Add UEFI_VARIABLE_DATA according to TCG PC-Client PFP Spec 00.21.
http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoShellPkg SmbiosView: Add decoding of SMBIOS spec 3.1.1
Star Zeng [Sun, 22 Jan 2017 06:50:23 +0000 (14:50 +0800)]
ShellPkg SmbiosView: Add decoding of SMBIOS spec 3.1.1

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=349

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoMdeModulePkg: Update PcdSmbiosDocRev to 0x1 for SMBIOS spec 3.1.1
Star Zeng [Sun, 22 Jan 2017 06:26:13 +0000 (14:26 +0800)]
MdeModulePkg: Update PcdSmbiosDocRev to 0x1 for SMBIOS spec 3.1.1

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=349

Cc: Feng Tian <feng.tian@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: Feng Tian <feng.tian@intel.com>
7 years agoMdePkg: Add definitions for SMBIOS spec 3.1.1
Star Zeng [Sun, 22 Jan 2017 06:24:51 +0000 (14:24 +0800)]
MdePkg: Add definitions for SMBIOS spec 3.1.1

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=349

This patch is to add definitions for below items.
Processor Information (Type 4):
- add socket SP3r2
- add AMD Zen Processor Family
Management Controller Host Interface (Type 42):
- include Host Interface Type and Protocol Identifier enumerations

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoOvmfPkg/QemuVideoDxe: Frame buffer config size may change in new mode
Ruiyu Ni [Mon, 23 Jan 2017 06:07:42 +0000 (14:07 +0800)]
OvmfPkg/QemuVideoDxe: Frame buffer config size may change in new mode

https://bugzilla.tianocore.org/show_bug.cgi?id=339

The patch removes the assumption in QemuVideoDxe driver that it
wrongly assumes the frame buffer configure size is the same in
different video modes.
The assumption is true in old FrameBufferBltLib but is false in
new implementation.

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 agoMdeModulePkg/FrameBufferBltLib: Use dynamic allocated line buffer
Ruiyu Ni [Wed, 11 Jan 2017 07:16:39 +0000 (15:16 +0800)]
MdeModulePkg/FrameBufferBltLib: Use dynamic allocated line buffer

https://bugzilla.tianocore.org/show_bug.cgi?id=339

The patch uses dynamic allocated line buffer to reduce memory usage
of frame buffer configure. (Original implementation uses 0x4000
bytes for line buffer.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/FrameBufferBltLib: Refine ConfigurePixelBitMaskFormat
Ruiyu Ni [Wed, 11 Jan 2017 07:06:25 +0000 (15:06 +0800)]
MdeModulePkg/FrameBufferBltLib: Refine ConfigurePixelBitMaskFormat

https://bugzilla.tianocore.org/show_bug.cgi?id=339
The patch refines ConfigurePixelBitMaskFormat() to prepare the
enhancement in next commit: Enhance this library to use dynamic
allocated line buffer to reduce memory usage of frame buffer
configure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdePkg : UefiTcgPlatform.h: Define Startup Locality Event & Indicator
Zhang, Chao B [Sun, 22 Jan 2017 04:48:03 +0000 (12:48 +0800)]
MdePkg : UefiTcgPlatform.h: Define Startup Locality Event & Indicator

Add Startup Locality Event definition according to PC Client PFP 00.21
http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf
Add Locality Indicator definition according to PC Client PTP 00.43
https://www.trustedcomputinggroup.org/wp-content/uploads/PC-Client-Specific-Platform-TPM-Profile-for-TPM-2-0-v43-150126.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoSecurityPkg: Tcg2Dxe: Log Startup Locality Event
Zhang, Chao B [Sun, 22 Jan 2017 04:47:51 +0000 (12:47 +0800)]
SecurityPkg: Tcg2Dxe: Log Startup Locality Event

Log Startup Locality Event according to TCG PC Client PFP 00.21.
Event should be placed before any extend to PCR[0]
http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoBaseTools: Convert incomplete expression with dangling while()
Nikolai SAOUKH [Sun, 22 Jan 2017 03:27:18 +0000 (11:27 +0800)]
BaseTools: Convert incomplete expression with dangling while()

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nikolai SAOUKH <nms@otdel-1.org>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools: Extend the Macro used in the FDF !include statement
Yonghong Zhu [Sun, 22 Jan 2017 01:59:32 +0000 (09:59 +0800)]
BaseTools: Extend the Macro used in the FDF !include statement

Current it only support the system environment variables in the !include
statement, $(WORKSPACE), $(PACKAGES_PATH), $(EFI_SOURCE), $(EDK_SOURCE),
$(ECP_SOURCE), this patch extend the usage to support the Global macros
and the macro which defined before the statement.

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: Fix protocol handler service in HttpDxe.
Zhang, Lubo [Sun, 22 Jan 2017 01:40:30 +0000 (09:40 +0800)]
NetworkPkg: Fix protocol handler service in HttpDxe.

When we create a HTTP driver service binding private
instance, there may be different DriverBindingHandle
for Ipv4 or Ipv6, so it is essential to distinguish
the HttpService image which will be used in open
protocol or close protocol.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Sriram Subramanian <sriram-s@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoNetworkPkg: Remove superfluous return statement.
Thomas Huth [Thu, 19 Jan 2017 09:37:31 +0000 (17:37 +0800)]
NetworkPkg: Remove superfluous return statement.

If the code eventually returns "Status" anyway, it does not make
sense to explicitely return "Status" in case of an error, too.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoOvmfPkg: Allow HTTP connections if HTTP Boot enabled
Jiaxin Wu [Thu, 19 Jan 2017 03:53:08 +0000 (11:53 +0800)]
OvmfPkg: Allow HTTP connections if HTTP Boot enabled

v2
* Move the setting above the "!ifndef $(USE_OLD_SHELL)" part.
* Un-indent the setting to column zero.
(Comments from Laszlo)

Overwrite the value of PcdAllowHttpConnections to allow HTTP
connections if HTTP Boot enabled (-D HTTP_BOOT_ENABLE).

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Justen Jordan L <jordan.l.justen@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Gary Lin <glin@suse.com>
Tested-by: Gary Lin <glin@suse.com>
7 years agoNt32Pkg.dsc: Add flag to control HTTP connections
Jiaxin Wu [Fri, 6 Jan 2017 03:55:47 +0000 (11:55 +0800)]
Nt32Pkg.dsc: Add flag to control HTTP connections

v3:
* Correct the commits grammar

v2:
* Rename the flag.

This flag is to overwrite the value of PcdAllowHttpConnections,
then the platform can make a decision whether to allow HTTP
connections or not.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Gary Lin <glin@suse.com>
7 years agoNetworkPkg: Add PCD to enable the HTTP connections switch
Jiaxin Wu [Fri, 6 Jan 2017 03:53:57 +0000 (11:53 +0800)]
NetworkPkg: Add PCD to enable the HTTP connections switch

v3:
* Correct the commits grammar

v2:
* Rename the PCD to PcdAllowHttpConnections.
* Refine the PCD descriptions.

If the value of PcdAllowHttpConnections is TRUE, HTTP connections are
allowed. Both the "https://" and "http://" URI schemes are permitted.
Otherwise, HTTP connections are denied. Only the "https://" URI scheme
is permitted.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Gary Lin <glin@suse.com>
Tested-by: Gary Lin <glin@suse.com>
7 years agoNt32Pkg FDF: Move StatusCode Handler run earlier in DXE phase
Liming Gao [Fri, 20 Jan 2017 09:28:34 +0000 (17:28 +0800)]
Nt32Pkg FDF: Move StatusCode Handler run earlier in DXE phase

Add StatusCode Handler into APRIORI DXE so that they can run early, then
more DEBUG message can print.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg: Variable: Update PCR[7] measure for new TCG spec
Zhang, Chao B [Wed, 18 Jan 2017 03:32:47 +0000 (11:32 +0800)]
MdeModulePkg: Variable: Update PCR[7] measure for new TCG spec

Measure DBT into PCR[7] when it is updated between initial measure and
ExitBootService. Measure "SecureBoot" change after PK update.
Spec version : TCG PC Client PFP 00.37. http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoSecurityPkg: Tcg2Dxe: Measure DBT into PCR[7]
Zhang, Chao B [Wed, 18 Jan 2017 03:28:54 +0000 (11:28 +0800)]
SecurityPkg: Tcg2Dxe: Measure DBT into PCR[7]

Measure DBT into PCR[7] in initial measurement phase according
to TCG PC Client PFP 00.37. http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoSecurityPkg: DxeImageVerificationLib: Update PCR[7] measure logic
Zhang, Chao B [Wed, 18 Jan 2017 03:27:19 +0000 (11:27 +0800)]
SecurityPkg: DxeImageVerificationLib: Update PCR[7] measure logic

Update PCR[7] measure logic according to TCG PC Client PFP 00.37.
Only entries in DB that is used for image authentication need to be
measured.
http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoShellPkg SmbiosView: Add decoding of SMBIOS spec 3.1.0
Star Zeng [Thu, 12 Jan 2017 09:20:01 +0000 (17:20 +0800)]
ShellPkg SmbiosView: Add decoding of SMBIOS spec 3.1.0

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=340

The decoding of TPM Device (Type 43) has been added at
e9f0be021b7649c15d823e193110c0088cda9a89.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoMdeModulePkg: Update PcdSmbiosVersion to 0x0301 for SMBIOS spec 3.1.0
Star Zeng [Tue, 17 Jan 2017 02:01:26 +0000 (10:01 +0800)]
MdeModulePkg: Update PcdSmbiosVersion to 0x0301 for SMBIOS spec 3.1.0

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=340

Cc: Feng Tian <feng.tian@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: Feng Tian <feng.tian@intel.com>
7 years agoMdePkg: Add definitions for SMBIOS spec 3.1.0
Star Zeng [Thu, 12 Jan 2017 08:21:45 +0000 (16:21 +0800)]
MdePkg: Add definitions for SMBIOS spec 3.1.0

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=340

TPM Device (Type 43) definition has been added at
713e4b007cb791829397522ad8f366dd1e08bee6.

This patch is to add definitions for below items.
• BIOS Information (Type 0):
– Add new entry for extended BIOS ROM size
• System Enclosure or Chassis (Type 3):
– Add new chassis types: IoT Gateway and Embedded PC
– Add new chassis types: Mini PC and Stick PC
• Processor Information (Type 4):
– Add Intel Core m3 m5 m7 processors
– Add processor socket AM4
– Add processor socket LGA1151
– Add processor socket BGA1356, BGA1440, BGA1515
– Add AMD Opteron A-Series processor
– Add processor socket LGA3647-1
– Add processor socket SP3 Processors
– Add families for ARMv7 and ARMv8
– Add family for AMD Opteron(TM) X3000 Series APU
• Cache Information (Type 7):
– Extend to support Cache sizes >2047 MB
• System Slots (Type 9):
– Add Mini PCIe support

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmPkg/ArmMmuLib: Revert "use a pool allocation for the root table"
Ard Biesheuvel [Fri, 20 Jan 2017 16:44:35 +0000 (16:44 +0000)]
ArmPkg/ArmMmuLib: Revert "use a pool allocation for the root table"

This reverts commit d32702d2c2aa23e828363a7f88829b78ce36c3af.

Using a pool allocation for the root translation table seemed like
a good idea at the time, but as it turns out, such allocations are
handled in a way that makes them unsuitable for this purpose: they
are backed by HOBs that don't remain in the same place during the
various PI phase changes, which means the address programmed into
the TTBR register is no longer valid, and may refer to memory that
is reported as available to the OS.

So switch back to using a page based allocation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmLib: remove indirection layer from timer register accessors
Ard Biesheuvel [Fri, 20 Jan 2017 11:58:37 +0000 (11:58 +0000)]
ArmPkg/ArmLib: remove indirection layer from timer register accessors

The generic timer support libraries call the actual system register
accessor function via a single pair of functions ArmArchTimerReadReg()
and ArmArchTimerWriteReg(), which take an enum argument to identify
the register, and return output values by pointer reference.

Since these functions are never called with a non-immediate argument,
we can simply replace each invocation with the underlying system register
accessor instead. This is mostly functionally equivalent, with the
exception of the bounds check for the enum (which is pointless given the
fact that we never pass a variable), the check for the presence of the
architected timer (which only makes sense for ARMv7, but is highly unlikely
to vary between platforms that are similar enough to run the same firmware
image), and a check for enum values that refer to the HYP view of the timer,
which we never referred to anywhere in the code in the first place.

So get rid of the middle man, and update the ArmGenericTimerPhyCounterLib
and ArmGenericTimerVirtCounterLib implementations to call the system
register accessors directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
7 years agoArmPlatformPkg/NorFlashDxe: Change Flash memory attributes before writes
Achin Gupta [Fri, 20 Jan 2017 11:54:59 +0000 (11:54 +0000)]
ArmPlatformPkg/NorFlashDxe: Change Flash memory attributes before writes

In NorFlashFvbInitialize() if a valid Firmware Volume header is not found at the
start of NOR Flash, the Flash memory is written before it has been remapped with
EFI_MEMORY_UC attributes to allow write commands. Since the flash memory was
previously mapped with Normal and possibly cacheable memory attributes, the
Flash commands might never reach the device.

This patch fixes this issue by remapping the Flash memory region with correct
memory attributes before writing to it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoArmPlatformPkg: Use EfiEventGroupSignal from UefiLib
Star Zeng [Tue, 17 Jan 2017 06:12:51 +0000 (14:12 +0800)]
ArmPlatformPkg: Use EfiEventGroupSignal from UefiLib

Use EfiEventGroupSignal from UefiLib and remove
EmptyCallbackFunction.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoCorebootPayloadPkg: Use EfiEventGroupSignal from UefiLib
Star Zeng [Tue, 17 Jan 2017 06:11:17 +0000 (14:11 +0800)]
CorebootPayloadPkg: Use EfiEventGroupSignal from UefiLib

Use EfiEventGroupSignal from UefiLib and remove
InternalBdsEmptyCallbackFuntion.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
7 years agoIntelFrameworkModulePkg: Use EfiEventEmptyFunction from UefiLib
Star Zeng [Tue, 17 Jan 2017 06:11:05 +0000 (14:11 +0800)]
IntelFrameworkModulePkg: Use EfiEventEmptyFunction from UefiLib

Use EfiEventEmptyFunction from UefiLib and remove the duplication
of event empty function.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoMdeModulePkg: Use EfiEventEmptyFunction from UefiLib
Star Zeng [Tue, 17 Jan 2017 05:50:17 +0000 (13:50 +0800)]
MdeModulePkg: Use EfiEventEmptyFunction from UefiLib

Use EfiEventEmptyFunction from UefiLib and remove the duplication
of event empty function.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298

Cc: Feng Tian <feng.tian@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.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>
7 years agoIntelFrameworkPkg UefiLib: Make the event empty function public
Star Zeng [Tue, 17 Jan 2017 05:27:35 +0000 (13:27 +0800)]
IntelFrameworkPkg UefiLib: Make the event empty function public

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298

Then this event empty function can be used to remove
the duplication in drivers and other libraries.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoMdePkg UefiLib: Make the event empty function public
Star Zeng [Tue, 17 Jan 2017 05:26:18 +0000 (13:26 +0800)]
MdePkg UefiLib: Make the event empty function public

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298

Then this event empty function can be used to remove
the duplication in drivers and other libraries.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg: Avoid Non-Boolean type used as Boolean
Dandan Bi [Thu, 19 Jan 2017 08:53:41 +0000 (16:53 +0800)]
MdePkg: Avoid Non-Boolean type used as Boolean

Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Leo Duran <leo.duran@amd.com>
Cc: Liming Gao <liming.gao@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 agoMdePkg DxeHobLib: Make GetHobList working before Constructor is called
Star Zeng [Mon, 16 Jan 2017 08:07:53 +0000 (16:07 +0800)]
MdePkg DxeHobLib: Make GetHobList working before Constructor is called

The latest PiSmmCore driver added several debug messages in the
function SmmAddMemoryRegion in Page.c. The function SmmAddMemoryRegion
is called by the library constructor
PiSmmCoreMemoryAllocationLibConstructor.

When PiSmmCoreMemoryAllocationLibConstructor is executed, the
constructor of DxeHobLib (HobLibConstructor in HobLib.c) is not
executed yet. But platform instance of DebugLib may need get hob
before printing any message. As a result, an ASSERT happens in the
function GetHobList.

The patch is to update GetHobList to get HOB list from system
configuration table when the HOB list is not retrieved and not cached
yet, and HobLibConstructor is also to be updated to just call
GetHobList.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg: Remove superfluous return statements
Thomas Huth [Thu, 19 Jan 2017 10:16:04 +0000 (18:16 +0800)]
MdeModulePkg: Remove superfluous return statements

If the code eventually returns "Status" anyway, it does not make
sense to explicitly return "Status" in case of an error, too.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg/UfsBlockIoPei: fix initialize OCS value to 0x0F
Haojian Zhuang [Mon, 16 Jan 2017 12:22:58 +0000 (20:22 +0800)]
MdeModulePkg/UfsBlockIoPei: fix initialize OCS value to 0x0F

The OCS value should be initiliazed as 0x0F according to UFS spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/UfsPassThruDxe: fix initialize OCS value to 0x0F
Haojian Zhuang [Mon, 16 Jan 2017 12:22:57 +0000 (20:22 +0800)]
MdeModulePkg/UfsPassThruDxe: fix initialize OCS value to 0x0F

The OCS value should be initiliazed as 0x0F according to UFS spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/UfsBlockIoPei: fix the bit in UFS_HC_UTRLDBR_OFFSET reg
Haojian Zhuang [Mon, 16 Jan 2017 12:22:56 +0000 (20:22 +0800)]
MdeModulePkg/UfsBlockIoPei: fix the bit in UFS_HC_UTRLDBR_OFFSET reg

When UPIU packet is sent, (BIT0 << Slot) should be set according
to context.  But BIT0 is used without Slot when UfsWaitMemSet ()
is invoked.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/UfsPassThruDxe: fix the bit in UFS_HC_UTRLDBR_OFFSET reg
Haojian Zhuang [Mon, 16 Jan 2017 12:22:55 +0000 (20:22 +0800)]
MdeModulePkg/UfsPassThruDxe: fix the bit in UFS_HC_UTRLDBR_OFFSET reg

When UPIU packet is sent, (BIT0 << Slot) should be set according
to context.  But BIT0 is used without Slot when UfsWaitMemSet ()
is invoked.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModuelPkg/UfsPassThruDxe: fix to identify 32 bits address mode
Haojian Zhuang [Mon, 16 Jan 2017 12:22:54 +0000 (20:22 +0800)]
MdeModuelPkg/UfsPassThruDxe: fix to identify 32 bits address mode

When UFS_HC_CAP_64ADDR bit is set, it means 64-bit address,
not 32-bit address.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoPcAtChipsetPkg: Fix typing errors
Thomas Huth [Wed, 18 Jan 2017 13:40:15 +0000 (21:40 +0800)]
PcAtChipsetPkg: Fix typing errors

Correct the reported by the codespell utility in some files
of PcAtChipsetPkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoOvmfPkg: Remove superfluous return statements.
Thomas Huth [Thu, 19 Jan 2017 09:17:37 +0000 (10:17 +0100)]
OvmfPkg: Remove superfluous return statements.

If the code eventually returns "Status" anyway, it does not make
sense to explicitely return "Status" in case of an error, too.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoShellPkg: Add check logic for the gateway validity.
Zhang Lubo [Fri, 6 Jan 2017 09:15:27 +0000 (17:15 +0800)]
ShellPkg: Add check logic for the gateway validity.

if we set a static IP using command
'ifconfig -s eth0 static 192.168.0.121 255.255.255.0 0.0.0.0'
The system says 'Failed to set address.' but using
'ifconfig -l', the static IP can be assigned successfully.
so we need to check the gateway validity before setting manual
address to keep the ifconfig -s command more consistent.

Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Santhapur Naveen <naveens@amiindia.co.in>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoNetworkPkg: Add dns support for target URL configuration in ISCSI.
Zhang Lubo [Thu, 8 Dec 2016 11:26:24 +0000 (19:26 +0800)]
NetworkPkg: Add dns support for target URL configuration in ISCSI.

v2:
*1. Add IScsiDnsIsConfigured function in IScsiSupported to check
attempt using DNS protocol or not.2. Fix wrongs typos in IScsiDns.c
and .uni file.3. define a macro for the length of target URL.4.
update the Copyright to 2017.

Add DNS support for target URL directly configuration in UI.

Besides, When we enable the option (Get target info via DHCP) ,
the dhcp server will return target info include the  rootpath,
like the format
"iscsi:"<servername>":"<protocol>":"<port>":"<LUN>":"<targetname>
According to the RFC 4173,the server name region is expressed as
IPv4(192.168.10.20 )or IPv6 ([2000:bbbb::3]) or domain name,
but currently we only support the IP address format.
To enable this feature, we can support both.

Another enhancement is that we can deal with the data received from
the iSCSI login response with an target redirection status,
in which contains the Target Address in the format
domainname[:port][,portal-group-tag] required by RFC 3720.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoMdeModulePkg/FileExplorer: Enable functionality of creating new file/folder
Dandan Bi [Thu, 12 Jan 2017 12:25:40 +0000 (20:25 +0800)]
MdeModulePkg/FileExplorer: Enable functionality of creating new file/folder

https://bugzilla.tianocore.org/show_bug.cgi?id=324

Enhance the FileExplorerlib so that user can create a new file/folder
through the UI page.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
7 years agoMdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore form
Dandan Bi [Thu, 12 Jan 2017 10:49:40 +0000 (18:49 +0800)]
MdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore form

https://bugzilla.tianocore.org/show_bug.cgi?id=342

When user select and enter a directory, File Explorer will update the
form based on the new folders and files in the directory. But when
creating question opcodes, the question id is same with previous one
and this will cause browser to show the highlight menu incorrectly.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
7 years agoMdeModulePkg/FileExplorer: Remove the codes of searching load file protocol
Dandan Bi [Tue, 10 Jan 2017 05:17:28 +0000 (13:17 +0800)]
MdeModulePkg/FileExplorer: Remove the codes of searching load file protocol

https://bugzilla.tianocore.org/show_bug.cgi?id=323

FileExplorer no need to search load file protocol to show files.
Now remove the codes.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
7 years agoShellPkg/HandleParsingLib: Fix coding style issue
Dandan Bi [Mon, 16 Jan 2017 01:58:47 +0000 (09:58 +0800)]
ShellPkg/HandleParsingLib: Fix coding style issue

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg SmbiosView: Add missing decoding of SMBIOS spec 3.0.0
Star Zeng [Thu, 12 Jan 2017 10:21:29 +0000 (18:21 +0800)]
ShellPkg SmbiosView: Add missing decoding of SMBIOS spec 3.0.0

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=345

When I am adding SMBIOS spec 3.1.0 support, I found the decoding
of SMBIOS spec 3.0.0 for some definitions is missing.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg SmbiosView: Add missing decoding of SlotType AGP8X
Star Zeng [Fri, 13 Jan 2017 08:14:54 +0000 (16:14 +0800)]
ShellPkg SmbiosView: Add missing decoding of SlotType AGP8X

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=344

SlotType AGP8X was added in SMBIOS spec 2.3.4, but the decoding
of it is missing. I found it when I am adding SMBIOS spec 3.1.0
support.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoMdePkg: Correct comments of macros FixedPcdGetX/PatchPcdXXX in PcdLib.h
Star Zeng [Tue, 17 Jan 2017 03:41:57 +0000 (11:41 +0800)]
MdePkg: Correct comments of macros FixedPcdGetX/PatchPcdXXX in PcdLib.h

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=311

The patch is also to refine comments of macros PcdToken and PcdTokenEx.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoNetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler
Gary Lin [Mon, 16 Jan 2017 06:30:10 +0000 (14:30 +0800)]
NetworkPkg/TlsAuthConfigDxe: Declare EFIAPI for the ChooseFile handler

The ChooseFile handler, UpdateCAFromFile, has to be EFIAPI or gcc would
use the wrong ABI and cause the crash of the firmware. This commit also
removes the unnecessary type casting in ChooseFile.

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
7 years agoOvmfPkg: pull in TLS modules with -D TLS_ENABLE (also enabling HTTPS)
Gary Lin [Tue, 17 Jan 2017 04:52:32 +0000 (12:52 +0800)]
OvmfPkg: pull in TLS modules with -D TLS_ENABLE (also enabling HTTPS)

This commit introduces a new build option, TLS_ENABLE, to pull in the
TLS-related modules. If HTTP_BOOT_ENABLE and TLS_ENABLE are enabled at
the same time, the HTTP driver locates the TLS protocols automatically
and thus HTTPS is enabled.

To build OVMF with HTTP Boot:

$ ./build.sh -D HTTP_BOOT_ENABLE

To build OVMF with HTTPS Boot:

$ ./build.sh -D HTTP_BOOT_ENABLE -D TLS_ENABLE

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Justen Jordan L <jordan.l.justen@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Long Qin <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg: correct the IScsiDxe module included for the IPv6 stack
Gary Lin [Tue, 17 Jan 2017 04:52:31 +0000 (12:52 +0800)]
OvmfPkg: correct the IScsiDxe module included for the IPv6 stack

Always use IScsiDxe from NetworkPkg when IPv6 is enabled since it provides
the complete ISCSI support.

NOTE: This makes OpenSSL a hard requirement when NETWORK_IP6_ENABLE is
      true.

(Based on Jiaxin's suggestion)

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Justen Jordan L <jordan.l.justen@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Long Qin <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: update subject line]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg: always resolve OpenSslLib, IntrinsicLib and BaseCryptLib
Gary Lin [Tue, 17 Jan 2017 04:52:30 +0000 (12:52 +0800)]
OvmfPkg: always resolve OpenSslLib, IntrinsicLib and BaseCryptLib

This commit provides unconditional library resolutions for the OpenSslLib,
IntrinsicLib and BaseCryptLib classes, regardless of whether those classes
are actually used by any module.

Although those libraries depends on OpenSSL, they won't be built unless
a module really uses them. Thus, missing OpenSSL from the tree won't
cause any build failure as long as SECURE_BOOT_ENABLE is false.

(Based on Jiaxin's patch and Laszlo's suggestion)

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Justen Jordan L <jordan.l.justen@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Long Qin <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg: Modify QemuFwCfgLib to use new IoLib class library
Leo Duran [Fri, 13 Jan 2017 20:10:00 +0000 (04:10 +0800)]
OvmfPkg: Modify QemuFwCfgLib to use new IoLib class library

The Fifo routines from the QuemuFwCfgLib library have been ported
to the new BaseIoLibIntrinsic (IoLib class) library.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoIntelFrameworkPkg/DxeIoLibCpuIo: Add new Fifo routines in IoLib class
Leo Duran [Fri, 13 Jan 2017 20:09:59 +0000 (04:09 +0800)]
IntelFrameworkPkg/DxeIoLibCpuIo: Add new Fifo routines in IoLib class

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoMdePkg/SmmIoLibSmmCpuIo2: Add new Fifo routines in IoLib class
Leo Duran [Fri, 13 Jan 2017 20:09:58 +0000 (04:09 +0800)]
MdePkg/SmmIoLibSmmCpuIo2: Add new Fifo routines in IoLib class

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoMdePkg/DxeIoLibEsal: Add new Fifo routines in IoLib class
Leo Duran [Fri, 13 Jan 2017 20:09:57 +0000 (04:09 +0800)]
MdePkg/DxeIoLibEsal: Add new Fifo routines in IoLib class

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg/PeiIoLibCpuIo: Add new Fifo routines in IoLib class
Leo Duran [Fri, 13 Jan 2017 20:09:56 +0000 (04:09 +0800)]
MdePkg/PeiIoLibCpuIo: Add new Fifo routines in IoLib class

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoMdePkg/DxeIoLibCpuIo2: Add new Fifo routines in IoLib class
Leo Duran [Fri, 13 Jan 2017 20:09:55 +0000 (04:09 +0800)]
MdePkg/DxeIoLibCpuIo2: Add new Fifo routines in IoLib class

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoIntelFrameworkModulePkg: Modify CpuIoDxe to support new IoLib library
Leo Duran [Fri, 13 Jan 2017 20:09:54 +0000 (04:09 +0800)]
IntelFrameworkModulePkg: Modify CpuIoDxe to support new IoLib library

The IO_PROTOCOL supports Fifo types by invoking the Fifo routines in the
new BaseIoLibIntrinsic (IoLib class) library.

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>