]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
4 years agoBaseTools:Remove unused Edk2\BuildNotes2.txt
Fan, ZhijuX [Tue, 18 Jun 2019 06:54:44 +0000 (14:54 +0800)]
BaseTools:Remove unused Edk2\BuildNotes2.txt

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

Edk2\BuildNotes2.txt is not maintained any more. User can find the
related info in wiki. So, this file can be removed.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoEdk2Setup: Support different VS tool chain setup
Dandan Bi [Wed, 12 Jun 2019 03:28:46 +0000 (11:28 +0800)]
Edk2Setup: Support different VS tool chain setup

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

This patch is to update edksetup with additional option:
VS2017 VS2015 VS2013 VS2012 to setup different VS environment.
And will report error if the specified VS tool is not installed.
For VS2017, also consider the case that only VS2017 build tool
is installed.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoEdk2: Remove nt32 related flag in bat files
Dandan Bi [Thu, 6 Jun 2019 02:48:50 +0000 (10:48 +0800)]
Edk2: Remove nt32 related flag in bat files

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

NT32Pkg has been removed, remove nt32 related
flags in bat files.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoSecurityPkg/DxeDeferImageLoadLib: Remove DxeDeferImageLoadLib
Shenglei Zhang [Wed, 19 Jun 2019 01:47:56 +0000 (09:47 +0800)]
SecurityPkg/DxeDeferImageLoadLib: Remove DxeDeferImageLoadLib

The library DxeDeferImageLoadLib supports UID feature and it is conflicted
with the driver SecurityStubDxe (Defer3rdPartyImageLoad.c).
And the UID feature is dropped. So it should be removed from SecurityPkg.
https://bugzilla.tianocore.org/show_bug.cgi?id=1919

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg/DxeCapsuleLibFmp: Add missing NULL pointer check.
Wei6 Xu [Thu, 27 Jun 2019 08:43:06 +0000 (16:43 +0800)]
MdeModulePkg/DxeCapsuleLibFmp: Add missing NULL pointer check.

Add missing NULL pointer check for CapsuleNameBufStart.
Also add comments to notice that capsule name integrity check assumes
the capsule has been validated by IsValidCapsuleHeader().

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoBaseTools/Capsule: Supports multiple payloads and drivers in capsule
Jin, Eric [Wed, 26 Jun 2019 05:55:35 +0000 (13:55 +0800)]
BaseTools/Capsule: Supports multiple payloads and drivers in capsule

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

1)Add arguments "--embedded-driver" to support embedded driver
in command line.
2)Add arguments "--update-image-index" to identify ImageIndex
within the device in command line.
3)Add arguments "-j JSONFILE" to support multiple payloads and
embedded drivers with JSON file.

The update is in a backwards compatible manner, so all command
line options to support single payload are still supported. But
all the options associated with multiple payloads should be
provided in a JSON file.

Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Eric Jin <eric.jin@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoUefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid
Zhichao Gao [Wed, 26 Jun 2019 04:51:55 +0000 (12:51 +0800)]
UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

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

0x0       MicrocodeBegin  MicrocodeEntry  MicrocodeEnd      0xffffffff
|--------------|---------------|---------------|---------------|
                                 valid TotalSize
TotalSize is only valid between 0 and (MicrocodeEnd - MicrocodeEntry).
So add '(UINTN)MicrocodeEntryPoint > (MAX_ADDRESS - TotalSize)' before
'((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd' to make sure
((UINTN)MicrocodeEntryPoint + TotalSize) wouldn't overflow.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoMdeModulePkg/UfsPassThruDxe: Refactor UFS device presence detection
Albecki, Mateusz [Fri, 21 Jun 2019 15:27:02 +0000 (23:27 +0800)]
MdeModulePkg/UfsPassThruDxe: Refactor UFS device presence detection

In current implementation we are checking for device presence every
time we execute UIC command. To make UfsExecUicCommands more generic
checking device presence has been moved to UfsDeviceDetection.

Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoPcAtChipsetPkg: Remove framework modules
Hao A Wu [Mon, 27 May 2019 05:59:30 +0000 (13:59 +0800)]
PcAtChipsetPkg: Remove framework modules

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

The commit will remove the below modules from PcAtChipsetPkg:
* PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf
* PcAtChipsetPkg/8254TimerDxe/8254Timer.inf
* PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf

They are considered legacy framework components and will no longer be used
after the removal of IntelFramework[Module]Pkg.

Also, the unused (after the modules being removed) PCDs will be deleted in
package level DEC/UNI files.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoSecurityPkg: add FvReportPei.inf in dsc for build validation
Jian J Wang [Fri, 10 May 2019 02:22:46 +0000 (10:22 +0800)]
SecurityPkg: add FvReportPei.inf in dsc for build validation

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

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: "Hernandez Beltran, Jorge" <jorge.hernandez.beltran@intel.com>
Cc: Harry Han <harry.han@intel.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoSecurityPkg/FvReportPei: implement a common FV verifier and reporter
Jian J Wang [Fri, 10 May 2019 02:19:36 +0000 (10:19 +0800)]
SecurityPkg/FvReportPei: implement a common FV verifier and reporter

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

This driver implements a common checker, verifier and reporter which is
independent of hardware based root-of-trust.

Usually the hardware based root-of-trust will not verify all BIOS but
part of it. For example, Boot Guard will only verify IBB segment. The IBB
needs to verify other part of BIOS, i.e. other FVs to transfer control to
from IBB. This driver plays the role in IBB to verify FVs not covered by
hardware root-of-trust to make sure integrity of the chain of trust.

To be hardware/platform independent, PPI

  gEdkiiPeiFirmwareVolumeInfoStoredHashFvPpiGuid

is introduced for platform to pass digest information to this driver.
This PPI should include all information needed to verify required FVs in
required boot mode.

struct _EDKII_PEI_FIRMWARE_VOLUME_INFO_STORED_HASH_FV_PPI {
  FV_HASH_INFO            HashInfo;
  UINTN                   FvNumber;
  HASHED_FV_INFO          FvInfo[1];
};

To avoid TOCTOU issue, all FVs to be verified will be copied to memory
before hash calculation. That also means this driver has to be run after
permanent memory has been discovered.

For a measured boot, this driver will install

  gEdkiiPeiFirmwareVolumeInfoPrehashedFvPpiGuid

to report digest of each FV to TCG driver.

For a verified boot, this driver will verify the final hash value
(calculated from the concatenation of each FV's hash) for indicated
FVs against the hash got from platform/hardware.

If pass, it will build EFI_HOB_TYPE_FV (consumed by DXE core) and/or
install gEfiPeiFirmwareVolumeInfoPpiGuid (consumed by PEI core), and
then report status code PcdStatusCodeFvVerificationPass.

If fail, it just report status code PcdStatusCodeFvVerificationFail
and go to dead loop if status report returns.

The platform can register customized handler to process pass and fail
cases differently.

Currently, this driver only supports hash (sha256/384/512) verification
for the performance consideration.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: "Hernandez Beltran, Jorge" <jorge.hernandez.beltran@intel.com>
Cc: Harry Han <harry.han@intel.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoSecurityPkg: add definitions for OBB verification
Jian J Wang [Tue, 19 Feb 2019 12:00:27 +0000 (20:00 +0800)]
SecurityPkg: add definitions for OBB verification

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

gEdkiiPeiFirmwareVolumeInfoStoredHashFvPpiGuid should be installed by
platform to pass FV hash information to the common FV verify/report
driver, in which the hash value will be calculated again based on the
information fed in and then verified.

The information passed in this PPI include:
  - FVs location in flash and length
  - Hash values for different boot mode

The hash value must be calculated in following way (if 3 FVs to calc):

  FV1 -> Hash1
  FV2 -> Hash2
  FV3 -> Hash3
  Hash1 + Hash2 + Hash3 -> HashAll

Only HashAll is stored in this PPI. The purposes for this algorithm
are two:

  1. To report each FV's hash to TCG driver and verify HashAll at the
     same time without the burden to calculate the hash twice;
  2. To save hash value storage due to potential hardware limitation

Different boot mode may have its own hash value so that each mode can
decide which FV will be verified. For example, for the sake of performance,
S3 may choose to skip some FVs verification and normal boot will verify
all FVs it concerns.

So in this PPI, each FV information has flag to indicate which boot mode
it will be taken into hash calculation.

And if multiple hash values passed in this PPI, each has a flag to indicate
which boot mode it's used for. Note one hash value supports more than one
boot modes if they're just the same.

PcdStatusCodeFvVerificationPass and PcdStatusCodeFvVerificationFail are
introduced to report status back to platform, and platform can choose how
to act upon verification success and failure.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: "Hernandez Beltran, Jorge" <jorge.hernandez.beltran@intel.com>
Cc: Harry Han <harry.han@intel.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoOvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled
David Woodhouse [Wed, 26 Jun 2019 11:37:42 +0000 (12:37 +0100)]
OvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled

Mostly, this is only necessary for devices that the CSM might have
native support for, such as VirtIO and NVMe; PciBusDxe will already
degrade devices to 32-bit if they have an OpROM.

However, there doesn't seem to be a generic way of requesting PciBusDxe
to downgrade specific devices.

There's IncompatiblePciDeviceSupportProtocol but that doesn't provide
the PCI class information or a handle to the device itself, so there's
no simple way to just match on all NVMe devices, for example.

Just leave gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size set to zero for
CSM builds, until/unless that can be fixed.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190626113742.819933-5-dwmw2@infradead.org>

4 years agoOvmfPkg: Don't build in QemuVideoDxe when we have CSM
David Woodhouse [Wed, 26 Jun 2019 11:37:41 +0000 (12:37 +0100)]
OvmfPkg: Don't build in QemuVideoDxe when we have CSM

QemuVideoDxe installs its own legacy INT 10h handler for the benefit of
systems like Windows 2008r2 which attempt to use INT 10h even when booted
via EFI.

This interacts extremely badly with a CSM actually attempting to install
a real video BIOS.

The last thing done before invoking a legacy OpROM is to call INT 10h to
set a plain text mode. In the case where it's the video BIOS OpROM being
loaded, INT 10h will normally point to an iret stub in the CSM itself.

Unless QemuVideoDxe has changed INT10h to point to a location in the
0xC0000 segment that it didn't allocate properly, so the real OpROM has
been shadowed over them top of it, and the INT 10h vector now points to
some random place in the middle of the newly-shadowed OpROM.

Don't Do That Then. QemuVideoDxe doesn't do any acceleration and just
sets up a linear framebuffer, so we don't lose much by just
unconditionally using BiosVideoDxe instead when CSM is present.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190626113742.819933-4-dwmw2@infradead.org>

4 years agoOvmfPkg/LegacyBbs: Add boot entries for VirtIO and NVME devices
David Woodhouse [Wed, 26 Jun 2019 11:37:40 +0000 (12:37 +0100)]
OvmfPkg/LegacyBbs: Add boot entries for VirtIO and NVME devices

Iterate over the available block devices in much the same way as
BdsLibEnumerateAllBootOption() does, but limiting to those devices
which are PCI-backed, which can be represented in the BbsTable.

One day we might need to extend the BbsTable to allow us to distinguish
between different NVMe namespaces on a device.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190626113742.819933-3-dwmw2@infradead.org>

4 years agoOvmfPkg/LegacyBios: set NumberBbsEntries to the size of BbsTable
David Woodhouse [Wed, 26 Jun 2019 11:37:39 +0000 (12:37 +0100)]
OvmfPkg/LegacyBios: set NumberBbsEntries to the size of BbsTable

This is hard-coded in the IntThunk structure, and the additional entries
will be needed for other devices like VirtIO and NVMe disks. So admit
that they exist.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190626113742.819933-2-dwmw2@infradead.org>

4 years agoSecurityPkg: Add missing instances for build only
Bret Barkelew [Mon, 10 Jun 2019 02:27:45 +0000 (10:27 +0800)]
SecurityPkg: Add missing instances for build only

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

Add the missing instance to the [Components] of dsc file
for build only.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Zhichao gao <zhichao.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg/CapsulePei: Add memory pointer check
Gao, Zhichao [Tue, 25 Jun 2019 03:22:49 +0000 (11:22 +0800)]
MdeModulePkg/CapsulePei: Add memory pointer check

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

Before use the memory that is allocated through AllocateZeroPool,
we should check the memory pointer is valid to avoid using the
NULL pointer.
Add check for VariableArrayAddress that is returned from
GetScatterGatherHeadEntries. If it is NULL, directly return
the error status.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg: Add CapsuleOnDiskLoadPei PEIM.
Wei6 Xu [Mon, 24 Jun 2019 06:53:18 +0000 (14:53 +0800)]
MdeModulePkg: Add CapsuleOnDiskLoadPei PEIM.

REF: https://github.com/tianocore/tianocore.github.io/wiki/
UEFI-Capsule-on-Disk-Introducation

This module provides PPI to load Capsule On Disk temp relocation file
from Root Directory file system, retrieve the capsules from the temp
file and create capsule hobs for these capsules.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg: Add Capsule On Disk APIs into CapsuleLib.
Wei6 Xu [Mon, 24 Jun 2019 06:52:31 +0000 (14:52 +0800)]
MdeModulePkg: Add Capsule On Disk APIs into CapsuleLib.

REF: https://github.com/tianocore/tianocore.github.io/wiki/
UEFI-Capsule-on-Disk-Introducation

CoDCheckCapsuleOnDiskFlag() is to check if CapsuleOnDisk flag in
"OsIndications" Variable is enabled. It is used to indicate whether
capsule on disk is provisioned in normal boot path.

CoDClearCapsuleOnDiskFlag() is to to clear CapsuleOnDisk flags,
including "OsIndications" and "BootNext" variable.

CoDRelocateCapsule() is to relocate the capsules from EFI system
partition. Depends on PcdCapsuleInRamSupport, there are two solutions
to relocate the capsule on disk images:
When Capsule In Ram is supported, the Capsule On Disk images are
relocated into memory, and call UpdateCapsule() service to deliver
the capsules.
When Capsule In Ram is not supported, the Capsule On Disk images are
relocated into a temp file which will be stored in root directory on
a platform specific storage device. CapsuleOnDiskLoadPei PEIM will
retrieve the capsules from the relocation temp file and report
capsule hobs for them.

CoDRemoveTempFile() is to remove the relocation temp file in the next
boot after capsules are processed.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/DxeIpl: Support Capsule On Disk.
Wei6 Xu [Mon, 24 Jun 2019 06:50:14 +0000 (14:50 +0800)]
MdeModulePkg/DxeIpl: Support Capsule On Disk.

REF: https://github.com/tianocore/tianocore.github.io/wiki/
UEFI-Capsule-on-Disk-Introducation

If Capsule On Disk mode, call Capsule On Disk Load PPI to load
capsules. When it fails, still goes to Firmware Update boot path.
BDS will clear corresponding indicator and reboot later on.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
Wei6 Xu [Mon, 24 Jun 2019 06:49:24 +0000 (14:49 +0800)]
MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.

REF: https://github.com/tianocore/tianocore.github.io/wiki/
UEFI-Capsule-on-Disk-Introducation

Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
Platform could choose to drop CapsulePei/CapsuleX64 and not to support
Capsule In Ram.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/BdsDxe: Support Capsule On Disk.
Wei6 Xu [Mon, 24 Jun 2019 06:48:27 +0000 (14:48 +0800)]
MdeModulePkg/BdsDxe: Support Capsule On Disk.

REF: https://github.com/tianocore/tianocore.github.io/wiki/
UEFI-Capsule-on-Disk-Introducation

Set EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED bit of
"OsIndicationsSupported" variable to indicate the Capsule On
Disk is supported or not, according to PcdCapsuleOnDiskSupport.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg: Add Capsule On Disk related definition.
Wei6 Xu [Mon, 24 Jun 2019 06:46:02 +0000 (14:46 +0800)]
MdeModulePkg: Add Capsule On Disk related definition.

REF: https://github.com/tianocore/tianocore.github.io/wiki/
UEFI-Capsule-on-Disk-Introducation

This patch will add Capsule On Disk related definition, including
GUID, PPI and PCDs:
The Capsule On Disk Name GUID indicates the capsule is to store
Capsule On Disk file names.
The Pei Capsule On Disk PPI provides service to retrieve capsules
from Capsule On Disk temp relocation file on mass storage devices
and create capsule hob for these capsules.
Pei Boot In CapsuleOnDisk Mode Ppi indicates current boot mode is
capsule on disk mode.
PcdCapsuleOnDiskSupport is used to enable/disable Capsule On Disk.
PcdCapsuleInRamSupport is used to enable/disable Capsule In Ram.
PcdCoDRelocationFileName specifies the Capsule On Disk temp
relocation file name.
PcdCodRelocationDevPath specifies platform specific device to store
Capsule On Disk temp relocation file.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/CapsuleApp: Enhance Capsule-On-Disk related functions.
Wei6 Xu [Mon, 24 Jun 2019 05:21:35 +0000 (13:21 +0800)]
MdeModulePkg/CapsuleApp: Enhance Capsule-On-Disk related functions.

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

1. Introduce an internal header file to put definitions in it.
2. Add missing '\n' in usage.
3. Fix the dead loop of CapsuleApp -L.
4. Fix the bug that CapsuleApp -OD cannot perform capsules in sub-
folder.
5. Optimize the handling for option -NR and -OD to support both
'CapsuleApp <Capsule> -OD -NR' and 'CapsuleApp <Capsule> -NR -OD'.
6. Check if Capsule-On-Disk is supported by "OsIndicationsSupported"
variable firstly before processing capsules. If not supported, prompt
an error message and quit the process.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoCryptoPkg/OpensslLib: Exclude err_all.c in process_files.pl
Xiaoyu Lu [Wed, 19 Jun 2019 15:19:21 +0000 (15:19 +0000)]
CryptoPkg/OpensslLib: Exclude err_all.c in process_files.pl

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

Commit(0a1b13fd4d2210e2c3) fix VS2017 build failure
remove useless file in OpensslLib[Crypto].inf,
but we use process_files.pl to generate files.
So exclude err_all.c file in process_files.pl

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoBaseTools: Move Build Cache related function out of CreateAsBuiltInf
Bob Feng [Mon, 24 Jun 2019 01:51:44 +0000 (09:51 +0800)]
BaseTools: Move Build Cache related function out of CreateAsBuiltInf

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1932
There are two functions in current CreateAsBuiltInf, Copy Binary files
to build cache folder and create asbuild inf file.

This patch is to separate UpdateBuildCache and CreateAsBuiltInf into
two functions.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Christian Rodriguez <christian.rodriguez@intel.com>
Reviewed-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
4 years agoBaseTools: refine CreateAsBuiltInf function
Bob Feng [Mon, 24 Jun 2019 01:51:24 +0000 (09:51 +0800)]
BaseTools: refine CreateAsBuiltInf function

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1932
ModuleAutogen.CreateAsBuiltInf IsOnlyCopy parameter
and related function can be moved out of CreateAsBuiltInf,
so that CreateAsBuiltInf is more clean.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Christian Rodriguez <christian.rodriguez@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
4 years agoBaseTools:Add DetectNotUsedItem.py to Edk2\BaseTools\Scripts
Fan, ZhijuX [Mon, 24 Jun 2019 10:26:27 +0000 (18:26 +0800)]
BaseTools:Add DetectNotUsedItem.py to Edk2\BaseTools\Scripts

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

This script is used to Detect unreferenced PCD and GUID/Protocols/PPIs.
The input parameters are Dec file and package directory.

This script can be run in both Py2 and Py3.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMaintainers.txt: update it to remove IntelSiliconPkg maintainers
Liming Gao [Mon, 10 Jun 2019 15:29:12 +0000 (23:29 +0800)]
Maintainers.txt: update it to remove IntelSiliconPkg maintainers

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
4 years agoRemove IntelSiliconPkg that has been moved to edk2-platform repo
Liming Gao [Mon, 10 Jun 2019 15:27:58 +0000 (23:27 +0800)]
Remove IntelSiliconPkg that has been moved to edk2-platform repo

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
4 years agoBaseTools:Add import in FvImageSection
Fan, ZhijuX [Thu, 20 Jun 2019 06:07:39 +0000 (14:07 +0800)]
BaseTools:Add import in FvImageSection

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

Since MultipleWorkspace is not imported in FvImageSection,
an error of "global name 'MWS' is not defined" appeared.

This patch is going to fix that issue.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoMdeModulePkg/PeiMain: PeiAllocatePool: output NULL if HOB creation fails
Bret Barkelew [Wed, 12 Jun 2019 03:56:29 +0000 (11:56 +0800)]
MdeModulePkg/PeiMain: PeiAllocatePool: output NULL if HOB creation fails

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

The original logic is ASSERT if fail to create HOB. But
that doesn't make sense for release version. So it is required
to set the Buffer to null to indicate the failure.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeMoudlePkg/CapsulePei: No need to remain space for null-terminate
Zhichao Gao [Mon, 10 Jun 2019 01:54:52 +0000 (09:54 +0800)]
MdeMoudlePkg/CapsulePei: No need to remain space for null-terminate

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

UnicodeValueToStringS would remain two bytes for the first
parameter to set the null- terminate. So remove this change
in Mu.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Zhichao gao <zhichao.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeMoudlePkg/CapsulePei: Optimize GetScatterGatherHeadEntries
Zhichao Gao [Mon, 10 Jun 2019 01:52:22 +0000 (09:52 +0800)]
MdeMoudlePkg/CapsulePei: Optimize GetScatterGatherHeadEntries

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

Rename the MACRO from MAX_SG_LIST_HEADS to DEFAULT_SG_LIST_HEADS.
GetScatterGatherHeadEntries: use allocated buffer instead of fixed
array to handle the condition which the SG list is larger then the
array size.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Zhichao gao <zhichao.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeMoudlePkg/CapsulePei: Optimize AreCapsulesStaged
Zhichao Gao [Mon, 10 Jun 2019 01:43:59 +0000 (09:43 +0800)]
MdeMoudlePkg/CapsulePei: Optimize AreCapsulesStaged

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

AreCapsulesStaged do not need to return the status, only boolean
result is useful. So directly return a boolean value.
Cannot initialize the variable at its definition.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Zhichao gao <zhichao.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeMoudlePkg/CapsulePei: Fix coding style issue
Zhichao Gao [Mon, 10 Jun 2019 01:38:18 +0000 (09:38 +0800)]
MdeMoudlePkg/CapsulePei: Fix coding style issue

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

Remove API specifier AreCapsulesStaged and GetScatterGatherHeadEntries
because they are internal used.
Add space between function name and bracket.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Zhichao gao <zhichao.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/CapsulePei: Optimize the CapsulePei
Bret Barkelew [Tue, 4 Jun 2019 02:24:02 +0000 (10:24 +0800)]
MdeModulePkg/CapsulePei: Optimize the CapsulePei

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

Code change form Mu project:
https://github.com/microsoft/mu_basecore/blob/release/201903/
MdeModulePkg/Universal/CapsulePei/UefiCapsule.c#L801

Separate the capsule check function from GetCapsuleDescriptors
to AreCapsulesStaged. The original one is unclear.

Avoid querying the capsule variable twice. Use a fixed array
to cache the SG list during count the number of SG list. Then
allocate memory buffer to save the SG list from array.

Using MemoryAllocationLib instead of memory function in Pei
services.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Zhichao gao <zhichao.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/NvmExpressPei: Produce NVM Express PassThru PPI
Maggie Chu [Mon, 17 Jun 2019 02:11:26 +0000 (10:11 +0800)]
MdeModulePkg/NvmExpressPei: Produce NVM Express PassThru PPI

https://bugzilla.tianocore.org/show_bug.cgi?id=1879
This commit will add codes to produce the NVM Express PassThru PPI.

Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
4 years agoMdeModulePkg: Add definitions for NVM Express Passthru PPI
Chu, Maggie [Mon, 17 Jun 2019 02:10:43 +0000 (10:10 +0800)]
MdeModulePkg: Add definitions for NVM Express Passthru PPI

https://bugzilla.tianocore.org/show_bug.cgi?id=1879
This commit will add the definitions of Nvm Express PassThru PPI.
This PPI will provide services that allow NVM commands to be sent
to NVM Express devices during PEI phase.

More specifically, the PPI will provide services to:

* Sends an NVM Express Command Packet to an NVM Express controller
  or namespace (by service 'PassThru');
* Get the list of the attached namespaces on a controller
  (by services 'GetNextNameSpace');
* Get the identification information (DevicePath) of the underlying
  NVM Express host controller (by service 'GetDevicePath').

Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
4 years agoUefiPayloadPkg: Remove legacy PIC 8259 driver
Dong, Guo [Wed, 29 May 2019 18:52:20 +0000 (11:52 -0700)]
UefiPayloadPkg: Remove legacy PIC 8259 driver

Since legacy PIC 8259 driver would be removed from edk2,
update UEFI payload to remove 8259 driver.
If required, bootloader could disable 8259.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
4 years agoCryptoPkg/OpensslLib: disable autoload-config for OpenSSL
Xiaoyu Lu [Thu, 20 Jun 2019 05:55:13 +0000 (13:55 +0800)]
CryptoPkg/OpensslLib: disable autoload-config for OpenSSL

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

This problem was found by Rebecca Cran <rebecca@bluestop.org>.
REF: https://edk2.groups.io/g/devel/topic/32100684

OpenSSL will automatically load a system config file which configures
default ssl options. In UEFI, It will cause TlsInitialize failed
without OPENSSL_INIT_NO_LOAD_CONFIG flag. we don't use this feature,
So disable it.

Re-run process_files.py to generate OpensslLib[Crypto].inf files.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
Reviewed-by: Rebecca Cran <rebecca@bluestop.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoCryptoPkg/OpensslLib: Fix CR/LF issue
Lu, XiaoyuX [Wed, 19 Jun 2019 07:20:54 +0000 (15:20 +0800)]
CryptoPkg/OpensslLib: Fix CR/LF issue

Re-run process_files.py to generate OpensslLib[Crypto].inf.
CryptoPkg/Library/Include/openssl/opensslconf.h is coped from OpenSSL,
So keep the CR/LF style like OpenSSL source file.

Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoRevert "Capsule-on-Disk entire Patch
Zhang, Chao B [Fri, 21 Jun 2019 02:24:10 +0000 (10:24 +0800)]
Revert "Capsule-on-Disk entire Patch

This reverts commit 0d4aa276d1f6e0cb9d71a7fb88b30c416ba6d5a3,
                    6470a43160183cd48cad8901c912a48811f18b13,
                    fd7286089542ee7a98cfea00be45ceb3561e0b20,
                    7837d1249807b4248079699097bc993254235d7a,
                    6b32af2e105f9b5454a55b581f2dc365c5eb6397,
                    8636f70b5a763ed1c03b292708f9c5543e531ea9,
                    f17935321a5b818a66e999632ef371b374b98f0c
due to incorrect review process.

Cc: Wei6 Xu <wei6.xu@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdePkg: Add Generic Initiator Affinity Structure definitions to SRAT
Krzysztof Koch [Wed, 12 Jun 2019 14:10:45 +0000 (22:10 +0800)]
MdePkg: Add Generic Initiator Affinity Structure definitions to SRAT

Add Generic Initiator Affinity Structure to the list of recognised
System Resource Affinity Table (SRAT) structure types.

Add definitions for Device Handle Types inside the Generic Initiator
Affinity Structure.

References:
- ACPI 6.3 January 2019, Table 5-78

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdeModulePkg: Add CapsuleOnDiskLoadPei PEIM.
Wei6 Xu [Wed, 19 Jun 2019 17:03:20 +0000 (01:03 +0800)]
MdeModulePkg: Add CapsuleOnDiskLoadPei PEIM.

https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule-
on-Disk-Introducation

This module provides PPI to load Capsule On Disk temp relocation file
from Root Directory file system, retrieve the capsules from the temp
file and create capsule hobs for these capsules.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoMdeModulePkg: Add Capsule On Disk APIs into CapsuleLib.
Wei6 Xu [Wed, 19 Jun 2019 16:55:40 +0000 (00:55 +0800)]
MdeModulePkg: Add Capsule On Disk APIs into CapsuleLib.

https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule-
on-Disk-Introducation

CoDCheckCapsuleOnDiskFlag() is to check if CapsuleOnDisk flag in
"OsIndications" Variable is enabled. It is used to indicate whether
capsule on disk is provisioned in normal boot path.

CoDClearCapsuleOnDiskFlag() is to to clear CapsuleOnDisk flags,
including "OsIndications" and "BootNext" variable.

CoDRelocateCapsule() is to relocate the capsules from EFI system
partition. Depends on PcdCapsuleInRamSupport, there are two solutions
to relocate the capsule on disk images:
When Capsule In Ram is supported, the Capsule On Disk images are
relocated into memory, and call UpdateCapsule() service to deliver
the capsules.
When Capsule In Ram is not supported, the Capsule On Disk images are
relocated into a temp file which will be stored in root directory on
a platform specific storage device. CapsuleOnDiskLoadPei PEIM will
retrieve the capsules from the relocation temp file and report
capsule hobs for them.

CoDRemoveTempFile() is to remove the relocation temp file in the next
boot after capsules are processed.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoMdeModulePkg/DxeIpl: Support Capsule On Disk.
Wei6 Xu [Wed, 19 Jun 2019 16:32:05 +0000 (00:32 +0800)]
MdeModulePkg/DxeIpl: Support Capsule On Disk.

https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule-
on-Disk-Introducation

If Capsule On Disk mode, call Capsule On Disk Load PPI to load
capsules. When it fails, still goes to Firmware Update boot path.
BDS will clear corresponding indicator and reboot later on.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoMdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
Wei6 Xu [Wed, 19 Jun 2019 16:27:09 +0000 (00:27 +0800)]
MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.

https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule-
on-Disk-Introducation

Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
Platform could choose to drop CapsulePei/CapsuleX64 and not to support
Capsule In Ram.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoMdeModulePkg/BdsDxe: Support Capsule On Disk.
Wei6 Xu [Wed, 19 Jun 2019 16:24:33 +0000 (00:24 +0800)]
MdeModulePkg/BdsDxe: Support Capsule On Disk.

https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule-
on-Disk-Introducation

Set EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED bit of
"OsIndicationsSupported" variable to indicate the Capsule On
Disk is supported or not, according to PcdCapsuleOnDiskSupport.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoMdeModulePkg/CapsuleApp: Enhance Capsule-On-Disk related functions.
xuwei6 [Fri, 24 May 2019 08:52:35 +0000 (16:52 +0800)]
MdeModulePkg/CapsuleApp: Enhance Capsule-On-Disk related functions.

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

1. Add missing '\n' in usage.
2. Fix the dead loop of CapsuleApp -L.
3. Fix the bug that CapsuleApp -OD cannot perform capsules in sub-
folder.
4. Optimize the handling for option -NR and -OD to support both
'CapsuleApp <Capsule> -OD -NR' and 'CapsuleApp <Capsule> -NR -OD'.
5. Check if Capsule-On-Disk is supported by "OsIndicationsSupported"
variable firstly before processing capsules. If not supported, prompt
an error message and quit the process.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg: Add Capsule On Disk related definition.
Wei6 Xu [Wed, 19 Jun 2019 16:22:38 +0000 (00:22 +0800)]
MdeModulePkg: Add Capsule On Disk related definition.

https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule-
on-Disk-Introducation

This patch will add Capsule On Disk related definition, including
GUID, PPI and PCDs:
The Capsule On Disk Name GUID indicates the capsule is to store
Capsule On Disk file names.
The Pei Capsule On Disk PPI provides service to retrieve capsules
from Capsule On Disk temp relocation file on mass storage devices
and create capsule hob for these capsules.
Pei Boot In CapsuleOnDisk Mode Ppi indicates current boot mode is
capsule on disk mode.
PcdCapsuleOnDiskSupport is used to enable/disable Capsule On Disk.
PcdCapsuleInRamSupport is used to enable/disable Capsule In Ram.
PcdCoDRelocationFileName specifies the Capsule On Disk temp
relocation file name.
PcdCodRelocationDevPath specifies platform specific device to store
Capsule On Disk temp relocation file.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoIntelFsp2Pkg: add TempRamExitPpi.h.
Chasel Chiu [Fri, 14 Jun 2019 09:39:34 +0000 (17:39 +0800)]
IntelFsp2Pkg: add TempRamExitPpi.h.

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

Add header file for FSP_TEMP_RAM_EXIT_PPI which is
defined by FSP 2.1 spec.

Test: Build successfully.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
4 years agoShellPkg: acpiview: ACPI 6.3 update for MADT parser
Krzysztof Koch [Fri, 31 May 2019 03:06:51 +0000 (20:06 -0700)]
ShellPkg: acpiview: ACPI 6.3 update for MADT parser

The ACPI 6.3 specification introduces a 'SPE overflow
Interrupt' field as part of the GICC structure.

Update the MADT parser to decode this field and validate
the interrupt ID used.

References:
- ACPI 6.3 Specification - January 2019
- Arm Generic Interrupt Controller Architecture Specification,
  GIC architecture version 3 and version 4, issue E
- Arm Server Base System Architecture 5.0

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoEmbeddedPkg: improve TimeBaseLib type safety
Leif Lindholm [Thu, 13 Jun 2019 15:48:28 +0000 (16:48 +0100)]
EmbeddedPkg: improve TimeBaseLib type safety

EfiTimeToEpoch currently returns a UINTN.
Also, some internal calculations was using UINTN for fixed-width.
Both of these lead to warnings/errors with VS2017.

Replace with appropriate fixed-size types.

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

Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoArmPlatformPkg: use UINT32 epoch second counter
Leif Lindholm [Thu, 13 Jun 2019 15:44:27 +0000 (16:44 +0100)]
ArmPlatformPkg: use UINT32 epoch second counter

The comments describes the device as being 32-bit:
"the maximum time span is just over 136 years"
then uses a UINTN to hold the value.

Change to UINT32 so we don't get different behaviour for different architectures.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoBaseTools:Introduce CopyFileOnChange() function to copy cache files
Shi, Steven [Mon, 17 Jun 2019 08:43:58 +0000 (16:43 +0800)]
BaseTools:Introduce CopyFileOnChange() function to copy cache files

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

Basetool need a CopyFileOnChange() function to avoid cache
file writing race in multi-thread build. Some platforms
build fail with file IO writing race issue when the
build cache is enabled to store cache files in multi-threads.
This is because common same library cache files (e.g. some
libs in MdePkg) can be stored by many different driver modules'
build threads at same time. Current build cache need a function
to check whether the same cache file already exist, and only
copy source file if it is different from the destination file.

This patch introduces an atomic copy function to avoid duplicated
cache files copy.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Christian Rodriguez <christian.rodriguez@intel.com>
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: Cannot store library cache of different arch together
Shi, Steven [Mon, 17 Jun 2019 08:16:18 +0000 (16:16 +0800)]
BaseTools: Cannot store library cache of different arch together

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

Build cache cannot store cache for the same library modules
in different arch together. E.g. Both the below IA32 and X64
arch BaseLib caches should exist after build Ovmf3264, but now
only the one in X64 arch exist.
The reason is the current Basetool use a set() to same all
library AutoGen objects, but the different arch lib AutoGen
objects have same __hash_ value which comes from the lib
MetaFile(The path of module file):
    def __hash__(self):
        return hash(self.MetaFile)

So the different arch lib AutoGen objects are duplicated one
to the set() and only one can exist. This is why the Basetool
can only store one arch cache for library.

This patch adds the arch string into the PlatformAutoGen and
ModuleAutoGen __hash_ definitions and ensure the different
platform and module AutoGen objects have different __hash_ values.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Christian Rodriguez <christian.rodriguez@intel.com>
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools:Build Cache output notification message
Shi, Steven [Fri, 14 Jun 2019 11:44:41 +0000 (19:44 +0800)]
BaseTools:Build Cache output notification message

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

Build need output the cache miss or hit notification
message when consume the build cache. Current build does not
output any message which is not clear for user to know
whether the module built result is from cache or not.

This patch adds message about the cache miss or hit when
build consumes the cache.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Zhiju.Fan <zhijux.fan@intel.com>
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools:Build cache cannot store the cache files for library package
Shi, Steven [Tue, 11 Jun 2019 06:33:16 +0000 (14:33 +0800)]
BaseTools:Build cache cannot store the cache files for library package

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

Current build cache cannot store the cache for library package.
build -p MdePkg\MdePkg.dsc -a IA32 -b DEBUG -t VS2015x86 --hash
--binary-destination=BinCache
After build, the expected result is the BinCache folder is generated
and the MdePkg build cache files (e.g. .hash and .lib) are stored in
the BinCache folder. But the BinCache folder is not generated at all.

This patch is going to fix that issue.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Zhiju.Fan <zhijux.fan@intel.com>
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoOvmfPkg: Refer to Shell app via its declared GUID
Hao A Wu [Fri, 14 Jun 2019 01:14:29 +0000 (09:14 +0800)]
OvmfPkg: Refer to Shell app via its declared GUID

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

Currently, the file GUID reference of the UEFI Shell app is indirected
via the PCD gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile,
which is set to a fixed value for OvmfPkg.

So instead, use the symbolic GUID in ShellPkg for this purpose, and drop
the reference to this PCD, and to the IntelFrameworkModulePkg package
entirely.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/Csm/CsmSupportLib: Drop IntelFrameworkPkg dependency
Hao A Wu [Wed, 15 May 2019 07:11:48 +0000 (15:11 +0800)]
OvmfPkg/Csm/CsmSupportLib: Drop IntelFrameworkPkg dependency

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

This commit will update the INF file of the CsmSupportLib to drop its
dependency on IntelFrameworkPkg:

gEfiLegacyBiosPlatformProtocolGuid
gEfiLegacyBiosProtocolGuid
gEfiLegacyInterruptProtocolGuid

The above dependencies have already been addressed by the duplication of
these definitions from IntelFrameworkPkg to OvmfPkg.

Cc: Ray Ni <ray.ni@intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/IncompatiblePciDeviceSupportDxe: Drop framework pkg dependency
Hao A Wu [Wed, 15 May 2019 02:07:53 +0000 (10:07 +0800)]
OvmfPkg/IncompatiblePciDeviceSupportDxe: Drop framework pkg dependency

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

This commit will drop the driver's dependency on the IntelFrameworkPkg:
gEfiLegacyBiosProtocolGuid

Such dependency has already been addressed by the duplication of the above
definition from IntelFrameworkPkg into the OvmfPkg.

Cc: Ray Ni <ray.ni@intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/PlatformPei: Remove redundant reference of framework pkg DEC
Hao A Wu [Wed, 15 May 2019 02:10:47 +0000 (10:10 +0800)]
OvmfPkg/PlatformPei: Remove redundant reference of framework pkg DEC

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

For the driver's INF file, this commit will remove the redundant reference
to 'IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec'.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoMdeModulePkg: Add missing instances for build only
Bret Barkelew [Mon, 20 May 2019 05:50:35 +0000 (13:50 +0800)]
MdeModulePkg: Add missing instances for build only

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

Add the missing instances to the [Components] of dsc file
for build only.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoSourceLevelDebugPkg: Add missing instances for build only
Bret Barkelew [Mon, 10 Jun 2019 02:19:13 +0000 (10:19 +0800)]
SourceLevelDebugPkg: Add missing instances for build only

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

Add the missing instances to the [Components] of dsc file
for build only.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Zhichao gao <zhichao.gao@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoCryptoPkg: Add missing instance for build only
Bret Barkelew [Wed, 12 Jun 2019 02:30:00 +0000 (10:30 +0800)]
CryptoPkg: Add missing instance for build only

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

Add the missing instance to [Components] of dsc file
for build only.

Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoUefiPayloadPkg/PlatformBootManagerLib: Use EDKII_SERIAL_PORT_LIB_VENDOR_GUID from...
Anthony PERARD [Thu, 6 Jun 2019 13:14:59 +0000 (14:14 +0100)]
UefiPayloadPkg/PlatformBootManagerLib: Use EDKII_SERIAL_PORT_LIB_VENDOR_GUID from MdeModulePkg

EDKII_SERIAL_PORT_LIB_VENDOR_GUID is now defined in MdeModulePkg,
simply use it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190606131459.1464-5-anthony.perard@citrix.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoArmPkg/PlatformBootManagerLib: Use EDKII_SERIAL_PORT_LIB_VENDOR_GUID from MdeModulePkg
Anthony PERARD [Thu, 6 Jun 2019 13:14:58 +0000 (14:14 +0100)]
ArmPkg/PlatformBootManagerLib: Use EDKII_SERIAL_PORT_LIB_VENDOR_GUID from MdeModulePkg

SERIAL_DXE_FILE_GUID is now defined in MdeModulePkg as
EDKII_SERIAL_PORT_LIB_VENDOR_GUID, simply use it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190606131459.1464-4-anthony.perard@citrix.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoArmVirtPkg/PlatformBootManagerLib: Use EDKII_SERIAL_PORT_LIB_VENDOR_GUID
Anthony PERARD [Thu, 6 Jun 2019 13:14:57 +0000 (14:14 +0100)]
ArmVirtPkg/PlatformBootManagerLib: Use EDKII_SERIAL_PORT_LIB_VENDOR_GUID

SERIAL_DXE_FILE_GUID is now defined in MdeModulePkg as
EDKII_SERIAL_PORT_LIB_VENDOR_GUID, simply use it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190606131459.1464-3-anthony.perard@citrix.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[lersek@redhat.com: drop "from MdeModulePkg" from the subject]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
4 years agoMdeModulePkg: Introduce EDKII_SERIAL_PORT_LIB_VENDOR_GUID
Anthony PERARD [Thu, 6 Jun 2019 13:14:56 +0000 (14:14 +0100)]
MdeModulePkg: Introduce EDKII_SERIAL_PORT_LIB_VENDOR_GUID

SERIAL_DXE_FILE_GUID is used in different places, create a single
define that other can use. Also fix SerialDxe to actually use
EDKII_SERIAL_PORT_LIB_VENDOR_GUID in the device path instead of the
FILE_GUID.

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190606131459.1464-2-anthony.perard@citrix.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoOvmfPkg/Csm/LegacyBiosDxe: Fix Legacy16GetTableAddress call for E820 data
David Woodhouse [Thu, 13 Jun 2019 08:40:05 +0000 (16:40 +0800)]
OvmfPkg/Csm/LegacyBiosDxe: Fix Legacy16GetTableAddress call for E820 data

The DX register is supposed to contain the required alignment for the
allocation. It was zero, and SeaBIOS doesn't (well, didn't) cope well
with that. Set it appropriately.

Also set BX to indicate the regions it's OK to allocate in too. That
wasn't being initialised and was just using whatever the previous user
of the structure had left there.

Finally, actually return an error if the allocation fails. Instead of
going all the way through into the CSM and just letting it have a bogus
pointer to the E820 data.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg: Update DSC/FDF files to consume CSM components in OvmfPkg
Hao A Wu [Wed, 15 May 2019 07:15:53 +0000 (15:15 +0800)]
OvmfPkg: Update DSC/FDF files to consume CSM components in OvmfPkg

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

This commit updates the OVMF DSC/FDF files to consume the copied CSM
components within OvmfPkg.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/Csm/LegacyBootManagerLib: Update to make it build for OVMF
Hao A Wu [Wed, 15 May 2019 07:09:49 +0000 (15:09 +0800)]
OvmfPkg/Csm/LegacyBootManagerLib: Update to make it build for OVMF

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

This commit will update the library's INF file to:

A) Assign a new file GUID;
B) Remove the IntelFramework[Module]Pkg DEC file dependency.

Please note that a subsequent commit (final patch of the series) will:

Replace the use of LegacyBootManagerLib in IntelFrameworkModulePkg with
the one copied in OvmfPkg within DSC files.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/Csm/LegacyBootMaintUiLib: Update to make it build for OVMF
Hao A Wu [Wed, 15 May 2019 07:08:16 +0000 (15:08 +0800)]
OvmfPkg/Csm/LegacyBootMaintUiLib: Update to make it build for OVMF

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

