]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
7 years agoSecurityPkg: Tcg2Config: TPM2 ACPI Table Rev Option
Zhang, Chao B [Fri, 23 Dec 2016 08:55:32 +0000 (16:55 +0800)]
SecurityPkg: Tcg2Config: TPM2 ACPI Table Rev Option

Add TPM2 ACPI Table Rev Option in Tcg2Config UI. Rev 4 is defined in
TCG ACPI Specification 00.37

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoMdePkg: Tpm2Acpi.h: Update TPM2 ACPI table version
Zhang, Chao B [Mon, 26 Dec 2016 02:50:36 +0000 (10:50 +0800)]
MdePkg: Tpm2Acpi.h: Update TPM2 ACPI table version

Update TPM2 ACPI Table revision to 4. New version & data structure is
defined in TCG ACPI Spec 00.37

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoOvmfPkg/SmmControl2Dxe: correct PCI_CONFIG_READ_WRITE in S3 boot script
Laszlo Ersek [Thu, 1 Dec 2016 01:20:15 +0000 (02:20 +0100)]
OvmfPkg/SmmControl2Dxe: correct PCI_CONFIG_READ_WRITE in S3 boot script

EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE expects the PCI address to
access in UEFI encoding, not in edk2/PciLib encoding.

Introduce the POWER_MGMT_REGISTER_Q35_EFI_PCI_ADDRESS() macro, and with
it, store the ICH9_GEN_PMCON_1 register's address to the boot script in
UEFI representation.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoSecurityPkg Tcg2ConfigDxe: Refine debug message and comments
Star Zeng [Mon, 9 Jan 2017 05:36:41 +0000 (13:36 +0800)]
SecurityPkg Tcg2ConfigDxe: Refine debug message and comments

Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoMdePkg/BaseLib: Add safe string functions [U|A]StrnTo[A|U]StrS
Hao Wu [Tue, 13 Dec 2016 08:00:35 +0000 (16:00 +0800)]
MdePkg/BaseLib: Add safe string functions [U|A]StrnTo[A|U]StrS

Add the following 2 APIs:
UnicodeStrnToAsciiStrS
AsciiStrnToUnicodeStrS

These APIs are used to enhance APIs UnicodeStrToAsciiStrS and
AsciiStrToUnicodeStrS (without 'n' in names) by:
1. Adds an input parameter 'Length' to specify the maximum number of
Ascii/Unicode characters to convert.
2. Adds an output parameter 'DestinationLength' to indicate the number of
Ascii/Unicode characters successfully converted.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoMdePkg/BaseLib: Enhance the return value for string to uint functions
Hao Wu [Wed, 14 Dec 2016 03:04:48 +0000 (11:04 +0800)]
MdePkg/BaseLib: Enhance the return value for string to uint functions

For the following 8 APIs in MdePkg/BaseLib:
[Ascii]StrDecimalToUintn
[Ascii]StrDecimalToUint64
[Ascii]StrHexToUintn
[Ascii]StrHexToUint64

They will ASSERT for DEBUG build when the input string exceeds the range
of UINTN/UINT64. However, for RELEASE build, incorrect value will be
returned.

This commit refines those APIs to direcly call their enhanced counterparts
(with trailing 'S' in API names) so as to remove those exceed-range ASSERT
checks and to make those APIs to return MAX_UINTN/MAX_UINT64 instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoMdePkg/BaseLib: Add safe string functions that convert str to value
Hao Wu [Mon, 12 Dec 2016 00:58:51 +0000 (08:58 +0800)]
MdePkg/BaseLib: Add safe string functions that convert str to value

Add the following 8 APIs:
[Ascii]StrDecimalToUintnS
[Ascii]StrDecimalToUint64S
[Ascii]StrHexToUintnS
[Ascii]StrHexToUint64S

These safe version APIs are used to enhance their counterpart (APIs
without trailing 'S' in function names).

These safe version APIs perform checks to the input string and will return
relative status to reflect the check result:
When the input string exceeds the range of UINTN/64, these APIs will
return RETURN_UNSUPPORTED and store MAX_UINTN/64 in the output data.
When no conversion can be performed for the input string, these APIs will
return RETURN_SUCCESS and store 0 in the output data.

The optional parameter 'EndPointer', if provided, will point to the
character that stopped the scan.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoMdePkg/BaseLib: Add safe string functions [Ascii]StrnSizeS
Hao Wu [Fri, 9 Dec 2016 07:53:06 +0000 (15:53 +0800)]
MdePkg/BaseLib: Add safe string functions [Ascii]StrnSizeS

Add StrnSizeS() and AsciiStrnSizeS() APIs.

These 2 safe version APIs are used to replace StrSize() and
AsciiStrSize(). Those two APIs use similar checks as [Ascii]StrnLenS().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoSecurityPkg Tcg2ConfigDxe: Typecast to (CHAR8*) as para of AsciiStrSize
Star Zeng [Mon, 9 Jan 2017 02:04:45 +0000 (10:04 +0800)]
SecurityPkg Tcg2ConfigDxe: Typecast to (CHAR8*) as para of AsciiStrSize

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
7 years agoOvmfPkg: Install BGRT ACPI table
Bhupesh Sharma [Fri, 6 Jan 2017 09:47:15 +0000 (15:17 +0530)]
OvmfPkg: Install BGRT ACPI table

While debugging OS for ACPI BGRT support (especially on VMs),
it is very useful to have the EFI firmware (OVMF in most cases
which use Tianocore) to export the ACPI BGRT table.

This patch tries to add this support in OvmfPkg.

Tested this patch in the following environments:

1. On both RHEL7.3 and Fedora-25 VM guests running on a Fedora-24 Host:
   - Ensured that the BGRT logo is properly prepared and
     can be viewed with user-space tools (like 'Gwenview' on KDE,
     for example):

     $ file /sys/firmware/acpi/bgrt/image
     /sys/firmware/acpi/bgrt/image: PC bitmap, Windows 3.x format, 193 x
     58 x 24

