]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
6 years agoUefiCpuPkg CpuDxe: Enhance get mtrr mask logic.
Eric Dong [Wed, 2 Aug 2017 10:29:09 +0000 (18:29 +0800)]
UefiCpuPkg CpuDxe: Enhance get mtrr mask logic.

In order to not use the deprecated macro, refine
get mtrr mask value logic.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoQuarkSocPkg MtrrLib: Enhance get mtrr mask logic.
Eric Dong [Wed, 2 Aug 2017 10:26:43 +0000 (18:26 +0800)]
QuarkSocPkg MtrrLib: Enhance get mtrr mask logic.

In order to not use the deprecated macro, refine
get mtrr mask value logic.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoBaseTools/Conf: apply nasmb, asm16 build rule order
Chris Ruffin [Wed, 2 Aug 2017 20:30:06 +0000 (04:30 +0800)]
BaseTools/Conf: apply nasmb, asm16 build rule order

Prioritize nasmb rule over asm16 where both source types are specified.

Change-Id: I33ec348dab66b313ddb05cb15f2d8407a648c320
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chris Ruffin <chris.ruffin@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoNetworkPkg/HttpDxe: Support HTTP Patch method
Jiaxin Wu [Wed, 2 Aug 2017 07:51:47 +0000 (15:51 +0800)]
NetworkPkg/HttpDxe: Support HTTP Patch method

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoOvmfPkg/PlatformPei: support >=1TB high RAM, and discontiguous high RAM
Laszlo Ersek [Fri, 7 Jul 2017 23:28:37 +0000 (01:28 +0200)]
OvmfPkg/PlatformPei: support >=1TB high RAM, and discontiguous high RAM

In OVMF we currently get the upper (>=4GB) memory size with the
GetSystemMemorySizeAbove4gb() function.

The GetSystemMemorySizeAbove4gb() function is used in two places:

(1) It is the starting point of the calculations in GetFirstNonAddress().
    GetFirstNonAddress() in turn
    - determines the placement of the 64-bit PCI MMIO aperture,
    - provides input for the GCD memory space map's sizing (see
      AddressWidthInitialization(), and the CPU HOB in
      MiscInitialization()),
    - influences the permanent PEI RAM cap (the DXE core's page tables,
      built in permanent PEI RAM, grow as the RAM to map grows).

(2) In QemuInitializeRam(), GetSystemMemorySizeAbove4gb() determines the
    single memory descriptor HOB that we produce for the upper memory.

Respectively, there are two problems with GetSystemMemorySizeAbove4gb():

(1) It reads a 24-bit count of 64KB RAM chunks from the CMOS, and
    therefore cannot return a larger value than one terabyte.

(2) It cannot express discontiguous high RAM.

Starting with version 1.7.0, QEMU has provided the fw_cfg file called
"etc/e820". Refer to the following QEMU commits:

0624c7f916b4 ("e820: pass high memory too.", 2013-10-10),
7d67110f2d9a ("pc: add etc/e820 fw_cfg file", 2013-10-18)
7db16f2480db ("pc: register e820 entries for ram", 2013-10-10)

Ever since these commits in v1.7.0 -- with the last QEMU release being
v2.9.0, and v2.10.0 under development --, the only two RAM entries added
to this E820 map correspond to the below-4GB RAM range, and the above-4GB
RAM range. And, the above-4GB range exactly matches the CMOS registers in
question; see the use of "pcms->above_4g_mem_size":

  pc_q35_init() | pc_init1()
    pc_memory_init()
      e820_add_entry(0x100000000ULL, pcms->above_4g_mem_size, E820_RAM);
    pc_cmos_init()
      val = pcms->above_4g_mem_size / 65536;
      rtc_set_memory(s, 0x5b, val);
      rtc_set_memory(s, 0x5c, val >> 8);
      rtc_set_memory(s, 0x5d, val >> 16);

Therefore, remedy the above OVMF limitations as follows:

(1) Start off GetFirstNonAddress() by scanning the E820 map for the
    highest exclusive >=4GB RAM address. Fall back to the CMOS if the E820
    map is unavailable. Base all further calculations (such as 64-bit PCI
    MMIO aperture placement, GCD sizing etc) on this value.

    At the moment, the only difference this change makes is that we can
    have more than 1TB above 4GB -- given that the sole "high RAM" entry
    in the E820 map matches the CMOS exactly, modulo the most significant
    bits (see above).

    However, Igor plans to add discontiguous (cold-plugged) high RAM to
    the fw_cfg E820 RAM map later on, and then this scanning will adapt
    automatically.

(2) In QemuInitializeRam(), describe the high RAM regions from the E820
    map one by one with memory HOBs. Fall back to the CMOS only if the
    E820 map is missing.

    Again, right now this change only makes a difference if there is at
    least 1TB high RAM. Later on it will adapt to discontiguous high RAM
    (regardless of its size) automatically.

-*-

Implementation details: introduce the ScanOrAdd64BitE820Ram() function,
which reads the E820 entries from fw_cfg, and finds the highest exclusive
>=4GB RAM address, or produces memory resource descriptor HOBs for RAM
entries that start at or above 4GB. The RAM map is not read in a single
go, because its size can vary, and in PlatformPei we should stay away from
dynamic memory allocation, for the following reasons:

- "Pool" allocations are limited to ~64KB, are served from HOBs, and
  cannot be released ever.

- "Page" allocations are seriously limited before PlatformPei installs the
  permanent PEI RAM. Furthermore, page allocations can only be released in
  DXE, with dedicated code (so the address would have to be passed on with
  a HOB or PCD).

- Raw memory allocation HOBs would require the same freeing in DXE.

Therefore we process each E820 entry as soon as it is read from fw_cfg.

-*-

Considering the impact of high RAM on the DXE core:

A few years ago, installing high RAM as *tested* would cause the DXE core
to inhabit such ranges rather than carving out its home from the permanent
PEI RAM. Fortunately, this was fixed in the following edk2 commit:

  3a05b13106d1, "MdeModulePkg DxeCore: Take the range in resource HOB for
                PHIT as higher priority", 2015-09-18

which I regression-tested at the time:

  http://mid.mail-archive.com/55FC27B0.4070807@redhat.com

Later on, OVMF was changed to install its high RAM as tested (effectively
"arming" the earlier DXE core change for OVMF), in the following edk2
commit:

  035ce3b37c90, "OvmfPkg/PlatformPei: Add memory above 4GB as tested",
                2016-04-21

