]> Cypherpunks repositories - gostls13.git/commit
runtime: support riscv64 SV57 mode
authorDmitry Vyukov <dvyukov@google.com>
Fri, 27 May 2022 16:55:35 +0000 (18:55 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Thu, 4 Aug 2022 05:33:40 +0000 (05:33 +0000)
commit1e3c19f3fee12e5e2b7802a54908a4d4d03960da
tree80e1bb7caf14223b64a21f270f0275dd02cad792
parentf28fa952b5f81a63afd96c9c58dceb99cc7d1dbf
runtime: support riscv64 SV57 mode

riscv64 has SV57 mode when user-space VA is 56 bits.
Linux kernel recently got support for this mode and Go binaries started crashing as:

runtime: lfstack.push invalid packing: node=0xffffff5908a940 cnt=0x1
packed=0xffff5908a9400001 -> node=0xffff5908a940

Adjust lfstack code to use only 8 top bits of pointers on riscv64.

For context see:
https://groups.google.com/g/syzkaller-bugs/c/lU0GQTZoNQQ/m/O_c3vmE3AAAJ

Update #54104

Change-Id: Ib5d3d6a79c0c6eddf11618d73fcc8bc1832a9c25
Reviewed-on: https://go-review.googlesource.com/c/go/+/409055
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/lfstack_64bit.go