From owner-svn-src-stable-7@FreeBSD.ORG Sun Sep 6 15:23:03 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA33E106566C; Sun, 6 Sep 2009 15:23:03 +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 B8CDC8FC0A; Sun, 6 Sep 2009 15:23:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n86FN3Ob087455; Sun, 6 Sep 2009 15:23:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n86FN3QP087453; Sun, 6 Sep 2009 15:23:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909061523.n86FN3QP087453@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Sep 2009 15:23:03 +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: r196894 - stable/7/sys/vm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2009 15:23:03 -0000 Author: kib Date: Sun Sep 6 15:23:03 2009 New Revision: 196894 URL: http://svn.freebsd.org/changeset/base/196894 Log: Partial MFC of r194459 by thompsa, without merge recording, to allow the vm_phys_paddr_to_vm_page(9) to return NULL instead of panicking when supplied physical address does not correspond to a vm page. This is needed for device pager (and not yet merged sg pager) to skip memattr checks on specific addresses. Reported by: Thierry Herbelot Modified: stable/7/sys/vm/vm_phys.c Modified: stable/7/sys/vm/vm_phys.c ============================================================================== --- stable/7/sys/vm/vm_phys.c Sun Sep 6 14:23:26 2009 (r196893) +++ stable/7/sys/vm/vm_phys.c Sun Sep 6 15:23:03 2009 (r196894) @@ -382,8 +382,7 @@ vm_phys_paddr_to_vm_page(vm_paddr_t pa) if (pa >= seg->start && pa < seg->end) return (&seg->first_page[atop(pa - seg->start)]); } - panic("vm_phys_paddr_to_vm_page: paddr %#jx is not in any segment", - (uintmax_t)pa); + return (NULL); } /* From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 7 08:37:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85D73106566B; Mon, 7 Sep 2009 08:37:25 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5D08FC0A; Mon, 7 Sep 2009 08:37:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n878bPNV008237; Mon, 7 Sep 2009 08:37:25 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n878bP79008232; Mon, 7 Sep 2009 08:37:25 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909070837.n878bP79008232@svn.freebsd.org> From: Attilio Rao Date: Mon, 7 Sep 2009 08:37:25 +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: r196912 - in stable/7/sys: kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 08:37:25 -0000 Author: attilio Date: Mon Sep 7 08:37:25 2009 New Revision: 196912 URL: http://svn.freebsd.org/changeset/base/196912 Log: MFC r196334: Add the macro ASSERT_ATOMIC_LOAD_PTR(), enabled through INVARIANTS, which asserts for the correct alignment of datas which need to be read atomically without locks. Use that macro in locking primitives. Modified: stable/7/sys/kern/kern_mutex.c stable/7/sys/kern/kern_rwlock.c stable/7/sys/kern/kern_sx.c stable/7/sys/sys/systm.h Modified: stable/7/sys/kern/kern_mutex.c ============================================================================== --- stable/7/sys/kern/kern_mutex.c Mon Sep 7 06:37:44 2009 (r196911) +++ stable/7/sys/kern/kern_mutex.c Mon Sep 7 08:37:25 2009 (r196912) @@ -724,6 +724,9 @@ mtx_init(struct mtx *m, const char *name MPASS((opts & ~(MTX_SPIN | MTX_QUIET | MTX_RECURSE | MTX_NOWITNESS | MTX_DUPOK | MTX_NOPROFILE)) == 0); + ASSERT_ATOMIC_LOAD_PTR(m->mtx_lock, + ("%s: mtx_lock not aligned for %s:%p", __func__, name, + &m->mtx_lock)); #ifdef MUTEX_DEBUG /* Diagnostic and error correction */ Modified: stable/7/sys/kern/kern_rwlock.c ============================================================================== --- stable/7/sys/kern/kern_rwlock.c Mon Sep 7 06:37:44 2009 (r196911) +++ stable/7/sys/kern/kern_rwlock.c Mon Sep 7 08:37:25 2009 (r196912) @@ -137,6 +137,9 @@ rw_init_flags(struct rwlock *rw, const c MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET | RW_RECURSE)) == 0); + ASSERT_ATOMIC_LOAD_PTR(rw->rw_lock, + ("%s: rw_lock not aligned for %s:%p", __func__, name, + &rw->rw_lock)); flags = LO_UPGRADABLE | LO_RECURSABLE; if (opts & RW_DUPOK) Modified: stable/7/sys/kern/kern_sx.c ============================================================================== --- stable/7/sys/kern/kern_sx.c Mon Sep 7 06:37:44 2009 (r196911) +++ stable/7/sys/kern/kern_sx.c Mon Sep 7 08:37:25 2009 (r196912) @@ -166,6 +166,9 @@ sx_init_flags(struct sx *sx, const char MPASS((opts & ~(SX_QUIET | SX_RECURSE | SX_NOWITNESS | SX_DUPOK | SX_NOPROFILE | SX_ADAPTIVESPIN)) == 0); + ASSERT_ATOMIC_LOAD_PTR(sx->sx_lock, + ("%s: sx_lock not aligned for %s:%p", __func__, description, + &sx->sx_lock)); flags = LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE; if (opts & SX_DUPOK) Modified: stable/7/sys/sys/systm.h ============================================================================== --- stable/7/sys/sys/systm.h Mon Sep 7 06:37:44 2009 (r196911) +++ stable/7/sys/sys/systm.h Mon Sep 7 08:37:25 2009 (r196912) @@ -96,6 +96,17 @@ extern int maxusers; /* system tune hin #endif /* + * Assert that a pointer can be loaded from memory atomically. + * + * This assertion enforces stronger alignment than necessary. For example, + * on some architectures, atomicity for unaligned loads will depend on + * whether or not the load spans multiple cache lines. + */ +#define ASSERT_ATOMIC_LOAD_PTR(var, msg) \ + KASSERT(sizeof(var) == sizeof(void *) && \ + ((uintptr_t)&(var) & (sizeof(void *) - 1)) == 0, msg) + +/* * XXX the hints declarations are even more misplaced than most declarations * in this file, since they are needed in one file (per arch) and only used * in two files. From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 7 08:41:14 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3086106566C; Mon, 7 Sep 2009 08:41:14 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D200F8FC14; Mon, 7 Sep 2009 08:41:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n878fEHu008348; Mon, 7 Sep 2009 08:41:14 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n878fE6M008345; Mon, 7 Sep 2009 08:41:14 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909070841.n878fE6M008345@svn.freebsd.org> From: Attilio Rao Date: Mon, 7 Sep 2009 08:41: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: r196913 - stable/7/lib/libthr/thread X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 08:41:15 -0000 Author: attilio Date: Mon Sep 7 08:41:14 2009 New Revision: 196913 URL: http://svn.freebsd.org/changeset/base/196913 Log: MFC r195403: Fix a bug in read lock acquisition for rwlocks by bumping rdlock_count when a successfull rwlock_rdlock_common() take place. Modified: stable/7/lib/libthr/thread/thr_rtld.c stable/7/lib/libthr/thread/thr_rwlock.c Modified: stable/7/lib/libthr/thread/thr_rtld.c ============================================================================== --- stable/7/lib/libthr/thread/thr_rtld.c Mon Sep 7 08:37:25 2009 (r196912) +++ stable/7/lib/libthr/thread/thr_rtld.c Mon Sep 7 08:41:14 2009 (r196913) @@ -116,6 +116,7 @@ _thr_rtld_rlock_acquire(void *lock) THR_CRITICAL_ENTER(curthread); while (_thr_rwlock_rdlock(&l->lock, 0, NULL) != 0) ; + curthread->rdlock_count++; RESTORE_ERRNO(); } @@ -150,6 +151,7 @@ _thr_rtld_lock_release(void *lock) state = l->lock.rw_state; if (_thr_rwlock_unlock(&l->lock) == 0) { + curthread->rdlock_count--; if ((state & URWLOCK_WRITE_OWNER) == 0) { THR_CRITICAL_LEAVE(curthread); } else { Modified: stable/7/lib/libthr/thread/thr_rwlock.c ============================================================================== --- stable/7/lib/libthr/thread/thr_rwlock.c Mon Sep 7 08:37:25 2009 (r196912) +++ stable/7/lib/libthr/thread/thr_rwlock.c Mon Sep 7 08:41:14 2009 (r196913) @@ -177,10 +177,11 @@ rwlock_rdlock_common(pthread_rwlock_t *r /* if interrupted, try to lock it in userland again. */ if (_thr_rwlock_tryrdlock(&prwlock->lock, flags) == 0) { ret = 0; - curthread->rdlock_count++; break; } } + if (ret == 0) + curthread->rdlock_count++; return (ret); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 7 08:46:27 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03E69106566B; Mon, 7 Sep 2009 08:46:27 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1B0C8FC16; Mon, 7 Sep 2009 08:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n878kQAQ008511; Mon, 7 Sep 2009 08:46:26 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n878kQLe008508; Mon, 7 Sep 2009 08:46:26 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909070846.n878kQLe008508@svn.freebsd.org> From: Attilio Rao Date: Mon, 7 Sep 2009 08:46:26 +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: r196914 - stable/7/usr.sbin/tzsetup X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 08:46:27 -0000 Author: attilio Date: Mon Sep 7 08:46:26 2009 New Revision: 196914 URL: http://svn.freebsd.org/changeset/base/196914 Log: MFC r195339: Add a new option (-s) that, when specified, skips the question about adjusting the clock to UTC. Sponsored by: Sandvine Incorporated Modified: stable/7/usr.sbin/tzsetup/tzsetup.8 stable/7/usr.sbin/tzsetup/tzsetup.c Modified: stable/7/usr.sbin/tzsetup/tzsetup.8 ============================================================================== --- stable/7/usr.sbin/tzsetup/tzsetup.8 Mon Sep 7 08:41:14 2009 (r196913) +++ stable/7/usr.sbin/tzsetup/tzsetup.8 Mon Sep 7 08:46:26 2009 (r196914) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 24, 1996 +.Dd September 05, 2009 .Dt TZSETUP 8 .Os .Sh NAME @@ -31,7 +31,7 @@ .Nd set local timezone .Sh SYNOPSIS .Nm -.Op Fl n +.Op Fl ns .Op Ar default .Sh DESCRIPTION The @@ -51,6 +51,9 @@ The following option is available: .Bl -tag -offset indent -width Fl .It Fl n Do not create or copy files. +.It Fl s +Skip the initial question about adjusting the clock if not set to +.Tn UTC . .El .Pp It is possible to short-circuit the menu system by specifying a Modified: stable/7/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/7/usr.sbin/tzsetup/tzsetup.c Mon Sep 7 08:41:14 2009 (r196913) +++ stable/7/usr.sbin/tzsetup/tzsetup.c Mon Sep 7 08:46:26 2009 (r196914) @@ -648,11 +648,14 @@ main(int argc, char **argv) dialog_utc = dialog_noyes; #endif - while ((c = getopt(argc, argv, "n")) != -1) { + while ((c = getopt(argc, argv, "ns")) != -1) { switch(c) { case 'n': reallydoit = 0; break; + case 's': + dialog_utc = NULL; + break; default: usage(); @@ -671,22 +674,25 @@ main(int argc, char **argv) make_menus(); init_dialog(); - if (!dialog_utc("Select local or UTC (Greenwich Mean Time) clock", - "Is this machine's CMOS clock set to UTC? If it is set to local time,\n" - "or you don't know, please choose NO here!", 7, 72)) { - if (reallydoit) - unlink(_PATH_WALL_CMOS_CLOCK); - } else { - if (reallydoit) { - fd = open(_PATH_WALL_CMOS_CLOCK, - O_WRONLY|O_CREAT|O_TRUNC, - S_IRUSR|S_IRGRP|S_IROTH); - if (fd < 0) - err(1, "create %s", _PATH_WALL_CMOS_CLOCK); - close(fd); + if (dialog_utc != NULL) { + if (!dialog_utc("Select local or UTC (Greenwich Mean Time) clock", + "Is this machine's CMOS clock set to UTC? If it is set to local time,\n" + "or you don't know, please choose NO here!", 7, 72)) { + if (reallydoit) + unlink(_PATH_WALL_CMOS_CLOCK); + } else { + if (reallydoit) { + fd = open(_PATH_WALL_CMOS_CLOCK, + O_WRONLY|O_CREAT|O_TRUNC, + S_IRUSR|S_IRGRP|S_IROTH); + if (fd < 0) + err(1, "create %s", + _PATH_WALL_CMOS_CLOCK); + close(fd); + } } + dialog_clear_norefresh(); } - dialog_clear_norefresh(); if (optind == argc - 1) { char *msg; asprintf(&msg, "\nUse the default `%s' zone?", argv[optind]); From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 7 08:52:15 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEFC01065679; Mon, 7 Sep 2009 08:52:15 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C31F98FC13; Mon, 7 Sep 2009 08:52:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n878qFLJ008671; Mon, 7 Sep 2009 08:52:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n878qFds008667; Mon, 7 Sep 2009 08:52:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909070852.n878qFds008667@svn.freebsd.org> From: Attilio Rao Date: Mon, 7 Sep 2009 08:52:15 +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: r196915 - in stable/7/sys: dev/hwpmc kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 08:52:16 -0000 Author: attilio Date: Mon Sep 7 08:52:15 2009 New Revision: 196915 URL: http://svn.freebsd.org/changeset/base/196915 Log: MFC r195159 and r195005: * Don't assume a fixed number of preloaded KLDs but calculate at runtime. This avoind ending up into an endless loop. * Fix a LOR between pmc_sx and allproc/proctree locks Sponsored by: Sandvine Incorporated Modified: stable/7/sys/dev/hwpmc/hwpmc_logging.c stable/7/sys/dev/hwpmc/hwpmc_mod.c stable/7/sys/kern/kern_linker.c Modified: stable/7/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_logging.c Mon Sep 7 08:46:26 2009 (r196914) +++ stable/7/sys/dev/hwpmc/hwpmc_logging.c Mon Sep 7 08:52:15 2009 (r196915) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -552,6 +553,12 @@ pmclog_configure_log(struct pmc_mdep *md int error; struct proc *p; + /* + * As long as it is possible to get a LOR between pmc_sx lock and + * proctree/allproc sx locks used for adding a new process, assure + * the former is not held here. + */ + sx_assert(&pmc_sx, SA_UNLOCKED); PMCDBG(LOG,CFG,1, "config po=%p logfd=%d", po, logfd); p = po->po_owner; Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_mod.c Mon Sep 7 08:46:26 2009 (r196914) +++ stable/7/sys/dev/hwpmc/hwpmc_mod.c Mon Sep 7 08:52:15 2009 (r196915) @@ -2666,7 +2666,7 @@ static const char *pmc_op_to_name[] = { static int pmc_syscall_handler(struct thread *td, void *syscall_args) { - int error, is_sx_downgraded, op; + int error, is_sx_downgraded, is_sx_locked, op; struct pmc_syscall_args *c; void *arg; @@ -2675,6 +2675,7 @@ pmc_syscall_handler(struct thread *td, v DROP_GIANT(); is_sx_downgraded = 0; + is_sx_locked = 1; c = (struct pmc_syscall_args *) syscall_args; @@ -2723,9 +2724,11 @@ pmc_syscall_handler(struct thread *td, v * a log file configured, flush its buffers and * de-configure it. */ - if (cl.pm_logfd >= 0) + if (cl.pm_logfd >= 0) { + sx_xunlock(&pmc_sx); + is_sx_locked = 0; error = pmclog_configure_log(md, po, cl.pm_logfd); - else if (po->po_flags & PMC_PO_OWNS_LOGFILE) { + } else if (po->po_flags & PMC_PO_OWNS_LOGFILE) { pmclog_process_closelog(po); error = pmclog_flush(po); if (error == 0) { @@ -3776,10 +3779,12 @@ pmc_syscall_handler(struct thread *td, v break; } - if (is_sx_downgraded) - sx_sunlock(&pmc_sx); - else - sx_xunlock(&pmc_sx); + if (is_sx_locked != 0) { + if (is_sx_downgraded) + sx_sunlock(&pmc_sx); + else + sx_xunlock(&pmc_sx); + } if (error) atomic_add_int(&pmc_stats.pm_syscall_errors, 1); Modified: stable/7/sys/kern/kern_linker.c ============================================================================== --- stable/7/sys/kern/kern_linker.c Mon Sep 7 08:46:26 2009 (r196914) +++ stable/7/sys/kern/kern_linker.c Mon Sep 7 08:52:15 2009 (r196915) @@ -1882,62 +1882,41 @@ linker_basename(const char *path) } #ifdef HWPMC_HOOKS - -struct hwpmc_context { - int nobjects; - int nmappings; - struct pmckern_map_in *kobase; -}; - -static int -linker_hwpmc_list_object(linker_file_t lf, void *arg) -{ - struct hwpmc_context *hc; - - hc = arg; - - /* If we run out of mappings, fail. */ - if (hc->nobjects >= hc->nmappings) - return (1); - - /* Save the info for this linker file. */ - hc->kobase[hc->nobjects].pm_file = lf->filename; - hc->kobase[hc->nobjects].pm_address = (uintptr_t)lf->address; - hc->nobjects++; - return (0); -} - /* * Inform hwpmc about the set of kernel modules currently loaded. */ void * linker_hwpmc_list_objects(void) { - struct hwpmc_context hc; + linker_file_t lf; + struct pmckern_map_in *kobase; + int i, nmappings; - hc.nmappings = 15; /* a reasonable default */ + nmappings = 0; + KLD_LOCK(); + TAILQ_FOREACH(lf, &linker_files, link) + nmappings++; - retry: - /* allocate nmappings+1 entries */ - MALLOC(hc.kobase, struct pmckern_map_in *, - (hc.nmappings + 1) * sizeof(struct pmckern_map_in), M_LINKER, - M_WAITOK | M_ZERO); - - hc.nobjects = 0; - if (linker_file_foreach(linker_hwpmc_list_object, &hc) != 0) { - hc.nmappings = hc.nobjects; - FREE(hc.kobase, M_LINKER); - goto retry; + /* Allocate nmappings + 1 entries. */ + kobase = malloc((nmappings + 1) * sizeof(struct pmckern_map_in), + M_LINKER, M_WAITOK | M_ZERO); + i = 0; + TAILQ_FOREACH(lf, &linker_files, link) { + + /* Save the info for this linker file. */ + kobase[i].pm_file = lf->filename; + kobase[i].pm_address = (uintptr_t)lf->address; + i++; } + KLD_UNLOCK(); - KASSERT(hc.nobjects > 0, ("linker_hpwmc_list_objects: no kernel " - "objects?")); + KASSERT(i > 0, ("linker_hwpmc_list_objects: no kernel objects?")); /* The last entry of the malloced area comprises of all zeros. */ - KASSERT(hc.kobase[hc.nobjects].pm_file == NULL, + KASSERT(kobase[i].pm_file == NULL, ("linker_hwpmc_list_objects: last object not NULL")); - return ((void *)hc.kobase); + return ((void *)kobase); } #endif From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 7 09:51:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9A111065672; Mon, 7 Sep 2009 09:51:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6B058FC2A; Mon, 7 Sep 2009 09:51:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n879pNtm010179; Mon, 7 Sep 2009 09:51:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n879pNst010173; Mon, 7 Sep 2009 09:51:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909070951.n879pNst010173@svn.freebsd.org> From: Attilio Rao Date: Mon, 7 Sep 2009 09:51:23 +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: r196917 - in stable/7: bin/ps sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 09:51:24 -0000 Author: attilio Date: Mon Sep 7 09:51:23 2009 New Revision: 196917 URL: http://svn.freebsd.org/changeset/base/196917 Log: MFC r189078: * Implement ucomm with a dynamic size function in order to print out the threads name also in the case they are not the last one shown. * On AMD64 pointers don't have enough space to be printed. Fix it. * Check a return value for malloc which wasn't checked before Sponsored by: Sandvine Incorporated Modified: stable/7/bin/ps/extern.h stable/7/bin/ps/keyword.c stable/7/bin/ps/print.c stable/7/bin/ps/ps.c stable/7/sys/kern/kern_proc.c Modified: stable/7/bin/ps/extern.h ============================================================================== --- stable/7/bin/ps/extern.h Mon Sep 7 09:30:37 2009 (r196916) +++ stable/7/bin/ps/extern.h Mon Sep 7 09:51:23 2009 (r196917) @@ -39,7 +39,7 @@ extern fixpt_t ccpu; extern int cflag, eval, fscale, nlistread, rawcpu; extern unsigned long mempages; extern time_t now; -extern int sumrusage, termwidth, totwidth; +extern int showthreads, sumrusage, termwidth, totwidth; extern STAILQ_HEAD(velisthead, varent) varlist; __BEGIN_DECLS @@ -71,6 +71,7 @@ void priorityr(KINFO *, VARENT *); void rgroupname(KINFO *, VARENT *); void runame(KINFO *, VARENT *); void rvar(KINFO *, VARENT *); +int s_comm(KINFO *); int s_label(KINFO *); int s_rgroupname(KINFO *); int s_runame(KINFO *); Modified: stable/7/bin/ps/keyword.c ============================================================================== --- stable/7/bin/ps/keyword.c Mon Sep 7 09:30:37 2009 (r196916) +++ stable/7/bin/ps/keyword.c Mon Sep 7 09:51:23 2009 (r196917) @@ -79,8 +79,8 @@ static VAR var[] = { CHAR, NULL, 0}, {"blocked", "", "sigmask", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"caught", "", "sigcatch", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"comm", "COMMAND", NULL, LJUST, ucomm, NULL, MAXCOMLEN, 0, CHAR, - NULL, 0}, + {"comm", "COMMAND", NULL, LJUST|DSIZ, ucomm, s_comm, + COMMLEN + OCOMMLEN + 1, 0, CHAR, NULL, 0}, {"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16, 0, CHAR, NULL, 0}, {"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d", @@ -135,12 +135,13 @@ static VAR var[] = { LONG, "ld", 0}, {"nvcsw", "NVCSW", NULL, USER, rvar, NULL, 5, ROFF(ru_nvcsw), LONG, "ld", 0}, - {"nwchan", "NWCHAN", NULL, LJUST, nwchan, NULL, 8, 0, CHAR, NULL, 0}, + {"nwchan", "NWCHAN", NULL, LJUST, nwchan, NULL, sizeof(void *) * 2, 0, + CHAR, NULL, 0}, {"oublk", "OUBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_oublock), LONG, "ld", 0}, {"oublock", "", "oublk", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"paddr", "PADDR", NULL, 0, kvar, NULL, 8, KOFF(ki_paddr), KPTR, - "lx", 0}, + {"paddr", "PADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, + KOFF(ki_paddr), KPTR, "lx", 0}, {"pagein", "PAGEIN", NULL, USER, pagein, NULL, 6, 0, CHAR, NULL, 0}, {"pcpu", "", "%cpu", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"pending", "", "sig", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, @@ -194,13 +195,13 @@ static VAR var[] = { {"tsiz", "TSIZ", NULL, 0, kvar, NULL, 4, KOFF(ki_tsize), PGTOK, "ld", 0}, {"tt", "TT ", NULL, 0, tname, NULL, 4, 0, CHAR, NULL, 0}, {"tty", "TTY", NULL, LJUST, longtname, NULL, 8, 0, CHAR, NULL, 0}, - {"ucomm", "UCOMM", NULL, LJUST, ucomm, NULL, MAXCOMLEN, 0, CHAR, NULL, - 0}, + {"ucomm", "UCOMM", NULL, LJUST|DSIZ, ucomm, s_comm, + COMMLEN + OCOMMLEN + 1, 0, CHAR, NULL, 0}, {"uid", "UID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_uid), UINT, UIDFMT, 0}, {"upr", "UPR", NULL, 0, upr, NULL, 3, 0, CHAR, NULL, 0}, - {"uprocp", "UPROCP", NULL, 0, kvar, NULL, 8, KOFF(ki_paddr), KPTR, - "lx", 0}, + {"uprocp", "UPROCP", NULL, 0, kvar, NULL, sizeof(void *) * 2, + KOFF(ki_paddr), KPTR, "lx", 0}, {"user", "USER", NULL, LJUST|DSIZ, uname, s_uname, USERLEN, 0, CHAR, NULL, 0}, {"usrpri", "", "upr", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, @@ -324,6 +325,8 @@ findvar(char *p, int user, char **header */ rflen = strlen(v->alias) + strlen(hp) + 2; realfmt = malloc(rflen); + if (realfmt == NULL) + errx(1, "malloc failed"); snprintf(realfmt, rflen, "%s=%s", v->alias, hp); parsefmt(realfmt, user); } Modified: stable/7/bin/ps/print.c ============================================================================== --- stable/7/bin/ps/print.c Mon Sep 7 09:30:37 2009 (r196916) +++ stable/7/bin/ps/print.c Mon Sep 7 09:51:23 2009 (r196917) @@ -186,6 +186,7 @@ command(KINFO *k, VARENT *ve) void ucomm(KINFO *k, VARENT *ve) { + char tmpbuff[COMMLEN + OCOMMLEN + 2]; VAR *v; v = ve->var; @@ -193,8 +194,15 @@ ucomm(KINFO *k, VARENT *ve) if (k->ki_d.prefix) (void)printf("%s", k->ki_d.prefix); (void)printf("%s", k->ki_p->ki_comm); - } else - (void)printf("%-*s", v->width, k->ki_p->ki_comm); + } else { + bzero(tmpbuff, sizeof(tmpbuff)); + if (showthreads && k->ki_p->ki_numthreads > 1) + sprintf(tmpbuff, "%s/%s", k->ki_p->ki_comm, + k->ki_p->ki_ocomm); + else + sprintf(tmpbuff, "%s", k->ki_p->ki_comm); + (void)printf("%-*s", v->width, tmpbuff); + } } void @@ -822,6 +830,20 @@ out: } int +s_comm(KINFO *k) +{ + char tmpbuff[COMMLEN + OCOMMLEN + 2]; + + bzero(tmpbuff, sizeof(tmpbuff)); + if (showthreads && k->ki_p->ki_numthreads > 1) + sprintf(tmpbuff, "%s/%s", k->ki_p->ki_comm, + k->ki_p->ki_ocomm); + else + sprintf(tmpbuff, "%s", k->ki_p->ki_comm); + return (strlen(tmpbuff)); +} + +int s_label(KINFO *k) { char *string = NULL; Modified: stable/7/bin/ps/ps.c ============================================================================== --- stable/7/bin/ps/ps.c Mon Sep 7 09:30:37 2009 (r196916) +++ stable/7/bin/ps/ps.c Mon Sep 7 09:51:23 2009 (r196917) @@ -100,6 +100,7 @@ int rawcpu; /* -C */ int sumrusage; /* -S */ int termwidth; /* Width of the screen (0 == infinity). */ int totwidth; /* Calculated-width of requested variables. */ +int showthreads; /* will threads be shown? */ struct velisthead varlist = STAILQ_HEAD_INITIALIZER(varlist); @@ -178,7 +179,7 @@ main(int argc, char *argv[]) char *cols; int all, ch, elem, flag, _fmt, i, lineno; int descendancy, nentries, nkept, nselectors; - int prtheader, showthreads, wflag, what, xkeep, xkeep_implied; + int prtheader, wflag, what, xkeep, xkeep_implied; char errbuf[_POSIX2_LINE_MAX]; (void) setlocale(LC_ALL, ""); Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Mon Sep 7 09:30:37 2009 (r196916) +++ stable/7/sys/kern/kern_proc.c Mon Sep 7 09:51:23 2009 (r196917) @@ -115,6 +115,7 @@ MALLOC_DEFINE(M_SUBPROC, "subproc", "Pro static void doenterpgrp(struct proc *, struct pgrp *); static void orphanpg(struct pgrp *pg); +static void fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp); static void fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp); static void fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread); @@ -670,6 +671,30 @@ DB_SHOW_COMMAND(pgrpdump, pgrpdump) #endif /* DDB */ /* + * Rework the kinfo_proc members which need to be aggregated in the + * case of process-ware informations. + * Must be called with the target spinlock process held. + */ +static void +fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp) +{ + struct thread *td; + + PROC_SLOCK_ASSERT(p, MA_OWNED); + + kp->ki_estcpu = 0; + kp->ki_pctcpu = 0; + kp->ki_runtime = 0; + FOREACH_THREAD_IN_PROC(p, td) { + thread_lock(td); + kp->ki_pctcpu += sched_pctcpu(td); + kp->ki_runtime += cputick2usec(td->td_runtime); + kp->ki_estcpu += td->td_estcpu; + thread_unlock(td); + } +} + +/* * Clear kinfo_proc and fill in any information that is common * to all threads in the process. * Must be called with the target process locked. @@ -868,14 +893,15 @@ fill_kinfo_thread(struct thread *td, str kp->ki_numthreads = p->p_numthreads; kp->ki_pcb = td->td_pcb; kp->ki_kstack = (void *)td->td_kstack; - kp->ki_pctcpu = sched_pctcpu(td); - kp->ki_estcpu = td->td_estcpu; kp->ki_slptime = (ticks - td->td_slptick) / hz; kp->ki_pri.pri_class = td->td_pri_class; kp->ki_pri.pri_user = td->td_user_pri; - if (preferthread) + if (preferthread) { kp->ki_runtime = cputick2usec(td->td_runtime); + kp->ki_pctcpu = sched_pctcpu(td); + kp->ki_estcpu = td->td_estcpu; + } /* We can't get this anymore but ps etc never used it anyway. */ kp->ki_rqindex = 0; @@ -895,8 +921,9 @@ fill_kinfo_proc(struct proc *p, struct k fill_kinfo_proc_only(p, kp); PROC_SLOCK(p); - if (FIRST_THREAD_IN_PROC(p) != NULL) - fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), kp, 0); + MPASS (FIRST_THREAD_IN_PROC(p) != NULL); + fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), kp, 0); + fill_kinfo_aggregate(p, kp); PROC_SUNLOCK(p); } @@ -962,28 +989,20 @@ sysctl_out_proc(struct proc *p, struct s PROC_LOCK_ASSERT(p, MA_OWNED); - fill_kinfo_proc_only(p, &kinfo_proc); - if (flags & KERN_PROC_NOTHREADS) { - PROC_SLOCK(p); - if (FIRST_THREAD_IN_PROC(p) != NULL) - fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), - &kinfo_proc, 0); - PROC_SUNLOCK(p); + fill_kinfo_proc(p, &kinfo_proc); + if (flags & KERN_PROC_NOTHREADS) error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); - } else { + sizeof(kinfo_proc)); + else { PROC_SLOCK(p); - if (FIRST_THREAD_IN_PROC(p) != NULL) - FOREACH_THREAD_IN_PROC(p, td) { - fill_kinfo_thread(td, &kinfo_proc, 1); - error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); - if (error) - break; - } - else + MPASS(FIRST_THREAD_IN_PROC(p) != NULL); + FOREACH_THREAD_IN_PROC(p, td) { + fill_kinfo_thread(td, &kinfo_proc, 1); error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); + sizeof(kinfo_proc)); + if (error) + break; + } PROC_SUNLOCK(p); } PROC_UNLOCK(p); From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 7 10:15:51 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11652106566B; Mon, 7 Sep 2009 10:15:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1BB28FC15; Mon, 7 Sep 2009 10:15:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n87AFoUg011808; Mon, 7 Sep 2009 10:15:50 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n87AFoDx011798; Mon, 7 Sep 2009 10:15:50 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200909071015.n87AFoDx011798@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 7 Sep 2009 10:15: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: r196918 - in stable/7: sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 10:15:51 -0000 Author: ume Date: Mon Sep 7 10:15:50 2009 New Revision: 196918 URL: http://svn.freebsd.org/changeset/base/196918 Log: MFC r193664, r193796, r193815: Fix and add a workaround on an issue of EtherIP packet with reversed version field sent via gif(4)+if_bridge(4). The EtherIP implementation found on FreeBSD 6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 had an interoperability issue because it sent the incorrect EtherIP packets and discarded the correct ones. Approved by: hrs Added: stable/7/sbin/ifconfig/ifgif.c - copied unchanged from r193664, head/sbin/ifconfig/ifgif.c Modified: stable/7/sbin/ifconfig/ (props changed) stable/7/sbin/ifconfig/Makefile stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/gif.4 stable/7/share/man/man4/if_bridge.4 stable/7/sys/net/ (props changed) stable/7/sys/net/if_gif.c stable/7/sys/net/if_gif.h stable/7/sys/netinet/in_gif.c stable/7/sys/netinet6/in6_gif.c stable/7/sys/sys/priv.h Modified: stable/7/sbin/ifconfig/Makefile ============================================================================== --- stable/7/sbin/ifconfig/Makefile Mon Sep 7 09:51:23 2009 (r196917) +++ stable/7/sbin/ifconfig/Makefile Mon Sep 7 10:15:50 2009 (r196918) @@ -25,6 +25,7 @@ SRCS+= ifmedia.c # SIOC[GS]IFMEDIA supp SRCS+= ifvlan.c # SIOC[GS]ETVLAN support SRCS+= ifieee80211.c # SIOC[GS]IEEE80211 support SRCS+= ifgre.c # GRE keys etc +SRCS+= ifgif.c # GIF reversed header workaround SRCS+= ifcarp.c # SIOC[GS]VH support SRCS+= ifgroup.c # ... Copied: stable/7/sbin/ifconfig/ifgif.c (from r193664, head/sbin/ifconfig/ifgif.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sbin/ifconfig/ifgif.c Mon Sep 7 10:15:50 2009 (r196918, copy of r193664, head/sbin/ifconfig/ifgif.c) @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 2009 Hiroki Sato. 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 ``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 HIS RELATIVES 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 MIND, 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. + */ + +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "ifconfig.h" + +static void gif_status(int); + +static struct { + const char *label; + u_int mask; +} gif_opts[] = { + { "ACCEPT_REV_ETHIP_VER", GIF_ACCEPT_REVETHIP }, + { "SEND_REV_ETHIP_VER", GIF_SEND_REVETHIP }, +}; + +static void +gif_status(int s) +{ + int opts; + int nopts = 0; + int i; + + ifr.ifr_data = (caddr_t)&opts; + if (ioctl(s, GIFGOPTS, &ifr) == -1) + return; + + printf("\toptions=%d<", opts); + for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) { + if (opts & gif_opts[i].mask) { + if (nopts++) + printf(","); + printf("%s", gif_opts[i].label); + } + } + printf(">\n"); +} + +static void +setgifopts(const char *val, + int d, int s, const struct afswtch *afp) +{ + int opts; + + ifr.ifr_data = (caddr_t)&opts; + if (ioctl(s, GIFGOPTS, &ifr) == -1) { + warn("ioctl(GIFGOPTS)"); + return; + } + + if (d < 0) + opts &= ~(-d); + else + opts |= d; + + if (ioctl(s, GIFSOPTS, &ifr) == -1) { + warn("ioctl(GIFSOPTS)"); + return; + } +} + +static struct cmd gif_cmds[] = { + DEF_CMD("accept_rev_ethip_ver", GIF_ACCEPT_REVETHIP, setgifopts), + DEF_CMD("-accept_rev_ethip_ver",-GIF_ACCEPT_REVETHIP, setgifopts), + DEF_CMD("send_rev_ethip_ver", GIF_SEND_REVETHIP, setgifopts), + DEF_CMD("-send_rev_ethip_ver", -GIF_SEND_REVETHIP, setgifopts), +}; + +static struct afswtch af_gif = { + .af_name = "af_gif", + .af_af = AF_UNSPEC, + .af_other_status = gif_status, +}; + +static __constructor void +gif_ctor(void) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + int i; + + for (i = 0; i < N(gif_cmds); i++) + cmd_register(&gif_cmds[i]); + af_register(&af_gif); +#undef N +} Modified: stable/7/share/man/man4/gif.4 ============================================================================== --- stable/7/share/man/man4/gif.4 Mon Sep 7 09:51:23 2009 (r196917) +++ stable/7/share/man/man4/gif.4 Mon Sep 7 10:15:50 2009 (r196918) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 1999 +.Dd June 8, 2009 .Dt GIF 4 .Os .Sh NAME @@ -256,3 +256,32 @@ had a multi-destination behavior, config .Dv IFF_LINK0 flag. The behavior is obsolete and is no longer supported. +.Pp +On +.Fx +6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 +the +.Nm +sends and receives incorrect EtherIP packets with reversed version +field when +.Xr if_bridge 4 +is used together. As a workaround on this interoperability issue, the +following two +.Xr ifconfig 8 +flags can be used: +.Bl -tag -width "accept_rev_ethip_ver" -offset indent +.It accept_rev_ethip_ver +accepts both correct EtherIP packets and ones with reversed version +field, if enabled. If disabled, the +.Nm +accepts the correct packets only. This flag is enabled by default. +.It send_rev_ethip_ver +sends EtherIP packets with reversed version field intentionally, if +enabled. If disabled, the +.Nm +sends the correct packets only. This flag is disabled by default. +.El +.Pp +If interoperability with the older +.Fx +machines is needed, both of these two flags must be enabled. Modified: stable/7/share/man/man4/if_bridge.4 ============================================================================== --- stable/7/share/man/man4/if_bridge.4 Mon Sep 7 09:51:23 2009 (r196917) +++ stable/7/share/man/man4/if_bridge.4 Mon Sep 7 10:15:50 2009 (r196918) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2007 +.Dd June 8, 2009 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -389,6 +389,12 @@ ifconfig gif0 tunnel 1.2.3.4 5.6.7.8 up ifconfig bridge0 create ifconfig bridge0 addm fxp0 addm gif0 up .Ed +.Pp +Note that +.Fx +6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 have a bug in the EtherIP protocol. +For more details and workaround, see +.Xr gif 4 manual page. .Sh SEE ALSO .Xr gif 4 , .Xr ipf 4 , Modified: stable/7/sys/net/if_gif.c ============================================================================== --- stable/7/sys/net/if_gif.c Mon Sep 7 09:51:23 2009 (r196917) +++ stable/7/sys/net/if_gif.c Mon Sep 7 10:15:50 2009 (r196918) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -169,6 +170,7 @@ gif_clone_create(ifc, unit, params) if_initname(GIF2IFP(sc), ifc->ifc_name, unit); sc->encap_cookie4 = sc->encap_cookie6 = NULL; + sc->gif_options = GIF_ACCEPT_REVETHIP; GIF2IFP(sc)->if_addrlen = 0; GIF2IFP(sc)->if_mtu = GIF_MTU; @@ -479,6 +481,7 @@ gif_input(m, af, ifp) struct ifnet *ifp; { int isr, n; + struct gif_softc *sc = ifp->if_softc; struct etherip_header *eip; struct ether_header *eh; struct ifnet *oldifp; @@ -539,11 +542,25 @@ gif_input(m, af, ifp) } eip = mtod(m, struct etherip_header *); - if (eip->eip_ver != - (ETHERIP_VERSION & ETHERIP_VER_VERS_MASK)) { - /* discard unknown versions */ - m_freem(m); - return; + /* + * GIF_ACCEPT_REVETHIP (enabled by default) intentionally + * accepts an EtherIP packet with revered version field in + * the header. This is a knob for backward compatibility + * with FreeBSD 7.2R or prior. + */ + if (sc->gif_options & GIF_ACCEPT_REVETHIP) { + if (eip->eip_resvl != ETHERIP_VERSION + && eip->eip_ver != ETHERIP_VERSION) { + /* discard unknown versions */ + m_freem(m); + return; + } + } else { + if (eip->eip_ver != ETHERIP_VERSION) { + /* discard unknown versions */ + m_freem(m); + return; + } } m_adj(m, sizeof(struct etherip_header)); @@ -598,6 +615,7 @@ gif_ioctl(ifp, cmd, data) struct gif_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq*)data; int error = 0, size; + u_int options; struct sockaddr *dst, *src; #ifdef SIOCSIFMTU /* xxx */ u_long mtu; @@ -832,6 +850,24 @@ gif_ioctl(ifp, cmd, data) /* if_ioctl() takes care of it */ break; + case GIFGOPTS: + options = sc->gif_options; + error = copyout(&options, ifr->ifr_data, + sizeof(options)); + break; + + case GIFSOPTS: + if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0) + break; + error = copyin(ifr->ifr_data, &options, sizeof(options)); + if (error) + break; + if (options & ~GIF_OPTMASK) + error = EINVAL; + else + sc->gif_options = options; + break; + default: error = EINVAL; break; Modified: stable/7/sys/net/if_gif.h ============================================================================== --- stable/7/sys/net/if_gif.h Mon Sep 7 09:51:23 2009 (r196917) +++ stable/7/sys/net/if_gif.h Mon Sep 7 10:15:50 2009 (r196918) @@ -71,6 +71,7 @@ struct gif_softc { const struct encaptab *encap_cookie4; const struct encaptab *encap_cookie6; void *gif_netgraph; /* ng_gif(4) netgraph node info */ + u_int gif_options; LIST_ENTRY(gif_softc) gif_list; /* all gif's are linked */ }; #define GIF2IFP(sc) ((sc)->gif_ifp) @@ -94,12 +95,18 @@ struct gif_softc { #define MTAG_GIF_CALLED 0 struct etherip_header { - u_int8_t eip_ver; /* version/reserved */ - u_int8_t eip_pad; /* required padding byte */ -}; -#define ETHERIP_VER_VERS_MASK 0x0f -#define ETHERIP_VER_RSVD_MASK 0xf0 -#define ETHERIP_VERSION 0x03 +#if BYTE_ORDER == LITTLE_ENDIAN + u_int eip_resvl:4, /* reserved */ + eip_ver:4; /* version */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_int eip_ver:4, /* version */ + eip_resvl:4; /* reserved */ +#endif + u_int8_t eip_resvh; /* reserved */ +} __packed; + +#define ETHERIP_VERSION 0x3 /* mbuf adjust factor to force 32-bit alignment of IP header */ #define ETHERIP_ALIGN 2 @@ -114,4 +121,11 @@ int gif_encapcheck(const struct mbuf *, #endif /* _KERNEL */ +#define GIFGOPTS _IOWR('i', 150, struct ifreq) +#define GIFSOPTS _IOW('i', 151, struct ifreq) + +#define GIF_ACCEPT_REVETHIP 0x0001 +#define GIF_SEND_REVETHIP 0x0010 +#define GIF_OPTMASK (GIF_ACCEPT_REVETHIP|GIF_SEND_REVETHIP) + #endif /* _NET_IF_GIF_H_ */ Modified: stable/7/sys/netinet/in_gif.c ============================================================================== --- stable/7/sys/netinet/in_gif.c Mon Sep 7 09:51:23 2009 (r196917) +++ stable/7/sys/netinet/in_gif.c Mon Sep 7 10:15:50 2009 (r196918) @@ -144,8 +144,22 @@ in_gif_output(struct ifnet *ifp, int fam #endif /* INET6 */ case AF_LINK: proto = IPPROTO_ETHERIP; - eiphdr.eip_ver = ETHERIP_VERSION & ETHERIP_VER_VERS_MASK; - eiphdr.eip_pad = 0; + + /* + * GIF_SEND_REVETHIP (disabled by default) intentionally + * sends an EtherIP packet with revered version field in + * the header. This is a knob for backward compatibility + * with FreeBSD 7.2R or prior. + */ + if ((sc->gif_options & GIF_SEND_REVETHIP)) { + eiphdr.eip_ver = 0; + eiphdr.eip_resvl = ETHERIP_VERSION; + eiphdr.eip_resvh = 0; + } else { + eiphdr.eip_ver = ETHERIP_VERSION; + eiphdr.eip_resvl = 0; + eiphdr.eip_resvh = 0; + } /* prepend Ethernet-in-IP header */ M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); if (m && m->m_len < sizeof(struct etherip_header)) Modified: stable/7/sys/netinet6/in6_gif.c ============================================================================== --- stable/7/sys/netinet6/in6_gif.c Mon Sep 7 09:51:23 2009 (r196917) +++ stable/7/sys/netinet6/in6_gif.c Mon Sep 7 10:15:50 2009 (r196918) @@ -142,8 +142,22 @@ in6_gif_output(struct ifnet *ifp, #endif case AF_LINK: proto = IPPROTO_ETHERIP; - eiphdr.eip_ver = ETHERIP_VERSION & ETHERIP_VER_VERS_MASK; - eiphdr.eip_pad = 0; + + /* + * GIF_SEND_REVETHIP (disabled by default) intentionally + * sends an EtherIP packet with revered version field in + * the header. This is a knob for backward compatibility + * with FreeBSD 7.2R or prior. + */ + if ((sc->gif_options & GIF_SEND_REVETHIP)) { + eiphdr.eip_ver = 0; + eiphdr.eip_resvl = ETHERIP_VERSION; + eiphdr.eip_resvh = 0; + } else { + eiphdr.eip_ver = ETHERIP_VERSION; + eiphdr.eip_resvl = 0; + eiphdr.eip_resvh = 0; + } /* prepend Ethernet-in-IP header */ M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); if (m && m->m_len < sizeof(struct etherip_header)) Modified: stable/7/sys/sys/priv.h ============================================================================== --- stable/7/sys/sys/priv.h Mon Sep 7 09:51:23 2009 (r196917) +++ stable/7/sys/sys/priv.h Mon Sep 7 10:15:50 2009 (r196918) @@ -327,6 +327,7 @@ #define PRIV_NET_ADDIFADDR 413 /* Add protocol addr to interface. */ #define PRIV_NET_DELIFADDR 414 /* Delete protocol addr on interface. */ #define PRIV_NET_LAGG 415 /* Administer lagg interface. */ +#define PRIV_NET_GIF 416 /* Administer gif interface. */ /* * 802.11-related privileges. From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 7 12:39:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27F131065670; Mon, 7 Sep 2009 12:39:55 +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 15FC98FC0C; Mon, 7 Sep 2009 12:39:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n87CdsTA014742; Mon, 7 Sep 2009 12:39:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n87Cds3C014740; Mon, 7 Sep 2009 12:39:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909071239.n87Cds3C014740@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 7 Sep 2009 12:39: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: r196922 - in stable/7/sys: . contrib/pf net ufs/ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 12:39:55 -0000 Author: kib Date: Mon Sep 7 12:39:54 2009 New Revision: 196922 URL: http://svn.freebsd.org/changeset/base/196922 Log: MFC r196206. Take the number of allocated freeblks into consideration for softdep_slowdown(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/net/ (props changed) stable/7/sys/ufs/ffs/ffs_softdep.c Modified: stable/7/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/7/sys/ufs/ffs/ffs_softdep.c Mon Sep 7 12:10:41 2009 (r196921) +++ stable/7/sys/ufs/ffs/ffs_softdep.c Mon Sep 7 12:39:54 2009 (r196922) @@ -671,6 +671,8 @@ static int req_clear_inodedeps; /* synce static int req_clear_remove; /* syncer process flush some freeblks */ #define FLUSH_REMOVE 2 #define FLUSH_REMOVE_WAIT 3 +static long num_freeblkdep; /* number of freeblks workitems allocated */ + /* * runtime statistics */ @@ -2230,6 +2232,9 @@ softdep_setup_freeblocks(ip, length, fla freeblks->fb_uid = ip->i_uid; freeblks->fb_previousinum = ip->i_number; freeblks->fb_devvp = ip->i_devvp; + ACQUIRE_LOCK(&lk); + num_freeblkdep++; + FREE_LOCK(&lk); extblocks = 0; if (fs->fs_magic == FS_UFS2_MAGIC) extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize)); @@ -2821,6 +2826,7 @@ handle_workitem_freeblocks(freeblks, fla ACQUIRE_LOCK(&lk); WORKITEM_FREE(freeblks, D_FREEBLKS); + num_freeblkdep--; FREE_LOCK(&lk); } @@ -5748,7 +5754,8 @@ softdep_slowdown(vp) max_softdeps_hard = max_softdeps * 11 / 10; if (num_dirrem < max_softdeps_hard / 2 && num_inodedep < max_softdeps_hard && - VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirdeps) { + VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirdeps && + num_freeblkdep < max_softdeps_hard) { FREE_LOCK(&lk); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 7 13:37:04 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83D6D106568B; Mon, 7 Sep 2009 13:37:04 +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 70E968FC17; Mon, 7 Sep 2009 13:37:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n87Db4na016094; Mon, 7 Sep 2009 13:37:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n87Db4tN016089; Mon, 7 Sep 2009 13:37:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200909071337.n87Db4tN016089@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 7 Sep 2009 13:37: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: r196924 - in stable/7/sys: . amd64/amd64 compat/ia32 contrib/pf i386/i386 kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 13:37:04 -0000 Author: bz Date: Mon Sep 7 13:37:04 2009 New Revision: 196924 URL: http://svn.freebsd.org/changeset/base/196924 Log: MFC r196653: Make sure FreeBSD binaries without .note.ABI-tag section work correctly and do not match a colliding Debian GNU/kFreeBSD brandinfo statements. For this mark the Debian GNU/kFreeBSD brandinfo that it must have an .note.ABI-tag section and ignore the old EI_OSABI brandinfo when comparing a possibly colliding set of options. Due to SYSINIT we add the brandinfo in a non-deterministic order, so native FreeBSD is not always first. We may want to consider to force native FreeBSD to come first as well. The only way a problem could currently be noticed is when running an i386 binary without the .note.ABI-tag on amd64 and the Debian GNU/kFreeBSD brandinfo was matched first, as the fallback to ld-elf32.so.1 does not exist in that case. Reported and tested by: ticso In collaboration with: kib Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/elf_machdep.c stable/7/sys/compat/ia32/ia32_sysvec.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/i386/elf_machdep.c stable/7/sys/kern/imgact_elf.c stable/7/sys/sys/imgact_elf.h Modified: stable/7/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/elf_machdep.c Mon Sep 7 12:41:19 2009 (r196923) +++ stable/7/sys/amd64/amd64/elf_machdep.c Mon Sep 7 13:37:04 2009 (r196924) @@ -117,7 +117,7 @@ static Elf64_Brandinfo kfreebsd_brand_in .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_kfreebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE_MANDATORY }; SYSINIT(kelf64, SI_SUB_EXEC, SI_ORDER_ANY, Modified: stable/7/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- stable/7/sys/compat/ia32/ia32_sysvec.c Mon Sep 7 12:41:19 2009 (r196923) +++ stable/7/sys/compat/ia32/ia32_sysvec.c Mon Sep 7 13:37:04 2009 (r196924) @@ -179,7 +179,7 @@ static Elf32_Brandinfo kia32_brand_info .interp_path = "/lib/ld.so.1", .sysvec = &ia32_freebsd_sysvec, .brand_note = &elf32_kfreebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE_MANDATORY }; SYSINIT(kia32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: stable/7/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/7/sys/i386/i386/elf_machdep.c Mon Sep 7 12:41:19 2009 (r196923) +++ stable/7/sys/i386/i386/elf_machdep.c Mon Sep 7 13:37:04 2009 (r196924) @@ -116,7 +116,7 @@ static Elf32_Brandinfo kfreebsd_brand_in .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_kfreebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE_MANDATORY }; SYSINIT(kelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: stable/7/sys/kern/imgact_elf.c ============================================================================== --- stable/7/sys/kern/imgact_elf.c Mon Sep 7 12:41:19 2009 (r196923) +++ stable/7/sys/kern/imgact_elf.c Mon Sep 7 13:37:04 2009 (r196924) @@ -241,8 +241,10 @@ __elfN(get_brandinfo)(struct image_param /* Look for an ".note.ABI-tag" ELF section */ for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; - if (bi != NULL && hdr->e_machine == bi->machine && - (bi->flags & BI_BRAND_NOTE) != 0) { + if (bi == NULL) + continue; + if (hdr->e_machine == bi->machine && (bi->flags & + (BI_BRAND_NOTE|BI_BRAND_NOTE_MANDATORY)) != 0) { ret = __elfN(check_note)(imgp, bi->brand_note, osrel); if (ret) return (bi); @@ -252,7 +254,9 @@ __elfN(get_brandinfo)(struct image_param /* If the executable has a brand, search for it in the brand list. */ for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; - if (bi != NULL && hdr->e_machine == bi->machine && + if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) + continue; + if (hdr->e_machine == bi->machine && (hdr->e_ident[EI_OSABI] == bi->brand || strncmp((const char *)&hdr->e_ident[OLD_EI_BRAND], bi->compat_3_brand, strlen(bi->compat_3_brand)) == 0)) @@ -263,7 +267,9 @@ __elfN(get_brandinfo)(struct image_param if (interp != NULL) { for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; - if (bi != NULL && hdr->e_machine == bi->machine && + if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) + continue; + if (hdr->e_machine == bi->machine && strcmp(interp, bi->interp_path) == 0) return (bi); } @@ -272,7 +278,9 @@ __elfN(get_brandinfo)(struct image_param /* Lacking a recognized interpreter, try the default brand */ for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; - if (bi != NULL && hdr->e_machine == bi->machine && + if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) + continue; + if (hdr->e_machine == bi->machine && __elfN(fallback_brand) == bi->brand) return (bi); } Modified: stable/7/sys/sys/imgact_elf.h ============================================================================== --- stable/7/sys/sys/imgact_elf.h Mon Sep 7 12:41:19 2009 (r196923) +++ stable/7/sys/sys/imgact_elf.h Mon Sep 7 13:37:04 2009 (r196924) @@ -75,8 +75,9 @@ typedef struct { const char *interp_newpath; int flags; Elf_Brandnote *brand_note; -#define BI_CAN_EXEC_DYN 0x0001 -#define BI_BRAND_NOTE 0x0002 +#define BI_CAN_EXEC_DYN 0x0001 +#define BI_BRAND_NOTE 0x0002 /* May have note.ABI-tag section. */ +#define BI_BRAND_NOTE_MANDATORY 0x0004 /* Must have note.ABI-tag section. */ } __ElfN(Brandinfo); __ElfType(Auxargs); From owner-svn-src-stable-7@FreeBSD.ORG Wed Sep 9 00:15:43 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD7E81065670; Wed, 9 Sep 2009 00:15: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 BC0C18FC0A; Wed, 9 Sep 2009 00:15:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n890FhAC066122; Wed, 9 Sep 2009 00:15:43 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n890Fhnp066119; Wed, 9 Sep 2009 00:15:43 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200909090015.n890Fhnp066119@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 9 Sep 2009 00:15:43 +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: r197001 - stable/7/share/zoneinfo X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2009 00:15:43 -0000 Author: edwin Date: Wed Sep 9 00:15:43 2009 New Revision: 197001 URL: http://svn.freebsd.org/changeset/base/197001 Log: MFC from 197000: Update to tzdata2008m: Samoa will go in DST on 4 October 2009 till 28 March 2010 Palestine will go back from DST on 4 September 2009 Modified: stable/7/share/zoneinfo/ (props changed) stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/australasia Modified: stable/7/share/zoneinfo/asia ============================================================================== --- stable/7/share/zoneinfo/asia Wed Sep 9 00:07:05 2009 (r197000) +++ stable/7/share/zoneinfo/asia Wed Sep 9 00:15:43 2009 (r197001) @@ -1,5 +1,5 @@ #
-# @(#)asia	8.36
+# @(#)asia	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1836,6 +1836,42 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
 # http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
 # 
 
