coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cpu.c File Reference
#include <acpi/acpigen.h>
#include <assert.h>
#include <console/console.h>
#include <console/debug.h>
#include <cpu/cpu.h>
#include <cpu/intel/common/common.h>
#include <cpu/intel/em64t101_save_state.h>
#include <cpu/intel/microcode.h>
#include <cpu/intel/smm_reloc.h>
#include <cpu/intel/turbo.h>
#include <cpu/x86/mp.h>
#include <cpu/x86/mtrr.h>
#include <intelblocks/cpulib.h>
#include <intelblocks/mp_init.h>
#include <intelpch/lockdown.h>
#include <soc/cpu.h>
#include <soc/msr.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/smmrelocate.h>
#include <soc/soc_util.h>
#include <soc/util.h>
#include <types.h>
#include "chip.h"
Include dependency graph for cpu.c:

Go to the source code of this file.

Functions

bool cpu_soc_is_in_untrusted_mode (void)
 
static void xeon_configure_mca (void)
 
void get_microcode_info (const void **microcode, int *parallel)
 
static void each_cpu_init (struct device *cpu)
 
static void set_max_turbo_freq (void)
 
static void pre_mp_init (void)
 
static int get_thread_count (void)
 
static void post_mp_init (void)
 
void cpx_init_cpus (struct device *dev)
 

Variables

static const voidmicrocode_patch
 
static const config_tchip_config = NULL
 
static struct device_operations cpu_dev_ops
 
static const struct cpu_device_id cpu_table []
 
static const struct cpu_driver driver __cpu_driver
 
static const struct mp_ops mp_ops
 

Function Documentation

◆ cpu_soc_is_in_untrusted_mode()

bool cpu_soc_is_in_untrusted_mode ( void  )

Definition at line 33 of file cpu.c.

◆ cpx_init_cpus()

void cpx_init_cpus ( struct device dev)

◆ each_cpu_init()

static void each_cpu_init ( struct device cpu)
static

Definition at line 73 of file cpu.c.

◆ get_microcode_info()

void get_microcode_info ( const void **  microcode,
int *  parallel 
)

Definition at line 67 of file cpu.c.

References intel_microcode_find().

Here is the call graph for this function:

◆ get_thread_count()

static int get_thread_count ( void  )
static

Definition at line 171 of file cpu.c.

References BIOS_SPEW, cpu_read_topology(), and printk.

Here is the call graph for this function:

◆ post_mp_init()

static void post_mp_init ( void  )
static

Definition at line 187 of file cpu.c.

◆ pre_mp_init()

static void pre_mp_init ( void  )
static

Definition at line 165 of file cpu.c.

References x86_mtrr_check(), and x86_setup_mtrrs_with_detect().

Here is the call graph for this function:

◆ set_max_turbo_freq()

static void set_max_turbo_freq ( void  )
static

◆ xeon_configure_mca()

static void xeon_configure_mca ( void  )
static

Definition at line 39 of file cpu.c.

References cpuid, cpuid_result::edx, msr_struct::hi, IA32_MCG_CAP, IA32_MCG_CAP_CTL_P_MASK, IA32_MCG_CTL, msr_struct::lo, mca_configure(), rdmsr(), and wrmsr().

Here is the call graph for this function:

Variable Documentation

◆ __cpu_driver

const struct cpu_driver driver __cpu_driver
static
Initial value:
= {
.ops = &cpu_dev_ops,
.id_table = cpu_table,
}
static const struct cpu_device_id cpu_table[]
Definition: cpu.c:124
static struct device_operations cpu_dev_ops
Definition: cpu.c:120

Definition at line 73 of file cpu.c.

◆ chip_config

const config_t* chip_config = NULL
static

Definition at line 31 of file cpu.c.

Referenced by cpx_init_cpus().

◆ cpu_dev_ops

struct device_operations cpu_dev_ops
static
Initial value:
= {
.init = each_cpu_init,
}
static void each_cpu_init(struct device *cpu)
Definition: cpu.c:73

Definition at line 73 of file cpu.c.

◆ cpu_table

const struct cpu_device_id cpu_table[]
static
Initial value:
= {
{0, 0},
}
#define X86_VENDOR_INTEL
Definition: cpu.h:138
#define CPUID_COOPERLAKE_SP_A0
Definition: cpu_ids.h:9
#define CPUID_COOPERLAKE_SP_A1
Definition: cpu_ids.h:10

Definition at line 73 of file cpu.c.

◆ microcode_patch

const void* microcode_patch
static

Definition at line 29 of file cpu.c.

Referenced by cpx_init_cpus().

◆ mp_ops

const struct mp_ops mp_ops
static
Initial value:
= {
.pre_mp_init = pre_mp_init,
.get_cpu_count = get_thread_count,
.get_smm_info = get_smm_info,
.pre_mp_smm_init = smm_southbridge_clear_state,
.relocation_handler = smm_relocation_handler,
.get_microcode_info = get_microcode_info,
.post_mp_init = post_mp_init,
}
void smm_relocation_handler(int cpu, uintptr_t curr_smbase, uintptr_t staggered_smbase)
Definition: smmrelocate.c:90
void smm_southbridge_clear_state(void)
Definition: smm.c:22
void get_microcode_info(const void **microcode, int *parallel)
Definition: cpu.c:180
static void get_smm_info(uintptr_t *perm_smbase, size_t *perm_smsize, size_t *smm_save_state_size)
Definition: cpu.c:149
static int get_thread_count(void)
Definition: cpu.c:171
static void pre_mp_init(void)
Definition: cpu.c:165
static void post_mp_init(void)
Definition: cpu.c:187

Definition at line 187 of file cpu.c.