2. On a Windows-10 VM Guest running on a Fedora-24 Host:
   - Ensured that the BGRT ACPI table is properly prepared and can be
     read with freeware tool like FirmwareTablesView:

     ==================================================
     Signature         : BGRT
     Firmware Provider : ACPI
     Length            : 56
     Revision          : 1
     Checksum          : 129
     OEM ID            : INTEL
     OEM Table ID      : EDK2
     OEM Revision      : 0x00000002
     Creator ID        : 0x20202020
     Creator Revision  : 0x01000013
     Description       :
     ==================================================

Note from Laszlo Ersek <lersek@redhat.com>: without the BGRT ACPI table,
Windows 8 and Windows 10 first clear the screen, then display a blue,
slanted Windows picture above the rotating white boot animation. With the
BGRT ACPI table, Windows 8 and Windows 10 don't clear the screen, the blue
Windows image is not displayed, and the rotating white boot animation is
shown between the firmware's original TianoCore boot splash and (optional)
"Start boot option" progress bar.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: cover effect on Windows 8/10 boot anim. in commit msg]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdeModulePkg/Bds: Fix a bug that may causes S4 fails to resume
Ruiyu Ni [Thu, 5 Jan 2017 01:56:11 +0000 (09:56 +0800)]
MdeModulePkg/Bds: Fix a bug that may causes S4 fails to resume

When firmware boots to UiApp, the memory type information settings
are saved to NV storage and the settings in HOB are changed as well.
Because UiApp is an APPLICATION type of boot option, system doesn't
reset when settings change.
But when user selects OS to boot in UiApp, because the settings in HOB
was updated when booting to UiApp, the BDS doesn't think the settings
change, expected reset doesn't happen.

The patch fixes this issue to not update the settings in HOB.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoShellPkg: Fix a bug ">>v" cannot append data to environment variable
Chen A Chen [Wed, 4 Jan 2017 03:28:03 +0000 (11:28 +0800)]
ShellPkg: Fix a bug ">>v" cannot append data to environment variable

When ">v" is used to redirect the command output to environment
variable, the ending "\r\n\0" is removed before setting to environment
variable but the length is not updated.
It causes ">>v" fails to append data to the environment variable
created by ">v".
The patch fixes the above bug.

Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoSecurityPkg Tcg2ConfigDxe: Add setup option to configure PPI version
Star Zeng [Fri, 9 Dec 2016 07:53:22 +0000 (15:53 +0800)]
SecurityPkg Tcg2ConfigDxe: Add setup option to configure PPI version

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

gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer was
introduced to configure physical presence interface version. but test
or user needs to build different images to support different versions
separately as the PCD does not support Dynamic types.

This patch is to extend the PCD to support Dynamic types and add a
setup option in Tcg2ConfigDxe driver to configure the physical
presence interface version, the PCD needs to be DynamicHii type and
maps to the setup option.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoBaseTools: not report error for the optional items in the FmpTokens
Yonghong Zhu [Wed, 4 Jan 2017 02:40:54 +0000 (10:40 +0800)]
BaseTools: not report error for the optional items in the FmpTokens

<FmpTokens> in the FDF spec defined some optional items, eg: IMAGE_INDEX,
HARDWARE_INSTANCE. but current tool report error if no such item is exist
in the FDF file.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=293
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoCryptoPkg/TlsLib: Refine the coding style.
Jiaxin Wu [Thu, 5 Jan 2017 03:37:06 +0000 (11:37 +0800)]
CryptoPkg/TlsLib: Refine the coding style.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Long Qin <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoMdePkg, NetworkPkg: Refine the coding style.
Jiaxin Wu [Thu, 5 Jan 2017 03:34:07 +0000 (11:34 +0800)]
MdePkg, NetworkPkg: Refine the coding style.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoSecurityPkg: TcgPei: Sync TCG PP lifetime lock state
Zhang, Chao B [Fri, 6 Jan 2017 01:27:15 +0000 (09:27 +0800)]
SecurityPkg: TcgPei: Sync TCG PP lifetime lock state

Sync TCG lifetime lock state after performing PP command.
Later logic checks such state.

Cc: Long Qin <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
7 years agoSecurityPkg: Tcg2ConfigDxe: Remove duplicate local variable
Zhang, Chao B [Fri, 6 Jan 2017 01:13:13 +0000 (09:13 +0800)]
SecurityPkg: Tcg2ConfigDxe: Remove duplicate local variable

Remove duplicate local status variable declaration.

Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Bi Dandan <dandan.bi@intel.com>
7 years agoMdeModulePkg/StaControllerDxe: Fix coding style issue
Dandan Bi [Thu, 5 Jan 2017 02:17:23 +0000 (10:17 +0800)]
MdeModulePkg/StaControllerDxe: Fix coding style issue

Remove the empty line.

Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/DxeCapsuleLibFmp: Fix incorrect MODULE_TYPE
Dandan Bi [Thu, 5 Jan 2017 05:03:53 +0000 (13:03 +0800)]
MdeModulePkg/DxeCapsuleLibFmp: Fix incorrect MODULE_TYPE

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoSecurityPkg: Add Pcd PROMPT/HELP & Chang default setting
Zhang, Chao B [Thu, 5 Jan 2017 02:16:16 +0000 (10:16 +0800)]
SecurityPkg: Add Pcd PROMPT/HELP & Chang default setting

Update PCD PcdTcg2PhysicalPresenceFlags default setting. Also add PROMPT,
HELP string.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoSecuritPkg: Tcg2: Fix coding style issue
Zhang, Chao B [Thu, 5 Jan 2017 02:11:07 +0000 (10:11 +0800)]
SecuritPkg: Tcg2: Fix coding style issue

Fix coding style issue

Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Bi Dandan <dandan.bi@intel.com>
7 years agoSecurityPkg: Tcg2ConfigDxe: Display TPM2 HID in Tcg2Config
Zhang, Chao B [Thu, 29 Dec 2016 08:21:02 +0000 (16:21 +0800)]
SecurityPkg: Tcg2ConfigDxe: Display TPM2 HID in Tcg2Config

Display TPM2 HID from TPM2 ACPI device object in Tcg2Config UI

