]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
5 years agoMdeModulePkg/UdfDxe: Use debug msg instead of ASSERT in UdfOpen()
Hao Wu [Mon, 8 Oct 2018 06:30:14 +0000 (14:30 +0800)]
MdeModulePkg/UdfDxe: Use debug msg instead of ASSERT in UdfOpen()

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

Within function UdfOpen():
This commit will use debug messages instead of using ASSERT when an error
occurs after calling GetFileSize().

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UdfDxe: Use error handling when fail to return LSN
Hao Wu [Sat, 29 Sep 2018 05:03:50 +0000 (13:03 +0800)]
MdeModulePkg/UdfDxe: Use error handling when fail to return LSN

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

This commit will refine the ASSERTs in function GetLongAdLsn() and
GetAllocationDescriptorLsn() when the logical sector number cannot be
returned due to unrecognized media format.

Error handling logic will be used for those ASSERTs.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UdfDxe: ASSERT for false positives of NULL ptr deref
Hao Wu [Tue, 9 Oct 2018 03:03:27 +0000 (11:03 +0800)]
MdeModulePkg/UdfDxe: ASSERT for false positives of NULL ptr deref

This commit adds ASSERTs to address false positive reports of NULL
pointer dereference issues raised from static analysis with regard to
function ReadDirectoryEntry().

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UdfDxe: Use error handling for memory allocation failure
Hao Wu [Fri, 28 Sep 2018 12:12:23 +0000 (20:12 +0800)]
MdeModulePkg/UdfDxe: Use error handling for memory allocation failure

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

For functions DuplicateFid() and DuplicateFe(), this commit will use error
handling logic instead of ASSERTs for memory allocation failure.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdePkg/BaseSynchronizationLib GCC: simplify IA32 InternalSyncCompareExchange64()
Laszlo Ersek [Sat, 29 Sep 2018 21:13:47 +0000 (23:13 +0200)]
MdePkg/BaseSynchronizationLib GCC: simplify IA32 InternalSyncCompareExchange64()

The IA32 variant of InternalSyncCompareExchange64() is correct, but we can
simplify it. We don't need to load the lower 32 bits of ExchangeValue into
EBX in two steps (first into a general register, then into EBX); we can
ask GCC to populate EBX like that itself.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1208
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/BaseSynchronizationLib GCC: fix X64 InternalSyncCompareExchange64()
Laszlo Ersek [Sat, 29 Sep 2018 19:22:57 +0000 (21:22 +0200)]
MdePkg/BaseSynchronizationLib GCC: fix X64 InternalSyncCompareExchange64()

(This patch is identical to the X64 half of the last one, except for the
InternalSyncCompareExchange32() -> InternalSyncCompareExchange64() and
"cmpxchgl" -> "cmpxchgq" replacements.)

The CMPXCHG instruction has the following operands:
- AX (implicit, CompareValue):    input and output
- destination operand (*Value):   input and output
- source operand (ExchangeValue): input

The X64 version of InternalSyncCompareExchange64() attempts to mark both
CompareValue and (*Value) as input/output, but it doesn't use the
appropriate constraints for either operand.

Fix these issues. Furthermore, prefer the short "+" constraint for I/O
operands over the <output-operand-number> constraint that can be applied
to the input instances of I/O operands.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1208
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/BaseSynchronizationLib GCC: fix InternalSyncCompareExchange32()
Laszlo Ersek [Sat, 29 Sep 2018 19:22:57 +0000 (21:22 +0200)]
MdePkg/BaseSynchronizationLib GCC: fix InternalSyncCompareExchange32()

(This patch is identical to the last one, except for the
InternalSyncCompareExchange16() -> InternalSyncCompareExchange32() and
"cmpxchgw" -> "cmpxchgl" replacements.)

The CMPXCHG instruction has the following operands:
- AX (implicit, CompareValue):    input and output
- destination operand (*Value):   input and output
- source operand (ExchangeValue): input

The IA32 version of InternalSyncCompareExchange32() correctly marks
CompareValue as input/output, but it marks (*Value) only as input.

The X64 version of InternalSyncCompareExchange32() attempts to mark both
CompareValue and (*Value) as input/output, but it doesn't use the
appropriate constraints for either operand.

Fix these issues. Furthermore, prefer the short "+" constraint for I/O
operands over the <output-operand-number> constraint that can be applied
to the input instances of I/O operands.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1208
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/BaseSynchronizationLib GCC: fix InternalSyncCompareExchange16()
Laszlo Ersek [Sat, 29 Sep 2018 19:22:57 +0000 (21:22 +0200)]
MdePkg/BaseSynchronizationLib GCC: fix InternalSyncCompareExchange16()

The CMPXCHG instruction has the following operands:
- AX (implicit, CompareValue):    input and output
- destination operand (*Value):   input and output
- source operand (ExchangeValue): input

The IA32 version of InternalSyncCompareExchange16() correctly marks
CompareValue as input/output, but it marks (*Value) only as input.

The X64 version of InternalSyncCompareExchange16() attempts to mark both
CompareValue and (*Value) as input/output, but it doesn't use the
appropriate constraints for either operand.

Fix these issues. Furthermore, prefer the short "+" constraint for I/O
operands over the <output-operand-number> constraint that can be applied
to the input instances of I/O operands.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1208
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/BaseSynchronizationLib GCC: fix whitespace and comments
Laszlo Ersek [Sat, 29 Sep 2018 18:18:34 +0000 (20:18 +0200)]
MdePkg/BaseSynchronizationLib GCC: fix whitespace and comments

The "GccInline.c" files have some inconsistent whitespace, and missing (or
incorrect) operand comments. Fix and unify them.

