From e629cd0f88d86867f9fc898c6a75fb17060b83ea Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Wed, 15 Apr 2015 19:11:47 +1000 Subject: [PATCH] runtime: mark all runtime.cputicks implementations NOSPLIT MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes #10450 runtime.cputicks is called from runtime.exitsyscall and must not split the stack. cputicks is implemented in several ways and the NOSPLIT annotation was missing from a few of these. Change-Id: I5cbbb4e5888c5d298fe2fef240782d0e49f59af8 Reviewed-on: https://go-review.googlesource.com/8939 Reviewed-by: Aram Hăvărneanu --- src/runtime/os_linux_arm.go | 1 + src/runtime/os_linux_arm64.go | 1 + 2 files changed, 2 insertions(+) diff --git a/src/runtime/os_linux_arm.go b/src/runtime/os_linux_arm.go index d88bf785ee..c5abedbd98 100644 --- a/src/runtime/os_linux_arm.go +++ b/src/runtime/os_linux_arm.go @@ -64,6 +64,7 @@ func sysargs(argc int32, argv **byte) { } } +//go:nosplit func cputicks() int64 { // Currently cputicks() is used in blocking profiler and to seed fastrand1(). // nanotime() is a poor approximation of CPU ticks that is enough for the profiler. diff --git a/src/runtime/os_linux_arm64.go b/src/runtime/os_linux_arm64.go index c3ad871349..3f994f128b 100644 --- a/src/runtime/os_linux_arm64.go +++ b/src/runtime/os_linux_arm64.go @@ -11,6 +11,7 @@ const ( var randomNumber uint32 +//go:nosplit func cputicks() int64 { // Currently cputicks() is used in blocking profiler and to seed fastrand1(). // nanotime() is a poor approximation of CPU ticks that is enough for the profiler. -- 2.48.1