Cc: Long Qin <qin.long@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoBaseTools: fix the bug for Mixed Pcd display in the report
Yonghong Zhu [Fri, 30 Dec 2016 06:54:34 +0000 (14:54 +0800)]
BaseTools: fix the bug for Mixed Pcd display in the report

Fix the bug to not display the mixed PCD in the Global PCD section, and
correct the Pcd display name.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools toolsetup.bat: set PATH to include Bin Win32 directory
Liming Gao [Thu, 29 Dec 2016 02:52:01 +0000 (10:52 +0800)]
BaseTools toolsetup.bat: set PATH to include Bin Win32 directory

Bin Win32 directory includes antlr.exe. This tool is used when compile
BaseTools source code. So, set it into PATH first.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTools toolsetup.bat: Set env when the binary tools are missing
Liming Gao [Thu, 29 Dec 2016 02:52:00 +0000 (10:52 +0800)]
BaseTools toolsetup.bat: Set env when the binary tools are missing

BASE_TOOLS_PATH is required to be set when the binary tools are missing.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoSecurityPkg: Tcg2Smm: Update HID patch logic
Zhang, Chao B [Wed, 4 Jan 2017 02:29:28 +0000 (10:29 +0800)]
SecurityPkg: Tcg2Smm: Update HID patch logic

Update HID patch logic. NOOP in ASL template may cause syntax error when
disassembled and recompiled.

Cc: Long Qin <qin.long@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
7 years agoNetworkPkg/Ip6Dxe: Fix the potential NULL pointer free
Jiaxin Wu [Tue, 3 Jan 2017 03:27:38 +0000 (11:27 +0800)]
NetworkPkg/Ip6Dxe: Fix the potential NULL pointer free

Ip6ConfigSetDnsServer may cause ASSERT if the invalid DNS
server address received. The issue is triggered by the NULL
pointer(Tmp) free.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoMdeModulePkg/Ip4Dxe: Fix the potential NULL pointer free
Jiaxin Wu [Thu, 29 Dec 2016 07:57:39 +0000 (15:57 +0800)]
MdeModulePkg/Ip4Dxe: Fix the potential NULL pointer free

Ip4Config2SetDnsServer may cause ASSERT if the invalid DNS
server address received. The issue is triggered by the NULL
pointer(Tmp) free.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoVlv2TbltDevicePkg/BootScriptSaveDxe: save 64-bit LoopTimes
Laszlo Ersek [Wed, 30 Nov 2016 19:31:18 +0000 (20:31 +0100)]
Vlv2TbltDevicePkg/BootScriptSaveDxe: save 64-bit LoopTimes

The BootScriptMemPoll() helper function does the following:

- pop LoopTimes from the variable argument list as UINT64, then truncate
  it to UINTN,

- pass the truncated value to S3BootScriptSaveMemPoll() as last argument.

The truncation to UINTN is now superfluous, thanks to the patch titled
"MdePkg, MdeModulePkg: S3BootScriptSaveMemPoll(): accept 64-bit
LoopTimes".

Cc: David Wei <david.wei@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoMdeModulePkg: S3SaveStateDxe, SmmS3SaveState: save 64-bit LoopTimes
Laszlo Ersek [Wed, 30 Nov 2016 19:19:06 +0000 (20:19 +0100)]
MdeModulePkg: S3SaveStateDxe, SmmS3SaveState: save 64-bit LoopTimes

The BootScriptWriteMemPoll() helper function in both drivers does the
following:

- pop Delay from the variable argument list as UINT64, then truncate it to
  UINTN,

- divide Delay by 10, using DivU64x32Remainder(), then store the quotient
  in LoopTimes (also UINTN),

- pass LoopTimes to S3BootScriptSaveMemPoll() as last argument.

The truncation to UINTN is superfluous and wrong in this logic (not to
mention incompatible with the PI spec); it prevents callers from
specifying Delays longer than 0xFFFF_FFFF * 100ns (approximately 429
seconds == 7 minutes 9 seconds) on Ia32. In particular it prevents callers
from specifying an infinite timeout (for example, 0xFFFF_FFFF_FFFF_FFFF *
100ns, approximately 58494 years).

Change the type of Delay and LoopTimes to UINT64. Keep the same logic,
just remove the truncations. The resultant LoopTimes values can be safely
passed to S3BootScriptSaveMemPoll() thanks to the previous patch.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoMdePkg, MdeModulePkg: S3BootScriptSaveMemPoll(): accept 64-bit LoopTimes
Laszlo Ersek [Wed, 30 Nov 2016 19:07:50 +0000 (20:07 +0100)]
MdePkg, MdeModulePkg: S3BootScriptSaveMemPoll(): accept 64-bit LoopTimes

The BaseNull instance of S3BootScriptLib obviously doesn't care about the
type of the S3BootScriptSaveMemPoll() function's LoopTimes parameter; this
lib instance doesn't do anything with the parameters received in
S3BootScriptSaveMemPoll().

The PiDxe instance saves the LoopTimes parameter in
EFI_BOOT_SCRIPT_MEM_POLL.LoopTimes. This target field already has UINT64
type. Furthermore, the BootScriptExecuteMemPoll() function in the same
library instance already uses a local UINT64 variable called LoopTimes to
count up to EFI_BOOT_SCRIPT_MEM_POLL.LoopTimes. This means that the the
UINTN type for S3BootScriptSaveMemPoll()'s LoopTimes parameter is an
unnecessary restriction.

The callers of S3BootScriptSaveMemPoll() will be updated in the next
patches, functionally. At this stage, they will continue to compile, since
UINT64 parameters can accept UINTN arguments.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoMdeModulePkg/PrintLib: Add missing return status check for Print APIs
Hao Wu [Fri, 23 Dec 2016 05:04:38 +0000 (13:04 +0800)]
MdeModulePkg/PrintLib: Add missing return status check for Print APIs

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

