From owner-p4-projects@FreeBSD.ORG Tue Apr 28 11:12:31 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1BC84106566B; Tue, 28 Apr 2009 11:12:31 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7A241065672 for ; Tue, 28 Apr 2009 11:12:30 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A5F918FC39 for ; Tue, 28 Apr 2009 11:12:30 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3SBCUOo077852 for ; Tue, 28 Apr 2009 11:12:30 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3SBCUYY077850 for perforce@freebsd.org; Tue, 28 Apr 2009 11:12:30 GMT (envelope-from zec@fer.hr) Date: Tue, 28 Apr 2009 11:12:30 GMT Message-Id: <200904281112.n3SBCUYY077850@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161235 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2009 11:12:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=161235 Change 161235 by zec@zec_amdx2 on 2009/04/28 11:12:12 Make VIMAGE kernels boot into single-user stage. Hehehe. Deviation from vimage branch: process's vnet affinity is hanging off directly of struct ucred, instead of having another level of indirection via struct vimage. Affected files ... .. //depot/projects/vimage-commit2/src/sys/kern/init_main.c#6 edit .. //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#30 edit .. //depot/projects/vimage-commit2/src/sys/netinet6/nd6.c#31 edit .. //depot/projects/vimage-commit2/src/sys/sys/ucred.h#2 edit .. //depot/projects/vimage-commit2/src/sys/sys/vimage.h#45 edit Differences ... ==== //depot/projects/vimage-commit2/src/sys/kern/init_main.c#6 (text+ko) ==== @@ -74,6 +74,7 @@ #include #include #include +#include #include @@ -452,6 +453,9 @@ p->p_ucred->cr_uidinfo = uifind(0); p->p_ucred->cr_ruidinfo = uifind(0); p->p_ucred->cr_prison = NULL; /* Don't jail it. */ +#ifdef VIMAGE + p->p_ucred->cr_vnet = LIST_FIRST(&vnet_head); +#endif #ifdef AUDIT audit_cred_kproc0(p->p_ucred); #endif ==== //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#30 (text+ko) ==== @@ -289,8 +289,9 @@ in6_rtqtimo(void *rock) { CURVNET_SET_QUIET((struct vnet *) rock); + INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); - struct radix_node_head *rnh = rock; + struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; struct rtqk_arg arg; struct timeval atv; static time_t last_adjusted_timeout = 0; @@ -376,8 +377,9 @@ in6_mtutimo(void *rock) { CURVNET_SET_QUIET((struct vnet *) rock); + INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); - struct radix_node_head *rnh = rock; + struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; struct mtuex_arg arg; struct timeval atv; @@ -403,7 +405,7 @@ in6_rtqdrain(void) { INIT_VNET_NET(curvnet); - struct radix_node_head *rnh = V_rt_tables[AF_INET6]; + struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; struct rtqk_arg arg; arg.found = arg.killed = 0; @@ -427,6 +429,9 @@ int in6_inithead(void **head, int off) { +#ifdef INVARIANTS + INIT_VNET_NET(curvnet); +#endif INIT_VNET_INET6(curvnet); struct radix_node_head *rnh; @@ -442,11 +447,12 @@ V_rtq_timeout6 = RTQ_TIMEOUT; rnh = *head; + KASSERT(rnh == V_rt_tables[0][AF_INET6], ("rnh?")); rnh->rnh_addaddr = in6_addroute; rnh->rnh_matchaddr = in6_matroute; callout_init(&V_rtq_timer6, CALLOUT_MPSAFE); - in6_rtqtimo(rnh); /* kick off timeout first time */ callout_init(&V_rtq_mtutimer, CALLOUT_MPSAFE); - in6_mtutimo(rnh); /* kick off timeout first time */ + in6_rtqtimo(curvnet); /* kick off timeout first time */ + in6_mtutimo(curvnet); /* kick off timeout first time */ return 1; } ==== //depot/projects/vimage-commit2/src/sys/netinet6/nd6.c#31 (text+ko) ==== @@ -600,8 +600,8 @@ void nd6_timer(void *arg) { - CURVNET_SET_QUIET((struct vnet *) arg); /* XXX revisit! */ - INIT_VNET_INET6(curvnet); /* XXX revisit! */ + CURVNET_SET((struct vnet *) arg); + INIT_VNET_INET6(curvnet); int s; struct nd_defrouter *dr; struct nd_prefix *pr; @@ -609,7 +609,7 @@ struct in6_addrlifetime *lt6; callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, - nd6_timer, NULL); + nd6_timer, arg); /* expire default router list */ s = splnet(); ==== //depot/projects/vimage-commit2/src/sys/sys/ucred.h#2 (text+ko) ==== @@ -55,7 +55,8 @@ struct uidinfo *cr_uidinfo; /* per euid resource consumption */ struct uidinfo *cr_ruidinfo; /* per ruid resource consumption */ struct prison *cr_prison; /* jail(2) */ - void *cr_pspare[3]; /* vimage 2; general use 1 */ + struct vnet *cr_vnet; /* vimage / vnet */ + void *cr_pspare[2]; /* vimage 1; general use 1 */ #define cr_endcopy cr_label struct label *cr_label; /* MAC label */ struct auditinfo_addr cr_audit; /* Audit properties. */ ==== //depot/projects/vimage-commit2/src/sys/sys/vimage.h#45 (text+ko) ==== @@ -246,7 +246,7 @@ #define VNET_FOREACH(arg) #endif -#define TD_TO_VNET(td) curvnet +#define TD_TO_VNET(td) (td)->td_ucred->cr_vnet /* Non-VIMAGE null-macros */ #define IS_DEFAULT_VNET(arg) 1