Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2a7f1d4

Browse files
randall77gopherbot
authored andcommitted
runtime: use one more address bit for tagged pointers
We use one extra bit to placate systems which simulate amd64 binaries on an arm64 host. Allocated arm64 addresses could be as high as 1<<48-1, which would be invalid if we assumed 48-bit sign-extended addresses. (Note that this does not help the other way around, simluating arm64 on amd64, but we don't have that problem at the moment.) Fixes #69255 Change-Id: Iace17a5d41a65e34abf201d03d8b0ff6f7bf1150 Reviewed-on: https://go-review.googlesource.com/c/go/+/700515 Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
1 parent b090680 commit 2a7f1d4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/runtime/tagptr_64bit.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@ const (
2222
// On AMD64, virtual addresses are 48-bit (or 57-bit) sign-extended.
2323
// Other archs are 48-bit zero-extended.
2424
//
25+
// We use one extra bit to placate systems which simulate amd64 binaries on
26+
// an arm64 host. Allocated arm64 addresses could be as high as 1<<48-1,
27+
// which would be invalid if we assumed 48-bit sign-extended addresses.
28+
// See issue 69255.
29+
// (Note that this does not help the other way around, simluating arm64
30+
// on amd64, but we don't have that problem at the moment.)
31+
//
2532
// On s390x, virtual addresses are 64-bit. There's not much we
2633
// can do about this, so we just hope that the kernel doesn't
2734
// get to really high addresses and panic if it does.
28-
defaultAddrBits = 48
35+
defaultAddrBits = 48+1
2936

3037
// On AIX, 64-bit addresses are split into 36-bit segment number and 28-bit
3138
// offset in segment. Segment numbers in the range 0x0A0000000-0x0AFFFFFFF(LSA)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /