summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/mp_machdep.c
diff options
context:
space:
mode:
authorLuiz Souza <luiz@netgate.com>2018-02-21 14:26:37 -0300
committerLuiz Souza <luiz@netgate.com>2018-02-21 14:26:37 -0300
commitc1ee180537f04875eccd8e9b3d630b73ad654b14 (patch)
treedc39f4926b363489ebed63757d4634367c717350 /sys/amd64/amd64/mp_machdep.c
parent4c9907d21517c211b27a3cf5b7a2a976623820cc (diff)
downloadFreeBSD-src-c1ee180537f04875eccd8e9b3d630b73ad654b14.zip
FreeBSD-src-c1ee180537f04875eccd8e9b3d630b73ad654b14.tar.gz
Revert "MFC r327818:"
This reverts commit ba6ece08e939b4f3d25e9e81956e8d622ed1fc2e.
Diffstat (limited to 'sys/amd64/amd64/mp_machdep.c')
-rw-r--r--sys/amd64/amd64/mp_machdep.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 70b2e6d..ce07e0f 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -87,6 +87,8 @@ extern struct pcpu __pcpu[];
char *doublefault_stack;
char *nmi_stack;
+extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
+
/*
* Local data and functions.
*/
@@ -186,7 +188,7 @@ init_secondary(void)
{
struct pcpu *pc;
struct nmi_pcpu *np;
- u_int64_t cr0;
+ u_int64_t msr, cr0;
int cpu, gsel_tss, x;
struct region_descriptor ap_gdt;
@@ -261,7 +263,15 @@ init_secondary(void)
cr0 &= ~(CR0_CD | CR0_NW | CR0_EM);
load_cr0(cr0);
- amd64_conf_fast_syscall();
+ /* 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);
/* signal our startup to the BSP. */
mp_naps++;
OpenPOWER on IntegriCloud