summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2011-02-14 20:49:37 +0000
committerbz <bz@FreeBSD.org>2011-02-14 20:49:37 +0000
commit51beb8d1240bf64f248d6bdb6f0c4994b6ab291f (patch)
tree71b67f60a974ee2c60401ea9eeca5000f8170686 /sys/kern
parenta9d6cae20bf16335b24c919c44acd5849ea5ae10 (diff)
downloadFreeBSD-src-51beb8d1240bf64f248d6bdb6f0c4994b6ab291f.zip
FreeBSD-src-51beb8d1240bf64f248d6bdb6f0c4994b6ab291f.tar.gz
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 MFC after: 11 days
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_trap.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index bca71f5..c66de3e 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -74,6 +74,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>
@@ -126,6 +130,13 @@ userret(struct thread *td, struct trapframe *frame)
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
OpenPOWER on IntegriCloud