For the following APIs in PrintLib instance
MdeModulePkg\Library\DxePrintLibPrint2Protocol:
UnicodeVSPrint
UnicodeSPrint
UnicodeVSPrintAsciiFormat
UnicodeSPrintAsciiFormat
AsciiVSPrint
AsciiSPrint
AsciiVSPrintUnicodeFormat
AsciiSPrintUnicodeFormat

The internal function DxePrintLibPrint2ProtocolVaListToBaseList() will be
called to convert a VA_LIST to a BASE_LIST. However, those APIs miss
checking the return value of the internal function.

This commit adds codes to check the return value. If the VA_LIST fails to
be converted to a BASE_LIST, those PrintLib APIs will return 0 and leave
the output 'StartOfBuffer' unmodified.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoUefiCpuPkg/MpInitLib: Set initialize value of TimerPeriod
Jeff Fan [Thu, 29 Dec 2016 01:29:23 +0000 (09:29 +0800)]
UefiCpuPkg/MpInitLib: Set initialize value of TimerPeriod

This fix is to pass VS2010/VS2012 build.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
7 years agoBaseTools: Fix the bug for RAW file alignment value support
Yonghong Zhu [Tue, 27 Dec 2016 09:52:12 +0000 (17:52 +0800)]
BaseTools: Fix the bug for RAW file alignment value support

Fix the bug for RAW file to support Align=32 and Align=64. Current FDF
spec FfsAlignmentValues support this two values, while it is not the
valid value for GenFfs. So this patch add the logic to handle it.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=248
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoNetworkPkg/NetworkPkg.dsc: Move TLS modules to the supported components
Jiaxin Wu [Wed, 28 Dec 2016 11:32:18 +0000 (19:32 +0800)]
NetworkPkg/NetworkPkg.dsc: Move TLS modules to the supported components

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoBaseTools/Ecc: Fix the issue of not recognizing "FILE_GUID"
Hess Chen [Tue, 27 Dec 2016 10:10:48 +0000 (18:10 +0800)]
BaseTools/Ecc: Fix the issue of not recognizing "FILE_GUID"

Fix the issue of not recognizing "FILE_GUID"

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoNt32Pkg SecMain: Update SecMain.inf to support VS2015x86 X64 Mode
chanuei [Tue, 18 Oct 2016 02:45:02 +0000 (10:45 +0800)]
Nt32Pkg SecMain: Update SecMain.inf to support VS2015x86 X64 Mode

In V2:
  Add the specific LIB path in IA32 LINK path.

Update SecMain.inf to support VS2015x86 X64 Mode Build.
After this change, X64 Native Tools Command Prompt is not
required to be trig. NT32 IA32 and X64 can be built in the same
environment. It simplifies NT32 X64 build. New build command:
edksetup.bat --nt32
build -p Nt32Pkg\Nt32Pkg.dsc -a X64  # for 64
build -p Nt32Pkg\Nt32Pkg.dsc -a IA32 # for 32

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Chan <chanuei@sina.com>
Tested-by: Liming Gao <liming.gao@intel.com>
7 years agoSecurityPkg: Tcg2PhysicalPresence: Define TCG2 PP Flags Initial Pcd
Zhang, Chao B [Tue, 27 Dec 2016 08:47:06 +0000 (16:47 +0800)]
SecurityPkg: Tcg2PhysicalPresence: Define TCG2 PP Flags Initial Pcd

Define PcdTcg2PhysicalPresenceFlags to initialize TCG2 PP Flags setting.

Cc: Yao Jiewen <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoSecurityPkg: Tcg2Smm: TPM2 Vendor specific HID
Zhang, Chao B [Wed, 21 Dec 2016 06:31:47 +0000 (14:31 +0800)]
SecurityPkg: Tcg2Smm: TPM2 Vendor specific HID

Update TPM2 HID using vendor ManufacturerID & FirmwareVersion1.

Cc: Yao Jiewen <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoShellPkg/cd: Fix "cd" to support "fs0:dir" (no slash after ':')
Ruiyu Ni [Wed, 21 Dec 2016 08:04:19 +0000 (16:04 +0800)]
ShellPkg/cd: Fix "cd" to support "fs0:dir" (no slash after ':')

When "fs0:dir"(drive letter without slash) is used as destination
of "cd", "cd" tries to change to "dir" in root directory of "fs0:".
It's incorrect. The correct behavior is to change to "dir" in
current directory of "fs0:"

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoMdePkg/BaseLib: Fix PathCleanUpDirectories to correctly handle "\.\"
Ruiyu Ni [Wed, 21 Dec 2016 07:21:32 +0000 (15:21 +0800)]
MdePkg/BaseLib: Fix PathCleanUpDirectories to correctly handle "\.\"

The old code incorrectly cleans path like "fs0:\abc\.\.." to
"fs0:\abc", instead of "fs0:\"

The patch fixes this bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoUefiCpuPkg/MpInitLib: Set new AP to idle state after switching BSP
Jeff Fan [Mon, 26 Dec 2016 11:16:23 +0000 (19:16 +0800)]
UefiCpuPkg/MpInitLib: Set new AP to idle state after switching BSP

We need to set new AP to idle state if it is expected to be waken up by new BSP
later.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg/MpInitLib: Disable and restore system timer interrupt
Jeff Fan [Mon, 26 Dec 2016 11:13:44 +0000 (19:13 +0800)]
UefiCpuPkg/MpInitLib: Disable and restore system timer interrupt

We need to disable system timer interrup to avoid generating the pending
interrupt on the old BSP.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg/MpInitLib: Swap local APIC timer interrupt state
Jeff Fan [Mon, 26 Dec 2016 08:55:12 +0000 (16:55 +0800)]
UefiCpuPkg/MpInitLib: Swap local APIC timer interrupt state

We need to swap local APIC timer interrupt state between old BSP and new BSP.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg/MpInitLib: Move save/restore interrupt to SwitchBSPWorker()
Jeff Fan [Mon, 26 Dec 2016 08:52:48 +0000 (16:52 +0800)]
UefiCpuPkg/MpInitLib: Move save/restore interrupt to SwitchBSPWorker()