+# From Steffen Thorsen (2009-08-31):
+# Palestine's Council of Ministers announced that they will revert back to
+# winter time on Friday, 2009-09-04.
+#
+# One news source:
+# 
+# http://www.safa.ps/ara/?action=showdetail&seid=4158
+# 
+# (Palestinian press agency, Arabic),
+# Google translate: "Decided that the Palestinian government in Ramallah
+# headed by Salam Fayyad, the start of work in time for the winter of
+# 2009, starting on Friday approved the fourth delay Sept. clock sixty
+# minutes per hour as of Friday morning."
+#
+# We are not sure if Gaza will do the same, last year they had a different
+# end date, we will keep this page updated:
+# 
+# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
+# 
+
+# From Alexander Krivenyshev (2009-09-02):
+# Seems that Gaza Strip will go back to Winter Time same date as West Bank.
+#
+# According to Palestinian Ministry Of Interior, West Bank and Gaza Strip plan
+# to change time back to Standard time on September 4, 2009.
+#
+# "Winter time unite the West Bank and Gaza"
+# (from Palestinian National Authority):
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html
+# 
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -1854,7 +1890,7 @@ Rule Palestine	2006	only	-	Sep	22	0:00	0
 Rule Palestine	2007	only	-	Sep	Thu>=8	2:00	0	-
 Rule Palestine	2008	only	-	Aug	lastFri	2:00	0	-
 Rule Palestine	2009	max	-	Mar	lastFri	0:00	1:00	S
-Rule Palestine	2009	max	-	Sep	lastMon	2:00	0	-
+Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct

Modified: stable/7/share/zoneinfo/australasia
==============================================================================
--- stable/7/share/zoneinfo/australasia	Wed Sep  9 00:07:05 2009	(r197000)
+++ stable/7/share/zoneinfo/australasia	Wed Sep  9 00:15:43 2009	(r197001)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.12
+# @(#)australasia	8.13
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -443,10 +443,26 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 # http://www.worldtimezone.com/dst_news/dst_news_samoa01.html
 # 
 
+# From Steffen Thorsen (2009-08-27):
+# Samoa's parliament passed the Daylight Saving Bill 2009, and will start 
+# daylight saving time on the first Sunday of October 2009 and end on the 
+# last Sunday of March 2010. We hope that the full text will be published 
+# soon, but we believe that the bill is only valid for 2009-2010. Samoa's 
+# Daylight Saving Act 2009 will be enforced as soon as the Head of State 
+# executes a proclamation publicizing this Act.
+#
+# Some background information here, which will be updated once we have 
+# more details:
+# 
+# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
+# 
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
-			-11:00	-	WST			# Samoa Time
+			-11:00	-	WST	2009 Oct 4
+			-11:00	1:00	WSDT	2010 Mar 28
+			-11:00	-	WST
 
 # Solomon Is
 # excludes Bougainville, for which see Papua New Guinea

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Sep 10 11:44:51 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A0A13106566C;
	Thu, 10 Sep 2009 11:44:51 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8F6448FC0A;
	Thu, 10 Sep 2009 11:44:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8ABiptb018457;
	Thu, 10 Sep 2009 11:44:51 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8ABipTW018454;
	Thu, 10 Sep 2009 11:44:51 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200909101144.n8ABipTW018454@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 10 Sep 2009 11:44:51 +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: r197059 - stable/7/contrib/gdtoa
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 10 Sep 2009 11:44:51 -0000

Author: attilio
Date: Thu Sep 10 11:44:51 2009
New Revision: 197059
URL: http://svn.freebsd.org/changeset/base/197059

Log:
  MFC r196916:
  Fix a list overrun.
  
  Sponsored by: Sandvine Incorporated

Modified:
  stable/7/contrib/gdtoa/gdtoaimp.h
  stable/7/contrib/gdtoa/misc.c

Modified: stable/7/contrib/gdtoa/gdtoaimp.h
==============================================================================
--- stable/7/contrib/gdtoa/gdtoaimp.h	Thu Sep 10 11:27:07 2009	(r197058)
+++ stable/7/contrib/gdtoa/gdtoaimp.h	Thu Sep 10 11:44:51 2009	(r197059)
@@ -472,7 +472,7 @@ extern pthread_mutex_t __gdtoa_locks[2];
 		_pthread_mutex_unlock(&__gdtoa_locks[n]);	\
 } while(0)
 
-#define Kmax 15
+#define Kmax 9
 
  struct
 Bigint {

Modified: stable/7/contrib/gdtoa/misc.c
==============================================================================
--- stable/7/contrib/gdtoa/misc.c	Thu Sep 10 11:27:07 2009	(r197058)
+++ stable/7/contrib/gdtoa/misc.c	Thu Sep 10 11:44:51 2009	(r197059)
@@ -55,7 +55,9 @@ Balloc
 #endif
 
 	ACQUIRE_DTOA_LOCK(0);
-	if ( (rv = freelist[k]) !=0) {
+	/* The k > Kmax case does not need ACQUIRE_DTOA_LOCK(0), */
+	/* but this case seems very unlikely. */
+	if (k <= Kmax && (rv = freelist[k]) !=0) {
 		freelist[k] = rv->next;
 		}
 	else {
@@ -65,7 +67,7 @@ Balloc
 #else
 		len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
 			/sizeof(double);
-		if (pmem_next - private_mem + len <= PRIVATE_mem) {
+		if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) {
 			rv = (Bigint*)pmem_next;
 			pmem_next += len;
 			}
@@ -89,10 +91,14 @@ Bfree
 #endif
 {
 	if (v) {
-		ACQUIRE_DTOA_LOCK(0);
-		v->next = freelist[v->k];
-		freelist[v->k] = v;
-		FREE_DTOA_LOCK(0);
+		if (v->k > Kmax)
+			free((void*)v);
+		else {
+			ACQUIRE_DTOA_LOCK(0);
+			v->next = freelist[v->k];
+			freelist[v->k] = v;
+			FREE_DTOA_LOCK(0);
+			}
 		}
 	}
 

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Sep 10 13:01:23 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EA73106566B;
	Thu, 10 Sep 2009 13:01:23 +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 7C8CA8FC0A;
	Thu, 10 Sep 2009 13:01:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8AD1NW6020221;
	Thu, 10 Sep 2009 13:01:23 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8AD1NDW020218;
	Thu, 10 Sep 2009 13:01:23 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200909101301.n8AD1NDW020218@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 10 Sep 2009 13:01:23 +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: r197063 - in stable/7/sys: . contrib/pf fs/pseudofs net
	ufs/ffs
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 10 Sep 2009 13:01:23 -0000

Author: kib
Date: Thu Sep 10 13:01:23 2009
New Revision: 197063
URL: http://svn.freebsd.org/changeset/base/197063

Log:
  MFC r196920:
  insmntque_stddtr() clears vp->v_data and resets vp->v_op to
  dead_vnodeops before calling vgone(). Revert r189706 and corresponding
  part of the r186560.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/fs/pseudofs/pseudofs_vncache.c
  stable/7/sys/net/   (props changed)
  stable/7/sys/ufs/ffs/ffs_vfsops.c

Modified: stable/7/sys/fs/pseudofs/pseudofs_vncache.c
==============================================================================
--- stable/7/sys/fs/pseudofs/pseudofs_vncache.c	Thu Sep 10 12:58:37 2009	(r197062)
+++ stable/7/sys/fs/pseudofs/pseudofs_vncache.c	Thu Sep 10 13:01:23 2009	(r197063)
@@ -193,6 +193,7 @@ retry:
 	vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread);
 	error = insmntque(*vpp, mp);
 	if (error != 0) {
+		free(pvd, M_PFSVNCACHE);
 		*vpp = NULLVP;
 		return (error);
 	}

Modified: stable/7/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_vfsops.c	Thu Sep 10 12:58:37 2009	(r197062)
+++ stable/7/sys/ufs/ffs/ffs_vfsops.c	Thu Sep 10 13:01:23 2009	(r197063)
@@ -1466,6 +1466,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags
 		vp->v_vflag |= VV_FORCEINSMQ;
 	error = insmntque(vp, mp);
 	if (error != 0) {
+		uma_zfree(uma_inode, ip);
 		*vpp = NULL;
 		return (error);
 	}

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Sep 10 14:08:28 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D09A7106566C;
	Thu, 10 Sep 2009 14:08:28 +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 A4FFB8FC08;
	Thu, 10 Sep 2009 14:08:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8AE8Snf021756;
	Thu, 10 Sep 2009 14:08:28 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8AE8Skq021754;
	Thu, 10 Sep 2009 14:08:28 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200909101408.n8AE8Skq021754@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 10 Sep 2009 14:08:28 +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: r197066 - stable/7/share/man/man7
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 10 Sep 2009 14:08:28 -0000

Author: jhb
Date: Thu Sep 10 14:08:28 2009
New Revision: 197066
URL: http://svn.freebsd.org/changeset/base/197066

Log:
  MFC 196337 and 196356:
  Document SVN* and MAKE_DVD variables.

Modified:
  stable/7/share/man/man7/   (props changed)
  stable/7/share/man/man7/release.7

Modified: stable/7/share/man/man7/release.7
==============================================================================
--- stable/7/share/man/man7/release.7	Thu Sep 10 14:04:00 2009	(r197065)
+++ stable/7/share/man/man7/release.7	Thu Sep 10 14:08:28 2009	(r197066)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 12, 2006
+.Dd August 17, 2009
 .Dt RELEASE 7
 .Os
 .Sh NAME
@@ -332,6 +332,10 @@ patch file.
 A script that will be run in the
 .Xr chroot 8
 environment immediately after any local patches are applied.
+.It Va MAKE_DVD
+If defined, build a bootable ISO DVD image in the CD-ROM
+stage directory.
+This option may not be available for all architectures.
 .It Va MAKE_ISOS
 If defined, bootable ISO CD-ROM images will be created from the
 contents of the CD-ROM stage directory.
@@ -390,6 +394,35 @@ of the CVS tree
 .It Va SEPARATE_LIVEFS
 Store the live file system on its own CD-ROM image rather than placing it on
 the first disc.
+.It Va SVNCMDARGS
+Additional arguments for svn
+.Ic checkout
+and
+.Ic switch
+commands.
+.It Va SVNROOT
+The location of the FreeBSD SVN source repository.
+If this variable is set,
+then the source tree will be extracted using Subversion rather than
+CVS.
+.It Va SVNBRANCH
+The branch to check out from a SVN source repository.
+It is specified as a path such as
+.Pa head
+or
+.Pa stable/7 .
+If this variable is not set,
+then the branch that corresponds to the current value of
+.Va RELEASETAG
+will be used.
+If neither
+.Va SVNBRANCH
+nor
+.Va RELEASETAG
+are set,
+then the
+.Pa head
+branch will be used.
 .It Va TARGET_ARCH
 The target machine processor architecture.
 This is analogous to the
@@ -474,6 +507,7 @@ make release CHROOTDIR=/local3/release B
 .Xr install 1 ,
 .Xr make 1 ,
 .Xr patch 1 ,
+.Xr svn 1 Pq Pa ports/devel/subversion-freebsd ,
 .Xr uname 1 ,
 .Xr md 4 ,
 .Xr make.conf 5 ,
@@ -511,7 +545,7 @@ effort was spent getting
 into a shape where it could at least automate most of the tediousness
 of building a release in a sterile environment.
 .Pp
-With its almost 1000 revisions spread over multiple branches, the
+At near 1000 revisions spread over multiple branches, the
 .Xr cvs 1
 log of
 .Pa src/release/Makefile

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Sep 10 14:16:05 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AF69F1065676;
	Thu, 10 Sep 2009 14:16: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 9D09B8FC0C;
	Thu, 10 Sep 2009 14:16:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8AEG52C021984;
	Thu, 10 Sep 2009 14:16:05 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8AEG5jf021981;
	Thu, 10 Sep 2009 14:16:05 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200909101416.n8AEG5jf021981@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 10 Sep 2009 14:16:05 +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: r197067 - stable/7/release
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 10 Sep 2009 14:16:05 -0000

Author: jhb
Date: Thu Sep 10 14:16:05 2009
New Revision: 197067
URL: http://svn.freebsd.org/changeset/base/197067

Log:
  MFC 196221:
  Add the ability to build a release from an SVN checkout instead of a CVS
  checkout.  If SVNROOT is specified, then the source tree will be checked
  out from that SVN repository instead of using CVS.  ports and docs still
  use CVS.  If SVNROOT is not specified, then the source tree will be checked
  out using CVS.  An explicit SVN branch can be specified using SVNBRANCH
  (e.g. SVNBRANCH=stable/8).  If SVNBRANCH is not set but RELEASETAG is set
  to a CVS branch (such as RELENG_8) the appropriate SVN branch will be
  inferred from the CVS branch using svnbranch.awk.

Added:
  stable/7/release/svnbranch.awk
     - copied unchanged from r196221, head/release/svnbranch.awk
Modified:
  stable/7/release/   (props changed)
  stable/7/release/Makefile

Modified: stable/7/release/Makefile
==============================================================================
--- stable/7/release/Makefile	Thu Sep 10 14:08:28 2009	(r197066)
+++ stable/7/release/Makefile	Thu Sep 10 14:16:05 2009	(r197067)
@@ -1,7 +1,8 @@
 # $FreeBSD$
 #
 # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \
-#     [RELEASETAG=tag]
+#     [RELEASETAG=tag] [SVNROOT=svn://svn.freebsd.org/base] \
+#     [SVNBRANCH=some/branch]
 #
 # Where "/some/dir" is the pathname of a directory on a some filesystem with
 # at least 1000MB of free space, "somename" is what you want the release to
@@ -9,6 +10,11 @@
 # which CVS "tag" name should be used when checking out the sources to build
 # the release (default is HEAD).
 #
+# Please note the support for building from SVN is preliminary and there
+# are still questions about things like how to handle updates of
+# /usr/src on production systems (csup(1) replacement).  It is a work
+# in progress and may change as the other issues get worked out.
+#
 # Please note: the md(4) driver must be present in the kernel
 # (either by being compiled in or available as a kld(4) module),
 # otherwise the target 'release.8' and possibly others will fail.
@@ -45,12 +51,25 @@ BUILDNAME?=${BASE}-${DATE}-SNAP
 # To add other options to the CVS command, set
 #CVSARGS="-lfq"
 #
-# To prefix the cvs command
+# To prefix the CVS command
 #CVSPREFIX="/usr/bin/time"
 #
 # Where the CVS repository is
 #CVSROOT="/home/ncvs"
 #
+# To add other options to the Subversion subcommands (co,up), set
+#SVNCMDARGS="-r '{ 01/01/2002 00:00:00 UTC }'"
+#
+# To prefix the Subversion command
+#SVNPREFIX="/usr/bin/time"
+#
+# Where the Subversion repository is
+#SVNROOT=svn://svn.freebsd.org/base
+#
+# Subversion branch to build for src.  If this is not set then it is
+# automatically computed from RELEASETAG.
+#SVNBRANCH=stable/7
+#
 # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
 # are building an official release.  Otherwise, we are building for
 # a branch.
@@ -64,6 +83,16 @@ PORTSRELEASETAG?=	${AUXRELEASETAG}
 .endif
 .endif
 
+# Determine the Subversion source branch that corresponds to the requested
+# RELEASETAG.
+.if !defined(SVNBRANCH)
+.if defined(RELEASETAG)
+SVNBRANCH!=	echo "${RELEASETAG}" | awk -f ${.CURDIR}/svnbranch.awk
+.else
+SVNBRANCH=	head
+.endif
+.endif
+
 # If you want to pass flags to the world build such as -j X, use
 # WORLD_FLAGS.  Similarly, you can specify make flags for kernel
 # builds via KERNEL_FLAGS.
@@ -342,8 +371,17 @@ CVS_PORTSARGS+=	-r ${PORTSRELEASETAG}
 WORLDDIR?=	${.CURDIR}/..
 
 release rerelease:
-.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
-	@echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
+.if !defined(CHROOTDIR) || !defined(BUILDNAME)
+	@echo "To make a release you must set CHROOTDIR and BUILDNAME" && false
+.endif
+.if !defined(NOPORTSATALL) && !defined(EXTPORTSDIR) && !defined(CVSROOT)
+	@echo "Building ports requires CVSROOT or EXTPORTSDIR" && false
+.endif
+.if !defined(NODOC) && !defined(EXTDOCDIR) && !defined(CVSROOT)
+	@echo "Building docs requires CVSROOT or EXTDOCDIR" && false
+.endif
+.if !defined(EXTSRCDIR) && !defined(CVSROOT) && !defined(SVNROOT)
+	@echo "The source tree requires SVNROOT, CVSROOT, or EXTSRCDIR" && false
 .endif
 .if defined(NOPORTSATALL) && !defined(NODOC)
 	@echo "Ports are required for building the docs.  Either set NODOC or"
@@ -388,6 +426,10 @@ release rerelease:
 .if defined(EXTSRCDIR)
 	cd ${CHROOTDIR}/usr && \
 	    cp -R -H ${EXTSRCDIR} src
+.elif defined(SVNROOT)
+	cd ${CHROOTDIR}/usr && \
+	    ${SVNPREFIX} svn co ${SVNCMDARGS} ${SVNROOT}/${SVNBRANCH} \
+	    ${RELEASESRCMODULE} 
 .else
 	cd ${CHROOTDIR}/usr && \
 	    ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
@@ -433,7 +475,10 @@ release rerelease:
 .endif
 .if make(rerelease)
 .if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR)
-.if !defined(RELEASETAG)
+.if defined(SVNROOT)
+	cd ${CHROOTDIR}/usr/src && ${SVNPREFIX} svn switch ${SVNCMDARGS} \
+	    ${SVNROOT}/${SVNBRANCH}
+.elif !defined(RELEASETAG)
 	cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
 	    update ${CVSCMDARGS} -P -d -A
 .else

Copied: stable/7/release/svnbranch.awk (from r196221, head/release/svnbranch.awk)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/release/svnbranch.awk	Thu Sep 10 14:16:05 2009	(r197067, copy of r196221, head/release/svnbranch.awk)
@@ -0,0 +1,28 @@
+# $FreeBSD$
+
+BEGIN {
+	FS = "_"
+}
+
+/RELENG_.*_RELEASE/ {
+	if (NF == 5) {
+		printf "release/%s.%s.%s", $2, $3, $4
+		exit
+	}
+}
+
+/RELENG_.*/ {
+	if (NF == 3) {
+		printf "releng/%s.%s", $2, $3
+		exit
+	}
+
+	if (NF == 2) {
+		printf "stable/%s", $2
+		exit
+	}
+}
+
+// {
+	printf "unknown_branch"
+}

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Sep 10 16:03:12 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 539511065670;
	Thu, 10 Sep 2009 16:03:12 +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 279B18FC19;
	Thu, 10 Sep 2009 16:03:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8AG3CLG024373;
	Thu, 10 Sep 2009 16:03:12 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8AG3CTS024372;
	Thu, 10 Sep 2009 16:03:12 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200909101603.n8AG3CTS024372@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 10 Sep 2009 16:03:12 +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: r197069 - in stable/7/sys: . contrib/pf net
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 10 Sep 2009 16:03:12 -0000

