summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2024-05-31 13:02:39 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-07 08:40:03 +0000
commit67d3be644f9361c678f3b21a6f0b91ad8fda0383 (patch)
treeddd31d2f298c7524a17fcf80b784b47ad7910258 /MdeModulePkg
parent26bc42f1e34cdf43057a75b8edcc0bd86c091214 (diff)
downloadedk2-67d3be644f9361c678f3b21a6f0b91ad8fda0383.tar.gz
edk2-67d3be644f9361c678f3b21a6f0b91ad8fda0383.tar.bz2
edk2-67d3be644f9361c678f3b21a6f0b91ad8fda0383.zip
MdeModulePkg/FaultTolerantWriteSmm: Update buffer valid check func name
In the MdeModulePkg/FaultTolerantWriteSmm, the Primary Buffer (CommBuffer) check function has been updated to match the buffer validation behavior: For SMM, the SMM Handlers is to validate the buffer outside MMRAM. For MM, the MM Handlers do not need to validate the buffer if it is the CommBuffer passed from MmCore through the MmiHandler() parameter. Return TRUE directly in this case. There is no function impact. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c6
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h13
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c13
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c6
4 files changed, 16 insertions, 22 deletions
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c
index 8c2d209fa0..676f46ded2 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c
@@ -43,7 +43,7 @@
Caution: This module requires additional review when modified.
This driver need to make sure the CommBuffer is not in the SMRAM range.
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -332,8 +332,8 @@ SmmFaultTolerantWriteHandler (
CommBufferPayloadSize = TempCommBufferSize - SMM_FTW_COMMUNICATE_HEADER_SIZE;
- if (!FtwSmmIsBufferOutsideSmmValid ((UINTN)CommBuffer, TempCommBufferSize)) {
- DEBUG ((DEBUG_ERROR, "SmmFtwHandler: SMM communication buffer in SMRAM or overflow!\n"));
+ if (!FtwSmmIsPrimaryBufferValid ((UINTN)CommBuffer, TempCommBufferSize)) {
+ DEBUG ((DEBUG_ERROR, "SmmFtwHandler: SMM Primary(communication buffer) is not valid!\n"));
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h
index f717432e15..73799d3256 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h
@@ -2,7 +2,7 @@
The common header file for SMM FTW module and SMM FTW DXE Module.
-Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved. <BR>
+Copyright (c) 2011 - 2024, Intel Corporation. All rights reserved. <BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -85,19 +85,16 @@ MmFaultTolerantWriteInitialize (
);
/**
- This function checks if the buffer is valid per processor architecture and
- does not overlap with SMRAM.
+ This function checks if the Primary Buffer is valid.
@param Buffer The buffer start address to be checked.
@param Length The buffer length to be checked.
- @retval TRUE This buffer is valid per processor architecture and does not
- overlap with SMRAM.
- @retval FALSE This buffer is not valid per processor architecture or overlaps
- with SMRAM.
+ @retval TRUE This buffer is valid.
+ @retval FALSE This buffer is not valid.
**/
BOOLEAN
-FtwSmmIsBufferOutsideSmmValid (
+FtwSmmIsPrimaryBufferValid (
IN EFI_PHYSICAL_ADDRESS Buffer,
IN UINT64 Length
);
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c
index 52922a0c53..af837f03d5 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c
@@ -2,7 +2,7 @@
Parts of the SMM/MM implementation that are specific to standalone MM
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -14,19 +14,16 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "FaultTolerantWriteSmmCommon.h"
/**
- This function checks if the buffer is valid per processor architecture and
- does not overlap with SMRAM.
+ This function checks if the Primary Buffer is valid.
@param Buffer The buffer start address to be checked.
@param Length The buffer length to be checked.
- @retval TRUE This buffer is valid per processor architecture and does not
- overlap with SMRAM.
- @retval FALSE This buffer is not valid per processor architecture or overlaps
- with SMRAM.
+ @retval TRUE This buffer is valid.
+ @retval FALSE This buffer is not valid.
**/
BOOLEAN
-FtwSmmIsBufferOutsideSmmValid (
+FtwSmmIsPrimaryBufferValid (
IN EFI_PHYSICAL_ADDRESS Buffer,
IN UINT64 Length
)
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c
index a7241e651a..d0a218490b 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c
@@ -2,7 +2,7 @@
Parts of the SMM/MM implementation that are specific to traditional MM
-Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved. <BR>
+Copyright (c) 2011 - 2024, Intel Corporation. All rights reserved. <BR>
Copyright (c) 2018, Linaro, Ltd. All rights reserved. <BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "FaultTolerantWriteSmmCommon.h"
/**
- This function checks if the buffer is valid per processor architecture and
+ This function checks if the Primary Buffer is valid per processor architecture and
does not overlap with SMRAM.
@param Buffer The buffer start address to be checked.
@@ -26,7 +26,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
with SMRAM.
**/
BOOLEAN
-FtwSmmIsBufferOutsideSmmValid (
+FtwSmmIsPrimaryBufferValid (
IN EFI_PHYSICAL_ADDRESS Buffer,
IN UINT64 Length
)