This patch doesn't change behavior.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1208
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg Variable: Fix Timestamp zeroing issue on APPEND_WRITE
Star Zeng [Tue, 28 Feb 2017 06:01:47 +0000 (14:01 +0800)]
MdeModulePkg Variable: Fix Timestamp zeroing issue on APPEND_WRITE

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

When SetVariable() to a time based auth variable with APPEND_WRITE
attribute, and if the EFI_VARIABLE_AUTHENTICATION_2.TimeStamp in
the input Data is earlier than current value, it will cause timestamp
zeroing.

This issue may bring time based auth variable downgrade problem.
For example:
A vendor released three certs at 2014, 2015, and 2016, and system
integrated the 2016 cert. User can SetVariable() with 2015 cert and
APPEND_WRITE attribute to cause timestamp zeroing first, then
SetVariable() with 2014 cert to downgrade the cert.

This patch fixes this issue.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoMdeModulePkg/UsbMass: Reject device whose block size is 0 or > 64K
Ruiyu Ni [Tue, 16 Oct 2018 04:40:13 +0000 (12:40 +0800)]
MdeModulePkg/UsbMass: Reject device whose block size is 0 or > 64K

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/Bus/Ufs: Ensure device not return more data than expected
Hao Wu [Thu, 20 Sep 2018 05:48:02 +0000 (13:48 +0800)]
MdeModulePkg/Bus/Ufs: Ensure device not return more data than expected

This commit adds checks to make sure the UFS devices do not return more
data than the driver expected.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UsbBus: Deny when the string descriptor length is odd
Ruiyu Ni [Mon, 17 Sep 2018 08:05:26 +0000 (16:05 +0800)]
MdeModulePkg/UsbBus: Deny when the string descriptor length is odd

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UsbMouse: Don't access key codes when length is wrong
Ruiyu Ni [Thu, 13 Sep 2018 08:09:10 +0000 (16:09 +0800)]
MdeModulePkg/UsbMouse: Don't access key codes when length is wrong

Per USB HID spec, the buffer holding key codes should at least 3-byte
long.
Today's code assumes that the key codes buffer length is longer than
3-byte and unconditionally accesses the key codes buffer.
It's incorrect.
The patch fixes the issue by returning Device Error when the
length is less than 3-byte.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/AbsPointer: Don't access key codes when length is wrong
Ruiyu Ni [Thu, 13 Sep 2018 08:06:52 +0000 (16:06 +0800)]
MdeModulePkg/AbsPointer: Don't access key codes when length is wrong

Per USB HID spec, the buffer holding key codes should at least 3-byte
long.
Today's code assumes that the key codes buffer length is longer than
3-byte and unconditionally accesses the key codes buffer.
It's incorrect.
The patch fixes the issue by returning Device Error when the
length is less than 3-byte.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UsbKb: Don't access key codes when length is wrong
Ruiyu Ni [Thu, 13 Sep 2018 07:49:23 +0000 (15:49 +0800)]
MdeModulePkg/UsbKb: Don't access key codes when length is wrong

Per USB HID spec, the buffer holding key codes should be 8-byte
long.
Today's code assumes that the key codes buffer length is 8-byte
long and unconditionally accesses the key codes buffer.
It's incorrect.
The patch fixes the issue by returning Device Error when the
length is less than 8-byte.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoSourceLevelDebugPkg/Usb3: Make sure data from HW can fit in buffer
Ruiyu Ni [Thu, 2 Aug 2018 07:48:52 +0000 (15:48 +0800)]
SourceLevelDebugPkg/Usb3: Make sure data from HW can fit in buffer

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/Usb: Make sure data from HW is no more than expected
Ruiyu Ni [Thu, 2 Aug 2018 01:57:17 +0000 (09:57 +0800)]
MdeModulePkg/Usb: Make sure data from HW is no more than expected

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UsbBus: Reject descriptor whose length is bad
Ruiyu Ni [Thu, 27 Sep 2018 08:36:05 +0000 (16:36 +0800)]
MdeModulePkg/UsbBus: Reject descriptor whose length is bad

Today's implementation doesn't check whether the length of
descriptor is valid before using it.

The patch fixes this issue.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UsbBus: Fix out-of-bound read access to descriptors
Ruiyu Ni [Thu, 27 Sep 2018 08:34:36 +0000 (16:34 +0800)]
MdeModulePkg/UsbBus: Fix out-of-bound read access to descriptors

Today's implementation reads the Type/Length field in the USB
descriptors data without checking whether the offset to read is
beyond the data boundary.

The patch fixes this issue.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UsbMass: Fix integer overflow when BlockSize is 1
Ruiyu Ni [Tue, 11 Sep 2018 10:13:05 +0000 (18:13 +0800)]
MdeModulePkg/UsbMass: Fix integer overflow when BlockSize is 1

UsbBootReadWriteBlocks() and UsbBootReadWriteBlocks16() use a UINT16
local variable to hold the value of
USB_BOOT_MAX_CARRY_SIZE (=0x10000) / BlockSize.
When BlockSize is 1, the UINT16 local variable is set to 0x10000
but the high-16 bits are truncated resulting the final value be 0.

It causes the while-loop in the two functions accesses 0 block in
each loop, resulting the loop never ends.

The patch fixes the two functions to make sure no integer overflow
happens.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/UsbMass: Merge UsbBoot(Read|Write)Blocks(16)
Ruiyu Ni [Tue, 11 Sep 2018 10:08:02 +0000 (18:08 +0800)]
MdeModulePkg/UsbMass: Merge UsbBoot(Read|Write)Blocks(16)

The change doesn't have functionality impact.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoCorebootPayloadPkg: don't use serial output for Release build
Wonkyu Kim [Mon, 15 Oct 2018 22:44:45 +0000 (06:44 +0800)]
CorebootPayloadPkg: don't use serial output for Release build

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wonkyu Kim <wonkyu.kim@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
5 years agoMdeModulePkg/RegularExpressionDxe: Add null pointer check
Dongao Guo [Thu, 11 Oct 2018 06:57:03 +0000 (14:57 +0800)]
MdeModulePkg/RegularExpressionDxe: Add null pointer check

This is the part of commit 3948c510edad901bb9f8d23f7bf0f4ae91b5fcde.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dongao Guo <dongao.guo@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/EOT: Change to call a program instead of calling Python API.
Hess Chen [Mon, 15 Oct 2018 08:29:09 +0000 (16:29 +0800)]
BaseTools/EOT: Change to call a program instead of calling Python API.

Update the EOT tool to call the program itself instead of calling the Python API when parsing FV images.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Acked-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoBaseTools: Support to use struct name as datum type before max size
Yonghong Zhu [Mon, 15 Oct 2018 13:20:00 +0000 (21:20 +0800)]
BaseTools: Support to use struct name as datum type before max size

Original it hard code to use "VOID*", this patch extend it to both
support VOID* and valid struct name.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Fix bugs use special character in the --pcd option
Yonghong Zhu [Mon, 15 Oct 2018 12:43:47 +0000 (20:43 +0800)]
BaseTools: Fix bugs use special character in the --pcd option

Cases:
--pcd Token.Name="!"
--pcd Token.Name="\'W&\'"
--pcd Token.Name="2*h"

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoBaseTools: Add check for the string type whether is same
zhijufan [Mon, 15 Oct 2018 01:02:31 +0000 (09:02 +0800)]
BaseTools: Add check for the string type whether is same

Relational and equality operators require both operands to be of
the same type.
Treat the string 'A' and "A" as same type, but for "A" and L"A"
are not same type since one is general string, another is unicode
string.

True:'A'<'B', "A"<"B" 'A'<"B", L'A'<L'B', L"A"<L"B", L'A'<L"B"
Error:'A'<L'B', 'A'<L"B", "A'<L'B'

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoBaseTools:Fix issue caused by 84a52d4d030185a44f2d8736142c6f0b19c6e9b1
Zhaozh1x [Wed, 26 Sep 2018 08:04:06 +0000 (16:04 +0800)]
BaseTools:Fix issue caused by 84a52d4d030185a44f2d8736142c6f0b19c6e9b1

The commit 84a52d4d030185a44f2d8736142c6f0b19c6e9b1 will introduce
the new issue "Invalid offset value for Dynamic Vpd PCD". This patch
will fix the new issue, add 'DEFAULT' sku in to the AvailableSkuIdSet
variable.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Convert string value of void* pcd in command line to array.
Zhaozh1x [Wed, 26 Sep 2018 09:53:49 +0000 (17:53 +0800)]
BaseTools: Convert string value of void* pcd in command line to array.

For void* type pcd in command line, if its value is string, then
convert the string value to array format. For example,
build --pcd gUefiOvmfPkgTokenSpaceGuid.PcdTest="c",
convert the pcd value from "c" to "{0x63,0x00}".

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Code should not update the variable that save the raw data.
Zhaozh1x [Tue, 11 Sep 2018 10:31:36 +0000 (18:31 +0800)]
BaseTools: Code should not update the variable that save the raw data.

Code should not update the value of variable which save the original
raw content of meta file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: add ASSERT checker for array buffer value assignment.
Zhaozh1x [Tue, 4 Sep 2018 09:26:11 +0000 (17:26 +0800)]
BaseTools: add ASSERT checker for array buffer value assignment.

V3:
Update the error message for array checker.
V2:
1. Add comments for each ASSERT.
2. ASSERT need to skip the case of array size of array as zero. For
example, TestArray[] in struct in header file.
V1:
For structure PCD,
1. use compiler time assert to check the array index, report error
if array index exceeds the array number.
2. use compiler time assert to check the array size, report error
if the user declared size in header file is smaller than the user
defined in DEC/DSC file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Fix regression boot hang issue by commit 0e982cf03dd5
Feng, YunhuaX [Mon, 15 Oct 2018 09:03:51 +0000 (17:03 +0800)]
BaseTools: Fix regression boot hang issue by commit 0e982cf03dd5

Fix regression boot hang issue by commit
0e982cf03dd5023b90def60c3656e5e18135ebac

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoMdeModulePkg BrotliCustomDecompressLib: Don't build it for EBC arch
Liming Gao [Thu, 11 Oct 2018 05:53:01 +0000 (13:53 +0800)]
MdeModulePkg BrotliCustomDecompressLib: Don't build it for EBC arch

BrotliCustomDecompressLib has the definition with float type. But,
Floating-point types are not supported by EBC compiler.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Bi Dandan <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg RegularExpressionDxe: Enable STDARG for variable arguments
Liming Gao [Mon, 8 Oct 2018 04:22:38 +0000 (12:22 +0800)]
MdeModulePkg RegularExpressionDxe: Enable STDARG for variable arguments

Set macro for variable arguments, and remove the hard code definition
to avoid the potential duplicated definition.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Dongao Guo <dongao.guo@intel.com>
5 years agoMdeModulePkg/RegularExpressionDxe: Add null pointer check
Dongao Guo [Thu, 11 Oct 2018 06:57:03 +0000 (14:57 +0800)]
MdeModulePkg/RegularExpressionDxe: Add null pointer check

There are five check not necessary in logic ,just for pass static
analysis. More detail please refer to comment in code.
And the rest changes are all accepted by owner, they are reasonable.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dongao Guo <dongao.guo@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/RegularExpressionDxe: Miss null pointer check
Dongao Guo [Thu, 11 Oct 2018 06:57:02 +0000 (14:57 +0800)]
MdeModulePkg/RegularExpressionDxe: Miss null pointer check

Oniguruma https://github.com/kkos/oniguruma
this change is merged from oniguruma develop branch.
from commit 1db8a2726dfad0401f928cb8474bd770f07040a7.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dongao Guo <dongao.guo@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/RegularExpressionDxe: Miss null pointer check
Dongao Guo [Thu, 11 Oct 2018 06:57:01 +0000 (14:57 +0800)]
MdeModulePkg/RegularExpressionDxe: Miss null pointer check

Oniguruma https://github.com/kkos/oniguruma
this change is merged from oniguruma develop branch.
from commit ea36d810f1d9b28f3ef20bd8d453bea2f7fb598b

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dongao Guo <dongao.guo@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/RegularExpressionDxe: Miss null pointer check
Dongao Guo [Thu, 11 Oct 2018 06:57:00 +0000 (14:57 +0800)]
MdeModulePkg/RegularExpressionDxe: Miss null pointer check

Oniguruma https://github.com/kkos/oniguruma
this change is merged from oniguruma develop branch.
from commit 396a757dffafc0c7eb269433c29a0ba961d73ad6.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dongao Guo <dongao.guo@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Add --uefi option to enable UefiCompress method
Yunhua Feng [Sun, 30 Sep 2018 03:07:18 +0000 (11:07 +0800)]
BaseTools: Add --uefi option to enable UefiCompress method

Add one new option --uefi to enable UefiCompress.
(re-add this patch since it be reverted in Python3 migration patches,
but this patch is not related with Python3)

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Enhance the *P Flag display for Structure Pcd
Yonghong Zhu [Mon, 15 Oct 2018 06:51:55 +0000 (14:51 +0800)]
BaseTools: Enhance the *P Flag display for Structure Pcd

Cover the case:
1.only define the structure Pcd in DEC file, it should not have any
Flag.
2.In the DEC file and DSC file only have the PCD's default value, and
without the field value, it should have *P Flag.
(re-add this patch since it be reverted in Python3 migration patches,
but this patch is not related with Python3)

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set
Star Zeng [Fri, 12 Oct 2018 10:01:40 +0000 (18:01 +0800)]
MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set

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

In current implementation and according to the description in
MdeModulePkg.dec, PcdSetNvStoreDefaultId should be set in PEI
phase to take effect.

This patch ASSERTs PcdSetNvStoreDefaultId set in PcdDxe to alert
the invalid operation.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoBaseTools: increment build generate inf file lost .depex file
Yunhua Feng [Wed, 10 Oct 2018 06:54:49 +0000 (14:54 +0800)]
BaseTools: increment build generate inf file lost .depex file

increment build generate inf file in output directory lost .depex file info.
(re-add this patch since it be reverted in Python3 migration patches,
but this check is not related with Python3)

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1244
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: remove the not used PyUtility file
Yonghong Zhu [Thu, 13 Sep 2018 06:12:00 +0000 (14:12 +0800)]
BaseTools: remove the not used PyUtility file

the PyUtility is not used, so we remove it.
(re-add this patch since it be reverted in Python3 migration patches,
but this check is not related with Python3)

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: do basic check in FvImage with header size and signature
zhijufan [Tue, 25 Sep 2018 02:55:46 +0000 (10:55 +0800)]
BaseTools: do basic check in FvImage with header size and signature

Add some basic check in FvImage with header size and signature.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1181
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoUefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.
Eric Dong [Mon, 15 Oct 2018 00:30:37 +0000 (08:30 +0800)]
UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

V5:
1. Add ASSERT to indicate this assumption that environment is 32 bit mode.
2. Add description in INF about this driver's expected result
   in different environment.

V4:
Only disable paging when it is enabled.

V3 changes:
No need to change inf file.

V2 changes:
Only disable paging in 32 bit mode, no matter it is enable or not.

V1 changes:
PEI Stack Guard needs to enable paging. This might cause #GP if code
trying to write CR3 register with PML4 page table while the processor
is enabled with PAE paging.

Simply disabling paging before updating CR3 can solve this conflict.

It's an regression caused by change: 0a0d5296e448fc350de1594c49b9c0deff7fad60

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

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoRevert BaseTools: PYTHON3 migration
Liming Gao [Mon, 15 Oct 2018 00:27:53 +0000 (08:27 +0800)]
Revert BaseTools: PYTHON3 migration

This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52..
678f85131238622e576705117e299d81cff755c9.

Python3 migration is the fundamental change. It requires every developer
to install Python3. Before this migration, the well communication and wide
verification must be done. But now, most people is not aware of this change,
and not try it. So, Python3 migration is reverted and be moved to edk2-staging
Python3 branch for the edk2 user evaluation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/Tests: Update GNUmakefile to use python3 variable
Yonghong Zhu [Sat, 13 Oct 2018 15:47:02 +0000 (23:47 +0800)]
BaseTools/Tests: Update GNUmakefile to use python3 variable

Cover the case user do make -C BaseTools before run the .edksetup.sh
file.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoBaseTools: Not compare the VOID* difference in the DSC and DEC file
Yonghong Zhu [Tue, 9 Oct 2018 08:12:35 +0000 (16:12 +0800)]
BaseTools: Not compare the VOID* difference in the DSC and DEC file

