]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
4 years ago.mailmap: Add an entry for Marc-Andre Lureau
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:54:01 +0000 (12:54 +0100)]
.mailmap: Add an entry for Marc-Andre Lureau

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Marc-André Lureau to have his/her name and email
address displayed properly in the git history.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-19-philmd@redhat.com>
[lersek@redhat.com: translit subject to ASCII to suppress PatchCheck.py]

4 years ago.mailmap: Add an entry for Maciej Rabeda
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:54:00 +0000 (12:54 +0100)]
.mailmap: Add an entry for Maciej Rabeda

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Maciej Rabeda to have his/her name and email
address displayed properly in the git history.

Cc: Maciej Rabeda <maciej.rabeda@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-18-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Liming Gao
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:59 +0000 (12:53 +0100)]
.mailmap: Add an entry for Liming Gao

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Liming Gao to have his/her name and email
address displayed properly in the git history.

Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-17-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Laszlo Ersek
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:58 +0000 (12:53 +0100)]
.mailmap: Add an entry for Laszlo Ersek

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Laszlo Ersek to have his/her name and email
address displayed properly in the git history.

Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-16-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Jim Dailey
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:57 +0000 (12:53 +0100)]
.mailmap: Add an entry for Jim Dailey

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Jim Dailey to have his/her name and email
address displayed properly in the git history.

Cc: Jim Dailey <Jim.Dailey@Dell.com>
Reviewed-by: Jim Dailey <Jim.Dailey@Dell.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-15-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Jiewen Yao
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:56 +0000 (12:53 +0100)]
.mailmap: Add an entry for Jiewen Yao

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Jiewen Yao to have his/her name and email
address displayed properly in the git history.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-14-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Hot Tian
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:55 +0000 (12:53 +0100)]
.mailmap: Add an entry for Hot Tian

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Hot Tian to have his/her name and email address
displayed properly in the git history.

Cc: Hot Tian <hot.tian@intel.com>
Reviewed-by: Hot Tian <hot.tian@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-13-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Hao Wu
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:54 +0000 (12:53 +0100)]
.mailmap: Add an entry for Hao Wu

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Hao Wu to have his/her name and email address
displayed properly in the git history.

Cc: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-12-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Erik Bjorge
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:53 +0000 (12:53 +0100)]
.mailmap: Add an entry for Erik Bjorge

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Erik Bjorge to have his/her name and email
address displayed properly in the git history.

Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-11-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Eric Dong
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:52 +0000 (12:53 +0100)]
.mailmap: Add an entry for Eric Dong

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Eric Dong to have his/her name and email
address displayed properly in the git history.

Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-10-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Christopher J Zurcher
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:51 +0000 (12:53 +0100)]
.mailmap: Add an entry for Christopher J Zurcher

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Christopher J Zurcher to have his/her name and
email address displayed properly in the git history.

Cc: Christopher J Zurcher <christopher.j.zurcher@intel.com>
Reviewed-by: Christopher J Zurcher <christopher.j.zurcher@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-9-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Chasel Chiu
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:50 +0000 (12:53 +0100)]
.mailmap: Add an entry for Chasel Chiu

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Chasel Chiu to have his/her name and email
address displayed properly in the git history.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-8-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Baraneedharan Anbazhagan
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:49 +0000 (12:53 +0100)]
.mailmap: Add an entry for Baraneedharan Anbazhagan

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Baraneedharan Anbazhagan to have his/her name
and email address displayed properly in the git history.

Cc: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Reviewed-by: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-7-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Ashley DeSimone
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:48 +0000 (12:53 +0100)]
.mailmap: Add an entry for Ashley DeSimone

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Ashley DeSimone to have his/her name and email
address displayed properly in the git history.

Cc: Ashley DeSimone <ashley.e.desimone@intel.com>
Reviewed-by: Ashley DeSimone <ashley.e.desimone@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-6-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Ard Biesheuvel
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:47 +0000 (12:53 +0100)]
.mailmap: Add an entry for Ard Biesheuvel

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Ard Biesheuvel to have his/her name and email
address displayed properly in the git history.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-5-philmd@redhat.com>

4 years ago.mailmap: Add an entry for Antoine Coeur
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:46 +0000 (12:53 +0100)]
.mailmap: Add an entry for Antoine Coeur

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Antoine Cœur to have his/her name and email
address displayed properly in the git history.

Cc: Antoine Cœur <coeur@gmx.fr>
Reviewed-by: Antoine Cœur <coeur@gmx.fr>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-4-philmd@redhat.com>
[lersek@redhat.com: fix up valid PatchCheck.py error in Reviewed-by]
[lersek@redhat.com: translit subject to ASCII to suppress PatchCheck.py]

4 years ago.mailmap: Add an entry for Aaron Li
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:45 +0000 (12:53 +0100)]
.mailmap: Add an entry for Aaron Li

We use .mailmap to display contributors email addresses in an
uniform format.

Add an entry for Aaron Li to have his/her name and email address
displayed properly in the git history.

Cc: Aaron Li <aaron.li@intel.com>
Cc: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Aaron Li <aaron.li@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-3-philmd@redhat.com>

4 years ago.mailmap: Add a stub with documentation
Philippe Mathieu-Daude [Mon, 6 Jan 2020 11:53:44 +0000 (12:53 +0100)]
.mailmap: Add a stub with documentation

The .mailmap git feature helps fixing commit mistakes (in name/email).

The easiest way to use it is with the --use-mailmap flag:

  $ git log --use-mailmap

See:
* https://git-scm.com/docs/git-shortlog#_mapping_authors
* https://git-scm.com/docs/git-check-mailmap#_mapping_authors

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20200106115415.11624-2-philmd@redhat.com>

4 years agoMdeModulePkg/UsbMouseAbsolutePointer: Fix endpoint selection
MrChromebox [Mon, 6 Jan 2020 04:12:07 +0000 (12:12 +0800)]
MdeModulePkg/UsbMouseAbsolutePointer: Fix endpoint selection

The endpoint selected by the driver needs to not
only be an interrupt type, but have direction IN
as required to set up an asynchronous interrupt transfer.