This commit will update the library's INF file to:

A) Assign a new file GUID;
B) Remove the IntelFramework[Module]Pkg DEC file dependency.

Please note that a subsequent commit (final patch of the series) will:

Replace the use of LegacyBootMaintUiLib in IntelFrameworkModulePkg with
the one copied in OvmfPkg within DSC files.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/Csm/LegacyBiosDxe: Update to make it build for OVMF
Hao A Wu [Wed, 15 May 2019 07:07:08 +0000 (15:07 +0800)]
OvmfPkg/Csm/LegacyBiosDxe: Update to make it build for OVMF

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

This commit will update the driver's INF file to:

A) Assign a new file GUID;
B) Consume the PCDs duplicated in OvmfPkg DEC file;
C) Remove the IntelFramework[Module]Pkg DEC file dependency.

Please note that a subsequent commit (final patch of the series) will:

Replace the use of LegacyBiosDxe in IntelFrameworkModulePkg with the one
copied in OvmfPkg within DSC/FDF files.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/Csm/VideoDxe: Update to make it build for OVMF
Hao A Wu [Wed, 15 May 2019 06:59:43 +0000 (14:59 +0800)]
OvmfPkg/Csm/VideoDxe: Update to make it build for OVMF

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

This commit will update the driver's INF file to:

A) Assign a new file GUID;
B) Consume the PCDs duplicated in OvmfPkg DEC file;
C) Remove the IntelFramework[Module]Pkg DEC file dependency.

Please note that a subsequent commit (final patch of the series) will:

Replace the use of VideoDxe in IntelFrameworkModulePkg with the one copied
in OvmfPkg within DSC/FDF files.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/OvmfPkg.dec: Add PCD definitions used by copied CSM modules
Hao A Wu [Wed, 15 May 2019 06:39:46 +0000 (14:39 +0800)]
OvmfPkg/OvmfPkg.dec: Add PCD definitions used by copied CSM modules

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

This commit will add the PCD definitions consumed by the duplicated
drivers:

* VideoDxe
* LegacyBiosDxe

into the OvmfPkg DEC file.

Please note that, instead of adding these PCDs under section:
[PcdsFixedAtBuild, PcdsDynamic, PcdsDynamicEx, PcdsPatchableInModule]

as in IntelFrameworkModulePkg.dec file, they are added in section:
[PcdsFixedAtBuild]

in OvmfPkg.dec instead.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/OvmfPkg.dec: Add the new include folder for CSM header files
Hao A Wu [Wed, 15 May 2019 06:36:35 +0000 (14:36 +0800)]
OvmfPkg/OvmfPkg.dec: Add the new include folder for CSM header files

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

