Compare commits

...

6 Commits

Author SHA1 Message Date
b24306f15d NetworkPkg: Fix incorrect unicode string of the AKM/Cipher Suite
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3813

The size of buffer should be 3 CHAR16 for Null-terminated Unicode
string.
The first char is the AKM/Cipher Suite number, the second char is ' ',
the third char is '\0'.

Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
2022-02-21 15:19:40 +00:00
8a57673316 ShellPkg: Fix Ping GetTimerPeriod API failure
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3819

Ping GetTimerPeriod API returns sometime zero value when
StallCounter has smaller value than RttTimerTick (divide by zero)
which results some failure at ping UEFI shell command

Signed-off-by: MohammedX Rehan <mohammedx.rehan@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2022-02-16 08:09:46 +00:00
c28e376edc OvmfPkg/FvbServicesSmm: use the VmgExitLibNull
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3835

The commit ade62c18f4 caused a boot failure
when OVMF is build with SECURE_BOOT/SMM enabled.

This happen because the above commit extended the BaseMemEncryptSevLib.inf
to include VmgExitLib. The FvbServicesSmm uses the functions provided
by the MemEncryptSevLib to clear the memory encryption mask from the
page table. It created a dependency, as shown below

OvmfPkg/FvbServicesSmm.inf
 ---> MemEncryptSevLib                   class
 ---> "OvmfPkg/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf"  instance
 ---> VmgExitLib
 ---> "OvmfPkg/VmgExitLib"    instance
 ---> LocalApicLib                       class
 ---> UefiCpuPkg/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf    instance
 ---> TimerLib                           class
 ---> "OvmfPkg/AcpiTimerLib/DxeAcpiTimerLib.inf"              instance
 ---> PciLib                             class
 ---> "OvmfPkg/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf"     instance

The LocalApicLib provides a constructor, execution of the constructor
causes an exception. The SEV-ES and SEV-SNP do not support the SMM, so
skip including the VmgExitLib chain. Use the module override to use the
VmgExitLibNull to avoid the inclusion of unneeded LocalApicLib dependency
chain in FvbServicesSmm. We ran similar issue for AmdSevDxe driver,
see commit 19914edc5a

After the patch, the dependency look like this:

OvmfPkg/FvbServicesSmm.inf
 ---> MemEncryptSevLib                   class
 ---> "OvmfPkg/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf"  instance
 ---> VmgExitLib
 ---> "UefiCpuPkg/Library/VmgExitLibNull"    instance

Fixes: ade62c18f4
Reported-by: Aaron Young <aaron.young@oracle.com>
Cc: Dann Frazier <dann.frazier@canonical.com>
Cc: Michael Roth <michael.roth@amd.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Tested-by: dann frazier <dann.frazier@canonical.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-02-16 06:51:58 +00:00
85589ddbf6 OvmfPkg/VmgExitLib: Fix uninitialized variable warning with XCODE5
XCODE5 reported the following warning:

OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c:1895:12: note:
uninitialized use occurs here
           Compacted
           ^^^^^^^^^

Initialize the 'Compacted' variable to fix the warning.

Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2022-02-15 10:17:31 +00:00
1193aa2dfb MdeModulePkg: update brotli submodule
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3417
Update the brotli submodule to the latest commit (f4153a0)
so that the build isn't broken in GCC 11 compilers.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Pedro Falcato <pedro.falcato@gmail.com>

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2022-02-15 02:13:32 +00:00
42af706dfb BaseTools: Update brotli submodule
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3417
Update the brotli submodule to the latest commit (f4153a0)
so that the build isn't broken in GCC 11 compilers.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2022-02-15 02:13:32 +00:00
11 changed files with 56 additions and 12 deletions

View File

@ -10,6 +10,13 @@ APPNAME = BrotliCompress
OBJECTS = \
BrotliCompress.o \
brotli/c/common/platform.o \
brotli/c/common/shared_dictionary.o \
brotli/c/common/constants.o \
brotli/c/common/context.o \
brotli/c/enc/command.o \
brotli/c/enc/compound_dictionary.o \
brotli/c/enc/fast_log.o \
brotli/c/common/dictionary.o \
brotli/c/common/transform.o \
brotli/c/dec/bit_reader.o \

View File