For structure Pcd, the type defined in the DEC file is the struct name
while if this Pcd used in the DSC file, it should add VOID* keywords
when it have max size info. so this patch filter the type compare for
this case.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Enhance the *P Flag display for Structure Pcd
Yonghong Zhu [Thu, 11 Oct 2018 07:04:41 +0000 (15:04 +0800)]
BaseTools: Enhance the *P Flag display for Structure Pcd

Cover the case:
1.only define the structure Pcd in DEC file, it should not have any
Flag.
2.In the DEC file and DSC file only have the PCD's default value, and
without the field value, it should have *P Flag.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: remove the not used PyUtility file
Yonghong Zhu [Thu, 13 Sep 2018 06:12:00 +0000 (14:12 +0800)]
BaseTools: remove the not used PyUtility file

the PyUtility is not used, so we remove it.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: increment build generate inf file lost .depex file
Yunhua Feng [Wed, 10 Oct 2018 06:54:49 +0000 (14:54 +0800)]
BaseTools: increment build generate inf file lost .depex file

increment build generate inf file in output directory lost .depex file info.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1244
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: update Test scripts support python3
Yunhua Feng [Fri, 12 Oct 2018 01:19:03 +0000 (09:19 +0800)]
BaseTools: update Test scripts support python3

update Test scripts support python3

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/Ecc/EOT: Add Python 3 support on ECC and EOT tools.
Hess Chen [Tue, 9 Oct 2018 04:44:35 +0000 (12:44 +0800)]
BaseTools/Ecc/EOT: Add Python 3 support on ECC and EOT tools.

1. Add Python 3 support on ECC and EOT tools
2. Add C grammar file of ANTLR4 and fix some bugs

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Add --uefi option to enable UefiCompress method
Yunhua Feng [Sun, 30 Sep 2018 03:07:18 +0000 (11:07 +0800)]
BaseTools: Add --uefi option to enable UefiCompress method

Add one new option --uefi to enable UefiCompress.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/UPT: Porting UPT Tool from Python2 to Python3
Yonghong Zhu [Tue, 4 Sep 2018 02:39:47 +0000 (10:39 +0800)]
BaseTools/UPT: Porting UPT Tool from Python2 to Python3

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/Scripts: Porting PackageDocumentTools code to use Python3
Yunhua Feng [Tue, 28 Aug 2018 09:00:24 +0000 (17:00 +0800)]
BaseTools/Scripts: Porting PackageDocumentTools code to use Python3

Porting PackageDocumentTools code to Python3
DoxyGen 1.8.6
wxpython 4.0.3

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Update Makefile to ignore python tools make
Yunhua Feng [Wed, 26 Sep 2018 00:52:18 +0000 (08:52 +0800)]
BaseTools: Update Makefile to ignore python tools make

ignore make python tools, replace PYTHON_HOME by PYTHON3

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Use PYTHON3 variable instead of PYTHON_HOME
Yunhua Feng [Tue, 25 Sep 2018 04:25:30 +0000 (12:25 +0800)]
BaseTools: Use PYTHON3 variable instead of PYTHON_HOME

Use PYTHON3 variable instead of PYTHON_HOME path

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Update windows and linux run scripts file to use Python3
Yunhua Feng [Wed, 5 Sep 2018 09:27:05 +0000 (17:27 +0800)]
BaseTools: Update windows and linux run scripts file to use Python3

Modify windows script, PosixLike script, edksetup.sh, edksetup.bat to
use Python3

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Fix some build and report file issue
Yunhua Feng [Fri, 24 Aug 2018 08:39:14 +0000 (16:39 +0800)]
BaseTools: Fix some build and report file issue

1. increment build not skip make file when not change any file
2. report file generate abundant blank line
3. Build encounter Database is locked on some platform, using database
   auto commit
4. Fv BaseAddress must have if set

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Rename get_bytes_le() to bytes_le
Yonghong Zhu [Wed, 26 Sep 2018 03:07:26 +0000 (11:07 +0800)]
BaseTools: Rename get_bytes_le() to bytes_le

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Update argparse arguments since it not have version now
Yunhua Feng [Fri, 24 Aug 2018 06:01:50 +0000 (14:01 +0800)]
BaseTools: Update argparse arguments since it not have version now

argparse.ArgumentParser not have version parameter

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: change the Division Operator in the expression
Yunhua Feng [Tue, 14 Aug 2018 07:57:47 +0000 (15:57 +0800)]
BaseTools: change the Division Operator in the expression

PEP 238 -- Changing the Division Operator
x/y to return a reasonable approximation of the mathematical result
    of the division ("true division")
x//y to return the floor ("floor division")

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: do the list and iterator translation
Yunhua Feng [Fri, 27 Jul 2018 05:14:59 +0000 (13:14 +0800)]
BaseTools: do the list and iterator translation

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Handle the bytes and str difference
Yunhua Feng [Thu, 11 Oct 2018 03:20:59 +0000 (11:20 +0800)]
BaseTools: Handle the bytes and str difference

Deal with bytes and str is different, remove the unicode()
Using utcfromtimestamp instead of fromtimestamp.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: fix the open file's read and write bugs
Yunhua Feng [Fri, 27 Jul 2018 08:02:05 +0000 (16:02 +0800)]
BaseTools: fix the open file's read and write bugs

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: use map and filter to replace the itertools function
Yunhua Feng [Fri, 27 Jul 2018 07:53:45 +0000 (15:53 +0800)]
BaseTools: use map and filter to replace the itertools function

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: remove the super() function argument
Yunhua Feng [Thu, 23 Aug 2018 10:27:46 +0000 (18:27 +0800)]
BaseTools: remove the super() function argument

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: replace the list iteritems by items
Yunhua Feng [Mon, 3 Sep 2018 07:40:46 +0000 (15:40 +0800)]
BaseTools: replace the list iteritems by items

replace the list iteritems by items in Python3.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Rename raw_input() to input()
Yunhua Feng [Tue, 14 Aug 2018 03:23:47 +0000 (11:23 +0800)]
BaseTools: Rename raw_input() to input()

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Rename long() to int()
Yunhua Feng [Wed, 10 Oct 2018 03:00:31 +0000 (11:00 +0800)]
BaseTools: Rename long() to int()

Because the long() function was not exist in Python3.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Rename xrange() to range()
Yunhua Feng [Thu, 26 Jul 2018 06:12:09 +0000 (14:12 +0800)]
BaseTools: Rename xrange() to range()

Because the xrange() was not exist in Python3

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Remove the "from __future__ import" items
Yunhua Feng [Fri, 21 Sep 2018 07:36:42 +0000 (15:36 +0800)]
BaseTools: Remove the "from __future__ import" items

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Remove the outdated verbose parameter of namedtuple
Yunhua Feng [Tue, 25 Sep 2018 05:31:35 +0000 (13:31 +0800)]
BaseTools: Remove the outdated verbose parameter of namedtuple

the verbose is outdated.
in 3.6: The verbose and rename parameters became keyword-only arguments

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoArmPkg: Add support for GICv4
Sami Mujawar [Tue, 9 Oct 2018 15:35:22 +0000 (16:35 +0100)]
ArmPkg: Add support for GICv4

Updated Redistributor base calculation to allow for the fact that
GICv4 has 2 additional 64KB frames (for VLPI and a reserved frame).
The code now tests the VLPIS bit in the GIC Redistributor Type
Register (GICR_TYPER) and calculates the Redistributor granularity
accordingly.

The code changes are:
  GICR_TYPER register fields, etc, added to the header.
  Loop updated to pay attention to GICR_TYPER.Last.
  Derive frame "stride" size from GICR_TYPER.VLPIS.

