Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Apr 2011 15:27:36 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r220503 - stable/8/sys/kern
Message-ID:  <201104091527.p39FRas9018494@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Sat Apr  9 15:27:36 2011
New Revision: 220503
URL: http://svn.freebsd.org/changeset/base/220503

Log:
  MFC r218688:
  
    Mfp4 CH=177256:
  
      Catch a set vnet upon return to user space. This usually
      means return paths with CURVNET_RESTORE() missing.
  
      If VNET_DEBUG is turned on we can even tell the function
      that did the CURVNET_SET() which is really helpful; else
      we print "N/A".
  
      Sponsored by: The FreeBSD Foundation
      Sponsored by: CK Software GmbH
      Reviewed by:  jhb

Modified:
  stable/8/sys/kern/subr_trap.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/subr_trap.c
==============================================================================
--- stable/8/sys/kern/subr_trap.c	Sat Apr  9 14:45:50 2011	(r220502)
+++ stable/8/sys/kern/subr_trap.c	Sat Apr  9 15:27:36 2011	(r220503)
@@ -73,6 +73,10 @@ __FBSDID("$FreeBSD$");
 
 #include <machine/cpu.h>
 
+#ifdef VIMAGE
+#include <net/vnet.h>
+#endif
+
 #ifdef XEN
 #include <vm/vm.h>
 #include <vm/vm_param.h>
@@ -125,6 +129,13 @@ userret(struct thread *td, struct trapfr
 	sched_userret(td);
 	KASSERT(td->td_locks == 0,
 	    ("userret: Returning with %d locks held.", td->td_locks));
+#ifdef VIMAGE
+	/* Unfortunately td_vnet_lpush needs VNET_DEBUG. */
+	VNET_ASSERT(curvnet == NULL,
+	    ("%s: Returning on td %p (pid %d, %s) with vnet %p set in %s",
+	    __func__, td, p->p_pid, td->td_name, curvnet,
+	    (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A"));
+#endif
 #ifdef XEN
 	PT_UPDATES_FLUSH();
 #endif



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