MdeModulePkg/Variable: Update to consume SpeculationBarrier
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(). Please note that speculation execution barriers are intended to be asserted for SMM codes, hence, this commit still preserve an empty implementation of the speculation execution barrier for the DXE codes. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
@@ -85,13 +85,15 @@ SetVariableCheckHandlerMor (
|
||||
);
|
||||
|
||||
/**
|
||||
This service is consumed by the variable modules to perform a serializing
|
||||
operation on all load-from-memory instructions that were issued prior to the
|
||||
call of this function.
|
||||
This service is consumed by the variable modules to place a barrier to stop
|
||||
speculative execution.
|
||||
|
||||
Ensures that no later instruction will execute speculatively, until all prior
|
||||
instructions have completed.
|
||||
|
||||
**/
|
||||
VOID
|
||||
MemoryLoadFence (
|
||||
VariableSpeculationBarrier (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user