coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sgx.c File Reference
#include <console/console.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mtrr.h>
#include <cpu/intel/microcode.h>
#include <cpu/intel/common/common.h>
#include <intelblocks/cpulib.h>
#include <intelblocks/msr.h>
#include <intelblocks/sgx.h>
#include <intelblocks/systemagent.h>
#include <soc/cpu.h>
#include <soc/pci_devs.h>
Include dependency graph for sgx.c:

Go to the source code of this file.

Functions

int is_sgx_supported (void)
 
void prmrr_core_configure (void)
 
static int is_prmrr_set (void)
 
static void enable_sgx (void)
 
static void lock_sgx (void)
 
static int owner_epoch_update (void)
 
static void activate_sgx (void)
 
static int is_prmrr_approved (void)
 
void sgx_configure (void *unused)
 

Function Documentation

◆ activate_sgx()

static void activate_sgx ( void  )
static

Definition at line 144 of file sgx.c.

References BIOS_ERR, BIOS_INFO, msr_struct::lo, MSR_BIOS_UPGD_TRIG, printk, rdmsr(), SGX_ACTIVATE_BIT, and wrmsr().

Referenced by sgx_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable_sgx()

static void enable_sgx ( void  )
static

Definition at line 96 of file sgx.c.

References FEATURE_CONTROL_LOCK_BIT, IA32_FEATURE_CONTROL, msr_struct::lo, rdmsr(), SGX_GLOBAL_ENABLE, and wrmsr().

Referenced by sgx_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_prmrr_approved()

static int is_prmrr_approved ( void  )
static

Definition at line 166 of file sgx.c.

References BIOS_INFO, msr_struct::lo, MSR_PRMRR_PHYS_MASK, printk, PRMRR_PHYS_MASK_VALID, and rdmsr().

Referenced by sgx_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_prmrr_set()

static int is_prmrr_set ( void  )
static

Definition at line 82 of file sgx.c.

References msr_struct::hi, msr_struct::lo, MSR_PRMRR_PHYS_BASE, MSR_PRMRR_PHYS_MASK, PRMRR_PHYS_MASK_LOCK, and rdmsr().

Referenced by sgx_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_sgx_supported()

int is_sgx_supported ( void  )

Definition at line 15 of file sgx.c.

References cpuid_ext(), cpuid_result::ebx, MTRR_CAP_MSR, MTRR_CAP_PRMRR, rdmsr(), and SGX_SUPPORTED.

Referenced by prmrr_core_configure(), sgx_configure(), and sgx_fill_ssdt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lock_sgx()

static void lock_sgx ( void  )
static

Definition at line 114 of file sgx.c.

References IA32_FEATURE_CONTROL, msr_struct::lo, rdmsr(), and wrmsr().

Referenced by sgx_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ owner_epoch_update()

static int owner_epoch_update ( void  )
static

Definition at line 132 of file sgx.c.

References MSR_SGX_OWNEREPOCH0, MSR_SGX_OWNEREPOCH1, and wrmsr().

Referenced by sgx_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prmrr_core_configure()

void prmrr_core_configure ( void  )

Definition at line 25 of file sgx.c.

References BIOS_ERR, BIOS_INFO, intel_ht_sibling(), is_sgx_supported(), msr_struct::lo, MSR_PRMRR_PHYS_BASE, MSR_PRMRR_PHYS_MASK, MTRR_TYPE_WRBACK, printk, PRMRR_PHYS_MASK_LOCK, PRMRR_PHYS_MASK_VALID, rdmsr(), soc_get_uncore_prmmr_base_and_mask(), and wrmsr().

Referenced by soc_core_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sgx_configure()

void sgx_configure ( void unused)

Definition at line 183 of file sgx.c.

References activate_sgx(), BIOS_ERR, CONFIG, cpu_lt_lock_memory(), enable_sgx(), intel_ht_sibling(), intel_microcode_find(), intel_microcode_load_unlocked(), is_prmrr_approved(), is_prmrr_set(), is_sgx_supported(), lock_sgx(), microcode_patch, owner_epoch_update(), and printk.

Referenced by post_mp_init().

Here is the call graph for this function:
Here is the caller graph for this function: