VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X86SpeculationBarrier.c@ 89916

Last change on this file since 89916 was 80721, checked in by vboxsync, 6 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • Property svn:eol-style set to native
File size: 618 bytes
Line 
1/** @file
2 SpeculationBarrier() function for IA32 and x64.
3
4 Copyright (C) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10#include <Library/BaseLib.h>
11
12/**
13 Uses as a barrier to stop speculative execution.
14
15 Ensures that no later instruction will execute speculatively, until all prior
16 instructions have completed.
17
18**/
19VOID
20EFIAPI
21SpeculationBarrier (
22 VOID
23 )
24{
25 if (PcdGet8 (PcdSpeculationBarrierType) == 0x01) {
26 AsmLfence ();
27 } else if (PcdGet8 (PcdSpeculationBarrierType) == 0x02) {
28 AsmCpuid (0x01, NULL, NULL, NULL, NULL);
29 }
30}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette