Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/machdep.c
Show First 20 Lines • Show All 1,519 Lines • ▼ Show 20 Lines | amd64_conf_fast_syscall(void) | ||||
msr = rdmsr(MSR_EFER) | EFER_SCE; | msr = rdmsr(MSR_EFER) | EFER_SCE; | ||||
wrmsr(MSR_EFER, msr); | wrmsr(MSR_EFER, msr); | ||||
wrmsr(MSR_LSTAR, (u_int64_t)IDTVEC(fast_syscall)); | wrmsr(MSR_LSTAR, (u_int64_t)IDTVEC(fast_syscall)); | ||||
wrmsr(MSR_CSTAR, (u_int64_t)IDTVEC(fast_syscall32)); | wrmsr(MSR_CSTAR, (u_int64_t)IDTVEC(fast_syscall32)); | ||||
msr = ((u_int64_t)GSEL(GCODE_SEL, SEL_KPL) << 32) | | msr = ((u_int64_t)GSEL(GCODE_SEL, SEL_KPL) << 32) | | ||||
((u_int64_t)GSEL(GUCODE32_SEL, SEL_UPL) << 48); | ((u_int64_t)GSEL(GUCODE32_SEL, SEL_UPL) << 48); | ||||
wrmsr(MSR_STAR, msr); | wrmsr(MSR_STAR, msr); | ||||
wrmsr(MSR_SF_MASK, PSL_NT | PSL_T | PSL_I | PSL_C | PSL_D); | wrmsr(MSR_SF_MASK, PSL_NT | PSL_T | PSL_I | PSL_C | PSL_D | PSL_AC); | ||||
} | } | ||||
u_int64_t | u_int64_t | ||||
hammer_time(u_int64_t modulep, u_int64_t physfree) | hammer_time(u_int64_t modulep, u_int64_t physfree) | ||||
{ | { | ||||
caddr_t kmdp; | caddr_t kmdp; | ||||
int gsel_tss, x; | int gsel_tss, x; | ||||
struct pcpu *pc; | struct pcpu *pc; | ||||
Show All 11 Lines | hammer_time(u_int64_t modulep, u_int64_t physfree) | ||||
*/ | */ | ||||
proc_linkup0(&proc0, &thread0); | proc_linkup0(&proc0, &thread0); | ||||
kmdp = init_ops.parse_preload_data(modulep); | kmdp = init_ops.parse_preload_data(modulep); | ||||
identify_cpu1(); | identify_cpu1(); | ||||
identify_hypervisor(); | identify_hypervisor(); | ||||
/* link_elf_ireloc(kmdp); */ | |||||
/* Init basic tunables, hz etc */ | /* Init basic tunables, hz etc */ | ||||
init_param1(); | init_param1(); | ||||
thread0.td_kstack = physfree + KERNBASE; | thread0.td_kstack = physfree + KERNBASE; | ||||
thread0.td_kstack_pages = kstack_pages; | thread0.td_kstack_pages = kstack_pages; | ||||
kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; | kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; | ||||
bzero((void *)thread0.td_kstack, kstack0_sz); | bzero((void *)thread0.td_kstack, kstack0_sz); | ||||
physfree += kstack0_sz; | physfree += kstack0_sz; | ||||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | #endif | ||||
* This loses mainly printf()s in getmemsize() and early debugging. | * This loses mainly printf()s in getmemsize() and early debugging. | ||||
*/ | */ | ||||
late_console = 1; | late_console = 1; | ||||
TUNABLE_INT_FETCH("debug.late_console", &late_console); | TUNABLE_INT_FETCH("debug.late_console", &late_console); | ||||
if (!late_console) { | if (!late_console) { | ||||
cninit(); | cninit(); | ||||
amd64_kdb_init(); | amd64_kdb_init(); | ||||
} | } | ||||
link_elf_ireloc(kmdp); | |||||
getmemsize(kmdp, physfree); | getmemsize(kmdp, physfree); | ||||
init_param2(physmem); | init_param2(physmem); | ||||
/* now running on new page tables, configured,and u/iom is accessible */ | /* now running on new page tables, configured,and u/iom is accessible */ | ||||
if (late_console) | if (late_console) | ||||
cninit(); | cninit(); | ||||
▲ Show 20 Lines • Show All 866 Lines • Show Last 20 Lines |