Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2020 22:12:45 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r364734 - head/sys/amd64/amd64
Message-ID:  <202008242212.07OMCjXH091705@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Aug 24 22:12:45 2020
New Revision: 364734
URL: https://svnweb.freebsd.org/changeset/base/364734

Log:
  Restore workaround for sysret fault on non-canonical address after LA57.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/amd64/amd64/trap.c

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Mon Aug 24 20:40:26 2020	(r364733)
+++ head/sys/amd64/amd64/trap.c	Mon Aug 24 22:12:45 2020	(r364734)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008242212.07OMCjXH091705>