]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoBaseTools: Update Build tool to support multiple workspaces
Li YangX [Thu, 8 Oct 2015 09:27:14 +0000 (09:27 +0000)]
BaseTools: Update Build tool to support multiple workspaces

WORKSPACE is still kept.
New PACKAGES_PATH is introduced to specify the additional WORKSPACEs.
In PACKAGES_PATH, ';' is separator in Windows, ':' is separator in Linux.

Build directory is in WORKSPACE. Package, BaseTools and Conf directory
will be found from WORKSPACE and PACKAGES_PATH.

In implementation, BaseTools adds MultipleWorkspace class for
the file path conversion from WORKSPACE and PACKAGES_PATH.

Verify two tree layouts.
Root\edk2\MdePkg
Root\edk2\MdeMdeModulePkg
Root\edk2\...
1. set WORKSPACE=Root\edk2
2. set WORKSPACE=Root, and set PACKAGES_PATH=Root\edk2

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

8 years agoEmulatorPkg/build.sh: Use GCC49 toolchain with GCC 5.*
Jordan Justen [Thu, 8 Oct 2015 05:51:57 +0000 (05:51 +0000)]
EmulatorPkg/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>
Cc: Andrew Fish <afish@apple.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18578 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: raise DXEFV size to 9 MB
Gary Ching-Pang Lin [Wed, 7 Oct 2015 11:53:07 +0000 (11:53 +0000)]
OvmfPkg: raise DXEFV size to 9 MB

With gcc5 and enabling SECURE_BOOT and NETWORK_IP6, the build
failed with this error:

GenFv: ERROR 3000: Invalid
  the required fv image size 0x814c18 exceeds the set fv image size 0x800000

Raise the DXEFV size to 9 MB to fix the build error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18577 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg: Fixes for Juno ACPI
Supreeth Venkatesh [Wed, 7 Oct 2015 08:18:00 +0000 (08:18 +0000)]
ArmPlatformPkg: Fixes for Juno ACPI

1. Change Interrupt for Juno PCI Routing table
Interrupt Number Reference:
http://www.arm.com/files/pdf/DDI0515D1a_juno_arm_development_platform_soc_trm.pdf
table 3-3 page 3-7
2. Support for PCI IO range with ACPI on JUNO

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18576 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoDuetPkg: exit pci function loops early if device is not multi-function
Joseph Shifflett [Tue, 6 Oct 2015 20:55:36 +0000 (20:55 +0000)]
DuetPkg: exit pci function loops early if device is not multi-function

When looping through all PCI functions, code should not look for functions
1-7 if function 0 is not present or if function 0 indicates the device is
not multifunction.  Prior to this fix the code would use stale data in a
buffer to determine if a device is multifunction even if function 0 is not
present.  This fixes a code bug and provides very small performance
improvements.

PCI 2.3 Specification states: They [multifunction devices] are also
required to always implement function 0 in the device. Implementing other
functions is optional and may be assigned in any order.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Joseph Shifflett <joseph.shifflett@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18575 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: exit pci function loops early if device is not multi-function
Joseph Shifflett [Tue, 6 Oct 2015 20:55:31 +0000 (20:55 +0000)]
MdeModulePkg: exit pci function loops early if device is not multi-function

When looping through all PCI functions, code should not look for functions
1-7 if function 0 is not present or if function 0 indicates the device is
not multifunction.  Prior to this fix the code would use stale data in a
buffer to determine if a device is multifunction even if function 0 is not
present.  This fixes a code bug and provides very small performance
improvements.

PCI 2.3 Specification states: They [multifunction devices] are also
required to always implement function 0 in the device. Implementing other
functions is optional and may be assigned in any order.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Joseph Shifflett <joseph.shifflett@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18574 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: HttpDxe: Remove unused local variables
Samer El-Haj-Mahmoud [Tue, 6 Oct 2015 19:49:13 +0000 (19:49 +0000)]
NetworkPkg: HttpDxe: Remove unused local variables

