mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-21 12:44:50 +02:00
MdePkg/BaseLib: Use PcdSpeculationBarrierType
Use PcdSpeculationBarrierType in the x86 implementation of SpeculationBarrier() to select between AsmLfence(), AsmCpuid(), and no operation. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Brian J. Johnson <brian.johnson@hpe.com>
This commit is contained in:
parent
a41b12574e
commit
aec7465689
@ -394,6 +394,7 @@
|
|||||||
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength ## SOMETIMES_CONSUMES
|
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength ## SOMETIMES_CONSUMES
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength ## SOMETIMES_CONSUMES
|
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength ## SOMETIMES_CONSUMES
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdControlFlowEnforcementPropertyMask ## SOMETIMES_CONSUMES
|
gEfiMdePkgTokenSpaceGuid.PcdControlFlowEnforcementPropertyMask ## SOMETIMES_CONSUMES
|
||||||
|
gEfiMdePkgTokenSpaceGuid.PcdSpeculationBarrierType ## SOMETIMES_CONSUMES
|
||||||
|
|
||||||
[FeaturePcd]
|
[FeaturePcd]
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdVerifyNodeInList ## CONSUMES
|
gEfiMdePkgTokenSpaceGuid.PcdVerifyNodeInList ## CONSUMES
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SpeculationBarrier() function for IA32 and x64.
|
SpeculationBarrier() function for IA32 and x64.
|
||||||
|
|
||||||
Copyright (C) 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (C) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@ -22,5 +22,9 @@ SpeculationBarrier (
|
|||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (PcdGet8 (PcdSpeculationBarrierType) == 0x01) {
|
||||||
AsmLfence ();
|
AsmLfence ();
|
||||||
|
} else if (PcdGet8 (PcdSpeculationBarrierType) == 0x02) {
|
||||||
|
AsmCpuid (0x01, NULL, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user