which I also regression-tested at the time:

  http://mid.mail-archive.com/571E8B90.1020102@redhat.com

Therefore adding more "tested memory" HOBs is safe.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1468526
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoOvmfPkg/QemuFwCfgLib: Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS
Brijesh Singh [Wed, 2 Aug 2017 22:12:48 +0000 (18:12 -0400)]
OvmfPkg/QemuFwCfgLib: Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS

Commit 09719a01b11b (OvmfPkg/QemuFwCfgLib: Implement SEV internal function
for Dxe phase) uses IOMMU protocol to allocate and free FW_CFG_DMA_ACCESS
buffer when SEV is active. During initial commits we made assumption that
IOMMU.AllocateBuffer() will provide PlainTextAddress (i.e C-bit cleared).
This assumption was wrong, the AllocateBuffer() protocol member is not
expected to produce a buffer that is immediatly usable, and client is
required to call Map() uncondtionally with BusMasterCommonBuffer[64] to
get a mapping which is accessable by both host and device.

The patch refactors code a bit and add the support to Map()
FW_CFG_DMA_ACCESS buffer using BusMasterCommonBuffer operation after
allocation and Unamp() before free.

The complete discussion about this and recommendation from Laszlo can be
found here [1]

[1] https://lists.01.org/pipermail/edk2-devel/2017-July/012652.html

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
[lersek@redhat.com: convert pointers to UINTN before converting to UINT64]
[lersek@redhat.com: fix argument indentation in multi-line function call]
[lersek@redhat.com: explicitly compare pointers to NULL]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
6 years agoOvmfPkg/IoMmuDxe: Unmap(): recycle MAP_INFO after BusMasterCommonBuffer[64]
Laszlo Ersek [Wed, 2 Aug 2017 18:31:08 +0000 (20:31 +0200)]
OvmfPkg/IoMmuDxe: Unmap(): recycle MAP_INFO after BusMasterCommonBuffer[64]

In order for Unmap() to be callable from ExitBootServices() event handler
context (for cleaning up a BusMasterCommonBuffer[64] operation), we have
to completely liberate the affected path in Unmap() from dynamic memory
management.

The last remaining piece is the release of the MAP_INFO structure. Rather
than freeing it with FreePool(), recycle it to an internal list. Elements
of this "free list" can be reused for any kind of Map() operation, and can
be freed later, or recycled again.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: abort harder on memory encryption mask failures
Laszlo Ersek [Wed, 2 Aug 2017 17:35:38 +0000 (19:35 +0200)]
OvmfPkg/IoMmuDxe: abort harder on memory encryption mask failures

Upon a MemEncryptSevClearPageEncMask() failure in Map(), it wouldn't be
difficult to release the bounce buffer that was implicitly allocated for
BusMasterRead[64] and BusMasterWrite[64] operations. However, undoing any
partial memory encryption mask changes -- partial page splitting and PTE
modifications -- is practically impossible. (For example, restoring the
encryption mask on the entire range has no reason to fare any better than
the MemEncryptSevClearPageEncMask() call itself.)

For this reason, keep ASSERT_EFI_ERROR(), but hang in RELEASE builds too,
if MemEncryptSevClearPageEncMask() or MemEncryptSevSetPageEncMask() fails.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: implement in-place decryption/encryption for Map/Unmap
Laszlo Ersek [Wed, 2 Aug 2017 16:26:59 +0000 (18:26 +0200)]
OvmfPkg/IoMmuDxe: implement in-place decryption/encryption for Map/Unmap

At the moment, we have the following distribution of actions between the
IOMMU protocol member functions:

- AllocateBuffer() allocates pages and clears the memory encryption mask.

- FreeBuffer() re-sets the memory encryption mask, and deallocates pages.

- Map() does nothing at all when BusMasterCommonBuffer[64] is requested
  (and AllocateBuffer() was called previously). Otherwise, Map() allocates
  pages, and clears the memory encryption mask.

- Unmap() does nothing when cleaning up a BusMasterCommonBuffer[64]
  operation. Otherwise, Unmap() clears the encryption mask, and frees the
  pages.

This is wrong: the AllocateBuffer() protocol member is not expected to
produce a buffer that is immediately usable, and client code is required
to call Map() unconditionally, even if BusMasterCommonBuffer[64] is the
desired operation. Implement the right distribution of actions as follows:

- AllocateBuffer() allocates pages and does not touch the encryption mask.

- FreeBuffer() deallocates pages and does not touch the encryption mask.

- Map() does not allocate pages when BusMasterCommonBuffer[64] is
  requested, and it allocates pages (bounce buffer) otherwise.  Regardless
  of the BusMaster operation, Map() (and Map() only) clears the memory
  encryption mask.

- Unmap() restores the encryption mask unconditionally. If the operation
  was BusMasterCommonBuffer[64], then Unmap() does not release the pages.
  Otherwise, the pages (bounce buffer) are released.

This approach also ensures that Unmap() can be called from
ExitBootServices() event handlers, for cleaning up
BusMasterCommonBuffer[64] operations. (More specifically, for restoring
the SEV encryption mask on any in-flight buffers, after resetting any
referring devices.) ExitBootServices() event handlers must not change the
UEFI memory map, thus any memory allocation or freeing in Unmap() would
disqualify Unmap() from being called in such a context.

Map()-ing and Unmap()-ing memory for a BusMasterCommonBuffer[64] operation
effectively means in-place decryption and encryption in a SEV context. As
an additional hurdle, section "7.10.8 Encrypt-in-Place" of AMD publication
Nr.24593 implies that we need a separate temporary buffer for decryption
and encryption that will eventually land in-place. Allocating said
temporary buffer in the straightforward way would violate the above
allocation/freeing restrictions on Map()/Unmap(), therefore pre-allocate
this "stash buffer" too in AllocateBuffer(), and free it in FreeBuffer().

To completely rid Unmap() of dynamic memory impact, for
BusMasterCommonBuffer[64] operations, we're going to rework the lifecycle of
the MAP_INFO structures in a later patch.

(The MemEncryptSevSetPageEncMask() call in Unmap() could theoretically
allocate memory internally for page splitting, however this won't happen
in practice: in Unmap() we only restore the memory encryption mask, and
don't genuinely set it. Any page splitting will have occurred in Map()'s
MemEncryptSevClearPageEncMask() call first.)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: rework setup of "MapInfo->PlainTextAddress" in Map()
Laszlo Ersek [Wed, 2 Aug 2017 13:13:15 +0000 (15:13 +0200)]
OvmfPkg/IoMmuDxe: rework setup of "MapInfo->PlainTextAddress" in Map()