During switching BSP phase, we need to disable CPU interruput to prevent stack
crashed by Timer interrupt handle. But when we enabled source debugging feature,
debug timer interrupt handler (existing on both PEI and DXE) also could crash
the stack used during switching BSP. So,we need to move save/restore interrupt
to SwitchBSPWorker().

Cc: Feng Tian <feng.tian@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg/MpInitLib: Sync BSP's local APIC timer settings to APs
Jeff Fan [Mon, 26 Dec 2016 08:44:24 +0000 (16:44 +0800)]
UefiCpuPkg/MpInitLib: Sync BSP's local APIC timer settings to APs

If APs are waken up by INIT-SIPI-SIPI command, they will lose original local
APIC timer setting. As a result, the timer library instance based on local APIC
timer cannot work on APs function.

This fix is to save BSP's local APIC timer settings before waking up APs and
to sync to APs when APs wakeup by INIT-SIPI-SIPI command.

Setting BSP's current counter to AP's initial counter could make sure BSP and
APs have same counter value across BSP switching.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg/DxeMpInitLib: Support source debugging on AP function
Jeff Fan [Mon, 26 Dec 2016 08:28:58 +0000 (16:28 +0800)]
UefiCpuPkg/DxeMpInitLib: Support source debugging on AP function

The current DxeDebugAgentLib supports source debugging on AP function. This
update is to update DxeMpInitLib to consume Debug Agent Library by
DEBUG_AGENT_INIT_DXE_AP flag. Thus, we could source debugging AP function
invoked by CPU MP Protocol.

However, current SecPeiDebugAgentLib does not support source debugging on AP
function invoked by CPU MP PPI. I have submitted one bugzilla to add this
support at https://bugzilla.tianocore.org/show_bug.cgi?id=308.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg/MicrocodeUpdate: Add MP support.
Jiewen Yao [Tue, 27 Dec 2016 06:21:16 +0000 (14:21 +0800)]
UefiCpuPkg/MicrocodeUpdate: Add MP support.

Support the case that BSP and AP are using different Microcode.
The previous logic validates new MCU on BSP only.
The enhanced logic will validate MCU on every BSP and AP.
As long as one processor loads the MCU successfully, it will be updated.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoUefiCpuPkg/MicrocodeUpdate: enhance flash write logic
Jiewen Yao [Mon, 26 Dec 2016 15:35:41 +0000 (23:35 +0800)]
UefiCpuPkg/MicrocodeUpdate: enhance flash write logic

The patch updated MicrocodeWrite() to move the Microcode replacement logic
to a standalone function -  UpdateMicrocodeFlashRegion().
More detail description is added in UpdateMicrocodeFlashRegion()
to improve readability.

The Microcode information is collected in InitializeMicrocodeDescriptor(),
so that FmpGetImage() can get the info directly.
MicrocodeRead() is not needed any more.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoIntelFrameworkModulePkg KbDxe: Execute key notify func at TPL_CALLBACK
Star Zeng [Fri, 16 Dec 2016 10:07:43 +0000 (18:07 +0800)]
IntelFrameworkModulePkg KbDxe: Execute key notify func at TPL_CALLBACK

Current implementation executes key notify function in TimerHandler
at TPL_NOTIFY. The code change is to make key notify function
executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY.

The code will signal KeyNotify process event if the key pressed
matches any key registered and insert the KeyData to the EFI Key
queue for notify, then the KeyNotify process handler will invoke
key notify functions at TPL_CALLBACK.

Cc: Ruiyu Ni <Ruiyu.ni@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoIntelFrameworkModulePkg Ps2KbDxe: Execute key notify func at TPL_CALLBACK
Star Zeng [Fri, 16 Dec 2016 10:07:12 +0000 (18:07 +0800)]
IntelFrameworkModulePkg Ps2KbDxe: Execute key notify func at TPL_CALLBACK

Current implementation executes key notify function in TimerHandler
at TPL_NOTIFY. The code change is to make key notify function
executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY.

The code will signal KeyNotify process event if the key pressed
matches any key registered and insert the KeyData to the EFI Key
queue for notify, then the KeyNotify process handler will invoke
key notify functions at TPL_CALLBACK.

Cc: Ruiyu Ni <Ruiyu.ni@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoMdeModulePkg Ps2KbDxe: Execute key notify func at TPL_CALLBACK
Star Zeng [Fri, 16 Dec 2016 10:08:18 +0000 (18:08 +0800)]
MdeModulePkg Ps2KbDxe: Execute key notify func at TPL_CALLBACK

Current implementation executes key notify function in TimerHandler
at TPL_NOTIFY. The code change is to make key notify function
executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY.

The code will signal KeyNotify process event if the key pressed
matches any key registered and insert the KeyData to the EFI Key
queue for notify, then the KeyNotify process handler will invoke
key notify functions at TPL_CALLBACK.

Cc: Ruiyu Ni <Ruiyu.ni@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoMdeModulePkg TerminalDxe: Execute key notify func at TPL_CALLBACK
Star Zeng [Mon, 19 Dec 2016 14:21:11 +0000 (22:21 +0800)]
MdeModulePkg TerminalDxe: Execute key notify func at TPL_CALLBACK

Current implementation executes key notify function in TimerHandler
at TPL_NOTIFY. The code change is to make key notify function
executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY.

The code will signal KeyNotify process event if the key pressed
matches any key registered and insert the KeyData to the EFI Key
queue for notify, then the KeyNotify process handler will invoke
key notify functions at TPL_CALLBACK.

Cc: Ruiyu Ni <Ruiyu.ni@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoMdeModulePkg UsbKbDxe: Execute key notify func at TPL_CALLBACK
Star Zeng [Fri, 16 Dec 2016 09:16:22 +0000 (17:16 +0800)]
MdeModulePkg UsbKbDxe: Execute key notify func at TPL_CALLBACK

Current implementation executes key notify function in TimerHandler
at TPL_NOTIFY. The code change is to make key notify function
executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY.

The code will signal KeyNotify process event if the key pressed
matches any key registered and insert the KeyData to the EFI Key
queue for notify, then the KeyNotify process handler will invoke
key notify functions at TPL_CALLBACK.

