+++ /dev/null
-/** @file\r
- Serialize operation on all load-from-memory instructions (DXE version).\r
-\r
-Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "Variable.h"\r
-\r
-/**\r
- This service is consumed by the variable modules to perform a serializing\r
- operation on all load-from-memory instructions that were issued prior to the\r
- call of this function.\r
-\r
-**/\r
-VOID\r
-MemoryLoadFence (\r
- VOID\r
- )\r
-{\r
- //\r
- // Do nothing.\r
- //\r
-}\r
+++ /dev/null
-/** @file\r
- Serialize operation on all load-from-memory instructions (SMM version).\r
-\r
-Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include <Library/BaseLib.h>\r
-#include "Variable.h"\r
-\r
-/**\r
- This service is consumed by the variable modules to perform a serializing\r
- operation on all load-from-memory instructions that were issued prior to the\r
- call of this function.\r
-\r
-**/\r
-VOID\r
-MemoryLoadFence (\r
- VOID\r
- )\r
-{\r
- AsmLfence ();\r
-}\r
);\r
\r
/**\r
- This service is consumed by the variable modules to perform a serializing\r
- operation on all load-from-memory instructions that were issued prior to the\r
- call of this function.\r
+ This service is consumed by the variable modules to place a barrier to stop\r
+ speculative execution.\r
+\r
+ Ensures that no later instruction will execute speculatively, until all prior\r
+ instructions have completed.\r
\r
**/\r
VOID\r
-MemoryLoadFence (\r
+VariableSpeculationBarrier (\r
VOID\r
);\r
\r
--- /dev/null
+/** @file\r
+ Barrier to stop speculative execution (DXE version).\r
+\r
+Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "Variable.h"\r
+\r
+/**\r
+ This service is consumed by the variable modules to place a barrier to stop\r
+ speculative execution.\r
+\r
+ Ensures that no later instruction will execute speculatively, until all prior\r
+ instructions have completed.\r
+\r
+**/\r
+VOID\r
+VariableSpeculationBarrier (\r
+ VOID\r
+ )\r
+{\r
+ //\r
+ // Do nothing.\r
+ //\r
+}\r
--- /dev/null
+/** @file\r
+ Barrier to stop speculative execution (SMM version).\r
+\r
+Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <Library/BaseLib.h>\r
+#include "Variable.h"\r
+\r
+/**\r
+ This service is consumed by the variable modules to place a barrier to stop\r
+ speculative execution.\r
+\r
+ Ensures that no later instruction will execute speculatively, until all prior\r
+ instructions have completed.\r
+\r
+**/\r
+VOID\r
+VariableSpeculationBarrier (\r
+ VOID\r
+ )\r
+{\r
+ SpeculationBarrier ();\r
+}\r
return EFI_SECURITY_VIOLATION;\r
}\r
//\r
- // The MemoryLoadFence() call here is to ensure the above sanity check\r
- // for the EFI_VARIABLE_AUTHENTICATION_2 descriptor has been completed\r
+ // The VariableSpeculationBarrier() call here is to ensure the above sanity\r
+ // check for the EFI_VARIABLE_AUTHENTICATION_2 descriptor has been completed\r
// before the execution of subsequent codes.\r
//\r
- MemoryLoadFence ();\r
+ VariableSpeculationBarrier ();\r
PayloadSize = DataSize - AUTHINFO2_SIZE (Data);\r
} else {\r
PayloadSize = DataSize;\r
TcgMorLockDxe.c\r
VarCheck.c\r
VariableExLib.c\r
- LoadFenceDxe.c\r
+ SpeculationBarrierDxe.c\r
\r
[Packages]\r
MdePkg/MdePkg.dec\r
}\r
\r
//\r
- // The MemoryLoadFence() call here is to ensure the previous range/content\r
- // checks for the CommBuffer have been completed before the subsequent\r
- // consumption of the CommBuffer content.\r
+ // The VariableSpeculationBarrier() call here is to ensure the previous\r
+ // range/content checks for the CommBuffer have been completed before the\r
+ // subsequent consumption of the CommBuffer content.\r
//\r
- MemoryLoadFence ();\r
+ VariableSpeculationBarrier ();\r
if (SmmVariableHeader->NameSize < sizeof (CHAR16) || SmmVariableHeader->Name[SmmVariableHeader->NameSize/sizeof (CHAR16) - 1] != L'\0') {\r
//\r
// Make sure VariableName is A Null-terminated string.\r
}\r
\r
//\r
- // The MemoryLoadFence() call here is to ensure the previous range/content\r
- // checks for the CommBuffer have been completed before the subsequent\r
- // consumption of the CommBuffer content.\r
+ // The VariableSpeculationBarrier() call here is to ensure the previous\r
+ // range/content checks for the CommBuffer have been completed before the\r
+ // subsequent consumption of the CommBuffer content.\r
//\r
- MemoryLoadFence ();\r
+ VariableSpeculationBarrier ();\r
if (SmmVariableHeader->NameSize < sizeof (CHAR16) || SmmVariableHeader->Name[SmmVariableHeader->NameSize/sizeof (CHAR16) - 1] != L'\0') {\r
//\r
// Make sure VariableName is A Null-terminated string.\r
}\r
\r
//\r
- // The MemoryLoadFence() call here is to ensure the previous range/content\r
- // checks for the CommBuffer have been completed before the subsequent\r
- // consumption of the CommBuffer content.\r
+ // The VariableSpeculationBarrier() call here is to ensure the previous\r
+ // range/content checks for the CommBuffer have been completed before the\r
+ // subsequent consumption of the CommBuffer content.\r
//\r
- MemoryLoadFence ();\r
+ VariableSpeculationBarrier ();\r
if (CommVariableProperty->NameSize < sizeof (CHAR16) || CommVariableProperty->Name[CommVariableProperty->NameSize/sizeof (CHAR16) - 1] != L'\0') {\r
//\r
// Make sure VariableName is A Null-terminated string.\r
PrivilegePolymorphic.h\r
VariableExLib.c\r
TcgMorLockSmm.c\r
- LoadFenceSmm.c\r
+ SpeculationBarrierSmm.c\r
\r
[Packages]\r
MdePkg/MdePkg.dec\r