27052c21c4
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 >
2019-06-24 09:18:31 +08:00
57ec204e69
Revert "Capsule-on-Disk entire Patch
...
This reverts commit 0d4aa276d1
,
6470a43160
,
fd72860895
,
7837d12498
,
6b32af2e10
,
8636f70b5a
,
f17935321a
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 >
2019-06-21 10:25:25 +08:00
f17935321a
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 >
2019-06-20 19:49:31 +08:00
7837d12498
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 >
2019-06-20 16:50:41 +08:00
fd72860895
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 >
2019-06-20 16:50:41 +08:00
cf78c9d18a
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 >
2019-06-14 21:26:28 +02:00
0a35997643
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 >
2019-06-13 14:53:40 +08:00
297495f410
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 >
2019-06-13 14:53:40 +08:00
4542f8b813
NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg
...
Signed-off-by: Liming Gao <liming.gao@intel.com >
Cc: Siyuan Fu <siyuan.fu@intel.com >
Cc: Jiaxin Wu <jiaxin.wu@intel.com >
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com >
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com >
2019-05-27 09:25:18 +08:00
0a506fc7ab
MdeModulePkg: Remove BootInRecoveryMode PPI
...
DEPEX from PEI storage stack.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1777
BootInRecoveryMode Ppi dependency should be removed from PEI storage stack
drivers. Besides recovery, more features are using the storage stack.
Platform can apply Ppi dependency in Recovery FV which contains full
storage driver stack. Platform storage stack modules, such as host
controller init PEI module, should also remove this dependency.
Cc: Ray Ni <ray.ni@intel.com >
Cc: Hao A Wu <hao.a.wu@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 >
2019-05-09 20:52:41 +08:00
059cf575eb
MdeModulePkg/Setup: Remove PcdFrameworkCompatibilitySupport usage
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464
Currently Framework compatibility support is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.
Cc: Liming Gao <liming.gao@intel.com >
Cc: Eric Dong <eric.dong@intel.com >
Signed-off-by: Dandan Bi <dandan.bi@intel.com >
Reviewed-by: Eric Dong <eric.dong@intel.com >
2019-05-09 09:42:55 +08:00
2e217e4022
MdeModulePkg/CdExpress: Remove PcdFrameworkCompatibilitySupport usage
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464
Currently Framework compatibility is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.
Cc: Hao Wu <hao.a.wu@intel.com >
Cc: Liming Gao <liming.gao@intel.com >
Signed-off-by: Dandan Bi <dandan.bi@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
2019-05-09 09:42:55 +08:00
af51cb48a2
MdeModulePkg/StatusCodeHandlerRuntimeDxe: make global variable static
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1740
Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.
Cc: Laszlo Ersek <lersek@redhat.com >
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: Dandan Bi <dandan.bi@intel.com >
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2019-04-28 10:54:28 +08:00
2410ac0230
MdeModulePkg/FirmwarePerformanceDxe: make global variable static
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1740
Add a 'static' storage-class specifier to the global variables
that only used in a single file to minimize the name collisions.
This is only for the variable named 'mExitBootServicesEvent'.
Cc: Laszlo Ersek <lersek@redhat.com >
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: Dandan Bi <dandan.bi@intel.com >
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2019-04-28 10:54:27 +08:00
3bb9b1fad3
MdeModulePkg/ResetSystemPei: Change comments of ResetSystem2
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1460
Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not.
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 Wu <hao.a.wu@intel.com >
2019-04-28 09:40:15 +08:00
f69cb10828
MdeModulePkg/ResetSystemRuntimeDxe: Change comments
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1460
Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus
is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific
or not. So change the comments of RuntimeServiceResetSystem.
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 Wu <hao.a.wu@intel.com >
2019-04-28 09:40:15 +08:00
60a86abf95
MdeModulePkg/HiiDB: Minimize memory allocation times after ReadyToBoot
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1597
Currently RTData are allocated at/after ReadyToBoot to store the
contents in HiiDatabase and the HII configurations for OS runtime
utilization.
Some platforms may meet S4 resume issue since the allocation after
ReadyToBoot cause memory map change.
Now this patch is to do some overallocation to minimize the number
of memory allocations after ReadyToBoot and also add warning
message when do allocation after ReadyToBoot.
Cc: Michael D Kinney <michael.d.kinney@intel.com >
Cc: Liming Gao <liming.gao@intel.com >
Cc: Eric Dong <eric.dong@intel.com >
Signed-off-by: Dandan Bi <dandan.bi@intel.com >
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com >
Reviewed-by: Eric Dong <eric.dong@intel.com >
2019-04-28 09:32:42 +08:00
ab7e02a4f8
MdeModulePkg/HiiDatabaseDxe: Release lock on all error return path
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1652
Commit ffe5f7a6b4
"MdeModulePkg/HiiDatabase: Fix potential integer overflow "
added some new error paths, but it missed releasing the
mHiiDatabaseLock lock on those paths.
This patch releases mHiiDatabaseLock on those paths.
Cc: Hao Wu <hao.a.wu@intel.com >
Cc: Ray Ni <ray.ni@intel.com >
Cc: Liming Gao <liming.gao@intel.com >
Signed-off-by: Dandan Bi <dandan.bi@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
(cherry picked from commit 927c516f9557f2f36319fe5d2508af29e3375fb8)
2019-04-24 10:23:20 +08:00
42d8be0eaa
MdeModulePkg/CapsulePei: Update the debug code to print 64bit data
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1677
For some pointer and UINT64 data, the debug code print with '%x'.
Which would loss the upper 32bit data. So update '%x' to '%lx'
for these data. And change the pointer value from '%x' to '%p'.
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 Wu <hao.a.wu@intel.com >
2019-04-16 13:03:12 +08:00
85b0193276
MdeModulePkg/CapsulePei: Change debug MACRO
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1677
Change debug printlevel from EFI_D_ to DEBUG_.
DEBUG_ version is recommanded to use.
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 Wu <hao.a.wu@intel.com >
2019-04-16 13:03:12 +08:00
095fcfc606
MdeModulePkg/EbcDxe: implement the PE/COFF emulator protocol
...
Implement the new EDK2 PE/COFF image emulator protocol so that we can
remove the EBC specific handling in the DXE core and other places in
the core code.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
2019-04-14 18:37:33 -07:00
9d510e61fc
MdeModulePkg: Replace BSD License with BSD+Patent License
...
https://bugzilla.tianocore.org/show_bug.cgi?id=1373
Replace BSD 2-Clause License with BSD+Patent License. This change is
based on the following emails:
https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html
https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html
RFCs with detailed process for the license change:
V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html
V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html
V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
2019-04-09 10:58:08 -07:00
2bc8224463
MdeModulePkg: Add a PEIM to install Debug PPI
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1549
Add a PEIM to install Debug PPI so that PEI debug library
instance can locate gEdkiiDebugPpiGuid to implement the
debug functions. Using this PPI can reduce the size of
PEIMs which consume the debug library.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com >
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 >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2019-04-02 12:49:29 +08:00
9338e23017
MdeModulePkg/ResetSystemRuntimeDxe: Remove DoS3 in warm reset
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1462
Original logic is that checking the CapsuleUpdate variable
and do the EnterS3WithImmediateWake if the system require a
capsule update. The EnterS3WithImmediateWake is usually
implemented in Platform ResetSystemLib instance and it may
do some operation for capsule update. For now, thess preparations
of capsule are platform reset notify functions' duty. Most
platforms need flush cache to memory before warm reset during
capsule update and this operation is added to capsule flow.
So it is safe to remove it and do not affect the capsule update
function.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com >
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 >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2019-04-02 12:49:03 +08:00
a89fd3a359
MdeModulePkg/CapsuleRuntimeDxe: Add cache flush for IA32 and X64
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1462
The IA32 and X64 ARCH need cache flush function during capsule update.
And the cache flush is already implemented in arm ARCH, so add this
function CapsuleCacheWriteBack() to IA32 and X64 ARCH. And add a null
version for EBC.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com >
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: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2019-04-02 12:49:03 +08:00
89910a39dc
MdeModulePkg/HiiImage: Fix stack overflow when corrupted BMP is parsed (CVE-2018-12181)
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1135
For 4bit BMP, there are only 2^4 = 16 colors in the palette.
But when a corrupted BMP contains more than 16 colors in the palette,
today's implementation wrongly copies all colors to the local
PaletteValue[16] array which causes stack overflow.
The similar issue also exists in the logic to handle 8bit BMP.
The patch fixes the issue by only copies the first 16 or 256 colors
in the palette depending on the BMP type.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ray Ni <ray.ni@intel.com >
Cc: Liming Gao <liming.gao@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
2019-03-08 23:44:59 +08:00
ffe5f7a6b4
MdeModulePkg/HiiDatabase: Fix potential integer overflow (CVE-2018-12181)
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1135
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ray Ni <ray.ni@intel.com >
Cc: Dandan Bi <dandan.bi@intel.com >
Cc: Hao A Wu <hao.a.wu@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
2019-03-08 23:44:58 +08:00
38c9fbdcaa
MdeModulePkg/RamDiskDxe: Restrict on RAM disk size (CVE-2018-12180)
...
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1134
Originally, the block size of created Ram disks is hard-coded to 512
bytes. However, if the total size of the Ram disk is not a multiple of 512
bytes, there will be potential memory access issues when dealing with the
last block of the Ram disk.
This commit will adjust the block size of the Ram disks to ensure that the
total size is a multiple of the block size.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Star Zeng <star.zeng@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Ray Ni <ray.ni@intel.com >
2019-02-28 08:15:51 +08:00
fccdb88022
MdeModulePkg/PartitionDxe: Ensure blocksize holds MBR (CVE-2018-12180)
...
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1134
The commit adds checks for detecting GPT and MBR partitions.
These checks will ensure that the device block size is big enough to hold
an MBR (512 bytes).
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Star Zeng <star.zeng@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Ray Ni <ray.ni@intel.com >
2019-02-28 08:15:42 +08:00
e2531da3b8
MdeModulePkg: change the function name ResetSystem
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460
Change the function name form ResetSystem to RuntimeServiceResetSystem.
Because ResetSystem and EfiResetSystem would be used in ResetSystemLib
and RuntimeLib.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com >
Cc: Ray Ni <ray.ni@intel.com >
Cc: Liming Gao <liming.gao@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2019-02-22 09:45:43 +08:00
4a7aa8d34a
MdeModulePkg: Remove EmuVariableRuntimeDxe
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.
The real variable driver has been updated to support emulated
variable NV mode.
This patch removes EmuVariableRuntimeDxe after platforms are
migrated to use the merged variable driver.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-02-19 17:36:11 +08:00
a083afa3fe
MdeModulePkg/PropertiesTableAttributesDxe: Remove this driver
...
This functionality of this driver has been deprecated and
no platform employs this driver. It can be removed completely.
https://bugzilla.tianocore.org/show_bug.cgi?id=1475
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 >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com >
Reviewed-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
2019-02-19 16:15:23 +08:00
69544d224e
MdeModulePkg/SmmS3SaveStateDxe: Change function parameter types
...
Change parameter Opcode from UINT16 to UINTN in
BootScriptWrite and BootScriptInsert.
https://bugzilla.tianocore.org/show_bug.cgi?id=1517
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 >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2019-02-14 15:38:44 +08:00
5bdcfe3385
MdeModulePkg/S3SaveStateDxe: Change function parameter types
...
Change parameter Opcode from UINT16 to UINTN in
BootScriptWrite and BootScriptInsert.
https://bugzilla.tianocore.org/show_bug.cgi?id=1517
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 >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2019-02-14 15:38:44 +08:00
463d994f9c
MdeModulePkg/Ip4Dxe: Uninstall protocols when error happen in Driver Binding Start.
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1447
This patch is to uninstall Ip4ServiceBindingProtocol and Ip4Config2Protocol when
error happen in Driver Binding Start.
Cc: Michael Turner <Michael.Turner@microsoft.com >
Cc: Ye Ting <ting.ye@intel.com >
Cc: Fu Siyuan <siyuan.fu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com >
Signed-off-by: Michael Turner <Michael.Turner@microsoft.com >
Reviewed-By: Ye Ting <ting.ye@intel.com >
2019-02-12 08:25:31 +08:00
44289eeafd
MdeModulePkg: Fix coding style issues
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1479
Fix issues that reported by Edk2 coding style check tool(ECC) that:
Comment description should end with period '.'
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org >
2019-02-02 21:41:38 +08:00
357fc11c35
MdeModulePkg/EbcDebugger: Use AsciiCharToUpper and CharToUpper
...
InternalUnicodeToUpper and InternalAsciiToUpper are internal functions,
so they are substituted by public functions AsciiCharToUpper and CharToUpper.
And their implements are removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1369
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Cc: Ruiyu Ni <ruiyu.ni@intel.com >
Cc: Star Zeng <star.zeng@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Ray Ni <ray.ni@intel.com >
2019-01-31 20:19:16 +08:00
cecbecb71d
MdeModulePkg/EbcDebugger: Change function names
...
Change UnicodeToUpper to InternalUnicodeToUpper.
Change AsciiToUpper to InternalAsciiToUpper.
These changes are committed for bisectability, or build failure will
occur when 2/7 is applied. Because the introduced function names in
2/7 are the same as ones in EdbSupporting.c.
https://bugzilla.tianocore.org/show_bug.cgi?id=1369
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Cc: Ruiyu Ni <ruiyu.ni@intel.com >
Cc: Star Zeng <star.zeng@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
Reviewed-by: Ray Ni <ray.ni@intel.com >
2019-01-31 20:19:12 +08:00
9084239f34
MdeModulePkg VariableStandaloneMm: Add PcdEmuVariableNvModeEnable in inf
...
It was missed in 7cd6995946
when rebasing
the patches after 688b2cad7b
added
VariableStandaloneMm.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Dandan Bi <dandan.bi@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Reviewed-by: Dandan Bi <dandan.bi@intel.com >
2019-01-25 11:41:14 +08:00
3c007f3653
MdeModulePkg VariablePei: Don't check BOOT_IN_RECOVERY_MODE
...
Don't check BOOT_IN_RECOVERY_MODE, but check PcdEmuVariableNvModeEnable
which platform can configure flexibly.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-01-24 10:52:37 +08:00
7cd6995946
MdeModulePkg Variable: Add emulated variable NV mode support
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.
Add emulated variable NV mode support in real variable driver.
Platform can configure PcdEmuVariableNvModeEnable statically
(build time) or dynamically (boot time) to support emulated
variable NV mode.
If PcdEmuVariableNvModeEnable is configured to dynamic, its
value should be set before Variable driver starts to work,
otherwise default value will take effect.
Then EmuVariableRuntimeDxe could be removed, the removal of
EmuVariableRuntimeDxe will be done after platforms are migrated
to use the merged variable driver.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Cc: Michael D Kinney <michael.d.kinney@intel.com >
Cc: Liming Gao <liming.gao@intel.com >
Cc: Ray Ni <ray.ni@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Acked-by: Laszlo Ersek <lersek@redhat.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-01-24 10:52:36 +08:00
602cd0b6ba
MdeModulePkg Variable: type case VolatileBase to UINTN directly
...
Simplify
((UINTN) ((UINT8 *) VolatileBase + VolatileBase->Size))
to
((UINTN) VolatileBase + VolatileBase->Size)
This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-01-24 10:52:34 +08:00
ebe34c96f4
MdeModulePkg Variable: Remove CacheOffset in UpdateVariable()
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.
CacheOffset could be removed in UpdateVariable() after
//
// update the memory copy of Flash region.
//
CopyMem (
(UINT8 *)mNvVariableCache + CacheOffset,
(UINT8 *)NextVariable, VarSize
);
is moved to be before mVariableModuleGlobal->NonVolatileLastVariableOffset
value is updated, like right before
mVariableModuleGlobal->NonVolatileLastVariableOffset +=
HEADER_ALIGN (VarSize);
Except for the movement above, the patch also capitalizes the first
character of "update the memory copy of Flash region".
This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-01-24 10:52:33 +08:00
b59fd889ac
MdeModulePkg Variable: Abstract VariableWriteServiceInitializeDxe/Smm
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.
Abstract VariableWriteServiceInitializeDxe/Smm from
FtwNotificationEvent/SmmFtwNotificationEvent, then
VariableWriteServiceInitializeDxe/Smm could be not aware
the NV storage is real or emulated.
This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-01-24 10:52:32 +08:00
904e0ca997
MdeModulePkg Variable: Not get NV PCD in VariableWriteServiceInitialize
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.
Add macro NV_STORAGE_VARIABLE_BASE.
Not get NV PCD in VariableWriteServiceInitialize, but in
FtwNotificationEvent/SmmFtwNotificationEvent, then
VariableWriteServiceInitialize could be not aware the NV
storage is real or emulated.
This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-01-24 10:52:32 +08:00
5f0871e3d8
MdeModulePkg Variable: Move "extern XXX" to Variable.h
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.
Move "extern XXX" to Variable.h from VariableDxe.c/VariableSmm.c.
This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-01-24 10:52:31 +08:00
701d603f32
MdeModulePkg Variable: Abstract InitRealNonVolatileVariableStore
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.
Abstract InitRealNonVolatileVariableStore from
InitNonVolatileVariableStore.
This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-01-24 10:52:30 +08:00
874c8434d1
MdeModulePkg Variable: Add some missing changes for 9b18845
...
To improve performance 9b18845a4b
changed the code which read from physical MMIO address to read
from memory cache, but it missed some places that could be updated
the same away for performance optimization.
The patch updates these places as supplementary.
I found them when updating code for
https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Hao Wu <hao.a.wu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com >
Reviewed-by: Hao Wu <hao.a.wu@intel.com >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Tested-by: Julien Grall <julien.grall@arm.com >
Acked-by: Julien Grall <julien.grall@arm.com >
2019-01-24 10:52:29 +08:00
710962016b
MdeModulePkg/Dhcp4Dxe: Remove unnecessary NULL pointer check.
...
v3: Add the instance token check.
v2: The DHCP Instance might be destroyed in PxeDhcpDone. So,
we need safe-delete.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1469
Since the value of Instance is retrieved from the list Entry,
it can't be the NULL pointer, so just remove the unnecessary
check.
Cc: Ye Ting <ting.ye@intel.com >
Cc: Fu Siyuan <siyuan.fu@intel.com >
Cc: Wu Hao A <hao.a.wu@intel.com >
Cc: Gao Liming <liming.gao@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com >
Reviewed-by: Wu Hao A <hao.a.wu@intel.com >
2019-01-23 08:46:48 +08:00
688b2cad7b
MdeModulePkg/VariableRuntimeDxe: implement standalone MM version
...
Reuse most of the existing code to implement a variable runtime
driver that will be able to execute in the context of standalone
MM.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Reviewed-by: Jian J Wang <jian.j.wang@intel.com >
Reviewed-by: Star Zeng <star.zeng@intel.com >
2019-01-16 20:10:51 +01:00