Cc: Ruiyu Ni <Ruiyu.ni@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoMdeModulePkg ConSplitterDxe: Support toggle state sync
Star Zeng [Fri, 15 Apr 2016 09:38:51 +0000 (17:38 +0800)]
MdeModulePkg ConSplitterDxe: Support toggle state sync

Register key notify for toggle state (CapsLock, NumLock and ScrollLock)
sync between multiple keyboards.
The implementation for this feature requires keyboard driver supports
EFI_KEY_STATE_EXPOSED, and turns on physical TextInEx partial key
report for toggle state sync.
The virtual TextInEx will report the partial key after it is required
by calling SetState(X | KEY_STATE_VALID_EXPOSED) explicitly.

Cc: Ruiyu Ni <Ruiyu.ni@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
7 years agoNetworkPkg: Fix potentially uninitialized local variable
Jiaxin Wu [Mon, 26 Dec 2016 01:53:20 +0000 (09:53 +0800)]
NetworkPkg: Fix potentially uninitialized local variable

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoNt32Pkg/Nt32Pkg.dsc: Change TLS_ENABLE flag to FALSE by default
Jiaxin Wu [Fri, 23 Dec 2016 08:39:45 +0000 (16:39 +0800)]
Nt32Pkg/Nt32Pkg.dsc: Change TLS_ENABLE flag to FALSE by default

TLS feature highly depends on the OpenSSL building. To avoid
the default Nt32 platform build failure, we should change the
default value of TLS_ENABLE to FALSE.

The notes are also provided for Secure Boot and TLS features.

Cc: Ni Ruiyu <ruiyu.ni@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNetworkPkg/HttpDxe: Fix the potential NULL dereference
Jiaxin Wu [Fri, 23 Dec 2016 03:13:21 +0000 (11:13 +0800)]
NetworkPkg/HttpDxe: Fix the potential NULL dereference

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNetworkPkg/DnsDxe: Fixed the assert issue in DnsDxe
Jiaxin Wu [Thu, 8 Dec 2016 00:52:41 +0000 (08:52 +0800)]
NetworkPkg/DnsDxe: Fixed the assert issue in DnsDxe

Fix the DnsDxe assert issue when the incorrect answer message
received.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
7 years agoMdeModulePkg/CapsuleLib: Follow UEFI 22.2.3 to process FMP.
Jiewen Yao [Fri, 23 Dec 2016 15:22:30 +0000 (23:22 +0800)]
MdeModulePkg/CapsuleLib: Follow UEFI 22.2.3 to process FMP.

Previous logic does not follow UEFI 22.2.3 to process FMP strictly.
It may cause FMP image not be processed in some corner case.
The updated logic follows UEFI 22.2.3.

The way to check if a capsule is processed is also simplified.

The function - ProcessFmpCapsuleImage() is too big, so that
we created sub-functions - StartFmpImage(), DumpAllFmpInfo(),
GetFmpHandleBufferByType(), SetFmpImageData(), RecordFmpCapsuleStatus()
to improve the readability.

The function - ProcessTheseCapsules() is too big, so that
we created sub-functions - InitCapsulePtr(), AreAllImagesProcessed(),
PopulateCapsuleInConfigurationTable() to improve the readability.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg/CapsuleLib: Support result rolling over.
Jiewen Yao [Fri, 23 Dec 2016 16:00:51 +0000 (00:00 +0800)]
MdeModulePkg/CapsuleLib: Support result rolling over.

According to UEFI spec, capsule result variable may roll over to 0.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg/CapsuleLib: Add CapsuleTarget support.
Jiewen Yao [Fri, 23 Dec 2016 07:42:27 +0000 (15:42 +0800)]
MdeModulePkg/CapsuleLib: Add CapsuleTarget support.

UEFI spec requires CapsuleTarget to be a device path associated
with FMP producer.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoBaseTools/Pccts: Resolve GCC sting format mismatch build warning
Hao Wu [Thu, 22 Dec 2016 01:17:27 +0000 (09:17 +0800)]
BaseTools/Pccts: Resolve GCC sting format mismatch build warning

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

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg/CapsuleLib: remove ImageIndex check.
Jiewen Yao [Thu, 22 Dec 2016 15:41:00 +0000 (23:41 +0800)]
MdeModulePkg/CapsuleLib: remove ImageIndex check.

UEFI specification does not require ImageIndex check,
it only requires ImageTypeId check.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg/CapsuleApp: Dump capsule name in record.
Jiewen Yao [Thu, 22 Dec 2016 05:45:18 +0000 (13:45 +0800)]
MdeModulePkg/CapsuleApp: Dump capsule name in record.

According to UEFI spec, capsule report variable should include
a null terminator for capsule name and capsule target, if they are
not present.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg/CapsuleLib: Add NULL capsule name in record.
Jiewen Yao [Thu, 22 Dec 2016 05:43:37 +0000 (13:43 +0800)]
MdeModulePkg/CapsuleLib: Add NULL capsule name in record.

According to UEFI spec, capsule report variable should include
a null terminator for capsule name and capsule target, if they are
not present.

The reserved field is zeroed.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoSignedCapsulePkg/SystemCapsuleLib: Add ASSERT check for PCD
Jiewen Yao [Thu, 22 Dec 2016 04:38:22 +0000 (12:38 +0800)]
SignedCapsulePkg/SystemCapsuleLib: Add ASSERT check for PCD

Add ASSERT check for PCD to avoid platform mis-configuration.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Qin Long <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
7 years agoSecurityPkg/FmpAuthLib: Add PublicKeyDataLength check
Jiewen Yao [Thu, 22 Dec 2016 04:36:39 +0000 (12:36 +0800)]
SecurityPkg/FmpAuthLib: Add PublicKeyDataLength check

Add PublicKeyDataLength check to be multiple SHA256_DIGEST_SIZE
to avoid caller make mistake, or platform mis-configuration.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Qin Long <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
7 years agoNt32Pkg: Enable HTTPS boot feature for Nt32 platform
Jiaxin Wu [Wed, 14 Dec 2016 03:36:38 +0000 (11:36 +0800)]
Nt32Pkg: Enable HTTPS boot feature for Nt32 platform

