]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
5 years agoArmPlatformPkg/NorFlashPlatformLib: remove unused Guid member from struct
Ard Biesheuvel [Wed, 21 Nov 2018 11:58:28 +0000 (12:58 +0100)]
ArmPlatformPkg/NorFlashPlatformLib: remove unused Guid member from struct

We no longer use per-instance GUIDs to identify NOR flash banks so
there is no longer a need to define them. Drop the Guid member from
the NOR_FLASH_DESCRIPTION type.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Thomas Abraham <thomas.abraham@arm.com>
5 years agoMdeModulePkg PCD: Add DynamicEx PcdVpdBaseAddress64 for non SPI platform
Liming Gao [Thu, 22 Nov 2018 14:10:29 +0000 (22:10 +0800)]
MdeModulePkg PCD: Add DynamicEx PcdVpdBaseAddress64 for non SPI platform

https://bugzilla.tianocore.org/show_bug.cgi?id=1356
Current PcdVpdBaseAddress is 32bit static Pcd. NON SPI platform needs to
configure it as Dynamic PCD. Emulator platform (such as NT32) may set its
value to 64bit address.
To meet with this usage, 64bit DynamicEx PcdVpdBaseAddress64 is introduced.
If its value is not zero, it will be used.
If its value is zero, static PcdVpdBaseAddress will be used.
When NON SPI platform enables VPD PCD, they need to set PcdVpdBaseAddress64.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
5 years agoOvmfPkg: Don't include TftpDynamicCommand in XCODE5 tool chain
Liming Gao [Thu, 22 Nov 2018 13:41:41 +0000 (21:41 +0800)]
OvmfPkg: Don't include TftpDynamicCommand in XCODE5 tool chain

https://bugzilla.tianocore.org/show_bug.cgi?id=1355
XCODE doesn't support HII resource section. TftpDynamicCommand driver depends
on HII resource section. To let OvmfPkg boot to shell on XCODE5 tool chain,
don't include TftpDynamicCommand driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdePkg ACPI: fix the typos in Acpi61.h and Acpi62.h
Gary Lin [Tue, 20 Nov 2018 07:03:11 +0000 (15:03 +0800)]
MdePkg ACPI: fix the typos in Acpi61.h and Acpi62.h

The GUID for VIRTUAL_CD_REGION_PERSISTENT was using the closing
square bracket mistakenly.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically
Ard Biesheuvel [Wed, 21 Nov 2018 11:58:27 +0000 (12:58 +0100)]
ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically

NorFlashQemuLib is one of the last remaining drivers in ArmVirtPkg
that are not based on the device tree received from QEMU.

For ArmVirtQemu, this does not really matter, given that the NOR
flash banks are always the same: the PEI code is linked to execute
in place from flash bank #0, and the fixed varstore PCDs refer to
flash bank #1 directly.

However, ArmVirtQemuKernel can execute at any offset, permitting it
to be used as an intermediary loader when running QEMU with secure
world emulation enabled, in which case NOR flash bank #0 is secure
only and contains the secure world firmware. In this case,
NorFlashQemuLib should not expose the first flash bank at all.

To prevent introducing too much internal knowledge about which flash
bank is accessible under which circumstances, let's switch to using
the DTB to decide which flash banks to expose to the NOR flash driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoArmVirtPkg/FdtClientDxe: take DT node 'status' properties into account
Ard Biesheuvel [Wed, 21 Nov 2018 11:58:26 +0000 (12:58 +0100)]
ArmVirtPkg/FdtClientDxe: take DT node 'status' properties into account

DT has a [pseudo-]standardized 'status' property that can be set on
any node, and which signifies that a node should be treated as
absent unless it is set to 'ok' or 'okay'. So take this into account
when iterating over nodes.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash banks
Ard Biesheuvel [Wed, 21 Nov 2018 11:58:25 +0000 (12:58 +0100)]
ArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash banks

Currently, each flash bank controlled by ArmPlatformPkg/NorFlashDxe
has its own VendorHw GUID, and instances of NorFlashPlatformLib
describe each bank to the driver, along with the GUID for each.

This works ok for bare metal platforms, but it would be useful for
virtual platforms if we could obtain this information from a
device tree, which would require us to invent GUIDs on the fly,
given that the 'cfi-flash' binding does not include a GUID.

So instead, let's switch to a single GUID for all flash banks,
and update the driver's device path handling to include an index
to identify each bank uniquely.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Thomas Abraham <thomas.abraham@arm.com>
5 years agoArmPlatformPkg/NorFlashDxe: prepare for devicepath format change
Ard Biesheuvel [Wed, 21 Nov 2018 11:58:24 +0000 (12:58 +0100)]
ArmPlatformPkg/NorFlashDxe: prepare for devicepath format change

A subsequent patch will change the layout of devicepath nodes
produced by this driver. In preparation, make some tweaks to
the code to use a packed struct for the devicepath and to pass
the device index to NorFlashCreateInstance(). These are cosmetic
changes only, the resulting binaries should be identical.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Thomas Abraham <thomas.abraham@arm.com>
5 years agoArmPkg: remove now unused BsdLib.h
Ard Biesheuvel [Fri, 23 Nov 2018 18:54:59 +0000 (19:54 +0100)]
ArmPkg: remove now unused BsdLib.h

The last remaining users of the BdsLib.h header reside in the
edk2-platforms tree, and so it has been copied there. This
allows us to remove the original from ArmPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoIntelFsp2WrapperPkg: Fix constant if statements issue
Chasel, Chiu [Thu, 22 Nov 2018 02:51:21 +0000 (10:51 +0800)]
IntelFsp2WrapperPkg: Fix constant if statements issue

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

Internal code quality scanning found 2 constant if
statements related to FixedPcdGet8 () usage.
Since the PCD can be PatchableInModule too, it should be
changed to PcdGet8 () to fix this issue.

Test: Verified on internal platform and booted successfully.

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Desimone Nathaniel L <nathaniel.l.desimone@intel.com>
Cc: Wu Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoIntelFsp2WrapperPkg: Fix line ending format issue
Chasel, Chiu [Thu, 22 Nov 2018 01:44:28 +0000 (09:44 +0800)]
IntelFsp2WrapperPkg: Fix line ending format issue

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

Fixed line ending format wrong issues on some files.

Test: Verified building successfully.

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Desimone Nathaniel L <nathaniel.l.desimone@intel.com>
Cc: Wu Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg/LockboxNullLib: clean up INF file.
Jiewen Yao [Wed, 17 Jan 2018 01:27:46 +0000 (09:27 +0800)]
MdeModulePkg/LockboxNullLib: clean up INF file.

Remove unused module type restriction for NULL instance.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoNetworkPkg/IScsiDxe: add debug logs for failed SetVariable attempts
Vijayenthiran Subramaniam [Wed, 21 Nov 2018 15:35:59 +0000 (23:35 +0800)]
NetworkPkg/IScsiDxe: add debug logs for failed SetVariable attempts

Add debug messages for failed attempts to write to a variable.

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
5 years agoVlv2TbltDevicePkg:Fix build and boot failure of Minnowboard Max platform.
zwei4 [Thu, 22 Nov 2018 10:16:22 +0000 (18:16 +0800)]
Vlv2TbltDevicePkg:Fix build and boot failure of Minnowboard Max platform.

Remove the duplicated IScsiDxe driver from FDF; Add required shell libraries; Update SYSTEM_CONFIGURATION data structure.

Test: Install and boot Windows 10.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: David Wei <david.wei@intel.com>
5 years agoMdeModulePkg/Variable: add debug logs in VariableServiceSetVariable
Vijayenthiran Subramaniam [Wed, 21 Nov 2018 15:29:06 +0000 (23:29 +0800)]
MdeModulePkg/Variable: add debug logs in VariableServiceSetVariable

