aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_windows_amd64.s
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2021-03-18 16:01:23 +0000
committerMichael Knyszek <mknyszek@google.com>2021-03-19 17:07:35 +0000
commit4deaa6a178d89631302470f78574c1e957cf84a5 (patch)
tree74284bc4674ee877284a5723a5203cdf9dc28f49 /src/runtime/sys_windows_amd64.s
parente58fb90c753ce8ac1ccd6e26035e7ec0f4f108bc (diff)
downloadgo-4deaa6a178d89631302470f78574c1e957cf84a5.tar.gz
go-4deaa6a178d89631302470f78574c1e957cf84a5.zip
runtime: call nanotimeQPC from nanotime1 without a wrapper
This changes makes it so that nanotimeQPC calls nanotime1 without an ABI wrapper by specifying the ABIInternal version directly. The reason why this is necessary is because ABI wrappers typically require additional stack space, and nanotimeQPC is used deep within nosplit contexts, and with the ABI wrappers now enabled, this exhausts the stack guard space held for nosplit functions. Rather than increase the stack guard, we choose to do this. For #40724. Change-Id: Ia9173ca903335a9d6f380f57f4a45e49b58da6bb Reviewed-on: https://go-review.googlesource.com/c/go/+/303069 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/sys_windows_amd64.s')
-rw-r--r--src/runtime/sys_windows_amd64.s8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/runtime/sys_windows_amd64.s b/src/runtime/sys_windows_amd64.s
index aba2811e59..a7c519ae19 100644
--- a/src/runtime/sys_windows_amd64.s
+++ b/src/runtime/sys_windows_amd64.s
@@ -464,7 +464,13 @@ loop:
MOVQ CX, ret+0(FP)
RET
useQPC:
- JMP runtime·nanotimeQPC(SB)
+ // Call with ABIInternal because we could be
+ // very deep in a nosplit context and the wrapper
+ // adds stack space.
+ // TODO(#40724): The result from nanotimeQPC will
+ // be passed in a register, so store that to the
+ // stack so we can return through a wrapper.
+ JMP runtime·nanotimeQPC<ABIInternal>(SB)
RET
TEXT time·now(SB),NOSPLIT,$0-24