There are three issues with the current calculations:

- The initial logic that sets up "DmaMemoryTop" and "AllocateType" checks
  for the BusMasterCommonBuffer64 operation in two places. The inner check
  for BusMasterCommonBuffer64 will never evaluate to TRUE however, because
  the outer check excludes BusMasterCommonBuffer64.

- In order to lower "DmaMemoryTop" to (SIZE_4GB - 1), the outer check
  requires that the encrypted (original) buffer cross the 4GB mark. This
  is wrong: for BusMasterRead[64] and BusMasterWrite[64] operations, we
  unconditionally need a bounce buffer (a decrypted memory area), and for
  the 32-bit variants, "DmaMemoryTop" should be lowered regardless of the
  location of the original (encrypted) buffer.

- The current logic would be hard to extend for the in-place decryption
  that we'll implement in the next patch.

Therefore rework the "MapInfo->PlainTextAddress" setup. No functional
changes beyond said bugfixes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: zero out pages before releasing them
Laszlo Ersek [Wed, 2 Aug 2017 09:53:53 +0000 (11:53 +0200)]
OvmfPkg/IoMmuDxe: zero out pages before releasing them

Whenever we release the plaintext bounce buffer pages that were allocated
implicitly in Map() for BusMasterRead[64] and BusMasterWrite[64], we
restore the encryption mask on them. However, we should also rewrite the
area (fill it with zeros) so that the hypervisor is not left with a
plaintext view of the earlier data.

Similarly, whenever we release the plaintext common buffer pages that were
allocated explicitly in AllocateBuffer() for BusMasterCommonBuffer[64], we
restore the encryption mask on them.  However, we should also rewrite the
area (fill it with zeros) so that the hypervisor is not left with a
plaintext view of the earlier data.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: clean up used library classes
Laszlo Ersek [Wed, 2 Aug 2017 10:11:50 +0000 (12:11 +0200)]
OvmfPkg/IoMmuDxe: clean up used library classes

The following library classes are not used by this module, so remove them
from the INF file's [LibraryClasses] section:
- DxeServicesTableLib
- UefiLib

The following library classes are used by this module, so add them to the
INF file's [LibraryClasses] section:
- BaseMemoryLib (e.g. via CopyMem())
- MemoryAllocationLib (e.g. via AllocatePool())

Sort the list of library classes (in both "IoMmuDxe.inf" and
"AmdSevIoMmu.h").

Remove all non-local #include directives from "IoMmuDxe.c"; both C files
of this module include "AmdSevIoMmu.h", and "AmdSevIoMmu.h" includes all
non-local headers already.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: propagate errors from AmdSevInstallIoMmuProtocol()
Laszlo Ersek [Wed, 2 Aug 2017 10:20:14 +0000 (12:20 +0200)]
OvmfPkg/IoMmuDxe: propagate errors from AmdSevInstallIoMmuProtocol()

If we cannot install the IOMMU protocol for whatever reason, exit the
driver with an error. The same is already done for the IOMMU Absent
protocol.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: don't initialize local variables
Laszlo Ersek [Wed, 2 Aug 2017 10:03:27 +0000 (12:03 +0200)]
OvmfPkg/IoMmuDxe: don't initialize local variables

The edk2 coding style requires separate assignments.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: convert UINTN arguments to UINT64 for the %Lx fmt spec
Laszlo Ersek [Wed, 2 Aug 2017 09:42:14 +0000 (11:42 +0200)]
OvmfPkg/IoMmuDxe: convert UINTN arguments to UINT64 for the %Lx fmt spec

The portable way to print UINTN values is to use the %Lx format specifier,
and to convert the values to UINT64. The second step is currently missing,
add it.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: rename HostAddress to CryptedAddress in MAP_INFO
Laszlo Ersek [Wed, 2 Aug 2017 09:34:18 +0000 (11:34 +0200)]
OvmfPkg/IoMmuDxe: rename HostAddress to CryptedAddress in MAP_INFO

As a continuation of the last patch, clarify that the area pointed-to by
"HostAddress" is encrypted and hidden from the hypervisor.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: rename DeviceAddress to PlainTextAddress in MAP_INFO
Laszlo Ersek [Wed, 2 Aug 2017 09:26:42 +0000 (11:26 +0200)]
OvmfPkg/IoMmuDxe: rename DeviceAddress to PlainTextAddress in MAP_INFO

In this particular IOMMU driver, "DeviceAddress" is just as accessible to
the CPU as "HostAddress", the difference is that the area pointed-to by
the former is plain-text and accessible to the hypervisor. Rename
"DeviceAddress" to "PlainTextAddress" in MAP_INFO.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: rewrap source code to 79 characters
Laszlo Ersek [Wed, 2 Aug 2017 09:20:03 +0000 (11:20 +0200)]
OvmfPkg/IoMmuDxe: rewrap source code to 79 characters

No functional changes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: Fix header guard macro
Thomas Palmer [Fri, 4 Aug 2017 20:28:17 +0000 (15:28 -0500)]
OvmfPkg/IoMmuDxe: Fix header guard macro

Correct the header guard macro

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoMdeModulePkg/DisplayEngine: Fix incorrect display issue
Dandan Bi [Fri, 28 Jul 2017 02:40:14 +0000 (10:40 +0800)]
MdeModulePkg/DisplayEngine: Fix incorrect display issue

In a form, some new menus may be dynamically inserted between highlight
menu and previous top of screen menu when some question are refreshed.
So the highlight menu and previous top of screen menu perhaps can't be
shown in one page. Existing codes miss to handle this case then will
cause incorrect display.This patch is to fix this display issue.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoBaseTools/VfrCompile: Remove the MAX_PATH limitation
Dandan Bi [Fri, 28 Jul 2017 08:19:22 +0000 (16:19 +0800)]
BaseTools/VfrCompile: Remove the MAX_PATH limitation

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

Since we have already used LongFilePath() to convert
file path, so we can remove the MAX_PATH limitation.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Daniel Díaz <daniel.diaz@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoBaseTools/VfrCompile: Fix segmentation fault issues
Dandan Bi [Tue, 11 Jul 2017 07:35:14 +0000 (15:35 +0800)]
BaseTools/VfrCompile: Fix segmentation fault issues

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

(1) Add NULL check before using a pointer.
(2) Use "%s" format string in DebugError function to
    avoid crash caused by incorrect input.

