coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smm_reloc.h File Reference
#include <console/console.h>
#include <types.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mtrr.h>
Include dependency graph for smm_reloc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  smm_relocation_params
 
struct  ied_header
 

Macros

#define MSR_PRMRR_PHYS_BASE   0x1f4
 
#define MSR_PRMRR_PHYS_MASK   0x1f5
 
#define MSR_UNCORE_PRMRR_PHYS_BASE   0x2f4
 
#define MSR_UNCORE_PRMRR_PHYS_MASK   0x2f5
 

Functions

void northbridge_write_smram (u8 smram)
 
void smm_lock (void)
 
void smm_relocate (void)
 
void smm_southbridge_clear_state (void)
 
void smm_initialize (void)
 
void smm_info (uintptr_t *perm_smbase, size_t *perm_smsize, size_t *smm_save_state_size)
 
void smm_relocation_handler (int cpu, uintptr_t curr_smbase, uintptr_t staggered_smbase)
 
bool cpu_has_alternative_smrr (void)
 
static void write_smrr (struct smm_relocation_params *relo_params)
 
static void write_prmrr (struct smm_relocation_params *relo_params)
 
static void write_uncore_prmrr (struct smm_relocation_params *relo_params)
 

Variables

struct smm_relocation_params smm_reloc_params
 
struct ied_header __packed
 

Macro Definition Documentation

◆ MSR_PRMRR_PHYS_BASE

#define MSR_PRMRR_PHYS_BASE   0x1f4

Definition at line 54 of file smm_reloc.h.

◆ MSR_PRMRR_PHYS_MASK

#define MSR_PRMRR_PHYS_MASK   0x1f5

Definition at line 55 of file smm_reloc.h.

◆ MSR_UNCORE_PRMRR_PHYS_BASE

#define MSR_UNCORE_PRMRR_PHYS_BASE   0x2f4

Definition at line 56 of file smm_reloc.h.

◆ MSR_UNCORE_PRMRR_PHYS_MASK

#define MSR_UNCORE_PRMRR_PHYS_MASK   0x2f5

Definition at line 57 of file smm_reloc.h.

Function Documentation

◆ cpu_has_alternative_smrr()

bool cpu_has_alternative_smrr ( void  )

Definition at line 31 of file smmrelocate.c.

References c, cpuid_eax(), and get_fms().

Referenced by fill_in_relocation_params(), per_cpu_smm_trigger(), and smm_relocation_handler().

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

◆ northbridge_write_smram()

void northbridge_write_smram ( u8  smram)

Definition at line 27 of file memmap.c.

References PCI_DEV, pci_write_config8(), and SMRAMC.

Referenced by smm_lock().

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

◆ smm_info()

void smm_info ( uintptr_t perm_smbase,
size_t perm_smsize,
size_t smm_save_state_size 
)

◆ smm_initialize()

void smm_initialize ( void  )

Definition at line 227 of file smmrelocate.c.

References BIOS_DEBUG, printk, smm_initiate_relocation(), smm_reloc_params, smm_relocation_params::smm_save_state_in_msrs, and smm_southbridge_clear_state().

Referenced by pre_mp_smm_init().

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

◆ smm_lock()

void smm_lock ( void  )

Definition at line 261 of file smmrelocate.c.

References BIOS_DEBUG, C_BASE_SEG, D_LCK, ESMRAMC, G_SMRAME, northbridge_write_smram(), PCI_DEV, pci_or_config8(), pci_write_config8(), pcidev_on_root(), pcidev_path_on_root(), printk, SA_DEVFN_ROOT, SMRAM, SMRAMC, and T_EN.

Referenced by post_mp_init().

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

◆ smm_relocate()

void smm_relocate ( void  )

Definition at line 247 of file smmrelocate.c.

References boot_cpu(), smm_initiate_relocation(), smm_initiate_relocation_parallel(), smm_reloc_params, and smm_relocation_params::smm_save_state_in_msrs.

Referenced by per_cpu_smm_trigger().

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

◆ smm_relocation_handler()

void smm_relocation_handler ( int  cpu,
uintptr_t  curr_smbase,
uintptr_t  staggered_smbase 
)

Definition at line 90 of file smmrelocate.c.

◆ smm_southbridge_clear_state()

◆ write_prmrr()

static void write_prmrr ( struct smm_relocation_params relo_params)
inlinestatic

Definition at line 67 of file smm_reloc.h.

References BIOS_DEBUG, msr_struct::lo, MSR_PRMRR_PHYS_BASE, MSR_PRMRR_PHYS_MASK, printk, smm_relocation_params::prmrr_base, smm_relocation_params::prmrr_mask, and wrmsr().

Referenced by smm_relocation_handler().

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

◆ write_smrr()

static void write_smrr ( struct smm_relocation_params relo_params)
inlinestatic

Definition at line 59 of file smm_reloc.h.

References BIOS_DEBUG, IA32_SMRR_PHYS_BASE, IA32_SMRR_PHYS_MASK, msr_struct::lo, printk, smm_relocation_params::smrr_base, smm_relocation_params::smrr_mask, and wrmsr().

Referenced by smm_relocation_handler().

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

◆ write_uncore_prmrr()

static void write_uncore_prmrr ( struct smm_relocation_params relo_params)
inlinestatic

Definition at line 75 of file smm_reloc.h.

References BIOS_DEBUG, msr_struct::lo, MSR_UNCORE_PRMRR_PHYS_BASE, MSR_UNCORE_PRMRR_PHYS_MASK, printk, smm_relocation_params::uncore_prmrr_base, smm_relocation_params::uncore_prmrr_mask, and wrmsr().

Referenced by smm_relocation_handler().

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

Variable Documentation

◆ __packed

◆ smm_reloc_params

struct smm_relocation_params smm_reloc_params
extern