Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/amd64 Do not compute code value more than onc...



details:   https://anonhg.NetBSD.org/src/rev/cf3d329b0d7a
branches:  trunk
changeset: 329252:cf3d329b0d7a
user:      njoly <njoly%NetBSD.org@localhost>
date:      Fri May 16 12:55:43 2014 +0000

description:
Do not compute code value more than once. Remove unneeded before
trace_enter()/trace_exit() calls.

This fix some cases where tracing show unexpected SYSRET number value
because some syscalls, such as setcontext(2), modified the trapframe
register values.

diffstat:

 sys/arch/amd64/amd64/netbsd32_syscall.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (36 lines):

diff -r bf1999e2fb2f -r cf3d329b0d7a sys/arch/amd64/amd64/netbsd32_syscall.c
--- a/sys/arch/amd64/amd64/netbsd32_syscall.c   Fri May 16 12:22:32 2014 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_syscall.c   Fri May 16 12:55:43 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_syscall.c,v 1.31 2010/12/20 00:25:24 matt Exp $       */
+/*     $NetBSD: netbsd32_syscall.c,v 1.32 2014/05/16 12:55:43 njoly Exp $      */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscall.c,v 1.31 2010/12/20 00:25:24 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscall.c,v 1.32 2014/05/16 12:55:43 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -86,8 +86,6 @@
                error = copyin(params, args, callp->sy_argsize);
                if (__predict_false(error != 0))
                        goto bad;
-               /* Recover 'code' - not in a register */
-               code = frame->tf_rax & (SYS_NSYSENT - 1);
        }
 
        if (__predict_false(p->p_trace_enabled)
@@ -107,8 +105,6 @@
 out:
        if (__predict_false(p->p_trace_enabled)
            && !__predict_false(callp->sy_flags & SYCALL_INDIRECT)) {
-               /* Recover 'code' - the compiler doesn't assign it a register */
-               code = frame->tf_rax & (SYS_NSYSENT - 1);
                trace_exit(code, rval, error);
        }
 



Home | Main Index | Thread Index | Old Index