summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Souza <luiz@netgate.com>2018-02-21 14:22:48 -0300
committerLuiz Souza <luiz@netgate.com>2018-02-21 14:22:48 -0300
commit364d23417fdf8cd90b896af94c6857c6ba13be8c (patch)
tree97f12b531e47520b0358947a3fb53f9de0b77491
parent7eddfe2723939683f87c79dac52507b6878a4017 (diff)
downloadFreeBSD-src-364d23417fdf8cd90b896af94c6857c6ba13be8c.zip
FreeBSD-src-364d23417fdf8cd90b896af94c6857c6ba13be8c.tar.gz
Revert "MFC r321899"
This reverts commit 1027b09f970c81aab8f721168a4500261978c198.
-rw-r--r--sys/amd64/amd64/elf_machdep.c19
-rw-r--r--sys/amd64/amd64/initcpu.c27
-rw-r--r--sys/amd64/include/md_var.h5
-rw-r--r--sys/amd64/linux/linux_sysvec.c2
4 files changed, 1 insertions, 52 deletions
diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c
index 4e9476a..ca07adc 100644
--- a/sys/amd64/amd64/elf_machdep.c
+++ b/sys/amd64/amd64/elf_machdep.c
@@ -84,25 +84,6 @@ struct sysentvec elf64_freebsd_sysvec = {
};
INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec);
-void
-amd64_lower_shared_page(struct sysentvec *sv)
-{
- if (hw_lower_amd64_sharedpage != 0) {
- sv->sv_maxuser -= PAGE_SIZE;
- sv->sv_shared_page_base -= PAGE_SIZE;
- sv->sv_usrstack -= PAGE_SIZE;
- sv->sv_psstrings -= PAGE_SIZE;
- }
-}
-
-/*
- * Do this fixup before INIT_SYSENTVEC (SI_ORDER_ANY) because the latter
- * uses the value of sv_shared_page_base.
- */
-SYSINIT(elf64_sysvec_fixup, SI_SUB_EXEC, SI_ORDER_FIRST,
- (sysinit_cfunc_t) amd64_lower_shared_page,
- &elf64_freebsd_sysvec);
-
static Elf64_Brandinfo freebsd_brand_info = {
.brand = ELFOSABI_FREEBSD,
.machine = EM_X86_64,
diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index ff3b6be..63c0f20 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -48,11 +48,6 @@ __FBSDID("$FreeBSD$");
static int hw_instruction_sse;
SYSCTL_INT(_hw, OID_AUTO, instruction_sse, CTLFLAG_RD,
&hw_instruction_sse, 0, "SIMD/MMX2 instructions available in CPU");
-static int lower_sharedpage_init;
-int hw_lower_amd64_sharedpage;
-SYSCTL_INT(_hw, OID_AUTO, lower_amd64_sharedpage, CTLFLAG_RDTUN,
- &hw_lower_amd64_sharedpage, 0,
- "Lower sharedpage to work around Ryzen issue with executing code near the top of user memory");
/*
* -1: automatic (default)
* 0: keep enable CLFLUSH
@@ -127,28 +122,6 @@ init_amd(void)
wrmsr(0xc0011020, msr);
}
}
-
- /*
- * Work around a problem on Ryzen that is triggered by executing
- * code near the top of user memory, in our case the signal
- * trampoline code in the shared page on amd64.
- *
- * This function is executed once for the BSP before tunables take
- * effect so the value determined here can be overridden by the
- * tunable. This function is then executed again for each AP and
- * also on resume. Set a flag the first time so that value set by
- * the tunable is not overwritten.
- *
- * The stepping and/or microcode versions should be checked after
- * this issue is fixed by AMD so that we don't use this mode if not
- * needed.
- */
- if (lower_sharedpage_init == 0) {
- lower_sharedpage_init = 1;
- if (CPUID_TO_FAMILY(cpu_id) == 0x17) {
- hw_lower_amd64_sharedpage = 1;
- }
- }
}
/*
diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h
index 7a84631..706ffc6 100644
--- a/sys/amd64/include/md_var.h
+++ b/sys/amd64/include/md_var.h
@@ -34,15 +34,12 @@
#include <x86/x86_var.h>
-extern uint64_t *vm_page_dump;
-extern int hw_lower_amd64_sharedpage;
+extern uint64_t *vm_page_dump;
struct savefpu;
-struct sysentvec;
void amd64_conf_fast_syscall(void);
void amd64_db_resume_dbreg(void);
-void amd64_lower_shared_page(struct sysentvec *);
void amd64_syscall(struct thread *td, int traced);
void doreti_iret(void) __asm(__STRING(doreti_iret));
void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault));
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
index 942819b..f77c2c9 100644
--- a/sys/amd64/linux/linux_sysvec.c
+++ b/sys/amd64/linux/linux_sysvec.c
@@ -833,8 +833,6 @@ static void
linux_vdso_install(void *param)
{
- amd64_lower_shared_page(&elf_linux_sysvec);
-
linux_szsigcode = (&_binary_linux_locore_o_end -
&_binary_linux_locore_o_start);
OpenPOWER on IntegriCloud