coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smmrelocate.c File Reference
#include <console/console.h>
#include <cpu/intel/common/common.h>
#include <cpu/intel/em64t101_save_state.h>
#include <cpu/intel/smm_reloc.h>
#include <cpu/x86/mp.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mtrr.h>
#include <cpu/x86/smm.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ops.h>
#include <smp/node.h>
#include <soc/cpu.h>
#include <soc/msr.h>
#include <soc/pci_devs.h>
#include <soc/soc_chip.h>
#include <string.h>
#include <types.h>
Include dependency graph for smmrelocate.c:

Go to the source code of this file.

Functions

static void update_save_state (int cpu, uintptr_t curr_smbase, uintptr_t staggered_smbase, struct smm_relocation_params *relo_params)
 
static int bsp_setup_msr_save_state (struct smm_relocation_params *relo_params)
 
void smm_relocation_handler (int cpu, uintptr_t curr_smbase, uintptr_t staggered_smbase)
 
static void fill_in_relocation_params (struct smm_relocation_params *params)
 
static void setup_ied_area (struct smm_relocation_params *params)
 
void smm_info (uintptr_t *perm_smbase, size_t *perm_smsize, size_t *smm_save_state_size)
 
void smm_initialize (void)
 
void smm_relocate (void)
 

Function Documentation

◆ bsp_setup_msr_save_state()

static int bsp_setup_msr_save_state ( struct smm_relocation_params relo_params)
static

Definition at line 78 of file smmrelocate.c.

References msr_struct::hi, msr_struct::lo, rdmsr(), SMM_CPU_SAVE_EN, SMM_CPU_SVRSTR_MASK, SMM_FEATURE_CONTROL_MSR, SMM_MCA_CAP_MSR, smm_relocation_params::smm_save_state_in_msrs, and wrmsr().

Referenced by smm_relocation_handler().

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

◆ fill_in_relocation_params()

static void fill_in_relocation_params ( struct smm_relocation_params params)
static

Definition at line 163 of file smmrelocate.c.

References BIOS_WARNING, IS_ALIGNED, KiB, MTRR_PHYS_MASK_VALID, MTRR_TYPE_WRBACK, params, printk, smm_region(), smm_subregion(), SMM_SUBREGION_CHIPSET, and smm_relocation_params::tseg_base.

Referenced by smm_info().

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

◆ setup_ied_area()

static void setup_ied_area ( struct smm_relocation_params params)
static

Definition at line 186 of file smmrelocate.c.

References BIOS_DEBUG, smm_relocation_params::ied_base, KiB, memcpy(), memset(), MiB, params, printk, and ied_header::signature.

Referenced by smm_info().

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 223 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().

Here is the call graph for this function:

◆ smm_relocate()

void smm_relocate ( void  )

Definition at line 238 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.

Here is the call graph for this function:

◆ smm_relocation_handler()

◆ update_save_state()

static void update_save_state ( int  cpu,
uintptr_t  curr_smbase,
uintptr_t  staggered_smbase,
struct smm_relocation_params relo_params 
)
static

Definition at line 22 of file smmrelocate.c.

References BIOS_DEBUG, msr_struct::hi, smm_relocation_params::ied_base, IEDBASE_MSR, msr_struct::lo, printk, save_state, SMBASE_MSR, SMM_DEFAULT_SIZE, smm_relocation_params::smm_save_state_in_msrs, and wrmsr().

Referenced by smm_relocation_handler().

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