diff options
author | Austin Clements <austin@google.com> | 2019-12-08 22:24:10 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2019-12-09 14:41:00 +0000 |
commit | 1c8d1f45ba7b72836dfe93fc680dfb27ef174965 (patch) | |
tree | e556890fc4cd91c57f71b74c567730e164c91d75 /src/runtime/sys_linux_386.s | |
parent | daaab44f3124aff61937fa7e118f02d4ff82166c (diff) | |
download | go-1c8d1f45ba7b72836dfe93fc680dfb27ef174965.tar.gz go-1c8d1f45ba7b72836dfe93fc680dfb27ef174965.zip |
runtime: mlock top of signal stack on both amd64 and 386
CL 209899 worked around an issue that corrupts vector registers in
recent versions of the Linux kernel by mlocking the top page of every
signal stack on amd64. However, the underlying issue also affects the
XMM registers on 386. This CL applies the mlock fix to both amd64 and
386.
Fixes #35777 (again).
Change-Id: I9886f2dc4c23625421296bd5518d5fd3288bfe48
Reviewed-on: https://go-review.googlesource.com/c/go/+/210345
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_386.s')
-rw-r--r-- | src/runtime/sys_linux_386.s | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s index 373d9d3bc2..8e05acf894 100644 --- a/src/runtime/sys_linux_386.s +++ b/src/runtime/sys_linux_386.s @@ -39,6 +39,8 @@ #define SYS_socketcall 102 #define SYS_setittimer 104 #define SYS_clone 120 +#define SYS_uname 122 +#define SYS_mlock 150 #define SYS_sched_yield 158 #define SYS_nanosleep 162 #define SYS_rt_sigreturn 173 @@ -776,3 +778,20 @@ TEXT runtime·sbrk0(SB),NOSPLIT,$0-4 INVOKE_SYSCALL MOVL AX, ret+0(FP) RET + +// func uname(utsname *new_utsname) int +TEXT ·uname(SB),NOSPLIT,$0-8 + MOVL $SYS_uname, AX + MOVL utsname+0(FP), BX + INVOKE_SYSCALL + MOVL AX, ret+4(FP) + RET + +// func mlock(addr, len uintptr) int +TEXT ·mlock(SB),NOSPLIT,$0-12 + MOVL $SYS_mlock, AX + MOVL addr+0(FP), BX + MOVL len+4(FP), CX + INVOKE_SYSCALL + MOVL AX, ret+8(FP) + RET |