Cc: Bo Chen <chenbo@pdx.edu>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoNetworkPkg: iSCSI should allow to set 6 or 12 length of ISID keyword.
Fu Siyuan [Thu, 3 Aug 2017 06:38:51 +0000 (14:38 +0800)]
NetworkPkg: iSCSI should allow to set 6 or 12 length of ISID keyword.

The last 3 bytes of ISID should be able to changed by setting the keyword with
a value with length 6 (only last 3 bytes) or 12 (full ISID) according to the
keyword definition in UEFI configuration namespace website.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoUefiCpuPkg: Enable Processor Trace feature.
Eric Dong [Fri, 4 Aug 2017 01:59:08 +0000 (09:59 +0800)]
UefiCpuPkg: Enable Processor Trace feature.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg: Add Processor Trace feature definition.
Eric Dong [Wed, 19 Jul 2017 02:16:20 +0000 (10:16 +0800)]
UefiCpuPkg: Add Processor Trace feature definition.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg: Add Pcds used by processor trace feature.
Eric Dong [Wed, 19 Jul 2017 01:00:30 +0000 (09:00 +0800)]
UefiCpuPkg: Add Pcds used by processor trace feature.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg/Msr: Add a missing IvyBridge processor signature
Hao Wu [Wed, 2 Aug 2017 08:15:53 +0000 (16:15 +0800)]
UefiCpuPkg/Msr: Add a missing IvyBridge processor signature

This commit modifies the CPUID signature check MACRO for IvyBridge
processor by adding a missing DisplayModel 0x3E. The missing one appears
at Section 35.10.1 to Section 35.10.3 of the Intel(R) 64 and IA-32
Architectures Software Developer's Manual, Volume 3, September 2016.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoMdeModulePkg PeiCore: Install SEC HOB data
Star Zeng [Tue, 1 Aug 2017 05:47:08 +0000 (13:47 +0800)]
MdeModulePkg PeiCore: Install SEC HOB data

If the EFI_SEC_HOB_DATA_PPI is in the list of PPIs passed to the PEI
entry point, the PEI Foundation will call the GetHobs() member
function and install all HOBs returned into the HOB list. It does
this after installing all PPIs passed from SEC into the PPI database
and before dispatching any PEIMs.

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: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg: Add definition for SecHobData PPI
Star Zeng [Wed, 19 Jul 2017 05:52:24 +0000 (13:52 +0800)]
MdePkg: Add definition for SecHobData PPI

This PPI is introduced in PI Version 1.5.

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: Liming Gao <liming.gao@intel.com>
6 years agoUefiCpuPkg PiSmmCpuDxeSmm: Check LMCE capability when wait for AP.
Eric Dong [Thu, 20 Jul 2017 12:07:46 +0000 (20:07 +0800)]
UefiCpuPkg PiSmmCpuDxeSmm: Check LMCE capability when wait for AP.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg CpuCommonFeaturesLib: Enable LMCE feature.
Eric Dong [Fri, 4 Aug 2017 00:46:41 +0000 (08:46 +0800)]
UefiCpuPkg CpuCommonFeaturesLib: Enable LMCE feature.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg: Add definition for LMCE feature.
Eric Dong [Thu, 20 Jul 2017 12:05:43 +0000 (20:05 +0800)]
UefiCpuPkg: Add definition for LMCE feature.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoOvmfPkg: Undo removal of License.txt
Michael D Kinney [Thu, 3 Aug 2017 18:44:31 +0000 (11:44 -0700)]
OvmfPkg: Undo removal of License.txt

Undo removal of OvmfPkg/License.txt in commit

https://github.com/tianocore/edk2/commit/2a98de03444e6a1e04030e70bb85e62de6b82edc

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Add Readme.md to root of edk2 repository
Michael D Kinney [Wed, 19 Jul 2017 21:28:14 +0000 (14:28 -0700)]
edk2: Add Readme.md to root of edk2 repository

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

Add Readme.md with a brief description of the EDK II
open source project along with links to contribution
agreement, licenses, and resources.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Move License.txt file to root
Michael D Kinney [Wed, 19 Jul 2017 21:30:30 +0000 (14:30 -0700)]
edk2: Move License.txt file to root

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

Add top level License.txt file with the BSD 2-Clause
License that is used by the majority of the EKD II open
source project content.  Merge copyright statements
from the BSD 2-Clause License files in each package
directory and remove the duplication License.txt
file from package directories.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Reformat TianoCore Contribution Agreement 1.1
Michael D Kinney [Mon, 24 Jul 2017 21:53:10 +0000 (14:53 -0700)]
edk2: Reformat TianoCore Contribution Agreement 1.1

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

Update formatting of Contributions.txt to line wrap
at 80 columns.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Update to TianoCore Contribution Agreement 1.1
Michael D Kinney [Tue, 18 Jul 2017 20:59:21 +0000 (13:59 -0700)]
edk2: Update to TianoCore Contribution Agreement 1.1

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

Update the TianoCore Contribution Agreement from Version 1.0
to Version 1.1 to cover open source documentation associated
with the TianoCore project.

Version 1.0 covers source code files.  Version 1.1 is a
backwards compatible extension that adds support for document
files in both source form and compiled form.

The edk2 repository is updated so the same contribution
agreement is used by developers that work on TianoCore
related source code or TianoCore related documents.

Links to RFC and Wiki on the GitBook documentation process
* https://lists.01.org/pipermail/edk2-devel/2017-March/008654.html
* https://github.com/tianocore-docs/edk2-TemplateSpecification/wiki

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Move TianoCore Contribution Agreement to root
Michael D Kinney [Tue, 18 Jul 2017 20:34:33 +0000 (13:34 -0700)]
edk2: Move TianoCore Contribution Agreement to root

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

Move Contributions.txt that contains the TianoCore
Contribution Agreement 1.0 to the root of the edk2
repository and remove the duplicate Contributions.txt
files from all packages.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoBaseTools/PatchCheck: Support Contribution Agreement 1.1
Michael D Kinney [Wed, 12 Jul 2017 20:11:07 +0000 (13:11 -0700)]
BaseTools/PatchCheck: Support Contribution Agreement 1.1

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

Update PatchCheck.py to support either
"Contributed-under: TianoCore Contribution Agreement 1.0"
or "Contributed-under: TianoCore Contribution Agreement 1.1"
in the commit message.