Fix gcc build errors [-Werror=unused-but-set-variable].

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Build-tested-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: add more details to commit message]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18573 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/ArmJunoPkg/Madt.aslc: Fix MADT header version
Sudeep Holla [Tue, 6 Oct 2015 14:05:37 +0000 (14:05 +0000)]
ArmPlatformPkg/ArmJunoPkg/Madt.aslc: Fix MADT header version

Currently the MADT signature and revision is mapped to v1.0 macros
which results in MADT with incorrect entries in the header for Juno.
This patch fixes these EFI_ACPI_*_0_MULTIPLE_APIC_DESCRIPTION_TABLE
macros by using appropriate v5.0 versions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18572 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/RTSM: remove obsolete Foundation model libraries
Ard Biesheuvel [Tue, 6 Oct 2015 12:51:27 +0000 (12:51 +0000)]
ArmPlatformPkg/RTSM: remove obsolete Foundation model libraries

These are no longer used by any platform in the tree, nor are they
of any significance to any out of tree platforms.

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@18571 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/AArch64Mmu: remove cache maintenance for page tables
Ard Biesheuvel [Tue, 6 Oct 2015 12:51:07 +0000 (12:51 +0000)]
ArmPkg/AArch64Mmu: remove cache maintenance for page tables

All our page tables are allocated from memory whose cacheability
attributes are inherited by the cacheability bits in the MMU control
register, so there is no need for explicit cache maintenance after
updating the page tables. And even if there were, Set/Way operations
are not appropriate anyway for ensuring that these changes make it to
main memory. So just remove the explicit cache maintenance completely.

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@18570 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools/AARCH64: use large code model for GCC <= 4.8
Ard Biesheuvel [Fri, 2 Oct 2015 14:48:30 +0000 (14:48 +0000)]
BaseTools/AARCH64: use large code model for GCC <= 4.8

As it turns out, upstream GCC only supports the AArch64 'tiny' code
model as of version 4.9. Since the default 'small' code model requires
4 KB section alignment (which is undesirable for the XIP modules),
revert GCC 4.7 and 4.8 to using the 'large' code model instead.

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

8 years agoArmPkg/Mmu: do not configure block translations at level 0
Ard Biesheuvel [Fri, 2 Oct 2015 14:48:21 +0000 (14:48 +0000)]
ArmPkg/Mmu: do not configure block translations at level 0

Now that the AArch64 MMU code correctly identifies and handles
naturally aligned regions of more than 2 MB in size, it will happily
try to use block mappings at level 0 to map huge memory regions, such
as the single cacheable 1:1 mapping we use for Xen domU to map the
entire PA space. However, block mappings are not supported at level 0
so the resulting translation tables will be incorrect, causing
execution to fail as soon as the MMU is enabled.

So use level 1 as the minimum level at which to perform block
translations.

Reported-by: Julien Grall <julien.grall@citrix.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18568 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVExpressPkg: use 4 KB section alignment for ARM DXE_RUNTIME_DRIVER modules
Ard Biesheuvel [Thu, 1 Oct 2015 14:01:24 +0000 (14:01 +0000)]
ArmVExpressPkg: use 4 KB section alignment for ARM DXE_RUNTIME_DRIVER modules

In order to support the Properties Table memory protection feature
on 32-bit ARM, build DXE_RUNTIME_DRIVER type binaries with 4 KB section
alignment by setting the common-page-size linker command line option.

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@18567 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: use 4 KB section alignment for ARM DXE_RUNTIME_DRIVER modules
Ard Biesheuvel [Thu, 1 Oct 2015 14:01:16 +0000 (14:01 +0000)]
ArmVirtPkg: use 4 KB section alignment for ARM DXE_RUNTIME_DRIVER modules

In order to support the Properties Table memory protection feature
on 32-bit ARM, build DXE_RUNTIME_DRIVER type binaries with 4 KB section
alignment by setting the common-page-size linker command line option.

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

8 years agoBaseTools/ARM: move to unified GCC linker script
Ard Biesheuvel [Thu, 1 Oct 2015 14:01:07 +0000 (14:01 +0000)]
BaseTools/ARM: move to unified GCC linker script

Instead of using the ARM builtin linker script for GNU ld, use the
new unified one instead. This will allow us to increase the section
alignment for DXE_RUNTIME_MODULEs, which is a prerequisite for
enabling the UEFIv2.5 Properties Table memory protection feature.

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

8 years agoOvmfPkg: set 4 KB section alignment for DXE_RUNTIME_DRIVER modules
Ard Biesheuvel [Wed, 30 Sep 2015 08:53:00 +0000 (08:53 +0000)]
OvmfPkg: set 4 KB section alignment for DXE_RUNTIME_DRIVER modules

Increase the section alignment to 4 KB for DXE_RUNTIME_DRIVER modules.
This allows the OS to map them with tightened permissions (i.e., R-X for
.text and RW- for .data). This is a prerequisite for enabling the
EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA (sic)
feature that was introduced in UEFIv2.5.

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

8 years agoVlv2TbltDevicePkg FvbRuntimeDxe: Fix CalculateCheckSum16 input incorrect length
Star Zeng [Wed, 30 Sep 2015 04:39:34 +0000 (04:39 +0000)]
Vlv2TbltDevicePkg FvbRuntimeDxe: Fix CalculateCheckSum16 input incorrect length

The input length should be "The size, in bytes, of Buffer.",
the divide sizeof (UINT16) operation is not needed and incorrect.

Cc: David Wei <david.wei@intel.com>
Cc: Tim He <tim.he@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18563 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg GenericBdsLib: Do not assume perf entry count has no change
Star Zeng [Wed, 30 Sep 2015 04:30:34 +0000 (04:30 +0000)]
IntelFrameworkModulePkg GenericBdsLib: Do not assume perf entry count has no change

Current implementation assumes the performance entry count has no change from
multiple GetPerformanceMeasurement() while loops, it may cause the allocated buffer
for PerfEntriesAsDxeHandle at the first loop to be overflowed if the following loop has
the count changed.

This patch is also to sync the change at
commit R18417 "MdeModulePkg: Fix a performance data buffer overrun issue".

Cc: Ruiyu Ni <ruiyu.ni@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: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18562 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg UefiBootManagerLib: Do not assume perf entry count has no change
Star Zeng [Wed, 30 Sep 2015 04:29:50 +0000 (04:29 +0000)]
MdeModulePkg UefiBootManagerLib: Do not assume perf entry count has no change

Current implementation assumes the performance entry count has no change from
multiple GetPerformanceMeasurement() while loops, it may cause the allocated buffer
for PerfEntriesAsDxeHandle at the first loop to be overflowed if the following loop has
the count changed.

This patch is also to sync the change at
commit R17851 "IntelFrameworkModulePkg GenericBdsLib: Resolve array size mismatch".

Cc: Ruiyu Ni <ruiyu.ni@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: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18561 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg Ip4Dxe: Ip4Config2 to request DHCP Option6 DNS server IP
Samer El-Haj-Mahmoud [Wed, 30 Sep 2015 03:01:13 +0000 (03:01 +0000)]
MdeModulePkg Ip4Dxe: Ip4Config2 to request DHCP Option6 DNS server IP

Ip4Config2 protocol implementation must request for DNS server info when the
policy is set to DHCP. And when a DHCP server responds to it with a list of
DNS server addresses, it must parse it and set it for the instance. Without
this, nobody can do a Ip4Config->GetData for DNS server IPs before calling
Dns->Configure(). This will mean a DHCP is initiated when calling
Dns->Configure(), thus causing serious performance issues. This patch
attempts to address this issue.

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

8 years agoMdeModulePkg: Add SMBIOS 3.0 support in NetLibGetSystemGuid.
Samer El-Haj-Mahmoud [Wed, 30 Sep 2015 01:06:57 +0000 (01:06 +0000)]
MdeModulePkg: Add SMBIOS 3.0 support in NetLibGetSystemGuid.

NetLibGetSystemGuid gets the UUID from SMBIOS table to use as the System GUID
(in DHCP and other network use cases). This change adds support to get the
UUID from either SMBIOS 2.x or 3.0, 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: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18559 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Add a simple case to test shell parameter parsing logic
Ruiyu Ni [Tue, 29 Sep 2015 06:35:33 +0000 (06:35 +0000)]
ShellPkg: Add a simple case to test shell parameter parsing logic

TestArgv.nsh is a very simple shell script to test how the interpreter parses
the parameters. It uses ShellCTestApp.efi to dump the parameters passed from the
interpreter.

TestArgv.log is the desired output created using "TestArgv.nsh > TestArgv.log".

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

8 years agoShellPkg: Build all libraries unconditionally.
Qiu Shumin [Mon, 28 Sep 2015 02:18:05 +0000 (02:18 +0000)]
ShellPkg: Build all libraries unconditionally.

Build all the optional libraries unconditionally so we can catch changes and how they affect the package regardless of the NO_SHELL_PROFILES,
INCLUDE_DP, and INCLUDE_TFTP_COMMAND settings.

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

8 years agoMdePkg: remove redundant handling of EFI_IMAGE_REL_BASED_DIR64 relocations
Ard Biesheuvel [Fri, 25 Sep 2015 21:49:09 +0000 (21:49 +0000)]
MdePkg: remove redundant handling of EFI_IMAGE_REL_BASED_DIR64 relocations

There is AARCH64 specific code in the PE/COFF loader to handle relocations
of type EFI_IMAGE_REL_BASED_DIR64 which is dead code since this type is
handled by generic code and never handed to the AARCH64 specific routine.
So remove it.

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@18556 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: build the TFTP command into the UEFI shell
Laszlo Ersek [Fri, 25 Sep 2015 17:23:03 +0000 (17:23 +0000)]
ArmVirtPkg: build the TFTP command into the UEFI shell

The TFTP command is easy to use, it has very nice documentation
(accessible with "HELP TFTP" in the shell), and it's a very versatile
tool for downloading files from the host to the guest, via virtual
network, while the guest is in the UEFI shell.

Even better, enabling this command in the shell increases the
uncompressed FVMAIN size only by 8192 bytes, in my AARCH64 build of
VirtArmQemu.dsc, and the final size increase (after LZMA compression)
that is visible in the FVMAIN_COMPACT volume is merely 1976 bytes.

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

8 years agoOvmfPkg: build the TFTP command into the UEFI shell
Laszlo Ersek [Fri, 25 Sep 2015 17:22:58 +0000 (17:22 +0000)]
OvmfPkg: build the TFTP command into the UEFI shell

The TFTP command is easy to use, it has very nice documentation
(accessible with "HELP TFTP" in the shell), and it's a very versatile tool
for downloading files from the host to the guest, via virtual network,
while the guest is in the UEFI shell.

Even better, enabling this command in the shell increases the uncompressed
DXEFV size only by 12896 bytes, in my X64 build, and the final size
increase (after LZMA compression) that is visible in the FVMAIN_COMPACT
volume is merely 2576 bytes.

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@18554 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: UefiShellTftpCommandLib: fix incompatible pointer assignment
Laszlo Ersek [Fri, 25 Sep 2015 17:22:53 +0000 (17:22 +0000)]
ShellPkg: UefiShellTftpCommandLib: fix incompatible pointer assignment

Add the missing EFIAPI calling convention to the CheckPacket() function.
Without it, the gcc build breaks due to the incompatible pointer
assignment in "Mtftp4Token.CheckPacket = CheckPacket".

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

8 years agoUefiCpuPkg/CpuMpPei: Fix wrong CpuData pointer
Jeff Fan [Fri, 25 Sep 2015 06:29:51 +0000 (06:29 +0000)]
UefiCpuPkg/CpuMpPei: Fix wrong CpuData pointer

CpuData buffer should be located in allocated buffer instead of at end of
WakeupBuffer.

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

8 years agoUefiCpuPkg/CpuMpPei: Add check on Processors number found
Jeff Fan [Fri, 25 Sep 2015 06:29:03 +0000 (06:29 +0000)]
UefiCpuPkg/CpuMpPei: Add check on Processors number found

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

8 years agoNetworkPkg:Fix iSCSI driver issue to work with iSCSI LIO target
Ye Ting [Fri, 25 Sep 2015 03:51:46 +0000 (03:51 +0000)]
NetworkPkg:Fix iSCSI driver issue to work with iSCSI LIO target

The patch fixes iSCSI driver can't reinstate itself when configured
 in AutoConfigure mode and IPv6 stack is actually used.
The issue occurs when iSCSI driver communicates with
iSCSI LIO target in IPv6 path and the target sends
back TCP FIN packets randomly.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu jiaxin <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18546 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: QemuFwCfgLib: read bytes from fw-cfg with DMA when available
Laszlo Ersek [Thu, 24 Sep 2015 21:40:41 +0000 (21:40 +0000)]
ArmVirtPkg: QemuFwCfgLib: read bytes from fw-cfg with DMA when available

The protocol is documented in "docs/specs/fw_cfg.txt" in the QEMU tree.

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@18545 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: VirtFdtDxe: detect fw-cfg DMA interface from the DTB
Laszlo Ersek [Thu, 24 Sep 2015 21:40:36 +0000 (21:40 +0000)]
ArmVirtPkg: VirtFdtDxe: detect fw-cfg DMA interface from the DTB

A DMA-like transfer interface has recently been implemented in QEMU for
fw-cfg. For ARM and AARCH64 virtual machines, the binding prescribes a new
8-byte wide register at offset 0x10 in the register block. Make VirtFdtDxe
expose this register if it is present.

Please see "docs/specs/fw_cfg.txt" in the QEMU tree for more information.

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@18544 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Update tftp to build with current tip
Jaben Carsey [Thu, 24 Sep 2015 20:44:59 +0000 (20:44 +0000)]
ShellPkg: Update tftp to build with current tip

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

8 years agoRevert 18541
Jaben Carsey [Thu, 24 Sep 2015 20:44:00 +0000 (20:44 +0000)]
Revert 18541

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

8 years agoShellPkg: Update tftp to build with current tip
Jaben Carsey [Thu, 24 Sep 2015 19:48:58 +0000 (19:48 +0000)]
ShellPkg: Update tftp to build with current tip

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

8 years agoBaseTools/GenFw: disable RVCT linker size optimization
Ard Biesheuvel [Thu, 24 Sep 2015 19:35:16 +0000 (19:35 +0000)]
BaseTools/GenFw: disable RVCT linker size optimization

Disable the RVCT size optimization that may put sections at an offset
that is not aligned to their own alignment, by adding the --no_legacyalign
switch to the RVCT linker command line. This is necessary since such sections
cannot be correctly converted into PE/COFF sections without padding them at
the front, which defeats the purpose of the optimization anyway.

With the optimization gone, we can also remove the special case for ARM in
GenFw that could result in corrupt PE/COFF images to be emitted. Instead,
sections whose base address is not aligned correctly are outright rejected.

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@18540 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools/GenFw: remove ARM and RVCT references from ELF64 code
Ard Biesheuvel [Thu, 24 Sep 2015 19:35:10 +0000 (19:35 +0000)]
BaseTools/GenFw: remove ARM and RVCT references from ELF64 code

ARM and RVCT apply to 32-bit code only, so remove any references
to them (including the workaround for the linker) from the 64-bit
version of ElfConvert.c

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@18539 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/CpuDxe: Disable interrupt before restoring context
Heyi Guo [Thu, 24 Sep 2015 17:05:39 +0000 (17:05 +0000)]
ArmPkg/CpuDxe: Disable interrupt before restoring context

Interrupt must be disabled before we storing ELR and other system
registers, or else ELR will be overridden by interrupt reentrance.

This bug is critical as we may get occasional exception or dead loop
when interrupt reentrance occurs:

  After increasing SP ... Before popping out registers
Or
  After restoring ELR

The 1st circumstance could also be resolved by optimizing SP operation
(Pop out registers before adding SP back), but the 2nd could not be
resolved by disabling interrupt.

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

8 years agoSourceLevelDebugPkg: Change revision to 4 to compress packet
Ruiyu Ni [Thu, 24 Sep 2015 03:08:00 +0000 (03:08 +0000)]
SourceLevelDebugPkg: Change revision to 4 to compress packet

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

8 years agoSourceLevelDebugPkg: Change the debug message to "v1.5" from "v1.4"
Ruiyu Ni [Thu, 24 Sep 2015 03:07:04 +0000 (03:07 +0000)]
SourceLevelDebugPkg: Change the debug message to "v1.5" from "v1.4"

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

