From owner-svn-src-stable-8@FreeBSD.ORG Sun Oct 7 18:19:14 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 85252106578F; Sun, 7 Oct 2012 18:19:14 +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 548988FC14; Sun, 7 Oct 2012 18:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IJEjh046444; Sun, 7 Oct 2012 18:19:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IJEJJ046442; Sun, 7 Oct 2012 18:19:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210071819.q97IJEJJ046442@svn.freebsd.org> From: John Baldwin Date: Sun, 7 Oct 2012 18:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241315 - stable/8/sys/dev/cxgb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 18:19:14 -0000 Author: jhb Date: Sun Oct 7 18:19:13 2012 New Revision: 241315 URL: http://svn.freebsd.org/changeset/base/241315 Log: MFC 239913: Attach interrupt handlers during attach instead of during the first time the interface is brought up. Without this, the boot time interrupt round-robin assignment does not think the allocated interrupt resources are active and leaves them assigned to CPU 0. While here, add descriptive tags to each interrupt handler when MSI-X is used. Modified: stable/8/sys/dev/cxgb/cxgb_main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cxgb/ (props changed) Modified: stable/8/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_main.c Sun Oct 7 18:18:59 2012 (r241314) +++ stable/8/sys/dev/cxgb/cxgb_main.c Sun Oct 7 18:19:13 2012 (r241315) @@ -662,6 +662,9 @@ cxgb_controller_attach(device_t dev) device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]); callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc); t3_add_attach_sysctls(sc); + + t3_intr_clear(sc); + error = cxgb_setup_interrupts(sc); out: if (error) cxgb_free(sc); @@ -917,6 +920,7 @@ cxgb_setup_interrupts(adapter_t *sc) if (!(intr_flag & USING_MSIX) || err) return (err); + bus_describe_intr(sc->dev, sc->irq_res, sc->intr_tag, "err"); for (i = 0; i < sc->msi_count - 1; i++) { rid = i + 2; res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid, @@ -940,6 +944,7 @@ cxgb_setup_interrupts(adapter_t *sc) sc->msix_irq_rid[i] = rid; sc->msix_irq_res[i] = res; sc->msix_intr_tag[i] = tag; + bus_describe_intr(sc->dev, res, tag, "qs%d", i); } if (err) @@ -1660,11 +1665,6 @@ cxgb_up(struct adapter *sc) alloc_filters(sc); setup_rss(sc); - t3_intr_clear(sc); - err = cxgb_setup_interrupts(sc); - if (err) - goto out; - t3_add_configured_sysctls(sc); sc->flags |= FULL_INIT_DONE; } From owner-svn-src-stable-8@FreeBSD.ORG Sun Oct 7 18:23:16 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24308106567B; Sun, 7 Oct 2012 18:23:16 +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 0EFDE8FC08; Sun, 7 Oct 2012 18:23:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97INFOI047119; Sun, 7 Oct 2012 18:23:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97INFWh047117; Sun, 7 Oct 2012 18:23:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210071823.q97INFWh047117@svn.freebsd.org> From: John Baldwin Date: Sun, 7 Oct 2012 18:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241317 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 18:23:16 -0000 Author: jhb Date: Sun Oct 7 18:23:15 2012 New Revision: 241317 URL: http://svn.freebsd.org/changeset/base/241317 Log: MFC 240132: When WIFCONTINUED was added, the number of "first" macros grew from three to four. Modified: stable/8/lib/libc/sys/wait.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/wait.2 ============================================================================== --- stable/8/lib/libc/sys/wait.2 Sun Oct 7 18:22:59 2012 (r241316) +++ stable/8/lib/libc/sys/wait.2 Sun Oct 7 18:23:15 2012 (r241317) @@ -164,7 +164,7 @@ with a value of -1. .Pp The following macros may be used to test the manner of exit of the process. -One of the first three macros will evaluate to a non-zero (true) value: +One of the first four macros will evaluate to a non-zero (true) value: .Bl -tag -width Ds .It Fn WIFCONTINUED status True if the process has not terminated, and From owner-svn-src-stable-8@FreeBSD.ORG Sun Oct 7 18:25:49 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 311821065670; Sun, 7 Oct 2012 18:25:49 +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 1B8408FC12; Sun, 7 Oct 2012 18:25:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IPmXg047525; Sun, 7 Oct 2012 18:25:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IPmsb047523; Sun, 7 Oct 2012 18:25:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210071825.q97IPmsb047523@svn.freebsd.org> From: John Baldwin Date: Sun, 7 Oct 2012 18:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241319 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 18:25:49 -0000 Author: jhb Date: Sun Oct 7 18:25:48 2012 New Revision: 241319 URL: http://svn.freebsd.org/changeset/base/241319 Log: MFC 239906: Clarify that bus_dma does not stall future load requests once a load is deferred. The caller is required to enforce that if that is desired. Modified: stable/8/share/man/man9/bus_dma.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/bus_dma.9 ============================================================================== --- stable/8/share/man/man9/bus_dma.9 Sun Oct 7 18:25:33 2012 (r241318) +++ stable/8/share/man/man9/bus_dma.9 Sun Oct 7 18:25:48 2012 (r241319) @@ -580,8 +580,13 @@ The status of the mapping has been deliv The mapping has been deferred for lack of resources. The callback will be called as soon as resources are available. Callbacks are serviced in FIFO order. -To ensure that ordering is guaranteed, all subsequent load requests will also -be deferred until all callbacks have been processed. +.Pp +Note that subsequent load operations for the same tag that do not require +extra resources will still succeed. +This may result in out-of-order processing of requests. +If the caller requires the order of requests to be preserved, +then the caller is required to stall subsequent requests until a pending +request's callback is invoked. .It Er ENOMEM The load request has failed due to insufficient resources, and the caller specifically used the From owner-svn-src-stable-8@FreeBSD.ORG Sun Oct 7 18:31:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 794D910657BD; Sun, 7 Oct 2012 18:31:18 +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 596468FC12; Sun, 7 Oct 2012 18:31:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IVIsN048357; Sun, 7 Oct 2012 18:31:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IVIQZ048354; Sun, 7 Oct 2012 18:31:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210071831.q97IVIQZ048354@svn.freebsd.org> From: John Baldwin Date: Sun, 7 Oct 2012 18:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241321 - stable/8/bin/mv X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 18:31:18 -0000 Author: jhb Date: Sun Oct 7 18:31:17 2012 New Revision: 241321 URL: http://svn.freebsd.org/changeset/base/241321 Log: MFC 226961,239951: Add a -h flag similar to the -h flag for ln to force mv(1) to treat a symbolic link to a directory for the target as a symbolic link instead of a directory. This makes it possible to atomically update a symbolic link using rename(). Modified: stable/8/bin/mv/mv.1 stable/8/bin/mv/mv.c Directory Properties: stable/8/bin/mv/ (props changed) Modified: stable/8/bin/mv/mv.1 ============================================================================== --- stable/8/bin/mv/mv.1 Sun Oct 7 18:31:01 2012 (r241320) +++ stable/8/bin/mv/mv.1 Sun Oct 7 18:31:17 2012 (r241321) @@ -32,7 +32,7 @@ .\" @(#)mv.1 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.Dd May 12, 2007 +.Dd August 28, 2012 .Dt MV 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl f | i | n -.Op Fl v +.Op Fl hv .Ar source target .Nm .Op Fl f | i | n @@ -81,6 +81,21 @@ option overrides any previous or .Fl n options.) +.It Fl h +If the +.Ar target +operand is a symbolic link to a directory, +do not follow it. +This causes the +.Nm +utility to rename the file +.Ar source +to the destination path +.Ar target +rather than moving +.Ar source +into the directory referenced by +.Ar target . .It Fl i Cause .Nm @@ -142,7 +157,8 @@ rm -rf source_file .Ex -std .Sh COMPATIBILITY The -.Fl n +.Fl h , +.Fl n , and .Fl v options are non-standard and their use in scripts is not recommended. Modified: stable/8/bin/mv/mv.c ============================================================================== --- stable/8/bin/mv/mv.c Sun Oct 7 18:31:01 2012 (r241320) +++ stable/8/bin/mv/mv.c Sun Oct 7 18:31:17 2012 (r241321) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); /* Exit code for a failed exec. */ #define EXEC_FAILED 127 -int fflg, iflg, nflg, vflg; +static int fflg, hflg, iflg, nflg, vflg; static int copy(const char *, const char *); static int do_move(const char *, const char *); @@ -87,8 +87,11 @@ main(int argc, char *argv[]) int ch; char path[PATH_MAX]; - while ((ch = getopt(argc, argv, "finv")) != -1) + while ((ch = getopt(argc, argv, "fhinv")) != -1) switch (ch) { + case 'h': + hflg = 1; + break; case 'i': iflg = 1; fflg = nflg = 0; @@ -123,6 +126,17 @@ main(int argc, char *argv[]) exit(do_move(argv[0], argv[1])); } + /* + * If -h was specified, treat the target as a symlink instead of + * directory. + */ + if (hflg) { + if (argc > 2) + usage(); + if (lstat(argv[1], &sb) == 0 && S_ISLNK(sb.st_mode)) + exit(do_move(argv[0], argv[1])); + } + /* It's a directory, move each file into it. */ if (strlen(argv[argc - 1]) > sizeof(path) - 1) errx(1, "%s: destination pathname too long", *argv); @@ -489,7 +503,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: mv [-f | -i | -n] [-v] source target", + "usage: mv [-f | -i | -n] [-hv] source target", " mv [-f | -i | -n] [-v] source ... directory"); exit(EX_USAGE); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Oct 7 18:37:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C676E10657D9; Sun, 7 Oct 2012 18:37: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 AFCF38FC08; Sun, 7 Oct 2012 18:37:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97Ibx8v049462; Sun, 7 Oct 2012 18:37:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IbxHV049460; Sun, 7 Oct 2012 18:37:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210071837.q97IbxHV049460@svn.freebsd.org> From: John Baldwin Date: Sun, 7 Oct 2012 18:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241323 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 18:37:59 -0000 Author: jhb Date: Sun Oct 7 18:37:59 2012 New Revision: 241323 URL: http://svn.freebsd.org/changeset/base/241323 Log: MFC 239335: Remove D_NEEDGIANT from dead_devsw. biofinish() (and thus dead_strategy) does not need Giant. Modified: stable/8/sys/kern/kern_conf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_conf.c ============================================================================== --- stable/8/sys/kern/kern_conf.c Sun Oct 7 18:37:47 2012 (r241322) +++ stable/8/sys/kern/kern_conf.c Sun Oct 7 18:37:59 2012 (r241323) @@ -306,7 +306,6 @@ dead_strategy(struct bio *bp) static struct cdevsw dead_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, /* XXX: does dead_strategy need this ? */ .d_open = dead_open, .d_close = dead_close, .d_read = dead_read, From owner-svn-src-stable-8@FreeBSD.ORG Sun Oct 7 18:42:03 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1903F10657C4; Sun, 7 Oct 2012 18:42:03 +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 049638FC0A; Sun, 7 Oct 2012 18:42:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97Ig2ts050107; Sun, 7 Oct 2012 18:42:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97Ig2s4050104; Sun, 7 Oct 2012 18:42:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210071842.q97Ig2s4050104@svn.freebsd.org> From: John Baldwin Date: Sun, 7 Oct 2012 18:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241325 - stable/8/sys/dev/mfi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 18:42:03 -0000 Author: jhb Date: Sun Oct 7 18:42:02 2012 New Revision: 241325 URL: http://svn.freebsd.org/changeset/base/241325 Log: MFC 240962: Grab the mfi_config_lock while performing a MFI_DCMD_CFG_FOREIGN_IMPORT request on behalf of a user utility. Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mfi/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Sun Oct 7 18:41:48 2012 (r241324) +++ stable/8/sys/dev/mfi/mfi.c Sun Oct 7 18:42:02 2012 (r241325) @@ -2550,6 +2550,7 @@ mfi_config_lock(struct mfi_softc *sc, ui case MFI_DCMD_LD_DELETE: case MFI_DCMD_CFG_ADD: case MFI_DCMD_CFG_CLEAR: + case MFI_DCMD_CFG_FOREIGN_IMPORT: sx_xlock(&sc->mfi_config_lock); return (1); default: From owner-svn-src-stable-8@FreeBSD.ORG Sun Oct 7 18:57:53 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 032251065690; Sun, 7 Oct 2012 18:57:53 +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 E17008FC08; Sun, 7 Oct 2012 18:57:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97IvqNH052665; Sun, 7 Oct 2012 18:57:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97IvqVO052663; Sun, 7 Oct 2012 18:57:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210071857.q97IvqVO052663@svn.freebsd.org> From: John Baldwin Date: Sun, 7 Oct 2012 18:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241328 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 18:57:53 -0000 Author: jhb Date: Sun Oct 7 18:57:52 2012 New Revision: 241328 URL: http://svn.freebsd.org/changeset/base/241328 Log: MFC 239440,239519: Refine the changes made in r208212 to avoid bogus failures from if_delmulti() when clearing the configuration for a subinterface when the parent interface is being detached. The current code was still triggering an assertion in if_delmulti() due to the parent interface being partially detached. Fix this by not calling if_delmulti() at all if the parent interface is being detached. Warn if if_delmulti() fails when the parent is not being detached (but similar to 208212, still proceed with tearing down the vlan state). Modified: stable/8/sys/net/if_vlan.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/net/if_vlan.c ============================================================================== --- stable/8/sys/net/if_vlan.c Sun Oct 7 18:57:29 2012 (r241327) +++ stable/8/sys/net/if_vlan.c Sun Oct 7 18:57:52 2012 (r241328) @@ -188,7 +188,7 @@ static int vlan_setflags(struct ifnet *i static int vlan_setmulti(struct ifnet *ifp); static int vlan_transmit(struct ifnet *ifp, struct mbuf *m); static void vlan_unconfig(struct ifnet *ifp); -static void vlan_unconfig_locked(struct ifnet *ifp); +static void vlan_unconfig_locked(struct ifnet *ifp, int departing); static int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag); static void vlan_link_state(struct ifnet *ifp, int link); static void vlan_capabilities(struct ifvlan *ifv); @@ -543,7 +543,7 @@ vlan_ifdetach(void *arg __unused, struct #ifdef VLAN_ARRAY for (i = 0; i < VLAN_ARRAY_SIZE; i++) if ((ifv = ifp->if_vlantrunk->vlans[i])) { - vlan_unconfig_locked(ifv->ifv_ifp); + vlan_unconfig_locked(ifv->ifv_ifp, 1); if (ifp->if_vlantrunk == NULL) break; } @@ -551,7 +551,7 @@ vlan_ifdetach(void *arg __unused, struct restart: for (i = 0; i < (1 << ifp->if_vlantrunk->hwidth); i++) if ((ifv = LIST_FIRST(&ifp->if_vlantrunk->hash[i]))) { - vlan_unconfig_locked(ifv->ifv_ifp); + vlan_unconfig_locked(ifv->ifv_ifp, 1); if (ifp->if_vlantrunk) goto restart; /* trunk->hwidth can change */ else @@ -821,7 +821,7 @@ vlan_clone_create(struct if_clone *ifc, error = vlan_config(ifv, p, tag); if (error != 0) { /* - * Since we've partialy failed, we need to back + * Since we've partially failed, we need to back * out all the way, otherwise userland could get * confused. Thus, we destroy the interface. */ @@ -1163,17 +1163,18 @@ vlan_unconfig(struct ifnet *ifp) { VLAN_LOCK(); - vlan_unconfig_locked(ifp); + vlan_unconfig_locked(ifp, 0); VLAN_UNLOCK(); } static void -vlan_unconfig_locked(struct ifnet *ifp) +vlan_unconfig_locked(struct ifnet *ifp, int departing) { struct ifvlantrunk *trunk; struct vlan_mc_entry *mc; struct ifvlan *ifv; struct ifnet *parent; + int error; VLAN_LOCK_ASSERT(); @@ -1204,13 +1205,21 @@ vlan_unconfig_locked(struct ifnet *ifp) ETHER_ADDR_LEN); /* - * This may fail if the parent interface is - * being detached. Regardless, we should do a - * best effort to free this interface as much - * as possible as all callers expect vlan - * destruction to succeed. + * If the parent interface is being detached, + * all its multicast addresses have already + * been removed. Warn about errors if + * if_delmulti() does fail, but don't abort as + * all callers expect vlan destruction to + * succeed. */ - (void)if_delmulti(parent, (struct sockaddr *)&sdl); + if (!departing) { + error = if_delmulti(parent, + (struct sockaddr *)&sdl); + if (error) + if_printf(ifp, + "Failed to delete multicast address from parent: %d\n", + error); + } SLIST_REMOVE_HEAD(&ifv->vlan_mc_listhead, mc_entries); free(mc, M_VLAN); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Oct 7 20:17:25 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A771106566C; Sun, 7 Oct 2012 20:17:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 746668FC08; Sun, 7 Oct 2012 20:17:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97KHPCP063175; Sun, 7 Oct 2012 20:17:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97KHPPE063173; Sun, 7 Oct 2012 20:17:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210072017.q97KHPPE063173@svn.freebsd.org> From: John Baldwin Date: Sun, 7 Oct 2012 20:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241332 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 20:17:25 -0000 Author: jhb Date: Sun Oct 7 20:17:24 2012 New Revision: 241332 URL: http://svn.freebsd.org/changeset/base/241332 Log: MFC 212429: Add real dependancies on the uuencoded firmwares. Now when one does 'make kernel ; make kernel' the second invocation only does: `kernel.ko' is up to date. rather than reproduce all the .fw files and relink the kernel. Modified: stable/8/sys/conf/files Directory Properties: stable/8/sys/ (props changed) stable/8/sys/conf/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Sun Oct 7 20:01:41 2012 (r241331) +++ stable/8/sys/conf/files Sun Oct 7 20:17:24 2012 (r241332) @@ -1027,7 +1027,7 @@ ipw_bss.fwo optional ipwbssfw | ipwfw no-implicit-rule \ clean "ipw_bss.fwo" ipw_bss.fw optional ipwbssfw | ipwfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \ no-obj no-implicit-rule \ clean "ipw_bss.fw" @@ -1041,7 +1041,7 @@ ipw_ibss.fwo optional ipwibssfw | ipwf no-implicit-rule \ clean "ipw_ibss.fwo" ipw_ibss.fw optional ipwibssfw | ipwfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \ no-obj no-implicit-rule \ clean "ipw_ibss.fw" @@ -1055,7 +1055,7 @@ ipw_monitor.fwo optional ipwmonitorfw no-implicit-rule \ clean "ipw_monitor.fwo" ipw_monitor.fw optional ipwmonitorfw | ipwfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \ no-obj no-implicit-rule \ clean "ipw_monitor.fw" @@ -1083,7 +1083,7 @@ iwi_bss.fwo optional iwibssfw | iwifw no-implicit-rule \ clean "iwi_bss.fwo" iwi_bss.fw optional iwibssfw | iwifw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/iwi/ipw2200-bss.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \ no-obj no-implicit-rule \ clean "iwi_bss.fw" @@ -1097,7 +1097,7 @@ iwi_ibss.fwo optional iwiibssfw | iwif no-implicit-rule \ clean "iwi_ibss.fwo" iwi_ibss.fw optional iwiibssfw | iwifw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \ no-obj no-implicit-rule \ clean "iwi_ibss.fw" @@ -1111,7 +1111,7 @@ iwi_monitor.fwo optional iwimonitorfw no-implicit-rule \ clean "iwi_monitor.fwo" iwi_monitor.fw optional iwimonitorfw | iwifw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \ no-obj no-implicit-rule \ clean "iwi_monitor.fw" @@ -1140,7 +1140,7 @@ iwn4965fw.fwo optional iwn4965fw | iwn no-implicit-rule \ clean "iwn4965fw.fwo" iwn4965.fw optional iwn4965fw | iwnfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \ no-obj no-implicit-rule \ clean "iwn4965.fw" @@ -1168,7 +1168,7 @@ iwn5150fw.fwo optional iwn5150fw | iwn no-implicit-rule \ clean "iwn5150fw.fwo" iwn5150.fw optional iwn5150fw | iwnfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu"\ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \ no-obj no-implicit-rule \ clean "iwn5150.fw" @@ -1182,7 +1182,7 @@ iwn6000fw.fwo optional iwn6000fw | iwn no-implicit-rule \ clean "iwn6000fw.fwo" iwn6000.fw optional iwn6000fw | iwnfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \ no-obj no-implicit-rule \ clean "iwn6000.fw" @@ -1365,7 +1365,7 @@ mw88W8363.fwo optional mwlfw \ no-implicit-rule \ clean "mw88W8363.fwo" mw88W8363.fw optional mwlfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/mwl/mw88W8363.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu" \ no-obj no-implicit-rule \ clean "mw88W8363.fw" @@ -1375,7 +1375,7 @@ mwlboot.fwo optional mwlfw \ no-implicit-rule \ clean "mwlboot.fwo" mwlboot.fw optional mwlfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/mwl/mwlboot.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu" \ no-obj no-implicit-rule \ clean "mwlboot.fw" @@ -1487,7 +1487,7 @@ rt2561fw.fwo optional rt2561fw | ralfw no-implicit-rule \ clean "rt2561fw.fwo" rt2561.fw optional rt2561fw | ralfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/ral/rt2561.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \ no-obj no-implicit-rule \ clean "rt2561.fw" @@ -1501,7 +1501,7 @@ rt2561sfw.fwo optional rt2561sfw | ral no-implicit-rule \ clean "rt2561sfw.fwo" rt2561s.fw optional rt2561sfw | ralfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/ral/rt2561s.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu" \ no-obj no-implicit-rule \ clean "rt2561s.fw" @@ -1515,7 +1515,7 @@ rt2661fw.fwo optional rt2661fw | ralfw no-implicit-rule \ clean "rt2661fw.fwo" rt2661.fw optional rt2661fw | ralfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/ral/rt2661.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu" \ no-obj no-implicit-rule \ clean "rt2661.fw" @@ -1529,7 +1529,7 @@ rt2860fw.fwo optional rt2860fw | ralfw no-implicit-rule \ clean "rt2860fw.fwo" rt2860.fw optional rt2860fw | ralfw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/ral/rt2860.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu" \ no-obj no-implicit-rule \ clean "rt2860.fw" @@ -1894,7 +1894,7 @@ wpifw.fwo optional wpifw \ no-implicit-rule \ clean "wpifw.fwo" wpi.fw optional wpifw \ - dependency ".PHONY" \ + dependency "$S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu" \ no-obj no-implicit-rule \ clean "wpi.fw" From owner-svn-src-stable-8@FreeBSD.ORG Sun Oct 7 21:33:05 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27D9110656C2; Sun, 7 Oct 2012 21:33: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 0F5168FC14; Sun, 7 Oct 2012 21:33:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q97LX5nG074178; Sun, 7 Oct 2012 21:33:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q97LX4eC074175; Sun, 7 Oct 2012 21:33:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210072133.q97LX4eC074175@svn.freebsd.org> From: John Baldwin Date: Sun, 7 Oct 2012 21:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241335 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 21:33:05 -0000 Author: jhb Date: Sun Oct 7 21:33:04 2012 New Revision: 241335 URL: http://svn.freebsd.org/changeset/base/241335 Log: MFC 239955-239957: Cleanups and fixes for building firmware modules into a kernel: - Add common rules for building firmware object files (NORMAL_FW to run uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those instead of explicit ld/uudecode invocations in sys/conf/files. Apart from increasing readability, this makes it possible to adjust the flags used for firmware objects in one place. - Similar to how r171350 fixed linking of kernel modules containing firmware objects by adding --no-warn-mismatch to the linker flags, add --no-warn-mismatch when linking firmware objects (*.fwo) as well as to the link of the main kernel file. This permits firmware modules to be statically linked into an ia64 kernel. Modified: stable/8/sys/conf/files stable/8/sys/conf/kern.pre.mk Directory Properties: stable/8/sys/ (props changed) stable/8/sys/conf/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Sun Oct 7 21:32:41 2012 (r241334) +++ stable/8/sys/conf/files Sun Oct 7 21:33:04 2012 (r241335) @@ -1023,12 +1023,12 @@ ipwbssfw.c optional ipwbssfw | ipwfw clean "ipwbssfw.c" ipw_bss.fwo optional ipwbssfw | ipwfw \ dependency "ipw_bss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_bss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ipw_bss.fwo" ipw_bss.fw optional ipwbssfw | ipwfw \ dependency "$S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_bss.fw" ipwibssfw.c optional ipwibssfw | ipwfw \ @@ -1037,12 +1037,12 @@ ipwibssfw.c optional ipwibssfw | ipwfw clean "ipwibssfw.c" ipw_ibss.fwo optional ipwibssfw | ipwfw \ dependency "ipw_ibss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_ibss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ipw_ibss.fwo" ipw_ibss.fw optional ipwibssfw | ipwfw \ dependency "$S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_ibss.fw" ipwmonitorfw.c optional ipwmonitorfw | ipwfw \ @@ -1051,12 +1051,12 @@ ipwmonitorfw.c optional ipwmonitorfw | clean "ipwmonitorfw.c" ipw_monitor.fwo optional ipwmonitorfw | ipwfw \ dependency "ipw_monitor.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_monitor.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ipw_monitor.fwo" ipw_monitor.fw optional ipwmonitorfw | ipwfw \ dependency "$S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_monitor.fw" dev/iscsi/initiator/iscsi.c optional iscsi_initiator scbus @@ -1079,12 +1079,12 @@ iwibssfw.c optional iwibssfw | iwifw clean "iwibssfw.c" iwi_bss.fwo optional iwibssfw | iwifw \ dependency "iwi_bss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_bss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwi_bss.fwo" iwi_bss.fw optional iwibssfw | iwifw \ dependency "$S/contrib/dev/iwi/ipw2200-bss.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_bss.fw" iwiibssfw.c optional iwiibssfw | iwifw \ @@ -1093,12 +1093,12 @@ iwiibssfw.c optional iwiibssfw | iwifw clean "iwiibssfw.c" iwi_ibss.fwo optional iwiibssfw | iwifw \ dependency "iwi_ibss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_ibss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwi_ibss.fwo" iwi_ibss.fw optional iwiibssfw | iwifw \ dependency "$S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_ibss.fw" iwimonitorfw.c optional iwimonitorfw | iwifw \ @@ -1107,12 +1107,12 @@ iwimonitorfw.c optional iwimonitorfw | clean "iwimonitorfw.c" iwi_monitor.fwo optional iwimonitorfw | iwifw \ dependency "iwi_monitor.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_monitor.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwi_monitor.fwo" iwi_monitor.fw optional iwimonitorfw | iwifw \ dependency "$S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_monitor.fw" dev/iwn/if_iwn.c optional iwn @@ -1122,12 +1122,12 @@ iwn1000fw.c optional iwn1000fw | iwnfw clean "iwn1000fw.c" iwn1000fw.fwo optional iwn1000fw | iwnfw \ dependency "iwn1000.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn1000.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn1000fw.fwo" iwn1000.fw optional iwn1000fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn1000.fw" iwn4965fw.c optional iwn4965fw | iwnfw \ @@ -1136,12 +1136,12 @@ iwn4965fw.c optional iwn4965fw | iwnfw clean "iwn4965fw.c" iwn4965fw.fwo optional iwn4965fw | iwnfw \ dependency "iwn4965.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn4965.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn4965fw.fwo" iwn4965.fw optional iwn4965fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn4965.fw" iwn5000fw.c optional iwn5000fw | iwnfw \ @@ -1150,12 +1150,12 @@ iwn5000fw.c optional iwn5000fw | iwnfw clean "iwn5000fw.c" iwn5000fw.fwo optional iwn5000fw | iwnfw \ dependency "iwn5000.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5000.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn5000fw.fwo" iwn5000.fw optional iwn5000fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn5000.fw" iwn5150fw.c optional iwn5150fw | iwnfw \ @@ -1164,12 +1164,12 @@ iwn5150fw.c optional iwn5150fw | iwnfw clean "iwn5150fw.c" iwn5150fw.fwo optional iwn5150fw | iwnfw \ dependency "iwn5150.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5150.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn5150fw.fwo" iwn5150.fw optional iwn5150fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu"\ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn5150.fw" iwn6000fw.c optional iwn6000fw | iwnfw \ @@ -1178,12 +1178,12 @@ iwn6000fw.c optional iwn6000fw | iwnfw clean "iwn6000fw.c" iwn6000fw.fwo optional iwn6000fw | iwnfw \ dependency "iwn6000.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6000fw.fwo" iwn6000.fw optional iwn6000fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6000.fw" iwn6000g2afw.c optional iwn6000g2afw | iwnfw \ @@ -1192,12 +1192,12 @@ iwn6000g2afw.c optional iwn6000g2afw | clean "iwn6000g2afw.c" iwn6000g2afw.fwo optional iwn6000g2afw | iwnfw \ dependency "iwn6000g2a.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2a.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6000g2afw.fwo" iwn6000g2a.fw optional iwn6000g2afw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6000g2a.fw" iwn6000g2bfw.c optional iwn6000g2bfw | iwnfw \ @@ -1206,12 +1206,12 @@ iwn6000g2bfw.c optional iwn6000g2bfw | clean "iwn6000g2bfw.c" iwn6000g2bfw.fwo optional iwn6000g2bfw | iwnfw \ dependency "iwn6000g2b.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2b.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6000g2bfw.fwo" iwn6000g2b.fw optional iwn6000g2bfw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6000g2b.fw" iwn6050fw.c optional iwn6050fw | iwnfw \ @@ -1220,12 +1220,12 @@ iwn6050fw.c optional iwn6050fw | iwnfw clean "iwn6050fw.c" iwn6050fw.fwo optional iwn6050fw | iwnfw \ dependency "iwn6050.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6050.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6050fw.fwo" iwn6050.fw optional iwn6050fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6050.fw" dev/ixgb/if_ixgb.c optional ixgb @@ -1361,22 +1361,22 @@ mwlfw.c optional mwlfw \ clean "mwlfw.c" mw88W8363.fwo optional mwlfw \ dependency "mw88W8363.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mw88W8363.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "mw88W8363.fwo" mw88W8363.fw optional mwlfw \ dependency "$S/contrib/dev/mwl/mw88W8363.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "mw88W8363.fw" mwlboot.fwo optional mwlfw \ dependency "mwlboot.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mwlboot.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "mwlboot.fwo" mwlboot.fw optional mwlfw \ dependency "$S/contrib/dev/mwl/mwlboot.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "mwlboot.fw" dev/mxge/if_mxge.c optional mxge pci @@ -1483,12 +1483,12 @@ rt2561fw.c optional rt2561fw | ralfw clean "rt2561fw.c" rt2561fw.fwo optional rt2561fw | ralfw \ dependency "rt2561.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2561fw.fwo" rt2561.fw optional rt2561fw | ralfw \ dependency "$S/contrib/dev/ral/rt2561.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2561.fw" rt2561sfw.c optional rt2561sfw | ralfw \ @@ -1497,12 +1497,12 @@ rt2561sfw.c optional rt2561sfw | ralfw clean "rt2561sfw.c" rt2561sfw.fwo optional rt2561sfw | ralfw \ dependency "rt2561s.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2561sfw.fwo" rt2561s.fw optional rt2561sfw | ralfw \ dependency "$S/contrib/dev/ral/rt2561s.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2561s.fw" rt2661fw.c optional rt2661fw | ralfw \ @@ -1511,12 +1511,12 @@ rt2661fw.c optional rt2661fw | ralfw clean "rt2661fw.c" rt2661fw.fwo optional rt2661fw | ralfw \ dependency "rt2661.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2661fw.fwo" rt2661.fw optional rt2661fw | ralfw \ dependency "$S/contrib/dev/ral/rt2661.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2661.fw" rt2860fw.c optional rt2860fw | ralfw \ @@ -1525,12 +1525,12 @@ rt2860fw.c optional rt2860fw | ralfw clean "rt2860fw.c" rt2860fw.fwo optional rt2860fw | ralfw \ dependency "rt2860.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2860fw.fwo" rt2860.fw optional rt2860fw | ralfw \ dependency "$S/contrib/dev/ral/rt2860.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2860.fw" dev/random/harvest.c standard @@ -1890,12 +1890,12 @@ wpifw.c optional wpifw \ clean "wpifw.c" wpifw.fwo optional wpifw \ dependency "wpi.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "wpifw.fwo" wpi.fw optional wpifw \ dependency "$S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "wpi.fw" dev/xe/if_xe.c optional xe Modified: stable/8/sys/conf/kern.pre.mk ============================================================================== --- stable/8/sys/conf/kern.pre.mk Sun Oct 7 21:32:41 2012 (r241334) +++ stable/8/sys/conf/kern.pre.mk Sun Oct 7 21:33:04 2012 (r241335) @@ -131,6 +131,10 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${ NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c +NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} +NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \ + -o ${.TARGET} ${.ALLSRC:M*.fw} + .if defined(CTFCONVERT) NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .else @@ -149,7 +153,7 @@ SYSTEM_OBJS+= hack.So SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o LD+= -g .endif -SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \ +SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} --no-warn-mismatch \ -warn-common -export-dynamic -dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ From owner-svn-src-stable-8@FreeBSD.ORG Mon Oct 8 05:51:26 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE7461065680; Mon, 8 Oct 2012 05:51:26 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD9C88FC08; Mon, 8 Oct 2012 05:51:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q985pQOq040861; Mon, 8 Oct 2012 05:51:26 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q985pQck040858; Mon, 8 Oct 2012 05:51:26 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201210080551.q985pQck040858@svn.freebsd.org> From: Doug Barton Date: Mon, 8 Oct 2012 05:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241338 - stable/8/usr.sbin/mergemaster X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2012 05:51:27 -0000 Author: dougb Date: Mon Oct 8 05:51:26 2012 New Revision: 241338 URL: http://svn.freebsd.org/changeset/base/241338 Log: MFC r241218: Remove references to CVS so that people will stop bringing it up For -p: The localtime update should have been excluded in the first place The make.conf comparison has been OBE for some time now, and there is no src.conf equivalent to share/examples/make.conf, so remove the whole thing. Update copyright Modified: stable/8/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/8/usr.sbin/mergemaster/ (props changed) Modified: stable/8/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/8/usr.sbin/mergemaster/mergemaster.sh Mon Oct 8 05:50:58 2012 (r241337) +++ stable/8/usr.sbin/mergemaster/mergemaster.sh Mon Oct 8 05:51:26 2012 (r241338) @@ -5,8 +5,8 @@ # Compare files created by /usr/src/etc/Makefile (or the directory # the user specifies) with the currently installed copies. -# Copyright 1998-2011 Douglas Barton -# dougb@FreeBSD.org +# Copyright (c) 1998-2012 Douglas Barton, All rights reserved +# Please see detailed copyright below # $FreeBSD$ @@ -532,9 +532,9 @@ if [ -t 0 ]; then esac fi -# Define what CVS $Id tag to look for to aid portability. +# Define what $Id tag to look for to aid portability. # -CVS_ID_TAG=FreeBSD +ID_TAG=FreeBSD delete_temproot () { rm -rf "${TEMPROOT}" 2>/dev/null @@ -1097,17 +1097,17 @@ for COMPFILE in `find . -type f | sort`; case "${STRICT}" in '' | [Nn][Oo]) - # Compare CVS $Id's first so if the file hasn't been modified + # Compare $Id's first so if the file hasn't been modified # local changes will be ignored. # If the files have the same $Id, delete the one in temproot so the # user will have less to wade through if files are left to merge by hand. # - CVSID1=`grep "[$]${CVS_ID_TAG}:" ${DESTDIR}${COMPFILE#.} 2>/dev/null` - CVSID2=`grep "[$]${CVS_ID_TAG}:" ${COMPFILE} 2>/dev/null` || CVSID2=none + ID1=`grep "[$]${ID_TAG}:" ${DESTDIR}${COMPFILE#.} 2>/dev/null` + ID2=`grep "[$]${ID_TAG}:" ${COMPFILE} 2>/dev/null` || ID2=none - case "${CVSID2}" in - "${CVSID1}") - echo " *** Temp ${COMPFILE} and installed have the same CVS Id, deleting" + case "${ID2}" in + "${ID1}") + echo " *** Temp ${COMPFILE} and installed have the same Id, deleting" rm "${COMPFILE}" ;; esac @@ -1336,7 +1336,7 @@ case "${NEED_PWD_MKDB}" in ;; esac -if [ -e "${DESTDIR}/etc/localtime" ]; then # Ignore if TZ == UTC +if [ -e "${DESTDIR}/etc/localtime" -a -z "${PRE_WORLD}" ]; then # Ignore if TZ == UTC echo '' [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}" if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then @@ -1382,29 +1382,35 @@ case "${COMP_CONFS}" in ;; esac -case "${PRE_WORLD}" in -'') ;; -*) - MAKE_CONF="${SOURCEDIR}/share/examples/etc/make.conf" - - (echo '' - echo '*** Comparing make variables' - echo '' - echo "*** From ${DESTDIR}/etc/make.conf" - echo "*** From ${MAKE_CONF}" - - for MAKE_VAR in `grep -i ^[a-z] ${DESTDIR}/etc/make.conf | cut -d '=' -f 1`; do - echo '' - grep -w ^${MAKE_VAR} ${DESTDIR}/etc/make.conf - grep -w ^#${MAKE_VAR} ${MAKE_CONF} || - echo ' * No example variable with this name' - done) | ${PAGER} - ;; -esac - if [ -n "${PRESERVE_FILES}" ]; then find -d $PRESERVE_FILES_DIR -type d -empty -delete 2>/dev/null rmdir $PRESERVE_FILES_DIR 2>/dev/null fi exit 0 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Copyright (c) 1998-2012 Douglas Barton +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. From owner-svn-src-stable-8@FreeBSD.ORG Mon Oct 8 13:14:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A6C21065670; Mon, 8 Oct 2012 13:14:01 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E51EF8FC0C; Mon, 8 Oct 2012 13:14:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q98DE0Fg006082; Mon, 8 Oct 2012 13:14:00 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q98DE0Rn006080; Mon, 8 Oct 2012 13:14:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201210081314.q98DE0Rn006080@svn.freebsd.org> From: Rick Macklem Date: Mon, 8 Oct 2012 13:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241348 - stable/8/usr.sbin/mountd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2012 13:14:01 -0000 Author: rmacklem Date: Mon Oct 8 13:14:00 2012 New Revision: 241348 URL: http://svn.freebsd.org/changeset/base/241348 Log: MFC: r240902 Attila Bogar reported a bug in mountd when multiple export entries with different security flavors are in the exports(5) file. For that case, mountd replies with the security flavors of the last entry and not the correct one for the client host. This patch fixes that by storing separate copies of the flavors for each host/net case, plus a default one for the case where no hosts/nets are specified on an entry in the exports(5) file. Unlike the patch in the PR, it replies with the security flavors for the entry instead of merging the security flavors for all the entries and replying with that. Modified: stable/8/usr.sbin/mountd/mountd.c Directory Properties: stable/8/usr.sbin/mountd/ (props changed) Modified: stable/8/usr.sbin/mountd/mountd.c ============================================================================== --- stable/8/usr.sbin/mountd/mountd.c Mon Oct 8 12:59:09 2012 (r241347) +++ stable/8/usr.sbin/mountd/mountd.c Mon Oct 8 13:14:00 2012 (r241348) @@ -117,6 +117,8 @@ struct exportlist { char *ex_indexfile; int ex_numsecflavors; int ex_secflavors[MAXSECFLAVORS]; + int ex_defnumsecflavors; + int ex_defsecflavors[MAXSECFLAVORS]; }; /* ex_flag bits */ #define EX_LINKED 0x1 @@ -136,6 +138,8 @@ struct grouplist { int gr_type; union grouptypes gr_ptr; struct grouplist *gr_next; + int gr_numsecflavors; + int gr_secflavors[MAXSECFLAVORS]; }; /* Group types */ #define GT_NULL 0x0 @@ -163,12 +167,13 @@ struct fhreturn { /* Global defs */ char *add_expdir(struct dirlist **, char *, int); void add_dlist(struct dirlist **, struct dirlist *, - struct grouplist *, int); + struct grouplist *, int, struct exportlist *); void add_mlist(char *, char *); int check_dirpath(char *); int check_options(struct dirlist *); int checkmask(struct sockaddr *sa); -int chk_host(struct dirlist *, struct sockaddr *, int *, int *); +int chk_host(struct dirlist *, struct sockaddr *, int *, int *, int *, + int **); static int create_service(struct netconfig *nconf); static void complete_service(struct netconfig *nconf, char *port_str); static void clearout_service(void); @@ -938,6 +943,7 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *t char rpcpath[MNTPATHLEN + 1], dirpath[MAXPATHLEN]; int bad = 0, defset, hostset; sigset_t sighup_mask; + int numsecflavors, *secflavorsp; sigemptyset(&sighup_mask); sigaddset(&sighup_mask, SIGHUP); @@ -1000,9 +1006,11 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *t sigprocmask(SIG_BLOCK, &sighup_mask, NULL); ep = ex_search(&fsb.f_fsid); hostset = defset = 0; - if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset) || + if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset, + &numsecflavors, &secflavorsp) || ((dp = dirp_search(ep->ex_dirl, dirpath)) && - chk_host(dp, saddr, &defset, &hostset)) || + chk_host(dp, saddr, &defset, &hostset, &numsecflavors, + &secflavorsp)) || (defset && scan_tree(ep->ex_defdir, saddr) == 0 && scan_tree(ep->ex_dirl, saddr) == 0))) { if (bad) { @@ -1012,10 +1020,15 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *t sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL); return; } - if (hostset & DP_HOSTSET) + if (hostset & DP_HOSTSET) { fhr.fhr_flag = hostset; - else + fhr.fhr_numsecflavors = numsecflavors; + fhr.fhr_secflavors = secflavorsp; + } else { fhr.fhr_flag = defset; + fhr.fhr_numsecflavors = ep->ex_defnumsecflavors; + fhr.fhr_secflavors = ep->ex_defsecflavors; + } fhr.fhr_vers = rqstp->rq_vers; /* Get the file handle */ memset(&fhr.fhr_fh, 0, sizeof(nfsfh_t)); @@ -1028,8 +1041,6 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *t sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL); return; } - fhr.fhr_numsecflavors = ep->ex_numsecflavors; - fhr.fhr_secflavors = ep->ex_secflavors; if (!svc_sendreply(transp, (xdrproc_t)xdr_fhs, (caddr_t)&fhr)) syslog(LOG_ERR, "can't send reply"); @@ -1884,11 +1895,21 @@ hang_dirp(struct dirlist *dp, struct gro ep->ex_defdir = dp; if (grp == (struct grouplist *)NULL) { ep->ex_defdir->dp_flag |= DP_DEFSET; + /* Save the default security flavors list. */ + ep->ex_defnumsecflavors = ep->ex_numsecflavors; + if (ep->ex_numsecflavors > 0) + memcpy(ep->ex_defsecflavors, ep->ex_secflavors, + sizeof(ep->ex_secflavors)); } else while (grp) { hp = get_ht(); hp->ht_grp = grp; hp->ht_next = ep->ex_defdir->dp_hosts; ep->ex_defdir->dp_hosts = hp; + /* Save the security flavors list for this host set. */ + grp->gr_numsecflavors = ep->ex_numsecflavors; + if (ep->ex_numsecflavors > 0) + memcpy(grp->gr_secflavors, ep->ex_secflavors, + sizeof(ep->ex_secflavors)); grp = grp->gr_next; } } else { @@ -1898,7 +1919,7 @@ hang_dirp(struct dirlist *dp, struct gro */ while (dp) { dp2 = dp->dp_left; - add_dlist(&ep->ex_dirl, dp, grp, flags); + add_dlist(&ep->ex_dirl, dp, grp, flags, ep); dp = dp2; } } @@ -1910,7 +1931,7 @@ hang_dirp(struct dirlist *dp, struct gro */ void add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp, - int flags) + int flags, struct exportlist *ep) { struct dirlist *dp; struct hostlist *hp; @@ -1920,10 +1941,10 @@ add_dlist(struct dirlist **dpp, struct d if (dp) { cmp = strcmp(dp->dp_dirp, newdp->dp_dirp); if (cmp > 0) { - add_dlist(&dp->dp_left, newdp, grp, flags); + add_dlist(&dp->dp_left, newdp, grp, flags, ep); return; } else if (cmp < 0) { - add_dlist(&dp->dp_right, newdp, grp, flags); + add_dlist(&dp->dp_right, newdp, grp, flags, ep); return; } else free((caddr_t)newdp); @@ -1942,10 +1963,20 @@ add_dlist(struct dirlist **dpp, struct d hp->ht_grp = grp; hp->ht_next = dp->dp_hosts; dp->dp_hosts = hp; + /* Save the security flavors list for this host set. */ + grp->gr_numsecflavors = ep->ex_numsecflavors; + if (ep->ex_numsecflavors > 0) + memcpy(grp->gr_secflavors, ep->ex_secflavors, + sizeof(ep->ex_secflavors)); grp = grp->gr_next; } while (grp); } else { dp->dp_flag |= DP_DEFSET; + /* Save the default security flavors list. */ + ep->ex_defnumsecflavors = ep->ex_numsecflavors; + if (ep->ex_numsecflavors > 0) + memcpy(ep->ex_defsecflavors, ep->ex_secflavors, + sizeof(ep->ex_secflavors)); } } @@ -1974,7 +2005,7 @@ dirp_search(struct dirlist *dp, char *di */ int chk_host(struct dirlist *dp, struct sockaddr *saddr, int *defsetp, - int *hostsetp) + int *hostsetp, int *numsecflavors, int **secflavorsp) { struct hostlist *hp; struct grouplist *grp; @@ -1993,6 +2024,12 @@ chk_host(struct dirlist *dp, struct sock if (!sacmp(ai->ai_addr, saddr, NULL)) { *hostsetp = (hp->ht_flag | DP_HOSTSET); + if (numsecflavors != NULL) { + *numsecflavors = + grp->gr_numsecflavors; + *secflavorsp = + grp->gr_secflavors; + } return (1); } } @@ -2003,6 +2040,12 @@ chk_host(struct dirlist *dp, struct sock (struct sockaddr *) &grp->gr_ptr.gt_net.nt_mask)) { *hostsetp = (hp->ht_flag | DP_HOSTSET); + if (numsecflavors != NULL) { + *numsecflavors = + grp->gr_numsecflavors; + *secflavorsp = + grp->gr_secflavors; + } return (1); } break; @@ -2024,7 +2067,7 @@ scan_tree(struct dirlist *dp, struct soc if (dp) { if (scan_tree(dp->dp_left, saddr)) return (1); - if (chk_host(dp, saddr, &defset, &hostset)) + if (chk_host(dp, saddr, &defset, &hostset, NULL, NULL)) return (1); if (scan_tree(dp->dp_right, saddr)) return (1); From owner-svn-src-stable-8@FreeBSD.ORG Mon Oct 8 14:05:00 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0164106566C; Mon, 8 Oct 2012 14:05:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4D6B8FC0A; Mon, 8 Oct 2012 14:05:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q98E50vA013131; Mon, 8 Oct 2012 14:05:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q98E50xm013129; Mon, 8 Oct 2012 14:05:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201210081405.q98E50xm013129@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 8 Oct 2012 14:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241350 - stable/8/libexec/atrun X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2012 14:05:00 -0000 Author: jilles Date: Mon Oct 8 14:05:00 2012 New Revision: 241350 URL: http://svn.freebsd.org/changeset/base/241350 Log: MFC r240974: atrun: Do not assume that MAXLOGNAME <= 100. The reserved space for fmt was exactly sufficient for a two-digit value of MAXLOGNAME - 1. PR: bin/171815 Submitted by: Jeremy Huddleston Sequoia Modified: stable/8/libexec/atrun/atrun.c Directory Properties: stable/8/libexec/atrun/ (props changed) Modified: stable/8/libexec/atrun/atrun.c ============================================================================== --- stable/8/libexec/atrun/atrun.c Mon Oct 8 13:45:40 2012 (r241349) +++ stable/8/libexec/atrun/atrun.c Mon Oct 8 14:05:00 2012 (r241350) @@ -130,7 +130,7 @@ run_file(const char *filename, uid_t uid pid_t pid; int fd_out, fd_in; int queue; - char mailbuf[LOGNAMESIZE + 1], fmt[49]; + char mailbuf[LOGNAMESIZE + 1], fmt[64]; char *mailname = NULL; FILE *stream; int send_mail = 0; From owner-svn-src-stable-8@FreeBSD.ORG Mon Oct 8 16:00:34 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DD97106566B; Mon, 8 Oct 2012 16:00:34 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 689858FC08; Mon, 8 Oct 2012 16:00:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q98G0YM8029854; Mon, 8 Oct 2012 16:00:34 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q98G0YYW029851; Mon, 8 Oct 2012 16:00:34 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201210081600.q98G0YYW029851@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 8 Oct 2012 16:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241352 - stable/8/usr.bin/find X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2012 16:00:34 -0000 Author: jilles Date: Mon Oct 8 16:00:33 2012 New Revision: 241352 URL: http://svn.freebsd.org/changeset/base/241352 Log: MFC r240973: find: Do not pass fd to save current directory to child processes. This removes one of the two wrongly passed file descriptors. The other one appears to be from fts(3). Modified: stable/8/usr.bin/find/main.c Directory Properties: stable/8/usr.bin/find/ (props changed) Modified: stable/8/usr.bin/find/main.c ============================================================================== --- stable/8/usr.bin/find/main.c Mon Oct 8 14:08:13 2012 (r241351) +++ stable/8/usr.bin/find/main.c Mon Oct 8 16:00:33 2012 (r241352) @@ -154,7 +154,7 @@ main(int argc, char *argv[]) usage(); *p = NULL; - if ((dotfd = open(".", O_RDONLY, 0)) < 0) + if ((dotfd = open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) err(1, "."); exit(find_execute(find_formplan(argv), start)); From owner-svn-src-stable-8@FreeBSD.ORG Tue Oct 9 06:32:27 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BF1D107B; Tue, 9 Oct 2012 06:32:27 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EA7C8FC20; Tue, 9 Oct 2012 06:32:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9956UMS041278; Tue, 9 Oct 2012 05:06:30 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9956U2Z041272; Tue, 9 Oct 2012 05:06:30 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201210090506.q9956U2Z041272@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 9 Oct 2012 05:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241368 - in stable/8: tools/regression/usr.bin/make tools/regression/usr.bin/make/variables/modifier_t tools/regression/usr.bin/make/variables/opt_V usr.bin/make X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 06:32:27 -0000 Author: obrien Date: Tue Oct 9 05:06:30 2012 New Revision: 241368 URL: http://svn.freebsd.org/changeset/base/241368 Log: MF9: r237100: MFC r236338, r236339, r236346, r236347, r236365, & r236977 * Deprecate the FreeBSD 10's make's ":U" (to-upper case) and ":L" (to-lower case) modifiers for ":tu" and ":tl". * make it easier to test newly-built make. * Add "-V '${VAR}'" variable expansion from Portable Berkeley Make. * regression test for '-V' command line option and the :t[lu] modifiers. MF9: r241364: Update MAKE_VERSION for r237100. MFC: r201225: add missing `void' keyword. Added: stable/8/tools/regression/usr.bin/make/test-new.mk - copied unchanged from r237100, stable/9/tools/regression/usr.bin/make/test-new.mk stable/8/tools/regression/usr.bin/make/variables/modifier_t/ - copied from r237100, stable/9/tools/regression/usr.bin/make/variables/modifier_t/ stable/8/tools/regression/usr.bin/make/variables/opt_V/ - copied from r237100, stable/9/tools/regression/usr.bin/make/variables/opt_V/ Modified: stable/8/usr.bin/make/Makefile stable/8/usr.bin/make/job.c stable/8/usr.bin/make/make.1 stable/8/usr.bin/make/var.c Directory Properties: stable/8/ (props changed) stable/8/tools/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/make/all.sh (props changed) stable/8/tools/regression/usr.bin/make/common.sh (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/make/ (props changed) Copied: stable/8/tools/regression/usr.bin/make/test-new.mk (from r237100, stable/9/tools/regression/usr.bin/make/test-new.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/usr.bin/make/test-new.mk Tue Oct 9 05:06:30 2012 (r241368, copy of r237100, stable/9/tools/regression/usr.bin/make/test-new.mk) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +NEW_DIR!= make -C ${.CURDIR}/../../../../usr.bin/make -V .OBJDIR + +all: + rm -rf /tmp/${USER}.make.test + env MAKE_PROG=${NEW_DIR}/make ${.SHELL} ./all.sh + +.include Modified: stable/8/usr.bin/make/Makefile ============================================================================== --- stable/8/usr.bin/make/Makefile Tue Oct 9 03:54:53 2012 (r241367) +++ stable/8/usr.bin/make/Makefile Tue Oct 9 05:06:30 2012 (r241368) @@ -11,7 +11,9 @@ SRCS= arch.c buf.c cond.c dir.c for.c ha WARNS?= 6 NO_SHARED?= YES -CFLAGS+=-DMAKE_VERSION=\"5200408120\" +# Version has the RYYYYMMDDX format, where R is from RELENG_ +CFLAGS+=-DMAKE_VERSION=\"8201210080\" + # There is no obvious performance improvement currently. # CFLAGS+=-DUSE_KQUEUE Modified: stable/8/usr.bin/make/job.c ============================================================================== --- stable/8/usr.bin/make/job.c Tue Oct 9 03:54:53 2012 (r241367) +++ stable/8/usr.bin/make/job.c Tue Oct 9 05:06:30 2012 (r241368) @@ -485,7 +485,7 @@ catch_child(int sig __unused) /** */ void -Proc_Init() +Proc_Init(void) { /* * Catch SIGCHLD so that we get kicked out of select() when we Modified: stable/8/usr.bin/make/make.1 ============================================================================== --- stable/8/usr.bin/make/make.1 Tue Oct 9 03:54:53 2012 (r241367) +++ stable/8/usr.bin/make/make.1 Tue Oct 9 05:06:30 2012 (r241368) @@ -32,7 +32,7 @@ .\" @(#)make.1 8.8 (Berkeley) 6/13/95 .\" $FreeBSD$ .\" -.Dd November 5, 2011 +.Dd May 30, 2012 .Dt MAKE 1 .Os .Sh NAME @@ -290,6 +290,11 @@ Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. +If +.Ar variable +contains a +.Sq Ic $ +then the value will be expanded before printing. .It Fl v Be extra verbose. Print any extra information. @@ -873,6 +878,7 @@ Replaces each word in the variable with .It Cm L Converts variable to lower-case letters. .It Cm M Ns Ar pattern +(deprecated) Select only those words that match the rest of the modifier. The standard shell wildcard characters .Pf ( Ql * , @@ -963,8 +969,13 @@ to be replaced in .Ar new_string . .It Cm T Replaces each word in the variable with its last component. +.It Cm tl +Converts variable to lower-case letters. +.It Cm tu +Converts variable to upper-case letters. .It Cm U Converts variable to upper-case letters. +(deprecated) .It Cm u Remove adjacent duplicate words (like .Xr uniq 1 ) . @@ -1711,6 +1722,19 @@ is set to the same value as .Va .MAKE ; support for this may be removed in the future. .Pp +The use of the +.Cm :L +and +.Cm :U +modifiers will be deprecated +in +.Fx 10.0 +and the more portable (among Pmake decedents) +.Cm :tl +and +.Cm :tu +should be used instead. +.Pp Most of the more esoteric features of .Nm should probably be avoided for greater compatibility. Modified: stable/8/usr.bin/make/var.c ============================================================================== --- stable/8/usr.bin/make/var.c Tue Oct 9 03:54:53 2012 (r241367) +++ stable/8/usr.bin/make/var.c Tue Oct 9 05:06:30 2012 (r241368) @@ -1748,6 +1748,19 @@ ParseModifier(VarParser *vp, char startc case 'C': newStr = modifier_C(vp, value, v); break; + case 't': + /* :tl :tu for OSF ODE & NetBSD make compatibility */ + switch (vp->ptr[1]) { + case 'l': + vp->ptr++; + goto mod_lower; + break; + case 'u': + vp->ptr++; + goto mod_upper; + break; + } + /* FALLTHROUGH */ default: if (vp->ptr[1] != endc && vp->ptr[1] != ':') { #ifdef SUNSHCMD @@ -1776,6 +1789,7 @@ ParseModifier(VarParser *vp, char startc switch (vp->ptr[0]) { case 'L': + mod_lower: { const char *cp; Buffer *buf; @@ -1801,6 +1815,7 @@ ParseModifier(VarParser *vp, char startc vp->ptr++; break; case 'U': + mod_upper: { const char *cp; Buffer *buf; @@ -2580,7 +2595,7 @@ void Var_Print(Lst *vlist, Boolean expandVars) { LstNode *n; - const char *name; + char *name; LST_FOREACH(n, vlist) { name = Lst_Datum(n); @@ -2588,13 +2603,17 @@ Var_Print(Lst *vlist, Boolean expandVars char *value; char *v; - v = emalloc(strlen(name) + 1 + 3); - sprintf(v, "${%s}", name); - + if (*name == '$') { + v = name; + } else { + v = emalloc(strlen(name) + 1 + 3); + sprintf(v, "${%s}", name); + } value = Buf_Peel(Var_Subst(v, VAR_GLOBAL, FALSE)); printf("%s\n", value); - free(v); + if (v != name) + free(v); free(value); } else { const char *value = Var_Value(name, VAR_GLOBAL); From owner-svn-src-stable-8@FreeBSD.ORG Tue Oct 9 18:02:06 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5AAB1CB4; Tue, 9 Oct 2012 18:02:06 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27D498FC0C; Tue, 9 Oct 2012 18:02:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q99I26VI048656; Tue, 9 Oct 2012 18:02:06 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q99I25Wq048652; Tue, 9 Oct 2012 18:02:05 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201210091802.q99I25Wq048652@svn.freebsd.org> From: Sean Bruno Date: Tue, 9 Oct 2012 18:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241376 - stable/8/sys/dev/e1000 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 18:02:06 -0000 Author: sbruno Date: Tue Oct 9 18:02:05 2012 New Revision: 241376 URL: http://svn.freebsd.org/changeset/base/241376 Log: MFC r240879 This patch fixes a nit in the em, lem, and igb driver statistics. Increment adapter->dropped_pkts instead of if_ierrors because if_ierrors is overwritten by hw stats collection. Submitted by: Andrew Boyer Reviewed by: Jack F Vogel Modified: stable/8/sys/dev/e1000/if_em.c stable/8/sys/dev/e1000/if_igb.c stable/8/sys/dev/e1000/if_lem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/e1000/if_em.c ============================================================================== --- stable/8/sys/dev/e1000/if_em.c Tue Oct 9 17:06:31 2012 (r241375) +++ stable/8/sys/dev/e1000/if_em.c Tue Oct 9 18:02:05 2012 (r241376) @@ -4336,7 +4336,7 @@ em_rxeof(struct rx_ring *rxr, int count, if ((cur->errors & E1000_RXD_ERR_FRAME_ERR_MASK) || (rxr->discard == TRUE)) { - ifp->if_ierrors++; + adapter->dropped_pkts++; ++rxr->rx_discarded; if (!eop) /* Catch subsequent segs */ rxr->discard = TRUE; Modified: stable/8/sys/dev/e1000/if_igb.c ============================================================================== --- stable/8/sys/dev/e1000/if_igb.c Tue Oct 9 17:06:31 2012 (r241375) +++ stable/8/sys/dev/e1000/if_igb.c Tue Oct 9 18:02:05 2012 (r241376) @@ -4610,7 +4610,7 @@ igb_rxeof(struct igb_queue *que, int cou /* Make sure all segments of a bad packet are discarded */ if (((staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) != 0) || (rxr->discard)) { - ifp->if_ierrors++; + adapter->dropped_pkts++; ++rxr->rx_discarded; if (!eop) /* Catch subsequent segs */ rxr->discard = TRUE; Modified: stable/8/sys/dev/e1000/if_lem.c ============================================================================== --- stable/8/sys/dev/e1000/if_lem.c Tue Oct 9 17:06:31 2012 (r241375) +++ stable/8/sys/dev/e1000/if_lem.c Tue Oct 9 18:02:05 2012 (r241376) @@ -3522,7 +3522,7 @@ skip: adapter->lmp = NULL; } } else { - ifp->if_ierrors++; + adapter->dropped_pkts++; discard: /* Reuse loaded DMA map and just update mbuf chain */ mp = adapter->rx_buffer_area[i].m_head; From owner-svn-src-stable-8@FreeBSD.ORG Tue Oct 9 18:45:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2EBE28FA; Tue, 9 Oct 2012 18:45:09 +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 150D18FC1A; Tue, 9 Oct 2012 18:45:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q99Ij9Lj054577; Tue, 9 Oct 2012 18:45:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q99Ij88H054570; Tue, 9 Oct 2012 18:45:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210091845.q99Ij88H054570@svn.freebsd.org> From: John Baldwin Date: Tue, 9 Oct 2012 18:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241378 - in stable/8/sys/dev: cardbus pci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 18:45:09 -0000 Author: jhb Date: Tue Oct 9 18:45:08 2012 New Revision: 241378 URL: http://svn.freebsd.org/changeset/base/241378 Log: MFC 201279,201280,201286,213907,214146,220195,222753,223371,225515,235833: Various fixes to managing PCI BARs including proper support for managing PCI ROM BARs: - Teach the PCI bus driver to handle PCIR_BIOS BARs properly and remove special handling for the PCIR_BIOS decoding enable bit from the cardbus driver. The PCIR_BIOS BAR does include type bits like other BARs. Instead, it is always a 32-bit non-prefetchable memory BAR where the low bit is used as a flag to enable decoding. - Explicitly track the state of all known BARs for each PCI device. The PCI bus driver will now remember the size of a BAR obtained during the initial bus scan and use that size when doing lazy resource allocation rather than resizing the BAR. The bus driver will now also report unallocated BARs to userland for display by 'pciconf -lb'. - Add a constant for the offset of the ROM BIOS BAR in PCI-PCI bridges and properly handle ROM BIOS BARs in PCI-PCI bridges. The PCI bus now also properly handles the lack of a ROM BIOS BAR in a PCI-Cardbus bridge. Tested by: John Kozubik john kozubik com Modified: stable/8/sys/dev/cardbus/cardbus_cis.c stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci_private.h stable/8/sys/dev/pci/pci_user.c stable/8/sys/dev/pci/pcireg.h stable/8/sys/dev/pci/pcivar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cardbus/ (props changed) stable/8/sys/dev/pci/ (props changed) Modified: stable/8/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- stable/8/sys/dev/cardbus/cardbus_cis.c Tue Oct 9 18:02:09 2012 (r241377) +++ stable/8/sys/dev/cardbus/cardbus_cis.c Tue Oct 9 18:45:08 2012 (r241378) @@ -324,7 +324,7 @@ decode_tuple_bar(device_t cbdev, device_ * hint when the cardbus bridge is a child of pci0 (the main * bus). The PC Card spec seems to indicate that this should * only be done on x86 based machines, which suggests that on - * non-x86 machines the adddresses can be anywhere. Since the + * non-x86 machines the addresses can be anywhere. Since the * hardware can do it on non-x86 machines, it should be able * to do it on x86 machines too. Therefore, we can and should * ignore this hint. Furthermore, the PC Card spec recommends @@ -435,9 +435,7 @@ cardbus_read_tuple_finish(device_t cbdev { if (res != CIS_CONFIG_SPACE) { bus_release_resource(child, SYS_RES_MEMORY, rid, res); - if (rid == PCIM_CIS_ASI_ROM) - pci_write_config(child, rid, pci_read_config(child, - rid, 4) & ~PCIR_BIOS, 4); + bus_delete_resource(child, SYS_RES_MEMORY, rid); } } @@ -474,7 +472,7 @@ cardbus_read_tuple_init(device_t cbdev, } /* allocate the memory space to read CIS */ - res = bus_alloc_resource(child, SYS_RES_MEMORY, rid, 0, ~0, 1, + res = bus_alloc_resource_any(child, SYS_RES_MEMORY, rid, rman_make_alignment_flags(4096) | RF_ACTIVE); if (res == NULL) { device_printf(cbdev, "Unable to allocate resource " @@ -482,9 +480,6 @@ cardbus_read_tuple_init(device_t cbdev, return (NULL); } DEVPRINTF((cbdev, "CIS Mapped to %#lx\n", rman_get_start(res))); - if (*rid == PCIR_BIOS) - pci_write_config(child, *rid, - rman_get_start(res) | PCIM_BIOS_ENABLE, 4); /* Flip to the right ROM image if CIS is in ROM */ if (space == PCIM_CIS_ASI_ROM) { @@ -508,8 +503,8 @@ cardbus_read_tuple_init(device_t cbdev, device_printf(cbdev, "Bad header in rom %d: " "[%x] %04x\n", romnum, imagebase + CARDBUS_EXROM_SIGNATURE, romsig); - bus_release_resource(child, SYS_RES_MEMORY, - *rid, res); + cardbus_read_tuple_finish(cbdev, child, *rid, + res); *rid = 0; return (NULL); } @@ -545,8 +540,8 @@ cardbus_read_tuple_init(device_t cbdev, CARDBUS_EXROM_DATA_INDICATOR) & 0x80) != 0) { device_printf(cbdev, "Cannot find CIS in " "Option ROM\n"); - bus_release_resource(child, SYS_RES_MEMORY, - *rid, res); + cardbus_read_tuple_finish(cbdev, child, *rid, + res); *rid = 0; return (NULL); } Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Tue Oct 9 18:02:09 2012 (r241377) +++ stable/8/sys/dev/pci/pci.c Tue Oct 9 18:45:08 2012 (r241378) @@ -91,10 +91,16 @@ __FBSDID("$FreeBSD$"); #endif #endif +#define PCIR_IS_BIOS(cfg, reg) \ + (((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \ + ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1)) + static pci_addr_t pci_mapbase(uint64_t mapreg); static const char *pci_maptype(uint64_t mapreg); static int pci_mapsize(uint64_t testval); static int pci_maprange(uint64_t mapreg); +static pci_addr_t pci_rombase(uint64_t mapreg); +static int pci_romsize(uint64_t testval); static void pci_fixancient(pcicfgregs *cfg); static int pci_printf(pcicfgregs *cfg, const char *fmt, ...); @@ -162,7 +168,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_activate_resource, pci_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method), DEVMETHOD(bus_child_location_str, pci_child_location_str_method), DEVMETHOD(bus_remap_intr, pci_remap_intr_method), @@ -324,7 +330,7 @@ static int pci_usb_takeover = 1; static int pci_usb_takeover = 0; #endif TUNABLE_INT("hw.pci.usb_early_takeover", &pci_usb_takeover); -SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RD | CTLFLAG_TUN, +SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RDTUN, &pci_usb_takeover, 1, "Enable early takeover of USB controllers.\n\ Disable this if you depend on BIOS emulation of USB devices, that is\n\ you use USB devices (like keyboard or mouse) but do not load USB drivers"); @@ -447,6 +453,34 @@ pci_mapsize(uint64_t testval) return (ln2size); } +/* return base address of device ROM */ + +static pci_addr_t +pci_rombase(uint64_t mapreg) +{ + + return (mapreg & PCIM_BIOS_ADDR_MASK); +} + +/* return log2 of map size decided for device ROM */ + +static int +pci_romsize(uint64_t testval) +{ + int ln2size; + + testval = pci_rombase(testval); + ln2size = 0; + if (testval != 0) { + while ((testval & 1) == 0) + { + ln2size++; + testval >>= 1; + } + } + return (ln2size); +} + /* return log2 of address range supported by map register */ static int @@ -551,6 +585,7 @@ pci_read_device(device_t pcib, int d, in cfg->mfdev = (cfg->hdrtype & PCIM_MFDEV) != 0; cfg->hdrtype &= ~PCIM_MFDEV; + STAILQ_INIT(&cfg->maps); pci_fixancient(cfg); pci_hdrtypedata(pcib, b, s, f, cfg); @@ -2124,6 +2159,7 @@ int pci_freecfg(struct pci_devinfo *dinfo) { struct devlist *devlist_head; + struct pci_map *pm, *next; int i; devlist_head = &pci_devq; @@ -2137,6 +2173,9 @@ pci_freecfg(struct pci_devinfo *dinfo) free(dinfo->cfg.vpd.vpd_w[i].value, M_DEVBUF); free(dinfo->cfg.vpd.vpd_w, M_DEVBUF); } + STAILQ_FOREACH_SAFE(pm, &dinfo->cfg.maps, pm_link, next) { + free(pm, M_DEVBUF); + } STAILQ_REMOVE(devlist_head, dinfo, pci_devinfo, pci_links); free(dinfo, M_DEVBUF); @@ -2411,10 +2450,27 @@ pci_memen(device_t dev) static void pci_read_bar(device_t dev, int reg, pci_addr_t *mapp, pci_addr_t *testvalp) { + struct pci_devinfo *dinfo; pci_addr_t map, testval; int ln2range; uint16_t cmd; + /* + * The device ROM BAR is special. It is always a 32-bit + * memory BAR. Bit 0 is special and should not be set when + * sizing the BAR. + */ + dinfo = device_get_ivars(dev); + if (PCIR_IS_BIOS(&dinfo->cfg, reg)) { + map = pci_read_config(dev, reg, 4); + pci_write_config(dev, reg, 0xfffffffe, 4); + testval = pci_read_config(dev, reg, 4); + pci_write_config(dev, reg, map, 4); + *mapp = map; + *testvalp = testval; + return; + } + map = pci_read_config(dev, reg, 4); ln2range = pci_maprange(map); if (ln2range == 64) @@ -2456,16 +2512,100 @@ pci_read_bar(device_t dev, int reg, pci_ } static void -pci_write_bar(device_t dev, int reg, pci_addr_t base) +pci_write_bar(device_t dev, struct pci_map *pm, pci_addr_t base) { - pci_addr_t map; + struct pci_devinfo *dinfo; int ln2range; - map = pci_read_config(dev, reg, 4); - ln2range = pci_maprange(map); - pci_write_config(dev, reg, base, 4); + /* The device ROM BAR is always a 32-bit memory BAR. */ + dinfo = device_get_ivars(dev); + if (PCIR_IS_BIOS(&dinfo->cfg, pm->pm_reg)) + ln2range = 32; + else + ln2range = pci_maprange(pm->pm_value); + pci_write_config(dev, pm->pm_reg, base, 4); if (ln2range == 64) - pci_write_config(dev, reg + 4, base >> 32, 4); + pci_write_config(dev, pm->pm_reg + 4, base >> 32, 4); + pm->pm_value = pci_read_config(dev, pm->pm_reg, 4); + if (ln2range == 64) + pm->pm_value |= (pci_addr_t)pci_read_config(dev, + pm->pm_reg + 4, 4) << 32; +} + +struct pci_map * +pci_find_bar(device_t dev, int reg) +{ + struct pci_devinfo *dinfo; + struct pci_map *pm; + + dinfo = device_get_ivars(dev); + STAILQ_FOREACH(pm, &dinfo->cfg.maps, pm_link) { + if (pm->pm_reg == reg) + return (pm); + } + return (NULL); +} + +int +pci_bar_enabled(device_t dev, struct pci_map *pm) +{ + struct pci_devinfo *dinfo; + uint16_t cmd; + + dinfo = device_get_ivars(dev); + if (PCIR_IS_BIOS(&dinfo->cfg, pm->pm_reg) && + !(pm->pm_value & PCIM_BIOS_ENABLE)) + return (0); + cmd = pci_read_config(dev, PCIR_COMMAND, 2); + if (PCIR_IS_BIOS(&dinfo->cfg, pm->pm_reg) || PCI_BAR_MEM(pm->pm_value)) + return ((cmd & PCIM_CMD_MEMEN) != 0); + else + return ((cmd & PCIM_CMD_PORTEN) != 0); +} + +static struct pci_map * +pci_add_bar(device_t dev, int reg, pci_addr_t value, pci_addr_t size) +{ + struct pci_devinfo *dinfo; + struct pci_map *pm, *prev; + + dinfo = device_get_ivars(dev); + pm = malloc(sizeof(*pm), M_DEVBUF, M_WAITOK | M_ZERO); + pm->pm_reg = reg; + pm->pm_value = value; + pm->pm_size = size; + STAILQ_FOREACH(prev, &dinfo->cfg.maps, pm_link) { + KASSERT(prev->pm_reg != pm->pm_reg, ("duplicate map %02x", + reg)); + if (STAILQ_NEXT(prev, pm_link) == NULL || + STAILQ_NEXT(prev, pm_link)->pm_reg > pm->pm_reg) + break; + } + if (prev != NULL) + STAILQ_INSERT_AFTER(&dinfo->cfg.maps, prev, pm, pm_link); + else + STAILQ_INSERT_TAIL(&dinfo->cfg.maps, pm, pm_link); + return (pm); +} + +static void +pci_restore_bars(device_t dev) +{ + struct pci_devinfo *dinfo; + struct pci_map *pm; + int ln2range; + + dinfo = device_get_ivars(dev); + STAILQ_FOREACH(pm, &dinfo->cfg.maps, pm_link) { + if (PCIR_IS_BIOS(&dinfo->cfg, pm->pm_reg)) + ln2range = 32; + else + ln2range = pci_maprange(pm->pm_value); + pci_write_config(dev, pm->pm_reg, pm->pm_value, 4); + if (ln2range == 64) + pci_write_config(dev, pm->pm_reg + 4, + pm->pm_value >> 32, 4); + } } /* @@ -2476,12 +2616,24 @@ static int pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl, int force, int prefetch) { + struct pci_map *pm; pci_addr_t base, map, testval; pci_addr_t start, end, count; int barlen, basezero, maprange, mapsize, type; uint16_t cmd; struct resource *res; + /* + * The BAR may already exist if the device is a CardBus card + * whose CIS is stored in this BAR. + */ + pm = pci_find_bar(dev, reg); + if (pm != NULL) { + maprange = pci_maprange(pm->pm_value); + barlen = maprange == 64 ? 2 : 1; + return (barlen); + } + pci_read_bar(dev, reg, &map, &testval); if (PCI_BAR_MEM(map)) { type = SYS_RES_MEMORY; @@ -2512,6 +2664,8 @@ pci_add_map(device_t bus, device_t dev, (type == SYS_RES_IOPORT && mapsize < 2)) return (barlen); + /* Save a record of this BAR. */ + pm = pci_add_bar(dev, reg, map, mapsize); if (bootverbose) { printf("\tmap[%02x]: type %s, range %2d, base %#jx, size %2d", reg, pci_maptype(map), maprange, (uintmax_t)base, mapsize); @@ -2573,7 +2727,7 @@ pci_add_map(device_t bus, device_t dev, count = (pci_addr_t)1 << mapsize; if (basezero || base == pci_mapbase(testval)) { start = 0; /* Let the parent decide. */ - end = ~0ULL; + end = ~0ul; } else { start = base; end = base + count - 1; @@ -2601,7 +2755,7 @@ pci_add_map(device_t bus, device_t dev, start = rman_get_start(res); rman_set_device(res, bus); } - pci_write_bar(dev, reg, start); + pci_write_bar(dev, pm, start); return (barlen); } @@ -3037,7 +3191,7 @@ pci_suspend(device_t dev) return (error); for (i = 0; i < numdevs; i++) { child = devlist[i]; - dinfo = (struct pci_devinfo *) device_get_ivars(child); + dinfo = device_get_ivars(child); pci_cfg_save(child, dinfo, 0); } @@ -3454,7 +3608,7 @@ pci_probe_nomatch(device_t dev, device_t } printf(" at device %d.%d (no driver attached)\n", pci_get_slot(child), pci_get_function(child)); - pci_cfg_save(child, (struct pci_devinfo *)device_get_ivars(child), 1); + pci_cfg_save(child, device_get_ivars(child), 1); return; } @@ -3759,24 +3913,41 @@ pci_alloc_map(device_t dev, device_t chi struct resource_list *rl = &dinfo->resources; struct resource_list_entry *rle; struct resource *res; + struct pci_map *pm; pci_addr_t map, testval; int mapsize; - /* - * Weed out the bogons, and figure out how large the BAR/map - * is. Bars that read back 0 here are bogus and unimplemented. - * Note: atapci in legacy mode are special and handled elsewhere - * in the code. If you have a atapci device in legacy mode and - * it fails here, that other code is broken. - */ res = NULL; - pci_read_bar(child, *rid, &map, &testval); + pm = pci_find_bar(child, *rid); + if (pm != NULL) { + /* This is a BAR that we failed to allocate earlier. */ + mapsize = pm->pm_size; + map = pm->pm_value; + } else { + /* + * Weed out the bogons, and figure out how large the + * BAR/map is. BARs that read back 0 here are bogus + * and unimplemented. Note: atapci in legacy mode are + * special and handled elsewhere in the code. If you + * have a atapci device in legacy mode and it fails + * here, that other code is broken. + */ + pci_read_bar(child, *rid, &map, &testval); - /* Ignore a BAR with a base of 0. */ - if (pci_mapbase(testval) == 0) - goto out; + /* + * Determine the size of the BAR and ignore BARs with a size + * of 0. Device ROM BARs use a different mask value. + */ + if (PCIR_IS_BIOS(&dinfo->cfg, *rid)) + mapsize = pci_romsize(testval); + else + mapsize = pci_mapsize(testval); + if (mapsize == 0) + goto out; + pm = pci_add_bar(child, *rid, map, mapsize); + } - if (PCI_BAR_MEM(testval)) { + if (PCI_BAR_MEM(map) || PCIR_IS_BIOS(&dinfo->cfg, *rid)) { if (type != SYS_RES_MEMORY) { if (bootverbose) device_printf(dev, @@ -3803,16 +3974,15 @@ pci_alloc_map(device_t dev, device_t chi * situation where we might allocate the excess to * another driver, which won't work. */ - mapsize = pci_mapsize(testval); count = (pci_addr_t)1 << mapsize; if (RF_ALIGNMENT(flags) < mapsize) flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize); - if (PCI_BAR_MEM(testval) && (testval & PCIM_BAR_MEM_PREFETCH)) + if (PCI_BAR_MEM(map) && (map & PCIM_BAR_MEM_PREFETCH)) flags |= RF_PREFETCHABLE; /* * Allocate enough resource, and then write back the - * appropriate bar for that resource. + * appropriate BAR for that resource. */ res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, start, end, count, flags & ~RF_ACTIVE); @@ -3836,7 +4006,7 @@ pci_alloc_map(device_t dev, device_t chi "Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n", count, *rid, type, rman_get_start(res)); map = rman_get_start(res); - pci_write_bar(child, *rid, map); + pci_write_bar(child, pm, map); out:; return (res); } @@ -3968,6 +4138,7 @@ int pci_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { + struct pci_devinfo *dinfo; int error; error = bus_generic_activate_resource(dev, child, type, rid, r); @@ -3976,6 +4147,11 @@ pci_activate_resource(device_t dev, devi /* Enable decoding in the command register when activating BARs. */ if (device_get_parent(child) == dev) { + /* Device ROMs need their decoding explicitly enabled. */ + dinfo = device_get_ivars(child); + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) + pci_write_bar(child, pci_find_bar(child, rid), + rman_get_start(r) | PCIM_BIOS_ENABLE); switch (type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: @@ -3986,6 +4162,27 @@ pci_activate_resource(device_t dev, devi return (error); } +int +pci_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + struct pci_devinfo *dinfo; + int error; + + error = bus_generic_deactivate_resource(dev, child, type, rid, r); + if (error) + return (error); + + /* Disable decoding for device ROMs. */ + if (device_get_parent(child) == dev) { + dinfo = device_get_ivars(child); + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) + pci_write_bar(child, pci_find_bar(child, rid), + rman_get_start(r)); + } + return (0); +} + void pci_delete_resource(device_t dev, device_t child, int type, int rid) { @@ -4021,7 +4218,7 @@ pci_delete_resource(device_t dev, device switch (type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: - pci_write_bar(child, rid, 0); + pci_write_bar(child, pci_find_bar(child, rid), 0); break; } #endif @@ -4128,7 +4325,6 @@ pci_modevent(module_t mod, int what, voi void pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo) { - int i; /* * Only do header type 0 devices. Type 1 devices are bridges, @@ -4148,12 +4344,9 @@ pci_cfg_restore(device_t dev, struct pci * the noise on boot by doing nothing if we are already in * state D0. */ - if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { + if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) pci_set_powerstate(dev, PCI_POWERSTATE_D0); - } - for (i = 0; i < dinfo->cfg.nummaps; i++) - pci_write_config(dev, PCIR_BAR(i), dinfo->cfg.bar[i], 4); - pci_write_config(dev, PCIR_BIOS, dinfo->cfg.bios, 4); + pci_restore_bars(dev); pci_write_config(dev, PCIR_COMMAND, dinfo->cfg.cmdreg, 2); pci_write_config(dev, PCIR_INTLINE, dinfo->cfg.intline, 1); pci_write_config(dev, PCIR_INTPIN, dinfo->cfg.intpin, 1); @@ -4174,7 +4367,6 @@ pci_cfg_restore(device_t dev, struct pci void pci_cfg_save(device_t dev, struct pci_devinfo *dinfo, int setstate) { - int i; uint32_t cls; int ps; @@ -4187,9 +4379,6 @@ pci_cfg_save(device_t dev, struct pci_de */ if (dinfo->cfg.hdrtype != 0) return; - for (i = 0; i < dinfo->cfg.nummaps; i++) - dinfo->cfg.bar[i] = pci_read_config(dev, PCIR_BAR(i), 4); - dinfo->cfg.bios = pci_read_config(dev, PCIR_BIOS, 4); /* * Some drivers apparently write to these registers w/o updating our Modified: stable/8/sys/dev/pci/pci_private.h ============================================================================== --- stable/8/sys/dev/pci/pci_private.h Tue Oct 9 18:02:09 2012 (r241377) +++ stable/8/sys/dev/pci/pci_private.h Tue Oct 9 18:45:08 2012 (r241378) @@ -91,6 +91,8 @@ int pci_release_resource(device_t dev, int rid, struct resource *r); int pci_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r); +int pci_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); void pci_delete_resource(device_t dev, device_t child, int type, int rid); struct resource_list *pci_get_resource_list (device_t dev, device_t child); Modified: stable/8/sys/dev/pci/pci_user.c ============================================================================== --- stable/8/sys/dev/pci/pci_user.c Tue Oct 9 18:02:09 2012 (r241377) +++ stable/8/sys/dev/pci/pci_user.c Tue Oct 9 18:45:08 2012 (r241378) @@ -309,8 +309,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_io *io; struct pci_bar_io *bio; struct pci_match_conf *pattern_buf; - struct resource_list_entry *rle; - uint32_t value; + struct pci_map *pm; size_t confsz, iolen, pbufsz; int error, ionum, i, num_patterns; #ifdef PRE7_COMPAT @@ -685,54 +684,14 @@ getconfexit: error = ENODEV; break; } - dinfo = device_get_ivars(pcidev); - - /* - * Look for a resource list entry matching the requested BAR. - * - * XXX: This will not find BARs that are not initialized, but - * maybe that is ok? - */ - rle = resource_list_find(&dinfo->resources, SYS_RES_MEMORY, - bio->pbi_reg); - if (rle == NULL) - rle = resource_list_find(&dinfo->resources, - SYS_RES_IOPORT, bio->pbi_reg); - if (rle == NULL || rle->res == NULL) { + pm = pci_find_bar(pcidev, bio->pbi_reg); + if (pm == NULL) { error = EINVAL; break; } - - /* - * Ok, we have a resource for this BAR. Read the lower - * 32 bits to get any flags. - */ - value = pci_read_config(pcidev, bio->pbi_reg, 4); - if (PCI_BAR_MEM(value)) { - if (rle->type != SYS_RES_MEMORY) { - error = EINVAL; - break; - } - value &= ~PCIM_BAR_MEM_BASE; - } else { - if (rle->type != SYS_RES_IOPORT) { - error = EINVAL; - break; - } - value &= ~PCIM_BAR_IO_BASE; - } - bio->pbi_base = rman_get_start(rle->res) | value; - bio->pbi_length = rman_get_size(rle->res); - - /* - * Check the command register to determine if this BAR - * is enabled. - */ - value = pci_read_config(pcidev, PCIR_COMMAND, 2); - if (rle->type == SYS_RES_MEMORY) - bio->pbi_enabled = (value & PCIM_CMD_MEMEN) != 0; - else - bio->pbi_enabled = (value & PCIM_CMD_PORTEN) != 0; + bio->pbi_base = pm->pm_value; + bio->pbi_length = (pci_addr_t)1 << pm->pm_size; + bio->pbi_enabled = pci_bar_enabled(pcidev, pm); error = 0; break; default: Modified: stable/8/sys/dev/pci/pcireg.h ============================================================================== --- stable/8/sys/dev/pci/pcireg.h Tue Oct 9 18:02:09 2012 (r241377) +++ stable/8/sys/dev/pci/pcireg.h Tue Oct 9 18:45:08 2012 (r241378) @@ -213,6 +213,7 @@ #define PCIM_BRPM_64 0x1 #define PCIM_BRPM_MASK 0xf +#define PCIR_BIOS_1 0x38 #define PCIR_BRIDGECTL_1 0x3e /* config registers for header type 2 (CardBus) devices */ Modified: stable/8/sys/dev/pci/pcivar.h ============================================================================== --- stable/8/sys/dev/pci/pcivar.h Tue Oct 9 18:02:09 2012 (r241377) +++ stable/8/sys/dev/pci/pcivar.h Tue Oct 9 18:45:08 2012 (r241378) @@ -46,7 +46,14 @@ struct pcicfg_pp { uint8_t pp_pmcsr; /* config space address of PMCSR reg */ uint8_t pp_data; /* config space address of PCI power data reg */ }; - + +struct pci_map { + pci_addr_t pm_value; /* Raw BAR value */ + pci_addr_t pm_size; + uint8_t pm_reg; + STAILQ_ENTRY(pci_map) pm_link; +}; + struct vpd_readonly { char keyword[2]; char *value; @@ -120,8 +127,7 @@ struct pcicfg_ht { typedef struct pcicfg { struct device *dev; /* device which owns this */ - uint32_t bar[PCI_MAXMAPS_0]; /* BARs */ - uint32_t bios; /* BIOS mapping */ + STAILQ_HEAD(, pci_map) maps; /* BARs */ uint16_t subvendor; /* card vendor ID */ uint16_t subdevice; /* card device ID, assigned by card vendor */ @@ -480,4 +486,7 @@ STAILQ_HEAD(devlist, pci_devinfo); extern struct devlist pci_devq; extern uint32_t pci_generation; +struct pci_map *pci_find_bar(device_t dev, int reg); +int pci_bar_enabled(device_t dev, struct pci_map *pm); + #endif /* _PCIVAR_H_ */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Oct 9 19:04:24 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DEFBD3; Tue, 9 Oct 2012 19:04:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3C09D8FC0C; Tue, 9 Oct 2012 19:04:24 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 89016B963; Tue, 9 Oct 2012 15:04:23 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r241378 - in stable/8/sys/dev: cardbus pci Date: Tue, 9 Oct 2012 15:04:13 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210091845.q99Ij88H054570@svn.freebsd.org> In-Reply-To: <201210091845.q99Ij88H054570@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201210091504.13804.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 09 Oct 2012 15:04:23 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 19:04:24 -0000 On Tuesday, October 09, 2012 2:45:08 pm John Baldwin wrote: > Author: jhb > Date: Tue Oct 9 18:45:08 2012 > New Revision: 241378 > URL: http://svn.freebsd.org/changeset/base/241378 > > Log: > MFC 201279,201280,201286,213907,214146,220195,222753,223371,225515,235833: > Various fixes to managing PCI BARs including proper support for managing > PCI ROM BARs: > - Teach the PCI bus driver to handle PCIR_BIOS BARs properly and remove > special handling for the PCIR_BIOS decoding enable bit from the cardbus > driver. The PCIR_BIOS BAR does include type bits like other BARs. > Instead, it is always a 32-bit non-prefetchable memory BAR where the low > bit is used as a flag to enable decoding. > - Explicitly track the state of all known BARs for each PCI device. The PCI > bus driver will now remember the size of a BAR obtained during the initial > bus scan and use that size when doing lazy resource allocation rather than > resizing the BAR. The bus driver will now also report unallocated BARs to > userland for display by 'pciconf -lb'. > - Add a constant for the offset of the ROM BIOS BAR in PCI-PCI bridges and > properly handle ROM BIOS BARs in PCI-PCI bridges. The PCI bus now also > properly handles the lack of a ROM BIOS BAR in a PCI-Cardbus bridge. > > Tested by: John Kozubik john kozubik com In particular this fixes problems with the cardbus driver not being able to read CIS information from cards that stored their CIS in a PCI ROM BAR. -- John Baldwin From owner-svn-src-stable-8@FreeBSD.ORG Tue Oct 9 19:57:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B40B7960; Tue, 9 Oct 2012 19:57:18 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C4078FC0C; Tue, 9 Oct 2012 19:57:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q99JvIhh067133; Tue, 9 Oct 2012 19:57:18 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q99JvILD067131; Tue, 9 Oct 2012 19:57:18 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210091957.q99JvILD067131@svn.freebsd.org> From: Jim Harris Date: Tue, 9 Oct 2012 19:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241381 - stable/8/sys/dev/tws X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 19:57:18 -0000 Author: jimharris Date: Tue Oct 9 19:57:18 2012 New Revision: 241381 URL: http://svn.freebsd.org/changeset/base/241381 Log: MFC r240900: Specify MTX_RECURSE for the controller's io_lock. Without it, tws(4) immediately panics on boot with INVARIANTS enabled. The driver already clearly expects to be able to recurse on this mutex - the main I/O path is always recursing on this lock. Modified: stable/8/sys/dev/tws/tws.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/tws/ (props changed) Modified: stable/8/sys/dev/tws/tws.c ============================================================================== --- stable/8/sys/dev/tws/tws.c Tue Oct 9 19:55:12 2012 (r241380) +++ stable/8/sys/dev/tws/tws.c Tue Oct 9 19:57:18 2012 (r241381) @@ -197,7 +197,7 @@ tws_attach(device_t dev) mtx_init( &sc->q_lock, "tws_q_lock", NULL, MTX_DEF); mtx_init( &sc->sim_lock, "tws_sim_lock", NULL, MTX_DEF); mtx_init( &sc->gen_lock, "tws_gen_lock", NULL, MTX_DEF); - mtx_init( &sc->io_lock, "tws_io_lock", NULL, MTX_DEF); + mtx_init( &sc->io_lock, "tws_io_lock", NULL, MTX_DEF | MTX_RECURSE); if ( tws_init_trace_q(sc) == FAILURE ) printf("trace init failure\n"); From owner-svn-src-stable-8@FreeBSD.ORG Tue Oct 9 19:59:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C324DA19; Tue, 9 Oct 2012 19:59:22 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB5168FC0A; Tue, 9 Oct 2012 19:59:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q99JxMcG067645; Tue, 9 Oct 2012 19:59:22 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q99JxMTd067643; Tue, 9 Oct 2012 19:59:22 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210091959.q99JxMTd067643@svn.freebsd.org> From: Jim Harris Date: Tue, 9 Oct 2012 19:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241382 - stable/8/sys/dev/tws X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 19:59:22 -0000 Author: jimharris Date: Tue Oct 9 19:59:22 2012 New Revision: 241382 URL: http://svn.freebsd.org/changeset/base/241382 Log: MFC r240901: Use CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE to report missing targets or LUNs respectively. This removes a huge number of error messages from CAM during bus scans. Modified: stable/8/sys/dev/tws/tws_cam.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/tws/ (props changed) Modified: stable/8/sys/dev/tws/tws_cam.c ============================================================================== --- stable/8/sys/dev/tws/tws_cam.c Tue Oct 9 19:57:18 2012 (r241381) +++ stable/8/sys/dev/tws/tws_cam.c Tue Oct 9 19:59:22 2012 (r241382) @@ -529,10 +529,10 @@ tws_scsi_err_complete(struct tws_request if ( ccb->ccb_h.target_lun ) { TWS_TRACE_DEBUG(sc, "invalid lun error",0,0); - ccb->ccb_h.status |= CAM_LUN_INVALID; + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; } else { TWS_TRACE_DEBUG(sc, "invalid target error",0,0); - ccb->ccb_h.status |= CAM_TID_INVALID; + ccb->ccb_h.status |= CAM_SEL_TIMEOUT; } } else { From owner-svn-src-stable-8@FreeBSD.ORG Tue Oct 9 20:06:17 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1585C5D; Tue, 9 Oct 2012 20:06:16 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D93148FC0A; Tue, 9 Oct 2012 20:06:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q99K6GnP069267; Tue, 9 Oct 2012 20:06:16 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q99K6G1A069265; Tue, 9 Oct 2012 20:06:16 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210092006.q99K6G1A069265@svn.freebsd.org> From: Jim Harris Date: Tue, 9 Oct 2012 20:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241384 - stable/8/sys/dev/pci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 20:06:17 -0000 Author: jimharris Date: Tue Oct 9 20:06:16 2012 New Revision: 241384 URL: http://svn.freebsd.org/changeset/base/241384 Log: MFC r240695: Add constants for programming interfaces for NVM/solid state storage controller sub-class code. Reference: PCI Code and ID Assignment Specification Rev 1.2 Modified: stable/8/sys/dev/pci/pcireg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) Modified: stable/8/sys/dev/pci/pcireg.h ============================================================================== --- stable/8/sys/dev/pci/pcireg.h Tue Oct 9 20:05:19 2012 (r241383) +++ stable/8/sys/dev/pci/pcireg.h Tue Oct 9 20:06:16 2012 (r241384) @@ -265,6 +265,8 @@ #define PCIP_STORAGE_SATA_AHCI_1_0 0x01 #define PCIS_STORAGE_SAS 0x07 #define PCIS_STORAGE_NVM 0x08 +#define PCIP_STORAGE_NVM_NVMHCI_1_0 0x01 +#define PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0 0x02 #define PCIS_STORAGE_OTHER 0x80 #define PCIC_NETWORK 0x02 From owner-svn-src-stable-8@FreeBSD.ORG Wed Oct 10 21:20:35 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21063E6F; Wed, 10 Oct 2012 21:20:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08F788FC0C; Wed, 10 Oct 2012 21:20:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ALKYEt003829; Wed, 10 Oct 2012 21:20:34 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ALKY8k003817; Wed, 10 Oct 2012 21:20:34 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210102120.q9ALKY8k003817@svn.freebsd.org> From: Eitan Adler Date: Wed, 10 Oct 2012 21:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241419 - stable/8/usr.bin/procstat X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 21:20:35 -0000 Author: eadler Date: Wed Oct 10 21:20:34 2012 New Revision: 241419 URL: http://svn.freebsd.org/changeset/base/241419 Log: MFC r241117: add SG state type PR: bin/171664 Approved by: cperciva (implicit) Modified: stable/8/usr.bin/procstat/procstat.1 Directory Properties: stable/8/usr.bin/procstat/ (props changed) Modified: stable/8/usr.bin/procstat/procstat.1 ============================================================================== --- stable/8/usr.bin/procstat/procstat.1 Wed Oct 10 20:41:37 2012 (r241418) +++ stable/8/usr.bin/procstat/procstat.1 Wed Oct 10 21:20:34 2012 (r241419) @@ -378,6 +378,8 @@ default device .It ph physical +.It sg +scatter/gather .It sw swap .It vn From owner-svn-src-stable-8@FreeBSD.ORG Wed Oct 10 21:21:54 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 764F2324; Wed, 10 Oct 2012 21:21:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F70F8FC08; Wed, 10 Oct 2012 21:21:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ALLsBF004086; Wed, 10 Oct 2012 21:21:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ALLsmv004083; Wed, 10 Oct 2012 21:21:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210102121.q9ALLsmv004083@svn.freebsd.org> From: Eitan Adler Date: Wed, 10 Oct 2012 21:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241422 - stable/8/usr.bin/mktemp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 21:21:54 -0000 Author: eadler Date: Wed Oct 10 21:21:53 2012 New Revision: 241422 URL: http://svn.freebsd.org/changeset/base/241422 Log: MFC r241118: Implement the Sun/GNU extension of using a default prefix when no arguments are supplied. Approved by: cperciva (implicit) Modified: stable/8/usr.bin/mktemp/mktemp.1 stable/8/usr.bin/mktemp/mktemp.c Directory Properties: stable/8/usr.bin/mktemp/ (props changed) Modified: stable/8/usr.bin/mktemp/mktemp.1 ============================================================================== --- stable/8/usr.bin/mktemp/mktemp.1 Wed Oct 10 21:20:34 2012 (r241421) +++ stable/8/usr.bin/mktemp/mktemp.1 Wed Oct 10 21:21:53 2012 (r241422) @@ -103,6 +103,14 @@ Care should be taken to ensure that it is appropriate to use an environment variable potentially supplied by the user. .Pp +If no arguments are passed or if only the +.Fl d +flag is passed +.Nm +behaves as if +.Fl t Li tmp +was supplied. +.Pp Any number of temporary files may be created in a single invocation, including one based on the internal template resulting from the .Fl t Modified: stable/8/usr.bin/mktemp/mktemp.c ============================================================================== --- stable/8/usr.bin/mktemp/mktemp.c Wed Oct 10 21:20:34 2012 (r241421) +++ stable/8/usr.bin/mktemp/mktemp.c Wed Oct 10 21:21:53 2012 (r241422) @@ -87,6 +87,11 @@ main(int argc, char **argv) argc -= optind; argv += optind; + if (!tflag && argc < 1) { + tflag = 1; + prefix = "tmp"; + } + if (tflag) { tmpdir = getenv("TMPDIR"); if (tmpdir == NULL) @@ -100,8 +105,6 @@ main(int argc, char **argv) else errx(1, "cannot generate template"); } - } else if (argc < 1) { - usage(); } /* generate all requested files */ From owner-svn-src-stable-8@FreeBSD.ORG Wed Oct 10 21:27:30 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8FB179D3; Wed, 10 Oct 2012 21:27:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 793688FC14; Wed, 10 Oct 2012 21:27:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ALRUt9005054; Wed, 10 Oct 2012 21:27:30 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ALRUiI005052; Wed, 10 Oct 2012 21:27:30 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210102127.q9ALRUiI005052@svn.freebsd.org> From: Eitan Adler Date: Wed, 10 Oct 2012 21:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241425 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 21:27:30 -0000 Author: eadler Date: Wed Oct 10 21:27:29 2012 New Revision: 241425 URL: http://svn.freebsd.org/changeset/base/241425 Log: MFC r241119: Provide a generic way to disable devices at boot time PR: kern/119202 Approved by: cperciva (implicit) Modified: stable/8/sys/kern/subr_bus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Wed Oct 10 21:21:54 2012 (r241424) +++ stable/8/sys/kern/subr_bus.c Wed Oct 10 21:27:29 2012 (r241425) @@ -2759,6 +2759,13 @@ device_attach(device_t dev) { int error; + if (resource_disabled(dev->driver->name, dev->unit)) { + device_disable(dev); + if (bootverbose) + device_printf(dev, "disabled via hints entry\n"); + return (ENXIO); + } + device_sysctl_init(dev); if (!device_is_quiet(dev)) device_print_child(dev->parent, dev); From owner-svn-src-stable-8@FreeBSD.ORG Wed Oct 10 21:30:26 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B49DCE55; Wed, 10 Oct 2012 21:30:26 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0AA8FC18; Wed, 10 Oct 2012 21:30:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ALUQTY005556; Wed, 10 Oct 2012 21:30:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ALUQiV005553; Wed, 10 Oct 2012 21:30:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210102130.q9ALUQiV005553@svn.freebsd.org> From: Eitan Adler Date: Wed, 10 Oct 2012 21:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241429 - stable/8/usr.sbin/ip6addrctl X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 21:30:26 -0000 Author: eadler Date: Wed Oct 10 21:30:26 2012 New Revision: 241429 URL: http://svn.freebsd.org/changeset/base/241429 Log: MFC r241134: Fix alignment related warnings reported by gcc Switch from old style arguments to modern C remove WARNS as a result tested with "make universe" Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/ip6addrctl/ip6addrctl.c Directory Properties: stable/8/usr.sbin/ip6addrctl/ (props changed) Modified: stable/8/usr.sbin/ip6addrctl/ip6addrctl.c ============================================================================== --- stable/8/usr.sbin/ip6addrctl/ip6addrctl.c Wed Oct 10 21:30:26 2012 (r241428) +++ stable/8/usr.sbin/ip6addrctl/ip6addrctl.c Wed Oct 10 21:30:26 2012 (r241429) @@ -71,12 +71,10 @@ static void plen2mask(struct sockaddr_in static void set_policy(void); static void add_policy(char *, char *, char *); static void delete_policy(char *); -static void flush_policy(); +static void flush_policy(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { TAILQ_INIT(&policyhead); @@ -107,11 +105,11 @@ main(argc, argv) } static void -get_policy() +get_policy(void) { int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_ADDRCTLPOLICY }; size_t l; - char *buf; + struct in6_addrpolicy *buf; struct in6_addrpolicy *pol, *ep; if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &l, NULL, 0) < 0) { @@ -131,8 +129,8 @@ get_policy() /* NOTREACHED */ } - ep = (struct in6_addrpolicy *)(buf + l); - for (pol = (struct in6_addrpolicy *)buf; pol + 1 <= ep; pol++) { + ep = buf + l/sizeof(*buf); + for (pol = buf; pol + 1 <= ep; pol++) { struct policyqueue *new; if ((new = malloc(sizeof(*new))) == NULL) @@ -145,7 +143,7 @@ get_policy() } static void -dump_policy() +dump_policy(void) { size_t addrlen; char addrbuf[NI_MAXHOST]; @@ -201,8 +199,7 @@ dump_policy() } while (0); static void -make_policy_fromfile(conf) - char *conf; +make_policy_fromfile(char *conf) { char line[_POSIX2_LINE_MAX], *cp; char *addrstr; @@ -257,9 +254,7 @@ make_policy_fromfile(conf) } static int -parse_prefix(prefix0, pol) - const char *prefix0; - struct in6_addrpolicy *pol; +parse_prefix(const char *prefix0, struct in6_addrpolicy *pol) { int e = 0, plen; char *prefix, *plenstr; @@ -299,11 +294,9 @@ parse_prefix(prefix0, pol) } static void -plen2mask(mask, plen) - struct sockaddr_in6 *mask; - int plen; +plen2mask(struct sockaddr_in6 *mask, int plen) { - u_char *cp = (char *)&mask->sin6_addr; + u_char *cp = (unsigned char *)&mask->sin6_addr; memset(mask, 0, sizeof(*mask)); mask->sin6_family = AF_INET6; /* just in case */ @@ -316,7 +309,7 @@ plen2mask(mask, plen) } static void -set_policy() +set_policy(void) { struct policyqueue *ent; int s; @@ -334,8 +327,7 @@ set_policy() } static int -mask2plen(mask) - struct sockaddr_in6 *mask; +mask2plen(struct sockaddr_in6 *mask) { int masklen, final = 0; u_char *p, *lim; @@ -394,8 +386,7 @@ mask2plen(mask) } static void -add_policy(prefix, prec, label) - char *prefix, *prec, *label; +add_policy(char *prefix, char *prec, char *label) { struct in6_addrpolicy p; int s; @@ -416,8 +407,7 @@ add_policy(prefix, prec, label) } static void -delete_policy(prefix) - char *prefix; +delete_policy(char *prefix) { struct in6_addrpolicy p; int s; @@ -436,7 +426,7 @@ delete_policy(prefix) } static void -flush_policy() +flush_policy(void) { struct policyqueue *ent; int s; @@ -454,7 +444,7 @@ flush_policy() } static void -usage() +usage(void) { fprintf(stderr, "usage: ip6addrctl [show]\n"); fprintf(stderr, " ip6addrctl add " From owner-svn-src-stable-8@FreeBSD.ORG Thu Oct 11 13:25:10 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A42F0F5D; Thu, 11 Oct 2012 13:25:10 +0000 (UTC) (envelope-from erwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 819B48FC1B; Thu, 11 Oct 2012 13:25:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9BDPAJI029215; Thu, 11 Oct 2012 13:25:10 GMT (envelope-from erwin@svn.freebsd.org) Received: (from erwin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9BDPA0A029211; Thu, 11 Oct 2012 13:25:10 GMT (envelope-from erwin@svn.freebsd.org) Message-Id: <201210111325.q9BDPA0A029211@svn.freebsd.org> From: Erwin Lansing Date: Thu, 11 Oct 2012 13:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241443 - in stable/8/contrib/bind9: . bin/named X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 13:25:10 -0000 Author: erwin (ports committer) Date: Thu Oct 11 13:25:09 2012 New Revision: 241443 URL: http://svn.freebsd.org/changeset/base/241443 Log: Update to 9.6-ESV-R7-P4 Prevents a lockup when queried a deliberately constructed combination of records. [CVE-2012-5166] For more information: https://kb.isc.org/article/AA-00801 Approved by: bz Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/bin/named/query.c stable/8/contrib/bind9/version Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Thu Oct 11 08:44:15 2012 (r241442) +++ stable/8/contrib/bind9/CHANGES Thu Oct 11 13:25:09 2012 (r241443) @@ -1,3 +1,9 @@ + --- 9.6-ESV-R7-P4 released --- + +3383. [security] A certain combination of records in the RBT could + cause named to hang while populating the additional + section of a response. [RT #31090] + --- 9.6-ESV-R7-P3 released --- 3364. [security] Named could die on specially crafted record. Modified: stable/8/contrib/bind9/bin/named/query.c ============================================================================== --- stable/8/contrib/bind9/bin/named/query.c Thu Oct 11 08:44:15 2012 (r241442) +++ stable/8/contrib/bind9/bin/named/query.c Thu Oct 11 13:25:09 2012 (r241443) @@ -1025,13 +1025,6 @@ query_isduplicate(ns_client_t *client, d mname = NULL; } - /* - * If the dns_name_t we're looking up is already in the message, - * we don't want to trigger the caller's name replacement logic. - */ - if (name == mname) - mname = NULL; - if (mnamep != NULL) *mnamep = mname; @@ -1230,6 +1223,7 @@ query_addadditional(void *arg, dns_name_ if (dns_rdataset_isassociated(rdataset) && !query_isduplicate(client, fname, type, &mname)) { if (mname != NULL) { + INSIST(mname != fname); query_releasename(client, &fname); fname = mname; } else @@ -1292,11 +1286,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_a, &mname)) { - if (mname != NULL) { - query_releasename(client, &fname); - fname = mname; - } else - need_addname = ISC_TRUE; + if (mname != fname) { + if (mname != NULL) { + query_releasename(client, &fname); + fname = mname; + } else + need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1338,11 +1334,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_aaaa, &mname)) { - if (mname != NULL) { - query_releasename(client, &fname); - fname = mname; - } else - need_addname = ISC_TRUE; + if (mname != fname) { + if (mname != NULL) { + query_releasename(client, &fname); + fname = mname; + } else + need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1865,22 +1863,24 @@ query_addadditional2(void *arg, dns_name crdataset->type == dns_rdatatype_aaaa) { if (!query_isduplicate(client, fname, crdataset->type, &mname)) { - if (mname != NULL) { - /* - * A different type of this name is - * already stored in the additional - * section. We'll reuse the name. - * Note that this should happen at most - * once. Otherwise, fname->link could - * leak below. - */ - INSIST(mname0 == NULL); - - query_releasename(client, &fname); - fname = mname; - mname0 = mname; - } else - need_addname = ISC_TRUE; + if (mname != fname) { + if (mname != NULL) { + /* + * A different type of this name is + * already stored in the additional + * section. We'll reuse the name. + * Note that this should happen at most + * once. Otherwise, fname->link could + * leak below. + */ + INSIST(mname0 == NULL); + + query_releasename(client, &fname); + fname = mname; + mname0 = mname; + } else + need_addname = ISC_TRUE; + } ISC_LIST_UNLINK(cfname.list, crdataset, link); ISC_LIST_APPEND(fname->list, crdataset, link); added_something = ISC_TRUE; Modified: stable/8/contrib/bind9/version ============================================================================== --- stable/8/contrib/bind9/version Thu Oct 11 08:44:15 2012 (r241442) +++ stable/8/contrib/bind9/version Thu Oct 11 13:25:09 2012 (r241443) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R7-P3 +RELEASEVER=-R7-P4 From owner-svn-src-stable-8@FreeBSD.ORG Thu Oct 11 18:11:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A027CC6B; Thu, 11 Oct 2012 18:11:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5488FC08; Thu, 11 Oct 2012 18:11:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9BIBcE0064007; Thu, 11 Oct 2012 18:11:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9BIBcZE064006; Thu, 11 Oct 2012 18:11:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201210111811.q9BIBcZE064006@svn.freebsd.org> From: Xin LI Date: Thu, 11 Oct 2012 18:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241450 - stable/8/contrib/bind9 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 18:11:38 -0000 Author: delphij Date: Thu Oct 11 18:11:38 2012 New Revision: 241450 URL: http://svn.freebsd.org/changeset/base/241450 Log: Record mergeinfo for r241443 to ease future imports. Modified: Directory Properties: stable/8/contrib/bind9/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Thu Oct 11 20:51:00 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4E5E714B; Thu, 11 Oct 2012 20:51:00 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 366208FC0A; Thu, 11 Oct 2012 20:51:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9BKp0vo083901; Thu, 11 Oct 2012 20:51:00 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9BKp0hV083899; Thu, 11 Oct 2012 20:51:00 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201210112051.q9BKp0hV083899@svn.freebsd.org> From: Peter Wemm Date: Thu, 11 Oct 2012 20:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241459 - stable/8/etc/sendmail X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 20:51:00 -0000 Author: peter Date: Thu Oct 11 20:50:59 2012 New Revision: 241459 URL: http://svn.freebsd.org/changeset/base/241459 Log: Switch freebsd.org nullhost cluster machines from hub to mx1. Modified: stable/8/etc/sendmail/freefall.mc Modified: stable/8/etc/sendmail/freefall.mc ============================================================================== --- stable/8/etc/sendmail/freefall.mc Thu Oct 11 20:48:45 2012 (r241458) +++ stable/8/etc/sendmail/freefall.mc Thu Oct 11 20:50:59 2012 (r241459) @@ -43,5 +43,5 @@ divert(0)dnl VERSIONID(`$FreeBSD$') OSTYPE(freebsd6) -FEATURE(nullclient, hub.$m) +FEATURE(nullclient, mx1.$m) MASQUERADE_AS(FreeBSD.org) From owner-svn-src-stable-8@FreeBSD.ORG Fri Oct 12 02:10:27 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B63F9DD2; Fri, 12 Oct 2012 02:10:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 854048FC08; Fri, 12 Oct 2012 02:10:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9C2AR51023551; Fri, 12 Oct 2012 02:10:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9C2ARLD023544; Fri, 12 Oct 2012 02:10:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210120210.q9C2ARLD023544@svn.freebsd.org> From: Eitan Adler Date: Fri, 12 Oct 2012 02:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241472 - stable/8/usr.sbin/syslogd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 02:10:27 -0000 Author: eadler Date: Fri Oct 12 02:10:26 2012 New Revision: 241472 URL: http://svn.freebsd.org/changeset/base/241472 Log: MFC r240389,r240409: - Add support for ipv6 addresses as destination - Add documentation for IPv6 support PR: docs/171580 Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/syslogd/syslog.conf.5 stable/8/usr.sbin/syslogd/syslogd.c Directory Properties: stable/8/usr.sbin/syslogd/ (props changed) Modified: stable/8/usr.sbin/syslogd/syslog.conf.5 ============================================================================== --- stable/8/usr.sbin/syslogd/syslog.conf.5 Fri Oct 12 01:31:02 2012 (r241471) +++ stable/8/usr.sbin/syslogd/syslog.conf.5 Fri Oct 12 02:10:26 2012 (r241472) @@ -28,7 +28,7 @@ .\" @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd September 12, 2012 .Dt SYSLOG.CONF 5 .Os .Sh NAME @@ -347,6 +347,14 @@ If a port number is added after a colon .Pq Ql :\& then that port will be used as the destination port rather than the usual syslog port. +IPv6 addresses can be used +by surrounding the address portion with +square brackets +.Po +.Ql [\& +and +.Ql ]\& +.Pc . .It A comma separated list of users. Selected messages are written to those users Modified: stable/8/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/8/usr.sbin/syslogd/syslogd.c Fri Oct 12 01:31:02 2012 (r241471) +++ stable/8/usr.sbin/syslogd/syslogd.c Fri Oct 12 02:10:26 2012 (r241472) @@ -1939,6 +1939,7 @@ cfline(const char *line, struct filed *f case '@': { char *tp; + char endkey = ':'; /* * scan forward to see if there is a port defined. * so we can't use strlcpy.. @@ -1947,9 +1948,19 @@ cfline(const char *line, struct filed *f tp = f->f_un.f_forw.f_hname; p++; - while (*p && (*p != ':') && (i-- > 0)) { + /* + * an ipv6 address should start with a '[' in that case + * we should scan for a ']' + */ + if (*p == '[') { + p++; + endkey = ']'; + } + while (*p && (*p != endkey) && (i-- > 0)) { *tp++ = *p++; } + if (endkey == ']' && *p == endkey) + p++; *tp = '\0'; } /* See if we copied a domain and have a port */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Oct 12 02:12:53 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80AE553B; Fri, 12 Oct 2012 02:12:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A2868FC18; Fri, 12 Oct 2012 02:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9C2CrhV023957; Fri, 12 Oct 2012 02:12:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9C2Crlp023954; Fri, 12 Oct 2012 02:12:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210120212.q9C2Crlp023954@svn.freebsd.org> From: Eitan Adler Date: Fri, 12 Oct 2012 02:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241475 - stable/8/lib/libc/stdlib X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 02:12:53 -0000 Author: eadler Date: Fri Oct 12 02:12:52 2012 New Revision: 241475 URL: http://svn.freebsd.org/changeset/base/241475 Log: MFC r241373: Remove undefined behavior from sranddev() and srandomdev(). This doesn't actually work with any modern C compiler: In particular, both clang and modern gcc verisons silently elide any xor operation with 'junk'. Approved by: cperciva (implicit) Modified: stable/8/lib/libc/stdlib/rand.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdlib/rand.c ============================================================================== --- stable/8/lib/libc/stdlib/rand.c Fri Oct 12 02:10:27 2012 (r241474) +++ stable/8/lib/libc/stdlib/rand.c Fri Oct 12 02:12:52 2012 (r241475) @@ -130,10 +130,9 @@ sranddev() if (!done) { struct timeval tv; - unsigned long junk; gettimeofday(&tv, NULL); - srand((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec ^ junk); + srand((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec); } }