![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
#include <string.h>
#include <rmodule.h>
#include <commonlib/helpers.h>
#include <cpu/cpu.h>
#include <cpu/intel/microcode.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/gdt.h>
#include <cpu/x86/lapic.h>
#include <cpu/x86/name.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mtrr.h>
#include <cpu/x86/smm.h>
#include <cpu/x86/mp.h>
#include <delay.h>
#include <device/device.h>
#include <device/path.h>
#include <smp/atomic.h>
#include <smp/spinlock.h>
#include <symbols.h>
#include <timer.h>
#include <thread.h>
#include <types.h>
#include <security/intel/stm/SmmStm.h>
Go to the source code of this file.
Data Structures | |
struct | mp_callback |
struct | mp_flight_record |
struct | mp_params |
struct | sipi_params |
struct | saved_msr |
struct | mp_flight_plan |
struct | mp_state |
Macros | |
#define | MAX_APIC_IDS 256 |
#define | _MP_FLIGHT_RECORD(barrier_, ap_func_, bsp_func_) |
#define | MP_FR_BLOCK_APS(ap_func_, bsp_func_) _MP_FLIGHT_RECORD(0, ap_func_, bsp_func_) |
#define | MP_FR_NOBLOCK_APS(ap_func_, bsp_func_) _MP_FLIGHT_RECORD(1, ap_func_, bsp_func_) |
#define | NUM_FIXED_MTRRS 11 |
Variables | |
static char | processor_name [49] |
atomic_t | barrier |
atomic_t | cpus_entered |
void(* | ap_call )(void) |
void(* | bsp_call )(void) |
struct mp_params | __aligned |
struct sipi_params | __packed |
char | _binary_sipi_vector_start [] |
static const uintptr_t | sipi_vector_location = SMM_DEFAULT_BASE |
static const int | sipi_vector_location_size = SMM_DEFAULT_SIZE |
static int | global_num_aps |
static struct mp_flight_plan | mp_info |
static struct device * | cpus_dev [CONFIG_MAX_CPUS] |
static const unsigned int | fixed_mtrrs [NUM_FIXED_MTRRS] |
struct mp_state | mp_state |
static struct mp_callback * | ap_callbacks [CONFIG_MAX_CPUS] |
static struct mp_flight_record | mp_steps [] |
#define _MP_FLIGHT_RECORD | ( | barrier_, | |
ap_func_, | |||
bsp_func_ | |||
) |
#define MP_FR_BLOCK_APS | ( | ap_func_, | |
bsp_func_ | |||
) | _MP_FLIGHT_RECORD(0, ap_func_, bsp_func_) |
#define MP_FR_NOBLOCK_APS | ( | ap_func_, | |
bsp_func_ | |||
) | _MP_FLIGHT_RECORD(1, ap_func_, bsp_func_) |
struct mp_flight_record __aligned | ( | CACHELINE_SIZE | ) |
|
static |
Definition at line 750 of file mp_init.c.
References smm_stub_params::apic_id_to_cpu, cpu_get_apic_id(), and smm_loader_params::stub_params.
Definition at line 356 of file mp_init.c.
References alloc_find_dev(), BIOS_CRIT, cpu_info(), cpus_dev, DEVICE_PATH_APIC, info, NULL, mp_params::num_cpus, printk, and processor_name.
Definition at line 159 of file mp_init.c.
References mp_flight_record::ap_call, atomic_inc, mp_flight_record::barrier, barrier_wait(), mp_flight_record::cpus_entered, mp_info, NULL, mp_flight_plan::num_records, and mp_flight_plan::records.
Referenced by ap_init().
|
static |
Definition at line 181 of file mp_init.c.
References ap_do_flight_plan(), BIOS_INFO, cpu_add_map_entry(), cpu_info(), cpu_is_intel(), cpus_dev, enable_lapic(), get_current_microcode_rev(), info, lapicid(), NULL, park_this_cpu(), printk, and setup_lapic_interrupts().
Referenced by load_sipi_vector().
Definition at line 933 of file mp_init.c.
References ap_callbacks, mp_callback::arg, BIOS_ERR, CONFIG, cpu_index(), mp_callback::func, mp_callback::logical_cpu_number, memcpy(), mfence(), NULL, printk, read_callback(), and store_callback().
|
static |
Definition at line 356 of file mp_init.c.
Referenced by smm_initiate_relocation_parallel().
Definition at line 129 of file mp_init.c.
References atomic_read, and mfence().
Referenced by ap_do_flight_plan().
DECLARE_SPIN_LOCK | ( | smm_relocation_lock | ) |
Definition at line 1058 of file mp_init.c.
References ALIGN_UP, CONFIG, MAX, NULL, mp_state::ops, ops, mp_ops::per_cpu_smm_trigger, smm_initiate_relocation(), and smm_stub_size().
Referenced by do_mp_init_with_smm().
Definition at line 533 of file mp_init.c.
References alloc_find_dev(), BIOS_CRIT, BIOS_INFO, cpu_add_map_entry(), cpu_info(), DEVICE_PATH_APIC, enable_lapic(), fill_processor_name(), info, lapicid(), printk, processor_name, and setup_lapic_interrupts().
|
static |
Definition at line 750 of file mp_init.c.
Referenced by load_smm_handlers().
|
static |
Definition at line 750 of file mp_init.c.
Referenced by load_smm_handlers().
|
static |
Definition at line 684 of file mp_init.c.
References CONFIG, and mp_state::do_smm.
Referenced by load_smm_handlers(), and trigger_smm_relocation().
Definition at line 282 of file mp_init.c.
References _binary_sipi_vector_start, ALIGN_UP, sipi_params::ap_count, ap_init(), atomic_set, BIOS_CRIT, sipi_params::c_handler, sipi_params::microcode_lock, mp_params::microcode_pointer, sipi_params::microcode_ptr, sipi_params::msr_count, sipi_params::msr_table_ptr, NULL, mp_params::parallel_microcode_load, printk, rmodule_entry_offset(), rmodule_load(), rmodule_load_alignment(), rmodule_memory_size(), rmodule_parameters(), rmodule_parse(), save_bsp_msrs(), setup_default_sipi_vector_params(), sipi_vector_location, and sipi_vector_location_size.
Definition at line 810 of file mp_init.c.
References BIOS_ERR, CB_SUCCESS, mp_state::cpu_count, install_permanent_handler(), install_relocation_handler(), is_smm_enabled(), NULL, mp_state::ops, mp_state::perm_smbase, mp_state::perm_smsize, mp_ops::pre_mp_smm_init, printk, smm_disable(), mp_state::smm_real_save_state_size, mp_state::smm_save_state_size, smm_setup_stack(), and wbinvd().
Definition at line 1082 of file mp_init.c.
Referenced by cpx_init_cpus(), get_adl_cpu_type(), mp_init_cpus(), soc_init_cpus(), and xeon_sp_init_cpus().
Definition at line 632 of file mp_init.c.
References cpu_info(), cpu_initialize(), and info.
Definition at line 933 of file mp_init.c.
Referenced by arch_bootstate_coreboot_exit(), and intel_txt_prepare_txt_env().
enum cb_err mp_run_on_all_aps | ( | void(*)(void *) | func, |
void * | arg, | ||
long | expire_us, | ||
bool | run_parallel | ||
) |
Definition at line 933 of file mp_init.c.
Referenced by mp_startup_all_aps(), and mp_startup_all_cpus().
Definition at line 933 of file mp_init.c.
Referenced by drop_privilege_all(), finalize_cores(), post_cpus_init(), post_mp_init(), and run_set_cpu_type().
Definition at line 933 of file mp_init.c.
Referenced by agesa_RunFcnOnAllAps(), agesa_RunFuncOnAp(), mp_startup_this_ap(), and ocp_oem_smbios_strings().
Definition at line 174 of file mp_init.c.
References stop_this_cpu().
Referenced by ap_init().
|
static |
Definition at line 862 of file mp_init.c.
Referenced by ap_wait_for_instruction().
Definition at line 136 of file mp_init.c.
References atomic_set, and mfence().
|
static |
|
static |
Definition at line 243 of file mp_init.c.
References BIOS_CRIT, fixed_mtrrs, fixed_mtrrs_expose_amd_rwdram(), fixed_mtrrs_hide_amd_rwdram(), get_var_mtrr_count(), MTRR_DEF_TYPE_MSR, MTRR_PHYS_BASE, MTRR_PHYS_MASK, NUM_FIXED_MTRRS, printk, save_msr(), and void().
Referenced by load_sipi_vector().
Definition at line 229 of file mp_init.c.
References saved_msr::hi, msr_struct::hi, saved_msr::index, saved_msr::lo, msr_struct::lo, and rdmsr().
Referenced by save_bsp_msrs().
|
static |
Definition at line 210 of file mp_init.c.
References ALIGN_DOWN, sipi_params::gdt, gdt, gdt_end, sipi_params::gdtlimit, sipi_params::idt_ptr, idtarg, sipi_params::per_cpu_segment_descriptors, per_cpu_segment_descriptors, sipi_params::per_cpu_segment_selector, per_cpu_segment_selector, sipi_params::stack_size, and sipi_params::stack_top.
Referenced by load_sipi_vector().
Definition at line 689 of file mp_init.c.
References mp_state::do_smm.
Referenced by load_smm_handlers().
|
static |
Definition at line 705 of file mp_init.c.
References arg, BIOS_CRIT, BIOS_ERR, BIOS_INFO, CONFIG, smm_module_params::cpu, mp_state::ops, mp_state::perm_smbase, mp_state::perm_smsize, printk, mp_state::reloc_start32_offset, mp_ops::relocation_handler, SMM_DEFAULT_BASE, smm_get_cpu_smbase(), and stm_setup().
Definition at line 694 of file mp_init.c.
References CONFIG, and mp_state::do_smm.
Definition at line 664 of file mp_init.c.
References smm_initiate_relocation_parallel(), spin_lock, and spin_unlock.
Referenced by fill_mp_state_smm(), per_cpu_smm_trigger(), smm_initialize(), and smm_relocate().
Definition at line 639 of file mp_init.c.
References apic_wait_timeout(), BIOS_DEBUG, CB_SUCCESS, lapic_busy(), LAPIC_DM_SMI, LAPIC_INT_ASSERT, lapic_send_ipi_self(), and printk.
Referenced by smm_initiate_relocation(), and smm_relocate().
Definition at line 1045 of file mp_init.c.
References _binary_smmstub_start, BIOS_ERR, printk, rmodule_memory_size(), and rmodule_parse().
Referenced by fill_mp_state_smm(), and smm_module_setup_stub().
|
static |
Definition at line 874 of file mp_init.c.
Referenced by ap_wait_for_instruction().
Definition at line 851 of file mp_init.c.
References is_smm_enabled(), NULL, mp_state::ops, and mp_ops::per_cpu_smm_trigger.
struct mp_params __aligned |
|
extern |
Referenced by load_sipi_vector().
|
static |
Definition at line 860 of file mp_init.c.
Referenced by ap_wait_for_instruction().
Definition at line 0 of file mp_init.c.
Referenced by smp_pause(), spinlock_lock(), and spinlock_unlock().
|
static |
Definition at line 127 of file mp_init.c.
Referenced by allocate_cpu_devices(), and ap_init().
|
static |
|
static |
Definition at line 123 of file mp_init.c.
Referenced by ap_do_flight_plan().
|
static |
|
static |
Definition at line 37 of file mp_init.c.
Referenced by allocate_cpu_devices(), fill_processor_name(), init_bsp(), model_2065x_init(), and model_206ax_report().
|
static |
Definition at line 115 of file mp_init.c.
Referenced by load_sipi_vector().
|
static |
Definition at line 116 of file mp_init.c.
Referenced by load_sipi_vector().