Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Sep 2012 18:27:12 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240244 - in head/sys: amd64/amd64 i386/i386 ia64/ia32 ia64/ia64 kern mips/mips powerpc/aim powerpc/booke sparc64/sparc64
Message-ID:  <201209081827.q88IRCnN035177@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Sat Sep  8 18:27:11 2012
New Revision: 240244
URL: http://svn.freebsd.org/changeset/base/240244

Log:
  userret() already checks for td_locks when INVARIANTS is enabled, so
  there is no need to check if Giant is acquired after it.
  
  Reviewed by:	kib
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/trap.c
  head/sys/i386/i386/trap.c
  head/sys/ia64/ia32/ia32_trap.c
  head/sys/ia64/ia64/trap.c
  head/sys/kern/kern_fork.c
  head/sys/kern/subr_trap.c
  head/sys/mips/mips/trap.c
  head/sys/powerpc/aim/trap.c
  head/sys/powerpc/booke/trap.c
  head/sys/sparc64/sparc64/trap.c

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/amd64/amd64/trap.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -632,7 +632,6 @@ trap(struct trapframe *frame)
 
 user:
 	userret(td, frame);
-	mtx_assert(&Giant, MA_NOTOWNED);
 	KASSERT(PCB_USER_FPU(td->td_pcb),
 	    ("Return from trap with kernel FPU ctx leaked"));
 userout:

Modified: head/sys/i386/i386/trap.c
==============================================================================
--- head/sys/i386/i386/trap.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/i386/i386/trap.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -775,7 +775,6 @@ trap(struct trapframe *frame)
 
 user:
 	userret(td, frame);
-	mtx_assert(&Giant, MA_NOTOWNED);
 	KASSERT(PCB_USER_FPU(td->td_pcb),
 	    ("Return from trap with kernel FPU ctx leaked"));
 userout:

Modified: head/sys/ia64/ia32/ia32_trap.c
==============================================================================
--- head/sys/ia64/ia32/ia32_trap.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/ia64/ia32/ia32_trap.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -278,6 +278,5 @@ ia32_trap(int vector, struct trapframe *
 
 out:
 	userret(td, tf);
-	mtx_assert(&Giant, MA_NOTOWNED);
 	do_ast(tf);
 }

Modified: head/sys/ia64/ia64/trap.c
==============================================================================
--- head/sys/ia64/ia64/trap.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/ia64/ia64/trap.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -841,7 +841,6 @@ trap(int vector, struct trapframe *tf)
 out:
 	if (user) {
 		userret(td, tf);
-		mtx_assert(&Giant, MA_NOTOWNED);
 		do_ast(tf);
 	}
 	return;

Modified: head/sys/kern/kern_fork.c
==============================================================================
--- head/sys/kern/kern_fork.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/kern/kern_fork.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -1055,5 +1055,4 @@ fork_return(struct thread *td, struct tr
 	if (KTRPOINT(td, KTR_SYSRET))
 		ktrsysret(SYS_fork, 0, 0);
 #endif
-	mtx_assert(&Giant, MA_NOTOWNED);
 }

Modified: head/sys/kern/subr_trap.c
==============================================================================
--- head/sys/kern/subr_trap.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/kern/subr_trap.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -260,7 +260,6 @@ ast(struct trapframe *framep)
 	}
 
 	userret(td, framep);
-	mtx_assert(&Giant, MA_NOTOWNED);
 }
 
 const char *

Modified: head/sys/mips/mips/trap.c
==============================================================================
--- head/sys/mips/mips/trap.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/mips/mips/trap.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -1095,7 +1095,6 @@ out:
 	 * Note: we should only get here if returning to user mode.
 	 */
 	userret(td, trapframe);
-	mtx_assert(&Giant, MA_NOTOWNED);
 	return (trapframe->pc);
 }
 

Modified: head/sys/powerpc/aim/trap.c
==============================================================================
--- head/sys/powerpc/aim/trap.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/powerpc/aim/trap.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -297,7 +297,6 @@ trap(struct trapframe *frame)
 	}
 
 	userret(td, frame);
-	mtx_assert(&Giant, MA_NOTOWNED);
 }
 
 static void

Modified: head/sys/powerpc/booke/trap.c
==============================================================================
--- head/sys/powerpc/booke/trap.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/powerpc/booke/trap.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -249,7 +249,6 @@ trap(struct trapframe *frame)
 	}
 
 	userret(td, frame);
-	mtx_assert(&Giant, MA_NOTOWNED);
 }
 
 static void

Modified: head/sys/sparc64/sparc64/trap.c
==============================================================================
--- head/sys/sparc64/sparc64/trap.c	Sat Sep  8 18:07:35 2012	(r240243)
+++ head/sys/sparc64/sparc64/trap.c	Sat Sep  8 18:27:11 2012	(r240244)
@@ -329,7 +329,6 @@ trap(struct trapframe *tf)
 		}
 
 		userret(td, tf);
-		mtx_assert(&Giant, MA_NOTOWNED);
 	} else {
 		KASSERT((tf->tf_type & T_KERNEL) != 0,
 		    ("trap: kernel trap isn't"));



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