The previous file-duplication commit has put all the CSM related header
files within folder: OvmfPkg/Csm/Inclue.

This commit will update the DEC file to add that folder under the
'[Include]' section.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/OvmfPkg.dec: Add definitions for CSM-related Guid & Protocol
Hao A Wu [Wed, 15 May 2019 06:24:19 +0000 (14:24 +0800)]
OvmfPkg/OvmfPkg.dec: Add definitions for CSM-related Guid & Protocol

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

This commit will add the Guid definitions of the duplicated CSM-related
Guids and Protocols from IntelFramework[Module]Pkg.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg: Copy the required CSM components from framework packages
Hao A Wu [Wed, 15 May 2019 03:22:29 +0000 (11:22 +0800)]
OvmfPkg: Copy the required CSM components from framework packages

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

This commit copies the exact:

Drivers:
* VideoDxe
* LegacyBiosDxe

Libraries:
* LegacyBootMaintUiLib
* LegacyBootManagerLib

Guid header files:
* Legacy Bios Guid
* LegacyDevOrder Guid

Protocol header files:
* Firmware Volume Protocol
* ISA ACPI Protocol
* ISA I/O Protocol
* Legacy BIOS Protocol
* Legacy BIOS Platform Protocol
* Legacy Interrupt Protocol
* VGA Mini Port Protocol

