diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2019-05-12 22:23:39 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2019-05-12 22:23:39 +0000 |
commit | 84fa4782dee30a786dc11e49c47d744a74b37db6 (patch) | |
tree | 56d4ca0d73e246920489ccefc826df6c700dcd66 /sys/arch/amd64 | |
parent | 251727744f6be053af1f5c9e5cea4476b16b698c (diff) |
Delete cpu_idle_{enter,leave}_fcn() as unused. Add RETGUARD checks to
cpu_idle_cycle()
ok mpi@ kettenis@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/locore.S | 13 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/include/cpu.h | 4 |
3 files changed, 8 insertions, 13 deletions
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index b61380de651..2b58ca2a7e0 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.116 2019/04/02 03:35:08 mortimer Exp $ */ +/* $OpenBSD: locore.S,v 1.117 2019/05/12 22:23:38 guenther Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -490,28 +490,27 @@ switch_restored: ret ENTRY(cpu_idle_enter) - movq _C_LABEL(cpu_idle_enter_fcn),%rax - cmpq $0,%rax - jne retpoline_rax ret +END(cpu_idle_enter) ENTRY(cpu_idle_leave) - movq _C_LABEL(cpu_idle_leave_fcn),%rax - cmpq $0,%rax - jne retpoline_rax ret +END(cpu_idle_leave) /* placed here for correct static branch prediction in cpu_idle_* */ NENTRY(retpoline_rax) JMP_RETPOLINE(rax) ENTRY(cpu_idle_cycle) + RETGUARD_SETUP(cpu_idle_cycle, r11) movq _C_LABEL(cpu_idle_cycle_fcn),%rax cmpq $0,%rax jne retpoline_rax sti hlt + RETGUARD_CHECK(cpu_idle_cycle, r11) ret +END(cpu_idle_cycle) .globl _C_LABEL(panic) diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index d6a126b94fe..eed79f4b32a 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.256 2019/04/01 07:00:51 tedu Exp $ */ +/* $OpenBSD: machdep.c,v 1.257 2019/05/12 22:23:38 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -155,9 +155,7 @@ char machine[] = MACHINE; /* * switchto vectors */ -void (*cpu_idle_leave_fcn)(void) = NULL; void (*cpu_idle_cycle_fcn)(void) = NULL; -void (*cpu_idle_enter_fcn)(void) = NULL; /* the following is used externally for concurrent handlers */ int setperf_prio = 0; diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index e5210e082d0..e0297a488fb 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.129 2019/01/19 20:45:06 tedu Exp $ */ +/* $OpenBSD: cpu.h,v 1.130 2019/05/12 22:23:38 guenther Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -371,9 +371,7 @@ void x86_64_proc0_tss_ldt_init(void); void x86_64_bufinit(void); void cpu_proc_fork(struct proc *, struct proc *); int amd64_pa_used(paddr_t); -extern void (*cpu_idle_enter_fcn)(void); extern void (*cpu_idle_cycle_fcn)(void); -extern void (*cpu_idle_leave_fcn)(void); struct region_descriptor; void lgdt(struct region_descriptor *); |