Print debug messages if size of the VariableName plus DataSize exceeds
Max(Auth|Voltaile)VariableSize bytes. The messages will be useful if any
platform specific value of Max(Auth|Voltaile)VariableSize PCDs have to
be changed.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoShellPkg: Remove ShellPkg wrapper header files
Shenglei Zhang [Thu, 15 Nov 2018 07:39:55 +0000 (15:39 +0800)]
ShellPkg: Remove ShellPkg wrapper header files

These wrapper header files are not referenced by all
open source, so they are removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=158

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoArmPkg/ArmSmcPsciResetSystemLib: add missing call to ExitBootServices()
Ard Biesheuvel [Tue, 20 Nov 2018 01:53:13 +0000 (17:53 -0800)]
ArmPkg/ArmSmcPsciResetSystemLib: add missing call to ExitBootServices()

Our poor man's implementation of EnterS3WithImmediateWake () currently
sets a high TPL level to disable interrupts, and simply calls the
PEI entrypoint again after disabling the MMU.

Unfortunately, this is not sufficient: DMA capable devices such as
network controllers or USB controllers may still be enabled and
writing to memory, e.g., in response to incoming network packets.

So instead, do the full ExitBootServices() dance: allocate space and
get the memory map, call ExitBootServices(), and in case it fails, get
the memory map again and call ExitBootServices() again. This ensures
that all cleanup related to DMA capable devices is performed before
doing the warm reset.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoMaintainers.txt: update Vlv2*Pkg maintainers.
Sun, Zailiang [Wed, 21 Nov 2018 09:29:35 +0000 (17:29 +0800)]
Maintainers.txt: update Vlv2*Pkg maintainers.

Cc: David Wei <david.wei@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zailiang Sun <zailiang.sun@intel.com>
5 years agoMdePkg: Check input Ptrs in GetSectionFromAnyFvByFileType
Dandan Bi [Mon, 19 Nov 2018 01:50:22 +0000 (09:50 +0800)]
MdePkg: Check input Ptrs in GetSectionFromAnyFvByFileType

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

In function GetSectionFromAnyFvByFileType, the input parameter "Buffer"
and "size" should not be NULL, so add ASSERT here to avoid any checker
report that the NULL pointer may be used.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg: check Length para before use in DevPathToTextUsbWWID
Dandan Bi [Mon, 19 Nov 2018 01:33:14 +0000 (09:33 +0800)]
MdePkg: check Length para before use in DevPathToTextUsbWWID

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

In function DevPathToTextUsbWWID, the Length parameter is used
without check. This patch is to add check before using it.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/DisplayEngine: Remove useless NULL ptr check for NewPos
Dandan Bi [Wed, 7 Nov 2018 08:14:22 +0000 (16:14 +0800)]
MdeModulePkg/DisplayEngine: Remove useless NULL ptr check for NewPos

In function UiDisplayMenu, the NewPos ptr which used to point to the
highlight menu entry. It will always point to the menu entry which
need to be highlighted or the gMenuOption menu if the highlight menu
is not found.
So we can remove the NULL ptr check for NewPos in this function.
And add the ASSERT code to avoid if any false positive reports
of NULL pointer dereference issue raised from static analysis.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoSecurityPkg: Update TCG PFP spec revision.
Zhang, Chao B [Tue, 20 Nov 2018 01:47:19 +0000 (09:47 +0800)]
SecurityPkg: Update TCG PFP spec revision.

UEFI TCG has aligned with TCG PFP 1.03 v51 along with Errata Version 1.0.
Update spec version accordingly.
Spec Link:
https://trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v51.pdf
https://trustedcomputinggroup.org/wp-content/uploads/PC-Client-Specific-Platform-Firmware-Profile-for-TPM-2-0-v1p03_r51-errata-v1p0_170426.pdf

Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
5 years agoOvmfPkg: simply use the Bochs interface for vmsvga
yuchenlin [Wed, 7 Nov 2018 03:47:13 +0000 (11:47 +0800)]
OvmfPkg: simply use the Bochs interface for vmsvga

BAR  |    std vga     |  vmsvga
---------------------------------
0    |   Framebuffer  | I/O space
1    |   Reserved     | Framebuffer
2    |   MMIO         | FIFO

- We cannot recognize VMW SVGA as BOCHS because that would confuse the
  IsQxl setting in QemuVideoControllerDriverStart(),

- We cannot recognize VMW SVGA as BOCHS_MMIO because BAR2 on VMW SVGA is
  not the BOCHS MMIO BAR (we can only use port IO).

Therefore the list of reasons for which we should introduce
QEMU_VIDEO_VMWARE_SVGA should name three reasons:

 (1) Get framebuffer from correct PCI BAR
 (2) Prevent using BAR2 for MMIO
 (3) Prevent mis-recognizing VMW SVGA as QXL

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoRevert "OvmfPkg: VMWare SVGA display device register definitions"
yuchenlin [Fri, 2 Nov 2018 03:24:01 +0000 (11:24 +0800)]
Revert "OvmfPkg: VMWare SVGA display device register definitions"

This reverts commit 9bcca53fe466cdff397578328d9d87d257aba493.

We reverted VMWare SVGA driver. We don't need these definitions too.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit 328409ce8de7f318ee9c929b64302bd361cd1dbd)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoRevert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."
yuchenlin [Fri, 2 Nov 2018 03:24:00 +0000 (11:24 +0800)]
Revert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."

This reverts commit 05a5379458725234de8a05780fcb5da2c12680e4.

The VMWare SVGA display device implemented by Qemu (-vga vmware) uses
an I/O-type BAR which is laid out such that some register offsets are
not aligned to the read/write width with which they are expected to be
accessed. However, we reverted the initialization of VMWare SVGA device,
we don't need such unaligned I/O.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit 438ada5aa5a1174940795678c2dae07cde8f3869)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoRevert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"
yuchenlin [Fri, 2 Nov 2018 03:23:59 +0000 (11:23 +0800)]
Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"

This reverts commit c137d95081690d4877fbeb5f1856972e84ac32f2.

The VMWare SVGA model now -- since commit 104bd1dc70 in QEMU --
falls back to stdvga (that is, Bochs) if we don't setup VMWare SVGA
FIFO.

To simplify QemuVideoDxe, we don't intend to implement the VMWare SVGA
FIFO setup feature. It means our current VMW SVGA driver code is
basically dead. To simplify the problem, we will replace the old
VMWare SVGA driver to Bochs interface. It should work on all QEMU
version.

The first step for using Bochs interface is to revert old driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit 98856a724c2acdc0094220d4de615a557dad0f88)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoRevert "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"
yuchenlin [Fri, 2 Nov 2018 03:23:58 +0000 (11:23 +0800)]
Revert "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"

This reverts commit b2959e9f1a57279506ca46d56bc424fd7fa6b62a.

