Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Mar 2019 20:43:31 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r345250 - in stable/12/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace
Message-ID:  <201903172043.x2HKhVtE007600@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sun Mar 17 20:43:31 2019
New Revision: 345250
URL: https://svnweb.freebsd.org/changeset/base/345250

Log:
  MFC r344599:
  Fix fasttrap_sig{trap,segv}().

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  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/common/dtrace/fasttrap.c
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Sun Mar 17 20:43:01 2019	(r345249)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Sun Mar 17 20:43:31 2019	(r345250)
@@ -291,30 +291,15 @@ fasttrap_hash_str(const char *p)
 void
 fasttrap_sigtrap(proc_t *p, kthread_t *t, uintptr_t pc)
 {
-#ifdef illumos
-	sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP);
+	ksiginfo_t ksi;
 
-	sqp->sq_info.si_signo = SIGTRAP;
-	sqp->sq_info.si_code = TRAP_DTRACE;
-	sqp->sq_info.si_addr = (caddr_t)pc;
-
-	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);
-	ksi->ksi_signo = SIGTRAP;
-	ksi->ksi_code = TRAP_DTRACE;
-	ksi->ksi_addr = (caddr_t)pc;
+	ksiginfo_init(&ksi);
+	ksi.ksi_signo = SIGTRAP;
+	ksi.ksi_code = TRAP_DTRACE;
+	ksi.ksi_addr = (caddr_t)pc;
 	PROC_LOCK(p);
-	(void) tdsendsignal(p, t, SIGTRAP, ksi);
+	(void)tdsendsignal(p, t, SIGTRAP, &ksi);
 	PROC_UNLOCK(p);
-#endif
 }
 
 #ifndef illumos

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:43:01 2019	(r345249)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c	Sun Mar 17 20:43:31 2019	(r345250)
@@ -735,13 +735,15 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p
 static void
 fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr)
 {
-	ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP);
+	ksiginfo_t ksi;
 
-	ksiginfo_init(ksi);
-	ksi->ksi_signo = SIGSEGV;
-	ksi->ksi_code = SEGV_MAPERR;
-	ksi->ksi_addr = (caddr_t)addr;
-	(void) tdksignal(t, SIGSEGV, ksi);
+	ksiginfo_init(&ksi);
+	ksi.ksi_signo = SIGSEGV;
+	ksi.ksi_code = SEGV_MAPERR;
+	ksi.ksi_addr = (caddr_t)addr;
+	PROC_LOCK(p);
+	(void)tdksignal(t, SIGSEGV, &ksi);
+	PROC_UNLOCK(p);
 }
 
 #ifdef __amd64



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