summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/amd64/amd64/locore.S10
-rw-r--r--sys/arch/amd64/include/asm.h7
2 files changed, 9 insertions, 8 deletions
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S
index 66b3321adbb..a05af42b870 100644
--- a/sys/arch/amd64/amd64/locore.S
+++ b/sys/arch/amd64/amd64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.101 2018/06/14 19:57:29 guenther Exp $ */
+/* $OpenBSD: locore.S,v 1.102 2018/07/01 04:47:32 guenther Exp $ */
/* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */
/*
@@ -256,7 +256,7 @@ _C_LABEL(sigcode):
_C_LABEL(sigcoderet):
movq $SYS_exit,%rax
syscall
- .align 16,0xcc
+ _ALIGN_TRAPS
1: JMP_RETPOLINE(rax)
.globl _C_LABEL(esigcode)
_C_LABEL(esigcode):
@@ -660,14 +660,14 @@ KUENTRY(syscall_trampback)
sysretq
.text
- .align 16,0xcc
+ _ALIGN_TRAPS
/* in this case, need FS.base but not xstate, rarely happens */
.Lsyscall_restore_fsbase: /* CPU doesn't have curproc's FS.base */
orl $CPUF_USERSEGS,CPUVAR(FLAGS)
movq CPUVAR(CURPCB),%rdi
jmp .Lsyscall_restore_fsbase_real
- .align 16,0xcc
+ _ALIGN_TRAPS
.Lsyscall_restore_xstate: /* CPU doesn't have curproc's xstate */
orl $(CPUF_USERXSTATE|CPUF_USERSEGS),CPUVAR(FLAGS)
movq CPUVAR(CURPCB),%rdi
@@ -825,7 +825,7 @@ _C_LABEL(doreti_iret):
iretq
.text
- .align 16,0xcc
+ _ALIGN_TRAPS
.Lintr_restore_xstate: /* CPU doesn't have curproc's xstate */
orl $CPUF_USERXSTATE,CPUVAR(FLAGS)
movq CPUVAR(CURPCB),%rdi
diff --git a/sys/arch/amd64/include/asm.h b/sys/arch/amd64/include/asm.h
index f3b7a249534..ade96f09dcf 100644
--- a/sys/arch/amd64/include/asm.h
+++ b/sys/arch/amd64/include/asm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm.h,v 1.10 2018/06/07 04:09:35 guenther Exp $ */
+/* $OpenBSD: asm.h,v 1.11 2018/07/01 04:47:32 guenther Exp $ */
/* $NetBSD: asm.h,v 1.2 2003/05/02 18:05:47 yamt Exp $ */
/*-
@@ -61,8 +61,9 @@
/* let kernels and others override entrypoint alignment */
#ifndef _ALIGN_TEXT
-#define _ALIGN_TEXT .align 16, 0x90
+#define _ALIGN_TEXT .align 16, 0x90
#endif
+#define _ALIGN_TRAPS .align 16, 0xcc
#define _ENTRY(x) \
.text; _ALIGN_TEXT; .globl x; .type x,@function; x:
@@ -125,7 +126,7 @@
call 69f ; \
68: pause ; \
jmp 68b ; \
- .align 16,0xcc ; \
+ _ALIGN_TRAPS ; \
69: mov %reg,(%rsp) ; \
ret