Author: jhb
Date: Thu Sep 10 16:03:11 2009
New Revision: 197069
URL: http://svn.freebsd.org/changeset/base/197069

Log:
  Hoist some mergeinfo up from sys/net to sys/.
  
  Reported by:	kib

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/net/   (props changed)

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Sep 10 16:10:12 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D0A41065676;
	Thu, 10 Sep 2009 16:10:12 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
	by mx1.freebsd.org (Postfix) with ESMTP id 801268FC08;
	Thu, 10 Sep 2009 16:10:10 +0000 (UTC)
Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua
	[212.40.38.101])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA24801;
	Thu, 10 Sep 2009 19:10:08 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Message-ID: <4AA924DF.7080009@freebsd.org>
Date: Thu, 10 Sep 2009 19:10:07 +0300
From: Andriy Gapon 
User-Agent: Thunderbird 2.0.0.22 (X11/20090724)
MIME-Version: 1.0
To: John Baldwin 
References: <200909101603.n8AG3CTS024372@svn.freebsd.org>
In-Reply-To: <200909101603.n8AG3CTS024372@svn.freebsd.org>
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset=UTF-8
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: r197069 - in stable/7/sys: . contrib/pf net
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 10 Sep 2009 16:10:12 -0000

on 10/09/2009 19:03 John Baldwin said the following:
> Author: jhb
> Date: Thu Sep 10 16:03:11 2009
> New Revision: 197069
> URL: http://svn.freebsd.org/changeset/base/197069
> 
> Log:
>   Hoist some mergeinfo up from sys/net to sys/.
>   
>   Reported by:	kib