Temporarily continue to allow the TianoCore Contribution
Agreement 1.0 agreement.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoNetworkPkg: Display HTTP redirection info to the screen if need.
Fu Siyuan [Wed, 26 Jul 2017 07:57:38 +0000 (15:57 +0800)]
NetworkPkg: Display HTTP redirection info to the screen if need.

HTTP defines a set of status code for redirecting a request to a different URI
in Section 6.4 of RFC7231 and also RFC7583. This patch updates the HTTP boot
driver to display the redirection info to the screen so the user would have
chance to know new URI address of the HTTP boot image.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
6 years agoShellPkg/dblk: Honor the BlockIo alignment requirement.
HuajingLi [Tue, 1 Aug 2017 04:30:18 +0000 (12:30 +0800)]
ShellPkg/dblk: Honor the BlockIo alignment requirement.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Huajing Li <huajing.li@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoUefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport().
Marvin.Haeuser@outlook.com [Fri, 21 Jul 2017 10:20:22 +0000 (18:20 +0800)]
UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport().

The documentation of PpinSupport() refers to 'Enhanced Intel
SpeedStep'. This patch fixes these referneces.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoMdeModulePkg/Ufs: Set 'Data Segment Length' field for Write Descriptor
Hao Wu [Thu, 15 Jun 2017 07:15:59 +0000 (15:15 +0800)]
MdeModulePkg/Ufs: Set 'Data Segment Length' field for Write Descriptor

According to the Universal Flash Storage (UFS) Version 2.1 (JESD220C) spec
Section 10.7.8.5, the DATA SEGMENT LENGTH field of the UPIU shall also be
set to number of descriptor bytes to write.

The origin codes miss the above operation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/UfsPassThruDxe: Add impl of UFS Device Config Protocol
Hao Wu [Mon, 19 Jun 2017 02:53:34 +0000 (10:53 +0800)]
MdeModulePkg/UfsPassThruDxe: Add impl of UFS Device Config Protocol

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoUefiCpuPkg SecCore: Fix operands of different size in bitwise operation
Star Zeng [Wed, 2 Aug 2017 02:07:31 +0000 (10:07 +0800)]
UefiCpuPkg SecCore: Fix operands of different size in bitwise operation

It is introduced by 9e9ca2100f22be29f1a53129d741f4305ff34a71.

Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg/Ftp4: Fix wrong function pointer declaration
Alcantara, Paulo [Tue, 6 Jun 2017 00:33:36 +0000 (08:33 +0800)]
MdePkg/Ftp4: Fix wrong function pointer declaration

EFI_FTP4_DATA_CALLBACK is a function pointer and defined as follows:

> typedef
> EFI_STATUS
> (EFIAPI *EFI_FTP4_DATA_CALLBACK)(
>  IN EFI_FTP4_PROTOCOL           *This,
>  IN EFI_FTP4_COMMAND_TOKEN      *Token
>  );

And EFI_FTP4_COMMAND_TOKEN structure declared it as:

> EFI_FTP4_DATA_CALLBACK *DataCallback

Which ended up being a pointer to function pointer and clearly wrong.
This patch fixes it by removing the misleading '*' from declaration.
It's also fixed in new UEFI 2.7 spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paulo Alcantara <paulo.alc.cavalcanti@hp.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoNetworkPkg/HttpDxe: Destroy the TLS instance when cleaning up the HTTP child
Jiaxin Wu [Mon, 31 Jul 2017 05:36:37 +0000 (13:36 +0800)]
NetworkPkg/HttpDxe: Destroy the TLS instance when cleaning up the HTTP child

During clean up the HTTP child, all resources used by it should be cleaned. But
currently, TLS instance is not destroyed.

This patch is to fix this issue.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoCryptoPkg/TlsLib: Remove the redundant free of BIO objects
Jiaxin Wu [Mon, 31 Jul 2017 05:29:40 +0000 (13:29 +0800)]
CryptoPkg/TlsLib: Remove the redundant free of BIO objects

TLS BIO objects (InBio/OutBio) will be freed by SSL_free() function.
So, the following free operation (BIO_free) in TlsFree is redundant.
It can be removed directly.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Long Qin <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoNetworkPkg/Ip6Dxe: Fix the IPv6 PXE boot option goes missing issue
Jiaxin Wu [Sun, 30 Jul 2017 13:52:02 +0000 (21:52 +0800)]
NetworkPkg/Ip6Dxe: Fix the IPv6 PXE boot option goes missing issue

This patch is to fix the potential issue recorded at Bugzilla 636:
https://bugzilla.tianocore.org/show_bug.cgi?id=636

The issue is caused by the IPv6 policy switching after PXEv6 boot. When IP
policy is changing, the IPv6 children used by PXE.UdpRead() will be destroyed.
Then, PXE Stop() function is called to uninstall the devicePath protocol,
which leads to the IPv6 PXE boot option goes missing.

Through the above analysis, the IP driver should take the responsibility for
the upper layer network stacks recovery by using ConnectController().

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: Ni Ruiyu <ruiyu.ni@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Subramanian Sriram <sriram-s@hpe.com>
Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
6 years agoNetworkPkg/HttpBootDxe: Fix spelling typo in EFI_HTTP_STATUS_CODE
Jiaxin Wu [Tue, 25 Jul 2017 12:49:27 +0000 (20:49 +0800)]
NetworkPkg/HttpBootDxe: Fix spelling typo in EFI_HTTP_STATUS_CODE

"HTTP_STATUS_300_MULTIPLE_CHIOCES"
This should instead be:
"HTTP_STATUS_300_MULTIPLE_CHOICES"

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdeModulePkg/DxeHttpLib: Fix spelling typo in EFI_HTTP_STATUS_CODE
Jiaxin Wu [Tue, 25 Jul 2017 12:48:12 +0000 (20:48 +0800)]
MdeModulePkg/DxeHttpLib: Fix spelling typo in EFI_HTTP_STATUS_CODE

"HTTP_STATUS_300_MULTIPLE_CHIOCES"
This should instead be:
"HTTP_STATUS_300_MULTIPLE_CHOICES"

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdePkg/Http.h: Fix spelling typo in EFI_HTTP_STATUS_CODE
Jiaxin Wu [Tue, 25 Jul 2017 12:47:09 +0000 (20:47 +0800)]
MdePkg/Http.h: Fix spelling typo in EFI_HTTP_STATUS_CODE