Framework header files (within IntelFrameworkPkg):
* FrameworkDxe.h
* Framework/BootScript.h
* Framework/DxeCis.h
* Framework/FirmwareVolumeHeader.h
* Framework/FirmwareVolumeImageFormat.h
* Framework/FrameworkInternalFormRepresentation.h
* Framework/Hob.h
* Framework/StatusCode.h

from IntelFramework[Module]Pkg to OvmfPkg/Csm/ folder.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoMaintainers.txt: Add maintainer for CSM components in OvmfPkg
Hao A Wu [Fri, 24 May 2019 00:26:40 +0000 (08:26 +0800)]
Maintainers.txt: Add maintainer for CSM components in OvmfPkg

According to the discussion at:

https://edk2.groups.io/g/devel/topic/31627718#40659
(Request by Laszlo to find proper maintainer for to-be-duplicated CSM
components in OvmfPkg.)

and:

https://edk2.groups.io/g/devel/topic/31682287#40996
(Confirmation with David Woodhouse as the maintainer for the
to-be-duplicated CSM components in OvmfPkg.)

This commit will add David Woodhouse as the maintainer for the CSM
modules under OvmfPkg.

Please note that the duplication of the required CSM modules from
framework packages to OvmfPkg will be done in subsequent commits.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoMdeModulePkg/GraphicsConsoleDxe: Initialize the output mode
Zhichao Gao [Tue, 30 Apr 2019 06:51:34 +0000 (14:51 +0800)]
MdeModulePkg/GraphicsConsoleDxe: Initialize the output mode

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

Original logic:
Connect the graphics device -> connect it as graphics consoles
and initialize its parameters(Mode = -1, invalid) -> connect it
as console spliter and add the device to the list(use SetMode to
set mode to the user defined mode or the best mode the devices
supported if the mode is invalid. *clear the screen at this phase*)

Changed logic:
Connect the graphics device -> connect it as graphics consoles
and initialize its parameters(initialize the mode to the user
defined mode or the best mode. *directly set the mode value without
using SetMode, that would not clear the screen) -> connect it as
console spliter and add the device to the list(use SetMode to set
mode to the user defined mode or the best mode the devices supported
if the mode is invalid. *now the mode is already set, so it would
not clear the screen*).

Also remove the section of SetMode for debug version.

Impact: as the text mode may not be an invalid value, the SetMode
may have no chance to be called during reconnect the graphics device.
That means the screen may not be cleaned after finishing reconnect
operation. There is one common condition: shell command "recoonect -r".

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetMode
Aaron Antone [Thu, 11 Apr 2019 10:42:58 +0000 (18:42 +0800)]
MdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetMode

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

For Console Out device, it would always set all present devices'
text out mode again through ConSplitterTextOutSetMode while adding
devices. That may cause the screen cleared for serval times.
So add a BOOLEAN to judge if it is adding device then we will not
set the same text mode again for same console out device.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoUefiCpuPkg RegisterCpuFeaturesLib.h: Fix typo 'STRICK' to 'STRIKE'
Star Zeng [Mon, 10 Jun 2019 10:20:37 +0000 (18:20 +0800)]
UefiCpuPkg RegisterCpuFeaturesLib.h: Fix typo 'STRICK' to 'STRIKE'

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

This patch fixes typo in CPU_FEATURE_THREE_STRICK_COUNTER.

CPU_FEATURE_THREE_STRICK_COUNTER
->
CPU_FEATURE_THREE_STRIKE_COUNTER

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Chandana Kumar <chandana.c.kumar@intel.com>
Cc: Kevin Li <kevin.y.li@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoShellPkg/Debug1CommandsLib: Fix bugs in func DisplaySysEventLogData
Dandan Bi [Tue, 28 May 2019 02:25:09 +0000 (19:25 -0700)]
ShellPkg/Debug1CommandsLib: Fix bugs in func DisplaySysEventLogData

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

This patch fix following bugs in func DisplaySysEventLogData:
1. Log increment (Log = (LOG_RECORD_FORMAT *) (LogData + Offset);)
should happened in the end of while loop, not in the very beginning.
2. DisplaySELTypes function should be used in while loop instead of
DisplaySELVarDataFormatType.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoBaseTools: add script to configure local git options
Leif Lindholm [Mon, 10 Jun 2019 11:54:10 +0000 (19:54 +0800)]
BaseTools: add script to configure local git options

Patch contribution and review is greatly simplified by following the
steps described in "Laszlo's unkempt guide":
https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers
but there are a lot of tedious manual steps in there, so here is a
python script that configures all options I am aware of
*for the repository the script is executed from*.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: add centralized location for git config files
Leif Lindholm [Mon, 10 Jun 2019 11:54:09 +0000 (19:54 +0800)]
BaseTools: add centralized location for git config files