Perhaps it's possible to develop a commit hook that would reject mergeinfo being
set on some entities? E.g. individual files, or directories under sys.

-- 
Andriy Gapon

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Sep 10 17:58:00 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 882B81065670;
	Thu, 10 Sep 2009 17:58: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 56DF68FC19;
	Thu, 10 Sep 2009 17:58:00 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 07B3246B06;
	Thu, 10 Sep 2009 13:58:00 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 6A9D98A01B;
	Thu, 10 Sep 2009 13:57:59 -0400 (EDT)
From: John Baldwin 
To: Andriy Gapon 
Date: Thu, 10 Sep 2009 13:27:22 -0400
User-Agent: KMail/1.9.7
References: <200909101603.n8AG3CTS024372@svn.freebsd.org>
	<4AA924DF.7080009@freebsd.org>
In-Reply-To: <4AA924DF.7080009@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200909101327.23113.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Thu, 10 Sep 2009 13:57:59 -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: r197069 - in stable/7/sys: . contrib/pf net
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 10 Sep 2009 17:58:00 -0000

On Thursday 10 September 2009 12:10:07 pm Andriy Gapon wrote:
> on 10/09/2009 19:03 John Baldwin said the following:
> > Author: jhb
> > Date: Thu Sep 10 16:03:11 2009
> > New Revision: 197069
> > URL: http://svn.freebsd.org/changeset/base/197069
> > 
> > Log:
> >   Hoist some mergeinfo up from sys/net to sys/.
> >   
> >   Reported by:	kib
> 
> Perhaps it's possible to develop a commit hook that would reject mergeinfo being
> set on some entities? E.g. individual files, or directories under sys.

