]> Cypherpunks repositories - gostls13.git/commit
runtime: allow physical page aligned stacks to be allocated
authorJoel Sing <joel@sing.id.au>
Sun, 1 Nov 2020 16:58:08 +0000 (03:58 +1100)
committerJoel Sing <joel@sing.id.au>
Wed, 4 Nov 2020 06:14:02 +0000 (06:14 +0000)
commit5ca43acdb3e27117e6994141e518b8d55e4d32aa
tree718a7140c6704e640220e94192153aea8f33691f
parent8eb846fd37eb7bded8a1cf6932be2c59069863e5
runtime: allow physical page aligned stacks to be allocated

Add a physPageAlignedStack boolean which if set, results in over allocation
by a physical page, the allocation being rounded to physical page alignment
and the unused memory surrounding the allocation being freed again.

OpenBSD/octeon has 16KB physical pages and requires stacks to be physical page
aligned in order for them to be remapped as MAP_STACK. This change allows Go
to work on this platform.

Based on a suggestion from mknyszek in issue #41008.

Updates #40995
Fixes #41008

Change-Id: Ia5d652292b515916db473043b41f6030094461d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/266919
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/runtime/mheap.go