summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h6
-rw-r--r--MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf1
-rw-r--r--MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c119
-rw-r--r--MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c21
-rw-r--r--MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h4
-rw-r--r--MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c15
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c10
-rw-r--r--MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c9
-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
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c8
-rw-r--r--MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c23
-rw-r--r--MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.inf1
-rw-r--r--MdeModulePkg/Universal/Variable/Pei/Variable.c1
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h33
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c2
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf2
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c18
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c53
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf4
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c28
23 files changed, 313 insertions, 83 deletions
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h
index 9cfef3d718..3caa20d9eb 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h
@@ -127,6 +127,12 @@ typedef struct {
)
//
+// ACPI HOB produced by silicon initialization code will provide the RSDP structure.
+//
+typedef struct {
+ EFI_PHYSICAL_ADDRESS Rsdp;
+} ACPI_SILICON_HOB;
+//
// Protocol Constructor functions
//
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
index be498a56cf..8d147a3a0d 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
@@ -57,6 +57,7 @@
gEfiAcpi10TableGuid ## PRODUCES ## SystemTable
gEfiAcpiTableGuid ## PRODUCES ## SystemTable
gUniversalPayloadAcpiTableGuid ## SOMETIMES_CONSUMES ## HOB
+ gAcpiTableHobGuid ## SOMETIMES_CONSUMES ## HOB
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol ## CONSUMES
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
index 45c0ae6c80..f2a7be5778 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
@@ -1948,6 +1948,107 @@ InstallAcpiTableFromHob (
}
/**
+ This function is updating the instance with RSDP and RSDT, these are steps in the constructor that will be skipped if this HOB is available.
+
+ @param AcpiTableInstance Protocol instance private data.
+ @param GuidHob GUID HOB header.
+
+ @return EFI_SUCCESS The function completed successfully.
+ @return EFI_NOT_FOUND The function doesn't find the Rsdp from AcpiSiliconHob.
+ @return EFI_ABORTED The function could not complete successfully.
+
+**/
+EFI_STATUS
+InstallAcpiTableFromAcpiSiliconHob (
+ EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance,
+ EFI_HOB_GUID_TYPE *GuidHob
+ )
+{
+ ACPI_SILICON_HOB *AcpiSiliconHob;
+ EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *SiAcpiHobRsdp;
+ EFI_ACPI_DESCRIPTION_HEADER *SiCommonAcpiTable;
+ EFI_STATUS Status;
+ UINT8 *TempBuffer;
+ UINTN NumOfTblEntries;
+
+ DEBUG ((DEBUG_INFO, "InstallAcpiTableFromAcpiSiliconHob\n"));
+ //
+ // Initial variable.
+ //
+ SiAcpiHobRsdp = NULL;
+ SiCommonAcpiTable = NULL;
+ AcpiSiliconHob = GET_GUID_HOB_DATA (GuidHob);
+ Status = EFI_SUCCESS;
+ //
+ // Got RSDP table from ACPI Silicon Hob.
+ //
+ SiAcpiHobRsdp = (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)(UINTN)(AcpiSiliconHob->Rsdp);
+ if (SiAcpiHobRsdp == NULL) {
+ DEBUG ((DEBUG_ERROR, "InstallAcpiTableFromAcpiSiliconHob: Fail to locate RSDP Acpi table!!\n"));
+ return EFI_NOT_FOUND;
+ }
+
+ DEBUG ((DEBUG_INFO, "Silicon ACPI RSDP address : 0x%lx\n", SiAcpiHobRsdp));
+ AcpiTableInstance->Rsdp3 = SiAcpiHobRsdp;
+
+ if (SiAcpiHobRsdp->RsdtAddress != 0x00000000) {
+ //
+ // Initial RSDT.
+ //
+ TempBuffer = (UINT8 *)(UINTN)(SiAcpiHobRsdp->RsdtAddress);
+ SiCommonAcpiTable = (EFI_ACPI_DESCRIPTION_HEADER *)TempBuffer;
+ AcpiTableInstance->Rsdt3 = SiCommonAcpiTable;
+
+ if (SiCommonAcpiTable->Length <= sizeof (EFI_ACPI_DESCRIPTION_HEADER)) {
+ DEBUG ((DEBUG_ERROR, "RSDT length is incorrect\n"));
+ return EFI_ABORTED;
+ }
+
+ //
+ // Calcaue 32bit Acpi table number.
+ //
+ NumOfTblEntries = (SiCommonAcpiTable->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / sizeof (UINT32);
+ AcpiTableInstance->NumberOfTableEntries1 = NumOfTblEntries;
+ DEBUG ((DEBUG_INFO, "32bit NumOfTblEntries : 0x%x\n", NumOfTblEntries));
+ //
+ // Enlarge the max table number from mEfiAcpiMaxNumTables to current ACPI tables + EFI_ACPI_MAX_NUM_TABLES
+ //
+ if (AcpiTableInstance->NumberOfTableEntries1 >= EFI_ACPI_MAX_NUM_TABLES) {
+ mEfiAcpiMaxNumTables = AcpiTableInstance->NumberOfTableEntries1 + EFI_ACPI_MAX_NUM_TABLES;
+ DEBUG ((DEBUG_ERROR, "mEfiAcpiMaxNumTables : 0x%x\n", mEfiAcpiMaxNumTables));
+ }
+ } else {
+ //
+ // Initial XSDT.
+ //
+ TempBuffer = (UINT8 *)(UINTN)(SiAcpiHobRsdp->XsdtAddress);
+ SiCommonAcpiTable = (EFI_ACPI_DESCRIPTION_HEADER *)TempBuffer;
+ AcpiTableInstance->Xsdt = SiCommonAcpiTable;
+
+ if (SiCommonAcpiTable->Length <= sizeof (EFI_ACPI_DESCRIPTION_HEADER)) {
+ DEBUG ((DEBUG_ERROR, "XSDT length is incorrect\n"));
+ return EFI_ABORTED;
+ }
+
+ //
+ // Calcaue 64bit Acpi table number.
+ //
+ NumOfTblEntries = (SiCommonAcpiTable->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / sizeof (UINT64);
+ AcpiTableInstance->NumberOfTableEntries3 = NumOfTblEntries;
+ DEBUG ((DEBUG_ERROR, "64bit NumOfTblEntries : 0x%x\n", NumOfTblEntries));
+ //
+ // Enlarge the max table number from mEfiAcpiMaxNumTables to current ACPI tables + EFI_ACPI_MAX_NUM_TABLES
+ //
+ if (AcpiTableInstance->NumberOfTableEntries3 >= EFI_ACPI_MAX_NUM_TABLES) {
+ mEfiAcpiMaxNumTables = AcpiTableInstance->NumberOfTableEntries3 + EFI_ACPI_MAX_NUM_TABLES;
+ DEBUG ((DEBUG_ERROR, "mEfiAcpiMaxNumTables : 0x%x\n", mEfiAcpiMaxNumTables));
+ }
+ }
+
+ return Status;
+}
+
+/**
Constructor for the ACPI table protocol. Initializes instance
data.
@@ -1969,6 +2070,7 @@ AcpiTableAcpiTableConstructor (
UINT8 *Pointer;
EFI_PHYSICAL_ADDRESS PageAddress;
EFI_MEMORY_TYPE AcpiAllocateMemoryType;
+ EFI_HOB_GUID_TYPE *GuidHob;
//
// Check for invalid input parameters
@@ -1996,6 +2098,23 @@ AcpiTableAcpiTableConstructor (
}
//
+ // Check Silicon ACPI Hob.
+ //
+ GuidHob = GetFirstGuidHob (&gAcpiTableHobGuid);
+ if (GuidHob != NULL) {
+ Status = InstallAcpiTableFromAcpiSiliconHob (AcpiTableInstance, GuidHob);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((DEBUG_INFO, "Installed ACPI Table from AcpiSiliconHob.\n"));
+ return EFI_SUCCESS;
+ } else {
+ DEBUG ((DEBUG_ERROR, "Fail to Installed ACPI Table from AcpiSiliconHob!!\n"));
+ ASSERT (Status != EFI_SUCCESS);
+ }
+ } else {
+ DEBUG ((DEBUG_INFO, "Fail to locate AcpiSiliconHob!!\n"));
+ }
+
+ //
// Create RSDP table
//
RsdpTableSize = sizeof (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
diff --git a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
index 700ea9d5c0..a7f0225f30 100644
--- a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
+++ b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
@@ -27,6 +27,15 @@ EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextOutDriverBinding = {
NULL
};
+//
+// Values from Usb Inteface Association Descriptor Device
+// Class Code and Usage Model specification (iadclasscode_r10.pdf)
+// from Usb.org
+//
+#define USB_BASE_CLASS_MISCELLANEOUS 0xEF
+#define USB_MISCELLANEOUS_SUBCLASS_COMMON 0x02
+#define USB_MISCELLANEOUS_PROTOCOL_IAD 0x01
+
/**
Entrypoint of this module.
@@ -808,10 +817,16 @@ MatchUsbClass (
DeviceClass = DevDesc.DeviceClass;
DeviceSubClass = DevDesc.DeviceSubClass;
DeviceProtocol = DevDesc.DeviceProtocol;
- if (DeviceClass == 0) {
+
+ if ((DeviceClass == 0) ||
+ ((DeviceClass == USB_BASE_CLASS_MISCELLANEOUS) &&
+ (DeviceSubClass == USB_MISCELLANEOUS_SUBCLASS_COMMON) &&
+ (DeviceProtocol == USB_MISCELLANEOUS_PROTOCOL_IAD)))
+ {
//
- // If Class in Device Descriptor is set to 0, use the Class, SubClass and
- // Protocol in Interface Descriptor instead.
+ // If Class in Device Descriptor is set to 0 (Device), or
+ // Class/SubClass/Protocol is 0xEF/0x02/0x01 (IAD), use the Class, SubClass
+ // and Protocol in Interface Descriptor instead.
//
Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc);
if (EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
index 7581cda18b..61fbd808ae 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
@@ -1216,8 +1216,8 @@ AnsiRawDataToUnicode (
Putty function key map:
+=========+======+===========+=============+=============+=============+=========+
| | EFI | | | | | |
- | | Scan | | | Normal | | |
- | KEY | Code | VT100+ | Xterm R6 | VT400 | Linux | SCO |
+ | | Scan | VT100+ | | Normal | | |
+ | KEY | Code | VTUTF8 | Xterm R6 | VT400 | Linux | SCO |
+=========+======+===========+=============+=============+=============+=========+
| F1 | 0x0B | ESC O P | ESC O P | ESC [ 1 1 ~ | ESC [ [ A | ESC [ M |
| F2 | 0x0C | ESC O Q | ESC O Q | ESC [ 1 2 ~ | ESC [ [ B | ESC [ N |
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index aafa65f44c..dd31347402 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -95,6 +95,10 @@ TerminalConInReset (
);
}
+ if (!EFI_ERROR (Status)) {
+ Status = TerminalDevice->SerialIo->SetControl (TerminalDevice->SerialIo, EFI_SERIAL_DATA_TERMINAL_READY|EFI_SERIAL_REQUEST_TO_SEND);
+ }
+
return Status;
}
@@ -1313,8 +1317,8 @@ UnicodeToEfiKeyFlushState (
Putty function key map:
+=========+======+===========+=============+=============+=============+=========+
| | EFI | | | | | |
- | | Scan | | | Normal | | |
- | KEY | Code | VT100+ | Xterm R6 | VT400 | Linux | SCO |
+ | | Scan | VT100+ | | Normal | | |
+ | KEY | Code | VTUTF8 | Xterm R6 | VT400 | Linux | SCO |
+=========+======+===========+=============+=============+=============+=========+
| F1 | 0x0B | ESC O P | ESC O P | ESC [ 1 1 ~ | ESC [ [ A | ESC [ M |
| F2 | 0x0C | ESC O Q | ESC O Q | ESC [ 1 2 ~ | ESC [ [ B | ESC [ N |
@@ -1391,7 +1395,8 @@ UnicodeToEfiKey (
if ((UnicodeChar == 'O') && ((TerminalDevice->TerminalType == TerminalTypeVt100) ||
(TerminalDevice->TerminalType == TerminalTypeTtyTerm) ||
(TerminalDevice->TerminalType == TerminalTypeXtermR6) ||
- (TerminalDevice->TerminalType == TerminalTypeVt100Plus)))
+ (TerminalDevice->TerminalType == TerminalTypeVt100Plus) ||
+ (TerminalDevice->TerminalType == TerminalTypeVtUtf8)))
{
TerminalDevice->InputState |= INPUT_STATE_O;
TerminalDevice->ResetState = RESET_STATE_DEFAULT;
@@ -1565,7 +1570,9 @@ UnicodeToEfiKey (
Key.ScanCode = SCAN_END;
break;
}
- } else if (TerminalDevice->TerminalType == TerminalTypeVt100Plus) {
+ } else if ((TerminalDevice->TerminalType == TerminalTypeVt100Plus) ||
+ (TerminalDevice->TerminalType == TerminalTypeVtUtf8))
+ {
switch (UnicodeChar) {
case 'P':
Key.ScanCode = SCAN_F1;
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
index 38af39f41e..54b634afe3 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
@@ -846,7 +846,8 @@ DiskIo2ReadWriteDisk (
LIST_ENTRY Subtasks;
DISK_IO_SUBTASK *Subtask;
DISK_IO2_TASK *Task;
- EFI_TPL OldTpl;
+ EFI_TPL SubtaskPerformTpl;
+ EFI_TPL SubtaskLockTpl;
BOOLEAN Blocking;
BOOLEAN SubtaskBlocking;
LIST_ENTRY *SubtasksPtr;
@@ -896,7 +897,7 @@ DiskIo2ReadWriteDisk (
ASSERT (!IsListEmpty (SubtasksPtr));
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+ SubtaskPerformTpl = gBS->RaiseTPL (TPL_CALLBACK);
for ( Link = GetFirstNode (SubtasksPtr), NextLink = GetNextNode (SubtasksPtr, Link)
; !IsNull (SubtasksPtr, Link)
; Link = NextLink, NextLink = GetNextNode (SubtasksPtr, NextLink)
@@ -977,7 +978,7 @@ DiskIo2ReadWriteDisk (
}
}
- gBS->RaiseTPL (TPL_NOTIFY);
+ SubtaskLockTpl = gBS->RaiseTPL (TPL_NOTIFY);
//
// Remove all the remaining subtasks when failure.
@@ -1012,7 +1013,8 @@ DiskIo2ReadWriteDisk (
FreePool (Task);
}
- gBS->RestoreTPL (OldTpl);
+ gBS->RestoreTPL (SubtaskLockTpl);
+ gBS->RestoreTPL (SubtaskPerformTpl);
return Status;
}
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
index 60cf3c8c4a..2dac121c47 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
@@ -404,7 +404,8 @@ HiiCreateRamDisk (
);
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
- return EFI_DEVICE_ERROR;
+ Status = EFI_DEVICE_ERROR;
+ goto ErrorExit;
}
}
@@ -431,7 +432,7 @@ HiiCreateRamDisk (
);
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
- return Status;
+ goto ErrorExit;
}
//
@@ -442,6 +443,10 @@ HiiCreateRamDisk (
PrivateData->CreateMethod = RamDiskCreateHii;
return EFI_SUCCESS;
+
+ErrorExit:
+ gBS->FreePool (StartingAddr);
+ return Status;
}
/**
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
)
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
index 508184f7a0..d442ccb52f 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
@@ -810,12 +810,18 @@ FtwGetLastWriteHeader (
FtwHeader = (EFI_FAULT_TOLERANT_WRITE_HEADER *)(FtwWorkSpaceHeader + 1);
Offset = sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER);
+ if (!CompareGuid (&FtwWorkSpaceHeader->Signature, &gEdkiiWorkingBlockSignatureGuid)) {
+ *FtwWriteHeader = FtwHeader;
+ return EFI_ABORTED;
+ }
+
while (FtwHeader->Complete == FTW_VALID_STATE) {
Offset += FTW_WRITE_TOTAL_SIZE (FtwHeader->NumberOfWrites, FtwHeader->PrivateDataSize);
//
// If Offset exceed the FTW work space boudary, return error.
//
- if (Offset >= FtwWorkSpaceSize) {
+
+ if ((Offset + sizeof (EFI_FAULT_TOLERANT_WRITE_HEADER)) >= FtwWorkSpaceSize) {
*FtwWriteHeader = FtwHeader;
return EFI_ABORTED;
}
diff --git a/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c b/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c
index 663cfff965..a47311c3b1 100644
--- a/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c
+++ b/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.c
@@ -19,7 +19,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
+#include <Library/HobLib.h>
#include <Library/UefiLib.h>
+#include <Guid/MmCommBuffer.h>
#include <Guid/PiSmmCommunicationRegionTable.h>
#define DEFAULT_COMMON_PI_SMM_COMMUNIATION_REGION_PAGES 4
@@ -44,8 +46,11 @@ SmmCommunicationBufferEntryPoint (
UINT32 DescriptorSize;
EDKII_PI_SMM_COMMUNICATION_REGION_TABLE *PiSmmCommunicationRegionTable;
EFI_MEMORY_DESCRIPTOR *Entry;
+ EFI_HOB_GUID_TYPE *GuidHob;
+ MM_COMM_BUFFER *MmCommBuffer;
DescriptorSize = sizeof (EFI_MEMORY_DESCRIPTOR);
+
//
// Make sure Size != sizeof(EFI_MEMORY_DESCRIPTOR). This will
// prevent people from having pointer math bugs in their code.
@@ -65,11 +70,21 @@ SmmCommunicationBufferEntryPoint (
PiSmmCommunicationRegionTable->DescriptorSize = DescriptorSize;
Entry = (EFI_MEMORY_DESCRIPTOR *)(PiSmmCommunicationRegionTable + 1);
Entry->Type = EfiConventionalMemory;
- Entry->PhysicalStart = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateReservedPages (DEFAULT_COMMON_PI_SMM_COMMUNIATION_REGION_PAGES);
+
+ GuidHob = GetFirstGuidHob (&gMmCommBufferHobGuid);
+
+ if (GuidHob == NULL) {
+ Entry->PhysicalStart = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateReservedPages (DEFAULT_COMMON_PI_SMM_COMMUNIATION_REGION_PAGES);
+ Entry->NumberOfPages = DEFAULT_COMMON_PI_SMM_COMMUNIATION_REGION_PAGES;
+ } else {
+ MmCommBuffer = GET_GUID_HOB_DATA (GuidHob);
+ Entry->PhysicalStart = MmCommBuffer->PhysicalStart;
+ Entry->NumberOfPages = MmCommBuffer->NumberOfPages;
+ }
+
ASSERT (Entry->PhysicalStart != 0);
- Entry->VirtualStart = 0;
- Entry->NumberOfPages = DEFAULT_COMMON_PI_SMM_COMMUNIATION_REGION_PAGES;
- Entry->Attribute = 0;
+ Entry->VirtualStart = 0;
+ Entry->Attribute = 0;
DEBUG ((DEBUG_INFO, "PiSmmCommunicationRegionTable:(0x%x)\n", PiSmmCommunicationRegionTable));
DEBUG ((DEBUG_INFO, " Version - 0x%x\n", PiSmmCommunicationRegionTable->Version));
diff --git a/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.inf b/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.inf
index 5c867ba1de..1c9bbdc136 100644
--- a/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.inf
+++ b/MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.inf
@@ -47,6 +47,7 @@
[Guids]
gEdkiiPiSmmCommunicationRegionTableGuid ## PRODUCES ## SystemTable
+ gMmCommBufferHobGuid ## CONSUMES
[Depex]
TRUE
diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c b/MdeModulePkg/Universal/Variable/Pei/Variable.c
index 26f95c6d95..9f3d43486c 100644
--- a/MdeModulePkg/Universal/Variable/Pei/Variable.c
+++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c
@@ -1336,6 +1336,7 @@ CalculateHobVariableCacheSize (
VARIABLE_STORE_HEADER *VariableStoreHeader;
VariableStoreHeader = NULL;
+ ZeroMem (&StoreInfo, sizeof (VARIABLE_STORE_INFO));
GetHobVariableStore (&StoreInfo, &VariableStoreHeader);
if (VariableStoreHeader == NULL) {
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h b/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h
index 065c75a642..969a4f7e9d 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h
@@ -7,7 +7,7 @@
vs. non-privileged driver code.
Copyright (c) 2017, Red Hat, Inc.<BR>
- 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
**/
@@ -123,6 +123,21 @@ MmVariableServiceInitialize (
);
/**
+ This function checks if the Primary Buffer (CommBuffer) 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.
+ @retval FALSE This buffer is not valid.
+**/
+BOOLEAN
+VariableSmmIsPrimaryBufferValid (
+ IN EFI_PHYSICAL_ADDRESS Buffer,
+ IN UINT64 Length
+ );
+
+/**
This function checks if the buffer is valid per processor architecture and
does not overlap with SMRAM.
@@ -135,23 +150,19 @@ MmVariableServiceInitialize (
with SMRAM.
**/
BOOLEAN
-VariableSmmIsBufferOutsideSmmValid (
+VariableSmmIsNonPrimaryBufferValid (
IN EFI_PHYSICAL_ADDRESS Buffer,
IN UINT64 Length
);
/**
- Whether the TCG or TCG2 protocols are installed in the UEFI protocol database.
- This information is used by the MorLock code to infer whether an existing
- MOR variable is legitimate or not.
-
- @retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI
- protocol database
- @retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI
- protocol database
+ Whether the MOR variable is legitimate or not.
+
+ @retval TRUE MOR Variable is legitimate.
+ @retval FALSE MOR Variable in not legitimate.
**/
BOOLEAN
-VariableHaveTcgProtocols (
+VariableIsMorVariableLegitimate (
VOID
);
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c
index 28e8cc55d9..7f8b2a7776 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c
@@ -475,7 +475,7 @@ MorLockInitAtEndOfDxe (
// can be deduced from the absence of the TCG / TCG2 protocols, as edk2's
// MOR implementation depends on (one of) those protocols.
//
- if (VariableHaveTcgProtocols ()) {
+ if (VariableIsMorVariableLegitimate ()) {
//
// The MOR variable originates from the platform firmware; set the MOR
// Control Lock variable to report the locking capability to the OS.
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
index f90ec70b77..b5e8bf6067 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
@@ -84,7 +84,7 @@
gEfiVariableWriteArchProtocolGuid ## PRODUCES
gEfiVariableArchProtocolGuid ## PRODUCES
gEdkiiVariableLockProtocolGuid ## PRODUCES
- gEdkiiVariablePolicyProtocolGuid ## CONSUMES
+ gEdkiiVariablePolicyProtocolGuid ## PRODUCES
gEdkiiVarCheckProtocolGuid ## PRODUCES
[Guids]
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
index 5253c328dc..12b76a9746 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
@@ -14,7 +14,7 @@
VariableServiceSetVariable(), VariableServiceQueryVariableInfo(), ReclaimForOS(),
SmmVariableGetStatistics() should also do validation based on its own knowledge.
-Copyright (c) 2010 - 2019, 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
@@ -497,8 +497,8 @@ SmmVariableHandler (
return EFI_SUCCESS;
}
- if (!VariableSmmIsBufferOutsideSmmValid ((UINTN)CommBuffer, TempCommBufferSize)) {
- DEBUG ((DEBUG_ERROR, "SmmVariableHandler: SMM communication buffer in SMRAM or overflow!\n"));
+ if (!VariableSmmIsPrimaryBufferValid ((UINTN)CommBuffer, TempCommBufferSize)) {
+ DEBUG ((DEBUG_ERROR, "SmmVariableHandler: SMM Primary Buffer (CommBuffer) is not valid!\n"));
return EFI_SUCCESS;
}
@@ -864,7 +864,7 @@ SmmVariableHandler (
// Verify runtime buffers do not overlap with SMRAM ranges.
//
if ((RuntimeVariableCacheContext->RuntimeHobCache != NULL) &&
- !VariableSmmIsBufferOutsideSmmValid (
+ !VariableSmmIsNonPrimaryBufferValid (
(UINTN)RuntimeVariableCacheContext->RuntimeHobCache,
(UINTN)RuntimeVariableCacheContext->RuntimeHobCache->Size
))
@@ -874,7 +874,7 @@ SmmVariableHandler (
goto EXIT;
}
- if (!VariableSmmIsBufferOutsideSmmValid (
+ if (!VariableSmmIsNonPrimaryBufferValid (
(UINTN)RuntimeVariableCacheContext->RuntimeVolatileCache,
(UINTN)RuntimeVariableCacheContext->RuntimeVolatileCache->Size
))
@@ -884,7 +884,7 @@ SmmVariableHandler (
goto EXIT;
}
- if (!VariableSmmIsBufferOutsideSmmValid (
+ if (!VariableSmmIsNonPrimaryBufferValid (
(UINTN)RuntimeVariableCacheContext->RuntimeNvCache,
(UINTN)RuntimeVariableCacheContext->RuntimeNvCache->Size
))
@@ -894,7 +894,7 @@ SmmVariableHandler (
goto EXIT;
}
- if (!VariableSmmIsBufferOutsideSmmValid (
+ if (!VariableSmmIsNonPrimaryBufferValid (
(UINTN)RuntimeVariableCacheContext->PendingUpdate,
sizeof (*(RuntimeVariableCacheContext->PendingUpdate))
))
@@ -904,7 +904,7 @@ SmmVariableHandler (
goto EXIT;
}
- if (!VariableSmmIsBufferOutsideSmmValid (
+ if (!VariableSmmIsNonPrimaryBufferValid (
(UINTN)RuntimeVariableCacheContext->ReadLock,
sizeof (*(RuntimeVariableCacheContext->ReadLock))
))
@@ -914,7 +914,7 @@ SmmVariableHandler (
goto EXIT;
}
- if (!VariableSmmIsBufferOutsideSmmValid (
+ if (!VariableSmmIsNonPrimaryBufferValid (
(UINTN)RuntimeVariableCacheContext->HobFlushComplete,
sizeof (*(RuntimeVariableCacheContext->HobFlushComplete))
))
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c
index 943993eb67..10578226c6 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c
@@ -2,15 +2,35 @@
Parts of the SMM/MM implementation that are specific to standalone 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
**/
+#include <Library/MmServicesTableLib.h>
+#include <Library/StandaloneMmMemLib.h>
#include "Variable.h"
/**
+ This function checks if the Primary Buffer (CommBuffer) 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.
+ @retval FALSE This buffer is not valid.
+**/
+BOOLEAN
+VariableSmmIsPrimaryBufferValid (
+ IN EFI_PHYSICAL_ADDRESS Buffer,
+ IN UINT64 Length
+ )
+{
+ return TRUE;
+}
+
+/**
This function checks if the buffer is valid per processor architecture and
does not overlap with SMRAM.
@@ -23,12 +43,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
with SMRAM.
**/
BOOLEAN
-VariableSmmIsBufferOutsideSmmValid (
+VariableSmmIsNonPrimaryBufferValid (
IN EFI_PHYSICAL_ADDRESS Buffer,
IN UINT64 Length
)
{
- return TRUE;
+ return MmIsBufferOutsideMmValid (Buffer, Length);
}
/**
@@ -49,6 +69,17 @@ VariableNotifySmmWriteReady (
VOID
)
{
+ EFI_STATUS Status;
+ EFI_HANDLE Handle;
+
+ Handle = NULL;
+ Status = gMmst->MmInstallProtocolInterface (
+ &Handle,
+ &gSmmVariableWriteGuid,
+ EFI_NATIVE_INTERFACE,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
}
/**
@@ -71,19 +102,15 @@ VariableServiceInitialize (
}
/**
- Whether the TCG or TCG2 protocols are installed in the UEFI protocol database.
- This information is used by the MorLock code to infer whether an existing
- MOR variable is legitimate or not.
-
- @retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI
- protocol database
- @retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI
- protocol database
+ Whether the MOR variable is legitimate or not.
+
+ @retval TRUE MOR Variable is legitimate.
+ @retval FALSE MOR Variable in not legitimate.
**/
BOOLEAN
-VariableHaveTcgProtocols (
+VariableIsMorVariableLegitimate (
VOID
)
{
- return FALSE;
+ return TRUE;
}
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
index f09bed40cf..2d651c3c3d 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
@@ -18,7 +18,7 @@
# may not be modified without authorization. If platform fails to protect these resources,
# the authentication service provided in this driver will be broken, and the behavior is undefined.
#
-# Copyright (c) 2010 - 2019, 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>
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -71,6 +71,7 @@
BaseMemoryLib
DebugLib
HobLib
+ MemLib
MemoryAllocationLib
MmServicesTableLib
SafeIntLib
@@ -114,6 +115,7 @@
gEfiMemoryOverwriteControlDataGuid ## SOMETIMES_CONSUMES ## Variable:L"MemoryOverwriteRequestControl"
gEfiMemoryOverwriteRequestControlLockGuid ## SOMETIMES_PRODUCES ## Variable:L"MemoryOverwriteRequestControlLock"
+ gSmmVariableWriteGuid ## PRODUCES ## GUID # Install protocol
gEfiSystemNvDataFvGuid ## CONSUMES ## GUID
gEdkiiFaultTolerantWriteGuid ## SOMETIMES_CONSUMES ## HOB
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c
index 0369c3cd01..cd82bb5675 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.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
@@ -13,6 +13,24 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "Variable.h"
/**
+ This function checks if the Primary Buffer (CommBuffer) 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.
+ @retval FALSE This buffer is not valid.
+**/
+BOOLEAN
+VariableSmmIsPrimaryBufferValid (
+ IN EFI_PHYSICAL_ADDRESS Buffer,
+ IN UINT64 Length
+ )
+{
+ return SmmIsBufferOutsideSmmValid (Buffer, Length);
+}
+
+/**
This function checks if the buffer is valid per processor architecture and
does not overlap with SMRAM.
@@ -25,7 +43,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
with SMRAM.
**/
BOOLEAN
-VariableSmmIsBufferOutsideSmmValid (
+VariableSmmIsNonPrimaryBufferValid (
IN EFI_PHYSICAL_ADDRESS Buffer,
IN UINT64 Length
)
@@ -100,12 +118,12 @@ VariableServiceInitialize (
MOR variable is legitimate or not.
@retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI
- protocol database
+ protocol database. MOR variable is legitimate.
@retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI
- protocol database
+ protocol database. MOR variable is not legitimate.
**/
BOOLEAN
-VariableHaveTcgProtocols (
+VariableIsMorVariableLegitimate (
VOID
)
{