From owner-svn-src-stable-12@freebsd.org Sun Mar 17 20:43:02 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9025E1549C4C; Sun, 17 Mar 2019 20:43:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 323EC8FF27; Sun, 17 Mar 2019 20:43:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B8CDF47B; Sun, 17 Mar 2019 20:43:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2HKh1Me007535; Sun, 17 Mar 2019 20:43:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2HKh1Pk007534; Sun, 17 Mar 2019 20:43:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201903172043.x2HKh1Pk007534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Mar 2019 20:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345249 - stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Commit-Revision: 345249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 323EC8FF27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Mar 2019 20:43:02 -0000 Author: markj Date: Sun Mar 17 20:43:01 2019 New Revision: 345249 URL: https://svnweb.freebsd.org/changeset/base/345249 Log: MFC r344588: Remove illumos-specific code from the x86 fasttrap_isa.c. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Mar 17 20:41:06 2019 (r345248) +++ stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Mar 17 20:43:01 2019 (r345249) @@ -28,21 +28,11 @@ * Use is subject to license terms. */ -#ifdef illumos -#pragma ident "%Z%%M% %I% %E% SMI" -#endif - #include #include #include #include #include -#ifdef illumos -#include -#include -#include -#include -#else #include #include #include @@ -53,14 +43,8 @@ #include #include #include -#endif #include -#ifdef illumos -#include -#include -#else #include -#endif /* illumos */ #ifdef __i386__ #define r_rax r_eax @@ -707,16 +691,9 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p fasttrap_tracepoint_t *tp; fasttrap_bucket_t *bucket; fasttrap_id_t *id; -#ifdef illumos - kmutex_t *pid_mtx; - - pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; - mutex_enter(pid_mtx); -#else struct rm_priotracker tracker; rm_rlock(&fasttrap_tp_lock, &tracker); -#endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) { @@ -731,11 +708,7 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p * is not essential to the correct execution of the process. */ if (tp == NULL) { -#ifdef illumos - mutex_exit(pid_mtx); -#else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif return; } @@ -756,30 +729,12 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p rp->r_rax, rp->r_rbx, 0, 0); } -#ifdef illumos - mutex_exit(pid_mtx); -#else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif } static void fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr) { -#ifdef illumos - sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); - - sqp->sq_info.si_signo = SIGSEGV; - sqp->sq_info.si_code = SEGV_MAPERR; - sqp->sq_info.si_addr = (caddr_t)addr; - - mutex_enter(&p->p_lock); - sigaddqa(p, t, sqp); - mutex_exit(&p->p_lock); - - if (t != NULL) - aston(t); -#else ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); ksiginfo_init(ksi); @@ -787,7 +742,6 @@ fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t ad ksi->ksi_code = SEGV_MAPERR; ksi->ksi_addr = (caddr_t)addr; (void) tdksignal(t, SIGSEGV, ksi); -#endif } #ifdef __amd64 @@ -971,9 +925,6 @@ fasttrap_pid_probe(struct trapframe *tf) uintptr_t pc; uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; -#ifdef illumos - kmutex_t *pid_mtx; -#endif fasttrap_tracepoint_t *tp, tp_local; pid_t pid; dtrace_icookie_t cookie; @@ -1013,15 +964,6 @@ fasttrap_pid_probe(struct trapframe *tf) * parent. We know that there's only one thread of control in such a * process: this one. */ -#ifdef illumos - while (p->p_flag & SVFORK) { - p = p->p_parent; - } - - pid = p->p_pid; - pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; - mutex_enter(pid_mtx); -#else pp = p; sx_slock(&proctree_lock); while (pp->p_vmspace == pp->p_pptr->p_vmspace) @@ -1045,7 +987,6 @@ fasttrap_pid_probe(struct trapframe *tf) sx_sunlock(&proctree_lock); rm_rlock(&fasttrap_tp_lock, &tracker); -#endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -1064,10 +1005,6 @@ fasttrap_pid_probe(struct trapframe *tf) * fasttrap_ioctl), or somehow we have mislaid this tracepoint. */ if (tp == NULL) { -#ifdef illumos - mutex_exit(pid_mtx); - return (-1); -#else rm_runlock(&fasttrap_tp_lock, &tracker); gen = atomic_load_acq_64(&pp->p_fasttrap_tp_gen); if (pp != p) @@ -1088,7 +1025,6 @@ fasttrap_pid_probe(struct trapframe *tf) return (0); } return (-1); -#endif } if (pp != p) PRELE(pp); @@ -1210,11 +1146,7 @@ fasttrap_pid_probe(struct trapframe *tf) * tracepoint again later if we need to light up any return probes. */ tp_local = *tp; -#ifdef illumos - mutex_exit(pid_mtx); -#else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif tp = &tp_local; /* @@ -1534,28 +1466,6 @@ fasttrap_pid_probe(struct trapframe *tf) uint8_t scratch[2 * FASTTRAP_MAX_INSTR_SIZE + 7]; #endif uint_t i = 0; -#ifdef illumos - klwp_t *lwp = ttolwp(curthread); - - /* - * Compute the address of the ulwp_t and step over the - * ul_self pointer. The method used to store the user-land - * thread pointer is very different on 32- and 64-bit - * kernels. - */ -#if defined(__amd64) - if (p->p_model == DATAMODEL_LP64) { - addr = lwp->lwp_pcb.pcb_fsbase; - addr += sizeof (void *); - } else { - addr = lwp->lwp_pcb.pcb_gsbase; - addr += sizeof (caddr32_t); - } -#else - addr = USD_GETBASE(&lwp->lwp_pcb.pcb_gsdesc); - addr += sizeof (void *); -#endif -#else /* !illumos */ fasttrap_scrspace_t *scrspace; scrspace = fasttrap_scraddr(curthread, tp->ftt_proc); if (scrspace == NULL) { @@ -1571,7 +1481,6 @@ fasttrap_pid_probe(struct trapframe *tf) break; } addr = scrspace->ftss_addr; -#endif /* illumos */ /* * Generic Instruction Tracing @@ -1813,11 +1722,9 @@ done: rp->r_rip = new_pc; -#ifndef illumos PROC_LOCK(p); proc_write_regs(curthread, rp); PROC_UNLOCK(p); -#endif return (0); }