summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2017-12-31 02:48:16 +0000
committerLuiz Souza <luiz@netgate.com>2018-02-19 14:44:34 -0300
commit457061d949ae73e58071fe42a7430d13af05e237 (patch)
treee76c7e74c9d27da566321e985307c79420b8c7fb
parentad10a4776f2fb0039e322a9e45c4a4746be66161 (diff)
downloadFreeBSD-src-457061d949ae73e58071fe42a7430d13af05e237.zip
FreeBSD-src-457061d949ae73e58071fe42a7430d13af05e237.tar.gz
MFC r321922:
amd64: annotate the syscall return address check with __predict_false before: 0xffffffff80b03ebb <+2059>: mov 0x460(%r14),%rax 0xffffffff80b03ec2 <+2066>: mov 0x98(%rax),%rax 0xffffffff80b03ec9 <+2073>: shr $0x2f,%rax 0xffffffff80b03ecd <+2077>: je 0xffffffff80b03edd <amd64_syscall+2093> 0xffffffff80b03ecf <+2079>: mov 0x3f8(%r14),%rax 0xffffffff80b03ed6 <+2086>: orl $0x1,0xc8(%rax) 0xffffffff80b03edd <+2093>: add $0xf8,%rsp after: 0xffffffff80b03ebb <+2059>: mov 0x460(%r14),%rax 0xffffffff80b03ec2 <+2066>: mov 0x98(%rax),%rax 0xffffffff80b03ec9 <+2073>: shr $0x2f,%rax 0xffffffff80b03ecd <+2077>: jne 0xffffffff80b03eef <amd64_syscall+2111> 0xffffffff80b03ecf <+2079>: add $0xf8,%rsp (cherry picked from commit 4ebdf0a463e767672045047ec82c75bf545e9a7c)
-rw-r--r--sys/amd64/amd64/trap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 070d722b..67c5868 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -933,6 +933,6 @@ amd64_syscall(struct thread *td, int traced)
* not be safe. Instead, use the full return path which
* catches the problem safely.
*/
- if (td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS)
+ if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS))
set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
}
OpenPOWER on IntegriCloud