Note: The assumption is that the redistributors are adjacent for
all CPUs. However this may not be the case for NUMA systems.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoMdeModulePkg/SdMmcPciHcDxe: Allow additional SDHCI versions
Jeff Brasen [Tue, 9 Oct 2018 17:50:37 +0000 (01:50 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Allow additional SDHCI versions

Clock control is similar in SDHCI versions greater then version 2. Add
support for more recent versions of the controller specification.

SD card support for 1.8V is also present in controller versions 3 and
greater.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg/SdMmcPciHcDxe: Add controller version defines
Jeff Brasen [Tue, 9 Oct 2018 17:50:36 +0000 (01:50 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Add controller version defines

Add SDHCI controller defines, this is useful as the version in the
register does not explictly map to a specification version. For example
vesion 4.10 of the specification is version 0x04.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdePkg: Use VENDOR_DEVICE_PATH structure for Debug Port device path
Dandan Bi [Fri, 5 Oct 2018 09:30:31 +0000 (17:30 +0800)]
MdePkg: Use VENDOR_DEVICE_PATH structure for Debug Port device path

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

When converting DebugPort device path from text,
current code use VENDOR_DEFINED_MESSAGING_DEVICE_PATH structure
for Debug port device node.
typedef struct {
  EFI_DEVICE_PATH_PROTOCOL  Header;
  EFI_GUID                  Guid;
  UINT8                     VendorDefinedData[1];
} VENDOR_DEFINED_MESSAGING_DEVICE_PATH;

And Debugport Device Path is a vendor-defined messaging
device path with no data, only a GUID. So it's better to
use VENDOR_DEVICE_PATH to create the Debug port device node.
typedef struct {
  EFI_DEVICE_PATH_PROTOCOL        Header;
  EFI_GUID                        Guid;
} VENDOR_DEVICE_PATH;

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoShellPkg-Cd: Ensure all valid cd targets are handled properly
Jim.Dailey@dell.com [Thu, 4 Oct 2018 16:46:39 +0000 (00:46 +0800)]
ShellPkg-Cd: Ensure all valid cd targets are handled properly

ShellPkg-Cd: Ensure all valid cd targets are handled properly

Make sure that PathCleanUpDirectories() is called on all valid targets
of the cd command.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoMdePkg-BaseLib: Fix PathCleanUpDirectories() error involving "\..\.."
Jim.Dailey@dell.com [Thu, 4 Oct 2018 15:03:28 +0000 (23:03 +0800)]
MdePkg-BaseLib: Fix PathCleanUpDirectories() error involving "\..\.."

MdePkg-BaseLib: Fix PathCleanUpDirectories() error involving "\..\.."

The loop that removes "xxxx\..\" errs when multiple "\.." sequences are
in the path.  Before this change the code would modify a path like
"FS0:\efi\tools\..\.." to "FS0:\efi\\.." and then to "FS0:\efi\", but
the correct path is "FS0:\".

You can test the effect of this change in the shell by setting the
current directory to something like FS0:\efi\boot and then executing
the command "ls ..\..".  Before the change you will see the files in
the FS0:\efi directory; after the change, you will see the files in
the root directory of FS0:.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoMdeModulePkg/RegularExpressionDxe:omit unused variable
Guo, Dongao [Mon, 8 Oct 2018 07:56:48 +0000 (15:56 +0800)]
MdeModulePkg/RegularExpressionDxe:omit unused variable

comment unused variable to avoid warning,and modify inf build option.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dongao Guo <dongao.guo@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/RegularExpressionDxe:disable wraning to pass gcc4.8 build
Guo, Dongao [Wed, 10 Oct 2018 07:39:03 +0000 (15:39 +0800)]
MdeModulePkg/RegularExpressionDxe:disable wraning to pass gcc4.8 build

There are three warnings reported by GCC 4.8 and the later GCC release
are workaround with them.
And all the three warnings are invalid,so I just disable warnings rather
than fix them at now.

Following is the analysis from Laszlo Ersek.
(1)

> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c: In
> function 'compile_length_tree':
> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c:1516:7:
> warning: 'len' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>    int len;
>        ^

I think this is an invalid warning; the type of the controlling expression
(node->type) is enum GimmickType, and the case labels cover all values of
the enum. An assert(0) could be added, I guess, but again, upstream
Oniguruma would be justified to reject the idea.

(2)

> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c: In
> function 'parse_callout_args.isra.10.constprop.30':
> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c:6753:25:
> warning: 'rl' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>   vals[n].l = rl;
>               ^

This warning is invalid, given:

  6749    if (cn > 0) {
  6750      long rl;
  6751      r = parse_long(enc, buf, bufend, 1, LONG_MAX, &rl);
  6752      if (r == ONIG_NORMAL) {
  6753        vals[n].l = rl;

Because parse_long() only returns ONIG_NORMAL after it sets (*rl).

(3)

> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c: In
> function 'parse_callout_of_name.constprop.29':
> MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c:6861:38:
> warning: 'tag_end' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>      if (! is_allowed_callout_tag_name(enc, tag_start, tag_end))

This warning is also invalid, given:

  6852    if (c == '[') {
  6853      if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
  6854      tag_start = p;
  6855      while (! PEND) {
  6856        if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
  6857        tag_end = p;
  6858        PFETCH_S(c);
  6859        if (c == ']') break;
  6860      }
  6861      if (! is_allowed_callout_tag_name(enc, tag_start, tag_end))
  6862        return ONIGERR_INVALID_CALLOUT_TAG_NAME;
  6863

To see that, first we should note:
 #define PEND         (p < end ?  0 : 1)

therefore PEND doesn't change if neither "p" nor "end" change.

Second, when we reach line 6855 (the "while") for the very first time,
(!PEND) is certainly true (i.e., PEND is false), because otherwise we
would have bailed at line 6853. Therefore we reach line 6857, and assign
"tag_end". Regardless of whether we iterate zero or more *additional*
times around the loop, "tag_end" will have been set, whenever we reach
line 6861.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dongao Guo <dongao.guo@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoIntelFsp2Pkg/GenCfgOpt.py: Support PCD input from command line
Chasel, Chiu [Mon, 8 Oct 2018 07:44:45 +0000 (15:44 +0800)]
IntelFsp2Pkg/GenCfgOpt.py: Support PCD input from command line

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

Build system already support override PCD value by command
line so add this support to GenCfgOpt.py
Also update revision to 0.53

Test: Verified UPD header files generated can reflect different
      PCD values from --pcd build command input

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Gao Liming <liming.gao@intel.com>
Cc: Zhu Yonghong <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Zhu Yonghong <yonghong.zhu@intel.com>
5 years agoMdeModulePkg/NonDiscoverablePciDeviceDxe: expose unique B/D/F identifiers
Ard Biesheuvel [Wed, 10 Oct 2018 08:34:50 +0000 (10:34 +0200)]
MdeModulePkg/NonDiscoverablePciDeviceDxe: expose unique B/D/F identifiers

Currently, the implementation of EFI_PCI_IO_PROTOCOL::GetLocation()
in NonDiscoverablePciDeviceDxe returns the same set of dummy values
for each instance of the NON_DISCOVERABLE_DEVICE protocol that it
attaches itself to. However, this turns out to be causing problems
in cases where software (such as the ARM Compliance Test Suite [ACS])
attempts to use these values to uniquely identify controllers, since
the collisions create ambiguity in this regard.

So let's modify GetLocation() to return an arbitrary bus/device tuple
on segment 0xff instead. This is guaranteed not to clash with other
non-discoverable PCI devices, and highly unlikely to clash with real
PCIe devices.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg: Update Brotli DecompressLib to the latest v1.0.6
Liming Gao [Thu, 9 Aug 2018 07:51:58 +0000 (15:51 +0800)]
MdeModulePkg: Update Brotli DecompressLib to the latest v1.0.6

https://bugzilla.tianocore.org/show_bug.cgi?id=1201
Update Brotli to the latest version 1.0.6
https://github.com/google/brotli

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoBaseTools: Update Brotli Compress to the latest one 1.0.6
Liming Gao [Thu, 9 Aug 2018 06:55:19 +0000 (14:55 +0800)]
BaseTools: Update Brotli Compress to the latest one 1.0.6

https://bugzilla.tianocore.org/show_bug.cgi?id=1201
Update Brotli to the latest version 1.0.6
https://github.com/google/brotli
Verify VS2017, GCC5 build.
Verify Decompression boot functionality.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdePkg: Add PciRoot/PcieRoot text for ACPI Expanded Device Path
Dandan Bi [Fri, 5 Oct 2018 08:06:00 +0000 (16:06 +0800)]
MdePkg: Add PciRoot/PcieRoot text for ACPI Expanded Device Path

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

According to UEFI spec,for ACPI Expanded Device Path
when HID=PNP0A03 or CID=PNP0A03 and HID != PNP0A08,
the device path node can be displayed as: PciRoot(UID|UIDSTR)
When HID=PNP0A08 or CID=PNP0A08, the device path node can be
displayed as: PcieRoot(UID|UIDSTR). But current code miss the
code logic.

This commit is to do the enhancement.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoMdePkg: Correct condition check for AcpiExp text format
Dandan Bi [Fri, 5 Oct 2018 06:35:25 +0000 (14:35 +0800)]
MdePkg: Correct condition check for AcpiExp text format

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

According to UEFI Spec, for ACPI Expanded Device Path,
when HIDSTR=empty, CIDSTR=empty, UID STR!=empty,
the ACPI Expanded Device Path node can be displayed as
AcpiExp(HID,CID,UIDSTR) format.
And if UID is 0 and UIDSTR is empty, then use AcpiEx format.

This patch is to correct the condition check to follow UEFI
Spec when convert the device path node to the AcpiExp text
format.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoMdePkg: Correct the string order of ACPI Expanded Device Path
Dandan Bi [Fri, 5 Oct 2018 05:21:57 +0000 (13:21 +0800)]
MdePkg: Correct the string order of ACPI Expanded Device Path

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

According to UEFI Spec, ACPI Expanded Device Path can be display
AcpiEx(HID|HIDSTR,(CID|CIDSTR,UID|UIDSTR)), but current code display
UID|UIDSTR before CID|CIDSTR.
This patch is to fix this issue.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoMdePkg: Correct the string expression of UTF8 vendor device path
Dandan Bi [Fri, 5 Oct 2018 01:22:20 +0000 (09:22 +0800)]
MdePkg: Correct the string expression of UTF8 vendor device path

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

According to UEFI spec, the string expression of UTF8 vendor
device node should be displayed as: VenUtf8(). Current code
display it as: VenUft8() by mistake when convert device
path node to text.

This commit is to fix this bug.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoMdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox
Dandan Bi [Fri, 28 Sep 2018 05:28:03 +0000 (13:28 +0800)]
MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox

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

When covert IFR binary to EFI_IFR_CHECKBOX structure,
Current code has following incorrect code logic:
IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);
The correct one should be:
IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpHdr;

1. The bug is in function "UpdateDefaultSettingInFormPackage()"
which is to update the default setting of some HII Questions
in the IFR binary data. So it only has impact when platform
overrides default setting in HII VarStore through DynamicHii
PCD setting in Platform DSC file. If platform doesn't
override default setting, it has no impact.

2. The implementation updates the "Flags" filed in the
EFI_IFR_CHECKBOX structure to update the default
setting of checkbox.
If using "IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);"
when wants to update the " Flags" filed in checkbox,
but in fact it will update the opcode binary
data(opcode binary length) behind checkbox binary.
And then it will cause Browser can't parse the IFR
binary data correctly. And then the possible symptom
is that some HII Question and forms may be not parsed
and then cannot be shown.

This patch is to fix this bug.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools LzmaCompress: Fix GCC warning misleading-indentation
Liming Gao [Tue, 9 Oct 2018 07:06:14 +0000 (15:06 +0800)]
BaseTools LzmaCompress: Fix GCC warning misleading-indentation

GCC 6 or above reports the warning misleading-indentation.
This patch fixes it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1234
[lersek@redhat.com: reference the BZ that got reported meanwhile]

5 years agoIntelFrameworkModulePkg Lzma: Update LZMA SDK version to 18.05
Liming Gao [Wed, 29 Aug 2018 00:51:26 +0000 (08:51 +0800)]
IntelFrameworkModulePkg Lzma: Update LZMA SDK version to 18.05

https://bugzilla.tianocore.org/show_bug.cgi?id=1006
New formal release in https://www.7-zip.org/sdk.html is 18.05.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg Lzma: Update LZMA SDK version to 18.05
Liming Gao [Wed, 29 Aug 2018 00:51:27 +0000 (08:51 +0800)]
MdeModulePkg Lzma: Update LZMA SDK version to 18.05

https://bugzilla.tianocore.org/show_bug.cgi?id=1006
New formal release in https://www.7-zip.org/sdk.html is 18.05.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoBaseTools Lzma: Update LZMA SDK version to 18.05
Liming Gao [Wed, 29 Aug 2018 00:51:28 +0000 (08:51 +0800)]
BaseTools Lzma: Update LZMA SDK version to 18.05

https://bugzilla.tianocore.org/show_bug.cgi?id=1006
New formal release in https://www.7-zip.org/sdk.html is 18.05.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoShellPkg/TftpDynamicCommand: Correct comments to align with the input parameter.
Jiaxin Wu [Mon, 8 Oct 2018 02:49:33 +0000 (10:49 +0800)]
ShellPkg/TftpDynamicCommand: Correct comments to align with the input parameter.

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

Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoNetworkPkg/UefiPxeBcDxe: Correct comments to align with the input parameter.
Jiaxin Wu [Mon, 8 Oct 2018 02:48:20 +0000 (10:48 +0800)]
NetworkPkg/UefiPxeBcDxe: Correct comments to align with the input parameter.

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

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
5 years agoMdeModulePkg/Tcp4Dxe: Remove the trailing white space in one line.
Jiaxin Wu [Mon, 8 Oct 2018 02:27:20 +0000 (10:27 +0800)]
MdeModulePkg/Tcp4Dxe: Remove the trailing white space in one line.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
5 years agoOvmfPkg/PlatformPei: clear CPU caches
Marc-André Lureau [Tue, 2 Oct 2018 12:17:25 +0000 (16:17 +0400)]
OvmfPkg/PlatformPei: clear CPU caches

This is for conformance with the TCG "Platform Reset Attack Mitigation
Specification". Because clearing the CPU caches at boot doesn't impact
performance significantly, do it unconditionally, for simplicity's
sake.

Flush the cache on all logical processors, thanks to
EFI_PEI_MP_SERVICES_PPI and CacheMaintenanceLib.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
[lersek@redhat.com: remove bogus Message-Id line from commit msg]