From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 96DBC211A2DAC for ; Thu, 20 Dec 2018 19:11:16 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2018 19:11:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,379,1539673200"; d="scan'208";a="102333248" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.9]) by orsmga006.jf.intel.com with ESMTP; 20 Dec 2018 19:11:14 -0800 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Ard Biesheuvel , Jiewen Yao , Liming Gao , Jian J Wang Date: Fri, 21 Dec 2018 11:11:04 +0800 Message-Id: <20181221031106.12960-4-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20181221031106.12960-1-hao.a.wu@intel.com> References: <20181221031106.12960-1-hao.a.wu@intel.com> Subject: [PATCH v1 3/5] MdeModulePkg/SmmLockBox: Update to consume SpeculationBarrier X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 03:11:16 -0000 REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1417 Since BaseLib API AsmLfence() is a x86 arch specific API and should be avoided using in generic codes, this commit replaces the usage of AsmLfence() with arch-generic API SpeculationBarrier(). Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Liming Gao Cc: Jian J Wang Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu --- MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c index c1c9aa5663..a743129539 100644 --- a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c +++ b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c @@ -77,10 +77,10 @@ SmmLockBoxSave ( return ; } // - // The AsmLfence() call here is to ensure the above range check for the - // CommBuffer have been completed before calling into SaveLockBox(). + // The SpeculationBarrier() call here is to ensure the above range check for + // the CommBuffer have been completed before calling into SaveLockBox(). // - AsmLfence (); + SpeculationBarrier (); // // Save data @@ -166,10 +166,10 @@ SmmLockBoxUpdate ( return ; } // - // The AsmLfence() call here is to ensure the above range check for the - // CommBuffer have been completed before calling into UpdateLockBox(). + // The SpeculationBarrier() call here is to ensure the above range check for + // the CommBuffer have been completed before calling into UpdateLockBox(). // - AsmLfence (); + SpeculationBarrier (); // // Update data -- 2.12.0.windows.1