From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 12:57:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54CE5106566B; Sun, 19 Jul 2009 12:57:11 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38ACB8FC0C; Sun, 19 Jul 2009 12:57:11 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JCvATt043101; Sun, 19 Jul 2009 12:57:10 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JCvA9r043100; Sun, 19 Jul 2009 12:57:10 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200907191257.n6JCvA9r043100@svn.freebsd.org> From: Ulf Lilleengen Date: Sun, 19 Jul 2009 12:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195759 - in stable/7/sys: . contrib/pf geom/linux_lvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 12:57:11 -0000 Author: lulf Date: Sun Jul 19 12:57:10 2009 New Revision: 195759 URL: http://svn.freebsd.org/changeset/base/195759 Log: MFC r194924: - Apply the same naming rules of LVM names as done in the LVM code itself. PR: kern/135874 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/geom/linux_lvm/g_linux_lvm.c Modified: stable/7/sys/geom/linux_lvm/g_linux_lvm.c ============================================================================== --- stable/7/sys/geom/linux_lvm/g_linux_lvm.c Sat Jul 18 21:50:53 2009 (r195758) +++ stable/7/sys/geom/linux_lvm/g_linux_lvm.c Sun Jul 19 12:57:10 2009 (r195759) @@ -826,14 +826,6 @@ llvm_md_decode(const u_char *data, struc return (0); } -#define GRAB_NAME(tok, name, len) \ - len = 0; \ - while (tok[len] && (isalpha(tok[len]) || isdigit(tok[len])) && \ - len < G_LLVM_NAMELEN - 1) \ - len++; \ - bcopy(tok, name, len); \ - name[len] = '\0'; - #define GRAB_INT(key, tok1, tok2, v) \ if (tok1 && tok2 && strncmp(tok1, key, sizeof(key)) == 0) { \ v = strtol(tok2, &tok1, 10); \ @@ -864,6 +856,27 @@ llvm_md_decode(const u_char *data, struc break; \ } +static size_t +llvm_grab_name(char *name, const char *tok) +{ + size_t len; + + len = 0; + if (tok == NULL) + return (0); + if (tok[0] == '-') + return (0); + if (strcmp(tok, ".") == 0 || strcmp(tok, "..") == 0) + return (0); + while (tok[len] && (isalpha(tok[len]) || isdigit(tok[len]) || + tok[len] == '.' || tok[len] == '_' || tok[len] == '-' || + tok[len] == '+') && len < G_LLVM_NAMELEN - 1) + len++; + bcopy(tok, name, len); + name[len] = '\0'; + return (len); +} + static int llvm_textconf_decode(u_char *data, int buflen, struct g_llvm_metadata *md) { @@ -872,7 +885,7 @@ llvm_textconf_decode(u_char *data, int b char *tok, *v; char name[G_LLVM_NAMELEN]; char uuid[G_LLVM_UUIDLEN]; - int len; + size_t len; if (buf == NULL || *buf == '\0') return (EINVAL); @@ -880,7 +893,7 @@ llvm_textconf_decode(u_char *data, int b tok = strsep(&buf, "\n"); if (tok == NULL) return (EINVAL); - GRAB_NAME(tok, name, len); + len = llvm_grab_name(name, tok); if (len == 0) return (EINVAL); @@ -970,7 +983,7 @@ llvm_textconf_decode_pv(char **buf, char { struct g_llvm_pv *pv; char *v; - int len; + size_t len; if (*buf == NULL || **buf == '\0') return (EINVAL); @@ -983,7 +996,7 @@ llvm_textconf_decode_pv(char **buf, char len = 0; if (tok == NULL) goto bad; - GRAB_NAME(tok, pv->pv_name, len); + len = llvm_grab_name(pv->pv_name, tok); if (len == 0) goto bad; @@ -1024,7 +1037,7 @@ llvm_textconf_decode_lv(char **buf, char struct g_llvm_lv *lv; struct g_llvm_segment *sg; char *v; - int len; + size_t len; if (*buf == NULL || **buf == '\0') return (EINVAL); @@ -1036,10 +1049,9 @@ llvm_textconf_decode_lv(char **buf, char lv->lv_vg = vg; LIST_INIT(&lv->lv_segs); - len = 0; if (tok == NULL) goto bad; - GRAB_NAME(tok, lv->lv_name, len); + len = llvm_grab_name(lv->lv_name, tok); if (len == 0) goto bad; @@ -1162,7 +1174,6 @@ bad: free(sg, M_GLLVM); return (-1); } -#undef GRAB_NAME #undef GRAB_INT #undef GRAB_STR #undef SPLIT From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 14:20:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33734106567B; Sun, 19 Jul 2009 14:20:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FEF48FC1D; Sun, 19 Jul 2009 14:20:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JEKsCd044807; Sun, 19 Jul 2009 14:20:54 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JEKrtL044792; Sun, 19 Jul 2009 14:20:53 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907191420.n6JEKrtL044792@svn.freebsd.org> From: Robert Watson Date: Sun, 19 Jul 2009 14:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195760 - in head/sys: kern net netgraph netinet netinet6 netipsec sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 14:20:54 -0000 Author: rwatson Date: Sun Jul 19 14:20:53 2009 New Revision: 195760 URL: http://svn.freebsd.org/changeset/base/195760 Log: Reimplement and/or implement vnet list locking by replacing a mostly unused custom mutex/condvar-based sleep locks with two locks: an rwlock (for non-sleeping use) and sxlock (for sleeping use). Either acquired for read is sufficient to stabilize the vnet list, but both must be acquired for write to modify the list. Replace previous no-op read locking macros, used in various places in the stack, with actual locking to prevent race conditions. Callers must declare when they may perform unbounded sleeps or not when selecting how to lock. Refactor vnet sysinits so that the vnet list and locks are initialized before kernel modules are linked, as the kernel linker will use them for modules loaded by the boot loader. Update various consumers of these KPIs based on whether they may sleep or not. Reviewed by: bz Approved by: re (kib) Modified: head/sys/kern/kern_vimage.c head/sys/net/if.c head/sys/netgraph/ng_gif.c head/sys/netinet/igmp.c head/sys/netinet/in_pcb.c head/sys/netinet/in_rmx.c head/sys/netinet/ip_input.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet6/frag6.c head/sys/netinet6/mld6.c head/sys/netipsec/key.c head/sys/sys/kernel.h head/sys/sys/vimage.h Modified: head/sys/kern/kern_vimage.c ============================================================================== --- head/sys/kern/kern_vimage.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/kern/kern_vimage.c Sun Jul 19 14:20:53 2009 (r195760) @@ -58,23 +58,22 @@ static void vnet_mod_complete_registrati static int vnet_mod_constructor(struct vnet_modlink *); static int vnet_mod_destructor(struct vnet_modlink *); -#define VNET_LIST_WLOCK() \ - mtx_lock(&vnet_list_refc_mtx); \ - while (vnet_list_refc != 0) \ - cv_wait(&vnet_list_condvar, &vnet_list_refc_mtx); +struct rwlock vnet_rwlock; +struct sx vnet_sxlock; -#define VNET_LIST_WUNLOCK() \ - mtx_unlock(&vnet_list_refc_mtx); +#define VNET_LIST_WLOCK() do { \ + sx_xlock(&vnet_sxlock); \ + rw_wlock(&vnet_rwlock); \ +} while (0) + +#define VNET_LIST_WUNLOCK() do { \ + rw_wunlock(&vnet_rwlock); \ + sx_xunlock(&vnet_sxlock); \ +} while (0) struct vnet_list_head vnet_head; - -struct cv vnet_list_condvar; -struct mtx vnet_list_refc_mtx; -int vnet_list_refc = 0; - struct vnet *vnet0; - /* * Move an ifnet to or from another vnet, specified by the jail id. */ @@ -373,16 +372,22 @@ vnet_foreach(void (*vnet_foreach_fn)(str } static void -vi_init(void *unused) +vnet_init_prelink(void *arg) { - TAILQ_INIT(&vnet_modlink_head); - TAILQ_INIT(&vnet_modpending_head); - + rw_init(&vnet_rwlock, "vnet_rwlock"); + sx_init(&vnet_sxlock, "vnet_sxlock"); LIST_INIT(&vnet_head); +} +SYSINIT(vnet_init_prelink, SI_SUB_VNET_PRELINK, SI_ORDER_FIRST, + vnet_init_prelink, NULL); + +static void +vnet0_init(void *arg) +{ - mtx_init(&vnet_list_refc_mtx, "vnet_list_refc_mtx", NULL, MTX_DEF); - cv_init(&vnet_list_condvar, "vnet_list_condvar"); + TAILQ_INIT(&vnet_modlink_head); + TAILQ_INIT(&vnet_modpending_head); /* * We MUST clear curvnet in vi_init_done() before going SMP, @@ -391,9 +396,10 @@ vi_init(void *unused) */ curvnet = prison0.pr_vnet = vnet0 = vnet_alloc(); } +SYSINIT(vnet0_init, SI_SUB_VNET, SI_ORDER_FIRST, vnet0_init, NULL); static void -vi_init_done(void *unused) +vnet_init_done(void *unused) { struct vnet_modlink *vml_iter; @@ -411,8 +417,8 @@ vi_init_done(void *unused) panic("going nowhere without my vnet modules!"); } -SYSINIT(vimage, SI_SUB_VIMAGE, SI_ORDER_FIRST, vi_init, NULL); -SYSINIT(vimage_done, SI_SUB_VIMAGE_DONE, SI_ORDER_FIRST, vi_init_done, NULL); +SYSINIT(vnet_init_done, SI_SUB_VNET_DONE, SI_ORDER_FIRST, vnet_init_done, + NULL); #ifdef DDB DB_SHOW_COMMAND(vnets, db_show_vnets) Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/net/if.c Sun Jul 19 14:20:53 2009 (r195760) @@ -1793,8 +1793,8 @@ if_slowtimo(void *arg) struct ifnet *ifp; int s = splimp(); + VNET_LIST_RLOCK_NOSLEEP(); IFNET_RLOCK(); - VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { @@ -1805,8 +1805,8 @@ if_slowtimo(void *arg) } CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); IFNET_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); splx(s); timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ); } Modified: head/sys/netgraph/ng_gif.c ============================================================================== --- head/sys/netgraph/ng_gif.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netgraph/ng_gif.c Sun Jul 19 14:20:53 2009 (r195760) @@ -561,8 +561,8 @@ ng_gif_mod_event(module_t mod, int event ng_gif_input_orphan_p = ng_gif_input_orphan; /* Create nodes for any already-existing gif interfaces */ + VNET_LIST_RLOCK_NOSLEEP(); IFNET_RLOCK(); - VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET_QUIET(vnet_iter); /* XXX revisit quiet */ TAILQ_FOREACH(ifp, &V_ifnet, if_link) { @@ -571,8 +571,8 @@ ng_gif_mod_event(module_t mod, int event } CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); IFNET_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); break; case MOD_UNLOAD: Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netinet/igmp.c Sun Jul 19 14:20:53 2009 (r195760) @@ -1616,13 +1616,13 @@ igmp_fasttimo(void) { VNET_ITERATOR_DECL(vnet_iter); - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); igmp_fasttimo_vnet(); CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } /* @@ -2159,13 +2159,13 @@ igmp_slowtimo(void) { VNET_ITERATOR_DECL(vnet_iter); - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); igmp_slowtimo_vnet(); CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } /* Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netinet/in_pcb.c Sun Jul 19 14:20:53 2009 (r195760) @@ -1570,7 +1570,7 @@ ipport_tick(void *xtp) { VNET_ITERATOR_DECL(vnet_iter); - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); /* XXX appease INVARIANTS here */ if (V_ipport_tcpallocs <= @@ -1582,7 +1582,7 @@ ipport_tick(void *xtp) V_ipport_tcplastcount = V_ipport_tcpallocs; CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); callout_reset(&ipport_tick_callout, hz, ipport_tick, NULL); } Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netinet/in_rmx.c Sun Jul 19 14:20:53 2009 (r195760) @@ -319,7 +319,7 @@ in_rtqdrain(void) struct rtqk_arg arg; int fibnum; - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); @@ -336,7 +336,7 @@ in_rtqdrain(void) } CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } static int _in_rt_was_here; Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netinet/ip_input.c Sun Jul 19 14:20:53 2009 (r195760) @@ -1193,8 +1193,8 @@ ip_slowtimo(void) struct ipq *fp; int i; + VNET_LIST_RLOCK_NOSLEEP(); IPQ_LOCK(); - VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); for (i = 0; i < IPREASS_NHASH; i++) { @@ -1228,8 +1228,8 @@ ip_slowtimo(void) } CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); IPQ_UNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } /* @@ -1241,8 +1241,8 @@ ip_drain(void) VNET_ITERATOR_DECL(vnet_iter); int i; + VNET_LIST_RLOCK_NOSLEEP(); IPQ_LOCK(); - VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); for (i = 0; i < IPREASS_NHASH; i++) { @@ -1254,8 +1254,8 @@ ip_drain(void) } CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); IPQ_UNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); in_rtqdrain(); } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netinet/tcp_subr.c Sun Jul 19 14:20:53 2009 (r195760) @@ -940,7 +940,7 @@ tcp_drain(void) if (!do_tcpdrain) return; - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); struct inpcb *inpb; @@ -976,7 +976,7 @@ tcp_drain(void) INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } /* @@ -1576,7 +1576,7 @@ tcp_isn_tick(void *xtp) VNET_ITERATOR_DECL(vnet_iter); u_int32_t projected_offset; - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); ISN_LOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); /* XXX appease INVARIANTS */ @@ -1590,7 +1590,7 @@ tcp_isn_tick(void *xtp) CURVNET_RESTORE(); } ISN_UNLOCK(); - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL); } Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netinet/tcp_timer.c Sun Jul 19 14:20:53 2009 (r195760) @@ -127,7 +127,7 @@ tcp_slowtimo(void) { VNET_ITERATOR_DECL(vnet_iter); - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); tcp_maxidle = tcp_keepcnt * tcp_keepintvl; @@ -136,7 +136,7 @@ tcp_slowtimo(void) INP_INFO_WUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } int tcp_syn_backoff[TCP_MAXRXTSHIFT + 1] = Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netinet6/frag6.c Sun Jul 19 14:20:53 2009 (r195760) @@ -720,8 +720,8 @@ frag6_slowtimo(void) VNET_ITERATOR_DECL(vnet_iter); struct ip6q *q6; + VNET_LIST_RLOCK_NOSLEEP(); IP6Q_LOCK(); - VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); q6 = V_ip6q.ip6q_next; @@ -748,8 +748,8 @@ frag6_slowtimo(void) } CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); IP6Q_UNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } /* @@ -760,9 +760,11 @@ frag6_drain(void) { VNET_ITERATOR_DECL(vnet_iter); - if (IP6Q_TRYLOCK() == 0) + VNET_LIST_RLOCK_NOSLEEP(); + if (IP6Q_TRYLOCK() == 0) { + VNET_LIST_RUNLOCK_NOSLEEP(); return; - VNET_LIST_RLOCK(); + } VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); while (V_ip6q.ip6q_next != &V_ip6q) { @@ -772,6 +774,6 @@ frag6_drain(void) } CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); IP6Q_UNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netinet6/mld6.c Sun Jul 19 14:20:53 2009 (r195760) @@ -1306,13 +1306,13 @@ mld_fasttimo(void) { VNET_ITERATOR_DECL(vnet_iter); - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); mld_fasttimo_vnet(); CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } /* @@ -1721,13 +1721,13 @@ mld_slowtimo(void) { VNET_ITERATOR_DECL(vnet_iter); - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); mld_slowtimo_vnet(); CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } /* Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/netipsec/key.c Sun Jul 19 14:20:53 2009 (r195760) @@ -4537,7 +4537,7 @@ key_timehandler(void) VNET_ITERATOR_DECL(vnet_iter); time_t now = time_second; - VNET_LIST_RLOCK(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); key_flush_spd(now); @@ -4546,7 +4546,7 @@ key_timehandler(void) key_flush_spacq(now); CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); #ifndef IPSEC_DEBUG2 /* do exchange to tick time !! */ Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/sys/kernel.h Sun Jul 19 14:20:53 2009 (r195760) @@ -106,13 +106,14 @@ enum sysinit_sub_id { SI_SUB_MTX_POOL_DYNAMIC = 0x1AC0000, /* dynamic mutex pool */ SI_SUB_LOCK = 0x1B00000, /* various locks */ SI_SUB_EVENTHANDLER = 0x1C00000, /* eventhandler init */ + SI_SUB_VNET_PRELINK = 0x1E00000, /* vnet init before modules */ SI_SUB_KLD = 0x2000000, /* KLD and module setup */ SI_SUB_CPU = 0x2100000, /* CPU resource(s)*/ SI_SUB_KDTRACE = 0x2140000, /* Kernel dtrace hooks */ SI_SUB_MAC = 0x2180000, /* TrustedBSD MAC subsystem */ SI_SUB_MAC_POLICY = 0x21C0000, /* TrustedBSD MAC policies */ SI_SUB_MAC_LATE = 0x21D0000, /* TrustedBSD MAC subsystem */ - SI_SUB_VIMAGE = 0x21E0000, /* vimage infrastructure */ + SI_SUB_VNET = 0x21E0000, /* vnet 0 */ SI_SUB_INTRINSIC = 0x2200000, /* proc 0*/ SI_SUB_VM_CONF = 0x2300000, /* config VM, set limits*/ SI_SUB_DDB_SERVICES = 0x2380000, /* capture, scripting, etc. */ @@ -158,7 +159,7 @@ enum sysinit_sub_id { SI_SUB_SWAP = 0xc000000, /* swap */ SI_SUB_INTRINSIC_POST = 0xd000000, /* proc 0 cleanup*/ SI_SUB_SYSCALLS = 0xd800000, /* register system calls */ - SI_SUB_VIMAGE_DONE = 0xdc00000, /* vnet registration complete */ + SI_SUB_VNET_DONE = 0xdc00000, /* vnet registration complete */ SI_SUB_KTHREAD_INIT = 0xe000000, /* init process*/ SI_SUB_KTHREAD_PAGE = 0xe400000, /* pageout daemon*/ SI_SUB_KTHREAD_VM = 0xe800000, /* vm daemon*/ Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Sun Jul 19 12:57:10 2009 (r195759) +++ head/sys/sys/vimage.h Sun Jul 19 14:20:53 2009 (r195760) @@ -38,6 +38,9 @@ #ifdef _KERNEL +#include +#include + #ifdef INVARIANTS #define VNET_DEBUG #endif @@ -176,17 +179,42 @@ struct vnet { #endif /* !VIMAGE */ #ifdef VIMAGE +/* + * Global linked list of all virtual network stacks, along with read locks to + * access it. If a caller may sleep while accessing the list, it must use + * the sleepable lock macros. + */ LIST_HEAD(vnet_list_head, vnet); extern struct vnet_list_head vnet_head; -extern struct vnet *vnet0; -#define VNET_ITERATOR_DECL(arg) struct vnet *arg; -#define VNET_FOREACH(arg) LIST_FOREACH(arg, &vnet_head, vnet_le) -#else +extern struct rwlock vnet_rwlock; +extern struct sx vnet_sxlock; + +#define VNET_LIST_RLOCK() sx_slock(&vnet_sxlock) +#define VNET_LIST_RLOCK_NOSLEEP() rw_rlock(&vnet_rwlock) +#define VNET_LIST_RUNLOCK() sx_sunlock(&vnet_sxlock) +#define VNET_LIST_RUNLOCK_NOSLEEP() rw_runlock(&vnet_rwlock) + +/* + * Iteration macros to walk the global list of virtual network stacks. + */ +#define VNET_ITERATOR_DECL(arg) struct vnet *arg +#define VNET_FOREACH(arg) LIST_FOREACH((arg), &vnet_head, vnet_le) + +#else /* !VIMAGE */ +/* + * No-op macros for the !VIMAGE case. + */ +#define VNET_LIST_RLOCK() +#define VNET_LIST_RLOCK_NOSLEEP() +#define VNET_LIST_RUNLOCK() +#define VNET_LIST_RUNLOCK_NOSLEEP() #define VNET_ITERATOR_DECL(arg) #define VNET_FOREACH(arg) -#endif + +#endif /* VIMAGE */ #ifdef VIMAGE +extern struct vnet *vnet0; #define IS_DEFAULT_VNET(arg) ((arg) == vnet0) #else #define IS_DEFAULT_VNET(arg) 1 @@ -202,10 +230,6 @@ extern struct vnet *vnet0; #define P_TO_VNET(p) NULL #endif /* VIMAGE */ -/* Non-VIMAGE null-macros */ -#define VNET_LIST_RLOCK() -#define VNET_LIST_RUNLOCK() - #endif /* _KERNEL */ #endif /* !_SYS_VIMAGE_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 15:21:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8D831065670; Sun, 19 Jul 2009 15:21:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6C2C8FC08; Sun, 19 Jul 2009 15:21:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JFLgUW045971; Sun, 19 Jul 2009 15:21:42 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JFLgrn045969; Sun, 19 Jul 2009 15:21:42 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907191521.n6JFLgrn045969@svn.freebsd.org> From: Robert Watson Date: Sun, 19 Jul 2009 15:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195761 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 15:21:43 -0000 Author: rwatson Date: Sun Jul 19 15:21:42 2009 New Revision: 195761 URL: http://svn.freebsd.org/changeset/base/195761 Log: Expose the definitions of 'struct vnet' and 'VNET_MAGIC_N' to userspace if _WANT_VNET is defined. This is required so that libkvm can locate virtual network stack instances in order to reach their global variables for monitoring and crashdump analysis. Reviewed by: bz Approved by: re (kib) Modified: head/sys/sys/vimage.h Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Sun Jul 19 14:20:53 2009 (r195760) +++ head/sys/sys/vimage.h Sun Jul 19 15:21:42 2009 (r195761) @@ -33,13 +33,31 @@ #ifndef _SYS_VIMAGE_H_ #define _SYS_VIMAGE_H_ -#include +/* + * struct vnet describes a virtualized network stack, and is primarily a + * pointer to storage for virtualized global variables. Expose to userspace + * as required for libkvm. + */ +#if defined(_KERNEL) || defined(_WANT_VNET) #include +struct vnet { + LIST_ENTRY(vnet) vnet_le; /* all vnets list */ + u_int vnet_magic_n; + u_int ifcnt; + u_int sockcnt; + void *vnet_data_mem; + uintptr_t vnet_data_base; +}; + +#define VNET_MAGIC_N 0x3e0d8f29 +#endif + #ifdef _KERNEL #include #include +#include #ifdef INVARIANTS #define VNET_DEBUG @@ -115,19 +133,8 @@ void vnet_foreach(void (*vnet_foreach_fn #endif /* VIMAGE */ -struct vnet { - LIST_ENTRY(vnet) vnet_le; /* all vnets list */ - u_int vnet_magic_n; - u_int ifcnt; - u_int sockcnt; - void *vnet_data_mem; - uintptr_t vnet_data_base; -}; - #define curvnet curthread->td_vnet -#define VNET_MAGIC_N 0x3e0d8f29 - #ifdef VIMAGE #ifdef VNET_DEBUG #define VNET_ASSERT(condition) \ From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 16:44:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07D6D106564A; Sun, 19 Jul 2009 16:44:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E90DA8FC34; Sun, 19 Jul 2009 16:44:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JGiQIT048399; Sun, 19 Jul 2009 16:44:26 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JGiQ6B048397; Sun, 19 Jul 2009 16:44:26 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907191644.n6JGiQ6B048397@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jul 2009 16:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195762 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 16:44:27 -0000 Author: rmacklem Date: Sun Jul 19 16:44:26 2009 New Revision: 195762 URL: http://svn.freebsd.org/changeset/base/195762 Log: Fix two bugs in the experimental nfs client: - When the root vnode was acquired during mounting, mnt_stat.f_iosize was still set to 0, so getnewvnode() would set bo_bsize == 0. This would confuse getblk(), so that it always returned the first block causing the problem when the root directory of the mount point was greater than one block in size. It was fixed by setting mnt_stat.f_iosize to NFS_DIRBLKSIZ before calling ncl_nget() to acquire the root vnode. - NFSMNT_INT was being set temporarily while the initial connect to a server was being done. This erroneously configured the krpc for interruptible RPCs, which caused problems because signals weren't being masked off as they would have been for interruptible mounts. This code was deleted to fix the problem. Since mount_nfs does an NFS null RPC before the mount system call, connections to the server should work ok. Tested by: swell dot k at gmail dot com Approved by: re (kensmith), kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun Jul 19 15:21:42 2009 (r195761) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun Jul 19 16:44:26 2009 (r195762) @@ -1037,7 +1037,7 @@ mountnfs(struct nfs_args *argp, struct m { struct nfsmount *nmp; struct nfsnode *np; - int error, trycnt, ret, clearintr; + int error, trycnt, ret; struct nfsvattr nfsva; static u_int64_t clval = 0; @@ -1152,20 +1152,8 @@ mountnfs(struct nfs_args *argp, struct m nmp->nm_sockreq.nr_vers = NFS_VER2; - /* - * For Connection based sockets (TCP,...) do the connect here, - * but make it interruptible, even for non-interuptible mounts. - */ - if ((nmp->nm_flag & NFSMNT_INT) == 0) { - nmp->nm_flag |= NFSMNT_INT; - clearintr = 1; - } else { - clearintr = 0; - } if ((error = newnfs_connect(nmp, &nmp->nm_sockreq, cred, td, 0))) goto bad; - if (clearintr) - nmp->nm_flag &= ~NFSMNT_INT; /* * A reference count is needed on the nfsnode representing the @@ -1194,6 +1182,12 @@ mountnfs(struct nfs_args *argp, struct m } } if (nmp->nm_fhsize > 0) { + /* + * Set f_iosize to NFS_DIRBLKSIZ so that bo_bsize gets set + * non-zero for the root vnode. f_iosize will be set correctly + * by nfs_statfs() before any I/O occurs. + */ + mp->mnt_stat.f_iosize = NFS_DIRBLKSIZ; error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np); if (error) goto bad; From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 16:48:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BECD61065670; Sun, 19 Jul 2009 16:48:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC0208FC16; Sun, 19 Jul 2009 16:48:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JGmPv5048510; Sun, 19 Jul 2009 16:48:25 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JGmP8u048508; Sun, 19 Jul 2009 16:48:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200907191648.n6JGmP8u048508@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 19 Jul 2009 16:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195763 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 16:48:26 -0000 Author: jilles Date: Sun Jul 19 16:48:25 2009 New Revision: 195763 URL: http://svn.freebsd.org/changeset/base/195763 Log: Correct AT_SYMLINK_FOLLOW flag name in linkat(2) man page. Approved by: re (kib), ed (mentor) Modified: head/lib/libc/sys/link.2 Modified: head/lib/libc/sys/link.2 ============================================================================== --- head/lib/libc/sys/link.2 Sun Jul 19 16:44:26 2009 (r195762) +++ head/lib/libc/sys/link.2 Sun Jul 19 16:48:25 2009 (r195763) @@ -110,7 +110,7 @@ are constructed by a bitwise-inclusive O list, defined in .In fcntl.h : .Bl -tag -width indent -.It Dv AT_SYMLINK_NOFOLLOW +.It Dv AT_SYMLINK_FOLLOW If .Fa name1 names a symbolic link, a new link for the target of the symbolic link is From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 16:50:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45FC6106564A; Sun, 19 Jul 2009 16:50:49 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 331108FC0C; Sun, 19 Jul 2009 16:50:49 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JGonuN048594; Sun, 19 Jul 2009 16:50:49 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JGons0048592; Sun, 19 Jul 2009 16:50:49 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907191650.n6JGons0048592@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 19 Jul 2009 16:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195764 - stable/7/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 16:50:49 -0000 Author: bms Date: Sun Jul 19 16:50:48 2009 New Revision: 195764 URL: http://svn.freebsd.org/changeset/base/195764 Log: Output debug information for global 'using' declarations, instead of just blowing up. A very similar change to this exists which is GPLv3 licensed, this is my own change. See also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31899 Reviewed by: luigi Modified: stable/7/contrib/gcc/dwarf2out.c Modified: stable/7/contrib/gcc/dwarf2out.c ============================================================================== --- stable/7/contrib/gcc/dwarf2out.c Sun Jul 19 16:48:25 2009 (r195763) +++ stable/7/contrib/gcc/dwarf2out.c Sun Jul 19 16:50:48 2009 (r195764) @@ -10007,7 +10007,7 @@ reference_to_unused (tree * tp, int * wa return NULL_TREE; else if (!cgraph_global_info_ready && (TREE_CODE (*tp) == VAR_DECL || TREE_CODE (*tp) == FUNCTION_DECL)) - gcc_unreachable (); + return *tp; else if (DECL_P (*tp) && TREE_CODE (*tp) == VAR_DECL) { struct cgraph_varpool_node *node = cgraph_varpool_node (*tp); From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 16:54:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4DC0106566B; Sun, 19 Jul 2009 16:54:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D308B8FC23; Sun, 19 Jul 2009 16:54:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JGsORR048683; Sun, 19 Jul 2009 16:54:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JGsOmj048681; Sun, 19 Jul 2009 16:54:24 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907191654.n6JGsOmj048681@svn.freebsd.org> From: Sam Leffler Date: Sun, 19 Jul 2009 16:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195765 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 16:54:25 -0000 Author: sam Date: Sun Jul 19 16:54:24 2009 New Revision: 195765 URL: http://svn.freebsd.org/changeset/base/195765 Log: add urtw Approved by: re (kib) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jul 19 16:50:48 2009 (r195764) +++ head/sys/conf/files Sun Jul 19 16:54:24 2009 (r195765) @@ -1627,6 +1627,7 @@ dev/usb/net/usb_ethernet.c \ dev/usb/wlan/if_rum.c optional rum dev/usb/wlan/if_uath.c optional uath dev/usb/wlan/if_ural.c optional ural +dev/usb/wlan/if_urtw.c optional urtw dev/usb/wlan/if_zyd.c optional zyd # # USB serial and parallel port drivers From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 16:56:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B47B11065673; Sun, 19 Jul 2009 16:56:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6BB8FC08; Sun, 19 Jul 2009 16:56:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n6JGttuR033877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Jul 2009 19:55:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n6JGttGK075465; Sun, 19 Jul 2009 19:55:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n6JGttoU075464; Sun, 19 Jul 2009 19:55:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 19 Jul 2009 19:55:55 +0300 From: Kostik Belousov To: Bruce M Simpson Message-ID: <20090719165555.GC55190@deviant.kiev.zoral.com.ua> References: <200907191650.n6JGons0048592@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cgSBEnGlXcJKhBVw" Content-Disposition: inline In-Reply-To: <200907191650.n6JGons0048592@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r195764 - stable/7/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 16:56:02 -0000 --cgSBEnGlXcJKhBVw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 19, 2009 at 04:50:49PM +0000, Bruce M Simpson wrote: > Author: bms > Date: Sun Jul 19 16:50:48 2009 > New Revision: 195764 > URL: http://svn.freebsd.org/changeset/base/195764 >=20 > Log: > Output debug information for global 'using' declarations, instead > of just blowing up. A very similar change to this exists which is > GPLv3 licensed, this is my own change. > =20 > See also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D31899 > Reviewed by: luigi >=20 > Modified: > stable/7/contrib/gcc/dwarf2out.c Was this committed to HEAD first ? Please revert ASAP if not. --cgSBEnGlXcJKhBVw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkpjUBsACgkQC3+MBN1Mb4j1QgCg4Zraa1QyMI3YfUlQ1hvfkV1j XgUAoLqPMaiEx8Gq7keDC6nbaB+DKxr+ =SqZq -----END PGP SIGNATURE----- --cgSBEnGlXcJKhBVw-- From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 17:13:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 457E8106566C; Sun, 19 Jul 2009 17:13:17 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32DA18FC24; Sun, 19 Jul 2009 17:13:17 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JHDGOm049116; Sun, 19 Jul 2009 17:13:16 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JHDGel049114; Sun, 19 Jul 2009 17:13:16 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907191713.n6JHDGel049114@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 19 Jul 2009 17:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195766 - stable/7/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 17:13:17 -0000 Author: bms Date: Sun Jul 19 17:13:16 2009 New Revision: 195766 URL: http://svn.freebsd.org/changeset/base/195766 Log: Revert previous change. Requested by: kib Modified: stable/7/contrib/gcc/dwarf2out.c Modified: stable/7/contrib/gcc/dwarf2out.c ============================================================================== --- stable/7/contrib/gcc/dwarf2out.c Sun Jul 19 16:54:24 2009 (r195765) +++ stable/7/contrib/gcc/dwarf2out.c Sun Jul 19 17:13:16 2009 (r195766) @@ -10007,7 +10007,7 @@ reference_to_unused (tree * tp, int * wa return NULL_TREE; else if (!cgraph_global_info_ready && (TREE_CODE (*tp) == VAR_DECL || TREE_CODE (*tp) == FUNCTION_DECL)) - return *tp; + gcc_unreachable (); else if (DECL_P (*tp) && TREE_CODE (*tp) == VAR_DECL) { struct cgraph_varpool_node *node = cgraph_varpool_node (*tp); From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 17:25:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC8AD106564A; Sun, 19 Jul 2009 17:25:25 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F6A88FC15; Sun, 19 Jul 2009 17:25:25 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JHPPWp049436; Sun, 19 Jul 2009 17:25:25 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JHPOBe049379; Sun, 19 Jul 2009 17:25:24 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200907191725.n6JHPOBe049379@svn.freebsd.org> From: Ken Smith Date: Sun, 19 Jul 2009 17:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195767 - in head: . cddl/lib cddl/lib/libctf cddl/lib/libdtrace gnu/lib/libdialog gnu/lib/libg2c gnu/lib/libobjc gnu/lib/libreadline gnu/lib/libregex lib lib/libalias/libalias lib/liba... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 17:25:26 -0000 Author: kensmith Date: Sun Jul 19 17:25:24 2009 New Revision: 195767 URL: http://svn.freebsd.org/changeset/base/195767 Log: Bump the version of all non-symbol-versioned shared libraries in preparation for 8.0-RELEASE. Add the previous version of those libraries to ObsoleteFiles.inc and bump __FreeBSD_Version. Reviewed by: kib Approved by: re (rwatson) Modified: head/ObsoleteFiles.inc head/UPDATING head/cddl/lib/Makefile.inc head/cddl/lib/libctf/Makefile head/cddl/lib/libdtrace/Makefile head/gnu/lib/libdialog/Makefile head/gnu/lib/libg2c/Makefile head/gnu/lib/libobjc/Makefile head/gnu/lib/libreadline/Makefile.inc head/gnu/lib/libregex/Makefile head/lib/Makefile.inc head/lib/libalias/libalias/Makefile head/lib/libarchive/Makefile head/lib/libautofs/Makefile head/lib/libbegemot/Makefile head/lib/libbluetooth/Makefile head/lib/libbsm/Makefile head/lib/libbsnmp/Makefile.inc head/lib/libbz2/Makefile head/lib/libcrypt/Makefile head/lib/libdevstat/Makefile head/lib/libdwarf/Makefile head/lib/libedit/Makefile head/lib/libexpat/Makefile head/lib/libfetch/Makefile head/lib/libftpio/Makefile head/lib/libgpib/Makefile head/lib/libipsec/Makefile head/lib/libkiconv/Makefile head/lib/libkse/Makefile head/lib/libmagic/Makefile head/lib/libmemstat/Makefile head/lib/libncp/Makefile head/lib/libnetgraph/Makefile head/lib/libngatm/Makefile head/lib/libopie/Makefile head/lib/libpam/Makefile.inc head/lib/libpcap/Makefile head/lib/libproc/Makefile head/lib/libradius/Makefile head/lib/libsdp/Makefile head/lib/libsmb/Makefile head/lib/libtacplus/Makefile head/lib/libugidfw/Makefile head/lib/libusb/Makefile head/lib/libusbhid/Makefile head/lib/libutil/Makefile head/lib/libvgl/Makefile head/lib/libwrap/Makefile head/lib/libypclnt/Makefile head/lib/ncurses/ncurses/Makefile head/secure/lib/libcrypto/Makefile head/secure/lib/libssh/Makefile head/secure/lib/libssl/Makefile head/sys/sys/param.h head/usr.sbin/bsnmpd/modules/Makefile.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jul 19 17:13:16 2009 (r195766) +++ head/ObsoleteFiles.inc Sun Jul 19 17:25:24 2009 (r195767) @@ -14,6 +14,214 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090719: library version bump for 8.0 +OLD_LIBS+=lib/libalias.so.6 +OLD_LIBS+=lib/libavl.so.1 +OLD_LIBS+=lib/libbegemot.so.3 +OLD_LIBS+=lib/libbsdxml.so.3 +OLD_LIBS+=lib/libbsnmp.so.4 +OLD_LIBS+=lib/libcam.so.4 +OLD_LIBS+=lib/libcrypt.so.4 +OLD_LIBS+=lib/libcrypto.so.5 +OLD_LIBS+=lib/libctf.so.1 +OLD_LIBS+=lib/libdevstat.so.6 +OLD_LIBS+=lib/libdtrace.so.1 +OLD_LIBS+=lib/libedit.so.6 +OLD_LIBS+=lib/libgeom.so.4 +OLD_LIBS+=lib/libipsec.so.3 +OLD_LIBS+=lib/libipx.so.4 +OLD_LIBS+=lib/libkiconv.so.3 +OLD_LIBS+=lib/libkvm.so.4 +OLD_LIBS+=lib/libmd.so.4 +OLD_LIBS+=lib/libncurses.so.7 +OLD_LIBS+=lib/libncursesw.so.7 +OLD_LIBS+=lib/libnvpair.so.1 +OLD_LIBS+=lib/libpcap.so.6 +OLD_LIBS+=lib/libreadline.so.7 +OLD_LIBS+=lib/libsbuf.so.4 +OLD_LIBS+=lib/libufs.so.4 +OLD_LIBS+=lib/libumem.so.1 +OLD_LIBS+=lib/libutil.so.7 +OLD_LIBS+=lib/libuutil.so.1 +OLD_LIBS+=lib/libz.so.4 +OLD_LIBS+=lib/libzfs.so.1 +OLD_LIBS+=lib/libzpool.so.1 +OLD_LIBS+=usr/lib/libarchive.so.4 +OLD_LIBS+=usr/lib/libauditd.so.4 +OLD_LIBS+=usr/lib/libbluetooth.so.3 +OLD_LIBS+=usr/lib/libbsm.so.2 +OLD_LIBS+=usr/lib/libbz2.so.3 +OLD_LIBS+=usr/lib/libcalendar.so.4 +OLD_LIBS+=usr/lib/libcom_err.so.4 +OLD_LIBS+=usr/lib/libdevinfo.so.4 +OLD_LIBS+=usr/lib/libdialog.so.6 +OLD_LIBS+=usr/lib/libdwarf.so.1 +OLD_LIBS+=usr/lib/libfetch.so.5 +OLD_LIBS+=usr/lib/libform.so.4 +OLD_LIBS+=usr/lib/libformw.so.4 +OLD_LIBS+=usr/lib/libftpio.so.7 +OLD_LIBS+=usr/lib/libgnuregex.so.4 +OLD_LIBS+=usr/lib/libgpib.so.2 +OLD_LIBS+=usr/lib/libhistory.so.7 +OLD_LIBS+=usr/lib/libmagic.so.3 +OLD_LIBS+=usr/lib/libmemstat.so.2 +OLD_LIBS+=usr/lib/libmenu.so.4 +OLD_LIBS+=usr/lib/libmenuw.so.4 +OLD_LIBS+=usr/lib/libmilter.so.4 +OLD_LIBS+=usr/lib/libncp.so.3 +OLD_LIBS+=usr/lib/libnetgraph.so.3 +OLD_LIBS+=usr/lib/libngatm.so.3 +OLD_LIBS+=usr/lib/libobjc.so.3 +OLD_LIBS+=usr/lib/libopie.so.5 +OLD_LIBS+=usr/lib/libpam.so.4 +OLD_LIBS+=usr/lib/libpanel.so.4 +OLD_LIBS+=usr/lib/libpanelw.so.4 +OLD_LIBS+=usr/lib/libpmc.so.4 +OLD_LIBS+=usr/lib/libproc.so.1 +OLD_LIBS+=usr/lib/libradius.so.3 +OLD_LIBS+=usr/lib/librpcsvc.so.4 +OLD_LIBS+=usr/lib/libsdp.so.3 +OLD_LIBS+=usr/lib/libsmb.so.3 +OLD_LIBS+=usr/lib/libssh.so.4 +OLD_LIBS+=usr/lib/libssl.so.5 +OLD_LIBS+=usr/lib/libtacplus.so.3 +OLD_LIBS+=usr/lib/libugidfw.so.3 +OLD_LIBS+=usr/lib/libusb.so.1 +OLD_LIBS+=usr/lib/libusbhid.so.3 +OLD_LIBS+=usr/lib/libwrap.so.5 +OLD_LIBS+=usr/lib/libypclnt.so.3 +OLD_LIBS+=usr/lib/pam_chroot.so.4 +OLD_LIBS+=usr/lib/pam_deny.so.4 +OLD_LIBS+=usr/lib/pam_echo.so.4 +OLD_LIBS+=usr/lib/pam_exec.so.4 +OLD_LIBS+=usr/lib/pam_ftpusers.so.4 +OLD_LIBS+=usr/lib/pam_group.so.4 +OLD_LIBS+=usr/lib/pam_guest.so.4 +OLD_LIBS+=usr/lib/pam_krb5.so.4 +OLD_LIBS+=usr/lib/pam_ksu.so.4 +OLD_LIBS+=usr/lib/pam_lastlog.so.4 +OLD_LIBS+=usr/lib/pam_login_access.so.4 +OLD_LIBS+=usr/lib/pam_nologin.so.4 +OLD_LIBS+=usr/lib/pam_opie.so.4 +OLD_LIBS+=usr/lib/pam_opieaccess.so.4 +OLD_LIBS+=usr/lib/pam_passwdqc.so.4 +OLD_LIBS+=usr/lib/pam_permit.so.4 +OLD_LIBS+=usr/lib/pam_radius.so.4 +OLD_LIBS+=usr/lib/pam_rhosts.so.4 +OLD_LIBS+=usr/lib/pam_rootok.so.4 +OLD_LIBS+=usr/lib/pam_securetty.so.4 +OLD_LIBS+=usr/lib/pam_self.so.4 +OLD_LIBS+=usr/lib/pam_ssh.so.4 +OLD_LIBS+=usr/lib/pam_tacplus.so.4 +OLD_LIBS+=usr/lib/pam_unix.so.4 +OLD_LIBS+=usr/lib/snmp_atm.so.5 +OLD_LIBS+=usr/lib/snmp_bridge.so.5 +OLD_LIBS+=usr/lib/snmp_hostres.so.5 +OLD_LIBS+=usr/lib/snmp_mibII.so.5 +OLD_LIBS+=usr/lib/snmp_netgraph.so.5 +OLD_LIBS+=usr/lib/snmp_pf.so.5 +.if ${TARGET_ARCH} == "amd64" +OLD_LIBS+=usr/lib32/libalias.so.6 +OLD_LIBS+=usr/lib32/libarchive.so.4 +OLD_LIBS+=usr/lib32/libauditd.so.4 +OLD_LIBS+=usr/lib32/libavl.so.1 +OLD_LIBS+=usr/lib32/libbegemot.so.3 +OLD_LIBS+=usr/lib32/libbluetooth.so.3 +OLD_LIBS+=usr/lib32/libbsdxml.so.3 +OLD_LIBS+=usr/lib32/libbsm.so.2 +OLD_LIBS+=usr/lib32/libbsnmp.so.4 +OLD_LIBS+=usr/lib32/libbz2.so.3 +OLD_LIBS+=usr/lib32/libcalendar.so.4 +OLD_LIBS+=usr/lib32/libcam.so.4 +OLD_LIBS+=usr/lib32/libcom_err.so.4 +OLD_LIBS+=usr/lib32/libcrypt.so.4 +OLD_LIBS+=usr/lib32/libcrypto.so.5 +OLD_LIBS+=usr/lib32/libctf.so.1 +OLD_LIBS+=usr/lib32/libdevinfo.so.4 +OLD_LIBS+=usr/lib32/libdevstat.so.6 +OLD_LIBS+=usr/lib32/libdialog.so.6 +OLD_LIBS+=usr/lib32/libdtrace.so.1 +OLD_LIBS+=usr/lib32/libdwarf.so.1 +OLD_LIBS+=usr/lib32/libedit.so.6 +OLD_LIBS+=usr/lib32/libfetch.so.5 +OLD_LIBS+=usr/lib32/libform.so.4 +OLD_LIBS+=usr/lib32/libformw.so.4 +OLD_LIBS+=usr/lib32/libftpio.so.7 +OLD_LIBS+=usr/lib32/libgeom.so.4 +OLD_LIBS+=usr/lib32/libgnuregex.so.4 +OLD_LIBS+=usr/lib32/libgpib.so.2 +OLD_LIBS+=usr/lib32/libhistory.so.7 +OLD_LIBS+=usr/lib32/libipsec.so.3 +OLD_LIBS+=usr/lib32/libipx.so.4 +OLD_LIBS+=usr/lib32/libkiconv.so.3 +OLD_LIBS+=usr/lib32/libkvm.so.4 +OLD_LIBS+=usr/lib32/libmagic.so.3 +OLD_LIBS+=usr/lib32/libmd.so.4 +OLD_LIBS+=usr/lib32/libmemstat.so.2 +OLD_LIBS+=usr/lib32/libmenu.so.4 +OLD_LIBS+=usr/lib32/libmenuw.so.4 +OLD_LIBS+=usr/lib32/libmilter.so.4 +OLD_LIBS+=usr/lib32/libncp.so.3 +OLD_LIBS+=usr/lib32/libncurses.so.7 +OLD_LIBS+=usr/lib32/libncursesw.so.7 +OLD_LIBS+=usr/lib32/libnetgraph.so.3 +OLD_LIBS+=usr/lib32/libngatm.so.3 +OLD_LIBS+=usr/lib32/libnvpair.so.1 +OLD_LIBS+=usr/lib32/libobjc.so.3 +OLD_LIBS+=usr/lib32/libopie.so.5 +OLD_LIBS+=usr/lib32/libpam.so.4 +OLD_LIBS+=usr/lib32/libpanel.so.4 +OLD_LIBS+=usr/lib32/libpanelw.so.4 +OLD_LIBS+=usr/lib32/libpcap.so.6 +OLD_LIBS+=usr/lib32/libpmc.so.4 +OLD_LIBS+=usr/lib32/libproc.so.1 +OLD_LIBS+=usr/lib32/libradius.so.3 +OLD_LIBS+=usr/lib32/libreadline.so.7 +OLD_LIBS+=usr/lib32/librpcsvc.so.4 +OLD_LIBS+=usr/lib32/libsbuf.so.4 +OLD_LIBS+=usr/lib32/libsdp.so.3 +OLD_LIBS+=usr/lib32/libsmb.so.3 +OLD_LIBS+=usr/lib32/libssh.so.4 +OLD_LIBS+=usr/lib32/libssl.so.5 +OLD_LIBS+=usr/lib32/libtacplus.so.3 +OLD_LIBS+=usr/lib32/libufs.so.4 +OLD_LIBS+=usr/lib32/libugidfw.so.3 +OLD_LIBS+=usr/lib32/libumem.so.1 +OLD_LIBS+=usr/lib32/libusb.so.1 +OLD_LIBS+=usr/lib32/libusbhid.so.3 +OLD_LIBS+=usr/lib32/libutil.so.7 +OLD_LIBS+=usr/lib32/libuutil.so.1 +OLD_LIBS+=usr/lib32/libvgl.so.5 +OLD_LIBS+=usr/lib32/libwrap.so.5 +OLD_LIBS+=usr/lib32/libypclnt.so.3 +OLD_LIBS+=usr/lib32/libz.so.4 +OLD_LIBS+=usr/lib32/libzfs.so.1 +OLD_LIBS+=usr/lib32/libzpool.so.1 +OLD_LIBS+=usr/lib32/pam_chroot.so.4 +OLD_LIBS+=usr/lib32/pam_deny.so.4 +OLD_LIBS+=usr/lib32/pam_echo.so.4 +OLD_LIBS+=usr/lib32/pam_exec.so.4 +OLD_LIBS+=usr/lib32/pam_ftpusers.so.4 +OLD_LIBS+=usr/lib32/pam_group.so.4 +OLD_LIBS+=usr/lib32/pam_guest.so.4 +OLD_LIBS+=usr/lib32/pam_krb5.so.4 +OLD_LIBS+=usr/lib32/pam_ksu.so.4 +OLD_LIBS+=usr/lib32/pam_lastlog.so.4 +OLD_LIBS+=usr/lib32/pam_login_access.so.4 +OLD_LIBS+=usr/lib32/pam_nologin.so.4 +OLD_LIBS+=usr/lib32/pam_opie.so.4 +OLD_LIBS+=usr/lib32/pam_opieaccess.so.4 +OLD_LIBS+=usr/lib32/pam_passwdqc.so.4 +OLD_LIBS+=usr/lib32/pam_permit.so.4 +OLD_LIBS+=usr/lib32/pam_radius.so.4 +OLD_LIBS+=usr/lib32/pam_rhosts.so.4 +OLD_LIBS+=usr/lib32/pam_rootok.so.4 +OLD_LIBS+=usr/lib32/pam_securetty.so.4 +OLD_LIBS+=usr/lib32/pam_self.so.4 +OLD_LIBS+=usr/lib32/pam_ssh.so.4 +OLD_LIBS+=usr/lib32/pam_tacplus.so.4 +OLD_LIBS+=usr/lib32/pam_unix.so.4 +.endif # 20090718: the gdm pam.d file is no longer required. OLD_FILES+=etc/pam.d/gdm # 20090713: vimage container structs removed. Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Jul 19 17:13:16 2009 (r195766) +++ head/UPDATING Sun Jul 19 17:25:24 2009 (r195767) @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090719: + Bump the shared library version numbers for all libraries that + do not use symbol versioning as part of the 8.0-RELEASE cycle. + Bump __FreeBSD_version to 800105. + 20090714: Due to changes in the implementation of virtual network stack support, all network-related kernel modules must be recompiled. Modified: head/cddl/lib/Makefile.inc ============================================================================== --- head/cddl/lib/Makefile.inc Sun Jul 19 17:13:16 2009 (r195766) +++ head/cddl/lib/Makefile.inc Sun Jul 19 17:25:24 2009 (r195767) @@ -1,6 +1,6 @@ # $FreeBSD$ SHLIBDIR?= /lib -SHLIB_MAJOR?= 1 +SHLIB_MAJOR?= 2 .include "../Makefile.inc" Modified: head/cddl/lib/libctf/Makefile ============================================================================== --- head/cddl/lib/libctf/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/cddl/lib/libctf/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -3,7 +3,7 @@ .include "../../Makefile.inc" LIB= ctf -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 SRCS= ctf_create.c \ ctf_decl.c \ Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/cddl/lib/libdtrace/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -3,7 +3,7 @@ .include "../../Makefile.inc" LIB= dtrace -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 WARNS= 1 Modified: head/gnu/lib/libdialog/Makefile ============================================================================== --- head/gnu/lib/libdialog/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/gnu/lib/libdialog/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -7,7 +7,7 @@ LIB= dialog INCS= dialog.h MAN= dialog.3 -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 7 SRCS= kernel.c rc.c checklist.c inputbox.c menubox.c msgbox.c \ lineedit.c radiolist.c textbox.c yesno.c prgbox.c raw_popen.c \ fselect.c ui_objects.c dir.c notify.c help.c gauge.c tree.c Modified: head/gnu/lib/libg2c/Makefile ============================================================================== --- head/gnu/lib/libg2c/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/gnu/lib/libg2c/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -7,7 +7,7 @@ SRCDIR= ${.CURDIR}/../../../contrib/libf .PATH: ${SRCDIR} ${SRCDIR}/libU77 ${SRCDIR}/libF77 ${SRCDIR}/libI77 LIB= g2c -SHLIB_MAJOR= 2 +SHLIB_MAJOR= 3 # Traditional FORTRAN Library members defined in libF77 Modified: head/gnu/lib/libobjc/Makefile ============================================================================== --- head/gnu/lib/libobjc/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/gnu/lib/libobjc/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -7,7 +7,7 @@ GCCLIB= ${.CURDIR}/../../../contrib/gccl .PATH: ${OBJCDIR}/objc ${OBJCDIR} LIB= objc -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SRCS= archive.c class.c encoding.c gc.c hash.c init.c linking.m misc.c \ nil_method.c NXConstStr.m Object.m objects.c Protocol.m sarray.c \ Modified: head/gnu/lib/libreadline/Makefile.inc ============================================================================== --- head/gnu/lib/libreadline/Makefile.inc Sun Jul 19 17:13:16 2009 (r195766) +++ head/gnu/lib/libreadline/Makefile.inc Sun Jul 19 17:25:24 2009 (r195767) @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIB_MAJOR=7 +SHLIB_MAJOR=8 RL_LIBRARY_VERSION=5.2 SRCDIR= ${.CURDIR}/../../../../contrib/libreadline Modified: head/gnu/lib/libregex/Makefile ============================================================================== --- head/gnu/lib/libregex/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/gnu/lib/libregex/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -3,7 +3,7 @@ SUBDIR= doc LIB= gnuregex -SHLIB_MAJOR= 4 +SHLIB_MAJOR= 5 SRCS= gnuregex.c INCSGROUPS= INCS WRINCS PXINCS Modified: head/lib/Makefile.inc ============================================================================== --- head/lib/Makefile.inc Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/Makefile.inc Sun Jul 19 17:25:24 2009 (r195767) @@ -1,3 +1,3 @@ # $FreeBSD$ # Default version for system libs (override in /Makefile if necessary) -SHLIB_MAJOR?= 4 +SHLIB_MAJOR?= 5 Modified: head/lib/libalias/libalias/Makefile ============================================================================== --- head/lib/libalias/libalias/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libalias/libalias/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -4,7 +4,7 @@ LIB= alias SHLIBDIR?= /lib -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 7 MAN= libalias.3 SRCS= alias.c alias_db.c alias_proxy.c alias_util.c alias_mod.c INCS= alias.h Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libarchive/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -7,7 +7,7 @@ LDADD= -lbz2 -lz -lmd # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system. # It has no real relation to the libarchive version number. -SHLIB_MAJOR= 4 +SHLIB_MAJOR= 5 CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I${.OBJDIR} Modified: head/lib/libautofs/Makefile ============================================================================== --- head/lib/libautofs/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libautofs/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -2,7 +2,7 @@ # $FreeBSD$ LIB= autofs -SHLIB_MAJOR= 2 +SHLIB_MAJOR= 3 WARNS?= 4 SRCS= libautofs.c Modified: head/lib/libbegemot/Makefile ============================================================================== --- head/lib/libbegemot/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libbegemot/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -5,7 +5,7 @@ LIBBEGEMOT_DIR=${.CURDIR}/../../contrib/ .PATH: ${LIBBEGEMOT_DIR} LIB= begemot -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SHLIBDIR?= /lib # WARNS?= 6 Modified: head/lib/libbluetooth/Makefile ============================================================================== --- head/lib/libbluetooth/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libbluetooth/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -7,7 +7,7 @@ MAN= bluetooth.3 WARNS?= 2 CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../sys -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SRCS= bluetooth.c dev.c hci.c INCS= bluetooth.h Modified: head/lib/libbsm/Makefile ============================================================================== --- head/lib/libbsm/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libbsm/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -6,7 +6,7 @@ OPENBSMDIR= ${.CURDIR}/../../contrib/op LIBBSMDIR= ${OPENBSMDIR}/libbsm LIB= bsm -SHLIB_MAJOR= 2 +SHLIB_MAJOR= 3 .PATH: ${LIBBSMDIR} .PATH: ${OPENBSMDIR}/bsm Modified: head/lib/libbsnmp/Makefile.inc ============================================================================== --- head/lib/libbsnmp/Makefile.inc Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libbsnmp/Makefile.inc Sun Jul 19 17:25:24 2009 (r195767) @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIB_MAJOR= 4 +SHLIB_MAJOR= 5 WARNS?= 6 NO_WERROR= INCSDIR= ${INCLUDEDIR}/bsnmp Modified: head/lib/libbz2/Makefile ============================================================================== --- head/lib/libbz2/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libbz2/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -4,7 +4,7 @@ BZ2DIR= ${.CURDIR}/../../contrib/bzip2 .PATH: ${BZ2DIR} LIB= bz2 -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SRCS= bzlib.c blocksort.c compress.c crctable.c decompress.c \ huffman.c randtable.c INCS= bzlib.h Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libcrypt/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib .include -SHLIB_MAJOR= 4 +SHLIB_MAJOR= 5 LIB= crypt .PATH: ${.CURDIR}/../libmd Modified: head/lib/libdevstat/Makefile ============================================================================== --- head/lib/libdevstat/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libdevstat/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -3,7 +3,7 @@ LIB= devstat SHLIBDIR?= /lib # Bump DEVSTAT_USER_API_VER in devstat.h every time this is incremented. -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 7 SRCS= devstat.c INCS= devstat.h Modified: head/lib/libdwarf/Makefile ============================================================================== --- head/lib/libdwarf/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libdwarf/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -21,7 +21,7 @@ INCS= dwarf.h libdwarf.h CFLAGS+= -I. -I${.CURDIR} -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 WARNS?= 6 Modified: head/lib/libedit/Makefile ============================================================================== --- head/lib/libedit/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libedit/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -3,7 +3,7 @@ # $FreeBSD$ LIB= edit -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 7 SHLIBDIR?= /lib OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \ Modified: head/lib/libexpat/Makefile ============================================================================== --- head/lib/libexpat/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libexpat/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -4,7 +4,7 @@ EXPAT= ${.CURDIR}/../../contrib/expat LIB= bsdxml SHLIBDIR?= /lib -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SRCS= xmlparse.c xmlrole.c xmltok.c INCS= bsdxml.h bsdxml_external.h MAN= libbsdxml.3 Modified: head/lib/libfetch/Makefile ============================================================================== --- head/lib/libfetch/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libfetch/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -25,7 +25,7 @@ CFLAGS+= -DFTP_COMBINE_CWDS CSTD?= c99 WARNS?= 2 -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 6 ftperr.h: ftp.errors ${.CURDIR}/Makefile @echo "static struct fetcherr ftp_errlist[] = {" > ${.TARGET} Modified: head/lib/libftpio/Makefile ============================================================================== --- head/lib/libftpio/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libftpio/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -3,7 +3,7 @@ .include LIB= ftpio -SHLIB_MAJOR= 7 +SHLIB_MAJOR= 8 SRCS= ftpio.c ftperr.c INCS= ftpio.h Modified: head/lib/libgpib/Makefile ============================================================================== --- head/lib/libgpib/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libgpib/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= gpib -SHLIB_MAJOR= 2 +SHLIB_MAJOR= 3 INCS= gpib.h INCSDIR= ${INCLUDEDIR}/gpib SRCS= ibfoo.c Modified: head/lib/libipsec/Makefile ============================================================================== --- head/lib/libipsec/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libipsec/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -32,7 +32,7 @@ SHLIBDIR?= /lib .include LIB= ipsec -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 CFLAGS+=-I. -I${.CURDIR} CFLAGS+=-DIPSEC_DEBUG -DIPSEC .if ${MK_INET6_SUPPORT} != "no" Modified: head/lib/libkiconv/Makefile ============================================================================== --- head/lib/libkiconv/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libkiconv/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -5,7 +5,7 @@ SHLIBDIR?= /lib SRCS= kiconv_sysctl.c xlat16_iconv.c xlat16_sysctl.c SRCS+= quirks.c -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 MAN= kiconv.3 Modified: head/lib/libkse/Makefile ============================================================================== --- head/lib/libkse/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libkse/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -19,7 +19,7 @@ SHLIBDIR= /lib SHLIB=kse .endif -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 CFLAGS+=-DPTHREAD_KERNEL CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \ -I${.CURDIR}/../../include Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libmagic/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -5,7 +5,7 @@ CONTRDIR= ${.CURDIR}/../../contrib/file .PATH: ${CONTRDIR} LIB= magic -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 DPADD= ${LIBZ} LDADD= -lz MAN= libmagic.3 magic.5 Modified: head/lib/libmemstat/Makefile ============================================================================== --- head/lib/libmemstat/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libmemstat/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -2,7 +2,7 @@ WARNS?= 3 LIB= memstat -SHLIB_MAJOR= 2 +SHLIB_MAJOR= 3 DPADD= ${LIBKVM} LDADD= -lkvm SRCS+= memstat.c Modified: head/lib/libncp/Makefile ============================================================================== --- head/lib/libncp/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libncp/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -2,7 +2,7 @@ LIB= ncp -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 DPADD= ${LIBIPX} LDADD= -lipx Modified: head/lib/libnetgraph/Makefile ============================================================================== --- head/lib/libnetgraph/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libnetgraph/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -5,7 +5,7 @@ LIB= netgraph WARNS?= 3 MAN= netgraph.3 -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SRCS= sock.c msg.c debug.c INCS= netgraph.h Modified: head/lib/libngatm/Makefile ============================================================================== --- head/lib/libngatm/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libngatm/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -3,7 +3,7 @@ # Author: Harti Brandt # LIB= ngatm -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 MAN= libngatm.3 uniaddr.3 unifunc.3 unimsg.3 unisap.3 unistruct.3 WARNS?= 6 Modified: head/lib/libopie/Makefile ============================================================================== --- head/lib/libopie/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libopie/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -4,7 +4,7 @@ # OPIE_DIST?= ${.CURDIR}/../../contrib/opie DIST_DIR= ${OPIE_DIST}/${.CURDIR:T} -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 6 KEYFILE?= \"/etc/opiekeys\" Modified: head/lib/libpam/Makefile.inc ============================================================================== --- head/lib/libpam/Makefile.inc Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libpam/Makefile.inc Sun Jul 19 17:25:24 2009 (r195767) @@ -28,5 +28,5 @@ DEBUG_FLAGS+= -DDEBUG .endif -SHLIB_MAJOR= 4 +SHLIB_MAJOR= 5 PAM_MOD_DIR= ${LIBDIR} Modified: head/lib/libpcap/Makefile ============================================================================== --- head/lib/libpcap/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libpcap/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -97,7 +97,7 @@ CFLAGS+=-DINET6 CFLAGS+=-DHAVE_NET_PFVAR_H .endif -SHLIB_MAJOR=6 +SHLIB_MAJOR=7 # # Magic to grab sources out of src/contrib Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libproc/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -11,7 +11,7 @@ INCS= libproc.h CFLAGS+= -I. -I${.CURDIR} -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 WARNS?= 6 Modified: head/lib/libradius/Makefile ============================================================================== --- head/lib/libradius/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libradius/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -30,7 +30,7 @@ LIB= radius SRCS= radlib.c INCS= radlib.h radlib_vs.h CFLAGS+= -Wall -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 MAN= libradius.3 radius.conf.5 .if ${MK_OPENSSL} == "no" Modified: head/lib/libsdp/Makefile ============================================================================== --- head/lib/libsdp/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libsdp/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -7,7 +7,7 @@ MAN= sdp.3 WARNS?= 2 CFLAGS+= -I${.CURDIR} -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SRCS= search.c service.c session.c util.c INCS= sdp.h Modified: head/lib/libsmb/Makefile ============================================================================== --- head/lib/libsmb/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libsmb/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -4,7 +4,7 @@ CONTRIBDIR= ${.CURDIR}/../../contrib/smb .PATH: ${CONTRIBDIR}/lib/smb LIB= smb -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 DPADD= ${LIBKICONV} LDADD= -lkiconv Modified: head/lib/libtacplus/Makefile ============================================================================== --- head/lib/libtacplus/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libtacplus/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -30,7 +30,7 @@ INCS= taclib.h CFLAGS+= -Wall DPADD= ${LIBMD} LDADD= -lmd -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 MAN= libtacplus.3 tacplus.conf.5 .include Modified: head/lib/libugidfw/Makefile ============================================================================== --- head/lib/libugidfw/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libugidfw/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= ugidfw -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SRCS= ugidfw.c INCS= ugidfw.h Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libusb/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -5,7 +5,7 @@ # LIB= usb -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 SHLIB_MINOR= 0 SRCS= libusb20.c SRCS+= libusb20_desc.c Modified: head/lib/libusbhid/Makefile ============================================================================== --- head/lib/libusbhid/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libusbhid/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -4,7 +4,7 @@ LIB= usbhid MAN= usbhid.3 -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 MLINKS= usbhid.3 libusbhid.3 usbhid.3 hid_get_report_desc.3 \ usbhid.3 hid_dispose_report_desc.3 \ Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libutil/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib .include LIB= util -SHLIB_MAJOR= 7 +SHLIB_MAJOR= 8 SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c gr_util.c \ hexdump.c humanize_number.c kinfo_getfile.c kinfo_getvmmap.c kld.c \ Modified: head/lib/libvgl/Makefile ============================================================================== --- head/lib/libvgl/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libvgl/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -1,6 +1,6 @@ # $FreeBSD$ LIB= vgl -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 6 CFLAGS+=-Wall -I${.CURDIR} SRCS= main.c simple.c bitmap.c text.c mouse.c keyboard.c INCS= vgl.h Modified: head/lib/libwrap/Makefile ============================================================================== --- head/lib/libwrap/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libwrap/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -5,7 +5,7 @@ .include LIB= wrap -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 6 INCS= tcpd.h MAN= hosts_access.3 MAN+= hosts_access.5 hosts_options.5 Modified: head/lib/libypclnt/Makefile ============================================================================== --- head/lib/libypclnt/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/libypclnt/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= ypclnt -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SRCS= ypclnt_connect.c \ ypclnt_error.c \ ypclnt_free.c \ Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/lib/ncurses/ncurses/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -7,7 +7,7 @@ SHLIBDIR?= /lib .include "${.CURDIR}/../config.mk" LIB= ncurses${LIB_SUFFIX} -SHLIB_MAJOR= 7 +SHLIB_MAJOR= 8 NO_LINT= Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/secure/lib/libcrypto/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -6,7 +6,7 @@ SUBDIR= engines .include LIB= crypto -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 6 NO_LINT= Modified: head/secure/lib/libssh/Makefile ============================================================================== --- head/secure/lib/libssh/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/secure/lib/libssh/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -3,7 +3,7 @@ .include LIB= ssh -SHLIB_MAJOR= 4 +SHLIB_MAJOR= 5 SRCS= acss.c authfd.c authfile.c bufaux.c bufbn.c buffer.c \ canohost.c channels.c cipher.c cipher-acss.c cipher-aes.c \ cipher-bf1.c cipher-ctr.c cipher-3des1.c cleanup.c \ Modified: head/secure/lib/libssl/Makefile ============================================================================== --- head/secure/lib/libssl/Makefile Sun Jul 19 17:13:16 2009 (r195766) +++ head/secure/lib/libssl/Makefile Sun Jul 19 17:25:24 2009 (r195767) @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= ssl -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 6 NO_LINT= Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Jul 19 17:13:16 2009 (r195766) +++ head/sys/sys/param.h Sun Jul 19 17:25:24 2009 (r195767) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 800104 /* Master, propagated to newvers */ +#define __FreeBSD_version 800105 /* Master, propagated to newvers */ #ifndef LOCORE #include Modified: head/usr.sbin/bsnmpd/modules/Makefile.inc ============================================================================== --- head/usr.sbin/bsnmpd/modules/Makefile.inc Sun Jul 19 17:13:16 2009 (r195766) +++ head/usr.sbin/bsnmpd/modules/Makefile.inc Sun Jul 19 17:25:24 2009 (r195767) @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 6 WARNS?= 6 MANFILTER= sed -e 's%@MODPATH@%${LIBDIR}/%g' \ From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 17:35:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 216FC1065672; Sun, 19 Jul 2009 17:35:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC218FC12; Sun, 19 Jul 2009 17:35:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JHZNra049667; Sun, 19 Jul 2009 17:35:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JHZNgm049664; Sun, 19 Jul 2009 17:35:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200907191735.n6JHZNgm049664@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 19 Jul 2009 17:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195768 - head/bin/ln X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 17:35:24 -0000 Author: jilles Date: Sun Jul 19 17:35:23 2009 New Revision: 195768 URL: http://svn.freebsd.org/changeset/base/195768 Log: Allow creating hard links to symlinks using ln(1). This implements the POSIX.1-2008 -L and -P flags. The default remains to create hard links to the target of symlinks. Approved by: re (kib), ed (mentor) Modified: head/bin/ln/ln.1 head/bin/ln/ln.c Modified: head/bin/ln/ln.1 ============================================================================== --- head/bin/ln/ln.1 Sun Jul 19 17:25:24 2009 (r195767) +++ head/bin/ln/ln.1 Sun Jul 19 17:35:23 2009 (r195768) @@ -32,7 +32,7 @@ .\" @(#)ln.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd June 6, 2008 +.Dd July 17, 2009 .Dt LN 1 .Os .Sh NAME @@ -41,13 +41,13 @@ .Nd link files .Sh SYNOPSIS .Nm -.Op Fl s Op Fl F +.Op Fl L | Fl P | Fl s Op Fl F .Op Fl f | iw .Op Fl hnv .Ar source_file .Op Ar target_file .Nm -.Op Fl s Op Fl F +.Op Fl L | Fl P | Fl s Op Fl F .Op Fl f | iw .Op Fl hnv .Ar source_file ... @@ -77,16 +77,6 @@ to a file is one of the differences betw .Pp The options are as follows: .Bl -tag -width flag -.It Fl f -If the target file already exists, -then unlink it so that the link may occur. -(The -.Fl f -option overrides any previous -.Fl i -and -.Fl w -options.) .It Fl F If the target file already exists and is a directory, then remove it so that the link may occur. @@ -105,6 +95,29 @@ The option is a no-op unless .Fl s option is specified. +.It Fl L +When creating a hard link to a symbolic link, +create a hard link to the target of the symbolic link. +This is the default. +This option cancels the +.Fl P +option. +.It Fl P +When creating a hard link to a symbolic link, +create a hard link to the symbolic link itself. +This option cancels the +.Fl L +option. +.It Fl f +If the target file already exists, +then unlink it so that the link may occur. +(The +.Fl f +option overrides any previous +.Fl i +and +.Fl w +options.) .It Fl h If the .Ar target_file Modified: head/bin/ln/ln.c ============================================================================== --- head/bin/ln/ln.c Sun Jul 19 17:25:24 2009 (r195767) +++ head/bin/ln/ln.c Sun Jul 19 17:35:23 2009 (r195768) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -56,12 +57,11 @@ int fflag; /* Unlink existing files. int Fflag; /* Remove empty directories also. */ int hflag; /* Check new name for symlink first. */ int iflag; /* Interactive mode. */ +int Pflag; /* Create hard links to symlinks. */ int sflag; /* Symbolic, not hard, link. */ int vflag; /* Verbose output. */ int wflag; /* Warn if symlink target does not * exist, and -f is not enabled. */ - /* System link call. */ -int (*linkf)(const char *, const char *); char linkch; int linkit(const char *, const char *, int); @@ -90,15 +90,20 @@ main(int argc, char *argv[]) argv += optind; if (argc != 2) usage(); - linkf = link; exit(linkit(argv[0], argv[1], 0)); } - while ((ch = getopt(argc, argv, "Ffhinsvw")) != -1) + while ((ch = getopt(argc, argv, "FLPfhinsvw")) != -1) switch (ch) { case 'F': Fflag = 1; break; + case 'L': + Pflag = 0; + break; + case 'P': + Pflag = 1; + break; case 'f': fflag = 1; iflag = 0; @@ -129,7 +134,6 @@ main(int argc, char *argv[]) argv += optind; argc -= optind; - linkf = sflag ? symlink : link; linkch = sflag ? '-' : '='; if (sflag == 0) Fflag = 0; @@ -179,7 +183,7 @@ linkit(const char *source, const char *t if (!sflag) { /* If source doesn't exist, quit now. */ - if (stat(source, &sb)) { + if ((Pflag ? lstat : stat)(source, &sb)) { warn("%s", source); return (1); } @@ -276,7 +280,9 @@ linkit(const char *source, const char *t } /* Attempt the link. */ - if ((*linkf)(source, target)) { + if (sflag ? symlink(source, target) : + linkat(AT_FDCWD, source, AT_FDCWD, target, + Pflag ? 0 : AT_SYMLINK_FOLLOW)) { warn("%s", target); return (1); } @@ -289,8 +295,8 @@ void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n", - "usage: ln [-s [-F]] [-f | -i] [-hnv] source_file [target_file]", - " ln [-s [-F]] [-f | -i] [-hnv] source_file ... target_dir", + "usage: ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file [target_file]", + " ln [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file ... target_dir", " link source_file target_file"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 17:40:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7103106564A; Sun, 19 Jul 2009 17:40:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A46A38FC12; Sun, 19 Jul 2009 17:40:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JHejnK049803; Sun, 19 Jul 2009 17:40:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JHejw6049798; Sun, 19 Jul 2009 17:40:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907191740.n6JHejw6049798@svn.freebsd.org> From: Robert Watson Date: Sun, 19 Jul 2009 17:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195769 - in head/sys: kern net sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 17:40:46 -0000 Author: rwatson Date: Sun Jul 19 17:40:45 2009 New Revision: 195769 URL: http://svn.freebsd.org/changeset/base/195769 Log: Normalize field naming for struct vnet, fix two debugging printfs that print them. Reviewed by: bz Approved by: re (kensmith, kib) Modified: head/sys/kern/kern_vimage.c head/sys/kern/uipc_socket.c head/sys/net/if.c head/sys/sys/vimage.h Modified: head/sys/kern/kern_vimage.c ============================================================================== --- head/sys/kern/kern_vimage.c Sun Jul 19 17:35:23 2009 (r195768) +++ head/sys/kern/kern_vimage.c Sun Jul 19 17:40:45 2009 (r195769) @@ -333,7 +333,8 @@ vnet_destroy(struct vnet *vnet) struct ifnet *ifp, *nifp; struct vnet_modlink *vml; - KASSERT(vnet->sockcnt == 0, ("%s: vnet still has sockets", __func__)); + KASSERT(vnet->vnet_sockcnt == 0, + ("%s: vnet still has sockets", __func__)); VNET_LIST_WLOCK(); LIST_REMOVE(vnet, vnet_le); @@ -426,14 +427,13 @@ DB_SHOW_COMMAND(vnets, db_show_vnets) VNET_ITERATOR_DECL(vnet_iter); #if SIZE_MAX == UINT32_MAX /* 32-bit arch */ - db_printf(" vnet ifs socks"); + db_printf(" vnet ifs socks\n"); #else /* 64-bit arch, most probaly... */ - db_printf(" vnet ifs socks"); + db_printf(" vnet ifs socks\n"); #endif VNET_FOREACH(vnet_iter) { - db_printf("%p %3d %5d", - vnet_iter, vnet_iter->ifcnt, vnet_iter->sockcnt); - db_printf("\n"); + db_printf("%p %3d %5d\n", vnet_iter, vnet_iter->vnet_ifcnt, + vnet_iter->vnet_sockcnt); } } #endif Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Jul 19 17:35:23 2009 (r195768) +++ head/sys/kern/uipc_socket.c Sun Jul 19 17:40:45 2009 (r195769) @@ -285,7 +285,7 @@ soalloc(struct vnet *vnet) so->so_gencnt = ++so_gencnt; ++numopensockets; #ifdef VIMAGE - ++vnet->sockcnt; /* Locked with so_global_mtx. */ + vnet->vnet_sockcnt++; so->so_vnet = vnet; #endif mtx_unlock(&so_global_mtx); @@ -308,7 +308,7 @@ sodealloc(struct socket *so) so->so_gencnt = ++so_gencnt; --numopensockets; /* Could be below, but faster here. */ #ifdef VIMAGE - --so->so_vnet->sockcnt; + so->so_vnet->vnet_sockcnt--; #endif mtx_unlock(&so_global_mtx); if (so->so_rcv.sb_hiwat) Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Jul 19 17:35:23 2009 (r195768) +++ head/sys/net/if.c Sun Jul 19 17:40:45 2009 (r195769) @@ -593,7 +593,7 @@ if_attach_internal(struct ifnet *ifp, in IFNET_WLOCK(); TAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link); #ifdef VIMAGE - curvnet->ifcnt++; + curvnet->vnet_ifcnt++; #endif IFNET_WUNLOCK(); @@ -758,7 +758,7 @@ if_detach_internal(struct ifnet *ifp, in } #ifdef VIMAGE if (found) - curvnet->ifcnt--; + curvnet->vnet_ifcnt--; #endif IFNET_WUNLOCK(); if (!found) { Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Sun Jul 19 17:35:23 2009 (r195768) +++ head/sys/sys/vimage.h Sun Jul 19 17:40:45 2009 (r195769) @@ -44,8 +44,8 @@ struct vnet { LIST_ENTRY(vnet) vnet_le; /* all vnets list */ u_int vnet_magic_n; - u_int ifcnt; - u_int sockcnt; + u_int vnet_ifcnt; + u_int vnet_sockcnt; void *vnet_data_mem; uintptr_t vnet_data_base; }; From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 18:36:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 133471065686; Sun, 19 Jul 2009 18:36:55 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 010AA8FC08; Sun, 19 Jul 2009 18:36:55 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JIas1b050944; Sun, 19 Jul 2009 18:36:54 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JIasO8050942; Sun, 19 Jul 2009 18:36:54 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907191836.n6JIasO8050942@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 19 Jul 2009 18:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195770 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 18:36:55 -0000 Author: bms Date: Sun Jul 19 18:36:54 2009 New Revision: 195770 URL: http://svn.freebsd.org/changeset/base/195770 Log: Fix two typos in sctp_send_initiate(); these corrupt the INIT chunk on 64-bit platforms, in the 7.x SCTP stack. Observed on 7.2-STABLE/amd64. Submitted by: Michael Tuexen Reviewed by: rrs Modified: stable/7/sys/netinet/sctp_output.c Modified: stable/7/sys/netinet/sctp_output.c ============================================================================== --- stable/7/sys/netinet/sctp_output.c Sun Jul 19 17:40:45 2009 (r195769) +++ stable/7/sys/netinet/sctp_output.c Sun Jul 19 18:36:54 2009 (r195770) @@ -6087,7 +6087,7 @@ sctp_send_initiate(struct sctp_inpcb *in ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); ph->param_type = htons(SCTP_HAS_NAT_SUPPORT); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - SCTP_BUF_LEN(m) += sizeof(sizeof(struct sctp_paramhdr)); + SCTP_BUF_LEN(m) += sizeof(struct sctp_paramhdr); } /* add authentication parameters */ if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { @@ -7198,7 +7198,7 @@ do_a_abort: ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); ph->param_type = htons(SCTP_HAS_NAT_SUPPORT); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - SCTP_BUF_LEN(m) += sizeof(sizeof(struct sctp_paramhdr)); + SCTP_BUF_LEN(m) += sizeof(struct sctp_paramhdr); } /* And now tell the peer we do all the extensions */ pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 18:37:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 229AA10656A8; Sun, 19 Jul 2009 18:37:21 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 102AE8FC1A; Sun, 19 Jul 2009 18:37:21 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JIbKMp050989; Sun, 19 Jul 2009 18:37:20 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JIbKme050987; Sun, 19 Jul 2009 18:37:20 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907191837.n6JIbKme050987@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 19 Jul 2009 18:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195771 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 18:37:22 -0000 Author: bms Date: Sun Jul 19 18:37:20 2009 New Revision: 195771 URL: http://svn.freebsd.org/changeset/base/195771 Log: When moving an SCTP association from one hash table to another, make sure the association's link entry in the hash table is updated. This fixes a panic on closing an association in the 7.x SCTP stack. Observed on 7.2-STABLE/amd64. Submitted by: Michael Tuexen Reviewed by: rrs Modified: stable/7/sys/netinet/sctp_pcb.c Modified: stable/7/sys/netinet/sctp_pcb.c ============================================================================== --- stable/7/sys/netinet/sctp_pcb.c Sun Jul 19 18:36:54 2009 (r195770) +++ stable/7/sys/netinet/sctp_pcb.c Sun Jul 19 18:37:20 2009 (r195771) @@ -2504,7 +2504,9 @@ sctp_move_pcb_and_assoc(struct sctp_inpc /* Pull the tcb from the old association */ LIST_REMOVE(stcb, sctp_tcbhash); LIST_REMOVE(stcb, sctp_tcblist); - + if (stcb->asoc.in_asocid_hash) { + LIST_REMOVE(stcb, sctp_tcbasocidhash); + } /* Now insert the new_inp into the TCP connected hash */ head = &SCTP_BASE_INFO(sctp_tcpephash)[SCTP_PCBHASH_ALLADDR((lport), SCTP_BASE_INFO(hashtcpmark))]; @@ -2520,7 +2522,12 @@ sctp_move_pcb_and_assoc(struct sctp_inpc * only have one connection? Probably not :> so lets get rid of it * and not suck up any kernel memory in that. */ - + if (stcb->asoc.in_asocid_hash) { + struct sctpasochead *lhd; + lhd = &new_inp->sctp_asocidhash[SCTP_PCBHASH_ASOC(stcb->asoc.assoc_id, + new_inp->hashasocidmark)]; + LIST_INSERT_HEAD(lhd, stcb, sctp_tcbasocidhash); + } /* Ok. Let's restart timer. */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, new_inp, From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 19:01:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 448A5106566C; Sun, 19 Jul 2009 19:01:31 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 332A38FC1A; Sun, 19 Jul 2009 19:01:31 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JJ1UlN051523; Sun, 19 Jul 2009 19:01:30 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JJ1Um3051521; Sun, 19 Jul 2009 19:01:30 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200907191901.n6JJ1Um3051521@svn.freebsd.org> From: Brian Somers Date: Sun, 19 Jul 2009 19:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195772 - head/usr.sbin/ppp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 19:01:31 -0000 Author: brian Date: Sun Jul 19 19:01:30 2009 New Revision: 195772 URL: http://svn.freebsd.org/changeset/base/195772 Log: Don't get stuck in an infinite loop comparing (short++ <= maxshort) PR: 136893 Submitted by: Aragon Gouveia - aragon at phat dot za dot net (mostly) Approved by: re (kib) MFC after: 3 weeks Modified: head/usr.sbin/ppp/nat_cmd.c Modified: head/usr.sbin/ppp/nat_cmd.c ============================================================================== --- head/usr.sbin/ppp/nat_cmd.c Sun Jul 19 18:37:20 2009 (r195771) +++ head/usr.sbin/ppp/nat_cmd.c Sun Jul 19 19:01:30 2009 (r195772) @@ -175,7 +175,7 @@ nat_RedirectPort(struct cmdargs const *a return -1; } - while (laliasport <= haliasport) { + do { link = LibAliasRedirectPort(la, localaddr, htons(llocalport), remoteaddr, htons(lremoteport), aliasaddr, htons(laliasport), @@ -187,10 +187,9 @@ nat_RedirectPort(struct cmdargs const *a return 1; } llocalport++; - laliasport++; if (hremoteport) lremoteport++; - } + } while (laliasport++ < haliasport); return 0; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 20:25:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9057106564A; Sun, 19 Jul 2009 20:25:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C322A8FC08; Sun, 19 Jul 2009 20:25:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JKPx0o053075; Sun, 19 Jul 2009 20:25:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JKPxFg053073; Sun, 19 Jul 2009 20:25:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200907192025.n6JKPxFg053073@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 19 Jul 2009 20:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195773 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 20:26:00 -0000 Author: kib Date: Sun Jul 19 20:25:59 2009 New Revision: 195773 URL: http://svn.freebsd.org/changeset/base/195773 Log: When buffer write is failed, it is wrong for brelse() to invalidate portion of the page that was written. Among other problems, this page might be picked up by pagedaemon, with failed assertion in vm_pageout_flush() about validity of the page. Reported and tested by: pho Approved by: re (kensmith) MFC after: 3 weeks Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Jul 19 19:01:30 2009 (r195772) +++ head/sys/kern/vfs_bio.c Sun Jul 19 20:25:59 2009 (r195773) @@ -1330,7 +1330,8 @@ brelse(struct buf *bp) m = bp->b_pages[i]; } if ((bp->b_flags & B_NOCACHE) || - (bp->b_ioflags & BIO_ERROR)) { + (bp->b_ioflags & BIO_ERROR && + bp->b_iocmd == BIO_READ)) { int poffset = foff & PAGE_MASK; int presid = resid > (PAGE_SIZE - poffset) ? (PAGE_SIZE - poffset) : resid; From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 21:40:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D63D6106564A; Sun, 19 Jul 2009 21:40:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C48858FC20; Sun, 19 Jul 2009 21:40:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JLeJ5x054554; Sun, 19 Jul 2009 21:40:19 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JLeJ5X054549; Sun, 19 Jul 2009 21:40:19 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200907192140.n6JLeJ5X054549@svn.freebsd.org> From: Alan Cox Date: Sun, 19 Jul 2009 21:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195774 - in head/sys: amd64/amd64 i386/i386 i386/xen vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 21:40:20 -0000 Author: alc Date: Sun Jul 19 21:40:19 2009 New Revision: 195774 URL: http://svn.freebsd.org/changeset/base/195774 Log: Change the handling of fictitious pages by pmap_page_set_memattr() on amd64 and i386. Essentially, fictitious pages provide a mechanism for creating aliases for either normal or device-backed pages. Therefore, pmap_page_set_memattr() on a fictitious page needn't update the direct map or flush the cache. Such actions are the responsibility of the "primary" instance of the page or the device driver that "owns" the physical address. For example, these actions are already performed by pmap_mapdev(). The device pager needn't restore the memory attributes on a fictitious page before releasing it. It's now pointless. Add pmap_page_set_memattr() to the Xen pmap. Approved by: re (kib) Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/vm/device_pager.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Jul 19 20:25:59 2009 (r195773) +++ head/sys/amd64/amd64/pmap.c Sun Jul 19 21:40:19 2009 (r195774) @@ -4381,9 +4381,12 @@ pmap_page_set_memattr(vm_page_t m, vm_me m->md.pat_mode = ma; /* - * Update the direct mapping and flush the cache. + * If "m" is a normal page, update its direct mapping. This update + * can be relied upon to perform any cache operations that are + * required for data coherence. */ - if (pmap_change_attr(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), PAGE_SIZE, + if ((m->flags & PG_FICTITIOUS) == 0 && + pmap_change_attr(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), PAGE_SIZE, m->md.pat_mode)) panic("memory attribute change on the direct map failed"); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Jul 19 20:25:59 2009 (r195773) +++ head/sys/i386/i386/pmap.c Sun Jul 19 21:40:19 2009 (r195774) @@ -4466,12 +4466,13 @@ pmap_page_set_memattr(vm_page_t m, vm_me m->md.pat_mode = ma; /* - * Flush CPU caches to make sure any data isn't cached that shouldn't - * be, etc. + * If "m" is a normal page, flush it from the cache. */ - /* If "Self Snoop" is supported, do nothing. */ - if (!(cpu_feature & CPUID_SS)) - pmap_invalidate_cache(); + if ((m->flags & PG_FICTITIOUS) == 0) { + /* If "Self Snoop" is supported, do nothing. */ + if (!(cpu_feature & CPUID_SS)) + pmap_invalidate_cache(); + } } int Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sun Jul 19 20:25:59 2009 (r195773) +++ head/sys/i386/xen/pmap.c Sun Jul 19 21:40:19 2009 (r195774) @@ -3921,6 +3921,25 @@ pmap_unmapdev(vm_offset_t va, vm_size_t kmem_free(kernel_map, base, size); } +/* + * Sets the memory attribute for the specified page. + */ +void +pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) +{ + + m->md.pat_mode = ma; + + /* + * If "m" is a normal page, flush it from the cache. + */ + if ((m->flags & PG_FICTITIOUS) == 0) { + /* If "Self Snoop" is supported, do nothing. */ + if (!(cpu_feature & CPUID_SS)) + pmap_invalidate_cache(); + } +} + int pmap_change_attr(va, size, mode) vm_offset_t va; Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Sun Jul 19 20:25:59 2009 (r195773) +++ head/sys/vm/device_pager.c Sun Jul 19 21:40:19 2009 (r195774) @@ -305,7 +305,8 @@ dev_pager_haspage(object, pindex, before /* * Create a fictitious page with the specified physical address and memory - * attribute. + * attribute. The memory attribute is the only the machine-dependent aspect + * of a fictitious page that must be initialized. */ static vm_page_t dev_pager_getfake(vm_paddr_t paddr, vm_memattr_t memattr) @@ -317,11 +318,9 @@ dev_pager_getfake(vm_paddr_t paddr, vm_m /* Fictitious pages don't use "segind". */ m->flags = PG_FICTITIOUS; /* Fictitious pages don't use "order" or "pool". */ - pmap_page_init(m); m->oflags = VPO_BUSY; m->wire_count = 1; - if (memattr != VM_MEMATTR_DEFAULT) - pmap_page_set_memattr(m, memattr); + pmap_page_set_memattr(m, memattr); return (m); } @@ -334,9 +333,6 @@ dev_pager_putfake(vm_page_t m) if (!(m->flags & PG_FICTITIOUS)) panic("dev_pager_putfake: bad page"); - /* Restore the default memory attribute to "phys_addr". */ - if (pmap_page_get_memattr(m) != VM_MEMATTR_DEFAULT) - pmap_page_set_memattr(m, VM_MEMATTR_DEFAULT); uma_zfree(fakepg_zone, m); } @@ -350,10 +346,6 @@ dev_pager_updatefake(vm_page_t m, vm_pad if (!(m->flags & PG_FICTITIOUS)) panic("dev_pager_updatefake: bad page"); - /* Restore the default memory attribute before changing "phys_addr". */ - if (pmap_page_get_memattr(m) != VM_MEMATTR_DEFAULT) - pmap_page_set_memattr(m, VM_MEMATTR_DEFAULT); m->phys_addr = paddr; - if (memattr != VM_MEMATTR_DEFAULT) - pmap_page_set_memattr(m, memattr); + pmap_page_set_memattr(m, memattr); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 03:59:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFA3F1065673; Mon, 20 Jul 2009 03:59:01 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDA3E8FC0C; Mon, 20 Jul 2009 03:59:01 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6K3x0Qw065599; Mon, 20 Jul 2009 03:59:00 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6K3x0aD065598; Mon, 20 Jul 2009 03:59:00 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200907200359.n6K3x0aD065598@svn.freebsd.org> From: Scott Long Date: Mon, 20 Jul 2009 03:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195776 - head/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 03:59:02 -0000 Author: scottl Date: Mon Jul 20 03:59:00 2009 New Revision: 195776 URL: http://svn.freebsd.org/changeset/base/195776 Log: Fix an apparently harmless typo. Approved by: re Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Jul 19 23:11:08 2009 (r195775) +++ head/sys/dev/ciss/ciss.c Mon Jul 20 03:59:00 2009 (r195776) @@ -2687,7 +2687,7 @@ ciss_request_map_helper(void *arg, bus_d if (cr->cr_flags & CISS_REQ_DATAOUT) bus_dmamap_sync(sc->ciss_buffer_dmat, cr->cr_datamap, BUS_DMASYNC_PREWRITE); - if (nseg == 1) + if (nseg == 0) cr->cr_sg_tag = CISS_SG_NONE; else if (nseg == 1) cr->cr_sg_tag = CISS_SG_1; From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 07:50:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E465010656B3; Mon, 20 Jul 2009 07:50:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C75448FC13; Mon, 20 Jul 2009 07:50:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6K7ooUA070053; Mon, 20 Jul 2009 07:50:50 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6K7ooPM070050; Mon, 20 Jul 2009 07:50:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907200750.n6K7ooPM070050@svn.freebsd.org> From: Robert Watson Date: Mon, 20 Jul 2009 07:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195778 - in head/sys: kern net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 07:50:51 -0000 Author: rwatson Date: Mon Jul 20 07:50:50 2009 New Revision: 195778 URL: http://svn.freebsd.org/changeset/base/195778 Log: Add macros VNET_SETNAME and VNET_SYMPREFIX, and expose to userspace if _WANT_VNET is defined. This way we don't need separate definitions in libkvm. Reviewed by: bz Approved by: re (vimage blanket) Modified: head/sys/kern/link_elf_obj.c head/sys/net/vnet.h Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Mon Jul 20 06:12:23 2009 (r195777) +++ head/sys/kern/link_elf_obj.c Mon Jul 20 07:50:50 2009 (r195778) @@ -350,7 +350,7 @@ link_elf_link_preload(linker_class_t cls ef->progtab[pb].addr = dpcpu; #ifdef VIMAGE } else if (ef->progtab[pb].name != NULL && - !strcmp(ef->progtab[pb].name, "set_vnet")) { + !strcmp(ef->progtab[pb].name, VNET_SETNAME)) { void *vnet_data; vnet_data = vnet_data_alloc(shdr[i].sh_size); @@ -756,7 +756,7 @@ link_elf_load_file(linker_class_t cls, c dpcpu_alloc(shdr[i].sh_size); #ifdef VIMAGE else if (ef->progtab[pb].name != NULL && - !strcmp(ef->progtab[pb].name, "set_vnet")) + !strcmp(ef->progtab[pb].name, VNET_SETNAME)) ef->progtab[pb].addr = vnet_data_alloc(shdr[i].sh_size); #endif @@ -789,7 +789,7 @@ link_elf_load_file(linker_class_t cls, c #ifdef VIMAGE else if (ef->progtab[pb].addr != (void *)mapbase && - !strcmp(ef->progtab[pb].name, "set_vnet")) + !strcmp(ef->progtab[pb].name, VNET_SETNAME)) vnet_data_copy(ef->progtab[pb].addr, shdr[i].sh_size); #endif @@ -909,7 +909,7 @@ link_elf_unload_file(linker_file_t file) dpcpu_free(ef->progtab[i].addr, ef->progtab[i].size); #ifdef VIMAGE - else if (!strcmp(ef->progtab[i].name, "set_vnet")) + else if (!strcmp(ef->progtab[i].name, VNET_SETNAME)) vnet_data_free(ef->progtab[i].addr, ef->progtab[i].size); #endif Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Mon Jul 20 06:12:23 2009 (r195777) +++ head/sys/net/vnet.h Mon Jul 20 07:50:50 2009 (r195778) @@ -37,19 +37,26 @@ #ifndef _NET_VNET_H_ #define _NET_VNET_H_ +#if defined(_KERNEL) || defined(_WANT_VNET) + +#define VNET_SETNAME "set_vnet" +#define VNET_SYMPREFIX "vnet_entry_" + +#endif + #ifdef _KERNEL #ifdef VIMAGE #if defined(__arm__) -__asm__(".section set_vnet, \"aw\", %progbits"); +__asm__(".section " VNET_SETNAME ", \"aw\", %progbits"); #else -__asm__(".section set_vnet, \"aw\", @progbits"); +__asm__(".section " VNET_SETNAME ", \"aw\", @progbits"); #endif __asm__(".previous"); #define VNET_NAME(n) vnet_entry_##n #define VNET_DECLARE(t, n) extern t VNET_NAME(n) -#define VNET_DEFINE(t, n) t VNET_NAME(n) __section("set_vnet") __used +#define VNET_DEFINE(t, n) t VNET_NAME(n) __section(VNET_SETNAME) __used #define _VNET_PTR(b, n) (__typeof(VNET_NAME(n))*) \ ((b) + (uintptr_t)&VNET_NAME(n)) From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 07:53:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07A29106566C; Mon, 20 Jul 2009 07:53:08 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF80F8FC0A; Mon, 20 Jul 2009 07:53:07 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6K7r7D7070137; Mon, 20 Jul 2009 07:53:07 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6K7r7gb070133; Mon, 20 Jul 2009 07:53:07 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200907200753.n6K7r7gb070133@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 20 Jul 2009 07:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195779 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 07:53:08 -0000 Author: raj Date: Mon Jul 20 07:53:07 2009 New Revision: 195779 URL: http://svn.freebsd.org/changeset/base/195779 Log: ARM pmap fixes. a) nocache-remap problem When a page is remapped into a non-cacheable virtual memory region there was no associated write-back invalidate operation performed. We remove writeback of the original buffer size from bus_dmamem_alloc() and add appropriate L1/L2 flush operation. b) missing write-back invalidate operation In pmap_kremove a page is removed so we must do a write-back invalidate operation aligned to the page virtual address. Submitted by: Michal Hajduk Reviewed by: Mark Tinguely, rpaulo, stas Approved by: re (kib) Obtained from: Semihalf Modified: head/sys/arm/arm/busdma_machdep.c head/sys/arm/arm/pmap.c head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Mon Jul 20 07:50:50 2009 (r195778) +++ head/sys/arm/arm/busdma_machdep.c Mon Jul 20 07:53:07 2009 (r195779) @@ -630,10 +630,6 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi ((vm_offset_t)*vaddr & PAGE_MASK)); newmap->origbuffer = *vaddr; newmap->allocbuffer = tmpaddr; - cpu_idcache_wbinv_range((vm_offset_t)*vaddr, - dmat->maxsize); - cpu_l2cache_wbinv_range((vm_offset_t)*vaddr, - dmat->maxsize); *vaddr = tmpaddr; } else newmap->origbuffer = newmap->allocbuffer = NULL; Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Mon Jul 20 07:50:50 2009 (r195778) +++ head/sys/arm/arm/pmap.c Mon Jul 20 07:53:07 2009 (r195779) @@ -2984,6 +2984,7 @@ pmap_kremove(vm_offset_t va) pmap_free_pv_entry(pve); PMAP_UNLOCK(pmap_kernel()); vm_page_unlock_queues(); + va = va & ~PAGE_MASK; cpu_dcache_wbinv_range(va, PAGE_SIZE); cpu_l2cache_wbinv_range(va, PAGE_SIZE); cpu_tlb_flushD_SE(va); Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Mon Jul 20 07:50:50 2009 (r195778) +++ head/sys/arm/arm/vm_machdep.c Mon Jul 20 07:53:07 2009 (r195779) @@ -426,10 +426,15 @@ arm_remap_nocache(void *addr, vm_size_t vm_offset_t tomap = arm_nocache_startaddr + i * PAGE_SIZE; void *ret = (void *)tomap; vm_paddr_t physaddr = vtophys((vm_offset_t)addr); + vm_offset_t vaddr = (vm_offset_t) addr; + vaddr = vaddr & ~PAGE_MASK; for (; tomap < (vm_offset_t)ret + size; tomap += PAGE_SIZE, - physaddr += PAGE_SIZE, i++) { + vaddr += PAGE_SIZE, physaddr += PAGE_SIZE, i++) { + cpu_idcache_wbinv_range(vaddr, PAGE_SIZE); + cpu_l2cache_wbinv_range(vaddr, PAGE_SIZE); pmap_kenter_nocache(tomap, physaddr); + cpu_tlb_flushID_SE(vaddr); arm_nocache_allocated[i / BITS_PER_INT] |= 1 << (i % BITS_PER_INT); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 13:55:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5C2B106566B; Mon, 20 Jul 2009 13:55:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C88448FC24; Mon, 20 Jul 2009 13:55:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6KDtXEL079722; Mon, 20 Jul 2009 13:55:33 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6KDtXX9079713; Mon, 20 Jul 2009 13:55:33 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907201355.n6KDtXX9079713@svn.freebsd.org> From: Robert Watson Date: Mon, 20 Jul 2009 13:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195782 - in head/sys: net netinet netinet6 netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 13:55:34 -0000 Author: rwatson Date: Mon Jul 20 13:55:33 2009 New Revision: 195782 URL: http://svn.freebsd.org/changeset/base/195782 Log: Garbage collect vnet module registrations that have neither constructors nor destructors, as there's no actual work to do. In most cases, the constructors weren't needed because of the existing protocol initialization functions run by net_init_domain() as part of VNET_MOD_NET, or they were eliminated when support for static initialization of virtualized globals was added. Garbage collect dependency references to modules without constructors or destructors, notably VNET_MOD_INET and VNET_MOD_INET6. Reviewed by: bz Approved by: re (vimage blanket) Modified: head/sys/net/flowtable.c head/sys/netinet/igmp.c head/sys/netinet/ip_input.c head/sys/netinet6/ip6_input.c head/sys/netinet6/mld6.c head/sys/netipsec/ipsec.c head/sys/netipsec/xform_ipcomp.c head/sys/netipsec/xform_ipip.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Mon Jul 20 11:17:54 2009 (r195781) +++ head/sys/net/flowtable.c Mon Jul 20 13:55:33 2009 (r195782) @@ -180,7 +180,6 @@ static int flowtable_idetach(const void static const vnet_modinfo_t flowtable_modinfo = { .vmi_id = VNET_MOD_FLOWTABLE, .vmi_name = "flowtable", - .vmi_dependson = VNET_MOD_INET, .vmi_iattach = flowtable_iattach, .vmi_idetach = flowtable_idetach }; Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Mon Jul 20 11:17:54 2009 (r195781) +++ head/sys/netinet/igmp.c Mon Jul 20 13:55:33 2009 (r195782) @@ -224,7 +224,10 @@ static VNET_DEFINE(int, current_state_ti #define V_current_state_timers_running VNET(current_state_timers_running) static VNET_DEFINE(LIST_HEAD(, igmp_ifinfo), igi_head); -static VNET_DEFINE(struct igmpstat, igmpstat); +static VNET_DEFINE(struct igmpstat, igmpstat) = { + .igps_version = IGPS_VERSION_3, + .igps_len = sizeof(struct igmpstat), +}; static VNET_DEFINE(struct timeval, igmp_gsrdelay) = {10, 0}; #define V_igi_head VNET(igi_head) @@ -3615,12 +3618,6 @@ vnet_igmp_iattach(const void *unused __u LIST_INIT(&V_igi_head); - /* - * Initialize sysctls to default values. - */ - V_igmpstat.igps_version = IGPS_VERSION_3; - V_igmpstat.igps_len = sizeof(struct igmpstat); - return (0); } @@ -3640,7 +3637,6 @@ vnet_igmp_idetach(const void *unused __u static vnet_modinfo_t vnet_igmp_modinfo = { .vmi_id = VNET_MOD_IGMP, .vmi_name = "igmp", - .vmi_dependson = VNET_MOD_INET, .vmi_iattach = vnet_igmp_iattach, .vmi_idetach = vnet_igmp_idetach }; Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Mon Jul 20 11:17:54 2009 (r195781) +++ head/sys/netinet/ip_input.c Mon Jul 20 13:55:33 2009 (r195782) @@ -236,24 +236,6 @@ VNET_DEFINE(int, fw_one_pass) = 1; static void ip_freef(struct ipqhead *, struct ipq *); -#ifdef VIMAGE -/* XXX only has to stay for .vmi_dependson elsewhere. */ -static void vnet_inet_register(void); - -static const vnet_modinfo_t vnet_inet_modinfo = { - .vmi_id = VNET_MOD_INET, - .vmi_name = "inet", -}; - -static void vnet_inet_register() -{ - - vnet_mod_register(&vnet_inet_modinfo); -} - -SYSINIT(inet, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, vnet_inet_register, 0); -#endif - static int sysctl_netinet_intr_queue_maxlen(SYSCTL_HANDLER_ARGS) { @@ -302,8 +284,6 @@ ip_init(void) struct protosw *pr; int i; - V_ip_id = time_second & 0xffff; - TAILQ_INIT(&V_in_ifaddrhead); V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask); @@ -362,6 +342,7 @@ ip_init(void) NULL, EVENTHANDLER_PRI_ANY); /* Initialize various other remaining things. */ + V_ip_id = time_second & 0xffff; IPQ_LOCK_INIT(); netisr_register(&ip_nh); } Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Mon Jul 20 11:17:54 2009 (r195781) +++ head/sys/netinet6/ip6_input.c Mon Jul 20 13:55:33 2009 (r195782) @@ -162,26 +162,6 @@ static int ip6_hopopts_input(u_int32_t * static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); #endif -#ifdef VIMAGE -/* XXX only has to stay for .vmi_dependson elsewhere. */ -static void vnet_inet6_register(void); - -static const vnet_modinfo_t vnet_inet6_modinfo = { - .vmi_id = VNET_MOD_INET6, - .vmi_name = "inet6", - .vmi_dependson = VNET_MOD_INET /* XXX revisit - TCP/UDP needs this? */ -}; - -static void -vnet_inet6_register(void) -{ - - vnet_mod_register(&vnet_inet6_modinfo); -} - -SYSINIT(inet6, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, vnet_inet6_register, 0); -#endif - /* * IP6 initialization: fill in IP6 protocol switch table. * All protocols not implemented in kernel go to raw IP6 protocol handler. Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Mon Jul 20 11:17:54 2009 (r195781) +++ head/sys/netinet6/mld6.c Mon Jul 20 13:55:33 2009 (r195782) @@ -3253,7 +3253,6 @@ vnet_mld_idetach(const void *unused __un static vnet_modinfo_t vnet_mld_modinfo = { .vmi_id = VNET_MOD_MLD, .vmi_name = "mld", - .vmi_dependson = VNET_MOD_INET6, .vmi_iattach = vnet_mld_iattach, .vmi_idetach = vnet_mld_idetach }; Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Mon Jul 20 11:17:54 2009 (r195781) +++ head/sys/netipsec/ipsec.c Mon Jul 20 13:55:33 2009 (r195782) @@ -245,7 +245,6 @@ static int ipsec_iattach(const void *); static const vnet_modinfo_t vnet_ipsec_modinfo = { .vmi_id = VNET_MOD_IPSEC, .vmi_name = "ipsec", - .vmi_dependson = VNET_MOD_INET, /* XXX revisit - INET6 ? */ .vmi_iattach = ipsec_iattach, }; #endif Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Mon Jul 20 11:17:54 2009 (r195781) +++ head/sys/netipsec/xform_ipcomp.c Mon Jul 20 13:55:33 2009 (r195782) @@ -81,14 +81,6 @@ SYSCTL_VNET_STRUCT(_net_inet_ipcomp, IPS static int ipcomp_input_cb(struct cryptop *crp); static int ipcomp_output_cb(struct cryptop *crp); -#ifdef VIMAGE -static const vnet_modinfo_t vnet_ipcomp_modinfo = { - .vmi_id = VNET_MOD_IPCOMP, - .vmi_name = "ipsec_ipcomp", - .vmi_dependson = VNET_MOD_IPSEC, -}; -#endif - struct comp_algo * ipcomp_algorithm_lookup(int alg) { @@ -604,9 +596,6 @@ ipcomp_attach(void) { xform_register(&ipcomp_xformsw); -#ifdef VIMAGE - vnet_mod_register(&vnet_ipcomp_modinfo); -#endif } SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipcomp_attach, NULL); Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Mon Jul 20 11:17:54 2009 (r195781) +++ head/sys/netipsec/xform_ipip.c Mon Jul 20 13:55:33 2009 (r195782) @@ -105,14 +105,6 @@ SYSCTL_VNET_STRUCT(_net_inet_ipip, IPSEC static void _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp); -#ifdef VIMAGE -static const vnet_modinfo_t vnet_ipip_modinfo = { - .vmi_id = VNET_MOD_IPIP, - .vmi_name = "ipsec_ipip", - .vmi_dependson = VNET_MOD_IPSEC, -}; -#endif - #ifdef INET6 /* * Really only a wrapper for ipip_input(), for use with IPv6. @@ -710,9 +702,6 @@ ipe4_attach(void) (void) encap_attach_func(AF_INET6, -1, ipe4_encapcheck, (struct protosw *)&ipe6_protosw, NULL); #endif -#ifdef VIMAGE - vnet_mod_register(&vnet_ipip_modinfo); -#endif } SYSINIT(ipe4_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipe4_attach, NULL); #endif /* IPSEC */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 16:19:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA2211065673; Mon, 20 Jul 2009 16:19:42 +0000 (UTC) (envelope-from snb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D679D8FC22; Mon, 20 Jul 2009 16:19:42 +0000 (UTC) (envelope-from snb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6KGJgQd082555; Mon, 20 Jul 2009 16:19:42 GMT (envelope-from snb@svn.freebsd.org) Received: (from snb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6KGJgQ0082553; Mon, 20 Jul 2009 16:19:42 GMT (envelope-from snb@svn.freebsd.org) Message-Id: <200907201619.n6KGJgQ0082553@svn.freebsd.org> From: Sean Nicholas Barkas Date: Mon, 20 Jul 2009 16:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195783 - stable/7/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 16:19:43 -0000 Author: snb Date: Mon Jul 20 16:19:42 2009 New Revision: 195783 URL: http://svn.freebsd.org/changeset/base/195783 Log: MFC r195003: Fix a bug reported by pho@ where one can induce a panic by decreasing vfs.ufs.dirhash_maxmem below the current amount of memory used by dirhash. When ufsdirhash_build() is called with the memory in use greater than dirhash_maxmem, it attempts to free up memory by calling ufsdirhash_recycle(). If successful in freeing enough memory, ufsdirhash_recycle() leaves the dirhash list locked. But at this point in ufsdirhash_build(), the list is not explicitly unlocked after the call(s) to ufsdirhash_recycle(). When we next attempt to lock the dirhash list, we will get a "panic: _mtx_lock_sleep: recursed on non-recursive mutex dirhash list". Approved by: dwmalone (mentor) Modified: stable/7/sys/ufs/ufs/ufs_dirhash.c Modified: stable/7/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- stable/7/sys/ufs/ufs/ufs_dirhash.c Mon Jul 20 13:55:33 2009 (r195782) +++ stable/7/sys/ufs/ufs/ufs_dirhash.c Mon Jul 20 16:19:42 2009 (r195783) @@ -329,9 +329,12 @@ ufsdirhash_build(struct inode *ip) int dirblocks, i, j, memreqd, nblocks, narrays, nslots, slot; /* Take care of a decreased sysctl value. */ - while (ufs_dirhashmem > ufs_dirhashmaxmem) + while (ufs_dirhashmem > ufs_dirhashmaxmem) { if (ufsdirhash_recycle(0) != 0) return (-1); + /* Recycled enough memory, so unlock the list. */ + DIRHASHLIST_UNLOCK(); + } /* Check if we can/should use dirhash. */ if (ip->i_size < ufs_mindirhashsize || OFSFMT(ip->i_vnode) || From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 19:12:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B41C5106564A; Mon, 20 Jul 2009 19:12:08 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0B068FC17; Mon, 20 Jul 2009 19:12:08 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6KJC82d086122; Mon, 20 Jul 2009 19:12:08 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6KJC8MB086115; Mon, 20 Jul 2009 19:12:08 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907201912.n6KJC8MB086115@svn.freebsd.org> From: Rui Paulo Date: Mon, 20 Jul 2009 19:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195784 - in head: sbin/ifconfig sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 19:12:09 -0000 Author: rpaulo Date: Mon Jul 20 19:12:08 2009 New Revision: 195784 URL: http://svn.freebsd.org/changeset/base/195784 Log: More mesh bits, namely: * bridge support (sam) * handling of errors (sam) * deletion of inactive routing entries * more debug msgs (sam) * fixed some inconsistencies with the spec. * decap is now specific to mesh (sam) * print mesh seq. no. on ifconfig list mesh * small perf. improvements Reviewed by: sam Approved by: re (kib) Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_ioctl.h head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h head/sys/net80211/ieee80211_output.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon Jul 20 16:19:42 2009 (r195783) +++ head/sbin/ifconfig/ifieee80211.c Mon Jul 20 19:12:08 2009 (r195784) @@ -3965,21 +3965,23 @@ list_mesh(int s) if (ioctl(s, SIOCG80211, &ireq) < 0) err(1, "unable to get the Mesh routing table"); - printf("%-17.17s %-17.17s %4s %4s %4s\n" + printf("%-17.17s %-17.17s %4s %4s %4s %6s\n" , "DEST" , "NEXT HOP" , "HOPS" , "METRIC" - , "LIFETIME"); + , "LIFETIME" + , "MSEQ"); for (i = 0; i < ireq.i_len / sizeof(*routes); i++) { printf("%s ", ether_ntoa((const struct ether_addr *)routes[i].imr_dest)); - printf("%s %4u %4d %6d\n", + printf("%s %4u %4u %6u %6u\n", ether_ntoa((const struct ether_addr *) routes[i].imr_nexthop), routes[i].imr_nhops, routes[i].imr_metric, - routes[i].imr_lifetime); + routes[i].imr_lifetime, + routes[i].imr_lastmseq); } } Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Mon Jul 20 16:19:42 2009 (r195783) +++ head/sys/net80211/ieee80211_hwmp.c Mon Jul 20 19:12:08 2009 (r195784) @@ -121,7 +121,6 @@ static int ieee80211_hwmp_replyforward = static const int ieee80211_hwmp_maxprepretries = 3; static const struct timeval ieee80211_hwmp_maxhopstime = { 0, 500000 }; static const struct timeval ieee80211_hwmp_preqminint = { 0, 100000 }; -static const struct timeval ieee80211_hwmp_prepminint = { 0, 100000 }; static const struct timeval ieee80211_hwmp_perrminint = { 0, 100000 }; static const struct timeval ieee80211_hwmp_roottimeout = { 5, 0 }; static const struct timeval ieee80211_hwmp_pathtimeout = { 5, 0 }; @@ -152,8 +151,6 @@ static const struct timeval ieee80211_hw /* NB: the Target Address set in a Proactive PREQ is the broadcast address. */ static const uint8_t broadcastaddr[IEEE80211_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -static const uint8_t invalidaddr[IEEE80211_ADDR_LEN] = - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; typedef uint32_t ieee80211_hwmp_seq; #define IEEE80211_HWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) @@ -171,7 +168,6 @@ struct ieee80211_hwmp_state { ieee80211_hwmp_seq hs_seq; /* next seq to be used */ ieee80211_hwmp_seq hs_preqid; /* next PREQ ID to be used */ struct timeval hs_lastpreq; /* last time we sent a PREQ */ - struct timeval hs_lastprep; /* last time we sent a PREP */ struct timeval hs_lastperr; /* last time we sent a PERR */ int hs_rootmode; /* proactive HWMP */ struct callout hs_roottimer; @@ -201,6 +197,8 @@ static const struct ieee80211_mesh_proto .mpp_vdetach = hwmp_vdetach, .mpp_newstate = hwmp_newstate, .mpp_privlen = sizeof(struct ieee80211_hwmp_route), + /* ieee80211_hwmp_pathtimeout */ + .mpp_inact = { 5, 0 }, }; @@ -250,8 +248,7 @@ hwmp_vdetach(struct ieee80211vap *vap) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - if (callout_active(&hs->hs_roottimer)) - callout_drain(&hs->hs_roottimer); + callout_drain(&hs->hs_roottimer); free(vap->iv_hwmp, M_80211_VAP); vap->iv_hwmp = NULL; } @@ -269,6 +266,8 @@ hwmp_newstate(struct ieee80211vap *vap, /* Flush the table on RUN -> !RUN, e.g. interface down & up */ if (nstate != IEEE80211_S_RUN && ostate == IEEE80211_S_RUN) callout_drain(&hs->hs_roottimer); + if (nstate == IEEE80211_S_RUN) + hwmp_rootmode_setup(vap); return 0; } @@ -644,7 +643,7 @@ hwmp_rootmode_cb(void *arg) struct ieee80211_meshpreq_ie preq; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, vap->iv_bss, - "%s", "sending broadcast PREQ"); + "%s", "send broadcast PREQ"); /* XXX check portal role */ preq.preq_flags = IEEE80211_MESHPREQ_FLAGS_AM; @@ -683,7 +682,7 @@ hwmp_rootmode_rann_cb(void *arg) struct ieee80211_meshrann_ie rann; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, vap->iv_bss, - "%s", "sending broadcast RANN"); + "%s", "send broadcast RANN"); /* XXX check portal role */ rann.rann_flags = 0; @@ -740,7 +739,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ if (IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0))) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "replying to %s", ether_sprintf(preq->preq_origaddr)); + "reply to %s", ether_sprintf(preq->preq_origaddr)); /* * Build and send a PREP frame. */ @@ -760,7 +759,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, rt = ieee80211_mesh_rt_find(vap, preq->preq_origaddr); if (rt == NULL) hwmp_discover(vap, preq->preq_origaddr, NULL); - else if (IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) + else if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) hwmp_discover(vap, rt->rt_dest, NULL); return; } @@ -774,30 +773,36 @@ hwmp_recv_preq(struct ieee80211vap *vap, (IEEE80211_MESHPREQ_TFLAGS_TO|IEEE80211_MESHPREQ_TFLAGS_RF)))) { uint8_t rootmac[IEEE80211_ADDR_LEN]; - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "root mesh station @ %s", - ether_sprintf(preq->preq_origaddr)); IEEE80211_ADDR_COPY(rootmac, preq->preq_origaddr); rt = ieee80211_mesh_rt_find(vap, rootmac); - if (rt == NULL) + if (rt == NULL) { rt = ieee80211_mesh_rt_add(vap, rootmac); + if (rt == NULL) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "unable to add root mesh path to %s", + ether_sprintf(rootmac)); + vap->iv_stats.is_mesh_rtaddfailed++; + return; + } + } + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "root mesh station @ %s", ether_sprintf(rootmac)); + /* * Reply with a PREP if we don't have a path to the root * or if the root sent us a proactive PREQ. */ - if (IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr) || + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 || (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_PP)) { prep.prep_flags = 0; prep.prep_hopcount = 0; prep.prep_ttl = ms->ms_ttl; - IEEE80211_ADDR_COPY(prep.prep_origaddr, - vap->iv_myaddr); + IEEE80211_ADDR_COPY(prep.prep_origaddr, vap->iv_myaddr); prep.prep_origseq = preq->preq_origseq; prep.prep_targetseq = ++hs->hs_seq; prep.prep_lifetime = preq->preq_lifetime; prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; - IEEE80211_ADDR_COPY(prep.prep_targetaddr, - rootmac); + IEEE80211_ADDR_COPY(prep.prep_targetaddr, rootmac); prep.prep_targetseq = PREQ_TSEQ(0); hwmp_send_prep(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &prep); @@ -820,7 +825,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, * We have a valid route to this node. */ if (rt != NULL && - !IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) { + (rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) { hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); @@ -829,7 +834,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, if (preq->preq_ttl > 1 && preq->preq_hopcount < hs->hs_maxhops) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "forwarding PREQ from %s", + "forward PREQ from %s", ether_sprintf(preq->preq_origaddr)); /* * Propagate the original PREQ. @@ -880,8 +885,16 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ } else if (preq->preq_ttl > 1 && preq->preq_hopcount < hs->hs_maxhops) { - if (rt == NULL) + if (rt == NULL) { rt = ieee80211_mesh_rt_add(vap, PREQ_TADDR(0)); + if (rt == NULL) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, + ni, "unable to add PREQ path to %s", + ether_sprintf(PREQ_TADDR(0))); + vap->iv_stats.is_mesh_rtaddfailed++; + return; + } + } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); rt->rt_metric = preq->preq_metric; @@ -890,7 +903,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, hr->hr_preqid = preq->preq_id; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "forwarding PREQ from %s", + "forward PREQ from %s", ether_sprintf(preq->preq_origaddr)); ppreq.preq_hopcount += 1; ppreq.preq_ttl -= 1; @@ -968,7 +981,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_meshprep_ie pprep; /* propagated PREP */ IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "propagating PREP from %s", + "propagate PREP from %s", ether_sprintf(prep->prep_origaddr)); memcpy(&pprep, prep, sizeof(pprep)); @@ -986,10 +999,18 @@ hwmp_recv_prep(struct ieee80211vap *vap, */ if (hs->hs_rootmode != IEEE80211_HWMP_ROOTMODE_DISABLED) { rt = ieee80211_mesh_rt_add(vap, prep->prep_origaddr); + if (rt == NULL) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, + ni, "unable to add PREP path to %s", + ether_sprintf(prep->prep_origaddr)); + vap->iv_stats.is_mesh_rtaddfailed++; + return; + } IEEE80211_ADDR_COPY(rt->rt_nexthop, wh->i_addr2); rt->rt_nhops = prep->prep_hopcount; rt->rt_lifetime = prep->prep_lifetime; rt->rt_metric = prep->prep_metric; + rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; return; } return; @@ -1002,7 +1023,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, * If we do, check if this path reply contains a * better route. */ - if (IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) useprep = 1; else if (prep->prep_hopcount < rt->rt_nhops || prep->prep_metric < rt->rt_metric) @@ -1012,6 +1033,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, rt->rt_nhops = prep->prep_hopcount; rt->rt_lifetime = prep->prep_lifetime; rt->rt_metric = prep->prep_metric; + rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; } } else { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, @@ -1044,6 +1066,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, for (; m != NULL; m = next) { next = m->m_nextpkt; m->m_nextpkt = NULL; + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "flush queued frame %p len %d", m, m->m_pkthdr.len); ifp->if_transmit(ifp, m); } } @@ -1054,14 +1078,7 @@ hwmp_send_prep(struct ieee80211_node *ni const uint8_t da[IEEE80211_ADDR_LEN], struct ieee80211_meshprep_ie *prep) { - struct ieee80211_hwmp_state *hs = ni->ni_vap->iv_hwmp; - - /* - * Enforce PREP interval. - */ - if (ratecheck(&hs->hs_lastprep, &ieee80211_hwmp_prepminint) == 0) - return EALREADY; - getmicrouptime(&hs->hs_lastprep); + /* NB: there's no PREP minimum interval. */ /* * mesh prep action frame format @@ -1092,7 +1109,7 @@ hwmp_peerdown(struct ieee80211_node *ni) return; hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "%s", "deleting route entry"); + "%s", "delete route entry"); perr.perr_mode = 0; perr.perr_ndests = 1; IEEE80211_ADDR_COPY(PERR_DADDR(0), rt->rt_dest); @@ -1144,7 +1161,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, */ if (forward) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "propagating PERR from %s", ether_sprintf(wh->i_addr2)); + "propagate PERR from %s", ether_sprintf(wh->i_addr2)); memcpy(&pperr, perr, sizeof(*perr)); hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &pperr); } @@ -1264,13 +1281,16 @@ hwmp_discover(struct ieee80211vap *vap, if (rt == NULL) { rt = ieee80211_mesh_rt_add(vap, dest); if (rt == NULL) { - /* XXX stat+msg */ + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, + ni, "unable to add discovery path to %s", + ether_sprintf(dest)); + vap->iv_stats.is_mesh_rtaddfailed++; goto done; } } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); - if (IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) { + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) { if (hr->hr_preqid == 0) { hr->hr_seq = ++hs->hs_seq; hr->hr_preqid = ++hs->hs_preqid; @@ -1281,7 +1301,9 @@ hwmp_discover(struct ieee80211vap *vap, /* XXX check preq retries */ sendpreq = 1; IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, dest, - "%s", "initiating path discovery"); + "start path discovery (src %s)", + m == NULL ? "" : ether_sprintf( + mtod(m, struct ether_header *)->ether_shost)); /* * Try to discover the path for this node. */ @@ -1306,16 +1328,16 @@ hwmp_discover(struct ieee80211vap *vap, hwmp_send_preq(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &preq); } - if (!IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) + if (rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) ni = ieee80211_find_txnode(vap, rt->rt_nexthop); } else { ni = ieee80211_find_txnode(vap, dest); + /* NB: if null then we leak mbuf */ + KASSERT(ni != NULL, ("leak mcast frame")); return ni; } done: if (ni == NULL && m != NULL) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_HWMP, - dest, NULL, "%s", "no valid path to this node"); if (sendpreq) { struct ieee80211com *ic = vap->iv_ic; /* @@ -1323,13 +1345,18 @@ done: * completes. If discovery never completes the * frame will be flushed by way of the aging timer. */ + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, dest, + "%s", "queue frame until path found"); m->m_pkthdr.rcvif = (void *)(uintptr_t) ieee80211_mac_hash(ic, dest); /* XXX age chosen randomly */ ieee80211_ageq_append(&ic->ic_stageq, m, IEEE80211_INACT_WAIT); - } else + } else { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_HWMP, + dest, NULL, "%s", "no valid path to this node"); m_freem(m); + } } return ni; } Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Mon Jul 20 16:19:42 2009 (r195783) +++ head/sys/net80211/ieee80211_input.c Mon Jul 20 19:12:08 2009 (r195784) @@ -233,22 +233,17 @@ ieee80211_deliver_data(struct ieee80211v struct mbuf * ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen) { -#ifdef IEEE80211_SUPPORT_MESH - union { - struct ieee80211_qosframe_addr4 wh4; - uint8_t b[sizeof(struct ieee80211_qosframe_addr4) + - sizeof(struct ieee80211_meshcntl_ae11)]; - } whu; -#define wh whu.wh4 -#else struct ieee80211_qosframe_addr4 wh; -#endif struct ether_header *eh; struct llc *llc; + KASSERT(hdrlen <= sizeof(wh), + ("hdrlen %d > max %zd", hdrlen, sizeof(wh))); + if (m->m_len < hdrlen + sizeof(*llc) && (m = m_pullup(m, hdrlen + sizeof(*llc))) == NULL) { - /* XXX stat, msg */ + vap->iv_stats.is_rx_tooshort++; + /* XXX msg */ return NULL; } memcpy(&wh, mtod(m, caddr_t), hdrlen); @@ -295,7 +290,6 @@ ieee80211_decap(struct ieee80211vap *vap eh->ether_type = htons(m->m_pkthdr.len - sizeof(*eh)); } return m; -#undef wh } /* Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Mon Jul 20 16:19:42 2009 (r195783) +++ head/sys/net80211/ieee80211_ioctl.h Mon Jul 20 19:12:08 2009 (r195784) @@ -235,9 +235,13 @@ struct ieee80211_stats { uint32_t is_hwmp_wrongseq; /* wrong hwmp seq no. */ uint32_t is_hwmp_rootreqs; /* root PREQs sent */ uint32_t is_hwmp_rootrann; /* root RANNs sent */ - uint32_t is_rx_badalign; /* dropped 'cuz misaligned */ - uint32_t is_spare[15]; + uint32_t is_mesh_badae; /* dropped 'cuz invalid AE */ + uint32_t is_mesh_rtaddfailed; /* route add failed */ + uint32_t is_mesh_notproxy; /* dropped 'cuz not proxying */ + uint32_t is_rx_badalign; /* dropped 'cuz misaligned */ + + uint32_t is_spare[12]; }; /* @@ -328,6 +332,16 @@ enum { IEEE80211_MESH_RTCMD_DELETE = 3, /* delete an entry from the table */ }; +struct ieee80211req_mesh_route { + uint8_t imr_dest[IEEE80211_ADDR_LEN]; + uint8_t imr_nexthop[IEEE80211_ADDR_LEN]; + uint16_t imr_nhops; + uint16_t imr_pad; + uint32_t imr_metric; + uint32_t imr_lifetime; + uint32_t imr_lastmseq; +}; + /* * HWMP root modes */ Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Mon Jul 20 16:19:42 2009 (r195783) +++ head/sys/net80211/ieee80211_mesh.c Mon Jul 20 19:12:08 2009 (r195784) @@ -62,10 +62,12 @@ __FBSDID("$FreeBSD$"); #include #include +static void mesh_rt_flush_invalid(struct ieee80211vap *); static int mesh_select_proto_path(struct ieee80211vap *, const char *); static int mesh_select_proto_metric(struct ieee80211vap *, const char *); static void mesh_vattach(struct ieee80211vap *); static int mesh_newstate(struct ieee80211vap *, enum ieee80211_state, int); +static void mesh_rt_cleanup_cb(void *); static void mesh_linkchange(struct ieee80211_node *, enum ieee80211_mesh_mlstate); static void mesh_checkid(void *, struct ieee80211_node *); @@ -138,6 +140,7 @@ static struct ieee80211_mesh_proto_path static struct ieee80211_mesh_proto_metric mesh_proto_metrics[4]; #define MESH_RT_LOCK(ms) mtx_lock(&(ms)->ms_rt_lock) +#define MESH_RT_LOCK_ASSERT(ms) mtx_assert(&(ms)->ms_rt_lock, MA_OWNED) #define MESH_RT_UNLOCK(ms) mtx_unlock(&(ms)->ms_rt_lock) MALLOC_DEFINE(M_80211_MESH_RT, "80211mesh", "802.11s routing table"); @@ -145,6 +148,44 @@ MALLOC_DEFINE(M_80211_MESH_RT, "80211mes /* * Helper functions to manipulate the Mesh routing table. */ + +static struct ieee80211_mesh_route * +mesh_rt_find_locked(struct ieee80211_mesh_state *ms, + const uint8_t dest[IEEE80211_ADDR_LEN]) +{ + struct ieee80211_mesh_route *rt; + + MESH_RT_LOCK_ASSERT(ms); + + TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { + if (IEEE80211_ADDR_EQ(dest, rt->rt_dest)) + return rt; + } + return NULL; +} + +static struct ieee80211_mesh_route * +mesh_rt_add_locked(struct ieee80211_mesh_state *ms, + const uint8_t dest[IEEE80211_ADDR_LEN]) +{ + struct ieee80211_mesh_route *rt; + + KASSERT(!IEEE80211_ADDR_EQ(broadcastaddr, dest), + ("%s: adding broadcast to the routing table", __func__)); + + MESH_RT_LOCK_ASSERT(ms); + + rt = malloc(ALIGN(sizeof(struct ieee80211_mesh_route)) + + ms->ms_ppath->mpp_privlen, M_80211_MESH_RT, M_NOWAIT | M_ZERO); + if (rt != NULL) { + IEEE80211_ADDR_COPY(rt->rt_dest, dest); + rt->rt_priv = (void *)ALIGN(&rt[1]); + getmicrouptime(&rt->rt_crtime); + TAILQ_INSERT_TAIL(&ms->ms_routes, rt, rt_next); + } + return rt; +} + struct ieee80211_mesh_route * ieee80211_mesh_rt_find(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) @@ -153,14 +194,9 @@ ieee80211_mesh_rt_find(struct ieee80211v struct ieee80211_mesh_route *rt; MESH_RT_LOCK(ms); - TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { - if (IEEE80211_ADDR_EQ(dest, rt->rt_dest)) { - MESH_RT_UNLOCK(ms); - return rt; - } - } + rt = mesh_rt_find_locked(ms, dest); MESH_RT_UNLOCK(ms); - return NULL; + return rt; } struct ieee80211_mesh_route * @@ -174,20 +210,65 @@ ieee80211_mesh_rt_add(struct ieee80211va ("%s: duplicate entry in the routing table", __func__)); KASSERT(!IEEE80211_ADDR_EQ(vap->iv_myaddr, dest), ("%s: adding self to the routing table", __func__)); - KASSERT(!IEEE80211_ADDR_EQ(broadcastaddr, dest), - ("%s: adding broadcast to the routing table", __func__)); - rt = malloc(sizeof(struct ieee80211_mesh_route), M_80211_MESH_RT, - M_NOWAIT | M_ZERO); - IEEE80211_ADDR_COPY(rt->rt_dest, dest); - rt->rt_priv = malloc(ms->ms_ppath->mpp_privlen, M_80211_MESH_RT, - M_NOWAIT | M_ZERO); MESH_RT_LOCK(ms); - TAILQ_INSERT_TAIL(&ms->ms_routes, rt, rt_next); + rt = mesh_rt_add_locked(ms, dest); MESH_RT_UNLOCK(ms); return rt; } +/* + * Add a proxy route (as needed) for the specified destination. + */ +void +ieee80211_mesh_proxy_check(struct ieee80211vap *vap, + const uint8_t dest[IEEE80211_ADDR_LEN]) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt; + + MESH_RT_LOCK(ms); + rt = mesh_rt_find_locked(ms, dest); + if (rt == NULL) { + rt = mesh_rt_add_locked(ms, dest); + if (rt == NULL) { + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, dest, + "%s", "unable to add proxy entry"); + vap->iv_stats.is_mesh_rtaddfailed++; + } else { + IEEE80211_ADDR_COPY(rt->rt_nexthop, vap->iv_myaddr); + rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID + | IEEE80211_MESHRT_FLAGS_PROXY; + } + /* XXX assert PROXY? */ + } else if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) { + struct ieee80211com *ic = vap->iv_ic; + /* + * Fix existing entry created by received frames from + * stations that have some memory of dest. We also + * flush any frames held on the staging queue; delivering + * them is too much trouble right now. + */ + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, dest, + "%s", "fix proxy entry"); + IEEE80211_ADDR_COPY(rt->rt_nexthop, vap->iv_myaddr); + rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID + | IEEE80211_MESHRT_FLAGS_PROXY; + /* XXX belongs in hwmp */ + ieee80211_ageq_drain_node(&ic->ic_stageq, + (void *)(uintptr_t) ieee80211_mac_hash(ic, dest)); + /* XXX stat? */ + } + MESH_RT_UNLOCK(ms); +} + +static __inline void +mesh_rt_del(struct ieee80211_mesh_state *ms, struct ieee80211_mesh_route *rt) +{ + TAILQ_REMOVE(&ms->ms_routes, rt, rt_next); + free(rt, M_80211_MESH_RT); +} + void ieee80211_mesh_rt_del(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) @@ -198,9 +279,7 @@ ieee80211_mesh_rt_del(struct ieee80211va MESH_RT_LOCK(ms); TAILQ_FOREACH_SAFE(rt, &ms->ms_routes, rt_next, next) { if (IEEE80211_ADDR_EQ(rt->rt_dest, dest)) { - TAILQ_REMOVE(&ms->ms_routes, rt, rt_next); - free(rt->rt_priv, M_80211_MESH_RT); - free(rt, M_80211_MESH_RT); + mesh_rt_del(ms, rt); MESH_RT_UNLOCK(ms); return; } @@ -217,10 +296,32 @@ ieee80211_mesh_rt_flush(struct ieee80211 if (ms == NULL) return; MESH_RT_LOCK(ms); + TAILQ_FOREACH_SAFE(rt, &ms->ms_routes, rt_next, next) + mesh_rt_del(ms, rt); + MESH_RT_UNLOCK(ms); +} + +/* + * Flush expired routing entries, i.e. those in invalid state for + * some time. + */ +static void +mesh_rt_flush_invalid(struct ieee80211vap *vap) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt, *next; + struct timeval tv, delta; + + if (ms == NULL) + return; + getmicrouptime(&tv); + MESH_RT_LOCK(ms); TAILQ_FOREACH_SAFE(rt, &ms->ms_routes, rt_next, next) { - TAILQ_REMOVE(&ms->ms_routes, rt, rt_next); - free(rt->rt_priv, M_80211_MESH_RT); - free(rt, M_80211_MESH_RT); + delta = tv; + timevalsub(&delta, &rt->rt_crtime); + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 && + timevalcmp(&delta, &ms->ms_ppath->mpp_inact, >=)) + mesh_rt_del(ms, rt); } MESH_RT_UNLOCK(ms); } @@ -381,7 +482,7 @@ mesh_vdetach_peers(void *arg, struct iee IEEE80211_ACTION_MESHPEERING_CLOSE, args); } - callout_stop(&ni->ni_mltimer); + callout_drain(&ni->ni_mltimer); /* XXX belongs in hwmp */ ieee80211_ageq_drain_node(&ic->ic_stageq, (void *)(uintptr_t) ieee80211_mac_hash(ic, ni->ni_macaddr)); @@ -392,6 +493,7 @@ mesh_vdetach(struct ieee80211vap *vap) { struct ieee80211_mesh_state *ms = vap->iv_mesh; + callout_drain(&ms->ms_cleantimer); ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, mesh_vdetach_peers, NULL); ieee80211_mesh_rt_flush(vap); @@ -413,7 +515,7 @@ mesh_vattach(struct ieee80211vap *vap) M_NOWAIT | M_ZERO); if (ms == NULL) { printf("%s: couldn't alloc MBSS state\n", __func__); - return; + return; } vap->iv_mesh = ms; ms->ms_seq = 0; @@ -421,6 +523,7 @@ mesh_vattach(struct ieee80211vap *vap) ms->ms_ttl = IEEE80211_MESH_DEFAULT_TTL; TAILQ_INIT(&ms->ms_routes); mtx_init(&ms->ms_rt_lock, "MBSS", "802.11s routing table", MTX_DEF); + callout_init(&ms->ms_cleantimer, CALLOUT_MPSAFE); mesh_select_proto_metric(vap, "AIRTIME"); KASSERT(ms->ms_pmetric, ("ms_pmetric == NULL")); mesh_select_proto_path(vap, "HWMP"); @@ -449,9 +552,8 @@ mesh_newstate(struct ieee80211vap *vap, if (ostate != IEEE80211_S_SCAN) ieee80211_cancel_scan(vap); /* background scan */ ni = vap->iv_bss; /* NB: no reference held */ - /* Flush the routing table */ - if (nstate != IEEE80211_S_INIT && ostate == IEEE80211_S_INIT) - ieee80211_mesh_rt_flush(vap); + if (nstate != IEEE80211_S_RUN && ostate == IEEE80211_S_RUN) + callout_drain(&ms->ms_cleantimer); switch (nstate) { case IEEE80211_S_INIT: switch (ostate) { @@ -471,6 +573,7 @@ mesh_newstate(struct ieee80211vap *vap, if (ostate != IEEE80211_S_INIT) { /* NB: optimize INIT -> INIT case */ ieee80211_reset_bss(vap); + ieee80211_mesh_rt_flush(vap); } break; case IEEE80211_S_SCAN: @@ -573,17 +676,33 @@ mesh_newstate(struct ieee80211vap *vap, break; } ieee80211_node_authorize(vap->iv_bss); + callout_reset(&ms->ms_cleantimer, + msecs_to_ticks(ms->ms_ppath->mpp_inact.tv_sec * 1000 + + ms->ms_ppath->mpp_inact.tv_usec / 1000), + mesh_rt_cleanup_cb, vap); break; default: break; } - /* NB: ostate not nstate */ ms->ms_ppath->mpp_newstate(vap, ostate, arg); - return 0; } +static void +mesh_rt_cleanup_cb(void *arg) +{ + struct ieee80211vap *vap = arg; + struct ieee80211_mesh_state *ms = vap->iv_mesh; + + mesh_rt_flush_invalid(vap); + callout_reset(&ms->ms_cleantimer, + msecs_to_ticks(ms->ms_ppath->mpp_inact.tv_sec * 1000 + + ms->ms_ppath->mpp_inact.tv_usec / 1000), + mesh_rt_cleanup_cb, vap); +} + + /* * Helper function to note the Mesh Peer Link FSM change. */ @@ -617,8 +736,16 @@ mesh_linkchange(struct ieee80211_node *n ms->ms_neighbors--; } ni->ni_mlstate = state; - if (state == IEEE80211_NODE_MESH_HOLDING) + switch (state) { + case IEEE80211_NODE_MESH_HOLDING: ms->ms_ppath->mpp_peerdown(ni); + break; + case IEEE80211_NODE_MESH_ESTABLISHED: + ieee80211_mesh_discover(vap, ni->ni_macaddr, NULL); + break; + default: + break; + } } /* @@ -660,8 +787,11 @@ mesh_checkpseq(struct ieee80211vap *vap, rt = ieee80211_mesh_rt_find(vap, source); if (rt == NULL) { + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, source, + "add mcast route, mesh seqno %d", seq); rt = ieee80211_mesh_rt_add(vap, source); - rt->rt_lastmseq = seq; + if (rt != NULL) + rt->rt_lastmseq = seq; return 0; } if (IEEE80211_MESH_SEQ_GEQ(rt->rt_lastmseq, seq)) { @@ -684,6 +814,13 @@ mesh_find_txnode(struct ieee80211vap *va rt = ieee80211_mesh_rt_find(vap, dest); if (rt == NULL) return NULL; + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 || + (rt->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY)) { + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, dest, + "%s: !valid or proxy, flags 0x%x", __func__, rt->rt_flags); + /* XXX stat */ + return NULL; + } return ieee80211_find_txnode(vap, rt->rt_nexthop); } @@ -757,11 +894,6 @@ mesh_forward(struct ieee80211vap *vap, s } IEEE80211_ADDR_COPY(whcopy->i_addr1, ni->ni_macaddr); } - IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, ni, - "fwd %s frame from %s ttl %d", - IEEE80211_IS_MULTICAST(wh->i_addr1) ? "mcast" : "ucast", - ether_sprintf(wh->i_addr3), mccopy->mc_ttl); - KASSERT(mccopy->mc_ttl > 0, ("%s called with wrong ttl", __func__)); mccopy->mc_ttl--; @@ -779,6 +911,117 @@ mesh_forward(struct ieee80211vap *vap, s } } +static struct mbuf * +mesh_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen, int meshdrlen) +{ +#define WHDIR(wh) ((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) + uint8_t b[sizeof(struct ieee80211_qosframe_addr4) + + sizeof(struct ieee80211_meshcntl_ae11)]; + const struct ieee80211_qosframe_addr4 *wh; + const struct ieee80211_meshcntl_ae10 *mc; + struct ether_header *eh; + struct llc *llc; + int ae; + + if (m->m_len < hdrlen + sizeof(*llc) && + (m = m_pullup(m, hdrlen + sizeof(*llc))) == NULL) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_ANY, + "discard data frame: %s", "m_pullup failed"); + vap->iv_stats.is_rx_tooshort++; + return NULL; + } + memcpy(b, mtod(m, caddr_t), hdrlen); + wh = (const struct ieee80211_qosframe_addr4 *)&b[0]; + mc = (const struct ieee80211_meshcntl_ae10 *)&b[hdrlen - meshdrlen]; + KASSERT(WHDIR(wh) == IEEE80211_FC1_DIR_FROMDS || + WHDIR(wh) == IEEE80211_FC1_DIR_DSTODS, + ("bogus dir, fc 0x%x:0x%x", wh->i_fc[0], wh->i_fc[1])); + + llc = (struct llc *)(mtod(m, caddr_t) + hdrlen); + if (llc->llc_dsap == LLC_SNAP_LSAP && llc->llc_ssap == LLC_SNAP_LSAP && + llc->llc_control == LLC_UI && llc->llc_snap.org_code[0] == 0 && + llc->llc_snap.org_code[1] == 0 && llc->llc_snap.org_code[2] == 0 && + /* NB: preserve AppleTalk frames that have a native SNAP hdr */ + !(llc->llc_snap.ether_type == htons(ETHERTYPE_AARP) || + llc->llc_snap.ether_type == htons(ETHERTYPE_IPX))) { + m_adj(m, hdrlen + sizeof(struct llc) - sizeof(*eh)); + llc = NULL; + } else { + m_adj(m, hdrlen - sizeof(*eh)); + } + eh = mtod(m, struct ether_header *); + ae = mc->mc_flags & 3; + if (WHDIR(wh) == IEEE80211_FC1_DIR_FROMDS) { + IEEE80211_ADDR_COPY(eh->ether_dhost, wh->i_addr1); + if (ae == 0) { + IEEE80211_ADDR_COPY(eh->ether_shost, wh->i_addr3); + } else if (ae == 1) { + IEEE80211_ADDR_COPY(eh->ether_shost, mc->mc_addr4); + } else { + IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, + (const struct ieee80211_frame *)wh, NULL, + "bad AE %d", ae); + vap->iv_stats.is_mesh_badae++; + m_freem(m); + return NULL; + } + } else { + if (ae == 0) { + IEEE80211_ADDR_COPY(eh->ether_dhost, wh->i_addr3); + IEEE80211_ADDR_COPY(eh->ether_shost, wh->i_addr4); + } else if (ae == 2) { + IEEE80211_ADDR_COPY(eh->ether_dhost, mc->mc_addr4); + IEEE80211_ADDR_COPY(eh->ether_shost, mc->mc_addr5); + } else { + IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, + (const struct ieee80211_frame *)wh, NULL, + "bad AE %d", ae); + vap->iv_stats.is_mesh_badae++; + m_freem(m); + return NULL; + } + } +#ifdef ALIGNED_POINTER + if (!ALIGNED_POINTER(mtod(m, caddr_t) + sizeof(*eh), uint32_t)) { + m = ieee80211_realign(vap, m, sizeof(*eh)); + if (m == NULL) + return NULL; + } +#endif /* ALIGNED_POINTER */ + if (llc != NULL) { + eh = mtod(m, struct ether_header *); + eh->ether_type = htons(m->m_pkthdr.len - sizeof(*eh)); + } + return m; +#undef WDIR +} + +/* + * Return non-zero if the unicast mesh data frame should be processed + * locally. Frames that are not proxy'd have our address, otherwise + * we need to consult the routing table to look for a proxy entry. + */ +static __inline int +mesh_isucastforme(struct ieee80211vap *vap, const struct ieee80211_frame *wh, + const struct ieee80211_meshcntl *mc) +{ + int ae = mc->mc_flags & 3; + + KASSERT((wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS, + ("bad dir 0x%x:0x%x", wh->i_fc[0], wh->i_fc[1])); + KASSERT(ae == 0 || ae == 2, ("bad AE %d", ae)); + if (ae == 2) { /* ucast w/ proxy */ + const struct ieee80211_meshcntl_ae10 *mc10 = + (const struct ieee80211_meshcntl_ae10 *) mc; + struct ieee80211_mesh_route *rt = + ieee80211_mesh_rt_find(vap, mc10->mc_addr4); + /* check for proxy route to ourself */ + return (rt != NULL && + (rt->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY)); + } else /* ucast w/o proxy */ + return IEEE80211_ADDR_EQ(wh->i_addr3, vap->iv_myaddr); +} + static int mesh_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) { @@ -789,7 +1032,7 @@ mesh_input(struct ieee80211_node *ni, st struct ifnet *ifp = vap->iv_ifp; struct ieee80211_frame *wh; const struct ieee80211_meshcntl *mc; - int hdrspace, need_tap; + int hdrspace, meshdrlen, need_tap; uint8_t dir, type, subtype, qos; uint32_t seq; uint8_t *addr; @@ -904,13 +1147,14 @@ mesh_input(struct ieee80211_node *ni, st } /* * Now calculate the full extent of the headers. Note - * ieee80211_decap will pull up anything we didn't get + * mesh_decap will pull up anything we didn't get * above when it strips the 802.11 headers. */ mc = (const struct ieee80211_meshcntl *) (mtod(m, const uint8_t *) + hdrspace); - hdrspace += sizeof(struct ieee80211_meshcntl) + + meshdrlen = sizeof(struct ieee80211_meshcntl) + (mc->mc_flags & 3) * IEEE80211_ADDR_LEN; + hdrspace += meshdrlen; seq = LE_READ_4(mc->mc_seq); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) addr = wh->i_addr3; @@ -935,7 +1179,7 @@ mesh_input(struct ieee80211_node *ni, st * for the rules. XXX tap fwd'd packets not for us? */ if (dir == IEEE80211_FC1_DIR_FROMDS || - !IEEE80211_ADDR_EQ(wh->i_addr3, vap->iv_myaddr)) { + !mesh_isucastforme(vap, wh, mc)) { mesh_forward(vap, m, mc); if (dir == IEEE80211_FC1_DIR_DSTODS) goto out; @@ -970,7 +1214,7 @@ mesh_input(struct ieee80211_node *ni, st /* * Finally, strip the 802.11 header. */ - m = ieee80211_decap(vap, m, hdrspace); + m = mesh_decap(vap, m, hdrspace, meshdrlen); if (m == NULL) { /* XXX mask bit to check for both */ /* don't count Null data frames as errors */ @@ -987,13 +1231,7 @@ mesh_input(struct ieee80211_node *ni, st m = ieee80211_decap_amsdu(ni, m); if (m == NULL) return IEEE80211_FC0_TYPE_DATA; - } else { -#ifdef IEEE80211_SUPPORT_SUPERG - m = ieee80211_decap_fastframe(vap, ni, m); - if (m == NULL) - return IEEE80211_FC0_TYPE_DATA; -#endif - } + } ieee80211_deliver_data(vap, ni, m); return type; case IEEE80211_FC0_TYPE_MGT: @@ -1967,7 +2205,7 @@ mesh_peer_timeout_backoff(struct ieee802 static __inline void mesh_peer_timeout_stop(struct ieee80211_node *ni) { - callout_stop(&ni->ni_mltimer); + callout_drain(&ni->ni_mltimer); } /* @@ -2401,6 +2639,7 @@ mesh_ioctl_get80211(struct ieee80211vap return ENOMEM; } ireq->i_len = len; + /* XXX M_WAIT? */ p = malloc(len, M_TEMP, M_NOWAIT | M_ZERO); if (p == NULL) return ENOMEM; @@ -2418,6 +2657,7 @@ mesh_ioctl_get80211(struct ieee80211vap imr->imr_metric = rt->rt_metric; imr->imr_nhops = rt->rt_nhops; imr->imr_lifetime = rt->rt_lifetime; + imr->imr_lastmseq = rt->rt_lastmseq; off += sizeof(*imr); } MESH_RT_UNLOCK(ms); @@ -2475,17 +2715,19 @@ mesh_ioctl_set80211(struct ieee80211vap if (ireq->i_val != 0 || ireq->i_len > IEEE80211_MESHID_LEN) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 19:16:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48330106564A; Mon, 20 Jul 2009 19:16:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 350F48FC19; Mon, 20 Jul 2009 19:16:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6KJGhPn086257; Mon, 20 Jul 2009 19:16:43 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6KJGhEl086253; Mon, 20 Jul 2009 19:16:43 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200907201916.n6KJGhEl086253@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 20 Jul 2009 19:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195785 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 19:16:43 -0000 Author: trasz Date: Mon Jul 20 19:16:42 2009 New Revision: 195785 URL: http://svn.freebsd.org/changeset/base/195785 Log: Fix permission handling for extended attributes in ZFS. Without this change, ZFS uses SunOS Alternate Data Streams semantics - each EA has its own permissions, which are set at EA creation time and - unlike SunOS - invisible to the user and impossible to change. From the user point of view, it's just broken: sometimes access is granted when it shouldn't be, sometimes it's denied when it shouldn't be. This patch makes it behave just like UFS, i.e. depend on current file permissions. Also, it fixes returned error codes (ENOATTR instead of ENOENT) and makes listextattr(2) return 0 instead of EPERM where there is no EA directory (i.e. the file never had any EA). Reviewed by: pjd (idea, not actual code) Approved by: re (kib) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Jul 20 19:12:08 2009 (r195784) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Jul 20 19:16:42 2009 (r195785) @@ -2360,6 +2360,15 @@ zfs_zaccess(znode_t *zp, int mode, int f is_attr = ((zp->z_phys->zp_flags & ZFS_XATTR) && (ZTOV(zp)->v_type == VDIR)); +#ifdef __FreeBSD__ + /* + * In FreeBSD, we don't care about permissions of individual ADS. + * Note that not checking them is not just an optimization - without + * this shortcut, EA operations may bogusly fail with EACCES. + */ + if (zp->z_phys->zp_flags & ZFS_XATTR) + return (0); +#else /* * If attribute then validate against base file */ @@ -2385,6 +2394,7 @@ zfs_zaccess(znode_t *zp, int mode, int f mode |= ACE_READ_NAMED_ATTRS; } } +#endif if ((error = zfs_zaccess_common(check_zp, mode, &working_mode, &check_privs, skipaclchk, cr)) == 0) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Jul 20 19:12:08 2009 (r195784) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Jul 20 19:16:42 2009 (r195785) @@ -831,8 +831,14 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * *xvpp = NULL; + /* + * In FreeBSD, access checking for creating an EA is being done + * in zfs_setextattr(), + */ +#ifndef __FreeBSD__ if (error = zfs_zaccess(zp, ACE_WRITE_NAMED_ATTRS, 0, B_FALSE, cr)) return (error); +#endif tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_bonus(tx, zp->z_id); @@ -906,12 +912,14 @@ top: ASSERT(zp->z_phys->zp_xattr == 0); -#ifdef TODO if (!(flags & CREATE_XATTR_DIR)) { zfs_dirent_unlock(dl); +#ifdef __FreeBSD__ + return (ENOATTR); +#else return (ENOENT); - } #endif + } if (zfsvfs->z_vfs->vfs_flag & VFS_RDONLY) { zfs_dirent_unlock(dl); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jul 20 19:12:08 2009 (r195784) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jul 20 19:16:42 2009 (r195785) @@ -4502,6 +4502,11 @@ vop_getextattr { vnode_t *xvp = NULL, *vp; int error, flags; + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VREAD); + if (error != 0) + return (error); + error = zfs_create_attrname(ap->a_attrnamespace, ap->a_name, attrname, sizeof(attrname)); if (error != 0) @@ -4523,6 +4528,8 @@ vop_getextattr { vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { + if (error == ENOENT) + error = ENOATTR; ZFS_EXIT(zfsvfs); return (error); } @@ -4564,6 +4571,11 @@ vop_deleteextattr { vnode_t *xvp = NULL, *vp; int error, flags; + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VWRITE); + if (error != 0) + return (error); + error = zfs_create_attrname(ap->a_attrnamespace, ap->a_name, attrname, sizeof(attrname)); if (error != 0) @@ -4584,6 +4596,8 @@ vop_deleteextattr { vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { + if (error == ENOENT) + error = ENOATTR; ZFS_EXIT(zfsvfs); return (error); } @@ -4623,6 +4637,11 @@ vop_setextattr { vnode_t *xvp = NULL, *vp; int error, flags; + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VWRITE); + if (error != 0) + return (error); + error = zfs_create_attrname(ap->a_attrnamespace, ap->a_name, attrname, sizeof(attrname)); if (error != 0) @@ -4631,7 +4650,7 @@ vop_setextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR | CREATE_XATTR_DIR); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -4690,6 +4709,11 @@ vop_listextattr { vnode_t *xvp = NULL, *vp; int done, error, eof, pos; + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VREAD); + if (error) + return (error); + error = zfs_create_attrname(ap->a_attrnamespace, "", attrprefix, sizeof(attrprefix)); if (error != 0) @@ -4701,6 +4725,12 @@ vop_listextattr { error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, LOOKUP_XATTR); if (error != 0) { + /* + * ENOATTR means that the EA directory does not yet exist, + * i.e. there are no extended attributes there. + */ + if (error == ENOATTR) + error = 0; ZFS_EXIT(zfsvfs); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 19:20:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E60D1065674; Mon, 20 Jul 2009 19:20:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B29D8FC1D; Mon, 20 Jul 2009 19:20:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6KJKdrc086454; Mon, 20 Jul 2009 19:20:39 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6KJKbtj086449; Mon, 20 Jul 2009 19:20:37 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907201920.n6KJKbtj086449@svn.freebsd.org> From: Doug Barton Date: Mon, 20 Jul 2009 19:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195786 - in stable/7/games/fortune: . datfiles fortune X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 19:20:40 -0000 Author: dougb Date: Mon Jul 20 19:20:37 2009 New Revision: 195786 URL: http://svn.freebsd.org/changeset/base/195786 Log: MFC 195726: spaces before commas and one ). Modified: stable/7/games/fortune/ (props changed) stable/7/games/fortune/datfiles/ (props changed) stable/7/games/fortune/datfiles/fortunes stable/7/games/fortune/datfiles/fortunes-o.real stable/7/games/fortune/datfiles/freebsd-tips (props changed) stable/7/games/fortune/fortune/ (props changed) Modified: stable/7/games/fortune/datfiles/fortunes ============================================================================== --- stable/7/games/fortune/datfiles/fortunes Mon Jul 20 19:16:42 2009 (r195785) +++ stable/7/games/fortune/datfiles/fortunes Mon Jul 20 19:20:37 2009 (r195786) @@ -12229,7 +12229,7 @@ after they got done, you wanted to be tr "The test or the room?" "The tests or the room? Vell, nah, about them I can't complain." "The nurses? The food?" asked Fats, but Bernard shook his head no. -Fats laughed and said, "Listen , Bernie, you went to the MBH, they did this +Fats laughed and said, "Listen, Bernie, you went to the MBH, they did this great workup, and when I asked you shy you came to the House of God, all you tell me is, 'Nah, I can't complain.' So why did you come here? Why, Bernie, why?" @@ -25009,7 +25009,7 @@ Great song. -- Fred Reuss % I went to a job interview the other day, the guy asked me if I had any -questions , I said yes, just one, if you're in a car traveling at the +questions, I said yes, just one, if you're in a car traveling at the speed of light and you turn your headlights on, does anything happen? He said he couldn't answer that, I told him sorry, but I couldn't work @@ -25534,7 +25534,7 @@ we wouldn't reach a conclusion. If an average person on the subway turns to you, like an ancient mariner, and starts telling you her tale, you turn away or nod and hope she stops, not just because you fear she might be crazy. If she tells her tale on -camera, you might listen. Watching strangers on television , even +camera, you might listen. Watching strangers on television, even responding to them from a studio audience, we're disengaged - voyeurs collaborating with exhibitionists in rituals of sham community. Never have so many known so much about people for whom they cared so little. @@ -26161,9 +26161,9 @@ they'll never hurt you, nine times out o % If practice makes perfect, and nobody's perfect, why practice? % -If preceded by a '-' , the timezone shall be east of the Prime +If preceded by a '-', the timezone shall be east of the Prime Meridian; otherwise, it shall be west (which may be indicated by -an optional preceding '+' ). +an optional preceding '+'). -- POSIX 2001 The "+" or "-" indicates whether the time-of-day is ahead of Modified: stable/7/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/7/games/fortune/datfiles/fortunes-o.real Mon Jul 20 19:16:42 2009 (r195785) +++ stable/7/games/fortune/datfiles/fortunes-o.real Mon Jul 20 19:20:37 2009 (r195786) @@ -6576,7 +6576,7 @@ mean. The answer is hot tubs. A hot tu water that you sit in naked with members of the opposite sex, none of whom is necessarily your spouse. After a few hours in their hot tubs, Californians don't give a damn about earthquakes or mass murderers. They don't give a -damn about anything , which is why they are able to produce "Laverne and +damn about anything, which is why they are able to produce "Laverne and Shirley" week after week. -- Dave Barry % From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 19:33:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30DFD1065673; Mon, 20 Jul 2009 19:33:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DAFF8FC0A; Mon, 20 Jul 2009 19:33:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6KJXNIR086841; Mon, 20 Jul 2009 19:33:23 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6KJXMIc086838; Mon, 20 Jul 2009 19:33:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907201933.n6KJXMIc086838@svn.freebsd.org> From: Doug Barton Date: Mon, 20 Jul 2009 19:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195787 - in stable/6/games/fortune: . datfiles fortune X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 19:33:24 -0000 Author: dougb Date: Mon Jul 20 19:33:22 2009 New Revision: 195787 URL: http://svn.freebsd.org/changeset/base/195787 Log: MFC 195726: spaces before commas and one ). (Note, the change to fortunes2-o is applied by hand from HEAD/*/fortunes-o.real since the fortunes2-o file was consolidated into it as of RELENG_7.) Modified: stable/6/games/fortune/ (props changed) stable/6/games/fortune/datfiles/fortunes stable/6/games/fortune/datfiles/fortunes2-o stable/6/games/fortune/fortune/ (props changed) Modified: stable/6/games/fortune/datfiles/fortunes ============================================================================== --- stable/6/games/fortune/datfiles/fortunes Mon Jul 20 19:20:37 2009 (r195786) +++ stable/6/games/fortune/datfiles/fortunes Mon Jul 20 19:33:22 2009 (r195787) @@ -12228,7 +12228,7 @@ after they got done, you wanted to be tr "The test or the room?" "The tests or the room? Vell, nah, about them I can't complain." "The nurses? The food?" asked Fats, but Bernard shook his head no. -Fats laughed and said, "Listen , Bernie, you went to the MBH, they did this +Fats laughed and said, "Listen, Bernie, you went to the MBH, they did this great workup, and when I asked you shy you came to the House of God, all you tell me is, 'Nah, I can't complain.' So why did you come here? Why, Bernie, why?" @@ -25008,7 +25008,7 @@ Great song. -- Fred Reuss % I went to a job interview the other day, the guy asked me if I had any -questions , I said yes, just one, if you're in a car traveling at the +questions, I said yes, just one, if you're in a car traveling at the speed of light and you turn your headlights on, does anything happen? He said he couldn't answer that, I told him sorry, but I couldn't work @@ -25533,7 +25533,7 @@ we wouldn't reach a conclusion. If an average person on the subway turns to you, like an ancient mariner, and starts telling you her tale, you turn away or nod and hope she stops, not just because you fear she might be crazy. If she tells her tale on -camera, you might listen. Watching strangers on television , even +camera, you might listen. Watching strangers on television, even responding to them from a studio audience, we're disengaged - voyeurs collaborating with exhibitionists in rituals of sham community. Never have so many known so much about people for whom they cared so little. @@ -26160,9 +26160,9 @@ they'll never hurt you, nine times out o % If practice makes perfect, and nobody's perfect, why practice? % -If preceded by a '-' , the timezone shall be east of the Prime +If preceded by a '-', the timezone shall be east of the Prime Meridian; otherwise, it shall be west (which may be indicated by -an optional preceding '+' ). +an optional preceding '+'). -- POSIX 2001 The "+" or "-" indicates whether the time-of-day is ahead of Modified: stable/6/games/fortune/datfiles/fortunes2-o ============================================================================== --- stable/6/games/fortune/datfiles/fortunes2-o Mon Jul 20 19:20:37 2009 (r195786) +++ stable/6/games/fortune/datfiles/fortunes2-o Mon Jul 20 19:33:22 2009 (r195787) @@ -5745,7 +5745,7 @@ mean. The answer is hot tubs. A hot tu water that you sit in naked with members of the opposite sex, none of whom is necessarily your spouse. After a few hours in their hot tubs, Californians don't give a damn about earthquakes or mass murderers. They don't give a -damn about anything , which is why they are able to produce "Laverne and +damn about anything, which is why they are able to produce "Laverne and Shirley" week after week. -- Dave Barry % From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 19:40:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A96111065672; Mon, 20 Jul 2009 19:40:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97CAF8FC28; Mon, 20 Jul 2009 19:40:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6KJe9OK087010; Mon, 20 Jul 2009 19:40:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6KJe9CZ087008; Mon, 20 Jul 2009 19:40:09 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907201940.n6KJe9CZ087008@svn.freebsd.org> From: Robert Watson Date: Mon, 20 Jul 2009 19:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195788 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 19:40:10 -0000 Author: rwatson Date: Mon Jul 20 19:40:09 2009 New Revision: 195788 URL: http://svn.freebsd.org/changeset/base/195788 Log: Back out the moving in r195782 of V_ip_id's initialization from the top back to the bottom of ip_init() as found in 7.x. I missed the fact that the bottom half of the init routine only runs in the !VNET case. Submitted by: zec Approved by: re (vimage blanket) Modified: head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Mon Jul 20 19:33:22 2009 (r195787) +++ head/sys/netinet/ip_input.c Mon Jul 20 19:40:09 2009 (r195788) @@ -284,6 +284,8 @@ ip_init(void) struct protosw *pr; int i; + V_ip_id = time_second & 0xffff; + TAILQ_INIT(&V_in_ifaddrhead); V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask); @@ -342,7 +344,6 @@ ip_init(void) NULL, EVENTHANDLER_PRI_ANY); /* Initialize various other remaining things. */ - V_ip_id = time_second & 0xffff; IPQ_LOCK_INIT(); netisr_register(&ip_nh); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 19:47:57 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBA7E1065670; Mon, 20 Jul 2009 19:47:57 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id B216C8FC16; Mon, 20 Jul 2009 19:47:57 +0000 (UTC) (envelope-from sam@errno.com) Received: from ice.local ([10.0.0.115]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n6KJKteu010943 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Jul 2009 12:20:55 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <4A64C397.6080902@errno.com> Date: Mon, 20 Jul 2009 12:20:55 -0700 From: Sam Leffler User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Rui Paulo References: <200907201912.n6KJC8MB086115@svn.freebsd.org> In-Reply-To: <200907201912.n6KJC8MB086115@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC-x.dcc-servers-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r195784 - in head: sbin/ifconfig sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 19:47:58 -0000 Rui Paulo wrote: > Author: rpaulo > Date: Mon Jul 20 19:12:08 2009 > New Revision: 195784 > URL: http://svn.freebsd.org/changeset/base/195784 > > Log: > More mesh bits, namely: > * bridge support (sam) > * handling of errors (sam) > * deletion of inactive routing entries > * more debug msgs (sam) > * fixed some inconsistencies with the spec. > * decap is now specific to mesh (sam) > * print mesh seq. no. on ifconfig list mesh > * small perf. improvements Note you can now build a MeshAP by doing something like: ifconfig wlan create wlandev ath0 wlanmode mesh ifconfig wlan create wlandev ath0 wlanmode ap ifconfig bridge create ifconfig bridge0 addm wlan0 addm wlan1 (+more config stuff...). Or you can use two devices if the driver doesn't support multi-bss. Similarly you can bridge mesh+wired to build a MeshPortal (modulo the mesh protocol bits). Sam From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 19:51:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88701106566B; Mon, 20 Jul 2009 19:51:47 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C9F08FC08; Mon, 20 Jul 2009 19:51:47 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6KJplA2087300; Mon, 20 Jul 2009 19:51:47 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6KJpliW087298; Mon, 20 Jul 2009 19:51:47 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200907201951.n6KJpliW087298@svn.freebsd.org> From: Antoine Brodin Date: Mon, 20 Jul 2009 19:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195789 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 19:51:48 -0000 Author: antoine Date: Mon Jul 20 19:51:47 2009 New Revision: 195789 URL: http://svn.freebsd.org/changeset/base/195789 Log: Update ObsoleteFiles.inc - Remove some USB headers that were resurrected recently - Add new obsolete files (2 man pages and libvgl.so.5) Approved by: re (kib) Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Jul 20 19:40:09 2009 (r195788) +++ head/ObsoleteFiles.inc Mon Jul 20 19:51:47 2009 (r195789) @@ -88,6 +88,7 @@ OLD_LIBS+=usr/lib/libtacplus.so.3 OLD_LIBS+=usr/lib/libugidfw.so.3 OLD_LIBS+=usr/lib/libusb.so.1 OLD_LIBS+=usr/lib/libusbhid.so.3 +OLD_LIBS+=usr/lib/libvgl.so.5 OLD_LIBS+=usr/lib/libwrap.so.5 OLD_LIBS+=usr/lib/libypclnt.so.3 OLD_LIBS+=usr/lib/pam_chroot.so.4 @@ -228,6 +229,10 @@ OLD_FILES+=etc/pam.d/gdm OLD_FILES+=usr/include/netinet/vinet.h OLD_FILES+=usr/include/netinet6/vinet6.h OLD_FILES+=usr/include/netipsec/vipsec.h +# 20090712: ieee80211.4 -> net80211.4 +OLD_FILES+=usr/share/man/man4/ieee80211.4.gz +# 20090711: typo fixed, kproc_resume,.9 -> kproc_resume.9 +OLD_FILES+=usr/share/man/man9/kproc_resume,.9.gz # 20090709: msgctl.3 msgget.3 msgrcv.3 msgsnd.3 manual pages moved OLD_FILES+=usr/share/man/man3/msgctl.3.gz OLD_FILES+=usr/share/man/man3/msgget.3.gz @@ -482,8 +487,6 @@ OLD_FILES+=usr/include/dev/usb/usb_mem.h OLD_FILES+=usr/include/dev/usb/usb_port.h OLD_FILES+=usr/include/dev/usb/usb_quirks.h OLD_FILES+=usr/include/dev/usb/usbcdc.h -OLD_FILES+=usr/include/dev/usb/usbdi.h -OLD_FILES+=usr/include/dev/usb/usbdi_util.h OLD_FILES+=usr/include/dev/usb/usbdivar.h OLD_FILES+=usr/include/dev/usb/uxb360gp_rdesc.h # 20090203: removal of pccard header files @@ -2071,7 +2074,6 @@ OLD_FILES+=usr/sbin/kenv OLD_FILES+=usr/bin/kenv OLD_FILES+=usr/sbin/elf2aout # 200210XX -OLD_FILES+=usr/include/libusb.h OLD_FILES+=usr/include/libusbhid.h OLD_FILES+=usr/share/man/man3/All_FreeBSD.3.gz OLD_FILES+=usr/share/man/man3/CheckRules.3.gz From owner-svn-src-all@FreeBSD.ORG Mon Jul 20 23:21:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E95D1106564A; Mon, 20 Jul 2009 23:21:19 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7AD08FC16; Mon, 20 Jul 2009 23:21:19 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6KNLJLP091586; Mon, 20 Jul 2009 23:21:19 GMT (envelope-from cokane@svn.freebsd.org) Received: (from cokane@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6KNLJwb091585; Mon, 20 Jul 2009 23:21:19 GMT (envelope-from cokane@svn.freebsd.org) Message-Id: <200907202321.n6KNLJwb091585@svn.freebsd.org> From: Coleman Kane Date: Mon, 20 Jul 2009 23:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195791 - head/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 23:21:20 -0000 Author: cokane Date: Mon Jul 20 23:21:19 2009 New Revision: 195791 URL: http://svn.freebsd.org/changeset/base/195791 Log: Fix regression in last set of commits. Submitted via e-mail and then nagged again via PR. Thank Paul for his persistence and contributions. PR: 136895 Submitted by: Paul B. Mahol Reviewed by: sam (timeout, 10 days), weongyo (timeout, 10 days), me Approved by: re (Kostik Belousov ) Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Mon Jul 20 21:45:44 2009 (r195790) +++ head/sys/dev/if_ndis/if_ndis.c Mon Jul 20 23:21:19 2009 (r195791) @@ -2292,6 +2292,8 @@ ndis_setstate_80211(sc) ifp = sc->ifp; ic = ifp->if_l2com; vap = TAILQ_FIRST(&ic->ic_vaps); + if (vap == NULL) + return; if (!NDIS_INITIALIZED(sc)) { DPRINTF(("%s: NDIS not initialized\n", __func__)); From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 01:59:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E06AE106564A; Tue, 21 Jul 2009 01:59:52 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C47AC8FC14; Tue, 21 Jul 2009 01:59:52 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L1xq6Q094696; Tue, 21 Jul 2009 01:59:52 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6L1xqDZ094691; Tue, 21 Jul 2009 01:59:52 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200907210159.n6L1xqDZ094691@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 21 Jul 2009 01:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195792 - vendor/tzdata/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 01:59:53 -0000 Author: edwin Date: Tue Jul 21 01:59:52 2009 New Revision: 195792 URL: http://svn.freebsd.org/changeset/base/195792 Log: Vendor import of tzdata2009k - Changes in Mauritius and Bangladesh - No leapsecond at the end of December 2009 Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/africa vendor/tzdata/dist/asia vendor/tzdata/dist/europe vendor/tzdata/dist/leapseconds Modified: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Mon Jul 20 23:21:19 2009 (r195791) +++ vendor/tzdata/dist/africa Tue Jul 21 01:59:52 2009 (r195792) @@ -1,5 +1,5 @@ #
-# @(#)africa	8.21
+# @(#)africa	8.22
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -502,11 +502,33 @@ Zone Africa/Nouakchott	-1:03:48 -	LMT	19
 # http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf
 # 
 
+# From Steffen Thorsen (2009-06-05):
+# According to several sources, Mauritius will not continue to observe
+# DST the coming summer...
+#
+# Some sources, in French:
+# 
+# http://www.defimedia.info/news/946/Rashid-Beebeejaun-:-%C2%AB-L%E2%80%99heure-d%E2%80%99%C3%A9t%C3%A9-ne-sera-pas-appliqu%C3%A9e-cette-ann%C3%A9e-%C2%BB
+# 
+# 
+# http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-
+# 
+#
+# Our wrap-up:
+# 
+# http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
+# 
+
+# From Arthur David Olson (2009-07-11):
+# The "mauritius-dst-will-not-repeat" wrapup includes this: 
+# "The trial ended on March 29, 2009, when the clocks moved back by one hour
+# at 2am (or 02:00) local time..."
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Mauritius	1982	only	-	Oct	10	0:00	1:00	S
 Rule Mauritius	1983	only	-	Mar	21	0:00	0	-
-Rule Mauritius	2008	max	-	Oct	lastSun	2:00s	1:00	S
-Rule Mauritius	2009	max	-	Mar	lastSun	2:00s	0	-
+Rule Mauritius	2008	only	-	Oct	lastSun	2:00	1:00	S
+Rule Mauritius	2009	only	-	Mar	lastSun	2:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Indian/Mauritius	3:50:00 -	LMT	1907		# Port Louis
 			4:00 Mauritius	MU%sT	# Mauritius Time

Modified: vendor/tzdata/dist/asia
==============================================================================
--- vendor/tzdata/dist/asia	Mon Jul 20 23:21:19 2009	(r195791)
+++ vendor/tzdata/dist/asia	Tue Jul 21 01:59:52 2009	(r195792)
@@ -1,5 +1,5 @@
 # 
-# @(#)asia	8.35
+# @(#)asia	8.36
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -172,6 +172,12 @@ Zone	Asia/Bahrain	3:22:20 -	LMT	1920		# 
 #
 # No DST end date has been announced yet.
 
+# From Arthur David Olson (2009-07-11):
+# Arbitrarily end DST at the end of 2009 so that a POSIX-sytle time zone string
+# can appear in the Dhaka binary file and for the benefit of old glibc
+# reimplementations of the time zone software that mishandle permanent DST.
+# A change will be required once the end date is known.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
@@ -180,7 +186,8 @@ Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			6:30	-	BURT	1951 Sep 30
 			6:00	-	DACT	1971 Mar 26 # Dacca Time
 			6:00	-	BDT	2009 Jun 19 23:00 # Bangladesh Time
-			6:00	1:00	BDST
+			6:00	1:00	BDST	2010
+			6:00	-	BDT
 
 # Bhutan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: vendor/tzdata/dist/europe
==============================================================================
--- vendor/tzdata/dist/europe	Mon Jul 20 23:21:19 2009	(r195791)
+++ vendor/tzdata/dist/europe	Tue Jul 21 01:59:52 2009	(r195792)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.21
+# @(#)europe	8.22
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -459,7 +459,7 @@ Rule	EU	1979	1995	-	Sep	lastSun	 1:00u	0
 Rule	EU	1981	max	-	Mar	lastSun	 1:00u	1:00	S
 Rule	EU	1996	max	-	Oct	lastSun	 1:00u	0	-
 # The most recent directive covers the years starting in 2002.  See:
-# 
+# 
 # Directive 2000/84/EC of the European Parliament and of the Council
 # of 19 January 2001 on summer-time arrangements.
 # 

Modified: vendor/tzdata/dist/leapseconds
==============================================================================
--- vendor/tzdata/dist/leapseconds	Mon Jul 20 23:21:19 2009	(r195791)
+++ vendor/tzdata/dist/leapseconds	Tue Jul 21 01:59:52 2009	(r195792)
@@ -1,5 +1,5 @@
 # 
-# @(#)leapseconds	8.8
+# @(#)leapseconds	8.9
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -56,13 +56,13 @@ Leap	2008	Dec	31	23:59:60	+	S
 # SERVICE DE LA ROTATION TERRESTRE
 # OBSERVATOIRE DE PARIS
 # 61, Av. de l'Observatoire 75014 PARIS (France)
-# Tel.      : 33 (0) 1 40 51 22 29
+# Tel.      : 33 (0) 1 40 51 22 26
 # FAX       : 33 (0) 1 40 51 22 91
 # Internet  : services.iers@obspm.fr
 #
-# Paris, 15 January 2009
+# Paris, 4 July 2009
 #
-# Bulletin C 37
+# Bulletin C 38
 #
 # To authorities responsible
 # for the measurement and
@@ -70,7 +70,7 @@ Leap	2008	Dec	31	23:59:60	+	S
 #
 # INFORMATION ON UTC - TAI
 #
-# NO positive leap second will be introduced at the end of June 2009.
+# NO positive leap second will be introduced at the end of December 2009.
 # The difference between Coordinated Universal Time UTC and the
 # International Atomic Time TAI is :		
 #
@@ -82,6 +82,6 @@ Leap	2008	Dec	31	23:59:60	+	S
 # will be no time step at the next possible date.
 #
 # Daniel GAMBIS
-# Head			
-# Earth Orientation Center of the IERS
+# Director			
+# Earth Orientation Center of IERS
 # Observatoire de Paris, France

From owner-svn-src-all@FreeBSD.ORG  Tue Jul 21 02:00:43 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A6FBF106564A;
	Tue, 21 Jul 2009 02:00:43 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7AFED8FC1C;
	Tue, 21 Jul 2009 02:00:43 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L20h4N094784;
	Tue, 21 Jul 2009 02:00:43 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6L20hOH094783;
	Tue, 21 Jul 2009 02:00:43 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200907210200.n6L20hOH094783@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 21 Jul 2009 02:00:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r195793 - vendor/tzdata/tzdata2009k
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 21 Jul 2009 02:00:44 -0000

Author: edwin
Date: Tue Jul 21 02:00:43 2009
New Revision: 195793
URL: http://svn.freebsd.org/changeset/base/195793

Log:
  Tag of tzdata2009k

Added:
  vendor/tzdata/tzdata2009k/
     - copied from r195792, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Jul 21 02:13:58 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 502B6106567C;
	Tue, 21 Jul 2009 02:13:58 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D14E8FC1B;
	Tue, 21 Jul 2009 02:13:58 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L2DvW6095065;
	Tue, 21 Jul 2009 02:13:57 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6L2Dvhw095061;
	Tue, 21 Jul 2009 02:13:57 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200907210213.n6L2Dvhw095061@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 21 Jul 2009 02:13:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r195794 - in vendor/tzcode/dist: unused zic
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 21 Jul 2009 02:13:58 -0000

Author: edwin
Date: Tue Jul 21 02:13:57 2009
New Revision: 195794
URL: http://svn.freebsd.org/changeset/base/195794

Log:
  Vendor import of tzcode2009k
  
  zic.c:
      Do not end a binary file with a POSIX-style time zone string
      for locations that end up in permanent DST (thanks to Andreas
      Schwab).
  
  tz-art.htm
      Add notes on "A Matter of Life and Death"
      (thanks to Dave Cantor).
  
  tz-link.htm
      Remove seemingly obsolete public.planetmirror.com/pub/timezone
      link (thanks to Nathan Stratton Treadway).
  
  Obtained from:	ftp://elsie.nci.nih.gov/pub/

Modified:
  vendor/tzcode/dist/unused/tz-art.htm
  vendor/tzcode/dist/unused/tz-link.htm
  vendor/tzcode/dist/zic/zic.c

Modified: vendor/tzcode/dist/unused/tz-art.htm
==============================================================================
--- vendor/tzcode/dist/unused/tz-art.htm	Tue Jul 21 02:00:43 2009	(r195793)
+++ vendor/tzcode/dist/unused/tz-art.htm	Tue Jul 21 02:13:57 2009	(r195794)
@@ -9,7 +9,7 @@ PUBLIC "-//W3C//DTD HTML 4.01//EN"
 
 

Time and the Arts

-@(#)tz-art.htm 8.12 +@(#)tz-art.htm 8.13

This file is in the public domain, so clarified as of @@ -353,6 +353,17 @@ A private jet's mid-flight change of tim premonition in the "We Had a Dream" episode of "Medium" (originally aired 2007-02-28). +

  • +In the 1946 "A Matter of Life and Death," +there is a reference to British Double Summer Time. +The time does not play a large part in the plot; +it's just a passing reference to the time when one of the +characters was supposed to have died (but didn't). +The IMDb page is at + +http://us.imdb.com/title/tt0038733/ +. (Dave Cantor) +

    • Modified: vendor/tzcode/dist/unused/tz-link.htm ============================================================================== --- vendor/tzcode/dist/unused/tz-link.htm Tue Jul 21 02:00:43 2009 (r195793) +++ vendor/tzcode/dist/unused/tz-link.htm Tue Jul 21 02:13:57 2009 (r195794) @@ -18,7 +18,7 @@

      Sources for Time Zone and Daylight Saving Time Data

      -@(#)tz-link.htm 8.21 +@(#)tz-link.htm 8.22

      This file is in the public domain, so clarified as of @@ -114,10 +114,7 @@ retrieve the full archive of old messages (in gzip compressed format), or retrieve archived older versions of code -and data; there is also a smaller HTTP -mirror.

      +and data.

      The Web has several other sources for time zone and daylight saving time data. Here are some recent links that may be of interest. Modified: vendor/tzcode/dist/zic/zic.c ============================================================================== --- vendor/tzcode/dist/zic/zic.c Tue Jul 21 02:00:43 2009 (r195793) +++ vendor/tzcode/dist/zic/zic.c Tue Jul 21 02:13:57 2009 (r195794) @@ -3,7 +3,7 @@ ** 2006-07-17 by Arthur David Olson. */ -static char elsieid[] = "@(#)zic.c 8.19"; +static char elsieid[] = "@(#)zic.c 8.20"; #include "private.h" #include "locale.h" @@ -1921,7 +1921,7 @@ const int zonecount; if (stdrp != NULL && stdrp->r_hiyear == 2037) return; } - if (stdrp == NULL && zp->z_nrules != 0) + if (stdrp == NULL && (zp->z_nrules != 0 || zp->z_stdoff != 0)) return; abbrvar = (stdrp == NULL) ? "" : stdrp->r_abbrvar; doabbr(result, zp->z_format, abbrvar, FALSE, TRUE); From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 02:14:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4456E1065672; Tue, 21 Jul 2009 02:14:40 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 183248FC1D; Tue, 21 Jul 2009 02:14:40 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L2EeP9095119; Tue, 21 Jul 2009 02:14:40 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6L2Ed8T095118; Tue, 21 Jul 2009 02:14:39 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200907210214.n6L2Ed8T095118@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 21 Jul 2009 02:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195795 - vendor/tzcode/tzcode2009k X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 02:14:40 -0000 Author: edwin Date: Tue Jul 21 02:14:39 2009 New Revision: 195795 URL: http://svn.freebsd.org/changeset/base/195795 Log: Tag of tzcode2009k Added: vendor/tzcode/tzcode2009k/ - copied from r195794, vendor/tzcode/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 04:04:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BBF71065673; Tue, 21 Jul 2009 04:04:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 470C28FC20; Tue, 21 Jul 2009 04:04:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L44ZCc098756; Tue, 21 Jul 2009 04:04:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6L44Za3098751; Tue, 21 Jul 2009 04:04:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907210404.n6L44Za3098751@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jul 2009 04:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195796 - stable/7/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 04:04:36 -0000 Author: delphij Date: Tue Jul 21 04:04:35 2009 New Revision: 195796 URL: http://svn.freebsd.org/changeset/base/195796 Log: MFC all recent gzip(1) changes, up to r194916. Added: stable/7/usr.bin/gzip/unpack.c - copied unchanged from r195795, head/usr.bin/gzip/unpack.c Modified: stable/7/usr.bin/gzip/ (props changed) stable/7/usr.bin/gzip/gzip.1 stable/7/usr.bin/gzip/gzip.c stable/7/usr.bin/gzip/zuncompress.c Modified: stable/7/usr.bin/gzip/gzip.1 ============================================================================== --- stable/7/usr.bin/gzip/gzip.1 Tue Jul 21 02:14:39 2009 (r195795) +++ stable/7/usr.bin/gzip/gzip.1 Tue Jul 21 04:04:35 2009 (r195796) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.19 2008/05/29 14:51:27 mrg Exp $ +.\" $NetBSD: gzip.1,v 1.20 2009/04/01 08:15:37 mrg Exp $ .\" .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd June 30, 2008 +.Dd June 24, 2009 .Dt GZIP 1 .Os .Sh NAME @@ -152,8 +152,8 @@ embedded in the file. This option causes the stored filename in the input file to be used as the output file. .It Fl n , -no-name -This option stops the filename from being stored in the output -file. +This option stops the filename and timestamp from being stored in +the output file. .It Fl q , -quiet With this option, no warnings or errors are printed. .It Fl r , -recursive @@ -206,7 +206,7 @@ This implementation of was ported based on the .Nx .Nm -20060927, and first appeared in +20090412, and first appeared in .Fx 7.0 . .Sh AUTHORS This implementation of Modified: stable/7/usr.bin/gzip/gzip.c ============================================================================== --- stable/7/usr.bin/gzip/gzip.c Tue Jul 21 02:14:39 2009 (r195795) +++ stable/7/usr.bin/gzip/gzip.c Tue Jul 21 04:04:35 2009 (r195796) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.92 2008/07/21 14:19:22 lukem Exp $ */ +/* $NetBSD: gzip.c,v 1.94 2009/04/12 10:31:14 lukem Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -79,6 +79,9 @@ enum filetype { #ifndef NO_COMPRESS_SUPPORT FT_Z, #endif +#ifndef NO_PACK_SUPPORT + FT_PACK, +#endif FT_LAST, FT_UNKNOWN }; @@ -95,6 +98,10 @@ enum filetype { #define Z_MAGIC "\037\235" #endif +#ifndef NO_PACK_SUPPORT +#define PACK_MAGIC "\037\036" +#endif + #define GZ_SUFFIX ".gz" #define BUFLEN (64 * 1024) @@ -143,7 +150,7 @@ static suffixes_t suffixes[] = { }; #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) -static const char gzip_version[] = "FreeBSD gzip 20070711"; +static const char gzip_version[] = "FreeBSD gzip 20090621"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -195,10 +202,10 @@ static int exit_value = 0; /* exit valu static char *infile; /* name of file coming in */ -static void maybe_err(const char *fmt, ...) +static void maybe_err(const char *fmt, ...) __dead2 __attribute__((__format__(__printf__, 1, 2))); #ifndef NO_BZIP2_SUPPORT -static void maybe_errx(const char *fmt, ...) +static void maybe_errx(const char *fmt, ...) __dead2 __attribute__((__format__(__printf__, 1, 2))); #endif static void maybe_warn(const char *fmt, ...) @@ -248,6 +255,10 @@ static FILE *zdopen(int); static off_t zuncompress(FILE *, FILE *, char *, size_t, off_t *); #endif +#ifndef NO_PACK_SUPPORT +static off_t unpack(int, int, char *, size_t, off_t *); +#endif + int main(int, char **p); #ifdef SMALL @@ -1104,6 +1115,11 @@ file_gettype(u_char *buf) return FT_Z; else #endif +#ifndef NO_PACK_SUPPORT + if (memcmp(buf, PACK_MAGIC, 2) == 0) + return FT_PACK; + else +#endif return FT_UNKNOWN; } @@ -1297,7 +1313,7 @@ file_uncompress(char *file, char *outfil ssize_t rbytes; unsigned char header1[4]; enum filetype method; - int rv, fd, ofd, zfd = -1; + int fd, ofd, zfd = -1; #ifndef SMALL time_t timestamp = 0; unsigned char name[PATH_MAX + 1]; @@ -1344,9 +1360,10 @@ file_uncompress(char *file, char *outfil #ifndef SMALL if (method == FT_GZIP && Nflag) { unsigned char ts[4]; /* timestamp */ + ssize_t rv; rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP); - if (rv >= 0 && (size_t)rv < sizeof ts) + if (rv >= 0 && rv < (ssize_t)(sizeof ts)) goto unexpected_EOF; if (rv == -1) { if (!fflag) @@ -1457,6 +1474,17 @@ file_uncompress(char *file, char *outfil } else #endif +#ifndef NO_PACK_SUPPORT + if (method == FT_PACK) { + if (lflag) { + maybe_warnx("no -l with packed files"); + goto lose; + } + + size = unpack(fd, zfd, NULL, 0, NULL); + } else +#endif + #ifndef SMALL if (method == FT_UNKNOWN) { if (lflag) { @@ -1650,6 +1678,12 @@ handle_stdin(void) fclose(in); break; #endif +#ifndef NO_PACK_SUPPORT + case FT_PACK: + usize = unpack(STDIN_FILENO, STDOUT_FILENO, + (char *)header1, sizeof header1, &gsize); + break; +#endif } #ifndef SMALL @@ -1966,6 +2000,8 @@ print_list(int fd, off_t out, const char } in_tot += in; out_tot += out; +#else + (void)&ts; /* XXX */ #endif printf("%12llu %12llu ", (unsigned long long)out, (unsigned long long)in); print_ratio(in, out, stdout); @@ -2035,6 +2071,9 @@ display_version(void) #ifndef NO_COMPRESS_SUPPORT #include "zuncompress.c" #endif +#ifndef NO_PACK_SUPPORT +#include "unpack.c" +#endif static ssize_t read_retry(int fd, void *buf, size_t sz) Copied: stable/7/usr.bin/gzip/unpack.c (from r195795, head/usr.bin/gzip/unpack.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.bin/gzip/unpack.c Tue Jul 21 04:04:35 2009 (r195796, copy of r195795, head/usr.bin/gzip/unpack.c) @@ -0,0 +1,322 @@ +/*- + * Copyright (c) 2009 Xin LI + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* This file is #included by gzip.c */ + +/* + * pack(1) file format: + * + * The first 7 bytes is the header: + * 00, 01 - Signature (US, RS), we already validated it earlier. + * 02..05 - Uncompressed size + * 06 - Level for the huffman tree (<=24) + * + * pack(1) will then store symbols (leaf) nodes count in each huffman + * tree levels, each level would consume 1 byte (See [1]). + * + * After the symbol count table, there is the symbol table, storing + * symbols represented by coresponding leaf node. EOB is not being + * explicitly transmitted (not necessary anyway) in the symbol table. + * + * Compressed data goes after the symbol table. + * + * NOTES + * + * [1] If we count EOB into the symbols, that would mean that we will + * have at most 256 symbols in the huffman tree. pack(1) rejects empty + * file and files that just repeats one character, which means that we + * will have at least 2 symbols. Therefore, pack(1) would reduce the + * last level symbol count by 2 which makes it a number in + * range [0..254], so all levels' symbol count would fit into 1 byte. + */ + +#define PACK_HEADER_LENGTH 7 +#define HTREE_MAXLEVEL 24 + +/* + * unpack descriptor + * + * Represent the huffman tree in a similiar way that pack(1) would + * store in a packed file. We store all symbols in a linear table, + * and store pointers to each level's first symbol. In addition to + * that, maintain two counts for each level: inner nodes count and + * leaf nodes count. + */ +typedef struct { + int symbol_size; /* Size of the symbol table */ + int treelevels; /* Levels for the huffman tree */ + + int *symbolsin; /* Table of leaf symbols count in + each level */ + int *inodesin; /* Table of internal nodes count in + each level */ + + char *symbol; /* The symbol table */ + char *symbol_eob; /* Pointer to the EOB symbol */ + char **tree; /* Decoding huffman tree (pointers to + first symbol of each tree level */ + + off_t uncompressed_size; /* Uncompressed size */ + FILE *fpIn; /* Input stream */ + FILE *fpOut; /* Output stream */ +} unpack_descriptor_t; + +/* + * Release resource allocated to an unpack descriptor. + * + * Caller is responsible to make sure that all of these pointers are + * initialized (in our case, they all point to valid memory block). + * We don't zero out pointers here because nobody else would ever + * reference the memory block without scrubing them. + */ +static void +unpack_descriptor_fini(unpack_descriptor_t *unpackd) +{ + + free(unpackd->symbolsin); + free(unpackd->inodesin); + free(unpackd->symbol); + free(unpackd->tree); + + fclose(unpackd->fpIn); + fclose(unpackd->fpOut); +} + +/* + * Recursively fill the internal node count table + */ +static void +unpackd_fill_inodesin(const unpack_descriptor_t *unpackd, int level) +{ + + /* + * The internal nodes would be 1/2 of total internal nodes and + * leaf nodes in the next level. For the last level there + * would be no internal node by defination. + */ + if (level < unpackd->treelevels) { + unpackd_fill_inodesin(unpackd, level + 1); + unpackd->inodesin[level] = (unpackd->inodesin[level + 1] + + unpackd->symbolsin[level + 1]) / 2; + } else + unpackd->inodesin[level] = 0; +} + +/* + * Update counter for accepted bytes + */ +static void +accepted_bytes(off_t *bytes_in, off_t newbytes) +{ + + if (bytes_in != NULL) + (*bytes_in) += newbytes; +} + +/* + * Read file header and construct the tree. Also, prepare the buffered I/O + * for decode rountine. + * + * Return value is uncompressed size. + */ +static void +unpack_parse_header(int in, int out, char *pre, size_t prelen, off_t *bytes_in, + unpack_descriptor_t *unpackd) +{ + unsigned char hdr[PACK_HEADER_LENGTH]; /* buffer for header */ + ssize_t bytesread; /* Bytes read from the file */ + int i, j, thisbyte; + + /* Prepend the header buffer if we already read some data */ + if (prelen != 0) + memcpy(hdr, pre, prelen); + + /* Read in and fill the rest bytes of header */ + bytesread = read(in, hdr + prelen, PACK_HEADER_LENGTH - prelen); + if (bytesread < 0) + maybe_err("Error reading pack header"); + + accepted_bytes(bytes_in, PACK_HEADER_LENGTH); + + /* Obtain uncompressed length (bytes 2,3,4,5)*/ + unpackd->uncompressed_size = 0; + for (i = 2; i <= 5; i++) { + unpackd->uncompressed_size <<= 8; + unpackd->uncompressed_size |= hdr[i]; + } + + /* Get the levels of the tree */ + unpackd->treelevels = hdr[6]; + if (unpackd->treelevels > HTREE_MAXLEVEL || unpackd->treelevels < 1) + maybe_errx("Huffman tree has insane levels"); + + /* Let libc take care for buffering from now on */ + if ((unpackd->fpIn = fdopen(in, "r")) == NULL) + maybe_err("Can not fdopen() input stream"); + if ((unpackd->fpOut = fdopen(out, "w")) == NULL) + maybe_err("Can not fdopen() output stream"); + + /* Allocate for the tables of bounds and the tree itself */ + unpackd->inodesin = + calloc(unpackd->treelevels, sizeof(*(unpackd->inodesin))); + unpackd->symbolsin = + calloc(unpackd->treelevels, sizeof(*(unpackd->symbolsin))); + unpackd->tree = + calloc(unpackd->treelevels, (sizeof (*(unpackd->tree)))); + if (unpackd->inodesin == NULL || unpackd->symbolsin == NULL || + unpackd->tree == NULL) + maybe_err("calloc"); + + /* We count from 0 so adjust to match array upper bound */ + unpackd->treelevels--; + + /* Read the levels symbol count table and caculate total */ + unpackd->symbol_size = 1; /* EOB */ + for (i = 0; i <= unpackd->treelevels; i++) { + if ((thisbyte = fgetc(unpackd->fpIn)) == EOF) + maybe_err("File appears to be truncated"); + unpackd->symbolsin[i] = (unsigned char)thisbyte; + unpackd->symbol_size += unpackd->symbolsin[i]; + } + accepted_bytes(bytes_in, unpackd->treelevels); + if (unpackd->symbol_size > 256) + maybe_errx("Bad symbol table"); + + /* Allocate for the symbol table, point symbol_eob at the beginning */ + unpackd->symbol_eob = unpackd->symbol = calloc(1, unpackd->symbol_size); + if (unpackd->symbol == NULL) + maybe_err("calloc"); + + /* + * Read in the symbol table, which contain [2, 256] symbols. + * In order to fit the count in one byte, pack(1) would offset + * it by reducing 2 from the actual number from the last level. + * + * We adjust the last level's symbol count by 1 here, because + * the EOB symbol is not being transmitted explicitly. Another + * adjustment would be done later afterward. + */ + unpackd->symbolsin[unpackd->treelevels]++; + for (i = 0; i <= unpackd->treelevels; i++) { + unpackd->tree[i] = unpackd->symbol_eob; + for (j = 0; j < unpackd->symbolsin[i]; j++) { + if ((thisbyte = fgetc(unpackd->fpIn)) == EOF) + maybe_errx("Symbol table truncated"); + *unpackd->symbol_eob++ = (char)thisbyte; + } + accepted_bytes(bytes_in, unpackd->symbolsin[i]); + } + + /* Now, take account for the EOB symbol as well */ + unpackd->symbolsin[unpackd->treelevels]++; + + /* + * The symbolsin table has been constructed now. + * Caculate the internal nodes count table based on it. + */ + unpackd_fill_inodesin(unpackd, 0); +} + +/* + * Decode huffman stream, based on the huffman tree. + */ +static void +unpack_decode(const unpack_descriptor_t *unpackd, off_t *bytes_in) +{ + int thislevel, thiscode, thisbyte, inlevelindex; + int i; + off_t bytes_out = 0; + const char *thissymbol; /* The symbol pointer decoded from stream */ + + /* + * Decode huffman. Fetch every bytes from the file, get it + * into 'thiscode' bit-by-bit, then output the symbol we got + * when one has been found. + * + * Assumption: sizeof(int) > ((max tree levels + 1) / 8). + * bad things could happen if not. + */ + thislevel = 0; + thiscode = thisbyte = 0; + + while ((thisbyte = fgetc(unpackd->fpIn)) != EOF) { + accepted_bytes(bytes_in, 1); + + /* + * Split one bit from thisbyte, from highest to lowest, + * feed the bit into thiscode, until we got a symbol from + * the tree. + */ + for (i = 7; i >= 0; i--) { + thiscode = (thiscode << 1) | ((thisbyte >> i) & 1); + + /* Did we got a symbol? (referencing leaf node) */ + if (thiscode >= unpackd->inodesin[thislevel]) { + inlevelindex = + thiscode - unpackd->inodesin[thislevel]; + if (inlevelindex > unpackd->symbolsin[thislevel]) + maybe_errx("File corrupt"); + + thissymbol = + &(unpackd->tree[thislevel][inlevelindex]); + if ((thissymbol == unpackd->symbol_eob) && + (bytes_out == unpackd->uncompressed_size)) + goto finished; + + fputc((*thissymbol), unpackd->fpOut); + bytes_out++; + + /* Prepare for next input */ + thislevel = 0; thiscode = 0; + } else { + thislevel++; + if (thislevel > unpackd->treelevels) + maybe_errx("File corrupt"); + } + } + } + +finished: + if (bytes_out != unpackd->uncompressed_size) + maybe_errx("Premature EOF"); +} + +/* Handler for pack(1)'ed file */ +static off_t +unpack(int in, int out, char *pre, size_t prelen, off_t *bytes_in) +{ + unpack_descriptor_t unpackd; + + unpack_parse_header(dup(in), dup(out), pre, prelen, bytes_in, &unpackd); + unpack_decode(&unpackd, bytes_in); + unpack_descriptor_fini(&unpackd); + + /* If we reached here, the unpack was successful */ + return (unpackd.uncompressed_size); +} + Modified: stable/7/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/7/usr.bin/gzip/zuncompress.c Tue Jul 21 02:14:39 2009 (r195795) +++ stable/7/usr.bin/gzip/zuncompress.c Tue Jul 21 04:04:35 2009 (r195796) @@ -1,4 +1,4 @@ -/* $NetBSD: zuncompress.c,v 1.6 2005/11/22 09:05:30 mrg Exp $ */ +/* $NetBSD: zuncompress.c,v 1.7 2009/04/12 10:31:14 lukem Exp $ */ /*- * Copyright (c) 1985, 1986, 1992, 1993 @@ -147,7 +147,7 @@ zuncompress(FILE *in, FILE *out, char *p compressed_pre = NULL; while ((bin = fread(buf, 1, sizeof(buf), in)) != 0) { - if (tflag == 0 && fwrite(buf, 1, bin, out) != (size_t)bin) { + if (tflag == 0 && (off_t)fwrite(buf, 1, bin, out) != bin) { free(buf); return -1; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 04:25:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7E011065670; Tue, 21 Jul 2009 04:25:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF89A8FC0C; Tue, 21 Jul 2009 04:25:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L4P36h099432; Tue, 21 Jul 2009 04:25:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6L4P3Z3099428; Tue, 21 Jul 2009 04:25:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907210425.n6L4P3Z3099428@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jul 2009 04:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195797 - stable/6/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 04:25:04 -0000 Author: delphij Date: Tue Jul 21 04:25:03 2009 New Revision: 195797 URL: http://svn.freebsd.org/changeset/base/195797 Log: MFC all recent gzip(1) changes, up to r194916. Added: stable/6/usr.bin/gzip/unpack.c - copied unchanged from r194579, head/usr.bin/gzip/unpack.c Modified: stable/6/usr.bin/gzip/ (props changed) stable/6/usr.bin/gzip/gzip.1 stable/6/usr.bin/gzip/gzip.c stable/6/usr.bin/gzip/zuncompress.c Modified: stable/6/usr.bin/gzip/gzip.1 ============================================================================== --- stable/6/usr.bin/gzip/gzip.1 Tue Jul 21 04:04:35 2009 (r195796) +++ stable/6/usr.bin/gzip/gzip.1 Tue Jul 21 04:25:03 2009 (r195797) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.19 2008/05/29 14:51:27 mrg Exp $ +.\" $NetBSD: gzip.1,v 1.20 2009/04/01 08:15:37 mrg Exp $ .\" .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd June 30, 2008 +.Dd June 24, 2009 .Dt GZIP 1 .Os .Sh NAME @@ -152,8 +152,8 @@ embedded in the file. This option causes the stored filename in the input file to be used as the output file. .It Fl n , -no-name -This option stops the filename from being stored in the output -file. +This option stops the filename and timestamp from being stored in +the output file. .It Fl q , -quiet With this option, no warnings or errors are printed. .It Fl r , -recursive @@ -206,7 +206,7 @@ This implementation of was ported based on the .Nx .Nm -20060927, and first appeared in +20090412, and first appeared in .Fx 7.0 . .Sh AUTHORS This implementation of Modified: stable/6/usr.bin/gzip/gzip.c ============================================================================== --- stable/6/usr.bin/gzip/gzip.c Tue Jul 21 04:04:35 2009 (r195796) +++ stable/6/usr.bin/gzip/gzip.c Tue Jul 21 04:25:03 2009 (r195797) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.92 2008/07/21 14:19:22 lukem Exp $ */ +/* $NetBSD: gzip.c,v 1.94 2009/04/12 10:31:14 lukem Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -79,6 +79,9 @@ enum filetype { #ifndef NO_COMPRESS_SUPPORT FT_Z, #endif +#ifndef NO_PACK_SUPPORT + FT_PACK, +#endif FT_LAST, FT_UNKNOWN }; @@ -95,6 +98,10 @@ enum filetype { #define Z_MAGIC "\037\235" #endif +#ifndef NO_PACK_SUPPORT +#define PACK_MAGIC "\037\036" +#endif + #define GZ_SUFFIX ".gz" #define BUFLEN (64 * 1024) @@ -143,7 +150,7 @@ static suffixes_t suffixes[] = { }; #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) -static const char gzip_version[] = "FreeBSD gzip 20070711"; +static const char gzip_version[] = "FreeBSD gzip 20090621"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -195,10 +202,10 @@ static int exit_value = 0; /* exit valu static char *infile; /* name of file coming in */ -static void maybe_err(const char *fmt, ...) +static void maybe_err(const char *fmt, ...) __dead2 __attribute__((__format__(__printf__, 1, 2))); #ifndef NO_BZIP2_SUPPORT -static void maybe_errx(const char *fmt, ...) +static void maybe_errx(const char *fmt, ...) __dead2 __attribute__((__format__(__printf__, 1, 2))); #endif static void maybe_warn(const char *fmt, ...) @@ -248,6 +255,10 @@ static FILE *zdopen(int); static off_t zuncompress(FILE *, FILE *, char *, size_t, off_t *); #endif +#ifndef NO_PACK_SUPPORT +static off_t unpack(int, int, char *, size_t, off_t *); +#endif + int main(int, char **p); #ifdef SMALL @@ -1104,6 +1115,11 @@ file_gettype(u_char *buf) return FT_Z; else #endif +#ifndef NO_PACK_SUPPORT + if (memcmp(buf, PACK_MAGIC, 2) == 0) + return FT_PACK; + else +#endif return FT_UNKNOWN; } @@ -1297,7 +1313,7 @@ file_uncompress(char *file, char *outfil ssize_t rbytes; unsigned char header1[4]; enum filetype method; - int rv, fd, ofd, zfd = -1; + int fd, ofd, zfd = -1; #ifndef SMALL time_t timestamp = 0; unsigned char name[PATH_MAX + 1]; @@ -1344,9 +1360,10 @@ file_uncompress(char *file, char *outfil #ifndef SMALL if (method == FT_GZIP && Nflag) { unsigned char ts[4]; /* timestamp */ + ssize_t rv; rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP); - if (rv >= 0 && (size_t)rv < sizeof ts) + if (rv >= 0 && rv < (ssize_t)(sizeof ts)) goto unexpected_EOF; if (rv == -1) { if (!fflag) @@ -1457,6 +1474,17 @@ file_uncompress(char *file, char *outfil } else #endif +#ifndef NO_PACK_SUPPORT + if (method == FT_PACK) { + if (lflag) { + maybe_warnx("no -l with packed files"); + goto lose; + } + + size = unpack(fd, zfd, NULL, 0, NULL); + } else +#endif + #ifndef SMALL if (method == FT_UNKNOWN) { if (lflag) { @@ -1650,6 +1678,12 @@ handle_stdin(void) fclose(in); break; #endif +#ifndef NO_PACK_SUPPORT + case FT_PACK: + usize = unpack(STDIN_FILENO, STDOUT_FILENO, + (char *)header1, sizeof header1, &gsize); + break; +#endif } #ifndef SMALL @@ -1966,6 +2000,8 @@ print_list(int fd, off_t out, const char } in_tot += in; out_tot += out; +#else + (void)&ts; /* XXX */ #endif printf("%12llu %12llu ", (unsigned long long)out, (unsigned long long)in); print_ratio(in, out, stdout); @@ -2035,6 +2071,9 @@ display_version(void) #ifndef NO_COMPRESS_SUPPORT #include "zuncompress.c" #endif +#ifndef NO_PACK_SUPPORT +#include "unpack.c" +#endif static ssize_t read_retry(int fd, void *buf, size_t sz) Copied: stable/6/usr.bin/gzip/unpack.c (from r194579, head/usr.bin/gzip/unpack.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/6/usr.bin/gzip/unpack.c Tue Jul 21 04:25:03 2009 (r195797, copy of r194579, head/usr.bin/gzip/unpack.c) @@ -0,0 +1,322 @@ +/*- + * Copyright (c) 2009 Xin LI + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* This file is #included by gzip.c */ + +/* + * pack(1) file format: + * + * The first 7 bytes is the header: + * 00, 01 - Signature (US, RS), we already validated it earlier. + * 02..05 - Uncompressed size + * 06 - Level for the huffman tree (<=24) + * + * pack(1) will then store symbols (leaf) nodes count in each huffman + * tree levels, each level would consume 1 byte (See [1]). + * + * After the symbol count table, there is the symbol table, storing + * symbols represented by coresponding leaf node. EOB is not being + * explicitly transmitted (not necessary anyway) in the symbol table. + * + * Compressed data goes after the symbol table. + * + * NOTES + * + * [1] If we count EOB into the symbols, that would mean that we will + * have at most 256 symbols in the huffman tree. pack(1) rejects empty + * file and files that just repeats one character, which means that we + * will have at least 2 symbols. Therefore, pack(1) would reduce the + * last level symbol count by 2 which makes it a number in + * range [0..254], so all levels' symbol count would fit into 1 byte. + */ + +#define PACK_HEADER_LENGTH 7 +#define HTREE_MAXLEVEL 24 + +/* + * unpack descriptor + * + * Represent the huffman tree in a similiar way that pack(1) would + * store in a packed file. We store all symbols in a linear table, + * and store pointers to each level's first symbol. In addition to + * that, maintain two counts for each level: inner nodes count and + * leaf nodes count. + */ +typedef struct { + int symbol_size; /* Size of the symbol table */ + int treelevels; /* Levels for the huffman tree */ + + int *symbolsin; /* Table of leaf symbols count in + each level */ + int *inodesin; /* Table of internal nodes count in + each level */ + + char *symbol; /* The symbol table */ + char *symbol_eob; /* Pointer to the EOB symbol */ + char **tree; /* Decoding huffman tree (pointers to + first symbol of each tree level */ + + off_t uncompressed_size; /* Uncompressed size */ + FILE *fpIn; /* Input stream */ + FILE *fpOut; /* Output stream */ +} unpack_descriptor_t; + +/* + * Release resource allocated to an unpack descriptor. + * + * Caller is responsible to make sure that all of these pointers are + * initialized (in our case, they all point to valid memory block). + * We don't zero out pointers here because nobody else would ever + * reference the memory block without scrubing them. + */ +static void +unpack_descriptor_fini(unpack_descriptor_t *unpackd) +{ + + free(unpackd->symbolsin); + free(unpackd->inodesin); + free(unpackd->symbol); + free(unpackd->tree); + + fclose(unpackd->fpIn); + fclose(unpackd->fpOut); +} + +/* + * Recursively fill the internal node count table + */ +static void +unpackd_fill_inodesin(const unpack_descriptor_t *unpackd, int level) +{ + + /* + * The internal nodes would be 1/2 of total internal nodes and + * leaf nodes in the next level. For the last level there + * would be no internal node by defination. + */ + if (level < unpackd->treelevels) { + unpackd_fill_inodesin(unpackd, level + 1); + unpackd->inodesin[level] = (unpackd->inodesin[level + 1] + + unpackd->symbolsin[level + 1]) / 2; + } else + unpackd->inodesin[level] = 0; +} + +/* + * Update counter for accepted bytes + */ +static void +accepted_bytes(off_t *bytes_in, off_t newbytes) +{ + + if (bytes_in != NULL) + (*bytes_in) += newbytes; +} + +/* + * Read file header and construct the tree. Also, prepare the buffered I/O + * for decode rountine. + * + * Return value is uncompressed size. + */ +static void +unpack_parse_header(int in, int out, char *pre, size_t prelen, off_t *bytes_in, + unpack_descriptor_t *unpackd) +{ + unsigned char hdr[PACK_HEADER_LENGTH]; /* buffer for header */ + ssize_t bytesread; /* Bytes read from the file */ + int i, j, thisbyte; + + /* Prepend the header buffer if we already read some data */ + if (prelen != 0) + memcpy(hdr, pre, prelen); + + /* Read in and fill the rest bytes of header */ + bytesread = read(in, hdr + prelen, PACK_HEADER_LENGTH - prelen); + if (bytesread < 0) + maybe_err("Error reading pack header"); + + accepted_bytes(bytes_in, PACK_HEADER_LENGTH); + + /* Obtain uncompressed length (bytes 2,3,4,5)*/ + unpackd->uncompressed_size = 0; + for (i = 2; i <= 5; i++) { + unpackd->uncompressed_size <<= 8; + unpackd->uncompressed_size |= hdr[i]; + } + + /* Get the levels of the tree */ + unpackd->treelevels = hdr[6]; + if (unpackd->treelevels > HTREE_MAXLEVEL || unpackd->treelevels < 1) + maybe_errx("Huffman tree has insane levels"); + + /* Let libc take care for buffering from now on */ + if ((unpackd->fpIn = fdopen(in, "r")) == NULL) + maybe_err("Can not fdopen() input stream"); + if ((unpackd->fpOut = fdopen(out, "w")) == NULL) + maybe_err("Can not fdopen() output stream"); + + /* Allocate for the tables of bounds and the tree itself */ + unpackd->inodesin = + calloc(unpackd->treelevels, sizeof(*(unpackd->inodesin))); + unpackd->symbolsin = + calloc(unpackd->treelevels, sizeof(*(unpackd->symbolsin))); + unpackd->tree = + calloc(unpackd->treelevels, (sizeof (*(unpackd->tree)))); + if (unpackd->inodesin == NULL || unpackd->symbolsin == NULL || + unpackd->tree == NULL) + maybe_err("calloc"); + + /* We count from 0 so adjust to match array upper bound */ + unpackd->treelevels--; + + /* Read the levels symbol count table and caculate total */ + unpackd->symbol_size = 1; /* EOB */ + for (i = 0; i <= unpackd->treelevels; i++) { + if ((thisbyte = fgetc(unpackd->fpIn)) == EOF) + maybe_err("File appears to be truncated"); + unpackd->symbolsin[i] = (unsigned char)thisbyte; + unpackd->symbol_size += unpackd->symbolsin[i]; + } + accepted_bytes(bytes_in, unpackd->treelevels); + if (unpackd->symbol_size > 256) + maybe_errx("Bad symbol table"); + + /* Allocate for the symbol table, point symbol_eob at the beginning */ + unpackd->symbol_eob = unpackd->symbol = calloc(1, unpackd->symbol_size); + if (unpackd->symbol == NULL) + maybe_err("calloc"); + + /* + * Read in the symbol table, which contain [2, 256] symbols. + * In order to fit the count in one byte, pack(1) would offset + * it by reducing 2 from the actual number from the last level. + * + * We adjust the last level's symbol count by 1 here, because + * the EOB symbol is not being transmitted explicitly. Another + * adjustment would be done later afterward. + */ + unpackd->symbolsin[unpackd->treelevels]++; + for (i = 0; i <= unpackd->treelevels; i++) { + unpackd->tree[i] = unpackd->symbol_eob; + for (j = 0; j < unpackd->symbolsin[i]; j++) { + if ((thisbyte = fgetc(unpackd->fpIn)) == EOF) + maybe_errx("Symbol table truncated"); + *unpackd->symbol_eob++ = (char)thisbyte; + } + accepted_bytes(bytes_in, unpackd->symbolsin[i]); + } + + /* Now, take account for the EOB symbol as well */ + unpackd->symbolsin[unpackd->treelevels]++; + + /* + * The symbolsin table has been constructed now. + * Caculate the internal nodes count table based on it. + */ + unpackd_fill_inodesin(unpackd, 0); +} + +/* + * Decode huffman stream, based on the huffman tree. + */ +static void +unpack_decode(const unpack_descriptor_t *unpackd, off_t *bytes_in) +{ + int thislevel, thiscode, thisbyte, inlevelindex; + int i; + off_t bytes_out = 0; + const char *thissymbol; /* The symbol pointer decoded from stream */ + + /* + * Decode huffman. Fetch every bytes from the file, get it + * into 'thiscode' bit-by-bit, then output the symbol we got + * when one has been found. + * + * Assumption: sizeof(int) > ((max tree levels + 1) / 8). + * bad things could happen if not. + */ + thislevel = 0; + thiscode = thisbyte = 0; + + while ((thisbyte = fgetc(unpackd->fpIn)) != EOF) { + accepted_bytes(bytes_in, 1); + + /* + * Split one bit from thisbyte, from highest to lowest, + * feed the bit into thiscode, until we got a symbol from + * the tree. + */ + for (i = 7; i >= 0; i--) { + thiscode = (thiscode << 1) | ((thisbyte >> i) & 1); + + /* Did we got a symbol? (referencing leaf node) */ + if (thiscode >= unpackd->inodesin[thislevel]) { + inlevelindex = + thiscode - unpackd->inodesin[thislevel]; + if (inlevelindex > unpackd->symbolsin[thislevel]) + maybe_errx("File corrupt"); + + thissymbol = + &(unpackd->tree[thislevel][inlevelindex]); + if ((thissymbol == unpackd->symbol_eob) && + (bytes_out == unpackd->uncompressed_size)) + goto finished; + + fputc((*thissymbol), unpackd->fpOut); + bytes_out++; + + /* Prepare for next input */ + thislevel = 0; thiscode = 0; + } else { + thislevel++; + if (thislevel > unpackd->treelevels) + maybe_errx("File corrupt"); + } + } + } + +finished: + if (bytes_out != unpackd->uncompressed_size) + maybe_errx("Premature EOF"); +} + +/* Handler for pack(1)'ed file */ +static off_t +unpack(int in, int out, char *pre, size_t prelen, off_t *bytes_in) +{ + unpack_descriptor_t unpackd; + + unpack_parse_header(dup(in), dup(out), pre, prelen, bytes_in, &unpackd); + unpack_decode(&unpackd, bytes_in); + unpack_descriptor_fini(&unpackd); + + /* If we reached here, the unpack was successful */ + return (unpackd.uncompressed_size); +} + Modified: stable/6/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/6/usr.bin/gzip/zuncompress.c Tue Jul 21 04:04:35 2009 (r195796) +++ stable/6/usr.bin/gzip/zuncompress.c Tue Jul 21 04:25:03 2009 (r195797) @@ -1,4 +1,4 @@ -/* $NetBSD: zuncompress.c,v 1.6 2005/11/22 09:05:30 mrg Exp $ */ +/* $NetBSD: zuncompress.c,v 1.7 2009/04/12 10:31:14 lukem Exp $ */ /*- * Copyright (c) 1985, 1986, 1992, 1993 @@ -147,7 +147,7 @@ zuncompress(FILE *in, FILE *out, char *p compressed_pre = NULL; while ((bin = fread(buf, 1, sizeof(buf), in)) != 0) { - if (tflag == 0 && fwrite(buf, 1, bin, out) != (size_t)bin) { + if (tflag == 0 && (off_t)fwrite(buf, 1, bin, out) != bin) { free(buf); return -1; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 04:33:01 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6C031065670; Tue, 21 Jul 2009 04:33:01 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id C231A8FC08; Tue, 21 Jul 2009 04:33:01 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.3/8.14.3) with ESMTP id n6L48Aks085162; Mon, 20 Jul 2009 21:08:10 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.3/8.14.2/Submit) id n6L48Amg085161; Mon, 20 Jul 2009 21:08:10 -0700 (PDT) (envelope-from obrien) Date: Mon, 20 Jul 2009 21:08:10 -0700 From: "David O'Brien" To: John Baldwin Message-ID: <20090721040810.GA84807@dragon.NUXI.org> References: <200907142046.n6EKkJwO070823@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200907142046.n6EKkJwO070823@svn.freebsd.org> X-Operating-System: FreeBSD 8.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r195696 - in stable/7: crypto/openssh secure/lib/libssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 04:33:02 -0000 On Tue, Jul 14, 2009 at 08:46:19PM +0000, John Baldwin wrote: > Date: Tue Jul 14 20:46:19 2009 > New Revision: 195696 > URL: http://svn.freebsd.org/changeset/base/195696 > Log: > MFC: Use the closefrom(2) system call. > Modified: > stable/7/crypto/openssh/ (props changed) > stable/7/crypto/openssh/config.h > stable/7/crypto/openssh/ssh_namespace.h > stable/7/secure/lib/libssh/ (props changed) > stable/7/secure/lib/libssh/Makefile Hi John, Would you mind backing out this commit from 7-stable. This change mades it so one cannot seriously boot a machine multiuser with an older kernel as /usr/sbin/sshd dies due to bad system call. I think the MFC of this part of the closefrom(2) addtion edge up against POLA for a mature -stable branch. Even in -CURRENT it's good form to add a new system call and then immedately use it... without some time laps to allow folks to boot a week old kernel. Thanks, -- David From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 08:29:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64F2C1065677; Tue, 21 Jul 2009 08:29:21 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B73A8FC08; Tue, 21 Jul 2009 08:29:20 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L8TKeX004172; Tue, 21 Jul 2009 08:29:20 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6L8TKAJ004170; Tue, 21 Jul 2009 08:29:20 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200907210829.n6L8TKAJ004170@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 21 Jul 2009 08:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195798 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 08:29:25 -0000 Author: raj Date: Tue Jul 21 08:29:19 2009 New Revision: 195798 URL: http://svn.freebsd.org/changeset/base/195798 Log: Make dcache_inv_range() point to the proper routines on ARM9 and ARM9E/ARM10. On some ARM variations CPU func dispatcher has the D-cache invalidate method point to write-back invalidate, which is wrong, and can lead to a crash/panic on affected platforms. Spotted by: HPS Reviewed by: cognet Approved by: re (kib) Modified: head/sys/arm/arm/cpufunc.c Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Tue Jul 21 04:25:03 2009 (r195797) +++ head/sys/arm/arm/cpufunc.c Tue Jul 21 08:29:19 2009 (r195798) @@ -265,7 +265,7 @@ struct cpu_functions arm9_cpufuncs = { arm9_dcache_wbinv_all, /* dcache_wbinv_all */ arm9_dcache_wbinv_range, /* dcache_wbinv_range */ -/*XXX*/ arm9_dcache_wbinv_range, /* dcache_inv_range */ + arm9_dcache_inv_range, /* dcache_inv_range */ arm9_dcache_wb_range, /* dcache_wb_range */ arm9_idcache_wbinv_all, /* idcache_wbinv_all */ @@ -327,7 +327,7 @@ struct cpu_functions armv5_ec_cpufuncs = armv5_ec_dcache_wbinv_all, /* dcache_wbinv_all */ armv5_ec_dcache_wbinv_range, /* dcache_wbinv_range */ -/*XXX*/ armv5_ec_dcache_wbinv_range, /* dcache_inv_range */ + armv5_ec_dcache_inv_range, /* dcache_inv_range */ armv5_ec_dcache_wb_range, /* dcache_wb_range */ armv5_ec_idcache_wbinv_all, /* idcache_wbinv_all */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 08:38:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCD25106564A; Tue, 21 Jul 2009 08:38:45 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8B668FC14; Tue, 21 Jul 2009 08:38:45 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L8cjxK004426; Tue, 21 Jul 2009 08:38:45 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6L8cjUi004424; Tue, 21 Jul 2009 08:38:45 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200907210838.n6L8cjUi004424@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 21 Jul 2009 08:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195799 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 08:38:46 -0000 Author: raj Date: Tue Jul 21 08:38:45 2009 New Revision: 195799 URL: http://svn.freebsd.org/changeset/base/195799 Log: Do not use OCP85XX_LBC_OFF twice when accessing LBC registers on MPC85XX. It turns LBC control registers were not programmed correctly on MPC85XX. We were accessing bogus addresses as the base offset (OCP85XX_LBC_OFF) was erroneously added during offset calculations. Effectively the state of LBC control registers was not altered by the kernel initialization code, but everything worked as long as we coincided to use the same settings (LBC decode windows) as firmware has initialized. Submitted by: Lukasz Wojcik Reviewed by: marcel Approved by: re (kensmith) Obtained from: Semihalf Modified: head/sys/powerpc/mpc85xx/lbc.h Modified: head/sys/powerpc/mpc85xx/lbc.h ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.h Tue Jul 21 08:29:19 2009 (r195798) +++ head/sys/powerpc/mpc85xx/lbc.h Tue Jul 21 08:38:45 2009 (r195799) @@ -39,10 +39,10 @@ #define LBC_DEVTYPE_RTC 2 /* Local access registers */ -#define LBC85XX_BR(n) (OCP85XX_LBC_OFF + (8 * n)) -#define LBC85XX_OR(n) (OCP85XX_LBC_OFF + 4 + (8 * n)) -#define LBC85XX_LBCR (OCP85XX_LBC_OFF + 0xd0) -#define LBC85XX_LCRR (OCP85XX_LBC_OFF + 0xd4) +#define LBC85XX_BR(n) (8 * n) +#define LBC85XX_OR(n) (4 + (8 * n)) +#define LBC85XX_LBCR (0xd0) +#define LBC85XX_LCRR (0xd4) /* LBC machine select */ #define LBCRES_MSEL_GPCM 0 From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 09:54:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D94C106566B; Tue, 21 Jul 2009 09:54:04 +0000 (UTC) (envelope-from yzlin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50F228FC0A; Tue, 21 Jul 2009 09:54:04 +0000 (UTC) (envelope-from yzlin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L9s4wY005963; Tue, 21 Jul 2009 09:54:04 GMT (envelope-from yzlin@svn.freebsd.org) Received: (from yzlin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6L9s4PG005960; Tue, 21 Jul 2009 09:54:04 GMT (envelope-from yzlin@svn.freebsd.org) Message-Id: <200907210954.n6L9s4PG005960@svn.freebsd.org> From: Yi-Jheng Lin Date: Tue, 21 Jul 2009 09:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195800 - in head: share/misc usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 09:54:05 -0000 Author: yzlin (ports committer) Date: Tue Jul 21 09:54:04 2009 New Revision: 195800 URL: http://svn.freebsd.org/changeset/base/195800 Log: - Add my birthday - Add myself to ports committers and to lwhsu's mentee list Approved by: re (kib), lwhsu (mentor) Modified: head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Jul 21 08:38:45 2009 (r195799) +++ head/share/misc/committers-ports.dot Tue Jul 21 09:54:04 2009 (r195800) @@ -153,6 +153,7 @@ tmclaugh [label="Tom McLaughlin\ntmclaug vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"] wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"] xride [label="Soeren Straarup\nxride@FreeBSD.org\n2006/09/27"] +yzlin [label="Yi-Jheng Lin\nyzlin@FreeBSD.org\n2009/07/19"] znerd [label="Ernst de Haan\nznerd@FreeBSD.org\n2001/11/15"] # Here are the mentor/mentee relationships. @@ -261,6 +262,8 @@ leeym -> clsung lioux -> pat +lwhsu -> yzlin + maho -> tota marcus -> ahze Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Jul 21 08:38:45 2009 (r195799) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Jul 21 09:54:04 2009 (r195800) @@ -17,6 +17,7 @@ 01/10 Jean-Yves Lefort born in Charleroi, Belgium, 1980 01/12 Yen-Ming Lee born in Taipei, Taiwan, Republic of China, 1977 01/12 Ying-Chieh Liao born in Taipei, Taiwan, Republic of China, 1979 +01/14 Yi-Jheng Lin born in Taichung, Taiwan, Republic of China, 1985 01/16 Ariff Abdullah born in Kuala Lumpur, Malaysia, 1978 01/16 Dmitry Sivachenko born in Moscow, USSR, 1978 01/16 Vanilla I. Shu born in Taipei, Taiwan, Republic of China, 1978 From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 10:56:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4D61106566C; Tue, 21 Jul 2009 10:56:06 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 843F98FC0A; Tue, 21 Jul 2009 10:56:06 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227]) by mx0.deglitch.com (Postfix) with ESMTPSA id 8DB4C8FC27; Tue, 21 Jul 2009 14:56:04 +0400 (MSD) Date: Tue, 21 Jul 2009 14:55:59 +0400 From: Stanislav Sedov To: David Christensen Message-Id: <20090721145559.d2cf3f0b.stas@FreeBSD.org> In-Reply-To: <200902271925.n1RJP699080658@svn.freebsd.org> References: <200902271925.n1RJP699080658@svn.freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Tue__21_Jul_2009_14_55_59_+0400_lTQ9UKy7hhujs0+Z" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189117 - head/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 10:56:07 -0000 --Signature=_Tue__21_Jul_2009_14_55_59_+0400_lTQ9UKy7hhujs0+Z Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, 27 Feb 2009 19:25:06 +0000 (UTC) David Christensen mentioned: > Author: davidch > Date: Fri Feb 27 19:25:06 2009 > New Revision: 189117 > URL: http://svn.freebsd.org/changeset/base/189117 >=20 > Log: > - Update copyright to 2009. > - Only enable split header operation when ZERO_COPY_SOCKETS is enabled = in > the kernel. > =20 Hi, David! It appears that this change leads to excessive memory fragmentation due to large number of 9k contiguous buffers allocations performed. I noticed that under the relatively high load this can quickly lead to inability to s= end any packets via bce(4) even on machines with high amount of memory (16 Gb). I've been running with this change backed out for a long time and I don't see any problems with this driver with last changes applied. Interestingly enough, the split header functionality doesn't get enabled in this driver now even if zero copy sockets are used as this option doesn't get propagated to the driver due to missing opt_zero.h include. After latest busdma_sync fixes can we revert this patch so it will not requ= ire excessive amounts of 9k mbufs to operate? Thanks! --=20 Stanislav Sedov ST4096-RIPE --Signature=_Tue__21_Jul_2009_14_55_59_+0400_lTQ9UKy7hhujs0+Z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKZZ7EAAoJEKN82nOYvCd0HUIP/20SzzrYWyfsPLEpIQTB/i3/ mrJF8B+S3fT8D6+iHCeVvfle3R7+Y5yh6ktPKlKUoqS5OYiodMu1oMb+QMUVDfie yw5cO1TwA1Pblhst/rqQniFMKft7KGaD7CEJwzTZwaX50AiP4UqLoCgDDhUNmKec PungtddnCwEaCxY2sW7lpXwvSfpU/sGS8NcIhnW35Dymj51g7LEbipFtr0EFnwFm PTKbewEZSdzNZ3hsx8imphWBGc+ysG6PeMhPDP/+g5peWKg/YNVbW9nQY1EE1Voo ogfbfupvwhT0z4iJH0HSxePEzmy/yK37M6xH1hFzoXcE6oGpVKMotZTlzeXTL8cH O4ejW5poC3MbgGMAhD+u3LwqeuuFKBg8TzgJWQugY3rg1rIHsHv/aSbLwg4OVjtj vxOPkG1t2n1W9NRYCSRAvkCApWcf8cZfNedV16T+zEEUR3StCqm/hMsWQT0fEwbW DHWCvGi7Gu4s7hZkp0XKFGxj/zL01MTmWkflZhAfuW4lJEwF3gulJBcor9bnHGSo IoOVD66DPfab0EIMjBHaE/FykuGpavcx6g87bHtrUk9cfm5xQhjLYmRpc7Bv4WIC 80O/p5uy+JMy4hHkiAFdGTvvGNT2/7JbKLUFUA1CURFfjEtH8hKZuAOoTcgL6R5U pNGiZh+Z+Ai4ZNGi8io0 =330v -----END PGP SIGNATURE----- --Signature=_Tue__21_Jul_2009_14_55_59_+0400_lTQ9UKy7hhujs0+Z-- From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 12:32:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18F641065679; Tue, 21 Jul 2009 12:32:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03FC68FC19; Tue, 21 Jul 2009 12:32:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LCWlp9011343; Tue, 21 Jul 2009 12:32:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LCWkP1011337; Tue, 21 Jul 2009 12:32:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907211232.n6LCWkP1011337@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Jul 2009 12:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195801 - in head: share/man/man4 sys/conf sys/dev/siis sys/modules sys/modules/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 12:32:47 -0000 Author: mav Date: Tue Jul 21 12:32:46 2009 New Revision: 195801 URL: http://svn.freebsd.org/changeset/base/195801 Log: Add `siis` CAM driver for SiliconImage SiI3124/3132/3531 SATA2 controllers. Driver supports Serial ATA and ATAPI devices, Port Multipliers (including FIS-based switching), hardware command queues (31 command per port) and Native Command Queuing. This is probably the second on popularity, after AHCI, type of SATA2 controllers, that benefits from using CAM, because of hardware command queuing support. Approved by: re (kib) Added: head/share/man/man4/siis.4 (contents, props changed) head/sys/dev/siis/ head/sys/dev/siis/siis.c (contents, props changed) head/sys/dev/siis/siis.h (contents, props changed) head/sys/modules/siis/ head/sys/modules/siis/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Jul 21 09:54:04 2009 (r195800) +++ head/share/man/man4/Makefile Tue Jul 21 12:32:46 2009 (r195801) @@ -332,6 +332,7 @@ MAN= aac.4 \ sf.4 \ si.4 \ sio.4 \ + siis.4 \ sis.4 \ sk.4 \ smb.4 \ Added: head/share/man/man4/siis.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/siis.4 Tue Jul 21 12:32:46 2009 (r195801) @@ -0,0 +1,122 @@ +.\" Copyright (c) 2009 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 18, 2009 +.Dt SIIS 4 +.Os +.Sh NAME +.Nm siis +.Nd SiliconImage Serial ATA Host Controller driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pci" +.Cd "device scbus" +.Cd "device siis" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +siis_load="YES" +.Ed +.Pp +The following tunables are settable from the loader: +.Bl -ohang +.It Va hint.siis.X.msi +controls Message Signaled Interrupts (MSI) usage by the specified controller. +.It Va hint.siisch.X.pm_level +controls SATA interface Power Management for specified channel, +allowing some power to be saved at the cost of additional command +latency. +Possible values: +.Bl -tag -compact +.It 0 +interface Power Management is disabled (default); +.It 1 +device is allowed to initiate PM state change, host is passive. +.El +Note that interface Power Management is not compatible with +device presence detection. +You will have to reset bus manually on device hot-plug. +.It Va hint.siisch.X.sata_rev +setting to nonzero value limits maximum SATA revision (speed). +Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. +.El +.Sh DESCRIPTION +This driver provides the CAM subsystem native access to the +.Tn SATA +ports of controller. +Each SATA port is represented to CAM as a separate bus with 16 targets. +Most of the bus-management details are handled by the SATA-specific +transport of CAM. +Connected ATA disks are handled by the ATA protocol disk peripheral driver +.Xr ada 4 . +ATAPI devices are handled by the SCSI protocol peripheral drivers +.Xr cd 4 , +.Xr da 4 , +.Xr sa 4 , +etc. +.Pp +Driver features include support for Serial ATA and ATAPI devices, +Port Multipliers (including FIS-based switching), hardware command queues +(31 command per port), Native Command Queuing, SATA interface Power Management, +device hot-plug and Message Signaled Interrupts. +.Pp +Same hardware is also supported by atasiliconimage driver from +.Xr ata 4 +subsystem. If both drivers are loaded at the same time, this one will be +given precedence as the more functional of the two. +.Sh HARDWARE +The +.Nm +driver supports following controllers: +.Bl -bullet -compact +.It +SiI3124 +.It +SiI3132 +.It +SiI3531 +.El +.Sh SEE ALSO +.Xr ada 4 , +.Xr cd 4 , +.Xr da 4 , +.Xr sa 4 , +.Xr scsi 4 , +.Xr ata 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 8.0 . +.Sh AUTHORS +.An Alexander Motin Aq mav@FreeBSD.org . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jul 21 09:54:04 2009 (r195800) +++ head/sys/conf/files Tue Jul 21 12:32:46 2009 (r195801) @@ -1391,6 +1391,7 @@ dev/si/si3_t225.c optional si dev/si/si_eisa.c optional si eisa dev/si/si_isa.c optional si isa dev/si/si_pci.c optional si pci +dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci dev/sk/if_sk.c optional sk pci inet dev/smbus/smb.c optional smb Added: head/sys/dev/siis/siis.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/siis/siis.c Tue Jul 21 12:32:46 2009 (r195801) @@ -0,0 +1,1572 @@ +/*- + * Copyright (c) 2009 Alexander Motin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "siis.h" + +#include +#include +#include +#include +#include +#include + +/* local prototypes */ +static int siis_setup_interrupt(device_t dev); +static void siis_intr(void *data); +static int siis_suspend(device_t dev); +static int siis_resume(device_t dev); +static int siis_ch_suspend(device_t dev); +static int siis_ch_resume(device_t dev); +static void siis_ch_intr_locked(void *data); +static void siis_ch_intr(void *data); +static void siis_begin_transaction(device_t dev, union ccb *ccb); +static void siis_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error); +static void siis_execute_transaction(struct siis_slot *slot); +static void siis_timeout(struct siis_slot *slot); +static void siis_end_transaction(struct siis_slot *slot, enum siis_err_type et); +static int siis_setup_fis(struct siis_cmd *ctp, union ccb *ccb, int tag); +static void siis_dmainit(device_t dev); +static void siis_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); +static void siis_dmafini(device_t dev); +static void siis_slotsalloc(device_t dev); +static void siis_slotsfree(device_t dev); +static void siis_reset(device_t dev); +static void siis_portinit(device_t dev); +static int siis_wait_ready(device_t dev, int t); + +static int siis_sata_connect(struct siis_channel *ch); +static int siis_sata_phy_reset(device_t dev); + +static void siis_issue_read_log(device_t dev); +static void siis_process_read_log(device_t dev, union ccb *ccb); + +static void siisaction(struct cam_sim *sim, union ccb *ccb); +static void siispoll(struct cam_sim *sim); + +MALLOC_DEFINE(M_SIIS, "SIIS driver", "SIIS driver data buffers"); + +static int +siis_probe(device_t dev) +{ + uint32_t devid = pci_get_devid(dev); + + if (devid == SIIS_SII3124) { + device_set_desc_copy(dev, "SiI3124 SATA2 controller"); + } else if (devid == SIIS_SII3132 || + devid == SIIS_SII3132_1 || + devid == SIIS_SII3132_2) { + device_set_desc_copy(dev, "SiI3132 SATA2 controller"); + } else if (devid == SIIS_SII3531) { + device_set_desc_copy(dev, "SiI3531 SATA2 controller"); + } else { + return (ENXIO); + } + + return (BUS_PROBE_VENDOR); +} + +static int +siis_attach(device_t dev) +{ + struct siis_controller *ctlr = device_get_softc(dev); + uint32_t devid = pci_get_devid(dev); + device_t child; + int error, unit; + + ctlr->dev = dev; + /* Global memory */ + ctlr->r_grid = PCIR_BAR(0); + if (!(ctlr->r_gmem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &ctlr->r_grid, RF_ACTIVE))) + return (ENXIO); + /* Channels memory */ + ctlr->r_rid = PCIR_BAR(2); + if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &ctlr->r_rid, RF_ACTIVE))) + return (ENXIO); + /* Setup our own memory management for channels. */ + ctlr->sc_iomem.rm_type = RMAN_ARRAY; + ctlr->sc_iomem.rm_descr = "I/O memory addresses"; + if ((error = rman_init(&ctlr->sc_iomem)) != 0) { + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_grid, ctlr->r_gmem); + return (error); + } + if ((error = rman_manage_region(&ctlr->sc_iomem, + rman_get_start(ctlr->r_mem), rman_get_end(ctlr->r_mem))) != 0) { + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_grid, ctlr->r_gmem); + rman_fini(&ctlr->sc_iomem); + return (error); + } + /* Reset controller */ + siis_resume(dev); + /* Number of HW channels */ + ctlr->channels = (devid == SIIS_SII3124) ? 4 : + (devid == SIIS_SII3531 ? 1 : 2); + /* Setup interrupts. */ + if (siis_setup_interrupt(dev)) { + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_grid, ctlr->r_gmem); + rman_fini(&ctlr->sc_iomem); + return ENXIO; + } + /* Attach all channels on this controller */ + for (unit = 0; unit < ctlr->channels; unit++) { + child = device_add_child(dev, "siisch", -1); + if (child == NULL) + device_printf(dev, "failed to add channel device\n"); + else + device_set_ivars(child, (void *)(intptr_t)unit); + } + bus_generic_attach(dev); + return 0; +} + +static int +siis_detach(device_t dev) +{ + struct siis_controller *ctlr = device_get_softc(dev); + device_t *children; + int nchildren, i; + + /* Detach & delete all children */ + if (!device_get_children(dev, &children, &nchildren)) { + for (i = 0; i < nchildren; i++) + device_delete_child(dev, children[i]); + free(children, M_TEMP); + } + /* Free interrupts. */ + if (ctlr->irq.r_irq) { + bus_teardown_intr(dev, ctlr->irq.r_irq, + ctlr->irq.handle); + bus_release_resource(dev, SYS_RES_IRQ, + ctlr->irq.r_irq_rid, ctlr->irq.r_irq); + } + pci_release_msi(dev); + /* Free memory. */ + rman_fini(&ctlr->sc_iomem); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_grid, ctlr->r_gmem); + return (0); +} + +static int +siis_suspend(device_t dev) +{ + struct siis_controller *ctlr = device_get_softc(dev); + + bus_generic_suspend(dev); + /* Put controller into reset state. */ + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, SIIS_GCTL_GRESET); + return 0; +} + +static int +siis_resume(device_t dev) +{ + struct siis_controller *ctlr = device_get_softc(dev); + + /* Put controller into reset state. */ + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, SIIS_GCTL_GRESET); + DELAY(10000); + /* Get controller out of reset state and enable port interrupts. */ + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, 0x0000000f); + return (bus_generic_resume(dev)); +} + +static int +siis_setup_interrupt(device_t dev) +{ + struct siis_controller *ctlr = device_get_softc(dev); + int msi = 0; + + /* Process hints. */ + resource_int_value(device_get_name(dev), + device_get_unit(dev), "msi", &msi); + if (msi < 0) + msi = 0; + else if (msi > 0) + msi = min(1, pci_msi_count(dev)); + /* Allocate MSI if needed/present. */ + if (msi && pci_alloc_msi(dev, &msi) != 0) + msi = 0; + /* Allocate all IRQs. */ + ctlr->irq.r_irq_rid = msi ? 1 : 0; + if (!(ctlr->irq.r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &ctlr->irq.r_irq_rid, RF_SHAREABLE | RF_ACTIVE))) { + device_printf(dev, "unable to map interrupt\n"); + return ENXIO; + } + if ((bus_setup_intr(dev, ctlr->irq.r_irq, ATA_INTR_FLAGS, NULL, + siis_intr, ctlr, &ctlr->irq.handle))) { + /* SOS XXX release r_irq */ + device_printf(dev, "unable to setup interrupt\n"); + return ENXIO; + } + return (0); +} + +/* + * Common case interrupt handler. + */ +static void +siis_intr(void *data) +{ + struct siis_controller *ctlr = (struct siis_controller *)data; + u_int32_t is; + void *arg; + int unit; + + is = ATA_INL(ctlr->r_gmem, SIIS_IS); + for (unit = 0; unit < ctlr->channels; unit++) { + if ((is & SIIS_IS_PORT(unit)) != 0 && + (arg = ctlr->interrupt[unit].argument)) { + ctlr->interrupt[unit].function(arg); + } + } +} + +static struct resource * +siis_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct siis_controller *ctlr = device_get_softc(dev); + int unit = ((struct siis_channel *)device_get_softc(child))->unit; + struct resource *res = NULL; + int offset = unit << 13; + long st; + + switch (type) { + case SYS_RES_MEMORY: + st = rman_get_start(ctlr->r_mem); + res = rman_reserve_resource(&ctlr->sc_iomem, st + offset, + st + offset + 0x2000, 0x2000, RF_ACTIVE, child); + if (res) { + bus_space_handle_t bsh; + bus_space_tag_t bst; + bsh = rman_get_bushandle(ctlr->r_mem); + bst = rman_get_bustag(ctlr->r_mem); + bus_space_subregion(bst, bsh, offset, 0x2000, &bsh); + rman_set_bushandle(res, bsh); + rman_set_bustag(res, bst); + } + break; + case SYS_RES_IRQ: + if (*rid == ATA_IRQ_RID) + res = ctlr->irq.r_irq; + break; + } + return (res); +} + +static int +siis_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + + switch (type) { + case SYS_RES_MEMORY: + rman_release_resource(r); + return (0); + case SYS_RES_IRQ: + if (rid != ATA_IRQ_RID) + return ENOENT; + return (0); + } + return (EINVAL); +} + +static int +siis_setup_intr(device_t dev, device_t child, struct resource *irq, + int flags, driver_filter_t *filter, driver_intr_t *function, + void *argument, void **cookiep) +{ + struct siis_controller *ctlr = device_get_softc(dev); + int unit = (intptr_t)device_get_ivars(child); + + if (filter != NULL) { + printf("siis.c: we cannot use a filter here\n"); + return (EINVAL); + } + ctlr->interrupt[unit].function = function; + ctlr->interrupt[unit].argument = argument; + return (0); +} + +static int +siis_teardown_intr(device_t dev, device_t child, struct resource *irq, + void *cookie) +{ + struct siis_controller *ctlr = device_get_softc(dev); + int unit = (intptr_t)device_get_ivars(child); + + ctlr->interrupt[unit].function = NULL; + ctlr->interrupt[unit].argument = NULL; + return (0); +} + +static int +siis_print_child(device_t dev, device_t child) +{ + int retval; + + retval = bus_print_child_header(dev, child); + retval += printf(" at channel %d", + (int)(intptr_t)device_get_ivars(child)); + retval += bus_print_child_footer(dev, child); + + return (retval); +} + +devclass_t siis_devclass; +static device_method_t siis_methods[] = { + DEVMETHOD(device_probe, siis_probe), + DEVMETHOD(device_attach, siis_attach), + DEVMETHOD(device_detach, siis_detach), + DEVMETHOD(device_suspend, siis_suspend), + DEVMETHOD(device_resume, siis_resume), + DEVMETHOD(bus_print_child, siis_print_child), + DEVMETHOD(bus_alloc_resource, siis_alloc_resource), + DEVMETHOD(bus_release_resource, siis_release_resource), + DEVMETHOD(bus_setup_intr, siis_setup_intr), + DEVMETHOD(bus_teardown_intr,siis_teardown_intr), + { 0, 0 } +}; +static driver_t siis_driver = { + "siis", + siis_methods, + sizeof(struct siis_controller) +}; +DRIVER_MODULE(siis, pci, siis_driver, siis_devclass, 0, 0); +MODULE_VERSION(siis, 1); +MODULE_DEPEND(siis, cam, 1, 1, 1); + +static int +siis_ch_probe(device_t dev) +{ + + device_set_desc_copy(dev, "SIIS channel"); + return (0); +} + +static int +siis_ch_attach(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + struct cam_devq *devq; + int rid, error; + + ch->dev = dev; + ch->unit = (intptr_t)device_get_ivars(dev); + resource_int_value(device_get_name(dev), + device_get_unit(dev), "pm_level", &ch->pm_level); + resource_int_value(device_get_name(dev), + device_get_unit(dev), "sata_rev", &ch->sata_rev); + mtx_init(&ch->mtx, "SIIS channel lock", NULL, MTX_DEF); + rid = ch->unit; + if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE))) + return (ENXIO); + siis_dmainit(dev); + siis_slotsalloc(dev); + siis_ch_resume(dev); + mtx_lock(&ch->mtx); + rid = ATA_IRQ_RID; + if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_SHAREABLE | RF_ACTIVE))) { + bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); + device_printf(dev, "Unable to map interrupt\n"); + return (ENXIO); + } + if ((bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL, + siis_ch_intr_locked, dev, &ch->ih))) { + device_printf(dev, "Unable to setup interrupt\n"); + error = ENXIO; + goto err1; + } + /* Create the device queue for our SIM. */ + devq = cam_simq_alloc(SIIS_MAX_SLOTS); + if (devq == NULL) { + device_printf(dev, "Unable to allocate simq\n"); + error = ENOMEM; + goto err1; + } + /* Construct SIM entry */ + ch->sim = cam_sim_alloc(siisaction, siispoll, "siisch", ch, + device_get_unit(dev), &ch->mtx, SIIS_MAX_SLOTS, 0, devq); + if (ch->sim == NULL) { + device_printf(dev, "unable to allocate sim\n"); + error = ENOMEM; + goto err2; + } + if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) { + device_printf(dev, "unable to register xpt bus\n"); + error = ENXIO; + goto err2; + } + if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + device_printf(dev, "unable to create path\n"); + error = ENXIO; + goto err3; + } + mtx_unlock(&ch->mtx); + return (0); + +err3: + xpt_bus_deregister(cam_sim_path(ch->sim)); +err2: + cam_sim_free(ch->sim, /*free_devq*/TRUE); +err1: + bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); + bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); + mtx_unlock(&ch->mtx); + return (error); +} + +static int +siis_ch_detach(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + + mtx_lock(&ch->mtx); + xpt_async(AC_LOST_DEVICE, ch->path, NULL); + xpt_free_path(ch->path); + xpt_bus_deregister(cam_sim_path(ch->sim)); + cam_sim_free(ch->sim, /*free_devq*/TRUE); + mtx_unlock(&ch->mtx); + + bus_teardown_intr(dev, ch->r_irq, ch->ih); + bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); + + siis_ch_suspend(dev); + siis_slotsfree(dev); + siis_dmafini(dev); + + bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); + mtx_destroy(&ch->mtx); + return (0); +} + +static int +siis_ch_suspend(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + + /* Put port into reset state. */ + ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_PORT_RESET); + return (0); +} + +static int +siis_ch_resume(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + + /* Get port out of reset state. */ + ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PORT_RESET); + ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_32BIT); + ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PME); + /* Enable port interrupts */ + ATA_OUTL(ch->r_mem, SIIS_P_IESET, SIIS_P_IX_ENABLED); + return (0); +} + +devclass_t siisch_devclass; +static device_method_t siisch_methods[] = { + DEVMETHOD(device_probe, siis_ch_probe), + DEVMETHOD(device_attach, siis_ch_attach), + DEVMETHOD(device_detach, siis_ch_detach), + DEVMETHOD(device_suspend, siis_ch_suspend), + DEVMETHOD(device_resume, siis_ch_resume), + { 0, 0 } +}; +static driver_t siisch_driver = { + "siisch", + siisch_methods, + sizeof(struct siis_channel) +}; +DRIVER_MODULE(siisch, siis, siisch_driver, siis_devclass, 0, 0); + +struct siis_dc_cb_args { + bus_addr_t maddr; + int error; +}; + +static void +siis_dmainit(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + struct siis_dc_cb_args dcba; + + /* Command area. */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), 1024, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, + NULL, NULL, SIIS_WORK_SIZE, 1, SIIS_WORK_SIZE, + 0, NULL, NULL, &ch->dma.work_tag)) + goto error; + if (bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work, 0, + &ch->dma.work_map)) + goto error; + if (bus_dmamap_load(ch->dma.work_tag, ch->dma.work_map, ch->dma.work, + SIIS_WORK_SIZE, siis_dmasetupc_cb, &dcba, 0) || dcba.error) { + bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map); + goto error; + } + ch->dma.work_bus = dcba.maddr; + /* Data area. */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), 2, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, + NULL, NULL, + SIIS_SG_ENTRIES * PAGE_SIZE * SIIS_MAX_SLOTS, + SIIS_SG_ENTRIES, 0xFFFFFFFF, + 0, busdma_lock_mutex, &ch->mtx, &ch->dma.data_tag)) { + goto error; + } + return; + +error: + device_printf(dev, "WARNING - DMA initialization failed\n"); + siis_dmafini(dev); +} + +static void +siis_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct siis_dc_cb_args *dcba = (struct siis_dc_cb_args *)xsc; + + if (!(dcba->error = error)) + dcba->maddr = segs[0].ds_addr; +} + +static void +siis_dmafini(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + + if (ch->dma.data_tag) { + bus_dma_tag_destroy(ch->dma.data_tag); + ch->dma.data_tag = NULL; + } + if (ch->dma.work_bus) { + bus_dmamap_unload(ch->dma.work_tag, ch->dma.work_map); + bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map); + ch->dma.work_bus = 0; + ch->dma.work_map = NULL; + ch->dma.work = NULL; + } + if (ch->dma.work_tag) { + bus_dma_tag_destroy(ch->dma.work_tag); + ch->dma.work_tag = NULL; + } +} + +static void +siis_slotsalloc(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + int i; + + /* Alloc and setup command/dma slots */ + bzero(ch->slot, sizeof(ch->slot)); + for (i = 0; i < SIIS_MAX_SLOTS; i++) { + struct siis_slot *slot = &ch->slot[i]; + + slot->dev = dev; + slot->slot = i; + slot->state = SIIS_SLOT_EMPTY; + slot->ccb = NULL; + callout_init_mtx(&slot->timeout, &ch->mtx, 0); + + if (bus_dmamap_create(ch->dma.data_tag, 0, &slot->dma.data_map)) + device_printf(ch->dev, "FAILURE - create data_map\n"); + } +} + +static void +siis_slotsfree(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + int i; + + /* Free all dma slots */ + for (i = 0; i < SIIS_MAX_SLOTS; i++) { + struct siis_slot *slot = &ch->slot[i]; + + if (slot->dma.data_map) { + bus_dmamap_destroy(ch->dma.data_tag, slot->dma.data_map); + slot->dma.data_map = NULL; + } + } +} + +static void +siis_phy_check_events(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + + /* If we have a connection event, deal with it */ + if (ch->pm_level == 0) { + u_int32_t status = ATA_INL(ch->r_mem, SIIS_P_SSTS); + if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && + ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && + ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) { + if (bootverbose) + device_printf(dev, "CONNECT requested\n"); + siis_reset(dev); + } else { + if (bootverbose) + device_printf(dev, "DISCONNECT requested\n"); + ch->devices = 0; + } + } +} + +static void +siis_ch_intr_locked(void *data) +{ + device_t dev = (device_t)data; + struct siis_channel *ch = device_get_softc(dev); + + mtx_lock(&ch->mtx); + siis_ch_intr(data); + mtx_unlock(&ch->mtx); +} + +static void +siis_ch_intr(void *data) +{ + device_t dev = (device_t)data; + struct siis_channel *ch = device_get_softc(dev); + uint32_t istatus, sstatus, ctx, estatus, ok, err = 0; + enum siis_err_type et; + int i, ccs, port, tslots; + + mtx_assert(&ch->mtx, MA_OWNED); + /* Read command statuses. */ + sstatus = ATA_INL(ch->r_mem, SIIS_P_SS); + ok = ch->rslots & ~sstatus; + /* Complete all successfull commands. */ + for (i = 0; i < SIIS_MAX_SLOTS; i++) { + if ((ok >> i) & 1) + siis_end_transaction(&ch->slot[i], SIIS_ERR_NONE); + } + /* Do we have any other events? */ + if ((sstatus & SIIS_P_SS_ATTN) == 0) + return; + /* Read and clear interrupt statuses. */ + istatus = ATA_INL(ch->r_mem, SIIS_P_IS) & + (0xFFFF & ~SIIS_P_IX_COMMCOMP); + ATA_OUTL(ch->r_mem, SIIS_P_IS, istatus); + /* Process PHY events */ + if (istatus & SIIS_P_IX_PHYRDYCHG) + siis_phy_check_events(dev); + /* Process command errors */ + if (istatus & SIIS_P_IX_COMMERR) { + estatus = ATA_INL(ch->r_mem, SIIS_P_CMDERR); + ctx = ATA_INL(ch->r_mem, SIIS_P_CTX); + ccs = (ctx & SIIS_P_CTX_SLOT) >> SIIS_P_CTX_SLOT_SHIFT; + port = (ctx & SIIS_P_CTX_PMP) >> SIIS_P_CTX_PMP_SHIFT; + err = ch->rslots & sstatus; +//device_printf(dev, "%s ERROR ss %08x is %08x rs %08x es %d act %d port %d serr %08x\n", +// __func__, sstatus, istatus, ch->rslots, estatus, ccs, port, +// ATA_INL(ch->r_mem, SIIS_P_SERR)); + + if (!ch->readlog && !ch->recovery) { + xpt_freeze_simq(ch->sim, ch->numrslots); + ch->recovery = 1; + } + if (ch->frozen) { + union ccb *fccb = ch->frozen; + ch->frozen = NULL; + fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ; + xpt_done(fccb); + } + if (estatus == SIIS_P_CMDERR_DEV || + estatus == SIIS_P_CMDERR_SDB || + estatus == SIIS_P_CMDERR_DATAFIS) { + tslots = ch->numtslots[port]; + for (i = 0; i < SIIS_MAX_SLOTS; i++) { + /* XXX: reqests in loading state. */ + if (((ch->rslots >> i) & 1) == 0) + continue; + if (ch->slot[i].ccb->ccb_h.target_id != port) + continue; + if (tslots == 0) { + /* Untagged operation. */ + if (i == ccs) + et = SIIS_ERR_TFE; + else + et = SIIS_ERR_INNOCENT; + } else { + /* Tagged operation. */ + et = SIIS_ERR_NCQ; + } + siis_end_transaction(&ch->slot[i], et); + } + /* + * We can't reinit port if there are some other + * commands active, use resume to complete them. + */ + if (ch->rslots != 0) + ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_RESUME); + } else { + if (estatus == SIIS_P_CMDERR_SENDFIS || + estatus == SIIS_P_CMDERR_INCSTATE || + estatus == SIIS_P_CMDERR_PPE || + estatus == SIIS_P_CMDERR_SERVICE) { + et = SIIS_ERR_SATA; + } else + et = SIIS_ERR_INVALID; + for (i = 0; i < SIIS_MAX_SLOTS; i++) { + /* XXX: reqests in loading state. */ + if (((ch->rslots >> i) & 1) == 0) + continue; + siis_end_transaction(&ch->slot[i], et); + } + } + } +} + +/* Must be called with channel locked. */ +static int +siis_check_collision(device_t dev, union ccb *ccb) +{ + struct siis_channel *ch = device_get_softc(dev); + + mtx_assert(&ch->mtx, MA_OWNED); + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & (CAM_ATAIO_CONTROL | CAM_ATAIO_NEEDRESULT))) { + /* Atomic command while anything active. */ + if (ch->numrslots != 0) + return (1); + } + /* We have some atomic command running. */ + if (ch->aslots != 0) + return (1); + return (0); +} + +/* Must be called with channel locked. */ +static void +siis_begin_transaction(device_t dev, union ccb *ccb) +{ + struct siis_channel *ch = device_get_softc(dev); + struct siis_slot *slot; + int tag; + + mtx_assert(&ch->mtx, MA_OWNED); + /* Choose empty slot. */ + tag = ch->lastslot; + do { + tag++; + if (tag >= SIIS_MAX_SLOTS) + tag = 0; + if (ch->slot[tag].state == SIIS_SLOT_EMPTY) + break; + } while (tag != ch->lastslot); + if (ch->slot[tag].state != SIIS_SLOT_EMPTY) + device_printf(ch->dev, "ALL SLOTS BUSY!\n"); + ch->lastslot = tag; + /* Occupy chosen slot. */ + slot = &ch->slot[tag]; + slot->ccb = ccb; + /* Update channel stats. */ + ch->numrslots++; + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { + ch->numtslots[ccb->ccb_h.target_id]++; + } + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & (CAM_ATAIO_CONTROL | CAM_ATAIO_NEEDRESULT))) + ch->aslots |= (1 << slot->slot); + slot->dma.nsegs = 0; + /* If request moves data, setup and load SG list */ + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + void *buf; + bus_size_t size; + + slot->state = SIIS_SLOT_LOADING; + if (ccb->ccb_h.func_code == XPT_ATA_IO) { + buf = ccb->ataio.data_ptr; + size = ccb->ataio.dxfer_len; + } else { + buf = ccb->csio.data_ptr; + size = ccb->csio.dxfer_len; + } + bus_dmamap_load(ch->dma.data_tag, slot->dma.data_map, + buf, size, siis_dmasetprd, slot, 0); + } else + siis_execute_transaction(slot); +} + +/* Locked by busdma engine. */ +static void +siis_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 12:43:12 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B441410656EF; Tue, 21 Jul 2009 12:43:12 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 6DA158FC08; Tue, 21 Jul 2009 12:43:12 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 5C5E66D41E; Tue, 21 Jul 2009 14:43:11 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 39BF8844C2; Tue, 21 Jul 2009 14:43:11 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: obrien@FreeBSD.org References: <200907142046.n6EKkJwO070823@svn.freebsd.org> <20090721040810.GA84807@dragon.NUXI.org> Date: Tue, 21 Jul 2009 14:43:11 +0200 In-Reply-To: <20090721040810.GA84807@dragon.NUXI.org> (David O'Brien's message of "Mon, 20 Jul 2009 21:08:10 -0700") Message-ID: <86hbx6xl40.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable-7@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r195696 - in stable/7: crypto/openssh secure/lib/libssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 12:43:13 -0000 "David O'Brien" writes: > Would you mind backing out this commit from 7-stable. Rather than backing it out, we can fix it by adding a closefrom implementation in crypto/openssh/compat/. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 12:45:06 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9BA7106566C; Tue, 21 Jul 2009 12:45:06 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 92B3C8FC15; Tue, 21 Jul 2009 12:45:06 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id D39CF6D418; Tue, 21 Jul 2009 14:45:05 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id B19EA844C2; Tue, 21 Jul 2009 14:45:05 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: obrien@FreeBSD.org References: <200907142046.n6EKkJwO070823@svn.freebsd.org> <20090721040810.GA84807@dragon.NUXI.org> <86hbx6xl40.fsf@ds4.des.no> Date: Tue, 21 Jul 2009 14:45:05 +0200 In-Reply-To: <86hbx6xl40.fsf@ds4.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?= =?utf-8?Q?rav=22's?= message of "Tue, 21 Jul 2009 14:43:11 +0200") Message-ID: <86d47uxl0u.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable-7@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r195696 - in stable/7: crypto/openssh secure/lib/libssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 12:45:07 -0000 Dag-Erling Sm=C3=B8rgrav writes: > "David O'Brien" writes: > > Would you mind backing out this commit from 7-stable. > Rather than backing it out, we can fix it by adding a closefrom > implementation in crypto/openssh/compat/. Brain fart. That's what we had before the MFC. John, please back out your commit. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 13:43:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D56910656EF; Tue, 21 Jul 2009 13:43:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E45AE8FC16; Tue, 21 Jul 2009 13:43:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9624446B65; Tue, 21 Jul 2009 09:43:58 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id C2B7F8A09C; Tue, 21 Jul 2009 09:43:56 -0400 (EDT) From: John Baldwin To: obrien@freebsd.org Date: Tue, 21 Jul 2009 09:33:23 -0400 User-Agent: KMail/1.9.7 References: <200907142046.n6EKkJwO070823@svn.freebsd.org> <20090721040810.GA84807@dragon.NUXI.org> In-Reply-To: <20090721040810.GA84807@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907210933.24176.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 21 Jul 2009 09:43:57 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r195696 - in stable/7: crypto/openssh secure/lib/libssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 13:44:03 -0000 On Tuesday 21 July 2009 12:08:10 am David O'Brien wrote: > On Tue, Jul 14, 2009 at 08:46:19PM +0000, John Baldwin wrote: > > Date: Tue Jul 14 20:46:19 2009 > > New Revision: 195696 > > URL: http://svn.freebsd.org/changeset/base/195696 > > Log: > > MFC: Use the closefrom(2) system call. > > Modified: > > stable/7/crypto/openssh/ (props changed) > > stable/7/crypto/openssh/config.h > > stable/7/crypto/openssh/ssh_namespace.h > > stable/7/secure/lib/libssh/ (props changed) > > stable/7/secure/lib/libssh/Makefile > > Hi John, > Would you mind backing out this commit from 7-stable. > This change mades it so one cannot seriously boot a machine multiuser > with an older kernel as /usr/sbin/sshd dies due to bad system call. I > think the MFC of this part of the closefrom(2) addtion edge up against > POLA for a mature -stable branch. > > Even in -CURRENT it's good form to add a new system call and then > immedately use it... without some time laps to allow folks to boot > a week old kernel. Will do, no problem. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 13:45:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9F441065675; Tue, 21 Jul 2009 13:45:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCD218FC2F; Tue, 21 Jul 2009 13:45:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LDjeq5012888; Tue, 21 Jul 2009 13:45:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LDjeZb012884; Tue, 21 Jul 2009 13:45:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907211345.n6LDjeZb012884@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Jul 2009 13:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195802 - in stable/7: crypto/openssh secure/lib/libssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 13:45:41 -0000 Author: jhb Date: Tue Jul 21 13:45:40 2009 New Revision: 195802 URL: http://svn.freebsd.org/changeset/base/195802 Log: Revert to using the userland closefrom() stub instead of the system call to give a longer grace time where newer ssh binaries work with older kernels. Requested by: obrien Approved by: des Modified: stable/7/crypto/openssh/ (props changed) stable/7/crypto/openssh/config.h stable/7/crypto/openssh/ssh_namespace.h stable/7/secure/lib/libssh/ (props changed) stable/7/secure/lib/libssh/Makefile Modified: stable/7/crypto/openssh/config.h ============================================================================== --- stable/7/crypto/openssh/config.h Tue Jul 21 12:32:46 2009 (r195801) +++ stable/7/crypto/openssh/config.h Tue Jul 21 13:45:40 2009 (r195802) @@ -211,7 +211,7 @@ #define HAVE_CLOCK_T 1 /* Define to 1 if you have the `closefrom' function. */ -#define HAVE_CLOSEFROM 1 +/* #undef HAVE_CLOSEFROM */ /* Define if gai_strerror() returns const char * */ #define HAVE_CONST_GAI_STRERROR_PROTO 1 Modified: stable/7/crypto/openssh/ssh_namespace.h ============================================================================== --- stable/7/crypto/openssh/ssh_namespace.h Tue Jul 21 12:32:46 2009 (r195801) +++ stable/7/crypto/openssh/ssh_namespace.h Tue Jul 21 13:45:40 2009 (r195802) @@ -154,6 +154,7 @@ #define ciphers_valid ssh_ciphers_valid #define cleanhostname ssh_cleanhostname #define cleanup_exit ssh_cleanup_exit +#define closefrom ssh_closefrom #define colon ssh_colon #define compat_cipher_proposal ssh_compat_cipher_proposal #define compat_datafellows ssh_compat_datafellows Modified: stable/7/secure/lib/libssh/Makefile ============================================================================== --- stable/7/secure/lib/libssh/Makefile Tue Jul 21 12:32:46 2009 (r195801) +++ stable/7/secure/lib/libssh/Makefile Tue Jul 21 13:45:40 2009 (r195802) @@ -19,7 +19,7 @@ SRCS= acss.c authfd.c authfile.c bufaux. # compiled directly into sshd instead. # Portability layer -SRCS+= bsd-arc4random.c bsd-misc.c fmt_scaled.c \ +SRCS+= bsd-arc4random.c bsd-closefrom.c bsd-misc.c fmt_scaled.c \ getrrsetbyname.c openssl-compat.c port-tun.c strtonum.c \ vis.c xcrypt.c xmmap.c # FreeBSD additions From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 14:18:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43534106564A; Tue, 21 Jul 2009 14:18:26 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 309CD8FC24; Tue, 21 Jul 2009 14:18:26 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LEIQ2Q013570; Tue, 21 Jul 2009 14:18:26 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LEIQ6g013568; Tue, 21 Jul 2009 14:18:26 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907211418.n6LEIQ6g013568@svn.freebsd.org> From: Rui Paulo Date: Tue, 21 Jul 2009 14:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195803 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 14:18:27 -0000 Author: rpaulo Date: Tue Jul 21 14:18:25 2009 New Revision: 195803 URL: http://svn.freebsd.org/changeset/base/195803 Log: Improve the printf message when a module failed to load. This gives the user some clue about the possibility of a __FreeBSD_version mismatch. Discussed with: rwatson, jhb Approved by: re (kib) Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Tue Jul 21 13:45:40 2009 (r195802) +++ head/sys/kern/kern_linker.c Tue Jul 21 14:18:25 2009 (r195803) @@ -2079,8 +2079,8 @@ linker_load_dependencies(linker_file_t l } error = linker_load_module(NULL, modname, lf, verinfo, NULL); if (error) { - printf("KLD %s: depends on %s - not available\n", - lf->filename, modname); + printf("KLD %s: depends on %s - not available or" + " version mismatch\n", lf->filename, modname); break; } } From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 14:23:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25DAD1065672; Tue, 21 Jul 2009 14:23:06 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1414B8FC17; Tue, 21 Jul 2009 14:23:06 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LEN5q9013704; Tue, 21 Jul 2009 14:23:05 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LEN5Oa013702; Tue, 21 Jul 2009 14:23:05 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907211423.n6LEN5Oa013702@svn.freebsd.org> From: Rui Paulo Date: Tue, 21 Jul 2009 14:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195804 - head/sys/modules/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 14:23:06 -0000 Author: rpaulo Date: Tue Jul 21 14:23:05 2009 New Revision: 195804 URL: http://svn.freebsd.org/changeset/base/195804 Log: Enable mesh support. Submitted by: jkim Approved by: re (kib) Modified: head/sys/modules/wlan/Makefile Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Tue Jul 21 14:18:25 2009 (r195803) +++ head/sys/modules/wlan/Makefile Tue Jul 21 14:23:05 2009 (r195804) @@ -6,11 +6,11 @@ KMOD= wlan SRCS= ieee80211.c ieee80211_action.c ieee80211_ageq.c \ ieee80211_crypto.c ieee80211_crypto_none.c ieee80211_dfs.c \ ieee80211_freebsd.c ieee80211_input.c ieee80211_ioctl.c \ - ieee80211_node.c ieee80211_output.c ieee80211_phy.c ieee80211_power.c \ - ieee80211_proto.c ieee80211_scan.c ieee80211_scan_sta.c \ - ieee80211_radiotap.c ieee80211_regdomain.c ieee80211_ht.c \ - ieee80211_adhoc.c ieee80211_hostap.c ieee80211_monitor.c \ - ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c + ieee80211_mesh.c ieee80211_node.c ieee80211_output.c ieee80211_phy.c \ + ieee80211_power.c ieee80211_proto.c ieee80211_scan.c \ + ieee80211_scan_sta.c ieee80211_radiotap.c ieee80211_regdomain.c \ + ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \ + ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h opt_ipx.h opt_wlan.h \ opt_ddb.h @@ -18,6 +18,7 @@ SRCS+= bus_if.h device_if.h opt_inet.h o opt_wlan.h: echo "#define IEEE80211_DEBUG 1" > ${.TARGET} echo "#define IEEE80211_AMDPU_AGE 1" >> ${.TARGET} + echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} opt_inet.h: echo "#define INET 1" > ${.TARGET} opt_ipx.h: From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 15:06:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7174106564A; Tue, 21 Jul 2009 15:06:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5ACA8FC17; Tue, 21 Jul 2009 15:06:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LF6A88014638; Tue, 21 Jul 2009 15:06:10 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LF6A7h014636; Tue, 21 Jul 2009 15:06:10 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907211506.n6LF6A7h014636@svn.freebsd.org> From: Sam Leffler Date: Tue, 21 Jul 2009 15:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195805 - head/sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 15:06:11 -0000 Author: sam Date: Tue Jul 21 15:06:10 2009 New Revision: 195805 URL: http://svn.freebsd.org/changeset/base/195805 Log: Fix the logic to count the number of "live interfaces". With this change dhclient now terminates when the underlying ifnet is destroyed (e.g. on card eject). Reviewed by: brooks Approved by: re (kib) Modified: head/sbin/dhclient/dispatch.c Modified: head/sbin/dhclient/dispatch.c ============================================================================== --- head/sbin/dhclient/dispatch.c Tue Jul 21 14:23:05 2009 (r195804) +++ head/sbin/dhclient/dispatch.c Tue Jul 21 15:06:10 2009 (r195805) @@ -144,7 +144,7 @@ reinitialize_interfaces(void) void dispatch(void) { - int count, i, to_msec, nfds = 0; + int count, live_interfaces, i, to_msec, nfds = 0; struct protocol *l; struct pollfd *fds; time_t howlong; @@ -188,18 +188,20 @@ another: to_msec = -1; /* Set up the descriptors to be polled. */ + live_interfaces = 0; for (i = 0, l = protocols; l; l = l->next) { struct interface_info *ip = l->local; - if (ip && (l->handler != got_one || !ip->dead)) { - fds[i].fd = l->fd; - fds[i].events = POLLIN; - fds[i].revents = 0; - i++; - } + if (ip == NULL || ip->dead) + continue; + fds[i].fd = l->fd; + fds[i].events = POLLIN; + fds[i].revents = 0; + i++; + if (l->handler == got_one) + live_interfaces++; } - - if (i == 0) + if (live_interfaces == 0) error("No live interfaces to poll on - exiting."); /* Wait for a packet or a timeout... XXX */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 16:54:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DA84106566C; Tue, 21 Jul 2009 16:54:12 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8AB8FC08; Tue, 21 Jul 2009 16:54:12 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LGsCFX016649; Tue, 21 Jul 2009 16:54:12 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LGsB5l016647; Tue, 21 Jul 2009 16:54:12 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200907211654.n6LGsB5l016647@svn.freebsd.org> From: Alan Cox Date: Tue, 21 Jul 2009 16:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195806 - head/sys/xen/evtchn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 16:54:12 -0000 Author: alc Date: Tue Jul 21 16:54:11 2009 New Revision: 195806 URL: http://svn.freebsd.org/changeset/base/195806 Log: Catch up with r195249, "Improve the handling of cpuset with interrupts." Specifically, update the return type of xenpic_assign_cpu() so that this file compiles again. Approved by: re (kib) Modified: head/sys/xen/evtchn/evtchn.c Modified: head/sys/xen/evtchn/evtchn.c ============================================================================== --- head/sys/xen/evtchn/evtchn.c Tue Jul 21 15:06:10 2009 (r195805) +++ head/sys/xen/evtchn/evtchn.c Tue Jul 21 16:54:11 2009 (r195806) @@ -626,7 +626,7 @@ static int xenpic_vector(struct int static int xenpic_source_pending(struct intsrc *isrc); static void xenpic_suspend(struct pic* pic); static void xenpic_resume(struct pic* pic); -static void xenpic_assign_cpu(struct intsrc *, u_int apic_id); +static int xenpic_assign_cpu(struct intsrc *, u_int apic_id); struct pic xenpic_dynirq_template = { @@ -752,10 +752,11 @@ xenpic_resume(struct pic* pic) TODO; } -static void +static int xenpic_assign_cpu(struct intsrc *isrc, u_int apic_id) { TODO; + return (EOPNOTSUPP); } void From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 19:01:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D774A106566B; Tue, 21 Jul 2009 19:01:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC1478FC16; Tue, 21 Jul 2009 19:01:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LJ14Nx019317; Tue, 21 Jul 2009 19:01:04 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LJ14nU019314; Tue, 21 Jul 2009 19:01:04 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907211901.n6LJ14nU019314@svn.freebsd.org> From: Sam Leffler Date: Tue, 21 Jul 2009 19:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195807 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 19:01:05 -0000 Author: sam Date: Tue Jul 21 19:01:04 2009 New Revision: 195807 URL: http://svn.freebsd.org/changeset/base/195807 Log: track whether any mesh vaps are present to correctly setup the rx filter when, for example, an ap vap is created first Reviewed by: rpaulo Approved by: re (kib) Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jul 21 16:54:11 2009 (r195806) +++ head/sys/dev/ath/if_ath.c Tue Jul 21 19:01:04 2009 (r195807) @@ -1023,6 +1023,8 @@ ath_vap_create(struct ieee80211com *ic, sc->sc_nvaps++; if (opmode == IEEE80211_M_STA) sc->sc_nstavaps++; + if (opmode == IEEE80211_M_MBSS) + sc->sc_nmeshvaps++; } switch (ic_opmode) { case IEEE80211_M_IBSS: @@ -1137,6 +1139,8 @@ ath_vap_delete(struct ieee80211vap *vap) vap->iv_opmode == IEEE80211_M_MBSS) { reclaim_address(sc, vap->iv_myaddr); ath_hal_setbssidmask(ah, sc->sc_hwbssidmask); + if (vap->iv_opmode == IEEE80211_M_MBSS) + sc->sc_nmeshvaps--; } if (vap->iv_opmode != IEEE80211_M_WDS) sc->sc_nvaps--; @@ -2381,7 +2385,7 @@ ath_calcrxfilter(struct ath_softc *sc) if (ic->ic_opmode == IEEE80211_M_HOSTAP && IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) rfilt |= HAL_RX_FILTER_BEACON; - if (ic->ic_opmode == IEEE80211_M_MBSS) { + if (sc->sc_nmeshvaps) { rfilt |= HAL_RX_FILTER_BEACON; if (sc->sc_hasbmatch) rfilt |= HAL_RX_FILTER_BSSID; Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Jul 21 16:54:11 2009 (r195806) +++ head/sys/dev/ath/if_athvar.h Tue Jul 21 19:01:04 2009 (r195807) @@ -203,6 +203,7 @@ struct ath_softc { int sc_debug; int sc_nvaps; /* # vaps */ int sc_nstavaps; /* # station vaps */ + int sc_nmeshvaps; /* # mbss vaps */ u_int8_t sc_hwbssidmask[IEEE80211_ADDR_LEN]; u_int8_t sc_nbssid0; /* # vap's using base mac */ uint32_t sc_bssidmask; /* bssid mask */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 19:06:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6BF6106566C; Tue, 21 Jul 2009 19:06:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B488D8FC1F; Tue, 21 Jul 2009 19:06:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LJ6dkE019470; Tue, 21 Jul 2009 19:06:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LJ6d6x019467; Tue, 21 Jul 2009 19:06:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200907211906.n6LJ6d6x019467@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Jul 2009 19:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195808 - in head/sys: dev/pci sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 19:06:40 -0000 Author: marius Date: Tue Jul 21 19:06:39 2009 New Revision: 195808 URL: http://svn.freebsd.org/changeset/base/195808 Log: Add a MD __PCI_BAR_ZERO_VALID which denotes that BARs containing 0 actually specify valid bases that should be treated just as normal. The PCI specifications have no indication that 0 would be a magic value indicating a disabled BAR as commonly used on at least amd64 and i386 but not sparc64. It's unclear what to do in pci_delete_resource() instead of writing 0 to a BAR though as there's no (other) way do disable individual BARs so its decoding is left enabled in case of __PCI_BAR_ZERO_VALID for now. Approved by: re (kib), jhb MFC after: 1 week Modified: head/sys/dev/pci/pci.c head/sys/sparc64/include/param.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Jul 21 19:01:04 2009 (r195807) +++ head/sys/dev/pci/pci.c Tue Jul 21 19:06:39 2009 (r195808) @@ -2352,7 +2352,7 @@ pci_add_map(device_t bus, device_t dev, { pci_addr_t base, map, testval; pci_addr_t start, end, count; - int barlen, maprange, mapsize, type; + int barlen, basezero, maprange, mapsize, type; uint16_t cmd; struct resource *res; @@ -2365,6 +2365,11 @@ pci_add_map(device_t bus, device_t dev, type = SYS_RES_IOPORT; mapsize = pci_mapsize(testval); base = pci_mapbase(map); +#ifdef __PCI_BAR_ZERO_VALID + basezero = 0; +#else + basezero = base == 0; +#endif maprange = pci_maprange(map); barlen = maprange == 64 ? 2 : 1; @@ -2393,17 +2398,17 @@ pci_add_map(device_t bus, device_t dev, } /* - * If base is 0, then we have problems. It is best to ignore - * such entries for the moment. These will be allocated later if - * the driver specifically requests them. However, some - * removable busses look better when all resources are allocated, - * so allow '0' to be overriden. + * If base is 0, then we have problems if this architecture does + * not allow that. It is best to ignore such entries for the + * moment. These will be allocated later if the driver specifically + * requests them. However, some removable busses look better when + * all resources are allocated, so allow '0' to be overriden. * * Similarly treat maps whose values is the same as the test value * read back. These maps have had all f's written to them by the * BIOS in an attempt to disable the resources. */ - if (!force && (base == 0 || map == testval)) + if (!force && (basezero || map == testval)) return (barlen); if ((u_long)base != base) { device_printf(bus, @@ -2440,7 +2445,7 @@ pci_add_map(device_t bus, device_t dev, } count = 1 << mapsize; - if (base == 0 || base == pci_mapbase(testval)) { + if (basezero || base == pci_mapbase(testval)) { start = 0; /* Let the parent decide. */ end = ~0ULL; } else { @@ -3683,6 +3688,7 @@ pci_delete_resource(device_t dev, device return; } +#ifndef __PCI_BAR_ZERO_VALID /* * If this is a BAR, clear the BAR so it stops * decoding before releasing the resource. @@ -3693,6 +3699,7 @@ pci_delete_resource(device_t dev, device pci_write_bar(child, rid, 0); break; } +#endif bus_release_resource(dev, type, rid, rle->res); } resource_list_delete(rl, type, rid); Modified: head/sys/sparc64/include/param.h ============================================================================== --- head/sys/sparc64/include/param.h Tue Jul 21 19:01:04 2009 (r195807) +++ head/sys/sparc64/include/param.h Tue Jul 21 19:06:39 2009 (r195808) @@ -48,6 +48,8 @@ #ifndef _NO_NAMESPACE_POLLUTION +#define __PCI_BAR_ZERO_VALID + #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 19:23:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E1F7106566B; Tue, 21 Jul 2009 19:23:35 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CB818FC12; Tue, 21 Jul 2009 19:23:35 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LJNZmV019833; Tue, 21 Jul 2009 19:23:35 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LJNZe7019831; Tue, 21 Jul 2009 19:23:35 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907211923.n6LJNZe7019831@svn.freebsd.org> From: Sam Leffler Date: Tue, 21 Jul 2009 19:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195809 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 19:23:35 -0000 Author: sam Date: Tue Jul 21 19:23:34 2009 New Revision: 195809 URL: http://svn.freebsd.org/changeset/base/195809 Log: Fix handling of AR_RX_FILTER_BSSID: write the shadow value for AR_MISC_MODE so other register writes preserve the setting of AR_MISC_MODE_BSSID_MATCH_FORCE. Reviewed by: rpaulo Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Tue Jul 21 19:06:39 2009 (r195808) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Tue Jul 21 19:23:34 2009 (r195809) @@ -164,7 +164,7 @@ ar5212GetRxFilter(struct ath_hal *ah) if (phybits & (AR_PHY_ERR_OFDM_TIMING|AR_PHY_ERR_CCK_TIMING)) bits |= HAL_RX_FILTER_PHYERR; if (AH_PRIVATE(ah)->ah_caps.halBssidMatchSupport && - (OS_REG_READ(ah, AR_MISC_MODE) & AR_MISC_MODE_BSSID_MATCH_FORCE)) + (AH5212(ah)->ah_miscMode & AR_MISC_MODE_BSSID_MATCH_FORCE)) bits |= HAL_RX_FILTER_BSSID; return bits; } @@ -175,6 +175,7 @@ ar5212GetRxFilter(struct ath_hal *ah) void ar5212SetRxFilter(struct ath_hal *ah, uint32_t bits) { + struct ath_hal_5212 *ahp = AH5212(ah); uint32_t phybits; OS_REG_WRITE(ah, AR_RX_FILTER, @@ -194,12 +195,11 @@ ar5212SetRxFilter(struct ath_hal *ah, ui OS_REG_READ(ah, AR_RXCFG) &~ AR_RXCFG_ZLFDMA); } if (AH_PRIVATE(ah)->ah_caps.halBssidMatchSupport) { - uint32_t miscbits = OS_REG_READ(ah, AR_MISC_MODE); if (bits & HAL_RX_FILTER_BSSID) - miscbits |= AR_MISC_MODE_BSSID_MATCH_FORCE; + ahp->ah_miscMode |= AR_MISC_MODE_BSSID_MATCH_FORCE; else - miscbits &= ~AR_MISC_MODE_BSSID_MATCH_FORCE; - OS_REG_WRITE(ah, AR_MISC_MODE, miscbits); + ahp->ah_miscMode &= ~AR_MISC_MODE_BSSID_MATCH_FORCE; + OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode); } } From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 19:24:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3D3C1065675; Tue, 21 Jul 2009 19:24:53 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A244A8FC21; Tue, 21 Jul 2009 19:24:53 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LJOrOC019890; Tue, 21 Jul 2009 19:24:53 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LJOr1g019888; Tue, 21 Jul 2009 19:24:53 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907211924.n6LJOr1g019888@svn.freebsd.org> From: Sam Leffler Date: Tue, 21 Jul 2009 19:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195810 - head/sys/modules/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 19:24:54 -0000 Author: sam Date: Tue Jul 21 19:24:53 2009 New Revision: 195810 URL: http://svn.freebsd.org/changeset/base/195810 Log: correct setup of opt_ddb.h Submitted by: jkim Approved by: re (kib) Modified: head/sys/modules/wlan/Makefile Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Tue Jul 21 19:23:34 2009 (r195809) +++ head/sys/modules/wlan/Makefile Tue Jul 21 19:24:53 2009 (r195810) @@ -25,7 +25,7 @@ opt_ipx.h: echo "#define IPX 1" > ${.TARGET} # override to get ddb support? opt_ddb.h: - echo "#define DDB 0" > ${.TARGET} + :> ${.TARGET} .endif .include From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 19:25:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7BD01065673; Tue, 21 Jul 2009 19:25:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BE888FC2A; Tue, 21 Jul 2009 19:25:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LJPPCs019946; Tue, 21 Jul 2009 19:25:25 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LJPPgw019944; Tue, 21 Jul 2009 19:25:25 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907211925.n6LJPPgw019944@svn.freebsd.org> From: Sam Leffler Date: Tue, 21 Jul 2009 19:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195811 - head/tools/tools/net80211/wlanstats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 19:25:26 -0000 Author: sam Date: Tue Jul 21 19:25:25 2009 New Revision: 195811 URL: http://svn.freebsd.org/changeset/base/195811 Log: update for recent mesh additions Approved by: re (kib) Modified: head/tools/tools/net80211/wlanstats/wlanstats.c Modified: head/tools/tools/net80211/wlanstats/wlanstats.c ============================================================================== --- head/tools/tools/net80211/wlanstats/wlanstats.c Tue Jul 21 19:24:53 2009 (r195810) +++ head/tools/tools/net80211/wlanstats/wlanstats.c Tue Jul 21 19:25:25 2009 (r195811) @@ -342,7 +342,15 @@ static const struct fmt wlanstats[] = { { 4, "hwmp_rootreqs", "hwmp_rootreqs", "root PREQ frames sent" }, #define S_HWMP_ROOTANN AFTER(S_HWMP_ROOTREQS) { 4, "hwmp_rootann", "hwmp_rootann", "root RANN frames received" }, -#define S_INPUT AFTER(S_HWMP_ROOTANN) +#define S_MESH_BADAE AFTER(S_HWMP_ROOTANN) + { 4, "mesh_badae", "mesh_badae", "frame discarded for bad AddressExtension (AE)" }, +#define S_MESH_RTADDFAILED AFTER(S_MESH_BADAE) + { 4, "mesh_rtadd", "mesh_rtadd", "mesh route add failed" }, +#define S_MESH_NOTPROXY AFTER(S_MESH_RTADDFAILED) + { 8, "mesh_notproxy", "mesh_notproxy","frame discarded because station not acting as a proxy" }, +#define S_RX_BADALIGN AFTER(S_MESH_NOTPROXY) + { 4, "rx_badalign", "rx_badalign","frame discarded because payload re-alignment failed" }, +#define S_INPUT AFTER(S_RX_BADALIGN) { 8, "input", "input", "total data frames received" }, #define S_RX_UCAST AFTER(S_INPUT) { 8, "rx_ucast", "rx_ucast", "unicast data frames received" }, @@ -796,6 +804,10 @@ wlan_get_curstat(struct statfoo *sf, int case S_HWMP_WRONGSEQ: STAT(hwmp_wrongseq); case S_HWMP_ROOTREQS: STAT(hwmp_rootreqs); case S_HWMP_ROOTANN: STAT(hwmp_rootrann); + case S_MESH_BADAE: STAT(mesh_badae); + case S_MESH_RTADDFAILED:STAT(mesh_rtaddfailed); + case S_MESH_NOTPROXY: STAT(mesh_notproxy); + case S_RX_BADALIGN: STAT(rx_badalign); case S_INPUT: NSTAT(rx_data); case S_OUTPUT: NSTAT(tx_data); case S_RX_UCAST: NSTAT(rx_ucast); @@ -950,6 +962,10 @@ wlan_get_totstat(struct statfoo *sf, int case S_HWMP_WRONGSEQ: STAT(hwmp_wrongseq); case S_HWMP_ROOTREQS: STAT(hwmp_rootreqs); case S_HWMP_ROOTANN: STAT(hwmp_rootrann); + case S_MESH_BADAE: STAT(mesh_badae); + case S_MESH_RTADDFAILED:STAT(mesh_rtaddfailed); + case S_MESH_NOTPROXY: STAT(mesh_notproxy); + case S_RX_BADALIGN: STAT(rx_badalign); case S_INPUT: NSTAT(rx_data); case S_OUTPUT: NSTAT(tx_data); case S_RX_UCAST: NSTAT(rx_ucast); From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 19:36:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FEE61065673; Tue, 21 Jul 2009 19:36:33 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D59448FC1C; Tue, 21 Jul 2009 19:36:32 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LJaWb3020197; Tue, 21 Jul 2009 19:36:32 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LJaWFF020194; Tue, 21 Jul 2009 19:36:32 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907211936.n6LJaWFF020194@svn.freebsd.org> From: Sam Leffler Date: Tue, 21 Jul 2009 19:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195812 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 19:36:33 -0000 Author: sam Date: Tue Jul 21 19:36:32 2009 New Revision: 195812 URL: http://svn.freebsd.org/changeset/base/195812 Log: Correct handling of keys that already have a hardware/device key index: this was broken in r183248 when the check of wk_keyix was replaced by a check of IEEE80211_KEY_DEVKEY (because the flag was clobbered). Define IEEE80211_KEY_DEVICE to specify flags that are owned by net80211/driver and use this to preserve IEEE80211_KEY_DEVKEY so we don't ask the driver for another key index when we already have one. Testing by: Daniel Thiele, Wes Morgan Reviewed by: rpaulo Approved by: re (kib) Modified: head/sys/net80211/ieee80211_crypto.c head/sys/net80211/ieee80211_crypto.h Modified: head/sys/net80211/ieee80211_crypto.c ============================================================================== --- head/sys/net80211/ieee80211_crypto.c Tue Jul 21 19:25:25 2009 (r195811) +++ head/sys/net80211/ieee80211_crypto.c Tue Jul 21 19:36:32 2009 (r195812) @@ -244,11 +244,13 @@ static const char *cipher_modnames[IEEE8 [IEEE80211_CIPHER_NONE] = "wlan_none", }; +/* NB: there must be no overlap between user-supplied and device-owned flags */ +CTASSERT((IEEE80211_KEY_COMMON & IEEE80211_KEY_DEVICE) == 0); + /* * Establish a relationship between the specified key and cipher * and, if necessary, allocate a hardware index from the driver. - * Note that when a fixed key index is required it must be specified - * and we blindly assign it w/o consulting the driver (XXX). + * Note that when a fixed key index is required it must be specified. * * This must be the first call applied to a key; all the other key * routines assume wk_cipher is setup. @@ -309,6 +311,8 @@ ieee80211_crypto_newkey(struct ieee80211 oflags = key->wk_flags; flags &= IEEE80211_KEY_COMMON; + /* NB: preserve device attributes */ + flags |= (oflags & IEEE80211_KEY_DEVICE); /* * If the hardware does not support the cipher then * fallback to a host-based implementation. @@ -359,10 +363,6 @@ ieee80211_crypto_newkey(struct ieee80211 key->wk_cipher = cip; /* XXX refcnt? */ key->wk_private = keyctx; } - /* - * Commit to requested usage so driver can see the flags. - */ - key->wk_flags = flags; /* * Ask the driver for a key index if we don't have one. Modified: head/sys/net80211/ieee80211_crypto.h ============================================================================== --- head/sys/net80211/ieee80211_crypto.h Tue Jul 21 19:25:25 2009 (r195811) +++ head/sys/net80211/ieee80211_crypto.h Tue Jul 21 19:36:32 2009 (r195812) @@ -99,6 +99,8 @@ struct ieee80211_key { }; #define IEEE80211_KEY_COMMON /* common flags passed in by apps */\ (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP) +#define IEEE80211_KEY_DEVICE /* flags owned by device driver */\ + (IEEE80211_KEY_DEVKEY|IEEE80211_KEY_CIPHER0|IEEE80211_KEY_CIPHER1) #define IEEE80211_KEY_SWCRYPT \ (IEEE80211_KEY_SWENCRYPT | IEEE80211_KEY_SWDECRYPT) From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 19:38:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11EF41065672; Tue, 21 Jul 2009 19:38:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9F3F8FC08; Tue, 21 Jul 2009 19:38:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LJcMZs020264; Tue, 21 Jul 2009 19:38:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LJcMvW020260; Tue, 21 Jul 2009 19:38:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907211938.n6LJcMvW020260@svn.freebsd.org> From: Sam Leffler Date: Tue, 21 Jul 2009 19:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195813 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 19:38:23 -0000 Author: sam Date: Tue Jul 21 19:38:22 2009 New Revision: 195813 URL: http://svn.freebsd.org/changeset/base/195813 Log: store mesh timers as ticks and sysctls for changing the defaults Reviewed by: rpaulo Approved by: re (kib) Modified: head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Tue Jul 21 19:36:32 2009 (r195812) +++ head/sys/net80211/ieee80211_hwmp.c Tue Jul 21 19:38:22 2009 (r195813) @@ -116,24 +116,8 @@ static struct ieee80211_node * const uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); static void hwmp_peerdown(struct ieee80211_node *); -static int ieee80211_hwmp_targetonly = 0; -static int ieee80211_hwmp_replyforward = 1; -static const int ieee80211_hwmp_maxprepretries = 3; -static const struct timeval ieee80211_hwmp_maxhopstime = { 0, 500000 }; -static const struct timeval ieee80211_hwmp_preqminint = { 0, 100000 }; -static const struct timeval ieee80211_hwmp_perrminint = { 0, 100000 }; -static const struct timeval ieee80211_hwmp_roottimeout = { 5, 0 }; -static const struct timeval ieee80211_hwmp_pathtimeout = { 5, 0 }; -static const struct timeval ieee80211_hwmp_pathtoroottimeout = { 5, 0 }; -static const struct timeval ieee80211_hwmp_rootint = { 2, 0 }; -static const struct timeval ieee80211_hwmp_rannint = { 1, 0 }; -static const struct timeval ieee80211_hwmp_pathmaintenanceint = { 2, 0 }; -static const struct timeval ieee80211_hwmp_confirmint = { 2, 0 }; - -#define timeval2msecs(tv) (tv.tv_sec * 1000 + tv.tv_usec / 1000) - -#define HWMP_ROOTMODEINT msecs_to_ticks(timeval2msecs(ieee80211_hwmp_rootint)) -#define HWMP_RANNMODEINT msecs_to_ticks(timeval2msecs(ieee80211_hwmp_rannint)) +static struct timeval ieee80211_hwmp_preqminint = { 0, 100000 }; +static struct timeval ieee80211_hwmp_perrminint = { 0, 100000 }; /* unalligned little endian access */ #define LE_WRITE_2(p, v) do { \ @@ -176,10 +160,28 @@ struct ieee80211_hwmp_state { SYSCTL_NODE(_net_wlan, OID_AUTO, hwmp, CTLFLAG_RD, 0, "IEEE 802.11s HWMP parameters"); +static int ieee80211_hwmp_targetonly = 0; SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, targetonly, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_hwmp_targetonly, 0, "Set TO bit on generated PREQs"); +static int ieee80211_hwmp_replyforward = 1; SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, replyforward, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_hwmp_replyforward, 0, "Set RF bit on generated PREQs"); +static int ieee80211_hwmp_pathtimeout = -1; +SYSCTL_PROC(_net_wlan_hwmp, OID_AUTO, pathlifetime, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_hwmp_pathtimeout, 0, ieee80211_sysctl_msecs_ticks, "I", + "path entry lifetime (ms)"); +static int ieee80211_hwmp_roottimeout = -1; +SYSCTL_PROC(_net_wlan_hwmp, OID_AUTO, roottimeout, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_hwmp_roottimeout, 0, ieee80211_sysctl_msecs_ticks, "I", + "root PREQ timeout (ms)"); +static int ieee80211_hwmp_rootint = -1; +SYSCTL_PROC(_net_wlan_hwmp, OID_AUTO, rootint, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_hwmp_rootint, 0, ieee80211_sysctl_msecs_ticks, "I", + "root interval (ms)"); +static int ieee80211_hwmp_rannint = -1; +SYSCTL_PROC(_net_wlan_hwmp, OID_AUTO, rannint, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_hwmp_rannint, 0, ieee80211_sysctl_msecs_ticks, "I", + "root announcement interval (ms)"); #define IEEE80211_HWMP_DEFAULT_MAXHOPS 31 @@ -188,7 +190,7 @@ static ieee80211_recv_action_func hwmp_r static ieee80211_recv_action_func hwmp_recv_action_meshpath_perr; static ieee80211_recv_action_func hwmp_recv_action_meshpath_rann; -static const struct ieee80211_mesh_proto_path mesh_proto_hwmp = { +static struct ieee80211_mesh_proto_path mesh_proto_hwmp = { .mpp_descr = "HWMP", .mpp_ie = IEEE80211_MESHCONF_HWMP, .mpp_discover = hwmp_discover, @@ -197,14 +199,20 @@ static const struct ieee80211_mesh_proto .mpp_vdetach = hwmp_vdetach, .mpp_newstate = hwmp_newstate, .mpp_privlen = sizeof(struct ieee80211_hwmp_route), - /* ieee80211_hwmp_pathtimeout */ - .mpp_inact = { 5, 0 }, }; +SYSCTL_PROC(_net_wlan_hwmp, OID_AUTO, inact, CTLTYPE_INT | CTLFLAG_RW, + &mesh_proto_hwmp.mpp_inact, 0, ieee80211_sysctl_msecs_ticks, "I", + "mesh route inactivity timeout (ms)"); static void ieee80211_hwmp_init(void) { + ieee80211_hwmp_pathtimeout = msecs_to_ticks(5*1000); + ieee80211_hwmp_roottimeout = msecs_to_ticks(5*1000); + ieee80211_hwmp_rootint = msecs_to_ticks(2*1000); + ieee80211_hwmp_rannint = msecs_to_ticks(1*1000); + /* * Register action frame handlers. */ @@ -217,6 +225,9 @@ ieee80211_hwmp_init(void) ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH, IEEE80211_ACTION_MESHPATH_RANN, hwmp_recv_action_meshpath_rann); + /* NB: default is 5 secs per spec */ + mesh_proto_hwmp.mpp_inact = msecs_to_ticks(5*1000); + /* * Register HWMP. */ @@ -617,11 +628,11 @@ hwmp_rootmode_setup(struct ieee80211vap break; case IEEE80211_HWMP_ROOTMODE_NORMAL: case IEEE80211_HWMP_ROOTMODE_PROACTIVE: - callout_reset(&hs->hs_roottimer, HWMP_ROOTMODEINT, + callout_reset(&hs->hs_roottimer, ieee80211_hwmp_rootint, hwmp_rootmode_cb, vap); break; case IEEE80211_HWMP_ROOTMODE_RANN: - callout_reset(&hs->hs_roottimer, HWMP_RANNMODEINT, + callout_reset(&hs->hs_roottimer, ieee80211_hwmp_rannint, hwmp_rootmode_rann_cb, vap); break; } @@ -654,7 +665,7 @@ hwmp_rootmode_cb(void *arg) preq.preq_id = ++hs->hs_preqid; IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); preq.preq_origseq = ++hs->hs_seq; - preq.preq_lifetime = timeval2msecs(ieee80211_hwmp_roottimeout); + preq.preq_lifetime = ticks_to_msecs(ieee80211_hwmp_roottimeout); preq.preq_metric = IEEE80211_MESHLMETRIC_INITIALVAL; preq.preq_tcount = 1; IEEE80211_ADDR_COPY(PREQ_TADDR(0), broadcastaddr); @@ -1297,7 +1308,7 @@ hwmp_discover(struct ieee80211vap *vap, } rt->rt_metric = IEEE80211_MESHLMETRIC_INITIALVAL; rt->rt_lifetime = - timeval2msecs(ieee80211_hwmp_pathtimeout); + ticks_to_msecs(ieee80211_hwmp_pathtimeout); /* XXX check preq retries */ sendpreq = 1; IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, dest, Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Tue Jul 21 19:36:32 2009 (r195812) +++ head/sys/net80211/ieee80211_mesh.c Tue Jul 21 19:38:22 2009 (r195813) @@ -180,7 +180,7 @@ mesh_rt_add_locked(struct ieee80211_mesh if (rt != NULL) { IEEE80211_ADDR_COPY(rt->rt_dest, dest); rt->rt_priv = (void *)ALIGN(&rt[1]); - getmicrouptime(&rt->rt_crtime); + rt->rt_crtime = ticks; TAILQ_INSERT_TAIL(&ms->ms_routes, rt, rt_next); } return rt; @@ -310,17 +310,13 @@ mesh_rt_flush_invalid(struct ieee80211va { struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt, *next; - struct timeval tv, delta; if (ms == NULL) return; - getmicrouptime(&tv); MESH_RT_LOCK(ms); TAILQ_FOREACH_SAFE(rt, &ms->ms_routes, rt_next, next) { - delta = tv; - timevalsub(&delta, &rt->rt_crtime); if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 && - timevalcmp(&delta, &ms->ms_ppath->mpp_inact, >=)) + ticks - rt->rt_crtime >= ms->ms_ppath->mpp_inact) mesh_rt_del(ms, rt); } MESH_RT_UNLOCK(ms); @@ -676,9 +672,7 @@ mesh_newstate(struct ieee80211vap *vap, break; } ieee80211_node_authorize(vap->iv_bss); - callout_reset(&ms->ms_cleantimer, - msecs_to_ticks(ms->ms_ppath->mpp_inact.tv_sec * 1000 + - ms->ms_ppath->mpp_inact.tv_usec / 1000), + callout_reset(&ms->ms_cleantimer, ms->ms_ppath->mpp_inact, mesh_rt_cleanup_cb, vap); break; default: @@ -696,9 +690,7 @@ mesh_rt_cleanup_cb(void *arg) struct ieee80211_mesh_state *ms = vap->iv_mesh; mesh_rt_flush_invalid(vap); - callout_reset(&ms->ms_cleantimer, - msecs_to_ticks(ms->ms_ppath->mpp_inact.tv_sec * 1000 + - ms->ms_ppath->mpp_inact.tv_usec / 1000), + callout_reset(&ms->ms_cleantimer, ms->ms_ppath->mpp_inact, mesh_rt_cleanup_cb, vap); } Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Tue Jul 21 19:36:32 2009 (r195812) +++ head/sys/net80211/ieee80211_mesh.h Tue Jul 21 19:38:22 2009 (r195813) @@ -376,7 +376,7 @@ struct ieee80211_meshcntl_ae11 { MALLOC_DECLARE(M_80211_MESH_RT); struct ieee80211_mesh_route { TAILQ_ENTRY(ieee80211_mesh_route) rt_next; - struct timeval rt_crtime; /* creation time */ + int rt_crtime; /* creation time */ uint8_t rt_dest[IEEE80211_ADDR_LEN]; uint8_t rt_nexthop[IEEE80211_ADDR_LEN]; uint32_t rt_metric; /* path metric */ @@ -409,7 +409,8 @@ struct ieee80211_mesh_proto_path { enum ieee80211_state, int); const size_t mpp_privlen; /* size required in the routing table for private data */ - const struct timeval mpp_inact; /* inact. timeout for invalid routes */ + int mpp_inact; /* inact. timeout for invalid routes + (ticks) */ }; /* From owner-svn-src-all@FreeBSD.ORG Tue Jul 21 21:58:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9F65106566C; Tue, 21 Jul 2009 21:58:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7DC38FC27; Tue, 21 Jul 2009 21:58:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6LLwt6W023172; Tue, 21 Jul 2009 21:58:55 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6LLwtKG023171; Tue, 21 Jul 2009 21:58:55 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200907212158.n6LLwtKG023171@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 21 Jul 2009 21:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195814 - in head/sys: kern net netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 21:58:56 -0000 Author: bz Date: Tue Jul 21 21:58:55 2009 New Revision: 195814 URL: http://svn.freebsd.org/changeset/base/195814 Log: sysctl_msec_to_ticks is used with both virtualized and non-vrtiualized sysctls so we cannot used one common function. Add a macro to convert the arg1 in the virtualized case to vnet.h to not expose the maths to all over the code. Add a wrapper for the single virtualized call, properly handling arg1 and call the default implementation from there. Convert the two over places to use the new macro. Reviewed by: rwatson Approved by: re (kib) Modified: head/sys/kern/kern_sysctl.c head/sys/net/vnet.h head/sys/netinet/tcp_subr.c head/sys/netinet6/in6_proto.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Tue Jul 21 19:38:22 2009 (r195813) +++ head/sys/kern/kern_sysctl.c Tue Jul 21 21:58:55 2009 (r195814) @@ -948,11 +948,6 @@ sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS { int error, s, tt; -#ifdef VIMAGE - if (arg1 != NULL) - arg1 = (void *)(TD_TO_VNET(req->td)->vnet_data_base + - (uintptr_t)arg1); -#endif tt = *(int *)arg1; s = (int)((int64_t)tt * 1000 / hz); Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Tue Jul 21 19:38:22 2009 (r195813) +++ head/sys/net/vnet.h Tue Jul 21 21:58:55 2009 (r195814) @@ -101,6 +101,11 @@ int vnet_sysctl_handle_uint(SYSCTL_HANDL #define SYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \ ptr, val, vnet_sysctl_handle_uint, "IU", descr) +#define VNET_SYSCTL_ARG(req, arg1) do { \ + if (arg1 != NULL) \ + arg1 = (void *)(TD_TO_VNET((req)->td)->vnet_data_base + \ + (uintptr_t)(arg1)); \ +} while (0) #endif /* SYSCTL_OID */ /* @@ -141,6 +146,7 @@ void vnet_data_destroy(struct vnet *vne SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) #define SYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) +#define VNET_SYSCTL_ARG(req, arg1) #endif /* SYSCTL_OID */ /* Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Jul 21 19:38:22 2009 (r195813) +++ head/sys/netinet/tcp_subr.c Tue Jul 21 21:58:55 2009 (r195814) @@ -178,6 +178,14 @@ SYSCTL_VNET_PROC(_net_inet_tcp, TCPCTL_V "Default TCP Maximum Segment Size for IPv6"); #endif +static int +vnet_sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS) +{ + + VNET_SYSCTL_ARG(req, arg1); + return (sysctl_msec_to_ticks(oidp, arg1, arg2, req)); +} + /* * Minimum MSS we accept and use. This prevents DoS attacks where * we are forced to a ridiculous low MSS like 20 and send hundreds @@ -236,7 +244,7 @@ SYSCTL_INT(_net_inet_tcp_inflight, OID_A SYSCTL_VNET_PROC(_net_inet_tcp_inflight, OID_AUTO, rttthresh, CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(tcp_inflight_rttthresh), 0, - sysctl_msec_to_ticks, "I", + vnet_sysctl_msec_to_ticks, "I", "RTT threshold below which inflight will deactivate itself"); SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, min, CTLFLAG_RW, Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Tue Jul 21 19:38:22 2009 (r195813) +++ head/sys/netinet6/in6_proto.c Tue Jul 21 21:58:55 2009 (r195814) @@ -452,11 +452,7 @@ sysctl_ip6_temppltime(SYSCTL_HANDLER_ARG int error = 0; int old; -#ifdef VIMAGE - if (arg1 != NULL) - arg1 = (void *)(TD_TO_VNET(req->td)->vnet_data_base + - (uintptr_t)arg1); -#endif + VNET_SYSCTL_ARG(req, arg1); error = SYSCTL_OUT(req, arg1, sizeof(int)); if (error || !req->newptr) @@ -477,11 +473,7 @@ sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARG int error = 0; int old; -#ifdef VIMAGE - if (arg1 != NULL) - arg1 = (void *)(TD_TO_VNET(req->td)->vnet_data_base + - (uintptr_t)arg1); -#endif + VNET_SYSCTL_ARG(req, arg1); error = SYSCTL_OUT(req, arg1, sizeof(int)); if (error || !req->newptr) From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 01:07:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CECA1065673; Wed, 22 Jul 2009 01:07:12 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AB678FC08; Wed, 22 Jul 2009 01:07:12 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6M17BtU026836; Wed, 22 Jul 2009 01:07:11 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6M17BCA026834; Wed, 22 Jul 2009 01:07:11 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907220107.n6M17BCA026834@svn.freebsd.org> From: Bruce M Simpson Date: Wed, 22 Jul 2009 01:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195815 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 01:07:12 -0000 Author: bms Date: Wed Jul 22 01:07:11 2009 New Revision: 195815 URL: http://svn.freebsd.org/changeset/base/195815 Log: Output DWARF debug information for global 'using' declarations, instead of just blowing up. A very similar change to this exists which is GPLv3 licensed, this is my own change. This problem was triggered by running the Boost regression tests. See also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31899 Reviewed by: luigi Approved by: re (kib) Modified: head/contrib/gcc/dwarf2out.c Modified: head/contrib/gcc/dwarf2out.c ============================================================================== --- head/contrib/gcc/dwarf2out.c Tue Jul 21 21:58:55 2009 (r195814) +++ head/contrib/gcc/dwarf2out.c Wed Jul 22 01:07:11 2009 (r195815) @@ -10007,7 +10007,7 @@ reference_to_unused (tree * tp, int * wa return NULL_TREE; else if (!cgraph_global_info_ready && (TREE_CODE (*tp) == VAR_DECL || TREE_CODE (*tp) == FUNCTION_DECL)) - gcc_unreachable (); + return *tp; else if (DECL_P (*tp) && TREE_CODE (*tp) == VAR_DECL) { struct cgraph_varpool_node *node = cgraph_varpool_node (*tp); From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 01:07:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B402106566B; Wed, 22 Jul 2009 01:07:50 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 487948FC1C; Wed, 22 Jul 2009 01:07:50 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6M17ok6026880; Wed, 22 Jul 2009 01:07:50 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6M17ofL026878; Wed, 22 Jul 2009 01:07:50 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907220107.n6M17ofL026878@svn.freebsd.org> From: Bruce M Simpson Date: Wed, 22 Jul 2009 01:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195816 - stable/7/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 01:07:51 -0000 Author: bms Date: Wed Jul 22 01:07:49 2009 New Revision: 195816 URL: http://svn.freebsd.org/changeset/base/195816 Log: Output DWARF debug information for global 'using' declarations, instead of just blowing up. A very similar change to this exists which is GPLv3 licensed, this is my own change. This problem was triggered by running the Boost regression tests. See also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31899 Reviewed by: luigi Modified: stable/7/contrib/gcc/dwarf2out.c Modified: stable/7/contrib/gcc/dwarf2out.c ============================================================================== --- stable/7/contrib/gcc/dwarf2out.c Wed Jul 22 01:07:11 2009 (r195815) +++ stable/7/contrib/gcc/dwarf2out.c Wed Jul 22 01:07:49 2009 (r195816) @@ -10007,7 +10007,7 @@ reference_to_unused (tree * tp, int * wa return NULL_TREE; else if (!cgraph_global_info_ready && (TREE_CODE (*tp) == VAR_DECL || TREE_CODE (*tp) == FUNCTION_DECL)) - gcc_unreachable (); + return *tp; else if (DECL_P (*tp) && TREE_CODE (*tp) == VAR_DECL) { struct cgraph_varpool_node *node = cgraph_varpool_node (*tp); From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 03:50:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34167106566C; Wed, 22 Jul 2009 03:50:55 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07A618FC12; Wed, 22 Jul 2009 03:50:55 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6M3osrO030204; Wed, 22 Jul 2009 03:50:54 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6M3osaj030202; Wed, 22 Jul 2009 03:50:54 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200907220350.n6M3osaj030202@svn.freebsd.org> From: Colin Percival Date: Wed, 22 Jul 2009 03:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 03:50:55 -0000 Author: cperciva Date: Wed Jul 22 03:50:54 2009 New Revision: 195817 URL: http://svn.freebsd.org/changeset/base/195817 Log: Remove the "dedicated disk mode" partitioning option from sysinstall, in both the disk partitioning screen (the 'F' key) and via install.cfg (the VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x due to libdisk and geom generating different partition names; this commit merely acts to help steer users away from the breakage. Submitted by: randi Approved by: re (kensmith) Modified: head/usr.sbin/sysinstall/disks.c Modified: head/usr.sbin/sysinstall/disks.c ============================================================================== --- head/usr.sbin/sysinstall/disks.c Wed Jul 22 01:07:49 2009 (r195816) +++ head/usr.sbin/sysinstall/disks.c Wed Jul 22 03:50:54 2009 (r195817) @@ -205,7 +205,7 @@ static void print_command_summary(void) { mvprintw(14, 0, "The following commands are supported (in upper or lower case):"); - mvprintw(16, 0, "A = Use Entire Disk G = set Drive Geometry C = Create Slice F = `DD' mode"); + mvprintw(16, 0, "A = Use Entire Disk G = set Drive Geometry C = Create Slice"); mvprintw(17, 0, "D = Delete Slice Z = Toggle Size Units S = Set Bootable | = Wizard m."); mvprintw(18, 0, "T = Change Type U = Undo All Changes Q = Finish"); if (!RunningAsInit) @@ -423,24 +423,10 @@ diskPartition(Device *dev) break; case 'A': - case 'F': /* Undocumented magic Dangerously Dedicated mode */ #if !defined(__i386__) && !defined(__amd64__) rv = 1; #else /* The rest is only relevant on x86 */ - cp = variable_get(VAR_DEDICATE_DISK); - if (cp && !strcasecmp(cp, "always")) - rv = 1; - else if (toupper(key) == 'A') - rv = 0; - else { - rv = msgYesNo("Do you want to do this with a true partition entry\n" - "so as to remain cooperative with any future possible\n" - "operating systems on the drive(s)?\n" - "(See also the section about ``dangerously dedicated''\n" - "disks in the FreeBSD FAQ.)"); - if (rv == -1) - rv = 0; - } + rv = 0; #endif All_FreeBSD(d, rv); variable_set2(DISK_PARTITIONED, "yes", 0); From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 08:06:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE8DA106564A; Wed, 22 Jul 2009 08:06:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from pin.if.uz.zgora.pl (pin.if.uz.zgora.pl [212.109.128.251]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8D38FC15; Wed, 22 Jul 2009 08:06:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: by pin.if.uz.zgora.pl (Postfix, from userid 1001) id 3D1EF39BA2; Wed, 22 Jul 2009 10:08:45 +0200 (CEST) Date: Wed, 22 Jul 2009 10:08:45 +0200 From: Edward Tomasz Napierala To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20090722080845.GA32501@pin.if.uz.zgora.pl> References: <200907201916.n6KJGhEl086253@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <200907201916.n6KJGhEl086253@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Subject: Re: svn commit: r195785 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 08:06:48 -0000 On 0720T1916, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Jul 20 19:16:42 2009 > New Revision: 195785 > URL: http://svn.freebsd.org/changeset/base/195785 > > Log: > Fix permission handling for extended attributes in ZFS. Without > this change, ZFS uses SunOS Alternate Data Streams semantics - each > EA has its own permissions, which are set at EA creation time > and - unlike SunOS - invisible to the user and impossible to change. > From the user point of view, it's just broken: sometimes access > is granted when it shouldn't be, sometimes it's denied when > it shouldn't be. > > This patch makes it behave just like UFS, i.e. depend on current > file permissions. Also, it fixes returned error codes (ENOATTR > instead of ENOENT) and makes listextattr(2) return 0 instead > of EPERM where there is no EA directory (i.e. the file never had > any EA). > > Reviewed by: pjd (idea, not actual code) > Approved by: re (kib) Also: Reviewed by: kmacy -- If you cut off my head, what would I say? Me and my head, or me and my body? From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 08:42:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71AEE1065687; Wed, 22 Jul 2009 08:42:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 49E348FC08; Wed, 22 Jul 2009 08:42:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 249383255; Wed, 22 Jul 2009 11:42:29 +0300 Message-ID: <4A66D0F4.4030108@FreeBSD.org> Date: Wed, 22 Jul 2009 11:42:28 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Colin Percival References: <200907220350.n6M3osaj030202@svn.freebsd.org> In-Reply-To: <200907220350.n6M3osaj030202@svn.freebsd.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 08:42:35 -0000 Colin Percival wrote: > Author: cperciva > Date: Wed Jul 22 03:50:54 2009 > New Revision: 195817 > URL: http://svn.freebsd.org/changeset/base/195817 > > Log: > Remove the "dedicated disk mode" partitioning option from sysinstall, in > both the disk partitioning screen (the 'F' key) and via install.cfg (the > VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x > due to libdisk and geom generating different partition names; this commit > merely acts to help steer users away from the breakage. > > Submitted by: randi > Approved by: re (kensmith) > > Modified: > head/usr.sbin/sysinstall/disks.c Is there any other way to not align FS block to the ugly legacy 63 sectors per track boundary with sysinstall now? I think RAIDs won't be happy. May be it would be better to fix it? -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 08:51:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF3161065691; Wed, 22 Jul 2009 08:51:13 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 51F358FC19; Wed, 22 Jul 2009 08:51:12 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id n6M8pBMa029697; Wed, 22 Jul 2009 12:51:11 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Wed, 22 Jul 2009 12:51:11 +0400 (MSD) From: Dmitry Morozovsky To: Colin Percival In-Reply-To: <200907220350.n6M3osaj030202@svn.freebsd.org> Message-ID: References: <200907220350.n6M3osaj030202@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (woozle.rinet.ru [0.0.0.0]); Wed, 22 Jul 2009 12:51:11 +0400 (MSD) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 08:51:14 -0000 On Wed, 22 Jul 2009, Colin Percival wrote: CP> Modified: head/usr.sbin/sysinstall/disks.c CP> ============================================================================== CP> --- head/usr.sbin/sysinstall/disks.c Wed Jul 22 01:07:49 2009 (r195816) CP> +++ head/usr.sbin/sysinstall/disks.c Wed Jul 22 03:50:54 2009 (r195817) CP> @@ -205,7 +205,7 @@ static void CP> print_command_summary(void) CP> { CP> mvprintw(14, 0, "The following commands are supported (in upper or lower case):"); CP> - mvprintw(16, 0, "A = Use Entire Disk G = set Drive Geometry C = Create Slice F = `DD' mode"); CP> + mvprintw(16, 0, "A = Use Entire Disk G = set Drive Geometry C = Create Slice"); CP> mvprintw(17, 0, "D = Delete Slice Z = Toggle Size Units S = Set Bootable | = Wizard m."); CP> mvprintw(18, 0, "T = Change Type U = Undo All Changes Q = Finish"); CP> if (!RunningAsInit) While you're here, don't you think it's time to rename Wizard mode to Expert mode to not confuse users too much? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 08:58:40 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59FE11065672; Wed, 22 Jul 2009 08:58:40 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 0B9338FC13; Wed, 22 Jul 2009 08:58:39 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n6M8wau3002126; Wed, 22 Jul 2009 02:58:36 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A66D4BC.3030307@samsco.org> Date: Wed, 22 Jul 2009 02:58:36 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Alexander Motin References: <200907220350.n6M3osaj030202@svn.freebsd.org> <4A66D0F4.4030108@FreeBSD.org> In-Reply-To: <4A66D0F4.4030108@FreeBSD.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Colin Percival Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 08:58:40 -0000 Alexander Motin wrote: > Colin Percival wrote: >> Author: cperciva >> Date: Wed Jul 22 03:50:54 2009 >> New Revision: 195817 >> URL: http://svn.freebsd.org/changeset/base/195817 >> >> Log: >> Remove the "dedicated disk mode" partitioning option from sysinstall, in >> both the disk partitioning screen (the 'F' key) and via install.cfg (the >> VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x >> due to libdisk and geom generating different partition names; this commit >> merely acts to help steer users away from the breakage. >> >> Submitted by: randi >> Approved by: re (kensmith) >> >> Modified: >> head/usr.sbin/sysinstall/disks.c > > Is there any other way to not align FS block to the ugly legacy 63 > sectors per track boundary with sysinstall now? I think RAIDs won't be > happy. May be it would be better to fix it? > I typically tell people to align the first fdisk slice to sector 256 instead of 63. That covers most of the common RAID stripe sizes. I leave it up to someone with more courage than me to code that into sysinstall. Scott From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 09:21:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A22A1065675; Wed, 22 Jul 2009 09:21:50 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-gx0-f217.google.com (mail-gx0-f217.google.com [209.85.217.217]) by mx1.freebsd.org (Postfix) with ESMTP id 2616F8FC1B; Wed, 22 Jul 2009 09:21:49 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: by gxk17 with SMTP id 17so74905gxk.19 for ; Wed, 22 Jul 2009 02:21:49 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.100.108.2 with SMTP id g2mr877013anc.35.1248253063105; Wed, 22 Jul 2009 01:57:43 -0700 (PDT) In-Reply-To: <4A66D0F4.4030108@FreeBSD.org> References: <200907220350.n6M3osaj030202@svn.freebsd.org> <4A66D0F4.4030108@FreeBSD.org> From: Juli Mallett Date: Wed, 22 Jul 2009 01:57:23 -0700 X-Google-Sender-Auth: 7f46e3862d37f384 Message-ID: To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 09:21:51 -0000 On Wed, Jul 22, 2009 at 01:42, Alexander Motin wrote: > Colin Percival wrote: >> =A0 Remove the "dedicated disk mode" partitioning option from sysinstall= , in >> =A0 both the disk partitioning screen (the 'F' key) and via install.cfg = (the >> =A0 VAR_DEDICATED_DISK option). =A0This functionality is currently broke= n in 8.x >> =A0 due to libdisk and geom generating different partition names; this c= ommit >> =A0 merely acts to help steer users away from the breakage. > > Is there any other way to not align FS block to the ugly legacy 63 > sectors per track boundary with sysinstall now? I think RAIDs won't be > happy. May be it would be better to fix it? If you're interested in fixing this issue, you might want to look at the need for compatibility names so that existing DD installs aren't broken, and so DD installs work as-is without correcting libdisk's expectations about slice/partition names for DD disks, which is pretty invasive, too. Not breaking new installs by not letting users install broken systems is the absolute bare minimum approach, and given the late date and the lack of movement on the kernel side, I've been advocating for it for a while. See this message and others in the thread for some background: http://lists.freebsd.org/pipermail/freebsd-geom/2009-June/003567.html Juli. From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 10:13:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEE9F1065672; Wed, 22 Jul 2009 10:13:24 +0000 (UTC) (envelope-from artis.caune@gmail.com) Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by mx1.freebsd.org (Postfix) with ESMTP id F1E038FC19; Wed, 22 Jul 2009 10:13:23 +0000 (UTC) (envelope-from artis.caune@gmail.com) Received: by bwz19 with SMTP id 19so73903bwz.43 for ; Wed, 22 Jul 2009 03:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cNwb8aI090K7GEfmQAVUlFD0NGbUlq6idpz+b5v++iU=; b=fR6YohdTQ1ELmsuLe1p2bPnopI6vY3T+QjtQn9LGJUWgowvfdV5muQMhbKGNgwdZl6 CjV7K6EWrPsA072J8J644z5XzWgYbzFOg2X/nngS5F6IjfRVYOQpdkPg7tte9wflUBB9 ofI4L5i4FvCyvIgEwxVVR9/vrPIa8Tk2ycTCA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gknS09M4SLjm5tVeQO6y2GAqpzy4ZXaCSx5PE4fZ5FC2mqslXN+Cmik5LPJfGAPjy9 XHufsm23aQ/Ax/PzVZLKW+PmEffMjgtJBfnkraGMfNStetQWbEHDk+fX6mk23obuPn3X tQUJ5aK5mfem6aUQZr3/KWUH5XJ8/eOZUxLHY= MIME-Version: 1.0 Received: by 10.103.167.14 with SMTP id u14mr357849muo.38.1248256071751; Wed, 22 Jul 2009 02:47:51 -0700 (PDT) In-Reply-To: <200907201916.n6KJGhEl086253@svn.freebsd.org> References: <200907201916.n6KJGhEl086253@svn.freebsd.org> Date: Wed, 22 Jul 2009 12:47:51 +0300 Message-ID: <9e20d71e0907220247x3b8b75cdm59106eaadc1517fa@mail.gmail.com> From: Artis Caune To: Edward Tomasz Napierala Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195785 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 10:13:25 -0000 2009/7/20 Edward Tomasz Napierala : > Author: trasz > Date: Mon Jul 20 19:16:42 2009 > New Revision: 195785 > URL: http://svn.freebsd.org/changeset/base/195785 > > Log: > =C2=A0Fix permission handling for extended attributes in ZFS. =C2=A0Witho= ut > =C2=A0this change, ZFS uses SunOS Alternate Data Streams semantics - each > =C2=A0EA has its own permissions, which are set at EA creation time > =C2=A0and - unlike SunOS - invisible to the user and impossible to change= . > =C2=A0From the user point of view, it's just broken: sometimes access > =C2=A0is granted when it shouldn't be, sometimes it's denied when > =C2=A0it shouldn't be. > > =C2=A0This patch makes it behave just like UFS, i.e. depend on current > =C2=A0file permissions. =C2=A0Also, it fixes returned error codes (ENOATT= R > =C2=A0instead of ENOENT) and makes listextattr(2) return 0 instead > =C2=A0of EPERM where there is no EA directory (i.e. the file never had > =C2=A0any EA). I can not create archives from ZFS file system after this commit. # tar -c -f /dev/null -C /tmp ./ tar: Out of memory: Cannot allocate memory extattr_list_link(0x8010150a0,0x1,0x0,0x0,0x50f738,0x8e008) =3D -1098808089680 (0xffffff0029ef23b0) mmap(0x0,703594496,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) ERR#12 'Cannot allocate memory' tar: write(2,"tar: ",5) =3D 5 (0x5) Out of memorywrite(2,"Out of memory",13) =3D 13 (0xd) --=20 Artis Caune Everything should be made as simple as possible, but not simpler. From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 10:28:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 888C51065675; Wed, 22 Jul 2009 10:28:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 4817D8FC18; Wed, 22 Jul 2009 10:28:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 249397363; Wed, 22 Jul 2009 13:28:15 +0300 Message-ID: <4A66E9BE.2020603@FreeBSD.org> Date: Wed, 22 Jul 2009 13:28:14 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Juli Mallett References: <200907220350.n6M3osaj030202@svn.freebsd.org> <4A66D0F4.4030108@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 10:28:20 -0000 Juli Mallett wrote: > On Wed, Jul 22, 2009 at 01:42, Alexander Motin wrote: >> Colin Percival wrote: >>> Remove the "dedicated disk mode" partitioning option from sysinstall, in >>> both the disk partitioning screen (the 'F' key) and via install.cfg (the >>> VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x >>> due to libdisk and geom generating different partition names; this commit >>> merely acts to help steer users away from the breakage. >> Is there any other way to not align FS block to the ugly legacy 63 >> sectors per track boundary with sysinstall now? I think RAIDs won't be >> happy. May be it would be better to fix it? > > If you're interested in fixing this issue, you might want to look at > the need for compatibility names so that existing DD installs aren't > broken, and so DD installs work as-is without correcting libdisk's > expectations about slice/partition names for DD disks, which is pretty > invasive, too. Not breaking new installs by not letting users install > broken systems is the absolute bare minimum approach, and given the > late date and the lack of movement on the kernel side, I've been > advocating for it for a while. > > See this message and others in the thread for some background: > > http://lists.freebsd.org/pipermail/freebsd-geom/2009-June/003567.html Sorry, ENOTIME. I am not advocating DD mode, it is really a hack. Offset 0 is just an easiest choice to align FS. Instead, I would really like sysinstall to honor real disk geometry instead of fake one. GEOM has support for reporting disk stripe size/offset and some GEOM classes already provide them. But sysinstall - the main tool which could benefit from it - ignores it. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 11:34:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81CAC106564A; Wed, 22 Jul 2009 11:34:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 408F38FC14; Wed, 22 Jul 2009 11:34:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 249406272; Wed, 22 Jul 2009 14:33:58 +0300 Message-ID: <4A66F925.8000505@FreeBSD.org> Date: Wed, 22 Jul 2009 14:33:57 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Erik Trulsson References: <200907220350.n6M3osaj030202@svn.freebsd.org> <4A66D0F4.4030108@FreeBSD.org> <4A66E9BE.2020603@FreeBSD.org> <20090722111608.GA97528@owl.midgard.homeip.net> In-Reply-To: <20090722111608.GA97528@owl.midgard.homeip.net> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Juli Mallett , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 11:34:06 -0000 Erik Trulsson wrote: > On Wed, Jul 22, 2009 at 01:28:14PM +0300, Alexander Motin wrote: >> Juli Mallett wrote: >>> On Wed, Jul 22, 2009 at 01:42, Alexander Motin wrote: >>>> Colin Percival wrote: >>>>> Remove the "dedicated disk mode" partitioning option from sysinstall, in >>>>> both the disk partitioning screen (the 'F' key) and via install.cfg (the >>>>> VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x >>>>> due to libdisk and geom generating different partition names; this commit >>>>> merely acts to help steer users away from the breakage. >>>> Is there any other way to not align FS block to the ugly legacy 63 >>>> sectors per track boundary with sysinstall now? I think RAIDs won't be >>>> happy. May be it would be better to fix it? >>> If you're interested in fixing this issue, you might want to look at >>> the need for compatibility names so that existing DD installs aren't >>> broken, and so DD installs work as-is without correcting libdisk's >>> expectations about slice/partition names for DD disks, which is pretty >>> invasive, too. Not breaking new installs by not letting users install >>> broken systems is the absolute bare minimum approach, and given the >>> late date and the lack of movement on the kernel side, I've been >>> advocating for it for a while. >>> >>> See this message and others in the thread for some background: >>> >>> http://lists.freebsd.org/pipermail/freebsd-geom/2009-June/003567.html >> Sorry, ENOTIME. I am not advocating DD mode, it is really a hack. Offset >> 0 is just an easiest choice to align FS. Instead, I would really like >> sysinstall to honor real disk geometry instead of fake one. > > "real disk geometry" ? How would sysinstall find that? As I have said, GEOM is able to provide such info to user-level when provider reports it. > Keep in mind that any disk geometry reported by disks is completely fake > these days and is just an attempt to fit the total number of blocks into > the limitations of the PC BIOS. > > In short the whole notion of 'disk geometry' is mostly obsolete these days > and ought to be avoided as far as possible. You are right about regular HDDs, but I am speaking mostly about RAID geometry: stripe (native block) size and it's offset. geom_stripe provides that kind of information, and I believe most of hardware RAIDs could also do it. Also it could be used for different SSD/FLASH storages, which have media erase block of more then one sector. Proper FS alignment could reduce number of media erases. mmcsd(4) driver reports SD/MMC card's erase block size there. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 11:35:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 688E11065670 for ; Wed, 22 Jul 2009 11:35:02 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp03.sth.basefarm.net (ch-smtp03.sth.basefarm.net [80.76.149.214]) by mx1.freebsd.org (Postfix) with ESMTP id EC3598FC22 for ; Wed, 22 Jul 2009 11:35:01 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-255-48-78.bredband.comhem.se ([83.255.48.78]:50225 helo=falcon.midgard.homeip.net) by ch-smtp03.sth.basefarm.net with esmtp (Exim 4.69) (envelope-from ) id 1MTZnv-00076C-AC for svn-src-all@freebsd.org; Wed, 22 Jul 2009 13:16:13 +0200 Received: (qmail 83408 invoked from network); 22 Jul 2009 13:16:09 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 22 Jul 2009 13:16:09 +0200 Received: (qmail 97564 invoked by uid 1001); 22 Jul 2009 13:16:08 +0200 Date: Wed, 22 Jul 2009 13:16:08 +0200 From: Erik Trulsson To: Alexander Motin Message-ID: <20090722111608.GA97528@owl.midgard.homeip.net> References: <200907220350.n6M3osaj030202@svn.freebsd.org> <4A66D0F4.4030108@FreeBSD.org> <4A66E9BE.2020603@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A66E9BE.2020603@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: 83.255.48.78 X-Scan-Result: No virus found in message 1MTZnv-00076C-AC. X-Scan-Signature: ch-smtp03.sth.basefarm.net 1MTZnv-00076C-AC 4b219592b5716b306ac81e3343a3dd3a Cc: Juli Mallett , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 11:35:02 -0000 On Wed, Jul 22, 2009 at 01:28:14PM +0300, Alexander Motin wrote: > Juli Mallett wrote: > > On Wed, Jul 22, 2009 at 01:42, Alexander Motin wrote: > >> Colin Percival wrote: > >>> Remove the "dedicated disk mode" partitioning option from sysinstall, in > >>> both the disk partitioning screen (the 'F' key) and via install.cfg (the > >>> VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x > >>> due to libdisk and geom generating different partition names; this commit > >>> merely acts to help steer users away from the breakage. > >> Is there any other way to not align FS block to the ugly legacy 63 > >> sectors per track boundary with sysinstall now? I think RAIDs won't be > >> happy. May be it would be better to fix it? > > > > If you're interested in fixing this issue, you might want to look at > > the need for compatibility names so that existing DD installs aren't > > broken, and so DD installs work as-is without correcting libdisk's > > expectations about slice/partition names for DD disks, which is pretty > > invasive, too. Not breaking new installs by not letting users install > > broken systems is the absolute bare minimum approach, and given the > > late date and the lack of movement on the kernel side, I've been > > advocating for it for a while. > > > > See this message and others in the thread for some background: > > > > http://lists.freebsd.org/pipermail/freebsd-geom/2009-June/003567.html > > Sorry, ENOTIME. I am not advocating DD mode, it is really a hack. Offset > 0 is just an easiest choice to align FS. Instead, I would really like > sysinstall to honor real disk geometry instead of fake one. "real disk geometry" ? How would sysinstall find that? Keep in mind that any disk geometry reported by disks is completely fake these days and is just an attempt to fit the total number of blocks into the limitations of the PC BIOS. E.g. AFAIK there are no disk in production today with more than 10 heads, and even that many is rare. The number of sectors/track is actually variable, with the outer tracks having more sectors/track than the inner ones. In short the whole notion of 'disk geometry' is mostly obsolete these days and ought to be avoided as far as possible. -- Erik Trulsson ertr1013@student.uu.se From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 11:57:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA7F310656A4; Wed, 22 Jul 2009 11:57:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2B28FC0A; Wed, 22 Jul 2009 11:57:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MBvYMf040617; Wed, 22 Jul 2009 11:57:34 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MBvYOH040614; Wed, 22 Jul 2009 11:57:34 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200907221157.n6MBvYOH040614@svn.freebsd.org> From: Andrew Gallatin Date: Wed, 22 Jul 2009 11:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195818 - in head: share/man/man4 sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 11:57:35 -0000 Author: gallatin Date: Wed Jul 22 11:57:34 2009 New Revision: 195818 URL: http://svn.freebsd.org/changeset/base/195818 Log: mxge's tunable hw.mxge.rss_hash_type cannot be set from the loader, because it uses a reserved suffix (_type). Fix this by removing the "_" and renaming the tunable to hw.mxge.rss_hashtype. The old (rss_hash_type) tunable is still fetched, in case people load the driver via scripts. When both are present in the kernel environment, the new value (hw.mxge.rss_hashtype) overrides the old value. Approved by: re (kib) Modified: head/share/man/man4/mxge.4 head/sys/dev/mxge/if_mxge.c Modified: head/share/man/man4/mxge.4 ============================================================================== --- head/share/man/man4/mxge.4 Wed Jul 22 03:50:54 2009 (r195817) +++ head/share/man/man4/mxge.4 Wed Jul 22 11:57:34 2009 (r195818) @@ -125,14 +125,14 @@ A slice is comprised of a set of receive queues and an associated interrupt thread. When using multiple slices, the NIC hashes traffic to different slices based on the value of -.Va hw.mxge.rss_hash_type . +.Va hw.mxge.rss_hashtype . Using multiple slices requires that your motherboard and Myri10GE NIC both be capable of MSI-X. Older Myri10GE NICs can be field upgraded to add MSI-X using the "10G NIC Tool Kit" for FreeBSD which is available from .Pa http://www.myri.com/scs/download-10g-tools.html . .Pp -.It Va hw.mxge.rss_hash_type +.It Va hw.mxge.rss_hashtype This value determines how incoming traffic is steered to different slices. This tunable is ignored when using just a single slice. Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Wed Jul 22 03:50:54 2009 (r195817) +++ head/sys/dev/mxge/if_mxge.c Wed Jul 22 11:57:34 2009 (r195818) @@ -4014,6 +4014,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH("hw.mxge.lro_cnt", &sc->lro_cnt); TUNABLE_INT_FETCH("hw.mxge.always_promisc", &mxge_always_promisc); TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type); + TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type); TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu); if (sc->lro_cnt != 0) mxge_lro_cnt = sc->lro_cnt; From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 14:32:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E2B4106564A; Wed, 22 Jul 2009 14:32:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C0288FC1A; Wed, 22 Jul 2009 14:32:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MEWSBM043609; Wed, 22 Jul 2009 14:32:28 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MEWSWp043607; Wed, 22 Jul 2009 14:32:28 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907221432.n6MEWSWp043607@svn.freebsd.org> From: Rick Macklem Date: Wed, 22 Jul 2009 14:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195819 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 14:32:28 -0000 Author: rmacklem Date: Wed Jul 22 14:32:28 2009 New Revision: 195819 URL: http://svn.freebsd.org/changeset/base/195819 Log: When using an NFSv4 mount in the experimental nfs client with delegations being issued from the server, there was a case where an Open issued locally based on the delegation would be released before the associated vnode became inactive. If the delegation was recalled after the open was released, an Open against the server would not have been acquired and subsequent I/O operations would need to use the special stateid of all zeros. This patch fixes that case. Approved by: re (kensmith), kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Wed Jul 22 11:57:34 2009 (r195818) +++ head/sys/fs/nfsclient/nfs_clstate.c Wed Jul 22 14:32:28 2009 (r195819) @@ -2472,7 +2472,7 @@ tryagain: clearok = 1; LIST_FOREACH(owp, &dp->nfsdl_owner, nfsow_list) { op = LIST_FIRST(&owp->nfsow_open); - if (op != NULL && op->nfso_opencnt > 0) { + if (op != NULL) { clearok = 0; break; } From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 14:32:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3097710657BC; Wed, 22 Jul 2009 14:32:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 136EC8FC19; Wed, 22 Jul 2009 14:32:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MEWcJs043649; Wed, 22 Jul 2009 14:32:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MEWcXB043644; Wed, 22 Jul 2009 14:32:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200907221432.n6MEWcXB043644@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Jul 2009 14:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195820 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 14:32:39 -0000 Author: kib Date: Wed Jul 22 14:32:38 2009 New Revision: 195820 URL: http://svn.freebsd.org/changeset/base/195820 Log: When the page caching attributes are changed, after new mapping is established, OS shall flush the caches on all processors that may have used the mapping previously. This operation is not needed if processors support self-snooping. If not, but clflush instruction is implemented on the CPU, series of the clflush can be used on the mapping region. Otherwise, we have to flush the whole cache. The later operation is very expensive, and AMD-made CPUs do not have self-snooping. Implement cache flush for remapped region by using clflush for amd64, when supported by CPU. Proposed and reviewed by: alc Approved by: re (kensmith) Modified: head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/pmap.c head/sys/amd64/include/cpufunc.h head/sys/amd64/include/md_var.h Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Wed Jul 22 14:32:28 2009 (r195819) +++ head/sys/amd64/amd64/initcpu.c Wed Jul 22 14:32:38 2009 (r195820) @@ -65,6 +65,7 @@ char cpu_vendor[20]; /* CPU Origin code u_int cpu_vendor_id; /* CPU vendor ID */ u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ +u_int cpu_clflush_line_size = 32; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, "VIA C3/C7 RNG feature available in CPU"); @@ -156,4 +157,12 @@ initializecpu(void) AMD64_CPU_FAMILY(cpu_id) == 0x6 && AMD64_CPU_MODEL(cpu_id) >= 0xf) init_via(); + + /* + * CPUID with %eax = 1, %ebx returns + * Bits 15-8: CLFLUSH line size + * (Value * 8 = cache line size in bytes) + */ + if ((cpu_feature & CPUID_CLFSH) != 0) + cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8; } Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jul 22 14:32:28 2009 (r195819) +++ head/sys/amd64/amd64/pmap.c Wed Jul 22 14:32:38 2009 (r195820) @@ -231,6 +231,7 @@ static vm_page_t pmap_enter_quick_locked vm_page_t m, vm_prot_t prot, vm_page_t mpte); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); static void pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva); static boolean_t pmap_is_modified_pvh(struct md_page *pvh); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va); @@ -921,6 +922,40 @@ pmap_invalidate_cache(void) } #endif /* !SMP */ +static void +pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) +{ + + KASSERT((sva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: sva not page-aligned")); + KASSERT((eva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: eva not page-aligned")); + + if (cpu_feature & CPUID_SS) + ; /* If "Self Snoop" is supported, do nothing. */ + else if (cpu_feature & CPUID_CLFSH) { + + /* + * Otherwise, do per-cache line flush. Use the mfence + * instruction to insure that previous stores are + * included in the write-back. The processor + * propagates flush to other processors in the cache + * coherence domain. + */ + mfence(); + for (; eva < sva; eva += cpu_clflush_line_size) + clflush(eva); + mfence(); + } else { + + /* + * No targeted cache flush methods are supported by CPU, + * globally invalidate cache as a last resort. + */ + pmap_invalidate_cache(); + } +} + /* * Are we current address space or kernel? */ @@ -4256,7 +4291,8 @@ pmap_pde_attr(pd_entry_t *pde, int cache void * pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) { - vm_offset_t va, tmpva, offset; + vm_offset_t va, offset; + vm_size_t tmpsize; /* * If the specified range of physical addresses fits within the direct @@ -4273,16 +4309,10 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_ if (!va) panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); pa = trunc_page(pa); - for (tmpva = va; size > 0; ) { - pmap_kenter_attr(tmpva, pa, mode); - size -= PAGE_SIZE; - tmpva += PAGE_SIZE; - pa += PAGE_SIZE; - } - pmap_invalidate_range(kernel_pmap, va, tmpva); - /* If "Self Snoop" is supported, do nothing. */ - if (!(cpu_feature & CPUID_SS)) - pmap_invalidate_cache(); + for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) + pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); + pmap_invalidate_range(kernel_pmap, va, va + tmpsize); + pmap_invalidate_cache_range(va, va + tmpsize); return ((void *)(va + offset)); } @@ -4624,9 +4654,7 @@ pmap_change_attr_locked(vm_offset_t va, */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - /* If "Self Snoop" is supported, do nothing. */ - if (!(cpu_feature & CPUID_SS)) - pmap_invalidate_cache(); + pmap_invalidate_cache_range(base, tmpva); } return (error); } Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Wed Jul 22 14:32:28 2009 (r195819) +++ head/sys/amd64/include/cpufunc.h Wed Jul 22 14:32:38 2009 (r195820) @@ -100,6 +100,13 @@ bsrq(u_long mask) } static __inline void +clflush(u_long addr) +{ + + __asm __volatile("clflush %0" : : "m" (*(char *)addr)); +} + +static __inline void disable_intr(void) { __asm __volatile("cli" : : : "memory"); @@ -267,6 +274,13 @@ outw(u_int port, u_short data) } static __inline void +mfence(void) +{ + + __asm__ __volatile("mfence" : : : "memory"); +} + +static __inline void ia32_pause(void) { __asm __volatile("pause"); Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Wed Jul 22 14:32:28 2009 (r195819) +++ head/sys/amd64/include/md_var.h Wed Jul 22 14:32:38 2009 (r195820) @@ -47,6 +47,7 @@ extern u_int amd_feature2; extern u_int amd_pminfo; extern u_int via_feature_rng; extern u_int via_feature_xcrypt; +extern u_int cpu_clflush_line_size; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 14:37:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FC0F1065673; Wed, 22 Jul 2009 14:37:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ED3C8FC1F; Wed, 22 Jul 2009 14:37:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MEbrqO043840; Wed, 22 Jul 2009 14:37:53 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MEbrN2043836; Wed, 22 Jul 2009 14:37:53 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907221437.n6MEbrN2043836@svn.freebsd.org> From: Rick Macklem Date: Wed, 22 Jul 2009 14:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195821 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 14:37:57 -0000 Author: rmacklem Date: Wed Jul 22 14:37:53 2009 New Revision: 195821 URL: http://svn.freebsd.org/changeset/base/195821 Log: Add changes to the experimental nfs client to use the PBDRY flag for msleep(9) when a vnode lock or similar may be held. The changes are just a clone of the changes applied to the regular nfs client by r195703. Approved by: re (kensmith), kib (mentor) Modified: head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Wed Jul 22 14:32:38 2009 (r195820) +++ head/sys/fs/nfs/nfsport.h Wed Jul 22 14:37:53 2009 (r195821) @@ -911,6 +911,13 @@ struct nfsreq { #define NFSVNO_DELEGOK(v) (1) #endif +/* + * Define this as the flags argument for msleep() when catching signals + * while holding a resource that other threads would block for, such as + * a vnode lock. + */ +#define NFS_PCATCH (PCATCH | PBDRY) + #endif /* _KERNEL */ #endif /* _NFSPORT_NFS_H */ Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Wed Jul 22 14:32:38 2009 (r195820) +++ head/sys/fs/nfsclient/nfs_clbio.c Wed Jul 22 14:37:53 2009 (r195821) @@ -1357,7 +1357,7 @@ nfs_getcacheblk(struct vnode *vp, daddr_ sigset_t oldset; ncl_set_sigmask(td, &oldset); - bp = getblk(vp, bn, size, PCATCH, 0, 0); + bp = getblk(vp, bn, size, NFS_PCATCH, 0, 0); ncl_restore_sigmask(td, &oldset); while (bp == NULL) { if (newnfs_sigintr(nmp, td)) @@ -1396,7 +1396,7 @@ ncl_vinvalbuf(struct vnode *vp, int flag if ((nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF)) intrflg = 1; if (intrflg) { - slpflag = PCATCH; + slpflag = NFS_PCATCH; slptimeo = 2 * hz; } else { slpflag = 0; @@ -1484,7 +1484,7 @@ ncl_asyncio(struct nfsmount *nmp, struct } again: if (nmp->nm_flag & NFSMNT_INT) - slpflag = PCATCH; + slpflag = NFS_PCATCH; gotiod = FALSE; /* @@ -1553,7 +1553,7 @@ again: mtx_unlock(&ncl_iod_mutex); return (error2); } - if (slpflag == PCATCH) { + if (slpflag == NFS_PCATCH) { slpflag = 0; slptimeo = 2 * hz; } Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Jul 22 14:32:38 2009 (r195820) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Jul 22 14:37:53 2009 (r195821) @@ -2448,7 +2448,7 @@ ncl_flush(struct vnode *vp, int waitfor, int bvecsize = 0, bveccount; if (nmp->nm_flag & NFSMNT_INT) - slpflag = PCATCH; + slpflag = NFS_PCATCH; if (!commit) passone = 0; bo = &vp->v_bufobj; @@ -2646,7 +2646,7 @@ loop: error = EINTR; goto done; } - if (slpflag == PCATCH) { + if (slpflag & PCATCH) { slpflag = 0; slptimeo = 2 * hz; } @@ -2684,7 +2684,7 @@ loop: error = newnfs_sigintr(nmp, td); if (error) goto done; - if (slpflag == PCATCH) { + if (slpflag & PCATCH) { slpflag = 0; slptimeo = 2 * hz; } From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 15:15:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1644D1065670; Wed, 22 Jul 2009 15:15:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03A5E8FC24; Wed, 22 Jul 2009 15:15:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MFFwIe044858; Wed, 22 Jul 2009 15:15:58 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MFFwpd044856; Wed, 22 Jul 2009 15:15:58 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200907221515.n6MFFwpd044856@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 22 Jul 2009 15:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195822 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 15:15:59 -0000 Author: trasz Date: Wed Jul 22 15:15:58 2009 New Revision: 195822 URL: http://svn.freebsd.org/changeset/base/195822 Log: Fix extattr_list_file(2) on ZFS in case the attribute directory doesn't exist and user doesn't have write access to the file. Without this fix, it returns bogus value instead of 0. For some reason this didn't manifest on my kernel compiled with -O0. PR: kern/136601 Submitted by: Jaakko Heinonen Approved by: re (kib) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 22 14:37:53 2009 (r195821) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 22 15:15:58 2009 (r195822) @@ -4722,6 +4722,9 @@ vop_listextattr { ZFS_ENTER(zfsvfs); + if (sizep != NULL) + *sizep = 0; + error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, LOOKUP_XATTR); if (error != 0) { @@ -4752,9 +4755,6 @@ vop_listextattr { auio.uio_rw = UIO_READ; auio.uio_offset = 0; - if (sizep != NULL) - *sizep = 0; - do { u_char nlen; From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 15:17:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 108331065686; Wed, 22 Jul 2009 15:17:58 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from pin.if.uz.zgora.pl (pin.if.uz.zgora.pl [212.109.128.251]) by mx1.freebsd.org (Postfix) with ESMTP id BFE598FC19; Wed, 22 Jul 2009 15:17:57 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: by pin.if.uz.zgora.pl (Postfix, from userid 1001) id 2EDB939BA2; Wed, 22 Jul 2009 17:19:31 +0200 (CEST) Date: Wed, 22 Jul 2009 17:19:31 +0200 From: Edward Tomasz Napierala To: Artis Caune Message-ID: <20090722151931.GA35550@pin.if.uz.zgora.pl> References: <200907201916.n6KJGhEl086253@svn.freebsd.org> <9e20d71e0907220247x3b8b75cdm59106eaadc1517fa@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9e20d71e0907220247x3b8b75cdm59106eaadc1517fa@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195785 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 15:17:58 -0000 On 0722T1247, Artis Caune wrote: > > Author: trasz > > Date: Mon Jul 20 19:16:42 2009 > > New Revision: 195785 > > URL: http://svn.freebsd.org/changeset/base/195785 > > > > Log: > >  Fix permission handling for extended attributes in ZFS.  Without > >  this change, ZFS uses SunOS Alternate Data Streams semantics - each > >  EA has its own permissions, which are set at EA creation time > >  and - unlike SunOS - invisible to the user and impossible to change. > >  From the user point of view, it's just broken: sometimes access > >  is granted when it shouldn't be, sometimes it's denied when > >  it shouldn't be. > > > >  This patch makes it behave just like UFS, i.e. depend on current > >  file permissions.  Also, it fixes returned error codes (ENOATTR > >  instead of ENOENT) and makes listextattr(2) return 0 instead > >  of EPERM where there is no EA directory (i.e. the file never had > >  any EA). > > > > I can not create archives from ZFS file system after this commit. Should be fixed now. Sorry for the breakage. [..] -- If you cut off my head, what would I say? Me and my head, or me and my body? From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 15:26:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F8C010656B7; Wed, 22 Jul 2009 15:26:20 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E543A8FC2C; Wed, 22 Jul 2009 15:26:19 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MFQJWW045141; Wed, 22 Jul 2009 15:26:19 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MFQJvr045140; Wed, 22 Jul 2009 15:26:19 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907221526.n6MFQJvr045140@svn.freebsd.org> From: Bruce M Simpson Date: Wed, 22 Jul 2009 15:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195823 - stable/7/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 15:26:22 -0000 Author: bms Date: Wed Jul 22 15:26:19 2009 New Revision: 195823 URL: http://svn.freebsd.org/changeset/base/195823 Log: Mark the dwarf2out.c bug fix, r195815 as integrated; using --record-only. Pointy hat to: bms Requested by: kib Modified: stable/7/contrib/gcc/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 15:41:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2654106564A; Wed, 22 Jul 2009 15:41:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE79C8FC12; Wed, 22 Jul 2009 15:41:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MFfbix045458; Wed, 22 Jul 2009 15:41:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MFfbEo045455; Wed, 22 Jul 2009 15:41:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200907221541.n6MFfbEo045455@svn.freebsd.org> From: Andriy Gapon Date: Wed, 22 Jul 2009 15:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195824 - in stable/7/sys: . cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 contrib/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 15:41:38 -0000 Author: avg Date: Wed Jul 22 15:41:37 2009 New Revision: 195824 URL: http://svn.freebsd.org/changeset/base/195824 Log: MFC 195710: dtrace_gethrtime: improve scaling of TSC ticks to nanoseconds PR: kern/127441 Modified: stable/7/sys/ (props changed) stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Wed Jul 22 15:26:19 2009 (r195823) +++ stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Wed Jul 22 15:41:37 2009 (r195824) @@ -366,6 +366,10 @@ dtrace_safe_defer_signal(void) static int64_t tgt_cpu_tsc; static int64_t hst_cpu_tsc; static int64_t tsc_skew[MAXCPU]; +static uint64_t nsec_scale; + +/* See below for the explanation of this macro. */ +#define SCALE_SHIFT 28 static void dtrace_gethrtime_init_sync(void *arg) @@ -401,9 +405,36 @@ dtrace_gethrtime_init_cpu(void *arg) static void dtrace_gethrtime_init(void *arg) { + uint64_t tsc_f; cpumask_t map; int i; - struct pcpu *cp; + + /* + * Get TSC frequency known at this moment. + * This should be constant if TSC is invariant. + * Otherwise tick->time conversion will be inaccurate, but + * will preserve monotonic property of TSC. + */ + tsc_f = tsc_freq; + + /* + * The following line checks that nsec_scale calculated below + * doesn't overflow 32-bit unsigned integer, so that it can multiply + * another 32-bit integer without overflowing 64-bit. + * Thus minimum supported TSC frequency is 62.5MHz. + */ + KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), ("TSC frequency is too low")); + + /* + * We scale up NANOSEC/tsc_f ratio to preserve as much precision + * as possible. + * 2^28 factor was chosen quite arbitrarily from practical + * considerations: + * - it supports TSC frequencies as low as 62.5MHz (see above); + * - it provides quite good precision (e < 0.01%) up to THz + * (terahertz) values; + */ + nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; /* The current CPU is the reference one. */ tsc_skew[curcpu] = 0; @@ -412,7 +443,7 @@ dtrace_gethrtime_init(void *arg) if (i == curcpu) continue; - if ((cp = pcpu_find(i)) == NULL) + if (pcpu_find(i) == NULL) continue; map = 0; @@ -439,7 +470,21 @@ SYSINIT(dtrace_gethrtime_init, SI_SUB_SM uint64_t dtrace_gethrtime() { - return ((rdtsc() + tsc_skew[curcpu]) * (int64_t) 1000000000 / tsc_freq); + uint64_t tsc; + uint32_t lo; + uint32_t hi; + + /* + * We split TSC value into lower and higher 32-bit halves and separately + * scale them with nsec_scale, then we scale them down by 2^28 + * (see nsec_scale calculations) taking into account 32-bit shift of + * the higher half and finally add. + */ + tsc = rdtsc() + tsc_skew[curcpu]; + lo = tsc; + hi = tsc >> 32; + return (((lo * nsec_scale) >> SCALE_SHIFT) + + ((hi * nsec_scale) << (32 - SCALE_SHIFT))); } uint64_t Modified: stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c Wed Jul 22 15:26:19 2009 (r195823) +++ stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c Wed Jul 22 15:41:37 2009 (r195824) @@ -366,6 +366,10 @@ dtrace_safe_defer_signal(void) static int64_t tgt_cpu_tsc; static int64_t hst_cpu_tsc; static int64_t tsc_skew[MAXCPU]; +static uint64_t nsec_scale; + +/* See below for the explanation of this macro. */ +#define SCALE_SHIFT 28 static void dtrace_gethrtime_init_sync(void *arg) @@ -401,10 +405,38 @@ dtrace_gethrtime_init_cpu(void *arg) static void dtrace_gethrtime_init(void *arg) { + uint64_t tsc_f; cpumask_t map; int i; struct pcpu *cp; + /* + * Get TSC frequency known at this moment. + * This should be constant if TSC is invariant. + * Otherwise tick->time conversion will be inaccurate, but + * will preserve monotonic property of TSC. + */ + tsc_f = tsc_freq; + + /* + * The following line checks that nsec_scale calculated below + * doesn't overflow 32-bit unsigned integer, so that it can multiply + * another 32-bit integer without overflowing 64-bit. + * Thus minimum supported TSC frequency is 62.5MHz. + */ + KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), ("TSC frequency is too low")); + + /* + * We scale up NANOSEC/tsc_f ratio to preserve as much precision + * as possible. + * 2^28 factor was chosen quite arbitrarily from practical + * considerations: + * - it supports TSC frequencies as low as 62.5MHz (see above); + * - it provides quite good precision (e < 0.01%) up to THz + * (terahertz) values; + */ + nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; + /* The current CPU is the reference one. */ tsc_skew[curcpu] = 0; @@ -439,7 +471,21 @@ SYSINIT(dtrace_gethrtime_init, SI_SUB_SM uint64_t dtrace_gethrtime() { - return ((rdtsc() + tsc_skew[curcpu]) * (int64_t) 1000000000 / tsc_freq); + uint64_t tsc; + uint32_t lo; + uint32_t hi; + + /* + * We split TSC value into lower and higher 32-bit halves and separately + * scale them with nsec_scale, then we scale them down by 2^28 + * (see nsec_scale calculations) taking into account 32-bit shift of + * the higher half and finally add. + */ + tsc = rdtsc() + tsc_skew[curcpu]; + lo = tsc; + hi = tsc >> 32; + return (((lo * nsec_scale) >> SCALE_SHIFT) + + ((hi * nsec_scale) << (32 - SCALE_SHIFT))); } uint64_t From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 16:02:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF0A91065670; Wed, 22 Jul 2009 16:02:22 +0000 (UTC) (envelope-from sektie@gmail.com) Received: from mail-qy0-f191.google.com (mail-qy0-f191.google.com [209.85.221.191]) by mx1.freebsd.org (Postfix) with ESMTP id 144B68FC1B; Wed, 22 Jul 2009 16:02:21 +0000 (UTC) (envelope-from sektie@gmail.com) Received: by qyk29 with SMTP id 29so337194qyk.3 for ; Wed, 22 Jul 2009 09:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=bK6kC1W+juejycZR/cFhYXvz93WAiI2o9zfKFsno2eE=; b=bJ7wEzwI4yiteK1I2yukRyjfv5hQd351McqUUl7BQcyZA/J1w9IsfTeIcbNIMJJcEj q36IHs5RfjHKsqbdZL/J+pfowU9A0m/YycaGjDEeTyjqUd911KtIfBn2J1pDASu4adcb 1hyhIrbMMEKHsoAq9/IqnoN3X+MS+UOv2IEG0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=pFlKwLQ35BLlY1t4baQtikjT0Q9KNsCmmA1SF9JWdFrsg+wgQ0criYiPl256svd3WD riYYJj0uPY2+tdKOVxEF1I/bTQMWmMukUcuxxsWyDGgW6d3UTnu25LqdZdimzzYT2uAX KodaZbVOjy585PMkEUqpUBcTjIPjgdudqmBG0= MIME-Version: 1.0 Sender: sektie@gmail.com Received: by 10.229.89.146 with SMTP id e18mr218877qcm.23.1248278541457; Wed, 22 Jul 2009 09:02:21 -0700 (PDT) In-Reply-To: <4A66E9BE.2020603@FreeBSD.org> References: <200907220350.n6M3osaj030202@svn.freebsd.org> <4A66D0F4.4030108@FreeBSD.org> <4A66E9BE.2020603@FreeBSD.org> Date: Wed, 22 Jul 2009 09:02:21 -0700 X-Google-Sender-Auth: a95e5a11dc3ef6d2 Message-ID: From: Randi Harper To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Juli Mallett , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 16:02:23 -0000 On Wed, Jul 22, 2009 at 3:28 AM, Alexander Motin wrote: > Juli Mallett wrote: > > If you're interested in fixing this issue, you might want to look at > > the need for compatibility names so that existing DD installs aren't > > broken, and so DD installs work as-is without correcting libdisk's > > expectations about slice/partition names for DD disks, which is pretty > > invasive, too. Not breaking new installs by not letting users install > > broken systems is the absolute bare minimum approach, and given the > > late date and the lack of movement on the kernel side, I've been > > advocating for it for a while. > > > > See this message and others in the thread for some background: > > > > http://lists.freebsd.org/pipermail/freebsd-geom/2009-June/003567.html > > Sorry, ENOTIME. I am not advocating DD mode, it is really a hack. Offset > 0 is just an easiest choice to align FS. Instead, I would really like > sysinstall to honor real disk geometry instead of fake one. GEOM has > support for reporting disk stripe size/offset and some GEOM classes > already provide them. But sysinstall - the main tool which could benefit > from it - ignores it. This fix was intended - as Juli said - as a bare minimum approach until sysinstall/libgeom happens. Using GEOM would fix a lot of problems with sysinstall. I started poking at it a little while ago, but it's not going to be a minor change, certainly not something that is going to make it in anytime soon. -- randi From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 16:12:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CBC510656B7; Wed, 22 Jul 2009 16:12:01 +0000 (UTC) (envelope-from sektie@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA768FC18; Wed, 22 Jul 2009 16:12:00 +0000 (UTC) (envelope-from sektie@gmail.com) Received: by qw-out-2122.google.com with SMTP id 3so133920qwe.7 for ; Wed, 22 Jul 2009 09:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=RJ6LUVy0N3FXUrPpnz7X+xmGixxEXa/Bc0MPsOgzje8=; b=txZ8g/9Pi7ZOCdf+7AfmVzWc0aRSyzSfF61E32+VI8gjqYapfIBSbVI+XnwWDaltHb coF+mjoG1RCL3uOq948FCaXyt2gfFvZtUp422uU3yBLaP+yWwJ9F/EGpcc5g6AEtC3UL /3eRRHgnUqaGfHb6oFUAr4r7aAkrAeNoaecyE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=fQisatnaSe5vLvXCNHFZDUr8bukhcBO57L4hyvj/8QI4xhh5MSPqB4wC7KFu0f7bFN hyHDLBlaMxveXRs/OpX5froCf1tosEpEFbBuiWlKCp/G9w6//QhOTrcn542ehdDKUmYi 8w/YCKaV0TGuYk3wk8yW3jGE7O+YCbUe1ekMI= MIME-Version: 1.0 Sender: sektie@gmail.com Received: by 10.229.81.139 with SMTP id x11mr211255qck.14.1248277531105; Wed, 22 Jul 2009 08:45:31 -0700 (PDT) In-Reply-To: References: <200907220350.n6M3osaj030202@svn.freebsd.org> Date: Wed, 22 Jul 2009 08:45:30 -0700 X-Google-Sender-Auth: f4288bcb42167176 Message-ID: From: Randi Harper To: Dmitry Morozovsky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 16:12:01 -0000 On Wed, Jul 22, 2009 at 1:51 AM, Dmitry Morozovsky wrote: > > While you're here, don't you think it's time to rename Wizard mode to > Expert > mode to not confuse users too much? I'll be "here" for quite a while, and nitpicking menu options really isn't in my to-do list during a code freeze. :) Really, there's a huge list of stuff that needs to be done with sysinstall. Cleaning up the menus is on that list, but I'm working on bugfixes at the moment. -- randi From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 18:10:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23A181065689; Wed, 22 Jul 2009 18:10:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 120AB8FC17; Wed, 22 Jul 2009 18:10:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MIAij6048421; Wed, 22 Jul 2009 18:10:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MIAij9048419; Wed, 22 Jul 2009 18:10:44 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907221810.n6MIAij9048419@svn.freebsd.org> From: Rick Macklem Date: Wed, 22 Jul 2009 18:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195825 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 18:10:45 -0000 Author: rmacklem Date: Wed Jul 22 18:10:44 2009 New Revision: 195825 URL: http://svn.freebsd.org/changeset/base/195825 Log: When vfs.newnfs.callback_addr is set to an IPv4 address, the experimental NFSv4 client might try and use it as an IPv6 address, breaking callbacks. The fix simply initializes the isinet6 variable for this case. Approved by: re (kensmith), kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Wed Jul 22 15:41:37 2009 (r195824) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Wed Jul 22 18:10:44 2009 (r195825) @@ -753,7 +753,7 @@ nfsrpc_setclient(struct nfsmount *nmp, s nfsattrbit_t attrbits; u_int8_t *cp = NULL, *cp2, addr[INET6_ADDRSTRLEN + 9]; u_short port; - int error, isinet6, callblen; + int error, isinet6 = 0, callblen; nfsquad_t confirm; u_int32_t lease; static u_int32_t rev = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 18:45:33 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 131BF1065672; Wed, 22 Jul 2009 18:45:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Wed, 22 Jul 2009 14:44:52 -0400 User-Agent: KMail/1.6.2 References: <200907221432.n6MEWcXB043644@svn.freebsd.org> In-Reply-To: <200907221432.n6MEWcXB043644@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200907221445.25404.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Konstantin Belousov Subject: Re: svn commit: r195820 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 18:45:33 -0000 On Wednesday 22 July 2009 10:32 am, Konstantin Belousov wrote: > Author: kib > Date: Wed Jul 22 14:32:38 2009 > New Revision: 195820 > URL: http://svn.freebsd.org/changeset/base/195820 > > Log: > When the page caching attributes are changed, after new mapping > is established, OS shall flush the caches on all processors that > may have used the mapping previously. This operation is not needed > if processors support self-snooping. If not, but clflush > instruction is implemented on the CPU, series of the clflush can be > used on the mapping region. Otherwise, we have to flush the whole > cache. The later operation is very expensive, and AMD-made CPUs do > not have self-snooping. > > Implement cache flush for remapped region by using clflush for > amd64, when supported by CPU. --- >8 --- SKIP --- >8 --- > @@ -267,6 +274,13 @@ outw(u_int port, u_short data) > } > > static __inline void > +mfence(void) > +{ > + > + __asm__ __volatile("mfence" : : : "memory"); > +} > + > +static __inline void > ia32_pause(void) > { > __asm __volatile("pause"); Is there any reason why you want mfence() instead of mb() from machine/atomic.h? Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 19:26:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2CE01065674; Wed, 22 Jul 2009 19:26:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 57BCD8FC12; Wed, 22 Jul 2009 19:26:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n6MJQiI7023524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jul 2009 22:26:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n6MJQibm085735; Wed, 22 Jul 2009 22:26:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n6MJQiUS085734; Wed, 22 Jul 2009 22:26:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 22 Jul 2009 22:26:44 +0300 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20090722192644.GX55190@deviant.kiev.zoral.com.ua> References: <200907221432.n6MEWcXB043644@svn.freebsd.org> <200907221445.25404.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JX3/dhvb8vz6C4q6" Content-Disposition: inline In-Reply-To: <200907221445.25404.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195820 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 19:26:50 -0000 --JX3/dhvb8vz6C4q6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 22, 2009 at 02:44:52PM -0400, Jung-uk Kim wrote: > On Wednesday 22 July 2009 10:32 am, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Jul 22 14:32:38 2009 > > New Revision: 195820 > > URL: http://svn.freebsd.org/changeset/base/195820 > > > > Log: > > When the page caching attributes are changed, after new mapping > > is established, OS shall flush the caches on all processors that > > may have used the mapping previously. This operation is not needed > > if processors support self-snooping. If not, but clflush > > instruction is implemented on the CPU, series of the clflush can be > > used on the mapping region. Otherwise, we have to flush the whole > > cache. The later operation is very expensive, and AMD-made CPUs do > > not have self-snooping. > > > > Implement cache flush for remapped region by using clflush for > > amd64, when supported by CPU. >=20 > --- >8 --- SKIP --- >8 --- >=20 > > @@ -267,6 +274,13 @@ outw(u_int port, u_short data) > > } > > > > static __inline void > > +mfence(void) > > +{ > > + > > + __asm__ __volatile("mfence" : : : "memory"); > > +} > > + > > +static __inline void > > ia32_pause(void) > > { > > __asm __volatile("pause"); >=20 > Is there any reason why you want mfence() instead of mb() from=20 > machine/atomic.h? Char-to-char equal implementation of pmap_invalidate_cache_range() is developed for i386. Note that mb() is a barrier, while Intel notes that clflush only ordered with mfence. On i386, mb() is locked nop. --JX3/dhvb8vz6C4q6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkpnZ/MACgkQC3+MBN1Mb4hYgQCeMEq2b2hRipR/ZiUch0rZyozj 4J0AoLuTY2BE8OgChbfKRu3BlDy2Ju7H =IylY -----END PGP SIGNATURE----- --JX3/dhvb8vz6C4q6-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 20:46:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B4D51065670; Wed, 22 Jul 2009 20:46:18 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EE1B8FC19; Wed, 22 Jul 2009 20:46:18 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MKkIhX051727; Wed, 22 Jul 2009 20:46:18 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MKkIWW051725; Wed, 22 Jul 2009 20:46:18 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200907222046.n6MKkIWW051725@svn.freebsd.org> From: Ken Smith Date: Wed, 22 Jul 2009 20:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195827 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 20:46:19 -0000 Author: kensmith Date: Wed Jul 22 20:46:17 2009 New Revision: 195827 URL: http://svn.freebsd.org/changeset/base/195827 Log: It is believed the last subsystem that limited ID sizes to something other than the current system-wide size (32-bits) has been updated so for now just cautiously turn the check off. While here fix the check for IDs being too large which doesn't work due to type mis-matches. Reviewed by: jhb (previous version) Approved by: re (kib) MFC after: 1 month (type mis-match fixes only) Modified: head/lib/libc/gen/pw_scan.c Modified: head/lib/libc/gen/pw_scan.c ============================================================================== --- head/lib/libc/gen/pw_scan.c Wed Jul 22 18:25:51 2009 (r195826) +++ head/lib/libc/gen/pw_scan.c Wed Jul 22 20:46:17 2009 (r195827) @@ -58,8 +58,14 @@ __FBSDID("$FreeBSD$"); * * If pw_big_ids_warning is -1 on entry to pw_scan(), it will be set based * on the existence of PW_SCAN_BIG_IDS in the environment. + * + * It is believed all baseline system software that can not handle the + * normal ID sizes is now gone so pw_big_ids_warning is disabled for now. + * But the code has been left in place in case end-users want to re-enable + * it and/or for the next time the ID sizes get bigger but pieces of the + * system lag behind. */ -static int pw_big_ids_warning = -1; +static int pw_big_ids_warning = 0; int __pw_scan(char *bp, struct passwd *pw, int flags) @@ -67,6 +73,7 @@ __pw_scan(char *bp, struct passwd *pw, i uid_t id; int root; char *ep, *p, *sh; + unsigned long temp; if (pw_big_ids_warning == -1) pw_big_ids_warning = getenv("PW_SCAN_BIG_IDS") == NULL ? 1 : 0; @@ -94,12 +101,14 @@ __pw_scan(char *bp, struct passwd *pw, i return (0); } } - id = strtoul(p, &ep, 10); - if (errno == ERANGE) { + errno = 0; + temp = strtoul(p, &ep, 10); + if ((temp == ULONG_MAX && errno == ERANGE) || temp > UID_MAX) { if (flags & _PWSCAN_WARN) - warnx("%s > max uid value (%lu)", p, ULONG_MAX); + warnx("%s > max uid value (%u)", p, UID_MAX); return (0); } + id = temp; if (*ep != '\0') { if (flags & _PWSCAN_WARN) warnx("%s uid is incorrect", p); @@ -127,12 +136,14 @@ __pw_scan(char *bp, struct passwd *pw, i return (0); } } - id = strtoul(p, &ep, 10); - if (errno == ERANGE) { + errno = 0; + temp = strtoul(p, &ep, 10); + if ((temp == ULONG_MAX && errno == ERANGE) || temp > GID_MAX) { if (flags & _PWSCAN_WARN) - warnx("%s > max gid value (%lu)", p, ULONG_MAX); + warnx("%s > max gid value (%u)", p, GID_MAX); return (0); } + id = temp; if (*ep != '\0') { if (flags & _PWSCAN_WARN) warnx("%s gid is incorrect", p); From owner-svn-src-all@FreeBSD.ORG Wed Jul 22 22:13:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 175D3106568E; Wed, 22 Jul 2009 22:13:43 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEB458FC12; Wed, 22 Jul 2009 22:13:42 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MMDgYg053621; Wed, 22 Jul 2009 22:13:42 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MMDgRl053619; Wed, 22 Jul 2009 22:13:42 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200907222213.n6MMDgRl053619@svn.freebsd.org> From: Ken Smith Date: Wed, 22 Jul 2009 22:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195828 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 22:13:43 -0000 Author: kensmith Date: Wed Jul 22 22:13:42 2009 New Revision: 195828 URL: http://svn.freebsd.org/changeset/base/195828 Log: It is believed the last of the base system that could have an issue with IDs larger than 16-bits has been updated so adjust sysinstall to allow IDs up to the current system-wide size of 32-bits. Approved by: re (kib) Modified: head/usr.sbin/sysinstall/user.c Modified: head/usr.sbin/sysinstall/user.c ============================================================================== --- head/usr.sbin/sysinstall/user.c Wed Jul 22 20:46:17 2009 (r195827) +++ head/usr.sbin/sysinstall/user.c Wed Jul 22 22:13:42 2009 (r195828) @@ -45,10 +45,10 @@ /* XXX should they be moved out to sysinstall.h? */ #define GNAME_FIELD_LEN 32 -#define GID_FIELD_LEN 10 +#define GID_FIELD_LEN 11 #define GMEMB_FIELD_LEN 64 -#define UID_FIELD_LEN 10 +#define UID_FIELD_LEN 11 #define UGROUP_FIELD_LEN GNAME_FIELD_LEN #define GECOS_FIELD_LEN 64 #define UMEMB_FIELD_LEN GMEMB_FIELD_LEN @@ -169,7 +169,7 @@ static int verifyGroupSettings(void) { char tmp[256], *cp; - long lgid; + unsigned long lgid; if (strlen(gname) == 0) { feepout("The group name field must not be empty!"); @@ -181,9 +181,9 @@ verifyGroupSettings(void) return 0; } if (strlen(gid) > 0) { - lgid = strtol(gid, &cp, 10); - if (lgid < 0 || lgid >= 65536 || (*cp != '\0' && !isspace(*cp))) { - feepout("The GID must be a number between 1 and 65535."); + lgid = strtoul(gid, &cp, 10); + if (lgid == 0 || lgid > GID_MAX || (*cp != '\0' && !isspace(*cp))) { + feepout("The GID must be a number between 1 and 4294967295."); return 0; } } @@ -406,7 +406,7 @@ static int verifyUserSettings(WINDOW *ds_win) { char tmp[256], *cp; - long luid; + unsigned long luid; WINDOW *save; int rv; @@ -420,9 +420,9 @@ verifyUserSettings(WINDOW *ds_win) return 0; } if (strlen(uid) > 0) { - luid = strtol(uid, &cp, 10); - if (luid < 0 || luid >= 65536 || (*cp != '\0' && !isspace(*cp))) { - feepout("The UID must be a number between 1 and 65535."); + luid = strtoul(uid, &cp, 10); + if (luid == 0 || luid > UID_MAX || (*cp != '\0' && !isspace(*cp))) { + feepout("The UID must be a number between 1 and 4294967295."); return 0; } } From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 01:35:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76812106564A; Thu, 23 Jul 2009 01:35:14 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 608D48FC13; Thu, 23 Jul 2009 01:35:14 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6N1ZE8s057596; Thu, 23 Jul 2009 01:35:14 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6N1ZEar057595; Thu, 23 Jul 2009 01:35:14 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907230135.n6N1ZEar057595@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 23 Jul 2009 01:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195829 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 01:35:15 -0000 Author: bms Date: Thu Jul 23 01:35:13 2009 New Revision: 195829 URL: http://svn.freebsd.org/changeset/base/195829 Log: MFC r182138: Greatly expand the devices listed as being supported. This list was taken from PR/121184 which was mechanically generated from similar lists in the Linux ipaq driver. I then took the numbers we had in usbdevs and filled in the right symbols and eliminated duplicates. PR: usb/121184 Modified: stable/7/sys/dev/usb/uipaq.c Modified: stable/7/sys/dev/usb/uipaq.c ============================================================================== --- stable/7/sys/dev/usb/uipaq.c Wed Jul 22 22:13:42 2009 (r195828) +++ stable/7/sys/dev/usb/uipaq.c Thu Jul 23 01:35:13 2009 (r195829) @@ -119,16 +119,465 @@ struct uipaq_type { u_int16_t uv_flags; }; -static const struct uipaq_type uipaq_devs[] = { - {{ USB_VENDOR_HP, USB_PRODUCT_HP_2215 }, 0 }, - {{ USB_VENDOR_HP, USB_PRODUCT_HP_568J }, 0}, - {{ USB_VENDOR_HTC, USB_PRODUCT_HTC_WINMOBILE }, 0}, - {{ USB_VENDOR_HTC, USB_PRODUCT_HTC_PPC6700MODEM }, 0}, - {{ USB_VENDOR_HTC, USB_PRODUCT_HTC_SMARTPHONE }, 0}, - {{ USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_IPAQPOCKETPC } , 0}, - {{ USB_VENDOR_CASIO, USB_PRODUCT_CASIO_BE300 } , 0}, - {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WZERO3ES }, 0}, - {{ USB_VENDOR_ASUS, USB_PRODUCT_ASUS_P535 }, 0}, +/* + * Much of this list is generated from lists of other drivers that support + * the same hardware. Numeric values are used where no usbdevs entries + * exist. + */ + static const struct uipaq_type uipaq_devs[] = { + {{ 0x0104, 0x00be }, 0}, /* Socket USB Sync */ + {{ 0x04ad, 0x0301 }, 0}, /* USB Sync 0301 */ + {{ 0x04ad, 0x0302 }, 0}, /* USB Sync 0302 */ + {{ 0x04ad, 0x0303 }, 0}, /* USB Sync 0303 */ + {{ 0x04ad, 0x0306 }, 0}, /* GPS Pocket PC USB Sync */ + {{ 0x0536, 0x01a0 }, 0}, /* HHP PDT */ + {{ 0x067e, 0x1001 }, 0}, /* Intermec Mobile Computer */ + {{ 0x094b, 0x0001 }, 0}, /* Linkup Systems USB Sync */ + {{ 0x0960, 0x0065 }, 0}, /* BCOM USB Sync 0065 */ + {{ 0x0960, 0x0066 }, 0}, /* BCOM USB Sync 0066 */ + {{ 0x0960, 0x0067 }, 0}, /* BCOM USB Sync 0067 */ + {{ 0x0961, 0x0010 }, 0}, /* Portatec USB Sync */ + {{ 0x099e, 0x0052 }, 0}, /* Trimble GeoExplorer */ + {{ 0x099e, 0x4000 }, 0}, /* TDS Data Collector */ + {{ 0x0c44, 0x03a2 }, 0}, /* Motorola iDEN Smartphone */ + {{ 0x0c8e, 0x6000 }, 0}, /* Cesscom Luxian Series */ + {{ 0x0cad, 0x9001 }, 0}, /* Motorola PowerPad Pocket PCDevice */ + {{ 0x0f4e, 0x0200 }, 0}, /* Freedom Scientific USB Sync */ + {{ 0x0f98, 0x0201 }, 0}, /* Cyberbank USB Sync */ + {{ 0x0fb8, 0x3001 }, 0}, /* Wistron USB Sync */ + {{ 0x0fb8, 0x3002 }, 0}, /* Wistron USB Sync */ + {{ 0x0fb8, 0x3003 }, 0}, /* Wistron USB Sync */ + {{ 0x0fb8, 0x4001 }, 0}, /* Wistron USB Sync */ + {{ 0x1066, 0x00ce }, 0}, /* E-TEN USB Sync */ + {{ 0x1066, 0x0300 }, 0}, /* E-TEN P3XX Pocket PC */ + {{ 0x1066, 0x0500 }, 0}, /* E-TEN P5XX Pocket PC */ + {{ 0x1066, 0x0600 }, 0}, /* E-TEN P6XX Pocket PC */ + {{ 0x1066, 0x0700 }, 0}, /* E-TEN P7XX Pocket PC */ + {{ 0x1114, 0x0001 }, 0}, /* Psion Teklogix Sync 753x */ + {{ 0x1114, 0x0004 }, 0}, /* Psion Teklogix Sync netBookPro */ + {{ 0x1114, 0x0006 }, 0}, /* Psion Teklogix Sync 7525 */ + {{ 0x1182, 0x1388 }, 0}, /* VES USB Sync */ + {{ 0x11d9, 0x1002 }, 0}, /* Rugged Pocket PC 2003 */ + {{ 0x11d9, 0x1003 }, 0}, /* Rugged Pocket PC 2003 */ + {{ 0x1231, 0xce01 }, 0}, /* USB Sync 03 */ + {{ 0x1231, 0xce02 }, 0}, /* USB Sync 03 */ + {{ 0x3340, 0x011c }, 0}, /* Mio DigiWalker PPC StrongARM */ + {{ 0x3340, 0x0326 }, 0}, /* Mio DigiWalker 338 */ + {{ 0x3340, 0x0426 }, 0}, /* Mio DigiWalker 338 */ + {{ 0x3340, 0x043a }, 0}, /* Mio DigiWalker USB Sync */ + {{ 0x3340, 0x051c }, 0}, /* MiTAC USB Sync 528 */ + {{ 0x3340, 0x053a }, 0}, /* Mio DigiWalker SmartPhone USB Sync */ + {{ 0x3340, 0x071c }, 0}, /* MiTAC USB Sync */ + {{ 0x3340, 0x0b1c }, 0}, /* Generic PPC StrongARM */ + {{ 0x3340, 0x0e3a }, 0}, /* Generic PPC USB Sync */ + {{ 0x3340, 0x0f1c }, 0}, /* Itautec USB Sync */ + {{ 0x3340, 0x0f3a }, 0}, /* Generic SmartPhone USB Sync */ + {{ 0x3340, 0x1326 }, 0}, /* Itautec USB Sync */ + {{ 0x3340, 0x191c }, 0}, /* YAKUMO USB Sync */ + {{ 0x3340, 0x2326 }, 0}, /* Vobis USB Sync */ + {{ 0x3340, 0x3326 }, 0}, /* MEDION Winodws Moble USB Sync */ + {{ 0x3708, 0x20ce }, 0}, /* Legend USB Sync */ + {{ 0x3708, 0x21ce }, 0}, /* Lenovo USB Sync */ + {{ 0x4113, 0x0210 }, 0}, /* Mobile Media Technology USB Sync */ + {{ 0x4113, 0x0211 }, 0}, /* Mobile Media Technology USB Sync */ + {{ 0x4113, 0x0400 }, 0}, /* Mobile Media Technology USB Sync */ + {{ 0x4113, 0x0410 }, 0}, /* Mobile Media Technology USB Sync */ + {{ 0x4505, 0x0010 }, 0}, /* Smartphone */ + {{ 0x5e04, 0xce00 }, 0}, /* SAGEM Wireless Assistant */ + {{ USB_VENDOR_ACER, 0x1631 }, 0}, /* c10 Series */ + {{ USB_VENDOR_ACER, 0x1632 }, 0}, /* c20 Series */ + {{ USB_VENDOR_ACER, 0x16e1 }, 0}, /* Acer n10 Handheld USB Sync */ + {{ USB_VENDOR_ACER, 0x16e2 }, 0}, /* Acer n20 Handheld USB Sync */ + {{ USB_VENDOR_ACER, 0x16e3 }, 0}, /* Acer n30 Handheld USB Sync */ + {{ USB_VENDOR_ASUS, 0x4200 }, 0}, /* ASUS USB Sync */ + {{ USB_VENDOR_ASUS, 0x4201 }, 0}, /* ASUS USB Sync */ + {{ USB_VENDOR_ASUS, 0x4202 }, 0}, /* ASUS USB Sync */ + {{ USB_VENDOR_ASUS, 0x9200 }, 0}, /* ASUS USB Sync */ + {{ USB_VENDOR_ASUS, 0x9202 }, 0}, /* ASUS USB Sync */ + {{ USB_VENDOR_ASUS, USB_PRODUCT_ASUS_P535 }, 0}, + {{ USB_VENDOR_CASIO, 0x2001 }, 0}, /* CASIO USB Sync 2001 */ + {{ USB_VENDOR_CASIO, 0x2003 }, 0}, /* CASIO USB Sync 2003 */ + {{ USB_VENDOR_CASIO, USB_PRODUCT_CASIO_BE300 } , 0}, + {{ USB_VENDOR_COMPAL, 0x0531 }, 0}, /* MyGuide 7000 XL USB Sync */ + {{ USB_VENDOR_COMPAQ, 0x0032 }, 0}, /* Compaq iPAQ USB Sync */ + {{ USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_IPAQPOCKETPC } , 0}, + {{ USB_VENDOR_DELL, 0x4001 }, 0}, /* Dell Axim USB Sync */ + {{ USB_VENDOR_DELL, 0x4002 }, 0}, /* Dell Axim USB Sync */ + {{ USB_VENDOR_DELL, 0x4003 }, 0}, /* Dell Axim USB Sync */ + {{ USB_VENDOR_DELL, 0x4004 }, 0}, /* Dell Axim USB Sync */ + {{ USB_VENDOR_DELL, 0x4005 }, 0}, /* Dell Axim USB Sync */ + {{ USB_VENDOR_DELL, 0x4006 }, 0}, /* Dell Axim USB Sync */ + {{ USB_VENDOR_DELL, 0x4007 }, 0}, /* Dell Axim USB Sync */ + {{ USB_VENDOR_DELL, 0x4008 }, 0}, /* Dell Axim USB Sync */ + {{ USB_VENDOR_DELL, 0x4009 }, 0}, /* Dell Axim USB Sync */ + {{ USB_VENDOR_FSC, 0x1001 }, 0}, /* Fujitsu Siemens Computers USB Sync */ + {{ USB_VENDOR_FUJITSU, 0x1058 }, 0}, /* FUJITSU USB Sync */ + {{ USB_VENDOR_FUJITSU, 0x1079 }, 0}, /* FUJITSU USB Sync */ + {{ USB_VENDOR_GIGASET, 0x0601 }, 0}, /* Askey USB Sync */ + {{ USB_VENDOR_HITACHI, 0x0014 }, 0}, /* Hitachi USB Sync */ + {{ USB_VENDOR_HP, 0x1216 }, 0}, /* HP USB Sync 1612 */ + {{ USB_VENDOR_HP, 0x2016 }, 0}, /* HP USB Sync 1620 */ + {{ USB_VENDOR_HP, 0x2116 }, 0}, /* HP USB Sync 1621 */ + {{ USB_VENDOR_HP, 0x2216 }, 0}, /* HP USB Sync 1622 */ + {{ USB_VENDOR_HP, 0x3016 }, 0}, /* HP USB Sync 1630 */ + {{ USB_VENDOR_HP, 0x3116 }, 0}, /* HP USB Sync 1631 */ + {{ USB_VENDOR_HP, 0x3216 }, 0}, /* HP USB Sync 1632 */ + {{ USB_VENDOR_HP, 0x4016 }, 0}, /* HP USB Sync 1640 */ + {{ USB_VENDOR_HP, 0x4116 }, 0}, /* HP USB Sync 1641 */ + {{ USB_VENDOR_HP, 0x4216 }, 0}, /* HP USB Sync 1642 */ + {{ USB_VENDOR_HP, 0x5016 }, 0}, /* HP USB Sync 1650 */ + {{ USB_VENDOR_HP, 0x5116 }, 0}, /* HP USB Sync 1651 */ + {{ USB_VENDOR_HP, 0x5216 }, 0}, /* HP USB Sync 1652 */ + {{ USB_VENDOR_HP, USB_PRODUCT_HP_2215 }, 0 }, + {{ USB_VENDOR_HP, USB_PRODUCT_HP_568J }, 0}, + {{ USB_VENDOR_HTC, 0x00cf }, 0}, /* HTC USB Modem */ + {{ USB_VENDOR_HTC, 0x0a01 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a02 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a03 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a04 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a05 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a06 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a07 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a08 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a09 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a0a }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a0b }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a0c }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a0d }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a0e }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a0f }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a10 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a11 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a12 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a13 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a14 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a15 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a16 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a17 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a18 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a19 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a1a }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a1b }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a1c }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a1d }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a1e }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a1f }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a20 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a21 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a22 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a23 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a24 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a25 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a26 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a27 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a28 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a29 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a2a }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a2b }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a2c }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a2d }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a2e }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a2f }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a30 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a31 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a32 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a33 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a34 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a35 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a36 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a37 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a38 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a39 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a3a }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a3b }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a3c }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a3d }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a3e }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a3f }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a40 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a41 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a42 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a43 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a44 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a45 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a46 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a47 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a48 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a49 }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a4a }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a4b }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a4c }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a4d }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a4e }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a4f }, 0}, /* PocketPC USB Sync */ + {{ USB_VENDOR_HTC, 0x0a50 }, 0}, /* HTC SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a52 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a53 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a54 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a55 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a56 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a57 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a58 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a59 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a5a }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a5b }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a5c }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a5d }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a5e }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a5f }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a60 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a61 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a62 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a63 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a64 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a65 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a66 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a67 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a68 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a69 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a6a }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a6b }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a6c }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a6d }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a6e }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a6f }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a70 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a71 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a72 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a73 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a74 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a75 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a76 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a77 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a78 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a79 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a7a }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a7b }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a7c }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a7d }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a7e }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a7f }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a80 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a81 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a82 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a83 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a84 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a85 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a86 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a87 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a88 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a89 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a8a }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a8b }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a8c }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a8d }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a8e }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a8f }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a90 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a91 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a92 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a93 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a94 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a95 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a96 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a97 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a98 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a99 }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a9a }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a9b }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a9c }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a9d }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a9e }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0a9f }, 0}, /* SmartPhone USB Sync */ + {{ USB_VENDOR_HTC, 0x0bce }, 0}, /* "High Tech Computer Corp" */ + {{ USB_VENDOR_HTC, USB_PRODUCT_HTC_PPC6700MODEM }, 0}, + {{ USB_VENDOR_HTC, USB_PRODUCT_HTC_SMARTPHONE }, 0}, + {{ USB_VENDOR_HTC, USB_PRODUCT_HTC_WINMOBILE }, 0}, + {{ USB_VENDOR_JVC, 0x3011 }, 0}, /* JVC USB Sync */ + {{ USB_VENDOR_JVC, 0x3012 }, 0}, /* JVC USB Sync */ + {{ USB_VENDOR_LG, 0x9c01 }, 0}, /* LGE USB Sync */ + {{ USB_VENDOR_MICROSOFT, 0x00ce }, 0}, /* Microsoft USB Sync */ + {{ USB_VENDOR_MICROSOFT, 0x0400 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0401 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0402 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0403 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0404 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0405 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0406 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0407 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0408 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0409 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x040a }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x040b }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x040c }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x040d }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x040e }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x040f }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0410 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0411 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0412 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0413 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0414 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0415 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0416 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0417 }, 0}, /* Windows Pocket PC 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x0432 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0433 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0434 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0435 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0436 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0437 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0438 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0439 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x043a }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x043b }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x043c }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x043d }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x043e }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x043f }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0440 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0441 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0442 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0443 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0444 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0445 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0446 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0447 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0448 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0449 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x044a }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x044b }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x044c }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x044d }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x044e }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x044f }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0450 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0451 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0452 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0453 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0454 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0455 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0456 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0457 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0458 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0459 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x045a }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x045b }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x045c }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x045d }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x045e }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x045f }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0460 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0461 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0462 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0463 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0464 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0465 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0466 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0467 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0468 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0469 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x046a }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x046b }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x046c }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x046d }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x046e }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x046f }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0470 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0471 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0472 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0473 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0474 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0475 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0476 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0477 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0478 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x0479 }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x047a }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x047b }, 0}, /* Windows Pocket PC 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04c8 }, 0}, /* Windows Smartphone 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x04c9 }, 0}, /* Windows Smartphone 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x04ca }, 0}, /* Windows Smartphone 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x04cb }, 0}, /* Windows Smartphone 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x04cc }, 0}, /* Windows Smartphone 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x04cd }, 0}, /* Windows Smartphone 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x04ce }, 0}, /* Windows Smartphone 2002 */ + {{ USB_VENDOR_MICROSOFT, 0x04d7 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04d8 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04d9 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04da }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04db }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04dc }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04dd }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04de }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04df }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e0 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e1 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e2 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e3 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e4 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e5 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e6 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e7 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e8 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04e9 }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MICROSOFT, 0x04ea }, 0}, /* Windows Smartphone 2003 */ + {{ USB_VENDOR_MOTOROLA2, 0x4204 }, 0}, /* Motorola MPx200 Smartphone */ + {{ USB_VENDOR_MOTOROLA2, 0x4214 }, 0}, /* Motorola MPc GSM */ + {{ USB_VENDOR_MOTOROLA2, 0x4224 }, 0}, /* Motorola MPx220 Smartphone */ + {{ USB_VENDOR_MOTOROLA2, 0x4234 }, 0}, /* Motorola MPc CDMA */ + {{ USB_VENDOR_MOTOROLA2, 0x4244 }, 0}, /* Motorola MPx100 Smartphone */ + {{ USB_VENDOR_NEC, 0x00d5 }, 0}, /* NEC USB Sync */ + {{ USB_VENDOR_NEC, 0x00d6 }, 0}, /* NEC USB Sync */ + {{ USB_VENDOR_NEC, 0x00d7 }, 0}, /* NEC USB Sync */ + {{ USB_VENDOR_NEC, 0x8024 }, 0}, /* NEC USB Sync */ + {{ USB_VENDOR_NEC, 0x8025 }, 0}, /* NEC USB Sync */ + {{ USB_VENDOR_PANASONIC, 0x2500 }, 0}, /* Panasonic USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x5f00 }, 0}, /* Samsung NEXiO USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x5f01 }, 0}, /* Samsung NEXiO USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x5f02 }, 0}, /* Samsung NEXiO USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x5f03 }, 0}, /* Samsung NEXiO USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x5f04 }, 0}, /* Samsung NEXiO USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x6611 }, 0}, /* Samsung MITs USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x6613 }, 0}, /* Samsung MITs USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x6615 }, 0}, /* Samsung MITs USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x6617 }, 0}, /* Samsung MITs USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x6619 }, 0}, /* Samsung MITs USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x661b }, 0}, /* Samsung MITs USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x662e }, 0}, /* Samsung MITs USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x6630 }, 0}, /* Samsung MITs USB Sync */ + {{ USB_VENDOR_SAMSUNG, 0x6632 }, 0}, /* Samsung MITs USB Sync */ + {{ USB_VENDOR_SHARP, 0x9102 }, 0}, /* SHARP WS003SH USB Modem */ + {{ USB_VENDOR_SHARP, 0x9121 }, 0}, /* SHARP WS004SH USB Modem */ + {{ USB_VENDOR_SHARP, 0x9151 }, 0}, /* SHARP S01SH USB Modem */ + {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WZERO3ES }, 0}, + {{ USB_VENDOR_SYMBOL, 0x2000 }, 0}, /* Symbol USB Sync */ + {{ USB_VENDOR_SYMBOL, 0x2001 }, 0}, /* Symbol USB Sync 0x2001 */ + {{ USB_VENDOR_SYMBOL, 0x2002 }, 0}, /* Symbol USB Sync 0x2002 */ + {{ USB_VENDOR_SYMBOL, 0x2003 }, 0}, /* Symbol USB Sync 0x2003 */ + {{ USB_VENDOR_SYMBOL, 0x2004 }, 0}, /* Symbol USB Sync 0x2004 */ + {{ USB_VENDOR_SYMBOL, 0x2005 }, 0}, /* Symbol USB Sync 0x2005 */ + {{ USB_VENDOR_SYMBOL, 0x2006 }, 0}, /* Symbol USB Sync 0x2006 */ + {{ USB_VENDOR_SYMBOL, 0x2007 }, 0}, /* Symbol USB Sync 0x2007 */ + {{ USB_VENDOR_SYMBOL, 0x2008 }, 0}, /* Symbol USB Sync 0x2008 */ + {{ USB_VENDOR_SYMBOL, 0x2009 }, 0}, /* Symbol USB Sync 0x2009 */ + {{ USB_VENDOR_SYMBOL, 0x200a }, 0}, /* Symbol USB Sync 0x200a */ + {{ USB_VENDOR_TOSHIBA, 0x0700 }, 0}, /* TOSHIBA USB Sync 0700 */ + {{ USB_VENDOR_TOSHIBA, 0x0705 }, 0}, /* TOSHIBA Pocket PC e310 */ + {{ USB_VENDOR_TOSHIBA, 0x0707 }, 0}, /* TOSHIBA Pocket PC e330 Series */ + {{ USB_VENDOR_TOSHIBA, 0x0708 }, 0}, /* TOSHIBA Pocket PC e350Series */ + {{ USB_VENDOR_TOSHIBA, 0x0709 }, 0}, /* TOSHIBA Pocket PC e750 Series */ + {{ USB_VENDOR_TOSHIBA, 0x070a }, 0}, /* TOSHIBA Pocket PC e400 Series */ + {{ USB_VENDOR_TOSHIBA, 0x070b }, 0}, /* TOSHIBA Pocket PC e800 Series */ + {{ USB_VENDOR_TOSHIBA, USB_PRODUCT_TOSHIBA_POCKETPC_E740 }, 0}, /* TOSHIBA Pocket PC e740 */ + {{ USB_VENDOR_VIEWSONIC, 0x0ed9 }, 0}, /* ViewSonic Color Pocket PC V35 */ + {{ USB_VENDOR_VIEWSONIC, 0x1527 }, 0}, /* ViewSonic Color Pocket PC V36 */ + {{ USB_VENDOR_VIEWSONIC, 0x1529 }, 0}, /* ViewSonic Color Pocket PC V37 */ + {{ USB_VENDOR_VIEWSONIC, 0x152b }, 0}, /* ViewSonic Color Pocket PC V38 */ + {{ USB_VENDOR_VIEWSONIC, 0x152e }, 0}, /* ViewSonic Pocket PC */ + {{ USB_VENDOR_VIEWSONIC, 0x1921 }, 0}, /* ViewSonic Communicator Pocket PC */ + {{ USB_VENDOR_VIEWSONIC, 0x1922 }, 0}, /* ViewSonic Smartphone */ + {{ USB_VENDOR_VIEWSONIC, 0x1923 }, 0}, /* ViewSonic Pocket PC V30 */ }; #define uipaq_lookup(v, p) ((const struct uipaq_type *)usb_lookup(uipaq_devs, v, p)) From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 01:41:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8D4C1065673; Thu, 23 Jul 2009 01:41:08 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 954E98FC14; Thu, 23 Jul 2009 01:41:08 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 2FA143BC6C8; Wed, 22 Jul 2009 21:41:08 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 22 Jul 2009 21:41:08 -0400 X-Sasl-enc: +htrv0Kvw6mwTzPh8fSptQnHjKFdJR/PiTZs9Cl8YRuN 1248313267 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 4FB552B9F1; Wed, 22 Jul 2009 21:41:07 -0400 (EDT) Message-ID: <4A67BFB1.40904@incunabulum.net> Date: Thu, 23 Jul 2009 02:41:05 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Bruce M Simpson References: <200907230135.n6N1ZEar057595@svn.freebsd.org> In-Reply-To: <200907230135.n6N1ZEar057595@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r195829 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 01:41:09 -0000 Hi all, I haven't updated the mergeinfo for this file, as the USB stack in HEAD has been completely replaced with the new USB stack. If this is desired, please let me know how to proceed -- I'm new to mergeinfo. When I used the following command to try to maintain the mergeinfo information, I got a very large list of revisions, not all of which look as though they should be merged for this file: % svn merge --record-only -c182138 $FSVN/head/sys/dev/usb/uipaq.c@182138 uipaq.c If I omit the @182138 from the above command, the resultant mergeinfo is empty. thanks, BMS P.S. I tested the code in this commit with an HP iPaq 2215 and it appears to work fine. From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 10:15:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC671065670; Thu, 23 Jul 2009 10:15:22 +0000 (UTC) (envelope-from prvs=144824d4a6=brian@FreeBSD.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id 5BFF68FC08; Thu, 23 Jul 2009 10:15:22 +0000 (UTC) (envelope-from prvs=144824d4a6=brian@FreeBSD.org) Received: from pd6ml2no-ssvc.prod.shaw.ca ([10.0.153.163]) by pd5mo1no-svcs.prod.shaw.ca with ESMTP; 23 Jul 2009 03:47:03 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=9hgBjiEyFVcA:10 a=4Z0QP1WVBuUwHZGQKe2N1A==:17 a=awCybExcAAAA:8 a=MMwg4So0AAAA:8 a=6I5d2MoRAAAA:8 a=tKGW4t-VMDxU3_BKpUQA:9 a=oxZ1sUjUtO-yMlPT-DzJQwY8M4sA:4 a=z2jkVXLrYuwA:10 a=WJ3hkfHDukgA:10 a=SV7veod9ZcQA:10 a=DUDImQE_u13sDucWSrcA:9 a=SAitR033TxKKAKZwAVlIbvYN7zAA:4 Received: from unknown (HELO store.lan.Awfulhak.org) ([174.7.23.140]) by pd6ml2no-dmz.prod.shaw.ca with ESMTP; 23 Jul 2009 03:47:00 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 59818C43548_A68319AB; Thu, 23 Jul 2009 09:47:06 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id CDEC3C460F4_A68318FF; Thu, 23 Jul 2009 09:46:55 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.3/8.14.3) with ESMTP id n6N9kkUx042082; Thu, 23 Jul 2009 02:46:48 -0700 (PDT) (envelope-from brian@FreeBSD.org) Date: Thu, 23 Jul 2009 02:46:40 -0700 From: Brian Somers To: Bruce Simpson Message-ID: <20090723024640.6f5c893a@dev.lan.Awfulhak.org> In-Reply-To: <4A67BFB1.40904@incunabulum.net> References: <200907230135.n6N1ZEar057595@svn.freebsd.org> <4A67BFB1.40904@incunabulum.net> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.4; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/j7SZnq._V4iBURktYQh_wjy"; protocol="application/pgp-signature" Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce M Simpson , svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r195829 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 10:15:23 -0000 --Sig_/j7SZnq._V4iBURktYQh_wjy Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 23 Jul 2009 02:41:05 +0100 Bruce Simpson wrot= e: > Hi all, >=20 > I haven't updated the mergeinfo for this file, as the USB stack in=20 > HEAD has been completely replaced with the new USB stack. If this is=20 > desired, please let me know how to proceed -- I'm new to mergeinfo. >=20 > When I used the following command to try to maintain the mergeinfo=20 > information, I got a very large list of revisions, not all of which look= =20 > as though they should be merged for this file: > % svn merge --record-only -c182138=20 > $FSVN/head/sys/dev/usb/uipaq.c@182138 uipaq.c >=20 > If I omit the @182138 from the above command, the resultant mergeinfo is= =20 > empty. >=20 > thanks, > BMS >=20 > P.S. I tested the code in this commit with an HP iPaq 2215 and it=20 > appears to work fine. It seems ok to me: brian@dev svn $ cd stable/7/sys brian@dev sys $ svn merge --record-only -c182138 ^/head/sys brian@dev sys $ svn diff Property changes on: . ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys:r182138 Property changes on: contrib/pf ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/contrib/pf:r182138 brian@dev sys $ svn st M . M contrib/pf You should keep the mergeinfo on the sys directory, so the entire merge should really have been done as with the above command but without the --record-only - that would update the mergeinfo properties (as above) and patch uipaq.c in one commit. HTH. --=20 Brian Somers Don't _EVER_ lose your sense of humour ! --Sig_/j7SZnq._V4iBURktYQh_wjy Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iQCVAwUBSmgxhg7tvOdmanQhAQIVYgP/dYqPUOgdQczdOuFvw1oLXSvks/yalfmW 5AcVNzs/ktcbySgZRLqQDj6cccRM1twM/MJ6W+/Z5K7EDIlVHl8EGFFRay0rB8zE NgYEEXc5SZJGlZZV1A4azB/mFIyq773KJwDeQzNAqNISPrq4HmKoDKPktWe6n+x5 rZUuRyswGec= =VBH2 -----END PGP SIGNATURE----- --Sig_/j7SZnq._V4iBURktYQh_wjy-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 10:20:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA4BC1065674; Thu, 23 Jul 2009 10:20:12 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8DA38FC19; Thu, 23 Jul 2009 10:20:12 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NAKCTd075873; Thu, 23 Jul 2009 10:20:12 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6NAKCo8075872; Thu, 23 Jul 2009 10:20:12 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200907231020.n6NAKCo8075872@svn.freebsd.org> From: Brian Somers Date: Thu, 23 Jul 2009 10:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195830 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 10:20:13 -0000 Author: brian Date: Thu Jul 23 10:20:12 2009 New Revision: 195830 URL: http://svn.freebsd.org/changeset/base/195830 Log: Add the -d switch to the usage message. Submitted by: Emil Mikulic - emil at dmr dot ath dot cx Approved by: re (kib) MFC after: 1 week Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Thu Jul 23 01:35:13 2009 (r195829) +++ head/bin/ps/ps.c Thu Jul 23 10:20:12 2009 (r195830) @@ -1331,7 +1331,7 @@ check_procfs(void) static void usage(void) { -#define SINGLE_OPTS "[-aCce" OPT_LAZY_f "HhjlmrSTuvwXxZ]" +#define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]" (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]", From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 10:45:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE2651065676; Thu, 23 Jul 2009 10:45:20 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 7BEED8FC1D; Thu, 23 Jul 2009 10:45:20 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from a91-153-125-115.elisa-laajakaista.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id 6657D13971E; Thu, 23 Jul 2009 13:30:15 +0300 (EEST) Date: Thu, 23 Jul 2009 13:30:15 +0300 From: Jaakko Heinonen To: John Baldwin Message-ID: <20090723103014.GA2316@a91-153-125-115.elisa-laajakaista.fi> References: <200907141945.n6EJjaMC069356@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200907141945.n6EJjaMC069356@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195693 - in head: lib/libc/sys sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 10:45:21 -0000 Hi, On 2009-07-14, John Baldwin wrote: > - Change mmap() to fail requests with EINVAL that pass a length of 0. This > behavior is mandated by POSIX. After this change locate(1) gives an obscure error message for empty database files. Before: $ locate -d /dev/null foo locate: database too small: /dev/null After: $ locate -d /dev/null foo locate: mmap ``/dev/null'': Invalid argument Here's a patch to restore the behavior. %%% Index: usr.bin/locate/locate/locate.c =================================================================== --- usr.bin/locate/locate/locate.c (revision 195811) +++ usr.bin/locate/locate/locate.c (working copy) @@ -292,6 +292,9 @@ search_mmap(db, s) err(1, "`%s'", db); len = sb.st_size; + if (len == 0) + errx(1, "database too small: %s", db); + if ((p = mmap((caddr_t)0, (size_t)len, PROT_READ, MAP_SHARED, fd, (off_t)0)) == MAP_FAILED) %%% -- Jaakko From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 12:40:47 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 185E6106566B; Thu, 23 Jul 2009 12:40:47 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id D85E08FC0A; Thu, 23 Jul 2009 12:40:46 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 3847F3BCF60; Thu, 23 Jul 2009 08:40:46 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 23 Jul 2009 08:40:46 -0400 X-Sasl-enc: 9esvlyEtqfKMpY46ULzKVnaQxQKzCxGLPiDOvF/buv3l 1248352845 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 2E926B4A5; Thu, 23 Jul 2009 08:40:45 -0400 (EDT) Message-ID: <4A685A4B.9070201@incunabulum.net> Date: Thu, 23 Jul 2009 13:40:43 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Brian Somers References: <200907230135.n6N1ZEar057595@svn.freebsd.org> <4A67BFB1.40904@incunabulum.net> <20090723024640.6f5c893a@dev.lan.Awfulhak.org> In-Reply-To: <20090723024640.6f5c893a@dev.lan.Awfulhak.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce M Simpson , svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r195829 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 12:40:47 -0000 Brian Somers wrote: > ... > brian@dev sys $ svn st > M . > M contrib/pf > > You should keep the mergeinfo on the sys directory, so the entire merge > should really have been done as with the above command but without > the --record-only - that would update the mergeinfo properties (as above) > and patch uipaq.c in one commit. > Why would this commit update contrib/pf? This looks spurious. I got a lot more revisions than this (especially ones listed well after the new USB merge) in the mergeinfo output, therefore I did not commit the mergeinfo update. Too many to list here ATM. thanks, BMS From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 12:45:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0512A1065677; Thu, 23 Jul 2009 12:45:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C9F7C8FC08; Thu, 23 Jul 2009 12:45:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 84BDE46B51; Thu, 23 Jul 2009 08:45:32 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id A539B8A0A2; Thu, 23 Jul 2009 08:45:31 -0400 (EDT) From: John Baldwin To: Jaakko Heinonen Date: Thu, 23 Jul 2009 08:45:20 -0400 User-Agent: KMail/1.9.7 References: <200907141945.n6EJjaMC069356@svn.freebsd.org> <20090723103014.GA2316@a91-153-125-115.elisa-laajakaista.fi> In-Reply-To: <20090723103014.GA2316@a91-153-125-115.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907230845.21147.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 23 Jul 2009 08:45:31 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195693 - in head: lib/libc/sys sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 12:45:33 -0000 On Thursday 23 July 2009 6:30:15 am Jaakko Heinonen wrote: > > Hi, > > On 2009-07-14, John Baldwin wrote: > > - Change mmap() to fail requests with EINVAL that pass a length of 0. This > > behavior is mandated by POSIX. > > After this change locate(1) gives an obscure error message for empty > database files. Ah, odd. Perhaps it would be best to just move the original "too small" check earlier: Index: fastfind.c =================================================================== --- fastfind.c (revision 195818) +++ fastfind.c (working copy) @@ -154,9 +154,6 @@ /* init bigram table */ #ifdef FF_MMAP - if (len < (2*NBG)) - errx(1, "database too small: %s", database); - for (c = 0, p = bigram1, s = bigram2; c < NBG; c++, len-= 2) { p[c] = check_bigram_char(*paddr++); s[c] = check_bigram_char(*paddr++); Index: locate.c =================================================================== --- locate.c (revision 195818) +++ locate.c (working copy) @@ -291,6 +291,8 @@ fstat(fd, &sb) == -1) err(1, "`%s'", db); len = sb.st_size; + if (len < (2*NBG)) + errx(1, "database too small: %s", database); if ((p = mmap((caddr_t)0, (size_t)len, PROT_READ, MAP_SHARED, This should be functionally identical. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 12:51:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C37E61065676; Thu, 23 Jul 2009 12:51:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0A3F8FC1C; Thu, 23 Jul 2009 12:51:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NCpRcX078924; Thu, 23 Jul 2009 12:51:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6NCpR2J078923; Thu, 23 Jul 2009 12:51:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200907231251.n6NCpR2J078923@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jul 2009 12:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195831 - head/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 12:51:28 -0000 Author: nwhitehorn Date: Thu Jul 23 12:51:27 2009 New Revision: 195831 URL: http://svn.freebsd.org/changeset/base/195831 Log: Fix serial console on Apple Xserve G5 by falling back to input-device-1 if input-device is unavailable. The Xserve G5 defaults to using screen/keyboard for output-device/input-device even if these are not installed, and then falls back to serial ports at boot time. Reviewed by: marcel Hardware from: grehan Approved by: re (kib) Modified: head/sys/dev/uart/uart_cpu_powerpc.c Modified: head/sys/dev/uart/uart_cpu_powerpc.c ============================================================================== --- head/sys/dev/uart/uart_cpu_powerpc.c Thu Jul 23 10:20:12 2009 (r195830) +++ head/sys/dev/uart/uart_cpu_powerpc.c Thu Jul 23 12:51:27 2009 (r195831) @@ -78,6 +78,27 @@ uart_cpu_getdev(int devtype, struct uart return (uart_getenv(devtype, di, class)); } #else +static int +ofw_get_uart_console(phandle_t opts, phandle_t *result, const char *inputdev, + const char *outputdev) +{ + char buf[64]; + phandle_t input; + + if (OF_getprop(opts, inputdev, buf, sizeof(buf)) == -1) + return (ENXIO); + input = OF_finddevice(buf); + if (input == -1) + return (ENXIO); + if (OF_getprop(opts, outputdev, buf, sizeof(buf)) == -1) + return (ENXIO); + if (OF_finddevice(buf) != input) + return (ENXIO); + + *result = input; + return (0); +} + int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { @@ -94,15 +115,17 @@ uart_cpu_getdev(int devtype, struct uart return (ENXIO); switch (devtype) { case UART_DEV_CONSOLE: - if (OF_getprop(opts, "input-device", buf, sizeof(buf)) == -1) - return (ENXIO); - input = OF_finddevice(buf); - if (input == -1) - return (ENXIO); - if (OF_getprop(opts, "output-device", buf, sizeof(buf)) == -1) - return (ENXIO); - if (OF_finddevice(buf) != input) - return (ENXIO); + if (ofw_get_uart_console(opts, &input, "input-device", + "output-device")) { + /* + * At least some G5 Xserves require that we + * probe input-device-1 as well + */ + + if (ofw_get_uart_console(opts, &input, "input-device-1", + "output-device-1")) + return (ENXIO); + } break; case UART_DEV_DBGPORT: if (!getenv_string("hw.uart.dbgport", buf, sizeof(buf))) From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 16:00:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FB1F10656DB; Thu, 23 Jul 2009 16:00:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BB5E8FC12; Thu, 23 Jul 2009 16:00:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NG0cCu082776; Thu, 23 Jul 2009 16:00:38 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6NG0cTf082775; Thu, 23 Jul 2009 16:00:38 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200907231600.n6NG0cTf082775@svn.freebsd.org> From: Ed Maste Date: Thu, 23 Jul 2009 16:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195832 - in stable/6/sys: . boot/common contrib/pf dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 16:00:40 -0000 Author: emaste Date: Thu Jul 23 16:00:37 2009 New Revision: 195832 URL: http://svn.freebsd.org/changeset/base/195832 Log: MFC r163917 by ru: Unbreak compile with ELF_VERBOSE defined, and fix format warnings. Modified: stable/6/sys/ (props changed) stable/6/sys/boot/common/load_elf.c stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/common/load_elf.c ============================================================================== --- stable/6/sys/boot/common/load_elf.c Thu Jul 23 12:51:27 2009 (r195831) +++ stable/6/sys/boot/common/load_elf.c Thu Jul 23 16:00:37 2009 (r195832) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -400,9 +401,9 @@ __elfN(loadimage)(struct preloaded_file lastaddr += sizeof(size); #ifdef ELF_VERBOSE - printf("\n%s: 0x%lx@0x%lx -> 0x%lx-0x%lx", secname, - shdr[i].sh_size, shdr[i].sh_offset, - lastaddr, lastaddr + shdr[i].sh_size); + printf("\n%s: 0x%jx@0x%jx -> 0x%jx-0x%jx", secname, + (uintmax_t)shdr[i].sh_size, (uintmax_t)shdr[i].sh_offset, + (uintmax_t)lastaddr, (uintmax_t)(lastaddr + shdr[i].sh_size)); #else if (i == symstrindex) printf("+"); From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 17:25:03 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75D6B1065756; Thu, 23 Jul 2009 17:25:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 309648FC24; Thu, 23 Jul 2009 17:25:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n6NHNEeQ058386; Thu, 23 Jul 2009 11:23:15 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 23 Jul 2009 13:23:50 -0400 (EDT) Message-Id: <20090723.132350.-432839349.imp@bsdimp.com> To: mav@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <4A66D0F4.4030108@FreeBSD.org> References: <200907220350.n6M3osaj030202@svn.freebsd.org> <4A66D0F4.4030108@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, cperciva@FreeBSD.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 17:25:04 -0000 In message: <4A66D0F4.4030108@FreeBSD.org> Alexander Motin writes: : Colin Percival wrote: : > Author: cperciva : > Date: Wed Jul 22 03:50:54 2009 : > New Revision: 195817 : > URL: http://svn.freebsd.org/changeset/base/195817 : > : > Log: : > Remove the "dedicated disk mode" partitioning option from sysinstall, in : > both the disk partitioning screen (the 'F' key) and via install.cfg (the : > VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x : > due to libdisk and geom generating different partition names; this commit : > merely acts to help steer users away from the breakage. : > : > Submitted by: randi : > Approved by: re (kensmith) : > : > Modified: : > head/usr.sbin/sysinstall/disks.c : : Is there any other way to not align FS block to the ugly legacy 63 : sectors per track boundary with sysinstall now? I think RAIDs won't be : happy. May be it would be better to fix it? The reason we do it like this is because the boot blocks occupy the first cylinder group. Which with today's fake goemetry is 63 blocks... Warner From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 17:52:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B6971065673; Thu, 23 Jul 2009 17:52:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 393228FC0A; Thu, 23 Jul 2009 17:52:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id DEE7746B90; Thu, 23 Jul 2009 13:52:24 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 42B878A0A2; Thu, 23 Jul 2009 13:52:24 -0400 (EDT) From: John Baldwin To: Bruce Simpson Date: Thu, 23 Jul 2009 10:23:46 -0400 User-Agent: KMail/1.9.7 References: <200907230135.n6N1ZEar057595@svn.freebsd.org> <20090723024640.6f5c893a@dev.lan.Awfulhak.org> <4A685A4B.9070201@incunabulum.net> In-Reply-To: <4A685A4B.9070201@incunabulum.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907231023.47428.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 23 Jul 2009 13:52:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable-7@freebsd.org, Brian Somers , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce M Simpson Subject: Re: svn commit: r195829 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 17:52:26 -0000 On Thursday 23 July 2009 8:40:43 am Bruce Simpson wrote: > Brian Somers wrote: > > ... > > brian@dev sys $ svn st > > M . > > M contrib/pf > > > > You should keep the mergeinfo on the sys directory, so the entire merge > > should really have been done as with the above command but without > > the --record-only - that would update the mergeinfo properties (as above) > > and patch uipaq.c in one commit. > > > > Why would this commit update contrib/pf? This looks spurious. This is a FAQ at this point and has been discussed multiple times in the archives, but it is correct. > I got a lot more revisions than this (especially ones listed well after > the new USB merge) in the mergeinfo output, therefore I did not commit > the mergeinfo update. Too many to list here ATM. That's because you merged to the file rather than to sys/. There's a set of instructions about mergning with SVN on the wiki that explains why to do kernel merges to sys/ instead of individual files. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 18:38:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DF06106566B; Thu, 23 Jul 2009 18:38:55 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 199C88FC1B; Thu, 23 Jul 2009 18:38:55 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from a91-153-125-115.elisa-laajakaista.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id B76EA216617; Thu, 23 Jul 2009 21:38:49 +0300 (EEST) Date: Thu, 23 Jul 2009 21:38:49 +0300 From: Jaakko Heinonen To: John Baldwin Message-ID: <20090723183849.GB3773@a91-153-125-115.elisa-laajakaista.fi> References: <200907141945.n6EJjaMC069356@svn.freebsd.org> <20090723103014.GA2316@a91-153-125-115.elisa-laajakaista.fi> <200907230845.21147.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200907230845.21147.jhb@freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195693 - in head: lib/libc/sys sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 18:38:55 -0000 On 2009-07-23, John Baldwin wrote: > > After this change locate(1) gives an obscure error message for empty > > database files. > > Ah, odd. Perhaps it would be best to just move the original "too > small" check earlier: Looks good to me except you should use "db" instead of "database" in search_mmap(). > + if (len < (2*NBG)) > + errx(1, "database too small: %s", database); Thanks. -- Jaakko From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 19:03:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 391881065670; Thu, 23 Jul 2009 19:03:05 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF258FC1B; Thu, 23 Jul 2009 19:03:05 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NJ34nx086637; Thu, 23 Jul 2009 19:03:04 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6NJ34hP086636; Thu, 23 Jul 2009 19:03:04 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907231903.n6NJ34hP086636@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 23 Jul 2009 19:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195835 - in stable/7/sys: . contrib/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 19:03:05 -0000 Author: bms Date: Thu Jul 23 19:03:04 2009 New Revision: 195835 URL: http://svn.freebsd.org/changeset/base/195835 Log: Update mergeinfo for merge of r182138 to sys/dev/usb/uipaq.c. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 19:03:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F351106564A; Thu, 23 Jul 2009 19:03:41 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 377A38FC17; Thu, 23 Jul 2009 19:03:41 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id C6FA43BD547; Thu, 23 Jul 2009 15:03:40 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 23 Jul 2009 15:03:40 -0400 X-Sasl-enc: QhsCuvlcv2cM3NgmoLqs+yFR72ReIt0VgVcCLR/mS2vc 1248375820 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id AB9BCB624; Thu, 23 Jul 2009 15:03:39 -0400 (EDT) Message-ID: <4A68B40A.8020307@incunabulum.net> Date: Thu, 23 Jul 2009 20:03:38 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: John Baldwin References: <200907230135.n6N1ZEar057595@svn.freebsd.org> <20090723024640.6f5c893a@dev.lan.Awfulhak.org> <4A685A4B.9070201@incunabulum.net> <200907231023.47428.jhb@freebsd.org> In-Reply-To: <200907231023.47428.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@freebsd.org, Brian Somers , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce M Simpson Subject: Re: svn commit: r195829 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 19:03:42 -0000 John Baldwin wrote: > ... > That's because you merged to the file rather than to sys/. There's a set of > instructions about mergning with SVN on the wiki that explains why to do > kernel merges to sys/ instead of individual files. > I read them, having been pointed at them by kib@ -- but they didn't explain why contrib/pf was being touched at all. In the absence of other information, I'll take this at face value, and commit the mergeinfo, although I would be happier understanding why contrib/pf is being touched by the merge. Perhaps a purchase of the Subversion book is in my future. thanks, BMS From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 19:43:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 758B31065670; Thu, 23 Jul 2009 19:43:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 637698FC22; Thu, 23 Jul 2009 19:43:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NJhNgj087505; Thu, 23 Jul 2009 19:43:23 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6NJhN3m087504; Thu, 23 Jul 2009 19:43:23 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200907231943.n6NJhN3m087504@svn.freebsd.org> From: Alan Cox Date: Thu, 23 Jul 2009 19:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195836 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 19:43:25 -0000 Author: alc Date: Thu Jul 23 19:43:23 2009 New Revision: 195836 URL: http://svn.freebsd.org/changeset/base/195836 Log: Eliminate unnecessary cache and TLB flushes by pmap_change_attr(). (This optimization was implemented in the amd64 version roughly 1 year ago.) Approved by: re (kensmith) Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jul 23 19:03:04 2009 (r195835) +++ head/sys/i386/i386/pmap.c Thu Jul 23 19:43:23 2009 (r195836) @@ -4482,6 +4482,7 @@ pmap_change_attr(vm_offset_t va, vm_size pt_entry_t *pte; u_int opte, npte; pd_entry_t *pde; + boolean_t changed; base = trunc_page(va); offset = va & PAGE_MASK; @@ -4505,6 +4506,8 @@ pmap_change_attr(vm_offset_t va, vm_size return (EINVAL); } + changed = FALSE; + /* * Ok, all the pages exist and are 4k, so run through them updating * their cache mode. @@ -4522,6 +4525,8 @@ pmap_change_attr(vm_offset_t va, vm_size npte |= pmap_cache_bits(mode, 0); } while (npte != opte && !atomic_cmpset_int((u_int *)pte, opte, npte)); + if (npte != opte) + changed = TRUE; tmpva += PAGE_SIZE; size -= PAGE_SIZE; } @@ -4530,10 +4535,12 @@ pmap_change_attr(vm_offset_t va, vm_size * Flush CPU caches to make sure any data isn't cached that shouldn't * be, etc. */ - pmap_invalidate_range(kernel_pmap, base, tmpva); - /* If "Self Snoop" is supported, do nothing. */ - if (!(cpu_feature & CPUID_SS)) - pmap_invalidate_cache(); + if (changed) { + pmap_invalidate_range(kernel_pmap, base, tmpva); + /* If "Self Snoop" is supported, do nothing. */ + if (!(cpu_feature & CPUID_SS)) + pmap_invalidate_cache(); + } return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 20:00:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD372106566C; Thu, 23 Jul 2009 20:00:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD478FC19; Thu, 23 Jul 2009 20:00:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1FFA546B85; Thu, 23 Jul 2009 16:00:30 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 4C88E8A0A2; Thu, 23 Jul 2009 16:00:29 -0400 (EDT) From: John Baldwin To: Bruce Simpson Date: Thu, 23 Jul 2009 15:16:04 -0400 User-Agent: KMail/1.9.7 References: <200907230135.n6N1ZEar057595@svn.freebsd.org> <200907231023.47428.jhb@freebsd.org> <4A68B40A.8020307@incunabulum.net> In-Reply-To: <4A68B40A.8020307@incunabulum.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907231516.05011.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 23 Jul 2009 16:00:29 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable-7@freebsd.org, Brian Somers , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce M Simpson Subject: Re: svn commit: r195829 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 20:00:31 -0000 On Thursday 23 July 2009 3:03:38 pm Bruce Simpson wrote: > John Baldwin wrote: > > ... > > That's because you merged to the file rather than to sys/. There's a set of > > instructions about mergning with SVN on the wiki that explains why to do > > kernel merges to sys/ instead of individual files. > > > > I read them, having been pointed at them by kib@ -- but they didn't > explain why contrib/pf was being touched at all. True enough, though I was pointing to the docs to explain merging to sys/ rather than the file. I should probably add some note to the wiki page about the "spurious" mergeinfo. The short version is that stable/7/sys/contrib/pf has two sets of mergeinfo: 1 from head/sys/contrib/pf and 2 from vendor-sys/pf. 2) is inherited from head and is a result of a vendor update of pf being merged over from the vendor area into sys/contrib/pf. It is not suitable for other parts of the kernel. 1) is the normal mergeinfo for merges from head/sys to stable/7/sys. However, a design choice in mergeinfo is that mergeinfo is not inherited via pathnames. Specifically, when the svn client starts walking up the path tree to find mergeinfo, it stops at the first parent directory that has any mergeinfo whatsoever and expects that mergeinfo to fully describe all the mergeinfo for its subtree. Thus, because the mergeinfo from 2) is present on sys/contrib/pf, the mergeinfo in 1) has to be duplicated in sys/contrib/pf in addition to sys. I'm not sure this is the best design, but that is the way Subversion works. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 20:46:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36656106564A; Thu, 23 Jul 2009 20:46:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 217E78FC1A; Thu, 23 Jul 2009 20:46:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NKknLC088816; Thu, 23 Jul 2009 20:46:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6NKkntU088803; Thu, 23 Jul 2009 20:46:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907232046.n6NKkntU088803@svn.freebsd.org> From: Robert Watson Date: Thu, 23 Jul 2009 20:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195837 - in head/sys: kern net netgraph netgraph/bluetooth/socket netinet netinet6 netipsec sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 20:46:50 -0000 Author: rwatson Date: Thu Jul 23 20:46:49 2009 New Revision: 195837 URL: http://svn.freebsd.org/changeset/base/195837 Log: Introduce and use a sysinit-based initialization scheme for virtual network stacks, VNET_SYSINIT: - Add VNET_SYSINIT and VNET_SYSUNINIT macros to declare events that will occur each time a network stack is instantiated and destroyed. In the !VIMAGE case, these are simply mapped into regular SYSINIT/SYSUNINIT. For the VIMAGE case, we instead use SYSINIT's to track their order and properties on registration, using them for each vnet when created/ destroyed, or immediately on module load for already-started vnets. - Remove vnet_modinfo mechanism that existed to serve this purpose previously, as well as its dependency scheme: we now just use the SYSINIT ordering scheme. - Implement VNET_DOMAIN_SET() to allow protocol domains to declare that they want init functions to be called for each virtual network stack rather than just once at boot, compiling down to DOMAIN_SET() in the non-VIMAGE case. - Walk all virtualized kernel subsystems and make use of these instead of modinfo or DOMAIN_SET() for init/uninit events. In some cases, convert modular components from using modevent to using sysinit (where appropriate). In some cases, do minor rejuggling of SYSINIT ordering to make room for or better manage events. Portions submitted by: jhb (VNET_SYSINIT), bz (cleanup) Discussed with: jhb, bz, julian, zec Reviewed by: bz Approved by: re (VIMAGE blanket) Modified: head/sys/kern/kern_vimage.c head/sys/kern/uipc_domain.c head/sys/net/flowtable.c head/sys/net/if.c head/sys/net/if_clone.c head/sys/net/if_clone.h head/sys/net/if_gif.c head/sys/net/if_loop.c head/sys/net/route.c head/sys/net/rtsock.c head/sys/net/vnet.c head/sys/net/vnet.h head/sys/netgraph/bluetooth/socket/ng_btsocket.c head/sys/netgraph/netgraph.h head/sys/netgraph/ng_base.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_ether.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_socket.c head/sys/netinet/igmp.c head/sys/netinet/in_proto.c head/sys/netinet6/in6_proto.c head/sys/netinet6/mld6.c head/sys/netipsec/ipsec.c head/sys/netipsec/keysock.c head/sys/sys/domain.h head/sys/sys/kernel.h head/sys/sys/vimage.h Modified: head/sys/kern/kern_vimage.c ============================================================================== --- head/sys/kern/kern_vimage.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/kern/kern_vimage.c Thu Jul 23 20:46:49 2009 (r195837) @@ -52,12 +52,6 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_VNET, "vnet", "network stack control block"); -static TAILQ_HEAD(vnet_modlink_head, vnet_modlink) vnet_modlink_head; -static TAILQ_HEAD(vnet_modpending_head, vnet_modlink) vnet_modpending_head; -static void vnet_mod_complete_registration(struct vnet_modlink *); -static int vnet_mod_constructor(struct vnet_modlink *); -static int vnet_mod_destructor(struct vnet_modlink *); - struct rwlock vnet_rwlock; struct sx vnet_sxlock; @@ -130,185 +124,10 @@ vi_if_move(struct thread *td, struct ifn return (error); } - -/* - * Kernel interfaces and handlers. - */ - -void -vnet_mod_register(const struct vnet_modinfo *vmi) -{ - - vnet_mod_register_multi(vmi, NULL, NULL); -} - -void -vnet_mod_register_multi(const struct vnet_modinfo *vmi, void *iarg, - char *iname) -{ - struct vnet_modlink *vml, *vml_iter; - - /* Do not register the same {module, iarg} pair more than once. */ - TAILQ_FOREACH(vml_iter, &vnet_modlink_head, vml_mod_le) - if (vml_iter->vml_modinfo == vmi && vml_iter->vml_iarg == iarg) - break; - if (vml_iter != NULL) - panic("registering an already registered vnet module: %s", - vml_iter->vml_modinfo->vmi_name); - vml = malloc(sizeof(struct vnet_modlink), M_VNET, M_NOWAIT); - - /* - * XXX we support only statically assigned module IDs at the time. - * In principle modules should be able to get a dynamically - * assigned ID at registration time. - * - * If a module is registered in multiple instances, then each - * instance must have both iarg and iname set. - */ - if (vmi->vmi_id >= VNET_MOD_MAX) - panic("invalid vnet module ID: %d", vmi->vmi_id); - if (vmi->vmi_name == NULL) - panic("vnet module with no name: %d", vmi->vmi_id); - if ((iarg == NULL) ^ (iname == NULL)) - panic("invalid vnet module instance: %s", vmi->vmi_name); - - vml->vml_modinfo = vmi; - vml->vml_iarg = iarg; - vml->vml_iname = iname; - - /* Check whether the module we depend on is already registered. */ - if (vmi->vmi_dependson != vmi->vmi_id) { - TAILQ_FOREACH(vml_iter, &vnet_modlink_head, vml_mod_le) - if (vml_iter->vml_modinfo->vmi_id == - vmi->vmi_dependson) - break; /* Depencency found, we are done. */ - if (vml_iter == NULL) { -#ifdef DEBUG_ORDERING - printf("dependency %d missing for vnet mod %s," - "postponing registration\n", - vmi->vmi_dependson, vmi->vmi_name); -#endif /* DEBUG_ORDERING */ - TAILQ_INSERT_TAIL(&vnet_modpending_head, vml, - vml_mod_le); - return; - } - } - - vnet_mod_complete_registration(vml); -} - -void -vnet_mod_complete_registration(struct vnet_modlink *vml) -{ - VNET_ITERATOR_DECL(vnet_iter); - struct vnet_modlink *vml_iter; - - TAILQ_INSERT_TAIL(&vnet_modlink_head, vml, vml_mod_le); - - VNET_FOREACH(vnet_iter) { - CURVNET_SET_QUIET(vnet_iter); - vnet_mod_constructor(vml); - CURVNET_RESTORE(); - } - - /* Check for pending modules depending on us. */ - do { - TAILQ_FOREACH(vml_iter, &vnet_modpending_head, vml_mod_le) - if (vml_iter->vml_modinfo->vmi_dependson == - vml->vml_modinfo->vmi_id) - break; - if (vml_iter != NULL) { -#ifdef DEBUG_ORDERING - printf("vnet mod %s now registering," - "dependency %d loaded\n", - vml_iter->vml_modinfo->vmi_name, - vml->vml_modinfo->vmi_id); -#endif /* DEBUG_ORDERING */ - TAILQ_REMOVE(&vnet_modpending_head, vml_iter, - vml_mod_le); - vnet_mod_complete_registration(vml_iter); - } - } while (vml_iter != NULL); -} - -void -vnet_mod_deregister(const struct vnet_modinfo *vmi) -{ - - vnet_mod_deregister_multi(vmi, NULL, NULL); -} - -void -vnet_mod_deregister_multi(const struct vnet_modinfo *vmi, void *iarg, - char *iname) -{ - VNET_ITERATOR_DECL(vnet_iter); - struct vnet_modlink *vml; - - TAILQ_FOREACH(vml, &vnet_modlink_head, vml_mod_le) - if (vml->vml_modinfo == vmi && vml->vml_iarg == iarg) - break; - if (vml == NULL) - panic("cannot deregister unregistered vnet module %s", - vmi->vmi_name); - - VNET_FOREACH(vnet_iter) { - CURVNET_SET_QUIET(vnet_iter); - vnet_mod_destructor(vml); - CURVNET_RESTORE(); - } - - TAILQ_REMOVE(&vnet_modlink_head, vml, vml_mod_le); - free(vml, M_VNET); -} - -static int -vnet_mod_constructor(struct vnet_modlink *vml) -{ - const struct vnet_modinfo *vmi = vml->vml_modinfo; - -#ifdef DEBUG_ORDERING - printf("instantiating vnet_%s", vmi->vmi_name); - if (vml->vml_iarg) - printf("/%s", vml->vml_iname); - printf(": "); - if (vmi->vmi_iattach != NULL) - printf("iattach()"); - printf("\n"); -#endif - - if (vmi->vmi_iattach != NULL) - vmi->vmi_iattach(vml->vml_iarg); - - return (0); -} - -static int -vnet_mod_destructor(struct vnet_modlink *vml) -{ - const struct vnet_modinfo *vmi = vml->vml_modinfo; - -#ifdef DEBUG_ORDERING - printf("destroying vnet_%s", vmi->vmi_name); - if (vml->vml_iarg) - printf("/%s", vml->vml_iname); - printf(": "); - if (vmi->vmi_idetach != NULL) - printf("idetach(); "); - printf("\n"); -#endif - - if (vmi->vmi_idetach) - vmi->vmi_idetach(vml->vml_iarg); - - return (0); -} - struct vnet * vnet_alloc(void) { struct vnet *vnet; - struct vnet_modlink *vml; vnet = malloc(sizeof(struct vnet), M_VNET, M_WAITOK | M_ZERO); vnet->vnet_magic_n = VNET_MAGIC_N; @@ -316,11 +135,12 @@ vnet_alloc(void) /* Initialize / attach vnet module instances. */ CURVNET_SET_QUIET(vnet); - TAILQ_FOREACH(vml, &vnet_modlink_head, vml_mod_le) - vnet_mod_constructor(vml); + + sx_xlock(&vnet_sxlock); + vnet_sysinit(); CURVNET_RESTORE(); - VNET_LIST_WLOCK(); + rw_wlock(&vnet_rwlock); LIST_INSERT_HEAD(&vnet_head, vnet, vnet_le); VNET_LIST_WUNLOCK(); @@ -331,14 +151,13 @@ void vnet_destroy(struct vnet *vnet) { struct ifnet *ifp, *nifp; - struct vnet_modlink *vml; KASSERT(vnet->vnet_sockcnt == 0, ("%s: vnet still has sockets", __func__)); VNET_LIST_WLOCK(); LIST_REMOVE(vnet, vnet_le); - VNET_LIST_WUNLOCK(); + rw_wunlock(&vnet_rwlock); CURVNET_SET_QUIET(vnet); @@ -348,10 +167,8 @@ vnet_destroy(struct vnet *vnet) if_vmove(ifp, ifp->if_home_vnet); } - /* Detach / free per-module state instances. */ - TAILQ_FOREACH_REVERSE(vml, &vnet_modlink_head, - vnet_modlink_head, vml_mod_le) - vnet_mod_destructor(vml); + vnet_sysuninit(); + sx_xunlock(&vnet_sxlock); CURVNET_RESTORE(); @@ -387,9 +204,6 @@ static void vnet0_init(void *arg) { - TAILQ_INIT(&vnet_modlink_head); - TAILQ_INIT(&vnet_modpending_head); - /* * We MUST clear curvnet in vi_init_done() before going SMP, * otherwise CURVNET_SET() macros would scream about unnecessary @@ -402,20 +216,8 @@ SYSINIT(vnet0_init, SI_SUB_VNET, SI_ORDE static void vnet_init_done(void *unused) { - struct vnet_modlink *vml_iter; curvnet = NULL; - - if (TAILQ_EMPTY(&vnet_modpending_head)) - return; - - printf("vnet modules with unresolved dependencies:\n"); - TAILQ_FOREACH(vml_iter, &vnet_modpending_head, vml_mod_le) - printf(" %d:%s depending on %d\n", - vml_iter->vml_modinfo->vmi_id, - vml_iter->vml_modinfo->vmi_name, - vml_iter->vml_modinfo->vmi_dependson); - panic("going nowhere without my vnet modules!"); } SYSINIT(vnet_init_done, SI_SUB_VNET_DONE, SI_ORDER_FIRST, vnet_init_done, Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/kern/uipc_domain.c Thu Jul 23 20:46:49 2009 (r195837) @@ -59,17 +59,12 @@ __FBSDID("$FreeBSD$"); */ static void domaininit(void *); -SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL); +SYSINIT(domain, SI_SUB_PROTO_DOMAININIT, SI_ORDER_ANY, domaininit, NULL); static void domainfinalize(void *); SYSINIT(domainfin, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, domainfinalize, NULL); -static vnet_attach_fn net_init_domain; -#ifdef VIMAGE -static vnet_detach_fn net_detach_domain; -#endif - static struct callout pffast_callout; static struct callout pfslow_callout; @@ -106,15 +101,6 @@ struct pr_usrreqs nousrreqs = { .pru_sopoll = pru_sopoll_notsupp, }; -#ifdef VIMAGE -vnet_modinfo_t vnet_domain_modinfo = { - .vmi_id = VNET_MOD_DOMAIN, - .vmi_name = "domain", - .vmi_iattach = net_init_domain, - .vmi_idetach = net_detach_domain, -}; -#endif - static void protosw_init(struct protosw *pr) { @@ -174,10 +160,10 @@ protosw_init(struct protosw *pr) * Note: you cant unload it again because a socket may be using it. * XXX can't fail at this time. */ -static int -net_init_domain(const void *arg) +void +domain_init(void *arg) { - const struct domain *dp = arg; + struct domain *dp = arg; struct protosw *pr; if (dp->dom_init) @@ -191,17 +177,21 @@ net_init_domain(const void *arg) max_datalen = MHLEN - max_hdr; if (max_datalen < 1) panic("%s: max_datalen < 1", __func__); - return (0); } #ifdef VIMAGE -/* - * Detach / free a domain instance. - */ -static int -net_detach_domain(const void *arg) +void +vnet_domain_init(void *arg) +{ + + /* Virtualized case is no different -- call init functions. */ + domain_init(arg); +} + +void +vnet_domain_uninit(void *arg) { - const struct domain *dp = arg; + struct domain *dp = arg; struct protosw *pr; for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) @@ -209,8 +199,6 @@ net_detach_domain(const void *arg) (*pr->pr_destroy)(); if (dp->dom_destroy) (*dp->dom_destroy)(); - - return (0); } #endif @@ -220,7 +208,7 @@ net_detach_domain(const void *arg) * XXX can't fail at this time. */ void -net_add_domain(void *data) +domain_add(void *data) { struct domain *dp; @@ -234,24 +222,19 @@ net_add_domain(void *data) dp->dom_name)); #ifndef INVARIANTS if (domain_init_status < 1) - printf("WARNING: attempt to net_add_domain(%s) before " + printf("WARNING: attempt to domain_add(%s) before " "domaininit()\n", dp->dom_name); #endif #ifdef notyet KASSERT(domain_init_status < 2, - ("attempt to net_add_domain(%s) after domainfinalize()", + ("attempt to domain_add(%s) after domainfinalize()", dp->dom_name)); #else if (domain_init_status >= 2) - printf("WARNING: attempt to net_add_domain(%s) after " + printf("WARNING: attempt to domain_add(%s) after " "domainfinalize()\n", dp->dom_name); #endif mtx_unlock(&dom_mtx); -#ifdef VIMAGE - vnet_mod_register_multi(&vnet_domain_modinfo, dp, dp->dom_name); -#else - net_init_domain(dp); -#endif } static void Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/net/flowtable.c Thu Jul 23 20:46:49 2009 (r195837) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -173,18 +174,6 @@ static VNET_DEFINE(uma_zone_t, flow_ipv6 #define V_flow_ipv4_zone VNET(flow_ipv4_zone) #define V_flow_ipv6_zone VNET(flow_ipv6_zone) -static int flowtable_iattach(const void *); -#ifdef VIMAGE -static int flowtable_idetach(const void *); - -static const vnet_modinfo_t flowtable_modinfo = { - .vmi_id = VNET_MOD_FLOWTABLE, - .vmi_name = "flowtable", - .vmi_iattach = flowtable_iattach, - .vmi_idetach = flowtable_idetach -}; -#endif - /* * TODO: * - Make flowtable stats per-cpu, aggregated at sysctl call time, @@ -802,18 +791,7 @@ flowtable_alloc(int nentry, int flags) } static void -flowtable_setup(void *arg) -{ - -#ifdef VIMAGE - vnet_mod_register(&flowtable_modinfo); -#else - flowtable_iattach(NULL); -#endif -} - -static int -flowtable_iattach(const void *unused __unused) +flowtable_init(const void *unused __unused) { V_flow_ipv4_zone = uma_zcreate("ip4flow", sizeof(struct flentry_v4), @@ -822,21 +800,23 @@ flowtable_iattach(const void *unused __u NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET); uma_zone_set_max(V_flow_ipv4_zone, V_flowtable_nmbflows); uma_zone_set_max(V_flow_ipv6_zone, V_flowtable_nmbflows); - return (0); } +VNET_SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, + flowtable_init, NULL); + #ifdef VIMAGE -static int -flowtable_idetach(const void *unused __unused) +static void +flowtable_uninit(const void *unused __unused) { uma_zdestroy(V_flow_ipv4_zone); uma_zdestroy(V_flow_ipv6_zone); - return (0); } -#endif -SYSINIT(flowtable_setup, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, flowtable_setup, NULL); +VNET_SYSUNINIT(flowtable_uninit, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, + flowtable_uninit, NULL); +#endif /* * The rest of the code is devoted to garbage collection of expired entries. Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/net/if.c Thu Jul 23 20:46:49 2009 (r195837) @@ -150,11 +150,6 @@ static void if_detach_internal(struct if extern void nd6_setmtu(struct ifnet *); #endif -static int vnet_net_iattach(const void *); -#ifdef VIMAGE -static int vnet_net_idetach(const void *); -#endif - VNET_DEFINE(struct ifnethead, ifnet); /* depend on static init XXX */ VNET_DEFINE(struct ifgrouphead, ifg_head); VNET_DEFINE(int, if_index); @@ -171,19 +166,9 @@ struct rwlock ifnet_lock; static if_com_alloc_t *if_com_alloc[256]; static if_com_free_t *if_com_free[256]; -#ifdef VIMAGE -static const vnet_modinfo_t vnet_net_modinfo = { - .vmi_id = VNET_MOD_NET, - .vmi_name = "net", - .vmi_iattach = vnet_net_iattach, - .vmi_idetach = vnet_net_idetach -}; -#endif - /* * System initialization */ -SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_FIRST, if_init, NULL); SYSINIT(interface_check, SI_SUB_PROTO_IF, SI_ORDER_FIRST, if_check, NULL); MALLOC_DEFINE(M_IFNET, "ifnet", "interface internals"); @@ -255,44 +240,41 @@ ifaddr_byindex(u_short idx) * parameters. */ +static void +vnet_if_init(const void *unused __unused) +{ + + TAILQ_INIT(&V_ifnet); + TAILQ_INIT(&V_ifg_head); + if_grow(); /* create initial table */ + vnet_if_clone_init(); +} +VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_FIRST, vnet_if_init, + NULL); + /* ARGSUSED*/ static void if_init(void *dummy __unused) { -#ifdef VIMAGE - vnet_mod_register(&vnet_net_modinfo); -#else - vnet_net_iattach(NULL); -#endif - IFNET_LOCK_INIT(); if_clone_init(); } +SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_SECOND, if_init, NULL); -static int -vnet_net_iattach(const void *unused __unused) -{ - - TAILQ_INIT(&V_ifnet); - TAILQ_INIT(&V_ifg_head); - if_grow(); /* create initial table */ - - return (0); -} #ifdef VIMAGE -static int -vnet_net_idetach(const void *unused __unused) +static void +vnet_if_uninit(const void *unused __unused) { VNET_ASSERT(TAILQ_EMPTY(&V_ifnet)); VNET_ASSERT(TAILQ_EMPTY(&V_ifg_head)); free((caddr_t)V_ifindex_table, M_IFNET); - - return (0); } +VNET_SYSUNINIT(vnet_if_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, + vnet_if_uninit, NULL); #endif void Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/net/if_clone.c Thu Jul 23 20:46:49 2009 (r195837) @@ -55,7 +55,6 @@ static void if_clone_free(struct if_clone *ifc); static int if_clone_createif(struct if_clone *ifc, char *name, size_t len, caddr_t params); -static int vnet_clone_iattach(const void *); static struct mtx if_cloners_mtx; static VNET_DEFINE(int, if_cloners_count); @@ -116,19 +115,11 @@ VNET_DEFINE(LIST_HEAD(, if_clone), if_cl static MALLOC_DEFINE(M_CLONE, "clone", "interface cloning framework"); -#ifdef VIMAGE -static const vnet_modinfo_t vnet_clone_modinfo = { - .vmi_id = VNET_MOD_IF_CLONE, - .vmi_name = "if_clone", - .vmi_iattach = vnet_clone_iattach -}; -#endif - -static int vnet_clone_iattach(const void *unused __unused) +void +vnet_if_clone_init(void) { LIST_INIT(&V_if_cloners); - return (0); } void @@ -136,11 +127,6 @@ if_clone_init(void) { IF_CLONERS_LOCK_INIT(); -#ifdef VIMAGE - vnet_mod_register(&vnet_clone_modinfo); -#else - vnet_clone_iattach(NULL); -#endif } /* Modified: head/sys/net/if_clone.h ============================================================================== --- head/sys/net/if_clone.h Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/net/if_clone.h Thu Jul 23 20:46:49 2009 (r195837) @@ -72,6 +72,7 @@ struct if_clone { void if_clone_init(void); void if_clone_attach(struct if_clone *); void if_clone_detach(struct if_clone *); +void vnet_if_clone_init(void); int if_clone_create(char *, size_t, caddr_t); int if_clone_destroy(const char *); Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/net/if_gif.c Thu Jul 23 20:46:49 2009 (r195837) @@ -96,19 +96,15 @@ static struct mtx gif_mtx; static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); static VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list); -static VNET_DEFINE(int, max_gif_nesting); -static VNET_DEFINE(int, parallel_tunnels); #define V_gif_softc_list VNET(gif_softc_list) -#define V_max_gif_nesting VNET(max_gif_nesting) -#define V_parallel_tunnels VNET(parallel_tunnels) #ifdef INET -VNET_DEFINE(int, ip_gif_ttl); +VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; #define V_ip_gif_ttl VNET(ip_gif_ttl) #endif #ifdef INET6 -VNET_DEFINE(int, ip6_gif_hlim); +VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM; #define V_ip6_gif_hlim VNET(ip6_gif_hlim) #endif @@ -120,16 +116,6 @@ void (*ng_gif_detach_p)(struct ifnet *if static void gif_start(struct ifnet *); static int gif_clone_create(struct if_clone *, int, caddr_t); static void gif_clone_destroy(struct ifnet *); -static int vnet_gif_iattach(const void *); - -#ifdef VIMAGE -static const vnet_modinfo_t vnet_gif_modinfo = { - .vmi_id = VNET_MOD_GIF, - .vmi_name = "gif", - .vmi_dependson = VNET_MOD_NET, - .vmi_iattach = vnet_gif_iattach -}; -#endif IFC_SIMPLE_DECLARE(gif, 0); @@ -149,6 +135,10 @@ SYSCTL_NODE(_net_link, IFT_GIF, gif, CTL */ #define MAX_GIF_NEST 1 #endif + +static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST; +#define V_max_gif_nesting VNET(max_gif_nesting) + SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW, &VNET_NAME(max_gif_nesting), 0, "Max nested tunnels"); @@ -163,6 +153,13 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_ * pair of addresses. Some applications require this functionality so * we allow control over this check here. */ +#ifdef XBONEHACK +static VNET_DEFINE(int, parallel_tunnels) = 1; +#else +static VNET_DEFINE(int, parallel_tunnels) = 0; +#endif +#define V_parallel_tunnels VNET(parallel_tunnels) + SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, parallel_tunnels, CTLFLAG_RW, &VNET_NAME(parallel_tunnels), 0, "Allow parallel tunnels?"); @@ -259,26 +256,14 @@ gif_clone_destroy(ifp) free(sc, M_GIF); } -static int -vnet_gif_iattach(const void *unused __unused) +static void +vnet_gif_init(const void *unused __unused) { LIST_INIT(&V_gif_softc_list); - V_max_gif_nesting = MAX_GIF_NEST; -#ifdef XBONEHACK - V_parallel_tunnels = 1; -#else - V_parallel_tunnels = 0; -#endif -#ifdef INET - V_ip_gif_ttl = GIF_TTL; -#endif -#ifdef INET6 - V_ip6_gif_hlim = GIF_HLIM; -#endif - - return (0); } +VNET_SYSINIT(vnet_gif_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, vnet_gif_init, + NULL); static int gifmodevent(mod, type, data) @@ -290,20 +275,11 @@ gifmodevent(mod, type, data) switch (type) { case MOD_LOAD: mtx_init(&gif_mtx, "gif_mtx", NULL, MTX_DEF); - -#ifdef VIMAGE - vnet_mod_register(&vnet_gif_modinfo); -#else - vnet_gif_iattach(NULL); -#endif if_clone_attach(&gif_cloner); - break; + case MOD_UNLOAD: if_clone_detach(&gif_cloner); -#ifdef VIMAGE - vnet_mod_deregister(&vnet_gif_modinfo); -#endif mtx_destroy(&gif_mtx); break; default: Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/net/if_loop.c Thu Jul 23 20:46:49 2009 (r195837) @@ -103,30 +103,14 @@ int looutput(struct ifnet *ifp, struct struct sockaddr *dst, struct route *ro); static int lo_clone_create(struct if_clone *, int, caddr_t); static void lo_clone_destroy(struct ifnet *); -static int vnet_loif_iattach(const void *); -#ifdef VIMAGE -static int vnet_loif_idetach(const void *); -#endif VNET_DEFINE(struct ifnet *, loif); /* Used externally */ #ifdef VIMAGE -static VNET_DEFINE(struct ifc_simple_data *, lo_cloner_data); -static VNET_DEFINE(struct if_clone *, lo_cloner); +static VNET_DEFINE(struct ifc_simple_data, lo_cloner_data); +static VNET_DEFINE(struct if_clone, lo_cloner); #define V_lo_cloner_data VNET(lo_cloner_data) #define V_lo_cloner VNET(lo_cloner) - -MALLOC_DEFINE(M_LO_CLONER, "lo_cloner", "lo_cloner"); -#endif - -#ifdef VIMAGE -static const vnet_modinfo_t vnet_loif_modinfo = { - .vmi_id = VNET_MOD_LOIF, - .vmi_dependson = VNET_MOD_IF_CLONE, - .vmi_name = "loif", - .vmi_iattach = vnet_loif_iattach, - .vmi_idetach = vnet_loif_idetach -}; #endif IFC_SIMPLE_DECLARE(lo, 1); @@ -170,37 +154,32 @@ lo_clone_create(struct if_clone *ifc, in return (0); } -static int -vnet_loif_iattach(const void *unused __unused) +static void +vnet_loif_init(const void *unused __unused) { #ifdef VIMAGE - V_lo_cloner = malloc(sizeof(*V_lo_cloner), M_LO_CLONER, - M_WAITOK | M_ZERO); - V_lo_cloner_data = malloc(sizeof(*V_lo_cloner_data), M_LO_CLONER, - M_WAITOK | M_ZERO); - bcopy(&lo_cloner, V_lo_cloner, sizeof(*V_lo_cloner)); - bcopy(lo_cloner.ifc_data, V_lo_cloner_data, sizeof(*V_lo_cloner_data)); - V_lo_cloner->ifc_data = V_lo_cloner_data; - if_clone_attach(V_lo_cloner); + V_lo_cloner = lo_cloner; + V_lo_cloner_data = lo_cloner_data; + V_lo_cloner.ifc_data = &V_lo_cloner_data; + if_clone_attach(&V_lo_cloner); #else if_clone_attach(&lo_cloner); #endif - return (0); } +VNET_SYSINIT(vnet_loif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_loif_init, NULL); #ifdef VIMAGE -static int -vnet_loif_idetach(const void *unused __unused) +static void +vnet_loif_uninit(const void *unused __unused) { - if_clone_detach(V_lo_cloner); - free(V_lo_cloner, M_LO_CLONER); - free(V_lo_cloner_data, M_LO_CLONER); + if_clone_detach(&V_lo_cloner); V_loif = NULL; - - return (0); } +VNET_SYSUNINIT(vnet_loif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_loif_uninit, NULL); #endif static int @@ -209,11 +188,6 @@ loop_modevent(module_t mod, int type, vo switch (type) { case MOD_LOAD: -#ifdef VIMAGE - vnet_mod_register(&vnet_loif_modinfo); -#else - vnet_loif_iattach(NULL); -#endif break; case MOD_UNLOAD: Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/net/route.c Thu Jul 23 20:46:49 2009 (r195837) @@ -99,17 +99,6 @@ VNET_DEFINE(struct rtstat, rtstat); static void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); -static int vnet_route_iattach(const void *); -#ifdef VIMAGE -static int vnet_route_idetach(const void *); - -static const vnet_modinfo_t vnet_rtable_modinfo = { - .vmi_id = VNET_MOD_RTABLE, - .vmi_name = "rtable", - .vmi_iattach = vnet_route_iattach, - .vmi_idetach = vnet_route_idetach -}; -#endif /* compare two sockaddr structures */ #define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) @@ -174,6 +163,10 @@ rt_tables_get_rnh(int table, int fam) return (*rt_tables_get_rnh_ptr(table, fam)); } +/* + * route initialization must occur before ip6_init2(), which happenas at + * SI_ORDER_MIDDLE. + */ static void route_init(void) { @@ -184,16 +177,11 @@ route_init(void) if (rt_numfibs == 0) rt_numfibs = 1; rn_init(); /* initialize all zeroes, all ones, mask table */ - -#ifdef VIMAGE - vnet_mod_register(&vnet_rtable_modinfo); -#else - vnet_route_iattach(NULL); -#endif } +SYSINIT(route_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, route_init, 0); -static int -vnet_route_iattach(const void *unused __unused) +static void +vnet_route_init(const void *unused __unused) { struct domain *dom; struct radix_node_head **rnh; @@ -229,13 +217,13 @@ vnet_route_iattach(const void *unused __ } } } - - return (0); } +VNET_SYSINIT(vnet_route_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, + vnet_route_init, 0); #ifdef VIMAGE -static int -vnet_route_idetach(const void *unused __unused) +static void +vnet_route_uninit(const void *unused __unused) { int table; int fam; @@ -259,8 +247,9 @@ vnet_route_idetach(const void *unused __ } } } - return (0); } +VNET_SYSUNINIT(vnet_route_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, + vnet_route_uninit, 0); #endif #ifndef _SYS_SYSPROTO_H_ @@ -1510,6 +1499,3 @@ rtinit(struct ifaddr *ifa, int cmd, int fib = -1; return (rtinit1(ifa, cmd, flags, fib)); } - -/* This must be before ip6_init2(), which is now SI_ORDER_MIDDLE */ -SYSINIT(route, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, route_init, 0); Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/net/rtsock.c Thu Jul 23 20:46:49 2009 (r195837) @@ -35,9 +35,9 @@ #include "opt_inet6.h" #include -#include #include #include +#include #include #include #include @@ -1525,4 +1525,4 @@ static struct domain routedomain = { .dom_protoswNPROTOSW = &routesw[sizeof(routesw)/sizeof(routesw[0])] }; -DOMAIN_SET(route); +VNET_DOMAIN_SET(route); Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Thu Jul 23 19:43:23 2009 (r195836) +++ head/sys/net/vnet.c Thu Jul 23 20:46:49 2009 (r195837) @@ -126,6 +126,16 @@ MALLOC_DEFINE(M_VNET_DATA, "vnet_data", */ static VNET_DEFINE(char, modspace[VNET_MODMIN]); +/* + * Global lists of subsystem constructor and destructors for vnets. + * They are registered via VNET_SYSINIT() and VNET_SYSUNINIT(). The + * lists are protected by the vnet_sxlock global lock. + */ +static TAILQ_HEAD(vnet_sysinit_head, vnet_sysinit) vnet_constructors = + TAILQ_HEAD_INITIALIZER(vnet_constructors); +static TAILQ_HEAD(vnet_sysuninit_head, vnet_sysinit) vnet_destructors = + TAILQ_HEAD_INITIALIZER(vnet_destructors); + struct vnet_data_free { uintptr_t vnd_start; int vnd_len; @@ -339,3 +349,135 @@ vnet_sysctl_handle_uint(SYSCTL_HANDLER_A arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); return (sysctl_handle_int(oidp, arg1, arg2, req)); } + +/* + * Support for special SYSINIT handlers registered via VNET_SYSINIT() + * and VNET_SYSUNINIT(). + */ +void +vnet_register_sysinit(void *arg) +{ + struct vnet_sysinit *vs, *vs2; + struct vnet *vnet; + + vs = arg; + KASSERT(vs->subsystem > SI_SUB_VNET, ("vnet sysinit too early")); + + /* Add the constructor to the global list of vnet constructors. */ + sx_xlock(&vnet_sxlock); + TAILQ_FOREACH(vs2, &vnet_constructors, link) { + if (vs2->subsystem > vs->subsystem) + break; + if (vs2->subsystem == vs->subsystem && vs2->order > vs->order) + break; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 20:51:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC6B8106564A; Thu, 23 Jul 2009 20:51:19 +0000 (UTC) (envelope-from prvs=144824d4a6=brian@FreeBSD.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id 706F88FC16; Thu, 23 Jul 2009 20:51:19 +0000 (UTC) (envelope-from prvs=144824d4a6=brian@FreeBSD.org) Received: from pd7ml1no-ssvc.prod.shaw.ca ([10.0.153.161]) by pd6mo1no-svcs.prod.shaw.ca with ESMTP; 23 Jul 2009 14:51:18 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=9hgBjiEyFVcA:10 a=4Z0QP1WVBuUwHZGQKe2N1A==:17 a=awCybExcAAAA:8 a=MMwg4So0AAAA:8 a=6I5d2MoRAAAA:8 a=Ofibz1gJ8D_GyrKScWQA:9 a=B5u56gGq7mY0cWMgY2E6UkhbjPoA:4 a=z2jkVXLrYuwA:10 a=WJ3hkfHDukgA:10 a=SV7veod9ZcQA:10 Received: from unknown (HELO store.lan.Awfulhak.org) ([174.7.23.140]) by pd7ml1no-dmz.prod.shaw.ca with ESMTP; 23 Jul 2009 14:51:09 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 5A811C43548_A68CD42B; Thu, 23 Jul 2009 20:51:14 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id 71748C460F7_A68CD35F; Thu, 23 Jul 2009 20:51:01 +0000 (GMT) Received: from localhost (brian@gw.lan.Awfulhak.org [172.16.0.1]) by gw.Awfulhak.org (8.14.3/8.14.3) with ESMTP id n6NKoirp069401; Thu, 23 Jul 2009 13:50:47 -0700 (PDT) (envelope-from brian@FreeBSD.org) Date: Thu, 23 Jul 2009 13:50:44 -0700 From: Brian Somers To: Bruce Simpson Message-ID: <20090723135044.53ad9173@FreeBSD.org> In-Reply-To: <4A68B40A.8020307@incunabulum.net> References: <200907230135.n6N1ZEar057595@svn.freebsd.org> <20090723024640.6f5c893a@dev.lan.Awfulhak.org> <4A685A4B.9070201@incunabulum.net> <200907231023.47428.jhb@freebsd.org> <4A68B40A.8020307@incunabulum.net> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.5; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@FreeBSD.org, John Baldwin , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce M Simpson Subject: Re: svn commit: r195829 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 20:51:20 -0000 On Thu, 23 Jul 2009 20:03:38 +0100, Bruce Simpson wrote: > Perhaps a purchase of the Subversion book is in my future. You can download the pdf for free - it's worth reading. IMHO the svn:mergeinfo idea is flawed. It doesn't handle hierarchies with mixed --depth values at all - it should at least handle merges to trees with non-infinity-depth nodes by duplicating the mergeinfo for each non-infinity-depth node from it's closest parent and not merging to the node. The observant committer would of course not commit such a thing (and would set their depth to infinity on these nodes first). -- Brian Somers Don't _EVER_ lose your sense of humour ! From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 21:12:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432A51065676; Thu, 23 Jul 2009 21:12:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 300FC8FC15; Thu, 23 Jul 2009 21:12:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6NLCMSq089425; Thu, 23 Jul 2009 21:12:22 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6NLCMQ1089420; Thu, 23 Jul 2009 21:12:22 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200907232112.n6NLCMQ1089420@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 23 Jul 2009 21:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195838 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 21:12:22 -0000 Author: bz Date: Thu Jul 23 21:12:21 2009 New Revision: 195838 URL: http://svn.freebsd.org/changeset/base/195838 Log: Make libkvm work on live systems and crashdumps with and without VIMAGE virtualization in the kernel. If we cannot resolve a symbol try to see if we can find it with prefix of the virtualized subsystem, currently only "vnet_entry" by identifying either the vnet of the current process for a live system or the vnet of proc0 (or of dumptid if compiled in a non-default way). The way this is done currently allows us to only touch libkvm but no single application. Once we are going to virtualize more subsystems we will have to review this decision for better scaling. Submitted by: rwatson (initial version of kvm_vnet.c, lots of ideas) Reviewed by: rwatson Approved by: re (kib) Added: head/lib/libkvm/kvm_vnet.c (contents, props changed) Modified: head/lib/libkvm/Makefile head/lib/libkvm/kvm.c head/lib/libkvm/kvm_private.h Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Thu Jul 23 20:46:49 2009 (r195837) +++ head/lib/libkvm/Makefile Thu Jul 23 21:12:21 2009 (r195838) @@ -10,7 +10,7 @@ CFLAGS+=-DSUN4V .endif SRCS= kvm.c kvm_${MACHINE_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ - kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c + kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" SRCS+= kvm_minidump_${MACHINE_ARCH}.c .endif Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Thu Jul 23 20:46:49 2009 (r195837) +++ head/lib/libkvm/kvm.c Thu Jul 23 21:12:21 2009 (r195838) @@ -41,6 +41,9 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B #endif /* LIBC_SCCS and not lint */ #include + +#define _WANT_VNET + #include #include #include @@ -48,6 +51,8 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B #include #include +#include + #include #include @@ -62,6 +67,7 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B #include #include #include +#include #include #include "kvm_private.h" @@ -299,34 +305,154 @@ kvm_close(kd) return (0); } +/* + * Walk the list of unresolved symbols, generate a new list and prefix the + * symbol names, try again, and merge back what we could resolve. + */ +static int +kvm_fdnlist_prefix(kvm_t *kd, struct nlist *nl, int missing, const char *prefix, + uintptr_t (*validate_fn)(kvm_t *, uintptr_t)) +{ + struct nlist *n, *np, *p; + char *cp, *ce; + size_t len; + int unresolved; + + /* + * Calculate the space we need to malloc for nlist and names. + * We are going to store the name twice for later lookups: once + * with the prefix and once the unmodified name delmited by \0. + */ + len = 0; + unresolved = 0; + for (p = nl; p->n_name && p->n_name[0]; ++p) { + if (p->n_type != N_UNDF) + continue; + len += sizeof(struct nlist) + strlen(prefix) + + 2 * (strlen(p->n_name) + 1); + unresolved++; + } + if (unresolved == 0) + return (unresolved); + /* Add space for the terminating nlist entry. */ + len += sizeof(struct nlist); + unresolved++; + + /* Alloc one chunk for (nlist, [names]) and setup pointers. */ + n = np = malloc(len); + bzero(n, len); + if (n == NULL) + return (missing); + cp = ce = (char *)np; + cp += unresolved * sizeof(struct nlist); + ce += len; + + /* Generate shortened nlist with special prefix. */ + unresolved = 0; + for (p = nl; p->n_name && p->n_name[0]; ++p) { + if (p->n_type != N_UNDF) + continue; + bcopy(p, np, sizeof(struct nlist)); + /* Save the new\0orig. name so we can later match it again. */ + len = snprintf(cp, ce - cp, "%s%s%c%s", prefix, + (prefix[0] != '\0' && p->n_name[0] == '_') ? + (p->n_name + 1) : p->n_name, '\0', p->n_name); + if (len >= ce - cp) + continue; + np->n_name = cp; + cp += len + 1; + np++; + unresolved++; + } + + /* Do lookup on the reduced list. */ + np = n; + unresolved = __fdnlist(kd->nlfd, np); + + /* Check if we could resolve further symbols and update the list. */ + if (unresolved >= 0 && unresolved < missing) { + /* Find the first freshly resolved entry. */ + for (; np->n_name && np->n_name[0]; np++) + if (np->n_type != N_UNDF) + break; + /* + * The lists are both in the same order, + * so we can walk them in parallel. + */ + for (p = nl; np->n_name && np->n_name[0] && + p->n_name && p->n_name[0]; ++p) { + if (p->n_type != N_UNDF) + continue; + /* Skip expanded name and compare to orig. one. */ + cp = np->n_name + strlen(np->n_name) + 1; + if (strcmp(cp, p->n_name)) + continue; + /* Update nlist with new, translated results. */ + p->n_type = np->n_type; + p->n_other = np->n_other; + p->n_desc = np->n_desc; + if (validate_fn) + p->n_value = (*validate_fn)(kd, np->n_value); + else + p->n_value = np->n_value; + missing--; + /* Find next freshly resolved entry. */ + for (np++; np->n_name && np->n_name[0]; np++) + if (np->n_type != N_UNDF) + break; + } + } + /* We could assert missing = unresolved here. */ + + free(n); + return (unresolved); +} + int -kvm_nlist(kd, nl) - kvm_t *kd; - struct nlist *nl; +_kvm_nlist(kvm_t *kd, struct nlist *nl, int initialize) { struct nlist *p; int nvalid; struct kld_sym_lookup lookup; int error; - + char *prefix = "", symname[1024]; /* XXX-BZ symbol name length limit? */ /* * If we can't use the kld symbol lookup, revert to the * slow library call. */ - if (!ISALIVE(kd)) - return (__fdnlist(kd->nlfd, nl)); + if (!ISALIVE(kd)) { + error = __fdnlist(kd->nlfd, nl); + if (error <= 0) /* Hard error or success. */ + return (error); + + if (_kvm_vnet_initialized(kd, initialize)) + error = kvm_fdnlist_prefix(kd, nl, error, + VNET_SYMPREFIX, _kvm_vnet_validaddr); + + return (error); + } /* * We can use the kld lookup syscall. Go through each nlist entry * and look it up with a kldsym(2) syscall. */ nvalid = 0; +again: for (p = nl; p->n_name && p->n_name[0]; ++p) { + if (p->n_type != N_UNDF) + continue; + lookup.version = sizeof(lookup); - lookup.symname = p->n_name; lookup.symvalue = 0; lookup.symsize = 0; + error = snprintf(symname, sizeof(symname), "%s%s", prefix, + (prefix[0] != '\0' && p->n_name[0] == '_') ? + (p->n_name + 1) : p->n_name); + if (error >= sizeof(symname)) + continue; + + lookup.symname = symname; if (lookup.symname[0] == '_') lookup.symname++; @@ -334,11 +460,28 @@ kvm_nlist(kd, nl) p->n_type = N_TEXT; p->n_other = 0; p->n_desc = 0; - p->n_value = lookup.symvalue; + if (_kvm_vnet_initialized(kd, initialize) && + !strcmp(prefix, VNET_SYMPREFIX)) + p->n_value = + _kvm_vnet_validaddr(kd, lookup.symvalue); + else + p->n_value = lookup.symvalue; ++nvalid; /* lookup.symsize */ } } + + /* + * Check the number of entries that weren't found. If they exist, + * try again with a prefix for virtualized symbol names. + */ + error = ((p - nl) - nvalid); + if (error && _kvm_vnet_initialized(kd, initialize) && + strcmp(prefix, VNET_SYMPREFIX)) { + prefix = VNET_SYMPREFIX; + goto again; + } + /* * Return the number of entries that weren't found. If they exist, * also fill internal error buffer. @@ -349,6 +492,19 @@ kvm_nlist(kd, nl) return (error); } +int +kvm_nlist(kd, nl) + kvm_t *kd; + struct nlist *nl; +{ + + /* + * If called via the public interface, permit intialization of + * further virtualized modules on demand. + */ + return (_kvm_nlist(kd, nl, 1)); +} + ssize_t kvm_read(kd, kva, buf, len) kvm_t *kd; Modified: head/lib/libkvm/kvm_private.h ============================================================================== --- head/lib/libkvm/kvm_private.h Thu Jul 23 20:46:49 2009 (r195837) +++ head/lib/libkvm/kvm_private.h Thu Jul 23 21:12:21 2009 (r195838) @@ -62,6 +62,12 @@ struct __kvm { */ struct vmstate *vmst; int rawdump; /* raw dump format */ + + int vnet_initialized; /* vnet fields set up */ + uintptr_t vnet_start; /* start of kernel's vnet region */ + uintptr_t vnet_stop; /* stop of kernel's vnet region */ + uintptr_t vnet_current; /* vnet we're working with */ + uintptr_t vnet_base; /* vnet base of current vnet */ }; /* @@ -74,10 +80,14 @@ void _kvm_freevtop(kvm_t *); int _kvm_initvtop(kvm_t *); int _kvm_kvatop(kvm_t *, u_long, off_t *); void *_kvm_malloc(kvm_t *kd, size_t); +int _kvm_nlist(kvm_t *, struct nlist *, int); void *_kvm_realloc(kvm_t *kd, void *, size_t); void _kvm_syserr (kvm_t *kd, const char *program, const char *fmt, ...) __printflike(3, 4); int _kvm_uvatop(kvm_t *, const struct proc *, u_long, u_long *); +int _kvm_vnet_selectpid(kvm_t *, pid_t); +int _kvm_vnet_initialized(kvm_t *, int); +uintptr_t _kvm_vnet_validaddr(kvm_t *, uintptr_t); #if defined(__amd64__) || defined(__i386__) || defined(__arm__) void _kvm_minidump_freevtop(kvm_t *); Added: head/lib/libkvm/kvm_vnet.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_vnet.c Thu Jul 23 21:12:21 2009 (r195838) @@ -0,0 +1,237 @@ +/*- + * Copyright (c) 2009 Robert N. M. Watson + * Copyright (c) 2009 Bjoern A. Zeeb + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#define _WANT_PRISON +#define _WANT_UCRED +#define _WANT_VNET + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "kvm_private.h" + +/* + * Set up libkvm to handle virtual network stack symbols by selecting a + * starting pid. + */ +int +_kvm_vnet_selectpid(kvm_t *kd, pid_t pid) +{ + struct proc proc; + struct thread td; + struct ucred cred; + struct prison prison; + struct vnet vnet; + struct nlist nl[] = { + /* + * Note: kvm_nlist strips the first '_' so add an extra one + * here to __{start,stop}_set_vnet. + */ +#define NLIST_START_VNET 0 + { .n_name = "___start_" VNET_SETNAME }, +#define NLIST_STOP_VNET 1 + { .n_name = "___stop_" VNET_SETNAME }, +#define NLIST_VNET_HEAD 2 + { .n_name = "vnet_head" }, +#define NLIST_ALLPROC 3 + { .n_name = "allproc" }, +#define NLIST_DUMPTID 4 + { .n_name = "dumptid" }, +#define NLIST_PROC0 5 + { .n_name = "proc0" }, + { .n_name = NULL }, + }; + uintptr_t procp, tdp, credp; + lwpid_t dumptid; + + /* + * Locate and cache locations of important symbols + * using the internal version of _kvm_nlist, turning + * off initialization to avoid recursion in case of + * unresolveable symbols. + */ + if (_kvm_nlist(kd, nl, 0) != 0) { + /* + * XXX-BZ: ___start_/___stop_VNET_SETNAME may fail. + * For now do not report an error here as we are called + * internally and in `void context' until we merge the + * functionality to optionally activate this into programs. + * By that time we can properly fail and let the callers + * handle the error. + */ + /* _kvm_err(kd, kd->program, "%s: no namelist", __func__); */ + return (-1); + } + + /* + * Auto-detect if this is a crashdump by reading dumptid. + */ + dumptid = 0; + if (nl[NLIST_DUMPTID].n_value) { + if (kvm_read(kd, nl[NLIST_DUMPTID].n_value, &dumptid, + sizeof(dumptid)) != sizeof(dumptid)) { + _kvm_err(kd, kd->program, "%s: dumptid", __func__); + return (-1); + } + } + + /* + * First, find the process for this pid. If we are workig on a dump, + * either locate the thread dumptid is refering to or proc0. + * Based on either, take the address of the ucred. + */ + credp = 0; + + procp = nl[NLIST_ALLPROC].n_value; +#define VMCORE_VNET_OF_PROC0 +#ifdef VMCORE_VNET_OF_PROC0 + if (dumptid > 0) { + procp = nl[NLIST_PROC0].n_value; + pid = 0; + } +#endif + while (procp != 0) { + if (kvm_read(kd, procp, &proc, sizeof(proc)) != sizeof(proc)) { + _kvm_err(kd, kd->program, "%s: proc", __func__); + return (-1); + } +#ifndef VMCORE_VNET_OF_PROC0 + if (dumptid > 0) { + tdp = (uintptr_t)TAILQ_FIRST(&proc.p_threads); + while (tdp != 0) { + if (kvm_read(kd, tdp, &td, sizeof(td)) != + sizeof(td)) { + _kvm_err(kd, kd->program, "%s: thread", + __func__); + return (-1); + } + if (td.td_tid == dumptid) { + credp = (uintptr_t)td.td_ucred; + break; + } + tdp = (uintptr_t)TAILQ_NEXT(&td, td_plist); + } + } else +#endif + if (proc.p_pid == pid) + credp = (uintptr_t)proc.p_ucred; + if (credp != 0) + break; + procp = (uintptr_t)LIST_NEXT(&proc, p_list); + } + if (credp == 0) { + _kvm_err(kd, kd->program, "%s: pid/tid not found", __func__); + return (-1); + } + if (kvm_read(kd, (uintptr_t)credp, &cred, sizeof(cred)) != + sizeof(cred)) { + _kvm_err(kd, kd->program, "%s: cred", __func__); + return (-1); + } + if (cred.cr_prison == NULL) { + _kvm_err(kd, kd->program, "%s: no jail", __func__); + return (-1); + } + if (kvm_read(kd, (uintptr_t)cred.cr_prison, &prison, sizeof(prison)) != + sizeof(prison)) { + _kvm_err(kd, kd->program, "%s: prison", __func__); + return (-1); + } + if (prison.pr_vnet == NULL) { + _kvm_err(kd, kd->program, "%s: no vnet", __func__); + return (-1); + } + if (kvm_read(kd, (uintptr_t)prison.pr_vnet, &vnet, sizeof(vnet)) != + sizeof(vnet)) { + _kvm_err(kd, kd->program, "%s: vnet", __func__); + return (-1); + } + if (vnet.vnet_magic_n != VNET_MAGIC_N) { + _kvm_err(kd, kd->program, "%s: invalid vnet magic#", __func__); + return (-1); + } + kd->vnet_initialized = 1; + kd->vnet_start = nl[NLIST_START_VNET].n_value; + kd->vnet_stop = nl[NLIST_STOP_VNET].n_value; + kd->vnet_current = (uintptr_t)prison.pr_vnet; + kd->vnet_base = (uintptr_t)vnet.vnet_data_mem - kd->vnet_start; + return (0); +} + +/* + * Check whether the vnet module has been initialized sucessfully + * or not, intialize it if permitted. + */ +int +_kvm_vnet_initialized(kvm_t *kd, int intialize) +{ + + if (kd->vnet_initialized || !intialize) + return (kd->vnet_initialized); + + (void) _kvm_vnet_selectpid(kd, getpid()); + + return (kd->vnet_initialized); +} + +/* + * Check whether the value is within the vnet symbol range and + * only if so adjust the offset relative to the current base. + */ +uintptr_t +_kvm_vnet_validaddr(kvm_t *kd, uintptr_t value) +{ + + if (value == 0) + return (value); + + if (!kd->vnet_initialized) + return (value); + + if (value < kd->vnet_start || value >= kd->vnet_stop) + return (value); + + return (kd->vnet_base + value); +} From owner-svn-src-all@FreeBSD.ORG Thu Jul 23 21:47:08 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE341106566C; Thu, 23 Jul 2009 21:47:08 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF878FC12; Thu, 23 Jul 2009 21:47:08 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n6NLl2Ij012146; Thu, 23 Jul 2009 15:47:02 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A68DA56.60301@samsco.org> Date: Thu, 23 Jul 2009 15:47:02 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: "M. Warner Losh" References: <200907220350.n6M3osaj030202@svn.freebsd.org> <4A66D0F4.4030108@FreeBSD.org> <20090723.132350.-432839349.imp@bsdimp.com> In-Reply-To: <20090723.132350.-432839349.imp@bsdimp.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, mav@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, cperciva@FreeBSD.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 21:47:09 -0000 M. Warner Losh wrote: > In message: <4A66D0F4.4030108@FreeBSD.org> > Alexander Motin writes: > : Colin Percival wrote: > : > Author: cperciva > : > Date: Wed Jul 22 03:50:54 2009 > : > New Revision: 195817 > : > URL: http://svn.freebsd.org/changeset/base/195817 > : > > : > Log: > : > Remove the "dedicated disk mode" partitioning option from sysinstall, in > : > both the disk partitioning screen (the 'F' key) and via install.cfg (the > : > VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x > : > due to libdisk and geom generating different partition names; this commit > : > merely acts to help steer users away from the breakage. > : > > : > Submitted by: randi > : > Approved by: re (kensmith) > : > > : > Modified: > : > head/usr.sbin/sysinstall/disks.c > : > : Is there any other way to not align FS block to the ugly legacy 63 > : sectors per track boundary with sysinstall now? I think RAIDs won't be > : happy. May be it would be better to fix it? > > The reason we do it like this is because the boot blocks occupy the > first cylinder group. Which with today's fake goemetry is 63 > blocks... > I already covered this. Unfortunately, Randi didn't take my bait. Anyways, '63' is a minimum, it's not a singular value. It's also an incredibly bad default. Scott From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 13:40:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A34831065674; Fri, 24 Jul 2009 13:40:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9097E8FC20; Fri, 24 Jul 2009 13:40:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ODePWW011223; Fri, 24 Jul 2009 13:40:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ODeP2B011222; Fri, 24 Jul 2009 13:40:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907241340.n6ODeP2B011222@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jul 2009 13:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195839 - head/usr.bin/locate/locate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 13:40:26 -0000 Author: jhb Date: Fri Jul 24 13:40:25 2009 New Revision: 195839 URL: http://svn.freebsd.org/changeset/base/195839 Log: Move the check to ensure the locate database has the minimum required size when using mmap() before invoking mmap(). This avoids a confusing error message when locate is invoked against a zero-size database after the recent change to make mmap() fail requests to map 0 bytes. Submitted by: Jaakko Heinonen jh of saunalahti dot fi Approved by: re (kensmith) MFC after: 1 week Modified: head/usr.bin/locate/locate/fastfind.c head/usr.bin/locate/locate/locate.c Modified: head/usr.bin/locate/locate/fastfind.c ============================================================================== --- head/usr.bin/locate/locate/fastfind.c Thu Jul 23 21:12:21 2009 (r195838) +++ head/usr.bin/locate/locate/fastfind.c Fri Jul 24 13:40:25 2009 (r195839) @@ -154,9 +154,6 @@ fastfind /* init bigram table */ #ifdef FF_MMAP - if (len < (2*NBG)) - errx(1, "database too small: %s", database); - for (c = 0, p = bigram1, s = bigram2; c < NBG; c++, len-= 2) { p[c] = check_bigram_char(*paddr++); s[c] = check_bigram_char(*paddr++); Modified: head/usr.bin/locate/locate/locate.c ============================================================================== --- head/usr.bin/locate/locate/locate.c Thu Jul 23 21:12:21 2009 (r195838) +++ head/usr.bin/locate/locate/locate.c Fri Jul 24 13:40:25 2009 (r195839) @@ -291,6 +291,8 @@ search_mmap(db, s) fstat(fd, &sb) == -1) err(1, "`%s'", db); len = sb.st_size; + if (len < (2*NBG)) + errx(1, "database too small: %s", db); if ((p = mmap((caddr_t)0, (size_t)len, PROT_READ, MAP_SHARED, From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 13:50:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 265F110656C0; Fri, 24 Jul 2009 13:50:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FD168FC15; Fri, 24 Jul 2009 13:50:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ODoUwC011474; Fri, 24 Jul 2009 13:50:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ODoT7h011449; Fri, 24 Jul 2009 13:50:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907241350.n6ODoT7h011449@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jul 2009 13:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195840 - in head: sys/amd64/amd64 sys/arm/arm sys/conf sys/fs/procfs sys/i386/i386 sys/i386/xen sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/booke sys/sparc64/sparc64 sys/sys sys/v... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 13:50:30 -0000 Author: jhb Date: Fri Jul 24 13:50:29 2009 New Revision: 195840 URL: http://svn.freebsd.org/changeset/base/195840 Log: Add a new type of VM object: OBJT_SG. An OBJT_SG object is very similar to a device pager (OBJT_DEVICE) object in that it uses fictitious pages to provide aliases to other memory addresses. The primary difference is that it uses an sglist(9) to determine the physical addresses for a given offset into the object instead of invoking the d_mmap() method in a device driver. Reviewed by: alc Approved by: re (kensmith) MFC after: 2 weeks Added: head/sys/vm/sg_pager.c (contents, props changed) Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap.c head/sys/conf/files head/sys/fs/procfs/procfs_map.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/kern/kern_proc.c head/sys/mips/mips/pmap.c head/sys/powerpc/booke/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/sys/user.h head/sys/vm/vm.h head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/vm/vm_meter.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c head/sys/vm/vm_pager.c head/sys/vm/vm_pager.h head/usr.bin/procstat/procstat_vm.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/amd64/amd64/pmap.c Fri Jul 24 13:50:29 2009 (r195840) @@ -3359,7 +3359,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs int pat_mode; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if ((addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { if (!vm_object_populate(object, pindex, pindex + atop(size))) Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/arm/arm/pmap.c Fri Jul 24 13:50:29 2009 (r195840) @@ -3101,7 +3101,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/conf/files Fri Jul 24 13:50:29 2009 (r195840) @@ -2637,6 +2637,7 @@ vm/default_pager.c standard vm/device_pager.c standard vm/phys_pager.c standard vm/redzone.c optional DEBUG_REDZONE +vm/sg_pager.c standard vm/swap_pager.c standard vm/uma_core.c standard vm/uma_dbg.c standard Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/fs/procfs/procfs_map.c Fri Jul 24 13:50:29 2009 (r195840) @@ -174,6 +174,7 @@ procfs_doprocmap(PFS_FILL_ARGS) type = "swap"; vp = NULL; break; + case OBJT_SG: case OBJT_DEVICE: type = "device"; vp = NULL; Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/i386/i386/pmap.c Fri Jul 24 13:50:29 2009 (r195840) @@ -3448,7 +3448,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs int pat_mode; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if (pseflag && (addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/i386/xen/pmap.c Fri Jul 24 13:50:29 2009 (r195840) @@ -3093,7 +3093,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_page_t p; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if (pseflag && ((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) { Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/ia64/ia64/pmap.c Fri Jul 24 13:50:29 2009 (r195840) @@ -1751,7 +1751,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/kern/kern_proc.c Fri Jul 24 13:50:29 2009 (r195840) @@ -1486,6 +1486,9 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A case OBJT_DEAD: kve->kve_type = KVME_TYPE_DEAD; break; + case OBJT_SG: + kve->kve_type = KVME_TYPE_SG; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; @@ -1658,6 +1661,9 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR case OBJT_DEAD: kve->kve_type = KVME_TYPE_DEAD; break; + case OBJT_SG: + kve->kve_type = KVME_TYPE_SG; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/mips/mips/pmap.c Fri Jul 24 13:50:29 2009 (r195840) @@ -2148,7 +2148,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_object_t object, vm_pindex_t pindex, vm_size_t size) { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/powerpc/booke/pmap.c Fri Jul 24 13:50:29 2009 (r195840) @@ -2582,7 +2582,7 @@ mmu_booke_object_init_pt(mmu_t mmu, pmap { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("mmu_booke_object_init_pt: non-device object")); } Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/sparc64/sparc64/pmap.c Fri Jul 24 13:50:29 2009 (r195840) @@ -1499,7 +1499,7 @@ pmap_object_init_pt(pmap_t pm, vm_offset { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT(object->type == OBJT_DEVICE, + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/sys/user.h Fri Jul 24 13:50:29 2009 (r195840) @@ -340,6 +340,7 @@ struct kinfo_file { #define KVME_TYPE_DEVICE 4 #define KVME_TYPE_PHYS 5 #define KVME_TYPE_DEAD 6 +#define KVME_TYPE_SG 7 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 Added: head/sys/vm/sg_pager.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/vm/sg_pager.c Fri Jul 24 13:50:29 2009 (r195840) @@ -0,0 +1,263 @@ +/*- + * Copyright (c) 2009 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * This pager manages OBJT_SG objects. These objects are backed by + * a scatter/gather list of physical address ranges. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void sg_pager_init(void); +static vm_object_t sg_pager_alloc(void *, vm_ooffset_t, vm_prot_t, + vm_ooffset_t, struct ucred *); +static void sg_pager_dealloc(vm_object_t); +static int sg_pager_getpages(vm_object_t, vm_page_t *, int, int); +static void sg_pager_putpages(vm_object_t, vm_page_t *, int, + boolean_t, int *); +static boolean_t sg_pager_haspage(vm_object_t, vm_pindex_t, int *, + int *); + +static uma_zone_t fakepg_zone; + +static vm_page_t sg_pager_getfake(vm_paddr_t, vm_memattr_t); +static void sg_pager_putfake(vm_page_t); + +struct pagerops sgpagerops = { + .pgo_init = sg_pager_init, + .pgo_alloc = sg_pager_alloc, + .pgo_dealloc = sg_pager_dealloc, + .pgo_getpages = sg_pager_getpages, + .pgo_putpages = sg_pager_putpages, + .pgo_haspage = sg_pager_haspage, +}; + +static void +sg_pager_init(void) +{ + + fakepg_zone = uma_zcreate("SG fakepg", sizeof(struct vm_page), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, + UMA_ZONE_NOFREE|UMA_ZONE_VM); +} + +static vm_object_t +sg_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred) +{ + struct sglist *sg; + vm_object_t object; + vm_pindex_t npages, pindex; + int i; + + /* + * Offset should be page aligned. + */ + if (foff & PAGE_MASK) + return (NULL); + + /* + * The scatter/gather list must only include page-aligned + * ranges. + */ + npages = 0; + sg = handle; + for (i = 0; i < sg->sg_nseg; i++) { + if ((sg->sg_segs[i].ss_paddr % PAGE_SIZE) != 0 || + (sg->sg_segs[i].ss_len % PAGE_SIZE) != 0) + return (NULL); + npages += sg->sg_segs[i].ss_len / PAGE_SIZE; + } + + /* + * The scatter/gather list has a fixed size. Refuse requests + * to map beyond that. + */ + size = round_page(size); + pindex = OFF_TO_IDX(foff + size); + if (pindex > npages) + return (NULL); + + /* + * Allocate a new object and associate it with the + * scatter/gather list. It is ok for our purposes to have + * multiple VM objects associated with the same scatter/gather + * list because scatter/gather lists are static. This is also + * simpler than ensuring a unique object per scatter/gather + * list. + */ + object = vm_object_allocate(OBJT_SG, npages); + object->handle = sglist_hold(sg); + TAILQ_INIT(&object->un_pager.sgp.sgp_pglist); + return (object); +} + +static void +sg_pager_dealloc(vm_object_t object) +{ + struct sglist *sg; + vm_page_t m; + + /* + * Free up our fake pages. + */ + while ((m = TAILQ_FIRST(&object->un_pager.sgp.sgp_pglist)) != 0) { + TAILQ_REMOVE(&object->un_pager.sgp.sgp_pglist, m, pageq); + sg_pager_putfake(m); + } + + sg = object->handle; + sglist_free(sg); +} + +static int +sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage) +{ + struct sglist *sg; + vm_page_t m_paddr, page; + vm_pindex_t offset; + vm_paddr_t paddr; + vm_memattr_t memattr; + size_t space; + int i; + + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + sg = object->handle; + memattr = object->memattr; + VM_OBJECT_UNLOCK(object); + offset = m[reqpage]->pindex; + + /* + * Lookup the physical address of the requested page. An initial + * value of '1' instead of '0' is used so we can assert that the + * page is found since '0' can be a valid page-aligned physical + * address. + */ + space = 0; + paddr = 1; + for (i = 0; i < sg->sg_nseg; i++) { + if (space + sg->sg_segs[i].ss_len <= (offset * PAGE_SIZE)) { + space += sg->sg_segs[i].ss_len; + continue; + } + paddr = sg->sg_segs[i].ss_paddr + offset * PAGE_SIZE - space; + break; + } + KASSERT(paddr != 1, ("invalid SG page index")); + + /* If "paddr" is a real page, perform a sanity check on "memattr". */ + if ((m_paddr = vm_phys_paddr_to_vm_page(paddr)) != NULL && + pmap_page_get_memattr(m_paddr) != memattr) { + memattr = pmap_page_get_memattr(m_paddr); + printf( + "WARNING: A device driver has set \"memattr\" inconsistently.\n"); + } + + /* Return a fake page for the requested page. */ + KASSERT(!(m[reqpage]->flags & PG_FICTITIOUS), + ("backing page for SG is fake")); + + /* Construct a new fake page. */ + printf("SG: getting fake page for paddr %lx\n", paddr); + page = sg_pager_getfake(paddr, memattr); + VM_OBJECT_LOCK(object); + TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, pageq); + + /* Free the original pages and insert this fake page into the object. */ + vm_page_lock_queues(); + for (i = 0; i < count; i++) { + printf("SG: freeing VM page %p\n", m[i]); + vm_page_free(m[i]); + } + vm_page_unlock_queues(); + printf("SG: Inserting new fake page\n"); + vm_page_insert(page, object, offset); + m[reqpage] = page; + + return (VM_PAGER_OK); +} + +static void +sg_pager_putpages(vm_object_t object, vm_page_t *m, int count, + boolean_t sync, int *rtvals) +{ + + panic("sg_pager_putpage called"); +} + +static boolean_t +sg_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, + int *after) +{ + + if (before != NULL) + *before = 0; + if (after != NULL) + *after = 0; + return (TRUE); +} + +/* + * Create a fictitious page with the specified physical address and memory + * attribute. The memory attribute is the only the machine-dependent aspect + * of a fictitious page that must be initialized. + */ +static vm_page_t +sg_pager_getfake(vm_paddr_t paddr, vm_memattr_t memattr) +{ + vm_page_t m; + + m = uma_zalloc(fakepg_zone, M_WAITOK | M_ZERO); + m->phys_addr = paddr; + /* Fictitious pages don't use "segind". */ + m->flags = PG_FICTITIOUS; + /* Fictitious pages don't use "order" or "pool". */ + m->oflags = VPO_BUSY; + m->wire_count = 1; + pmap_page_set_memattr(m, memattr); + return (m); +} + +static void +sg_pager_putfake(vm_page_t m) +{ + + if (!(m->flags & PG_FICTITIOUS)) + panic("sg_pager_putfake: bad page"); + uma_zfree(fakepg_zone, m); +} Modified: head/sys/vm/vm.h ============================================================================== --- head/sys/vm/vm.h Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm.h Fri Jul 24 13:50:29 2009 (r195840) @@ -89,7 +89,7 @@ typedef u_char vm_prot_t; /* protection #define VM_PROT_DEFAULT VM_PROT_ALL enum obj_type { OBJT_DEFAULT, OBJT_SWAP, OBJT_VNODE, OBJT_DEVICE, OBJT_PHYS, - OBJT_DEAD }; + OBJT_DEAD, OBJT_SG }; typedef u_char objtype_t; union vm_map_object; Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm_fault.c Fri Jul 24 13:50:29 2009 (r195840) @@ -472,7 +472,8 @@ readrest: (fs.first_object == fs.object || (is_first_object_locked = VM_OBJECT_TRYLOCK(fs.first_object))) && fs.first_object->type != OBJT_DEVICE && - fs.first_object->type != OBJT_PHYS) { + fs.first_object->type != OBJT_PHYS && + fs.first_object->type != OBJT_SG) { vm_pindex_t firstpindex, tmppindex; if (fs.first_pindex < 2 * VM_FAULT_READ) Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm_map.c Fri Jul 24 13:50:29 2009 (r195840) @@ -1719,7 +1719,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) return; VM_OBJECT_LOCK(object); - if (object->type == OBJT_DEVICE) { + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { pmap_object_init_pt(map->pmap, addr, object, pindex, size); goto unlock_return; } @@ -2247,7 +2247,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); } } KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION, @@ -2366,7 +2367,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st saved_start = entry->start; saved_end = entry->end; fictitious = entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE; + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG); /* * Release the map lock, relying on the in-transition * mark. @@ -2462,7 +2464,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); } } next_entry_done: @@ -2595,7 +2598,8 @@ vm_map_entry_unwire(vm_map_t map, vm_map { vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - entry->object.vm_object->type == OBJT_DEVICE); + (entry->object.vm_object->type == OBJT_DEVICE || + entry->object.vm_object->type == OBJT_SG)); entry->wired_count = 0; } Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm_meter.c Fri Jul 24 13:50:29 2009 (r195840) @@ -205,7 +205,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) * synchronization should not impair the accuracy of * the reported statistics. */ - if (object->type == OBJT_DEVICE) { + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { /* * Devices, like /dev/mem, will badly skew our totals. */ Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm_object.c Fri Jul 24 13:50:29 2009 (r195840) @@ -309,6 +309,7 @@ vm_object_set_memattr(vm_object_t object case OBJT_DEFAULT: case OBJT_DEVICE: case OBJT_PHYS: + case OBJT_SG: case OBJT_SWAP: case OBJT_VNODE: if (!TAILQ_EMPTY(&object->memq)) Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm_object.h Fri Jul 24 13:50:29 2009 (r195840) @@ -124,6 +124,15 @@ struct vm_object { } devp; /* + * SG pager + * + * sgp_pglist - list of allocated pages + */ + struct { + TAILQ_HEAD(, vm_page) sgp_pglist; + } sgp; + + /* * Swap pager * * swp_bcount - number of swap 'swblock' metablocks, each Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm_page.c Fri Jul 24 13:50:29 2009 (r195840) @@ -1163,7 +1163,7 @@ vm_page_alloc(vm_object_t object, vm_pin if (object != NULL) { /* Ignore device objects; the pager sets "memattr" for them. */ if (object->memattr != VM_MEMATTR_DEFAULT && - object->type != OBJT_DEVICE) + object->type != OBJT_DEVICE && object->type != OBJT_SG) pmap_page_set_memattr(m, object->memattr); vm_page_insert(m, object, pindex); } else Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm_pageout.c Fri Jul 24 13:50:29 2009 (r195840) @@ -513,7 +513,9 @@ vm_pageout_object_deactivate_pages(pmap, int actcount, rcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); - if (first_object->type == OBJT_DEVICE || first_object->type == OBJT_PHYS) + if (first_object->type == OBJT_DEVICE || + first_object->type == OBJT_SG || + first_object->type == OBJT_PHYS) return; for (object = first_object;; object = backing_object) { if (pmap_resident_count(pmap) <= desired) Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm_pager.c Fri Jul 24 13:50:29 2009 (r195840) @@ -160,7 +160,8 @@ struct pagerops *pagertab[] = { &vnodepagerops, /* OBJT_VNODE */ &devicepagerops, /* OBJT_DEVICE */ &physpagerops, /* OBJT_PHYS */ - &deadpagerops /* OBJT_DEAD */ + &deadpagerops, /* OBJT_DEAD */ + &sgpagerops /* OBJT_SG */ }; static const int npagers = sizeof(pagertab) / sizeof(pagertab[0]); Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Fri Jul 24 13:40:25 2009 (r195839) +++ head/sys/vm/vm_pager.h Fri Jul 24 13:50:29 2009 (r195840) @@ -70,6 +70,7 @@ extern struct pagerops swappagerops; extern struct pagerops vnodepagerops; extern struct pagerops devicepagerops; extern struct pagerops physpagerops; +extern struct pagerops sgpagerops; /* * get/put return values Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Fri Jul 24 13:40:25 2009 (r195839) +++ head/usr.bin/procstat/procstat_vm.c Fri Jul 24 13:50:29 2009 (r195840) @@ -93,6 +93,9 @@ procstat_vm(pid_t pid, struct kinfo_proc case KVME_TYPE_DEAD: str = "dd"; break; + case KVME_TYPE_SG: + str = "sg"; + break; case KVME_TYPE_UNKNOWN: default: str = "??"; From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 14:52:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05424106564A; Fri, 24 Jul 2009 14:52:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C81198FC16; Fri, 24 Jul 2009 14:51:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 7FD9D46B8E; Fri, 24 Jul 2009 10:51:59 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 477838A0A1; Fri, 24 Jul 2009 10:51:58 -0400 (EDT) From: John Baldwin To: Nathan Whitehorn Date: Fri, 24 Jul 2009 10:51:02 -0400 User-Agent: KMail/1.9.7 References: <200907241350.n6ODoT7h011449@svn.freebsd.org> <4A69C623.2000806@freebsd.org> In-Reply-To: <4A69C623.2000806@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907241051.02980.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 24 Jul 2009 10:51:58 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195840 - in head: sys/amd64/amd64 sys/arm/arm sys/conf sys/fs/procfs sys/i386/i386 sys/i386/xen sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/booke sys/sparc64/sparc64 sys/sys sys/v... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 14:52:00 -0000 On Friday 24 July 2009 10:33:07 am Nathan Whitehorn wrote: > This breaks at least the PowerPC build. Here's the error: > /usr/src/sys/vm/sg_pager.c:196: warning: format '%lx' expects type 'long > unsigned int', but argument 2 has type 'vm_paddr_t' Eek, a couple of debug printfs slipped in. Patch to remove them is in route to re@. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 15:03:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97AD7106564A; Fri, 24 Jul 2009 15:03:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84DDB8FC20; Fri, 24 Jul 2009 15:03:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OF3AaT013232; Fri, 24 Jul 2009 15:03:10 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OF3ATP013228; Fri, 24 Jul 2009 15:03:10 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200907241503.n6OF3ATP013228@svn.freebsd.org> From: Brooks Davis Date: Fri, 24 Jul 2009 15:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195843 - in head: lib/libkvm sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 15:03:11 -0000 Author: brooks Date: Fri Jul 24 15:03:10 2009 New Revision: 195843 URL: http://svn.freebsd.org/changeset/base/195843 Log: Revert the changes to struct kinfo_proc in r194498. Instead, fill in up to 16 (KI_NGROUPS) values and steal a bit from ki_cr_flags (all bits currently unused) to indicate overflow with the new flag KI_CRF_GRP_OVERFLOW. This fixes procstat -s. Approved by: re (kib) Modified: head/lib/libkvm/kvm_proc.c head/sys/kern/kern_proc.c head/sys/sys/user.h Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Fri Jul 24 14:57:02 2009 (r195842) +++ head/lib/libkvm/kvm_proc.c Fri Jul 24 15:03:10 2009 (r195843) @@ -145,8 +145,14 @@ kvm_proclist(kd, what, arg, p, bp, maxcn kp->ki_svuid = ucred.cr_svuid; kp->ki_rgid = ucred.cr_rgid; kp->ki_svgid = ucred.cr_svgid; - kp->ki_ngroups = ucred.cr_ngroups; - kp->ki_groups = ucred.cr_groups; + kp->ki_cr_flags = ucred.cr_flags; + if (ucred.cr_ngroups > KI_NGROUPS) { + kp->ki_ngroups = KI_NGROUPS; + kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW; + } + kp->ki_ngroups = ucred.cr_ngroups; + bcopy(ucred.cr_groups, kp->ki_groups, + kp->ki_ngroups * sizeof(gid_t)); kp->ki_uid = ucred.cr_uid; if (ucred.cr_prison != NULL) { if (KREAD(kd, (u_long)ucred.cr_prison, &pr)) { Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Jul 24 14:57:02 2009 (r195842) +++ head/sys/kern/kern_proc.c Fri Jul 24 15:03:10 2009 (r195843) @@ -730,11 +730,17 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_uid = cred->cr_uid; kp->ki_ruid = cred->cr_ruid; kp->ki_svuid = cred->cr_svuid; - kp->ki_ngroups = cred->cr_ngroups; - kp->ki_groups = cred->cr_groups; + kp->ki_cr_flags = cred->cr_flags; + /* XXX bde doesn't like KI_NGROUPS */ + if (cred->cr_ngroups > KI_NGROUPS) { + kp->ki_ngroups = KI_NGROUPS; + kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW; + } else + kp->ki_ngroups = cred->cr_ngroups; + bcopy(cred->cr_groups, kp->ki_groups, + kp->ki_ngroups * sizeof(gid_t)); kp->ki_rgid = cred->cr_rgid; kp->ki_svgid = cred->cr_svgid; - kp->ki_cr_flags = cred->cr_flags; /* If jailed(cred), emulate the old P_JAILED flag. */ if (jailed(cred)) { kp->ki_flag |= P_JAILED; Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Fri Jul 24 14:57:02 2009 (r195842) +++ head/sys/sys/user.h Fri Jul 24 15:03:10 2009 (r195843) @@ -85,7 +85,7 @@ */ #define KI_NSPARE_INT 9 #define KI_NSPARE_LONG 12 -#define KI_NSPARE_PTR 6 +#define KI_NSPARE_PTR 7 #ifdef __amd64__ #define KINFO_PROC_SIZE 1088 @@ -117,8 +117,15 @@ #define OCOMMLEN 16 /* size of returned thread name */ #define COMMLEN 19 /* size of returned ki_comm name */ #define KI_EMULNAMELEN 16 /* size of returned ki_emul */ +#define KI_NGROUPS 16 /* number of groups in ki_groups */ #define LOGNAMELEN 17 /* size of returned ki_login */ +/* + * Steal a bit from ki_cr_flags (cr_flags is never used) to indicate + * that the cred had more than KI_NGROUPS groups. + */ +#define KI_CRF_GRP_OVERFLOW 0x80000000 + struct kinfo_proc { int ki_structsize; /* size of this structure */ int ki_layout; /* reserved: layout identifier */ @@ -150,7 +157,7 @@ struct kinfo_proc { gid_t ki_svgid; /* Saved effective group id */ short ki_ngroups; /* number of groups */ short ki_spare_short2; /* unused (just here for alignment) */ - uint32_t __was_ki_groups[16]; /* unused; left for bin compat */ + gid_t ki_groups[KI_NGROUPS]; /* groups */ vm_size_t ki_size; /* virtual size */ segsz_t ki_rssize; /* current resident set size in pages */ segsz_t ki_swrss; /* resident set size before last swap */ @@ -200,7 +207,6 @@ struct kinfo_proc { struct pcb *ki_pcb; /* kernel virtual addr of pcb */ void *ki_kstack; /* kernel virtual addr of stack */ void *ki_udata; /* User convenience pointer */ - gid_t *ki_groups; /* groups */ /* * When adding new variables, take space for pointers from the * front of ki_spareptrs, and longs from the end of ki_sparelongs. From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 15:06:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 048DB1065672; Fri, 24 Jul 2009 15:06:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E53278FC0A; Fri, 24 Jul 2009 15:06:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OF6ncA013350; Fri, 24 Jul 2009 15:06:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OF6n6i013349; Fri, 24 Jul 2009 15:06:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907241506.n6OF6n6i013349@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jul 2009 15:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195844 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 15:06:50 -0000 Author: jhb Date: Fri Jul 24 15:06:49 2009 New Revision: 195844 URL: http://svn.freebsd.org/changeset/base/195844 Log: Remove debugging that crept in with previous commit. Reported by: nwhitehorn Approved by: re (kib) Modified: head/sys/vm/sg_pager.c Modified: head/sys/vm/sg_pager.c ============================================================================== --- head/sys/vm/sg_pager.c Fri Jul 24 15:03:10 2009 (r195843) +++ head/sys/vm/sg_pager.c Fri Jul 24 15:06:49 2009 (r195844) @@ -193,19 +193,15 @@ sg_pager_getpages(vm_object_t object, vm ("backing page for SG is fake")); /* Construct a new fake page. */ - printf("SG: getting fake page for paddr %lx\n", paddr); page = sg_pager_getfake(paddr, memattr); VM_OBJECT_LOCK(object); TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, pageq); /* Free the original pages and insert this fake page into the object. */ vm_page_lock_queues(); - for (i = 0; i < count; i++) { - printf("SG: freeing VM page %p\n", m[i]); + for (i = 0; i < count; i++) vm_page_free(m[i]); - } vm_page_unlock_queues(); - printf("SG: Inserting new fake page\n"); vm_page_insert(page, object, offset); m[reqpage] = page; From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 15:22:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA982106566B; Fri, 24 Jul 2009 15:22:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8A3D8FC28; Fri, 24 Jul 2009 15:22:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OFMCAo013695; Fri, 24 Jul 2009 15:22:12 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OFMCCG013694; Fri, 24 Jul 2009 15:22:12 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907241522.n6OFMCCG013694@svn.freebsd.org> From: Sam Leffler Date: Fri, 24 Jul 2009 15:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195845 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 15:22:13 -0000 Author: sam Date: Fri Jul 24 15:22:12 2009 New Revision: 195845 URL: http://svn.freebsd.org/changeset/base/195845 Log: o kill old code no longer needed after r193312 o count output packets+errors for frames sent through ieee80211_output Approved by: re (kensmith) Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Jul 24 15:06:49 2009 (r195844) +++ head/sys/net80211/ieee80211_output.c Fri Jul 24 15:22:12 2009 (r195845) @@ -382,23 +382,10 @@ ieee80211_output(struct ifnet *ifp, stru { #define senderr(e) do { error = (e); goto bad;} while (0) struct ieee80211_node *ni = NULL; - struct ieee80211vap *vap; + struct ieee80211vap *vap = ifp->if_softc; struct ieee80211_frame *wh; int error; - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { - /* - * Short-circuit requests if the vap is marked OACTIVE - * as this is used when tearing down state to indicate - * the vap may be gone. This can also happen because a - * packet came down through ieee80211_start before the - * vap entered RUN state in which case it's also ok to - * just drop the frame. This should not be necessary - * but callers of if_output don't check OACTIVE. - */ - senderr(ENETDOWN); - } - vap = ifp->if_softc; /* * Hand to the 802.3 code if not tagged as * a raw 802.11 frame. @@ -468,6 +455,7 @@ ieee80211_output(struct ifnet *ifp, stru if (ieee80211_classify(ni, m)) senderr(EIO); /* XXX */ + ifp->if_opackets++; IEEE80211_NODE_STAT(ni, tx_data); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { IEEE80211_NODE_STAT(ni, tx_mcast); @@ -491,6 +479,7 @@ bad: m_freem(m); if (ni != NULL) ieee80211_free_node(ni); + ifp->if_oerrors++; return error; #undef senderr } From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 15:27:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7F8F106564A; Fri, 24 Jul 2009 15:27:02 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D62E48FC1B; Fri, 24 Jul 2009 15:27:02 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OFR2LS013834; Fri, 24 Jul 2009 15:27:02 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OFR2oT013832; Fri, 24 Jul 2009 15:27:02 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907241527.n6OFR2oT013832@svn.freebsd.org> From: Sam Leffler Date: Fri, 24 Jul 2009 15:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195846 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 15:27:03 -0000 Author: sam Date: Fri Jul 24 15:27:02 2009 New Revision: 195846 URL: http://svn.freebsd.org/changeset/base/195846 Log: monitor mode vaps are meant to be read-only so they can operate on any frequency w/o regulatory issues, do this by hooking if_transmit and if_output with routines that discard all transmits Reviewed by: thompsa, cbzimmer (intent) Approved by: re (kensmith) Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Jul 24 15:22:12 2009 (r195845) +++ head/sys/net80211/ieee80211.c Fri Jul 24 15:27:02 2009 (r195846) @@ -224,12 +224,19 @@ null_update_promisc(struct ifnet *ifp) } static int +null_transmit(struct ifnet *ifp, struct mbuf *m) +{ + m_freem(m); + ifp->if_oerrors++; + return EACCES; /* XXX EIO/EPERM? */ +} + +static int null_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct route *ro) { if_printf(ifp, "discard raw packet\n"); - m_freem(m); - return EIO; + return null_transmit(ifp, m); } static void @@ -515,9 +522,15 @@ ieee80211_vap_attach(struct ieee80211vap ifp->if_baudrate = IF_Mbps(maxrate); ether_ifattach(ifp, vap->iv_myaddr); - /* hook output method setup by ether_ifattach */ - vap->iv_output = ifp->if_output; - ifp->if_output = ieee80211_output; + if (vap->iv_opmode == IEEE80211_M_MONITOR) { + /* NB: disallow transmit */ + ifp->if_transmit = null_transmit; + ifp->if_output = null_output; + } else { + /* hook output method setup by ether_ifattach */ + vap->iv_output = ifp->if_output; + ifp->if_output = ieee80211_output; + } /* NB: if_mtu set by ether_ifattach to ETHERMTU */ IEEE80211_LOCK(ic); From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 15:28:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B84131065676; Fri, 24 Jul 2009 15:28:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6CAE8FC15; Fri, 24 Jul 2009 15:28:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OFSTNG013895; Fri, 24 Jul 2009 15:28:29 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OFSTqP013893; Fri, 24 Jul 2009 15:28:29 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907241528.n6OFSTqP013893@svn.freebsd.org> From: Sam Leffler Date: Fri, 24 Jul 2009 15:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195847 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 15:28:30 -0000 Author: sam Date: Fri Jul 24 15:28:29 2009 New Revision: 195847 URL: http://svn.freebsd.org/changeset/base/195847 Log: correct handling of IFF_PROMISC; this should not be pushed to the parent device except for monitor and ahdemo mode vaps Reviewed by: rpaulo Approved by: re (kensmith) Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Jul 24 15:27:02 2009 (r195846) +++ head/sys/net80211/ieee80211.c Fri Jul 24 15:28:29 2009 (r195847) @@ -637,7 +637,8 @@ ieee80211_syncifflag_locked(struct ieee8 * drivers don't need to special-case it */ if (flag == IFF_PROMISC && - vap->iv_opmode == IEEE80211_M_HOSTAP) + !(vap->iv_opmode == IEEE80211_M_MONITOR || + vap->iv_opmode == IEEE80211_M_AHDEMO)) continue; bit = 1; break; From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 15:31:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75D3C1065687; Fri, 24 Jul 2009 15:31:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60E1A8FC17; Fri, 24 Jul 2009 15:31:22 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OFVMSZ014012; Fri, 24 Jul 2009 15:31:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OFVMr4014002; Fri, 24 Jul 2009 15:31:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907241531.n6OFVMr4014002@svn.freebsd.org> From: Sam Leffler Date: Fri, 24 Jul 2009 15:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195848 - in head/tools/tools/net80211: stumbler w00t w00t/ap w00t/assoc w00t/expand w00t/prga w00t/redir wesside/wesside wlaninject X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 15:31:23 -0000 Author: sam Date: Fri Jul 24 15:31:22 2009 New Revision: 195848 URL: http://svn.freebsd.org/changeset/base/195848 Log: Update for vaps: o do not force monitor mode; the wlanX ifnet must be an ahdemo mode vap o move channel change work before marking ifnet up to avoid churning the state machine o change default ifnet name to "wlan0" Approved by: re (kensmith) Modified: head/tools/tools/net80211/stumbler/stumbler.c head/tools/tools/net80211/w00t/README head/tools/tools/net80211/w00t/ap/ap.c head/tools/tools/net80211/w00t/assoc/assoc.c head/tools/tools/net80211/w00t/expand/expand.c head/tools/tools/net80211/w00t/prga/prga.c head/tools/tools/net80211/w00t/redir/redir.c head/tools/tools/net80211/wesside/wesside/wesside.c head/tools/tools/net80211/wlaninject/wlaninject.c Modified: head/tools/tools/net80211/stumbler/stumbler.c ============================================================================== --- head/tools/tools/net80211/stumbler/stumbler.c Fri Jul 24 15:28:29 2009 (r195847) +++ head/tools/tools/net80211/stumbler/stumbler.c Fri Jul 24 15:31:22 2009 (r195848) @@ -275,9 +275,14 @@ void set_chan(int c) { void setup_if(char *dev) { struct ifreq ifr; unsigned int flags; - struct ifmediareq ifmr; - int *mwords; - + + // set chan + memset(&chaninfo.ireq, 0, sizeof(chaninfo.ireq)); + strcpy(chaninfo.ireq.i_name, dev); + chaninfo.ireq.i_type = IEEE80211_IOC_CHANNEL; + + set_chan(1); + // set iface up and promisc memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, dev); @@ -293,39 +298,6 @@ void setup_if(char *dev) { ifr.ifr_flagshigh = flags >> 16; if (ioctl(ioctl_s, SIOCSIFFLAGS, &ifr) == -1) die(1, "ioctl(SIOCSIFFLAGS)"); - - // set monitor mode - memset(&ifmr, 0, sizeof(ifmr)); - strcpy(ifmr.ifm_name, dev); - if (ioctl(ioctl_s, SIOCGIFMEDIA, &ifmr) == -1) - die(1, "ioctl(SIOCGIFMEDIA)"); - - if (ifmr.ifm_count == 0) - die(0, "0 media thinggies...\n"); - - mwords = (int *)malloc(ifmr.ifm_count * sizeof(int)); - if (!mwords) - die(1, "malloc()"); - - ifmr.ifm_ulist = mwords; - - if (ioctl(ioctl_s, SIOCGIFMEDIA, &ifmr) == -1) - die(1, "ioctl(SIOCGIFMEDIA)"); - - free(mwords); - - memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, dev); - ifr.ifr_media = ifmr.ifm_current | IFM_IEEE80211_MONITOR; - if (ioctl(ioctl_s, SIOCSIFMEDIA, &ifr) == -1) - die(1, "ioctl(SIOCSIFMEDIA)"); - - // set chan - memset(&chaninfo.ireq, 0, sizeof(chaninfo.ireq)); - strcpy(chaninfo.ireq.i_name, dev); - chaninfo.ireq.i_type = IEEE80211_IOC_CHANNEL; - - set_chan(1); } void open_bpf(char *dev, int dlt) { Modified: head/tools/tools/net80211/w00t/README ============================================================================== --- head/tools/tools/net80211/w00t/README Fri Jul 24 15:28:29 2009 (r195847) +++ head/tools/tools/net80211/w00t/README Fri Jul 24 15:31:22 2009 (r195848) @@ -4,7 +4,7 @@ This is a collection of tools that use r None of the tools configure the interface, so be sure to run something like: -ifconfig ath0 channel 7 mediaopt monitor promisc up +ifconfig wlan create wlandev ath0 wlanmode ahdemo channel 7 promisc up beforehand. The following tools are found here: Modified: head/tools/tools/net80211/w00t/ap/ap.c ============================================================================== --- head/tools/tools/net80211/w00t/ap/ap.c Fri Jul 24 15:28:29 2009 (r195847) +++ head/tools/tools/net80211/w00t/ap/ap.c Fri Jul 24 15:31:22 2009 (r195848) @@ -846,7 +846,7 @@ void next_event(struct params *p) int main(int argc, char *argv[]) { - char *iface = "ath0"; + char *iface = "wlan0"; char *tap = "tap0"; struct params p; int ch; Modified: head/tools/tools/net80211/w00t/assoc/assoc.c ============================================================================== --- head/tools/tools/net80211/w00t/assoc/assoc.c Fri Jul 24 15:28:29 2009 (r195847) +++ head/tools/tools/net80211/w00t/assoc/assoc.c Fri Jul 24 15:31:22 2009 (r195848) @@ -710,7 +710,7 @@ int main(int argc, char *argv[]) char mac[] = { 0x00, 0x00, 0xde, 0xfa, 0xce, 0xd }; int ch; struct params p; - char *iface = "ath0"; + char *iface = "wlan0"; char *tap = "tap0"; int timeout = 50*1000; struct timeval start; Modified: head/tools/tools/net80211/w00t/expand/expand.c ============================================================================== --- head/tools/tools/net80211/w00t/expand/expand.c Fri Jul 24 15:28:29 2009 (r195847) +++ head/tools/tools/net80211/w00t/expand/expand.c Fri Jul 24 15:31:22 2009 (r195848) @@ -421,7 +421,7 @@ void usage(char *name) int main(int argc, char *argv[]) { struct params p; - char *iface = "ath0"; + char *iface = "wlan0"; char *tap = "tap0"; int ch; Modified: head/tools/tools/net80211/w00t/prga/prga.c ============================================================================== --- head/tools/tools/net80211/w00t/prga/prga.c Fri Jul 24 15:28:29 2009 (r195847) +++ head/tools/tools/net80211/w00t/prga/prga.c Fri Jul 24 15:31:22 2009 (r195848) @@ -602,7 +602,7 @@ void transmit(struct params *p) int main(int argc, char *argv[]) { struct params p; - char *iface = "ath0"; + char *iface = "wlan0"; char *tap = "tap0"; int ch; Modified: head/tools/tools/net80211/w00t/redir/redir.c ============================================================================== --- head/tools/tools/net80211/w00t/redir/redir.c Fri Jul 24 15:28:29 2009 (r195847) +++ head/tools/tools/net80211/w00t/redir/redir.c Fri Jul 24 15:31:22 2009 (r195848) @@ -631,7 +631,7 @@ void usage(char *name) int main(int argc, char *argv[]) { struct params p; - char *iface = "ath0"; + char *iface = "wlan0"; char *tap = "tap0"; int ch; Modified: head/tools/tools/net80211/wesside/wesside/wesside.c ============================================================================== --- head/tools/tools/net80211/wesside/wesside/wesside.c Fri Jul 24 15:28:29 2009 (r195847) +++ head/tools/tools/net80211/wesside/wesside/wesside.c Fri Jul 24 15:31:22 2009 (r195848) @@ -384,6 +384,15 @@ void setup_if(char *dev) { exit(1); } + // set chan + memset(&chaninfo.ireq, 0, sizeof(chaninfo.ireq)); + strcpy(chaninfo.ireq.i_name, dev); + chaninfo.ireq.i_type = IEEE80211_IOC_CHANNEL; + + chaninfo.chan = 0; + chaninfo.s = s; + set_chan(1); + // set iface up and promisc memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, dev); @@ -404,49 +413,6 @@ void setup_if(char *dev) { exit(1); } - // set monitor mode - memset(&ifmr, 0, sizeof(ifmr)); - strcpy(ifmr.ifm_name, dev); - if (ioctl(s, SIOCGIFMEDIA, &ifmr) == -1) { - perror("ioctl(SIOCGIFMEDIA)"); - exit(1); - } - - if (ifmr.ifm_count == 0) { - time_print("0 media thinggies...\n"); - exit(1); - } - - mwords = (int *)malloc(ifmr.ifm_count * sizeof(int)); - if (!mwords) { - perror("malloc()"); - exit(1); - } - ifmr.ifm_ulist = mwords; - - if (ioctl(s, SIOCGIFMEDIA, &ifmr) == -1) { - perror("ioctl(SIOCGIFMEDIA)"); - exit(1); - } - free(mwords); - - memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, dev); - ifr.ifr_media = ifmr.ifm_current | IFM_IEEE80211_MONITOR; - if (ioctl(s, SIOCSIFMEDIA, &ifr) == -1) { - perror("ioctl(SIOCSIFMEDIA)"); - exit(1); - } - - // set chan - memset(&chaninfo.ireq, 0, sizeof(chaninfo.ireq)); - strcpy(chaninfo.ireq.i_name, dev); - chaninfo.ireq.i_type = IEEE80211_IOC_CHANNEL; - - chaninfo.chan = 0; - chaninfo.s = s; - set_chan(1); - printf("done\n"); } Modified: head/tools/tools/net80211/wlaninject/wlaninject.c ============================================================================== --- head/tools/tools/net80211/wlaninject/wlaninject.c Fri Jul 24 15:28:29 2009 (r195847) +++ head/tools/tools/net80211/wlaninject/wlaninject.c Fri Jul 24 15:31:22 2009 (r195848) @@ -58,6 +58,14 @@ void setup_if(char *dev, int chan) { if ((s = socket(PF_INET, SOCK_DGRAM, 0)) == -1) err(1, "socket()"); + /* chan */ + memset(&ireq, 0, sizeof(ireq)); + snprintf(ireq.i_name, sizeof(ireq.i_name), "%s", dev); + ireq.i_type = IEEE80211_IOC_CHANNEL; + ireq.i_val = chan; + if (ioctl(s, SIOCS80211, &ireq) == -1) + err(1, "ioctl(SIOCS80211)"); + /* UP & PROMISC */ memset(&ifr, 0, sizeof(ifr)); snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", dev); @@ -70,34 +78,6 @@ void setup_if(char *dev, int chan) { if (ioctl(s, SIOCSIFFLAGS, &ifr) == -1) err(1, "ioctl(SIOCSIFFLAGS)"); - /* set monitor mode */ - memset(&ifmr, 0, sizeof(ifmr)); - snprintf(ifmr.ifm_name, sizeof(ifmr.ifm_name), "%s", dev); - if (ioctl(s, SIOCGIFMEDIA, &ifmr) == -1) - err(1, "ioctl(SIOCGIFMEDIA)"); - if (ifmr.ifm_count == 0) { - printf("0 media thinggies...\n"); - exit(1); - } - mwords = (int *)malloc(ifmr.ifm_count * sizeof(int)); - if (!mwords) - err(1, "malloc()"); - ifmr.ifm_ulist = mwords; - if (ioctl(s, SIOCGIFMEDIA, &ifmr) == -1) - err(1, "ioctl(SIOCGIFMEDIA)"); - free(mwords); - ifr.ifr_media = ifmr.ifm_current | IFM_IEEE80211_MONITOR; - if (ioctl(s, SIOCSIFMEDIA, &ifr) == -1) - err(1, "ioctl(SIOCSIFMEDIA)"); - - /* chan */ - memset(&ireq, 0, sizeof(ireq)); - snprintf(ireq.i_name, sizeof(ireq.i_name), "%s", dev); - ireq.i_type = IEEE80211_IOC_CHANNEL; - ireq.i_val = chan; - if (ioctl(s, SIOCS80211, &ireq) == -1) - err(1, "ioctl(SIOCS80211)"); - close(s); } @@ -546,7 +526,7 @@ int do_verify(struct ieee80211_frame *se int main(int argc, char *argv[]) { int fd, fd2; - char *iface = "ath0"; + char *iface = "wlan0"; char *verify = NULL; int chan = 1; struct { From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 15:33:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA54D106566B; Fri, 24 Jul 2009 15:33:16 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id A167B8FC14; Fri, 24 Jul 2009 15:33:16 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=UTF-8; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7.0-5.01 32bit (built Feb 19 2009)) id <0KNA00908J3EGM00@smtpauth3.wiscmail.wisc.edu>; Fri, 24 Jul 2009 09:33:14 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.76.212]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7.0-5.01 32bit (built Feb 19 2009)) with ESMTPSA id <0KNA00511J38R060@smtpauth3.wiscmail.wisc.edu>; Fri, 24 Jul 2009 09:33:10 -0500 (CDT) Date: Fri, 24 Jul 2009 09:33:07 -0500 From: Nathan Whitehorn In-reply-to: <200907241350.n6ODoT7h011449@svn.freebsd.org> To: John Baldwin Message-id: <4A69C623.2000806@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.76.212 X-Spam-PmxInfo: Server=avs-9, Version=5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2009.7.24.142416, SenderIP=76.210.76.212 References: <200907241350.n6ODoT7h011449@svn.freebsd.org> User-Agent: Thunderbird 2.0.0.22 (X11/20090723) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195840 - in head: sys/amd64/amd64 sys/arm/arm sys/conf sys/fs/procfs sys/i386/i386 sys/i386/xen sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/booke sys/sparc64/sparc64 sys/sys sys/v... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 15:33:17 -0000 This breaks at least the PowerPC build. Here's the error: /usr/src/sys/vm/sg_pager.c:196: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'vm_paddr_t' -Nathan John Baldwin wrote: > Author: jhb > Date: Fri Jul 24 13:50:29 2009 > New Revision: 195840 > URL: http://svn.freebsd.org/changeset/base/195840 > > Log: > Add a new type of VM object: OBJT_SG. An OBJT_SG object is very similar to > a device pager (OBJT_DEVICE) object in that it uses fictitious pages to > provide aliases to other memory addresses. The primary difference is that > it uses an sglist(9) to determine the physical addresses for a given offset > into the object instead of invoking the d_mmap() method in a device driver. > > Reviewed by: alc > Approved by: re (kensmith) > MFC after: 2 weeks > > Added: > head/sys/vm/sg_pager.c (contents, props changed) > Modified: > head/sys/amd64/amd64/pmap.c > head/sys/arm/arm/pmap.c > head/sys/conf/files > head/sys/fs/procfs/procfs_map.c > head/sys/i386/i386/pmap.c > head/sys/i386/xen/pmap.c > head/sys/ia64/ia64/pmap.c > head/sys/kern/kern_proc.c > head/sys/mips/mips/pmap.c > head/sys/powerpc/booke/pmap.c > head/sys/sparc64/sparc64/pmap.c > head/sys/sys/user.h > head/sys/vm/vm.h > head/sys/vm/vm_fault.c > head/sys/vm/vm_map.c > head/sys/vm/vm_meter.c > head/sys/vm/vm_object.c > head/sys/vm/vm_object.h > head/sys/vm/vm_page.c > head/sys/vm/vm_pageout.c > head/sys/vm/vm_pager.c > head/sys/vm/vm_pager.h > head/usr.bin/procstat/procstat_vm.c > > Modified: head/sys/amd64/amd64/pmap.c > ============================================================================== > --- head/sys/amd64/amd64/pmap.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/amd64/amd64/pmap.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -3359,7 +3359,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs > int pat_mode; > > VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > - KASSERT(object->type == OBJT_DEVICE, > + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, > ("pmap_object_init_pt: non-device object")); > if ((addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { > if (!vm_object_populate(object, pindex, pindex + atop(size))) > > Modified: head/sys/arm/arm/pmap.c > ============================================================================== > --- head/sys/arm/arm/pmap.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/arm/arm/pmap.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -3101,7 +3101,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs > { > > VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > - KASSERT(object->type == OBJT_DEVICE, > + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, > ("pmap_object_init_pt: non-device object")); > } > > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/conf/files Fri Jul 24 13:50:29 2009 (r195840) > @@ -2637,6 +2637,7 @@ vm/default_pager.c standard > vm/device_pager.c standard > vm/phys_pager.c standard > vm/redzone.c optional DEBUG_REDZONE > +vm/sg_pager.c standard > vm/swap_pager.c standard > vm/uma_core.c standard > vm/uma_dbg.c standard > > Modified: head/sys/fs/procfs/procfs_map.c > ============================================================================== > --- head/sys/fs/procfs/procfs_map.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/fs/procfs/procfs_map.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -174,6 +174,7 @@ procfs_doprocmap(PFS_FILL_ARGS) > type = "swap"; > vp = NULL; > break; > + case OBJT_SG: > case OBJT_DEVICE: > type = "device"; > vp = NULL; > > Modified: head/sys/i386/i386/pmap.c > ============================================================================== > --- head/sys/i386/i386/pmap.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/i386/i386/pmap.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -3448,7 +3448,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs > int pat_mode; > > VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > - KASSERT(object->type == OBJT_DEVICE, > + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, > ("pmap_object_init_pt: non-device object")); > if (pseflag && > (addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { > > Modified: head/sys/i386/xen/pmap.c > ============================================================================== > --- head/sys/i386/xen/pmap.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/i386/xen/pmap.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -3093,7 +3093,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs > vm_page_t p; > > VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > - KASSERT(object->type == OBJT_DEVICE, > + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, > ("pmap_object_init_pt: non-device object")); > if (pseflag && > ((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) { > > Modified: head/sys/ia64/ia64/pmap.c > ============================================================================== > --- head/sys/ia64/ia64/pmap.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/ia64/ia64/pmap.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -1751,7 +1751,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs > { > > VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > - KASSERT(object->type == OBJT_DEVICE, > + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, > ("pmap_object_init_pt: non-device object")); > } > > > Modified: head/sys/kern/kern_proc.c > ============================================================================== > --- head/sys/kern/kern_proc.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/kern/kern_proc.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -1486,6 +1486,9 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A > case OBJT_DEAD: > kve->kve_type = KVME_TYPE_DEAD; > break; > + case OBJT_SG: > + kve->kve_type = KVME_TYPE_SG; > + break; > default: > kve->kve_type = KVME_TYPE_UNKNOWN; > break; > @@ -1658,6 +1661,9 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR > case OBJT_DEAD: > kve->kve_type = KVME_TYPE_DEAD; > break; > + case OBJT_SG: > + kve->kve_type = KVME_TYPE_SG; > + break; > default: > kve->kve_type = KVME_TYPE_UNKNOWN; > break; > > Modified: head/sys/mips/mips/pmap.c > ============================================================================== > --- head/sys/mips/mips/pmap.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/mips/mips/pmap.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -2148,7 +2148,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs > vm_object_t object, vm_pindex_t pindex, vm_size_t size) > { > VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > - KASSERT(object->type == OBJT_DEVICE, > + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, > ("pmap_object_init_pt: non-device object")); > } > > > Modified: head/sys/powerpc/booke/pmap.c > ============================================================================== > --- head/sys/powerpc/booke/pmap.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/powerpc/booke/pmap.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -2582,7 +2582,7 @@ mmu_booke_object_init_pt(mmu_t mmu, pmap > { > > VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > - KASSERT(object->type == OBJT_DEVICE, > + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, > ("mmu_booke_object_init_pt: non-device object")); > } > > > Modified: head/sys/sparc64/sparc64/pmap.c > ============================================================================== > --- head/sys/sparc64/sparc64/pmap.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/sparc64/sparc64/pmap.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -1499,7 +1499,7 @@ pmap_object_init_pt(pmap_t pm, vm_offset > { > > VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > - KASSERT(object->type == OBJT_DEVICE, > + KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, > ("pmap_object_init_pt: non-device object")); > } > > > Modified: head/sys/sys/user.h > ============================================================================== > --- head/sys/sys/user.h Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/sys/user.h Fri Jul 24 13:50:29 2009 (r195840) > @@ -340,6 +340,7 @@ struct kinfo_file { > #define KVME_TYPE_DEVICE 4 > #define KVME_TYPE_PHYS 5 > #define KVME_TYPE_DEAD 6 > +#define KVME_TYPE_SG 7 > #define KVME_TYPE_UNKNOWN 255 > > #define KVME_PROT_READ 0x00000001 > > Added: head/sys/vm/sg_pager.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/vm/sg_pager.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -0,0 +1,263 @@ > +/*- > + * Copyright (c) 2009 Advanced Computing Technologies LLC > + * Written by: John H. Baldwin > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* > + * This pager manages OBJT_SG objects. These objects are backed by > + * a scatter/gather list of physical address ranges. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +static void sg_pager_init(void); > +static vm_object_t sg_pager_alloc(void *, vm_ooffset_t, vm_prot_t, > + vm_ooffset_t, struct ucred *); > +static void sg_pager_dealloc(vm_object_t); > +static int sg_pager_getpages(vm_object_t, vm_page_t *, int, int); > +static void sg_pager_putpages(vm_object_t, vm_page_t *, int, > + boolean_t, int *); > +static boolean_t sg_pager_haspage(vm_object_t, vm_pindex_t, int *, > + int *); > + > +static uma_zone_t fakepg_zone; > + > +static vm_page_t sg_pager_getfake(vm_paddr_t, vm_memattr_t); > +static void sg_pager_putfake(vm_page_t); > + > +struct pagerops sgpagerops = { > + .pgo_init = sg_pager_init, > + .pgo_alloc = sg_pager_alloc, > + .pgo_dealloc = sg_pager_dealloc, > + .pgo_getpages = sg_pager_getpages, > + .pgo_putpages = sg_pager_putpages, > + .pgo_haspage = sg_pager_haspage, > +}; > + > +static void > +sg_pager_init(void) > +{ > + > + fakepg_zone = uma_zcreate("SG fakepg", sizeof(struct vm_page), > + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, > + UMA_ZONE_NOFREE|UMA_ZONE_VM); > +} > + > +static vm_object_t > +sg_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, > + vm_ooffset_t foff, struct ucred *cred) > +{ > + struct sglist *sg; > + vm_object_t object; > + vm_pindex_t npages, pindex; > + int i; > + > + /* > + * Offset should be page aligned. > + */ > + if (foff & PAGE_MASK) > + return (NULL); > + > + /* > + * The scatter/gather list must only include page-aligned > + * ranges. > + */ > + npages = 0; > + sg = handle; > + for (i = 0; i < sg->sg_nseg; i++) { > + if ((sg->sg_segs[i].ss_paddr % PAGE_SIZE) != 0 || > + (sg->sg_segs[i].ss_len % PAGE_SIZE) != 0) > + return (NULL); > + npages += sg->sg_segs[i].ss_len / PAGE_SIZE; > + } > + > + /* > + * The scatter/gather list has a fixed size. Refuse requests > + * to map beyond that. > + */ > + size = round_page(size); > + pindex = OFF_TO_IDX(foff + size); > + if (pindex > npages) > + return (NULL); > + > + /* > + * Allocate a new object and associate it with the > + * scatter/gather list. It is ok for our purposes to have > + * multiple VM objects associated with the same scatter/gather > + * list because scatter/gather lists are static. This is also > + * simpler than ensuring a unique object per scatter/gather > + * list. > + */ > + object = vm_object_allocate(OBJT_SG, npages); > + object->handle = sglist_hold(sg); > + TAILQ_INIT(&object->un_pager.sgp.sgp_pglist); > + return (object); > +} > + > +static void > +sg_pager_dealloc(vm_object_t object) > +{ > + struct sglist *sg; > + vm_page_t m; > + > + /* > + * Free up our fake pages. > + */ > + while ((m = TAILQ_FIRST(&object->un_pager.sgp.sgp_pglist)) != 0) { > + TAILQ_REMOVE(&object->un_pager.sgp.sgp_pglist, m, pageq); > + sg_pager_putfake(m); > + } > + > + sg = object->handle; > + sglist_free(sg); > +} > + > +static int > +sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage) > +{ > + struct sglist *sg; > + vm_page_t m_paddr, page; > + vm_pindex_t offset; > + vm_paddr_t paddr; > + vm_memattr_t memattr; > + size_t space; > + int i; > + > + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > + sg = object->handle; > + memattr = object->memattr; > + VM_OBJECT_UNLOCK(object); > + offset = m[reqpage]->pindex; > + > + /* > + * Lookup the physical address of the requested page. An initial > + * value of '1' instead of '0' is used so we can assert that the > + * page is found since '0' can be a valid page-aligned physical > + * address. > + */ > + space = 0; > + paddr = 1; > + for (i = 0; i < sg->sg_nseg; i++) { > + if (space + sg->sg_segs[i].ss_len <= (offset * PAGE_SIZE)) { > + space += sg->sg_segs[i].ss_len; > + continue; > + } > + paddr = sg->sg_segs[i].ss_paddr + offset * PAGE_SIZE - space; > + break; > + } > + KASSERT(paddr != 1, ("invalid SG page index")); > + > + /* If "paddr" is a real page, perform a sanity check on "memattr". */ > + if ((m_paddr = vm_phys_paddr_to_vm_page(paddr)) != NULL && > + pmap_page_get_memattr(m_paddr) != memattr) { > + memattr = pmap_page_get_memattr(m_paddr); > + printf( > + "WARNING: A device driver has set \"memattr\" inconsistently.\n"); > + } > + > + /* Return a fake page for the requested page. */ > + KASSERT(!(m[reqpage]->flags & PG_FICTITIOUS), > + ("backing page for SG is fake")); > + > + /* Construct a new fake page. */ > + printf("SG: getting fake page for paddr %lx\n", paddr); > + page = sg_pager_getfake(paddr, memattr); > + VM_OBJECT_LOCK(object); > + TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, pageq); > + > + /* Free the original pages and insert this fake page into the object. */ > + vm_page_lock_queues(); > + for (i = 0; i < count; i++) { > + printf("SG: freeing VM page %p\n", m[i]); > + vm_page_free(m[i]); > + } > + vm_page_unlock_queues(); > + printf("SG: Inserting new fake page\n"); > + vm_page_insert(page, object, offset); > + m[reqpage] = page; > + > + return (VM_PAGER_OK); > +} > + > +static void > +sg_pager_putpages(vm_object_t object, vm_page_t *m, int count, > + boolean_t sync, int *rtvals) > +{ > + > + panic("sg_pager_putpage called"); > +} > + > +static boolean_t > +sg_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, > + int *after) > +{ > + > + if (before != NULL) > + *before = 0; > + if (after != NULL) > + *after = 0; > + return (TRUE); > +} > + > +/* > + * Create a fictitious page with the specified physical address and memory > + * attribute. The memory attribute is the only the machine-dependent aspect > + * of a fictitious page that must be initialized. > + */ > +static vm_page_t > +sg_pager_getfake(vm_paddr_t paddr, vm_memattr_t memattr) > +{ > + vm_page_t m; > + > + m = uma_zalloc(fakepg_zone, M_WAITOK | M_ZERO); > + m->phys_addr = paddr; > + /* Fictitious pages don't use "segind". */ > + m->flags = PG_FICTITIOUS; > + /* Fictitious pages don't use "order" or "pool". */ > + m->oflags = VPO_BUSY; > + m->wire_count = 1; > + pmap_page_set_memattr(m, memattr); > + return (m); > +} > + > +static void > +sg_pager_putfake(vm_page_t m) > +{ > + > + if (!(m->flags & PG_FICTITIOUS)) > + panic("sg_pager_putfake: bad page"); > + uma_zfree(fakepg_zone, m); > +} > > Modified: head/sys/vm/vm.h > ============================================================================== > --- head/sys/vm/vm.h Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm.h Fri Jul 24 13:50:29 2009 (r195840) > @@ -89,7 +89,7 @@ typedef u_char vm_prot_t; /* protection > #define VM_PROT_DEFAULT VM_PROT_ALL > > enum obj_type { OBJT_DEFAULT, OBJT_SWAP, OBJT_VNODE, OBJT_DEVICE, OBJT_PHYS, > - OBJT_DEAD }; > + OBJT_DEAD, OBJT_SG }; > typedef u_char objtype_t; > > union vm_map_object; > > Modified: head/sys/vm/vm_fault.c > ============================================================================== > --- head/sys/vm/vm_fault.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm_fault.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -472,7 +472,8 @@ readrest: > (fs.first_object == fs.object || > (is_first_object_locked = VM_OBJECT_TRYLOCK(fs.first_object))) && > fs.first_object->type != OBJT_DEVICE && > - fs.first_object->type != OBJT_PHYS) { > + fs.first_object->type != OBJT_PHYS && > + fs.first_object->type != OBJT_SG) { > vm_pindex_t firstpindex, tmppindex; > > if (fs.first_pindex < 2 * VM_FAULT_READ) > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm_map.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -1719,7 +1719,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse > if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) > return; > VM_OBJECT_LOCK(object); > - if (object->type == OBJT_DEVICE) { > + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { > pmap_object_init_pt(map->pmap, addr, object, pindex, size); > goto unlock_return; > } > @@ -2247,7 +2247,8 @@ done: > */ > vm_fault_unwire(map, entry->start, entry->end, > entry->object.vm_object != NULL && > - entry->object.vm_object->type == OBJT_DEVICE); > + (entry->object.vm_object->type == OBJT_DEVICE || > + entry->object.vm_object->type == OBJT_SG)); > } > } > KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION, > @@ -2366,7 +2367,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st > saved_start = entry->start; > saved_end = entry->end; > fictitious = entry->object.vm_object != NULL && > - entry->object.vm_object->type == OBJT_DEVICE; > + (entry->object.vm_object->type == OBJT_DEVICE || > + entry->object.vm_object->type == OBJT_SG); > /* > * Release the map lock, relying on the in-transition > * mark. > @@ -2462,7 +2464,8 @@ done: > */ > vm_fault_unwire(map, entry->start, entry->end, > entry->object.vm_object != NULL && > - entry->object.vm_object->type == OBJT_DEVICE); > + (entry->object.vm_object->type == OBJT_DEVICE || > + entry->object.vm_object->type == OBJT_SG)); > } > } > next_entry_done: > @@ -2595,7 +2598,8 @@ vm_map_entry_unwire(vm_map_t map, vm_map > { > vm_fault_unwire(map, entry->start, entry->end, > entry->object.vm_object != NULL && > - entry->object.vm_object->type == OBJT_DEVICE); > + (entry->object.vm_object->type == OBJT_DEVICE || > + entry->object.vm_object->type == OBJT_SG)); > entry->wired_count = 0; > } > > > Modified: head/sys/vm/vm_meter.c > ============================================================================== > --- head/sys/vm/vm_meter.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm_meter.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -205,7 +205,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) > * synchronization should not impair the accuracy of > * the reported statistics. > */ > - if (object->type == OBJT_DEVICE) { > + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { > /* > * Devices, like /dev/mem, will badly skew our totals. > */ > > Modified: head/sys/vm/vm_object.c > ============================================================================== > --- head/sys/vm/vm_object.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm_object.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -309,6 +309,7 @@ vm_object_set_memattr(vm_object_t object > case OBJT_DEFAULT: > case OBJT_DEVICE: > case OBJT_PHYS: > + case OBJT_SG: > case OBJT_SWAP: > case OBJT_VNODE: > if (!TAILQ_EMPTY(&object->memq)) > > Modified: head/sys/vm/vm_object.h > ============================================================================== > --- head/sys/vm/vm_object.h Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm_object.h Fri Jul 24 13:50:29 2009 (r195840) > @@ -124,6 +124,15 @@ struct vm_object { > } devp; > > /* > + * SG pager > + * > + * sgp_pglist - list of allocated pages > + */ > + struct { > + TAILQ_HEAD(, vm_page) sgp_pglist; > + } sgp; > + > + /* > * Swap pager > * > * swp_bcount - number of swap 'swblock' metablocks, each > > Modified: head/sys/vm/vm_page.c > ============================================================================== > --- head/sys/vm/vm_page.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm_page.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -1163,7 +1163,7 @@ vm_page_alloc(vm_object_t object, vm_pin > if (object != NULL) { > /* Ignore device objects; the pager sets "memattr" for them. */ > if (object->memattr != VM_MEMATTR_DEFAULT && > - object->type != OBJT_DEVICE) > + object->type != OBJT_DEVICE && object->type != OBJT_SG) > pmap_page_set_memattr(m, object->memattr); > vm_page_insert(m, object, pindex); > } else > > Modified: head/sys/vm/vm_pageout.c > ============================================================================== > --- head/sys/vm/vm_pageout.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm_pageout.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -513,7 +513,9 @@ vm_pageout_object_deactivate_pages(pmap, > int actcount, rcount, remove_mode; > > VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); > - if (first_object->type == OBJT_DEVICE || first_object->type == OBJT_PHYS) > + if (first_object->type == OBJT_DEVICE || > + first_object->type == OBJT_SG || > + first_object->type == OBJT_PHYS) > return; > for (object = first_object;; object = backing_object) { > if (pmap_resident_count(pmap) <= desired) > > Modified: head/sys/vm/vm_pager.c > ============================================================================== > --- head/sys/vm/vm_pager.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm_pager.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -160,7 +160,8 @@ struct pagerops *pagertab[] = { > &vnodepagerops, /* OBJT_VNODE */ > &devicepagerops, /* OBJT_DEVICE */ > &physpagerops, /* OBJT_PHYS */ > - &deadpagerops /* OBJT_DEAD */ > + &deadpagerops, /* OBJT_DEAD */ > + &sgpagerops /* OBJT_SG */ > }; > > static const int npagers = sizeof(pagertab) / sizeof(pagertab[0]); > > Modified: head/sys/vm/vm_pager.h > ============================================================================== > --- head/sys/vm/vm_pager.h Fri Jul 24 13:40:25 2009 (r195839) > +++ head/sys/vm/vm_pager.h Fri Jul 24 13:50:29 2009 (r195840) > @@ -70,6 +70,7 @@ extern struct pagerops swappagerops; > extern struct pagerops vnodepagerops; > extern struct pagerops devicepagerops; > extern struct pagerops physpagerops; > +extern struct pagerops sgpagerops; > > /* > * get/put return values > > Modified: head/usr.bin/procstat/procstat_vm.c > ============================================================================== > --- head/usr.bin/procstat/procstat_vm.c Fri Jul 24 13:40:25 2009 (r195839) > +++ head/usr.bin/procstat/procstat_vm.c Fri Jul 24 13:50:29 2009 (r195840) > @@ -93,6 +93,9 @@ procstat_vm(pid_t pid, struct kinfo_proc > case KVME_TYPE_DEAD: > str = "dd"; > break; > + case KVME_TYPE_SG: > + str = "sg"; > + break; > case KVME_TYPE_UNKNOWN: > default: > str = "??"; > From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 15:37:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ACF91065673; Fri, 24 Jul 2009 15:37:02 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 494998FC15; Fri, 24 Jul 2009 15:37:02 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OFb2os014194; Fri, 24 Jul 2009 15:37:02 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OFb2m5014192; Fri, 24 Jul 2009 15:37:02 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907241537.n6OFb2m5014192@svn.freebsd.org> From: Sam Leffler Date: Fri, 24 Jul 2009 15:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195849 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 15:37:03 -0000 Author: sam Date: Fri Jul 24 15:37:02 2009 New Revision: 195849 URL: http://svn.freebsd.org/changeset/base/195849 Log: revert OACTIVE part of r195845; instead fix the comment so it does not refer to the old hack removed in r193312 Approved by: re (implicit) Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Jul 24 15:31:22 2009 (r195848) +++ head/sys/net80211/ieee80211_output.c Fri Jul 24 15:37:02 2009 (r195849) @@ -382,10 +382,22 @@ ieee80211_output(struct ifnet *ifp, stru { #define senderr(e) do { error = (e); goto bad;} while (0) struct ieee80211_node *ni = NULL; - struct ieee80211vap *vap = ifp->if_softc; + struct ieee80211vap *vap; struct ieee80211_frame *wh; int error; + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + /* + * Short-circuit requests if the vap is marked OACTIVE + * as this can happen because a packet came down through + * ieee80211_start before the vap entered RUN state in + * which case it's ok to just drop the frame. This + * should not be necessary but callers of if_output don't + * check OACTIVE. + */ + senderr(ENETDOWN); + } + vap = ifp->if_softc; /* * Hand to the 802.3 code if not tagged as * a raw 802.11 frame. From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 16:00:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B1D51065692; Fri, 24 Jul 2009 16:00:47 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 0AC518FC19; Fri, 24 Jul 2009 16:00:46 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id F1B543BC6E7; Fri, 24 Jul 2009 12:00:45 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 24 Jul 2009 12:00:46 -0400 X-Sasl-enc: ngIROz+QxW97SumAzX2uUBZoaLGwjzHyWGej9DhaGgy+ 1248451245 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 21714BE8C; Fri, 24 Jul 2009 12:00:45 -0400 (EDT) Message-ID: <4A69DAAB.8050309@incunabulum.net> Date: Fri, 24 Jul 2009 17:00:43 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Sam Leffler References: <200907241531.n6OFVMr4014002@svn.freebsd.org> In-Reply-To: <200907241531.n6OFVMr4014002@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195848 - in head/tools/tools/net80211: stumbler w00t w00t/ap w00t/assoc w00t/expand w00t/prga w00t/redir wesside/wesside wlaninject X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 16:00:48 -0000 Sam Leffler wrote: > Modified: > head/tools/tools/net80211/stumbler/stumbler.c > head/tools/tools/net80211/w00t/README > ... > head/tools/tools/net80211/wesside/wesside/wesside.c > head/tools/tools/net80211/wlaninject/wlaninject.c > All I can say is 'werd'... Mr Bittau's (to be Dr?) stuff's in there... :-) From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 16:54:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 708DC106564A; Fri, 24 Jul 2009 16:54:23 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 443828FC16; Fri, 24 Jul 2009 16:54:23 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OGsMho015768; Fri, 24 Jul 2009 16:54:22 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OGsM1d015766; Fri, 24 Jul 2009 16:54:22 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200907241654.n6OGsM1d015766@svn.freebsd.org> From: Jack F Vogel Date: Fri, 24 Jul 2009 16:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195850 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 16:54:23 -0000 Author: jfv Date: Fri Jul 24 16:54:22 2009 New Revision: 195850 URL: http://svn.freebsd.org/changeset/base/195850 Log: A small number of systems in the ICH9/10 family have a flash part that is made up of 8K banks rather than 4K, if these systems are using bank 1 then the last change in this code breaks the bank read, resulting in an invalid checksum of the eeprom during driver load. This change fixes this. Approved by: re Modified: head/sys/dev/e1000/e1000_ich8lan.c Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Fri Jul 24 15:37:02 2009 (r195849) +++ head/sys/dev/e1000/e1000_ich8lan.c Fri Jul 24 16:54:22 2009 (r195850) @@ -307,7 +307,6 @@ static s32 e1000_init_nvm_params_ich8lan { struct e1000_nvm_info *nvm = &hw->nvm; struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; - union ich8_hws_flash_status hsfsts; u32 gfpreg, sector_base_addr, sector_end_addr; s32 ret_val = E1000_SUCCESS; u16 i; @@ -346,20 +345,6 @@ static s32 e1000_init_nvm_params_ich8lan /* Adjust to word count */ nvm->flash_bank_size /= sizeof(u16); - /* - * Make sure the flash bank size does not overwrite the 4k - * sector ranges. We may have 64k allotted to us but we only care - * about the first 2 4k sectors. Therefore, if we have anything less - * than 64k set in the HSFSTS register, we will reduce the bank size - * down to 4k and let the rest remain unused. If berasesz == 3, then - * we are working in 64k mode. Otherwise we are not. - */ - if (nvm->flash_bank_size > E1000_SHADOW_RAM_WORDS) { - hsfsts.regval = E1000_READ_FLASH_REG16(hw, ICH_FLASH_HSFSTS); - if (hsfsts.hsf_status.berasesz != 3) - nvm->flash_bank_size = E1000_SHADOW_RAM_WORDS; - } - nvm->word_size = E1000_SHADOW_RAM_WORDS; /* Clear shadow ram */ @@ -1961,13 +1946,8 @@ static s32 e1000_erase_flash_bank_ich8la iteration = 1; break; case 2: - if (hw->mac.type == e1000_ich9lan) { - sector_size = ICH_FLASH_SEG_SIZE_8K; - iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_8K; - } else { - ret_val = -E1000_ERR_NVM; - goto out; - } + sector_size = ICH_FLASH_SEG_SIZE_8K; + iteration = 1; break; case 3: sector_size = ICH_FLASH_SEG_SIZE_64K; From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 16:57:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DB02106564A; Fri, 24 Jul 2009 16:57:50 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B44A8FC19; Fri, 24 Jul 2009 16:57:50 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OGvoNM015884; Fri, 24 Jul 2009 16:57:50 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OGvoQX015880; Fri, 24 Jul 2009 16:57:50 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200907241657.n6OGvoQX015880@svn.freebsd.org> From: Jack F Vogel Date: Fri, 24 Jul 2009 16:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195851 - in head/sys/dev: e1000 ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 16:57:51 -0000 Author: jfv Date: Fri Jul 24 16:57:49 2009 New Revision: 195851 URL: http://svn.freebsd.org/changeset/base/195851 Log: This delta fixes two bugs: - When a vlan event occurs a check was not made that the event was actually for the interface, thus resulting in a panic. All three drivers have this vulnerability. Add a check for this condition. - Secondly, there was a duplicate buf_ring free in the em driver resulting in a panic on unload. Remove. Approved by: re Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Jul 24 16:54:22 2009 (r195850) +++ head/sys/dev/e1000/if_em.c Fri Jul 24 16:57:49 2009 (r195851) @@ -919,9 +919,6 @@ em_detach(device_t dev) bus_generic_detach(dev); if_free(ifp); -#if __FreeBSD_version >= 800000 - drbr_free(adapter->br, M_DEVBUF); -#endif em_free_transmit_structures(adapter); em_free_receive_structures(adapter); @@ -3644,7 +3641,8 @@ em_free_transmit_structures(struct adapt adapter->txtag = NULL; } #if __FreeBSD_version >= 800000 - buf_ring_free(adapter->br, M_DEVBUF); + if (adapter->br != NULL) + buf_ring_free(adapter->br, M_DEVBUF); #endif } @@ -4720,7 +4718,10 @@ em_register_vlan(void *unused, struct if struct adapter *adapter = ifp->if_softc; u32 index, bit; - if ((vtag == 0) || (vtag > 4095)) /* Invalid */ + if (ifp->if_init != em_init) /* Not our event */ + return; + + if ((vtag == 0) || (vtag > 4095)) /* Invalid ID */ return; index = (vtag >> 5) & 0x7F; @@ -4741,6 +4742,9 @@ em_unregister_vlan(void *unused, struct struct adapter *adapter = ifp->if_softc; u32 index, bit; + if (ifp->if_init != em_init) + return; + if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jul 24 16:54:22 2009 (r195850) +++ head/sys/dev/e1000/if_igb.c Fri Jul 24 16:57:49 2009 (r195851) @@ -3068,7 +3068,8 @@ igb_free_transmit_buffers(struct tx_ring } } #if __FreeBSD_version >= 800000 - buf_ring_free(txr->br, M_DEVBUF); + if (txr->br != NULL) + buf_ring_free(txr->br, M_DEVBUF); #endif if (txr->tx_buffers != NULL) { free(txr->tx_buffers, M_DEVBUF); @@ -4309,6 +4310,9 @@ igb_register_vlan(void *unused, struct i struct adapter *adapter = ifp->if_softc; u32 index, bit; + if (ifp->if_init != igb_init) /* Not our event */ + return; + if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; @@ -4330,6 +4334,9 @@ igb_unregister_vlan(void *unused, struct struct adapter *adapter = ifp->if_softc; u32 index, bit; + if (ifp->if_init != igb_init) + return; + if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Jul 24 16:54:22 2009 (r195850) +++ head/sys/dev/ixgbe/ixgbe.c Fri Jul 24 16:57:49 2009 (r195851) @@ -2961,7 +2961,8 @@ ixgbe_free_transmit_buffers(struct tx_ri } } #if __FreeBSD_version >= 800000 - buf_ring_free(txr->br, M_DEVBUF); + if (txr->br != NULL) + buf_ring_free(txr->br, M_DEVBUF); #endif if (txr->tx_buffers != NULL) { free(txr->tx_buffers, M_DEVBUF); @@ -4128,6 +4129,9 @@ ixgbe_register_vlan(void *unused, struct struct adapter *adapter = ifp->if_softc; u16 index, bit; + if (ifp->if_init != ixgbe_init) /* Not our event */ + return; + if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; @@ -4150,6 +4154,9 @@ ixgbe_unregister_vlan(void *unused, stru struct adapter *adapter = ifp->if_softc; u16 index, bit; + if (ifp->if_init != ixgbe_init) + return; + if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 17:45:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40F4E106564A; Fri, 24 Jul 2009 17:45:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2EC8FC23; Fri, 24 Jul 2009 17:45:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id C98DD46B2E; Fri, 24 Jul 2009 13:45:01 -0400 (EDT) Date: Fri, 24 Jul 2009 18:45:01 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200907241340.n6ODeP2B011222@svn.freebsd.org> Message-ID: References: <200907241340.n6ODeP2B011222@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195839 - head/usr.bin/locate/locate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 17:45:02 -0000 On Fri, 24 Jul 2009, John Baldwin wrote: > Move the check to ensure the locate database has the minimum required size > when using mmap() before invoking mmap(). This avoids a confusing error > message when locate is invoked against a zero-size database after the > recent change to make mmap() fail requests to map 0 bytes. Does this mean we should anticipate other possible application compatibility problems? And I guess that means a 7.2 userspace (i.e., jail) on an 8.0 kernel won't support locate? Robert > > Submitted by: Jaakko Heinonen jh of saunalahti dot fi > Approved by: re (kensmith) > MFC after: 1 week > > Modified: > head/usr.bin/locate/locate/fastfind.c > head/usr.bin/locate/locate/locate.c > > Modified: head/usr.bin/locate/locate/fastfind.c > ============================================================================== > --- head/usr.bin/locate/locate/fastfind.c Thu Jul 23 21:12:21 2009 (r195838) > +++ head/usr.bin/locate/locate/fastfind.c Fri Jul 24 13:40:25 2009 (r195839) > @@ -154,9 +154,6 @@ fastfind > > /* init bigram table */ > #ifdef FF_MMAP > - if (len < (2*NBG)) > - errx(1, "database too small: %s", database); > - > for (c = 0, p = bigram1, s = bigram2; c < NBG; c++, len-= 2) { > p[c] = check_bigram_char(*paddr++); > s[c] = check_bigram_char(*paddr++); > > Modified: head/usr.bin/locate/locate/locate.c > ============================================================================== > --- head/usr.bin/locate/locate/locate.c Thu Jul 23 21:12:21 2009 (r195838) > +++ head/usr.bin/locate/locate/locate.c Fri Jul 24 13:40:25 2009 (r195839) > @@ -291,6 +291,8 @@ search_mmap(db, s) > fstat(fd, &sb) == -1) > err(1, "`%s'", db); > len = sb.st_size; > + if (len < (2*NBG)) > + errx(1, "database too small: %s", db); > > if ((p = mmap((caddr_t)0, (size_t)len, > PROT_READ, MAP_SHARED, > From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 17:54:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B30671065670; Fri, 24 Jul 2009 17:54:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8494B8FC15; Fri, 24 Jul 2009 17:54:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 39BC046B2E; Fri, 24 Jul 2009 13:54:50 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 6974C8A09D; Fri, 24 Jul 2009 13:54:49 -0400 (EDT) From: John Baldwin To: Jack F Vogel Date: Fri, 24 Jul 2009 13:54:34 -0400 User-Agent: KMail/1.9.7 References: <200907241657.n6OGvoQX015880@svn.freebsd.org> In-Reply-To: <200907241657.n6OGvoQX015880@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907241354.34889.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 24 Jul 2009 13:54:49 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195851 - in head/sys/dev: e1000 ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 17:54:51 -0000 On Friday 24 July 2009 12:57:50 pm Jack F Vogel wrote: > Author: jfv > Date: Fri Jul 24 16:57:49 2009 > New Revision: 195851 > URL: http://svn.freebsd.org/changeset/base/195851 > > Log: > This delta fixes two bugs: > - When a vlan event occurs a check was not made that > the event was actually for the interface, thus resulting > in a panic. All three drivers have this vulnerability. Add > a check for this condition. These are still not correct. You need to check the softc as in the latest patch I sent. Otherwise if you have multiple em(4) or igb(4) interfaces in a machine you will register vlan's on all the em/igb interfaces multiple times. E.g., if you added a em0.500 and em1.502, you would actually end up with both em0 and em1 doing hardware tagging for both vlans 500 and 502. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 18:31:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 496541065670; Fri, 24 Jul 2009 18:31:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 371468FC20; Fri, 24 Jul 2009 18:31:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OIV5wH017751; Fri, 24 Jul 2009 18:31:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OIV5sV017749; Fri, 24 Jul 2009 18:31:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907241831.n6OIV5sV017749@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jul 2009 18:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195852 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 18:31:05 -0000 Author: jhb Date: Fri Jul 24 18:31:04 2009 New Revision: 195852 URL: http://svn.freebsd.org/changeset/base/195852 Log: Bump __FreeBSD_version for the introduction of OBJT_SG. Approved by: re (kensmith) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jul 24 16:57:49 2009 (r195851) +++ head/sys/sys/param.h Fri Jul 24 18:31:04 2009 (r195852) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 800105 /* Master, propagated to newvers */ +#define __FreeBSD_version 800106 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 18:53:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA5DB106566B; Fri, 24 Jul 2009 18:53:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A76B58FC1F; Fri, 24 Jul 2009 18:53:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 447D246B03; Fri, 24 Jul 2009 14:53:46 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 0DA088A0A1; Fri, 24 Jul 2009 14:53:45 -0400 (EDT) From: John Baldwin To: Robert Watson Date: Fri, 24 Jul 2009 14:21:53 -0400 User-Agent: KMail/1.9.7 References: <200907241340.n6ODeP2B011222@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907241421.54000.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 24 Jul 2009 14:53:45 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195839 - head/usr.bin/locate/locate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 18:53:47 -0000 On Friday 24 July 2009 1:45:01 pm Robert Watson wrote: > > On Fri, 24 Jul 2009, John Baldwin wrote: > > > Move the check to ensure the locate database has the minimum required size > > when using mmap() before invoking mmap(). This avoids a confusing error > > message when locate is invoked against a zero-size database after the > > recent change to make mmap() fail requests to map 0 bytes. > > Does this mean we should anticipate other possible application compatibility > problems? And I guess that means a 7.2 userspace (i.e., jail) on an 8.0 > kernel won't support locate? In the case of locate(8) the only difference was in the error message received. In 7.2 if you used /dev/null as your locate database then you would trigger the "database too small" error. In 8.0 prior to this fix it was failing due to mmap() dying with EINVAL so a more confusing "Invalid parameter" error was emitted. This just makes the error message more readable. In general I would not expect 3rd party applications to break since other OS's such as Linux and OpenSolaris already fail mmap() with a length of 0 with EINVAL: http://fxr.watson.org/fxr/source/mm/mmap.c?v=linux-2.6#L932 http://fxr.watson.org/fxr/source/common/os/grow.c?v=OPENSOLARIS;im=excerpts#L647 Curiously NetBSD, OpenBSD, and Darwin all seem to return a random address that isn't really mapped with no error value. NetBSD silently returns 0 without doing anything for an munmap() with a length of 0. OpenBSD will return 0 if the address passed to munmap() is a valid address for the process w/o doing anything and EINVAL if the address is not valid I think (so passing the return value of mmap(.., 0) to munmap() may or may not succeed on OpenBSD). Darwin returns EINVAL for an munmap() with a length of 0. DFBSD does the same thing FreeBSD did before my commit to mmap(). > Robert > > > > > Submitted by: Jaakko Heinonen jh of saunalahti dot fi > > Approved by: re (kensmith) > > MFC after: 1 week > > > > Modified: > > head/usr.bin/locate/locate/fastfind.c > > head/usr.bin/locate/locate/locate.c > > > > Modified: head/usr.bin/locate/locate/fastfind.c > > ============================================================================== > > --- head/usr.bin/locate/locate/fastfind.c Thu Jul 23 21:12:21 2009 (r195838) > > +++ head/usr.bin/locate/locate/fastfind.c Fri Jul 24 13:40:25 2009 (r195839) > > @@ -154,9 +154,6 @@ fastfind > > > > /* init bigram table */ > > #ifdef FF_MMAP > > - if (len < (2*NBG)) > > - errx(1, "database too small: %s", database); > > - > > for (c = 0, p = bigram1, s = bigram2; c < NBG; c++, len-= 2) { > > p[c] = check_bigram_char(*paddr++); > > s[c] = check_bigram_char(*paddr++); > > > > Modified: head/usr.bin/locate/locate/locate.c > > ============================================================================== > > --- head/usr.bin/locate/locate/locate.c Thu Jul 23 21:12:21 2009 (r195838) > > +++ head/usr.bin/locate/locate/locate.c Fri Jul 24 13:40:25 2009 (r195839) > > @@ -291,6 +291,8 @@ search_mmap(db, s) > > fstat(fd, &sb) == -1) > > err(1, "`%s'", db); > > len = sb.st_size; > > + if (len < (2*NBG)) > > + errx(1, "database too small: %s", db); > > > > if ((p = mmap((caddr_t)0, (size_t)len, > > PROT_READ, MAP_SHARED, > > > -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 19:12:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 403D21065670; Fri, 24 Jul 2009 19:12:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CC888FC25; Fri, 24 Jul 2009 19:12:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OJCK6o018655; Fri, 24 Jul 2009 19:12:20 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OJCKih018651; Fri, 24 Jul 2009 19:12:20 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200907241912.n6OJCKih018651@svn.freebsd.org> From: Brooks Davis Date: Fri, 24 Jul 2009 19:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195853 - in head: sys/kern sys/sys usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 19:12:20 -0000 Author: brooks Date: Fri Jul 24 19:12:19 2009 New Revision: 195853 URL: http://svn.freebsd.org/changeset/base/195853 Log: Introduce a new sysctl process mib, kern.proc.groups which adds the ability to retrieve the group list of each process. Modify procstat's -s option to query this mib when the kinfo_proc reports that the field has been truncated. If the mib does not exist, fall back to the truncated list. Reviewed by: rwatson Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/kern/kern_proc.c head/sys/sys/sysctl.h head/usr.bin/procstat/procstat_cred.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Jul 24 18:31:04 2009 (r195852) +++ head/sys/kern/kern_proc.c Fri Jul 24 19:12:19 2009 (r195853) @@ -1826,6 +1826,43 @@ repeat: } #endif +/* + * This sysctl allows a process to retrieve the full list of groups from + * itself or another process. + */ +static int +sysctl_kern_proc_groups(SYSCTL_HANDLER_ARGS) +{ + pid_t *pidp = (pid_t *)arg1; + unsigned int arglen = arg2; + struct proc *p; + struct ucred *cred; + int error; + + if (arglen != 1) + return (EINVAL); + if (*pidp == -1) { /* -1 means this process */ + p = req->td->td_proc; + } else { + p = pfind(*pidp); + if (p == NULL) + return (ESRCH); + if ((error = p_cansee(curthread, p)) != 0) { + PROC_UNLOCK(p); + return (error); + } + } + + cred = crhold(p->p_ucred); + if (*pidp != -1) + PROC_UNLOCK(p); + + error = SYSCTL_OUT(req, cred->cr_groups, + cred->cr_ngroups * sizeof(gid_t)); + crfree(cred); + return (error); +} + SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD, 0, "Process table"); SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT| @@ -1910,3 +1947,6 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC static SYSCTL_NODE(_kern_proc, KERN_PROC_KSTACK, kstack, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc_kstack, "Process kernel stacks"); #endif + +static SYSCTL_NODE(_kern_proc, KERN_PROC_GROUPS, groups, CTLFLAG_RD | + CTLFLAG_MPSAFE, sysctl_kern_proc_groups, "Process groups"); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Fri Jul 24 18:31:04 2009 (r195852) +++ head/sys/sys/sysctl.h Fri Jul 24 19:12:19 2009 (r195853) @@ -486,6 +486,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e */ #define KERN_PROC_VMMAP 32 /* VM map entries for process */ #define KERN_PROC_FILEDESC 33 /* File descriptors for process */ +#define KERN_PROC_GROUPS 34 /* process groups */ /* * KERN_IPC identifiers Modified: head/usr.bin/procstat/procstat_cred.c ============================================================================== --- head/usr.bin/procstat/procstat_cred.c Fri Jul 24 18:31:04 2009 (r195852) +++ head/usr.bin/procstat/procstat_cred.c Fri Jul 24 19:12:19 2009 (r195853) @@ -31,7 +31,9 @@ #include #include +#include #include +#include #include "procstat.h" @@ -39,6 +41,10 @@ void procstat_cred(pid_t pid, struct kinfo_proc *kipp) { int i; + int mib[4]; + int ngroups; + size_t len; + gid_t *groups = NULL; if (!hflag) printf("%5s %-16s %5s %5s %5s %5s %5s %5s %-20s\n", "PID", @@ -53,7 +59,39 @@ procstat_cred(pid_t pid, struct kinfo_pr printf("%5d ", kipp->ki_groups[0]); printf("%5d ", kipp->ki_rgid); printf("%5d ", kipp->ki_svgid); - for (i = 0; i < kipp->ki_ngroups; i++) - printf("%s%d", (i > 0) ? "," : "", kipp->ki_groups[i]); + + /* + * We may have too many groups to fit in kinfo_proc's statically + * sized storage. If that occurs, attempt to retrieve them via + * sysctl. + */ + if (kipp->ki_cr_flags & KI_CRF_GRP_OVERFLOW) { + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_GROUPS; + mib[3] = pid; + + ngroups = sysconf(_SC_NGROUPS_MAX) + 1; + len = ngroups * sizeof(gid_t); + if((groups = malloc(len)) == NULL) + err(-1, "malloc"); + + if (sysctl(mib, 4, groups, &len, NULL, 0) == -1) { + warn("sysctl: kern.proc.groups: %d " + "group list truncated", pid); + free(groups); + groups = NULL; + } + ngroups = len / sizeof(gid_t); + } + if (groups == NULL) { + ngroups = kipp->ki_ngroups; + groups = kipp->ki_groups; + } + for (i = 0; i < ngroups; i++) + printf("%s%d", (i > 0) ? "," : "", groups[i]); + if (groups != kipp->ki_groups) + free(groups); + printf("\n"); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 19:35:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 898B01065672; Fri, 24 Jul 2009 19:35:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 736128FC19; Fri, 24 Jul 2009 19:35:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OJZ6AH019129; Fri, 24 Jul 2009 19:35:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OJZ6HX019123; Fri, 24 Jul 2009 19:35:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907241935.n6OJZ6HX019123@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jul 2009 19:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195854 - in stable/7: lib/libc lib/libc/sys sys sys/compat/freebsd32 sys/contrib/pf sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 19:35:07 -0000 Author: jhb Date: Fri Jul 24 19:35:06 2009 New Revision: 195854 URL: http://svn.freebsd.org/changeset/base/195854 Log: MFC: Several cleanups to the syscall tables: - Add explicit prototypes for lkmnosys() and lkmressys() in and remove hacks for those routines from makesyscalls.sh. - Change the LKM syscall entries in the freebsd32 table to use lkmnosys rather than nosys. - Use NOPROTO for __syscall() to remove more magic logic from makesyscalls.sh. - Retire the unused nfsclnt() system call and mark it as UNIMPL rather than NOIMPL. - Remove the NOIMPL system call type. - Allow multiple flags in the type system call type field. Use this to retire CPT_NOA. - Update the comment descriptions for COMPAT[45] system calls in various generated files. - Update comments in syscalls.master. - Include defintions for audit identifiers for compat system calls in . Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/sys/Symbol.map stable/7/sys/ (props changed) stable/7/sys/compat/freebsd32/syscalls.master stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/makesyscalls.sh stable/7/sys/kern/syscalls.master stable/7/sys/sys/sysent.h Modified: stable/7/lib/libc/sys/Symbol.map ============================================================================== --- stable/7/lib/libc/sys/Symbol.map Fri Jul 24 19:12:19 2009 (r195853) +++ stable/7/lib/libc/sys/Symbol.map Fri Jul 24 19:35:06 2009 (r195854) @@ -202,7 +202,6 @@ FBSD_1.0 { nanosleep; netbsd_lchown; netbsd_msync; - nfsclnt; nfssvc; nfstat; nlstat; @@ -746,8 +745,6 @@ FBSDprivate_1.0 { __sys_netbsd_lchown; _netbsd_msync; __sys_netbsd_msync; - _nfsclnt; - __sys_nfsclnt; _nfssvc; __sys_nfssvc; _nfstat; Modified: stable/7/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/7/sys/compat/freebsd32/syscalls.master Fri Jul 24 19:12:19 2009 (r195853) +++ stable/7/sys/compat/freebsd32/syscalls.master Fri Jul 24 19:35:06 2009 (r195854) @@ -5,15 +5,17 @@ ; System call name/number master file. ; Processed to created init_sysent.c, syscalls.c and syscall.h. -; Columns: number audit type nargs name alt{name,tag,rtyp}/comments +; Columns: number audit type name alt{name,tag,rtyp}/comments ; number system call number, must be in order ; audit the audit event associated with the system call ; A value of AUE_NULL means no auditing, but it also means that ; there is no audit event for the call at this time. For the ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. -; type one of STD, OBSOL, UNIMPL, COMPAT, CPT_NOA, LIBCOMPAT, -; NODEF, NOARGS, NOPROTO, NOIMPL, NOSTD, COMPAT4 +; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, +; LIBCOMPAT, NODEF, NOARGS, NOPROTO, NOSTD +; The COMPAT* options may be combined with one or more NO* +; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) ; name psuedo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different @@ -25,15 +27,16 @@ ; STD always included ; COMPAT included on COMPAT #ifdef ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) +; COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat) ; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically -; compiled in; sysent entry will be filled with lkmsys +; compiled in; sysent entry will be filled with lkmressys ; so the SYSCALL_MODULE macro works ; NOARGS same as STD except do not create structure in sys/sysproto.h ; NODEF same as STD except only have the entry in the syscall table -; added. Meaning - do do not create structure or function +; added. Meaning - do not create structure or function ; prototype in sys/sysproto.h ; NOPROTO same as STD except do not create structure or ; function prototype in sys/sysproto.h. Does add a @@ -388,16 +391,16 @@ ; ; The following are reserved for loadable syscalls ; -210 AUE_NULL UNIMPL -211 AUE_NULL UNIMPL -212 AUE_NULL UNIMPL -213 AUE_NULL UNIMPL -214 AUE_NULL UNIMPL -215 AUE_NULL UNIMPL -216 AUE_NULL UNIMPL -217 AUE_NULL UNIMPL -218 AUE_NULL UNIMPL -219 AUE_NULL UNIMPL +210 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int +211 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int +212 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int +213 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int +214 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int +215 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int +216 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int +217 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int +218 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int +219 AUE_NULL NODEF lkmnosys lkmnosys nosys_args int ; ; The following were introduced with NetBSD/4.4Lite-2 @@ -652,7 +655,7 @@ 367 AUE_NULL UNIMPL __cap_get_file 368 AUE_NULL UNIMPL __cap_set_fd 369 AUE_NULL UNIMPL __cap_set_file -370 AUE_NULL UNIMPL lkmressys +370 AUE_NULL UNIMPL nosys 371 AUE_EXTATTR_SET_FD NOPROTO { int extattr_set_fd(int fd, \ int attrnamespace, const char *attrname, \ void *data, size_t nbytes); } Modified: stable/7/sys/kern/makesyscalls.sh ============================================================================== --- stable/7/sys/kern/makesyscalls.sh Fri Jul 24 19:12:19 2009 (r195853) +++ stable/7/sys/kern/makesyscalls.sh Fri Jul 24 19:35:06 2009 (r195854) @@ -213,6 +213,19 @@ s/\$//g print exit 1 } + # Returns true if the type "name" is the first flag in the type field + function type(name, flags, n) { + n = split($3, flags, /\|/) + return (n > 0 && flags[1] == name) + } + # Returns true if the flag "name" is set in the type field + function flag(name, flags, i, n) { + n = split($3, flags, /\|/) + for (i = 1; i <= n; i++) + if (flags[i] == name) + return 1 + return 0 + } function align_sysent_comment(column) { printf("\t") > sysent column = column + 8 - column % 8 @@ -241,7 +254,7 @@ s/\$//g rettype="int" end=NF } - if ($3 == "NODEF") { + if (flag("NODEF")) { auditev="AUE_NULL" funcname=$4 argssize = "AS(" $6 ")" @@ -267,11 +280,11 @@ s/\$//g funcalias = funcname if (argalias == "") { argalias = funcname "_args" - if ($3 == "COMPAT") + if (flag("COMPAT")) argalias = "o" argalias - if ($3 == "COMPAT4") + if (flag("COMPAT4")) argalias = "freebsd4_" argalias - if ($3 == "COMPAT6") + if (flag("COMPAT6")) argalias = "freebsd6_" argalias } f++ @@ -318,8 +331,8 @@ s/\$//g auditev = $2; } - $3 == "STD" || $3 == "NODEF" || $3 == "NOARGS" || $3 == "NOPROTO" \ - || $3 == "NOIMPL" || $3 == "NOSTD" { + type("STD") || type("NODEF") || type("NOARGS") || type("NOPROTO") \ + || type("NOSTD") { parseline() printf("\t/* %s */\n\tcase %d: {\n", funcname, syscall) > systrace printf("\t/* %s */\n\tcase %d:\n", funcname, syscall) > systracetmp @@ -345,43 +358,30 @@ s/\$//g } printf("\t\t*n_args = %d;\n\t\tbreak;\n\t}\n", argc) > systrace printf("\t\tbreak;\n") > systracetmp - if ((!nosys || funcname != "nosys") && \ - (funcname != "lkmnosys") && (funcname != "lkmressys")) { - if (argc != 0 && $3 != "NOARGS" && $3 != "NOPROTO") { - printf("struct %s {\n", argalias) > sysarg - for (i = 1; i <= argc; i++) - printf("\tchar %s_l_[PADL_(%s)]; " \ - "%s %s; char %s_r_[PADR_(%s)];\n", - argname[i], argtype[i], - argtype[i], argname[i], - argname[i], argtype[i]) > sysarg - printf("};\n") > sysarg - } - else if ($3 != "NOARGS" && $3 != "NOPROTO" && \ - $3 != "NODEF") - printf("struct %s {\n\tregister_t dummy;\n};\n", - argalias) > sysarg - } - if (($3 != "NOPROTO" && $3 != "NODEF" && \ - (funcname != "nosys" || !nosys)) || \ - (funcname == "lkmnosys" && !lkmnosys) || \ - funcname == "lkmressys") { + if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \ + !flag("NODEF")) { + printf("struct %s {\n", argalias) > sysarg + for (i = 1; i <= argc; i++) + printf("\tchar %s_l_[PADL_(%s)]; " \ + "%s %s; char %s_r_[PADR_(%s)];\n", + argname[i], argtype[i], + argtype[i], argname[i], + argname[i], argtype[i]) > sysarg + printf("};\n") > sysarg + } + else if (!flag("NOARGS") && !flag("NOPROTO") && !flag("NODEF")) + printf("struct %s {\n\tregister_t dummy;\n};\n", + argalias) > sysarg + if (!flag("NOPROTO") && !flag("NODEF")) { printf("%s\t%s(struct thread *, struct %s *)", rettype, funcname, argalias) > sysdcl printf(";\n") > sysdcl printf("#define\t%sAUE_%s\t%s\n", syscallprefix, funcalias, auditev) > sysaue } - if (funcname == "nosys") - nosys = 1 - if (funcname == "lkmnosys") - lkmnosys = 1 printf("\t{ %s, (sy_call_t *)", argssize) > sysent column = 8 + 2 + length(argssize) + 15 - if ($3 == "NOIMPL") { - printf("%s },", "nosys, AUE_NULL, NULL, 0, 0") > sysent - column = column + length("nosys") + 3 - } else if ($3 == "NOSTD") { + if (flag("NOSTD")) { printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0") > sysent column = column + length("lkmressys") + 3 } else { @@ -392,7 +392,7 @@ s/\$//g printf("/* %d = %s */\n", syscall, funcalias) > sysent printf("\t\"%s\",\t\t\t/* %d = %s */\n", funcalias, syscall, funcalias) > sysnames - if ($3 != "NODEF") { + if (!flag("NODEF")) { printf("#define\t%s%s\t%d\n", syscallprefix, funcalias, syscall) > syshdr printf(" \\\n\t%s.o", funcalias) > sysmk @@ -400,28 +400,32 @@ s/\$//g syscall++ next } - $3 == "COMPAT" || $3 == "COMPAT4" || $3 == "COMPAT6" || $3 == "CPT_NOA" { - if ($3 == "COMPAT" || $3 == "CPT_NOA") { + type("COMPAT") || type("COMPAT4") || type("COMPAT6") { + if (flag("COMPAT")) { ncompat++ out = syscompat outdcl = syscompatdcl wrap = "compat" prefix = "o" - } else if ($3 == "COMPAT4") { + descr = "old" + } else if (flag("COMPAT4")) { ncompat4++ out = syscompat4 outdcl = syscompat4dcl wrap = "compat4" prefix = "freebsd4_" - } else if ($3 == "COMPAT6") { + descr = "freebsd4" + } else if (flag("COMPAT6")) { ncompat6++ out = syscompat6 outdcl = syscompat6dcl wrap = "compat6" prefix = "freebsd6_" + descr = "freebsd6" } parseline() - if (argc != 0 && $3 != "CPT_NOA") { + if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \ + !flag("NODEF")) { printf("struct %s {\n", argalias) > out for (i = 1; i <= argc; i++) printf("\tchar %s_l_[PADL_(%s)]; %s %s; " \ @@ -431,22 +435,33 @@ s/\$//g argname[i], argtype[i]) > out printf("};\n") > out } - else if($3 != "CPT_NOA") + else if (!flag("NOARGS") && !flag("NOPROTO") && !flag("NODEF")) printf("struct %s {\n\tregister_t dummy;\n};\n", argalias) > sysarg - printf("%s\t%s%s(struct thread *, struct %s *);\n", - rettype, prefix, funcname, argalias) > outdcl - printf("\t{ %s(%s,%s), %s, NULL, 0, 0 },", - wrap, argssize, funcname, auditev) > sysent - align_sysent_comment(8 + 9 + \ - length(argssize) + 1 + length(funcname) + length(auditev) + 4) - printf("/* %d = old %s */\n", syscall, funcalias) > sysent - printf("\t\"%s.%s\",\t\t/* %d = old %s */\n", - wrap, funcalias, syscall, funcalias) > sysnames - if ($3 == "COMPAT" || $3 == "CPT_NOA") { + if (!flag("NOPROTO") && !flag("NODEF")) { + printf("%s\t%s%s(struct thread *, struct %s *);\n", + rettype, prefix, funcname, argalias) > outdcl + printf("#define\t%sAUE_%s%s\t%s\n", syscallprefix, + prefix, funcname, auditev) > sysaue + } + if (flag("NOSTD")) { + printf("\t{ %s, (sy_call_t *)%s, %s, NULL, 0, 0 },", + "0", "lkmressys", "AUE_NULL") > sysent + align_sysent_comment(8 + 2 + length("0") + 15 + \ + length("lkmressys") + 3) + } else { + printf("\t{ %s(%s,%s), %s, NULL, 0, 0 },", + wrap, argssize, funcname, auditev) > sysent + align_sysent_comment(8 + 9 + length(argssize) + 1 + \ + length(funcname) + length(auditev) + 4) + } + printf("/* %d = %s %s */\n", syscall, descr, funcalias) > sysent + printf("\t\"%s.%s\",\t\t/* %d = %s %s */\n", + wrap, funcalias, syscall, descr, funcalias) > sysnames + if (flag("COMPAT")) { printf("\t\t\t\t/* %d is old %s */\n", syscall, funcalias) > syshdr - } else { + } else if (!flag("NODEF")) { printf("#define\t%s%s%s\t%d\n", syscallprefix, prefix, funcalias, syscall) > syshdr printf(" \\\n\t%s%s.o", prefix, funcalias) > sysmk @@ -454,7 +469,7 @@ s/\$//g syscall++ next } - $3 == "LIBCOMPAT" { + type("LIBCOMPAT") { ncompat++ parseline() printf("%s\to%s();\n", rettype, funcname) > syscompatdcl @@ -471,7 +486,7 @@ s/\$//g syscall++ next } - $3 == "OBSOL" { + type("OBSOL") { printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },") > sysent align_sysent_comment(34) printf("/* %d = obsolete %s */\n", syscall, comment) > sysent @@ -482,7 +497,7 @@ s/\$//g syscall++ next } - $3 == "UNIMPL" { + type("UNIMPL") { printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },\t\t\t/* %d = %s */\n", syscall, comment) > sysent printf("\t\"#%d\",\t\t\t/* %d = %s */\n", Modified: stable/7/sys/kern/syscalls.master ============================================================================== --- stable/7/sys/kern/syscalls.master Fri Jul 24 19:12:19 2009 (r195853) +++ stable/7/sys/kern/syscalls.master Fri Jul 24 19:35:06 2009 (r195854) @@ -11,8 +11,10 @@ ; there is no audit event for the call at this time. For the ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. -; type one of STD, OBSOL, UNIMPL, COMPAT, CPT_NOA, LIBCOMPAT, -; NODEF, NOARGS, NOPROTO, NOIMPL, NOSTD, COMPAT4 +; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, +; LIBCOMPAT, NODEF, NOARGS, NOPROTO, NOSTD +; The COMPAT* options may be combined with one or more NO* +; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) ; name psuedo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different @@ -24,15 +26,16 @@ ; STD always included ; COMPAT included on COMPAT #ifdef ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) +; COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat) ; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically -; compiled in; sysent entry will be filled with lkmsys +; compiled in; sysent entry will be filled with lkmressys ; so the SYSCALL_MODULE macro works ; NOARGS same as STD except do not create structure in sys/sysproto.h ; NODEF same as STD except only have the entry in the syscall table -; added. Meaning - do do not create structure or function +; added. Meaning - do not create structure or function ; prototype in sys/sysproto.h ; NOPROTO same as STD except do not create structure or ; function prototype in sys/sysproto.h. Does add a @@ -214,7 +217,7 @@ int protocol); } 98 AUE_CONNECT STD { int connect(int s, caddr_t name, \ int namelen); } -99 AUE_ACCEPT CPT_NOA { int accept(int s, caddr_t name, \ +99 AUE_ACCEPT COMPAT|NOARGS { int accept(int s, caddr_t name, \ int *anamelen); } accept accept_args int 100 AUE_GETPRIORITY STD { int getpriority(int which, int who); } 101 AUE_SEND COMPAT { int send(int s, caddr_t buf, int len, \ @@ -258,7 +261,7 @@ struct timezone *tzp); } 123 AUE_FCHOWN STD { int fchown(int fd, int uid, int gid); } 124 AUE_FCHMOD STD { int fchmod(int fd, int mode); } -125 AUE_RECVFROM CPT_NOA { int recvfrom(int s, caddr_t buf, \ +125 AUE_RECVFROM COMPAT|NOARGS { int recvfrom(int s, caddr_t buf, \ size_t len, int flags, caddr_t from, int \ *fromlenaddr); } recvfrom recvfrom_args \ int @@ -294,7 +297,7 @@ 148 AUE_QUOTACTL STD { int quotactl(char *path, int cmd, int uid, \ caddr_t arg); } 149 AUE_O_QUOTA COMPAT { int quota(void); } -150 AUE_GETSOCKNAME CPT_NOA { int getsockname(int fdec, \ +150 AUE_GETSOCKNAME COMPAT|NOARGS { int getsockname(int fdec, \ caddr_t asa, int *alen); } getsockname \ getsockname_args int @@ -380,7 +383,7 @@ 197 AUE_MMAP STD { caddr_t freebsd6_mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ int pad, off_t pos); } -198 AUE_NULL STD { int nosys(void); } __syscall \ +198 AUE_NULL NOPROTO { int nosys(void); } __syscall \ __syscall_args int 199 AUE_LSEEK STD { off_t freebsd6_lseek(int fd, int pad, \ off_t offset, int whence); } @@ -657,7 +660,7 @@ 367 AUE_NULL UNIMPL __cap_get_file 368 AUE_NULL UNIMPL __cap_set_fd 369 AUE_NULL UNIMPL __cap_set_file -370 AUE_NULL NODEF lkmressys lkmressys nosys_args int +370 AUE_NULL UNIMPL nosys 371 AUE_EXTATTR_SET_FD STD { int extattr_set_fd(int fd, \ int attrnamespace, const char *attrname, \ void *data, size_t nbytes); } @@ -668,7 +671,7 @@ int attrnamespace, \ const char *attrname); } 374 AUE_NULL STD { int __setugid(int flag); } -375 AUE_NULL NOIMPL { int nfsclnt(int flag, caddr_t argp); } +375 AUE_NULL UNIMPL nfsclnt 376 AUE_EACCESS STD { int eaccess(char *path, int flags); } 377 AUE_NULL UNIMPL afs_syscall 378 AUE_NMOUNT STD { int nmount(struct iovec *iovp, \ Modified: stable/7/sys/sys/sysent.h ============================================================================== --- stable/7/sys/sys/sysent.h Fri Jul 24 19:12:19 2009 (r195853) +++ stable/7/sys/sys/sysent.h Fri Jul 24 19:35:06 2009 (r195854) @@ -158,6 +158,12 @@ int syscall_register(int *offset, str int syscall_deregister(int *offset, struct sysent *old_sysent); int syscall_module_handler(struct module *mod, int what, void *arg); +/* Special purpose system call functions. */ +struct nosys_args; + +int lkmnosys(struct thread *, struct nosys_args *); +int lkmressys(struct thread *, struct nosys_args *); + #endif /* _KERNEL */ #endif /* !_SYS_SYSENT_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 20:35:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0F341065674; Fri, 24 Jul 2009 20:35:44 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9D28FC1F; Fri, 24 Jul 2009 20:35:44 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OKZiRu020488; Fri, 24 Jul 2009 20:35:44 GMT (envelope-from gad@svn.freebsd.org) Received: (from gad@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OKZiNF020486; Fri, 24 Jul 2009 20:35:44 GMT (envelope-from gad@svn.freebsd.org) Message-Id: <200907242035.n6OKZiNF020486@svn.freebsd.org> From: Garance A Drosehn Date: Fri, 24 Jul 2009 20:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195855 - in stable/7/usr.sbin/lpr: . common_source X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 20:35:45 -0000 Author: gad Date: Fri Jul 24 20:35:44 2009 New Revision: 195855 URL: http://svn.freebsd.org/changeset/base/195855 Log: MFC: Fix end-of-line issues that can come up when `lpq' reads information about a queue from a remote host. PR: bin/104731 Modified: stable/7/usr.sbin/lpr/ (props changed) stable/7/usr.sbin/lpr/common_source/displayq.c Modified: stable/7/usr.sbin/lpr/common_source/displayq.c ============================================================================== --- stable/7/usr.sbin/lpr/common_source/displayq.c Fri Jul 24 19:35:06 2009 (r195854) +++ stable/7/usr.sbin/lpr/common_source/displayq.c Fri Jul 24 20:35:44 2009 (r195855) @@ -69,6 +69,13 @@ __FBSDID("$FreeBSD$"); #define SIZCOL 62 /* start of Size column in normal */ /* + * isprint() takes a parameter of 'int', but expect values in the range + * of unsigned char. Define a wrapper which takes a value of type 'char', + * whether signed or unsigned, and ensure it ends up in the right range. + */ +#define isprintch(Anychar) isprint((u_char)(Anychar)) + +/* * Stuff for handling job specifications */ extern uid_t uid, euid; @@ -86,6 +93,7 @@ static const char *head0 = "Rank Owne static const char *head1 = "Total Size\n"; static void alarmhandler(int _signo); +static void filtered_write(char *_obuffer, int _wlen, FILE *_wstream); static void warn(const struct printer *_pp); /* @@ -254,12 +262,105 @@ displayq(struct printer *pp, int format) if (write(fd, line, i) != i) fatal(pp, "Lost connection"); while ((i = read(fd, line, sizeof(line))) > 0) - (void) fwrite(line, 1, i, stdout); + filtered_write(line, i, stdout); + filtered_write(NULL, -1, stdout); (void) close(fd); } } /* + * The lpq-info read from remote hosts may contain unprintable characters, + * or carriage-returns instead of line-feeds. Clean those up before echoing + * the lpq-info line(s) to stdout. The info may also be missing any kind of + * end-of-line character. This also turns CRLF and LFCR into a plain LF. + * + * This routine may be called multiple times to process a single set of + * information, and after a set is finished this routine must be called + * one extra time with NULL specified as the buffer address. + */ +static void +filtered_write(char *wbuffer, int wlen, FILE *wstream) +{ + static char lastchar, savedchar; + char *chkptr, *dest_end, *dest_ch, *nxtptr, *w_end; + int destlen; + char destbuf[BUFSIZ]; + + if (wbuffer == NULL) { + if (savedchar != '\0') { + if (savedchar == '\r') + savedchar = '\n'; + fputc(savedchar, wstream); + lastchar = savedchar; + savedchar = '\0'; + } + if (lastchar != '\0' && lastchar != '\n') + fputc('\n', wstream); + lastchar = '\0'; + return; + } + + dest_ch = &destbuf[0]; + dest_end = dest_ch + sizeof(destbuf); + chkptr = wbuffer; + w_end = wbuffer + wlen; + lastchar = '\0'; + if (savedchar != '\0') { + chkptr = &savedchar; + nxtptr = wbuffer; + } else + nxtptr = chkptr + 1; + + while (chkptr < w_end) { + if (nxtptr < w_end) { + if ((*chkptr == '\r' && *nxtptr == '\n') || + (*chkptr == '\n' && *nxtptr == '\r')) { + *dest_ch++ = '\n'; + /* want to skip past that second character */ + nxtptr++; + goto check_next; + } + } else { + /* This is the last byte in the buffer given on this + * call, so check if it could be the first-byte of a + * significant two-byte sequence. If it is, then + * don't write it out now, but save for checking in + * the next call. + */ + savedchar = '\0'; + if (*chkptr == '\r' || *chkptr == '\n') { + savedchar = *chkptr; + break; + } + } + if (*chkptr == '\r') + *dest_ch++ = '\n'; +#if 0 /* XXX - don't translate unprintable characters (yet) */ + else if (*chkptr != '\t' && *chkptr != '\n' && + !isprintch(*chkptr)) + *dest_ch++ = '?'; +#endif + else + *dest_ch++ = *chkptr; + +check_next: + chkptr = nxtptr; + nxtptr = chkptr + 1; + if (dest_ch >= dest_end) { + destlen = dest_ch - &destbuf[0]; + fwrite(destbuf, 1, destlen, wstream); + lastchar = destbuf[destlen - 1]; + dest_ch = &destbuf[0]; + } + } + destlen = dest_ch - &destbuf[0]; + if (destlen > 0) { + fwrite(destbuf, 1, destlen, wstream); + lastchar = destbuf[destlen - 1]; + } +} + +/* * Print a warning message if there is no daemon present. */ static void From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 21:30:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9181E106564A; Fri, 24 Jul 2009 21:30:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D74C8FC13; Fri, 24 Jul 2009 21:30:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OLUAjN021678; Fri, 24 Jul 2009 21:30:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OLUAc8021667; Fri, 24 Jul 2009 21:30:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907242130.n6OLUAc8021667@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jul 2009 21:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195856 - in stable/7/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 21:30:11 -0000 Author: jhb Date: Fri Jul 24 21:30:10 2009 New Revision: 195856 URL: http://svn.freebsd.org/changeset/base/195856 Log: Regen. Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h stable/7/sys/compat/freebsd32/freebsd32_syscall.h stable/7/sys/compat/freebsd32/freebsd32_syscalls.c stable/7/sys/compat/freebsd32/freebsd32_sysent.c stable/7/sys/kern/init_sysent.c stable/7/sys/kern/syscalls.c stable/7/sys/kern/systrace_args.c stable/7/sys/sys/syscall.h stable/7/sys/sys/syscall.mk stable/7/sys/sys/sysproto.h Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_proto.h Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/compat/freebsd32/freebsd32_proto.h Fri Jul 24 21:30:10 2009 (r195856) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195694 2009-07-14 19:48:31Z jhb + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195854 2009-07-24 19:35:06Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -647,15 +647,24 @@ int freebsd6_freebsd32_ftruncate(struct #endif /* COMPAT_FREEBSD6 */ #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 +#define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT #define FREEBSD32_SYS_AUE_freebsd32_recvmsg AUE_RECVMSG #define FREEBSD32_SYS_AUE_freebsd32_sendmsg AUE_SENDMSG #define FREEBSD32_SYS_AUE_freebsd32_recvfrom AUE_RECVFROM +#define FREEBSD32_SYS_AUE_ofreebsd32_sigaction AUE_SIGACTION +#define FREEBSD32_SYS_AUE_ofreebsd32_sigprocmask AUE_SIGPROCMASK +#define FREEBSD32_SYS_AUE_ofreebsd32_sigpending AUE_SIGPENDING #define FREEBSD32_SYS_AUE_freebsd32_sigaltstack AUE_SIGALTSTACK #define FREEBSD32_SYS_AUE_freebsd32_ioctl AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_execve AUE_EXECVE #define FREEBSD32_SYS_AUE_freebsd32_setitimer AUE_SETITIMER #define FREEBSD32_SYS_AUE_freebsd32_getitimer AUE_GETITIMER #define FREEBSD32_SYS_AUE_freebsd32_select AUE_SELECT +#define FREEBSD32_SYS_AUE_ofreebsd32_sigvec AUE_O_SIGVEC +#define FREEBSD32_SYS_AUE_ofreebsd32_sigblock AUE_O_SIGBLOCK +#define FREEBSD32_SYS_AUE_ofreebsd32_sigsetmask AUE_O_SIGSETMASK +#define FREEBSD32_SYS_AUE_ofreebsd32_sigsuspend AUE_SIGSUSPEND +#define FREEBSD32_SYS_AUE_ofreebsd32_sigstack AUE_O_SIGSTACK #define FREEBSD32_SYS_AUE_freebsd32_gettimeofday AUE_GETTIMEOFDAY #define FREEBSD32_SYS_AUE_freebsd32_getrusage AUE_GETRUSAGE #define FREEBSD32_SYS_AUE_freebsd32_readv AUE_READV @@ -663,13 +672,21 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_settimeofday AUE_SETTIMEOFDAY #define FREEBSD32_SYS_AUE_freebsd32_utimes AUE_UTIMES #define FREEBSD32_SYS_AUE_freebsd32_adjtime AUE_ADJTIME +#define FREEBSD32_SYS_AUE_freebsd4_freebsd32_statfs AUE_STATFS +#define FREEBSD32_SYS_AUE_freebsd4_freebsd32_fstatfs AUE_FSTATFS #define FREEBSD32_SYS_AUE_freebsd32_semsys AUE_SEMSYS #define FREEBSD32_SYS_AUE_freebsd32_msgsys AUE_MSGSYS #define FREEBSD32_SYS_AUE_freebsd32_shmsys AUE_SHMSYS +#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_pread AUE_PREAD +#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_pwrite AUE_PWRITE #define FREEBSD32_SYS_AUE_freebsd32_stat AUE_STAT #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_lstat AUE_LSTAT #define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES +#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_mmap AUE_MMAP +#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lseek AUE_LSEEK +#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_truncate AUE_TRUNCATE +#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_ftruncate AUE_FTRUNCATE #define FREEBSD32_SYS_AUE_freebsd32_sysctl AUE_SYSCTL #define FREEBSD32_SYS_AUE_freebsd32_futimes AUE_FUTIMES #define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL @@ -687,6 +704,7 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_lutimes AUE_LUTIMES #define FREEBSD32_SYS_AUE_freebsd32_preadv AUE_PREADV #define FREEBSD32_SYS_AUE_freebsd32_pwritev AUE_PWRITEV +#define FREEBSD32_SYS_AUE_freebsd4_freebsd32_fhstatfs AUE_FHSTATFS #define FREEBSD32_SYS_AUE_freebsd32_modstat AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_return AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_suspend AUE_NULL @@ -695,7 +713,10 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_oaio_read AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_oaio_write AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_olio_listio AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE #define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL +#define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION +#define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT #define FREEBSD32_SYS_AUE_freebsd32_sigwaitinfo AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_waitcomplete AUE_NULL Modified: stable/7/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_syscall.h Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/compat/freebsd32/freebsd32_syscall.h Fri Jul 24 21:30:10 2009 (r195856) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195694 2009-07-14 19:48:31Z jhb + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195854 2009-07-24 19:35:06Z jhb */ #define FREEBSD32_SYS_syscall 0 Modified: stable/7/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jul 24 21:30:10 2009 (r195856) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195694 2009-07-14 19:48:31Z jhb + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195854 2009-07-24 19:35:06Z jhb */ const char *freebsd32_syscallnames[] = { @@ -25,7 +25,7 @@ const char *freebsd32_syscallnames[] = { "chmod", /* 15 = chmod */ "chown", /* 16 = chown */ "break", /* 17 = break */ - "compat4.freebsd32_getfsstat", /* 18 = old freebsd32_getfsstat */ + "compat4.freebsd32_getfsstat", /* 18 = freebsd4 freebsd32_getfsstat */ "obs_olseek", /* 19 = obsolete olseek */ "getpid", /* 20 = getpid */ "mount", /* 21 = mount */ @@ -164,8 +164,8 @@ const char *freebsd32_syscallnames[] = { "#154", /* 154 = nlm_syscall */ "#155", /* 155 = nfssvc */ "obs_ogetdirentries", /* 156 = obsolete ogetdirentries */ - "compat4.freebsd32_statfs", /* 157 = old freebsd32_statfs */ - "compat4.freebsd32_fstatfs", /* 158 = old freebsd32_fstatfs */ + "compat4.freebsd32_statfs", /* 157 = freebsd4 freebsd32_statfs */ + "compat4.freebsd32_fstatfs", /* 158 = freebsd4 freebsd32_fstatfs */ "#159", /* 159 = nosys */ "#160", /* 160 = lgetfh */ "getfh", /* 161 = getfh */ @@ -180,8 +180,8 @@ const char *freebsd32_syscallnames[] = { "freebsd32_msgsys", /* 170 = freebsd32_msgsys */ "freebsd32_shmsys", /* 171 = freebsd32_shmsys */ "#172", /* 172 = nosys */ - "compat6.freebsd32_pread", /* 173 = old freebsd32_pread */ - "compat6.freebsd32_pwrite", /* 174 = old freebsd32_pwrite */ + "compat6.freebsd32_pread", /* 173 = freebsd6 freebsd32_pread */ + "compat6.freebsd32_pwrite", /* 174 = freebsd6 freebsd32_pwrite */ "#175", /* 175 = nosys */ "ntp_adjtime", /* 176 = ntp_adjtime */ "#177", /* 177 = sfork */ @@ -204,11 +204,11 @@ const char *freebsd32_syscallnames[] = { "getrlimit", /* 194 = getrlimit */ "setrlimit", /* 195 = setrlimit */ "freebsd32_getdirentries", /* 196 = freebsd32_getdirentries */ - "compat6.freebsd32_mmap", /* 197 = old freebsd32_mmap */ + "compat6.freebsd32_mmap", /* 197 = freebsd6 freebsd32_mmap */ "__syscall", /* 198 = __syscall */ - "compat6.freebsd32_lseek", /* 199 = old freebsd32_lseek */ - "compat6.freebsd32_truncate", /* 200 = old freebsd32_truncate */ - "compat6.freebsd32_ftruncate", /* 201 = old freebsd32_ftruncate */ + "compat6.freebsd32_lseek", /* 199 = freebsd6 freebsd32_lseek */ + "compat6.freebsd32_truncate", /* 200 = freebsd6 freebsd32_truncate */ + "compat6.freebsd32_ftruncate", /* 201 = freebsd6 freebsd32_ftruncate */ "freebsd32_sysctl", /* 202 = freebsd32_sysctl */ "mlock", /* 203 = mlock */ "munlock", /* 204 = munlock */ @@ -217,16 +217,16 @@ const char *freebsd32_syscallnames[] = { "getpgid", /* 207 = getpgid */ "#208", /* 208 = newreboot */ "poll", /* 209 = poll */ - "#210", /* 210 = */ - "#211", /* 211 = */ - "#212", /* 212 = */ - "#213", /* 213 = */ - "#214", /* 214 = */ - "#215", /* 215 = */ - "#216", /* 216 = */ - "#217", /* 217 = */ - "#218", /* 218 = */ - "#219", /* 219 = */ + "lkmnosys", /* 210 = lkmnosys */ + "lkmnosys", /* 211 = lkmnosys */ + "lkmnosys", /* 212 = lkmnosys */ + "lkmnosys", /* 213 = lkmnosys */ + "lkmnosys", /* 214 = lkmnosys */ + "lkmnosys", /* 215 = lkmnosys */ + "lkmnosys", /* 216 = lkmnosys */ + "lkmnosys", /* 217 = lkmnosys */ + "lkmnosys", /* 218 = lkmnosys */ + "lkmnosys", /* 219 = lkmnosys */ "freebsd32_semctl", /* 220 = freebsd32_semctl */ "semget", /* 221 = semget */ "semop", /* 222 = semop */ @@ -304,7 +304,7 @@ const char *freebsd32_syscallnames[] = { "#294", /* 294 = nosys */ "#295", /* 295 = nosys */ "#296", /* 296 = nosys */ - "compat4.freebsd32_fhstatfs", /* 297 = old freebsd32_fhstatfs */ + "compat4.freebsd32_fhstatfs", /* 297 = freebsd4 freebsd32_fhstatfs */ "fhopen", /* 298 = fhopen */ "fhstat", /* 299 = fhstat */ "modnext", /* 300 = modnext */ @@ -343,15 +343,15 @@ const char *freebsd32_syscallnames[] = { "sched_get_priority_min", /* 333 = sched_get_priority_min */ "sched_rr_get_interval", /* 334 = sched_rr_get_interval */ "utrace", /* 335 = utrace */ - "compat4.freebsd32_sendfile", /* 336 = old freebsd32_sendfile */ + "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile */ "kldsym", /* 337 = kldsym */ "freebsd32_jail", /* 338 = freebsd32_jail */ "#339", /* 339 = pioctl */ "sigprocmask", /* 340 = sigprocmask */ "sigsuspend", /* 341 = sigsuspend */ - "compat4.freebsd32_sigaction", /* 342 = old freebsd32_sigaction */ + "compat4.freebsd32_sigaction", /* 342 = freebsd4 freebsd32_sigaction */ "sigpending", /* 343 = sigpending */ - "compat4.freebsd32_sigreturn", /* 344 = old freebsd32_sigreturn */ + "compat4.freebsd32_sigreturn", /* 344 = freebsd4 freebsd32_sigreturn */ "freebsd32_sigtimedwait", /* 345 = freebsd32_sigtimedwait */ "freebsd32_sigwaitinfo", /* 346 = freebsd32_sigwaitinfo */ "__acl_get_file", /* 347 = __acl_get_file */ @@ -377,7 +377,7 @@ const char *freebsd32_syscallnames[] = { "#367", /* 367 = __cap_get_file */ "#368", /* 368 = __cap_set_fd */ "#369", /* 369 = __cap_set_file */ - "#370", /* 370 = lkmressys */ + "#370", /* 370 = nosys */ "extattr_set_fd", /* 371 = extattr_set_fd */ "extattr_get_fd", /* 372 = extattr_get_fd */ "extattr_delete_fd", /* 373 = extattr_delete_fd */ Modified: stable/7/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_sysent.c Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/compat/freebsd32/freebsd32_sysent.c Fri Jul 24 21:30:10 2009 (r195856) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195694 2009-07-14 19:48:31Z jhb + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195854 2009-07-24 19:35:06Z jhb */ #include "opt_compat.h" @@ -56,7 +56,7 @@ struct sysent freebsd32_sysent[] = { { AS(chmod_args), (sy_call_t *)chmod, AUE_CHMOD, NULL, 0, 0 }, /* 15 = chmod */ { AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0 }, /* 16 = chown */ { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0 }, /* 17 = break */ - { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0 }, /* 18 = old freebsd32_getfsstat */ + { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0 }, /* 18 = freebsd4 freebsd32_getfsstat */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 19 = obsolete olseek */ { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0 }, /* 20 = getpid */ { AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0 }, /* 21 = mount */ @@ -195,8 +195,8 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 154 = nlm_syscall */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 155 = nfssvc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 156 = obsolete ogetdirentries */ - { compat4(AS(freebsd4_freebsd32_statfs_args),freebsd32_statfs), AUE_STATFS, NULL, 0, 0 }, /* 157 = old freebsd32_statfs */ - { compat4(AS(freebsd4_freebsd32_fstatfs_args),freebsd32_fstatfs), AUE_FSTATFS, NULL, 0, 0 }, /* 158 = old freebsd32_fstatfs */ + { compat4(AS(freebsd4_freebsd32_statfs_args),freebsd32_statfs), AUE_STATFS, NULL, 0, 0 }, /* 157 = freebsd4 freebsd32_statfs */ + { compat4(AS(freebsd4_freebsd32_fstatfs_args),freebsd32_fstatfs), AUE_FSTATFS, NULL, 0, 0 }, /* 158 = freebsd4 freebsd32_fstatfs */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 159 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 160 = lgetfh */ { AS(getfh_args), (sy_call_t *)getfh, AUE_NFS_GETFH, NULL, 0, 0 }, /* 161 = getfh */ @@ -211,8 +211,8 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_msgsys_args), (sy_call_t *)freebsd32_msgsys, AUE_MSGSYS, NULL, 0, 0 }, /* 170 = freebsd32_msgsys */ { AS(freebsd32_shmsys_args), (sy_call_t *)freebsd32_shmsys, AUE_SHMSYS, NULL, 0, 0 }, /* 171 = freebsd32_shmsys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 172 = nosys */ - { compat6(AS(freebsd6_freebsd32_pread_args),freebsd32_pread), AUE_PREAD, NULL, 0, 0 }, /* 173 = old freebsd32_pread */ - { compat6(AS(freebsd6_freebsd32_pwrite_args),freebsd32_pwrite), AUE_PWRITE, NULL, 0, 0 }, /* 174 = old freebsd32_pwrite */ + { compat6(AS(freebsd6_freebsd32_pread_args),freebsd32_pread), AUE_PREAD, NULL, 0, 0 }, /* 173 = freebsd6 freebsd32_pread */ + { compat6(AS(freebsd6_freebsd32_pwrite_args),freebsd32_pwrite), AUE_PWRITE, NULL, 0, 0 }, /* 174 = freebsd6 freebsd32_pwrite */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 175 = nosys */ { AS(ntp_adjtime_args), (sy_call_t *)ntp_adjtime, AUE_NTP_ADJTIME, NULL, 0, 0 }, /* 176 = ntp_adjtime */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 177 = sfork */ @@ -235,11 +235,11 @@ struct sysent freebsd32_sysent[] = { { AS(__getrlimit_args), (sy_call_t *)getrlimit, AUE_GETRLIMIT, NULL, 0, 0 }, /* 194 = getrlimit */ { AS(__setrlimit_args), (sy_call_t *)setrlimit, AUE_SETRLIMIT, NULL, 0, 0 }, /* 195 = setrlimit */ { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 196 = freebsd32_getdirentries */ - { compat6(AS(freebsd6_freebsd32_mmap_args),freebsd32_mmap), AUE_MMAP, NULL, 0, 0 }, /* 197 = old freebsd32_mmap */ + { compat6(AS(freebsd6_freebsd32_mmap_args),freebsd32_mmap), AUE_MMAP, NULL, 0, 0 }, /* 197 = freebsd6 freebsd32_mmap */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 198 = __syscall */ - { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0 }, /* 199 = old freebsd32_lseek */ - { compat6(AS(freebsd6_freebsd32_truncate_args),freebsd32_truncate), AUE_TRUNCATE, NULL, 0, 0 }, /* 200 = old freebsd32_truncate */ - { compat6(AS(freebsd6_freebsd32_ftruncate_args),freebsd32_ftruncate), AUE_FTRUNCATE, NULL, 0, 0 }, /* 201 = old freebsd32_ftruncate */ + { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0 }, /* 199 = freebsd6 freebsd32_lseek */ + { compat6(AS(freebsd6_freebsd32_truncate_args),freebsd32_truncate), AUE_TRUNCATE, NULL, 0, 0 }, /* 200 = freebsd6 freebsd32_truncate */ + { compat6(AS(freebsd6_freebsd32_ftruncate_args),freebsd32_ftruncate), AUE_FTRUNCATE, NULL, 0, 0 }, /* 201 = freebsd6 freebsd32_ftruncate */ { AS(freebsd32_sysctl_args), (sy_call_t *)freebsd32_sysctl, AUE_SYSCTL, NULL, 0, 0 }, /* 202 = freebsd32_sysctl */ { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0 }, /* 203 = mlock */ { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0 }, /* 204 = munlock */ @@ -248,16 +248,16 @@ struct sysent freebsd32_sysent[] = { { AS(getpgid_args), (sy_call_t *)getpgid, AUE_GETPGID, NULL, 0, 0 }, /* 207 = getpgid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 208 = newreboot */ { AS(poll_args), (sy_call_t *)poll, AUE_POLL, NULL, 0, 0 }, /* 209 = poll */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 210 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 211 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 212 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 213 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 214 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 215 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 216 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 217 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 218 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 219 = */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 210 = lkmnosys */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 211 = lkmnosys */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 212 = lkmnosys */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 213 = lkmnosys */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 214 = lkmnosys */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 215 = lkmnosys */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 216 = lkmnosys */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 217 = lkmnosys */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 218 = lkmnosys */ + { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 219 = lkmnosys */ { AS(freebsd32_semctl_args), (sy_call_t *)freebsd32_semctl, AUE_SEMCTL, NULL, 0, 0 }, /* 220 = freebsd32_semctl */ { AS(semget_args), (sy_call_t *)semget, AUE_SEMGET, NULL, 0, 0 }, /* 221 = semget */ { AS(semop_args), (sy_call_t *)semop, AUE_SEMOP, NULL, 0, 0 }, /* 222 = semop */ @@ -335,7 +335,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 294 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 295 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 296 = nosys */ - { compat4(AS(freebsd4_freebsd32_fhstatfs_args),freebsd32_fhstatfs), AUE_FHSTATFS, NULL, 0, 0 }, /* 297 = old freebsd32_fhstatfs */ + { compat4(AS(freebsd4_freebsd32_fhstatfs_args),freebsd32_fhstatfs), AUE_FHSTATFS, NULL, 0, 0 }, /* 297 = freebsd4 freebsd32_fhstatfs */ { AS(fhopen_args), (sy_call_t *)fhopen, AUE_FHOPEN, NULL, 0, 0 }, /* 298 = fhopen */ { AS(fhstat_args), (sy_call_t *)fhstat, AUE_FHSTAT, NULL, 0, 0 }, /* 299 = fhstat */ { AS(modnext_args), (sy_call_t *)modnext, AUE_NULL, NULL, 0, 0 }, /* 300 = modnext */ @@ -374,15 +374,15 @@ struct sysent freebsd32_sysent[] = { { AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min, AUE_NULL, NULL, 0, 0 }, /* 333 = sched_get_priority_min */ { AS(sched_rr_get_interval_args), (sy_call_t *)sched_rr_get_interval, AUE_NULL, NULL, 0, 0 }, /* 334 = sched_rr_get_interval */ { AS(utrace_args), (sy_call_t *)utrace, AUE_NULL, NULL, 0, 0 }, /* 335 = utrace */ - { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0 }, /* 336 = old freebsd32_sendfile */ + { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0 }, /* 336 = freebsd4 freebsd32_sendfile */ { AS(kldsym_args), (sy_call_t *)kldsym, AUE_NULL, NULL, 0, 0 }, /* 337 = kldsym */ { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, NULL, 0, 0 }, /* 338 = freebsd32_jail */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 339 = pioctl */ { AS(sigprocmask_args), (sy_call_t *)sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0 }, /* 340 = sigprocmask */ { AS(sigsuspend_args), (sy_call_t *)sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0 }, /* 341 = sigsuspend */ - { compat4(AS(freebsd4_freebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0 }, /* 342 = old freebsd32_sigaction */ + { compat4(AS(freebsd4_freebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0 }, /* 342 = freebsd4 freebsd32_sigaction */ { AS(sigpending_args), (sy_call_t *)sigpending, AUE_SIGPENDING, NULL, 0, 0 }, /* 343 = sigpending */ - { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0 }, /* 344 = old freebsd32_sigreturn */ + { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0 }, /* 344 = freebsd4 freebsd32_sigreturn */ { AS(freebsd32_sigtimedwait_args), (sy_call_t *)freebsd32_sigtimedwait, AUE_SIGWAIT, NULL, 0, 0 }, /* 345 = freebsd32_sigtimedwait */ { AS(freebsd32_sigwaitinfo_args), (sy_call_t *)freebsd32_sigwaitinfo, AUE_NULL, NULL, 0, 0 }, /* 346 = freebsd32_sigwaitinfo */ { AS(__acl_get_file_args), (sy_call_t *)__acl_get_file, AUE_NULL, NULL, 0, 0 }, /* 347 = __acl_get_file */ @@ -408,7 +408,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 367 = __cap_get_file */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 368 = __cap_set_fd */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 369 = __cap_set_file */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 370 = lkmressys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 370 = nosys */ { AS(extattr_set_fd_args), (sy_call_t *)extattr_set_fd, AUE_EXTATTR_SET_FD, NULL, 0, 0 }, /* 371 = extattr_set_fd */ { AS(extattr_get_fd_args), (sy_call_t *)extattr_get_fd, AUE_EXTATTR_GET_FD, NULL, 0, 0 }, /* 372 = extattr_get_fd */ { AS(extattr_delete_fd_args), (sy_call_t *)extattr_delete_fd, AUE_EXTATTR_DELETE_FD, NULL, 0, 0 }, /* 373 = extattr_delete_fd */ Modified: stable/7/sys/kern/init_sysent.c ============================================================================== --- stable/7/sys/kern/init_sysent.c Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/kern/init_sysent.c Fri Jul 24 21:30:10 2009 (r195856) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb */ #include "opt_compat.h" @@ -46,7 +46,7 @@ struct sysent sysent[] = { { AS(chmod_args), (sy_call_t *)chmod, AUE_CHMOD, NULL, 0, 0 }, /* 15 = chmod */ { AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0 }, /* 16 = chown */ { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0 }, /* 17 = break */ - { compat4(AS(freebsd4_getfsstat_args),getfsstat), AUE_GETFSSTAT, NULL, 0, 0 }, /* 18 = old getfsstat */ + { compat4(AS(freebsd4_getfsstat_args),getfsstat), AUE_GETFSSTAT, NULL, 0, 0 }, /* 18 = freebsd4 getfsstat */ { compat(AS(olseek_args),lseek), AUE_LSEEK, NULL, 0, 0 }, /* 19 = old lseek */ { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0 }, /* 20 = getpid */ { AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0 }, /* 21 = mount */ @@ -185,8 +185,8 @@ struct sysent sysent[] = { { AS(nlm_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 154 = nlm_syscall */ { AS(nfssvc_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 155 = nfssvc */ { compat(AS(ogetdirentries_args),getdirentries), AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 156 = old getdirentries */ - { compat4(AS(freebsd4_statfs_args),statfs), AUE_STATFS, NULL, 0, 0 }, /* 157 = old statfs */ - { compat4(AS(freebsd4_fstatfs_args),fstatfs), AUE_FSTATFS, NULL, 0, 0 }, /* 158 = old fstatfs */ + { compat4(AS(freebsd4_statfs_args),statfs), AUE_STATFS, NULL, 0, 0 }, /* 157 = freebsd4 statfs */ + { compat4(AS(freebsd4_fstatfs_args),fstatfs), AUE_FSTATFS, NULL, 0, 0 }, /* 158 = freebsd4 fstatfs */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 159 = nosys */ { AS(lgetfh_args), (sy_call_t *)lgetfh, AUE_LGETFH, NULL, 0, 0 }, /* 160 = lgetfh */ { AS(getfh_args), (sy_call_t *)getfh, AUE_NFS_GETFH, NULL, 0, 0 }, /* 161 = getfh */ @@ -325,7 +325,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 294 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 295 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 296 = nosys */ - { compat4(AS(freebsd4_fhstatfs_args),fhstatfs), AUE_FHSTATFS, NULL, 0, 0 }, /* 297 = old fhstatfs */ + { compat4(AS(freebsd4_fhstatfs_args),fhstatfs), AUE_FHSTATFS, NULL, 0, 0 }, /* 297 = freebsd4 fhstatfs */ { AS(fhopen_args), (sy_call_t *)fhopen, AUE_FHOPEN, NULL, 0, 0 }, /* 298 = fhopen */ { AS(fhstat_args), (sy_call_t *)fhstat, AUE_FHSTAT, NULL, 0, 0 }, /* 299 = fhstat */ { AS(modnext_args), (sy_call_t *)modnext, AUE_NULL, NULL, 0, 0 }, /* 300 = modnext */ @@ -364,15 +364,15 @@ struct sysent sysent[] = { { AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min, AUE_NULL, NULL, 0, 0 }, /* 333 = sched_get_priority_min */ { AS(sched_rr_get_interval_args), (sy_call_t *)sched_rr_get_interval, AUE_NULL, NULL, 0, 0 }, /* 334 = sched_rr_get_interval */ { AS(utrace_args), (sy_call_t *)utrace, AUE_NULL, NULL, 0, 0 }, /* 335 = utrace */ - { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0 }, /* 336 = old sendfile */ + { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0 }, /* 336 = freebsd4 sendfile */ { AS(kldsym_args), (sy_call_t *)kldsym, AUE_NULL, NULL, 0, 0 }, /* 337 = kldsym */ { AS(jail_args), (sy_call_t *)jail, AUE_JAIL, NULL, 0, 0 }, /* 338 = jail */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 339 = pioctl */ { AS(sigprocmask_args), (sy_call_t *)sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0 }, /* 340 = sigprocmask */ { AS(sigsuspend_args), (sy_call_t *)sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0 }, /* 341 = sigsuspend */ - { compat4(AS(freebsd4_sigaction_args),sigaction), AUE_SIGACTION, NULL, 0, 0 }, /* 342 = old sigaction */ + { compat4(AS(freebsd4_sigaction_args),sigaction), AUE_SIGACTION, NULL, 0, 0 }, /* 342 = freebsd4 sigaction */ { AS(sigpending_args), (sy_call_t *)sigpending, AUE_SIGPENDING, NULL, 0, 0 }, /* 343 = sigpending */ - { compat4(AS(freebsd4_sigreturn_args),sigreturn), AUE_SIGRETURN, NULL, 0, 0 }, /* 344 = old sigreturn */ + { compat4(AS(freebsd4_sigreturn_args),sigreturn), AUE_SIGRETURN, NULL, 0, 0 }, /* 344 = freebsd4 sigreturn */ { AS(sigtimedwait_args), (sy_call_t *)sigtimedwait, AUE_SIGWAIT, NULL, 0, 0 }, /* 345 = sigtimedwait */ { AS(sigwaitinfo_args), (sy_call_t *)sigwaitinfo, AUE_NULL, NULL, 0, 0 }, /* 346 = sigwaitinfo */ { AS(__acl_get_file_args), (sy_call_t *)__acl_get_file, AUE_NULL, NULL, 0, 0 }, /* 347 = __acl_get_file */ @@ -398,12 +398,12 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 367 = __cap_get_file */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 368 = __cap_set_fd */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 369 = __cap_set_file */ - { AS(nosys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 370 = lkmressys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 370 = nosys */ { AS(extattr_set_fd_args), (sy_call_t *)extattr_set_fd, AUE_EXTATTR_SET_FD, NULL, 0, 0 }, /* 371 = extattr_set_fd */ { AS(extattr_get_fd_args), (sy_call_t *)extattr_get_fd, AUE_EXTATTR_GET_FD, NULL, 0, 0 }, /* 372 = extattr_get_fd */ { AS(extattr_delete_fd_args), (sy_call_t *)extattr_delete_fd, AUE_EXTATTR_DELETE_FD, NULL, 0, 0 }, /* 373 = extattr_delete_fd */ { AS(__setugid_args), (sy_call_t *)__setugid, AUE_NULL, NULL, 0, 0 }, /* 374 = __setugid */ - { AS(nfsclnt_args), (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 375 = nfsclnt */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 375 = nfsclnt */ { AS(eaccess_args), (sy_call_t *)eaccess, AUE_EACCESS, NULL, 0, 0 }, /* 376 = eaccess */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 377 = afs_syscall */ { AS(nmount_args), (sy_call_t *)nmount, AUE_NMOUNT, NULL, 0, 0 }, /* 378 = nmount */ Modified: stable/7/sys/kern/syscalls.c ============================================================================== --- stable/7/sys/kern/syscalls.c Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/kern/syscalls.c Fri Jul 24 21:30:10 2009 (r195856) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb */ const char *syscallnames[] = { @@ -25,7 +25,7 @@ const char *syscallnames[] = { "chmod", /* 15 = chmod */ "chown", /* 16 = chown */ "break", /* 17 = break */ - "compat4.getfsstat", /* 18 = old getfsstat */ + "compat4.getfsstat", /* 18 = freebsd4 getfsstat */ "compat.lseek", /* 19 = old lseek */ "getpid", /* 20 = getpid */ "mount", /* 21 = mount */ @@ -164,8 +164,8 @@ const char *syscallnames[] = { "nlm_syscall", /* 154 = nlm_syscall */ "nfssvc", /* 155 = nfssvc */ "compat.getdirentries", /* 156 = old getdirentries */ - "compat4.statfs", /* 157 = old statfs */ - "compat4.fstatfs", /* 158 = old fstatfs */ + "compat4.statfs", /* 157 = freebsd4 statfs */ + "compat4.fstatfs", /* 158 = freebsd4 fstatfs */ "#159", /* 159 = nosys */ "lgetfh", /* 160 = lgetfh */ "getfh", /* 161 = getfh */ @@ -304,7 +304,7 @@ const char *syscallnames[] = { "#294", /* 294 = nosys */ "#295", /* 295 = nosys */ "#296", /* 296 = nosys */ - "compat4.fhstatfs", /* 297 = old fhstatfs */ + "compat4.fhstatfs", /* 297 = freebsd4 fhstatfs */ "fhopen", /* 298 = fhopen */ "fhstat", /* 299 = fhstat */ "modnext", /* 300 = modnext */ @@ -343,15 +343,15 @@ const char *syscallnames[] = { "sched_get_priority_min", /* 333 = sched_get_priority_min */ "sched_rr_get_interval", /* 334 = sched_rr_get_interval */ "utrace", /* 335 = utrace */ - "compat4.sendfile", /* 336 = old sendfile */ + "compat4.sendfile", /* 336 = freebsd4 sendfile */ "kldsym", /* 337 = kldsym */ "jail", /* 338 = jail */ "#339", /* 339 = pioctl */ "sigprocmask", /* 340 = sigprocmask */ "sigsuspend", /* 341 = sigsuspend */ - "compat4.sigaction", /* 342 = old sigaction */ + "compat4.sigaction", /* 342 = freebsd4 sigaction */ "sigpending", /* 343 = sigpending */ - "compat4.sigreturn", /* 344 = old sigreturn */ + "compat4.sigreturn", /* 344 = freebsd4 sigreturn */ "sigtimedwait", /* 345 = sigtimedwait */ "sigwaitinfo", /* 346 = sigwaitinfo */ "__acl_get_file", /* 347 = __acl_get_file */ @@ -377,12 +377,12 @@ const char *syscallnames[] = { "#367", /* 367 = __cap_get_file */ "#368", /* 368 = __cap_set_fd */ "#369", /* 369 = __cap_set_file */ - "lkmressys", /* 370 = lkmressys */ + "#370", /* 370 = nosys */ "extattr_set_fd", /* 371 = extattr_set_fd */ "extattr_get_fd", /* 372 = extattr_get_fd */ "extattr_delete_fd", /* 373 = extattr_delete_fd */ "__setugid", /* 374 = __setugid */ - "nfsclnt", /* 375 = nfsclnt */ + "#375", /* 375 = nfsclnt */ "eaccess", /* 376 = eaccess */ "#377", /* 377 = afs_syscall */ "nmount", /* 378 = nmount */ Modified: stable/7/sys/kern/systrace_args.c ============================================================================== --- stable/7/sys/kern/systrace_args.c Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/kern/systrace_args.c Fri Jul 24 21:30:10 2009 (r195856) @@ -2016,11 +2016,6 @@ systrace_args(int sysnum, void *params, *n_args = 6; break; } - /* lkmressys */ - case 370: { - *n_args = 0; - break; - } /* extattr_set_fd */ case 371: { struct extattr_set_fd_args *p = params; @@ -2059,14 +2054,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* nfsclnt */ - case 375: { - struct nfsclnt_args *p = params; - iarg[0] = p->flag; /* int */ - uarg[1] = (intptr_t) p->argp; /* caddr_t */ - *n_args = 2; - break; - } /* eaccess */ case 376: { struct eaccess_args *p = params; @@ -6188,9 +6175,6 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; - /* lkmressys */ - case 370: - break; /* extattr_set_fd */ case 371: switch(ndx) { @@ -6261,19 +6245,6 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; - /* nfsclnt */ - case 375: - switch(ndx) { - case 0: - p = "int"; - break; - case 1: - p = "caddr_t"; - break; - default: - break; - }; - break; /* eaccess */ case 376: switch(ndx) { Modified: stable/7/sys/sys/syscall.h ============================================================================== --- stable/7/sys/sys/syscall.h Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/sys/syscall.h Fri Jul 24 21:30:10 2009 (r195856) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb */ #define SYS_syscall 0 @@ -305,7 +305,6 @@ #define SYS_extattr_get_fd 372 #define SYS_extattr_delete_fd 373 #define SYS___setugid 374 -#define SYS_nfsclnt 375 #define SYS_eaccess 376 #define SYS_nmount 378 #define SYS_kse_exit 379 Modified: stable/7/sys/sys/syscall.mk ============================================================================== --- stable/7/sys/sys/syscall.mk Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/sys/syscall.mk Fri Jul 24 21:30:10 2009 (r195856) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb +# created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb MIASM = \ syscall.o \ exit.o \ @@ -254,7 +254,6 @@ MIASM = \ extattr_get_fd.o \ extattr_delete_fd.o \ __setugid.o \ - nfsclnt.o \ eaccess.o \ nmount.o \ kse_exit.o \ Modified: stable/7/sys/sys/sysproto.h ============================================================================== --- stable/7/sys/sys/sysproto.h Fri Jul 24 20:35:44 2009 (r195855) +++ stable/7/sys/sys/sysproto.h Fri Jul 24 21:30:10 2009 (r195856) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb */ #ifndef _SYS_SYSPROTO_H_ @@ -1091,10 +1091,6 @@ struct extattr_delete_fd_args { struct __setugid_args { char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; -struct nfsclnt_args { - char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; - char argp_l_[PADL_(caddr_t)]; caddr_t argp; char argp_r_[PADR_(caddr_t)]; -}; struct eaccess_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; @@ -1702,7 +1698,6 @@ int undelete(struct thread *, struct und int futimes(struct thread *, struct futimes_args *); int getpgid(struct thread *, struct getpgid_args *); int poll(struct thread *, struct poll_args *); -int lkmnosys(struct thread *, struct nosys_args *); int __semctl(struct thread *, struct __semctl_args *); int semget(struct thread *, struct semget_args *); int semop(struct thread *, struct semop_args *); @@ -1799,12 +1794,10 @@ int getresuid(struct thread *, struct ge int getresgid(struct thread *, struct getresgid_args *); int kqueue(struct thread *, struct kqueue_args *); int kevent(struct thread *, struct kevent_args *); -int lkmressys(struct thread *, struct nosys_args *); int extattr_set_fd(struct thread *, struct extattr_set_fd_args *); int extattr_get_fd(struct thread *, struct extattr_get_fd_args *); int extattr_delete_fd(struct thread *, struct extattr_delete_fd_args *); int __setugid(struct thread *, struct __setugid_args *); -int nfsclnt(struct thread *, struct nfsclnt_args *); int eaccess(struct thread *, struct eaccess_args *); int nmount(struct thread *, struct nmount_args *); int kse_exit(struct thread *, struct kse_exit_args *); @@ -2141,6 +2134,7 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_open AUE_OPEN_RWTC #define SYS_AUE_close AUE_CLOSE #define SYS_AUE_wait4 AUE_WAIT4 +#define SYS_AUE_ocreat AUE_CREAT #define SYS_AUE_link AUE_LINK #define SYS_AUE_unlink AUE_UNLINK #define SYS_AUE_chdir AUE_CHDIR @@ -2149,6 +2143,8 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_chmod AUE_CHMOD #define SYS_AUE_chown AUE_CHOWN #define SYS_AUE_break AUE_NULL +#define SYS_AUE_freebsd4_getfsstat AUE_GETFSSTAT +#define SYS_AUE_olseek AUE_LSEEK #define SYS_AUE_getpid AUE_GETPID #define SYS_AUE_mount AUE_MOUNT #define SYS_AUE_unmount AUE_UMOUNT @@ -2167,16 +2163,21 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_fchflags AUE_FCHFLAGS #define SYS_AUE_sync AUE_SYNC #define SYS_AUE_kill AUE_KILL +#define SYS_AUE_ostat AUE_STAT #define SYS_AUE_getppid AUE_GETPPID +#define SYS_AUE_olstat AUE_LSTAT #define SYS_AUE_dup AUE_DUP #define SYS_AUE_pipe AUE_PIPE #define SYS_AUE_getegid AUE_GETEGID #define SYS_AUE_profil AUE_PROFILE #define SYS_AUE_ktrace AUE_KTRACE +#define SYS_AUE_osigaction AUE_SIGACTION #define SYS_AUE_getgid AUE_GETGID +#define SYS_AUE_osigprocmask AUE_SIGPROCMASK #define SYS_AUE_getlogin AUE_GETLOGIN #define SYS_AUE_setlogin AUE_SETLOGIN #define SYS_AUE_acct AUE_ACCT +#define SYS_AUE_osigpending AUE_SIGPENDING #define SYS_AUE_sigaltstack AUE_SIGALTSTACK #define SYS_AUE_ioctl AUE_IOCTL #define SYS_AUE_reboot AUE_REBOOT @@ -2186,10 +2187,14 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_execve AUE_EXECVE #define SYS_AUE_umask AUE_UMASK #define SYS_AUE_chroot AUE_CHROOT +#define SYS_AUE_ofstat AUE_FSTAT +#define SYS_AUE_ogetkerninfo AUE_NULL +#define SYS_AUE_ogetpagesize AUE_NULL #define SYS_AUE_msync AUE_MSYNC #define SYS_AUE_vfork AUE_VFORK #define SYS_AUE_sbrk AUE_SBRK #define SYS_AUE_sstk AUE_SSTK +#define SYS_AUE_ommap AUE_MMAP #define SYS_AUE_vadvise AUE_O_VADVISE #define SYS_AUE_munmap AUE_MUNMAP #define SYS_AUE_mprotect AUE_MPROTECT @@ -2200,8 +2205,11 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_getpgrp AUE_GETPGRP #define SYS_AUE_setpgid AUE_SETPGRP #define SYS_AUE_setitimer AUE_SETITIMER +#define SYS_AUE_owait AUE_WAIT4 #define SYS_AUE_swapon AUE_SWAPON #define SYS_AUE_getitimer AUE_GETITIMER +#define SYS_AUE_ogethostname AUE_SYSCTL +#define SYS_AUE_osethostname AUE_SYSCTL #define SYS_AUE_getdtablesize AUE_GETDTABLESIZE #define SYS_AUE_dup2 AUE_DUP2 #define SYS_AUE_fcntl AUE_FCNTL @@ -2210,10 +2218,21 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_setpriority AUE_SETPRIORITY #define SYS_AUE_socket AUE_SOCKET #define SYS_AUE_connect AUE_CONNECT +#define SYS_AUE_oaccept AUE_ACCEPT #define SYS_AUE_getpriority AUE_GETPRIORITY +#define SYS_AUE_osend AUE_SEND +#define SYS_AUE_orecv AUE_RECV +#define SYS_AUE_osigreturn AUE_SIGRETURN #define SYS_AUE_bind AUE_BIND #define SYS_AUE_setsockopt AUE_SETSOCKOPT #define SYS_AUE_listen AUE_LISTEN +#define SYS_AUE_osigvec AUE_NULL +#define SYS_AUE_osigblock AUE_NULL +#define SYS_AUE_osigsetmask AUE_NULL +#define SYS_AUE_osigsuspend AUE_NULL +#define SYS_AUE_osigstack AUE_NULL +#define SYS_AUE_orecvmsg AUE_RECVMSG +#define SYS_AUE_osendmsg AUE_SENDMSG #define SYS_AUE_gettimeofday AUE_GETTIMEOFDAY #define SYS_AUE_getrusage AUE_GETRUSAGE #define SYS_AUE_getsockopt AUE_GETSOCKOPT @@ -2222,9 +2241,12 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_settimeofday AUE_SETTIMEOFDAY #define SYS_AUE_fchown AUE_FCHOWN #define SYS_AUE_fchmod AUE_FCHMOD +#define SYS_AUE_orecvfrom AUE_RECVFROM #define SYS_AUE_setreuid AUE_SETREUID #define SYS_AUE_setregid AUE_SETREGID #define SYS_AUE_rename AUE_RENAME +#define SYS_AUE_otruncate AUE_TRUNCATE +#define SYS_AUE_oftruncate AUE_FTRUNCATE #define SYS_AUE_flock AUE_FLOCK #define SYS_AUE_mkfifo AUE_MKFIFO #define SYS_AUE_sendto AUE_SENDTO @@ -2234,10 +2256,21 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_rmdir AUE_RMDIR #define SYS_AUE_utimes AUE_UTIMES #define SYS_AUE_adjtime AUE_ADJTIME +#define SYS_AUE_ogetpeername AUE_GETPEERNAME +#define SYS_AUE_ogethostid AUE_SYSCTL +#define SYS_AUE_osethostid AUE_SYSCTL +#define SYS_AUE_ogetrlimit AUE_GETRLIMIT +#define SYS_AUE_osetrlimit AUE_SETRLIMIT +#define SYS_AUE_okillpg AUE_KILLPG #define SYS_AUE_setsid AUE_SETSID #define SYS_AUE_quotactl AUE_QUOTACTL +#define SYS_AUE_oquota AUE_O_QUOTA +#define SYS_AUE_ogetsockname AUE_GETSOCKNAME #define SYS_AUE_nlm_syscall AUE_NULL #define SYS_AUE_nfssvc AUE_NFS_SVC +#define SYS_AUE_ogetdirentries AUE_GETDIRENTRIES +#define SYS_AUE_freebsd4_statfs AUE_STATFS +#define SYS_AUE_freebsd4_fstatfs AUE_FSTATFS #define SYS_AUE_lgetfh AUE_LGETFH #define SYS_AUE_getfh AUE_NFS_GETFH #define SYS_AUE_getdomainname AUE_SYSCTL @@ -2274,7 +2307,6 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_futimes AUE_FUTIMES #define SYS_AUE_getpgid AUE_GETPGID #define SYS_AUE_poll AUE_POLL -#define SYS_AUE_lkmnosys AUE_NULL #define SYS_AUE___semctl AUE_SEMCTL #define SYS_AUE_semget AUE_SEMGET #define SYS_AUE_semop AUE_SEMOP @@ -2312,6 +2344,7 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_nlstat AUE_LSTAT #define SYS_AUE_preadv AUE_PREADV #define SYS_AUE_pwritev AUE_PWRITEV +#define SYS_AUE_freebsd4_fhstatfs AUE_FHSTATFS #define SYS_AUE_fhopen AUE_FHOPEN #define SYS_AUE_fhstat AUE_FHSTAT #define SYS_AUE_modnext AUE_NULL @@ -2347,11 +2380,14 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_sched_get_priority_min AUE_NULL #define SYS_AUE_sched_rr_get_interval AUE_NULL #define SYS_AUE_utrace AUE_NULL +#define SYS_AUE_freebsd4_sendfile AUE_SENDFILE #define SYS_AUE_kldsym AUE_NULL #define SYS_AUE_jail AUE_JAIL #define SYS_AUE_sigprocmask AUE_SIGPROCMASK #define SYS_AUE_sigsuspend AUE_SIGSUSPEND +#define SYS_AUE_freebsd4_sigaction AUE_SIGACTION #define SYS_AUE_sigpending AUE_SIGPENDING +#define SYS_AUE_freebsd4_sigreturn AUE_SIGRETURN #define SYS_AUE_sigtimedwait AUE_SIGWAIT #define SYS_AUE_sigwaitinfo AUE_NULL #define SYS_AUE___acl_get_file AUE_NULL @@ -2371,12 +2407,10 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_getresgid AUE_GETRESGID #define SYS_AUE_kqueue AUE_KQUEUE #define SYS_AUE_kevent AUE_NULL -#define SYS_AUE_lkmressys AUE_NULL #define SYS_AUE_extattr_set_fd AUE_EXTATTR_SET_FD #define SYS_AUE_extattr_get_fd AUE_EXTATTR_GET_FD #define SYS_AUE_extattr_delete_fd AUE_EXTATTR_DELETE_FD #define SYS_AUE___setugid AUE_NULL -#define SYS_AUE_nfsclnt AUE_NULL #define SYS_AUE_eaccess AUE_EACCESS #define SYS_AUE_nmount AUE_NMOUNT #define SYS_AUE_kse_exit AUE_NULL From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 21:35:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A433106564A; Fri, 24 Jul 2009 21:35:52 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77C598FC0A; Fri, 24 Jul 2009 21:35:52 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OLZqLC021839; Fri, 24 Jul 2009 21:35:52 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OLZqBs021835; Fri, 24 Jul 2009 21:35:52 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200907242135.n6OLZqBs021835@svn.freebsd.org> From: Jack F Vogel Date: Fri, 24 Jul 2009 21:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195857 - in head/sys/dev: e1000 ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 21:35:53 -0000 Author: jfv Date: Fri Jul 24 21:35:52 2009 New Revision: 195857 URL: http://svn.freebsd.org/changeset/base/195857 Log: Improvement on the last change, this gives a precise way to tell the one and only interface that a vlan event is for. Thanks to John Baldwin for the patch. Approved by: re Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Jul 24 21:30:10 2009 (r195856) +++ head/sys/dev/e1000/if_em.c Fri Jul 24 21:35:52 2009 (r195857) @@ -815,9 +815,9 @@ em_attach(device_t dev) #if __FreeBSD_version >= 700029 /* Register for VLAN events */ adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, - em_register_vlan, 0, EVENTHANDLER_PRI_FIRST); + em_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, - em_unregister_vlan, 0, EVENTHANDLER_PRI_FIRST); + em_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); #endif /* Tell the stack that the interface is not active */ @@ -4713,12 +4713,12 @@ em_receive_checksum(struct adapter *adap * config EVENT */ static void -em_register_vlan(void *unused, struct ifnet *ifp, u16 vtag) +em_register_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u32 index, bit; - if (ifp->if_init != em_init) /* Not our event */ + if (ifp->if_softc != arg) /* Not our event */ return; if ((vtag == 0) || (vtag > 4095)) /* Invalid ID */ @@ -4737,12 +4737,12 @@ em_register_vlan(void *unused, struct if * unconfig EVENT */ static void -em_unregister_vlan(void *unused, struct ifnet *ifp, u16 vtag) +em_unregister_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u32 index, bit; - if (ifp->if_init != em_init) + if (ifp->if_softc != arg) return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jul 24 21:30:10 2009 (r195856) +++ head/sys/dev/e1000/if_igb.c Fri Jul 24 21:35:52 2009 (r195857) @@ -600,9 +600,9 @@ igb_attach(device_t dev) /* Register for VLAN events */ adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, - igb_register_vlan, 0, EVENTHANDLER_PRI_FIRST); + igb_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, - igb_unregister_vlan, 0, EVENTHANDLER_PRI_FIRST); + igb_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); /* Tell the stack that the interface is not active */ adapter->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -4305,12 +4305,12 @@ igb_rx_checksum(u32 staterr, struct mbuf * config EVENT */ static void -igb_register_vlan(void *unused, struct ifnet *ifp, u16 vtag) +igb_register_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u32 index, bit; - if (ifp->if_init != igb_init) /* Not our event */ + if (ifp->if_softc != arg) /* Not our event */ return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ @@ -4329,12 +4329,12 @@ igb_register_vlan(void *unused, struct i * unconfig EVENT */ static void -igb_unregister_vlan(void *unused, struct ifnet *ifp, u16 vtag) +igb_unregister_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u32 index, bit; - if (ifp->if_init != igb_init) + if (ifp->if_softc != arg) return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Jul 24 21:30:10 2009 (r195856) +++ head/sys/dev/ixgbe/ixgbe.c Fri Jul 24 21:35:52 2009 (r195857) @@ -539,9 +539,9 @@ ixgbe_attach(device_t dev) /* Register for VLAN events */ adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, - ixgbe_register_vlan, 0, EVENTHANDLER_PRI_FIRST); + ixgbe_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, - ixgbe_unregister_vlan, 0, EVENTHANDLER_PRI_FIRST); + ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); /* let hardware know driver is loaded */ ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); @@ -4124,12 +4124,12 @@ ixgbe_rx_checksum(u32 staterr, struct mb ** repopulate the real table. */ static void -ixgbe_register_vlan(void *unused, struct ifnet *ifp, u16 vtag) +ixgbe_register_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u16 index, bit; - if (ifp->if_init != ixgbe_init) /* Not our event */ + if (ifp->if_softc != arg) /* Not our event */ return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ @@ -4149,12 +4149,12 @@ ixgbe_register_vlan(void *unused, struct ** in the soft vfta. */ static void -ixgbe_unregister_vlan(void *unused, struct ifnet *ifp, u16 vtag) +ixgbe_unregister_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u16 index, bit; - if (ifp->if_init != ixgbe_init) + if (ifp->if_softc != arg) return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 24 21:42:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F22F106566C; Fri, 24 Jul 2009 21:42:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DF928FC15; Fri, 24 Jul 2009 21:42:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OLgBwK022074; Fri, 24 Jul 2009 21:42:11 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OLgA3K022060; Fri, 24 Jul 2009 21:42:10 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200907242142.n6OLgA3K022060@svn.freebsd.org> From: Brooks Davis Date: Fri, 24 Jul 2009 21:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195859 - in stable/7: lib/libc lib/libc/gen lib/libc/rpc lib/libc/sys usr.bin/id usr.bin/newgrp usr.bin/quota usr.sbin/chown usr.sbin/chroot usr.sbin/jail usr.sbin/jexec usr.sbin/lpr u... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 21:42:12 -0000 Author: brooks Date: Fri Jul 24 21:42:10 2009 New Revision: 195859 URL: http://svn.freebsd.org/changeset/base/195859 Log: MFC r194494 to improve support for 7.x worlds on >=8.0 kernels: In preparation for raising NGROUPS and NGROUPS_MAX, change base system callers of getgroups(), getgrouplist(), and setgroups() to allocate buffers dynamically. Specifically, allocate a buffer of size sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow). This (or similar gymnastics) is required for the code to actually follow the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime and where getgroups may return {NGROUPS_MAX}+1 results on systems like FreeBSD which include the primary group. In id(1), don't pointlessly add the primary group to the list of all groups, it is always the first result from getgroups(). In principle the old code was more portable, but this was only done in one of the two places where getgroups() was called to the overall effect was pointless. Document the actual POSIX requirements in the getgroups(2) and setgroups(2) manpages. We do not yet support a dynamic NGROUPS, but we may in the future. Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/gen/initgroups.3 stable/7/lib/libc/gen/initgroups.c stable/7/lib/libc/rpc/auth_unix.c stable/7/lib/libc/sys/getgroups.2 stable/7/lib/libc/sys/setgroups.2 stable/7/usr.bin/id/ (props changed) stable/7/usr.bin/id/id.c stable/7/usr.bin/newgrp/ (props changed) stable/7/usr.bin/newgrp/newgrp.c stable/7/usr.bin/quota/ (props changed) stable/7/usr.bin/quota/quota.c stable/7/usr.sbin/chown/ (props changed) stable/7/usr.sbin/chown/chown.c stable/7/usr.sbin/chroot/ (props changed) stable/7/usr.sbin/chroot/chroot.c stable/7/usr.sbin/jail/ (props changed) stable/7/usr.sbin/jail/jail.c stable/7/usr.sbin/jexec/ (props changed) stable/7/usr.sbin/jexec/jexec.c stable/7/usr.sbin/lpr/ (props changed) stable/7/usr.sbin/lpr/lpc/lpc.c Modified: stable/7/lib/libc/gen/initgroups.3 ============================================================================== --- stable/7/lib/libc/gen/initgroups.3 Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/lib/libc/gen/initgroups.3 Fri Jul 24 21:42:10 2009 (r195859) @@ -65,6 +65,13 @@ function may fail and set .Va errno for any of the errors specified for the library function .Xr setgroups 2 . +It may also return: +.Bl -tag -width Er +.It Bq Er ENOMEM +The +.Fn initgroups +function was unable to allocate temporary storage. +.El .Sh SEE ALSO .Xr setgroups 2 , .Xr getgrouplist 3 Modified: stable/7/lib/libc/gen/initgroups.c ============================================================================== --- stable/7/lib/libc/gen/initgroups.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/lib/libc/gen/initgroups.c Fri Jul 24 21:42:10 2009 (r195859) @@ -35,10 +35,12 @@ __FBSDID("$FreeBSD$"); #include -#include #include "namespace.h" #include #include "un-namespace.h" +#include +#include +#include #include int @@ -46,14 +48,21 @@ initgroups(uname, agroup) const char *uname; gid_t agroup; { - int ngroups; + int ngroups, ret; + long ngroups_max; + gid_t *groups; + /* - * Provide space for one group more than NGROUPS to allow + * Provide space for one group more than possible to allow * setgroups to fail and set errno. */ - gid_t groups[NGROUPS + 1]; + ngroups_max = sysconf(_SC_NGROUPS_MAX) + 2; + if ((groups = malloc(sizeof(*groups) * ngroups_max)) == NULL) + return (ENOMEM); - ngroups = NGROUPS + 1; + ngroups = (int)ngroups_max; getgrouplist(uname, agroup, groups, &ngroups); - return (setgroups(ngroups, groups)); + ret = setgroups(ngroups, groups); + free(groups); + return (ret); } Modified: stable/7/lib/libc/rpc/auth_unix.c ============================================================================== --- stable/7/lib/libc/rpc/auth_unix.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/lib/libc/rpc/auth_unix.c Fri Jul 24 21:42:10 2009 (r195859) @@ -185,23 +185,29 @@ authunix_create(machname, uid, gid, len, AUTH * authunix_create_default() { - int len; + int ngids; + long ngids_max; char machname[MAXHOSTNAMELEN + 1]; uid_t uid; gid_t gid; - gid_t gids[NGROUPS_MAX]; + gid_t *gids; + + ngids_max = sysconf(_SC_NGROUPS_MAX) + 1; + gids = malloc(sizeof(gid_t) * ngids_max); + if (gids == NULL) + return (NULL); if (gethostname(machname, sizeof machname) == -1) abort(); machname[sizeof(machname) - 1] = 0; uid = geteuid(); gid = getegid(); - if ((len = getgroups(NGROUPS_MAX, gids)) < 0) + if ((ngids = getgroups(ngids_max, gids)) < 0) abort(); - if (len > NGRPS) - len = NGRPS; + if (ngids > NGRPS) + ngids = NGRPS; /* XXX: interface problem; those should all have been unsigned */ - return (authunix_create(machname, (int)uid, (int)gid, len, + return (authunix_create(machname, (int)uid, (int)gid, ngids, (int *)gids)); } Modified: stable/7/lib/libc/sys/getgroups.2 ============================================================================== --- stable/7/lib/libc/sys/getgroups.2 Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/lib/libc/sys/getgroups.2 Fri Jul 24 21:42:10 2009 (r195859) @@ -58,10 +58,7 @@ The system call returns the actual number of groups returned in .Fa gidset . -No more than -.Dv NGROUPS_MAX -will ever -be returned. +At least one and as many as {NGROUPS_MAX}+1 values may be returned. If .Fa gidsetlen is zero, @@ -92,6 +89,11 @@ an invalid address. .Sh SEE ALSO .Xr setgroups 2 , .Xr initgroups 3 +.Sh STANDARDS +The +.Fn getgroups +system call conforms to +.St -p1003.1-2008 . .Sh HISTORY The .Fn getgroups Modified: stable/7/lib/libc/sys/setgroups.2 ============================================================================== --- stable/7/lib/libc/sys/setgroups.2 Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/lib/libc/sys/setgroups.2 Fri Jul 24 21:42:10 2009 (r195859) @@ -53,9 +53,7 @@ The argument indicates the number of entries in the array and must be no more than -.Dv NGROUPS , -as defined in -.In sys/param.h . +.Dv {NGROUPS_MAX}+1 . .Pp Only the super-user may set new groups. .Sh RETURN VALUES @@ -71,7 +69,7 @@ The caller is not the super-user. The number specified in the .Fa ngroups argument is larger than the -.Dv NGROUPS +.Dv {NGROUPS_MAX}+1 limit. .It Bq Er EFAULT The address specified for Modified: stable/7/usr.bin/id/id.c ============================================================================== --- stable/7/usr.bin/id/id.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/usr.bin/id/id.c Fri Jul 24 21:42:10 2009 (r195859) @@ -258,7 +258,8 @@ id_print(struct passwd *pw, int use_ggl, gid_t gid, egid, lastgid; uid_t uid, euid; int cnt, ngroups; - gid_t groups[NGROUPS + 1]; + long ngroups_max; + gid_t *groups; const char *fmt; if (pw != NULL) { @@ -270,12 +271,16 @@ id_print(struct passwd *pw, int use_ggl, gid = getgid(); } + ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; + if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL) + err(1, "malloc"); + if (use_ggl && pw != NULL) { - ngroups = NGROUPS + 1; + ngroups = ngroups_max; getgrouplist(pw->pw_name, gid, groups, &ngroups); } else { - ngroups = getgroups(NGROUPS + 1, groups); + ngroups = getgroups(ngroups_max, groups); } if (pw != NULL) @@ -306,6 +311,7 @@ id_print(struct passwd *pw, int use_ggl, lastgid = gid; } printf("\n"); + free(groups); } #ifdef USE_BSM_AUDIT @@ -361,15 +367,19 @@ group(struct passwd *pw, int nflag) { struct group *gr; int cnt, id, lastid, ngroups; - gid_t groups[NGROUPS + 1]; + long ngroups_max; + gid_t *groups; const char *fmt; + ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; + if ((groups = malloc(sizeof(gid_t) * (ngroups_max))) == NULL) + err(1, "malloc"); + if (pw) { - ngroups = NGROUPS + 1; + ngroups = ngroups_max; (void) getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups); } else { - groups[0] = getgid(); - ngroups = getgroups(NGROUPS, groups + 1) + 1; + ngroups = getgroups(ngroups_max, groups); } fmt = nflag ? "%s" : "%u"; for (lastid = -1, cnt = 0; cnt < ngroups; ++cnt) { @@ -389,6 +399,7 @@ group(struct passwd *pw, int nflag) lastid = id; } (void)printf("\n"); + free(groups); } void Modified: stable/7/usr.bin/newgrp/newgrp.c ============================================================================== --- stable/7/usr.bin/newgrp/newgrp.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/usr.bin/newgrp/newgrp.c Fri Jul 24 21:42:10 2009 (r195859) @@ -146,8 +146,8 @@ restoregrps(void) static void addgroup(const char *grpname) { - gid_t grps[NGROUPS_MAX]; - long lgid; + gid_t *grps; + long lgid, ngrps_max; int dbmember, i, ngrps; gid_t egid; struct group *grp; @@ -185,7 +185,10 @@ addgroup(const char *grpname) } } - if ((ngrps = getgroups(NGROUPS_MAX, (gid_t *)grps)) < 0) { + ngrps_max = sysconf(_SC_NGROUPS_MAX) + 1; + if ((grps = malloc(sizeof(gid_t) * ngrps_max)) == NULL) + err(1, "malloc"); + if ((ngrps = getgroups(ngrps_max, (gid_t *)grps)) < 0) { warn("getgroups"); return; } @@ -217,7 +220,7 @@ addgroup(const char *grpname) /* Add old effective gid to supp. list if it does not exist. */ if (egid != grp->gr_gid && !inarray(egid, grps, ngrps)) { - if (ngrps == NGROUPS_MAX) + if (ngrps == ngrps_max) warnx("too many groups"); else { grps[ngrps++] = egid; @@ -231,6 +234,7 @@ addgroup(const char *grpname) } } + free(grps); } static int Modified: stable/7/usr.bin/quota/quota.c ============================================================================== --- stable/7/usr.bin/quota/quota.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/usr.bin/quota/quota.c Fri Jul 24 21:42:10 2009 (r195859) @@ -117,7 +117,8 @@ int main(int argc, char *argv[]) { int ngroups; - gid_t mygid, gidset[NGROUPS]; + long ngroups_max; + gid_t mygid, *gidset; int i, ch, gflag = 0, uflag = 0, errflag = 0; while ((ch = getopt(argc, argv, "f:ghlrquv")) != -1) { @@ -159,13 +160,18 @@ main(int argc, char *argv[]) errflag += showuid(getuid()); if (gflag) { mygid = getgid(); - ngroups = getgroups(NGROUPS, gidset); + ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; + if ((gidset = malloc(sizeof(gid_t) * ngroups_max)) + == NULL) + err(1, "malloc"); + ngroups = getgroups(ngroups_max, gidset); if (ngroups < 0) err(1, "getgroups"); errflag += showgid(mygid); for (i = 0; i < ngroups; i++) if (gidset[i] != mygid) errflag += showgid(gidset[i]); + free(gidset); } return(errflag); } Modified: stable/7/usr.sbin/chown/chown.c ============================================================================== --- stable/7/usr.sbin/chown/chown.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/usr.sbin/chown/chown.c Fri Jul 24 21:42:10 2009 (r195859) @@ -269,7 +269,8 @@ chownerr(const char *file) { static uid_t euid = -1; static int ngroups = -1; - gid_t groups[NGROUPS_MAX]; + static long ngroups_max; + gid_t *groups; /* Check for chown without being root. */ if (errno != EPERM || (uid != (uid_t)-1 && @@ -281,7 +282,10 @@ chownerr(const char *file) /* Check group membership; kernel just returns EPERM. */ if (gid != (gid_t)-1 && ngroups == -1 && euid == (uid_t)-1 && (euid = geteuid()) != 0) { - ngroups = getgroups(NGROUPS_MAX, groups); + ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; + if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL) + err(1, "malloc"); + ngroups = getgroups(ngroups_max, groups); while (--ngroups >= 0 && gid != groups[ngroups]); if (ngroups < 0) { warnx("you are not a member of group %s", gname); Modified: stable/7/usr.sbin/chroot/chroot.c ============================================================================== --- stable/7/usr.sbin/chroot/chroot.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/usr.sbin/chroot/chroot.c Fri Jul 24 21:42:10 2009 (r195859) @@ -69,9 +69,10 @@ main(argc, argv) struct passwd *pw; char *endp, *p; const char *shell; - gid_t gid, gidlist[NGROUPS_MAX]; + gid_t gid, *gidlist; uid_t uid; int ch, gids; + long ngroups_max; gid = 0; uid = 0; @@ -117,8 +118,11 @@ main(argc, argv) } } + ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; + if ((gidlist = malloc(sizeof(gid_t) * ngroups_max)) == NULL) + err(1, "malloc"); for (gids = 0; - (p = strsep(&grouplist, ",")) != NULL && gids < NGROUPS_MAX; ) { + (p = strsep(&grouplist, ",")) != NULL && gids < ngroups_max; ) { if (*p == '\0') continue; @@ -135,7 +139,7 @@ main(argc, argv) } gids++; } - if (p != NULL && gids == NGROUPS_MAX) + if (p != NULL && gids == ngroups_max) errx(1, "too many supplementary groups provided"); if (user != NULL) { Modified: stable/7/usr.sbin/jail/jail.c ============================================================================== --- stable/7/usr.sbin/jail/jail.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/usr.sbin/jail/jail.c Fri Jul 24 21:42:10 2009 (r195859) @@ -68,7 +68,7 @@ STAILQ_HEAD(addr6head, addr6entry) addr6 lcap = login_getpwclass(pwd); \ if (lcap == NULL) \ err(1, "getpwclass: %s", username); \ - ngroups = NGROUPS; \ + ngroups = ngroups_max; \ if (getgrouplist(username, pwd->pw_gid, groups, &ngroups) != 0) \ err(1, "getgrouplist: %s", username); \ } while (0) @@ -79,9 +79,10 @@ main(int argc, char **argv) login_cap_t *lcap = NULL; struct jail j; struct passwd *pwd = NULL; - gid_t groups[NGROUPS]; + gid_t *groups; int ch, error, i, ngroups, securelevel; int hflag, iflag, Jflag, lflag, uflag, Uflag; + long ngroups_max; char path[PATH_MAX], *jailname, *ep, *username, *JidFile, *ip; static char *cleanenv; const char *shell, *p = NULL; @@ -94,6 +95,10 @@ main(int argc, char **argv) jailname = username = JidFile = cleanenv = NULL; fp = NULL; + ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; + if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL) + err(1, "malloc"); + while ((ch = getopt(argc, argv, "hiln:s:u:U:J:")) != -1) { switch (ch) { case 'h': Modified: stable/7/usr.sbin/jexec/jexec.c ============================================================================== --- stable/7/usr.sbin/jexec/jexec.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/usr.sbin/jexec/jexec.c Fri Jul 24 21:42:10 2009 (r195859) @@ -202,7 +202,7 @@ lookup_jail(int jid, char *jailname) lcap = login_getpwclass(pwd); \ if (lcap == NULL) \ err(1, "getpwclass: %s", username); \ - ngroups = NGROUPS; \ + ngroups = ngroups_max; \ if (getgrouplist(username, pwd->pw_gid, groups, &ngroups) != 0) \ err(1, "getgrouplist: %s", username); \ } while (0) @@ -213,14 +213,19 @@ main(int argc, char *argv[]) int jid; login_cap_t *lcap = NULL; struct passwd *pwd = NULL; - gid_t groups[NGROUPS]; + gid_t *groups = NULL; int ch, ngroups, uflag, Uflag; + long ngroups_max; char *jailname, *username; ch = uflag = Uflag = 0; jailname = username = NULL; jid = -1; + ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; + if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL) + err(1, "malloc"); + while ((ch = getopt(argc, argv, "i:n:u:U:")) != -1) { switch (ch) { case 'n': Modified: stable/7/usr.sbin/lpr/lpc/lpc.c ============================================================================== --- stable/7/usr.sbin/lpr/lpc/lpc.c Fri Jul 24 21:38:51 2009 (r195858) +++ stable/7/usr.sbin/lpr/lpc/lpc.c Fri Jul 24 21:42:10 2009 (r195859) @@ -356,7 +356,8 @@ ingroup(const char *grname) { static struct group *gptr=NULL; static int ngroups = 0; - static gid_t groups[NGROUPS]; + static long ngroups_max; + static gid_t *groups; register gid_t gid; register int i; @@ -365,7 +366,10 @@ ingroup(const char *grname) warnx("warning: unknown group '%s'", grname); return(0); } - ngroups = getgroups(NGROUPS, groups); + ngroups_max = sysconf(_SC_NGROUPS_MAX); + if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL) + err(1, "malloc"); + ngroups = getgroups(ngroups_max, groups); if (ngroups < 0) err(1, "getgroups"); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 02:22:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6EFF106566B; Sat, 25 Jul 2009 02:22:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA7348FC20; Sat, 25 Jul 2009 02:22:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6P2MAS4027593; Sat, 25 Jul 2009 02:22:10 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6P2MAah027591; Sat, 25 Jul 2009 02:22:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200907250222.n6P2MAah027591@svn.freebsd.org> From: Ed Maste Date: Sat, 25 Jul 2009 02:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195860 - in stable/7/sys: . boot/i386/libi386 contrib/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 02:22:11 -0000 Author: emaste Date: Sat Jul 25 02:22:10 2009 New Revision: 195860 URL: http://svn.freebsd.org/changeset/base/195860 Log: MFC r179825 by olli: Implement a workaround for a long-standing problem in libi386's time(), caused by a qemu bug. The bug might be present in other BIOSes, too. qemu either does not simulate the AT RTC correctly or has a broken BIOS 1A/02 implementation, and will return an incorrect value if the RTC is read while it is being updated. The effect is worsened by the fact that qemu's INT 15/86 function ("wait" a.k.a. usleep) is non-implmeneted or broken and returns immediately, causing beastie.4th to spin in a tight loop calling the "read RTC" function millions of times, triggering the problem quickly. Therefore, we keep reading the BIOS value until we get the same result twice. This change fixes beastie.4th's countdown under qemu. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/libi386/time.c stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/libi386/time.c ============================================================================== --- stable/7/sys/boot/i386/libi386/time.c Fri Jul 24 21:42:10 2009 (r195859) +++ stable/7/sys/boot/i386/libi386/time.c Sat Jul 25 02:22:10 2009 (r195860) @@ -32,18 +32,16 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386.h" +static int bios_seconds(void); + /* - * Return the time in seconds since the beginning of the day. - * - * If we pass midnight, don't wrap back to 0. + * Return the BIOS time-of-day value. * * XXX uses undocumented BCD support from libstand. */ - -time_t -time(time_t *t) +static int +bios_seconds(void) { - static time_t lasttime, now; int hr, minute, sec; v86.ctl = 0; @@ -55,7 +53,33 @@ time(time_t *t) minute = bcd2bin(v86.ecx & 0xff); /* minute in %cl */ sec = bcd2bin((v86.edx & 0xff00) >> 8); /* second in %dh */ - now = hr * 3600 + minute * 60 + sec; + return (hr * 3600 + minute * 60 + sec); +} + +/* + * Return the time in seconds since the beginning of the day. + * + * Some BIOSes (notably qemu) don't correctly read the RTC + * registers in an atomic way, sometimes returning bogus values. + * Therefore we "debounce" the reading by accepting it only when + * we got two identical values in succession. + * + * If we pass midnight, don't wrap back to 0. + */ +time_t +time(time_t *t) +{ + static time_t lasttime; + time_t now, check; + int try; + + try = 0; + check = bios_seconds(); + do { + now = check; + check = bios_seconds(); + } while (now != check && ++try < 1000); + if (now < lasttime) now += 24 * 3600; lasttime = now; From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 02:37:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 889251065672; Sat, 25 Jul 2009 02:37:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4AC8FC14; Sat, 25 Jul 2009 02:37:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6P2bxiL027927; Sat, 25 Jul 2009 02:37:59 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6P2bx4a027925; Sat, 25 Jul 2009 02:37:59 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200907250237.n6P2bx4a027925@svn.freebsd.org> From: Ed Maste Date: Sat, 25 Jul 2009 02:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195861 - in stable/6/sys: . boot/i386/libi386 contrib/pf dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 02:38:00 -0000 Author: emaste Date: Sat Jul 25 02:37:59 2009 New Revision: 195861 URL: http://svn.freebsd.org/changeset/base/195861 Log: MFC r179825 by olli: Implement a workaround for a long-standing problem in libi386's time(), caused by a qemu bug. The bug might be present in other BIOSes, too. qemu either does not simulate the AT RTC correctly or has a broken BIOS 1A/02 implementation, and will return an incorrect value if the RTC is read while it is being updated. The effect is worsened by the fact that qemu's INT 15/86 function ("wait" a.k.a. usleep) is non-implmeneted or broken and returns immediately, causing beastie.4th to spin in a tight loop calling the "read RTC" function millions of times, triggering the problem quickly. Therefore, we keep reading the BIOS value until we get the same result twice. This change fixes beastie.4th's countdown under qemu. Modified: stable/6/sys/ (props changed) stable/6/sys/boot/i386/libi386/time.c stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/i386/libi386/time.c ============================================================================== --- stable/6/sys/boot/i386/libi386/time.c Sat Jul 25 02:22:10 2009 (r195860) +++ stable/6/sys/boot/i386/libi386/time.c Sat Jul 25 02:37:59 2009 (r195861) @@ -32,18 +32,16 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386.h" +static int bios_seconds(void); + /* - * Return the time in seconds since the beginning of the day. - * - * If we pass midnight, don't wrap back to 0. + * Return the BIOS time-of-day value. * * XXX uses undocumented BCD support from libstand. */ - -time_t -time(time_t *t) +static int +bios_seconds(void) { - static time_t lasttime, now; int hr, minute, sec; v86.ctl = 0; @@ -55,7 +53,33 @@ time(time_t *t) minute = bcd2bin(v86.ecx & 0xff); /* minute in %cl */ sec = bcd2bin((v86.edx & 0xff00) >> 8); /* second in %dh */ - now = hr * 3600 + minute * 60 + sec; + return (hr * 3600 + minute * 60 + sec); +} + +/* + * Return the time in seconds since the beginning of the day. + * + * Some BIOSes (notably qemu) don't correctly read the RTC + * registers in an atomic way, sometimes returning bogus values. + * Therefore we "debounce" the reading by accepting it only when + * we got two identical values in succession. + * + * If we pass midnight, don't wrap back to 0. + */ +time_t +time(time_t *t) +{ + static time_t lasttime; + time_t now, check; + int try; + + try = 0; + check = bios_seconds(); + do { + now = check; + check = bios_seconds(); + } while (now != check && ++try < 1000); + if (now < lasttime) now += 24 * 3600; lasttime = now; From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 03:36:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2479106564A; Sat, 25 Jul 2009 03:36:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7FD708FC0A; Sat, 25 Jul 2009 03:36:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n6P3YJj3003880; Fri, 24 Jul 2009 21:34:20 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 24 Jul 2009 23:34:58 -0400 (EDT) Message-Id: <20090724.233458.1683324074.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: <4A68DA56.60301@samsco.org> References: <4A66D0F4.4030108@FreeBSD.org> <20090723.132350.-432839349.imp@bsdimp.com> <4A68DA56.60301@samsco.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, mav@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, cperciva@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 03:36:16 -0000 In message: <4A68DA56.60301@samsco.org> Scott Long writes: : M. Warner Losh wrote: : > In message: <4A66D0F4.4030108@FreeBSD.org> : > Alexander Motin writes: : > : Colin Percival wrote: : > : > Author: cperciva : > : > Date: Wed Jul 22 03:50:54 2009 : > : > New Revision: 195817 : > : > URL: http://svn.freebsd.org/changeset/base/195817 : > : > : > : > Log: : > : > Remove the "dedicated disk mode" partitioning option from sysinstall, in : > : > both the disk partitioning screen (the 'F' key) and via install.cfg (the : > : > VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x : > : > due to libdisk and geom generating different partition names; this commit : > : > merely acts to help steer users away from the breakage. : > : > : > : > Submitted by: randi : > : > Approved by: re (kensmith) : > : > : > : > Modified: : > : > head/usr.sbin/sysinstall/disks.c : > : : > : Is there any other way to not align FS block to the ugly legacy 63 : > : sectors per track boundary with sysinstall now? I think RAIDs won't be : > : happy. May be it would be better to fix it? : > : > The reason we do it like this is because the boot blocks occupy the : > first cylinder group. Which with today's fake goemetry is 63 : > blocks... : > : : I already covered this. Unfortunately, Randi didn't take my bait. : Anyways, '63' is a minimum, it's not a singular value. It's also : an incredibly bad default. Yes. 256 is just as good as 63, unless the geometry reports more than 256 heads, which I don't think is possible... Warner From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 03:42:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BF18106564A; Sat, 25 Jul 2009 03:42:43 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id D318B8FC1F; Sat, 25 Jul 2009 03:42:42 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n6P3gbUm030420; Fri, 24 Jul 2009 21:42:37 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A6A7F2D.90807@samsco.org> Date: Fri, 24 Jul 2009 21:42:37 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: "M. Warner Losh" References: <4A66D0F4.4030108@FreeBSD.org> <20090723.132350.-432839349.imp@bsdimp.com> <4A68DA56.60301@samsco.org> <20090724.233458.1683324074.imp@bsdimp.com> In-Reply-To: <20090724.233458.1683324074.imp@bsdimp.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@freebsd.org, mav@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, cperciva@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 03:42:43 -0000 M. Warner Losh wrote: > In message: <4A68DA56.60301@samsco.org> > Scott Long writes: > : M. Warner Losh wrote: > : > In message: <4A66D0F4.4030108@FreeBSD.org> > : > Alexander Motin writes: > : > : Colin Percival wrote: > : > : > Author: cperciva > : > : > Date: Wed Jul 22 03:50:54 2009 > : > : > New Revision: 195817 > : > : > URL: http://svn.freebsd.org/changeset/base/195817 > : > : > > : > : > Log: > : > : > Remove the "dedicated disk mode" partitioning option from sysinstall, in > : > : > both the disk partitioning screen (the 'F' key) and via install.cfg (the > : > : > VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x > : > : > due to libdisk and geom generating different partition names; this commit > : > : > merely acts to help steer users away from the breakage. > : > : > > : > : > Submitted by: randi > : > : > Approved by: re (kensmith) > : > : > > : > : > Modified: > : > : > head/usr.sbin/sysinstall/disks.c > : > : > : > : Is there any other way to not align FS block to the ugly legacy 63 > : > : sectors per track boundary with sysinstall now? I think RAIDs won't be > : > : happy. May be it would be better to fix it? > : > > : > The reason we do it like this is because the boot blocks occupy the > : > first cylinder group. Which with today's fake goemetry is 63 > : > blocks... > : > > : > : I already covered this. Unfortunately, Randi didn't take my bait. > : Anyways, '63' is a minimum, it's not a singular value. It's also > : an incredibly bad default. > > Yes. 256 is just as good as 63, unless the geometry reports more than > 256 heads, which I don't think is possible... > > Warner If there is a BIOS in existence that can't find sector 256, then it likely can't boot off of anything other than partition 1 in the fdisk table. I bet that bugs like that were likely caught 15-20 years ago. Scott From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 03:56:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EC50106566B; Sat, 25 Jul 2009 03:56:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1D29B8FC12; Sat, 25 Jul 2009 03:56:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n6P3rgM4004035; Fri, 24 Jul 2009 21:53:43 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 24 Jul 2009 23:54:20 -0400 (EDT) Message-Id: <20090724.235420.319856209.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: <4A6A7F2D.90807@samsco.org> References: <4A68DA56.60301@samsco.org> <20090724.233458.1683324074.imp@bsdimp.com> <4A6A7F2D.90807@samsco.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, mav@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, cperciva@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 03:56:47 -0000 In message: <4A6A7F2D.90807@samsco.org> Scott Long writes: : M. Warner Losh wrote: : > In message: <4A68DA56.60301@samsco.org> : > Scott Long writes: : > : M. Warner Losh wrote: : > : > In message: <4A66D0F4.4030108@FreeBSD.org> : > : > Alexander Motin writes: : > : > : Colin Percival wrote: : > : > : > Author: cperciva : > : > : > Date: Wed Jul 22 03:50:54 2009 : > : > : > New Revision: 195817 : > : > : > URL: http://svn.freebsd.org/changeset/base/195817 : > : > : > : > : > : > Log: : > : > : > Remove the "dedicated disk mode" partitioning option from sysinstall, in : > : > : > both the disk partitioning screen (the 'F' key) and via install.cfg (the : > : > : > VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x : > : > : > due to libdisk and geom generating different partition names; this commit : > : > : > merely acts to help steer users away from the breakage. : > : > : > : > : > : > Submitted by: randi : > : > : > Approved by: re (kensmith) : > : > : > : > : > : > Modified: : > : > : > head/usr.sbin/sysinstall/disks.c : > : > : : > : > : Is there any other way to not align FS block to the ugly legacy 63 : > : > : sectors per track boundary with sysinstall now? I think RAIDs won't be : > : > : happy. May be it would be better to fix it? : > : > : > : > The reason we do it like this is because the boot blocks occupy the : > : > first cylinder group. Which with today's fake goemetry is 63 : > : > blocks... : > : > : > : : > : I already covered this. Unfortunately, Randi didn't take my bait. : > : Anyways, '63' is a minimum, it's not a singular value. It's also : > : an incredibly bad default. : > : > Yes. 256 is just as good as 63, unless the geometry reports more than : > 256 heads, which I don't think is possible... : > : > Warner : : If there is a BIOS in existence that can't find sector 256, then it : likely can't boot off of anything other than partition 1 in the fdisk : table. I bet that bugs like that were likely caught 15-20 years ago. I think you were missing the point I was trying to make, I must have been unclear. If there were more than 256 sectors in the first cylinder, then starting at 256 would overlap. This is largely a theoretical problem, I think, since I don't think that the BIOS can report a geometry > 64. The only issue that I can think of is that FreeBSD's fdisk wants to have things on cylinder boundaries, which 256 isn't, so fdisk will bitch and moan... Warner From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 04:09:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D139C1065673; Sat, 25 Jul 2009 04:09:05 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 791DB8FC17; Sat, 25 Jul 2009 04:09:05 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n6P4905s030549; Fri, 24 Jul 2009 22:09:00 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A6A855C.7090003@samsco.org> Date: Fri, 24 Jul 2009 22:09:00 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: "M. Warner Losh" References: <4A68DA56.60301@samsco.org> <20090724.233458.1683324074.imp@bsdimp.com> <4A6A7F2D.90807@samsco.org> <20090724.235420.319856209.imp@bsdimp.com> In-Reply-To: <20090724.235420.319856209.imp@bsdimp.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@freebsd.org, mav@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, cperciva@freebsd.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 04:09:06 -0000 M. Warner Losh wrote: > In message: <4A6A7F2D.90807@samsco.org> > Scott Long writes: > : M. Warner Losh wrote: > : > In message: <4A68DA56.60301@samsco.org> > : > Scott Long writes: > : > : M. Warner Losh wrote: > : > : > In message: <4A66D0F4.4030108@FreeBSD.org> > : > : > Alexander Motin writes: > : > : > : Colin Percival wrote: > : > : > : > Author: cperciva > : > : > : > Date: Wed Jul 22 03:50:54 2009 > : > : > : > New Revision: 195817 > : > : > : > URL: http://svn.freebsd.org/changeset/base/195817 > : > : > : > > : > : > : > Log: > : > : > : > Remove the "dedicated disk mode" partitioning option from sysinstall, in > : > : > : > both the disk partitioning screen (the 'F' key) and via install.cfg (the > : > : > : > VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x > : > : > : > due to libdisk and geom generating different partition names; this commit > : > : > : > merely acts to help steer users away from the breakage. > : > : > : > > : > : > : > Submitted by: randi > : > : > : > Approved by: re (kensmith) > : > : > : > > : > : > : > Modified: > : > : > : > head/usr.sbin/sysinstall/disks.c > : > : > : > : > : > : Is there any other way to not align FS block to the ugly legacy 63 > : > : > : sectors per track boundary with sysinstall now? I think RAIDs won't be > : > : > : happy. May be it would be better to fix it? > : > : > > : > : > The reason we do it like this is because the boot blocks occupy the > : > : > first cylinder group. Which with today's fake goemetry is 63 > : > : > blocks... > : > : > > : > : > : > : I already covered this. Unfortunately, Randi didn't take my bait. > : > : Anyways, '63' is a minimum, it's not a singular value. It's also > : > : an incredibly bad default. > : > > : > Yes. 256 is just as good as 63, unless the geometry reports more than > : > 256 heads, which I don't think is possible... > : > > : > Warner > : > : If there is a BIOS in existence that can't find sector 256, then it > : likely can't boot off of anything other than partition 1 in the fdisk > : table. I bet that bugs like that were likely caught 15-20 years ago. > > I think you were missing the point I was trying to make, I must have > been unclear. > > If there were more than 256 sectors in the first cylinder, then > starting at 256 would overlap. This is largely a theoretical > problem, I think, since I don't think that the BIOS can report a > geometry > 64. > > The only issue that I can think of is that FreeBSD's fdisk wants to > have things on cylinder boundaries, which 256 isn't, so fdisk will > bitch and moan... > > Warner Ah, we will never be freed of the CHS bonds, will we. Oh well. Scott From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 04:38:40 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAD4A106566C; Sat, 25 Jul 2009 04:38:40 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8B9A38FC22; Sat, 25 Jul 2009 04:38:40 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n6P4bn8D004712; Fri, 24 Jul 2009 22:37:50 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 25 Jul 2009 00:14:17 -0400 (EDT) Message-Id: <20090725.001417.-1417608789.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: <4A6A855C.7090003@samsco.org> References: <4A6A7F2D.90807@samsco.org> <20090724.235420.319856209.imp@bsdimp.com> <4A6A855C.7090003@samsco.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, mav@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, cperciva@FreeBSD.org Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 04:38:41 -0000 In message: <4A6A855C.7090003@samsco.org> Scott Long writes: : M. Warner Losh wrote: : > In message: <4A6A7F2D.90807@samsco.org> : > Scott Long writes: : > : M. Warner Losh wrote: : > : > In message: <4A68DA56.60301@samsco.org> : > : > Scott Long writes: : > : > : M. Warner Losh wrote: : > : > : > In message: <4A66D0F4.4030108@FreeBSD.org> : > : > : > Alexander Motin writes: : > : > : > : Colin Percival wrote: : > : > : > : > Author: cperciva : > : > : > : > Date: Wed Jul 22 03:50:54 2009 : > : > : > : > New Revision: 195817 : > : > : > : > URL: http://svn.freebsd.org/changeset/base/195817 : > : > : > : > : > : > : > : > Log: : > : > : > : > Remove the "dedicated disk mode" partitioning option from sysinstall, in : > : > : > : > both the disk partitioning screen (the 'F' key) and via install.cfg (the : > : > : > : > VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x : > : > : > : > due to libdisk and geom generating different partition names; this commit : > : > : > : > merely acts to help steer users away from the breakage. : > : > : > : > : > : > : > : > Submitted by: randi : > : > : > : > Approved by: re (kensmith) : > : > : > : > : > : > : > : > Modified: : > : > : > : > head/usr.sbin/sysinstall/disks.c : > : > : > : : > : > : > : Is there any other way to not align FS block to the ugly legacy 63 : > : > : > : sectors per track boundary with sysinstall now? I think RAIDs won't be : > : > : > : happy. May be it would be better to fix it? : > : > : > : > : > : > The reason we do it like this is because the boot blocks occupy the : > : > : > first cylinder group. Which with today's fake goemetry is 63 : > : > : > blocks... : > : > : > : > : > : : > : > : I already covered this. Unfortunately, Randi didn't take my bait. : > : > : Anyways, '63' is a minimum, it's not a singular value. It's also : > : > : an incredibly bad default. : > : > : > : > Yes. 256 is just as good as 63, unless the geometry reports more than : > : > 256 heads, which I don't think is possible... : > : > : > : > Warner : > : : > : If there is a BIOS in existence that can't find sector 256, then it : > : likely can't boot off of anything other than partition 1 in the fdisk : > : table. I bet that bugs like that were likely caught 15-20 years ago. : > : > I think you were missing the point I was trying to make, I must have : > been unclear. : > : > If there were more than 256 sectors in the first cylinder, then : > starting at 256 would overlap. This is largely a theoretical : > problem, I think, since I don't think that the BIOS can report a : > geometry > 64. : > : > The only issue that I can think of is that FreeBSD's fdisk wants to : > have things on cylinder boundaries, which 256 isn't, so fdisk will : > bitch and moan... : > : > Warner : : Ah, we will never be freed of the CHS bonds, will we. Oh well. Well, we could make it not bitch, except in extra picky mode :) Warner From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 06:42:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD811065676; Sat, 25 Jul 2009 06:42:42 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC2238FC15; Sat, 25 Jul 2009 06:42:42 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6P6gg5X032786; Sat, 25 Jul 2009 06:42:42 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6P6ggKw032784; Sat, 25 Jul 2009 06:42:42 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200907250642.n6P6ggKw032784@svn.freebsd.org> From: Julian Elischer Date: Sat, 25 Jul 2009 06:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195862 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 06:42:43 -0000 Author: julian Date: Sat Jul 25 06:42:42 2009 New Revision: 195862 URL: http://svn.freebsd.org/changeset/base/195862 Log: Catch ipfw up to the rest of the vimage code. It got left behind when it moved to its new location. Approved by: re (kensmith) Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Sat Jul 25 02:37:59 2009 (r195861) +++ head/sys/netinet/ipfw/ip_fw2.c Sat Jul 25 06:42:42 2009 (r195862) @@ -152,6 +152,8 @@ struct table_entry { static VNET_DEFINE(int, autoinc_step); #define V_autoinc_step VNET(autoinc_step) +static VNET_DEFINE(int, fw_deny_unknown_exthdrs); +#define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) extern int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); @@ -161,24 +163,38 @@ SYSCTL_VNET_PROC(_net_inet_ip_fw, OID_AU CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_enable), 0, ipfw_chg_hook, "I", "Enable ipfw"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, autoinc_step, - CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, "Rule number auto-increment step"); + CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, + "Rule number auto-increment step"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, one_pass, CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_one_pass), 0, "Only do a single pass through ipfw when using dummynet(4)"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, verbose, - CTLFLAG_RW | CTLFLAG_SECURE3, - &VNET_NAME(fw_verbose), 0, "Log matches to ipfw rules"); + CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_verbose), 0, + "Log matches to ipfw rules"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW, &VNET_NAME(verbose_limit), 0, "Set upper limit of matches of ipfw rules logged"); SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, default_rule, CTLFLAG_RD, - NULL, IPFW_DEFAULT_RULE, "The default/max possible rule number."); + NULL, IPFW_DEFAULT_RULE, + "The default/max possible rule number."); SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, tables_max, CTLFLAG_RD, - NULL, IPFW_TABLES_MAX, "The maximum number of tables."); + NULL, IPFW_TABLES_MAX, + "The maximum number of tables."); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, default_to_accept, CTLFLAG_RDTUN, - &default_to_accept, 0, "Make the default rule accept all packets."); + &default_to_accept, 0, + "Make the default rule accept all packets."); TUNABLE_INT("net.inet.ip.fw.default_to_accept", &default_to_accept); -#endif /* SYSCTL_NODE */ +#ifdef INET6 +SYSCTL_DECL(_net_inet6_ip6); +SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); +SYSCTL_VNET_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw6_enable), 0, + ipfw_chg_hook, "I", "Enable ipfw+6"); +SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, + CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, + "Deny packets with unknown IPv6 Extension Headers"); +#endif +#endif /* * Description of dynamic rules. @@ -277,16 +293,20 @@ static VNET_DEFINE(u_int32_t, dyn_max); #ifdef SYSCTL_NODE SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_buckets, - CTLFLAG_RW, &VNET_NAME(dyn_buckets), 0, "Number of dyn. buckets"); + CTLFLAG_RW, &VNET_NAME(dyn_buckets), 0, + "Number of dyn. buckets"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, CTLFLAG_RD, &VNET_NAME(curr_dyn_buckets), 0, "Current Number of dyn. buckets"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_count, - CTLFLAG_RD, &VNET_NAME(dyn_count), 0, "Number of dyn. rules"); + CTLFLAG_RD, &VNET_NAME(dyn_count), 0, + "Number of dyn. rules"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_max, - CTLFLAG_RW, &VNET_NAME(dyn_max), 0, "Max number of dyn. rules"); + CTLFLAG_RW, &VNET_NAME(dyn_max), 0, + "Max number of dyn. rules"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, - CTLFLAG_RD, &VNET_NAME(static_count), 0, "Number of static rules"); + CTLFLAG_RD, &VNET_NAME(static_count), 0, + "Number of static rules"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, CTLFLAG_RW, &VNET_NAME(dyn_ack_lifetime), 0, "Lifetime of dyn. rules for acks"); @@ -310,21 +330,6 @@ SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUT "Enable keepalives for dyn. rules"); #endif /* SYSCTL_NODE */ -#ifdef INET6 -/* - * IPv6 specific variables - */ -#ifdef SYSCTL_NODE -SYSCTL_DECL(_net_inet6_ip6); -#endif /* SYSCTL_NODE */ - -static struct sysctl_ctx_list ip6_fw_sysctl_ctx; -static struct sysctl_oid *ip6_fw_sysctl_tree; -#endif /* INET6 */ - -static VNET_DEFINE(int, fw_deny_unknown_exthdrs); -#define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) - /* * L3HDR maps an ipv4 pointer into a layer3 header pointer of type T * Other macros just cast void * into the appropriate type @@ -4511,17 +4516,22 @@ ipfw_ctl(struct sockopt *sopt) #undef RULE_MAXSIZE } + /* * This procedure is only used to handle keepalives. It is invoked * every dyn_keepalive_period */ static void -ipfw_tick(void * __unused unused) +ipfw_tick(void * vnetx) { struct mbuf *m0, *m, *mnext, **mtailp; int i; ipfw_dyn_rule *q; +#ifdef VIMAGE + struct vnet *vp = vnetx; +#endif + CURVNET_SET(vp); if (V_dyn_keepalive == 0 || V_ipfw_dyn_v == NULL || V_dyn_count == 0) goto done; @@ -4566,14 +4576,100 @@ ipfw_tick(void * __unused unused) } done: callout_reset(&V_ipfw_timeout, V_dyn_keepalive_period * hz, - ipfw_tick, NULL); + ipfw_tick, vnetx); + CURVNET_RESTORE(); } + + +/**************** + * Stuff that must be initialised only on boot or module load + */ int ipfw_init(void) { - struct ip_fw default_rule; + int error = 0; + + ipfw_dyn_rule_zone = uma_zcreate("IPFW dynamic rule", + sizeof(ipfw_dyn_rule), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + + IPFW_DYN_LOCK_INIT(); + /* + * Only print out this stuff the first time around, + * when called from the sysinit code. + */ + printf("ipfw2 " +#ifdef INET6 + "(+ipv6) " +#endif + "initialized, divert %s, nat %s, " + "rule-based forwarding " +#ifdef IPFIREWALL_FORWARD + "enabled, " +#else + "disabled, " +#endif + "default to %s, logging ", +#ifdef IPDIVERT + "enabled", +#else + "loadable", +#endif +#ifdef IPFIREWALL_NAT + "enabled", +#else + "loadable", +#endif + default_to_accept ? "accept" : "deny"); + + /* + * Note: V_xxx variables can be accessed here but the iattach() + * may not have been called yet for the VIMGE case. + * Tuneables will have been processed. + */ + if (V_fw_verbose == 0) + printf("disabled\n"); + else if (V_verbose_limit == 0) + printf("unlimited\n"); + else + printf("limited to %d packets/entry by default\n", + V_verbose_limit); + + /* + * Other things that are only done the first time. + * (now that we a re cuaranteed of success). + */ + ip_fw_ctl_ptr = ipfw_ctl; + ip_fw_chk_ptr = ipfw_chk; + return (error); +} + +/**************** + * Stuff that must be initialised for every instance + * (including the forst of course). + */ +static int +vnet_ipfw_init(const void *unused) +{ int error; + struct ip_fw default_rule; + + /* First set up some values that are compile time options */ +#ifdef IPFIREWALL_VERBOSE + V_fw_verbose = 1; +#endif +#ifdef IPFIREWALL_VERBOSE_LIMIT + V_verbose_limit = IPFIREWALL_VERBOSE_LIMIT; +#endif + + error = init_tables(&V_layer3_chain); + if (error) { + panic("init_tables"); /* XXX Marko fix this ! */ + } +#ifdef IPFIREWALL_NAT + LIST_INIT(&V_layer3_chain.nat); +#endif V_autoinc_step = 100; /* bounded to 1..1000 in add_rule() */ @@ -4596,127 +4692,85 @@ ipfw_init(void) V_fw_deny_unknown_exthdrs = 1; -#ifdef INET6 - /* Setup IPv6 fw sysctl tree. */ - sysctl_ctx_init(&ip6_fw_sysctl_ctx); - ip6_fw_sysctl_tree = SYSCTL_ADD_NODE(&ip6_fw_sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_net_inet6_ip6), OID_AUTO, "fw", - CTLFLAG_RW | CTLFLAG_SECURE, 0, "Firewall"); - SYSCTL_ADD_PROC(&ip6_fw_sysctl_ctx, SYSCTL_CHILDREN(ip6_fw_sysctl_tree), - OID_AUTO, "enable", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, - &V_fw6_enable, 0, ipfw_chg_hook, "I", "Enable ipfw+6"); - SYSCTL_ADD_INT(&ip6_fw_sysctl_ctx, SYSCTL_CHILDREN(ip6_fw_sysctl_tree), - OID_AUTO, "deny_unknown_exthdrs", CTLFLAG_RW | CTLFLAG_SECURE, - &V_fw_deny_unknown_exthdrs, 0, - "Deny packets with unknown IPv6 Extension Headers"); -#endif - V_layer3_chain.rules = NULL; IPFW_LOCK_INIT(&V_layer3_chain); - ipfw_dyn_rule_zone = uma_zcreate("IPFW dynamic rule", - sizeof(ipfw_dyn_rule), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - IPFW_DYN_LOCK_INIT(); callout_init(&V_ipfw_timeout, CALLOUT_MPSAFE); bzero(&default_rule, sizeof default_rule); - default_rule.act_ofs = 0; default_rule.rulenum = IPFW_DEFAULT_RULE; default_rule.cmd_len = 1; default_rule.set = RESVD_SET; - default_rule.cmd[0].len = 1; default_rule.cmd[0].opcode = default_to_accept ? O_ACCEPT : O_DENY; - error = add_rule(&V_layer3_chain, &default_rule); + if (error != 0) { printf("ipfw2: error %u initializing default rule " "(support disabled)\n", error); - IPFW_DYN_LOCK_DESTROY(); IPFW_LOCK_DESTROY(&V_layer3_chain); - uma_zdestroy(ipfw_dyn_rule_zone); + printf("leaving ipfw_iattach (1) with error %d\n", error); return (error); } ip_fw_default_rule = V_layer3_chain.rules; - printf("ipfw2 " -#ifdef INET6 - "(+ipv6) " -#endif - "initialized, divert %s, nat %s, " - "rule-based forwarding " -#ifdef IPFIREWALL_FORWARD - "enabled, " -#else - "disabled, " -#endif - "default to %s, logging ", -#ifdef IPDIVERT - "enabled", -#else - "loadable", -#endif -#ifdef IPFIREWALL_NAT - "enabled", -#else - "loadable", -#endif - - default_rule.cmd[0].opcode == O_ACCEPT ? "accept" : "deny"); -#ifdef IPFIREWALL_VERBOSE - V_fw_verbose = 1; -#endif -#ifdef IPFIREWALL_VERBOSE_LIMIT - V_verbose_limit = IPFIREWALL_VERBOSE_LIMIT; -#endif - if (V_fw_verbose == 0) - printf("disabled\n"); - else if (V_verbose_limit == 0) - printf("unlimited\n"); - else - printf("limited to %d packets/entry by default\n", - V_verbose_limit); - - error = init_tables(&V_layer3_chain); if (error) { - IPFW_DYN_LOCK_DESTROY(); IPFW_LOCK_DESTROY(&V_layer3_chain); - uma_zdestroy(ipfw_dyn_rule_zone); + printf("leaving ipfw_iattach (2) with error %d\n", error); return (error); } - ip_fw_ctl_ptr = ipfw_ctl; - ip_fw_chk_ptr = ipfw_chk; +#ifdef VIMAGE /* want a better way to do this */ + callout_reset(&V_ipfw_timeout, hz, ipfw_tick, curvnet); +#else callout_reset(&V_ipfw_timeout, hz, ipfw_tick, NULL); - LIST_INIT(&V_layer3_chain.nat); +#endif + + /* First set up some values that are compile time options */ return (0); } +/********************** + * Called for the removal of the last instance only on module unload. + */ void ipfw_destroy(void) { - struct ip_fw *reap; - ip_fw_chk_ptr = NULL; ip_fw_ctl_ptr = NULL; + uma_zdestroy(ipfw_dyn_rule_zone); + IPFW_DYN_LOCK_DESTROY(); + printf("IP firewall unloaded\n"); +} + +/*********************** + * Called for the removal of each instance. + */ +static int +vnet_ipfw_uninit(const void *unused) +{ + struct ip_fw *reap; + callout_drain(&V_ipfw_timeout); IPFW_WLOCK(&V_layer3_chain); flush_tables(&V_layer3_chain); + V_layer3_chain.reap = NULL; free_chain(&V_layer3_chain, 1 /* kill default rule */); reap = V_layer3_chain.reap; + V_layer3_chain.reap = NULL; IPFW_WUNLOCK(&V_layer3_chain); - reap_rules(reap); - IPFW_DYN_LOCK_DESTROY(); - uma_zdestroy(ipfw_dyn_rule_zone); + if (reap != NULL) + reap_rules(reap); + IPFW_LOCK_DESTROY(&V_layer3_chain); if (V_ipfw_dyn_v != NULL) free(V_ipfw_dyn_v, M_IPFW); - IPFW_LOCK_DESTROY(&V_layer3_chain); + return 0; +} -#ifdef INET6 - /* Free IPv6 fw sysctl tree. */ - sysctl_ctx_free(&ip6_fw_sysctl_ctx); -#endif +VNET_SYSINIT(vnet_ipfw_init, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, + vnet_ipfw_init, NULL); - printf("IP firewall unloaded\n"); -} +VNET_SYSUNINIT(vnet_ipfw_uninit, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, + vnet_ipfw_uninit, NULL); + + From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 08:36:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB34E106564A; Sat, 25 Jul 2009 08:36:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEF0C8FC1B; Sat, 25 Jul 2009 08:36:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6P8aSPX034937; Sat, 25 Jul 2009 08:36:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6P8aSLl034933; Sat, 25 Jul 2009 08:36:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200907250836.n6P8aSLl034933@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 25 Jul 2009 08:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195863 - in head/usr.sbin/sysinstall: . help X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 08:36:29 -0000 Author: trasz Date: Sat Jul 25 08:36:28 2009 New Revision: 195863 URL: http://svn.freebsd.org/changeset/base/195863 Log: Change the name displayed in sysinstall(8) from 'Wizard Mode' to 'Expert Mode', to make it less confusing to new users, to whom a 'wizard' is a set of simple dialogs with the 'next >>>' button. Approved by: re (kensmith) Modified: head/usr.sbin/sysinstall/disks.c head/usr.sbin/sysinstall/help/usage.hlp head/usr.sbin/sysinstall/label.c Modified: head/usr.sbin/sysinstall/disks.c ============================================================================== --- head/usr.sbin/sysinstall/disks.c Sat Jul 25 06:42:42 2009 (r195862) +++ head/usr.sbin/sysinstall/disks.c Sat Jul 25 08:36:28 2009 (r195863) @@ -206,7 +206,7 @@ print_command_summary(void) { mvprintw(14, 0, "The following commands are supported (in upper or lower case):"); mvprintw(16, 0, "A = Use Entire Disk G = set Drive Geometry C = Create Slice"); - mvprintw(17, 0, "D = Delete Slice Z = Toggle Size Units S = Set Bootable | = Wizard m."); + mvprintw(17, 0, "D = Delete Slice Z = Toggle Size Units S = Set Bootable | = Expert m."); mvprintw(18, 0, "T = Change Type U = Undo All Changes Q = Finish"); if (!RunningAsInit) mvprintw(18, 47, "W = Write Changes"); @@ -644,7 +644,7 @@ diskPartition(Device *dev) break; case '|': - if (!msgNoYes("Are you SURE you want to go into Wizard mode?\n" + if (!msgNoYes("Are you SURE you want to go into Expert mode?\n" "No seat belts whatsoever are provided!")) { clear(); refresh(); Modified: head/usr.sbin/sysinstall/help/usage.hlp ============================================================================== --- head/usr.sbin/sysinstall/help/usage.hlp Sat Jul 25 06:42:42 2009 (r195862) +++ head/usr.sbin/sysinstall/help/usage.hlp Sat Jul 25 08:36:28 2009 (r195863) @@ -52,7 +52,7 @@ that may have scrolled off the screen. Down keys to move through the saved text. To leave scroll-back mode, press the Scroll Lock key again. This feature is most useful for reading back through your boot messages (go ahead, try it now!) though -it's also useful when dealing with sub-shells or other "wizard modes" +it's also useful when dealing with sub-shells or other "expert modes" that don't use menus and tend to scroll their output off the top of the screen. Modified: head/usr.sbin/sysinstall/label.c ============================================================================== --- head/usr.sbin/sysinstall/label.c Sat Jul 25 06:42:42 2009 (r195862) +++ head/usr.sbin/sysinstall/label.c Sat Jul 25 08:36:28 2009 (r195863) @@ -1285,7 +1285,7 @@ diskLabel(Device *dev) #ifndef __ia64__ case '|': - if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n" + if (!msgNoYes("Are you sure you want to go into Expert mode?\n\n" "This is an entirely undocumented feature which you are not\n" "expected to understand!")) { int i; From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 11:10:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DCC106566B; Sat, 25 Jul 2009 11:10:02 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 060CC8FC0A; Sat, 25 Jul 2009 11:10:02 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6PBA1XS039338; Sat, 25 Jul 2009 11:10:01 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6PBA10l039335; Sat, 25 Jul 2009 11:10:01 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200907251110.n6PBA10l039335@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 25 Jul 2009 11:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195866 - in stable/7/sys: . boot/pc98/libpc98 contrib/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 11:10:02 -0000 Author: nyan Date: Sat Jul 25 11:10:01 2009 New Revision: 195866 URL: http://svn.freebsd.org/changeset/base/195866 Log: MFC: r190126 Reduce diffs against i386. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/pc98/libpc98/time.c stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/libpc98/time.c ============================================================================== --- stable/7/sys/boot/pc98/libpc98/time.c Sat Jul 25 10:22:51 2009 (r195865) +++ stable/7/sys/boot/pc98/libpc98/time.c Sat Jul 25 11:10:01 2009 (r195866) @@ -33,23 +33,21 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386.h" +static int bios_seconds(void); + /* - * Return the time in seconds since the beginning of the day. - * - * If we pass midnight, don't wrap back to 0. + * Return the BIOS time-of-day value. * * XXX uses undocumented BCD support from libstand. */ - -time_t -time(time_t *t) +static int +bios_seconds(void) { - static time_t lasttime, now; int hr, minute, sec; unsigned char bios_time[6]; - + v86.ctl = 0; - v86.addr = 0x1c; /* int 0x1c, function 0 */ + v86.addr = 0x1c; /* int 0x1c, function 0 */ v86.eax = 0x0000; v86.es = VTOPSEG(bios_time); v86.ebx = VTOPOFF(bios_time); @@ -59,7 +57,20 @@ time(time_t *t) minute = bcd2bin(bios_time[4]); sec = bcd2bin(bios_time[5]); - now = hr * 3600 + minute * 60 + sec; + return (hr * 3600 + minute * 60 + sec); +} + +/* + * Return the time in seconds since the beginning of the day. + */ +time_t +time(time_t *t) +{ + static time_t lasttime; + time_t now; + + now = bios_seconds(); + if (now < lasttime) now += 24 * 3600; lasttime = now; From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 11:10:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7106106566C; Sat, 25 Jul 2009 11:10:51 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A44708FC25; Sat, 25 Jul 2009 11:10:51 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6PBApdH039395; Sat, 25 Jul 2009 11:10:51 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6PBApsD039393; Sat, 25 Jul 2009 11:10:51 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200907251110.n6PBApsD039393@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 25 Jul 2009 11:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195867 - in stable/6/sys: . boot/pc98/libpc98 contrib/pf dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 11:10:52 -0000 Author: nyan Date: Sat Jul 25 11:10:51 2009 New Revision: 195867 URL: http://svn.freebsd.org/changeset/base/195867 Log: MFC: r190126 Reduce diffs against i386. Modified: stable/6/sys/ (props changed) stable/6/sys/boot/pc98/libpc98/time.c stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/pc98/libpc98/time.c ============================================================================== --- stable/6/sys/boot/pc98/libpc98/time.c Sat Jul 25 11:10:01 2009 (r195866) +++ stable/6/sys/boot/pc98/libpc98/time.c Sat Jul 25 11:10:51 2009 (r195867) @@ -33,23 +33,21 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386.h" +static int bios_seconds(void); + /* - * Return the time in seconds since the beginning of the day. - * - * If we pass midnight, don't wrap back to 0. + * Return the BIOS time-of-day value. * * XXX uses undocumented BCD support from libstand. */ - -time_t -time(time_t *t) +static int +bios_seconds(void) { - static time_t lasttime, now; int hr, minute, sec; unsigned char bios_time[6]; - + v86.ctl = 0; - v86.addr = 0x1c; /* int 0x1c, function 0 */ + v86.addr = 0x1c; /* int 0x1c, function 0 */ v86.eax = 0x0000; v86.es = VTOPSEG(bios_time); v86.ebx = VTOPOFF(bios_time); @@ -59,7 +57,20 @@ time(time_t *t) minute = bcd2bin(bios_time[4]); sec = bcd2bin(bios_time[5]); - now = hr * 3600 + minute * 60 + sec; + return (hr * 3600 + minute * 60 + sec); +} + +/* + * Return the time in seconds since the beginning of the day. + */ +time_t +time(time_t *t) +{ + static time_t lasttime; + time_t now; + + now = bios_seconds(); + if (now < lasttime) now += 24 * 3600; lasttime = now; From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 14:48:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDEE11065670; Sat, 25 Jul 2009 14:48:57 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9D738FC0A; Sat, 25 Jul 2009 14:48:57 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6PEmvFk043616; Sat, 25 Jul 2009 14:48:57 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6PEmvDM043608; Sat, 25 Jul 2009 14:48:57 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200907251448.n6PEmvDM043608@svn.freebsd.org> From: Jamie Gritton Date: Sat, 25 Jul 2009 14:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195870 - in head: lib/libjail sys/compat/linux sys/kern sys/sys usr.sbin/jail usr.sbin/jls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 14:48:58 -0000 Author: jamie Date: Sat Jul 25 14:48:57 2009 New Revision: 195870 URL: http://svn.freebsd.org/changeset/base/195870 Log: Some jail parameters (in particular, "ip4" and "ip6" for IP address restrictions) were found to be inadequately described by a boolean. Define a new parameter type with three values (disable, new, inherit) to handle these and future cases. Approved by: re (kib), bz (mentor) Discussed with: rwatson Modified: head/lib/libjail/jail.c head/lib/libjail/jail.h head/sys/compat/linux/linux_mib.c head/sys/kern/kern_jail.c head/sys/sys/jail.h head/usr.sbin/jail/jail.8 head/usr.sbin/jls/jls.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Sat Jul 25 14:33:21 2009 (r195869) +++ head/lib/libjail/jail.c Sat Jul 25 14:48:57 2009 (r195870) @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); #define ARRAY_SLOP 5 +static int jailparam_import_enum(const char **values, int nvalues, + const char *valstr, size_t valsize, int *value); static int jailparam_vlist(struct jailparam **jpp, va_list ap); static int jailparam_type(struct jailparam *jp); static char *noname(const char *name); @@ -61,6 +63,9 @@ static char *nononame(const char *name); char jail_errmsg[JAIL_ERRMSGLEN]; +static const char *bool_values[] = { "false", "true" }; +static const char *jailsys_values[] = { "disable", "new", "inherit" }; + /* * Import a null-terminated parameter list and set a jail with the flags @@ -140,7 +145,6 @@ int jailparam_all(struct jailparam **jpp) { struct jailparam *jp; - char *nname; size_t mlen1, mlen2, buflen; int njp, nlist; int mib1[CTL_MAXNAME], mib2[CTL_MAXNAME - 2]; @@ -182,6 +186,8 @@ jailparam_all(struct jailparam **jpp) "sysctl(0.1): %s", strerror(errno)); goto error; } + if (buf[buflen - 2] == '.') + buf[buflen - 2] = '\0'; /* Add the parameter to the list */ if (njp >= nlist) { nlist *= 2; @@ -197,17 +203,6 @@ jailparam_all(struct jailparam **jpp) njp++; goto error; } - /* Convert nobool parameters to bool. */ - if (jp[njp].jp_flags & JP_NOBOOL) { - nname = nononame(jp[njp].jp_name); - if (nname == NULL) { - njp++; - goto error; - } - free(jp[njp].jp_name); - jp[njp].jp_name = nname; - jp[njp].jp_flags ^= JP_BOOL | JP_NOBOOL; - } mib1[1] = 2; } jp = realloc(jp, njp * sizeof(*jp)); @@ -285,14 +280,31 @@ jailparam_import(struct jailparam *jp, c switch (jp->jp_ctltype & CTLTYPE) { case CTLTYPE_INT: if (jp->jp_flags & (JP_BOOL | JP_NOBOOL)) { - if (!strncasecmp(avalue, "true", 4)) - ((int *)jp->jp_value)[i] = 1; - else if (!strncasecmp(avalue, "false", 5)) - ((int *)jp->jp_value)[i] = 0; - else { + if (!jailparam_import_enum(bool_values, 2, + avalue, fw, &((int *)jp->jp_value)[i])) { snprintf(jail_errmsg, - JAIL_ERRMSGLEN, - "%s: unknown boolean value \"%.*s\"", + JAIL_ERRMSGLEN, "%s: " + "unknown boolean value \"%.*s\"", + jp->jp_name, fw, avalue); + errno = EINVAL; + goto error; + } + break; + } + if (jp->jp_flags & JP_JAILSYS) { + /* + * Allow setting a jailsys parameter to "new" + * in a booleanesque fashion. + */ + if (value[0] == '\0') + ((int *)jp->jp_value)[i] = JAIL_SYS_NEW; + else if (!jailparam_import_enum(jailsys_values, + sizeof(jailsys_values) / + sizeof(jailsys_values[0]), avalue, fw, + &((int *)jp->jp_value)[i])) { + snprintf(jail_errmsg, + JAIL_ERRMSGLEN, "%s: " + "unknown jailsys value \"%.*s\"", jp->jp_name, fw, avalue); errno = EINVAL; goto error; @@ -373,6 +385,23 @@ jailparam_import(struct jailparam *jp, c return (-1); } +static int +jailparam_import_enum(const char **values, int nvalues, const char *valstr, + size_t valsize, int *value) +{ + char *ep; + int i; + + for (i = 0; i < nvalues; i++) + if (valsize == strlen(values[i]) && + !strncasecmp(valstr, values[i], valsize)) { + *value = i; + return 1; + } + *value = strtol(valstr, &ep, 10); + return (ep == valstr + valsize); +} + /* * Put a name and value into a jail parameter element, copying the value * but not altering it. @@ -428,6 +457,15 @@ jailparam_set(struct jailparam *jp, unsi } } else { + /* + * Try to fill in missing values with an empty string. + */ + if (jp[j].jp_value == NULL && jp[j].jp_valuelen > 0 && + jailparam_import(jp + j, "") < 0) { + njp = j; + jid = -1; + goto done; + } jiov[i].iov_base = jp[j].jp_value; jiov[i].iov_len = (jp[j].jp_ctltype & CTLTYPE) == CTLTYPE_STRING @@ -632,7 +670,7 @@ jailparam_export(struct jailparam *jp) { char *value, *tvalue, **values; size_t valuelen; - int i, nval; + int i, nval, ival; char valbuf[INET6_ADDRSTRLEN]; if (!jp->jp_ctltype && jailparam_type(jp) < 0) @@ -655,14 +693,21 @@ jailparam_export(struct jailparam *jp) for (i = 0; i < nval; i++) { switch (jp->jp_ctltype & CTLTYPE) { case CTLTYPE_INT: - if (jp->jp_flags & (JP_BOOL | JP_NOBOOL)) { - strlcpy(valbuf, - ((int *)jp->jp_value)[i] ? "true" : "false", + ival = ((int *)jp->jp_value)[i]; + if ((jp->jp_flags & (JP_BOOL | JP_NOBOOL)) && + (unsigned)ival < 2) { + strlcpy(valbuf, bool_values[ival], + sizeof(valbuf)); + break; + } + if ((jp->jp_flags & JP_JAILSYS) && + (unsigned)ival < sizeof(jailsys_values) / + sizeof(jailsys_values[0])) { + strlcpy(valbuf, jailsys_values[ival], sizeof(valbuf)); break; } - snprintf(valbuf, sizeof(valbuf), "%d", - ((int *)jp->jp_value)[i]); + snprintf(valbuf, sizeof(valbuf), "%d", ival); break; case CTLTYPE_UINT: snprintf(valbuf, sizeof(valbuf), "%u", @@ -688,7 +733,7 @@ jailparam_export(struct jailparam *jp) valbuf, sizeof(valbuf)) == NULL) { strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN); - + return (NULL); } break; @@ -698,7 +743,7 @@ jailparam_export(struct jailparam *jp) valbuf, sizeof(valbuf)) == NULL) { strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN); - + return (NULL); } break; @@ -846,11 +891,13 @@ jailparam_type(struct jailparam *jp) } } } + unknown_parameter: snprintf(jail_errmsg, JAIL_ERRMSGLEN, "unknown parameter: %s", jp->jp_name); errno = ENOENT; return (-1); } + mib_desc: mib[1] = 4; desclen = sizeof(desc); if (sysctl(mib, (miblen / sizeof(int)) + 2, &desc, &desclen, @@ -873,8 +920,9 @@ jailparam_type(struct jailparam *jp) switch (desc.i & CTLTYPE) { case CTLTYPE_INT: if (desc.s[0] == 'B') - jp->jp_flags |= - (desc.s[1] == 'N') ? JP_NOBOOL : JP_BOOL; + jp->jp_flags |= JP_BOOL; + else if (!strcmp(desc.s, "E,jailsys")) + jp->jp_flags |= JP_JAILSYS; case CTLTYPE_UINT: jp->jp_valuelen = sizeof(int); break; @@ -916,41 +964,21 @@ jailparam_type(struct jailparam *jp) } break; case CTLTYPE_NODE: - /* - * A node isn't normally a parameter, but may be a boolean - * if its "no" counterpart exists. - */ - nname = noname(jp->jp_name); - if (nname == NULL) - return (-1); - mib[1] = 3; - snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", nname); - free(nname); - miblen = sizeof(mib) - 2 * sizeof(int); - if (sysctl(mib, 2, mib + 2, &miblen, desc.s, - strlen(desc.s)) < 0) { - snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "unknown parameter: %s", jp->jp_name); - return (-1); - } - mib[1] = 4; - desclen = sizeof(desc); - if (sysctl(mib, (miblen / sizeof(int)) + 2, &desc, &desclen, + /* A node might be described by an empty-named child. */ + mib[1] = 1; + mib[(miblen / sizeof(int)) + 2] = + mib[(miblen / sizeof(int)) + 1] - 1; + miblen += sizeof(int); + desclen = sizeof(desc.s); + if (sysctl(mib, (miblen / sizeof(int)) + 2, desc.s, &desclen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(0.4.%s): %s", desc.s, strerror(errno)); - return (-1); - } - if ((desc.i & CTLTYPE) != CTLTYPE_INT || desc.s[0] != 'B') { - snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "unknown parameter: %s", jp->jp_name); - errno = ENOENT; + "sysctl(0.1): %s", strerror(errno)); return (-1); } - jp->jp_valuelen = sizeof(int); - jp->jp_ctltype = desc.i; - jp->jp_flags |= JP_BOOL; - break; + if (desc.s[desclen - 2] != '.') + goto unknown_parameter; + goto mib_desc; default: snprintf(jail_errmsg, JAIL_ERRMSGLEN, "unknown type for %s", jp->jp_name); Modified: head/lib/libjail/jail.h ============================================================================== --- head/lib/libjail/jail.h Sat Jul 25 14:33:21 2009 (r195869) +++ head/lib/libjail/jail.h Sat Jul 25 14:48:57 2009 (r195870) @@ -32,6 +32,7 @@ #define JP_RAWVALUE 0x01 #define JP_BOOL 0x02 #define JP_NOBOOL 0x04 +#define JP_JAILSYS 0x08 #define JAIL_ERRMSGLEN 1024 Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Sat Jul 25 14:33:21 2009 (r195869) +++ head/sys/compat/linux/linux_mib.c Sat Jul 25 14:48:57 2009 (r195870) @@ -237,12 +237,14 @@ linux_prison_create(void *obj, void *dat { struct prison *pr = obj; struct vfsoptlist *opts = data; + int jsys; - if (vfs_flagopt(opts, "nolinux", NULL, 0)) + if (vfs_copyopt(opts, "linux", &jsys, sizeof(jsys)) == 0 && + jsys == JAIL_SYS_INHERIT) return (0); /* * Inherit a prison's initial values from its parent - * (different from NULL which also inherits changes). + * (different from JAIL_SYS_INHERIT which also inherits changes). */ return linux_alloc_prison(pr, NULL); } @@ -252,11 +254,16 @@ linux_prison_check(void *obj __unused, v { struct vfsoptlist *opts = data; char *osname, *osrelease; - int error, len, osrel, oss_version; + int error, jsys, len, osrel, oss_version; /* Check that the parameters are correct. */ - (void)vfs_flagopt(opts, "linux", NULL, 0); - (void)vfs_flagopt(opts, "nolinux", NULL, 0); + error = vfs_copyopt(opts, "linux", &jsys, sizeof(jsys)); + if (error != ENOENT) { + if (error != 0) + return (error); + if (jsys != JAIL_SYS_NEW && jsys != JAIL_SYS_INHERIT) + return (EINVAL); + } error = vfs_getopt(opts, "linux.osname", (void **)&osname, &len); if (error != ENOENT) { if (error != 0) @@ -296,33 +303,40 @@ linux_prison_set(void *obj, void *data) struct prison *pr = obj; struct vfsoptlist *opts = data; char *osname, *osrelease; - int error, gotversion, len, nolinux, oss_version, yeslinux; + int error, gotversion, jsys, len, oss_version; /* Set the parameters, which should be correct. */ - yeslinux = vfs_flagopt(opts, "linux", NULL, 0); - nolinux = vfs_flagopt(opts, "nolinux", NULL, 0); + error = vfs_copyopt(opts, "linux", &jsys, sizeof(jsys)); + if (error == ENOENT) + jsys = -1; error = vfs_getopt(opts, "linux.osname", (void **)&osname, &len); if (error == ENOENT) osname = NULL; else - yeslinux = 1; + jsys = JAIL_SYS_NEW; error = vfs_getopt(opts, "linux.osrelease", (void **)&osrelease, &len); if (error == ENOENT) osrelease = NULL; else - yeslinux = 1; + jsys = JAIL_SYS_NEW; error = vfs_copyopt(opts, "linux.oss_version", &oss_version, sizeof(oss_version)); - gotversion = (error == 0); - yeslinux |= gotversion; - if (nolinux) { - /* "nolinux": inherit the parent's Linux info. */ + if (error == ENOENT) + gotversion = 0; + else { + gotversion = 1; + jsys = JAIL_SYS_NEW; + } + switch (jsys) { + case JAIL_SYS_INHERIT: + /* "linux=inherit": inherit the parent's Linux info. */ mtx_lock(&pr->pr_mtx); osd_jail_del(pr, linux_osd_jail_slot); mtx_unlock(&pr->pr_mtx); - } else if (yeslinux) { + break; + case JAIL_SYS_NEW: /* - * "linux" or "linux.*": + * "linux=new" or "linux.*": * the prison gets its own Linux info. */ error = linux_alloc_prison(pr, &lpr); @@ -348,9 +362,7 @@ linux_prison_set(void *obj, void *data) return (0); } -SYSCTL_JAIL_PARAM_NODE(linux, "Jail Linux parameters"); -SYSCTL_JAIL_PARAM(, nolinux, CTLTYPE_INT | CTLFLAG_RW, - "BN", "Jail w/ no Linux parameters"); +SYSCTL_JAIL_PARAM_SYS_NODE(linux, CTLFLAG_RW, "Jail Linux parameters"); SYSCTL_JAIL_PARAM_STRING(_linux, osname, CTLFLAG_RW, LINUX_MAX_UTSNAME, "Jail Linux kernel OS name"); SYSCTL_JAIL_PARAM_STRING(_linux, osrelease, CTLFLAG_RW, LINUX_MAX_UTSNAME, @@ -371,15 +383,22 @@ linux_prison_get(void *obj, void *data) /* See if this prison is the one with the Linux info. */ lpr = linux_find_prison(pr, &ppr); - i = (ppr == pr); + i = (ppr == pr) ? JAIL_SYS_NEW : JAIL_SYS_INHERIT; error = vfs_setopt(opts, "linux", &i, sizeof(i)); if (error != 0 && error != ENOENT) goto done; - i = !i; - error = vfs_setopt(opts, "nolinux", &i, sizeof(i)); - if (error != 0 && error != ENOENT) - goto done; if (i) { + error = vfs_setopts(opts, "linux.osname", lpr->pr_osname); + if (error != 0 && error != ENOENT) + goto done; + error = vfs_setopts(opts, "linux.osrelease", lpr->pr_osrelease); + if (error != 0 && error != ENOENT) + goto done; + error = vfs_setopt(opts, "linux.oss_version", + &lpr->pr_oss_version, sizeof(lpr->pr_oss_version)); + if (error != 0 && error != ENOENT) + goto done; + } else { /* * If this prison is inheriting its Linux info, report * empty/zero parameters. @@ -394,17 +413,6 @@ linux_prison_get(void *obj, void *data) sizeof(lpr->pr_oss_version)); if (error != 0 && error != ENOENT) goto done; - } else { - error = vfs_setopts(opts, "linux.osname", lpr->pr_osname); - if (error != 0 && error != ENOENT) - goto done; - error = vfs_setopts(opts, "linux.osrelease", lpr->pr_osrelease); - if (error != 0 && error != ENOENT) - goto done; - error = vfs_setopt(opts, "linux.oss_version", - &lpr->pr_oss_version, sizeof(lpr->pr_oss_version)); - if (error != 0 && error != ENOENT) - goto done; } error = 0; Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sat Jul 25 14:33:21 2009 (r195869) +++ head/sys/kern/kern_jail.c Sat Jul 25 14:48:57 2009 (r195870) @@ -120,29 +120,26 @@ static int prison_restrict_ip6(struct pr */ static char *pr_flag_names[] = { [0] = "persist", - "host", -#ifdef INET - "ip4", -#endif -#ifdef INET6 - [3] = "ip6", -#endif -#ifdef VIMAGE - [4] = "vnet", -#endif }; static char *pr_flag_nonames[] = { [0] = "nopersist", - "nohost", +}; + +struct jailsys_flags { + const char *name; + unsigned disable; + unsigned new; +} pr_flag_jailsys[] = { + { "host", 0, PR_HOST }, +#ifdef VIMAGE + { "vnet", 0, PR_VNET }, +#endif #ifdef INET - "noip4", + { "ip4", PR_IP4_USER | PR_IP4_DISABLE, PR_IP4_USER }, #endif #ifdef INET6 - [3] = "noip6", -#endif -#ifdef VIMAGE - [4] = "novnet", + { "ip6", PR_IP6_USER | PR_IP6_DISABLE, PR_IP6_USER }, #endif }; @@ -478,7 +475,8 @@ kern_jail_set(struct thread *td, struct unsigned long hid; size_t namelen, onamelen; int created, cuflags, descend, enforce, error, errmsg_len, errmsg_pos; - int gotchildmax, gotenforce, gothid, gotslevel, fi, jid, len, level; + int gotchildmax, gotenforce, gothid, gotslevel; + int fi, jid, jsys, len, level; int childmax, slevel, vfslocked; #if defined(INET) || defined(INET6) int ii, ij; @@ -569,6 +567,34 @@ kern_jail_set(struct thread *td, struct vfs_flagopt(opts, pr_flag_nonames[fi], &ch_flags, 1 << fi); } ch_flags |= pr_flags; + for (fi = 0; fi < sizeof(pr_flag_jailsys) / sizeof(pr_flag_jailsys[0]); + fi++) { + error = vfs_copyopt(opts, pr_flag_jailsys[fi].name, &jsys, + sizeof(jsys)); + if (error == ENOENT) + continue; + if (error != 0) + goto done_free; + switch (jsys) { + case JAIL_SYS_DISABLE: + if (!pr_flag_jailsys[fi].disable) { + error = EINVAL; + goto done_free; + } + pr_flags |= pr_flag_jailsys[fi].disable; + break; + case JAIL_SYS_NEW: + pr_flags |= pr_flag_jailsys[fi].new; + break; + case JAIL_SYS_INHERIT: + break; + default: + error = EINVAL; + goto done_free; + } + ch_flags |= + pr_flag_jailsys[fi].new | pr_flag_jailsys[fi].disable; + } if ((flags & (JAIL_CREATE | JAIL_UPDATE | JAIL_ATTACH)) == JAIL_CREATE && !(pr_flags & PR_PERSIST)) { error = EINVAL; @@ -684,16 +710,18 @@ kern_jail_set(struct thread *td, struct #ifdef INET error = vfs_getopt(opts, "ip4.addr", &op, &ip4s); if (error == ENOENT) - ip4s = -1; + ip4s = (pr_flags & PR_IP4_DISABLE) ? 0 : -1; else if (error != 0) goto done_free; else if (ip4s & (sizeof(*ip4) - 1)) { error = EINVAL; goto done_free; } else { - ch_flags |= PR_IP4_USER; - pr_flags |= PR_IP4_USER; - if (ip4s > 0) { + ch_flags |= PR_IP4_USER | PR_IP4_DISABLE; + if (ip4s == 0) + pr_flags |= PR_IP4_USER | PR_IP4_DISABLE; + else { + pr_flags = (pr_flags & ~PR_IP4_DISABLE) | PR_IP4_USER; ip4s /= sizeof(*ip4); if (ip4s > jail_max_af_ips) { error = EINVAL; @@ -745,16 +773,18 @@ kern_jail_set(struct thread *td, struct #ifdef INET6 error = vfs_getopt(opts, "ip6.addr", &op, &ip6s); if (error == ENOENT) - ip6s = -1; + ip6s = (pr_flags & PR_IP6_DISABLE) ? 0 : -1; else if (error != 0) goto done_free; else if (ip6s & (sizeof(*ip6) - 1)) { error = EINVAL; goto done_free; } else { - ch_flags |= PR_IP6_USER; - pr_flags |= PR_IP6_USER; - if (ip6s > 0) { + ch_flags |= PR_IP6_USER | PR_IP6_DISABLE; + if (ip6s == 0) + pr_flags |= PR_IP6_USER | PR_IP6_DISABLE; + else { + pr_flags = (pr_flags & ~PR_IP6_DISABLE) | PR_IP6_USER; ip6s /= sizeof(*ip6); if (ip6s > jail_max_af_ips) { error = EINVAL; @@ -1968,6 +1998,19 @@ kern_jail_get(struct thread *td, struct if (error != 0 && error != ENOENT) goto done_deref; } + for (fi = 0; fi < sizeof(pr_flag_jailsys) / sizeof(pr_flag_jailsys[0]); + fi++) { + i = pr->pr_flags & + (pr_flag_jailsys[fi].disable | pr_flag_jailsys[fi].new); + i = pr_flag_jailsys[fi].disable && + (i == pr_flag_jailsys[fi].disable) ? JAIL_SYS_DISABLE + : (i == pr_flag_jailsys[fi].new) ? JAIL_SYS_NEW + : JAIL_SYS_INHERIT; + error = + vfs_setopt(opts, pr_flag_jailsys[fi].name, &i, sizeof(i)); + if (error != 0 && error != ENOENT) + goto done_deref; + } for (fi = 0; fi < sizeof(pr_allow_names) / sizeof(pr_allow_names[0]); fi++) { if (pr_allow_names[fi] == NULL) @@ -2614,6 +2657,7 @@ prison_restrict_ip4(struct prison *pr, s } } if (pr->pr_ip4s == 0) { + pr->pr_flags |= PR_IP4_DISABLE; free(pr->pr_ip4, M_PRISON); pr->pr_ip4 = NULL; } @@ -2918,6 +2962,7 @@ prison_restrict_ip6(struct prison *pr, s } } if (pr->pr_ip6s == 0) { + pr->pr_flags |= PR_IP6_DISABLE; free(pr->pr_ip6, M_PRISON); pr->pr_ip6 = NULL; } @@ -4035,7 +4080,7 @@ SYSCTL_JAIL_PARAM(, persist, CTLTYPE_INT "B", "Jail persistence"); #ifdef VIMAGE SYSCTL_JAIL_PARAM(, vnet, CTLTYPE_INT | CTLFLAG_RDTUN, - "B", "Virtual network stack"); + "E,jailsys", "Virtual network stack"); #endif SYSCTL_JAIL_PARAM(, dying, CTLTYPE_INT | CTLFLAG_RD, "B", "Jail is in the process of shutting down"); @@ -4046,9 +4091,7 @@ SYSCTL_JAIL_PARAM(_children, cur, CTLTYP SYSCTL_JAIL_PARAM(_children, max, CTLTYPE_INT | CTLFLAG_RW, "I", "Maximum number of child jails"); -SYSCTL_JAIL_PARAM_NODE(host, "Jail host info"); -SYSCTL_JAIL_PARAM(, nohost, CTLTYPE_INT | CTLFLAG_RW, - "BN", "Jail w/ no host info"); +SYSCTL_JAIL_PARAM_SYS_NODE(host, CTLFLAG_RW, "Jail host info"); SYSCTL_JAIL_PARAM_STRING(_host, hostname, CTLFLAG_RW, MAXHOSTNAMELEN, "Jail hostname"); SYSCTL_JAIL_PARAM_STRING(_host, domainname, CTLFLAG_RW, MAXHOSTNAMELEN, @@ -4062,16 +4105,12 @@ SYSCTL_JAIL_PARAM_NODE(cpuset, "Jail cpu SYSCTL_JAIL_PARAM(_cpuset, id, CTLTYPE_INT | CTLFLAG_RD, "I", "Jail cpuset ID"); #ifdef INET -SYSCTL_JAIL_PARAM_NODE(ip4, "Jail IPv4 address virtualization"); -SYSCTL_JAIL_PARAM(, noip4, CTLTYPE_INT | CTLFLAG_RW, - "BN", "Jail w/ no IP address virtualization"); +SYSCTL_JAIL_PARAM_SYS_NODE(ip4, CTLFLAG_RW, "Jail IPv4 address virtualization"); SYSCTL_JAIL_PARAM_STRUCT(_ip4, addr, CTLFLAG_RW, sizeof(struct in_addr), "S,in_addr,a", "Jail IPv4 addresses"); #endif #ifdef INET6 -SYSCTL_JAIL_PARAM_NODE(ip6, "Jail IPv6 address virtualization"); -SYSCTL_JAIL_PARAM(, noip6, CTLTYPE_INT | CTLFLAG_RW, - "BN", "Jail w/ no IP address virtualization"); +SYSCTL_JAIL_PARAM_SYS_NODE(ip6, CTLFLAG_RW, "Jail IPv6 address virtualization"); SYSCTL_JAIL_PARAM_STRUCT(_ip6, addr, CTLFLAG_RW, sizeof(struct in6_addr), "S,in6_addr,a", "Jail IPv6 addresses"); #endif @@ -4102,6 +4141,7 @@ db_show_prison(struct prison *pr) #if defined(INET) || defined(INET6) int ii; #endif + unsigned jsf; #ifdef INET6 char ip6buf[INET6_ADDRSTRLEN]; #endif @@ -4128,6 +4168,16 @@ db_show_prison(struct prison *pr) fi++) if (pr_flag_names[fi] != NULL && (pr->pr_flags & (1 << fi))) db_printf(" %s", pr_flag_names[fi]); + for (fi = 0; fi < sizeof(pr_flag_jailsys) / sizeof(pr_flag_jailsys[0]); + fi++) { + jsf = pr->pr_flags & + (pr_flag_jailsys[fi].disable | pr_flag_jailsys[fi].new); + db_printf(" %-16s= %s\n", pr_flag_jailsys[fi].name, + pr_flag_jailsys[fi].disable && + (jsf == pr_flag_jailsys[fi].disable) ? "disable" + : (jsf == pr_flag_jailsys[fi].new) ? "new" + : "inherit"); + } db_printf(" allow = %x", pr->pr_allow); for (fi = 0; fi < sizeof(pr_allow_names) / sizeof(pr_allow_names[0]); fi++) Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Sat Jul 25 14:33:21 2009 (r195869) +++ head/sys/sys/jail.h Sat Jul 25 14:48:57 2009 (r195870) @@ -100,6 +100,10 @@ struct xprison { #define JAIL_SET_MASK 0x0f #define JAIL_GET_MASK 0x08 +#define JAIL_SYS_DISABLE 0 +#define JAIL_SYS_NEW 1 +#define JAIL_SYS_INHERIT 2 + #ifndef _KERNEL struct iovec; @@ -182,16 +186,18 @@ struct prison { /* Flag bits set via options */ #define PR_PERSIST 0x00000001 /* Can exist without processes */ #define PR_HOST 0x00000002 /* Virtualize hostname et al */ -#define PR_IP4_USER 0x00000004 /* Virtualize IPv4 addresses */ -#define PR_IP6_USER 0x00000008 /* Virtualize IPv6 addresses */ +#define PR_IP4_USER 0x00000004 /* Restrict IPv4 addresses */ +#define PR_IP6_USER 0x00000008 /* Restrict IPv6 addresses */ #define PR_VNET 0x00000010 /* Virtual network stack */ +#define PR_IP4_DISABLE 0x00000020 /* Disable IPv4 */ +#define PR_IP6_DISABLE 0x00000040 /* Disable IPv6 */ /* Internal flag bits */ #define PR_REMOVE 0x01000000 /* In process of being removed */ -#define PR_IP4 0x02000000 /* IPv4 virtualized by this jail or */ - /* an ancestor */ -#define PR_IP6 0x04000000 /* IPv6 virtualized by this jail or */ - /* an ancestor */ +#define PR_IP4 0x02000000 /* IPv4 restricted or disabled */ + /* by this jail or an ancestor */ +#define PR_IP6 0x04000000 /* IPv6 restricted or disabled */ + /* by this jail or an ancestor */ /* Flags for pr_allow */ #define PR_ALLOW_SET_HOSTNAME 0x0001 @@ -315,7 +321,11 @@ SYSCTL_DECL(_security_jail_param); CTLTYPE_STRUCT | CTLFLAG_MPSAFE | (access), NULL, len, \ sysctl_jail_param, fmt, descr) #define SYSCTL_JAIL_PARAM_NODE(module, descr) \ - SYSCTL_NODE(_security_jail_param, OID_AUTO, module, CTLFLAG_RW, 0, descr) + SYSCTL_NODE(_security_jail_param, OID_AUTO, module, 0, 0, descr) +#define SYSCTL_JAIL_PARAM_SYS_NODE(module, access, descr) \ + SYSCTL_JAIL_PARAM_NODE(module, descr); \ + SYSCTL_JAIL_PARAM(_##module, , CTLTYPE_INT | (access), "E,jailsys", \ + descr) /* * Kernel support functions for jail(). Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sat Jul 25 14:33:21 2009 (r195869) +++ head/usr.sbin/jail/jail.8 Sat Jul 25 14:48:57 2009 (r195870) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2009 +.Dd July 25, 2009 .Dt JAIL 8 .Os .Sh NAME @@ -252,14 +252,26 @@ match. It is only possible to start multiple jails with the same IP address, if none of the jails has more than this single overlapping IP address assigned to itself. -.Pp -A list of zero elements (an empty string) will stop the jail from using IPv4 -entirely; setting the boolean parameter -.Ar noip4 -will not restrict the jail at all. -.It Va ip6.addr +.It Va ip4 +Control the availablity of IPv4 addresses. +Possible values are +.Dq inherit +to allow unrestricted access to all system addresses, +.Dq new +to restrict addresses via +.Va ip4.addr +above, and +.Dq disable +to stop the jail from using IPv4 entirely. +Setting the +.Va ip4.addr +parameter implies a value of +.Dq new . +.It Va ip6.addr , Va ip6 A list of IPv6 addresses assigned to the prison, the counterpart to -.Ar ip4.addr +.Va ip4.addr +and +.Va ip4 above. .It Va host.hostname Hostname of the prison. @@ -268,9 +280,15 @@ Other similar parameters are .Va host.hostuuid and .Va host.hostid . -Setting the boolean parameter -.Va nohost -will retain the system values of these settings. +.It Va host +Set the origin of hostname and related information. +Possible values are +.Dq inherit +to use the system information and +.Dq new +for the jail to use the information from the above fields. +Setting any of the above fields implies a value of +.Dq new . .It Va securelevel The value of the jail's .Va kern.securelevel Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Sat Jul 25 14:33:21 2009 (r195869) +++ head/usr.sbin/jls/jls.c Sat Jul 25 14:48:57 2009 (r195870) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #define PRINT_VERBOSE 0x20 static struct jailparam *params; -static int *param_noparent; +static int *param_parent; static int nparams; static int add_param(const char *name, void *value, size_t valuelen, @@ -71,7 +71,7 @@ static void quoted_print(char *str); int main(int argc, char **argv) { - char *dot, *ep, *jname, *nname; + char *dot, *ep, *jname; int c, i, jflags, jid, lastjid, pflags, spc; jname = NULL; @@ -139,17 +139,14 @@ main(int argc, char **argv) JP_USER); if (pflags & PRINT_SKIP) { - /* Check for parameters with boolean parents. */ + /* Check for parameters with jailsys parents. */ for (i = 0; i < nparams; i++) { if ((params[i].jp_flags & JP_USER) && (dot = strchr(params[i].jp_name, '.'))) { *dot = 0; - nname = noname(params[i].jp_name); + param_parent[i] = add_param(params[i].jp_name, + NULL, (size_t)0, NULL, JP_OPT); *dot = '.'; - param_noparent[i] = - add_param(nname, NULL, (size_t)0, NULL, - JP_OPT); - free(nname); } } } @@ -237,21 +234,20 @@ add_param(const char *name, void *value, if (!nparams) { paramlistsize = 32; params = malloc(paramlistsize * sizeof(*params)); - param_noparent = - malloc(paramlistsize * sizeof(*param_noparent)); - if (params == NULL || param_noparent == NULL) + param_parent = malloc(paramlistsize * sizeof(*param_parent)); + if (params == NULL || param_parent == NULL) err(1, "malloc"); } else if (nparams >= paramlistsize) { paramlistsize *= 2; params = realloc(params, paramlistsize * sizeof(*params)); - param_noparent = realloc(param_noparent, - paramlistsize * sizeof(*param_noparent)); - if (params == NULL || param_noparent == NULL) + param_parent = realloc(param_parent, + paramlistsize * sizeof(*param_parent)); + if (params == NULL || param_parent == NULL) err(1, "realloc"); } /* Look up the parameter. */ - param_noparent[nparams] = -1; + param_parent[nparams] = -1; param = params + nparams++; if (source != NULL) { *param = *source; @@ -387,8 +383,9 @@ print_jail(int pflags, int jflags) if ((pflags & PRINT_SKIP) && ((!(params[i].jp_ctltype & (CTLFLAG_WR | CTLFLAG_TUN))) || - (param_noparent[i] >= 0 && - *(int *)params[param_noparent[i]].jp_value))) + (param_parent[i] >= 0 && + *(int *)params[param_parent[i]].jp_value != + JAIL_SYS_NEW))) continue; if (spc) putchar(' '); From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 17:40:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 531C6106564A; Sat, 25 Jul 2009 17:40:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 415C38FC12; Sat, 25 Jul 2009 17:40:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6PHeo8S046909; Sat, 25 Jul 2009 17:40:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6PHeoX8046907; Sat, 25 Jul 2009 17:40:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907251740.n6PHeoX8046907@svn.freebsd.org> From: Alexander Motin Date: Sat, 25 Jul 2009 17:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195872 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 17:40:50 -0000 Author: mav Date: Sat Jul 25 17:40:49 2009 New Revision: 195872 URL: http://svn.freebsd.org/changeset/base/195872 Log: Add ahci and siis drivers to NOTES. Approved by: re (implicitly) Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Jul 25 15:47:57 2009 (r195871) +++ head/sys/conf/NOTES Sat Jul 25 17:40:49 2009 (r195872) @@ -1638,6 +1638,15 @@ options MFI_DEBUG device twe # 3ware ATA RAID # +# Serial ATA host controllers: +# +# ahci: Advanced Host Controller Interface (AHCI) compatible +# siis: SiliconImage SiI3124/SiI3132/SiI3531 controllers + +device ahci +device siis + +# # The 'ATA' driver supports all ATA and ATAPI devices, including PC Card # devices. You only need one "device ata" for it to find all # PCI and PC Card ATA/ATAPI devices on modern machines. From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 18:11:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F09DD1065670; Sat, 25 Jul 2009 18:11:55 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEA6D8FC24; Sat, 25 Jul 2009 18:11:55 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6PIBtbE047531; Sat, 25 Jul 2009 18:11:55 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6PIBtbG047529; Sat, 25 Jul 2009 18:11:55 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200907251811.n6PIBtbG047529@svn.freebsd.org> From: Tim Kientzle Date: Sat, 25 Jul 2009 18:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195873 - head/lib/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 18:11:56 -0000 Author: kientzle Date: Sat Jul 25 18:11:55 2009 New Revision: 195873 URL: http://svn.freebsd.org/changeset/base/195873 Log: Libarchive recognizes hardlinked files on ISO images, but returned them incorrectly, causing tar to actually erase the resulting file while trying to restore the link. This one-line fix corrects the hardlink descriptions to avoid this problem. Thanks to Jung-uk Kim for pointing this out. Approved by: re (kib) Modified: head/lib/libarchive/archive_read_support_format_iso9660.c Modified: head/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_iso9660.c Sat Jul 25 17:40:49 2009 (r195872) +++ head/lib/libarchive/archive_read_support_format_iso9660.c Sat Jul 25 18:11:55 2009 (r195873) @@ -579,6 +579,7 @@ archive_read_format_iso9660_read_header( && file->size > 0) { archive_entry_set_hardlink(entry, iso9660->previous_pathname.s); + archive_entry_unset_size(entry); iso9660->entry_bytes_remaining = 0; iso9660->entry_sparse_offset = 0; release_file(iso9660, file); From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 18:19:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 149901065672; Sat, 25 Jul 2009 18:19:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E837F8FC18; Sat, 25 Jul 2009 18:19:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6PIJVQM047697; Sat, 25 Jul 2009 18:19:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6PIJV8j047695; Sat, 25 Jul 2009 18:19:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907251819.n6PIJV8j047695@svn.freebsd.org> From: Alexander Motin Date: Sat, 25 Jul 2009 18:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195874 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 18:19:32 -0000 Author: mav Date: Sat Jul 25 18:19:31 2009 New Revision: 195874 URL: http://svn.freebsd.org/changeset/base/195874 Log: PMP provides 16 targets (15 drives + itself). Approved by: re (implicitly) Modified: head/share/man/man4/ahci.4 Modified: head/share/man/man4/ahci.4 ============================================================================== --- head/share/man/man4/ahci.4 Sat Jul 25 18:11:55 2009 (r195873) +++ head/share/man/man4/ahci.4 Sat Jul 25 18:19:31 2009 (r195874) @@ -87,7 +87,7 @@ This driver provides the CAM subsystem w .Tn SATA ports of AHCI-compatible controllers. Each SATA port found is represented to CAM as a separate bus with one -target, or, if HBA supports Port Multipliers, 15 targets. +target, or, if HBA supports Port Multipliers, 16 targets. Most of the bus-management details are handled by the SATA-specific transport of CAM. Connected ATA disks are handled by the ATA protocol disk peripheral driver From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 18:45:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC3921065670; Sat, 25 Jul 2009 18:45:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAAEB8FC17; Sat, 25 Jul 2009 18:45:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6PIj9b4048198; Sat, 25 Jul 2009 18:45:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6PIj95D048196; Sat, 25 Jul 2009 18:45:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907251845.n6PIj95D048196@svn.freebsd.org> From: Alexander Motin Date: Sat, 25 Jul 2009 18:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195875 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 18:45:10 -0000 Author: mav Date: Sat Jul 25 18:45:09 2009 New Revision: 195875 URL: http://svn.freebsd.org/changeset/base/195875 Log: Add note, that ahci(4) and siis(4) supersede ata(4) drivers. Approved by: re (implicitly) Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Jul 25 18:19:31 2009 (r195874) +++ head/sys/conf/NOTES Sat Jul 25 18:45:09 2009 (r195875) @@ -1642,6 +1642,9 @@ device twe # 3ware ATA RAID # # ahci: Advanced Host Controller Interface (AHCI) compatible # siis: SiliconImage SiI3124/SiI3132/SiI3531 controllers +# +# These drivers are part of cam(4) subsystem. They supersede less featured +# ata(4) subsystem drivers, supporting same hardware. device ahci device siis From owner-svn-src-all@FreeBSD.ORG Sat Jul 25 21:07:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A5851065670; Sat, 25 Jul 2009 21:07:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18A698FC08; Sat, 25 Jul 2009 21:07:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6PL7ukI051172; Sat, 25 Jul 2009 21:07:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6PL7u9G051170; Sat, 25 Jul 2009 21:07:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200907252107.n6PL7u9G051170@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 25 Jul 2009 21:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195878 - head/tools/regression/poll X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 21:07:57 -0000 Author: kib Date: Sat Jul 25 21:07:56 2009 New Revision: 195878 URL: http://svn.freebsd.org/changeset/base/195878 Log: Fix syntax error, makefile comments start with #. Submitted by: bde Approved by: re (kensmith) Modified: head/tools/regression/poll/Makefile Modified: head/tools/regression/poll/Makefile ============================================================================== --- head/tools/regression/poll/Makefile Sat Jul 25 20:26:54 2009 (r195877) +++ head/tools/regression/poll/Makefile Sat Jul 25 21:07:56 2009 (r195878) @@ -1,4 +1,4 @@ -$ $FreeBSD$ +# $FreeBSD$ # This makefile has been uglified for portability. # Nothing yet works with gmake for the path to the sources. .PATH: ..