Date: Tue, 5 Nov 2013 06:13:46 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257679 - in head/sys/cddl/contrib/opensolaris/uts: common/sys intel/dtrace Message-ID: <201311050613.rA56DkiT028871@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Tue Nov 5 06:13:46 2013 New Revision: 257679 URL: http://svnweb.freebsd.org/changeset/base/257679 Log: Use suword32 and suword64 instead of copyout(9). This fixes a bug in the emulation of the call instruction caused by reversing the uaddr and kaddr arguments when copying data out to userland: the suword* functions take the uaddr as the first argument whereas copyout(9) takes the kaddr as the first argument. This also partially undoes the fixes from r257143. Submitted by: Prashanth Kumar <pra_udupi@yahoo.co.in> (original version) MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Tue Nov 5 05:18:18 2013 (r257678) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Tue Nov 5 06:13:46 2013 (r257679) @@ -158,15 +158,15 @@ typedef struct fasttrap_hash { */ #define fasttrap_copyout copyout #define fasttrap_fuword32 fuword32 -#define fasttrap_suword32(_k, _u) copyout((_k), (_u), sizeof(uint32_t)) -#define fasttrap_suword64(_k, _u) copyout((_k), (_u), sizeof(uint64_t)) +#define fasttrap_suword32 suword32 +#define fasttrap_suword64 suword64 #ifdef __amd64__ #define fasttrap_fulword fuword64 -#define fasttrap_sulword fasttrap_suword64 +#define fasttrap_sulword suword64 #else #define fasttrap_fulword fuword32 -#define fasttrap_sulword fasttrap_suword32 +#define fasttrap_sulword suword32 #endif extern void fasttrap_sigtrap(proc_t *, kthread_t *, uintptr_t); Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue Nov 5 05:18:18 2013 (r257678) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue Nov 5 06:13:46 2013 (r257679) @@ -1399,12 +1399,12 @@ fasttrap_pid_probe(struct reg *rp) #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { rp->r_rsp -= sizeof (uintptr_t); - ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_sulword((void *)rp->r_rsp, rp->r_rbp); } else { #endif #ifdef __i386__ rp->r_rsp -= sizeof (uint32_t); - ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_suword32((void *)rp->r_rsp, rp->r_rbp); #endif #ifdef __amd64 } @@ -1499,13 +1499,13 @@ fasttrap_pid_probe(struct reg *rp) if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); pcps = pc + tp->ftt_size; - ret = fasttrap_sulword((void *)addr, &pcps); + ret = fasttrap_sulword((void *)addr, pcps); } else { #endif #ifdef __i386__ addr = rp->r_rsp - sizeof (uint32_t); pcps = (uint32_t)(pc + tp->ftt_size); - ret = fasttrap_suword32((void *)addr, &pcps); + ret = fasttrap_suword32((void *)addr, pcps); #endif #ifdef __amd64 }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311050613.rA56DkiT028871>