The VMWare SVGA display device implemented by Qemu (-vga vmware) uses
an I/O-type BAR which is laid out such that some register offsets are
not aligned to the read/write width with which they are expected to be
accessed. However, we will revert the initialization of VMWare SVGA
device later, we don't need such unaligned I/O.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit e038bde2679bbd200086c25ab43090ad3b8b25a3)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoMdeModulePkg/SdMmcPciHcDxe: Allow overriding base clock frequency
Marcin Wojtas [Fri, 9 Nov 2018 23:01:27 +0000 (07:01 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Allow overriding base clock frequency

Some SdMmc host controllers are run by clocks with different
frequency than it is reflected in Capabilities Register 1.
It is allowed by SDHCI specification ver. 4.2 - if BaseClkFreq
field value of the Capability Register 1 is zero, the clock
frequency must be obtained via another method.

Because the bitfield is only 8 bits wide, a maximum value
that could be obtained from hardware is 255MHz.
In case the actual frequency exceeds 255MHz, the 8-bit BaseClkFreq
member of SD_MMC_HC_SLOT_CAP structure occurs to be not sufficient
to be used for setting the clock speed in SdMmcHcClockSupply
function.

This patch adds new UINT32 array ('BaseClkFreq[]') to
SD_MMC_HC_PRIVATE_DATA structure for specifying
the input clock speed for each slot of the host controller.
All routines that are used for clock configuration are
updated accordingly.

This patch also adds new IN OUT BaseClockFreq field
in the Capability callback of the SdMmcOverride,
protocol which allows to update BaseClkFreq value.

The patch reuses original commit from edk2-platforms:
20f6f144d3a8 ("Marvell/Drivers: XenonDxe: Allow overriding base clock
frequency")

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg/SdMmcPciHcDxe: Add SwitchClockFreqPost to SdMmcOverride
Tomasz Michalec [Fri, 9 Nov 2018 23:01:26 +0000 (07:01 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Add SwitchClockFreqPost to SdMmcOverride

Some SD Host Controlers need to do additional operations after clock
frequency switch.

This patch add new callback type to NotifyPhase of the SdMmcOverride
protocol. It is called after SdMmcHcClockSupply.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride protocol
Tomasz Michalec [Fri, 9 Nov 2018 23:01:25 +0000 (07:01 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride protocol

Some SD Host Controllers use different values in Host Control 2 Register
to select UHS Mode. This patch adds a new UhsSignaling type routine to
the NotifyPhase of the SdMmcOverride protocol.

UHS signaling configuration is moved to a common, default routine
(SdMmcHcUhsSignaling). After it is executed, the protocol producer
can override the values if needed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg/SdMmcPciHcDxe: Add an optional parameter in NotifyPhase
Marcin Wojtas [Fri, 9 Nov 2018 23:01:24 +0000 (07:01 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Add an optional parameter in NotifyPhase

In order to ensure bigger flexibility in the NotifyPhase
routine of the SdMmcOverride protocol, enable using an
optional phase-specific data. This will allow to exchange
more information between the protocol producer driver
and SdMmcPciHcDxe in the newly added callbacks.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoIntelFsp2WrapperPkg: Support FSP Dispatch mode
Chasel, Chiu [Tue, 6 Nov 2018 07:31:31 +0000 (15:31 +0800)]
IntelFsp2WrapperPkg: Support FSP Dispatch mode

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

Provides PCD selection for FSP Wrapper to support Dispatch
mode. Also PcdFspmBaseAddress should support Dynamic for
recovery scenario (multiple FSP-M binary in flash)

Test: Verified on internal platform and both API and
      DISPATCH modes booted successfully.

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Desimone Nathaniel L <nathaniel.l.desimone@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
5 years agoIntelFsp2WrapperPkg: Revert 90c5bc08
Chasel, Chiu [Tue, 20 Nov 2018 03:45:17 +0000 (11:45 +0800)]
IntelFsp2WrapperPkg: Revert 90c5bc08

Commit message issue and reverted commit
90c5bc081d15d077606131a61114ddfdefe62e61.

Will re-submit with correct formats.

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoIntelFsp2WrapperPkg: Support FSP Dispatch mode
Chasel, Chiu [Tue, 6 Nov 2018 07:31:31 +0000 (15:31 +0800)]
IntelFsp2WrapperPkg: Support FSP Dispatch mode

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

Provides PCD selection for FSP Wrapper to support Dispatch
mode. Also PcdFspmBaseAddress should support Dynamic for
recovery scenario (multiple FSP-M binary in flash)

Test: Verified on internal platform and both API and
      DISPATCH modes booted successfully.

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Desimone Nathaniel L <nathaniel.l.desimone@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
5 years agoSecurityPkg: TCG Add more Event type
Zhang, Chao B [Sat, 17 Nov 2018 15:40:55 +0000 (23:40 +0800)]
SecurityPkg: TCG Add more Event type

Add more event log type defined in TCG PTP spec 00.51
https://trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v51.pdf

Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
5 years agoBaseTools: Fix the problem using FILE_GUID override in .dsc
Feng, Bob C [Fri, 16 Nov 2018 02:12:15 +0000 (10:12 +0800)]
BaseTools: Fix the problem using FILE_GUID override in .dsc

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

This patch is going to fix the problem using FILE_GUID override in .dsc.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: BobCF <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoArmVirtPkg/PrePi: clear frame pointer in startup code
Ard Biesheuvel [Fri, 16 Nov 2018 22:52:59 +0000 (14:52 -0800)]
ArmVirtPkg/PrePi: clear frame pointer in startup code

When setting up the stack in the startup code and jumping into C code
for the first time, ensure that the frame pointer register is cleared
so that backtraces terminate correctly. Otherwise, output like the
below is shown when encountering an exception on a DEBUG build:

  Synchronous Exception at 0x0000000078A14780
  PC 0x000078A14780 (0x000078A00000+0x00014780) [ 0] ArmVeNorFlashDxe.dll
  PC 0x000078A10634 (0x000078A00000+0x00010634) [ 0] ArmVeNorFlashDxe.dll
  PC 0x000078A11CF0 (0x000078A00000+0x00011CF0) [ 0] ArmVeNorFlashDxe.dll
  PC 0x000078A11DD0 (0x000078A00000+0x00011DD0) [ 0] ArmVeNorFlashDxe.dll
  PC 0x00007BC9D87C (0x00007BC98000+0x0000587C) [ 1] PartitionDxe.dll
  PC 0x00007BC99B3C (0x00007BC98000+0x00001B3C) [ 1] PartitionDxe.dll
  PC 0x00007F362F50 (0x00007F359000+0x00009F50) [ 2] DxeCore.dll
  PC 0x00007BD63BB0 (0x00007BD5B000+0x00008BB0) [ 3] BdsDxe.dll
  PC 0x00007BD6EE00 (0x00007BD5B000+0x00013E00) [ 3] BdsDxe.dll
  PC 0x00007BD67C70 (0x00007BD5B000+0x0000CC70) [ 3] BdsDxe.dll
  PC 0x00007F3724F0 (0x00007F359000+0x000194F0) [ 4] DxeCore.dll
  PC 0x00004008FC30
  PC 0x000040090130
  PC 0x5800F6025800F5E1

  Recursive exception occurred while dumping the CPU state

which is rather unhelpful, given that this prevent the remaining debug
output from being printed (register dump, stack dump, fault related
system registers etc)

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmPlatformPkg: clear frame pointer in startup code
Ard Biesheuvel [Fri, 16 Nov 2018 22:49:14 +0000 (14:49 -0800)]
ArmPlatformPkg: clear frame pointer in startup code

When setting up the stack in the startup code and jumping into C code
for the first time, ensure that the frame pointer register is cleared
so that backtraces terminate correctly. Otherwise, output like the
below is shown when encountering an exception on a DEBUG build:

  Synchronous Exception at 0x0000000078A14780
  PC 0x000078A14780 (0x000078A00000+0x00014780) [ 0] ArmVeNorFlashDxe.dll
  PC 0x000078A10634 (0x000078A00000+0x00010634) [ 0] ArmVeNorFlashDxe.dll
  PC 0x000078A11CF0 (0x000078A00000+0x00011CF0) [ 0] ArmVeNorFlashDxe.dll
  PC 0x000078A11DD0 (0x000078A00000+0x00011DD0) [ 0] ArmVeNorFlashDxe.dll
  PC 0x00007BC9D87C (0x00007BC98000+0x0000587C) [ 1] PartitionDxe.dll
  PC 0x00007BC99B3C (0x00007BC98000+0x00001B3C) [ 1] PartitionDxe.dll
  PC 0x00007F362F50 (0x00007F359000+0x00009F50) [ 2] DxeCore.dll
  PC 0x00007BD63BB0 (0x00007BD5B000+0x00008BB0) [ 3] BdsDxe.dll
  PC 0x00007BD6EE00 (0x00007BD5B000+0x00013E00) [ 3] BdsDxe.dll
  PC 0x00007BD67C70 (0x00007BD5B000+0x0000CC70) [ 3] BdsDxe.dll
  PC 0x00007F3724F0 (0x00007F359000+0x000194F0) [ 4] DxeCore.dll
  PC 0x00004008FC30
  PC 0x000040090130
  PC 0x5800F6025800F5E1

  Recursive exception occurred while dumping the CPU state

which is rather unhelpful, given that this prevent the remaining debug
output from being printed (register dump, stack dump, fault related
system registers etc)

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoMdeModulePkg: Remove PcdIdentifyMappingPageTablePtr
Shenglei Zhang [Mon, 19 Nov 2018 04:38:48 +0000 (12:38 +0800)]
MdeModulePkg: Remove PcdIdentifyMappingPageTablePtr

PcdIdentifyMappingPageTablePtr was used to share page
table buffer between modules.
Buf after some changes on 2015/07/17, it was useless
and could be removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1304

v2:
1.Remove PcdIdentifyMappingPageTablePtr in MdeModulePkg.uni.
2.Update the commit message.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoUnixPkg: Remove UnixPkg and update Maintainers.txt
Shenglei Zhang [Fri, 2 Nov 2018 02:34:58 +0000 (10:34 +0800)]
UnixPkg: Remove UnixPkg and update Maintainers.txt

UnixPkg is deprecated.
The same functionality is supported using the EmulatorPkg.
Please see EmulatorPkg/README for more information about
EmulatorPkg.
https://bugzilla.tianocore.org/show_bug.cgi?id=1291

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMaintainers.txt: Remove EdkShellPkg and EkdShellBinPkg
shenglei [Wed, 31 Oct 2018 01:43:53 +0000 (09:43 +0800)]
Maintainers.txt: Remove EdkShellPkg and EkdShellBinPkg

Given that EdkShellPkg and EkdShellBinPkg will be removed,
information about them in Maintainers.txt should also be
deleted.
https://bugzilla.tianocore.org/show_bug.cgi?id=1107
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoEdkShellPkg: Remove EdkShellPkg
shenglei [Wed, 31 Oct 2018 01:52:17 +0000 (09:52 +0800)]
EdkShellPkg: Remove EdkShellPkg

EdkShellPkg is removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1107

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoEdkShellBinPkg: Remove EdkShellBinPkg
shenglei [Mon, 29 Oct 2018 01:22:45 +0000 (09:22 +0800)]
EdkShellBinPkg: Remove EdkShellBinPkg

EdkShellBinPkg is removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoVlv2TbltDevicePkg: Remove EdkShellBinPkg with ShellPkg
shenglei [Wed, 31 Oct 2018 03:10:02 +0000 (11:10 +0800)]
Vlv2TbltDevicePkg: Remove EdkShellBinPkg with ShellPkg

Replace EdkShellBinPkg with ShellPkg in PlatformPkg.fdf,
PlatformPkgGcc.fdf, PlatformPkgGccX64.dsc,
PlatformPkgIA32.dsc and PlatformPkgX64.dsc.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

Cc: David Wei <david.wei@intel.com>
Cc: zailiang sun <zailiang.sun@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
5 years agoOvmfPkg: Remove EdkShellBinPkg in FDF
shenglei [Wed, 31 Oct 2018 03:07:15 +0000 (11:07 +0800)]
OvmfPkg: Remove EdkShellBinPkg in FDF

Remove EdkShellBinPkg in OvmfPkgIa32.fdf,
OvmfPkg/OvmfPkgIa32X64.fdf amd OvmfPkg/OvmfPkgX64.fdf.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

v2: Remove USE_OLD_SHELL in DSC and FDF because it will be
    unnecessary to use it.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoNt32Pkg: Remove EdkShellBinPkg in FDF and DEC
shenglei [Wed, 31 Oct 2018 03:04:51 +0000 (11:04 +0800)]
Nt32Pkg: Remove EdkShellBinPkg in FDF and DEC

Remove EdkShellBinPkg in Nt32Pkg.dec and Nt32Pkg.fdf.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

v2: Remove USE_OLD_SHELL because it will not be used.

v4:Remove PcdShellFile in Nt32Pkg.dsc.
https://bugzilla.tianocore.org/show_bug.cgi?id=1298

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoEmulatorPkg: Remove EdkShellBinPkg in FDF and DEC
shenglei [Wed, 31 Oct 2018 03:02:41 +0000 (11:02 +0800)]
EmulatorPkg: Remove EdkShellBinPkg in FDF and DEC

Remove EdkShellBinPkg in EmulatorPkg.dec and
EmulatorPkg.fdf.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

v2: Remove USE_OLD_SHELL because it will not be used.

v4: Remove PcdShellFile in EmulatorPkg.dsc.
https://bugzilla.tianocore.org/show_bug.cgi?id=1298

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
5 years agoMdeModulePkg/SdDxe: Fix potential NULL pointer access
Jeff Brasen [Fri, 16 Nov 2018 08:09:48 +0000 (16:09 +0800)]
MdeModulePkg/SdDxe: Fix potential NULL pointer access

SdReadWrite can be called with a NULL Token for synchronous operations.
Add guard for DEBUG print to only print event pointer with Token is not
NULL.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoEmulatorPkg/build.sh: Fix 'run' path to simulator host executable
Liu Yu [Sun, 18 Nov 2018 12:32:50 +0000 (12:32 +0000)]
EmulatorPkg/build.sh: Fix 'run' path to simulator host executable

Fixes: f89c018f3d "EmulatorPkg/Win: Enable 64bit (SEC, PEI, DXE all run at 64bit)"
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Pedroa Liu <pedroa.liu@outlook.com>
5 years agoArmPkg/ArmGicDxe ARM: fix encoding for GICv3 interrupt acknowledge
Ard Biesheuvel [Wed, 14 Nov 2018 19:27:24 +0000 (11:27 -0800)]
ArmPkg/ArmGicDxe ARM: fix encoding for GICv3 interrupt acknowledge

Fix a typo in the 32-bit ARM version of the GICv3 driver, which uses
the wrong system register encoding to access ICC_IAR1, and attempted
to access ICC_IAR0 instead. This results in boot time hangs both
under QEMU emulation and on real hardware.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoMdePkg/BaseIoLibIntrinsicArmVirt ARM: avoid double word loads and stores
Ard Biesheuvel [Wed, 7 Nov 2018 13:13:01 +0000 (14:13 +0100)]
MdePkg/BaseIoLibIntrinsicArmVirt ARM: avoid double word loads and stores

BaseIoLibIntrinsicArmVirt was created to prevent LTO from merging
accesses to MMIO regions, resulting in instructions with multiple
output registers that KVM on ARM cannot emulate (since the exception
syndrome information that KVM relies on can only describe a single
output register)

However, using double word loads on ARM amounts to the same thing,
and so code that relies on doing 64-bit MMIO to regions that are
emulated under KVM (such as the GICv3 TYPER register) will still
suffer from the original issue.

So replace ldrd and strd with equivalent two instruction sequences.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoUefiCpuPkg/CommonFeature: Always set FEATURE_CONTROL.Lock
Ruiyu Ni [Tue, 13 Nov 2018 07:34:33 +0000 (15:34 +0800)]
UefiCpuPkg/CommonFeature: Always set FEATURE_CONTROL.Lock

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

The patch reverts commit 1ed6498c4a0210204bf4b95cc0c0cd6623ad6a0b
* UefiCpuPkg/CommonFeature: Skip locking when the feature is disabled

FEATURE_CONTROL.Lock bit is controlled by feature
CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER. The commit 1ed649 fixes
a bug that when the feature is disabled, the Lock bit is cleared.
But it's a security hole if the bit is cleared when booting OS.
We can argue that platform needs to make sure the value
of PcdCpuFeaturesUserConfiguration should be set properly to make
sure feature CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER is enabled.

But it's better to guarantee this in the generic core code.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
5 years agoMdeModulePkg/NvmExpressPei: Refine data buffer & len check in PassThru
Hao Wu [Fri, 9 Nov 2018 07:14:08 +0000 (15:14 +0800)]
MdeModulePkg/NvmExpressPei: Refine data buffer & len check in PassThru

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

The fix is similar to commit ebb6c7633bca47fcd5b460a67e18e4a717ea91cc.
We found that a similar fix should be applied to the NVMe PEI driver as
well. Hence, this one is for the PEI counterpart driver.

According to the the NVM Express spec Revision 1.1, for some commands
(like Get/Set Feature Command, Figure 89 & 90 of the spec), the Memory
Buffer maybe optional although the command opcode indicates there is a
data transfer between host & controller (Get/Set Feature Command, Figure
38 of the spec).

Hence, this commit refine the checks for the 'TransferLength' and
'TransferBuffer' field of the
EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET structure to address this
issue.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <Jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
5 years agoMaintainers.txt: Update EDK II Releases to EDK-II-Release-Planning wiki
Liming Gao [Sat, 10 Nov 2018 14:05:58 +0000 (22:05 +0800)]
Maintainers.txt: Update EDK II Releases to EDK-II-Release-Planning wiki

In V2, add Liming Gao as the maintainer of EDK II Releases.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoReapply "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"
Laszlo Ersek [Fri, 9 Nov 2018 19:16:21 +0000 (20:16 +0100)]
Reapply "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"

This reverts commit e038bde2679bbd200086c25ab43090ad3b8b25a3, reapplying
b2959e9f1a57279506ca46d56bc424fd7fa6b62a.

Note that the commit now being reverted is technically correct; the only
reason we're reverting it is because it should not have been pushed past
the Soft Feature Freeze for the edk2-stable201811 tag.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@linaro.org>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: yuchenlin <yuchenlin@synology.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1319
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: yuchenlin <yuchenlin@synology.com>
5 years agoReapply "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"
Laszlo Ersek [Fri, 9 Nov 2018 19:15:31 +0000 (20:15 +0100)]
Reapply "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"

This reverts commit 98856a724c2acdc0094220d4de615a557dad0f88, reapplying
c137d95081690d4877fbeb5f1856972e84ac32f2.

Note that the commit now being reverted is technically correct; the only
reason we're reverting it is because it should not have been pushed past
the Soft Feature Freeze for the edk2-stable201811 tag.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@linaro.org>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: yuchenlin <yuchenlin@synology.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1319
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: yuchenlin <yuchenlin@synology.com>
5 years agoReapply "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."
Laszlo Ersek [Fri, 9 Nov 2018 19:13:54 +0000 (20:13 +0100)]
Reapply "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."

This reverts commit 438ada5aa5a1174940795678c2dae07cde8f3869,
reapplying 05a5379458725234de8a05780fcb5da2c12680e4.

Note that the commit now being reverted is technically correct; the only
reason we're reverting it is because it should not have been pushed past
the Soft Feature Freeze for the edk2-stable201811 tag.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@linaro.org>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: yuchenlin <yuchenlin@synology.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1319
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: yuchenlin <yuchenlin@synology.com>
5 years agoReapply "OvmfPkg: VMWare SVGA display device register definitions"
Laszlo Ersek [Fri, 9 Nov 2018 18:43:55 +0000 (19:43 +0100)]
Reapply "OvmfPkg: VMWare SVGA display device register definitions"

This reverts commit 328409ce8de7f318ee9c929b64302bd361cd1dbd, reapplying
9bcca53fe466cdff397578328d9d87d257aba493.

Note that the commit now being reverted is technically correct; the only
reason we're reverting it is because it should not have been pushed past
the Soft Feature Freeze for the edk2-stable201811 tag.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@linaro.org>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: yuchenlin <yuchenlin@synology.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1319
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: yuchenlin <yuchenlin@synology.com>
5 years agoIntelFrameworkModulePkg: Fix UEFI and Tiano Decompression logic issue
Liming Gao [Thu, 8 Nov 2018 23:58:16 +0000 (07:58 +0800)]
IntelFrameworkModulePkg: Fix UEFI and Tiano Decompression logic issue

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

This is a regression issue caused by 684db6da64bc7b5faee4e1174e801c245f563b5c.
In Decode() function, once mOutBuf is fully filled, Decode() should return.
Current logic misses the checker of mOutBuf after while() loop.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoMdePkg BaseUefiDecompressLib: Fix UEFI Decompression logic issue
Liming Gao [Thu, 8 Nov 2018 23:58:15 +0000 (07:58 +0800)]
MdePkg BaseUefiDecompressLib: Fix UEFI Decompression logic issue

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

This is a regression issue caused by 2ec7953d49677142c5f7552e9e3d96fb406ba0c4.
In Decode() function, once mOutBuf is fully filled, Decode() should return.
Current logic misses the checker of mOutBuf after while() loop.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Fix UEFI and Tiano Decompression logic issue
Liming Gao [Thu, 8 Nov 2018 23:58:14 +0000 (07:58 +0800)]
BaseTools: Fix UEFI and Tiano Decompression logic issue

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

This is a regression issue caused by 041d89bc0f0119df37a5fce1d0f16495ff905089.
In Decode() function, once mOutBuf is fully filled, Decode() should return.
Current logic misses the checker of mOutBuf after while() loop.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoRevert "MdeModulePkg/DisplayEngine: Remove useless NULL ptr check for NewPos"
Liming Gao [Sat, 10 Nov 2018 14:06:39 +0000 (22:06 +0800)]
Revert "MdeModulePkg/DisplayEngine: Remove useless NULL ptr check for NewPos"

This reverts commit 8cd4e734ccdfbc961c72aeaa8dbd3f5154171f9b.

It is not a real bug fix. It should not be pushed after
Hard Feature Freeze for edk2-stable201811 tag.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Bi Dandan <dandan.bi@intel.com>
5 years agoMdePkg: Fix incorrect check for DisplayOnly text format in AcpiEx
Dandan Bi [Thu, 8 Nov 2018 13:33:53 +0000 (21:33 +0800)]
MdePkg: Fix incorrect check for DisplayOnly text format in AcpiEx

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

Text format for AcpiEx device path in UEFI Spec:
AcpiEx(HID,CID,UID,HIDSTR,CIDSTR,UIDSTR)
AcpiEx(HID|HIDSTR,(CID|CIDSTR,UID|UIDSTR))(Display Only)

When convert device path to text for AcpiEx device path,
current code check AllowShortcuts parameter to convert
the device path to DisplayOnly text format(shorter text
representation) by mistake.
It should check DisplayOnly parameter.

This commit is to fix this issue.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Separate semaphore container.
Eric Dong [Sat, 10 Nov 2018 02:53:41 +0000 (10:53 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Separate semaphore container.

In current implementation, core and package level sync uses same semaphores.
Sharing the semaphore may cause wrong execution order.
For example:
1. Feature A has CPU_FEATURE_CORE_BEFORE dependency with Feature B.
2. Feature C has CPU_FEATURE_PACKAGE_AFTER dependency with Feature B.
The expected feature initialization order is A B C:
A ---- (Core Depends) ----> B ---- (Package Depends) ----> C

For a CPU has 1 package, 2 cores and 4 threads. The feature initialization
order may like below:

   Thread#1             Thread#2       Thread#3         Thread#4
   [A.Init]             [A.Init]                        [A.Init]
Release(S1, S2)        Release(S1, S2)                Release(S3, S4)
Wait(S1) * 2           Wait(S2) * 2  <------------------------------- Core sync

   [B.Init]             [B.Init]
Release (S1,S2,S3,S4)
Wait (S1) * 4  <----------------------------------------------------- Package sync
                                                      Wait(S4 * 2) <- Core sync
                                                        [B.Init]

In above case, for thread#4, when it syncs in core level, Wait(S4) * 2 isn't
blocked and [B.Init] runs. But [A.Init] hasn't run in thread#3. It's wrong!
Thread#4 should execute [B.Init] after thread#3 executes [A.Init] because B
core level depends on A.

The reason of the wrong execution order is that S4 is released in thread#1
by calling Release (S1, S2, S3, S4) and in thread #4 by calling
Release (S3, S4).

To fix this issue, core level sync and package level sync should use separate
semaphores.

In above example, the S4 released in Release (S1, S2, S3, S4) should not be the
same semaphore as that in Release (S3, S4).

Related BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1311

Cc: Laszlo Ersek <lersek@redhat.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: Ruiyu Ni <ruiyu.ni@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoUefiCpuPkg/RegisterCpuFeaturesLib: Separate semaphore container.
Eric Dong [Thu, 8 Nov 2018 01:06:33 +0000 (09:06 +0800)]
UefiCpuPkg/RegisterCpuFeaturesLib: Separate semaphore container.

In current implementation, core and package level sync uses same semaphores.
Sharing the semaphore may cause wrong execution order.
For example:
1. Feature A has CPU_FEATURE_CORE_BEFORE dependency with Feature B.
2. Feature C has CPU_FEATURE_PACKAGE_AFTER dependency with Feature B.
The expected feature initialization order is A B C:
A ---- (Core Depends) ----> B ---- (Package Depends) ----> C

For a CPU has 1 package, 2 cores and 4 threads. The feature initialization
order may like below:

   Thread#1             Thread#2       Thread#3         Thread#4
   [A.Init]             [A.Init]                        [A.Init]
Release(S1, S2)        Release(S1, S2)                Release(S3, S4)
Wait(S1) * 2           Wait(S2) * 2  <------------------------------- Core sync

   [B.Init]             [B.Init]
Release (S1,S2,S3,S4)
Wait (S1) * 4  <----------------------------------------------------- Package sync
                                                      Wait(S4 * 2) <- Core sync
                                                        [B.Init]

In above case, for thread#4, when it syncs in core level, Wait(S4) * 2 isn't
blocked and [B.Init] runs. But [A.Init] hasn't run in thread#3. It's wrong!
Thread#4 should execute [B.Init] after thread#3 executes [A.Init] because B
core level depends on A.

The reason of the wrong execution order is that S4 is released in thread#1
by calling Release (S1, S2, S3, S4) and in thread #4 by calling
Release (S3, S4).

To fix this issue, core level sync and package level sync should use separate
semaphores.

In above example, the S4 released in Release (S1, S2, S3, S4) should not be the
same semaphore as that in Release (S3, S4).

Related BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1311

Cc: Laszlo Ersek <lersek@redhat.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: Ruiyu Ni <ruiyu.ni@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoUefiCpuPkg/RegisterCpuFeaturesLib: Adjust Order.
Eric Dong [Fri, 9 Nov 2018 05:20:41 +0000 (13:20 +0800)]
UefiCpuPkg/RegisterCpuFeaturesLib: Adjust Order.

V2 changes:
V1 change has regression which caused by change feature order.
V2 changes logic to detect dependence not only for the
neighborhood features. It need to check all features in the list.

V1 Changes:
In current code logic, only adjust feature position if current
CPU feature position not follow the request order. Just like
Feature A need to be executed before feature B, but current
feature A registers after feature B. So code will adjust the
position for feature A, move it to just before feature B. If
the position already met the requirement, code will not adjust
the position.

This logic has issue when met all below cases:
1. feature A has core or package level dependence with feature B.
2. feature A is register before feature B.
3. Also exist other features exist between feature A and B.

Root cause is driver ignores the dependence for this case, so
threads may execute not follow the dependence order.

Fix this issue by change code logic to adjust feature position
for CPU features which has dependence relationship.

Related BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1311

Cc: Laszlo Ersek <lersek@redhat.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: Ruiyu Ni <Ruiyu.ni@intel.com>
5 years agoMdeModulePkg/DisplayEngine: Remove useless NULL ptr check for NewPos
Dandan Bi [Wed, 7 Nov 2018 08:14:22 +0000 (16:14 +0800)]
MdeModulePkg/DisplayEngine: Remove useless NULL ptr check for NewPos

In function UiDisplayMenu, the NewPos ptr which used to point to the
highlight menu entry. It will always point to the menu entry which
need to be highlighted or the gMenuOption menu if the highlight menu
is not found.
So we can remove the NULL ptr check for NewPos in this function.
And add the ASSERT code to avoid if any false positive reports
of NULL pointer dereference issue raised from static analysis.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoSourceLevelDebugPkg/Readme.txt: Update UDK Debugger Tool & manual URL
Hao Wu [Wed, 7 Nov 2018 02:27:28 +0000 (10:27 +0800)]
SourceLevelDebugPkg/Readme.txt: Update UDK Debugger Tool & manual URL

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

The commit updates the link to get access to the Intel(R) UDK Debugger
Tool and its detailed user manual.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoShellPkg/ShellLib: Fix potential NULL deference issue
Ruiyu Ni [Wed, 7 Nov 2018 09:34:20 +0000 (17:34 +0800)]
ShellPkg/ShellLib: Fix potential NULL deference issue

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoMdePkg/BaseSynchronizationLib: Fix InternalSync[De|In]crement
Ruiyu Ni [Wed, 7 Nov 2018 15:51:51 +0000 (23:51 +0800)]
MdePkg/BaseSynchronizationLib: Fix InternalSync[De|In]crement

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

Today's code generates assembly code as below for
InternalSyncIncrement:
  __asm__ __volatile__ (
    "movl    $1, %%eax  \n\t"
    "lock               \n\t"
    "xadd    %%eax, %1  \n\t"
    "inc     %%eax      \n\t"
    : "=a" (Result),          // %0
      "+m" (*Value)           // %1
    :                         // no inputs that aren't also outputs
    : "memory",
      "cc"
    );

 0:       55      pushl   %ebp
 1:       89 e5   movl    %esp, %ebp
 3:       8b 45 08        movl    8(%ebp), %eax
 6:       b8 01 00 00 00  movl    $1, %eax
 b:       f0      lock
 c:       0f c1 00        xaddl   %eax, _InternalSyncIncrement(%eax)
 f:       40      incl    %eax
10:       5d      popl    %ebp
11:       c3      retl

Line #3 and Line #6 both use EAX as destination register.
Line #c uses EAX and (EAX).

The output operand "=a" tells GCC that EAX is used for output.
But GCC only assumes that EAX will be used in the very last
instruction.

Per GCC document,
"Use the '&' constraint modifier on all output operands that must
 not  overlap an input. Otherwise, GCC may allocate the output
 operand in the same register as an unrelated input operand, on
 the assumption that the assembler code consumes its inputs before
 producing outputs. This assumption may be false if the assembler
 code actually consists of more than one instruction."

"=&a" should be used to tell GCC not use EAX before the assembly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: 8a94eb9283fa09a30f5f06f0c12cf0ee4e14fbcf
Fixes: 17634d026f968c404b039a8d8431b6389dd396ea
5 years agoUefiCpuPkg/SmmCpu: Block access-out only when static paging is used
Jiewen Yao [Sat, 3 Nov 2018 11:59:01 +0000 (19:59 +0800)]
UefiCpuPkg/SmmCpu: Block access-out only when static paging is used

When static paging is disabled, page table for below 4GB is created
and page table for above 4GB is created dynamically in page fault
handler.

Today's implementation only allow SMM access-out to below types of
memory address no matter static paging is enabled or not:
1. Reserved, run time and ACPI NVS type
2. MMIO

But certain platform feature like RAS may need to access other types
of memory from SMM. Today's code blocks these platforms.
This patch simplifies the policy to only block when static paging
is used so that the static paging can be disabled in these platforms
to meet their SMM access-out need.

Setting PcdCpuSmmStaticPageTable to FALSE can disable the static
paging.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoArmPkg/ArmGicDxe: Fix GICv3 interrupt routing mode bug
Ming Huang [Mon, 29 Oct 2018 04:57:08 +0000 (12:57 +0800)]
ArmPkg/ArmGicDxe: Fix GICv3 interrupt routing mode bug

Setting GICD_IROUTERn.IRM and GICD_IROUTERn.{Aff3,Aff2,Aff1,Aff0}
at the same time is nonsensical (see 8.9.13 in the GICv3 spec, which
says of GICD_IROUTERn.IRM that "When this bit is set to 1,
GICD_IROUTER<n>.{Aff3,Aff2,Aff1,Aff0} are UNKNOWN"). There is also no
guarantee that IRM is implemented (see GICD_TYPER.No1N which indicates
whether the implementation supports this or not).

Let's thus not set this bit, as we want all SPIs to be delivered to the
same CPU, and not be broadcast to all of them.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang <ming.huang@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
5 years agoMdeModulePkg/Core: fix ineffective guard page issue
Jian J Wang [Wed, 7 Nov 2018 00:48:09 +0000 (08:48 +0800)]
MdeModulePkg/Core: fix ineffective guard page issue

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

This issue originates from following patch which allows to enable
paging if PcdImageProtectionPolicy and PcdDxeNxMemoryProtectionPolicy
(in addition to PcdSetNxForStack) are set to enable related features.

  5267926134d17e86672b84fd57b438f05ffa68e1

Due to above change, PcdImageProtectionPolicy will be set to 0 by
default in many platforms, which, in turn, cause following code in
MdeModulePkg\Core\Dxe\Misc\MemoryProtection.c fail the creation of
notify event of CpuArchProtocol.

1138:  if (mImageProtectionPolicy != 0 ||
           PcdGet64 (PcdDxeNxMemoryProtectionPolicy) != 0) {
1139:  Status = CoreCreateEvent (
...
1142:             MemoryProtectionCpuArchProtocolNotify,
...
1145:             );

Then following call flow won't be done and Guard pages will not be
set as not-present in SetAllGuardPages() eventually.

   MemoryProtectionCpuArchProtocolNotify()
=> HeapGuardCpuArchProtocolNotify()
=> SetAllGuardPages()

The solution is removing the if(...) statement so that the notify
event will always be created and registered. This won't cause
unnecessary code execution because, in the notify event handler,
the related PCDs like

    PcdImageProtectionPolicy and
    PcdDxeNxMemoryProtectionPolicy

will be checked again before doing related jobs.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/Core: fill logic hole in MemoryProtectionCpuArchProtocolNotify
Jian J Wang [Sat, 3 Nov 2018 05:58:28 +0000 (13:58 +0800)]
MdeModulePkg/Core: fill logic hole in MemoryProtectionCpuArchProtocolNotify

At the end of of MemoryProtectionCpuArchProtocolNotify there's cleanup
code to free resource. But at line 978, 994, 1005 the function returns
directly. This patch use "goto" to replace "return" to make sure the
resource is freed before exit.

1029:  CoreCloseEvent (Event);
1030:  return;

There's another memory leak after calling gBS->LocateHandleBuffer() in
the same function:

  Status = gBS->LocateHandleBuffer (
                  ByProtocol,
                  &gEfiLoadedImageProtocolGuid,
                  NULL,
                  &NoHandles,
                  &HandleBuffer
                  );

HandleBuffer is allocated in above call but never freed. This patch
will also add code to free it.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoRevert "XhciDxe: Use common buffer for AsyncInterruptTransfer"
Star Zeng [Tue, 6 Nov 2018 13:47:39 +0000 (21:47 +0800)]
Revert "XhciDxe: Use common buffer for AsyncInterruptTransfer"

There is concern at the thread
https://lists.01.org/pipermail/edk2-devel/2018-November/031951.html.
And the time point is a little sensitive as it is near edk2-stable201811.

This reverts commit 777920997152a2e68f664241f6080b64ff21edd6.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoRevert "EhciDxe: Use common buffer for AsyncInterruptTransfer"
Star Zeng [Tue, 6 Nov 2018 13:45:25 +0000 (21:45 +0800)]
Revert "EhciDxe: Use common buffer for AsyncInterruptTransfer"

There is concern at the thread
https://lists.01.org/pipermail/edk2-devel/2018-November/031951.html.
And the time point is a little sensitive as it is near edk2-stable201811.

This reverts commit 0cd645250306b244a5d6e0e293ed1786ec101641.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoUefiCpuPkg/CommonFeature: Skip locking when the feature is disabled
Ruiyu Ni [Tue, 6 Nov 2018 09:04:39 +0000 (17:04 +0800)]
UefiCpuPkg/CommonFeature: Skip locking when the feature is disabled

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

Today's code unconditionally sets the IA32_FEATURE_CONTROL.Lock to 1
no matter the feature is enabled or not.

The patch fixes this issue by only setting the Lock bit to 1 when
the feature is enabled.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
5 years agoRevert "OvmfPkg: VMWare SVGA display device register definitions"
yuchenlin [Fri, 2 Nov 2018 03:24:01 +0000 (11:24 +0800)]
Revert "OvmfPkg: VMWare SVGA display device register definitions"

This reverts commit 9bcca53fe466cdff397578328d9d87d257aba493.

We reverted VMWare SVGA driver. We don't need these definitions too.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoRevert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."
yuchenlin [Fri, 2 Nov 2018 03:24:00 +0000 (11:24 +0800)]
Revert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."

This reverts commit 05a5379458725234de8a05780fcb5da2c12680e4.

The VMWare SVGA display device implemented by Qemu (-vga vmware) uses
an I/O-type BAR which is laid out such that some register offsets are
not aligned to the read/write width with which they are expected to be
accessed. However, we reverted the initialization of VMWare SVGA device,
we don't need such unaligned I/O.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoRevert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"
yuchenlin [Fri, 2 Nov 2018 03:23:59 +0000 (11:23 +0800)]
Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"

This reverts commit c137d95081690d4877fbeb5f1856972e84ac32f2.

The VMWare SVGA model now -- since commit 104bd1dc70 in QEMU --
falls back to stdvga (that is, Bochs) if we don't setup VMWare SVGA
FIFO.

To simplify QemuVideoDxe, we don't intend to implement the VMWare SVGA
FIFO setup feature. It means our current VMW SVGA driver code is
basically dead. To simplify the problem, we will replace the old
VMWare SVGA driver to Bochs interface. It should work on all QEMU
version.

The first step for using Bochs interface is to revert old driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoRevert "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"
yuchenlin [Fri, 2 Nov 2018 03:23:58 +0000 (11:23 +0800)]
Revert "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"

This reverts commit b2959e9f1a57279506ca46d56bc424fd7fa6b62a.

The VMWare SVGA display device implemented by Qemu (-vga vmware) uses
an I/O-type BAR which is laid out such that some register offsets are
not aligned to the read/write width with which they are expected to be
accessed. However, we will revert the initialization of VMWare SVGA
device later, we don't need such unaligned I/O.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoShellPkg/TftpDynamicCommand: Clarify the retry count option in command.
Jiaxin Wu [Mon, 5 Nov 2018 06:52:30 +0000 (14:52 +0800)]
ShellPkg/TftpDynamicCommand: Clarify the retry count option in command.

[-c <retry count>] is to define the number of times to transmit request
packets and wait for a response. The default value is 6. But it doesn't
specify the behavior of zero value. Here, The patch is to clear that:
Set to zero also means to use the default value.

Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoMdeModulePkg/Mtftp4Dxe: Fix invalid configuration of MTFTP local port.
Jiaxin Wu [Mon, 5 Nov 2018 06:46:57 +0000 (14:46 +0800)]
MdeModulePkg/Mtftp4Dxe: Fix invalid configuration of MTFTP local port.

This patch is to fix the invalid setting of MTFTP local port. The
issue can be reproduced by tftp shell command by using [-l port]
option.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
5 years agoOvmfPkg: Replace obsoleted network drivers from platform DSC/FDF.
Fu Siyuan [Tue, 30 Oct 2018 06:49:42 +0000 (14:49 +0800)]
OvmfPkg: Replace obsoleted network drivers from platform DSC/FDF.

V2:
Add missed library instance for NetworkPkg iSCSI driver.

This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those
ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively
maintained and will be removed from edk2 master soon.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoVlv2TbltDevicePkg: Replace obsoleted drivers from platform DSC/FDF.
Fu Siyuan [Tue, 30 Oct 2018 06:51:16 +0000 (14:51 +0800)]
Vlv2TbltDevicePkg: Replace obsoleted drivers from platform DSC/FDF.

V2:
Add missed library instance for NetworkPkg iSCSI driver.

This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those
ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively
maintained and will be removed from edk2 master soon.

Cc: David Wei <david.wei@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
5 years agoMaintainer.txt: Add Chao to be co-maintainer of SignedCapsulePkg
Zhang, Chao B [Mon, 5 Nov 2018 14:19:24 +0000 (22:19 +0800)]
Maintainer.txt: Add Chao to be co-maintainer of SignedCapsulePkg

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
5 years agoArmPkg/OpteeLib: Fix compilation issues for ARM (32-bit)
Sumit Garg [Fri, 2 Nov 2018 06:53:14 +0000 (12:23 +0530)]
ArmPkg/OpteeLib: Fix compilation issues for ARM (32-bit)

Correct usage of EFI_PHYSICAL_ADDRESS (always 64-bit) vs. pointers
(depending on architecture).

Reported-by: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoEmulatorPkg: Replace obsoleted network drivers from platform DSC/FDF.
Fu Siyuan [Tue, 30 Oct 2018 06:47:33 +0000 (14:47 +0800)]
EmulatorPkg: Replace obsoleted network drivers from platform DSC/FDF.

This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those
ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively
maintained and will be removed from edk2 master soon.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoNt32Pkg: Replace obsoleted network drivers from NT32 platform DSC/FDF.
Fu Siyuan [Tue, 30 Oct 2018 06:43:37 +0000 (14:43 +0800)]
Nt32Pkg: Replace obsoleted network drivers from NT32 platform DSC/FDF.

This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those
ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively
maintained and will be removed from edk2 master soon.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoCorebootPayloadPkg: Remove EdkShellBinPkg in FDF
shenglei [Mon, 5 Nov 2018 03:08:07 +0000 (11:08 +0800)]
CorebootPayloadPkg: Remove EdkShellBinPkg in FDF

Remove EdkShellBinPkg in CorebootPayloadPkg.fdf.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

v3:Remove FULL_BIN and change SHELL_TYPE from FULL_BIN
to UEFI_BIN.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Change-Id: I4db7068a3a1f68a1f6303079b73dc548c9feb2e3
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
5 years agoBaseTools: Use common cc flag for building PcdValueInit.
BobCF [Fri, 2 Nov 2018 05:56:38 +0000 (13:56 +0800)]
BaseTools: Use common cc flag for building PcdValueInit.

V3:

Update the patch to avoid "reduce" function fail.

V2:
Support to extract the common cc flag from a
combined cc flag string. For example
MSFT:*_*_IA32_CC_FLAGS = /D DISABLE_NEW_DEPRECATED_INTERFACES /DDEF_IA32
MSFT:*_*_X64_CC_FLAGS  = /DDEF_X64 /D DISABLE_NEW_DEPRECATED_INTERFACES

V1:
Use common cc flags for building PcdValueInit. The common
cc flags include the cc flag which is under common arch and
under all build arches.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools build_rule.template: Update aslc rule for XCODE tool chain
Liming Gao [Fri, 2 Nov 2018 15:17:07 +0000 (23:17 +0800)]
BaseTools build_rule.template: Update aslc rule for XCODE tool chain

Update aslc rule to rename the temp output file from .efi to .pecoff.
This change can avoid the conflict .efi file name in output directory.
One is the driver image, another is aslc temp output file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoShellPkg-ShellApp: Provide fully-qualified path to shell scripts
Jim.Dailey@dell.com [Mon, 29 Oct 2018 21:14:51 +0000 (05:14 +0800)]
ShellPkg-ShellApp: Provide fully-qualified path to shell scripts

Provide fully-qualified path to shell scripts

Section 3.6.2 of version 2.2 of the shell specification requires that
the first positional argument (i.e. arg 0) of a shell script resolves
to "the full path name of the script itself."

Ensure that the startup script and any scripts launched by the shell
meet this requirement.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoShellPkg-UefiShellLib: Add a function to fully-qualify paths
Jim.Dailey@dell.com [Mon, 29 Oct 2018 21:14:36 +0000 (05:14 +0800)]
ShellPkg-UefiShellLib: Add a function to fully-qualify paths

Add a function to return a clean, fully-qualified version of some path.

This function handles a (possibly "dirty") input path that may or may
not include a file system reference.

If it does not include a file system reference, then if the input path
does not begin with a forward or backward slash, then the input path is
relative to the current working directory of the current file system.
Otherwise, it is an absolute path within the current file system.

If it does include a file system reference, it may be a reference to the
current or some other file system.  If the file system reference is not
immediately followed by a forward or backward slash, then the input path
is relative to the current working directory of the given file system.
Otherwise, it is an absolute path within the given file system.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoUefiCpuPkg/MpInitLib: Rollback old change 2a5997f8.
Dong, Eric [Fri, 2 Nov 2018 08:27:48 +0000 (16:27 +0800)]
UefiCpuPkg/MpInitLib: Rollback old change 2a5997f8.

In some special cases, after BSP sends Init-sipi-sipi signal
AP needs more time to start the Ap procedure. In this case
BSP may think AP has finished its task but in fact AP hasn't began
yet.

Rollback former change to keep the status which only be used
when AP really finished task.

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: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoMaintainers.txt: Change package maintainer of UefiCpuPkg
Ruiyu Ni [Fri, 2 Nov 2018 09:21:37 +0000 (17:21 +0800)]
Maintainers.txt: Change package maintainer of UefiCpuPkg

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoMaintainers.txt: Change package maintainer of IntelSiliconPkg
Ruiyu Ni [Fri, 2 Nov 2018 09:19:03 +0000 (17:19 +0800)]
Maintainers.txt: Change package maintainer of IntelSiliconPkg

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoBaseTools: Check the max size for string PCD.
Zhao, ZhiqiangX [Wed, 31 Oct 2018 10:35:47 +0000 (18:35 +0800)]
BaseTools: Check the max size for string PCD.

According to PCD_DATABASE_INIT in
edk2\MdeModulePkg\Include\Guid\PcdDataBaseSignatureGuid.h,
the max size for string PCD should not exceed USHRT_MAX 65535(0xffff).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoMdePkg/Base.h: Implement BASE_CR() via OFFSET_OF().
Marvin.Haeuser@outlook.com [Wed, 31 Oct 2018 20:08:35 +0000 (04:08 +0800)]
MdePkg/Base.h: Implement BASE_CR() via OFFSET_OF().

Replace the current NULL pointer dereference to retrieve Field's
offset with a call to OFFSET_OF().  This is implemented via
__builtin_offsetof for GCC and Clang, which eliminates UB caught by
Clang UndefinedBehaviorSanitizer.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools tools_def.template: Add GCC link script option in ASLDLINK_FLAGS
Liming Gao [Thu, 1 Nov 2018 14:35:29 +0000 (22:35 +0800)]
BaseTools tools_def.template: Add GCC link script option in ASLDLINK_FLAGS

GCC link script is used to discard the unused section data from ELF image.
ASLDLINK_FLAGS requires it to remove the unnecessary section data, then
GenFw can be used to retrieve the correct data section from ELF image.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>