diff options
author | kib <kib@FreeBSD.org> | 2018-01-18 12:07:37 +0000 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2018-02-19 14:37:39 -0300 |
commit | ba6ece08e939b4f3d25e9e81956e8d622ed1fc2e (patch) | |
tree | a059f7afacaeda0c83ff0d2d6ecbe6b7c4c49bdc /sys/amd64/amd64/mp_machdep.c | |
parent | c15b1102756fd1613686a6d232b018ae7b0616d5 (diff) | |
download | FreeBSD-src-ba6ece08e939b4f3d25e9e81956e8d622ed1fc2e.zip FreeBSD-src-ba6ece08e939b4f3d25e9e81956e8d622ed1fc2e.tar.gz |
MFC r327818:
Move the hardware setup for fast syscalls into a common function.
(cherry picked from commit ee52c56e9fd3893f553479a1119972766e1bf10d)
Diffstat (limited to 'sys/amd64/amd64/mp_machdep.c')
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index ce07e0f..70b2e6d 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -87,8 +87,6 @@ extern struct pcpu __pcpu[]; char *doublefault_stack; char *nmi_stack; -extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32); - /* * Local data and functions. */ @@ -188,7 +186,7 @@ init_secondary(void) { struct pcpu *pc; struct nmi_pcpu *np; - u_int64_t msr, cr0; + u_int64_t cr0; int cpu, gsel_tss, x; struct region_descriptor ap_gdt; @@ -263,15 +261,7 @@ init_secondary(void) cr0 &= ~(CR0_CD | CR0_NW | CR0_EM); load_cr0(cr0); - /* Set up the fast syscall stuff */ - msr = rdmsr(MSR_EFER) | EFER_SCE; - wrmsr(MSR_EFER, msr); - wrmsr(MSR_LSTAR, (u_int64_t)IDTVEC(fast_syscall)); - wrmsr(MSR_CSTAR, (u_int64_t)IDTVEC(fast_syscall32)); - msr = ((u_int64_t)GSEL(GCODE_SEL, SEL_KPL) << 32) | - ((u_int64_t)GSEL(GUCODE32_SEL, SEL_UPL) << 48); - wrmsr(MSR_STAR, msr); - wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D); + amd64_conf_fast_syscall(); /* signal our startup to the BSP. */ mp_naps++; |