"HTTP_STATUS_300_MULTIPLE_CHIOCES"
This should instead be:
"HTTP_STATUS_300_MULTIPLE_CHOICES"

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoNetworkPkg/HttpDxe: Refine the coding style.
Jiaxin Wu [Tue, 25 Jul 2017 12:32:35 +0000 (20:32 +0800)]
NetworkPkg/HttpDxe: Refine the coding style.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoMdePkg/Http.h: Refine the coding style.
Jiaxin Wu [Tue, 25 Jul 2017 12:31:58 +0000 (20:31 +0800)]
MdePkg/Http.h: Refine the coding style.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoIntelSiliconPkg/IntelVTdDxe: Add explicit NULL pointer checks
Hao Wu [Tue, 1 Aug 2017 03:50:39 +0000 (11:50 +0800)]
IntelSiliconPkg/IntelVTdDxe: Add explicit NULL pointer checks

Add explicit NULL pointer check to make the codes more straight-forward.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoIntelSiliconPkg/IntelVTdDxe: Fix typo for VTd IOTLB domain ID
Hao Wu [Tue, 1 Aug 2017 03:45:33 +0000 (11:45 +0800)]
IntelSiliconPkg/IntelVTdDxe: Fix typo for VTd IOTLB domain ID

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoArmPkg: Move IS_DEVICE_PATH_NODE for sharing
Jun Nie [Tue, 1 Aug 2017 09:28:58 +0000 (17:28 +0800)]
ArmPkg: Move IS_DEVICE_PATH_NODE for sharing

Move IS_DEVICE_PATH_NODE into header to share it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoMdeModulePkg FirmwarePerfPei: Remove SEC performance data getting code
Star Zeng [Fri, 28 Jul 2017 02:05:19 +0000 (10:05 +0800)]
MdeModulePkg FirmwarePerfPei: Remove SEC performance data getting code

Current SEC performance data getting code in FirmwarePerformancePei
may get wrong SEC performance data if FirmwarePerformancePei executes
after memory discovered.

And as SecCore has added SecPerformancePpiCallBack to get SEC performance
data and build HOB to convey the SEC performance data to DXE phase.

This patch is to remove the SEC performance data getting code in
FirmwarePerformancePei.

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: Liming Gao <liming.gao@intel.com>
6 years agoUefiCpuPkg SecCore: Add SecPerformancePpiCallBack
Star Zeng [Fri, 28 Jul 2017 02:05:08 +0000 (10:05 +0800)]
UefiCpuPkg SecCore: Add SecPerformancePpiCallBack

Add SecPerformancePpiCallBack to get SEC performance data and
build HOB to convey the SEC performance data to DXE phase.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoUefiCpuPkg SecCore: Adjust PeiTemporaryRamBase&Size to be 8byte aligned
Star Zeng [Fri, 28 Jul 2017 14:13:00 +0000 (22:13 +0800)]
UefiCpuPkg SecCore: Adjust PeiTemporaryRamBase&Size to be 8byte aligned

As HOB which has 8byte aligned requirement will be built based on them
in PEI phase.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg PeiCore: Handle notification PPI from SEC
Star Zeng [Wed, 26 Jul 2017 07:55:26 +0000 (15:55 +0800)]
MdeModulePkg PeiCore: Handle notification PPI from SEC

InstallPpi() will be used for normal PPI in PPI list from SEC,
and NotifyPpi() will be used for notification PPI in PPI list from SEC.

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: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg PiPeiCis.h: Add description for notification PPI from SEC
Star Zeng [Wed, 26 Jul 2017 03:19:22 +0000 (11:19 +0800)]
MdePkg PiPeiCis.h: Add description for notification PPI from SEC

This patch is to follow latest (>= 1.5) PI spec to add description
for notification PPI from SEC

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: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg PiSmmCoreMemoryAllocLib: Fix a FreePool() assertion issue
Star Zeng [Fri, 28 Jul 2017 03:44:54 +0000 (11:44 +0800)]
MdeModulePkg PiSmmCoreMemoryAllocLib: Fix a FreePool() assertion issue

When PiSmmCore links against PeiDxeDebugLibReportStatusCode, the code
flow below will cause a FreePool() assertion issue.

PiSmmCoreMemoryAllocationLibConstructor() ->
SmmInitializeMemoryServices() ->
DEBUG ((DEBUG_INFO, "SmmAddMemoryRegion\n")) in SmmAddMemoryRegion() ->
DebugPrint() -> REPORT_STATUS_CODE_EX() -> ReportStatusCodeEx() ->
AllocatePool()/FreePool(PiSmmCoreMemoryAllocLib) ->
ASSERT() at Head = CR (Buffer, POOL_HEAD, Data, POOL_HEAD_SIGNATURE)
  in CoreFreePoolI() of DxeCore Pool.c

It is because at the point of FreePool() in the code flow above,
mSmmCoreMemoryAllocLibSmramRanges/mSmmCoreMemoryAllocLibSmramRangeCount
are not been initialized yet, the FreePool() will be directed to
gBS->FreePool(), that is wrong.

This patch is to temporarily use BootServicesData to hold the
SmramRanges data before calling SmmInitializeMemoryServices().

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools/GenCrc32: Fix a bug to hand empty file for decode
Yonghong Zhu [Wed, 19 Jul 2017 02:59:37 +0000 (10:59 +0800)]
BaseTools/GenCrc32: Fix a bug to hand empty file for decode

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=535
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools/EfiLdrImage: Fix a segmentation fault from vfprintf()
Yonghong Zhu [Wed, 19 Jul 2017 02:58:34 +0000 (10:58 +0800)]
BaseTools/EfiLdrImage: Fix a segmentation fault from vfprintf()

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=533
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools/EfiRom: Fix a segmentation fault from vsprintf()/vfprintf()
Yonghong Zhu [Wed, 19 Jul 2017 02:57:11 +0000 (10:57 +0800)]
BaseTools/EfiRom: Fix a segmentation fault from vsprintf()/vfprintf()

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=534
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools/GenFfs: Fix a segmentation fault from vsprintf()/vfprintf()
Yonghong Zhu [Wed, 19 Jul 2017 02:55:47 +0000 (10:55 +0800)]
BaseTools/GenFfs: Fix a segmentation fault from vsprintf()/vfprintf()

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=536
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools/GenSec: Fix a segmentation fault in main()
Yonghong Zhu [Wed, 19 Jul 2017 02:54:39 +0000 (10:54 +0800)]
BaseTools/GenSec: Fix a segmentation fault in main()

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=537
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools/Split: Fix the segmentation fault in GetSplitValue()
Yonghong Zhu [Wed, 19 Jul 2017 02:53:06 +0000 (10:53 +0800)]
BaseTools/Split: Fix the segmentation fault in GetSplitValue()

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=538
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Fix the bug to correctly check Pcd type that in FDF file
Yonghong Zhu [Thu, 27 Jul 2017 03:20:26 +0000 (11:20 +0800)]
BaseTools: Fix the bug to correctly check Pcd type that in FDF file

