public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
To: edk2-devel@lists.01.org, liming.gao@intel.com,
	chao.b.zhang@intel.com, lersek@readhat.com,
	leif.lindholm@linaro.org, ard.biesheuvel@linaro.org
Subject: [RFC PATCH v2 01/11] MdeModulePkg/Variable: replace all uses of AsmLfence with MemoryFence
Date: Tue, 27 Nov 2018 16:56:16 +0530	[thread overview]
Message-ID: <20181127112626.7854-2-jagadeesh.ujja@arm.com> (raw)
In-Reply-To: <20181127112626.7854-1-jagadeesh.ujja@arm.com>

Replace all uses of AsmLfence with call to MemoryFence to allow
variable service code to be platform independent.

Change-Id: I578719ab038318bd240ec5471d42552c8b7c75db
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
---
 .../Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c   | 4 ++--
 MdeModulePkg/Universal/Variable/RuntimeDxe/LoadFenceSmm.c     | 2 +-
 MdePkg/Library/BaseLib/X86MemoryFence.c                       | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c
index 27fcab19b6..fabd713c74 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c
@@ -419,11 +419,11 @@ SmmFaultTolerantWriteHandler (
                  );
       if (!EFI_ERROR (Status)) {
         //
-        // The AsmLfence() call here is to ensure the previous range/content
+        // The MemoryFence () call here is to ensure the previous range/content
         // checks for the CommBuffer have been completed before calling into
         // FtwWrite().
         //
-        AsmLfence ();
+        MemoryFence ();
         Status = FtwWrite(
                    &mFtwDevice->FtwInstance,
                    SmmFtwWriteHeader->Lba,
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/LoadFenceSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/LoadFenceSmm.c
index 4b0d7e3e95..7c4b01924e 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/LoadFenceSmm.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/LoadFenceSmm.c
@@ -26,5 +26,5 @@ MemoryLoadFence (
   VOID
   )
 {
-  AsmLfence ();
+  MemoryFence ();
 }
diff --git a/MdePkg/Library/BaseLib/X86MemoryFence.c b/MdePkg/Library/BaseLib/X86MemoryFence.c
index 77e1c5a4dd..3a7928df9b 100644
--- a/MdePkg/Library/BaseLib/X86MemoryFence.c
+++ b/MdePkg/Library/BaseLib/X86MemoryFence.c
@@ -28,5 +28,5 @@ MemoryFence (
   VOID
   )
 {
-  return;
+  AsmLfence ();
 }
-- 
2.19.1



  reply	other threads:[~2018-11-27 11:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 11:26 [RFC PATCH v2 00/11] Extend secure variable service to be usable from Standalone MM Jagadeesh Ujja
2018-11-27 11:26 ` Jagadeesh Ujja [this message]
2018-11-27 11:26 ` [RFC PATCH v2 02/11] StandaloneMmPkg: Pull in additonal libraries from staging branch Jagadeesh Ujja
2018-11-27 11:26 ` [RFC PATCH v2 03/11] MdeModulePkg/Library: Add StandaloneMmRuntimeDxe library Jagadeesh Ujja
2018-11-27 11:26 ` [RFC PATCH v2 04/11] ArmPlatformPkg/NorFlashDxe: allow reusability as a MM driver Jagadeesh Ujja
2018-11-27 11:52   ` Leif Lindholm
2018-11-27 11:26 ` [RFC PATCH v2 05/11] MdeModulePkg/FaultTolerantWriteDxe: " Jagadeesh Ujja
2018-11-27 11:26 ` [RFC PATCH v2 06/11] MdeModulePkg/Variable/RuntimeDxe: adapt for usability with MM Standalone Jagadeesh Ujja
2018-11-27 11:26 ` [RFC PATCH v2 07/11] MdeModulePkg/Variable/RuntimeDxe: adapt as a MM Standalone driver Jagadeesh Ujja
2018-11-27 11:26 ` [RFC PATCH v2 08/11] SecurityPkg/AuthVariableLib: allow MM_STANDALONE drivers to use this library Jagadeesh Ujja
2018-11-27 11:26 ` [RFC PATCH v2 09/11] MdeModulePkg/VarCheckLib: " Jagadeesh Ujja
2018-11-27 11:26 ` [RFC PATCH v2 10/11] CryptoPkg/BaseCryptLib: " Jagadeesh Ujja
2018-11-27 11:26 ` [RFC PATCH v2 11/11] CryptoPkg/BaseCryptLib: Hack to get time in MM Standalone mode Jagadeesh Ujja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181127112626.7854-2-jagadeesh.ujja@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox