audk/MdeModulePkg/Library
Heyi Guo f1f7190bf3 MdeModulePkg/DxeCorePerformanceLib: add lock protection
DXE performance gauge record access functions might be reentered since
we are supporting something like USB hot-plug, which is a timer event
where gBS->ConnectController might be called and then PERF will be
called in CoreConnectSingleController.

When StartGaugeEx is being reentered, not only the gauge record might
be overwritten, more serious situation will be caused if gauge data
buffer reallocation procedure is interrupted, between line 180 and 187
in DxeCorePerformanceLib.c specifically. There, mMaxGaugeRecords will
be doubled twice (denoted as 4X), but mGaugeData only points to a
buffer of size 2X, which will probably cause the following 2X memory
to be overflowed when gauge records are increased.

So we add EFI lock with TPL_NOTIFY in StartGaugeEx/EndGaugeEx/GetGaugeEx
to avoid memory overflow and gauge data corruption.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-11-29 20:34:10 +08:00
..
AuthVariableLibNull MdeModulePkg: Deprecate EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 2017-11-01 22:25:36 +08:00
BaseIpmiLibNull MdeModulePkg: Add the missing Library uni files of Ipmi instances 2015-12-24 02:28:45 +00:00
BasePlatformHookLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
BaseResetSystemLibNull MdeModulePkg/BaseResetSystemLibNull: Implement ResetPlatformSpecific 2016-09-02 10:07:14 +08:00
BaseSerialPortLib16550 MdeModulePkg BaseSerialPortLib: Fix VS2010 build error 2016-01-11 00:34:15 +00:00
BaseSortLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
BootLogoLib MdeModulePkg/BootLogoLib: Remove invalid if judgments 2016-11-11 12:55:46 +08:00
BootMaintenanceManagerUiLib MdeModulePkg: Fix misuses of AllocateCopyPool 2017-11-08 17:13:03 +08:00
BootManagerUiLib MdeModulePkg/BMUiLib: Check reset requirement before exiting UiApp 2017-07-27 10:47:15 +08:00
BrotliCustomDecompressLib MdeModulePkg: Fix MSFT C4255 warning 2017-11-14 18:18:43 +08:00
CpuExceptionHandlerLibNull MdeModulePkg/CpuExceptionHandlerLib: Add DumpCpuContext() 2017-04-07 09:43:40 +08:00
CustomizedDisplayLib MdeModulePkg/Library: Fix typos in comments and variables 2016-10-27 09:11:19 +08:00
DebugAgentLibNull MdeModulePkg/Library: Fix typos in comments and variables 2016-10-27 09:11:19 +08:00
DeviceManagerUiLib MdeModulePkg: Fix misuses of AllocateCopyPool 2017-11-08 17:13:03 +08:00
DxeCapsuleLibFmp MdeModulePkg: Update Ppi/Protocol/Guid usage in INF files 2017-10-10 18:10:25 +08:00
DxeCapsuleLibNull MdeModulePkg/DxeCapsuleLibNull: Add ProcessCapsules() interface. 2016-11-08 22:36:58 +08:00
DxeCoreMemoryAllocationLib MdeModulePkg: Refine casting expression result to bigger size 2017-03-06 14:33:20 +08:00
DxeCorePerformanceLib MdeModulePkg/DxeCorePerformanceLib: add lock protection 2017-11-29 20:34:10 +08:00
DxeCrc32GuidedSectionExtractLib MdeModulePkg/Library: Fix typos in comments and variables 2016-10-27 09:11:19 +08:00
DxeDebugPrintErrorLevelLib MdeModulePkg/Library: Fix typos in comments and variables 2016-10-27 09:11:19 +08:00
DxeDpcLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeFileExplorerProtocol MdeModulePkg DxeFileExplorerProtocol: Change file format which has mixed file format. 2015-12-16 03:20:21 +00:00
DxeHttpLib MdeModulePkg/DxeHttpLib: Fix spelling typo in EFI_HTTP_STATUS_CODE 2017-08-02 15:31:21 +08:00
DxeIpIoLib MdeModulePkg/Library: Remove the self-reference in UdpIoLib/TcpIoLib/IpIoLib 2017-08-23 09:17:28 +08:00
DxeIpmiLibIpmiProtocol MdeModulePkg: Add the missing Library uni files of Ipmi instances 2015-12-24 02:28:45 +00:00
DxeNetLib MdeModulePkg: Update IP4 stack to support point-to-point link with 31-bit mask. 2017-11-13 13:52:17 +08:00
DxePerformanceLib MdeModulePkg: Update PerformanceLib instances not to check Identifier. 2016-04-11 16:20:28 +08:00
DxePrintLibPrint2Protocol MdeModulePkg/PrintLib: Fix possible negative value left shift 2017-09-29 16:14:17 +08:00
DxeReportStatusCodeLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeSecurityManagementLib MdeModulePkg: Fix MSFT C4255 warning 2017-11-14 18:18:43 +08:00
DxeSmmPerformanceLib MdeModulePkg DxeSmmPerformanceLib: Add missing UefiLib in *.inf at de2459d 2016-06-29 12:54:53 +08:00
DxeTcpIoLib MdeModulePkg/Library: Remove the self-reference in UdpIoLib/TcpIoLib/IpIoLib 2017-08-23 09:17:28 +08:00
DxeUdpIoLib MdeModulePkg/Library: Remove the self-reference in UdpIoLib/TcpIoLib/IpIoLib 2017-08-23 09:17:28 +08:00
FileExplorerLib MdeModulePkg: Update Ppi/Protocol/Guid usage in INF files 2017-10-10 18:10:25 +08:00
FmpAuthenticationLibNull MdeModulePkg/FmpAuthenticationLibNull: Add NULL instance FMP. 2016-11-08 22:36:55 +08:00
FrameBufferBltLib MdeModulePkg/FrameBufferBltLib: Use dynamic allocated line buffer 2017-01-24 15:06:39 +08:00
LockBoxNullLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
LzmaCustomDecompressLib MdeModulePkg: Fix MSFT C4255 warning 2017-11-14 18:18:43 +08:00
NonDiscoverableDeviceRegistrationLib MdeModulePkg: Update NonDiscoverableDeviceRegistrationLib file header format 2017-07-26 09:00:25 +08:00
OemHookStatusCodeLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PciHostBridgeLibNull MdeModulePkg/PciHostBridgeLib: Correct the function header comments 2016-03-03 18:24:25 +01:00
PeiCrc32GuidedSectionExtractLib MdeModulePkg: Update modules to consume CalculateCrc32() 2017-10-10 18:10:16 +08:00
PeiDebugPrintHobLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PeiDxeDebugLibReportStatusCode MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PeiIpmiLibIpmiPpi MdeModulePkg: Add the missing Library uni files of Ipmi instances 2015-12-24 02:28:45 +00:00
PeiPerformanceLib MdeModulePkg: Update PerformanceLib instances not to check Identifier. 2016-04-11 16:20:28 +08:00
PeiRecoveryLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PeiReportStatusCodeLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PeiS3LibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PiDxeS3BootScriptLib MdeModulePkg: Update PiDxeS3BootScriptLib Internal function name 2017-09-13 15:02:08 +08:00
PiSmmCoreMemoryAllocationLib MdeModulePkg PiSmmCoreMemoryAllocLib: Fix a FreePool() assertion issue 2017-08-01 17:44:02 +08:00
PiSmmCoreSmmServicesTableLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PlatformBootManagerLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PlatformHookLibSerialPortPpi MdeModulePkg: Correct PlatformHookLibSerialPortPpi module type. 2016-04-25 13:17:05 +08:00
PlatformVarCleanupLib MdeModulePkg: Fix MSFT C4255 warning 2017-11-14 18:18:43 +08:00
RuntimeDxeReportStatusCodeLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
SmmCorePerformanceLib MdeModulePkg PerformanceLib: Fix GCC build failure caused by cfb0aba 2017-02-24 16:33:26 +08:00
SmmCorePlatformHookLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
SmmIpmiLibSmmIpmiProtocol MdeModulePkg: Add the missing Library uni files of Ipmi instances 2015-12-24 02:28:45 +00:00
SmmLockBoxLib MdeModulePkg SmmLockBoxDxeLib: Get SmmCommRegion for COMM buffer 2017-07-26 16:05:51 +08:00
SmmMemoryAllocationProfileLib MdeModulePkg: Refine casting expression result to bigger size 2017-03-06 14:33:20 +08:00
SmmPerformanceLib MdeModulePkg: Update PerformanceLib instances not to check Identifier. 2016-04-11 16:20:28 +08:00
SmmReportStatusCodeLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
SmmSmiHandlerProfileLib MdeModulePkg/SmiHandlerProfile: Add Context support in Unregister 2017-03-13 16:04:12 +08:00
TpmMeasurementLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UefiBootManagerLib MdeModulePkg/UefiBootManagerLib: Remove assertion 2017-11-22 17:50:39 +08:00
UefiHiiLib MdeModulePkg: Fix misuses of AllocateCopyPool 2017-11-08 17:13:03 +08:00
UefiHiiServicesLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UefiMemoryAllocationProfileLib MdeModulePkg: Refine casting expression result to bigger size 2017-03-06 14:33:20 +08:00
UefiSortLib MdeModulePkg: Update Ppi/Protocol/Guid usage in INF files 2017-10-10 18:10:25 +08:00
VarCheckHiiLib MdeModulePkg/VarCheckHii: Enhance VarCheckHiiLib to support bit check 2017-11-07 10:02:51 +08:00
VarCheckLib MdeModulePkg VarCheck: #### in L"Boot####" are upper case hex 2016-08-31 15:23:42 +08:00
VarCheckPcdLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
VarCheckUefiLib MdeModulePkg VarCheck: #### in L"Boot####" are upper case hex 2016-08-31 15:23:42 +08:00