In some cases it is valid to add the mergeinfo, though that is probably
restricted to certain subdirectories (contrib, cddl, crypto).  I don't know
enough of the SVN internals to look at doing that.

-- 
John Baldwin

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Sep 11 17:12:44 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 730FC106566C;
	Fri, 11 Sep 2009 17:12:44 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 618998FC14;
	Fri, 11 Sep 2009 17:12:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8BHCium058174;
	Fri, 11 Sep 2009 17:12:44 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8BHCikr058172;
	Fri, 11 Sep 2009 17:12:44 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200909111712.n8BHCikr058172@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 11 Sep 2009 17:12:43 +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: r197094 - in stable/7/sys: . contrib/pf dev/mii
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 11 Sep 2009 17:12:44 -0000

Author: yongari
Date: Fri Sep 11 17:12:43 2009
New Revision: 197094
URL: http://svn.freebsd.org/changeset/base/197094

Log:
  MFC r196366:
    Backout r193289. r193289 restored page select bits to previous
    value instead of blindly resetting it to 0. However, it seems page
    select bits of some 88E1116 PHY is initialized to invalid one such
    that restoring page select bits after programming broke MII
    register access. The correct solution would be reset page select
    bits to 0 in PHY attach stage but it would require more testing.
    Since we're in BETA stage such a change would be dangerous so just
    back it out.
    This change should fix nfe(4) breakage on NVIDIA MCP55.
  
    Reported by:	Ryan Rogers < webmaster <> doghouserepair dot com >
  		Sam Fourman Jr. < sfourman <> gmail dot com >
    Tested by:	Ryan Rogers < webmaster <> doghouserepair dot com >
  		Sam Fourman Jr. < sfourman <> gmail dot com >

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/mii/e1000phy.c

Modified: stable/7/sys/dev/mii/e1000phy.c
==============================================================================
--- stable/7/sys/dev/mii/e1000phy.c	Fri Sep 11 16:53:12 2009	(r197093)
+++ stable/7/sys/dev/mii/e1000phy.c	Fri Sep 11 17:12:43 2009	(r197094)
@@ -239,13 +239,11 @@ e1000phy_reset(struct mii_softc *sc)
 
 		if (esc->mii_model == MII_MODEL_MARVELL_E1116 ||
 		    esc->mii_model == MII_MODEL_MARVELL_E1149) {
-			page = PHY_READ(sc, E1000_EADR);
-			/* Select page 2, MAC specific control register. */
 			PHY_WRITE(sc, E1000_EADR, 2);
 			reg = PHY_READ(sc, E1000_SCR);
 			reg |= E1000_SCR_RGMII_POWER_UP;
 			PHY_WRITE(sc, E1000_SCR, reg);
-			PHY_WRITE(sc, E1000_EADR, page);
+			PHY_WRITE(sc, E1000_EADR, 0);
 		}
 	}
 

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Sep 11 17:15:18 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DBF6F1065676;
	Fri, 11 Sep 2009 17:15:18 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B214B8FC1D;
	Fri, 11 Sep 2009 17:15:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8BHFI8v058285;
	Fri, 11 Sep 2009 17:15:18 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8BHFIgW058282;
	Fri, 11 Sep 2009 17:15:18 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200909111715.n8BHFIgW058282@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 11 Sep 2009 17:15:18 +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: r197095 - in stable/7/sys: . contrib/pf dev/re pci
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 11 Sep 2009 17:15:19 -0000

Author: yongari
Date: Fri Sep 11 17:15:18 2009
New Revision: 197095
URL: http://svn.freebsd.org/changeset/base/197095

Log:
  MFC r196516:
    Add RTL8168DP/RTL8111DP device id. While I'm here append "8111D" to
    the description of RTL8168D as RL_HWREV_8168D can be either
    RTL8168D or RTL8111D.
  
    PR:	kern/137672

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/re/if_re.c
  stable/7/sys/pci/if_rlreg.h