8 years agoArmVirtPkg: reduce preallocation of boot services data pages
Ard Biesheuvel [Tue, 22 Sep 2015 15:50:30 +0000 (15:50 +0000)]
ArmVirtPkg: reduce preallocation of boot services data pages

Commit SVN r18503 ("MdeModulePkg DxeCore: Take the range in resource
HOB for PHIT as higher priority") changed the GCD init logic to take
the sum of the region sizes in gMemoryTypeInformation[] into account
when estimating the minimal amount of memory needed to boot the system.

Unfortunately, as an unintended side effect, this change results in boot
failures of ArmVirtQemu when running with QEMU's default memory size of
128 MB. The reason is that the sum of the gMemoryTypeInformation region
sizes plus the size of the inital PEI region exceeds 128 MB. Since we do
not actually need to preallocate 20,000 pages' worth of BootServicesData
memory, reduce this figure to the more reasonable 12,000.

Reported-by: Mark Rutland <mark.rutland@arm.com>
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@18533 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: enable SATA controller
Reza Jelveh [Tue, 22 Sep 2015 11:18:45 +0000 (11:18 +0000)]
OvmfPkg: enable SATA controller

In this patch, we replace the traditional IDE driver stack that comes from
PcAtChipsetPkg and IntelFrameworkModulePkg with more featureful drivers
from OvmfPkg and MdeModulePkg. The resultant driver stack is compatible
with the previous one, but provides more protocols, on more kinds of
virtual hardware.

Remove:
- PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeControllerDxe.inf
  (removing EFI_IDE_CONTROLLER_INIT_PROTOCOL [1])

Remove the dependent:
- IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf
  (removing EFI_DISK_INFO_PROTOCOL [2],
            EFI_BLOCK_IO_PROTOCOL  [3])

As replacement, add:
- OvmfPkg/SataControllerDxe/SataControllerDxe.inf
  (supplying EFI_IDE_CONTROLLER_INIT_PROTOCOL [1])

On top of which, add the dependent:
- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
  (providing EFI_ATA_PASS_THRU_PROTOCOL,
             EFI_EXT_SCSI_PASS_THRU_PROTOCOL)

On top of which, add the dependent:
- MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
  (supplying EFI_DISK_INFO_PROTOCOL [2],
             EFI_BLOCK_IO_PROTOCOL  [3],
   providing EFI_BLOCK_IO2PROTOCOL,
             EFI_STORAGE_SECURITY_COMMAND_PROTOCOL)

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: rewrote commit message]
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@18532 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: QemuBootOrderLib: recognize Q35 SATA disks / CD-ROMs
Laszlo Ersek [Tue, 22 Sep 2015 11:18:41 +0000 (11:18 +0000)]
OvmfPkg: QemuBootOrderLib: recognize Q35 SATA disks / CD-ROMs

The OpenFirmware device paths that QEMU generates for these disks and
CD-ROMs are very similar to those generated for the i440fx IDE disks and
CD-ROMs (including the same number of devpath nodes necessary for unique
parsing). The interpretations and the translation to UEFI devpath
fragments are different, of course.

(The spaces after "ide@1,1" are inserted below only for illustration
purposes.)

                                                 primary or secondary
                                                 |      master or slave
                                                 v      v
  i440fx IDE: /pci@i0cf8/ide@1,1          /drive@0/disk@0
  Q35 SATA:   /pci@i0cf8/pci8086,2922@1f,2/drive@1/disk@0
                                                 ^      ^
                                                 |      device number
                                                 |      (fixed 0)
                                                 channel (port) number

The similarity is reflected in the translation output (spaces again
inserted for illustration only):

  i440fx IDE: PciRoot(0x0)/Pci(0x1,0x1) /Ata(Primary,Master,0x0)
  Q35 SATA:   PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x1,0x0,0x0)
                                              ^   ^   ^
                                              |   |   LUN;
                                              |   |   always 0 on Q35
                                              |   port multiplier port
                                              |   number; always 0 on Q35
                                              channel (port) number

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@18531 6f19259b-4bc3-4df7-8a09-765794883524

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