Before adding the git environment initialization script, add the
following files that will be pointed to after running said script:

- BaseTools/Conf/diff.order
- BaseTools/Conf/gitattributes

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoSecurityPkg/HddPassword: Add a PCD to skip Hdd password prompt
Chu, Maggie [Mon, 10 Jun 2019 10:19:27 +0000 (18:19 +0800)]
SecurityPkg/HddPassword: Add a PCD to skip Hdd password prompt

https://bugzilla.tianocore.org/show_bug.cgi?id=1876
Add a PCD for skipping Hdd password prompt.
If device is in the locked status while attempting to skip
password prompt, device will keep locked and system
continue to boot.
If device is in the unlocked status while attempting to skip
password prompt, system will be forced shutdown.

Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoMdeModulePkg/PciBusDxe: catch unimplemented extended config space reads
Laszlo Ersek [Tue, 4 Jun 2019 19:42:56 +0000 (21:42 +0200)]
MdeModulePkg/PciBusDxe: catch unimplemented extended config space reads

When assigning a physical PCIe device to a QEMU/KVM guest, PciBusDxe may
find that the extended config space is not (fully) implemented. In
LocatePciExpressCapabilityRegBlock(), "CapabilityEntry" may be read as
0xFFFF_FFFF at a given config space offset, after which the loop gets
stuck spinning on offset 0xFFC (the read at offset 0xFFC returns
0xFFFF_FFFF most likely as well).

Another scenario (not related to virtualization) for triggering the above
is when a Conventional PCI bus -- exposed by a PCIe-to-PCI bridge in the
topology -- intervenes between a PCI Express Root Port and a PCI Express
Endpoint. The Conventional PCI bus limits the accessible config space of
the PCI Express Endpoint, even though the endpoint advertizes the PCI
Express capability. Here's a diagram, courtesy of Alex Williamson:

  [PCIe Root Port]--[PCIe-to-PCI]--[PCI-to-PCIe]--[PCIe EP]
                              ->|  |<- Conventional PCI bus

Catch reads of 0xFFFF_FFFF in LocatePciExpressCapabilityRegBlock(), and
break out of the scan with a warning message. The function will return
EFI_NOT_FOUND.

Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoOvmfPkg/README: Update the network build flags
Gary Lin [Mon, 10 Jun 2019 06:55:09 +0000 (14:55 +0800)]
OvmfPkg/README: Update the network build flags

The following network build flags changed due to the inclusion of
NetworkPkg/Network.fdf.inc.

  HTTP_BOOT_ENABLE -> NETWORK_HTTP_BOOT_ENABLE
  TLS_ENABLE -> NETWORK_TLS_ENABLE

This commit also adds NETWORK_ALLOW_HTTP_CONNECTIONS to reflect the
change in OvmfPkg/OvmfPkg*.dsc.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1884
Signed-off-by: Gary Lin <glin@suse.com>
Message-Id: <20190610065509.19573-1-glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoDynamicTablesPkg: Disable deprecated APIs
Sami Mujawar [Tue, 26 Mar 2019 14:59:12 +0000 (14:59 +0000)]
DynamicTablesPkg: Disable deprecated APIs

Add the DISABLE_NEW_DEPRECATED_INTERFACES macro to
the DynamicTablesPkg package build flags to disable
deprecated APIs.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
4 years agoDynamicTablesPkg: Fix line endings in dsc file
Sami Mujawar [Tue, 26 Mar 2019 15:08:06 +0000 (15:08 +0000)]
DynamicTablesPkg: Fix line endings in dsc file

Changed the line endings to DOS line endings for
DynamicTablesPkg/DynamicTablesPkg.dsc

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
4 years agoIntelFspPkg&IntelFspWrapperPkg: Remove them
Ray Ni [Tue, 11 Jun 2019 08:59:11 +0000 (16:59 +0800)]
IntelFspPkg&IntelFspWrapperPkg: Remove them

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

Since there are V2 FSP packages (IntelFsp2Pkg, IntelFsp2WrapperPkg),
this patch removes IntelFspPkg, IntelFspWrapperPkg to remove obsolete
code in edk2 repo.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
4 years agoDynamicTablesPkg: GTDT updates for ACPI 6.3
Pierre Gondois [Tue, 19 Mar 2019 17:46:50 +0000 (17:46 +0000)]
DynamicTablesPkg: GTDT updates for ACPI 6.3

The ACPI 6.3 specification adds support for describing
ARMv8.1 EL2 virtual timers. Update GTDT Generator
to extend this support.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoDynamicTablesPkg: Add dynamic PPTT table generation support
Krzysztof Koch [Fri, 22 Feb 2019 17:42:27 +0000 (17:42 +0000)]
DynamicTablesPkg: Add dynamic PPTT table generation support

The PPTT generator uses the configuration manager protocol to
obtain information about platform's processor topology and caches.
This data is then used to generate the PPTT table.

The table generator supports ACPI 6.3, PPTT table revision 2.

The dynamic PPTT generator also carries out extensive input
validation which includes cycle detection and MADT-PPTT
cross-validation. A number of architectural compliance checks
are also performed.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoIntelFsp2Pkg/SplitFspBin.py: Support rebasing 1.x binary.
Chasel Chiu [Tue, 28 May 2019 13:51:39 +0000 (21:51 +0800)]
IntelFsp2Pkg/SplitFspBin.py: Support rebasing 1.x binary.

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

Support rebasing FSP 1.x binary.
FSP 1.x has single component in binary so not supported
by split command and rebase can be done with the same
command for rebasing FSP-T component in FSP 2.x image.

Test: both FSP 2.x (Kabylake) and FSP 1.x (BroadwellDE) binary
      can be rebased successfully.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
4 years agoMaintainers.txt: Remove Yonghong from BaseTools Reviewer
Zhu, Yonghong [Wed, 5 Jun 2019 00:51:27 +0000 (08:51 +0800)]
Maintainers.txt: Remove Yonghong from BaseTools Reviewer

As Yonghong has some other focus, remove him from the reviewer.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoOvmfPkg: Drop build flag USE_LEGACY_ISA_STACK and legacy ISA stack
Hao A Wu [Fri, 24 May 2019 01:10:42 +0000 (09:10 +0800)]
OvmfPkg: Drop build flag USE_LEGACY_ISA_STACK and legacy ISA stack

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

According to the discussion at:
https://edk2.groups.io/g/devel/topic/30918343#38093

For OVMF, we keep both ISA stacks:
* The legacy one in PcAtChipsetPkg/IntelFrameworkModulePkg
* The Sio bus based OVMF-specified one introduced by commit a5cc178aeb

for a period of time (includes 1 stable tag: edk2-stable201905). And we
also keep the Sio bus based OVMF-specified stack as the default one (via a
build option 'USE_LEGACY_ISA_STACK') to validate its stability.

This commit will propose to drop the legacy ISA stack from OVMF and remove
the usage of the build flag 'USE_LEGACY_ISA_STACK' at the same time. This
is considered as a preparation for the removal of
PcAtChipsetPkg/IsaAcpiDxe & IntelFrameworkModulePkg.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoDynamicTablesPkg: Add ACPI 6.3 SPE support to MADT generator
Krzysztof Koch [Tue, 9 Apr 2019 13:44:37 +0000 (14:44 +0100)]
DynamicTablesPkg: Add ACPI 6.3 SPE support to MADT generator

The Dynamic Tables Framework now supports generating Multiple APIC
Description Table (MADT) revision 5 for ARM platforms while maintaining
backward-compatibility with ACPI 6.2.

The relevant change is the enablement of the Statistical Profiling
Extension (SPE).

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>