Modified: stable/7/sys/dev/re/if_re.c
==============================================================================
--- stable/7/sys/dev/re/if_re.c	Fri Sep 11 17:12:43 2009	(r197094)
+++ stable/7/sys/dev/re/if_re.c	Fri Sep 11 17:15:18 2009	(r197095)
@@ -174,8 +174,8 @@ static struct rl_type re_devs[] = {
 	{ RT_VENDORID, RT_DEVICEID_8101E, 0,
 	    "RealTek 8101E/8102E/8102EL PCIe 10/100baseTX" },
 	{ RT_VENDORID, RT_DEVICEID_8168, 0,
-	    "RealTek 8168/8168B/8168C/8168CP/8168D/8111B/8111C/8111CP PCIe "
-	    "Gigabit Ethernet" },
+	    "RealTek 8168/8168B/8168C/8168CP/8168D/8168DP/"
+	    "8111B/8111C/8111CP/8111DP PCIe Gigabit Ethernet" },
 	{ RT_VENDORID, RT_DEVICEID_8169, 0,
 	    "RealTek 8169/8169S/8169SB(L)/8110S/8110SB(L) Gigabit Ethernet" },
 	{ RT_VENDORID, RT_DEVICEID_8169SC, 0,
@@ -216,7 +216,8 @@ static struct rl_hwrev re_hwrevs[] = {
 	{ RL_HWREV_8168C, RL_8169, "8168C/8111C"},
 	{ RL_HWREV_8168C_SPIN2, RL_8169, "8168C/8111C"},
 	{ RL_HWREV_8168CP, RL_8169, "8168CP/8111CP"},
-	{ RL_HWREV_8168D, RL_8169, "8168D"},
+	{ RL_HWREV_8168D, RL_8169, "8168D/8111D"},
+	{ RL_HWREV_8168DP, RL_8169, "8168DP/8111DP"},
 	{ 0, 0, NULL }
 };
 
@@ -1280,6 +1281,7 @@ re_attach(device_t dev)
 		/* FALLTHROUGH */
 	case RL_HWREV_8168CP:
 	case RL_HWREV_8168D:
+	case RL_HWREV_8168DP:
 		sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR |
 		    RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP;
 		/*

Modified: stable/7/sys/pci/if_rlreg.h
==============================================================================
--- stable/7/sys/pci/if_rlreg.h	Fri Sep 11 17:12:43 2009	(r197094)
+++ stable/7/sys/pci/if_rlreg.h	Fri Sep 11 17:15:18 2009	(r197095)
@@ -160,6 +160,7 @@
 #define RL_HWREV_8169_8110SC	0x18000000
 #define RL_HWREV_8102EL		0x24800000
 #define RL_HWREV_8168D		0x28000000
+#define RL_HWREV_8168DP		0x28800000
 #define RL_HWREV_8168_SPIN1	0x30000000
 #define RL_HWREV_8100E		0x30800000
 #define RL_HWREV_8101E		0x34000000

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Sep 11 17:18:08 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F4B31065698;
	Fri, 11 Sep 2009 17:18:08 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E5758FC13;
	Fri, 11 Sep 2009 17:18:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8BHI8Ao058384;
	Fri, 11 Sep 2009 17:18:08 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8BHI83b058382;
	Fri, 11 Sep 2009 17:18:08 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200909111718.n8BHI83b058382@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 11 Sep 2009 17:18:08 +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: r197096 - in stable/7/sys: . contrib/pf dev/alc
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 11 Sep 2009 17:18:08 -0000

Author: yongari
Date: Fri Sep 11 17:18:08 2009
New Revision: 197096
URL: http://svn.freebsd.org/changeset/base/197096

Log:
  MFC r195989:
    Free allocated Rx ring dma memory/tags.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/alc/if_alc.c

Modified: stable/7/sys/dev/alc/if_alc.c
==============================================================================
--- stable/7/sys/dev/alc/if_alc.c	Fri Sep 11 17:15:18 2009	(r197095)
+++ stable/7/sys/dev/alc/if_alc.c	Fri Sep 11 17:18:08 2009	(r197096)
@@ -1501,6 +1501,21 @@ alc_dma_free(struct alc_softc *sc)
 		bus_dma_tag_destroy(sc->alc_cdata.alc_tx_ring_tag);
 		sc->alc_cdata.alc_tx_ring_tag = NULL;
 	}
+	/* Rx ring. */
+	if (sc->alc_cdata.alc_rx_ring_tag != NULL) {
+		if (sc->alc_cdata.alc_rx_ring_map != NULL)
+			bus_dmamap_unload(sc->alc_cdata.alc_rx_ring_tag,
+			    sc->alc_cdata.alc_rx_ring_map);
+		if (sc->alc_cdata.alc_rx_ring_map != NULL &&
+		    sc->alc_rdata.alc_rx_ring != NULL)
+			bus_dmamem_free(sc->alc_cdata.alc_rx_ring_tag,
+			    sc->alc_rdata.alc_rx_ring,
+			    sc->alc_cdata.alc_rx_ring_map);
+		sc->alc_rdata.alc_rx_ring = NULL;
+		sc->alc_cdata.alc_rx_ring_map = NULL;
+		bus_dma_tag_destroy(sc->alc_cdata.alc_rx_ring_tag);
+		sc->alc_cdata.alc_rx_ring_tag = NULL;
+	}
 	/* Rx return ring. */
 	if (sc->alc_cdata.alc_rr_ring_tag != NULL) {
 		if (sc->alc_cdata.alc_rr_ring_map != NULL)

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Sep 11 17:20:11 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4378106566B;
	Fri, 11 Sep 2009 17:20:11 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C5BF58FC1C;
	Fri, 11 Sep 2009 17:20:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8BHKB3u058478;
	Fri, 11 Sep 2009 17:20:11 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8BHKBCn058476;
	Fri, 11 Sep 2009 17:20:11 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200909111720.n8BHKBCn058476@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 11 Sep 2009 17:20:11 +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: r197097 - in stable/7/sys: . contrib/pf dev/alc
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 11 Sep 2009 17:20:12 -0000

Author: yongari
Date: Fri Sep 11 17:20:11 2009
New Revision: 197097
URL: http://svn.freebsd.org/changeset/base/197097

Log:
  MFC r196517:
    Don't try to power down PHY when alc(4) failed to map the device.
    This fixes system crash when mapping alc(4) device failed in device
    attach.
  
    Reported by:	Jim < stapleton.41 <> gmail DOT com >

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/alc/if_alc.c

Modified: stable/7/sys/dev/alc/if_alc.c
==============================================================================
--- stable/7/sys/dev/alc/if_alc.c	Fri Sep 11 17:18:08 2009	(r197096)
+++ stable/7/sys/dev/alc/if_alc.c	Fri Sep 11 17:20:11 2009	(r197097)
@@ -858,7 +858,8 @@ alc_detach(device_t dev)
 			sc->alc_intrhand[i] = NULL;
 		}
 	}
-	alc_phy_down(sc);
+	if (sc->alc_res[0] != NULL)
+		alc_phy_down(sc);
 	bus_release_resources(dev, sc->alc_irq_spec, sc->alc_irq);
 	if ((sc->alc_flags & (ALC_FLAG_MSI | ALC_FLAG_MSIX)) != 0)
 		pci_release_msi(dev);

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Sep 11 17:25:25 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1206F1065694;
	Fri, 11 Sep 2009 17:25:25 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 00B9E8FC15;
	Fri, 11 Sep 2009 17:25:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8BHPOE8058645;
	Fri, 11 Sep 2009 17:25:24 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8BHPOQt058643;
	Fri, 11 Sep 2009 17:25:24 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200909111725.n8BHPOQt058643@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 11 Sep 2009 17:25:24 +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: r197098 - in stable/7/sys: . contrib/pf dev/txp
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 11 Sep 2009 17:25:25 -0000

Author: yongari
Date: Fri Sep 11 17:25:24 2009
New Revision: 197098
URL: http://svn.freebsd.org/changeset/base/197098

Log:
  MFC r196721:
    Make sure rx descriptor ring align on 16 bytes. I guess the
    alignment requirement could be multiple of 4 bytes but I think
    using descriptor size would make intention clearer.
    Previously the size of rx descriptor was not power of 2 so it
    caused panic in bus_dmamem_alloc(9).
  
    Reported by:	Jeff Blank (jb000003 <> mr-happy dot com)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/txp/if_txp.c

Modified: stable/7/sys/dev/txp/if_txp.c
==============================================================================
--- stable/7/sys/dev/txp/if_txp.c	Fri Sep 11 17:20:11 2009	(r197097)
+++ stable/7/sys/dev/txp/if_txp.c	Fri Sep 11 17:25:24 2009	(r197098)
@@ -1389,7 +1389,8 @@ txp_alloc_rings(struct txp_softc *sc)
 
 	/* High priority rx ring. */
 	error = txp_dma_alloc(sc, "hi priority rx ring",
-	    &sc->sc_cdata.txp_rxhiring_tag, sizeof(struct txp_rx_desc), 0,
+	    &sc->sc_cdata.txp_rxhiring_tag,
+	    roundup(sizeof(struct txp_rx_desc), 16), 0,
 	    &sc->sc_cdata.txp_rxhiring_map, (void **)&sc->sc_ldata.txp_rxhiring,
 	    sizeof(struct txp_rx_desc) * RX_ENTRIES,
 	    &sc->sc_ldata.txp_rxhiring_paddr);
@@ -1409,7 +1410,8 @@ txp_alloc_rings(struct txp_softc *sc)
 
 	/* Low priority rx ring. */
 	error = txp_dma_alloc(sc, "low priority rx ring",
-	    &sc->sc_cdata.txp_rxloring_tag, sizeof(struct txp_rx_desc), 0,
+	    &sc->sc_cdata.txp_rxloring_tag,
+	    roundup(sizeof(struct txp_rx_desc), 16), 0,
 	    &sc->sc_cdata.txp_rxloring_map, (void **)&sc->sc_ldata.txp_rxloring,
 	    sizeof(struct txp_rx_desc) * RX_ENTRIES,
 	    &sc->sc_ldata.txp_rxloring_paddr);

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Sep 11 21:09:59 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A35A71065670;
	Fri, 11 Sep 2009 21:09:59 +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 926548FC20;
	Fri, 11 Sep 2009 21:09:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8BL9x3M063584;
	Fri, 11 Sep 2009 21:09:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8BL9xbb063582;
	Fri, 11 Sep 2009 21:09:59 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200909112109.n8BL9xbb063582@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 11 Sep 2009 21:09:59 +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: r197101 - stable/7/release
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 11 Sep 2009 21:09:59 -0000

Author: jhb
Date: Fri Sep 11 21:09:59 2009
New Revision: 197101
URL: http://svn.freebsd.org/changeset/base/197101

Log:
  MFC part of 180012:
  Changes to exclude .svn directories when building tarballs during release
  builds (not documented in the original commit to HEAD).

Modified:
  stable/7/release/   (props changed)
  stable/7/release/Makefile

Modified: stable/7/release/Makefile
==============================================================================
--- stable/7/release/Makefile	Fri Sep 11 19:23:11 2009	(r197100)
+++ stable/7/release/Makefile	Fri Sep 11 21:09:59 2009	(r197101)
@@ -731,7 +731,7 @@ release.6:
 	@rm -rf ${RD}/dists/ports/ports*
 	@mkdir -p ${RD}/dists/ports
 	@echo rolling ports/ports tarball
-	@tar --exclude CVS --exclude 'ports/distfiles/*' \
+	@tar --exclude CVS --exclude .svn --exclude 'ports/distfiles/*' \
 	  -czf ${RD}/dists/ports/ports.tgz -C /usr ports
 	@cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
 	@(cd ${RD}/dists/ports; \
@@ -834,7 +834,8 @@ release.8:
 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
 	@cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
 .endif
-	@tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
+	@tar --exclude CVS --exclude .svn -cf - \
+		-C ${.CURDIR}/../usr.sbin/sysinstall help | \
 		tar xf - -C ${RD}/mfsfd/stand
 	@mkdir -p ${RD}/mfsroot
 	sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
@@ -1232,7 +1233,7 @@ doTARBALL:
 	@( cd ${SD} && \
 		tn=`echo ${TN} | tr 'A-Z' 'a-z'` && \
 		echo rolling ${TD}/$$tn tarball &&\
-		tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
+		tar --exclude CVS --exclude .svn --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
 		${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
 		sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
 		    > ${RD}/dists/${TD}/$$tn.inf && \