aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/amd64/trap.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-08-24 22:12:45 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-08-24 22:12:45 +0000
commitf1e1c4ad735442a774247f392085c21081f9c732 (patch)
treef8f2c53315a0c85d3f9b02c5f43c45662ba60dde /sys/amd64/amd64/trap.c
parent2a5220e12e0dea19efdda014e4759186fece3a18 (diff)
downloadsrc-f1e1c4ad735442a774247f392085c21081f9c732.tar.gz
src-f1e1c4ad735442a774247f392085c21081f9c732.zip
Restore workaround for sysret fault on non-canonical address after LA57.
Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=364734
Diffstat (limited to 'sys/amd64/amd64/trap.c')
-rw-r--r--sys/amd64/amd64/trap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 5ae1e7f3112b..d5199dab2881 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -1189,7 +1189,8 @@ amd64_syscall(struct thread *td, int traced)
* not be safe. Instead, use the full return path which
* catches the problem safely.
*/
- if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS))
+ if (__predict_false(td->td_frame->tf_rip >= (la57 ?
+ VM_MAXUSER_ADDRESS_LA57 : VM_MAXUSER_ADDRESS_LA48)))
set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
amd64_syscall_ret_flush_l1d_check_inline(td->td_errno);