Currently, the driver assumes that the first INT endpoint
will be of type IN, but that is not true of all devices,
and will silently fail on devices which have the OUT endpoint
before the IN. Adjust the endpoint selection loop to explictly
check for direction IN.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/Usb/UsbMouse: Fix endpoint selection
MrChromebox [Mon, 6 Jan 2020 04:12:06 +0000 (12:12 +0800)]
MdeModulePkg/Usb/UsbMouse: Fix endpoint selection

The endpoint selected by the driver needs to not
only be an interrupt type, but have direction IN
as required to set up an asynchronous interrupt transfer.

Currently, the driver assumes that the first INT endpoint
will be of type IN, but that is not true of all devices,
and will silently fail on devices which have the OUT endpoint
before the IN. Adjust the endpoint selection loop to explictly
check for direction IN.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: GuoMinJ <newexplorerj@gmail.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/Usb/EfiKey: Fix endpoint selection
MrChromebox [Mon, 6 Jan 2020 04:12:05 +0000 (12:12 +0800)]
MdeModulePkg/Usb/EfiKey: Fix endpoint selection

The endpoint selected by the driver needs to not
only be an interrupt type, but have direction IN
as required to set up an asynchronous interrupt transfer.

Currently, the driver assumes that the first INT endpoint
will be of type IN, but that is not true of all devices,
and will silently fail on devices which have the OUT endpoint
before the IN. Adjust the endpoint selection loop to explictly
check for direction IN.

Test: detachable keyboard on Google Pixel Slate now works.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: GuoMinJ <newexplorerj@gmail.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoSecurityPkg/Tcg2Pei: Add TCG PFP 105 support.
Jiewen Yao [Tue, 31 Dec 2019 02:37:30 +0000 (10:37 +0800)]
SecurityPkg/Tcg2Pei: Add TCG PFP 105 support.

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

Use EV_EFI_PLATFORM_FIRMWARE_BLOB2 if the TCG PFP revision is >= 105.
Use FvName as the description for the FV.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg/Smbios: Add TCG PFP rev 105 support.
Jiewen Yao [Tue, 31 Dec 2019 01:47:11 +0000 (09:47 +0800)]
MdeModulePkg/Smbios: Add TCG PFP rev 105 support.

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

Report EV_EFI_HANDOFF_TABLES2 if the platform chooses PFP >= 105.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
4 years agoMdeModulePkg/dec: add PcdTcgPfpMeasurementRevision PCD
Jiewen Yao [Tue, 31 Dec 2019 01:45:27 +0000 (09:45 +0800)]
MdeModulePkg/dec: add PcdTcgPfpMeasurementRevision PCD

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

This PCD is to control the TCG PFP spec revision.

The PFP 105 added new event type to support NIST SP800-155,
and deprecated old event type.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg/Smbios: Done measure Smbios multiple times.
Jiewen Yao [Tue, 31 Dec 2019 01:02:52 +0000 (09:02 +0800)]
MdeModulePkg/Smbios: Done measure Smbios multiple times.

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

In current implementation, the SMBIOS table is measured multiple
time in every readytoboot event.

This causes Smbios Table record appears multiple time in the TCG event log
and confuses people.

This issue makes it hard to implement 800-155 reference measurement.

This patch closes the event to make sure Smbios is measured only once.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
4 years agoSecurityPkg/Tcg2Dxe: Add Tcg2Dxe to support 800-155 event.
Jiewen Yao [Mon, 30 Dec 2019 08:38:38 +0000 (16:38 +0800)]
SecurityPkg/Tcg2Dxe: Add Tcg2Dxe to support 800-155 event.

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

The TCG2 DXE supports to parse the 800-155 event GUID from PEI
and puts to the beginning of the TCG2 event.

The TCG2 DXE also supports a DXE driver produces 800-155 event
and let TCG2 DXE driver record.

The 800-155 is a NO-ACTION event which does not need extend
anything to TPM2. The TCG2 DXE also supports that.

Multiple 800-155 events are supported. All of them will be put
to the beginning of the TCG2 event, just after the SpecId event.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoSecurityPkg/Guid: Add TCG 800-155 event GUID definition.
Jiewen Yao [Mon, 30 Dec 2019 08:36:02 +0000 (16:36 +0800)]
SecurityPkg/Guid: Add TCG 800-155 event GUID definition.

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

The PEIM can produce the 800-155 event and the event
will be recorded to TCG event log by the TCG2 DXE.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg/SdMmcPciHcDxe: Add function to start SD clock
Albecki, Mateusz [Fri, 20 Dec 2019 17:13:12 +0000 (01:13 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Add function to start SD clock

In SD card voltage switch flow we used to redo the
entire internal clock setup after voltage switch.
Since internal clock has already been setup this
is wasting time on polling the internal clock stable.
This commit changes it to only start the SD clock.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Marcin Wojtas <mw@semihalf.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Tested-by: Marcin Wojtas <mw@semihalf.com>
Tested-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg/SdMmcPciHcDxe: Hook SwitchClockFreq after SD clock start
Albecki, Mateusz [Fri, 20 Dec 2019 17:13:11 +0000 (01:13 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Hook SwitchClockFreq after SD clock start

For eMMC modules we used to notify the platform about frequency
change only after sending CMD13 which meant that platform
might not get a chance to apply required post frequency
change fixes to get the clock stable. To fix this
notification has been moved to SdMmcHcClockSupply function
just after we start the SD clock. During first time setup
the notification won't be sent to avoid changing old behavior.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Marcin Wojtas <mw@semihalf.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Tested-by: Marcin Wojtas <mw@semihalf.com>
Tested-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Pre-allocate PROCEDURE_TOKEN buffer
Eric Dong [Fri, 27 Dec 2019 07:30:27 +0000 (15:30 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Pre-allocate PROCEDURE_TOKEN buffer

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

Token is new introduced by MM MP Protocol. Current logic allocate Token
every time when need to use it. The logic caused SMI latency raised to
very high. Update logic to allocate Token buffer at driver's entry point.
Later use the token from the allocated token buffer. Only when all the
buffer have been used, then need to allocate new buffer.

Former change (9caaa79dd7e078ebb4012dde3b3d3a5d451df609) missed
PROCEDURE_TOKEN part, this change covers it.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
4 years agoUefiPayloadPkg/BootManager: Add PS2 keyboard support
Dong, Guo [Wed, 18 Dec 2019 00:12:17 +0000 (08:12 +0800)]
UefiPayloadPkg/BootManager: Add PS2 keyboard support

Add PS2 keyboard support.
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2316

This patch adds PS2 keyboard support in boot manager, and
add a build flag PS2_KEYBOARD_ENABLE for PS2 keyboard to
build PS2 keyboard driver and SIO driver. Be default the
build flag is not enabled since PS2 keyboard is not common
used. could use -DPS2_KEYBOARD_ENABLE to enable build it
if need this feature.

Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
4 years agoUefiCpuPkg/MpInitLib: Remove redundant microcode fields in CPU_MP_DATA
Hao A Wu [Tue, 24 Dec 2019 07:02:23 +0000 (15:02 +0800)]
UefiCpuPkg/MpInitLib: Remove redundant microcode fields in CPU_MP_DATA

Previous commits have introduced below fields in structure CPU_AP_DATA:

  UINT32                         ProcessorSignature;
  UINT8                          PlatformId;
  UINT64                         MicrocodeEntryAddr;

which store the information of:

A. CPUID
B. Platform ID
C. Detected microcode patch entry address (including the microcode patch
   header)

for each processor within system.

Therefore, the below fields in structure CPU_MP_DATA:

  UINT32                         ProcessorSignature;
  UINT32                         ProcessorFlags;
  UINT64                         MicrocodeDataAddress;
  UINT32                         MicrocodeRevision;

which store the BSP's information of:

A. CPUID
B. Platform ID
C. The address and revision of detected microcode patch

are redundant and can be removed.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoUefiCpuPkg/MpInitLib: Relocate microcode patch fields in CPU_MP_DATA
Hao A Wu [Wed, 25 Dec 2019 02:50:19 +0000 (10:50 +0800)]
UefiCpuPkg/MpInitLib: Relocate microcode patch fields in CPU_MP_DATA

The below 2 microcode patch related fields in structure CPU_MP_DATA:

  UINT64                         MicrocodePatchAddress;
  UINT64                         MicrocodePatchRegionSize;

They will be passed from PEI phase and be reused DXE phase.

Previously, these 2 fields were placed after some fields with type
'UINTN', this will lead to different field offset in different
architecture for them.

This commit will move them before the fields with different size in
different architecture to ensure they can be properly used in DXE phase.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoUefiCpuPkg/MpInitLib: Produce EDKII microcode patch HOB
Hao A Wu [Mon, 23 Dec 2019 06:32:49 +0000 (14:32 +0800)]
UefiCpuPkg/MpInitLib: Produce EDKII microcode patch HOB

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

This commit will update the MpInitLib to:

A. Collect the base address and size information after microcode patches
   being loaded into memory;
B. Collect the detected microcode patch for each processor within system;
C. Based on the collected information, produce the EDKII microcode patch
   HOB.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoUefiCpuPkg: Add definitions for EDKII microcode patch HOB
Hao A Wu [Mon, 23 Dec 2019 02:52:14 +0000 (10:52 +0800)]
UefiCpuPkg: Add definitions for EDKII microcode patch HOB

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

This commit will add the definitions for EDKII microcode patch HOB.

The intention of adding this HOB is to provide a scheme to store the below
information:

A. The base address and size of the microcode patches that are being
   loaded (from flash) into memory;
B. The information of detected microcode patch for each processor within
   the system.

The producer of the HOB will be the UefiCpuPkg/MpInitLib (where the load,
detect and apply of the microcode happen). The consumer of the HOB can be
modules that want to detect/apply the microcode patch by themselves again
later during the boot flow.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoUefiCpuPkg/MpInitLib: Reduce the size when loading microcode patches
Hao A Wu [Thu, 19 Dec 2019 06:33:44 +0000 (14:33 +0800)]
UefiCpuPkg/MpInitLib: Reduce the size when loading microcode patches

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

This commit will attempt to reduce the copy size when loading the
microcode patches data from flash into memory.

Such optimization is done by a pre-process of the microcode patch headers
(on flash). A microcode patch will be loaded into memory only when the
below 3 criteria are met:

A. With a microcode patch header (which means the data is not padding data
   between microcode patches);
B. The 'ProcessorSignature' & 'ProcessorFlags' fields in the header match
   at least one processor within system;
C. If the Extended Signature Table exists in a microcode patch, the
   'ProcessorSignature' & 'ProcessorFlag' fields in the table entries
   match at least one processor within system.

Criterion B and C will require all the processors to be woken up once to
collect their CPUID and Platform ID information. Hence, this commit will
move the copy, detect and apply of microcode patch on BSP and APs after
all the processors have been woken up.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoUefiCpuPkg/MpInitLib: Collect processors' CPUID & Platform ID info
Hao A Wu [Thu, 19 Dec 2019 05:36:24 +0000 (13:36 +0800)]
UefiCpuPkg/MpInitLib: Collect processors' CPUID & Platform ID info

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

This commit will collect the CPUID and Platform ID information for each
processor within system. They will be stored in the CPU_AP_DATA structure.

These information will be used in the next commit to decide whether a
microcode patch will be loaded into memory.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoBaseTools/Scripts: Add sendemail.transferEncoding to SetupGit.py
Desimone, Nathaniel L [Fri, 6 Dec 2019 18:15:22 +0000 (02:15 +0800)]
BaseTools/Scripts: Add sendemail.transferEncoding to SetupGit.py

If git finds a '\r' character in the message, then it
converts the entire message content into Quoted-Printable
encoding. It appears that when groups.io converts the QP
encoding back to text format, the '\r' characters somehow
become '\n'. To workaround this, the SetupGit.py script
will now explicitly set the sendemail.transferEncoding git
config option to '8bit'

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Fix buffer overflow issue.
Eric Dong [Mon, 23 Dec 2019 06:37:28 +0000 (14:37 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Fix buffer overflow issue.

The size for the array of mSmmMpSyncData->CpuData[] is 0 ~
mMaxNumberOfCpus -1. But current code may use
mSmmMpSyncData->CpuData[mMaxNumberOfCpus].

This patch fixed this issue.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
4 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Remove dependence between APs
Eric Dong [Mon, 23 Dec 2019 06:15:04 +0000 (14:15 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Remove dependence between APs

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

In current implementation, when check whether APs called by StartUpAllAPs
or StartUpThisAp, it checks the Tokens value used by other APs. Also the AP
will update the Token value for itself if its task finished. In this
case, the potential race condition  issues happens for the tokens.
Because of this, system may trig ASSERT during cycling test.

This change enhance the code logic, add new attributes for the token to
remove the reference for the tokens belongs to other APs.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
4 years agoedksetup.bat stuck on unicode locale Windows
Park, Aiden [Fri, 20 Dec 2019 18:24:37 +0000 (02:24 +0800)]
edksetup.bat stuck on unicode locale Windows

This issue happens under two conditions.
  1. Unicode language environment in Windows
  2. Python2 (Not reproducible with Python3)

Step to reproduce
  C:\edk2>edksetup.bat forcerebuild
The edksetup.bat stuck at 'nmake cleanall'.

Signed-off-by: Aiden Park <aiden.park@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoMdePkg/Tcg: Add new definition in TCG PFP spec.
Jiewen Yao [Wed, 18 Dec 2019 07:13:07 +0000 (15:13 +0800)]
MdePkg/Tcg: Add new definition in TCG PFP spec.

The latest TCG PFP specification (TCG PC Client Platform Firmware Profile
Specification, Revision 1.05) added new data structure. For example,
the SPDM device measurement. This patch adds the new content.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg: Use __builtin_offset with CLANGPDB toolchain
Alex James [Thu, 28 Nov 2019 05:56:45 +0000 (13:56 +0800)]
MdePkg: Use __builtin_offset with CLANGPDB toolchain

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

CLANGPDB does not define __GNUC__, but it does define __clang__. Check
for the __clang__ preprocessor definition to use __builtin_offsetof to
implement the OFFSET_OF macro.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Alex James <theracermaster@gmail.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg PciExpress21: PCI_REG_PCIE_DEVICE_CONTROL2 struct has 17 bits
Daniel Pawel Banaszek [Tue, 17 Dec 2019 13:39:25 +0000 (14:39 +0100)]
MdePkg PciExpress21: PCI_REG_PCIE_DEVICE_CONTROL2 struct has 17 bits

Device Control 2 Structure have an issue.
 LtrMechanism - there is 2 bits instead of 1.

Signed-off-by: Daniel Pawel Banaszek <daniel.pawel.banaszek@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoShellPkg/ShellProtocol: Return error code while fail parsing cmd-line
Zhichao Gao [Fri, 29 Nov 2019 08:51:45 +0000 (16:51 +0800)]
ShellPkg/ShellProtocol: Return error code while fail parsing cmd-line

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

Errors happened in the arguments parsing is not a critical error.
And it would miss the error status code in the release version of shell.
So replace the ASSERT with returning error status code while fail
parsing command-line in UpdateArgcArgv.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Linson Augustine <linson.augustine@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoMdePkg/Spdm: fix Nonce structure error.
Jiewen Yao [Wed, 18 Dec 2019 02:56:28 +0000 (10:56 +0800)]
MdePkg/Spdm: fix Nonce structure error.

Align to SPDM 1.0.0 specification.
Fix Nonce data structure error.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Resolve a issue of Incremental build
Bob Feng [Mon, 16 Dec 2019 10:18:46 +0000 (18:18 +0800)]
BaseTools: Resolve a issue of Incremental build

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

In patch set 13c5e34a - 0c3e8e99, we implemented incremental build with
using compiler/pre-processor generate dependent header file function.

A issue is found for MSVC compiler, that the cl.exe /showIncludes
build option generate header file list to either stdout or stderr.
For .c file, the header file list is print out to stdout while for
.vfr, .aslc and .nasm file, the file list is print out to stderr.

The build tool use two threads to process the message from stdout and
stderr, but to generate correct *.deps file, build tool need to
combine the header file list from stderr and other messages from stdout
together with correct time sequence order.

So this patch is trying to combine the stdout and stderr together for
the process which is for calling make program.

The impact of this patch is that the output message of build with -q
will be changed. The compiler error message will not print out.
The build behavior of other log level setting will not be impacted.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMaintainers.txt: Update email address and role
Maciej Rabeda [Wed, 11 Dec 2019 09:54:19 +0000 (17:54 +0800)]
Maintainers.txt: Update email address and role

Created new email account that will not append legal disclaimers to
my responses/patches.

Switching to NetworkPkg maintainer.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
4 years agoBaseTools:replaces the two offending quotes by ascii quotes
Fan, Zhiju [Tue, 17 Dec 2019 05:51:51 +0000 (13:51 +0800)]
BaseTools:replaces the two offending quotes by ascii quotes

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

That commit 13c5e34a1b introduces the first two UTF-8
characters (the quote ') in an otherwise all-ascii file.

In Conf\tools_def.template
There is tow lines of
  Notes: Since this tool chain is obsolete, it doesn't enable
  the compiler option for included header file list generation,

we replaces the two offending quotes by proper ascii quotes
The patch is going to fix this issue

Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: Fix build failure when multiple build targets given
Bob Feng [Wed, 11 Dec 2019 11:22:21 +0000 (19:22 +0800)]
BaseTools: Fix build failure when multiple build targets given

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

This patch is to fix a regression issue that build fails
if multiple build targets given.

Two changes cause this regression issue.
One is AutoGen object __hash__ function only
hash file path and arch, missing ToolChain and build target.

The other is changing the multiple-thread-genfds function as default
build behavior. To generate the genffs command to Makefile, there
is a global data set is used, GenFdsGlobalVariable, which cause build
tool use the data of first build-target build in
the second build-target build.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdePkg/Include: Add DCC and BCM2835 SPCR UART types
Pete Batard [Tue, 10 Dec 2019 18:23:04 +0000 (18:23 +0000)]
MdePkg/Include: Add DCC and BCM2835 SPCR UART types

As per the Microsoft Debug Port Table 2 (DBG2) documentation, that
can be found online, we are missing 2 serial interface types for
Arm DCC and Bcm2835 (the latter being used with the Raspberry Pi).

These same types are present in DebugPort2Table.h so add them to
SerialPortConsoleRedirectionTable.h too.

Note that we followed the same idiosyncrasies as DebugPort2Table
for naming these new macros.

Signed-off-by: Pete Batard <pete@akeo.ie>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoArmPkg/MmCommunicationDxe: relay architected PI events to MM context
Ard Biesheuvel [Tue, 5 Mar 2019 13:32:48 +0000 (14:32 +0100)]
ArmPkg/MmCommunicationDxe: relay architected PI events to MM context

PI defines a few architected events that have significance in the MM
context as well as in the non-secure DXE context. So register notify
handlers for these events, and relay them into the standalone MM world.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
4 years agoMdeModulePkg PeiCore: Improve comment semantics
Michael Kubacki [Thu, 21 Nov 2019 01:31:24 +0000 (17:31 -0800)]
MdeModulePkg PeiCore: Improve comment semantics

This patch clarifies wording in several PeiCore comments to improve
reading comprehension.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg PeiCore: Fix typos
Michael Kubacki [Thu, 21 Nov 2019 01:10:48 +0000 (17:10 -0800)]
MdeModulePkg PeiCore: Fix typos

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoIntelFsp2WrapperPkg: Fix various typos
Antoine Coeur [Wed, 4 Dec 2019 04:14:53 +0000 (12:14 +0800)]
IntelFsp2WrapperPkg: Fix various typos

Fix various typos in comments and documentation.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
4 years agoSecurityPkg/Tcg2Smm: Measure the table before patch.
Jiewen Yao [Sat, 7 Dec 2019 13:41:10 +0000 (21:41 +0800)]
SecurityPkg/Tcg2Smm: Measure the table before patch.

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

According to TCG PFP specification: the ACPI table must be
measured prior to any modification, and the measurement
must be same cross every boot cycle.

There is a fix 3a63c17ebc853cbb27d190729d01e27f68e65b94
for the HID data. However that is not enough.
The LAML/LASA and PCD configuration change may also cause
similar problem.

We need measure the table before any update.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Jiewen Yao <Jiewen.Yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoBaseTools: Remove redundant binary cache file
Steven Shi [Tue, 19 Nov 2019 08:22:08 +0000 (16:22 +0800)]
BaseTools: Remove redundant binary cache file

Redesign the binary cache and not need to save the
cache intermediate result and state in memory as a
ModuleBuildCacheIR class instance. So remove the
CacheIR.py which define the ModuleBuildCacheIR class.

Signed-off-by: Steven Shi <steven.shi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: Leverage compiler output to optimize binary cache
Steven Shi [Tue, 19 Nov 2019 08:17:00 +0000 (16:17 +0800)]
BaseTools: Leverage compiler output to optimize binary cache

Redesign the binary cache and bases on the compiler to
output the dependency header files info for every module.
The binary cache will directly consume the dependency header
files info and doesn't parse the C source code by iteself.
Also redesign the dependency files list format for module
and try to share the common lib hash result as more as
possible in local process. Remove the unnecessary share data
access across multiprocessing.

Signed-off-by: Steven Shi <steven.shi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: enhance the CacheCopyFile method arg names
Steven Shi [Mon, 21 Oct 2019 06:51:49 +0000 (14:51 +0800)]
BaseTools: enhance the CacheCopyFile method arg names

Enhance the CacheCopyFile method arg names to be more
clear and readable

Signed-off-by: Steven Shi <steven.shi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: store more complete output files in binary cache
Steven Shi [Mon, 21 Oct 2019 06:24:57 +0000 (14:24 +0800)]
BaseTools: store more complete output files in binary cache

Binary cache use the OutputFile method to return the module
built output files needed to store in cache, but current
OutputFile implementation doesn't return complete output files.
Enhance the OutputFile method to return more complete output files.

Signed-off-by: Steven Shi <steven.shi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: Enhance Basetool for incremental build
Bob Feng [Wed, 20 Nov 2019 02:58:30 +0000 (10:58 +0800)]
BaseTools: Enhance Basetool for incremental build

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

Include dependency file in Makefile to enhance
incremental build

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Update build_rule.txt to generate dependent files.
Bob Feng [Mon, 2 Dec 2019 08:25:32 +0000 (16:25 +0800)]
BaseTools: Update build_rule.txt to generate dependent files.

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

Enable the dependent files generation function for compilers
and Trim tool.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Generate dependent files for ASL and ASM files
Bob Feng [Wed, 20 Nov 2019 02:58:28 +0000 (10:58 +0800)]
BaseTools: Generate dependent files for ASL and ASM files

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

Implement the function in Trim tool to get the included
file list for ASL and ASM file.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Add build option for dependency file generation
Bob Feng [Mon, 2 Dec 2019 08:24:19 +0000 (16:24 +0800)]
BaseTools: Add build option for dependency file generation

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

Add /showIncludes for msvc and -MMD -MF $@.deps
for GCC and CLANG

Remove /MP for msvc since /MP does not work with
/showIncludes

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMaintainers: assume co-maintainership of StandaloneMmPkg
Ard Biesheuvel [Fri, 6 Dec 2019 15:21:33 +0000 (15:21 +0000)]
Maintainers: assume co-maintainership of StandaloneMmPkg

Achin has indicated that he no longer has the bandwidth available to
co-maintain StandaloneMmPkg, and has asked Sami and me to step in.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Jiewen Yao <Jiewen.Yao@intel.com>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoEmbeddedPkg: implement EDK2 IoMmu protocol wrapping DmaLib
Ard Biesheuvel [Thu, 21 Nov 2019 08:32:27 +0000 (09:32 +0100)]
EmbeddedPkg: implement EDK2 IoMmu protocol wrapping DmaLib

Implement a version of the EDK2 IoMmu protocol that is a simple wrapper
around DmaLib. This is intended to be used to wrap NonCoherentDmaLib so
that the generic PCI infrastructure can be used to implement support for
non cache-coherent DMA.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Tested-by: Pete Batard <pete@akeo.ie>
4 years agoEmbeddedPkg/NonCoherentDmaLib: implement support for DMA range limits
Ard Biesheuvel [Thu, 21 Nov 2019 08:32:26 +0000 (09:32 +0100)]
EmbeddedPkg/NonCoherentDmaLib: implement support for DMA range limits

Implement support for driving peripherals with limited DMA ranges to
NonCoherentDmaLib, by adding a device address limit, and taking it,
along with the device offset, into account when allocating or mapping
DMA buffers.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Pete Batard <pete@akeo.ie>
Acked-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time
Eric Dong [Fri, 6 Dec 2019 03:36:35 +0000 (11:36 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time

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

Token is new introduced by MM MP Protocol. Current logic allocate Token
every time when need to use it. The logic caused SMI latency raised to
very high. Update logic to allocate Token buffer at driver's entry point.
Later use the token from the allocated token buffer. Only when all the
buffer have been used, then need to allocate new buffer.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
4 years agoBaseTools: Avoid "is" with a literal Python 3.8 warnings
Philippe Mathieu-Daude [Thu, 5 Dec 2019 11:19:41 +0000 (19:19 +0800)]
BaseTools: Avoid "is" with a literal Python 3.8 warnings

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

The following statement produces a SyntaxWarning with Python 3.8:

  if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in \
    str(FdRegion.RegionDataList):
  BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py:168: SyntaxWarning: \
    "is" with a literal. Did you mean "=="?

Change the 'is' operator by the conventional '==' comparator.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years ago.pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins
Philippe Mathieu-Daude [Thu, 5 Dec 2019 11:19:42 +0000 (19:19 +0800)]
.pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins

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

To avoid SyntaxWarning with Python 3.8, change the 'is' operator
by the conventional '==' comparator.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoArmPkg: Dispatch deferred images after EndOfDxe
Sami Mujawar [Thu, 11 Apr 2019 18:41:36 +0000 (11:41 -0700)]
ArmPkg: Dispatch deferred images after EndOfDxe

Third party driver images loaded from Option ROM get queued
for execution after EndOfDxe. These queued images need to be
dispatched from the PlatformBootManagerLib.

Since the queued images were not dispatched, the PCI Option
ROM drivers were not getting loaded on Juno. Therefore,
add call to EfiBootManagerDispatchDeferredImages() for
dispatching deferred images from PlatformBootManagerLib.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4 years agoShellPkg/UefiHandleParsingLib: Fix error allocate pool
Zhichao Gao [Mon, 15 Jul 2019 06:23:21 +0000 (14:23 +0800)]
ShellPkg/UefiHandleParsingLib: Fix error allocate pool

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

For function InsertNewGuidNameMapping, it rellocate the
mGuidList with new size
"mGuidListCount+1 * sizeof(GUID_INFO_BLOCK)". That isn't
its purpose and would cause a overflow operation in
"mGuidList[mGuidListCount - 1].xxx = xxx". Its purpose
is to increase 1 block size of mGuidList. Change it to
"(mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK)".

Adjust the coding style of this function.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
4 years agoShellPkg/edit: typo "%d Lines Wrote"
Heinrich Schuchardt [Sun, 24 Nov 2019 10:33:20 +0000 (18:33 +0800)]
ShellPkg/edit: typo "%d Lines Wrote"

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

When a file is saved in the edit command a status message L"%d Lines Wrote"
is displayed. The hexedit command suffers from the same typo.

Change the message to L"%d Lines Written".

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoShellPkg: acpiview: IORT Spec Rev D updates
Sami Mujawar [Mon, 25 Nov 2019 09:18:13 +0000 (17:18 +0800)]
ShellPkg: acpiview: IORT Spec Rev D updates

Updated IORT parser to conform to the IO Remapping
Table, Platform Design Document, Revision D, March 2018.

The following structure parsers have been updated:
  1. SMMUv3 - added proximity domain and device Id
              mapping index.
  2. RootComplex - added memory address size limit.
  2. PMCG - added page 1 support.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Add support for parsing FACS
Sami Mujawar [Fri, 22 Nov 2019 11:31:45 +0000 (19:31 +0800)]
ShellPkg: acpiview: Add support for parsing FACS

Add support for parsing the ACPI FACS table.

The FADT parser has also been updated as it
links the FACS table using the FIRMWARE_CTRL
or X_FIRMWARE_CTRL fields.

Since the FACS table does not follow the standard
ACPI header, the FADT parser extracts the FACS
signature, length and version fields before invoking
the FACS parser.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoMdeModulePkg: Add ARM/Aarch64 support which were missing
Zhiguang Liu [Wed, 4 Dec 2019 00:45:35 +0000 (08:45 +0800)]
MdeModulePkg: Add ARM/Aarch64 support which were missing

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

Add ARM/Aarch64 which were missing to VALID_ARCHITECTURES
 in LzmaCustomDecompressLib.inf

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
4 years agoMdeModulePkg: LzmaCustomDecompressLib.inf don't support EBC anymore
Zhiguang Liu [Wed, 4 Dec 2019 00:43:24 +0000 (08:43 +0800)]
MdeModulePkg: LzmaCustomDecompressLib.inf don't support EBC anymore

After unifying the definition of size_t, EBC compiler has failure.
So don't compile this inf file for EBC

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

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
4 years agoBaseTools:Enhance the way to handling included dsc file
Fan, ZhijuX [Tue, 3 Dec 2019 09:04:25 +0000 (17:04 +0800)]
BaseTools:Enhance the way to handling included dsc file

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

In Dsc Parser, included dsc file is parsed always no matter
if its condition is False

  gUefiOvmfPkgTokenSpaceGuid.test1|FALSE
!if gUefiOvmfPkgTokenSpaceGuid.test1 == FALSE
  !include OvmfPkg/test1.dsc
!else
  !include OvmfPkg/test2.dsc
!endif

The patch avoids processing redundant dsc files and improves
the way Tool handles them.

In the above case, since the conditional result is FALSE,
"test2.dsc" is not parsed.

Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoUefiCpuPkg: Update the coding styles
Shenglei Zhang [Thu, 14 Nov 2019 11:00:10 +0000 (16:30 +0530)]
UefiCpuPkg: Update the coding styles

In MpLib.c, remove the white space on a new line.
In PageTbl.c and PiSmmCpuDxeSmm.h, update the comment style.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoUefiCpuPkg/UefiCpuPkg.uni: Add missing strings for PCD
Shenglei Zhang [Thu, 14 Nov 2019 10:46:59 +0000 (16:16 +0530)]
UefiCpuPkg/UefiCpuPkg.uni: Add missing strings for PCD

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoNetworkPkg/NetworkPkg.uni: Add missing strings for PCD
Shenglei Zhang [Thu, 14 Nov 2019 10:43:14 +0000 (16:13 +0530)]
NetworkPkg/NetworkPkg.uni: Add missing strings for PCD

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Maciej Rabeda <maciej.rabeda@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
4 years agoMdeModulePkg/MdeModulePkg.uni: Add missing strings for PCD
Shenglei Zhang [Wed, 13 Nov 2019 04:30:34 +0000 (10:00 +0530)]
MdeModulePkg/MdeModulePkg.uni: Add missing strings for PCD

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoNetworkPkg: Fixes to static code analysis hits
Maciej Rabeda [Thu, 28 Nov 2019 14:46:06 +0000 (15:46 +0100)]
NetworkPkg: Fixes to static code analysis hits

Introducing fixes to memory leak issues identified by static code analysis
tool.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
4 years agoCryptoPkg/OpensslLib.inf: list OpenSSL local header "ms/uplink.h"
Laszlo Ersek [Thu, 21 Nov 2019 08:01:10 +0000 (09:01 +0100)]
CryptoPkg/OpensslLib.inf: list OpenSSL local header "ms/uplink.h"

Commit 8906f076de35 ("CryptoPkg/OpensslLib: Add missing header files in
INF file", 2019-08-16) incorrectly placed "ms/uplink.h" in the
auto-generated part of [Sources], in "OpensslLib.inf".

("ms/uplink.h" was added in the right spot in "OpensslLibCrypto.inf".)

Subsequently, when commit 9f4fbd56d430 ("CryptoPkg/OpensslLib: Update
process_files.pl to generate .h files", 2019-10-30) re-generated that part
of "OpensslLib.inf", the "ms/uplink.h" file reference was lost. This
triggers a warning from the "build" utility now.

Name the header file in the right spot in [Sources].

This change makes "OpensslLib.inf" consistent with "OpensslLibCrypto.inf".

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Shenglei Zhang <shenglei.zhang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Fixes: 8906f076de35b222a7d62bcf6ed1a4a2498a5791
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoCryptoPkg/OpensslLib: improve INF file consistency
Laszlo Ersek [Thu, 21 Nov 2019 07:46:10 +0000 (08:46 +0100)]
CryptoPkg/OpensslLib: improve INF file consistency

When diffing "OpensslLib.inf" against "OpensslLibCrypto.inf", the *only*
differences should be:

- BASE_NAME, MODULE_UNI_FILE, and FILE_GUID are expected to differ, in
  [Defines];

- "OpensslLib.inf" is expected to list "$(OPENSSL_PATH)/ssl/..." source
  files in the auto-generated part of the [Sources] section.

Commit 8906f076de35 ("CryptoPkg/OpensslLib: Add missing header files in
INF file", 2019-08-16) broke that invariant, by adding "buildinf.h" and
"rand_pool_noise.h" in different order to both INF files.

Fix that order in "OpensslLib.inf" now. (Note that this does not
re-establish full consistency between both INF files -- it just highlights
another problem, which we'll fix in the next patch.)

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Shenglei Zhang <shenglei.zhang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Fixes: 8906f076de35b222a7d62bcf6ed1a4a2498a5791
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoMdeModulePkg/VariableSmmRuntimeDxe.inf: list local header "Variable.h"
Laszlo Ersek [Thu, 21 Nov 2019 07:31:24 +0000 (08:31 +0100)]
MdeModulePkg/VariableSmmRuntimeDxe.inf: list local header "Variable.h"

Commit aab3b9b9a1e5 ("MdeModulePkg/Variable: Add RT GetVariable() cache
support", 2019-11-05) added "VariableParsing.h" to
"VariableSmmRuntimeDxe.inf".

"VariableParsing.h" includes "Variable.h", so the "build" utility is right
to warn us that "Variable.h" should be listed in [Sources] too.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Fixes: aab3b9b9a1e5e1f3fa966fb1667fc3e6c47e7706
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoMdeModulePkg/Variable: Initialize local variable "RtPtrTrack" edk2-stable201911
Kubacki, Michael A [Thu, 21 Nov 2019 23:02:36 +0000 (07:02 +0800)]
MdeModulePkg/Variable: Initialize local variable "RtPtrTrack"

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

Fixes a new build warning in VS2012 introduced in f8ff4cca7c.

This patch initializes the local variable "RtPtrTrack" in
FindVariableInRuntimeCache ().

This ensures the pointers in the structure are initialized
in the case no variable stores exist in the list of variable
stores.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg/Variable: Initialize local variable "Variable"
Kubacki, Michael A [Thu, 21 Nov 2019 23:02:35 +0000 (07:02 +0800)]
MdeModulePkg/Variable: Initialize local variable "Variable"

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

Fixes a new build warning in VS2012 introduced in f8ff4cca7c.

This patch initializes the local variable "Variable" in
VariableServiceGetNextVariableInternal ().

This ensures the pointers in the structure are initialized
in the case no variable stores exist in the list of variable
stores.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoStandaloneMmPkg: Fix build failure - Bug 2253
Sami Mujawar [Mon, 25 Nov 2019 09:06:04 +0000 (17:06 +0800)]
StandaloneMmPkg: Fix build failure - Bug 2253

The StandaloneMmPkg currently has code for supporting
Arm architecture only. Support for X64 and IA32 is
currently under development on a separate branch.

However, StandaloneMmPkg/StandaloneMmPkg.dsc is
indicating that support for X64 and IA32 is
available which is causing build failures.
This has been reported in
https://bugzilla.tianocore.org/show_bug.cgi?id=2253

This issue has been discussed earlier on the list:
(1) https://edk2.groups.io/g/devel/message/47276

(2) https://edk2.groups.io/g/devel/message/47283

In light of the above, this patch removes IA32 and X64
from SUPPORTED_ARCHITECTURES, until support for the
respective architectures is merged into StandaloneMmPkg.

Cc: Achin Gupta <achin.gupta@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
4 years agoBaseTools:fix regression issue for platform .map file
Fan, ZhijuX [Fri, 22 Nov 2019 10:54:39 +0000 (18:54 +0800)]
BaseTools:fix regression issue for platform .map file

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

This patch is to fix a build tool regression issue which was introduced
by commit b8ac0b7f28.This issue caused map file lost the line of IMAGE=***.
For example,in Ovmf.map, there is no line of (IMAGE=<path to efi> ) under
each of modules item.

The path to the efi file generated by each module is written on this line
The purpose of this line is add the debug image full path.
there is no information about the module in the map file other than FVName,
it allows us to quickly know which module this part corresponds to.

In commit b8ac0b7f28,add a line ("self.BuildModules = []") in function,
but it's used to calculate the variable ModuleList in the following code.

Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoMdePkg: Update the comments of IsLanguageSupported
Shenglei Zhang [Thu, 14 Nov 2019 11:46:41 +0000 (19:46 +0800)]
MdePkg: Update the comments of IsLanguageSupported

Keep the comment style of IsLanguageSupported align with
other functions.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools:Add [packages] section in dsc file
Fan, ZhijuX [Thu, 14 Nov 2019 01:27:42 +0000 (09:27 +0800)]
BaseTools:Add [packages] section in dsc file

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

Currently a PCD (e.g. FeaturePCD) cannot be used in a conditional
statement in a DSC/FDF file without a module in the build referencing
the PCD package DEC file.

An example implementation that to support this is to allow a [Packages]
section in the DSC file to list additional package dependencies for PCD
references in the package DSC/FDF files.

this patch is going to  add the ability to have the [packages] section
defined in the DSC file

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Acked-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoMdeModulePkg/NvmExpressDxe: Fix wrong queue size for async IO queues
Sean Brogan [Tue, 3 Sep 2019 23:52:26 +0000 (16:52 -0700)]
MdeModulePkg/NvmExpressDxe: Fix wrong queue size for async IO queues

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

When a packet is queued/completed for the asynchronous IO queue, the logic
to roll over to the front of the queue doesn't account for actual size of
the IO Submission/Completion queue.

This causes a device to hang due to doorbell being outside of visible
queue. An example would be if an NVMe drive only supported a queue size of
128 while the driver supports 256.

Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Ray Ni <ray.ni@intel.com>
4 years agoEmulatorPkg DSC and WinHost.inf: Update tool chain name to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:04:36 +0000 (16:04 +0800)]
EmulatorPkg DSC and WinHost.inf: Update tool chain name to CLANGPDB

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoOvmfPkg DSC: Update tool chain name to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:04:01 +0000 (16:04 +0800)]
OvmfPkg DSC: Update tool chain name to CLANGPDB

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoCryptoPkg CryptoLib: Update tool chain name to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:03:24 +0000 (16:03 +0800)]
CryptoPkg CryptoLib: Update tool chain name to CLANGPDB

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg RegularExpressionDxe: Update tool chain name to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:02:18 +0000 (16:02 +0800)]
MdeModulePkg RegularExpressionDxe: Update tool chain name to CLANGPDB

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

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoBaseTools: Rename tool chain CLANG9 to CLANGPDB
Liming Gao [Thu, 14 Nov 2019 08:00:53 +0000 (16:00 +0800)]
BaseTools: Rename tool chain CLANG9 to CLANGPDB

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

Based on feedback from https://edk2.groups.io/g/devel/message/50466,
CLANGPDB is the most acceptable tool chain name,
because this tool chain generates PE/COFF image with PDB debug symbol.
The following changes are made in this patch.
1. Update tool chain name from CLANG9 to CLANGPDB.
2. Update tool chain BUILDRULEFAMILY from CLANGPE to CLANGPDB.
3. Update CLANG9_BIN env name to CLANG_BIN without version info.

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoMdeModulePkg: Unify the definitions of size_t
Zhiguang Liu [Tue, 12 Nov 2019 08:47:44 +0000 (16:47 +0800)]
MdeModulePkg: Unify the definitions of size_t

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

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdeModulePkg/Variable: Fix volatile variable RT cache update logic
Michael Kubacki [Mon, 11 Nov 2019 04:03:21 +0000 (20:03 -0800)]
MdeModulePkg/Variable: Fix volatile variable RT cache update logic

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

During a SetVariable () invocation, UpdateVariable () is called.
UpdateVariable () contains logic to determine whether a volatile or
non-volatile UEFI variable was set so the corresponding runtime
cache can be updated to reflect the change. The current logic simply
evaluates Variable->Volatile to determine which runtime cache should
be updated.

The problem is Variable->Volatile does not always reflect whether a
volatile variable is being set. Variable->Volatile is set to TRUE
only in the case a pre-existing variable is found in the volatile
variable store. Therefore, the value is FALSE when a new volatile
variable is written.

This change updates the logic to take this into account. If a new
variable is written successfully, the Attributes will accurately
reflect whether the variable is non-volatile. If a pre-existing
variable is modified, the Volatile field will reflect the type of
variable (Attributes are not reliable; e.g. 0x0 indicates deletion).

* Observable symptom: A volatile variable that was set successfully
  might return EFI_NOT_FOUND when the variable should be found.

* The issue is a regression introduced to the variable services only
  when the variable runtime cache is enabled by the following PCD
  being set to TRUE:
  gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache

* The issue was implemented in commit aab3b9b9a1 but the PCD was not
  set to TRUE by default enabling the issue until commit e07b7d024a.

Fixes: aab3b9b9a1e5e1f3fa966fb1667fc3e6c47e7706
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>