We set Pcd value in FDF and used this Pcd as PatchableInModule type in
module, it cause build report generate failure. because we incorrectly
set the Pcd type during check whether the Pcd is used.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/PciBus: Avoid hang when BUS pad resource is not in top
Ruiyu Ni [Thu, 27 Jul 2017 03:05:16 +0000 (11:05 +0800)]
MdeModulePkg/PciBus: Avoid hang when BUS pad resource is not in top

PciScanBus() assumes the GetResourcePadding() puts BUS descriptor
in the very beginning, if it's not, the Descriptors will be updated
to point to middle of the pool buffer, which can cause
FreePool(Descriptors) hang in DEBUG image.
No functionality impact to RELEASE image.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoShellPkg: Avoid buffer out-of-bound access
Ruiyu Ni [Wed, 26 Jul 2017 08:21:54 +0000 (16:21 +0800)]
ShellPkg: Avoid buffer out-of-bound access

PathSize is the number of bytes in PathForReturn buffer so
PathForReturn[PathSize - 1] incorrectly accesses the last
character in the buffer,
PathForReturn[PathSize / sizeof (CHAR16) - 1] should be used.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Steven Shi <steven.shi@intel.com>
6 years agoShellPkg/setvar: Check the duplicate flag
Huajing Li [Thu, 27 Jul 2017 04:33:43 +0000 (12:33 +0800)]
ShellPkg/setvar: Check the duplicate flag

Signed-off-by: Huajing Li <huajing.li@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoShellPkg/ShellLib: Remove unused macros
Ruiyu Ni [Wed, 26 Jul 2017 09:34:01 +0000 (17:34 +0800)]
ShellPkg/ShellLib: Remove unused macros

MAX_FILE_NAME_LEN and FIND_XXXXX_FILE_BUFFER_SIZE are not used
by ShellLib so remove them.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg: Follow UEFI 2.7 spec to deprecate SMM Communication ACPI Table
Star Zeng [Thu, 20 Jul 2017 06:47:28 +0000 (14:47 +0800)]
MdePkg: Follow UEFI 2.7 spec to deprecate SMM Communication ACPI Table

Delete PiSmmCommunicationAcpiTable.h and delete SMM Communication ACPI
Table definition in UefiAcpiDataTable.h.
As EFI_SMM_COMMUNICATE_HEADER is defined in both PI spec vol 4
and UEFI spec, move its definition to SmmCommunication.h.

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>
6 years agoUefiCpuPkg PiSmmCommunicationSmm: Deprecate SMM Communication ACPI Table
Star Zeng [Thu, 20 Jul 2017 06:57:12 +0000 (14:57 +0800)]
UefiCpuPkg PiSmmCommunicationSmm: Deprecate SMM Communication ACPI Table

Follow UEFI 2.7 spec to deprecate SMM Communication ACPI Table,
PiSmmCommunicationSmm will not install SMM Communication ACPI Table
anymore.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoSecurityPkg OpalPasswordSupportLib: Remove include to UefiAcpiDataTable.h
Star Zeng [Thu, 20 Jul 2017 07:56:29 +0000 (15:56 +0800)]
SecurityPkg OpalPasswordSupportLib: Remove include to UefiAcpiDataTable.h

Remove redundant include to UefiAcpiDataTable.h as
SmmCommunication.h will help to include it.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdeModulePkg/BMMUiLib: Check reset requirement before exiting UiApp
Bi, Dandan [Fri, 21 Jul 2017 08:56:03 +0000 (16:56 +0800)]
MdeModulePkg/BMMUiLib: Check reset requirement before exiting UiApp

V2: Refine the comments.

In UI page, some configuration change may require system reset.
BootMaintenanceManagerUiLib misses this check before exiting UiApp
to boot other boot options. Now add the check.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/BMUiLib: Check reset requirement before exiting UiApp
Bi, Dandan [Fri, 21 Jul 2017 08:56:02 +0000 (16:56 +0800)]
MdeModulePkg/BMUiLib: Check reset requirement before exiting UiApp

V2: Refine the comments.

In UI page, some configuration change may require system reset.
BootManagerUiLib misses this check before exiting UiApp to boot
other boot options. Now add the check.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/SetupBrowser: Record the reset status in all SendForm
Bi, Dandan [Fri, 21 Jul 2017 08:56:01 +0000 (16:56 +0800)]
MdeModulePkg/SetupBrowser: Record the reset status in all SendForm

After calling SendForm to enter front page, configuration change in some
driver may require system reset. Currently the reset status is saved in
SendForm level. Then SendForm can return the reset status.
IsResetRequired API also can return the reset status before exiting browser.
It return the reset status in current SendForm level now. But SendForm can
be recursive called by some module.so the reset status in previous SendForm
may be lost. Now change the IsResetRequired API to return the reset info no
matter the reset is caught in any SendForm.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoNt32Pkg: Always use 0x2000 for maxim variable size
Ruiyu Ni [Wed, 26 Jul 2017 09:26:41 +0000 (17:26 +0800)]
Nt32Pkg: Always use 0x2000 for maxim variable size

Currently the PcdMaxVariableSize is controlled by the below condition
check:

!if $(SECURE_BOOT_ENABLE) == TRUE || $(TLS_ENABLE) == TRUE
  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
!endif

But for other case, PcdMaxVariableSize is also required with the value
of 0x2000 (e,g. NetworkPkg/IScsiDxe), so remove the condition of
PcdMaxVariableSize for NT32 platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
6 years agoIntelSiliconPkg/dsc: Add PlatformVtd sample driver.
Jiewen Yao [Tue, 18 Jul 2017 03:52:35 +0000 (11:52 +0800)]
IntelSiliconPkg/dsc: Add PlatformVtd sample driver.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoIntelSiliconPkg: Add PlatformVTdSample driver.
Jiewen Yao [Mon, 17 Jul 2017 08:24:09 +0000 (16:24 +0800)]
IntelSiliconPkg: Add PlatformVTdSample driver.

