From f1e1c4ad735442a774247f392085c21081f9c732 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Mon, 24 Aug 2020 22:12:45 +0000 Subject: [PATCH] Restore workaround for sysret fault on non-canonical address after LA57. Sponsored by: The FreeBSD Foundation --- sys/amd64/amd64/trap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 5ae1e7f3112..d5199dab288 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); -- 2.45.2