@ -13,14 +13,23 @@ APPNAME = BrotliCompress
#LIBS = $(LIB_PATH)\Common.lib
COMMON_OBJ = brotli\c\common\dictionary.obj brotli\c\common\transform.obj
COMMON_OBJ = \
brotli\c\common\constants.obj \
brotli\c\common\context.obj \
brotli\c\common\dictionary.obj \
brotli\c\common\platform.obj \
brotli\c\common\shared_dictionary.obj \
brotli\c\common\transform.obj
DEC_OBJ = \
brotli\c\dec\bit_reader.obj \
brotli\c\dec\decode.obj \
brotli\c\dec\huffman.obj \
brotli\c\dec\state.obj
ENC_OBJ = \
brotli\c\enc\command.obj \
brotli\c\enc\compound_dictionary.obj \
brotli\c\enc\backward_references.obj \
brotli\c\enc\fast_log.obj \
brotli\c\enc\backward_references_hq.obj \
brotli\c\enc\bit_cost.obj \
brotli\c\enc\block_splitter.obj \

View File

@ -280,12 +280,16 @@ WifiMgrGetStrAKMList (
//
// Current AKM Suite is between 1-9
//
AKMListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * AKMSuiteCount * 2);
AKMListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * (AKMSuiteCount * 2 + 1));
if (AKMListDisplay != NULL) {
for (Index = 0; Index < AKMSuiteCount; Index++) {
//
// The size of buffer should be 3 CHAR16 for Null-terminated Unicode string.
// The first char is the AKM Suite number, the second char is ' ', the third char is '\0'.
//
UnicodeSPrint (
AKMListDisplay + (Index * 2),
sizeof (CHAR16) * 2,
sizeof (CHAR16) * 3,
L"%d ",
Profile->Network.AKMSuite->AKMSuiteList[Index].SuiteType
);
@ -333,12 +337,16 @@ WifiMgrGetStrCipherList (
//
// Current Cipher Suite is between 1-9
//
CipherListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * CipherSuiteCount * 2);
CipherListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * (CipherSuiteCount * 2 + 1));
if (CipherListDisplay != NULL) {
for (Index = 0; Index < CipherSuiteCount; Index++) {
//
// The size of buffer should be 3 CHAR16 for Null-terminated Unicode string.
// The first char is the Cipher Suite number, the second char is ' ', the third char is '\0'.
//
UnicodeSPrint (
CipherListDisplay + (Index * 2),
sizeof (CHAR16) * 2,
sizeof (CHAR16) * 3,
L"%d ",
Profile->Network.CipherSuite->CipherSuiteList[Index].SuiteType
);

View File

@ -906,7 +906,10 @@
#
# Variable driver stack (SMM)
#
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf {
<LibraryClasses>
VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {
<LibraryClasses>

View File

@ -1872,6 +1872,7 @@ GetCpuidFw (
UINT32 XSaveSize;
XssMsr.Uint64 = 0;
Compacted = FALSE;
if (EcxIn == 1) {
/*
* The PPR and APM aren't clear on what size should be encoded in

View File

@ -956,7 +956,10 @@
#
# Variable driver stack (SMM)
#
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf {
<LibraryClasses>
VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {
<LibraryClasses>

View File

@ -974,7 +974,10 @@
#
# Variable driver stack (SMM)
#
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf {
<LibraryClasses>
VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {
<LibraryClasses>

View File

@ -971,7 +971,10 @@
#
# Variable driver stack (SMM)
#
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf {
<LibraryClasses>
VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
}
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {
<LibraryClasses>

View File

@ -259,9 +259,11 @@ GetTimerPeriod (
EFI_EVENT TimerEvent;
UINT32 StallCounter;
EFI_TPL OldTpl;
UINT32 TimerPeriod;
RttTimerTick = 0;
StallCounter = 0;
TimerPeriod = 0;
Status = gBS->CreateEvent (
EVT_TIMER | EVT_NOTIFY_SIGNAL,
@ -295,7 +297,12 @@ GetTimerPeriod (
gBS->SetTimer (TimerEvent, TimerCancel, 0);
gBS->CloseEvent (TimerEvent);
return StallCounter / RttTimerTick;
TimerPeriod = StallCounter / RttTimerTick;
if (TimerPeriod != 0) {
return TimerPeriod;
} else {
return 1;
}
}
/**