v2:
* Rename flag: HTTPS_BOOT_ENABLE -> TLS_ENABLE

This path is used to enable HTTPS boot feature for Nt32 platform.

Cc: Long Qin <qin.long@intel.com>
Cc: Ni Ruiyu <ruiyu.ni@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNt32Pkg/Nt32Pkg.dsc: Remove the flag for OpensslLib and BaseCryptLib
Jiaxin Wu [Wed, 14 Dec 2016 03:33:49 +0000 (11:33 +0800)]
Nt32Pkg/Nt32Pkg.dsc: Remove the flag for OpensslLib and BaseCryptLib

This patch is used to remove the 'SECURE_BOOT_ENABLE' flag for OpensslLib
and BaseCryptLib modules.

Cc: Long Qin <qin.long@intel.com>
Cc: Ni Ruiyu <ruiyu.ni@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNetworkPkg/NetworkPkg.dsc: Enable TlsDxe and TlsAuthConfigDxe module
Jiaxin Wu [Wed, 14 Dec 2016 02:59:51 +0000 (10:59 +0800)]
NetworkPkg/NetworkPkg.dsc: Enable TlsDxe and TlsAuthConfigDxe module

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNetworkPkg/HttpDxe: HTTPS support over IPv4 and IPv6
Jiaxin Wu [Wed, 14 Dec 2016 02:57:41 +0000 (10:57 +0800)]
NetworkPkg/HttpDxe: HTTPS support over IPv4 and IPv6

This patch is used to enable HTTPS feature. HttpDxe driver
will consume TlsDxe driver. It can both support http and https
feature, that’s depended on the information of URL, the HTTP
instance can be able to determine whether to use http or https.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNetworkPkg/TlsAuthConfigDxe: Provide the UI to support TLS auth configuration
Jiaxin Wu [Wed, 14 Dec 2016 02:54:32 +0000 (10:54 +0800)]
NetworkPkg/TlsAuthConfigDxe: Provide the UI to support TLS auth configuration

This patch provides the UI to support TLS auth configuration.
* EFI_SIGNATURE_LIST format is used for 'TlsCaCertificate'
variable. So, TLS supports multiple certificate configuration.
* The variable attribute is BS with NV, which only target at
preventing runtime phase attack.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNetworkPkg/TlsDxe: TlsDxe driver implementation over OpenSSL
Jiaxin Wu [Wed, 14 Dec 2016 02:44:07 +0000 (10:44 +0800)]
NetworkPkg/TlsDxe: TlsDxe driver implementation over OpenSSL

v3:
* Typo fix and code refine.
* Rename the internal macros and function:
TLS_INSTANCE_FROM_PROTOCOL_THIS -> TLS_INSTANCE_FROM_PROTOCOL
TLS_INSTANCE_FROM_CONFIGURATION_THIS -> TLS_INSTANCE_FROM_CONFIGURATION
TlsEcryptPacket -> TlsEncryptPacket

v2:
* Refine the TlsEcryptPacket/TlsDecryptPacket function
according the community feedback.

This patch is the implementation of EFI TLS Service Binding
Protocol, EFI TLS Protocol and EFI TLS Configuration Protocol
Interfaces.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoCryptoPkg: Add new TlsLib library
Jiaxin Wu [Wed, 14 Dec 2016 02:34:57 +0000 (10:34 +0800)]
CryptoPkg: Add new TlsLib library

v2:
* Code refine and Typo fix:
TlsHandeAlert -> TlsHandleAlert

This patch is used to add new TlsLib library, which is wrapped
over OpenSSL. The implementation provides TLS library functions
for EFI TLS protocol and EFI TLS Configuration Protocol.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoCryptoPkg: Enable ssl build in OpensslLib directly
Jiaxin Wu [Wed, 14 Dec 2016 02:30:32 +0000 (10:30 +0800)]
CryptoPkg: Enable ssl build in OpensslLib directly

This patch is used to enable ssl build in OpensslLib module
directly.

Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Tested-by: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoMdePkg: Add a header to standardize TLS definitions
Jiaxin Wu [Wed, 14 Dec 2016 02:21:16 +0000 (10:21 +0800)]
MdePkg: Add a header to standardize TLS definitions

This path is used to standardize TLS definitions from related
RFCs. Including TLS Cipher Suites, TLS Version, TLS Content Type
and TLS Record Header, etc.

Cc: Long Qin <qin.long@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoMdePkg: Add TLS related protocol definition
Jiaxin Wu [Wed, 14 Dec 2016 02:19:19 +0000 (10:19 +0800)]
MdePkg: Add TLS related protocol definition

This patch is used to add Tls.h and TlsConfig.h header
files to define EFI TLS Configuration Protocol,
EFI TLS Service Binding Protocol and
EFI TLS Configuration Protocol.

Cc: Long Qin <qin.long@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNetworkPkg: Refine UintnToAscDecWithFormat functions logic
Hao Wu [Tue, 15 Nov 2016 08:25:22 +0000 (16:25 +0800)]
NetworkPkg: Refine UintnToAscDecWithFormat functions logic

This commit refines the logic for HttpBootUintnToAscDecWithFormat and
PxeBcUintnToAscDecWithFormat. It avoids using the decrement operator '--'
for array index to prevent possible mis-reports by static code checkers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoMdeModulePkg/UefiPxeBcDxe: Refine the CvtNum function logic
Hao Wu [Tue, 15 Nov 2016 08:12:30 +0000 (16:12 +0800)]
MdeModulePkg/UefiPxeBcDxe: Refine the CvtNum function logic

This commit refines the logic for the CvtNum function. It avoids using the
decrement operator '--' for array index to prevent possible mis-reports by
static code checkers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoMdeModulePkg/DxeNetLib: Rewrite NetblockChecksum function logic
Hao Wu [Tue, 15 Nov 2016 07:39:44 +0000 (15:39 +0800)]
MdeModulePkg/DxeNetLib: Rewrite NetblockChecksum function logic

This commit rewrites the logic for NetblockChecksum. It processes the
checksum of the left-over byte first to prevent possible mis-reports by
static code checkers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoMdePkg/MemoryLib: Refine InternalMemSetMem16|32|64 functions logic
Hao Wu [Tue, 15 Nov 2016 05:26:47 +0000 (13:26 +0800)]
MdePkg/MemoryLib: Refine InternalMemSetMem16|32|64 functions logic

This commit refines the logic for InternalMemSetMem16|32|64 functions. It
avoids using the decrement operator '--' for array index to prevent
possible mis-reports by static code checkers.

Please note that those modified functions are only consumed within
MemoryLib by APIs SetMem16|32|64, and those APIs will handle the case when
the input number of bytes to set is 0. Hence, the behavior of APIs
SetMem16|32|64 is not changed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoMdePkg/BaseLib: Add an additional check within (Ascii)StrnCmp
Hao Wu [Wed, 7 Dec 2016 02:39:03 +0000 (10:39 +0800)]
MdePkg/BaseLib: Add an additional check within (Ascii)StrnCmp

This commit adds an addtional check in AsciiStrnCmp and StrnCmp. It
explicitly checks the end of the sting pointed by 'SecondString' to make
the code logic easier for reading and to prevent possible mis-reports by
static code checkers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoMdePkg/BaseLib: Refine (Ascii)StrnLenS functions logic
Hao Wu [Tue, 15 Nov 2016 01:59:37 +0000 (09:59 +0800)]
MdePkg/BaseLib: Refine (Ascii)StrnLenS functions logic

This commit refines the logic for AsciiStrnLenS and StrnLenS. It makes the
logic more straightforward to prevent possible mis-reports by static code
checkers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoUefiCpuPkg/SmmCpuFeaturesLib: Fix coding style issues
Dandan Bi [Tue, 20 Dec 2016 07:12:56 +0000 (15:12 +0800)]
UefiCpuPkg/SmmCpuFeaturesLib: Fix coding style issues

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoUefiCpuPkg: Add Pcd info to uni file
Dandan Bi [Tue, 20 Dec 2016 07:10:29 +0000 (15:10 +0800)]
UefiCpuPkg: Add Pcd info to uni file

Add PcdCpuSmmStmExceptionStackSize/PcdCpuMsegSize prompt and help
string to uni file.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSecurityPkg Tcg2ConfigDxe: Force reset when PCR Allocation changed.
Eric Dong [Tue, 20 Dec 2016 07:54:37 +0000 (15:54 +0800)]
SecurityPkg Tcg2ConfigDxe: Force reset when PCR Allocation changed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Add check to avoid NULL ptr dereference
Hao Wu [Tue, 20 Dec 2016 01:13:23 +0000 (09:13 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Add check to avoid NULL ptr dereference

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoBaseTools GCC makefile: disable unused-result warning for CPP file
Liming Gao [Fri, 16 Dec 2016 05:07:10 +0000 (13:07 +0800)]
BaseTools GCC makefile: disable unused-result warning for CPP file

This warning has been disabled for C file. To be same, it is also disabled
for CPP file.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTools: fix write-strings build warnings
Heyi Guo [Thu, 15 Dec 2016 06:49:47 +0000 (14:49 +0800)]
BaseTools: fix write-strings build warnings

Fix build warnings of "deprecated conversion from string constant to
?CHAR8* {aka char*}? [-Wwrite-strings]" for BaseTools, while using
"gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools: fix format type build warnings
Heyi Guo [Thu, 15 Dec 2016 06:49:46 +0000 (14:49 +0800)]
BaseTools: fix format type build warnings

Fix build warnings of "format ?%d? expects argument of type ?int?, but
argument 5 has type ?long unsigned int? [-Wformat=]" for BaseTools,
while using "gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools: fix format-security build warnings
Heyi Guo [Thu, 15 Dec 2016 06:49:45 +0000 (14:49 +0800)]
BaseTools: fix format-security build warnings

Fix build warnings of "format not a string literal and no format
arguments [-Wformat-security]" for BaseTools, while using "gcc version
4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg/NonDiscoverableDeviceRegistrationLib: Fix coding style issues
Dandan Bi [Mon, 19 Dec 2016 07:02:24 +0000 (15:02 +0800)]
MdeModulePkg/NonDiscoverableDeviceRegistrationLib: Fix coding style issues

1. Fix issues in comments
2. Fix Guid/protocol format

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoMdeModulePkg/SataControllerDxe: Fix coding style issue
Dandan Bi [Mon, 19 Dec 2016 03:37:51 +0000 (11:37 +0800)]
MdeModulePkg/SataControllerDxe: Fix coding style issue

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/TerminalDxe: Initialize variable after declaration
Dandan Bi [Mon, 19 Dec 2016 03:18:46 +0000 (11:18 +0800)]
MdeModulePkg/TerminalDxe: Initialize variable after declaration

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/EmmcDxe: Avoid Non-Boolean type used as Boolean
Dandan Bi [Mon, 19 Dec 2016 03:16:19 +0000 (11:16 +0800)]
MdeModulePkg/EmmcDxe: Avoid Non-Boolean type used as Boolean

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/EbcDxe: Make variable name follow rules
Dandan Bi [Mon, 19 Dec 2016 03:11:15 +0000 (11:11 +0800)]
MdeModulePkg/EbcDxe: Make variable name follow rules

For variable name, it should contain lower case characters.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoMdeModulePkg/CapsuleApp: Fix Guid format issues
Dandan Bi [Mon, 19 Dec 2016 03:03:57 +0000 (11:03 +0800)]
MdeModulePkg/CapsuleApp: Fix Guid format issues

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoIntelSiliconPkg: Fix format issues
Dandan Bi [Mon, 19 Dec 2016 01:46:01 +0000 (09:46 +0800)]
IntelSiliconPkg: Fix format issues

1. Fix doxygen formt
2. Fix Guid format

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>