]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoPcAtChipsetPkg: IdeControllerDxe: fix protocol usage hints in the INF file
Laszlo Ersek [Tue, 22 Sep 2015 11:18:36 +0000 (11:18 +0000)]
PcAtChipsetPkg: IdeControllerDxe: fix protocol usage hints in the INF file

IdeControllerDxe installs EFI_IDE_CONTROLLER_INIT_PROTOCOL interface(s),
and consumes PciIo. The comments in the INF file state the opposite at the
moment, fix them.

Cc: Alexander Graf <agraf@suse.de>
Cc: Reza Jelveh <reza.jelveh@tuhh.de>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18530 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: AtaAtapiPassThru: select master/slave around DIAG command
Reza Jelveh [Tue, 22 Sep 2015 11:18:31 +0000 (11:18 +0000)]
MdeModulePkg: AtaAtapiPassThru: select master/slave around DIAG command

Some IDE controllers only update ID fields such as sector information on
specific commands such as the DIAG command.

The master/slave device is therefore selected both before and after
sending the DIAG command; otherwise reading the IDE registers yields the
master's ID fields.

(Reza's patch originally *moved* the master/slave selection from after the
DIAG command before it, however Feng asked for the original master/slave
select to be preserved; effectively making the master/slave select
*bracket* the DIAG command. See this subthread:
<http://thread.gmane.org/gmane.comp.bios.tianocore.devel/10545/focus=10550>.)

Cc: Alexander Graf <agraf@suse.de>
Cc: Reza Jelveh <reza.jelveh@tuhh.de>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Reza Jelveh <reza.jelveh@tuhh.de>
[feng.tian@intel.com: see above]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
[lersek@redhat.com: updated commit message]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18529 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: SataControllerDxe: enable IO / mem access and DMA when binding
Laszlo Ersek [Tue, 22 Sep 2015 11:18:27 +0000 (11:18 +0000)]
OvmfPkg: SataControllerDxe: enable IO / mem access and DMA when binding

When we bind the SATA controller in SataControllerStart(), we read the NP
("Number of Ports") bitfield from the CAP ("HBA Capabilities") register of
the controller. (See the AHCI 1.3.1 spec.)

This register is memory mapped. If we'd like to access it, we must at
least enable memory space access for the device. In addition, Feng Tian
recommended enabling Bus Master DMA in
<http://thread.gmane.org/gmane.comp.bios.tianocore.devel/10545/focus=10659>.
We also enable IO space access for completeness.

Further, because we change the PCI attributes of the device with the above
when binding it, we must also restore its original PCI attributes when
unbinding it. See the Driver Writer's Guide for UEFI 2.3.1 v1.01, section
18.3 "PCI drivers" | 18.3.2 "Start() and Stop()".

(OvmfPkg's copy of SataControllerDxe differs from the same in DuetPkg
because Duet inherits a pre-configured SATA controller from the BIOS, as
explained by Feng. Technically, DuetPkg's SataControllerDxe could also
apply the technique seen in this patch.)

Cc: Alexander Graf <agraf@suse.de>
Cc: Reza Jelveh <reza.jelveh@tuhh.de>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
Cc: Feng Tian <feng.tian@intel.com>
Suggested-by: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18528 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: SataControllerDxe: add cascading error handling to Start()
Laszlo Ersek [Tue, 22 Sep 2015 11:18:22 +0000 (11:18 +0000)]
OvmfPkg: SataControllerDxe: add cascading error handling to Start()

In the next patch we'll add another PCI operation to
SataControllerStart(), which, on error, has to be rolled back similarly to
other actions already being done in SataControllerStart(). Since that PCI
operation won't provide a non-NULL pointer on success, its rollback isn't
really suitable for the current error handling in SataControllerStart().

Employ the traditional cascading labels instead.

Cc: Alexander Graf <agraf@suse.de>
Cc: Reza Jelveh <reza.jelveh@tuhh.de>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18527 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: copy SataControllerDxe from DuetPkg
Reza Jelveh [Tue, 22 Sep 2015 11:18:18 +0000 (11:18 +0000)]
OvmfPkg: copy SataControllerDxe from DuetPkg

Edk2 maintainers reached the consensus that SataControllerDxe was
inherently platform specific, for which reason it was not appropriate for
either PcAtChipsetPkg nor MdeModulePkg. Hence, if OvmfPkg wanted to use
it, it should either reference it directly from under DuetPkg, or copy it.

Given that DuetPkg is another "leaf" platform in edk2, and that in the
upcoming patches we'll actually modify the driver, the ultimate decision
(reached months ago on the list, after Reza's v2 posting) is that OvmfPkg
shall copy the driver.

This patch does that; the only difference being a fresh FILE_GUID in the
INF file.

Cc: Alexander Graf <agraf@suse.de>
Cc: Reza Jelveh <reza.jelveh@tuhh.de>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Reza Jelveh <reza.jelveh@tuhh.de>
[lersek@redhat.com: updated commit message, generated fresh FILE_GUID]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18526 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoDuetPkg: SataControllerDxe: fix private array subscripting
Laszlo Ersek [Tue, 22 Sep 2015 11:18:13 +0000 (11:18 +0000)]
DuetPkg: SataControllerDxe: fix private array subscripting

Each one of the DisqualifiedModes, IdentifyData and IdentifyValid arrays
in the EFI_SATA_CONTROLLER_PRIVATE_DATA structure is a matrix, represented
as a flat array.

The code currently uses the incorrect formula

  Channel * Device

to index them. The right formula is

  [Channel][Device]

which can be implemented as

  Channel * NumDevicePerChannel + Device

Add a helper function that does this, and replace the incorrect
subscripts.

Cc: Alexander Graf <agraf@suse.de>
Cc: Reza Jelveh <reza.jelveh@tuhh.de>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
Cc: Feng Tian <feng.tian@intel.com>
Reported-by: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18525 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoDuetPkg: SataControllerDxe: fix typo in "DisqulifiedModes"
Laszlo Ersek [Tue, 22 Sep 2015 11:18:09 +0000 (11:18 +0000)]
DuetPkg: SataControllerDxe: fix typo in "DisqulifiedModes"

Cc: Alexander Graf <agraf@suse.de>
Cc: Reza Jelveh <reza.jelveh@tuhh.de>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18524 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Fix typos in some EFI_HTTP_STATUS_CODE definitions
Samer El-Haj-Mahmoud [Mon, 21 Sep 2015 07:53:16 +0000 (07:53 +0000)]
NetworkPkg: Fix typos in some EFI_HTTP_STATUS_CODE definitions

Fix spelling typos in EFI_HTTP_STATUS_CODE definitions for error 415 and 501.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18521 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Http.h - Add HttpMethodMax to EFI_HTTP_METHOD.
Samer El-Haj-Mahmoud [Mon, 21 Sep 2015 07:53:00 +0000 (07:53 +0000)]
MdePkg: Http.h - Add HttpMethodMax to EFI_HTTP_METHOD.

Add HttpMethodMax enum value to EFI_HTTP_METHOD to make it easier to iterate
through the HTTP methods using a loop.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18520 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Add RngLib into MdePkg
Qin Long [Mon, 21 Sep 2015 05:54:03 +0000 (05:54 +0000)]
MdePkg: Add RngLib into MdePkg

Add one library class (RngLib.h) with three GetRandomNumber16/32/64
APIs to provide random number generator services, and one library
instance (BaseRngLib), based on Intel RdRand instruction access,
to provide high-quality random numbers generator.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18519 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Add CPU RdRand access APIs for random number generation
Qin Long [Mon, 21 Sep 2015 05:53:52 +0000 (05:53 +0000)]
MdePkg: Add CPU RdRand access APIs for random number generation

Add AsmRdRand16/32/64 APIs for RdRand instruction access to generate
high-quality random number.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18518 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Remove event from protocol database only if registered
Samer El-Haj-Mahmoud [Mon, 21 Sep 2015 01:53:34 +0000 (01:53 +0000)]
MdeModulePkg: Remove event from protocol database only if registered

In a CloseEvent, an UnregisterProtocolNotify is done unconditionally.
There is a penalty associated with searching the protocol database on
every CloseEvent and impacts performance, especially during Network IO.
Unregister needs to be done only if the Event is for a RegisterProtocolNotify.

So extend the ExFlag in IEVENT to a UINT8 and define new flags that can
be set to indicate if the Event is part of a group, or registered on a
protocol notify. Then in CloseEvent, call UnregisterProtocolNotify only
if the register protocol notify flag is set.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18517 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/Core/Dxe/Gcd: remove set but not used variables
Laszlo Ersek [Mon, 21 Sep 2015 00:50:32 +0000 (00:50 +0000)]
MdeModulePkg/Core/Dxe/Gcd: remove set but not used variables

These trip up compilation with gcc.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@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: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18515 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg/build.sh: Use GCC49 toolchain with GCC 5.*
Jordan Justen [Fri, 18 Sep 2015 19:16:30 +0000 (19:16 +0000)]
OvmfPkg/build.sh: Use GCC49 toolchain with GCC 5.*

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18514 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: PlatformIntelBdsLib: signal ReadyToBoot on direct kernel boot
Laszlo Ersek [Fri, 18 Sep 2015 13:58:35 +0000 (13:58 +0000)]
ArmVirtPkg: PlatformIntelBdsLib: signal ReadyToBoot on direct kernel boot

According to the UEFI spec, EFI_EVENT_GROUP_READY_TO_BOOT "is notified by
the system when the Boot Manager is about to load and execute a boot
option". ArmVirtPkg doesn't do this currently when launching a kernel from
the QEMU command line. OvmfPkg does (see git commit 28a34033ee).

At least two edk2-wide callbacks are worth mentioning:

- OnReadyToBoot() in
  "MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c" performs
  variable reclaim and (optionally) installs variable usage statistics as
  a vendor config table;

- OnReadyToBoot() in
  "SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c"
  installs the image execution info table if it doesn't exist yet, in
  SecureBoot-enabled builds.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18513 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellBinPkg: Ia32/X64 Shell binary update.
Qiu Shumin [Fri, 18 Sep 2015 05:51:14 +0000 (05:51 +0000)]
ShellBinPkg: Ia32/X64 Shell binary update.

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

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18511 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Added SMBIOS 2.8 Type 17 changes to smbiosview
Samer El-Haj-Mahmoud [Fri, 18 Sep 2015 02:58:31 +0000 (02:58 +0000)]
ShellPkg: Added SMBIOS 2.8 Type 17 changes to smbiosview

Updated smbiosview to decode SMBIOS Type 17 MinimumVoltage, MaximumVoltage, and ConfiguredVoltage

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18507 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Added SMBIOS 3.0 support in dmem.
Samer El-Haj-Mahmoud [Fri, 18 Sep 2015 02:53:06 +0000 (02:53 +0000)]
ShellPkg: Added SMBIOS 3.0 support in dmem.

Added SMBIOS 3.0 support in dmdem Shell command since SMBIOS 3.0 uses a different GUID in the System Configuration Table.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18506 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg DxeCore: Take the range in resource HOB for PHIT as higher priority
Star Zeng [Fri, 18 Sep 2015 02:02:11 +0000 (02:02 +0000)]
MdeModulePkg DxeCore: Take the range in resource HOB for PHIT as higher priority

Take the range in the resource descriptor HOB for the memory region described
by the PHIT as higher priority if it is big enough. It can make the memory bin
allocated to be at the same memory region with PHIT that has more better compatibility
to avoid memory fragmentation for some code practices assume and allocate <4G ACPI memory.

Also let the minimal memory size needed include the total memory bin size needed to
make sure memory bin could be allocated successfully.

Cc: Jiewen Yao <jiewen.yao@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: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18503 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Fix GCC build fail and code refine.
Qiu Shumin [Fri, 18 Sep 2015 01:08:31 +0000 (01:08 +0000)]
ShellPkg: Fix GCC build fail and code refine.

1. Fix GCC build fail.
2. It's not correct to cast away constness to allow TrimSpaces() to modify 'commandline'.
   This patch makes a copy of 'commandLine' and work with that in the remainder of the function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18500 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg DxeCore: Relocate HOB List after other tested memory resources added
Star Zeng [Thu, 17 Sep 2015 08:32:14 +0000 (08:32 +0000)]
MdeModulePkg DxeCore: Relocate HOB List after other tested memory resources added

The HOB List relocation should be at after all the tested memory resources added
(except the memory space that covers HOB List) to the memory services,
because the memory resource found in CoreInitializeMemoryServices()
may have not enough remaining resource for HOB List.

And the memory space that covers HOB List should be processed
after HOB List relocation to avoid the resources allocated by others
to corrupt HOB List before its relocation.

Cc: Jiewen Yao <jiewen.yao@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: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18499 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg:Fix the bug the incorrect change of StrCpyS function
Dandan Bi [Thu, 17 Sep 2015 07:21:22 +0000 (07:21 +0000)]
MdeModulePkg:Fix the bug the incorrect change of StrCpyS function

The pointer to the destination string changed,the max length also changed.Previous change neglect this point.
And base on the code logic,we can use StrCatS to replace StrCpyS.Now this patch is to fix this bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18497 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg/SmmServicesTableLib: Return TRUE in InSmm ()
Jeff Fan [Thu, 17 Sep 2015 04:59:59 +0000 (04:59 +0000)]
MdePkg/SmmServicesTableLib: Return TRUE in InSmm ()

SmmServicesTableLib instance only supports DXE_SMM_DRIVER type drivers that
will be loaded into SMM range. InSmm() could return TRUE directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.Yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18495 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Fix Shell fail when execute command in ShellProtocol.Execute().
Yang Jadis [Thu, 17 Sep 2015 01:42:59 +0000 (01:42 +0000)]
ShellPkg: Fix Shell fail when execute command in ShellProtocol.Execute().

When execute a command with tailing blank spaces in ShellProtocol.Execute() Shell will fail.
This patch move the TrimSpaces operation into ParseCommandLineToArgs function to fix the problem.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yang Jadis <jadis.yang@intel.com>
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18491 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/HiiDatabase: Refine KeywordHandlerProtocol->SetData().
Eric Dong [Thu, 17 Sep 2015 01:20:37 +0000 (01:20 +0000)]
MdeModulePkg/HiiDatabase: Refine KeywordHandlerProtocol->SetData().

Update this function to follow UEFI spec requirement.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18490 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/HiiDatabase: Refine KeywordHandlerProtocol->GetData().
Eric Dong [Thu, 17 Sep 2015 01:15:32 +0000 (01:15 +0000)]
MdeModulePkg/HiiDatabase: Refine KeywordHandlerProtocol->GetData().

Update this function to follow UEFI spec requirement.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18489 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/HiiDatabase: Fix Progress not point to the correct place issue.
Eric Dong [Thu, 17 Sep 2015 01:08:54 +0000 (01:08 +0000)]
MdeModulePkg/HiiDatabase: Fix Progress not point to the correct place issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18488 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Fix connection issue after correct SPD and re-enable IPsec
Jiaxin Wu [Wed, 16 Sep 2015 09:02:48 +0000 (09:02 +0000)]
NetworkPkg: Fix connection issue after correct SPD and re-enable IPsec

This patch is used to fix connection failure issue after correct the SPD
and re-enable IPsec. The driver should not update the SadEntry's SpdSelector
when doing SpdEntry modification. SadEntry's SpdSelector may not equal to
this edited SpdEntry’s Selector.

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: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18484 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: TrafficDirection not saved in IPsecConfig.
Fu Siyuan [Wed, 16 Sep 2015 08:52:43 +0000 (08:52 +0000)]
NetworkPkg: TrafficDirection not saved in IPsecConfig.

Fix a bug that the TrafficDirection field is not saved in IPsecConfig.SetData.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18483 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Enhance the NULL pointer check before dereference it.
Fu Siyuan [Wed, 16 Sep 2015 08:52:24 +0000 (08:52 +0000)]
NetworkPkg: Enhance the NULL pointer check before dereference it.

This patch enhances the NULL pointer check of the HttpInstance->RemoteHost
pointer before dereference it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18482 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Fix a command line unicode string type.
Samer El-Haj-Mahmoud [Wed, 16 Sep 2015 08:20:27 +0000 (08:20 +0000)]
ShellPkg: Fix a command line unicode string type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18480 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNt32Pkg: Fix PlatformBootManagerLib to respect PcdShellFile.
Ruiyu Ni [Wed, 16 Sep 2015 08:04:35 +0000 (08:04 +0000)]
Nt32Pkg: Fix PlatformBootManagerLib to respect PcdShellFile.

Fix the code to use PcdShellFile instead of using hard code GUID
which always points to new UEFI shell.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Jin <eric.jin@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18478 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSecurityPkg: Reduce verbosity of TPM DEBUG messages
Samer El-Haj-Mahmoud [Wed, 16 Sep 2015 00:53:28 +0000 (00:53 +0000)]
SecurityPkg: Reduce verbosity of TPM DEBUG messages

Some of the TPM/TPM2 DEBUG messages are at EFI_D_INFO level,
 even though they are simply tracing functions that run on every boot even
 if there is no TPM installed. Changed verbosity to EFI_D_VERBOSE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Samer El-Haj-Mahmoud" <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: "Jiewen Yao" <Jiewen.Yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18476 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Enhance PCI capability looking up logic to avoid hang
Ruiyu Ni [Tue, 15 Sep 2015 08:38:16 +0000 (08:38 +0000)]
MdeModulePkg: Enhance PCI capability looking up logic to avoid hang

Certain PCI device may have capability pointing to itself.
Update LocateCapabilityRegBlock() to break when detecting such loop.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18473 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: disable no-exec DXE stack by default
Laszlo Ersek [Tue, 15 Sep 2015 08:35:19 +0000 (08:35 +0000)]
OvmfPkg: disable no-exec DXE stack by default

(PcdSetNxForStack == TRUE) breaks a number of GRUB versions that, it turns
out, are still widely in use. Disable PcdSetNxForStack by default for now.
QEMU users can enable it dynamically using the micro-feature added in the
previous patch.

Reported-by: Anthony Perard <anthony.perard@citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18472 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: PlatformPei: take no-exec DXE settings from the QEMU command line
Laszlo Ersek [Tue, 15 Sep 2015 08:35:14 +0000 (08:35 +0000)]
OvmfPkg: PlatformPei: take no-exec DXE settings from the QEMU command line

Control them with:

  -fw_cfg name=opt/ovmf/PcdPropertiesTableEnable,file=no.txt \
  -fw_cfg name=opt/ovmf/PcdSetNxForStack,file=yes.txt

where the contents of the text files can be

  [0nN1yY](\n|\r\n)?

The macro trickery is not optimal, but it is caused by PcdSetBool(), which
is itself a macro, and can only take open-coded PCD names (ie. no
variables, like function parameters).

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>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18471 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: make PcdPropertiesTableEnable dynamic
Laszlo Ersek [Tue, 15 Sep 2015 08:35:08 +0000 (08:35 +0000)]
OvmfPkg: make PcdPropertiesTableEnable dynamic

Since PcdPropertiesTableEnable is used by the DXE Core (in the
InstallPropertiesTable() function, which runs at End-of-Dxe), we must also
change the PcdLib class resolution for that module, from the default
BasePcdLibNull to DxePcdLib.

Traditionally we've considered the DXE Core to be incapable of accessing
dynamic PCDs -- the PCD PPI is not available any longer to the DXE Core,
and the PCD Protocol is not available to it *yet*. There are exceptions
however: if the DXE Core can ensure, by whatever means, that the PCD
Protocol *is* available, then DxePcdLib will just work (the latter even
lists DXE_CORE as an allowed client module type). Namely, DxePcdLib looks
up the PCD Protocol dynamically, on the first library call that actually
needs it (for accessing a dynamic PCD); the lookup doesn't occur in a
library constructor.

And because the DXE Core fetches PcdPropertiesTableEnable at End-of-Dxe,
the PCD Protocol is definitely available then.

In addition, we change the default value of PcdPropertiesTableEnable from
the inherited TRUE to FALSE. It makes no difference at this point (our
runtime DXE drivers are not built with the required 4KB section alignment
anyway), but it's better to be clear about this. The properties table
feature requires OS compatibility, and it breaks Windows 7 minimally.
Therefore the default should be FALSE.

Cc: Jordan Justen <jordan.l.justen@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: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18470 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: make PcdSetNxForStack dynamic
Laszlo Ersek [Tue, 15 Sep 2015 08:35:03 +0000 (08:35 +0000)]
OvmfPkg: make PcdSetNxForStack dynamic

Plus, because PcdSetNxForStack is used by the DXE IPL PEIM (in the
HandOffToDxeCore() function, and in the CreateIdentityMappingPageTables()
function called by the former), we must change the PcdLib class resolution
for that module, from the default BasePcdLibNull to PeiPcdLib.

Cc: Jordan Justen <jordan.l.justen@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: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18469 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: PcdSetNxForStack: enable dynamism
Laszlo Ersek [Tue, 15 Sep 2015 08:34:57 +0000 (08:34 +0000)]
MdeModulePkg: PcdSetNxForStack: enable dynamism

Allow platforms to instantiate this PCD as PcdsDynamic and PcdsDynamicEx
too, not just PcdsFixedAtBuild and PcdsPatchableInModule.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18468 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg PiDxeS3BootScriptLib: Remove a hidden assumption.
Star Zeng [Tue, 15 Sep 2015 07:49:12 +0000 (07:49 +0000)]
MdeModulePkg PiDxeS3BootScriptLib: Remove a hidden assumption.

What to do:
1. Remove a hidden assumption "No SMM driver writes BootScript between
SmmReadyToLock and S3SleepEntryCallback".
 1.1. Use SmmExitBootServices and SmmLegacyBoot notification to record
      AtRuntime flag.
 1.2. Use mBootScriptDataBootTimeGuid LockBox to save boot time boot
      script data to handle potential INSERT boot script at runtime in SMM.
2. Do not depend on OS to help restore ACPINvs data and use
EfiReservedMemoryType instead of EfiACPIMemoryNVS.
 2.1. Use mBootScriptSmmPrivateDataGuid LockBox to save boot script
      SMM private data with BackFromS3 = TRUE at runtime. S3 resume
      will help restore it to tell the Library the system is back
      from S3.

Why to do:
1. The hidden assumption "No SMM driver writes BootScript between
SmmReadyToLock and S3SleepEntryCallback" will cause confusion to
the library's consumer and block the usage of "SMM driver writes
BootScript after SmmReadyToLock". So Remove the assumption.
2. In original code, there might be a corner case that malicious
code patch ACPINvs boot TableLength field same as SMM boot script.
So that it can skip the table restore. The impact is that BootScript
in SMM may be overridden by malicious code.
--------------------
    CopyMem ((VOID*)&TableHeader, (VOID*)mS3BootScriptTablePtr->TableBase, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER));
    if (mS3BootScriptTablePtr->TableLength + sizeof(EFI_BOOT_SCRIPT_TERMINATE) != TableHeader.TableLength) { // TableLength is in NVS
      ......
      //
      // NOTE: We should NOT use TableHeader.TableLength, because it is already updated to be whole length.
      //
      mS3BootScriptTablePtr->TableLength = (UINT32)(mLockBoxLength - sizeof(EFI_BOOT_SCRIPT_TERMINATE)); ? This line can be skipped.
--------------------
So use EfiReservedMemoryType instead of EfiACPIMemoryNVS as the code
has been updated to not depend on OS to help restore ACPINvs data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18467 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Rename some functions in Dp to avoid build errors.
Samer El-Haj-Mahmoud [Tue, 15 Sep 2015 04:54:06 +0000 (04:54 +0000)]
ShellPkg: Rename some functions in Dp to avoid build errors.

There are other libraries with similarly named functions that could be linked with the Shell

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18456 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Change the algorithm in SNP to use the first found BAR index.
Fu Siyuan [Tue, 15 Sep 2015 03:12:15 +0000 (03:12 +0000)]
MdeModulePkg: Change the algorithm in SNP to use the first found BAR index.

The driver binding start function in SNP.c goes through all the BARs and get
the last BAR index for use. Theoretically it should work with all valid BARs,
but we got reports some device did always use the first valid BAR, so we change
the logic in SNP to use the first found BAR index instead of the last one.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18455 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Update the help information for 'setvar' command to follow Shell behavior.
Qiu Shumin [Tue, 15 Sep 2015 01:08:59 +0000 (01:08 +0000)]
ShellPkg: Update the help information for 'setvar' command to follow Shell behavior.

Since Shell will remove the quotes in parameters, setvar cannot receive the quotes from ="ascii" or =L"unicode". User should add ^ to escape quotes in setvar data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18454 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Correct the missed code in r18449.
Fu Siyuan [Tue, 15 Sep 2015 00:59:37 +0000 (00:59 +0000)]
NetworkPkg: Correct the missed code in r18449.

The fix r18449 missed 1 line which will cause Http.Request() ASSERT. This patch
will correct this error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18453 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Fix Shell does not support ASCII pipe(|a).
Qiu Shumin [Tue, 15 Sep 2015 00:58:59 +0000 (00:58 +0000)]
ShellPkg: Fix Shell does not support ASCII pipe(|a).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18452 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Update Http driver to use DPC mechanism.
Fu Siyuan [Mon, 14 Sep 2015 09:06:26 +0000 (09:06 +0000)]
NetworkPkg: Update Http driver to use DPC mechanism.

This patch updates the HttpDxe driver to use the DPC mechanism to avoid long
time delay when single event.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18451 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: RxToken event not closed in Http.Response().
Fu Siyuan [Mon, 14 Sep 2015 09:06:02 +0000 (09:06 +0000)]
NetworkPkg: RxToken event not closed in Http.Response().

This patch contains a bug fix in HTTP driver that the RxToken is not closed,
this is one of the main reasons which lower the HTTP download speed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18450 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Avoid memory allocation for each HTTP message exchange.
Fu Siyuan [Mon, 14 Sep 2015 09:05:49 +0000 (09:05 +0000)]
NetworkPkg: Avoid memory allocation for each HTTP message exchange.

This patch updates the HTTP driver to use a shared buffer for URL parsing to
avoid memory allocation for each HTTP request.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18449 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Update cache management in HTTP boot driver.
Fu Siyuan [Mon, 14 Sep 2015 09:05:12 +0000 (09:05 +0000)]
NetworkPkg: Update cache management in HTTP boot driver.

The original HTTP boot driver always save the received message body in its cache,
it bring a large of memory allocation during HTTP download. This patch updates
the HTTP boot driver to only cache data when caller doesn't provide a buffer for
download (which is usually used when caller want to get the required buffer size).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18448 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Enlarge receive block size of HTTP boot driver.
Fu Siyuan [Mon, 14 Sep 2015 09:04:25 +0000 (09:04 +0000)]
NetworkPkg: Enlarge receive block size of HTTP boot driver.

HTTP boot driver uses block size of 1024 when receiving HTTP message body,
but typically the MTU of Ethernet is 1500 bytes so it makes 1 TCP segment data
split into 2 Http.Response call. This patch enlarges the block size to avoid
this issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18447 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools/Ecc: Remove checkpoint for STATIC modifier
Hess Chen [Mon, 14 Sep 2015 07:12:29 +0000 (07:12 +0000)]
BaseTools/Ecc: Remove checkpoint for STATIC modifier

1. Fix a bug of removing the checkpoint for STATIC modifier
2. Fix a bug of parsing CONST variable

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: YangX Li <yangx.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18446 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoedk2: Change BaseTools owner in Maintainers.txt
Liming Gao [Mon, 14 Sep 2015 05:52:36 +0000 (05:52 +0000)]
edk2: Change BaseTools owner in Maintainers.txt

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18445 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg:Refine the code comments in RegularExpressionDxe.
Dandan Bi [Fri, 11 Sep 2015 09:35:43 +0000 (09:35 +0000)]
MdeModulePkg:Refine the code comments in RegularExpressionDxe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18444 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools/GenFw: align RVA of debug
Ard Biesheuvel [Fri, 11 Sep 2015 07:07:06 +0000 (07:07 +0000)]
BaseTools/GenFw: align RVA of debug

SVN commit r18077 ("BaseTools/GenFw: move .debug contents to .data to
save space") removed the separate .debug section after moving its
contents into .text or .data. However, this change does not take into
account that some of these contents need to appear at a 32-bit aligned
offset. So align the debug data RVA to 32 bits.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18443 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: ScsiDiskDxe: adapt SectorCount when shortening transfers
Laszlo Ersek [Thu, 10 Sep 2015 11:25:09 +0000 (11:25 +0000)]
MdeModulePkg: ScsiDiskDxe: adapt SectorCount when shortening transfers

The specification of the EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru()
function documents the EFI_BAD_BUFFER_SIZE return status, and the
EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN host adapter
status.

These allow an EFI_EXT_SCSI_PASS_THRU_PROTOCOL implementation to request
higher layers in the stack (in this instance, UefiScsiLib and ScsiDiskDxe)
to break up the transfer into smaller pieces.

These conditions percolate up the stack correctly: the retry loops in
ScsiDiskDxe's ScsiDiskReadSectors() and ScsiDiskWriteSectors() functions
correctly and transparently update the transfer size (ByteCount),
accommodating any shortening requested by lower levels of the stack. After
the loop -- if the request ultimately succeeds -- SectorCount is even
recalculated from the final ByteCount, to see how many sectors the outer
loop should advance.

However, the inner (ie. retry) loops both have the same error: when the
underlying protocols request the transfer to be shortened, the decrease in
transfer size (ie. ByteCount) should immediately be reflected in
SectorCount. Otherwise the sector count encoded in the CDB will exceed the
transfer size, which is a permanent error.

This issue has been witnessed while booting

  en_windows_8.1_pro_n_vl_with_update_x86_dvd_6051127.iso

on the 32-bit build of OVMF, from a virtio-scsi CD-ROM:

(1) "cdboot.efi" correctly requested (from far atop) a long read:

    Timeout=940000000
    CdbLength=10
    DataDir=Read
    InTransferLength=134215680
    OutTransferLength=0
    SenseDataLength=108

    Cdb: 28 00 00 00 25 DD 00 FF FF 00
         ^     ^^^^^^^^^^^    ^^^^^
         |          |            |
         |          |     number of 2KB sectors to read,
         |          |     corresponding to 2048 * 65535 = 134215680 bytes
         |          |     (see InTransferLength above)
         |          |
         |   LBA to read from
         |
      READ (10)

(2) In turn, the EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru() function
    provided by "OvmfPkg/VirtioScsiDxe/VirtioScsi.c" asked for the request
    to be shortened:

    InTransferLength=16776704
    OutTransferLength=16776704
    SenseDataLength=0
    HostAdapterStatus=EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN
    TargetStatus=0
    Status=EFI_BAD_BUFFER_SIZE

(3) Then ScsiDiskReadSectors() in
    "MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c" retried the request
    with correctly shortened transfer length, but incorrectly unchanged
    sector count:

    Timeout=940000000
    CdbLength=10
    DataDir=Read
    InTransferLength=16776704 <--- updated as requested
    OutTransferLength=0
    SenseDataLength=108

    Cdb: 28 00 00 00 25 DD 00 FF FF 00
         ^     ^^^^^^^^^^^    ^^^^^
         |          |            |
         |          |       not changed!
         |          |
         |   LBA to read from
         |
      READ (10)

(4) Since 65535 sectors of 2KB each wouldn't fit in a buffer of approx.
    16MB, QEMU's virtio-scsi controller unconditionally rejected this
    request with VIRTIO_SCSI_S_OVERRUN, which VirtioScsiDxe then mapped
    to:

    InTransferLength=16776704
    OutTransferLength=0
    SenseDataLength=0
    HostAdapterStatus=EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN
    TargetStatus=0
    Status=EFI_DEVICE_ERROR

(5) After two more tries of the same, ScsiDiskDxe passed up the error,
    which ultimately caused "cdboot.efi" to BSOD.

Many thanks to Larry Cleeton from Microsoft for helping debug
"cdboot.efi".

Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18438 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: ScsiDiskDxe: recognize EFI_BAD_BUFFER_SIZE
Laszlo Ersek [Thu, 10 Sep 2015 11:25:02 +0000 (11:25 +0000)]
MdeModulePkg: ScsiDiskDxe: recognize EFI_BAD_BUFFER_SIZE

Acting specifically upon this error condition from UefiScsiLib (and
ultimately from EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru()) in the

- ScsiDiskRead10(),
- ScsiDiskWrite10(),
- ScsiDiskRead16(),
- ScsiDiskWrite16()

functions allows us to retry these operations from ScsiDiskReadSectors()
and ScsiDiskWriteSectors(), with adjusted transfer sizes, without
investigating further error details like Host Adapter Status, Target
Status, and Sense Data.

Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18437 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: PXE Driver's LoadFile protocol should check FilePath
Zhang Lubo [Thu, 10 Sep 2015 09:51:00 +0000 (09:51 +0000)]
NetworkPkg: PXE Driver's LoadFile protocol should check FilePath

PXE driver's LoadFile protocol should check the input parameter
FilePath to see whether it's a supported device path.If not,
it should return invalid parameter, do not continue PXE boot.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18436 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: PXE Driver's LoadFile protocol should check FilePath
Zhang Lubo [Thu, 10 Sep 2015 09:46:59 +0000 (09:46 +0000)]
MdeModulePkg: PXE Driver's LoadFile protocol should check FilePath

PXE driver's LoadFile protocol should check the input parameter
FilePath to see whether it's a supported device path.If not,
it should return invalid parameter, do not continue PXE boot.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18435 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg/UefiScsiLib: comments update to add EFI_INVALID_PARAMETER status
Feng Tian [Thu, 10 Sep 2015 07:02:12 +0000 (07:02 +0000)]
MdePkg/UefiScsiLib: comments update to add EFI_INVALID_PARAMETER status

EFI_SCSI_IO_PROTOCOL has alignment requirement on any data buffer
used in SCSI data transfer. As a wrap of this protocol, UefiScsiLib
have same request. Adding EFI_INVALID_PARAMETER return status in
function comments to ask the caller to guarantee this alignment.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18434 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Fix Shell fail with redundant space following delay number.
Qiu Shumin [Thu, 10 Sep 2015 03:08:56 +0000 (03:08 +0000)]
ShellPkg: Fix Shell fail with redundant space following delay number.

When boot from Shell we can use '-delay [num]' as optional data. If blank space exist after '[num]' Shell will fail. This patch add error handling to avoid this failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18431 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Refine UefiFileHandleLib to avoid write non-ASCII char into ASCII file.
Qiu Shumin [Thu, 10 Sep 2015 02:45:30 +0000 (02:45 +0000)]
MdePkg: Refine UefiFileHandleLib to avoid write non-ASCII char into ASCII file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18430 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg: ASSERT that PcdSystemMemoryBase does not exceed MAX_ADDRESS
Ard Biesheuvel [Wed, 9 Sep 2015 15:30:37 +0000 (15:30 +0000)]
ArmPlatformPkg: ASSERT that PcdSystemMemoryBase does not exceed MAX_ADDRESS

For 32-bit ARM platforms, it is essential that system memory starts
below the 4 GB limit, since that is the only memory we can address
using the UEFI spec mandated 1:1 mapping. So assert that this is the
case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18429 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: set max physical address width to 40 bits
Ard Biesheuvel [Wed, 9 Sep 2015 14:48:41 +0000 (14:48 +0000)]
ArmVirtPkg: set max physical address width to 40 bits

When executing on a LPAE capable 32-bit ARM platform, we support
up to 40 bits of physical address space so set PcdPrePiCpuMemorySize
accordingly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18428 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg/ArmVirtMemoryInitPeiLib: handle memory above 4 GB on 32-bit ARM
Ard Biesheuvel [Wed, 9 Sep 2015 14:48:33 +0000 (14:48 +0000)]
ArmVirtPkg/ArmVirtMemoryInitPeiLib: handle memory above 4 GB on 32-bit ARM

On 32-bit ARM, split system memory into a region below (and up to) 4 GB
and a region above 4 GB. This is necessary to get the DXE core to consider
the former as the resource descriptor that describes the primary memory
region that also covers the PHIT region.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18427 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/MemoryInitPeim: handle memory above 4 GB on 32-bit ARM
Ard Biesheuvel [Wed, 9 Sep 2015 14:48:25 +0000 (14:48 +0000)]
ArmPlatformPkg/MemoryInitPeim: handle memory above 4 GB on 32-bit ARM

Make sure that the PEI memory region is carved out of memory that is
32-bit addressable, by taking MAX_ADDRESS into account (which is
defined as '4 GB - 1' on ARM)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18426 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/Mmu: Fix potential page table memory leak
Heyi Guo [Wed, 9 Sep 2015 13:37:50 +0000 (13:37 +0000)]
ArmPkg/Mmu: Fix potential page table memory leak

During page entry attribute update, if there are table entries
between starting BlockEntry and LastBlockEntry, table entries will be
set as block entries and the allocated memory of the tables will be
leaked.

So instead, we break the inner loop when we find a table entry and run
outer loop again to step into the table by the same logic.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
[ardb: move termination condition check inside the loop]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18425 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/Mmu: Increase PageLevel when table found at the targeted level
Heyi Guo [Wed, 9 Sep 2015 13:37:41 +0000 (13:37 +0000)]
ArmPkg/Mmu: Increase PageLevel when table found at the targeted level

Below code has bug since *BlockEntrySize and *TableLevel are not
updated accordingly:

if (IndexLevel == PageLevel) {
  // And get the appropriate BlockEntry at the next level
  BlockEntry = (UINT64*)TT_GET_ENTRY_FOR_ADDRESS (TranslationTable, \
      IndexLevel + 1, RegionStart);

  // Set the last block for this new table
  *LastBlockEntry = TT_LAST_BLOCK_ADDRESS(TranslationTable, \
      TT_ENTRY_COUNT);
}

Also it doesn't check recursively to get the last level, e.g. the
initial PageLevel is 1 and we already have level 2 and 3 tables at
this address.

What's more, *LastBlockEntry was not updated when we get a table and
IndexLevel != PageLevel.

So we reorganize the sequence, only updating TranslationTable,
PageLevel and BlockEntry in the loop, and setting the other output
parameters with the final PageLevel before returning.

And LastBlockEntry is only an OUT parameter.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18424 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/Mmu: Fix literal number left shift bug
Heyi Guo [Wed, 9 Sep 2015 13:37:33 +0000 (13:37 +0000)]
ArmPkg/Mmu: Fix literal number left shift bug

There is a hidden bug for below code:

(1 << BaseAddressAlignment) & *BlockEntrySize

From disassembly code, we can see the literal number 1 will be treated
as INT32 by compiler by default, and we'll get 0xFFFFFFFF80000000 when
BaseAddressAlignment is equal to 31. So we will always get 31 when
alignment is larger than 31.

    if ((1 << BaseAddressAlignment) & *BlockEntrySize) {
5224: f9404be0  ldr x0, [sp,#144]
5228: 2a0003e1  mov w1, w0
522c: 52800020  mov w0, #0x1                    // #1
5230: 1ac12000  lsl w0, w0, w1
5234: 93407c01  sxtw  x1, w0

The bug can be replayed on QEMU AARCH64; by adding some debug print,
we can see lots of level 1 tables created (for block of 1GB) even
when the region is large enough to use 512GB block size.

Use LowBitSet64() in BaseLib instead to fix the bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18423 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/Mmu: Fix page level calculation bug
Heyi Guo [Wed, 9 Sep 2015 13:37:22 +0000 (13:37 +0000)]
ArmPkg/Mmu: Fix page level calculation bug

The bug can be triggered when alignment of Base is larger than Length
by 2 level of page granularity, e.g.

Base is 0x4000_0000, Length is 0x1000

The original code will change 2MB page level and we will get a
negative remaining length.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18422 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/Mmu: Fix bug of aligning new allocated page table
Heyi Guo [Wed, 9 Sep 2015 13:37:13 +0000 (13:37 +0000)]
ArmPkg/Mmu: Fix bug of aligning new allocated page table

The code has a simple bug on calculating aligned page table address.
We can just use AllocateAlignedPages in MemoryAllocationLib instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18421 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoFixed GCC tool chain build fail.
Cecil Sheng [Wed, 9 Sep 2015 06:29:14 +0000 (06:29 +0000)]
Fixed GCC tool chain build fail.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cecil Sheng <cecil.sheng@hpe.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18419 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNot support EBC arch for regular expression protocol driver.
Eric Dong [Wed, 9 Sep 2015 06:28:32 +0000 (06:28 +0000)]
Not support EBC arch for regular expression protocol driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18418 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Fix a performance data buffer overrun issue
Ruiyu Ni [Wed, 9 Sep 2015 05:43:44 +0000 (05:43 +0000)]
MdeModulePkg: Fix a performance data buffer overrun issue

The mBmPerfHeader.Count isn't reset to 0 in BmWriteBootToOsPerformanceData()
so when the actual performance data entry count exceeds the LimitCount,
the performance data collection breaks on condition
if (mBmPerfHeader.Count == LimitCount), but 2nd time calling this function
will not break on condition if (mBmPerfHeader.Count == LimitCount) because
the mBmPerfHeader.Count always bigger than LimitCount, which results buffer
overrun.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18417 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Fix 'for' command fail with multiple fields.
Qiu Shumin [Wed, 9 Sep 2015 04:57:05 +0000 (04:57 +0000)]
ShellPkg: Fix 'for' command fail with multiple fields.

When multiple fields are found in 'for' command return invalid parameters error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18416 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Correct Protocol usages in UefiDebugLibDebugPortProtocol
Liming Gao [Tue, 8 Sep 2015 08:28:56 +0000 (08:28 +0000)]
MdePkg: Correct Protocol usages in UefiDebugLibDebugPortProtocol

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18415 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Add UefiDebugLibDebugPortProtocol to output logs via DebugPort.
Masamitsu MURASE [Tue, 8 Sep 2015 08:28:23 +0000 (08:28 +0000)]
MdePkg: Add UefiDebugLibDebugPortProtocol to output logs via DebugPort.

UefiDebugLibDebugPortProtocol is an implementation of DebugLib.
It calls EFI_DEBUGPORT_PROTOCOL.Write in DebugPrint and DebugAssert.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Masamitsu MURASE <masamitsu.murase@gmail.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18414 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Regular expression protocol
Cecil Sheng [Tue, 8 Sep 2015 07:10:03 +0000 (07:10 +0000)]
MdeModulePkg: Regular expression protocol

Add driver to produce EFI_REGULAR_EXPRESSION_PROTOCOL.  Based on
Oniguruma v5.9.6 (BSD 2-clause license), which provides full Unicode
support, and POSIX ERE and Perl regex syntaxes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cecil Sheng <cecil.sheng@hpe.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18413 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoRollback the patch which has error changes.
Eric Dong [Tue, 8 Sep 2015 07:04:28 +0000 (07:04 +0000)]
Rollback the patch which has error changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18412 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Regular expression protocol
Cecil Sheng [Tue, 8 Sep 2015 06:49:47 +0000 (06:49 +0000)]
MdeModulePkg: Regular expression protocol

Add driver to produce EFI_REGULAR_EXPRESSION_PROTOCOL.  Based on
Oniguruma v5.9.6 (BSD 2-clause license), which provides full Unicode
support, and POSIX ERE and Perl regex syntaxes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cecil Sheng <cecil.sheng@hpe.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18411 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Fix suspicious dereference of pointer 'FieldCount'
Jiaxin Wu [Tue, 8 Sep 2015 02:01:05 +0000 (02:01 +0000)]
NetworkPkg: Fix suspicious dereference of pointer 'FieldCount'

This patch is used to fix suspicious dereference of pointer 'FieldCount'
before NULL check.

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: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18409 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoHandle extra module patchable PCD variable in Linux map.
Yao, Jiewen [Sun, 6 Sep 2015 22:36:43 +0000 (22:36 +0000)]
Handle extra module patchable PCD variable in Linux map.

Add comment for python function, too.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Mudusuru, Giri P" <giri.p.mudusuru@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18406 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoRevert the change in r18404.
Jeff Fan [Sun, 6 Sep 2015 08:58:25 +0000 (08:58 +0000)]
Revert the change in r18404.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18405 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUpdate BaseTools binary to match main trunk r18339.
Jeff Fan [Sun, 6 Sep 2015 08:52:50 +0000 (08:52 +0000)]
Update BaseTools binary to match main trunk r18339.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18404 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSecurityPkg: Use pointer instead of array to make code readable.
Qiu Shumin [Sun, 6 Sep 2015 06:22:24 +0000 (06:22 +0000)]
SecurityPkg: Use pointer instead of array to make code readable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18403 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Fix the HttpCloseConnection fail issue
Zhang Lubo [Sun, 6 Sep 2015 01:30:44 +0000 (01:30 +0000)]
NetworkPkg: Fix the HttpCloseConnection fail issue

When HTTP server is unavailable,HttpCloseConnection will enter
infinite loop to wait for TCP4->close Event return, So we need to
decide the Http Instance state whether in the appropriate state
before close it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18400 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: MtrrValidBitsMask and MtrrValidAddressMask wrong
Jeff Fan [Sat, 5 Sep 2015 02:07:02 +0000 (02:07 +0000)]
UefiCpuPkg/MtrrLib: MtrrValidBitsMask and MtrrValidAddressMask wrong

Per IA32 SDM, if CPUID.80000008H is not available, software may assume that the
processor supports a 36-bit physical address size.
However, for such old processors (For example, Quark processor),
MtrrValidBitsMask and MtrrValidAddressMask values are reverted and wrong in
MtrrLib. MtrrValidBitsMask should be 0xFFFFFFFFFULL and MtrrValidAddressMask
should be 0xFFFFFF000ULL.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18396 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/HdLcd: add missing LcdIdentify()
Ard Biesheuvel [Fri, 4 Sep 2015 10:02:43 +0000 (10:02 +0000)]
ArmPlatformPkg/HdLcd: add missing LcdIdentify()

Commit r18308 ("ArmPlatformPkg/LcdGraphicsOutputDxe: check PrimeCell ID
before initializing") introduced a LcdIdentify() function to the PL111
LCD driver that makes it fail gracefully when executed on hardware that
does not have the IP. However, the LcdGraphicsOutputDxe driver is shared
with the HdLcd driver, which now fails to build due to the fact that it
has no LcdIdentity() function. So add a dummy implementation that always
returns EFI_SUCCESS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18395 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg: signal EndOfDxe event in PlatformBsdInit
Ard Biesheuvel [Fri, 4 Sep 2015 06:11:42 +0000 (06:11 +0000)]
ArmPlatformPkg: signal EndOfDxe event in PlatformBsdInit

Like the ArmVirtPkg platforms up until SVN r17713, the ArmPlatformPkg
platforms built with the Intel BDS fail to signal the end-of-DXE event
'gEfiEndOfDxeEventGroupGuid' when entering the BDS phase, which results
in some loss of functionality, i.e., variable reclaim in the VariableDxe
drivers, and the splitting of the memory regions that is part of the recently
added UEFI 2.5 properties table feature.

As discussed on the edk2-devel mailing list here:

http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16088/focus=16109

it is up to the platform BDS to signal that event, since there may be
platform specific ordering constraints with respect to the signalling
of the event that are difficult to honor at the generic level.

So add the SignalEvent () call to PlatformBdsInit () of ArmPlatformPkg's
PlatformBdsLib implementation for the Intel BDS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18394 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: PlatformPei: force 32-bit MMIO aperture above 3 GB on Q35
Laszlo Ersek [Wed, 2 Sep 2015 18:45:44 +0000 (18:45 +0000)]
OvmfPkg: PlatformPei: force 32-bit MMIO aperture above 3 GB on Q35

The logic we have in place for i440fx does not work reliably on q35. For
example, if the guest has 2GB of RAM, we allow the PCI root bridge driver
to allocate the legacy video RAM BAR from the [2048 MB, 2816 MB] range,
which falls strictly outside of the Q35 PCI host MMIO aperture that QEMU
configures, and advertizes in ACPI.

In turn, PCI BARs that exist outside of the PCI host aperture that is
exposed in ACPI break Windows guests.

Allocating PCI MMIO resources at or above 3GB on Q35 ensures that we stay
within QEMU's aperture. (See the "w32.begin" assignments in
"hw/pci-host/q35.c".) Furthermore, in pc_q35_init() (file
"hw/i386/pc_q35.c"), QEMU ensures that the low RAM never "leaks" above
3GB.

The i440fx logic is left unchanged.

The Windows guest malfunction on Q35 was reported by Jon Panozzo of Lime
Technology, Inc.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Jon Panozzo <jonp@lime-technology.com>
Cc: "Gabriel L. Somlo" <somlo@cmu.edu>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jonathan Panozzo <jonp@lime-technology.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18393 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: AcpiTables: serialize control methods that create named objects
Laszlo Ersek [Wed, 2 Sep 2015 18:45:40 +0000 (18:45 +0000)]
OvmfPkg: AcpiTables: serialize control methods that create named objects

Bruce Cran reported the following issue:

  With iasl version 20150410-64 building OvmfX64 (using OvmfPkg/build.sh
  -a X64 -t GCC49 -b RELEASE) results in a couple of warnings about
  methods that should be serialized:

  .../OvmfPkg/AcpiTables/AcpiTables/OUTPUT/./Dsdt.iiii
  95:       Method (_CRS, 0) {
  Remark   2120 - Control Method should be made Serialized ^  (due to
  creation of named objects within)

  .../OvmfPkg/AcpiTables/AcpiTables/OUTPUT/./Dsdt.iiii
  235:         Method (PCRS, 1, NotSerialized) {
  Remark   2120 - Control Method should be made Serialized ^  (due to
  creation of named objects within)

The ACPI 6.0 spec justifies the above warnings in "19.6.82 Method (Declare
Control Method)":

  [...] The serialize rule can be used to prevent reentering of a method.
  This is especially useful if the method creates namespace objects.
  Without the serialize rule, the reentering of a method will fail when it
  attempts to create the same namespace object. [...]

Cc: Bruce Cran <bruce@cran.org.uk>
Reported-by: Bruce Cran <bruce@cran.org.uk>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18392 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: PlatformPei: clear CMOS 0xF after setting mBootMode
Laszlo Ersek [Wed, 2 Sep 2015 18:45:35 +0000 (18:45 +0000)]
OvmfPkg: PlatformPei: clear CMOS 0xF after setting mBootMode

We have an old bug in BootModeInitialization(): firmware is supposed to
clear the CMOS register 0xF after reading it for the last time. QEMU only
sets this register to 0xFE in "hw/timer/mc146818rtc.c", function
rtc_notify_suspend(), and never clears it. However, SeaBIOS does clear it
in "src/post.c" and "src/resume.c", so let's follow suit.

We've never noticed this until now because the register gets mysteriously
cleared on non-resume reboots when OVMF runs on qemu-system-x86_64. But on
qemu-system-i386, this bug breaks a (suspend, resume, reboot) triplet:
after the last step OVMF thinks it's resuming because when it actually
resumed (in the middle step), it failed to clear the register.

BootModeInitialization() is the perfect function to clear the register,
right after setting mBootMode: the function is executed on both normal
boot and on S3 resume; it succeeds DebugDumpCmos() -- so the dump is not
affected by this patch --; and everything that relies on S3 vs. normal
boot after we clear the register uses mBootMode anyway.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18391 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg: Bug fix for UncachedMemoryAllocationLib
Heyi Guo [Wed, 2 Sep 2015 16:29:31 +0000 (16:29 +0000)]
ArmPkg: Bug fix for UncachedMemoryAllocationLib

NewNode is the node we found, while Node is the last node in the
list. Also update mFreedBufferSize.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18390 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg: Fix one wrong parameter for weak key checking
Qin Long [Wed, 2 Sep 2015 08:44:46 +0000 (08:44 +0000)]
CryptoPkg: Fix one wrong parameter for weak key checking

Fix one wrong offset which is passed into DES weak key checking in TdesInit().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18389 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg:Support orderedList with default value
Dandan Bi [Wed, 2 Sep 2015 08:44:24 +0000 (08:44 +0000)]
MdeModulePkg:Support orderedList with default value

Our tool can support OrderedList which has default value,but doesn't update the
source code in HiiDatabase when parse the ifr data.Now update the code and add
test case in DriverSample.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18388 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg: Replace string wrapper functions with safe string functions
Qin Long [Wed, 2 Sep 2015 08:12:39 +0000 (08:12 +0000)]
CryptoPkg: Replace string wrapper functions with safe string functions

EDKII core suggests to retire unsafe string functions. This patch is to
replace string wrapper functions with new-added safe string functions
for consistency.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18385 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: remove redundant words in function comment.
Fu Siyuan [Wed, 2 Sep 2015 07:40:21 +0000 (07:40 +0000)]
NetworkPkg: remove redundant words in function comment.

A function with void return type doesn't need @retval line in its function
comment. This patch removes one redundant line from Ip6 driver in r18365.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18384 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoAdd more strict check for MOR variable, besides MOR lock variable.
Yao, Jiewen [Wed, 2 Sep 2015 06:29:06 +0000 (06:29 +0000)]
Add more strict check for MOR variable, besides MOR lock variable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18383 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/ArmVExpress-FVP: enable UEFI Secure Boot
Ard Biesheuvel [Tue, 1 Sep 2015 17:29:23 +0000 (17:29 +0000)]
ArmPlatformPkg/ArmVExpress-FVP: enable UEFI Secure Boot

This allows the FVP target to be built with UEFI Secure Boot enabled,
by passing -D SECURE_BOOT_ENABLE to the build command line. Note that
this requires the Intel BDS, or you will not be able to enroll
certificates, since the ARM BDS does not provide a GUI to do so.

The FVP Base model is recommended in this case, since the certificate
store is kept in NOR flash.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18379 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/ArmVExpress-FVP: add support for the Intel BDS
Ard Biesheuvel [Tue, 1 Sep 2015 17:29:14 +0000 (17:29 +0000)]
ArmPlatformPkg/ArmVExpress-FVP: add support for the Intel BDS

This adds support for the Intel BDS and enables it by default.
To revert to using the ARM BDS, pass '-D USE_ARM_BDS' on the
build command line.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18378 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/PlatformIntelBdsLib: add splash screen support
Ard Biesheuvel [Tue, 1 Sep 2015 17:29:06 +0000 (17:29 +0000)]
ArmPlatformPkg/PlatformIntelBdsLib: add splash screen support

Add a call to EnableQuietBoot () to BdsPlatformPolicyBehavior(),
so that a splash screen is shown in case one is present under the
correct GUID in the FV, and we have graphics support.

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: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18377 6f19259b-4bc3-4df7-8a09-765794883524