It provides sample on Platform VTd policy protocol.
This protocol is optional.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoIntelSiliconPkg/dsc: Add Vtd driver.
Jiewen Yao [Mon, 26 Jun 2017 06:02:36 +0000 (14:02 +0800)]
IntelSiliconPkg/dsc: Add Vtd driver.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoIntelSiliconPkg: Add VTd driver.
Jiewen Yao [Sat, 25 Mar 2017 08:59:36 +0000 (16:59 +0800)]
IntelSiliconPkg: Add VTd driver.

It provides AllocateBuffer/FreeBuffer/Map/Unmap function.
It also provides VTd capability yet.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoIntelSiliconPkg/Dec: Add ProtocolGuid.
Jiewen Yao [Mon, 26 Jun 2017 05:53:07 +0000 (13:53 +0800)]
IntelSiliconPkg/Dec: Add ProtocolGuid.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoIntelSiliconPkg/Include: Add PlatformVtdPolicy Protocol
Jiewen Yao [Mon, 26 Jun 2017 05:51:40 +0000 (13:51 +0800)]
IntelSiliconPkg/Include: Add PlatformVtdPolicy Protocol

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoIntelSiliconPkg/Include: Add VTD industry standard.
Jiewen Yao [Wed, 21 Jun 2017 06:24:50 +0000 (14:24 +0800)]
IntelSiliconPkg/Include: Add VTD industry standard.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoShellPkg/map: Recognize CDROM change
Ruiyu Ni [Tue, 25 Jul 2017 07:30:23 +0000 (15:30 +0800)]
ShellPkg/map: Recognize CDROM change

The patch adds logic to probe the media change for physical
block devices. So that when media change happens, the BlockIo
is re-installed again.

It fixes the issue when CDROM is removed UEFI Shell still shows
the BlockIo in the output of "map -r".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg Xhci: Also RecoverHaltedEndpoint for BABBLE_ERROR
Star Zeng [Tue, 25 Jul 2017 03:24:01 +0000 (11:24 +0800)]
MdeModulePkg Xhci: Also RecoverHaltedEndpoint for BABBLE_ERROR

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

According to XHCI spec:
4.10.2.1 Stall Error

4.10.2.4 Babble Detected Error
When a device transmits more data on the USB than the host controller
is expecting for a transaction, it is defined to be babbling.
In general, this is called a Babble Error. When a device sends more
data than the TD Transfer Size bytes (TD Babble), unexpected activity
that persists beyond a specified point in a (micro)frame (Frame Babble),
or a packet greater than Max Packet Size (Packet Babble), the host
controller shall set the Babble Detected Error in the Completion Code
field of the TRB, generate an Error Event, and halt the endpoint
(refer to Section 4.10.2.1).

This patch is to also check for EFI_USB_ERR_BABBLE error returned as
a TransferResult and then proceed to XhcRecoverhaltedEndPoint.

Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdeModulePkg SmmLockBoxDxeLib: Get SmmCommRegion for COMM buffer
Star Zeng [Fri, 21 Jul 2017 03:36:29 +0000 (11:36 +0800)]
MdeModulePkg SmmLockBoxDxeLib: Get SmmCommRegion for COMM buffer

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

Currently, SmmCommunciate fails in RestoreLockBox after
SmmReadyToLock since COMM buffer is in stack instead of
using SmmCommRegion by gEdkiiPiSmmCommunicationRegionTableGuid.

This patch is to get SmmCommRegion by
gEdkiiPiSmmCommunicationRegionTableGuid for COMM buffer

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdePkg/ResetNotification: Rename to UnregisterResetNotify
Ruiyu Ni [Wed, 19 Jul 2017 09:14:28 +0000 (17:14 +0800)]
MdePkg/ResetNotification: Rename to UnregisterResetNotify

UEFI Spec uses UnRegisterResetNotify in protocol structure
definition but uses UnregisterResetNotify in the function
prototype definition.

By searching the entire spec, Unregister* is used for
SIMPLE_TEXT_INPUT_EX_PROTOCOL.UnregisterKeyNotify(). So choose
to use UnregisterResetNotify for consistency.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoNt32Pkg: Add the ResetSystemLib in Nt32 Platform.
HuajingLi [Sat, 22 Jul 2017 07:40:53 +0000 (15:40 +0800)]
Nt32Pkg: Add the ResetSystemLib in Nt32 Platform.

Signed-off-by: Huajing Li <huajing.li@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdePkg: Add UEFI 2.7 defined GUID and structure for KMS protocol.
Fu Siyuan [Wed, 19 Jul 2017 06:24:22 +0000 (14:24 +0800)]
MdePkg: Add UEFI 2.7 defined GUID and structure for KMS protocol.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoShellPkg/ls: Display the file time in local time.
Li Huajing [Mon, 24 Jul 2017 07:46:03 +0000 (15:46 +0800)]
ShellPkg/ls: Display the file time in local time.

Signed-off-by: Li Huajing <huajing.li@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoNt32Pkg/WinNtSimpleFileSystemDxe: Change GetInfo() to get TimeZone.
Li Huajing [Mon, 24 Jul 2017 07:31:42 +0000 (15:31 +0800)]
Nt32Pkg/WinNtSimpleFileSystemDxe: Change GetInfo() to get TimeZone.

Signed-off-by: Huajing Li <huajing.li@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoBaseTools: Fix the bug that warn() function with only 1 argument
Yonghong Zhu [Tue, 25 Jul 2017 05:38:30 +0000 (13:38 +0800)]
BaseTools: Fix the bug that warn() function with only 1 argument

In the definition, the warn() function takes at least 2 arguments.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: add some comment for .PrebuildEnv file's usage
Yonghong Zhu [Tue, 25 Jul 2017 05:56:53 +0000 (13:56 +0800)]
BaseTools: add some comment for .PrebuildEnv file's usage

This patch add some comments to explain why we use .PrebuildEnv file to
save environment variable settings set by the prebuild script.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoUefiCpuPkg: Update RegisterCpuFeaturesLib to consume PcdGetSize with UINTN
Liming Gao [Tue, 11 Jul 2017 03:33:58 +0000 (11:33 +0800)]
UefiCpuPkg: Update RegisterCpuFeaturesLib to consume PcdGetSize with UINTN

PcdGetSize() returns UINTN data type. The consumer code should use UINTN data
to get its size.

This issue is found when PcdCpuFeaturesSupport is configured as patchable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg: Update RegisterCpuFeaturesLib module UNI to match it
Liming Gao [Tue, 11 Jul 2017 03:32:40 +0000 (11:32 +0800)]
UefiCpuPkg: Update RegisterCpuFeaturesLib module UNI to match it

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>