From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 00:35:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 019371065672; Sun, 26 Jun 2011 00:35:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5E9A8FC08; Sun, 26 Jun 2011 00:35:11 +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 p5Q0ZBGE029071; Sun, 26 Jun 2011 00:35:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5Q0ZBiM029069; Sun, 26 Jun 2011 00:35:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106260035.p5Q0ZBiM029069@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 26 Jun 2011 00:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223554 - head/sys/dev/sound/macio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 00:35:12 -0000 Author: nwhitehorn Date: Sun Jun 26 00:35:11 2011 New Revision: 223554 URL: http://svn.freebsd.org/changeset/base/223554 Log: Do not attach to the sound device on G5 Xserves, which is actually an LED controller used to run the load graph on the server's front panel. Reported by: Paul Mather MFC after: 3 days Modified: head/sys/dev/sound/macio/i2s.c Modified: head/sys/dev/sound/macio/i2s.c ============================================================================== --- head/sys/dev/sound/macio/i2s.c Sat Jun 25 23:14:49 2011 (r223553) +++ head/sys/dev/sound/macio/i2s.c Sun Jun 26 00:35:11 2011 (r223554) @@ -158,6 +158,8 @@ static int i2s_probe(device_t self) { const char *name; + phandle_t subchild; + char subchildname[255]; name = ofw_bus_get_name(self); if (!name) @@ -165,6 +167,16 @@ i2s_probe(device_t self) if (strcmp(name, "i2s") != 0) return (ENXIO); + + /* + * Do not attach to "lightshow" I2S devices on Xserves. This controller + * is used there to control the LEDs on the front panel, and this + * driver can't handle it. + */ + subchild = OF_child(OF_child(ofw_bus_get_node(self))); + if (subchild != 0 && OF_getprop(subchild, "name", subchildname, + sizeof(subchildname)) > 0 && strcmp(subchildname, "lightshow") == 0) + return (ENXIO); device_set_desc(self, "Apple I2S Audio Controller"); From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 00:49:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42589106566B; Sun, 26 Jun 2011 00:49:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 325C28FC12; Sun, 26 Jun 2011 00:49: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 p5Q0nHD6029470; Sun, 26 Jun 2011 00:49:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5Q0nHal029468; Sun, 26 Jun 2011 00:49:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106260049.p5Q0nHal029468@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 26 Jun 2011 00:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223555 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 00:49:18 -0000 Author: nwhitehorn Date: Sun Jun 26 00:49:17 2011 New Revision: 223555 URL: http://svn.freebsd.org/changeset/base/223555 Log: Turn the minimum PWM fan speed down to 30 from 40. It turns out the burning smell that caused me to turn this up was due to a failed fan burning, not a CPU (plus a healthy dose of paranoia). Submitted by: Paul Mather Modified: head/sys/powerpc/powermac/fcu.c Modified: head/sys/powerpc/powermac/fcu.c ============================================================================== --- head/sys/powerpc/powermac/fcu.c Sun Jun 26 00:35:11 2011 (r223554) +++ head/sys/powerpc/powermac/fcu.c Sun Jun 26 00:49:17 2011 (r223555) @@ -510,7 +510,7 @@ fcu_fill_fan_prop(device_t dev) sc->sc_fans[j].fan.set = (int (*)(struct pmac_fan *, int))(fcu_fan_set_rpm); } else { - sc->sc_fans[j].fan.min_rpm = 40; /* Percent */ + sc->sc_fans[j].fan.min_rpm = 30; /* Percent */ sc->sc_fans[j].fan.max_rpm = 100; sc->sc_fans[j].fan.read = NULL; sc->sc_fans[j].fan.set = From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 01:14:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96A6F106564A; Sun, 26 Jun 2011 01:14:54 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 873628FC08; Sun, 26 Jun 2011 01:14: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 p5Q1Esl1030269; Sun, 26 Jun 2011 01:14:54 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5Q1Esnd030267; Sun, 26 Jun 2011 01:14:54 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201106260114.p5Q1Esnd030267@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sun, 26 Jun 2011 01:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223556 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 01:14:54 -0000 Author: gibbs Date: Sun Jun 26 01:14:54 2011 New Revision: 223556 URL: http://svn.freebsd.org/changeset/base/223556 Log: cam/cam_xpt.c: In camisr_runqueue(), we need to run the sims queue regardless of whether or not the current peripheral has more work to do. This reverts a change mistakenly made in revision 223081. Reported by: ache Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Jun 26 00:49:17 2011 (r223555) +++ head/sys/cam/cam_xpt.c Sun Jun 26 01:14:54 2011 (r223556) @@ -4894,8 +4894,8 @@ camisr_runqueue(void *V_queue) && (--dev->tag_delay_count == 0)) xpt_start_tags(ccb_h->path); if (!device_is_send_queued(dev)) { - runq = xpt_schedule_dev_sendq(ccb_h->path->bus, - dev); + (void)xpt_schedule_dev_sendq(ccb_h->path->bus, + dev); } } From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 01:32:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91610106564A; Sun, 26 Jun 2011 01:32:47 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 819738FC13; Sun, 26 Jun 2011 01:32:47 +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 p5Q1WlTY030789; Sun, 26 Jun 2011 01:32:47 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5Q1Wlrw030787; Sun, 26 Jun 2011 01:32:47 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201106260132.p5Q1Wlrw030787@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sun, 26 Jun 2011 01:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223557 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 01:32:47 -0000 Author: gibbs Date: Sun Jun 26 01:32:46 2011 New Revision: 223557 URL: http://svn.freebsd.org/changeset/base/223557 Log: cam/scsi/scsi_cd.c: In cdregister(), hold the periph lock semaphore during changer probe/configuration. This removes a window where an open of the cd device may succeed before probe processing has completed. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Sun Jun 26 01:14:54 2011 (r223556) +++ head/sys/cam/scsi/scsi_cd.c Sun Jun 26 01:32:46 2011 (r223557) @@ -687,6 +687,10 @@ cdregister(struct cam_periph *periph, vo else softc->minimum_command_size = 6; + /* + * Refcount and block open attempts until we are setup + * Can't block + */ (void)cam_periph_hold(periph, PRIBIO); cam_periph_unlock(periph); /* @@ -747,7 +751,6 @@ cdregister(struct cam_periph *periph, vo softc->disk->d_hba_subdevice = cpi.hba_subdevice; disk_create(softc->disk, DISK_VERSION); cam_periph_lock(periph); - cam_periph_unhold(periph); /* * Add an async callback so that we get @@ -972,12 +975,6 @@ cdregister(struct cam_periph *periph, vo cdregisterexit: - /* - * Refcount and block open attempts until we are setup - * Can't block - */ - (void)cam_periph_hold(periph, PRIBIO); - if ((softc->flags & CD_FLAG_CHANGER) == 0) xpt_schedule(periph, CAM_PRIORITY_DEV); else From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 02:03:15 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECBB9106564A; Sun, 26 Jun 2011 02:03:15 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 6BB1B8FC1A; Sun, 26 Jun 2011 02:03:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.4/8.14.4) with ESMTP id p5Q23DlN055671; Sun, 26 Jun 2011 06:03:13 +0400 (MSD) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p5Q23CwN055669; Sun, 26 Jun 2011 06:03:12 +0400 (MSD) (envelope-from ache) Date: Sun, 26 Jun 2011 06:03:10 +0400 From: Andrey Chernov To: "Justin T. Gibbs" Message-ID: <20110626020309.GA55649@vniz.net> Mail-Followup-To: Andrey Chernov , "Justin T. Gibbs" , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201106260114.p5Q1Esnd030267@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106260114.p5Q1Esnd030267@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r223556 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 02:03:16 -0000 On Sun, Jun 26, 2011 at 01:14:54AM +0000, Justin T. Gibbs wrote: > Author: gibbs > Date: Sun Jun 26 01:14:54 2011 > New Revision: 223556 > URL: http://svn.freebsd.org/changeset/base/223556 > > Log: > cam/cam_xpt.c: > In camisr_runqueue(), we need to run the sims queue regardless of > whether or not the current peripheral has more work to do. This > reverts a change mistakenly made in revision 223081. > > Reported by: ache > Thanks! -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 09:07:41 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2088C106566B; Sun, 26 Jun 2011 09:07:41 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id B129A8FC0C; Sun, 26 Jun 2011 09:07:40 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id p5Q97UEo017731; Sun, 26 Jun 2011 17:07:30 +0800 (CST) From: Kevin Lo To: Hans Petter Selasky In-Reply-To: <201106252055.45798.hselasky@c2i.net> References: <201106252043.59444.hselasky@c2i.net> <201106252051.38956.hselasky@c2i.net> <201106252055.45798.hselasky@c2i.net> Content-Type: text/plain; charset="Big5" Date: Sun, 26 Jun 2011 17:07:28 +0800 Message-ID: <1309079248.6337.4.camel@srgsec> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gavin Atkinson , "src-committers@freebsd.org" Subject: Re: svn commit: r223537 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 09:07:41 -0000 On Sat, 2011-06-25 at 20:55 +0200, Hans Petter Selasky wrote: > On Saturday 25 June 2011 20:51:38 Hans Petter Selasky wrote: > > On Saturday 25 June 2011 20:43:59 Hans Petter Selasky wrote: > > > On Saturday 25 June 2011 20:26:19 Gavin Atkinson wrote: > > > > On Sat, 25 Jun 2011, Hans Petter Selasky wrote: > > > > > Hi, > > > > I see a minor bug here: > > > > %grep -r ACCTON /sys/dev/usb/wlan/if_zyd.c > > ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), > > ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), > > ZYD_ZD1211B_DEV(ACCTON, ZD1211B), > > > > %grep -r ACCTON /sys/dev/usb/wlan/if_uath.c > > UATH_DEV(ACCTON, SMCWUSBG), > > UATH_DEV(ACCTON, SMCWUSBTG2), > > > > Which one of these drivers support the SMCWUSBG ? > > > > --HPS > > Hi Gavin, > > Can you figure this out, which ID actually belongs to which driver and fix > this in: > > if_zyd.c, if_uath.c and uath.conf > > ? Accton's SMCWUSBG_NF belongs to zyd(4). I should mention I fixed the panic(r220087) with that device. > --HPS Kevin From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 09:32:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9746106564A; Sun, 26 Jun 2011 09:32:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C97EC8FC0A; Sun, 26 Jun 2011 09:32:46 +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 p5Q9Wkbl044435; Sun, 26 Jun 2011 09:32:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5Q9WkRw044433; Sun, 26 Jun 2011 09:32:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106260932.p5Q9WkRw044433@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Jun 2011 09:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223561 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 09:32:46 -0000 Author: adrian Date: Sun Jun 26 09:32:46 2011 New Revision: 223561 URL: http://svn.freebsd.org/changeset/base/223561 Log: Replace tab with 8 spaces, bringing it in line with the rest of the file. Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Sun Jun 26 07:12:48 2011 (r223560) +++ head/etc/regdomain.xml Sun Jun 26 09:32:46 2011 (r223561) @@ -341,9 +341,9 @@ 0x30 - - 30 - IEEE80211_CHAN_B + + 30 + IEEE80211_CHAN_B From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 09:54:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBCFA1065670; Sun, 26 Jun 2011 09:54:02 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from fep28.mx.upcmail.net (fep28.mx.upcmail.net [62.179.121.48]) by mx1.freebsd.org (Postfix) with ESMTP id 98F048FC0A; Sun, 26 Jun 2011 09:54:01 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep18-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20110626093354.WJGI1513.viefep18-int.chello.at@edge04.upcmail.net>; Sun, 26 Jun 2011 11:33:54 +0200 Received: from pinky ([95.96.138.26]) by edge04.upcmail.net with edge id 0ZZr1h02Q0aMTqv04ZZt8c; Sun, 26 Jun 2011 11:33:54 +0200 X-SourceIP: 95.96.138.26 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Hans Petter Selasky" References: <201106242132.p5OLW3DL071062@svn.freebsd.org> Date: Sun, 26 Jun 2011 11:33:51 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <201106242132.p5OLW3DL071062@svn.freebsd.org> User-Agent: Opera Mail/11.11 (Win32) X-Cloudmark-Analysis: v=1.1 cv=tMVj8KYobzzX0EiRnC7vY2isLrCxFvdg4RrHWPZXwJ0= c=1 sm=0 a=2CeqBfwGSwcA:10 a=_YJJ2cSHtBcA:10 a=bgpUlknNv7MA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=AsnYYoKPWW837BDgczYA:9 a=Zs_iCHiXqyRbD7uyez0A:7 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: Subject: Re: svn commit: r223519 - head/etc/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 09:54:02 -0000 Is this part of the auto-detect hardware discussion I read on one of the mailinglists lately? About having less drivers in GENERIC and more auto-loaded? If it is... Looks like a nice feature. Ronald. On Fri, 24 Jun 2011 23:32:03 +0200, Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Jun 24 21:32:03 2011 > New Revision: 223519 > URL: http://svn.freebsd.org/changeset/base/223519 > > Log: > - Add auto-load devd config file for USB kernel modules. > MFC after: 14 days > > Added: > head/etc/devd/bus_auto.conf (contents, props changed) > > Added: head/etc/devd/bus_auto.conf > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/devd/bus_auto.conf Fri Jun 24 21:32:03 2011 (r223519) > @@ -0,0 +1,2347 @@ > +# > +# $FreeBSD$ > +# > +# This file was automatically generated by "tools/bus_autoconf.sh". > +# Please do not edit! > +# > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "(host|device)"; > + match "intclass" "0x02"; > + match "intsubclass" "0x06"; > + action "kldload if_cdce"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "(host|device)"; > + match "intclass" "0x02"; > + match "intsubclass" "0x0a"; > + action "kldload if_cdce"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "(host|device)"; > + match "intclass" "0x02"; > + match "intsubclass" "0x0d"; > + action "kldload if_cdce"; > +}; > + > +# 3 usb_dual entries processed > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05ac"; > + match "product" "0x1290"; > + match "intclass" "0xff"; > + match "intsubclass" "0xfd"; > + match "intprotocol" "0x01"; > + action "kldload if_ipheth"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05ac"; > + match "product" "0x1292"; > + match "intclass" "0xff"; > + match "intsubclass" "0xfd"; > + match "intprotocol" "0x01"; > + action "kldload if_ipheth"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05ac"; > + match "product" "0x1294"; > + match "intclass" "0xff"; > + match "intsubclass" "0xfd"; > + match "intprotocol" "0x01"; > + action "kldload if_ipheth"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05ac"; > + match "product" "0x1297"; > + match "intclass" "0xff"; > + match "intsubclass" "0xfd"; > + match "intprotocol" "0x01"; > + action "kldload if_ipheth"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0104"; > + match "product" "0x00be"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x03e8"; > + match "product" "0x0008"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x03eb"; > + match "product" "0x2109"; > + action "kldload uftdi"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x03f0"; > + match "product" > "(0x0121|0x1016|0x1116|0x1216|0x1b1d|0x1e1d|0x2016|0x2116|0x2216|0x3016|0x3116|0x3216|0x3524|0x4016|0x4116|0x4216|0x5016|0x5116|0x5216|0x811c|0xca02)"; > + action "kldload ugensa"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0402"; > + match "product" "0x5632"; > + action "kldload if_cdce"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0403"; > + match "product" > "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; > + action "kldload uftdi"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0408"; > + match "product" "(0x0304|0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; > + action "kldload if_run"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0409"; > + match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0411"; > + match "product" > "(0x0001|0x0005|0x0009|0x0012|0x003d|0x005e|0x0066|0x0067|0x006e|0x008b|0x00b3|0x00d8|0x00d9|0x00da|0x00e8|0x0116|0x0119|0x012e|0x0137|0x0148|0x0150|0x015d|0x016f)"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0413"; > + match "product" "0x2101"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0423"; > + match "product" "(0x000a|0x000c)"; > + action "kldload if_cue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x043e"; > + match "product" "0x9c01"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x045a"; > + match "product" "(0x5001|0x5002)"; > + action "kldload urio"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x045b"; > + match "product" "0x0053"; > + action "kldload uslcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x045e"; > + match "product" > "(0x0079|0x007a|0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0471"; > + match "product" "(0x066a|0x1236|0x200f)"; > + action "kldload uslcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0482"; > + match "product" "0x0203"; > + action "kldload umodem"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0489"; > + match "product" "(0xe000|0xe003)"; > + action "kldload uslcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x049f"; > + match "product" "(0x0003|0x0032|0x505a)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04a4"; > + match "product" "0x0014"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04a5"; > + match "product" "(0x4027|0x4068)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04ad"; > + match "product" "(0x0301|0x0302|0x0303|0x0306)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04b4"; > + match "product" "0x1002"; > + action "kldload ufm"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04b7"; > + match "product" "0x0531"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04b8"; > + match "product" "(0x0521|0x0522)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04bb"; > + match "product" > "(0x0901|0x0904|0x0913|0x0930|0x0944|0x0945|0x0947|0x0948|0x0a03|0x0a0e)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04bf"; > + match "product" "(0x0115|0x0117)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04c5"; > + match "product" "(0x1058|0x1079)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04da"; > + match "product" "(0x2500|0x3900)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04dd"; > + match "product" > "(0x8004|0x8005|0x8006|0x8007|0x9031|0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; > + action "kldload if_cdce"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04e8"; > + match "product" > "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04|0x6601|0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632|0x8001)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x04f1"; > + match "product" "(0x3008|0x3011|0x3012)"; > + action "kldload if_axe"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0502"; > + match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0506"; > + match "product" "(0x03e8|0x11f8|0x4601)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x050d"; > + match "product" > "(0x0103|0x0109|0x0121|0x0257|0x0409|0x1203|0x4050|0x5055|0x7050|0x7050|0x7051|0x705a|0x705c|0x705e|0x8053|0x805c|0x815c|0x825a|0x905b|0x935a)"; > + action "kldload ubsa"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0525"; > + match "product" "(0x1080|0xa4a2)"; > + action "kldload udbp"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0536"; > + match "product" "0x01a0"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0543"; > + match "product" > "(0x0ed9|0x1527|0x1529|0x152b|0x152e|0x1921|0x1922|0x1923)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0547"; > + match "product" "(0x2008|0x2720)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x054c"; > + match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169|0x0437)"; > + action "kldload uvisor"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0557"; > + match "product" "(0x2002|0x2007|0x2008|0x2009|0x4000)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x055d"; > + match "product" "0x2018"; > + action "kldload if_run"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0565"; > + match "product" "(0x0001|0x0002|0x0003|0x0005)"; > + action "kldload ubsa"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0567"; > + match "product" "(0x2000|0x2002)"; > + action "kldload if_upgt"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x056c"; > + match "product" "0x8007"; > + action "kldload ubsa"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x056e"; > + match "product" > "(0x200c|0x4002|0x4005|0x400b|0x4010|0x5003|0x5004|0xabc1)"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x057c"; > + match "product" "(0x2200|0x3800)"; > + action "kldload ng_ubt"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0584"; > + match "product" "(0xb000|0xb020)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0586"; > + match "product" > "(0x3401|0x3407|0x3409|0x340a|0x340f|0x3410|0x3416|0x341a)"; > + action "kldload if_zyd"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x058f"; > + match "product" "0x9720"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05a6"; > + match "product" "0x0101"; > + action "kldload if_run"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05ac"; > + match "product" > "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x0229|0x022a|0x022b|0x030a|0x030b|0x1402)"; > + action "kldload atp"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05ad"; > + match "product" "0x0fba"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05c6"; > + match "product" "(0x6000|0x6613)"; > + action "kldload u3g"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05cc"; > + match "product" "0x3000"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05db"; > + match "product" "(0x0003|0x0005|0x0009|0x000a|0x0011)"; > + action "kldload uvscom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05e0"; > + match "product" > "(0x2000|0x2001|0x2002|0x2003|0x2004|0x2005|0x2006|0x2007|0x2008|0x2009|0x200a)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05e3"; > + match "product" "0x0501"; > + action "kldload udbp"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x05e9"; > + match "product" "(0x0008|0x0009)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x066b"; > + match "product" "(0x200c|0x2202|0x2202|0x2203|0x2204|0x2206|0x400b)"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0675"; > + match "product" "0x0550"; > + action "kldload if_zyd"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x067b"; > + match "product" > "(0x0000|0x0001|0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303|0x2501|0x331a|0xaaa0|0xaaa2)"; > + action "kldload udbp"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x067c"; > + match "product" "0x1001"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x067e"; > + match "product" "0x1001"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0681"; > + match "product" "0x3c06"; > + action "kldload if_ural"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x06e1"; > + match "product" "(0x0008|0x0009)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x06f8"; > + match "product" "(0xe000|0xe010|0xe020|0xe030)"; > + action "kldload if_ural"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0707"; > + match "product" "(0x0100|0x0200|0x0201|0xee13|0xee13)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0711"; > + match "product" "(0x0200|0x0210|0x0230)"; > + action "kldload umct"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0731"; > + match "product" "(0x0528|0x2003)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0745"; > + match "product" "(0x0001|0x1000)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0769"; > + match "product" "(0x11f2|0x11f3|0x31f3)"; > + action "kldload if_urtw"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x077b"; > + match "product" "0x2226"; > + action "kldload if_axe"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0789"; > + match "product" "(0x010c|0x0160|0x0162|0x0163|0x0164)"; > + action "kldload if_urtw"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x078b"; > + match "product" "0x1234"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x079b"; > + match "product" "(0x0027|0x004a|0x0062)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x07a6"; > + match "product" "(0x07c2|0x0986|0x8511|0x8513|0x8515)"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x07aa"; > + match "product" > "(0x0001|0x0004|0x000d|0x0017|0x002a|0x002d|0x002e|0x002f|0x003c|0x003f|0x0041|0x0042|0x9601)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x07b8"; > + match "product" > "(0x110c|0x200c|0x2770|0x2870|0x3070|0x3071|0x3072|0x4000|0x4002|0x4003|0x4004|0x4007|0x400b|0x400c|0x4102|0x4104|0x420a|0x6001|0xabc1|0xb21b|0xb21c|0xb21d|0xb21e|0xb21f)"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x07c9"; > + match "product" "0xb100"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x07cf"; > + match "product" "(0x2001|0x2002|0x2003)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x07d1"; > + match "product" > "(0x3a0c|0x3c03|0x3c04|0x3c06|0x3c07|0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; > + action "kldload if_uath"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x081e"; > + match "product" "0xdf00"; > + action "kldload uvisor"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x082d"; > + match "product" "(0x0100|0x0200|0x0300)"; > + action "kldload uvisor"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0830"; > + match "product" > "(0x0001|0x0002|0x0003|0x0020|0x0031|0x0040|0x0050|0x0060|0x0061|0x0070)"; > + action "kldload uvisor"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0833"; > + match "product" "(0x012e|0x039f)"; > + action "kldload uplcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x083a"; > + match "product" > "(0x1046|0x4506|0x4506|0x4508|0x4521|0x5046|0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522|0xe501)"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0841"; > + match "product" "0x0001"; > + action "kldload urio"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0846"; > + match "product" > "(0x1001|0x1002|0x1020|0x1040|0x4240|0x4260|0x4300|0x6100|0x6a00)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0856"; > + match "product" "0xac01"; > + action "kldload uftdi"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x085a"; > + match "product" "(0x0008|0x0009)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x086e"; > + match "product" "0x1920"; > + action "kldload if_axe"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x087d"; > + match "product" "0x5704"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x08d1"; > + match "product" "(0x0001|0x0003)"; > + action "kldload if_cue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x08dd"; > + match "product" "(0x0986|0x0987|0x0988|0x8511|0x90ff)"; > + action "kldload if_aue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x08e6"; > + match "product" "0x5501"; > + action "kldload uslcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x08fd"; > + match "product" "0x000a"; > + action "kldload uslcom"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0915"; > + match "product" "(0x2000|0x2002)"; > + action "kldload if_upgt"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x091e"; > + match "product" "0x0004"; > + action "kldload uvisor"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0921"; > + match "product" "0x1001"; > + action "kldload ubsa"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0930"; > + match "product" > "(0x0700|0x0705|0x0706|0x0707|0x0708|0x0709|0x070a|0x070b|0x0a07|0x0d45|0x1302)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x093c"; > + match "product" "(0x0601|0x0701)"; > + action "kldload uftdi"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x094b"; > + match "product" "0x0001"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0951"; > + match "product" "(0x0008|0x000a)"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x095a"; > + match "product" "0x3003"; > + action "kldload if_kue"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0960"; > + match "product" "(0x0065|0x0066|0x0067)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0961"; > + match "product" "0x0010"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x099e"; > + match "product" "(0x0052|0x4000)"; > + action "kldload uipaq"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x09aa"; > + match "product" "0x1000"; > + action "kldload if_upgt"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x09d7"; > + match "product" "0x0100"; > + action "kldload ugensa"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0a46"; > + match "product" "(0x0268|0x8515|0x9601)"; > + action "kldload if_udav"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0a5c"; > + match "product" "0x2033"; > + action "kldload ubtbcmfw"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0ace"; > + match "product" "(0x1211|0x1215)"; > + action "kldload if_zyd"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0af0"; > + match "product" > "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901|0x6911|0x6971|0x6971|0x7001|0x7011|0x7021|0x7041|0x7061|0x7100|0x7201|0x7211|0x7251|0x7301|0x7361|0x7381|0x7401|0x7501|0x7601|0x7601|0xc031|0xd013|0xd031|0xd033|0xd033|0xd055|0xd055)"; > + action "kldload u3g"; > +}; > + > +nomatch 32 { > + match "bus" "uhub[0-9]+"; > + match "mode" "host"; > + match "vendor" "0x0b05"; > + match "product" > "(0x1706|0x1707|0x170c|0x171b|0x171d|0x1723|0x1724|0x1731|0x1732|0x1742|0x1760|0x1761|0x1784|0x1790|0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)"; > + action "kldload if_ural"; > +}; > + > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 10:07:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5CFC1065678; Sun, 26 Jun 2011 10:07:48 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2EBF8FC20; Sun, 26 Jun 2011 10:07:48 +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 p5QA7mD6048653; Sun, 26 Jun 2011 10:07:48 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QA7m6Z048636; Sun, 26 Jun 2011 10:07:48 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106261007.p5QA7m6Z048636@svn.freebsd.org> From: Kevin Lo Date: Sun, 26 Jun 2011 10:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223562 - in head/sys: arm/at91 arm/sa11x0 mips/atheros mips/mips mips/rmi mips/rmi/dev/xlr mips/sentry5 mips/sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 10:07:49 -0000 Author: kevlo Date: Sun Jun 26 10:07:48 2011 New Revision: 223562 URL: http://svn.freebsd.org/changeset/base/223562 Log: Remove duplicate header includes Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/sa11x0/sa11x0.c head/sys/mips/atheros/ar71xx_chip.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/atheros/ar71xx_ohci.c head/sys/mips/atheros/ar71xx_setup.c head/sys/mips/atheros/ar724x_chip.c head/sys/mips/atheros/ar91xx_chip.c head/sys/mips/mips/genassym.c head/sys/mips/mips/trap.c head/sys/mips/rmi/dev/xlr/rge.c head/sys/mips/rmi/fmn.c head/sys/mips/rmi/iodi.c head/sys/mips/sentry5/s5_machdep.c head/sys/mips/sibyte/sb_machdep.c Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/arm/at91/at91_machdep.c Sun Jun 26 10:07:48 2011 (r223562) @@ -91,7 +91,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ #define KERNEL_PT_KERN 1 Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/arm/sa11x0/assabet_machdep.c Sun Jun 26 10:07:48 2011 (r223562) @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/sa11x0/sa11x0.c ============================================================================== --- head/sys/arm/sa11x0/sa11x0.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/arm/sa11x0/sa11x0.c Sun Jun 26 10:07:48 2011 (r223562) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -74,7 +73,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include extern void sa11x0_activateirqs(void); Modified: head/sys/mips/atheros/ar71xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar71xx_chip.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/atheros/ar71xx_chip.c Sun Jun 26 10:07:48 2011 (r223562) @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -61,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include +#include + /* XXX these should replace the current definitions in ar71xxreg.h */ /* XXX perhaps an ar71xx_chip.h header file? */ #define AR71XX_PLL_REG_CPU_CONFIG AR71XX_PLL_CPU_BASE + 0x00 Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/atheros/ar71xx_machdep.c Sun Jun 26 10:07:48 2011 (r223562) @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + extern char edata[], end[]; uint32_t ar711_base_mac[ETHER_ADDR_LEN]; Modified: head/sys/mips/atheros/ar71xx_ohci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ohci.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/atheros/ar71xx_ohci.c Sun Jun 26 10:07:48 2011 (r223562) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static int ar71xx_ohci_attach(device_t dev); static int ar71xx_ohci_detach(device_t dev); static int ar71xx_ohci_probe(device_t dev); Modified: head/sys/mips/atheros/ar71xx_setup.c ============================================================================== --- head/sys/mips/atheros/ar71xx_setup.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/atheros/ar71xx_setup.c Sun Jun 26 10:07:48 2011 (r223562) @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -64,6 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #define AR71XX_SYS_TYPE_LEN 128 static char ar71xx_sys_type[AR71XX_SYS_TYPE_LEN]; Modified: head/sys/mips/atheros/ar724x_chip.c ============================================================================== --- head/sys/mips/atheros/ar724x_chip.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/atheros/ar724x_chip.c Sun Jun 26 10:07:48 2011 (r223562) @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -62,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + static void ar724x_chip_detect_mem_size(void) { Modified: head/sys/mips/atheros/ar91xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar91xx_chip.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/atheros/ar91xx_chip.c Sun Jun 26 10:07:48 2011 (r223562) @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -61,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + static void ar91xx_chip_detect_mem_size(void) { Modified: head/sys/mips/mips/genassym.c ============================================================================== --- head/sys/mips/mips/genassym.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/mips/genassym.c Sun Jun 26 10:07:48 2011 (r223562) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/mips/trap.c Sun Jun 26 10:07:48 2011 (r223562) @@ -91,10 +91,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#include -#include - - #ifdef TRAP_DEBUG int trap_debug = 0; SYSCTL_INT(_machdep, OID_AUTO, trap_debug, CTLFLAG_RW, Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/rmi/dev/xlr/rge.c Sun Jun 26 10:07:48 2011 (r223562) @@ -78,8 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include Modified: head/sys/mips/rmi/fmn.c ============================================================================== --- head/sys/mips/rmi/fmn.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/rmi/fmn.c Sun Jun 26 10:07:48 2011 (r223562) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/rmi/iodi.c Sun Jun 26 10:07:48 2011 (r223562) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/mips/sentry5/s5_machdep.c ============================================================================== --- head/sys/mips/sentry5/s5_machdep.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/sentry5/s5_machdep.c Sun Jun 26 10:07:48 2011 (r223562) @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -75,6 +70,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #ifdef CFE #include #endif Modified: head/sys/mips/sibyte/sb_machdep.c ============================================================================== --- head/sys/mips/sibyte/sb_machdep.c Sun Jun 26 09:32:46 2011 (r223561) +++ head/sys/mips/sibyte/sb_machdep.c Sun Jun 26 10:07:48 2011 (r223562) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include - #include "opt_ddb.h" #include "opt_kdb.h" From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 10:32:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA60D1065670; Sun, 26 Jun 2011 10:32:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C04688FC0C; Sun, 26 Jun 2011 10:32: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 p5QAW9Y8049365; Sun, 26 Jun 2011 10:32:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QAW9uB049362; Sun, 26 Jun 2011 10:32:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106261032.p5QAW9uB049362@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Jun 2011 10:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223563 - in head/etc: . mtree X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 10:32:10 -0000 Author: adrian Date: Sun Jun 26 10:32:09 2011 New Revision: 223563 URL: http://svn.freebsd.org/changeset/base/223563 Log: Add a couple more frequency ranges to the FCC3 (FCC + DFS) regulatory domain. The frequency range 5490MHz -> 5710MHz was opened up sometime in 2009, but regdomain.xml wasn't updated. FCC reference: (Section 15.407): http://louise.hallikainen.org/FCC/FccRules/2009/15/407/ The hole between 5600-5650MHz is due to a request from Airports using a weather radar system which also utilises this range. The GIT commit explaining this hole in more detail can be found here: http://git.kernel.org/?p=linux/kernel/git/linville/wireless-regdb.git;a=commit;h=fcbf9225d56e82d9a4e506187d42285e76d81523 Modified: head/etc/mtree/BSD.include.dist head/etc/regdomain.xml Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sun Jun 26 10:07:48 2011 (r223562) +++ head/etc/mtree/BSD.include.dist Sun Jun 26 10:32:09 2011 (r223563) @@ -229,6 +229,8 @@ .. kadm5 .. + lib80211 + .. libmilter .. lwres Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Sun Jun 26 10:07:48 2011 (r223562) +++ head/etc/regdomain.xml Sun Jun 26 10:32:09 2011 (r223563) @@ -144,6 +144,18 @@ IEEE80211_CHAN_DFS + + 20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + 23 IEEE80211_CHAN_PASSIVE @@ -196,6 +208,34 @@ IEEE80211_CHAN_DFS + + 20 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + 23 IEEE80211_CHAN_HT20 @@ -1644,6 +1684,16 @@ 40 20 IEEE80211_CHAN_A + + 5500 5580 + 20 20 + IEEE80211_CHAN_A + + + 5500 5580 + 40 20 + IEEE80211_CHAN_A + 5500 5620 20 20 @@ -1664,6 +1714,16 @@ 20 20 IEEE80211_CHAN_A + + 5660 5700 + 20 20 + IEEE80211_CHAN_A + + + 5660 5700 + 40 20 + IEEE80211_CHAN_A + 5725 5825 40 20 From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 10:34:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1456B1065672; Sun, 26 Jun 2011 10:34:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF19D8FC16; Sun, 26 Jun 2011 10:34:01 +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 p5QAY1uZ049468; Sun, 26 Jun 2011 10:34:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QAY1BZ049466; Sun, 26 Jun 2011 10:34:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106261034.p5QAY1BZ049466@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Jun 2011 10:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223564 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 10:34:02 -0000 Author: adrian Date: Sun Jun 26 10:34:01 2011 New Revision: 223564 URL: http://svn.freebsd.org/changeset/base/223564 Log: I think 23dBm is the correct value to use here. CRDA uses 20dBm + 3dB max antenna gain; I believe net80211 doesn't take antenna gain into account and leaves it up to the driver to enforce. (ath_hal(4) certainly tries to do this.) Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Sun Jun 26 10:32:09 2011 (r223563) +++ head/etc/regdomain.xml Sun Jun 26 10:34:01 2011 (r223564) @@ -139,19 +139,19 @@ - 20 + 23 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS @@ -195,42 +195,42 @@ - 20 + 23 IEEE80211_CHAN_HT20 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT40 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT20 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT40 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT20 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT40 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 11:37:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C3E10656D9; Sun, 26 Jun 2011 11:37:25 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CC418FC17; Sun, 26 Jun 2011 11:37: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 p5QBbPnP051313; Sun, 26 Jun 2011 11:37:25 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QBbPOi051309; Sun, 26 Jun 2011 11:37:25 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106261137.p5QBbPOi051309@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 26 Jun 2011 11:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223566 - in head: etc/devd sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 11:37:25 -0000 Author: gavin Date: Sun Jun 26 11:37:24 2011 New Revision: 223566 URL: http://svn.freebsd.org/changeset/base/223566 Log: The SMCWUSBG is a zyd(4) device, not an uath(4) device. Remove from the latter. It appears that the addition to uath(4) came in through PR kern/135009, which had tested another device, the SMCWUSBTG2, successfully with uath(4) and included the SMCWUSBG as it "has the same chipset". I can find no other evidence that these two do actually share the same chipset. Moreover, Linux treats the SMCWUSBG as a zyd(4) device also. This reverts r223537. Discussed with: hselasky, kevlo MFC after: 1 week Modified: head/etc/devd/uath.conf head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/etc/devd/uath.conf ============================================================================== --- head/etc/devd/uath.conf Sun Jun 26 10:50:11 2011 (r223565) +++ head/etc/devd/uath.conf Sun Jun 26 11:37:24 2011 (r223566) @@ -3,13 +3,13 @@ # Atheros USB wireless network device specific devd events # Accton -# SMCWUSB-G and SMCWUSBT-G2 +# SMCWUSBT-G2 notify 100 { match "system" "USB"; match "subsystem" "DEVICE"; match "type" "ATTACH"; match "vendor" "0x083a"; - match "product" "(0x4505|0x4507)"; + match "product" "0x4507"; action "/usr/sbin/uathload -d /dev/$cdev"; }; Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Sun Jun 26 10:50:11 2011 (r223565) +++ head/sys/dev/usb/wlan/if_uath.c Sun Jun 26 11:37:24 2011 (r223566) @@ -169,7 +169,6 @@ enum { /* recognized device vendors/products */ static const STRUCT_USB_HOST_ID uath_devs[] = { #define UATH_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } - UATH_DEV(ACCTON, SMCWUSBG), UATH_DEV(ACCTON, SMCWUSBTG2), UATH_DEV(ATHEROS, AR5523), UATH_DEV(ATHEROS2, AR5523_1), Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Sun Jun 26 10:50:11 2011 (r223565) +++ head/sys/dev/usb/wlan/if_zyd.c Sun Jun 26 11:37:24 2011 (r223566) @@ -229,6 +229,7 @@ static const STRUCT_USB_HOST_ID zyd_devs ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), ZYD_ZD1211_DEV(ZYXEL, G200V2), /* ZYD_ZD1211B */ + ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), ZYD_ZD1211B_DEV(ACCTON, ZD1211B), ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 11:41:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0354106564A; Sun, 26 Jun 2011 11:41:35 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 02BE18FC1E; Sun, 26 Jun 2011 11:41:34 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=3OyxrDLVq9sri6DuQhVzJBEiMCfYdL5zDZJFh5fE9Ak= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=_YJJ2cSHtBcA:10 a=dBRESv0yCI8A:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=GRqBUWbMcLFBAkAPT4YA:9 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 145214647; Sun, 26 Jun 2011 13:41:32 +0200 Received-SPF: softfail receiver=mailfe08.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: Ronald Klop Date: Sun, 26 Jun 2011 13:39:52 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201106242132.p5OLW3DL071062@svn.freebsd.org> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201106261339.52204.hselasky@freebsd.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r223519 - head/etc/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 11:41:36 -0000 On Sunday 26 June 2011 11:33:51 Ronald Klop wrote: > Is this part of the auto-detect hardware discussion I read on one of the > mailinglists lately? About having less drivers in GENERIC and more > auto-loaded? > If it is... Looks like a nice feature. > > Ronald. > > On Fri, 24 Jun 2011 23:32:03 +0200, Hans Petter Selasky > That's correct. --HPS From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 13:19:55 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8137B106566B; Sun, 26 Jun 2011 13:19:55 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 42BF58FC1C; Sun, 26 Jun 2011 13:19:55 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id p5QCpYnF022502; Sun, 26 Jun 2011 06:51:34 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <201106260132.p5Q1Wlrw030787@svn.freebsd.org> Date: Sun, 26 Jun 2011 06:51:34 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <537C5DE9-9B16-4A4F-AE94-25C9DA7D3B78@samsco.org> References: <201106260132.p5Q1Wlrw030787@svn.freebsd.org> To: "Justin T. Gibbs" X-Mailer: Apple Mail (2.1084) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223557 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 13:19:55 -0000 On Jun 25, 2011, at 7:32 PM, Justin T. Gibbs wrote: > Author: gibbs > Date: Sun Jun 26 01:32:46 2011 > New Revision: 223557 > URL: http://svn.freebsd.org/changeset/base/223557 >=20 > Log: > cam/scsi/scsi_cd.c: > In cdregister(), hold the periph lock semaphore during changer > probe/configuration. This removes a window where an open of the > cd device may succeed before probe processing has completed. >=20 I hope this works for Andre (and likely others). Regardless though, = cdregister() and daregister() need to be refactored to not require this = delicate mess of locking hacks. Scott From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 13:43:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7B8E106564A; Sun, 26 Jun 2011 13:43:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7DEC8FC0A; Sun, 26 Jun 2011 13:43:15 +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 p5QDhFOI054813; Sun, 26 Jun 2011 13:43:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QDhF9l054810; Sun, 26 Jun 2011 13:43:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106261343.p5QDhF9l054810@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Jun 2011 13:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223567 - in head/sys: conf dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 13:43:15 -0000 Author: adrian Date: Sun Jun 26 13:43:15 2011 New Revision: 223567 URL: http://svn.freebsd.org/changeset/base/223567 Log: Add ATH_ENABLE_DFS which enables the DFS flag so the DFS code can be tested. This doesn't at all actually do radar detection! It's just so developers who wish to test the net80211 DFS code can easily do so. Without this flag, the DFS channels are never marked DFS and thus the DFS stuff doesn't run. Modified: head/sys/conf/options head/sys/dev/ath/if_ath.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Jun 26 11:37:24 2011 (r223566) +++ head/sys/conf/options Sun Jun 26 13:43:15 2011 (r223567) @@ -773,7 +773,8 @@ ATH_TXBUF opt_ath.h ATH_RXBUF opt_ath.h ATH_DIAGAPI opt_ath.h ATH_TX99_DIAG opt_ath.h -ATH_ENABLE_11N opt_ah.h +ATH_ENABLE_11N opt_ath.h +ATH_ENABLE_DFS opt_ath.h # options for the Atheros hal AH_SUPPORT_AR5416 opt_ah.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jun 26 11:37:24 2011 (r223566) +++ head/sys/dev/ath/if_ath.c Sun Jun 26 13:43:15 2011 (r223567) @@ -528,6 +528,9 @@ ath_attach(u_int16_t devid, struct ath_s | IEEE80211_C_WPA /* capable of WPA1+WPA2 */ | IEEE80211_C_BGSCAN /* capable of bg scanning */ | IEEE80211_C_TXFRAG /* handle tx frags */ +#ifdef ATH_ENABLE_DFS + | IEEE80211_C_DFS /* Enable DFS radar detection */ +#endif ; /* * Query the hal to figure out h/w crypto support. From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 13:53:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06B2D1065677; Sun, 26 Jun 2011 13:53:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D20448FC1D; Sun, 26 Jun 2011 13:53:24 +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 p5QDrOGP055144; Sun, 26 Jun 2011 13:53:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QDrOFc055142; Sun, 26 Jun 2011 13:53:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106261353.p5QDrOFc055142@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Jun 2011 13:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223568 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 13:53:25 -0000 Author: adrian Date: Sun Jun 26 13:53:24 2011 New Revision: 223568 URL: http://svn.freebsd.org/changeset/base/223568 Log: Fix beacon transmission after a channel set. The DFS code was tickling the channel set directly whilst going through the state RUN -> CSA -> RUN. This only changed the channel; it didn't go via ath_reset(). However in this driver, a channel change always causes a chip reset, which resets the beacon timer configuration and interrupt setup. This meant that data would go out but as the beacon timers never fired, beacons would never be queued. The confusing part is that sometimes the state transition was RUN -> SCAN -> CAC -> RUN (with CSA being in there sometimes); going via SCAN would clear sc_beacons and thus the transition to RUN would reprogram beacon transmission. In case someone tries debugging why suspending a device currently beaconing (versus just RX'ing beacons which is what occurs in STA mode), add a silly comment which should hopefully land them at this commit message. The call to ath_hal_reset() will be clearing the beacon config and it may not be always reset. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jun 26 13:43:15 2011 (r223567) +++ head/sys/dev/ath/if_ath.c Sun Jun 26 13:53:24 2011 (r223568) @@ -1290,6 +1290,8 @@ ath_resume(struct ath_softc *sc) HAL_GPIO_MUX_MAC_NETWORK_LED); ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); } + + /* XXX beacons ? */ } void @@ -1592,6 +1594,12 @@ ath_init(void *arg) sc->sc_lastani = 0; sc->sc_lastshortcal = 0; sc->sc_doresetcal = AH_FALSE; + /* + * Beacon timers were cleared here; give ath_newstate() + * a hint that the beacon timers should be poked when + * things transition to the RUN state. + */ + sc->sc_beacons = 0; /* * Setup the hardware after reset: the key cache @@ -4468,6 +4476,19 @@ ath_chan_set(struct ath_softc *sc, struc ath_chan_change(sc, chan); /* + * Reset clears the beacon timers; reset them + * here if needed. + */ + if (sc->sc_beacons) { /* restart beacons */ +#ifdef IEEE80211_SUPPORT_TDMA + if (sc->sc_tdma) + ath_tdma_config(sc, NULL); + else +#endif + ath_beacon_config(sc, NULL); + } + + /* * Re-enable interrupts. */ ath_hal_intrset(ah, sc->sc_imask); From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 14:29:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6460C1065672; Sun, 26 Jun 2011 14:29:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BA168FC08; Sun, 26 Jun 2011 14:29:50 +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 p5QETopT056253; Sun, 26 Jun 2011 14:29:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QETopS056251; Sun, 26 Jun 2011 14:29:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106261429.p5QETopS056251@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Jun 2011 14:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223569 - head/etc/mtree X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 14:29:50 -0000 Author: adrian Date: Sun Jun 26 14:29:49 2011 New Revision: 223569 URL: http://svn.freebsd.org/changeset/base/223569 Log: .. this wasn't supposed to be committed! sorry. Modified: head/etc/mtree/BSD.include.dist Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sun Jun 26 13:53:24 2011 (r223568) +++ head/etc/mtree/BSD.include.dist Sun Jun 26 14:29:49 2011 (r223569) @@ -229,8 +229,6 @@ .. kadm5 .. - lib80211 - .. libmilter .. lwres From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 15:08:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD0B31065670; Sun, 26 Jun 2011 15:08:14 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D71A8FC08; Sun, 26 Jun 2011 15:08: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 p5QF8EHN057348; Sun, 26 Jun 2011 15:08:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QF8EDK057345; Sun, 26 Jun 2011 15:08:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106261508.p5QF8EDK057345@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 26 Jun 2011 15:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223570 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 15:08:14 -0000 Author: nwhitehorn Date: Sun Jun 26 15:08:14 2011 New Revision: 223570 URL: http://svn.freebsd.org/changeset/base/223570 Log: Revert r223479. It is unnecessary and served only to slightly ameliorate some manifestations of the bug actually fixed in r223485. Modified: head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Sun Jun 26 14:29:49 2011 (r223569) +++ head/sys/powerpc/aim/trap_subr32.S Sun Jun 26 15:08:14 2011 (r223570) @@ -754,8 +754,6 @@ k_trap: /* Call C interrupt dispatcher: */ trapagain: addi %r3,%r1,8 - addi %r4,%r1,-4 /* Clear any existing reservations */ - stwcx. %r3,0,%r4 bl CNAME(powerpc_interrupt) .globl CNAME(trapexit) /* backtrace code sentinel */ CNAME(trapexit): Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sun Jun 26 14:29:49 2011 (r223569) +++ head/sys/powerpc/aim/trap_subr64.S Sun Jun 26 15:08:14 2011 (r223570) @@ -514,8 +514,6 @@ trapagain: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 - addi %r4,%r1,-8 /* Clear any existing reservations */ - stdcx. %r3,0,%r4 bl CNAME(powerpc_interrupt) nop From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 16:11:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CA6F106566B; Sun, 26 Jun 2011 16:11:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 637D78FC08; Sun, 26 Jun 2011 16:11:36 +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 p5QGBadc059155; Sun, 26 Jun 2011 16:11:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QGBa2A059153; Sun, 26 Jun 2011 16:11:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106261611.p5QGBa2A059153@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 26 Jun 2011 16:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223571 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 16:11:36 -0000 Author: nwhitehorn Date: Sun Jun 26 16:11:36 2011 New Revision: 223571 URL: http://svn.freebsd.org/changeset/base/223571 Log: Add better error handling for RTAS calls. These can potentially cause machine checks (e.g. invalid PCI configuration cycles), but these can be caught and recovered from. This change also the RTAS PCI driver to work without modification as a replacement for the Grackle driver on Grackle-based Powermacs. Modified: head/sys/powerpc/ofw/rtas.c Modified: head/sys/powerpc/ofw/rtas.c ============================================================================== --- head/sys/powerpc/ofw/rtas.c Sun Jun 26 15:08:14 2011 (r223570) +++ head/sys/powerpc/ofw/rtas.c Sun Jun 26 16:11:36 2011 (r223571) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -39,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,6 +62,8 @@ int rtascall(vm_offset_t callbuffer, uin extern uintptr_t rtas_entry; extern register_t rtasmsr; +int setfault(faultbuf); /* defined in locore.S */ + /* * After the VM is up, allocate RTAS memory and instantiate it */ @@ -188,6 +192,7 @@ int rtas_call_method(cell_t token, int nargs, int nreturns, ...) { vm_offset_t argsptr; + faultbuf env; va_list ap; struct { cell_t token; @@ -213,7 +218,19 @@ rtas_call_method(cell_t token, int nargs args.args_n_results[n] = va_arg(ap, cell_t); argsptr = rtas_real_map(&args, sizeof(args)); - result = rtascall(argsptr, rtas_private_data); + + /* Get rid of any stale machine checks that have been waiting. */ + __asm __volatile ("sync; isync"); + if (!setfault(env)) { + __asm __volatile ("sync"); + result = rtascall(argsptr, rtas_private_data); + __asm __volatile ("sync; isync"); + } else { + result = RTAS_HW_ERROR; + } + curthread->td_pcb->pcb_onfault = 0; + __asm __volatile ("sync"); + rtas_real_unmap(argsptr, &args, sizeof(args)); mtx_unlock(&rtas_mtx); From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 17:54:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2995106566B; Sun, 26 Jun 2011 17:54:11 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2A708FC19; Sun, 26 Jun 2011 17:54:11 +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 p5QHsBQf062102; Sun, 26 Jun 2011 17:54:11 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QHsBXL062100; Sun, 26 Jun 2011 17:54:11 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201106261754.p5QHsBXL062100@svn.freebsd.org> From: Tim Kientzle Date: Sun, 26 Jun 2011 17:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223573 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 17:54:11 -0000 Author: kientzle Date: Sun Jun 26 17:54:11 2011 New Revision: 223573 URL: http://svn.freebsd.org/changeset/base/223573 Log: The --newer-than test should descend into old directories to look for new files. PR: bin/150890 Submitted by: Tobias Herre MFC after: 3 weeks Modified: head/usr.bin/tar/write.c Modified: head/usr.bin/tar/write.c ============================================================================== --- head/usr.bin/tar/write.c Sun Jun 26 17:30:46 2011 (r223572) +++ head/usr.bin/tar/write.c Sun Jun 26 17:54:11 2011 (r223573) @@ -752,6 +752,9 @@ write_hierarchy(struct bsdtar *bsdtar, s break; } + if (bsdtar->option_no_subdirs) + descend = 0; + /* * Are we about to cross to a new filesystem? */ @@ -764,7 +767,6 @@ write_hierarchy(struct bsdtar *bsdtar, s } else if (descend == 0) { /* We're not descending, so no need to check. */ } else if (bsdtar->option_dont_traverse_mounts) { - /* User has asked us not to cross mount points. */ descend = 0; } else { /* We're prepared to cross a mount point. */ @@ -791,8 +793,15 @@ write_hierarchy(struct bsdtar *bsdtar, s * In -u mode, check that the file is newer than what's * already in the archive; in all modes, obey --newerXXX flags. */ - if (!new_enough(bsdtar, name, st)) + if (!new_enough(bsdtar, name, st)) { + if (!descend) + continue; + if (bsdtar->option_interactive && + !yes("add '%s'", name)) + continue; + tree_descend(tree); continue; + } archive_entry_free(entry); entry = archive_entry_new(); @@ -868,8 +877,7 @@ write_hierarchy(struct bsdtar *bsdtar, s !yes("add '%s'", name)) continue; - /* Note: if user vetoes, we won't descend. */ - if (descend && !bsdtar->option_no_subdirs) + if (descend) tree_descend(tree); /* From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 18:25:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C14C106564A; Sun, 26 Jun 2011 18:25:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 327498FC0C; Sun, 26 Jun 2011 18:25:11 +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 p5QIPBep063008; Sun, 26 Jun 2011 18:25:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QIPBIr063002; Sun, 26 Jun 2011 18:25:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106261825.p5QIPBIr063002@svn.freebsd.org> From: Ed Schouten Date: Sun, 26 Jun 2011 18:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223574 - in head/sys/teken: . demo libteken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 18:25:11 -0000 Author: ed Date: Sun Jun 26 18:25:10 2011 New Revision: 223574 URL: http://svn.freebsd.org/changeset/base/223574 Log: Fix various whitespace inconsistencies in sys/teken. Modified: head/sys/teken/demo/teken_demo.c head/sys/teken/gensequences head/sys/teken/libteken/teken.3 head/sys/teken/teken.c head/sys/teken/teken_subr.h Modified: head/sys/teken/demo/teken_demo.c ============================================================================== --- head/sys/teken/demo/teken_demo.c Sun Jun 26 17:54:11 2011 (r223573) +++ head/sys/teken/demo/teken_demo.c Sun Jun 26 18:25:10 2011 (r223574) @@ -88,7 +88,7 @@ printchar(const teken_pos_t *p) getyx(stdscr, y, x); - px = &buffer[p->tp_col][p->tp_row]; + px = &buffer[p->tp_col][p->tp_row]; /* Convert Unicode to UTF-8. */ if (px->c < 0x80) { @@ -169,10 +169,10 @@ test_copy(void *s __unused, const teken_ * Copying is a little tricky. We must make sure we do it in * correct order, to make sure we don't overwrite our own data. */ - + nrow = r->tr_end.tp_row - r->tr_begin.tp_row; ncol = r->tr_end.tp_col - r->tr_begin.tp_col; - + if (p->tp_row < r->tr_begin.tp_row) { /* Copy from top to bottom. */ if (p->tp_col < r->tr_begin.tp_col) { Modified: head/sys/teken/gensequences ============================================================================== --- head/sys/teken/gensequences Sun Jun 26 17:54:11 2011 (r223573) +++ head/sys/teken/gensequences Sun Jun 26 18:25:10 2011 (r223574) @@ -3,7 +3,7 @@ #- # Copyright (c) 2008-2009 Ed Schouten # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -12,7 +12,7 @@ # 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 Modified: head/sys/teken/libteken/teken.3 ============================================================================== --- head/sys/teken/libteken/teken.3 Sun Jun 26 17:54:11 2011 (r223573) +++ head/sys/teken/libteken/teken.3 Sun Jun 26 18:25:10 2011 (r223574) @@ -148,7 +148,7 @@ These defaults can be modified using and .Fn teken_set_defattr . .Pp -The +The .Fn teken_get_sequence function is a utility function that can be used to obtain escape sequences of special keyboard keys, generated by user input. Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Sun Jun 26 17:54:11 2011 (r223573) +++ head/sys/teken/teken.c Sun Jun 26 18:25:10 2011 (r223574) @@ -526,7 +526,7 @@ teken_get_sequence(teken_t *t, unsigned /* Default xterm sequences. */ if (k < sizeof special_strings_normal / sizeof(char *)) return (special_strings_normal[k]); - + return (NULL); } Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sun Jun 26 17:54:11 2011 (r223573) +++ head/sys/teken/teken_subr.h Sun Jun 26 18:25:10 2011 (r223574) @@ -260,7 +260,7 @@ teken_subr_cursor_backward_tabulation(te break; t->t_cursor.tp_col--; - + /* Tab marker set. */ if (teken_tab_isset(t, t->t_cursor.tp_col)) ntabs--; @@ -303,7 +303,7 @@ teken_subr_cursor_forward_tabulation(tek break; t->t_cursor.tp_col++; - + /* Tab marker set. */ if (teken_tab_isset(t, t->t_cursor.tp_col)) ntabs--; From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 18:26:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86A501065672; Sun, 26 Jun 2011 18:26:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 757FB8FC13; Sun, 26 Jun 2011 18:26:20 +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 p5QIQKLx063082; Sun, 26 Jun 2011 18:26:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QIQKRk063073; Sun, 26 Jun 2011 18:26:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106261826.p5QIQKRk063073@svn.freebsd.org> From: Ed Schouten Date: Sun, 26 Jun 2011 18:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223575 - in head/sys: dev/pty dev/snp dev/syscons kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 18:26:20 -0000 Author: ed Date: Sun Jun 26 18:26:20 2011 New Revision: 223575 URL: http://svn.freebsd.org/changeset/base/223575 Log: Fix whitespace inconsistencies in the TTY layer and its drivers owned by me. Modified: head/sys/dev/pty/pty.c head/sys/dev/snp/snp.c head/sys/dev/syscons/scterm-teken.c head/sys/kern/tty.c head/sys/kern/tty_inq.c head/sys/kern/tty_outq.c head/sys/kern/tty_pts.c head/sys/kern/tty_ttydisc.c Modified: head/sys/dev/pty/pty.c ============================================================================== --- head/sys/dev/pty/pty.c Sun Jun 26 18:25:10 2011 (r223574) +++ head/sys/dev/pty/pty.c Sun Jun 26 18:26:20 2011 (r223575) @@ -79,7 +79,7 @@ ptydev_fdopen(struct cdev *dev, int ffla /* Raise a warning when a legacy PTY has been allocated. */ if (pty_warningcnt > 0) { pty_warningcnt--; - log(LOG_INFO, "pid %d (%s) is using legacy pty devices%s\n", + log(LOG_INFO, "pid %d (%s) is using legacy pty devices%s\n", td->td_proc->p_pid, td->td_name, pty_warningcnt ? "" : " - not logging anymore"); } @@ -139,8 +139,8 @@ static int pty_modevent(module_t mod, int type, void *data) { - switch(type) { - case MOD_LOAD: + switch(type) { + case MOD_LOAD: EVENTHANDLER_REGISTER(dev_clone, pty_clone, 0, 1000); make_dev_credf(MAKEDEV_ETERNAL_KLD, &ptmx_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0666, "ptmx"); Modified: head/sys/dev/snp/snp.c ============================================================================== --- head/sys/dev/snp/snp.c Sun Jun 26 18:25:10 2011 (r223574) +++ head/sys/dev/snp/snp.c Sun Jun 26 18:26:20 2011 (r223575) @@ -158,7 +158,7 @@ snp_read(struct cdev *dev, struct uio *u error = devfs_get_cdevpriv((void **)&ss); if (error != 0) return (error); - + tp = ss->snp_tty; if (tp == NULL || tty_gone(tp)) return (EIO); @@ -198,7 +198,7 @@ snp_write(struct cdev *dev, struct uio * error = devfs_get_cdevpriv((void **)&ss); if (error != 0) return (error); - + tp = ss->snp_tty; if (tp == NULL || tty_gone(tp)) return (EIO); Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sun Jun 26 18:25:10 2011 (r223574) +++ head/sys/dev/syscons/scterm-teken.c Sun Jun 26 18:26:20 2011 (r223575) @@ -643,7 +643,7 @@ scteken_copy(void *arg, const teken_rect while (src < end) { sc_vtb_move(&scp->vtb, src, dst, width); - + src += scp->xsize; dst += scp->xsize; } @@ -658,7 +658,7 @@ scteken_copy(void *arg, const teken_rect while (src >= end) { sc_vtb_move(&scp->vtb, src, dst, width); - + src -= scp->xsize; dst -= scp->xsize; } Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Jun 26 18:25:10 2011 (r223574) +++ head/sys/kern/tty.c Sun Jun 26 18:26:20 2011 (r223575) @@ -470,10 +470,10 @@ ttydev_write(struct cdev *dev, struct ui if (error) goto done; } - - tp->t_flags |= TF_BUSY_OUT; + + tp->t_flags |= TF_BUSY_OUT; error = ttydisc_write(tp, uio, ioflag); - tp->t_flags &= ~TF_BUSY_OUT; + tp->t_flags &= ~TF_BUSY_OUT; cv_signal(&tp->t_outserwait); } @@ -1054,7 +1054,7 @@ tty_rel_pgrp(struct tty *tp, struct pgrp if (tp->t_pgrp == pg) tp->t_pgrp = NULL; - + tty_unlock(tp); } @@ -1241,7 +1241,7 @@ tty_signal_sessleader(struct tty *tp, in /* Make signals start output again. */ tp->t_flags &= ~TF_STOPPED; - + if (tp->t_session != NULL && tp->t_session->s_leader != NULL) { p = tp->t_session->s_leader; PROC_LOCK(p); @@ -1305,7 +1305,7 @@ tty_wait(struct tty *tp, struct cv *cv) /* Restart the system call when we may have been revoked. */ if (tp->t_revokecnt != revokecnt) return (ERESTART); - + /* Bail out when the device slipped away. */ if (tty_gone(tp)) return (ENXIO); @@ -1327,7 +1327,7 @@ tty_timedwait(struct tty *tp, struct cv /* Restart the system call when we may have been revoked. */ if (tp->t_revokecnt != revokecnt) return (ERESTART); - + /* Bail out when the device slipped away. */ if (tty_gone(tp)) return (ENXIO); @@ -1469,7 +1469,7 @@ tty_generic_ioctl(struct tty *tp, u_long return (error); /* XXX: CLOCAL? */ - + tp->t_termios.c_cflag = t->c_cflag & ~CIGNORE; tp->t_termios.c_ispeed = t->c_ispeed; tp->t_termios.c_ospeed = t->c_ospeed; @@ -1708,7 +1708,7 @@ tty_ioctl(struct tty *tp, u_long cmd, vo if (tty_gone(tp)) return (ENXIO); - + error = ttydevsw_ioctl(tp, cmd, data, td); if (error == ENOIOCTL) error = tty_generic_ioctl(tp, cmd, data, fflag, td); @@ -1786,7 +1786,7 @@ ttyhook_defrint(struct tty *tp, char c, if (ttyhook_rint_bypass(tp, &c, 1) != 1) return (-1); - + return (0); } @@ -1812,7 +1812,7 @@ ttyhook_register(struct tty **rtp, struc error = EBADF; goto done1; } - + /* * Make sure the vnode is bound to a character device. * Unlocked check for the vnode type is ok there, because we @@ -1910,7 +1910,7 @@ ttyconsdev_open(struct cdev *dev, int of /* System console has no TTY associated. */ if (dev_console->si_drv1 == NULL) return (ENXIO); - + return (ttydev_open(dev, oflags, devtype, td)); } Modified: head/sys/kern/tty_inq.c ============================================================================== --- head/sys/kern/tty_inq.c Sun Jun 26 18:25:10 2011 (r223574) +++ head/sys/kern/tty_inq.c Sun Jun 26 18:26:20 2011 (r223575) @@ -142,7 +142,7 @@ void ttyinq_free(struct ttyinq *ti) { struct ttyinq_block *tib; - + ttyinq_flush(ti); ti->ti_quota = 0; @@ -276,7 +276,7 @@ ttyinq_write(struct ttyinq *ti, const vo struct ttyinq_block *tib; unsigned int boff; size_t l; - + while (nbytes > 0) { boff = ti->ti_end % TTYINQ_DATASIZE; @@ -313,7 +313,7 @@ ttyinq_write(struct ttyinq *ti, const vo nbytes -= l; ti->ti_end += l; } - + return (cbuf - (const char *)buf); } @@ -397,7 +397,7 @@ ttyinq_peekchar(struct ttyinq *ti, char *c = tib->tib_data[boff]; *quote = GETBIT(tib, boff); - + return (0); } Modified: head/sys/kern/tty_outq.c ============================================================================== --- head/sys/kern/tty_outq.c Sun Jun 26 18:25:10 2011 (r223574) +++ head/sys/kern/tty_outq.c Sun Jun 26 18:26:20 2011 (r223575) @@ -119,7 +119,7 @@ void ttyoutq_free(struct ttyoutq *to) { struct ttyoutq_block *tob; - + ttyoutq_flush(to); to->to_quota = 0; Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Sun Jun 26 18:25:10 2011 (r223574) +++ head/sys/kern/tty_pts.c Sun Jun 26 18:26:20 2011 (r223575) @@ -295,7 +295,7 @@ ptsdev_ioctl(struct file *fp, u_long cmd return (EINVAL); return copyout(p, fgn->buf, i); } - + /* * We need to implement TIOCGPGRP and TIOCGSID here again. When * called on the pseudo-terminal master, it should not check if @@ -563,7 +563,7 @@ ptsdev_stat(struct file *fp, struct stat sb->st_uid = dev->si_uid; sb->st_gid = dev->si_gid; sb->st_mode = dev->si_mode | S_IFCHR; - + return (0); } @@ -823,7 +823,7 @@ posix_openpt(struct thread *td, struct p */ if (uap->flags & ~(O_RDWR|O_NOCTTY)) return (EINVAL); - + error = falloc(td, &fp, &fd, 0); if (error) return (error); Modified: head/sys/kern/tty_ttydisc.c ============================================================================== --- head/sys/kern/tty_ttydisc.c Sun Jun 26 18:25:10 2011 (r223574) +++ head/sys/kern/tty_ttydisc.c Sun Jun 26 18:26:20 2011 (r223575) @@ -270,13 +270,13 @@ ttydisc_read_raw_interbyte_timer(struct MPASS(tp->t_termios.c_cc[VMIN] != 0); MPASS(tp->t_termios.c_cc[VTIME] != 0); - + /* * When using the interbyte timer, the timer should be started * after the first byte has been received. We just call into the * generic read timer code after we've received the first byte. */ - + for (;;) { error = ttyinq_read_uio(&tp->t_inq, tp, uio, uio->uio_resid, 0); @@ -331,7 +331,7 @@ ttydisc_read(struct tty *tp, struct uio /* Unset the input watermark when we've got enough space. */ tty_hiwat_in_unblock(tp); } - + return (error); } @@ -521,7 +521,7 @@ ttydisc_write(struct tty *tp, struct uio error = EWOULDBLOCK; goto done; } - + /* * The driver may write back the data * synchronously. Be sure to check the high @@ -567,7 +567,7 @@ ttydisc_optimize(struct tty *tp) } else if (!CMP_FLAG(i, ICRNL|IGNCR|IMAXBEL|INLCR|ISTRIP|IXON) && (!CMP_FLAG(i, BRKINT) || CMP_FLAG(i, IGNBRK)) && (!CMP_FLAG(i, PARMRK) || - CMP_FLAG(i, IGNPAR|IGNBRK) == (IGNPAR|IGNBRK)) && + CMP_FLAG(i, IGNPAR|IGNBRK) == (IGNPAR|IGNBRK)) && !CMP_FLAG(l, ECHO|ICANON|IEXTEN|ISIG|PENDIN)) { tp->t_flags |= TF_BYPASS; } else { @@ -583,7 +583,7 @@ ttydisc_modem(struct tty *tp, int open) if (open) cv_broadcast(&tp->t_dcdwait); - + /* * Ignore modem status lines when CLOCAL is turned on, but don't * enter the zombie state when the TTY isn't opened, because @@ -834,7 +834,7 @@ ttydisc_rint(struct tty *tp, char c, int if (ttyhook_hashook(tp, rint)) return ttyhook_rint(tp, c, flags); - + if (tp->t_flags & TF_BYPASS) goto processed; @@ -1072,7 +1072,7 @@ ttydisc_rint_bypass(struct tty *tp, cons size_t ret; tty_lock_assert(tp, MA_OWNED); - + MPASS(tp->t_flags & TF_BYPASS); atomic_add_long(&tty_nin, len); @@ -1122,7 +1122,7 @@ ttydisc_rint_poll(struct tty *tp) l = ttyinq_bytesleft(&tp->t_inq); if (l == 0 && (tp->t_flags & TF_HIWAT_IN) == 0) return (1); - + return (l); } @@ -1201,7 +1201,7 @@ ttydisc_getc_uio(struct tty *tp, struct tty_unlock(tp); error = uiomove(buf, len, uio); tty_lock(tp); - + if (error != 0) break; } From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 18:27:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2526B1065673; Sun, 26 Jun 2011 18:27:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 151068FC18; Sun, 26 Jun 2011 18:27: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 p5QIRHJU063149; Sun, 26 Jun 2011 18:27:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QIRHVv063143; Sun, 26 Jun 2011 18:27:17 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106261827.p5QIRHVv063143@svn.freebsd.org> From: Ed Schouten Date: Sun, 26 Jun 2011 18:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223576 - in head/lib/libc: gen stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 18:27:18 -0000 Author: ed Date: Sun Jun 26 18:27:17 2011 New Revision: 223576 URL: http://svn.freebsd.org/changeset/base/223576 Log: Fix whitespace inconsistencies in libc in files copyrighted by me. Modified: head/lib/libc/gen/getutxent.3 head/lib/libc/gen/posix_spawn.3 head/lib/libc/gen/posix_spawn.c head/lib/libc/gen/pututxline.c head/lib/libc/stdlib/ptsname.c Modified: head/lib/libc/gen/getutxent.3 ============================================================================== --- head/lib/libc/gen/getutxent.3 Sun Jun 26 18:26:20 2011 (r223575) +++ head/lib/libc/gen/getutxent.3 Sun Jun 26 18:27:17 2011 (r223576) @@ -175,7 +175,7 @@ prefix, corresponding with the device us session. If no TTY character device is used, this field is left blank. This field is only applicable to entries of type -.Dv USER_PROCESS +.Dv USER_PROCESS and .Dv LOGIN_PROCESS . .It Fa ut_host @@ -473,7 +473,7 @@ are extensions. .Sh HISTORY These functions appeared in .Fx 9.0 . -They replaced the +They replaced the .In utmp.h interface. .Sh AUTHORS Modified: head/lib/libc/gen/posix_spawn.3 ============================================================================== --- head/lib/libc/gen/posix_spawn.3 Sun Jun 26 18:26:20 2011 (r223575) +++ head/lib/libc/gen/posix_spawn.3 Sun Jun 26 18:27:17 2011 (r223576) @@ -167,7 +167,7 @@ group IDs for the child process are chan attributes object referenced by .Fa attrp . .It -The file actions specified by the spawn file actions object are +The file actions specified by the spawn file actions object are performed in the order in which they were added to the spawn file actions object. .It Modified: head/lib/libc/gen/posix_spawn.c ============================================================================== --- head/lib/libc/gen/posix_spawn.c Sun Jun 26 18:26:20 2011 (r223575) +++ head/lib/libc/gen/posix_spawn.c Sun Jun 26 18:27:17 2011 (r223576) @@ -182,7 +182,7 @@ process_file_actions(const posix_spawn_f if (error) return (error); } - return (0); + return (0); } static int @@ -193,7 +193,7 @@ do_posix_spawn(pid_t *pid, const char *p { pid_t p; volatile int error = 0; - + p = vfork(); switch (p) { case -1: Modified: head/lib/libc/gen/pututxline.c ============================================================================== --- head/lib/libc/gen/pututxline.c Sun Jun 26 18:26:20 2011 (r223575) +++ head/lib/libc/gen/pututxline.c Sun Jun 26 18:27:17 2011 (r223576) @@ -57,7 +57,7 @@ futx_open(const char *file) errno = EFTYPE; return (NULL); } - + fp = fdopen(fd, "r+"); if (fp == NULL) { _close(fd); @@ -103,7 +103,7 @@ utx_active_add(const struct futx *fu) /* Allow us to overwrite unused records. */ if (partial == -1) { partial = ftello(fp); - /* + /* * Distinguish errors from valid values so we * don't overwrite good data by accident. */ Modified: head/lib/libc/stdlib/ptsname.c ============================================================================== --- head/lib/libc/stdlib/ptsname.c Sun Jun 26 18:26:20 2011 (r223575) +++ head/lib/libc/stdlib/ptsname.c Sun Jun 26 18:27:17 2011 (r223576) @@ -82,7 +82,7 @@ ptsname(int fildes) /* Make sure fildes points to a master device. */ if (__isptmaster(fildes) != 0) goto done; - + if (fdevname_r(fildes, pt_slave + (sizeof _PATH_DEV - 1), sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL) ret = pt_slave; From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 19:03:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9A62106566C; Sun, 26 Jun 2011 19:03:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9B238FC13; Sun, 26 Jun 2011 19:03:33 +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 p5QJ3XG5064347; Sun, 26 Jun 2011 19:03:33 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QJ3XT4064345; Sun, 26 Jun 2011 19:03:33 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201106261903.p5QJ3XT4064345@svn.freebsd.org> From: Dimitry Andric Date: Sun, 26 Jun 2011 19:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223579 - head/contrib/traceroute X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 19:03:34 -0000 Author: dim Date: Sun Jun 26 19:03:33 2011 New Revision: 223579 URL: http://svn.freebsd.org/changeset/base/223579 Log: For some reason, contrib/traceroute/traceroute.c ensures MAXHOSTNAMELEN is defined, but then proceeds to use a hardcoded maximum hostname length of 64 anyway. Fix this by checking against MAXHOSTNAMELEN instead. PR: bin/157732 MFC after: 3 days Modified: head/contrib/traceroute/traceroute.c Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Sun Jun 26 19:02:34 2011 (r223578) +++ head/contrib/traceroute/traceroute.c Sun Jun 26 19:03:33 2011 (r223579) @@ -1618,7 +1618,7 @@ gethostinfo(register char *hostname) register char **p; register u_int32_t addr, *ap; - if (strlen(hostname) > 64) { + if (strlen(hostname) >= MAXHOSTNAMELEN) { Fprintf(stderr, "%s: hostname \"%.32s...\" is too long\n", prog, hostname); exit(1); From owner-svn-src-head@FreeBSD.ORG Sun Jun 26 20:12:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F005106566B; Sun, 26 Jun 2011 20:12:05 +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 5E8EC8FC08; Sun, 26 Jun 2011 20:12: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 p5QKC5cA066274; Sun, 26 Jun 2011 20:12:05 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5QKC5RI066272; Sun, 26 Jun 2011 20:12:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106262012.p5QKC5RI066272@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 26 Jun 2011 20:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223580 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 20:12:05 -0000 Author: jilles Date: Sun Jun 26 20:12:05 2011 New Revision: 223580 URL: http://svn.freebsd.org/changeset/base/223580 Log: sh: Include instead of non-standard . Modified: head/bin/sh/arith_yacc.c Modified: head/bin/sh/arith_yacc.c ============================================================================== --- head/bin/sh/arith_yacc.c Sun Jun 26 19:03:33 2011 (r223579) +++ head/bin/sh/arith_yacc.c Sun Jun 26 20:12:05 2011 (r223580) @@ -35,7 +35,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 02:10:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBCAC106566C; Mon, 27 Jun 2011 02:10:10 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB0FF8FC12; Mon, 27 Jun 2011 02:10: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 p5R2AAIC076722; Mon, 27 Jun 2011 02:10:10 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5R2AAAL076719; Mon, 27 Jun 2011 02:10:10 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201106270210.p5R2AAAL076719@svn.freebsd.org> From: Colin Percival Date: Mon, 27 Jun 2011 02:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223582 - head/lib/libmd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 02:10:11 -0000 Author: cperciva Date: Mon Jun 27 02:10:10 2011 New Revision: 223582 URL: http://svn.freebsd.org/changeset/base/223582 Log: Rewrite HISTORY: The SHA256 code first appeared in 6.0, and the SHA512 code in 9.0; neither existed in FreeBSD 4.0. Modified: head/lib/libmd/sha256.3 head/lib/libmd/sha512.3 Modified: head/lib/libmd/sha256.3 ============================================================================== --- head/lib/libmd/sha256.3 Sun Jun 26 21:36:53 2011 (r223581) +++ head/lib/libmd/sha256.3 Mon Jun 27 02:10:10 2011 (r223582) @@ -127,7 +127,7 @@ argument is non-null it must point to at .Xr sha 3 .Sh HISTORY These functions appeared in -.Fx 4.0 . +.Fx 6.0 . .Sh AUTHORS The core hash routines were implemented by Colin Percival based on the published Modified: head/lib/libmd/sha512.3 ============================================================================== --- head/lib/libmd/sha512.3 Sun Jun 26 21:36:53 2011 (r223581) +++ head/lib/libmd/sha512.3 Mon Jun 27 02:10:10 2011 (r223582) @@ -127,7 +127,7 @@ argument is non-null it must point to at .Xr sha 3 .Sh HISTORY These functions appeared in -.Fx 4.0 . +.Fx 9.0 . .Sh AUTHORS The core hash routines were implemented by Colin Percival based on the published From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 04:20:05 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D697B106567B; Mon, 27 Jun 2011 04:20:05 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 096FC8FC14; Mon, 27 Jun 2011 04:20:04 +0000 (UTC) Received: from [10.64.87.206] (70-90-212-91-saltlake.hfc.comcastbusiness.net [70.90.212.91]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5R4EIpJ047041 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 26 Jun 2011 22:14:20 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Sun, 26 Jun 2011 22:14:13 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106242132.p5OLW3DL071062@svn.freebsd.org> To: Ronald Klop X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sun, 26 Jun 2011 22:14:22 -0600 (MDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hans Petter Selasky Subject: Re: svn commit: r223519 - head/etc/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 04:20:06 -0000 On Jun 26, 2011, at 3:33 AM, Ronald Klop wrote: > Is this part of the auto-detect hardware discussion I read on one of = the mailinglists lately? About having less drivers in GENERIC and more = auto-loaded? > If it is... Looks like a nice feature. Not in GENERIC. 9.0 is getting ready to feature freeze any minute, so = there's no time to do the testing that a radical change like that would = require. Warner >=20 > Ronald. >=20 > On Fri, 24 Jun 2011 23:32:03 +0200, Hans Petter Selasky = wrote: >=20 >> Author: hselasky >> Date: Fri Jun 24 21:32:03 2011 >> New Revision: 223519 >> URL: http://svn.freebsd.org/changeset/base/223519 >>=20 >> Log: >> - Add auto-load devd config file for USB kernel modules. >> MFC after: 14 days >>=20 >> Added: >> head/etc/devd/bus_auto.conf (contents, props changed) >>=20 >> Added: head/etc/devd/bus_auto.conf >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- /dev/null 00:00:00 1970 (empty, because file is newly = added) >> +++ head/etc/devd/bus_auto.conf Fri Jun 24 21:32:03 2011 = (r223519) >> @@ -0,0 +1,2347 @@ >> +# >> +# $FreeBSD$ >> +# >> +# This file was automatically generated by "tools/bus_autoconf.sh". >> +# Please do not edit! >> +# >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "(host|device)"; >> + match "intclass" "0x02"; >> + match "intsubclass" "0x06"; >> + action "kldload if_cdce"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "(host|device)"; >> + match "intclass" "0x02"; >> + match "intsubclass" "0x0a"; >> + action "kldload if_cdce"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "(host|device)"; >> + match "intclass" "0x02"; >> + match "intsubclass" "0x0d"; >> + action "kldload if_cdce"; >> +}; >> + >> +# 3 usb_dual entries processed >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05ac"; >> + match "product" "0x1290"; >> + match "intclass" "0xff"; >> + match "intsubclass" "0xfd"; >> + match "intprotocol" "0x01"; >> + action "kldload if_ipheth"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05ac"; >> + match "product" "0x1292"; >> + match "intclass" "0xff"; >> + match "intsubclass" "0xfd"; >> + match "intprotocol" "0x01"; >> + action "kldload if_ipheth"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05ac"; >> + match "product" "0x1294"; >> + match "intclass" "0xff"; >> + match "intsubclass" "0xfd"; >> + match "intprotocol" "0x01"; >> + action "kldload if_ipheth"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05ac"; >> + match "product" "0x1297"; >> + match "intclass" "0xff"; >> + match "intsubclass" "0xfd"; >> + match "intprotocol" "0x01"; >> + action "kldload if_ipheth"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0104"; >> + match "product" "0x00be"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x03e8"; >> + match "product" "0x0008"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x03eb"; >> + match "product" "0x2109"; >> + action "kldload uftdi"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x03f0"; >> + match "product" = "(0x0121|0x1016|0x1116|0x1216|0x1b1d|0x1e1d|0x2016|0x2116|0x2216|0x3016|0x= 3116|0x3216|0x3524|0x4016|0x4116|0x4216|0x5016|0x5116|0x5216|0x811c|0xca02= )"; >> + action "kldload ugensa"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0402"; >> + match "product" "0x5632"; >> + action "kldload if_cdce"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0403"; >> + match "product" = "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0x= e6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00= |0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; >> + action "kldload uftdi"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0408"; >> + match "product" = "(0x0304|0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; >> + action "kldload if_run"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0409"; >> + match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0411"; >> + match "product" = "(0x0001|0x0005|0x0009|0x0012|0x003d|0x005e|0x0066|0x0067|0x006e|0x008b|0x= 00b3|0x00d8|0x00d9|0x00da|0x00e8|0x0116|0x0119|0x012e|0x0137|0x0148|0x0150= |0x015d|0x016f)"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0413"; >> + match "product" "0x2101"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0423"; >> + match "product" "(0x000a|0x000c)"; >> + action "kldload if_cue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x043e"; >> + match "product" "0x9c01"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x045a"; >> + match "product" "(0x5001|0x5002)"; >> + action "kldload urio"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x045b"; >> + match "product" "0x0053"; >> + action "kldload uslcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x045e"; >> + match "product" = "(0x0079|0x007a|0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x= 0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411= |0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0= 436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|= 0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x04= 4b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0= x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x046= 0|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x= 046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475= |0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x0= 4cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|= 0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04= e9|0x04ea)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0471"; >> + match "product" "(0x066a|0x1236|0x200f)"; >> + action "kldload uslcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0482"; >> + match "product" "0x0203"; >> + action "kldload umodem"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0489"; >> + match "product" "(0xe000|0xe003)"; >> + action "kldload uslcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x049f"; >> + match "product" "(0x0003|0x0032|0x505a)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04a4"; >> + match "product" "0x0014"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04a5"; >> + match "product" "(0x4027|0x4068)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04ad"; >> + match "product" "(0x0301|0x0302|0x0303|0x0306)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04b4"; >> + match "product" "0x1002"; >> + action "kldload ufm"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04b7"; >> + match "product" "0x0531"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04b8"; >> + match "product" "(0x0521|0x0522)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04bb"; >> + match "product" = "(0x0901|0x0904|0x0913|0x0930|0x0944|0x0945|0x0947|0x0948|0x0a03|0x0a0e)";= >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04bf"; >> + match "product" "(0x0115|0x0117)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04c5"; >> + match "product" "(0x1058|0x1079)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04da"; >> + match "product" "(0x2500|0x3900)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04dd"; >> + match "product" = "(0x8004|0x8005|0x8006|0x8007|0x9031|0x9102|0x9121|0x9123|0x9151|0x91ac|0x= 9242)"; >> + action "kldload if_cdce"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04e8"; >> + match "product" = "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04|0x6601|0x6611|0x6613|0x6615|0x6617|0x= 6619|0x661b|0x662e|0x6630|0x6632|0x8001)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x04f1"; >> + match "product" "(0x3008|0x3011|0x3012)"; >> + action "kldload if_axe"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0502"; >> + match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0506"; >> + match "product" "(0x03e8|0x11f8|0x4601)"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x050d"; >> + match "product" = "(0x0103|0x0109|0x0121|0x0257|0x0409|0x1203|0x4050|0x5055|0x7050|0x7050|0x= 7051|0x705a|0x705c|0x705e|0x8053|0x805c|0x815c|0x825a|0x905b|0x935a)"; >> + action "kldload ubsa"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0525"; >> + match "product" "(0x1080|0xa4a2)"; >> + action "kldload udbp"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0536"; >> + match "product" "0x01a0"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0543"; >> + match "product" = "(0x0ed9|0x1527|0x1529|0x152b|0x152e|0x1921|0x1922|0x1923)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0547"; >> + match "product" "(0x2008|0x2720)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x054c"; >> + match "product" = "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169|0x0437)"; >> + action "kldload uvisor"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0557"; >> + match "product" "(0x2002|0x2007|0x2008|0x2009|0x4000)"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x055d"; >> + match "product" "0x2018"; >> + action "kldload if_run"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0565"; >> + match "product" "(0x0001|0x0002|0x0003|0x0005)"; >> + action "kldload ubsa"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0567"; >> + match "product" "(0x2000|0x2002)"; >> + action "kldload if_upgt"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x056c"; >> + match "product" "0x8007"; >> + action "kldload ubsa"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x056e"; >> + match "product" = "(0x200c|0x4002|0x4005|0x400b|0x4010|0x5003|0x5004|0xabc1)"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x057c"; >> + match "product" "(0x2200|0x3800)"; >> + action "kldload ng_ubt"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0584"; >> + match "product" "(0xb000|0xb020)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0586"; >> + match "product" = "(0x3401|0x3407|0x3409|0x340a|0x340f|0x3410|0x3416|0x341a)"; >> + action "kldload if_zyd"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x058f"; >> + match "product" "0x9720"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05a6"; >> + match "product" "0x0101"; >> + action "kldload if_run"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05ac"; >> + match "product" = "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x= 0229|0x022a|0x022b|0x030a|0x030b|0x1402)"; >> + action "kldload atp"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05ad"; >> + match "product" "0x0fba"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05c6"; >> + match "product" "(0x6000|0x6613)"; >> + action "kldload u3g"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05cc"; >> + match "product" "0x3000"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05db"; >> + match "product" "(0x0003|0x0005|0x0009|0x000a|0x0011)"; >> + action "kldload uvscom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05e0"; >> + match "product" = "(0x2000|0x2001|0x2002|0x2003|0x2004|0x2005|0x2006|0x2007|0x2008|0x2009|0x= 200a)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05e3"; >> + match "product" "0x0501"; >> + action "kldload udbp"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x05e9"; >> + match "product" "(0x0008|0x0009)"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x066b"; >> + match "product" = "(0x200c|0x2202|0x2202|0x2203|0x2204|0x2206|0x400b)"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0675"; >> + match "product" "0x0550"; >> + action "kldload if_zyd"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x067b"; >> + match "product" = "(0x0000|0x0001|0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303|0x2501|0x= 331a|0xaaa0|0xaaa2)"; >> + action "kldload udbp"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x067c"; >> + match "product" "0x1001"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x067e"; >> + match "product" "0x1001"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0681"; >> + match "product" "0x3c06"; >> + action "kldload if_ural"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x06e1"; >> + match "product" "(0x0008|0x0009)"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x06f8"; >> + match "product" "(0xe000|0xe010|0xe020|0xe030)"; >> + action "kldload if_ural"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0707"; >> + match "product" "(0x0100|0x0200|0x0201|0xee13|0xee13)"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0711"; >> + match "product" "(0x0200|0x0210|0x0230)"; >> + action "kldload umct"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0731"; >> + match "product" "(0x0528|0x2003)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0745"; >> + match "product" "(0x0001|0x1000)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0769"; >> + match "product" "(0x11f2|0x11f3|0x31f3)"; >> + action "kldload if_urtw"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x077b"; >> + match "product" "0x2226"; >> + action "kldload if_axe"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0789"; >> + match "product" "(0x010c|0x0160|0x0162|0x0163|0x0164)"; >> + action "kldload if_urtw"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x078b"; >> + match "product" "0x1234"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x079b"; >> + match "product" "(0x0027|0x004a|0x0062)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x07a6"; >> + match "product" "(0x07c2|0x0986|0x8511|0x8513|0x8515)"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x07aa"; >> + match "product" = "(0x0001|0x0004|0x000d|0x0017|0x002a|0x002d|0x002e|0x002f|0x003c|0x003f|0x= 0041|0x0042|0x9601)"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x07b8"; >> + match "product" = "(0x110c|0x200c|0x2770|0x2870|0x3070|0x3071|0x3072|0x4000|0x4002|0x4003|0x= 4004|0x4007|0x400b|0x400c|0x4102|0x4104|0x420a|0x6001|0xabc1|0xb21b|0xb21c= |0xb21d|0xb21e|0xb21f)"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x07c9"; >> + match "product" "0xb100"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x07cf"; >> + match "product" "(0x2001|0x2002|0x2003)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x07d1"; >> + match "product" = "(0x3a0c|0x3c03|0x3c04|0x3c06|0x3c07|0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x= 3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; >> + action "kldload if_uath"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x081e"; >> + match "product" "0xdf00"; >> + action "kldload uvisor"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x082d"; >> + match "product" "(0x0100|0x0200|0x0300)"; >> + action "kldload uvisor"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0830"; >> + match "product" = "(0x0001|0x0002|0x0003|0x0020|0x0031|0x0040|0x0050|0x0060|0x0061|0x0070)";= >> + action "kldload uvisor"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0833"; >> + match "product" "(0x012e|0x039f)"; >> + action "kldload uplcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x083a"; >> + match "product" = "(0x1046|0x4506|0x4506|0x4508|0x4521|0x5046|0x6618|0x7511|0x7512|0x7522|0x= 8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522|0xe501)"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0841"; >> + match "product" "0x0001"; >> + action "kldload urio"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0846"; >> + match "product" = "(0x1001|0x1002|0x1020|0x1040|0x4240|0x4260|0x4300|0x6100|0x6a00)"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0856"; >> + match "product" "0xac01"; >> + action "kldload uftdi"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x085a"; >> + match "product" "(0x0008|0x0009)"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x086e"; >> + match "product" "0x1920"; >> + action "kldload if_axe"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x087d"; >> + match "product" "0x5704"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x08d1"; >> + match "product" "(0x0001|0x0003)"; >> + action "kldload if_cue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x08dd"; >> + match "product" "(0x0986|0x0987|0x0988|0x8511|0x90ff)"; >> + action "kldload if_aue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x08e6"; >> + match "product" "0x5501"; >> + action "kldload uslcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x08fd"; >> + match "product" "0x000a"; >> + action "kldload uslcom"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0915"; >> + match "product" "(0x2000|0x2002)"; >> + action "kldload if_upgt"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x091e"; >> + match "product" "0x0004"; >> + action "kldload uvisor"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0921"; >> + match "product" "0x1001"; >> + action "kldload ubsa"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0930"; >> + match "product" = "(0x0700|0x0705|0x0706|0x0707|0x0708|0x0709|0x070a|0x070b|0x0a07|0x0d45|0x= 1302)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x093c"; >> + match "product" "(0x0601|0x0701)"; >> + action "kldload uftdi"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x094b"; >> + match "product" "0x0001"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0951"; >> + match "product" "(0x0008|0x000a)"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x095a"; >> + match "product" "0x3003"; >> + action "kldload if_kue"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0960"; >> + match "product" "(0x0065|0x0066|0x0067)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0961"; >> + match "product" "0x0010"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x099e"; >> + match "product" "(0x0052|0x4000)"; >> + action "kldload uipaq"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x09aa"; >> + match "product" "0x1000"; >> + action "kldload if_upgt"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x09d7"; >> + match "product" "0x0100"; >> + action "kldload ugensa"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0a46"; >> + match "product" "(0x0268|0x8515|0x9601)"; >> + action "kldload if_udav"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0a5c"; >> + match "product" "0x2033"; >> + action "kldload ubtbcmfw"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0ace"; >> + match "product" "(0x1211|0x1215)"; >> + action "kldload if_zyd"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0af0"; >> + match "product" = "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x= 6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901|0x6911|0x6971= |0x6971|0x7001|0x7011|0x7021|0x7041|0x7061|0x7100|0x7201|0x7211|0x7251|0x7= 301|0x7361|0x7381|0x7401|0x7501|0x7601|0x7601|0xc031|0xd013|0xd031|0xd033|= 0xd033|0xd055|0xd055)"; >> + action "kldload u3g"; >> +}; >> + >> +nomatch 32 { >> + match "bus" "uhub[0-9]+"; >> + match "mode" "host"; >> + match "vendor" "0x0b05"; >> + match "product" = "(0x1706|0x1707|0x170c|0x171b|0x171d|0x1723|0x1724|0x1731|0x1732|0x1742|0x= 1760|0x1761|0x1784|0x1790|0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)"; >> + action "kldload if_ural"; >> +}; >> + >>=20 >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 05:57:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 764CB1065674; Mon, 27 Jun 2011 05:57:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6639A8FC0A; Mon, 27 Jun 2011 05:57: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 p5R5vEcr084025; Mon, 27 Jun 2011 05:57:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5R5vE96084023; Mon, 27 Jun 2011 05:57:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106270557.p5R5vE96084023@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Jun 2011 05:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223583 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 05:57:14 -0000 Author: adrian Date: Mon Jun 27 05:57:14 2011 New Revision: 223583 URL: http://svn.freebsd.org/changeset/base/223583 Log: Print out a big warning if DFS can't find a channel to use. This way people debugging DFS won't be surprised when their AP stops talking. Modified: head/sys/net80211/ieee80211_dfs.c Modified: head/sys/net80211/ieee80211_dfs.c ============================================================================== --- head/sys/net80211/ieee80211_dfs.c Mon Jun 27 02:10:10 2011 (r223582) +++ head/sys/net80211/ieee80211_dfs.c Mon Jun 27 05:57:14 2011 (r223583) @@ -320,6 +320,8 @@ ieee80211_dfs_notify_radar(struct ieee80 * on the NOL to expire. */ /*XXX*/ + if_printf(ic->ic_ifp, "%s: No free channels; waiting for entry " + "on NOL to expire\n", __func__); } } else { /* From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 09:10:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 977B31065670; Mon, 27 Jun 2011 09:10:48 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8874F8FC13; Mon, 27 Jun 2011 09:10:48 +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 p5R9AmrS089754; Mon, 27 Jun 2011 09:10:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5R9Am0l089752; Mon, 27 Jun 2011 09:10:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201106270910.p5R9Am0l089752@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 27 Jun 2011 09:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223584 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 09:10:48 -0000 Author: pjd Date: Mon Jun 27 09:10:48 2011 New Revision: 223584 URL: http://svn.freebsd.org/changeset/base/223584 Log: Log a warning if we cannot sandbox using capsicum, but only under debug level 1. It would be too noisy to log it as a proper warning as CAPABILITIES are not compiled into GENERIC by default. MFC after: 3 days Modified: head/sbin/hastd/subr.c Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Mon Jun 27 05:57:14 2011 (r223583) +++ head/sbin/hastd/subr.c Mon Jun 27 09:10:48 2011 (r223584) @@ -230,9 +230,13 @@ drop_privs(struct hast_resource *res) * ioctls and secondary uses ioctls to handle BIO_DELETE and BIO_FLUSH. * For now capsicum is only used to sandbox hastctl. */ - if (res == NULL) + if (res == NULL) { capsicum = (cap_enter() == 0); - else + if (!capsicum) { + pjdlog_common(LOG_DEBUG, 1, errno, + "Unable to sandbox using capsicum"); + } + } else capsicum = false; /* From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 09:14:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CCA61065672; Mon, 27 Jun 2011 09:14:25 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DF408FC18; Mon, 27 Jun 2011 09:14: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 p5R9EP5B089906; Mon, 27 Jun 2011 09:14:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5R9EPlQ089904; Mon, 27 Jun 2011 09:14:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201106270914.p5R9EPlQ089904@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 27 Jun 2011 09:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223585 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 09:14:25 -0000 Author: pjd Date: Mon Jun 27 09:14:25 2011 New Revision: 223585 URL: http://svn.freebsd.org/changeset/base/223585 Log: Compile capsicum support only if HAVE_CAPSICUM is defined. MFC after: 3 days Modified: head/sbin/hastd/subr.c Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Mon Jun 27 09:10:48 2011 (r223584) +++ head/sbin/hastd/subr.c Mon Jun 27 09:14:25 2011 (r223585) @@ -31,7 +31,9 @@ #include __FBSDID("$FreeBSD$"); +#ifdef HAVE_CAPSICUM #include +#endif #include #include #include @@ -230,6 +232,7 @@ drop_privs(struct hast_resource *res) * ioctls and secondary uses ioctls to handle BIO_DELETE and BIO_FLUSH. * For now capsicum is only used to sandbox hastctl. */ +#ifdef HAVE_CAPSICUM if (res == NULL) { capsicum = (cap_enter() == 0); if (!capsicum) { @@ -237,6 +240,7 @@ drop_privs(struct hast_resource *res) "Unable to sandbox using capsicum"); } } else +#endif capsicum = false; /* From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 09:15:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 448CE106566C; Mon, 27 Jun 2011 09:15:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 358848FC0A; Mon, 27 Jun 2011 09:15:42 +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 p5R9FgGp089993; Mon, 27 Jun 2011 09:15:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5R9FgsB089990; Mon, 27 Jun 2011 09:15:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201106270915.p5R9FgsB089990@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 27 Jun 2011 09:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223586 - in head/sbin: hastctl hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 09:15:42 -0000 Author: pjd Date: Mon Jun 27 09:15:41 2011 New Revision: 223586 URL: http://svn.freebsd.org/changeset/base/223586 Log: Compile hastd and hastctl with capsicum support. X-MFC after: capsicum merge Modified: head/sbin/hastctl/Makefile head/sbin/hastd/Makefile Modified: head/sbin/hastctl/Makefile ============================================================================== --- head/sbin/hastctl/Makefile Mon Jun 27 09:14:25 2011 (r223585) +++ head/sbin/hastctl/Makefile Mon Jun 27 09:15:41 2011 (r223586) @@ -21,6 +21,7 @@ MAN= hastctl.8 NO_WFORMAT= CFLAGS+=-I${.CURDIR}/../hastd +CFLAGS+=-DHAVE_CAPSICUM CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DINET6 Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Mon Jun 27 09:14:25 2011 (r223585) +++ head/sbin/hastd/Makefile Mon Jun 27 09:15:41 2011 (r223586) @@ -20,8 +20,9 @@ SRCS+= y.tab.h MAN= hastd.8 hast.conf.5 NO_WFORMAT= -CFLAGS+=-DPROTO_TCP_DEFAULT_PORT=8457 CFLAGS+=-I${.CURDIR} +CFLAGS+=-DHAVE_CAPSICUM +CFLAGS+=-DPROTO_TCP_DEFAULT_PORT=8457 CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DINET6 From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 10:42:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8F61065672; Mon, 27 Jun 2011 10:42:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F4208FC15; Mon, 27 Jun 2011 10:42:07 +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 p5RAg6So094275; Mon, 27 Jun 2011 10:42:06 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RAg6Rr094272; Mon, 27 Jun 2011 10:42:06 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106271042.p5RAg6Rr094272@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 27 Jun 2011 10:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223587 - in head/sys: geom/part sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 10:42:07 -0000 Author: ae Date: Mon Jun 27 10:42:06 2011 New Revision: 223587 URL: http://svn.freebsd.org/changeset/base/223587 Log: MS Windows NT+ uses 4 bytes at offset 0x1b8 in the MBR to identify disk drive. The boot0cfg(8) utility preserves these 4 bytes when is writing bootcode to keep a multiboot ability. Change gpart's bootcode method to keep DSN if it is not zero. Also do not allow writing bootcode with size not equal to MBRSIZE. PR: kern/157819 Tested by: Eir Nym MFC after: 1 month Modified: head/sys/geom/part/g_part_mbr.c head/sys/sys/diskmbr.h Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Mon Jun 27 09:15:41 2011 (r223586) +++ head/sys/geom/part/g_part_mbr.c Mon Jun 27 10:42:06 2011 (r223587) @@ -237,14 +237,16 @@ static int g_part_mbr_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp) { struct g_part_mbr_table *table; - size_t codesz; + uint32_t dsn; + + if (gpp->gpp_codesize != MBRSIZE) + return (ENODEV); - codesz = DOSPARTOFF; table = (struct g_part_mbr_table *)basetable; - bzero(table->mbr, codesz); - codesz = MIN(codesz, gpp->gpp_codesize); - if (codesz > 0) - bcopy(gpp->gpp_codeptr, table->mbr, codesz); + dsn = *(uint32_t *)(table->mbr + DOSDSNOFF); + bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF); + if (dsn != 0) + *(uint32_t *)(table->mbr + DOSDSNOFF) = dsn; return (0); } Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Mon Jun 27 09:15:41 2011 (r223586) +++ head/sys/sys/diskmbr.h Mon Jun 27 10:42:06 2011 (r223587) @@ -36,6 +36,7 @@ #include #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#define DOSDSNOFF 440 /* WinNT/2K/XP Drive Serial Number offset */ #define DOSPARTOFF 446 #define DOSPARTSIZE 16 #define NDOSPART 4 From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 12:21:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5A20106564A; Mon, 27 Jun 2011 12:21:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C1978FC08; Mon, 27 Jun 2011 12:21:11 +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 p5RCLBO8097414; Mon, 27 Jun 2011 12:21:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RCLBm2097410; Mon, 27 Jun 2011 12:21:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106271221.p5RCLBm2097410@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 27 Jun 2011 12:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223593 - in head/sys: modules/ipdivert netinet netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 12:21:11 -0000 Author: glebius Date: Mon Jun 27 12:21:11 2011 New Revision: 223593 URL: http://svn.freebsd.org/changeset/base/223593 Log: Add possibility to pass IPv6 packets to a divert(4) socket. Submitted by: sem Modified: head/sys/modules/ipdivert/Makefile head/sys/netinet/ip_divert.c head/sys/netinet/ipfw/ip_fw_pfil.c Modified: head/sys/modules/ipdivert/Makefile ============================================================================== --- head/sys/modules/ipdivert/Makefile Mon Jun 27 11:49:58 2011 (r223592) +++ head/sys/modules/ipdivert/Makefile Mon Jun 27 12:21:11 2011 (r223593) @@ -3,6 +3,11 @@ .PATH: ${.CURDIR}/../../netinet KMOD= ipdivert -SRCS= ip_divert.c +SRCS= ip_divert.c opt_inet6.h + +.if !defined(KERNBUILDDIR) +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} +.endif .include Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Mon Jun 27 11:49:58 2011 (r223592) +++ head/sys/netinet/ip_divert.c Mon Jun 27 12:21:11 2011 (r223593) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #error "IPDIVERT requires INET." #endif #endif +#include "opt_inet6.h" #include #include @@ -62,6 +63,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INET6 +#include +#include +#endif #ifdef SCTP #include #endif @@ -312,10 +317,10 @@ static int div_output(struct socket *so, struct mbuf *m, struct sockaddr_in *sin, struct mbuf *control) { + struct ip *const ip = mtod(m, struct ip *); struct m_tag *mtag; struct ipfw_rule_ref *dt; int error = 0; - struct mbuf *options; /* * An mbuf may hasn't come from userland, but we pretend @@ -367,71 +372,103 @@ div_output(struct socket *so, struct mbu /* Reinject packet into the system as incoming or outgoing */ if (!sin || sin->sin_addr.s_addr == 0) { - struct ip *const ip = mtod(m, struct ip *); + struct mbuf *options = NULL; struct inpcb *inp; dt->info |= IPFW_IS_DIVERT | IPFW_INFO_OUT; inp = sotoinpcb(so); INP_RLOCK(inp); - /* - * Don't allow both user specified and setsockopt options, - * and don't allow packet length sizes that will crash - */ - if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options) || - ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) { - error = EINVAL; - INP_RUNLOCK(inp); - m_freem(m); - } else { + switch (ip->ip_v) { + case IPVERSION: + /* + * Don't allow both user specified and setsockopt + * options, and don't allow packet length sizes that + * will crash. + */ + if ((((ip->ip_hl << 2) != sizeof(struct ip)) && + inp->inp_options != NULL) || + ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) { + error = EINVAL; + INP_RUNLOCK(inp); + goto cantsend; + } + /* Convert fields to host order for ip_output() */ ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); + break; +#ifdef INET6 + case IPV6_VERSION >> 4: + { + struct ip6_hdr *const ip6 = mtod(m, struct ip6_hdr *); + + /* Don't allow packet length sizes that will crash */ + if (((u_short)ntohs(ip6->ip6_plen) > m->m_pkthdr.len)) { + error = EINVAL; + INP_RUNLOCK(inp); + goto cantsend; + } - /* Send packet to output processing */ - KMOD_IPSTAT_INC(ips_rawout); /* XXX */ + ip6->ip6_plen = ntohs(ip6->ip6_plen); + } +#endif + default: + error = EINVAL; + INP_RUNLOCK(inp); + goto cantsend; + } + + /* Send packet to output processing */ + KMOD_IPSTAT_INC(ips_rawout); /* XXX */ #ifdef MAC - mac_inpcb_create_mbuf(inp, m); + mac_inpcb_create_mbuf(inp, m); #endif - /* - * Get ready to inject the packet into ip_output(). - * Just in case socket options were specified on the - * divert socket, we duplicate them. This is done - * to avoid having to hold the PCB locks over the call - * to ip_output(), as doing this results in a number of - * lock ordering complexities. - * - * Note that we set the multicast options argument for - * ip_output() to NULL since it should be invariant that - * they are not present. - */ - KASSERT(inp->inp_moptions == NULL, - ("multicast options set on a divert socket")); - options = NULL; - /* - * XXXCSJP: It is unclear to me whether or not it makes - * sense for divert sockets to have options. However, - * for now we will duplicate them with the INP locks - * held so we can use them in ip_output() without - * requring a reference to the pcb. - */ - if (inp->inp_options != NULL) { - options = m_dup(inp->inp_options, M_DONTWAIT); - if (options == NULL) - error = ENOBUFS; - } - INP_RUNLOCK(inp); - if (error == ENOBUFS) { - m_freem(m); - return (error); + /* + * Get ready to inject the packet into ip_output(). + * Just in case socket options were specified on the + * divert socket, we duplicate them. This is done + * to avoid having to hold the PCB locks over the call + * to ip_output(), as doing this results in a number of + * lock ordering complexities. + * + * Note that we set the multicast options argument for + * ip_output() to NULL since it should be invariant that + * they are not present. + */ + KASSERT(inp->inp_moptions == NULL, + ("multicast options set on a divert socket")); + /* + * XXXCSJP: It is unclear to me whether or not it makes + * sense for divert sockets to have options. However, + * for now we will duplicate them with the INP locks + * held so we can use them in ip_output() without + * requring a reference to the pcb. + */ + if (inp->inp_options != NULL) { + options = m_dup(inp->inp_options, M_NOWAIT); + if (options == NULL) { + INP_RUNLOCK(inp); + error = ENOBUFS; + goto cantsend; } + } + INP_RUNLOCK(inp); + + switch (ip->ip_v) { + case IPVERSION: error = ip_output(m, options, NULL, - ((so->so_options & SO_DONTROUTE) ? - IP_ROUTETOIF : 0) | IP_ALLOWBROADCAST | - IP_RAWOUTPUT, NULL, NULL); - if (options != NULL) - m_freem(options); + ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) + | IP_ALLOWBROADCAST | IP_RAWOUTPUT, NULL, NULL); + break; +#ifdef INET6 + case IPV6_VERSION >> 4: + error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); + break; +#endif } + if (options != NULL) + m_freem(options); } else { dt->info |= IPFW_IS_DIVERT | IPFW_INFO_IN; if (m->m_pkthdr.rcvif == NULL) { @@ -456,14 +493,26 @@ div_output(struct socket *so, struct mbu mac_socket_create_mbuf(so, m); #endif /* Send packet to input processing via netisr */ - netisr_queue_src(NETISR_IP, (uintptr_t)so, m); + switch (ip->ip_v) { + case IPVERSION: + netisr_queue_src(NETISR_IP, (uintptr_t)so, m); + break; +#ifdef INET6 + case IPV6_VERSION >> 4: + netisr_queue_src(NETISR_IPV6, (uintptr_t)so, m); + break; +#endif + default: + error = EINVAL; + goto cantsend; + } } - return error; + return (error); cantsend: m_freem(m); - return error; + return (error); } static int Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Mon Jun 27 11:49:58 2011 (r223592) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Mon Jun 27 12:21:11 2011 (r223593) @@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INET6 +#include +#include +#endif #include #include @@ -265,7 +269,7 @@ ipfw_divert(struct mbuf **m0, int incomi * If not tee, consume packet and send it to divert socket. */ struct mbuf *clone; - struct ip *ip; + struct ip *ip = mtod(*m0, struct ip *); struct m_tag *tag; /* Cloning needed for tee? */ @@ -289,8 +293,9 @@ ipfw_divert(struct mbuf **m0, int incomi * Note that we now have the 'reass' ipfw option so if we care * we can do it before a 'tee'. */ - ip = mtod(clone, struct ip *); - if (!tee && ntohs(ip->ip_off) & (IP_MF | IP_OFFMASK)) { + if (!tee) switch (ip->ip_v) { + case IPVERSION: + if (ntohs(ip->ip_off) & (IP_MF | IP_OFFMASK)) { int hlen; struct mbuf *reass; @@ -312,7 +317,26 @@ ipfw_divert(struct mbuf **m0, int incomi else ip->ip_sum = in_cksum(reass, hlen); clone = reass; + } + break; +#ifdef INET6 + case IPV6_VERSION >> 4: + { + struct ip6_hdr *const ip6 = mtod(clone, struct ip6_hdr *); + + if (ip6->ip6_nxt == IPPROTO_FRAGMENT) { + int nxt, off; + + off = sizeof(struct ip6_hdr); + nxt = frag6_input(&clone, &off, 0); + if (nxt == IPPROTO_DONE) + return (0); + } + break; + } +#endif } + /* attach a tag to the packet with the reinject info */ tag = m_tag_alloc(MTAG_IPFW_RULE, 0, sizeof(struct ipfw_rule_ref), M_NOWAIT); From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 12:42:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 088A0106564A; Mon, 27 Jun 2011 12:42:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E30BC8FC16; Mon, 27 Jun 2011 12:42:48 +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 p5RCgmUw098104; Mon, 27 Jun 2011 12:42:48 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RCgmIe098102; Mon, 27 Jun 2011 12:42:48 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106271242.p5RCgmIe098102@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 27 Jun 2011 12:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223594 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 12:42:49 -0000 Author: ae Date: Mon Jun 27 12:42:48 2011 New Revision: 223594 URL: http://svn.freebsd.org/changeset/base/223594 Log: EBR could contain an early stage of boot code. But we do not support it. Remove message about non empty bootcode, we can not break something while GEOM_PART_EBR_COMPAT is defined. But without GEOM_PART_EBR_COMPAT any changes in EBR are allowed and we can accidentally wipe the boot code. To do not break anything save the first EBR chunk and keep it untouched each time when we are changing EBR. Note that we are still not support boot code for EBR. PR: kern/141235 MFC after: 1 month Modified: head/sys/geom/part/g_part_ebr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Mon Jun 27 12:21:11 2011 (r223593) +++ head/sys/geom/part/g_part_ebr.c Mon Jun 27 12:42:48 2011 (r223594) @@ -59,6 +59,9 @@ FEATURE(geom_part_ebr_compat, struct g_part_ebr_table { struct g_part_table base; +#ifndef GEOM_PART_EBR_COMPAT + u_char ebr[EBRSIZE]; +#endif }; struct g_part_ebr_entry { @@ -459,7 +462,7 @@ g_part_ebr_read(struct g_part_table *bas u_char *buf; off_t ofs, msize; u_int lba; - int error, index, sum; + int error, index; pp = cp->provider; table = (struct g_part_ebr_table *)basetable; @@ -482,20 +485,11 @@ g_part_ebr_read(struct g_part_table *bas printf("GEOM: %s: invalid entries in the EBR ignored.\n", pp->name); } - /* We do not support bootcode for EBR. If bootcode area is - * not zeroes, then mark this EBR as corrupt to do not break - * anything for another OS'es. - */ - if (lba == 0) { - sum = 0; - for (index = 0; index < DOSPARTOFF; index++) - sum += buf[index]; - if (sum != 0) { - basetable->gpt_corrupt = 1; - printf("GEOM: %s: EBR has non empty bootcode.\n", - pp->name); - } - } +#ifndef GEOM_PART_EBR_COMPAT + /* Save the first EBR, it can contain a boot code */ + if (lba == 0) + bcopy(buf, table->ebr, sizeof(table->ebr)); +#endif g_free(buf); if (ent[0].dp_typ == 0) @@ -583,6 +577,9 @@ g_part_ebr_type(struct g_part_table *bas static int g_part_ebr_write(struct g_part_table *basetable, struct g_consumer *cp) { +#ifndef GEOM_PART_EBR_COMPAT + struct g_part_ebr_table *table; +#endif struct g_provider *pp; struct g_part_entry *baseentry, *next; struct g_part_ebr_entry *entry; @@ -592,6 +589,10 @@ g_part_ebr_write(struct g_part_table *ba pp = cp->provider; buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); +#ifndef GEOM_PART_EBR_COMPAT + table = (struct g_part_ebr_table *)basetable; + bcopy(table->ebr, buf, DOSPARTOFF); +#endif le16enc(buf + DOSMAGICOFFSET, DOSMAGIC); baseentry = LIST_FIRST(&basetable->gpt_entry); @@ -644,7 +645,10 @@ g_part_ebr_write(struct g_part_table *ba error = g_write_data(cp, baseentry->gpe_start * pp->sectorsize, buf, pp->sectorsize); - +#ifndef GEOM_PART_EBR_COMPAT + if (baseentry->gpe_start == 0) + bzero(buf, DOSPARTOFF); +#endif baseentry = next; } while (!error && baseentry != NULL); From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 13:23:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 138621065672; Mon, 27 Jun 2011 13:23:52 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 042208FC1B; Mon, 27 Jun 2011 13:23: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 p5RDNpYD099379; Mon, 27 Jun 2011 13:23:51 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RDNpZp099377; Mon, 27 Jun 2011 13:23:51 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201106271323.p5RDNpZp099377@svn.freebsd.org> From: Stefan Esser Date: Mon, 27 Jun 2011 13:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223596 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 13:23:52 -0000 Author: se Date: Mon Jun 27 13:23:51 2011 New Revision: 223596 URL: http://svn.freebsd.org/changeset/base/223596 Log: Add macros to specify owner, group and mode of config files for installation. Submitted by: Chris Rees (crees) Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Jun 27 13:02:23 2011 (r223595) +++ head/share/mk/bsd.own.mk Mon Jun 27 13:23:51 2011 (r223596) @@ -63,6 +63,15 @@ # SHAREMODE ASCII text file mode. [${NOBINMODE}] # # +# CONFDIR Base path for configuration files. [/etc] +# +# CONFOWN Configuration file owner. [root] +# +# CONFGRP Configuration file group. [wheel] +# +# CONFMODE Configuration file mode. [644] +# +# # DOCDIR Base path for system documentation (e.g. PSD, USD, # handbook, FAQ etc.). [${SHAREDIR}/doc] # @@ -145,6 +154,11 @@ SHAREOWN?= root SHAREGRP?= wheel SHAREMODE?= ${NOBINMODE} +CONFDIR?= /etc +CONFOWN?= root +CONFGRP?= wheel +CONFMODE?= 644 + MANDIR?= ${SHAREDIR}/man/man MANOWN?= ${SHAREOWN} MANGRP?= ${SHAREGRP} From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 13:58:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 398DA1065670; Mon, 27 Jun 2011 13:58: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 28C768FC08; Mon, 27 Jun 2011 13:58: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 p5RDwPSh000514; Mon, 27 Jun 2011 13:58:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RDwP8d000511; Mon, 27 Jun 2011 13:58:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106271358.p5RDwP8d000511@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Jun 2011 13:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223597 - head/sys/boot/i386/zfsboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 13:58:25 -0000 Author: jhb Date: Mon Jun 27 13:58:24 2011 New Revision: 223597 URL: http://svn.freebsd.org/changeset/base/223597 Log: - Remove the fake BPB from zfsldr. zfsldr doesn't support booting from floppies, so it will not be used as the start of an emulated floppy image on a bootable CD which is what the fake BPB was used for. - Only check that EDD packet mode is available once at the start of zfsldr rather than for each disk sector now that we read data in one sector at a time. As a result, collapse the remaining bits of read up into nread and rename nread to read. - Restore a return at the end of putstr that I removed in the previous revision. Tested by: Henri Hennebert (earlier version) MFC after: 1 week Modified: head/sys/boot/i386/zfsboot/Makefile head/sys/boot/i386/zfsboot/zfsldr.S Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Mon Jun 27 13:23:51 2011 (r223596) +++ head/sys/boot/i386/zfsboot/Makefile Mon Jun 27 13:58:24 2011 (r223597) @@ -57,7 +57,7 @@ zfsboot1: zfsldr.out objcopy -S -O binary zfsldr.out ${.TARGET} zfsldr.out: zfsldr.o - ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o + ${LD} ${LDFLAGS} -e main -Ttext ${ORG1} -o ${.TARGET} zfsldr.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o Modified: head/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- head/sys/boot/i386/zfsboot/zfsldr.S Mon Jun 27 13:23:51 2011 (r223596) +++ head/sys/boot/i386/zfsboot/zfsldr.S Mon Jun 27 13:58:24 2011 (r223597) @@ -34,46 +34,9 @@ .set SIZ_SEC,0x200 # Sector size .set NSECT,0x80 - .globl start + .globl main .code16 -start: jmp main # Start recognizably - -/* - * This is the start of a standard BIOS Parameter Block (BPB). Most bootable - * FAT disks have this at the start of their MBR. While normal BIOS's will - * work fine without this section, IBM's El Torito emulation "fixes" up the - * BPB by writing into the memory copy of the MBR. Rather than have data - * written into our code, we'll define a BPB to work around it. - * The data marked with (T) indicates a field required for a ThinkPad to - * recognize the disk and (W) indicates fields written from IBM BIOS code. - * The use of the BPB is based on what OpenBSD and NetBSD implemented in - * their boot code but the required fields were determined by trial and error. - * - * Note: If additional space is needed in boot1, one solution would be to - * move the "prompt" message data (below) to replace the OEM ID. - */ - .org 0x03, 0x00 -oemid: .space 0x08, 0x00 # OEM ID - - .org 0x0b, 0x00 -bpb: .word 512 # sector size (T) - .byte 0 # sectors/clustor - .word 0 # reserved sectors - .byte 0 # number of FATs - .word 0 # root entries - .word 0 # small sectors - .byte 0 # media type (W) - .word 0 # sectors/fat - .word 18 # sectors per track (T) - .word 2 # number of heads (T) - .long 0 # hidden sectors (W) - .long 0 # large sectors - - .org 0x24, 0x00 -ebpb: .byte 0 # BIOS physical drive number (W) - - .org 0x25,0x90 /* * Load the rest of zfsboot2 and BTX up, copy the parts to the right locations, * and start it all up. @@ -90,18 +53,17 @@ main: cld # String ops inc mov %cx,%ss # Set up mov $start,%sp # stack /* - * If we are on a hard drive, then load the MBR and look for the first - * FreeBSD slice. We use the fake partition entry below that points to - * the MBR when we call nread. The first pass looks for the first active - * FreeBSD slice. The second pass looks for the first non-active FreeBSD - * slice if the first one fails. + * Load the MBR and look for the first FreeBSD slice. We use the fake + * partition entry below that points to the MBR when we call read. + * The first pass looks for the first active FreeBSD slice. The + * second pass looks for the first non-active FreeBSD slice if the + * first one fails. */ + call check_edd # Make sure EDD works mov $part4,%si # Dummy partition - cmpb $0x80,%dl # Hard drive? - jb main.4 # No xor %eax,%eax # Read MBR movl $MEM_BUF,%ebx # from first - callw nread # sector + call read # sector mov $0x1,%cx # Two passes main.1: mov $MEM_BUF+PRT_OFF,%si # Partition table movb $0x1,%dh # Partition @@ -122,10 +84,6 @@ main.3: add $0x10,%si # Next entry */ mov $msg_part,%si # Message jmp error # Error -/* - * Floppies use partition 0 of drive 0. - */ -main.4: xor %dx,%dx # Partition:drive /* * Ok, we have a slice and drive in %dx now, so use that to locate and @@ -153,7 +111,7 @@ main.5: mov %dx,MEM_ARG # Save args movl $1024,%eax # Offset to boot2 mov $MEM_BTX,%ebx # Destination buffer main.6: pushal # Save params - callw nread # Read disk + call read # Read disk popal # Restore incl %eax # Advance to add $SIZ_SEC,%ebx # next sector @@ -200,16 +158,16 @@ seta20.3: sti # Enable interrupts /* - * Trampoline used to call read from within zfsldr. Sets up an EDD - * packet on the stack and passes it to read. We assume that the - * destination address is always segment-aligned. + * Read a sector from the disk. Sets up an EDD packet on the stack + * and passes it to read. We assume that the destination address is + * always segment-aligned. * * %eax - int - LBA to read in relative to partition start * %ebx - ptr - destination address * %dl - byte - drive to read from * %si - ptr - MBR partition entry */ -nread: xor %ecx,%ecx # Get +read: xor %ecx,%ecx # Get addl 0x8(%si),%eax # LBA adc $0,%ecx pushl %ecx # Starting absolute block @@ -219,12 +177,13 @@ nread: xor %ecx,%ecx # Get push $0 # transfer buffer push $0x1 # Read 1 sector push $0x10 # Size of packet - mov %sp,%bp # Packet pointer - callw read # Read from disk - jc nread.1 # If error, fail - lea 0x10(%bp),%sp # Clear stack + mov %sp,%si # Packet pointer + mov $0x42,%ah # BIOS: Extended + int $0x13 # read + jc read.1 # If error, fail + lea 0x10(%si),%sp # Clear stack ret # If success, return -nread.1: mov %ah,%al # Format +read.1: mov %ah,%al # Format mov $read_err,%di # error call hex8 # code mov $msg_read,%si # Set the error message and @@ -250,36 +209,26 @@ putstr.0: mov $0x7,%bx # Page:attribu putstr: lodsb # Get char testb %al,%al # End of string? jne putstr.0 # No - + ret # To caller /* - * Reads sectors from the disk. If EDD is enabled, then check if it is - * installed and use it if it is. If it is not installed or not enabled, then - * fall back to using CHS. Since we use a LBA, if we are using CHS, we have to - * fetch the drive parameters from the BIOS and divide it out ourselves. - * Call with: - * - * %dl - byte - drive number - * stack - 10 bytes - EDD Packet + * Check to see if the disk supports EDD. zfsboot requires EDD and does not + * support older C/H/S disk I/O. */ -read: cmpb $0x80,%dl # Hard drive? - jb read.1 # No, use CHS +check_edd: cmpb $0x80,%dl # Hard drive? + jb check_edd.1 # No, fail to boot mov $0x55aa,%bx # Magic push %dx # Save movb $0x41,%ah # BIOS: Check int $0x13 # extensions present pop %dx # Restore - jc read.1 # If error, use CHS + jc check_edd.1 # If error, fail cmp $0xaa55,%bx # Magic? - jne read.1 # No, so use CHS + jne check_edd.1 # No, so fail testb $0x1,%cl # Packet interface? - jz read.1 # No, so use CHS - mov %bp,%si # Disk packet - movb $0x42,%ah # BIOS: Extended - int $0x13 # read - retw # To caller -read.1: mov $msg_chs,%si - jmp error - + jz check_edd.1 # No, so fail + ret # EDD ok, keep booting +check_edd.1: mov $msg_chs,%si # Warn that CHS is + jmp error # unsupported and fail /* * AL to hex, saving the result to [EDI]. */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 16:24:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B62011065673; Mon, 27 Jun 2011 16:24:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5BCF8FC1A; Mon, 27 Jun 2011 16:24:36 +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 p5RGOa9Z004924; Mon, 27 Jun 2011 16:24:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RGOaDe004922; Mon, 27 Jun 2011 16:24:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106271624.p5RGOaDe004922@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 27 Jun 2011 16:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223599 - head/lib/csu/powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 16:24:36 -0000 Author: nwhitehorn Date: Mon Jun 27 16:24:36 2011 New Revision: 223599 URL: http://svn.freebsd.org/changeset/base/223599 Log: Build Scrt.o on powerpc64. Its introduction on other platforms got lost during the period of time the powerpc64 port was on a project branch. Modified: head/lib/csu/powerpc64/Makefile Modified: head/lib/csu/powerpc64/Makefile ============================================================================== --- head/lib/csu/powerpc64/Makefile Mon Jun 27 15:13:12 2011 (r223598) +++ head/lib/csu/powerpc64/Makefile Mon Jun 27 16:24:36 2011 (r223599) @@ -4,15 +4,14 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o -CFLAGS+= -Wall -Wno-unused \ - -I${.CURDIR}/../common \ +OBJS+= Scrt1.o gcrt1.o +CFLAGS+= -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include all: ${OBJS} CLEANFILES= ${OBJS} -CLEANFILES+= crt1.s gcrt1.s +CLEANFILES+= crt1.s gcrt1.s Scrt1.s # See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not # directly compiled to .o files. @@ -31,6 +30,13 @@ gcrt1.s: crt1.c gcrt1.o: gcrt1.s ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s +Scrt1.s: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c + sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET} + +Scrt1.o: Scrt1.s + ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 20:32:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A203A106566B; Mon, 27 Jun 2011 20:32:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 927288FC16; Mon, 27 Jun 2011 20:32:19 +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 p5RKWJ2s012549; Mon, 27 Jun 2011 20:32:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RKWJkx012547; Mon, 27 Jun 2011 20:32:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106272032.p5RKWJkx012547@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 27 Jun 2011 20:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223604 - head/etc/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 20:32:19 -0000 Author: hselasky Date: Mon Jun 27 20:32:19 2011 New Revision: 223604 URL: http://svn.freebsd.org/changeset/base/223604 Log: Regenerate usb.conf after r223566. Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Mon Jun 27 20:04:13 2011 (r223603) +++ head/etc/devd/usb.conf Mon Jun 27 20:32:19 2011 (r223604) @@ -1533,15 +1533,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x083a"; - match "product" "0x4506"; - action "kldload if_uath"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x083a"; - match "product" "0x4506"; + match "product" "(0x4505|0x4506)"; action "kldload if_zyd"; }; From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 21:27:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BCA41065674; Mon, 27 Jun 2011 21:27:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1F78FC24; Mon, 27 Jun 2011 21:27:13 +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 p5RLRDQi014508; Mon, 27 Jun 2011 21:27:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RLRDfg014506; Mon, 27 Jun 2011 21:27:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106272127.p5RLRDfg014506@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 27 Jun 2011 21:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223608 - head/sys/dev/fxp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 21:27:13 -0000 Author: yongari Date: Mon Jun 27 21:27:12 2011 New Revision: 223608 URL: http://svn.freebsd.org/changeset/base/223608 Log: Disable microcode loading for 82550 and 82550C controllers. Loading the microcode caused SCB timeouts. Linux driver does not allow microcode loading for these controllers and jfv also confirmed that there is no need to do and it shouldn't. PR: kern/103332 Additional confirmation from: jfv MFC after: 1 week Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Mon Jun 27 21:14:25 2011 (r223607) +++ head/sys/dev/fxp/if_fxp.c Mon Jun 27 21:27:12 2011 (r223608) @@ -3012,8 +3012,10 @@ static uint32_t fxp_ucode_d101a[] = D101 static uint32_t fxp_ucode_d101b0[] = D101_B0_RCVBUNDLE_UCODE; static uint32_t fxp_ucode_d101ma[] = D101M_B_RCVBUNDLE_UCODE; static uint32_t fxp_ucode_d101s[] = D101S_RCVBUNDLE_UCODE; +#ifdef notyet static uint32_t fxp_ucode_d102[] = D102_B_RCVBUNDLE_UCODE; static uint32_t fxp_ucode_d102c[] = D102_C_RCVBUNDLE_UCODE; +#endif static uint32_t fxp_ucode_d102e[] = D102_E_RCVBUNDLE_UCODE; #define UCODE(x) x, sizeof(x)/sizeof(uint32_t) @@ -3031,10 +3033,12 @@ static const struct ucode { D101M_CPUSAVER_DWORD, D101M_CPUSAVER_BUNDLE_MAX_DWORD }, { FXP_REV_82559S_A, UCODE(fxp_ucode_d101s), D101S_CPUSAVER_DWORD, D101S_CPUSAVER_BUNDLE_MAX_DWORD }, +#ifdef notyet { FXP_REV_82550, UCODE(fxp_ucode_d102), D102_B_CPUSAVER_DWORD, D102_B_CPUSAVER_BUNDLE_MAX_DWORD }, { FXP_REV_82550_C, UCODE(fxp_ucode_d102c), D102_C_CPUSAVER_DWORD, D102_C_CPUSAVER_BUNDLE_MAX_DWORD }, +#endif { FXP_REV_82551_F, UCODE(fxp_ucode_d102e), D102_E_CPUSAVER_DWORD, D102_E_CPUSAVER_BUNDLE_MAX_DWORD }, { 0, NULL, 0, 0, 0 } From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 21:37:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25F2F106566B; Mon, 27 Jun 2011 21:37:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15AAF8FC0C; Mon, 27 Jun 2011 21:37:39 +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 p5RLbcp8014889; Mon, 27 Jun 2011 21:37:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RLbc6m014887; Mon, 27 Jun 2011 21:37:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106272137.p5RLbc6m014887@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 27 Jun 2011 21:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223610 - head/sys/dev/fxp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 21:37:39 -0000 Author: yongari Date: Mon Jun 27 21:37:38 2011 New Revision: 223610 URL: http://svn.freebsd.org/changeset/base/223610 Log: Enable CPUSaver D102 E-step microcode loading for 82551 revision 0x10. Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Mon Jun 27 21:30:04 2011 (r223609) +++ head/sys/dev/fxp/if_fxp.c Mon Jun 27 21:37:38 2011 (r223610) @@ -3041,6 +3041,8 @@ static const struct ucode { #endif { FXP_REV_82551_F, UCODE(fxp_ucode_d102e), D102_E_CPUSAVER_DWORD, D102_E_CPUSAVER_BUNDLE_MAX_DWORD }, + { FXP_REV_82551_10, UCODE(fxp_ucode_d102e), + D102_E_CPUSAVER_DWORD, D102_E_CPUSAVER_BUNDLE_MAX_DWORD }, { 0, NULL, 0, 0, 0 } }; From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 21:43:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDCD91065676; Mon, 27 Jun 2011 21:43:56 +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 BE7528FC18; Mon, 27 Jun 2011 21:43:56 +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 p5RLhuTR015127; Mon, 27 Jun 2011 21:43:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RLhu5I015124; Mon, 27 Jun 2011 21:43:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106272143.p5RLhu5I015124@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Jun 2011 21:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223611 - head/sys/boot/i386/zfsboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 21:43:56 -0000 Author: jhb Date: Mon Jun 27 21:43:56 2011 New Revision: 223611 URL: http://svn.freebsd.org/changeset/base/223611 Log: Revert the entry point label to 'start' to unbreak the build. Pointy hat to: jhb Modified: head/sys/boot/i386/zfsboot/Makefile head/sys/boot/i386/zfsboot/zfsldr.S Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Mon Jun 27 21:37:38 2011 (r223610) +++ head/sys/boot/i386/zfsboot/Makefile Mon Jun 27 21:43:56 2011 (r223611) @@ -57,7 +57,7 @@ zfsboot1: zfsldr.out objcopy -S -O binary zfsldr.out ${.TARGET} zfsldr.out: zfsldr.o - ${LD} ${LDFLAGS} -e main -Ttext ${ORG1} -o ${.TARGET} zfsldr.o + ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o Modified: head/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- head/sys/boot/i386/zfsboot/zfsldr.S Mon Jun 27 21:37:38 2011 (r223610) +++ head/sys/boot/i386/zfsboot/zfsldr.S Mon Jun 27 21:43:56 2011 (r223611) @@ -34,7 +34,7 @@ .set SIZ_SEC,0x200 # Sector size .set NSECT,0x80 - .globl main + .globl start .code16 /* @@ -46,7 +46,7 @@ * Setup the segment registers to flat addressing (segment 0) and setup the * stack to end just below the start of our code. */ -main: cld # String ops inc +start: cld # String ops inc xor %cx,%cx # Zero mov %cx,%es # Address mov %cx,%ds # data From owner-svn-src-head@FreeBSD.ORG Mon Jun 27 22:03:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D75E10657A4; Mon, 27 Jun 2011 22:03:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DD038FC1E; Mon, 27 Jun 2011 22:03: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 p5RM3YJx015803; Mon, 27 Jun 2011 22:03:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5RM3X7q015801; Mon, 27 Jun 2011 22:03:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201106272203.p5RM3X7q015801@svn.freebsd.org> From: Michael Tuexen Date: Mon, 27 Jun 2011 22:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223613 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 22:03:34 -0000 Author: tuexen Date: Mon Jun 27 22:03:33 2011 New Revision: 223613 URL: http://svn.freebsd.org/changeset/base/223613 Log: Add support for SCTP_PR_SCTP_NONE which I misded to add. This constant is defined in the socket API ID. MFC after: 2 months. Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Mon Jun 27 21:45:35 2011 (r223612) +++ head/sys/netinet/sctp_uio.h Mon Jun 27 22:03:33 2011 (r223613) @@ -251,12 +251,13 @@ struct sctp_snd_all_completes { /* for the endpoint */ /* The lower byte is an enumeration of PR-SCTP policies */ +#define SCTP_PR_SCTP_NONE 0x0000/* Reliable transfer */ #define SCTP_PR_SCTP_TTL 0x0001/* Time based PR-SCTP */ #define SCTP_PR_SCTP_BUF 0x0002/* Buffer based PR-SCTP */ #define SCTP_PR_SCTP_RTX 0x0003/* Number of retransmissions based PR-SCTP */ #define PR_SCTP_POLICY(x) ((x) & 0x0f) -#define PR_SCTP_ENABLED(x) (PR_SCTP_POLICY(x) != 0) +#define PR_SCTP_ENABLED(x) (PR_SCTP_POLICY(x) != SCTP_PR_SCTP_NONE) #define PR_SCTP_TTL_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL) #define PR_SCTP_BUF_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF) #define PR_SCTP_RTX_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX) From owner-svn-src-head@FreeBSD.ORG Tue Jun 28 00:01:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A2B8106564A; Tue, 28 Jun 2011 00:01:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A4A88FC14; Tue, 28 Jun 2011 00:01:55 +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 p5S01tK4019751; Tue, 28 Jun 2011 00:01:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5S01tCA019748; Tue, 28 Jun 2011 00:01:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106280001.p5S01tCA019748@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Jun 2011 00:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223615 - in head/sys/dev/ath/ath_hal: . ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 00:01:55 -0000 Author: adrian Date: Tue Jun 28 00:01:55 2011 New Revision: 223615 URL: http://svn.freebsd.org/changeset/base/223615 Log: Make sure the extended regdomain word is initialised. As with the AR9285, the AR9287 has a default word of 0x1F which means all the various bits in that field are set on by default. Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.h head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_9287.h Mon Jun 27 22:13:15 2011 (r223614) +++ head/sys/dev/ath/ath_hal/ah_eeprom_9287.h Tue Jun 28 00:01:55 2011 (r223615) @@ -31,6 +31,8 @@ #define AR9287_EEP_MINOR_VER_b AR9287_EEP_MINOR_VER #define AR9287_EEP_NO_BACK_VER AR9287_EEP_MINOR_VER_1 +#define AR9287_RDEXT_DEFAULT 0x1F + #define AR9287_EEP_START_LOC 128 #define AR9287_HTC_EEP_START_LOC 256 #define AR9287_NUM_2G_CAL_PIERS 3 Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Mon Jun 27 22:13:15 2011 (r223614) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Tue Jun 28 00:01:55 2011 (r223615) @@ -320,6 +320,7 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s /* Read Reg Domain */ AH_PRIVATE(ah)->ah_currentRD = ath_hal_eepromGet(ah, AR_EEP_REGDMN_0, AH_NULL); + AH_PRIVATE(ah)->ah_currentRDext = AR9287_RDEXT_DEFAULT; /* * ah_miscMode is populated by ar5416FillCapabilityInfo() From owner-svn-src-head@FreeBSD.ORG Tue Jun 28 00:58:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FD8F106566B; Tue, 28 Jun 2011 00:58:12 +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 700168FC1C; Tue, 28 Jun 2011 00:58:12 +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 p5S0wCsf021419; Tue, 28 Jun 2011 00:58:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5S0wC9I021417; Tue, 28 Jun 2011 00:58:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106280058.p5S0wC9I021417@svn.freebsd.org> From: Xin LI Date: Tue, 28 Jun 2011 00:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223616 - head/contrib/libpcap/bpf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 00:58:12 -0000 Author: delphij Date: Tue Jun 28 00:58:12 2011 New Revision: 223616 URL: http://svn.freebsd.org/changeset/base/223616 Log: Incorporate vendor commit ecdc5c0a7f7591a7cd4a: In userland, sign extend the offset for JA instructions. We currently use that to implement "ip6 protochain", and "pc" might be wider than "pc->k", in which case we need to arrange that "pc->k" be sign-extended, by casting it to bpf_int32. PR: kern/157188 Submitted by: plosher MFC after: 2 weeks Modified: head/contrib/libpcap/bpf/net/bpf_filter.c Modified: head/contrib/libpcap/bpf/net/bpf_filter.c ============================================================================== --- head/contrib/libpcap/bpf/net/bpf_filter.c Tue Jun 28 00:01:55 2011 (r223615) +++ head/contrib/libpcap/bpf/net/bpf_filter.c Tue Jun 28 00:58:12 2011 (r223616) @@ -405,7 +405,18 @@ bpf_filter(pc, p, wirelen, buflen) continue; case BPF_JMP|BPF_JA: +#if defined(KERNEL) || defined(_KERNEL) + /* + * No backward jumps allowed. + */ pc += pc->k; +#else + /* + * XXX - we currently implement "ip6 protochain" + * with backward jumps, so sign-extend pc->k. + */ + pc += (bpf_int32)pc->k; +#endif continue; case BPF_JMP|BPF_JGT|BPF_K: From owner-svn-src-head@FreeBSD.ORG Tue Jun 28 06:16:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF702106564A; Tue, 28 Jun 2011 06:16:33 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFAFF8FC15; Tue, 28 Jun 2011 06:16:33 +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 p5S6GXKJ031281; Tue, 28 Jun 2011 06:16:33 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5S6GXul031279; Tue, 28 Jun 2011 06:16:33 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201106280616.p5S6GXul031279@svn.freebsd.org> From: Martin Matuska Date: Tue, 28 Jun 2011 06:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223620 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 06:16:34 -0000 Author: mm Date: Tue Jun 28 06:16:33 2011 New Revision: 223620 URL: http://svn.freebsd.org/changeset/base/223620 Log: Allow mountpoints as arguments for the 'zfs get' command. Illumos-gate revision: 13295 Obtained from: Illumos (Feature #510) MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Jun 28 05:04:31 2011 (r223619) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Jun 28 06:16:33 2011 (r223620) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ #include @@ -1292,7 +1292,7 @@ static int zfs_do_get(int argc, char **argv) { zprop_get_cbdata_t cb = { 0 }; - int i, c, flags = 0; + int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; char *value, *fields; int ret; int limit = 0; From owner-svn-src-head@FreeBSD.ORG Tue Jun 28 06:32:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F2AD106564A; Tue, 28 Jun 2011 06:32:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0EB8FC13; Tue, 28 Jun 2011 06:32:36 +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 p5S6WZcn031873; Tue, 28 Jun 2011 06:32:35 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5S6WZDN031871; Tue, 28 Jun 2011 06:32:35 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201106280632.p5S6WZDN031871@svn.freebsd.org> From: Martin Matuska Date: Tue, 28 Jun 2011 06:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223622 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 06:32:36 -0000 Author: mm Date: Tue Jun 28 06:32:35 2011 New Revision: 223622 URL: http://svn.freebsd.org/changeset/base/223622 Log: Disable vdev cache (readahead) by default. The vdev cache is very underutilized (hit ratio 30%-70%) and may consume excessive memory on systems with many vdevs. Illumos-gate revision: 13346 Obtained from: Illumos (Bug #175) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c Tue Jun 28 06:26:03 2011 (r223621) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c Tue Jun 28 06:32:35 2011 (r223622) @@ -71,9 +71,16 @@ * 1< Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1D41106564A; Tue, 28 Jun 2011 07:52:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2068FC14; Tue, 28 Jun 2011 07:52:01 +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 p5S7q1P9034435; Tue, 28 Jun 2011 07:52:01 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5S7q1CD034429; Tue, 28 Jun 2011 07:52:01 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201106280752.p5S7q1CD034429@svn.freebsd.org> From: Martin Matuska Date: Tue, 28 Jun 2011 07:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223623 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 07:52:01 -0000 Author: mm Date: Tue Jun 28 07:52:01 2011 New Revision: 223623 URL: http://svn.freebsd.org/changeset/base/223623 Log: Add a new "REFCOMPRESSRATIO" property. For snapshots, this is the same as COMPRESSRATIO, but for filesystems/volumes, the COMPRESSRATIO is based on the data "USED" (ie, includes blocks in children, but not blocks shared with the origin). This is needed to figure out how much space a filesystem would use if it were not compressed (ignoring snapshots). Illumos-gate revision: 13387 Obtained from: Illumos (Feature #1092) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jun 28 06:32:35 2011 (r223622) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jun 28 07:52:01 2011 (r223623) @@ -6,6 +6,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] +.\" Copyright 2011 by Delphix. All rights reserved. .TH zfs 1M "24 Sep 2009" "SunOS 5.11" "System Administration Commands" .SH NAME zfs \- configures ZFS file systems @@ -389,7 +390,7 @@ This property can also be referred to by .ad .sp .6 .RS 4n -The compression ratio achieved for this dataset, expressed as a multiplier. Compression can be turned on by running: \fBzfs set compression=on \fIdataset\fR\fR. The default value is \fBoff\fR. +For non-snapshots, the compression ratio achieved for the \fBused\fR space of this dataset, expressed as a multiplier. The \fBused\fR property includes descendant datasets, and, for clones, does not include the space shared with the origin snapshot. For snapshots, the \fBcompressratio\fR is the same as the \fBrefcompressratio\fR property. Compression can be turned on by running: \fBzfs set compression=on \fIdataset\fR\fR. The default value is \fBoff\fR. .RE .sp @@ -453,6 +454,17 @@ This property can also be referred to by .ne 2 .mk .na +\fB\fBrefcompressratio\fR\fR +.ad +.sp .6 +.RS 4n +The compression ratio achieved for the \fBreferenced\fR space of this dataset, expressed as a multiplier. See also the \fBcompressratio\fR property. +.RE + +.sp +.ne 2 +.mk +.na \fB\fBtype\fR\fR .ad .sp .6 @@ -1278,7 +1290,7 @@ Recursively destroy all dependents, incl Force an unmount of any file systems using the \fBunmount -f\fR command. This option has no effect on non-file systems or unmounted file systems. .RE -Extreme care should be taken when applying either the \fB-r\fR or the \fB-f\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use. +Extreme care should be taken when applying either the \fB-r\fR or the \fB-R\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use. .RE .sp Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Jun 28 06:32:35 2011 (r223622) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Jun 28 07:52:01 2011 (r223623) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #include @@ -2038,6 +2039,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop } break; + case ZFS_PROP_REFRATIO: case ZFS_PROP_COMPRESSRATIO: if (get_numeric_property(zhp, prop, src, &source, &val) != 0) return (-1); Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Jun 28 06:32:35 2011 (r223622) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Jun 28 07:52:01 2011 (r223623) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -311,6 +312,9 @@ zfs_prop_init(void) zprop_register_number(ZFS_PROP_COMPRESSRATIO, "compressratio", 0, PROP_READONLY, ZFS_TYPE_DATASET, "<1.00x or higher if compressed>", "RATIO"); + zprop_register_number(ZFS_PROP_REFRATIO, "refcompressratio", 0, + PROP_READONLY, ZFS_TYPE_DATASET, + "<1.00x or higher if compressed>", "REFRATIO"); zprop_register_number(ZFS_PROP_VOLBLOCKSIZE, "volblocksize", ZVOL_DEFAULT_BLOCKSIZE, PROP_ONETIME, ZFS_TYPE_VOLUME, "512 to 128k, power of 2", "VOLBLOCK"); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jun 28 06:32:35 2011 (r223622) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jun 28 07:52:01 2011 (r223623) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #include @@ -2150,7 +2151,7 @@ dsl_dataset_sync(dsl_dataset_t *ds, zio_ void dsl_dataset_stats(dsl_dataset_t *ds, nvlist_t *nv) { - uint64_t refd, avail, uobjs, aobjs; + uint64_t refd, avail, uobjs, aobjs, ratio; dsl_dir_stats(ds->ds_dir, nv); @@ -2177,6 +2178,11 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_DEFER_DESTROY, DS_IS_DEFER_DESTROY(ds) ? 1 : 0); + ratio = ds->ds_phys->ds_compressed_bytes == 0 ? 100 : + (ds->ds_phys->ds_uncompressed_bytes * 100 / + ds->ds_phys->ds_compressed_bytes); + dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFRATIO, ratio); + if (ds->ds_phys->ds_next_snap_obj) { /* * This is a snapshot; override the dd's space used with @@ -2184,10 +2190,7 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl */ dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USED, ds->ds_phys->ds_unique_bytes); - dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO, - ds->ds_phys->ds_compressed_bytes == 0 ? 100 : - (ds->ds_phys->ds_uncompressed_bytes * 100 / - ds->ds_phys->ds_compressed_bytes)); + dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO, ratio); } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jun 28 06:32:35 2011 (r223622) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jun 28 07:52:01 2011 (r223623) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -124,6 +125,7 @@ typedef enum { ZFS_PROP_DEDUP, ZFS_PROP_MLSLABEL, ZFS_PROP_SYNC, + ZFS_PROP_REFRATIO, ZFS_NUM_PROPS } zfs_prop_t; From owner-svn-src-head@FreeBSD.ORG Tue Jun 28 08:36:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D2861065670; Tue, 28 Jun 2011 08:36:49 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 437CA8FC0C; Tue, 28 Jun 2011 08:36: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 p5S8anO4035788; Tue, 28 Jun 2011 08:36:49 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5S8amNC035773; Tue, 28 Jun 2011 08:36:48 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106280836.p5S8amNC035773@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Jun 2011 08:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223624 - in head/sys/dev: acpica an dc en et fdc iicbus mfi my sis tdfx usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 08:36:49 -0000 Author: kevlo Date: Tue Jun 28 08:36:48 2011 New Revision: 223624 URL: http://svn.freebsd.org/changeset/base/223624 Log: Remove duplicate header includes Modified: head/sys/dev/acpica/acpi_thermal.c head/sys/dev/an/if_an.c head/sys/dev/dc/dcphy.c head/sys/dev/dc/pnphy.c head/sys/dev/en/if_en_pci.c head/sys/dev/et/if_et.c head/sys/dev/fdc/fdc_pccard.c head/sys/dev/iicbus/if_ic.c head/sys/dev/mfi/mfi_cam.c head/sys/dev/my/if_my.c head/sys/dev/sis/if_sis.c head/sys/dev/tdfx/tdfx_pci.c head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/acpica/acpi_thermal.c Tue Jun 28 08:36:48 2011 (r223624) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/an/if_an.c Tue Jun 28 08:36:48 2011 (r223624) @@ -102,7 +102,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/dev/dc/dcphy.c ============================================================================== --- head/sys/dev/dc/dcphy.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/dc/dcphy.c Tue Jun 28 08:36:48 2011 (r223624) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include Modified: head/sys/dev/dc/pnphy.c ============================================================================== --- head/sys/dev/dc/pnphy.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/dc/pnphy.c Tue Jun 28 08:36:48 2011 (r223624) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include Modified: head/sys/dev/en/if_en_pci.c ============================================================================== --- head/sys/dev/en/if_en_pci.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/en/if_en_pci.c Tue Jun 28 08:36:48 2011 (r223624) @@ -44,9 +44,6 @@ __FBSDID("$FreeBSD$"); * thanks to Matt Thomas for figuring out FreeBSD vs NetBSD vs etc.. diffs. */ -#include -__FBSDID("$FreeBSD$"); - #include #include #include Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/et/if_et.c Tue Jun 28 08:36:48 2011 (r223624) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/fdc/fdc_pccard.c ============================================================================== --- head/sys/dev/fdc/fdc_pccard.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/fdc/fdc_pccard.c Tue Jun 28 08:36:48 2011 (r223624) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include "pccarddevs.h" Modified: head/sys/dev/iicbus/if_ic.c ============================================================================== --- head/sys/dev/iicbus/if_ic.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/iicbus/if_ic.c Tue Jun 28 08:36:48 2011 (r223624) @@ -49,9 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include #include #include Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/mfi/mfi_cam.c Tue Jun 28 08:36:48 2011 (r223624) @@ -54,12 +54,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include -#include #include #include Modified: head/sys/dev/my/if_my.c ============================================================================== --- head/sys/dev/my/if_my.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/my/if_my.c Tue Jun 28 08:36:48 2011 (r223624) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/sis/if_sis.c Tue Jun 28 08:36:48 2011 (r223624) @@ -87,7 +87,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/dev/tdfx/tdfx_pci.c ============================================================================== --- head/sys/dev/tdfx/tdfx_pci.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/tdfx/tdfx_pci.c Tue Jun 28 08:36:48 2011 (r223624) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Tue Jun 28 07:52:01 2011 (r223623) +++ head/sys/dev/usb/usb_msctest.c Tue Jun 28 08:36:48 2011 (r223624) @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Jun 28 08:41:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 913F91065670; Tue, 28 Jun 2011 08:41:44 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 818198FC0C; Tue, 28 Jun 2011 08:41:44 +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 p5S8fiYG035987; Tue, 28 Jun 2011 08:41:44 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5S8fi00035985; Tue, 28 Jun 2011 08:41:44 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201106280841.p5S8fi00035985@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 28 Jun 2011 08:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223625 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 08:41:44 -0000 Author: pluknet Date: Tue Jun 28 08:41:44 2011 New Revision: 223625 URL: http://svn.freebsd.org/changeset/base/223625 Log: Update ifc_len field of struct ifconf passed for the ioctl SIOCGIFCONF32 (i.e. under COMPAT_FREEBSD32) in case ifconf() returned success to match the native SIOCGIFCONF behavior. PR: kern/158369 Reported by: Paul Procacci MFC after: 1 week Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jun 28 08:36:48 2011 (r223624) +++ head/sys/net/if.c Tue Jun 28 08:41:44 2011 (r223625) @@ -2467,6 +2467,8 @@ ifioctl(struct socket *so, u_long cmd, c error = ifconf(SIOCGIFCONF, (void *)&ifc); CURVNET_RESTORE(); + if (error == 0) + ifc32->ifc_len = ifc.ifc_len; return (error); } #endif From owner-svn-src-head@FreeBSD.ORG Tue Jun 28 08:45:58 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 13291106566C; Tue, 28 Jun 2011 08:45:58 +0000 (UTC) Date: Tue, 28 Jun 2011 08:45:58 +0000 From: Alexey Dokuchaev To: Warner Losh Message-ID: <20110628084558.GA35392@FreeBSD.org> References: <201106242132.p5OLW3DL071062@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hans Petter Selasky , Ronald Klop Subject: Re: svn commit: r223519 - head/etc/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 08:45:58 -0000 On Sun, Jun 26, 2011 at 10:14:13PM -0600, Warner Losh wrote: > Not in GENERIC. 9.0 is getting ready to feature freeze any minute, so > there's no time to do the testing that a radical change like that would > require. Fair enough. Right now, this work seems to cover only USB kernel modules, is it so? Is expansion into generic PCI area also planned, provided that you've already had some ideas and seem to be willing to pick up the work given enough support from the other developers (please excuse me if my understanding is wrong)? ./danfe From owner-svn-src-head@FreeBSD.ORG Tue Jun 28 09:46:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF0AE1065745; Tue, 28 Jun 2011 09:46:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF1AE8FC08; Tue, 28 Jun 2011 09:46: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 p5S9kPbo037992; Tue, 28 Jun 2011 09:46:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5S9kPtP037990; Tue, 28 Jun 2011 09:46:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106280946.p5S9kPtP037990@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 28 Jun 2011 09:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223626 - head/contrib/ntp/ntpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 09:46:26 -0000 Author: bz Date: Tue Jun 28 09:46:25 2011 New Revision: 223626 URL: http://svn.freebsd.org/changeset/base/223626 Log: Compare port numbers correctly. They are stored by SRCPORT() in host byte order, so we need to compare them as such. Properly compare IPv6 addresses as well. This allows the, by default, 8 badaddrs slots per address family to work correctly and only print sendto() errors once. The change is no longer applicable to any latest upstream versions. Approved by: roberto Sponsored by: Sandvine Incorporated MFC after: 1 week Modified: head/contrib/ntp/ntpd/ntp_io.c Modified: head/contrib/ntp/ntpd/ntp_io.c ============================================================================== --- head/contrib/ntp/ntpd/ntp_io.c Tue Jun 28 08:41:44 2011 (r223625) +++ head/contrib/ntp/ntpd/ntp_io.c Tue Jun 28 09:46:25 2011 (r223626) @@ -2716,14 +2716,14 @@ sendpkt( for (slot = ERRORCACHESIZE; --slot >= 0; ) if(dest->ss_family == AF_INET) { - if (badaddrs[slot].port == ((struct sockaddr_in*)dest)->sin_port && + if (badaddrs[slot].port == SRCPORT(dest) && badaddrs[slot].addr.s_addr == ((struct sockaddr_in*)dest)->sin_addr.s_addr) break; } #ifdef INCLUDE_IPV6_SUPPORT else if (dest->ss_family == AF_INET6) { - if (badaddrs6[slot].port == ((struct sockaddr_in6*)dest)->sin6_port && - badaddrs6[slot].addr.s6_addr == ((struct sockaddr_in6*)dest)->sin6_addr.s6_addr) + if (badaddrs6[slot].port == SRCPORT(dest) && + !memcmp(&badaddrs6[slot].addr, &((struct sockaddr_in6*)dest)->sin6_addr, sizeof(struct in6_addr))) break; } #endif /* INCLUDE_IPV6_SUPPORT */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 28 10:24:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB2C51065745; Tue, 28 Jun 2011 10:24:01 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F598FC18; Tue, 28 Jun 2011 10:24:01 +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 p5SAO1OS041521; Tue, 28 Jun 2011 10:24:01 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SAO17Y041515; Tue, 28 Jun 2011 10:24:01 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201106281024.p5SAO17Y041515@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 28 Jun 2011 10:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223629 - head/contrib/tzdata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 10:24:01 -0000 Author: edwin Date: Tue Jun 28 10:24:01 2011 New Revision: 223629 URL: http://svn.freebsd.org/changeset/base/223629 Log: MFV of tzdata2011h, r223627 - Russia scraps DST in 2011 - Remove Netherlands Antilles, add Bonaire, Curacao, Sint Maarten Modified: head/contrib/tzdata/antarctica head/contrib/tzdata/asia head/contrib/tzdata/europe head/contrib/tzdata/southamerica head/contrib/tzdata/zone.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/antarctica ============================================================================== --- head/contrib/tzdata/antarctica Tue Jun 28 10:15:03 2011 (r223628) +++ head/contrib/tzdata/antarctica Tue Jun 28 10:24:01 2011 (r223629) @@ -1,5 +1,5 @@ #
-# @(#)antarctica	8.8
+# @(#)antarctica	8.9
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -19,18 +19,6 @@
 # I made up all time zone abbreviations mentioned here; corrections welcome!
 # FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited.
 
-# These rules are stolen from the `europe' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	RussAQ	1981	1984	-	Apr	 1	 0:00	1:00	S
-Rule	RussAQ	1981	1983	-	Oct	 1	 0:00	0	-
-Rule	RussAQ	1984	1991	-	Sep	lastSun	 2:00s	0	-
-Rule	RussAQ	1985	1991	-	Mar	lastSun	 2:00s	1:00	S
-Rule	RussAQ	1992	only	-	Mar	lastSat	 23:00	1:00	S
-Rule	RussAQ	1992	only	-	Sep	lastSat	 23:00	0	-
-Rule	RussAQ	1993	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	RussAQ	1993	1995	-	Sep	lastSun	 2:00s	0	-
-Rule	RussAQ	1996	max	-	Oct	lastSun	 2:00s	0	-
-
 # These rules are stolen from the `southamerica' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-

Modified: head/contrib/tzdata/asia
==============================================================================
--- head/contrib/tzdata/asia	Tue Jun 28 10:15:03 2011	(r223628)
+++ head/contrib/tzdata/asia	Tue Jun 28 10:24:01 2011	(r223629)
@@ -1,4 +1,4 @@
-# @(#)asia	8.64
+# @(#)asia	8.65
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -77,6 +77,10 @@ Rule RussiaAsia	1993	max	-	Mar	lastSun	 
 Rule RussiaAsia	1993	1995	-	Sep	lastSun	 2:00s	0	-
 Rule RussiaAsia	1996	max	-	Oct	lastSun	 2:00s	0	-
 
+# From Arthur David Olson (2011-06-15):
+# While Russia abandoned DST in 2011, Armenia may choose to
+# follow Russia's "old" rules.
+
 # Afghanistan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Kabul	4:36:48 -	LMT	1890

Modified: head/contrib/tzdata/europe
==============================================================================
--- head/contrib/tzdata/europe	Tue Jun 28 10:15:03 2011	(r223628)
+++ head/contrib/tzdata/europe	Tue Jun 28 10:24:01 2011	(r223629)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.32
+# @(#)europe	8.33
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -565,6 +565,26 @@ Rule	Russia	1993	max	-	Mar	lastSun	 2:00
 Rule	Russia	1993	1995	-	Sep	lastSun	 2:00s	0	-
 Rule	Russia	1996	max	-	Oct	lastSun	 2:00s	0	-
 
+# From Alexander Krivenyshev (2011-06-14):
+# According to Kremlin press service, Russian President Dmitry Medvedev
+# signed a federal law "On calculation of time" on June 9, 2011.
+# According to the law Russia is abolishing daylight saving time.
+# 
+# Medvedev signed a law "On the Calculation of Time" (in russian): 
+# 
+# http://bmockbe.ru/events/?ID=7583
+# 
+# 
+# Medvedev signed a law on the calculation of the time (in russian):
+# 
+# http://www.regnum.ru/news/polit/1413906.html
+# 
+
+# From Arthur David Olson (2011-06-15):
+# Take "abolishing daylight saving time" to mean that time is now considered
+# to be standard.
+# At least for now, keep the "old" Russia rules for the benefit of Belarus.
+
 # These are for backward compatibility with older versions.
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -2013,7 +2033,8 @@ Zone Europe/Kaliningrad	 1:22:00 -	LMT	1
 			 1:00	C-Eur	CE%sT	1945
 			 2:00	Poland	CE%sT	1946
 			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
-			 2:00	Russia	EE%sT
+			 2:00	Russia	EE%sT	2011 Mar 27 2:00s
+			 3:00	-	EET
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Respublika Adygeya, Arkhangel'skaya oblast',
@@ -2042,7 +2063,8 @@ Zone Europe/Moscow	 2:30:20 -	LMT	1880
 			 2:00	-	EET	1930 Jun 21
 			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
 			 2:00	Russia	EE%sT	1992 Jan 19 2:00s
-			 3:00	Russia	MSK/MSD
+			 3:00	Russia	MSK/MSD	2011 Mar 27 2:00s
+			 4:00	-	MSK
 #
 # Astrakhanskaya oblast', Kirovskaya oblast', Saratovskaya oblast',
 # Volgogradskaya oblast'.  Shanks & Pottenger say Kirov is still at +0400
@@ -2055,7 +2077,8 @@ Zone Europe/Volgograd	 2:57:40 -	LMT	192
 			 4:00	Russia	VOL%sT	1989 Mar 26 2:00s # Volgograd T
 			 3:00	Russia	VOL%sT	1991 Mar 31 2:00s
 			 4:00	-	VOLT	1992 Mar 29 2:00s
-			 3:00	Russia	VOL%sT
+			 3:00	Russia	VOL%sT	2011 Mar 27 2:00s
+			 4:00	-	VOLT
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Samarskaya oblast', Udmyrtskaya respublika
@@ -2067,7 +2090,8 @@ Zone Europe/Samara	 3:20:36 -	LMT	1919 J
 			 2:00	Russia	KUY%sT	1991 Sep 29 2:00s
 			 3:00	-	KUYT	1991 Oct 20 3:00
 			 4:00	Russia	SAM%sT	2010 Mar 28 2:00s # Samara Time
-			 3:00	Russia	SAM%sT
+			 3:00	Russia	SAM%sT	2011 Mar 27 2:00s
+			 4:00	-	SAMT
 
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
@@ -2080,7 +2104,8 @@ Zone Asia/Yekaterinburg	 4:02:24 -	LMT	1
 			 4:00	-	SVET	1930 Jun 21 # Sverdlovsk Time
 			 5:00	Russia	SVE%sT	1991 Mar 31 2:00s
 			 4:00	Russia	SVE%sT	1992 Jan 19 2:00s
-			 5:00	Russia	YEK%sT	# Yekaterinburg Time
+			 5:00	Russia	YEK%sT	2011 Mar 27 2:00s
+			 6:00	-	YEKT	# Yekaterinburg Time
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Respublika Altaj, Altajskij kraj, Omskaya oblast'.
@@ -2088,7 +2113,8 @@ Zone Asia/Omsk		 4:53:36 -	LMT	1919 Nov 
 			 5:00	-	OMST	1930 Jun 21 # Omsk TIme
 			 6:00	Russia	OMS%sT	1991 Mar 31 2:00s
 			 5:00	Russia	OMS%sT	1992 Jan 19 2:00s
-			 6:00	Russia	OMS%sT
+			 6:00	Russia	OMS%sT	2011 Mar 27 2:00s
+			 7:00	-	OMST
 #
 # From Paul Eggert (2006-08-19): I'm guessing about Tomsk here; it's
 # not clear when it switched from +7 to +6.
@@ -2098,7 +2124,8 @@ Zone Asia/Novosibirsk	 5:31:40 -	LMT	191
 			 7:00	Russia	NOV%sT	1991 Mar 31 2:00s
 			 6:00	Russia	NOV%sT	1992 Jan 19 2:00s
 			 7:00	Russia	NOV%sT	1993 May 23 # say Shanks & P.
-			 6:00	Russia	NOV%sT
+			 6:00	Russia	NOV%sT	2011 Mar 27 2:00s
+			 7:00	-	NOVT
 
 # From Alexander Krivenyshev (2009-10-13):
 # Kemerovo oblast' (Kemerovo region) in Russia will change current time zone on
@@ -2131,7 +2158,8 @@ Zone Asia/Novokuznetsk	 5:48:48 -	NMT	19
 			 7:00	Russia	KRA%sT	1991 Mar 31 2:00s
 			 6:00	Russia	KRA%sT	1992 Jan 19 2:00s
 			 7:00	Russia	KRA%sT	2010 Mar 28 2:00s
-			 6:00	Russia	NOV%sT # Novosibirsk/Novokuznetsk Time
+			 6:00	Russia	NOV%sT	2011 Mar 27 2:00s
+			 7:00	-	NOVT # Novosibirsk/Novokuznetsk Time
 
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
@@ -2142,7 +2170,8 @@ Zone Asia/Krasnoyarsk	 6:11:20 -	LMT	192
 			 6:00	-	KRAT	1930 Jun 21 # Krasnoyarsk Time
 			 7:00	Russia	KRA%sT	1991 Mar 31 2:00s
 			 6:00	Russia	KRA%sT	1992 Jan 19 2:00s
-			 7:00	Russia	KRA%sT
+			 7:00	Russia	KRA%sT	2011 Mar 27 2:00s
+			 8:00	-	KRAT
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Respublika Buryatiya, Irkutskaya oblast',
@@ -2152,7 +2181,8 @@ Zone Asia/Irkutsk	 6:57:20 -	LMT	1880
 			 7:00	-	IRKT	1930 Jun 21 # Irkutsk Time
 			 8:00	Russia	IRK%sT	1991 Mar 31 2:00s
 			 7:00	Russia	IRK%sT	1992 Jan 19 2:00s
-			 8:00	Russia	IRK%sT
+			 8:00	Russia	IRK%sT	2011 Mar 27 2:00s
+			 9:00	-	IRKT
 #
 # From Oscar van Vlijmen (2003-10-18): [This region consists of]
 # Aginskij Buryatskij avtonomnyj okrug, Amurskaya oblast',
@@ -2175,7 +2205,8 @@ Zone Asia/Yakutsk	 8:38:40 -	LMT	1919 De
 			 8:00	-	YAKT	1930 Jun 21 # Yakutsk Time
 			 9:00	Russia	YAK%sT	1991 Mar 31 2:00s
 			 8:00	Russia	YAK%sT	1992 Jan 19 2:00s
-			 9:00	Russia	YAK%sT
+			 9:00	Russia	YAK%sT	2011 Mar 27 2:00s
+			 10:00	-	YAKT
 #
 # From Oscar van Vlijmen (2003-10-18): [This region consists of]
 # Evrejskaya avtonomnaya oblast', Khabarovskij kraj, Primorskij kraj,
@@ -2188,7 +2219,8 @@ Zone Asia/Vladivostok	 8:47:44 -	LMT	192
 			 9:00	-	VLAT	1930 Jun 21 # Vladivostok Time
 			10:00	Russia	VLA%sT	1991 Mar 31 2:00s
 			 9:00	Russia	VLA%sST	1992 Jan 19 2:00s
-			10:00	Russia	VLA%sT
+			10:00	Russia	VLA%sT	2011 Mar 27 2:00s
+			11:00	-	VLAT
 #
 # Sakhalinskaya oblast'.
 # The Zone name should be Yuzhno-Sakhalinsk, but that's too long.
@@ -2198,7 +2230,8 @@ Zone Asia/Sakhalin	 9:30:48 -	LMT	1905 A
 			11:00	Russia	SAK%sT	1991 Mar 31 2:00s # Sakhalin T.
 			10:00	Russia	SAK%sT	1992 Jan 19 2:00s
 			11:00	Russia	SAK%sT	1997 Mar lastSun 2:00s
-			10:00	Russia	SAK%sT
+			10:00	Russia	SAK%sT	2011 Mar 27 2:00s
+			11:00	-	SAKT
 #
 # From Oscar van Vlijmen (2003-10-18): [This region consists of]
 # Magadanskaya oblast', Respublika Sakha (Yakutiya).
@@ -2211,7 +2244,8 @@ Zone Asia/Magadan	10:03:12 -	LMT	1924 Ma
 			10:00	-	MAGT	1930 Jun 21 # Magadan Time
 			11:00	Russia	MAG%sT	1991 Mar 31 2:00s
 			10:00	Russia	MAG%sT	1992 Jan 19 2:00s
-			11:00	Russia	MAG%sT
+			11:00	Russia	MAG%sT	2011 Mar 27 2:00s
+			12:00	-	MAGT
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Kamchatskaya oblast', Koryakskij avtonomnyj okrug.
@@ -2222,7 +2256,8 @@ Zone Asia/Kamchatka	10:34:36 -	LMT	1922 
 			12:00	Russia	PET%sT	1991 Mar 31 2:00s
 			11:00	Russia	PET%sT	1992 Jan 19 2:00s
 			12:00	Russia	PET%sT	2010 Mar 28 2:00s
-			11:00	Russia	PET%sT
+			11:00	Russia	PET%sT	2011 Mar 27 2:00s
+			12:00	-	PETT
 #
 # Chukotskij avtonomnyj okrug
 Zone Asia/Anadyr	11:49:56 -	LMT	1924 May  2
@@ -2231,7 +2266,8 @@ Zone Asia/Anadyr	11:49:56 -	LMT	1924 May
 			12:00	Russia	ANA%sT	1991 Mar 31 2:00s
 			11:00	Russia	ANA%sT	1992 Jan 19 2:00s
 			12:00	Russia	ANA%sT	2010 Mar 28 2:00s
-			11:00	Russia	ANA%sT
+			11:00	Russia	ANA%sT	2011 Mar 27 2:00s
+			12:00	-	ANAT
 
 # Serbia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: head/contrib/tzdata/southamerica
==============================================================================
--- head/contrib/tzdata/southamerica	Tue Jun 28 10:15:03 2011	(r223628)
+++ head/contrib/tzdata/southamerica	Tue Jun 28 10:24:01 2011	(r223629)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.49
+# @(#)southamerica	8.50
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1276,6 +1276,14 @@ Zone	America/Curacao	-4:35:44 -	LMT	1912
 			-4:30	-	ANT	1965 # Netherlands Antilles Time
 			-4:00	-	AST
 
+# From Arthur David Olson (2011-06-15):
+# At least for now, use links for places with new iso3166 codes.
+# The name "Lower Prince's Quarter" is both longer than fourteen charaters
+# and contains an apostrophe; use "Lower_Princes" below.
+
+Link	America/Curacao	America/Lower_Princes # Sint Maarten
+Link	America/Curacao	America/Kralendijk # Bonaire, Sint Estatius and Saba
+
 # Ecuador
 #
 # From Paul Eggert (2007-03-04):

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Tue Jun 28 10:15:03 2011	(r223628)
+++ head/contrib/tzdata/zone.tab	Tue Jun 28 10:24:01 2011	(r223629)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.43
+# @(#)zone.tab	8.45
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -32,7 +32,6 @@ AG	+1703-06148	America/Antigua
 AI	+1812-06304	America/Anguilla
 AL	+4120+01950	Europe/Tirane
 AM	+4011+04430	Asia/Yerevan
-AN	+1211-06900	America/Curacao
 AO	-0848+01314	Africa/Luanda
 AQ	-7750+16636	Antarctica/McMurdo	McMurdo Station, Ross Island
 AQ	-9000+00000	Antarctica/South_Pole	Amundsen-Scott Station, South Pole
@@ -87,6 +86,7 @@ BL	+1753-06251	America/St_Barthelemy
 BM	+3217-06446	Atlantic/Bermuda
 BN	+0456+11455	Asia/Brunei
 BO	-1630-06809	America/La_Paz
+BQ	+120903-0681636	America/Kralendijk
 BR	-0351-03225	America/Noronha	Atlantic islands
 BR	-0127-04829	America/Belem	Amapa, E Para
 BR	-0343-03830	America/Fortaleza	NE Brazil (MA, PI, CE, RN, PB)
@@ -155,6 +155,7 @@ CO	+0436-07405	America/Bogota
 CR	+0956-08405	America/Costa_Rica
 CU	+2308-08222	America/Havana
 CV	+1455-02331	Atlantic/Cape_Verde
+CW	+1211-06900	America/Curacao
 CX	-1025+10543	Indian/Christmas
 CY	+3510+03322	Asia/Nicosia
 CZ	+5005+01426	Europe/Prague
@@ -362,6 +363,7 @@ SO	+0204+04522	Africa/Mogadishu
 SR	+0550-05510	America/Paramaribo
 ST	+0020+00644	Africa/Sao_Tome
 SV	+1342-08912	America/El_Salvador
+SX	+180305-0630250	America/Lower_Princes
 SY	+3330+03618	Asia/Damascus
 SZ	-2618+03106	Africa/Mbabane
 TC	+2128-07108	America/Grand_Turk

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 10:38:12 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B273F106564A;
	Tue, 28 Jun 2011 10:38:12 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A2E8B8FC0C;
	Tue, 28 Jun 2011 10:38:12 +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 p5SAcCJR042160;
	Tue, 28 Jun 2011 10:38:12 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SAcCgD042158;
	Tue, 28 Jun 2011 10:38:12 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201106281038.p5SAcCgD042158@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 28 Jun 2011 10:38:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223633 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 10:38:12 -0000

Author: edwin
Date: Tue Jun 28 10:38:12 2011
New Revision: 223633
URL: http://svn.freebsd.org/changeset/base/223633

Log:
  Remove AN again now that tzdata2011h has been imported.

Modified:
  head/share/misc/iso3166

Modified: head/share/misc/iso3166
==============================================================================
--- head/share/misc/iso3166	Tue Jun 28 10:30:30 2011	(r223632)
+++ head/share/misc/iso3166	Tue Jun 28 10:38:12 2011	(r223633)
@@ -176,7 +176,6 @@ NA	NAM	516	Namibia
 NR	NRU	520	Nauru
 NP	NPL	524	Nepal
 NL	NLD	528	Netherlands
-AN	ANT	530	Netherlands Antilles
 NC	NCL	540	New Caledonia
 NZ	NZL	554	New Zealand
 NI	NIC	558	Nicaragua

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 11:57:26 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06C4B106564A;
	Tue, 28 Jun 2011 11:57:26 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E70488FC12;
	Tue, 28 Jun 2011 11:57: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 p5SBvPPN048107;
	Tue, 28 Jun 2011 11:57:25 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SBvP5g048097;
	Tue, 28 Jun 2011 11:57:25 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201106281157.p5SBvP5g048097@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Tue, 28 Jun 2011 11:57:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223637 - in head: . contrib/pf/authpf
	contrib/pf/ftp-proxy contrib/pf/man contrib/pf/pfctl
	contrib/pf/pflogd sbin/pflogd sys/conf sys/contrib/altq/altq
	sys/contrib/pf/net sys/modules s...
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 11:57:26 -0000

Author: bz
Date: Tue Jun 28 11:57:25 2011
New Revision: 223637
URL: http://svn.freebsd.org/changeset/base/223637

Log:
  Update packet filter (pf) code to OpenBSD 4.5.
  
  You need to update userland (world and ports) tools
  to be in sync with the kernel.
  
  Submitted by:	mlaier
  Submitted by:	eri

Added:
  head/sys/contrib/pf/net/if_pflow.h   (contents, props changed)
  head/sys/contrib/pf/net/pf_lb.c   (contents, props changed)
  head/sys/modules/pfsync/
  head/sys/modules/pfsync/Makefile   (contents, props changed)
Deleted:
  head/sys/contrib/pf/net/pf_subr.c
Modified:
  head/UPDATING
  head/contrib/pf/authpf/authpf.8
  head/contrib/pf/authpf/authpf.c
  head/contrib/pf/authpf/pathnames.h
  head/contrib/pf/ftp-proxy/filter.c
  head/contrib/pf/ftp-proxy/filter.h
  head/contrib/pf/ftp-proxy/ftp-proxy.8
  head/contrib/pf/ftp-proxy/ftp-proxy.c
  head/contrib/pf/man/pf.4
  head/contrib/pf/man/pf.conf.5
  head/contrib/pf/man/pf.os.5
  head/contrib/pf/man/pflog.4
  head/contrib/pf/man/pfsync.4
  head/contrib/pf/pfctl/parse.y
  head/contrib/pf/pfctl/pf_print_state.c
  head/contrib/pf/pfctl/pfctl.8
  head/contrib/pf/pfctl/pfctl.c
  head/contrib/pf/pfctl/pfctl.h
  head/contrib/pf/pfctl/pfctl_altq.c
  head/contrib/pf/pfctl/pfctl_optimize.c
  head/contrib/pf/pfctl/pfctl_osfp.c
  head/contrib/pf/pfctl/pfctl_parser.c
  head/contrib/pf/pfctl/pfctl_parser.h
  head/contrib/pf/pfctl/pfctl_qstats.c
  head/contrib/pf/pfctl/pfctl_radix.c
  head/contrib/pf/pfctl/pfctl_table.c
  head/contrib/pf/pflogd/pflogd.8
  head/contrib/pf/pflogd/pflogd.c
  head/contrib/pf/pflogd/privsep.c
  head/contrib/pf/pflogd/privsep_fdpass.c
  head/sbin/pflogd/Makefile
  head/sys/conf/files
  head/sys/contrib/altq/altq/altq_red.c
  head/sys/contrib/pf/net/if_pflog.c
  head/sys/contrib/pf/net/if_pflog.h
  head/sys/contrib/pf/net/if_pfsync.c
  head/sys/contrib/pf/net/if_pfsync.h
  head/sys/contrib/pf/net/pf.c
  head/sys/contrib/pf/net/pf_if.c
  head/sys/contrib/pf/net/pf_ioctl.c
  head/sys/contrib/pf/net/pf_mtag.h
  head/sys/contrib/pf/net/pf_norm.c
  head/sys/contrib/pf/net/pf_osfp.c
  head/sys/contrib/pf/net/pf_ruleset.c
  head/sys/contrib/pf/net/pf_table.c
  head/sys/contrib/pf/net/pfvar.h
  head/sys/modules/Makefile
  head/sys/modules/pf/Makefile
  head/sys/modules/pflog/Makefile
  head/sys/netinet/in_gif.c
  head/sys/netinet/ip_icmp.c
  head/sys/netinet/ipfw/ip_fw2.c
  head/sys/netinet/raw_ip.c
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/in6_gif.c
  head/sys/netipsec/ipsec_input.c
  head/sys/netipsec/ipsec_output.c
  head/sys/netipsec/xform_ipip.c
  head/sys/sys/mbuf.h
  head/sys/sys/param.h
  head/usr.sbin/ftp-proxy/ftp-proxy/Makefile

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Tue Jun 28 11:03:39 2011	(r223636)
+++ head/UPDATING	Tue Jun 28 11:57:25 2011	(r223637)
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20110628:
+	The packet filter (pf) code has been updated to OpenBSD 4.5.
+	You need to update userland tools to be in sync with kernel.
+
 20110608:
 	The following sysctls and tunables are retired on x86 platforms:
 		machdep.hlt_cpus

Modified: head/contrib/pf/authpf/authpf.8
==============================================================================
--- head/contrib/pf/authpf/authpf.8	Tue Jun 28 11:03:39 2011	(r223636)
+++ head/contrib/pf/authpf/authpf.8	Tue Jun 28 11:57:25 2011	(r223637)
@@ -1,5 +1,5 @@
 .\" $FreeBSD$
-.\" $OpenBSD: authpf.8,v 1.43 2007/02/24 17:21:04 beck Exp $
+.\" $OpenBSD: authpf.8,v 1.47 2009/01/06 03:11:50 mcbride Exp $
 .\"
 .\" Copyright (c) 1998-2007 Bob Beck (beck@openbsd.org>.  All rights reserved.
 .\"
@@ -15,14 +15,16 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd March 28, 2006
+.Dd January 6 2009
 .Dt AUTHPF 8
 .Os
 .Sh NAME
-.Nm authpf
+.Nm authpf ,
+.Nm authpf-noip
 .Nd authenticating gateway user shell
 .Sh SYNOPSIS
 .Nm authpf
+.Nm authpf-noip
 .Sh DESCRIPTION
 .Nm
 is a user shell for authenticating gateways.
@@ -31,47 +33,63 @@ It is used to change
 rules when a user authenticates and starts a session with
 .Xr sshd 8
 and to undo these changes when the user's session exits.
-It is designed for changing filter and translation rules for an individual
-source IP address as long as a user maintains an active
-.Xr ssh 1
-session.
 Typical use would be for a gateway that authenticates users before
 allowing them Internet use, or a gateway that allows different users into
 different places.
+Combined with properly set up filter rules and secure switches,
 .Nm
-logs the successful start and end of a session to
-.Xr syslogd 8 .
-This, combined with properly set up filter rules and secure switches,
 can be used to ensure users are held accountable for their network traffic.
-.Pp
-.Nm
-can add filter and translation rules using the syntax described in
-.Xr pf.conf 5 .
-.Nm
-requires that the
+It is meant to be used with users who can connect via
+.Xr ssh 1
+only, and requires the
 .Xr pf 4
-system be enabled and a 
-.Xr fdescfs 5
-file system be mounted at
-.Pa /dev/fd
-before use.
+subsystem to be enabled.
+.Pp
+.Nm authpf-noip
+is a user shell
+which allows multiple connections to take
+place from the same IP address.
+It is useful primarily in cases where connections are tunneled via
+the gateway system, and can be directly associated with the user name.
+It cannot ensure accountability when
+classifying connections by IP address;
+in this case the client's IP address
+is not provided to the packet filter via the
+.Ar client_ip
+macro or the
+.Ar authpf_users
+table.
+Additionally, states associated with the client IP address
+are not purged when the session is ended.
+.Pp
+To use either
 .Nm
-can also maintain the list of IP address of connected users
-in the "authpf_users"
-.Pa table .
+or
+.Nm authpf-noip ,
+the user's shell needs to be set to
+.Pa /usr/sbin/authpf
+or
+.Pa /usr/sbin/authpf-noip .
 .Pp
 .Nm
-is meant to be used with users who can connect via
+uses the
+.Xr pf.conf 5
+syntax to change filter and translation rules for an individual
+user or client IP address as long as a user maintains an active
 .Xr ssh 1
-only.
-On startup,
+session, and logs the successful start and end of a session to
+.Xr syslogd 8 .
 .Nm
 retrieves the client's connecting IP address via the
 .Ev SSH_CLIENT
 environment variable and, after performing additional access checks,
 reads a template file to determine what filter and translation rules
-(if any) to add.
-On session exit the same rules that were added at startup are removed.
+(if any) to add, and
+maintains the list of IP addresses of connected users in the
+.Ar authpf_users
+table.
+On session exit the same rules and table entries that were added at startup
+are removed, and all states associated with the client's IP address are purged.
 .Pp
 Each
 .Nm
@@ -185,6 +203,9 @@ It is also possible to configure
 to only allow specific users access.
 This is done by listing their login names, one per line, in
 .Pa /etc/authpf/authpf.allow .
+A group of users can also be indicated by prepending "%" to the group name,
+and all members of a login class can be indicated by prepending "@" to the
+login class name.
 If "*" is found on a line, then all usernames match.
 If
 .Nm
@@ -297,7 +318,8 @@ They have a
 wireless network which they would like to protect from unauthorized use.
 To accomplish this, they create the file
 .Pa /etc/authpf/authpf.allow
-which lists their login ids, one per line.
+which lists their login ids, group prepended with "%", or login class
+prepended with "@", one per line.
 At this point, even if eve could authenticate to
 .Xr sshd 8 ,
 she would not be allowed to use the gateway.
@@ -501,6 +523,31 @@ table  persist
 anchor "authpf/*" from 
 rdr-anchor "authpf/*" from 
 .Ed
+.Pp
+.Sy Tunneled users
+\- normally
+.Nm
+allows only one session per client IP address.
+However in some cases, such as when connections are tunneled via
+.Xr ssh 1
+or
+.Xr ipsec 4 ,
+the connections can be authorized based on the userid of the user instead of
+the client IP address.
+In this case it is appropriate to use
+.Nm authpf-noip
+to allow multiple users behind a NAT gateway to connect.
+In the
+.Pa /etc/authpf/authpf.rules
+example below, the remote user could tunnel a remote desktop session to their
+workstation:
+.Bd -literal
+internal_if="bge0"
+workstation_ip="10.2.3.4"
+
+pass out on $internal_if from (self) to $workstation_ip port 3389 \e
+       user $user_id
+.Ed
 .Sh FILES
 .Bl -tag -width "/etc/authpf/authpf.conf" -compact
 .It Pa /etc/authpf/authpf.conf
@@ -512,7 +559,6 @@ rdr-anchor "authpf/*" from 
 __FBSDID("$FreeBSD$");
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #endif
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -48,10 +49,11 @@ __FBSDID("$FreeBSD$");
 #include "pathnames.h"
 
 static int	read_config(FILE *);
-static void	print_message(char *);
-static int	allowed_luser(char *);
-static int	check_luser(char *, char *);
+static void	print_message(const char *);
+static int	allowed_luser(struct passwd *);
+static int	check_luser(const char *, char *);
 static int	remove_stale_rulesets(void);
+static int	recursive_ruleset_purge(char *, char *);
 static int	change_filter(int, const char *, const char *);
 static int	change_table(int, const char *);
 static void	authpf_kill_states(void);
@@ -60,8 +62,10 @@ int	dev;			/* pf device */
 char	anchorname[PF_ANCHOR_NAME_SIZE] = "authpf";
 char	rulesetname[MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 2];
 char	tablename[PF_TABLE_NAME_SIZE] = "authpf_users";
+int	user_ip = 1;	/* controls whether $user_ip is set */
 
 FILE	*pidfp;
+int	pidfd = -1;
 char	 luser[MAXLOGNAME];	/* username */
 char	 ipsrc[256];		/* ip as a string */
 char	 pidfile[MAXPATHLEN];	/* we save pid in this file. */
@@ -75,6 +79,7 @@ static __dead2 void	do_death(int);
 #else
 static __dead void	do_death(int);
 #endif
+extern char *__progname;	/* program name */
 
 /*
  * User shell for authenticating gateways. Sole purpose is to allow
@@ -83,21 +88,24 @@ static __dead void	do_death(int);
  * up. Meant to be used only from ssh(1) connections.
  */
 int
-main(int argc, char *argv[])
+main(void)
 {
-	int		 lockcnt = 0, n, pidfd;
+	int		 lockcnt = 0, n;
 	FILE		*config;
 	struct in6_addr	 ina;
 	struct passwd	*pw;
 	char		*cp;
 	gid_t		 gid;
 	uid_t		 uid;
-	char		*shell;
+	const char	*shell;
 	login_cap_t	*lc;
 
+	if (strcmp(__progname, "-authpf-noip") == 0)
+                user_ip = 0;
+
 	config = fopen(PATH_CONFFILE, "r");
 	if (config == NULL) {
-		syslog(LOG_ERR, "can not open %s (%m)", PATH_CONFFILE);
+		syslog(LOG_ERR, "cannot open %s (%m)", PATH_CONFFILE);
 		exit(1);
 	}
 
@@ -142,23 +150,34 @@ main(int argc, char *argv[])
 	}
 
 	if ((lc = login_getclass(pw->pw_class)) != NULL)
-		shell = (char *)login_getcapstr(lc, "shell", pw->pw_shell,
+		shell = login_getcapstr(lc, "shell", pw->pw_shell,
 		    pw->pw_shell);
 	else
 		shell = pw->pw_shell;
 
+#ifndef __FreeBSD__
 	login_close(lc);
+#endif
 
-	if (strcmp(shell, PATH_AUTHPF_SHELL)) {
+	if (strcmp(shell, PATH_AUTHPF_SHELL) && 
+	    strcmp(shell, PATH_AUTHPF_SHELL_NOIP)) {
 		syslog(LOG_ERR, "wrong shell for user %s, uid %u",
 		    pw->pw_name, pw->pw_uid);
+#ifdef __FreeBSD__
+	login_close(lc);
+#else
 		if (shell != pw->pw_shell)
 			free(shell);
+#endif
 		goto die;
 	}
 
+#ifdef __FreeBSD__
+	login_close(lc);
+#else
 	if (shell != pw->pw_shell)
 		free(shell);
+#endif
 
 	/*
 	 * Paranoia, but this data _does_ come from outside authpf, and
@@ -181,13 +200,22 @@ main(int argc, char *argv[])
 	}
 
 
-	/* Make our entry in /var/authpf as /var/authpf/ipaddr */
-	n = snprintf(pidfile, sizeof(pidfile), "%s/%s", PATH_PIDFILE, ipsrc);
+	/* Make our entry in /var/authpf as ipaddr or username */
+	n = snprintf(pidfile, sizeof(pidfile), "%s/%s",
+	    PATH_PIDFILE, user_ip ? ipsrc : luser);
 	if (n < 0 || (u_int)n >= sizeof(pidfile)) {
 		syslog(LOG_ERR, "path to pidfile too long");
 		goto die;
 	}
 
+	signal(SIGTERM, need_death);
+	signal(SIGINT, need_death);
+	signal(SIGALRM, need_death);
+	signal(SIGPIPE, need_death);
+	signal(SIGHUP, need_death);
+	signal(SIGQUIT, need_death);
+	signal(SIGTSTP, need_death);
+
 	/*
 	 * If someone else is already using this ip, then this person
 	 * wants to switch users - so kill the old process and exit
@@ -241,15 +269,17 @@ main(int argc, char *argv[])
 		}
 
 		/*
-		 * we try to kill the previous process and acquire the lock
+		 * We try to kill the previous process and acquire the lock
 		 * for 10 seconds, trying once a second. if we can't after
-		 * 10 attempts we log an error and give up
+		 * 10 attempts we log an error and give up.
 		 */
-		if (++lockcnt > 10) {
-			syslog(LOG_ERR, "cannot kill previous authpf (pid %d)",
-			    otherpid);
+		if (want_death || ++lockcnt > 10) {
+			if (!want_death)
+				syslog(LOG_ERR, "cannot kill previous authpf (pid %d)",
+				    otherpid);
 			fclose(pidfp);
 			pidfp = NULL;
+			pidfd = -1;
 			goto dogdeath;
 		}
 		sleep(1);
@@ -260,6 +290,7 @@ main(int argc, char *argv[])
 		 */
 		fclose(pidfp);
 		pidfp = NULL;
+		pidfd = -1;
 	} while (1);
 	
 	/* whack the group list */
@@ -277,7 +308,7 @@ main(int argc, char *argv[])
 	}
 	openlog("authpf", LOG_PID | LOG_NDELAY, LOG_DAEMON);
 
-	if (!check_luser(PATH_BAN_DIR, luser) || !allowed_luser(luser)) {
+	if (!check_luser(PATH_BAN_DIR, luser) || !allowed_luser(pw)) {
 		syslog(LOG_INFO, "user %s prohibited", luser);
 		do_death(0);
 	}
@@ -302,19 +333,12 @@ main(int argc, char *argv[])
 		printf("Unable to modify filters\r\n");
 		do_death(0);
 	}
-	if (change_table(1, ipsrc) == -1) {
+	if (user_ip && change_table(1, ipsrc) == -1) {
 		printf("Unable to modify table\r\n");
 		change_filter(0, luser, ipsrc);
 		do_death(0);
 	}
 
-	signal(SIGTERM, need_death);
-	signal(SIGINT, need_death);
-	signal(SIGALRM, need_death);
-	signal(SIGPIPE, need_death);
-	signal(SIGHUP, need_death);
-	signal(SIGQUIT, need_death);
-	signal(SIGTSTP, need_death);
 	while (1) {
 		printf("\r\nHello %s. ", luser);
 		printf("You are authenticated from host \"%s\"\r\n", ipsrc);
@@ -337,8 +361,6 @@ dogdeath:
 	sleep(180); /* them lusers read reaaaaal slow */
 die:
 	do_death(0);
-
-	/* NOTREACHED */
 }
 
 /*
@@ -361,6 +383,8 @@ read_config(FILE *f)
 		}
 		i++;
 		len = strlen(buf);
+		if (len == 0)
+			continue;
 		if (buf[len - 1] != '\n' && !feof(f)) {
 			syslog(LOG_ERR, "line %d too long in %s", i,
 			    PATH_CONFFILE);
@@ -413,7 +437,7 @@ parse_error:
  * they've been bad or we're unavailable.
  */
 static void
-print_message(char *filename)
+print_message(const char *filename)
 {
 	char	 buf[1024];
 	FILE	*f;
@@ -436,6 +460,7 @@ print_message(char *filename)
  * allowed_luser checks to see if user "luser" is allowed to
  * use this gateway by virtue of being listed in an allowed
  * users file, namely /etc/authpf/authpf.allow .
+ * Users may be listed by , %, or @.
  *
  * If /etc/authpf/authpf.allow does not exist, then we assume that
  * all users who are allowed in by sshd(8) are permitted to
@@ -444,9 +469,9 @@ print_message(char *filename)
  * the session terminates in the same manner as being banned.
  */
 static int
-allowed_luser(char *luser)
+allowed_luser(struct passwd *pw)
 {
-	char	*buf, *lbuf;
+	char *buf,*lbuf;
 	int	 matched;
 	size_t	 len;
 	FILE	*f;
@@ -476,8 +501,14 @@ allowed_luser(char *luser)
 		 * "public" gateway, such as it is, so let
 		 * everyone use it.
 		 */
+		int gl_init = 0, ngroups = NGROUPS + 1;
+		gid_t groups[NGROUPS + 1];
+
 		lbuf = NULL;
+		matched = 0;
+
 		while ((buf = fgetln(f, &len))) {
+			
 			if (buf[len - 1] == '\n')
 				buf[len - 1] = '\0';
 			else {
@@ -488,7 +519,40 @@ allowed_luser(char *luser)
 				buf = lbuf;
 			}
 
-			matched = strcmp(luser, buf) == 0 || strcmp("*", buf) == 0;
+			if (buf[0] == '@') {
+				/* check login class */
+				if (strcmp(pw->pw_class, buf + 1) == 0)
+					matched++;
+			} else if (buf[0] == '%') {
+				/* check group membership */
+				int cnt; 
+				struct group *group;
+
+				if ((group = getgrnam(buf + 1)) == NULL) {
+					syslog(LOG_ERR,
+					    "invalid group '%s' in %s (%s)",
+					    buf + 1, PATH_ALLOWFILE,
+				 	    strerror(errno));
+					return (0);
+				}
+
+				if (!gl_init) {
+					(void) getgrouplist(pw->pw_name,
+					    pw->pw_gid, groups, &ngroups);
+					gl_init++;
+				}
+			
+				for ( cnt = 0; cnt < ngroups; cnt++) {
+					if (group->gr_gid == groups[cnt]) {
+						matched++;
+						break;
+					}
+				}
+			} else {
+				/* check username and wildcard */
+				matched = strcmp(pw->pw_name, buf) == 0 ||
+				    strcmp("*", buf) == 0;
+			}
 
 			if (lbuf != NULL) {
 				free(lbuf);
@@ -496,13 +560,13 @@ allowed_luser(char *luser)
 			}
 
 			if (matched)
-				return (1); /* matched an allowed username */
+				return (1); /* matched an allowed user/group */
 		}
 		syslog(LOG_INFO, "denied access to %s: not listed in %s",
-		    luser, PATH_ALLOWFILE);
+		    pw->pw_name, PATH_ALLOWFILE);
 
 		/* reuse buf */
-		buf = "\n\nSorry, you are not allowed to use this facility!\n";
+		sprintf(buf, "%s", "\n\nSorry, you are not allowed to use this facility!\n");
 		fputs(buf, stdout);
 	}
 	fflush(stdout);
@@ -520,13 +584,13 @@ allowed_luser(char *luser)
  * going to be un-banned.)
  */
 static int
-check_luser(char *luserdir, char *luser)
+check_luser(const char *luserdir, char *l_user)
 {
 	FILE	*f;
 	int	 n;
 	char	 tmp[MAXPATHLEN];
 
-	n = snprintf(tmp, sizeof(tmp), "%s/%s", luserdir, luser);
+	n = snprintf(tmp, sizeof(tmp), "%s/%s", luserdir, l_user);
 	if (n < 0 || (u_int)n >= sizeof(tmp)) {
 		syslog(LOG_ERR, "provided banned directory line too long (%s)",
 		    luserdir);
@@ -555,7 +619,7 @@ check_luser(char *luserdir, char *luser)
 		 * tell what they can do and where they can go.
 		 */
 		syslog(LOG_INFO, "denied access to %s: %s exists",
-		    luser, tmp);
+		    l_user, tmp);
 
 		/* reuse tmp */
 		strlcpy(tmp, "\n\n-**- Sorry, you have been banned! -**-\n\n",
@@ -581,7 +645,7 @@ static int
 remove_stale_rulesets(void)
 {
 	struct pfioc_ruleset	 prs;
-	u_int32_t		 nr, mnr;
+	u_int32_t		 nr;
 
 	memset(&prs, 0, sizeof(prs));
 	strlcpy(prs.path, anchorname, sizeof(prs.path));
@@ -592,13 +656,12 @@ remove_stale_rulesets(void)
 			return (1);
 	}
 
-	mnr = prs.nr;
-	nr = 0;
-	while (nr < mnr) {
+	nr = prs.nr;
+	while (nr) {
 		char	*s, *t;
 		pid_t	 pid;
 
-		prs.nr = nr;
+		prs.nr = nr - 1;
 		if (ioctl(dev, DIOCGETRULESET, &prs))
 			return (1);
 		errno = 0;
@@ -610,119 +673,159 @@ remove_stale_rulesets(void)
 		if (!prs.name[0] || errno ||
 		    (*s && (t == prs.name || *s != ')')))
 			return (1);
-		if (kill(pid, 0) && errno != EPERM) {
-			int			i;
-			struct pfioc_trans_e	t_e[PF_RULESET_MAX+1];
-			struct pfioc_trans	t;
-
-			bzero(&t, sizeof(t));
-			bzero(t_e, sizeof(t_e));
-			t.size = PF_RULESET_MAX+1;
-			t.esize = sizeof(t_e[0]);
-			t.array = t_e;
-			for (i = 0; i < PF_RULESET_MAX+1; ++i) {
-				t_e[i].rs_num = i;
-				snprintf(t_e[i].anchor, sizeof(t_e[i].anchor),
-				    "%s/%s", anchorname, prs.name);
-			}
-			t_e[PF_RULESET_MAX].rs_num = PF_RULESET_TABLE;
-			if ((ioctl(dev, DIOCXBEGIN, &t) ||
-			    ioctl(dev, DIOCXCOMMIT, &t)) &&
-			    errno != EINVAL)
+		if ((kill(pid, 0) && errno != EPERM) || pid == getpid()) {
+			if (recursive_ruleset_purge(anchorname, prs.name))
 				return (1);
-			mnr--;
-		} else
-			nr++;
+		}
+		nr--;
 	}
 	return (0);
 }
 
+static int
+recursive_ruleset_purge(char *an, char *rs)
+{
+	struct pfioc_trans_e     *t_e = NULL;
+	struct pfioc_trans	 *t = NULL;
+	struct pfioc_ruleset	 *prs = NULL;
+	int			  i;
+
+
+	/* purge rules */
+	errno = 0;
+	if ((t = calloc(1, sizeof(struct pfioc_trans))) == NULL)
+		goto no_mem;
+	if ((t_e = calloc(PF_RULESET_MAX+1,
+	    sizeof(struct pfioc_trans_e))) == NULL)
+		goto no_mem;
+	t->size = PF_RULESET_MAX+1;
+	t->esize = sizeof(struct pfioc_trans_e);
+	t->array = t_e;
+	for (i = 0; i < PF_RULESET_MAX+1; ++i) {
+		t_e[i].rs_num = i;
+		snprintf(t_e[i].anchor, sizeof(t_e[i].anchor), "%s/%s", an, rs);
+	}
+	t_e[PF_RULESET_MAX].rs_num = PF_RULESET_TABLE;
+	if ((ioctl(dev, DIOCXBEGIN, t) ||
+	    ioctl(dev, DIOCXCOMMIT, t)) &&
+	    errno != EINVAL)
+		goto cleanup;
+
+	/* purge any children */
+	if ((prs = calloc(1, sizeof(struct pfioc_ruleset))) == NULL)
+		goto no_mem;
+	snprintf(prs->path, sizeof(prs->path), "%s/%s", an, rs);
+	if (ioctl(dev, DIOCGETRULESETS, prs)) {
+		if (errno != EINVAL)
+			goto cleanup;
+		errno = 0;
+	} else {
+		int nr = prs->nr;
+
+		while (nr) {
+			prs->nr = 0;
+			if (ioctl(dev, DIOCGETRULESET, prs))
+				goto cleanup;
+
+			if (recursive_ruleset_purge(prs->path, prs->name))
+				goto cleanup;
+			nr--;
+		}
+	}
+
+no_mem:
+	if (errno == ENOMEM)
+		syslog(LOG_ERR, "calloc failed");
+
+cleanup:
+	free(t);
+	free(t_e);
+	free(prs);
+	return (errno);
+}
+
 /*
  * Add/remove filter entries for user "luser" from ip "ipsrc"
  */
 static int
-change_filter(int add, const char *luser, const char *ipsrc)
+change_filter(int add, const char *l_user, const char *ip_src)
 {
-	char	*pargv[13] = {
-		"pfctl", "-p", "/dev/pf", "-q", "-a", "anchor/ruleset",
-		"-D", "user_ip=X", "-D", "user_id=X", "-f",
-		"file", NULL
-	};
 	char	*fdpath = NULL, *userstr = NULL, *ipstr = NULL;
 	char	*rsn = NULL, *fn = NULL;
 	pid_t	pid;
 	gid_t   gid;
 	int	s;
 
-	if (luser == NULL || !luser[0] || ipsrc == NULL || !ipsrc[0]) {
-		syslog(LOG_ERR, "invalid luser/ipsrc");
-		goto error;
-	}
-
-	if (asprintf(&rsn, "%s/%s", anchorname, rulesetname) == -1)
-		goto no_mem;
-	if (asprintf(&fdpath, "/dev/fd/%d", dev) == -1)
-		goto no_mem;
-	if (asprintf(&ipstr, "user_ip=%s", ipsrc) == -1)
-		goto no_mem;
-	if (asprintf(&userstr, "user_id=%s", luser) == -1)
-		goto no_mem;
-
 	if (add) {
 		struct stat sb;
+		char *pargv[13] = {
+			"pfctl", "-p", "/dev/pf", "-q", "-a", "anchor/ruleset",
+			"-D", "user_id=X", "-D", "user_ip=X", "-f", "file", NULL
+		};
 
-		if (asprintf(&fn, "%s/%s/authpf.rules", PATH_USER_DIR, luser)
-		    == -1)
+		if (l_user == NULL || !l_user[0] || ip_src == NULL || !ip_src[0]) {
+			syslog(LOG_ERR, "invalid luser/ipsrc");
+			goto error;
+		}
+
+		if (asprintf(&rsn, "%s/%s", anchorname, rulesetname) == -1)
+			goto no_mem;
+		if (asprintf(&fdpath, "/dev/fd/%d", dev) == -1)
+			goto no_mem;
+		if (asprintf(&ipstr, "user_ip=%s", ip_src) == -1)
+			goto no_mem;
+		if (asprintf(&userstr, "user_id=%s", l_user) == -1)
+			goto no_mem;
+		if (asprintf(&fn, "%s/%s/authpf.rules",
+		    PATH_USER_DIR, l_user) == -1)
 			goto no_mem;
 		if (stat(fn, &sb) == -1) {
 			free(fn);
 			if ((fn = strdup(PATH_PFRULES)) == NULL)
 				goto no_mem;
 		}
-	}
-	pargv[2] = fdpath;
-	pargv[5] = rsn;
-	pargv[7] = userstr;
-	pargv[9] = ipstr;
-	if (!add)
-		pargv[11] = "/dev/null";
-	else
-		pargv[11] = fn;
+		pargv[2] = fdpath;
+		pargv[5] = rsn;
+		pargv[7] = userstr;
+		if (user_ip) {
+			pargv[9] = ipstr;
+			pargv[11] = fn;
+		} else {
+			pargv[8] = "-f";
+			pargv[9] = fn;
+			pargv[10] = NULL;
+		}
 
-	switch (pid = fork()) {
-	case -1:
-		syslog(LOG_ERR, "fork failed");
-		goto error;
-	case 0:
-		/* revoke group privs before exec */
-		gid = getgid();
-		if (setregid(gid, gid) == -1) {
-			err(1, "setregid");
-		}
-		execvp(PATH_PFCTL, pargv);
-		warn("exec of %s failed", PATH_PFCTL);
-		_exit(1);
-	}
-
-	/* parent */
-	waitpid(pid, &s, 0);
-	if (s != 0) {
-		syslog(LOG_ERR, "pfctl exited abnormally");
-		goto error;
-	}
+		switch (pid = fork()) {
+		case -1:
+			syslog(LOG_ERR, "fork failed");
+			goto error;
+		case 0:
+			/* revoke group privs before exec */
+			gid = getgid();
+			if (setregid(gid, gid) == -1) {
+				err(1, "setregid");
+			}
+			execvp(PATH_PFCTL, pargv);
+			warn("exec of %s failed", PATH_PFCTL);
+			_exit(1);
+		}
+
+		/* parent */
+		waitpid(pid, &s, 0);
+		if (s != 0) {
+			syslog(LOG_ERR, "pfctl exited abnormally");
+			goto error;
+		}
 
-	if (add) {
 		gettimeofday(&Tstart, NULL);
-		syslog(LOG_INFO, "allowing %s, user %s", ipsrc, luser);
+		syslog(LOG_INFO, "allowing %s, user %s", ip_src, l_user);
 	} else {
+		remove_stale_rulesets();
+
 		gettimeofday(&Tend, NULL);
-#ifdef __FreeBSD__
-		syslog(LOG_INFO, "removed %s, user %s - duration %jd seconds",
-		    ipsrc, luser, (intmax_t)(Tend.tv_sec - Tstart.tv_sec));
-#else
-		syslog(LOG_INFO, "removed %s, user %s - duration %ld seconds",
-		    ipsrc, luser, Tend.tv_sec - Tstart.tv_sec);
-#endif
+		syslog(LOG_INFO, "removed %s, user %s - duration %ju seconds",
+		    ip_src, l_user, (uintmax_t)(Tend.tv_sec - Tstart.tv_sec));
 	}
 	return (0);
 no_mem:
@@ -740,7 +843,7 @@ error:
  * Add/remove this IP from the "authpf_users" table.
  */
 static int
-change_table(int add, const char *ipsrc)
+change_table(int add, const char *ip_src)
 {
 	struct pfioc_table	io;
 	struct pfr_addr		addr;
@@ -753,12 +856,12 @@ change_table(int add, const char *ipsrc)
 	io.pfrio_size = 1;
 
 	bzero(&addr, sizeof(addr));
-	if (ipsrc == NULL || !ipsrc[0])
+	if (ip_src == NULL || !ip_src[0])
 		return (-1);
-	if (inet_pton(AF_INET, ipsrc, &addr.pfra_ip4addr) == 1) {
+	if (inet_pton(AF_INET, ip_src, &addr.pfra_ip4addr) == 1) {
 		addr.pfra_af = AF_INET;
 		addr.pfra_net = 32;
-	} else if (inet_pton(AF_INET6, ipsrc, &addr.pfra_ip6addr) == 1) {
+	} else if (inet_pton(AF_INET6, ip_src, &addr.pfra_ip6addr) == 1) {
 		addr.pfra_af = AF_INET6;
 		addr.pfra_net = 128;
 	} else {
@@ -769,7 +872,7 @@ change_table(int add, const char *ipsrc)
 	if (ioctl(dev, add ? DIOCRADDADDRS : DIOCRDELADDRS, &io) &&
 	    errno != ESRCH) {
 		syslog(LOG_ERR, "cannot %s %s from table %s: %s",
-		    add ? "add" : "remove", ipsrc, tablename,
+		    add ? "add" : "remove", ip_src, tablename,
 		    strerror(errno));
 		return (-1);
 	}
@@ -821,7 +924,7 @@ authpf_kill_states(void)
 
 /* signal handler that makes us go away properly */
 static void
-need_death(int signo)
+need_death(int signo __unused)
 {
 	want_death = 1;
 }
@@ -840,11 +943,12 @@ do_death(int active)
 
 	if (active) {
 		change_filter(0, luser, ipsrc);
-		change_table(0, ipsrc);
-		authpf_kill_states();
-		remove_stale_rulesets();
+		if (user_ip) {
+			change_table(0, ipsrc);
+			authpf_kill_states();
+		}
 	}
-	if (pidfile[0] && (pidfp != NULL))
+	if (pidfile[0] && pidfd != -1)
 		if (unlink(pidfile) == -1)
 			syslog(LOG_ERR, "cannot unlink %s (%m)", pidfile);
 	exit(ret);

Modified: head/contrib/pf/authpf/pathnames.h
==============================================================================
--- head/contrib/pf/authpf/pathnames.h	Tue Jun 28 11:03:39 2011	(r223636)
+++ head/contrib/pf/authpf/pathnames.h	Tue Jun 28 11:57:25 2011	(r223637)
@@ -1,4 +1,4 @@
-/*	$OpenBSD: pathnames.h,v 1.7 2004/04/25 18:40:42 beck Exp $	*/
+/*	$OpenBSD: pathnames.h,v 1.8 2008/02/14 01:49:17 mcbride Exp $	*/
 
 /*
  * Copyright (C) 2002 Chris Kuethe (ckuethe@ualberta.ca)
@@ -35,4 +35,5 @@
 #define PATH_DEVFILE		"/dev/pf"
 #define PATH_PIDFILE		"/var/authpf"
 #define PATH_AUTHPF_SHELL	"/usr/sbin/authpf"
+#define PATH_AUTHPF_SHELL_NOIP	"/usr/sbin/authpf-noip"
 #define PATH_PFCTL		"/sbin/pfctl"

Modified: head/contrib/pf/ftp-proxy/filter.c
==============================================================================
--- head/contrib/pf/ftp-proxy/filter.c	Tue Jun 28 11:03:39 2011	(r223636)
+++ head/contrib/pf/ftp-proxy/filter.c	Tue Jun 28 11:57:25 2011	(r223637)
@@ -1,4 +1,4 @@
-/*	$OpenBSD: filter.c,v 1.5 2006/12/01 07:31:21 camield Exp $ */
+/*	$OpenBSD: filter.c,v 1.8 2008/06/13 07:25:26 claudio Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Camiel Dobbelaar, 
@@ -53,7 +53,7 @@ static struct pfioc_rule	pfr;
 static struct pfioc_trans	pft;
 static struct pfioc_trans_e	pfte[TRANS_SIZE];
 static int dev, rule_log;
-static char *qname;
+static const char *qname, *tagname;
 
 int
 add_filter(u_int32_t id, u_int8_t dir, struct sockaddr *src,
@@ -159,11 +159,12 @@ do_rollback(void)
 }
 
 void
-init_filter(char *opt_qname, int opt_verbose)
+init_filter(const char *opt_qname, const char *opt_tagname, int opt_verbose)
 {
 	struct pf_status status;
 
 	qname = opt_qname;
+	tagname = opt_tagname;
 
 	if (opt_verbose == 1)
 		rule_log = PF_LOG;
@@ -172,7 +173,7 @@ init_filter(char *opt_qname, int opt_ver
 
 	dev = open("/dev/pf", O_RDWR);	
 	if (dev == -1)
-		err(1, "/dev/pf");
+		err(1, "open /dev/pf");
 	if (ioctl(dev, DIOCGETSTATUS, &status) == -1)
 		err(1, "DIOCGETSTATUS");
 	if (!status.running)
@@ -280,9 +281,9 @@ prepare_rule(u_int32_t id, int rs_num, s
 	switch (rs_num) {
 	case PF_RULESET_FILTER:
 		/*
-		 * pass quick [log] inet[6] proto tcp \
+		 * pass [quick] [log] inet[6] proto tcp \
 		 *     from $src to $dst port = $d_port flags S/SA keep state
-		 *     (max 1) [queue qname]
+		 *     (max 1) [queue qname] [tag tagname]
 		 */
 		pfr.rule.action = PF_PASS;
 		pfr.rule.quick = 1;
@@ -293,6 +294,11 @@ prepare_rule(u_int32_t id, int rs_num, s
 		pfr.rule.max_states = 1;
 		if (qname != NULL)
 			strlcpy(pfr.rule.qname, qname, sizeof pfr.rule.qname);
+		if (tagname != NULL) {
+			pfr.rule.quick = 0;
+			strlcpy(pfr.rule.tagname, tagname,
+                                sizeof pfr.rule.tagname);
+		}
 		break;
 	case PF_RULESET_NAT:
 		/*

Modified: head/contrib/pf/ftp-proxy/filter.h
==============================================================================
--- head/contrib/pf/ftp-proxy/filter.h	Tue Jun 28 11:03:39 2011	(r223636)
+++ head/contrib/pf/ftp-proxy/filter.h	Tue Jun 28 11:57:25 2011	(r223637)
@@ -1,4 +1,4 @@
-/*	$OpenBSD: filter.h,v 1.3 2005/06/07 14:12:07 camield Exp $ */
+/*	$OpenBSD: filter.h,v 1.4 2007/08/01 09:31:41 henning Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Camiel Dobbelaar, 
@@ -26,6 +26,6 @@ int add_rdr(u_int32_t, struct sockaddr *
     struct sockaddr *, u_int16_t);
 int do_commit(void);
 int do_rollback(void);
-void init_filter(char *, int);
+void init_filter(const char *, const char *, int);
 int prepare_commit(u_int32_t);
 int server_lookup(struct sockaddr *, struct sockaddr *, struct sockaddr *);

Modified: head/contrib/pf/ftp-proxy/ftp-proxy.8
==============================================================================
--- head/contrib/pf/ftp-proxy/ftp-proxy.8	Tue Jun 28 11:03:39 2011	(r223636)
+++ head/contrib/pf/ftp-proxy/ftp-proxy.8	Tue Jun 28 11:57:25 2011	(r223637)
@@ -1,4 +1,4 @@
-.\"	$OpenBSD: ftp-proxy.8,v 1.7 2006/12/30 13:01:54 camield Exp $
+.\"	$OpenBSD: ftp-proxy.8,v 1.11 2008/02/26 18:52:53 henning Exp $
 .\"
 .\" Copyright (c) 2004, 2005 Camiel Dobbelaar, 
 .\"
@@ -16,14 +16,15 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 28, 2004
+.Dd February 26, 2008
 .Dt FTP-PROXY 8
 .Os
 .Sh NAME
 .Nm ftp-proxy
 .Nd Internet File Transfer Protocol proxy daemon
 .Sh SYNOPSIS
-.Nm ftp-proxy
+.Nm
+.Bk -words
 .Op Fl 6Adrv
 .Op Fl a Ar address
 .Op Fl b Ar address
@@ -33,7 +34,9 @@
 .Op Fl p Ar port
 .Op Fl q Ar queue

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 12:32:24 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE511106566B;
	Tue, 28 Jun 2011 12:32:24 +0000 (UTC) (envelope-from osa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AE5D48FC0A;
	Tue, 28 Jun 2011 12:32:24 +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 p5SCWOS1049527;
	Tue, 28 Jun 2011 12:32:24 GMT (envelope-from osa@svn.freebsd.org)
Received: (from osa@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SCWOZL049525;
	Tue, 28 Jun 2011 12:32:24 GMT (envelope-from osa@svn.freebsd.org)
Message-Id: <201106281232.p5SCWOZL049525@svn.freebsd.org>
From: "Sergey A. Osokin" 
Date: Tue, 28 Jun 2011 12:32:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223638 - head/usr.bin/calendar/calendars/ru_RU.KOI8-R
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 12:32:24 -0000

Author: osa (ports committer)
Date: Tue Jun 28 12:32:24 2011
New Revision: 223638
URL: http://svn.freebsd.org/changeset/base/223638

Log:
  Remove needless file due to Russia scraps DST in 2011.
  > Description of fields to fill in above:                     76 columns --|
  > PR:            If a GNATS PR is affected by the change.
  > Submitted by:  If someone else sent in the change.
  > Reviewed by:   If someone else reviewed your modification.
  > Approved by:   If you needed approval for this commit.
  > Obtained from: If the change is from a third party.
  > MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
  > Security:      Vulnerability reference (one per line) or description.
  > Empty fields above will be automatically removed.
  
  M    calendars/ru_RU.KOI8-R/calendar.all
  D    calendars/ru_RU.KOI8-R/calendar.msk

Deleted:
  head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.msk
Modified:
  head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.all

Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.all
==============================================================================
--- head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.all	Tue Jun 28 11:57:25 2011	(r223637)
+++ head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.all	Tue Jun 28 12:32:24 2011	(r223638)
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 14:07:29 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CEB5106566C;
	Tue, 28 Jun 2011 14:07:29 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2D1E48FC15;
	Tue, 28 Jun 2011 14:07:29 +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 p5SE7Tf3052575;
	Tue, 28 Jun 2011 14:07:29 GMT
	(envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SE7THi052573;
	Tue, 28 Jun 2011 14:07:29 GMT
	(envelope-from hselasky@svn.freebsd.org)
Message-Id: <201106281407.p5SE7THi052573@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Tue, 28 Jun 2011 14:07:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223642 - head/lib/libusb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 14:07:29 -0000

Author: hselasky
Date: Tue Jun 28 14:07:28 2011
New Revision: 223642
URL: http://svn.freebsd.org/changeset/base/223642

Log:
  LibUSB v1.0: Need at least one frame when doing the dummy open
  else clear stall won't work in that case.

Modified:
  head/lib/libusb/libusb10.c

Modified: head/lib/libusb/libusb10.c
==============================================================================
--- head/lib/libusb/libusb10.c	Tue Jun 28 13:14:39 2011	(r223641)
+++ head/lib/libusb/libusb10.c	Tue Jun 28 14:07:28 2011	(r223642)
@@ -636,7 +636,7 @@ libusb_clear_halt(struct libusb20_device
 		return (LIBUSB_ERROR_INVALID_PARAM);
 
 	CTX_LOCK(dev->ctx);
-	err = libusb20_tr_open(xfer, 0, 0, endpoint);
+	err = libusb20_tr_open(xfer, 0, 1, endpoint);
 	CTX_UNLOCK(dev->ctx);
 
 	if (err != 0 && err != LIBUSB20_ERROR_BUSY)

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 14:26:35 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 43671106564A;
	Tue, 28 Jun 2011 14:26:35 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 339798FC19;
	Tue, 28 Jun 2011 14:26: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 p5SEQZSY053224;
	Tue, 28 Jun 2011 14:26:35 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SEQZ5H053222;
	Tue, 28 Jun 2011 14:26:35 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201106281426.p5SEQZ5H053222@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Tue, 28 Jun 2011 14:26:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223644 - head/etc/rc.d
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 14:26:35 -0000

Author: pluknet
Date: Tue Jun 28 14:26:34 2011
New Revision: 223644
URL: http://svn.freebsd.org/changeset/base/223644

Log:
  Run load_rc_config before stop_cmd definition, so that ${quotaoff_flags}
  is correctly expanded inside stop_cmd instead of getting nothing.
  
  PR:		conf/157687
  Reported by:	Dmitry Banschikov 
  MFC after:	1 week

Modified:
  head/etc/rc.d/quota

Modified: head/etc/rc.d/quota
==============================================================================
--- head/etc/rc.d/quota	Tue Jun 28 14:10:39 2011	(r223643)
+++ head/etc/rc.d/quota	Tue Jun 28 14:26:34 2011	(r223644)
@@ -14,6 +14,7 @@
 
 name="quota"
 rcvar=`set_rcvar`
+load_rc_config $name
 start_cmd="quota_start"
 stop_cmd="/usr/sbin/quotaoff ${quotaoff_flags}"
 
@@ -30,5 +31,4 @@ quota_start()
 	echo ' done.'
 }
 
-load_rc_config $name
 run_rc_command "$1"

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 16:07:58 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AAC64106564A;
	Tue, 28 Jun 2011 16:07:58 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 49F008FC16;
	Tue, 28 Jun 2011 16:07:58 +0000 (UTC)
Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0)
	by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5SG3BKF070339
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO);
	Tue, 28 Jun 2011 10:03:14 -0600 (MDT) (envelope-from imp@bsdimp.com)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: Warner Losh 
In-Reply-To: <20110628084558.GA35392@FreeBSD.org>
Date: Tue, 28 Jun 2011 10:01:37 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: <9521FD1A-3D77-4F37-B37C-CC73B13BC6B5@bsdimp.com>
References: <201106242132.p5OLW3DL071062@svn.freebsd.org>
	
	
	<20110628084558.GA35392@FreeBSD.org>
To: Alexey Dokuchaev 
X-Mailer: Apple Mail (2.1084)
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(harmony.bsdimp.com [10.0.0.6]);
	Tue, 28 Jun 2011 10:03:15 -0600 (MDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Hans Petter Selasky ,
	Ronald Klop 
Subject: Re: svn commit: r223519 - head/etc/devd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 16:07:58 -0000


On Jun 28, 2011, at 2:45 AM, Alexey Dokuchaev wrote:

> On Sun, Jun 26, 2011 at 10:14:13PM -0600, Warner Losh wrote:
>> Not in GENERIC.  9.0 is getting ready to feature freeze any minute, =
so
>> there's no time to do the testing that a radical change like that =
would
>> require.
>=20
> Fair enough.  Right now, this work seems to cover only USB kernel =
modules,
> is it so?  Is expansion into generic PCI area also planned, provided =
that
> you've already had some ideas and seem to be willing to pick up the =
work
> given enough support from the other developers (please excuse me if my
> understanding is wrong)?

The reason we were able to relatively quickly generate this file from =
USB is because USB is very regular and uniform in its probe routines.  =
They all have (or could be converted to have) something approximating =
the same format.

PCI isn't even remotely close to this, and the techniques that worked =
for USB (and some of the short cuts taken) can't work for PCI for us.  =
There's no uniformity in the PCI space, although many of the PCI drivers =
use a similar design pattern.  They would all have to be converted to =
using the same thing, which is kinda impractical at the moment (since =
many have additional, driver specific fields).  While the tool is kinda =
flexible enough to cope with this situation, more and more code winds up =
in the tool to cope than is appropriate for the tool.

That's why this feature is experimental.  For what it works for, it =
works great.  For everything else, it is a lot of work to make it happy =
on a wide-spread enough scale.  It is very instructive for how to =
approach things, but embeds too much knowledge of the bus code into the =
tool to generate these files than is appropriate (since it is duplicated =
information from the driver, not exported from the bus/driver).

Warner


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 16:16:43 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 728F31065670;
	Tue, 28 Jun 2011 16:16:43 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 57B868FC17;
	Tue, 28 Jun 2011 16:16:43 +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 p5SGGhUJ056617;
	Tue, 28 Jun 2011 16:16:43 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SGGhbx056614;
	Tue, 28 Jun 2011 16:16:43 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201106281616.p5SGGhbx056614@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 28 Jun 2011 16:16:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223648 - head/sys/dev/gem
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 16:16:43 -0000

Author: marius
Date: Tue Jun 28 16:16:43 2011
New Revision: 223648
URL: http://svn.freebsd.org/changeset/base/223648

Log:
  - In gem_reset_rx() also reset the RX MAC which is necessary in order to
    get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW.
  - In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX
    filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it
    consistently use the newly introduced sc_mac_rxcfg throughout the driver
    instead of reading the its old content.
  - Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation
    failure.
  - According to the GEM datasheet the RX MAC should also be disabled in
    gem_setladrf() before changing its configuration.
  - Add error messages to gem_disable_{r,t}x() and take advantage of these
    throughout the driver instead of duplicating their functionality all over
    the place.
  
  In joint forces with:	yongari

Modified:
  head/sys/dev/gem/if_gem.c
  head/sys/dev/gem/if_gemvar.h

Modified: head/sys/dev/gem/if_gem.c
==============================================================================
--- head/sys/dev/gem/if_gem.c	Tue Jun 28 15:19:45 2011	(r223647)
+++ head/sys/dev/gem/if_gem.c	Tue Jun 28 16:16:43 2011	(r223648)
@@ -121,7 +121,7 @@ static void	gem_rint_timeout(void *arg);
 #endif
 static inline void gem_rxcksum(struct mbuf *m, uint64_t flags);
 static void	gem_rxdrain(struct gem_softc *sc);
-static void	gem_setladrf(struct gem_softc *sc);
+static void	gem_setladrf(struct gem_softc *sc, u_int enable);
 static void	gem_start(struct ifnet *ifp);
 static void	gem_start_locked(struct ifnet *ifp);
 static void	gem_stop(struct ifnet *ifp, int disable);
@@ -705,7 +705,7 @@ gem_reset_rx(struct gem_softc *sc)
 	 * Resetting while DMA is in progress can cause a bus hang, so we
 	 * disable DMA first.
 	 */
-	gem_disable_rx(sc);
+	(void)gem_disable_rx(sc);
 	GEM_BANK1_WRITE_4(sc, GEM_RX_CONFIG, 0);
 	GEM_BANK1_BARRIER(sc, GEM_RX_CONFIG, 4,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
@@ -715,7 +715,7 @@ gem_reset_rx(struct gem_softc *sc)
 	/* Wait 5ms extra. */
 	DELAY(5000);
 
-	/* Finally, reset the ERX. */
+	/* Reset the ERX. */
 	GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX);
 	GEM_BANK2_BARRIER(sc, GEM_RESET, 4,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
@@ -724,6 +724,16 @@ gem_reset_rx(struct gem_softc *sc)
 		device_printf(sc->sc_dev, "cannot reset receiver\n");
 		return (1);
 	}
+
+	/* Finally, reset RX MAC. */
+	GEM_BANK1_WRITE_4(sc, GEM_MAC_RXRESET, 1);
+	GEM_BANK1_BARRIER(sc, GEM_MAC_RXRESET, 4,
+	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+	if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RXRESET, 1, 0)) {
+		device_printf(sc->sc_dev, "cannot reset RX MAC\n");
+		return (1);
+	}
+
 	return (0);
 }
 
@@ -766,12 +776,17 @@ gem_reset_rxdma(struct gem_softc *sc)
 	GEM_BANK1_WRITE_4(sc, GEM_RX_PAUSE_THRESH,
 	    (3 * sc->sc_rxfifosize / 256) |
 	    ((sc->sc_rxfifosize / 256) << 12));
+	/*
+	 * Clear the RX filter and reprogram it.  This will also set the
+	 * current RX MAC configuration.
+	 */
+	gem_setladrf(sc, 0);
 	GEM_BANK1_WRITE_4(sc, GEM_RX_CONFIG,
 	    GEM_BANK1_READ_4(sc, GEM_RX_CONFIG) | GEM_RX_CONFIG_RXDMA_EN);
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_MASK,
 	    GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT);
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG,
-	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) | GEM_MAC_RX_ENABLE);
+	    sc->sc_mac_rxcfg | GEM_MAC_RX_ENABLE);
 }
 
 static int
@@ -782,7 +797,7 @@ gem_reset_tx(struct gem_softc *sc)
 	 * Resetting while DMA is in progress can cause a bus hang, so we
 	 * disable DMA first.
 	 */
-	gem_disable_tx(sc);
+	(void)gem_disable_tx(sc);
 	GEM_BANK1_WRITE_4(sc, GEM_TX_CONFIG, 0);
 	GEM_BANK1_BARRIER(sc, GEM_TX_CONFIG, 4,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
@@ -812,8 +827,10 @@ gem_disable_rx(struct gem_softc *sc)
 	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) & ~GEM_MAC_RX_ENABLE);
 	GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	return (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE,
-	    0));
+	if (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0))
+		return (1);
+	device_printf(sc->sc_dev, "cannot disable RX MAC\n");
+	return (0);
 }
 
 static int
@@ -824,8 +841,10 @@ gem_disable_tx(struct gem_softc *sc)
 	    GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG) & ~GEM_MAC_TX_ENABLE);
 	GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	return (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE,
-	    0));
+	if (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0))
+		return (1);
+	device_printf(sc->sc_dev, "cannot disable TX MAC\n");
+	return (0);
 }
 
 static int
@@ -960,7 +979,7 @@ gem_init_locked(struct gem_softc *sc)
 	gem_init_regs(sc);
 
 	/* step 5.  RX MAC registers & counters */
-	gem_setladrf(sc);
+	gem_setladrf(sc, 0);
 
 	/* step 6 & 7.  Program Descriptor Ring Base Addresses. */
 	/* NOTE: we use only 32-bit DMA addresses here. */
@@ -1050,21 +1069,14 @@ gem_init_locked(struct gem_softc *sc)
 	/* step 12.  RX_MAC Configuration Register */
 	v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG);
 	v |= GEM_MAC_RX_ENABLE | GEM_MAC_RX_STRIP_CRC;
-	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0);
-	GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0))
-		device_printf(sc->sc_dev, "cannot configure RX MAC\n");
+	(void)gem_disable_rx(sc);
+	sc->sc_mac_rxcfg = v & ~GEM_MAC_RX_ENABLE;
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v);
 
 	/* step 13.  TX_MAC Configuration Register */
 	v = GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG);
 	v |= GEM_MAC_TX_ENABLE;
-	GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0);
-	GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0))
-		device_printf(sc->sc_dev, "cannot configure TX MAC\n");
+	(void)gem_disable_tx(sc);
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, v);
 
 	/* step 14.  Issue Transmit Pending command. */
@@ -1588,7 +1600,7 @@ gem_rint(struct gem_softc *sc)
 		 * the buffer that's already attached to this descriptor.
 		 */
 		if (gem_add_rxbuf(sc, sc->sc_rxptr) != 0) {
-			ifp->if_ierrors++;
+			ifp->if_iqdrops++;
 			GEM_INIT_RXDESC(sc, sc->sc_rxptr);
 			m = NULL;
 		}
@@ -2028,8 +2040,8 @@ gem_mii_statchg(device_t dev)
 	 * the GEM Gigabit Ethernet ASIC Specification.
 	 */
 
-	rxcfg = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG);
-	rxcfg &= ~(GEM_MAC_RX_CARR_EXTEND | GEM_MAC_RX_ENABLE);
+	rxcfg = sc->sc_mac_rxcfg;
+	rxcfg &= ~GEM_MAC_RX_CARR_EXTEND;
 	txcfg = GEM_MAC_TX_ENA_IPG0 | GEM_MAC_TX_NGU | GEM_MAC_TX_NGU_LIMIT;
 	if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) != 0)
 		txcfg |= GEM_MAC_TX_IGN_CARRIER | GEM_MAC_TX_IGN_COLLIS;
@@ -2037,17 +2049,9 @@ gem_mii_statchg(device_t dev)
 		rxcfg |= GEM_MAC_RX_CARR_EXTEND;
 		txcfg |= GEM_MAC_TX_CARR_EXTEND;
 	}
-	GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0);
-	GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0))
-		device_printf(sc->sc_dev, "cannot disable TX MAC\n");
+	(void)gem_disable_tx(sc);
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, txcfg);
-	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0);
-	GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0))
-		device_printf(sc->sc_dev, "cannot disable RX MAC\n");
+	(void)gem_disable_rx(sc);
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, rxcfg);
 
 	v = GEM_BANK1_READ_4(sc, GEM_MAC_CONTROL_CONFIG) &
@@ -2092,6 +2096,7 @@ gem_mii_statchg(device_t dev)
 		v |= GEM_MAC_XIF_FDPLX_LED;
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_XIF_CONFIG, v);
 
+	sc->sc_mac_rxcfg = rxcfg;
 	if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
 	    (sc->sc_flags & GEM_LINK) != 0) {
 		GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG,
@@ -2147,7 +2152,7 @@ gem_ioctl(struct ifnet *ifp, u_long cmd,
 			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
 			    ((ifp->if_flags ^ sc->sc_ifflags) &
 			    (IFF_ALLMULTI | IFF_PROMISC)) != 0)
-				gem_setladrf(sc);
+				gem_setladrf(sc, 1);
 			else
 				gem_init_locked(sc);
 		} else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
@@ -2164,7 +2169,8 @@ gem_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
 		GEM_LOCK(sc);
-		gem_setladrf(sc);
+		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+			gem_setladrf(sc, 1);
 		GEM_UNLOCK(sc);
 		break;
 	case SIOCGIFMEDIA:
@@ -2189,7 +2195,7 @@ gem_ioctl(struct ifnet *ifp, u_long cmd,
 }
 
 static void
-gem_setladrf(struct gem_softc *sc)
+gem_setladrf(struct gem_softc *sc, u_int enable)
 {
 	struct ifnet *ifp = sc->sc_ifp;
 	struct ifmultiaddr *inm;
@@ -2199,24 +2205,20 @@ gem_setladrf(struct gem_softc *sc)
 
 	GEM_LOCK_ASSERT(sc, MA_OWNED);
 
-	/* Get the current RX configuration. */
-	v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG);
-
 	/*
-	 * Turn off promiscuous mode, promiscuous group mode (all multicast),
-	 * and hash filter.  Depending on the case, the right bit will be
-	 * enabled.
+	 * Turn off the RX MAC and the hash filter as required by the Sun GEM
+	 * programming restrictions.
 	 */
-	v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_HASH_FILTER |
-	    GEM_MAC_RX_PROMISC_GRP);
-
+	v = sc->sc_mac_rxcfg & GEM_MAC_RX_HASH_FILTER;
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v);
 	GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER,
-	    0))
-		device_printf(sc->sc_dev, "cannot disable RX hash filter\n");
+	if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER |
+	    GEM_MAC_RX_ENABLE, 0))
+		device_printf(sc->sc_dev,
+		    "cannot disable RX MAC or hash filter\n");
 
+	v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_PROMISC_GRP);
 	if ((ifp->if_flags & IFF_PROMISC) != 0) {
 		v |= GEM_MAC_RX_PROMISCUOUS;
 		goto chipit;
@@ -2262,5 +2264,8 @@ gem_setladrf(struct gem_softc *sc)
 		    hash[i]);
 
  chipit:
+	sc->sc_mac_rxcfg = v;
+	if (enable)
+		v |= GEM_MAC_RX_ENABLE;
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v);
 }

Modified: head/sys/dev/gem/if_gemvar.h
==============================================================================
--- head/sys/dev/gem/if_gemvar.h	Tue Jun 28 15:19:45 2011	(r223647)
+++ head/sys/dev/gem/if_gemvar.h	Tue Jun 28 16:16:43 2011	(r223648)
@@ -173,6 +173,8 @@ struct gem_softc {
 	u_int		sc_rxptr;	/* next ready RX descriptor/state */
 	u_int		sc_rxfifosize;	/* RX FIFO size (bytes) */
 
+	uint32_t	sc_mac_rxcfg;	/* RX MAC conf. % GEM_MAC_RX_ENABLE */
+
 	int		sc_ifflags;
 	u_long		sc_csum_features;
 };

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 16:44:03 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1BA69106566C;
	Tue, 28 Jun 2011 16:44:03 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0BD078FC18;
	Tue, 28 Jun 2011 16:44: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 p5SGi2ju057493;
	Tue, 28 Jun 2011 16:44:02 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SGi2Lk057491;
	Tue, 28 Jun 2011 16:44:02 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201106281644.p5SGi2Lk057491@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 28 Jun 2011 16:44:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223649 - head/sys/dev/gem
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 16:44:03 -0000

Author: marius
Date: Tue Jun 28 16:44:02 2011
New Revision: 223649
URL: http://svn.freebsd.org/changeset/base/223649

Log:
  Fix typo in r223648 which was accidentally committed

Modified:
  head/sys/dev/gem/if_gem.c

Modified: head/sys/dev/gem/if_gem.c
==============================================================================
--- head/sys/dev/gem/if_gem.c	Tue Jun 28 16:16:43 2011	(r223648)
+++ head/sys/dev/gem/if_gem.c	Tue Jun 28 16:44:02 2011	(r223649)
@@ -2209,7 +2209,7 @@ gem_setladrf(struct gem_softc *sc, u_int
 	 * Turn off the RX MAC and the hash filter as required by the Sun GEM
 	 * programming restrictions.
 	 */
-	v = sc->sc_mac_rxcfg & GEM_MAC_RX_HASH_FILTER;
+	v = sc->sc_mac_rxcfg & ~GEM_MAC_RX_HASH_FILTER;
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v);
 	GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 19:59:46 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A62581065673;
	Tue, 28 Jun 2011 19:59:46 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 94DA48FC15;
	Tue, 28 Jun 2011 19:59:46 +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 p5SJxkAb063304;
	Tue, 28 Jun 2011 19:59:46 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SJxksX063301;
	Tue, 28 Jun 2011 19:59:46 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201106281959.p5SJxksX063301@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Tue, 28 Jun 2011 19:59:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223652 - head/sbin/growfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 19:59:46 -0000

Author: trasz
Date: Tue Jun 28 19:59:46 2011
New Revision: 223652
URL: http://svn.freebsd.org/changeset/base/223652

Log:
  Revert the mechanical change from 'file system' to 'filesystem', committed
  in r223429.  As bde@ pointed out, it was mostly backwards.

Modified:
  head/sbin/growfs/growfs.8
  head/sbin/growfs/growfs.c

Modified: head/sbin/growfs/growfs.8
==============================================================================
--- head/sbin/growfs/growfs.8	Tue Jun 28 19:27:34 2011	(r223651)
+++ head/sbin/growfs/growfs.8	Tue Jun 28 19:59:46 2011	(r223652)
@@ -37,12 +37,12 @@
 .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $
 .\" $FreeBSD$
 .\"
-.Dd June 22, 2011
+.Dd June 29, 2011
 .Dt GROWFS 8
 .Os
 .Sh NAME
 .Nm growfs
-.Nd expand an existing UFS filesystem
+.Nd expand an existing UFS file system
 .Sh SYNOPSIS
 .Nm
 .Op Fl Ny
@@ -58,8 +58,8 @@ Before starting
 .Nm
 the disk must be labeled to a bigger size using
 .Xr bsdlabel 8 .
-If you wish to grow a filesystem beyond the boundary of
-the slice it resides in, you must resize the slice using
+If you wish to grow a file system beyond the boundary of
+the slice it resides in, you must re-size the slice using
 .Xr gpart 8
 before running
 .Nm .
@@ -67,17 +67,17 @@ If you are using volumes you must enlarg
 .Xr gvinum 8 .
 The
 .Nm
-utility extends the size of the filesystem on the specified special file.
+utility extends the size of the file system on the specified special file.
 Currently
 .Nm
-can only enlarge unmounted filesystems.
-Do not try enlarging a mounted filesystem, your system may panic and you will
-not be able to use the filesystem any longer.
+can only enlarge unmounted file systems.
+Do not try enlarging a mounted file system, your system may panic and you will
+not be able to use the file system any longer.
 Most of the
 .Xr newfs 8
 options cannot be changed by
 .Nm .
-In fact, you can only increase the size of the filesystem.
+In fact, you can only increase the size of the file system.
 Use
 .Xr tunefs 8
 for other changes.
@@ -86,8 +86,8 @@ The following options are available:
 .Bl -tag -width indent
 .It Fl N
 .Dq Test mode .
-Causes the new filesystem parameters to be printed out without actually
-enlarging the filesystem.
+Causes the new file system parameters to be printed out without actually
+enlarging the file system.
 .It Fl y
 .Dq Expert mode .
 Usually
@@ -102,12 +102,12 @@ So use this option with great care!
 .It Fl s Ar size
 Determines the
 .Ar size
-of the filesystem after enlarging in sectors.
+of the file system after enlarging in sectors.
 This value defaults to the size of the raw partition specified in
 .Ar special
 (in other words,
 .Nm
-will enlarge the filesystem to the size of the entire partition).
+will enlarge the file system to the size of the entire partition).
 .El
 .Sh EXAMPLES
 .Dl growfs -s 4194304 /dev/vinum/testvol
@@ -122,9 +122,9 @@ up to 2GB if there is enough space in
 .Xr ffsinfo 8 ,
 .Xr fsck 8 ,
 .Xr gpart 8 ,
+.Xr gvinum 8 ,
 .Xr newfs 8 ,
-.Xr tunefs 8 ,
-.Xr gvinum 8
+.Xr tunefs 8
 .Sh HISTORY
 The
 .Nm
@@ -144,12 +144,12 @@ There may be cases on
 .Fx
 3.x only, when
 .Nm
-does not recognize properly whether or not the filesystem is mounted and
+does not recognize properly whether or not the file system is mounted and
 exits with an error message.
 Then please use
 .Nm
 .Fl y
-if you are sure that the filesystem is not mounted.
+if you are sure that the file system is not mounted.
 It is also recommended to always use
 .Xr fsck 8
 after enlarging (just to be on the safe side).
@@ -183,8 +183,8 @@ on the first cylinder group to verify th
 in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP
 .Em cgr0
 has enough blocks.
-As a rule of thumb for default filesystem parameters one block is needed for
-every 2 GB of total filesystem size.
+As a rule of thumb for default file system parameters one block is needed for
+every 2 GB of total file system size.
 .Pp
 Normally
 .Nm

Modified: head/sbin/growfs/growfs.c
==============================================================================
--- head/sbin/growfs/growfs.c	Tue Jun 28 19:27:34 2011	(r223651)
+++ head/sbin/growfs/growfs.c	Tue Jun 28 19:59:46 2011	(r223652)
@@ -160,7 +160,7 @@ static void	get_dev_size(int, int *);
 
 /* ************************************************************ growfs ***** */
 /*
- * Here we actually start growing the filesystem. We basically read the
+ * Here we actually start growing the file system. We basically read the
  * cylinder summary from the first cylinder group as we want to update
  * this on the fly during our various operations. First we handle the
  * changes in the former last cylinder group. Afterwards we create all new
@@ -231,7 +231,7 @@ growfs(int fsi, int fso, unsigned int Nf
 	updjcg(osblock.fs_ncg-1, modtime, fsi, fso, Nflag);
 
 	/*
-	 * Dump out summary information about filesystem.
+	 * Dump out summary information about file system.
 	 */
 #	define B2MBFACTOR (1 / (1024.0 * 1024.0))
 	printf("growfs: %.1fMB (%jd sectors) block size %d, fragment size %d\n",
@@ -435,7 +435,7 @@ initcg(int cylno, time_t modtime, int fs
 	if (acg.cg_nextfreeoff > (unsigned)sblock.fs_cgsize) {
 		/*
 		 * This should never happen as we would have had that panic
-		 * already on filesystem creation
+		 * already on file system creation
 		 */
 		errx(37, "panic: cylinder group too big");
 	}
@@ -446,7 +446,7 @@ initcg(int cylno, time_t modtime, int fs
 			acg.cg_cs.cs_nifree--;
 		}
 	/*
-	 * For the old filesystem, we have to initialize all the inodes.
+	 * For the old file system, we have to initialize all the inodes.
 	 */
 	if (sblock.fs_magic == FS_UFS1_MAGIC) {
 		bzero(iobuf, sblock.fs_bsize);
@@ -670,7 +670,7 @@ cond_bl_upd(ufs2_daddr_t *block, struct 
 /* ************************************************************ updjcg ***** */
 /*
  * Here we do all needed work for the former last cylinder group. It has to be
- * changed in any case, even if the filesystem ended exactly on the end of
+ * changed in any case, even if the file system ended exactly on the end of
  * this group, as there is some slightly inconsistent handling of the number
  * of cylinders in the cylinder group. We start again by reading the cylinder
  * group from disk. If the last block was not fully available, we first handle
@@ -780,7 +780,7 @@ updjcg(int cylno, time_t modtime, int fs
 	 * the rotational layout tables and the cluster summary.  This is
 	 * also done per fragment for the first new block if the old file
 	 * system end was not on a block boundary, per fragment for the new
-	 * last block if the new filesystem end is not on a block boundary,
+	 * last block if the new file system end is not on a block boundary,
 	 * and per block for all space in between.
 	 *
 	 * Handle the first new block here if it was partially available
@@ -804,7 +804,7 @@ updjcg(int cylno, time_t modtime, int fs
 			/*
 			 * Check if the fragment just created could join an
 			 * already existing fragment at the former end of the
-			 * filesystem.
+			 * file system.
 			 */
 			if(isblock(&sblock, cg_blksfree(&acg),
 			    ((osblock.fs_size - cgbase(&sblock, cylno))/
@@ -931,7 +931,7 @@ updjcg(int cylno, time_t modtime, int fs
  * Option (1) is considered to be less intrusive to the structure of the file-
  * system. So we try to stick to that whenever possible. If there is not enough
  * space in the cylinder group containing the cylinder summary we have to use
- * method (2). In case of active snapshots in the filesystem we probably can
+ * method (2). In case of active snapshots in the file system we probably can
  * completely avoid implementing copy on write if we stick to method (2) only.
  */
 static void
@@ -1287,7 +1287,7 @@ updcsloc(time_t modtime, int fsi, int fs
 		/*
 		 * No cluster handling is needed here, as there was at least
 		 * one fragment in use by the cylinder summary in the old
-		 * filesystem.
+		 * file system.
 		 * No block-free counter handling here as this block was not
 		 * a free block.
 		 */
@@ -1597,7 +1597,7 @@ wtfs(ufs2_daddr_t bno, size_t size, void
 /*
  * Here we allocate a free block in the current cylinder group. It is assumed,
  * that acg contains the current cylinder group. As we may take a block from
- * somewhere in the filesystem we have to handle cluster summary here.
+ * somewhere in the file system we have to handle cluster summary here.
  */
 static ufs2_daddr_t
 alloc(void)
@@ -1939,9 +1939,9 @@ get_dev_size(int fd, int *size)
 /* ************************************************************** main ***** */
 /*
  * growfs(8)  is a utility which allows to increase the size of an existing
- * ufs filesystem. Currently this can only be done on unmounted filesystem.
+ * ufs file system. Currently this can only be done on unmounted file system.
  * It recognizes some command line options to specify the new desired size,
- * and it does some basic checkings. The old filesystem size is determined
+ * and it does some basic checkings. The old file system size is determined
  * and after some more checks like we can really access the new last block
  * on the disk etc. we calculate the new parameters for the superblock. After
  * having done this we just call growfs() which will do the work.  Before
@@ -1953,11 +1953,11 @@ get_dev_size(int fd, int *size)
  * are lucky, then we only have to handle our blocks to be relocated in that
  * way.
  * Also we have to consider in what order we actually update the critical
- * data structures of the filesystem to make sure, that in case of a disaster
+ * data structures of the file system to make sure, that in case of a disaster
  * fsck(8) is still able to restore any lost data.
  * The foreseen last step then will be to provide for growing even mounted
- * filesystems. There we have to extend the mount() system call to provide
- * userland access to the filesystem locking facility.
+ * file systems. There we have to extend the mount() system call to provide
+ * userland access to the file system locking facility.
  */
 int
 main(int argc, char **argv)
@@ -2088,7 +2088,7 @@ main(int argc, char **argv)
     }
 
 	/*
-	 * Check if that partition is suitable for growing a filesystem.
+	 * Check if that partition is suitable for growing a file system.
 	 */
 	if (p_size < 1) {
 		errx(1, "partition is unavailable");
@@ -2146,7 +2146,7 @@ main(int argc, char **argv)
 	if(ExpertFlag == 0) {
 		for(j=0; j
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3260F106566C;
	Tue, 28 Jun 2011 20:57:55 +0000 (UTC)
	(envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 227D98FC15;
	Tue, 28 Jun 2011 20:57:55 +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 p5SKvtHW065253;
	Tue, 28 Jun 2011 20:57:55 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SKvtXX065251;
	Tue, 28 Jun 2011 20:57:55 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201106282057.p5SKvtXX065251@svn.freebsd.org>
From: Mikolaj Golub 
Date: Tue, 28 Jun 2011 20:57:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223654 - head/sbin/hastd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 20:57:55 -0000

Author: trociny
Date: Tue Jun 28 20:57:54 2011
New Revision: 223654
URL: http://svn.freebsd.org/changeset/base/223654

Log:
  Make activemap_write_start/complete check the keepdirty list, when
  stating if we need to update activemap on disk. This makes keepdirty
  serve its purpose -- to reduce number of metadata updates.
  
  Discussed with:	pjd
  Approved by:	pjd (mentor)

Modified:
  head/sbin/hastd/activemap.c

Modified: head/sbin/hastd/activemap.c
==============================================================================
--- head/sbin/hastd/activemap.c	Tue Jun 28 20:28:11 2011	(r223653)
+++ head/sbin/hastd/activemap.c	Tue Jun 28 20:57:54 2011	(r223654)
@@ -205,7 +205,7 @@ keepdirty_find(struct activemap *amp, in
 	return (kd);
 }
 
-static void
+static bool
 keepdirty_add(struct activemap *amp, int extent)
 {
 	struct keepdirty *kd;
@@ -217,7 +217,7 @@ keepdirty_add(struct activemap *amp, int
 		 */
 		TAILQ_REMOVE(&->am_keepdirty, kd, kd_next);
 		TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next);
-		return;
+		return (false);
 	}
 	/*
 	 * Add new element, but first remove the most unused one if
@@ -238,6 +238,8 @@ keepdirty_add(struct activemap *amp, int
 		amp->am_nkeepdirty++;
 		TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next);
 	}
+
+	return (true);
 }
 
 static void
@@ -308,9 +310,9 @@ activemap_write_start(struct activemap *
 			assert(!bit_test(amp->am_memmap, ext));
 			bit_set(amp->am_memmap, ext);
 			amp->am_ndirty++;
-			modified = true;
 		}
-		keepdirty_add(amp, ext);
+		if (keepdirty_add(amp, ext))
+			modified = true;
 	}
 
 	return (modified);
@@ -345,7 +347,8 @@ activemap_write_complete(struct activema
 		if (--amp->am_memtab[ext] == 0) {
 			bit_clear(amp->am_memmap, ext);
 			amp->am_ndirty--;
-			modified = true;
+			if (keepdirty_find(amp, ext) == NULL)
+				modified = true;
 		}
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 21:01:32 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C9635106566C;
	Tue, 28 Jun 2011 21:01:32 +0000 (UTC)
	(envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B9F498FC1F;
	Tue, 28 Jun 2011 21:01:32 +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 p5SL1WUj065419;
	Tue, 28 Jun 2011 21:01:32 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SL1WPP065417;
	Tue, 28 Jun 2011 21:01:32 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201106282101.p5SL1WPP065417@svn.freebsd.org>
From: Mikolaj Golub 
Date: Tue, 28 Jun 2011 21:01:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223655 - head/sbin/hastd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 21:01:32 -0000

Author: trociny
Date: Tue Jun 28 21:01:32 2011
New Revision: 223655
URL: http://svn.freebsd.org/changeset/base/223655

Log:
  Check the returned value of activemap_write_complete() and update matadata on
  disk if needed. This should fix a potential case when extents are cleared in
  activemap but metadata is not updated on disk.
  
  Suggested by:	pjd
  Approved by:	pjd (mentor)

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c	Tue Jun 28 20:57:54 2011	(r223654)
+++ head/sbin/hastd/primary.c	Tue Jun 28 21:01:32 2011	(r223655)
@@ -1687,8 +1687,11 @@ ggate_send_thread(void *arg)
 		}
 		if (ggio->gctl_error == 0 && ggio->gctl_cmd == BIO_WRITE) {
 			mtx_lock(&res->hr_amp_lock);
-			activemap_write_complete(res->hr_amp,
-			    ggio->gctl_offset, ggio->gctl_length);
+			if (activemap_write_complete(res->hr_amp,
+				ggio->gctl_offset, ggio->gctl_length)) {
+				res->hr_stat_activemap_update++;
+				(void)hast_activemap_flush(res);
+			}
 			mtx_unlock(&res->hr_amp_lock);
 		}
 		if (ggio->gctl_cmd == BIO_WRITE) {

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 28 22:52:39 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4DDAF106566B;
	Tue, 28 Jun 2011 22:52:39 +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 33A508FC12;
	Tue, 28 Jun 2011 22:52:39 +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 p5SMqdJc068808;
	Tue, 28 Jun 2011 22:52:39 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5SMqdSi068804;
	Tue, 28 Jun 2011 22:52:39 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201106282252.p5SMqdSi068804@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 28 Jun 2011 22:52:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223657 - in head/sys/fs: nfs nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 28 Jun 2011 22:52:39 -0000

Author: rmacklem
Date: Tue Jun 28 22:52:38 2011
New Revision: 223657
URL: http://svn.freebsd.org/changeset/base/223657

Log:
  Fix the new NFSv4 client so that it doesn't fill the cached
  mode attribute in as 0 when doing writes. The change adds
  the Mode attribute plus the others except Owner and Owner_group
  to the list requested by the NFSv4 Write Operation. This fixed
  a problem where an executable file built by "cc" would get mode
  0111 instead of 0755 for some NFSv4 servers.
  Found at the recent NFSv4 interoperability Bakeathon.
  
  Tested by:	tdh at excfb.com
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfs/nfsproto.h
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfs_clrpcops.c

Modified: head/sys/fs/nfs/nfsproto.h
==============================================================================
--- head/sys/fs/nfs/nfsproto.h	Tue Jun 28 21:21:10 2011	(r223656)
+++ head/sys/fs/nfs/nfsproto.h	Tue Jun 28 22:52:38 2011	(r223657)
@@ -868,15 +868,24 @@ struct nfsv3_sattr {
  * NFSATTRBIT_WRITEGETATTR0 - bits 0<->31
  */
 #define	NFSATTRBIT_WRITEGETATTR0					\
- 	(NFSATTRBM_CHANGE |						\
+ 	(NFSATTRBM_SUPPORTEDATTRS |					\
+ 	NFSATTRBM_TYPE |						\
+ 	NFSATTRBM_CHANGE |						\
  	NFSATTRBM_SIZE |						\
- 	NFSATTRBM_FSID)
+ 	NFSATTRBM_FSID |						\
+ 	NFSATTRBM_FILEID |						\
+ 	NFSATTRBM_MAXREAD)
 
 /*
  * NFSATTRBIT_WRITEGETATTR1 - bits 32<->63
  */
 #define	NFSATTRBIT_WRITEGETATTR1					\
- 	(NFSATTRBM_TIMEMETADATA |					\
+ 	(NFSATTRBM_MODE |						\
+ 	NFSATTRBM_NUMLINKS |						\
+ 	NFSATTRBM_RAWDEV |						\
+ 	NFSATTRBM_SPACEUSED |						\
+ 	NFSATTRBM_TIMEACCESS |						\
+ 	NFSATTRBM_TIMEMETADATA |					\
  	NFSATTRBM_TIMEMODIFY)
 
 /*

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Tue Jun 28 21:21:10 2011	(r223656)
+++ head/sys/fs/nfsclient/nfs_clport.c	Tue Jun 28 22:52:38 2011	(r223657)
@@ -388,6 +388,7 @@ nfscl_loadattrcache(struct vnode **vpp, 
 		np->n_vattr.na_mtime = nap->na_mtime;
 		np->n_vattr.na_ctime = nap->na_ctime;
 		np->n_vattr.na_fsid = nap->na_fsid;
+		np->n_vattr.na_mode = nap->na_mode;
 	} else {
 		NFSBCOPY((caddr_t)nap, (caddr_t)&np->n_vattr,
 		    sizeof (struct nfsvattr));

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clrpcops.c	Tue Jun 28 21:21:10 2011	(r223656)
+++ head/sys/fs/nfsclient/nfs_clrpcops.c	Tue Jun 28 22:52:38 2011	(r223657)
@@ -1527,8 +1527,8 @@ nfsrpc_writerpc(vnode_t vp, struct uio *
 		 * deadlock, is that the upcall times out and allows
 		 * the write to complete. However, progress is so slow
 		 * that it might just as well be deadlocked.
-		 * So, we just get the attributes that change with each
-		 * write Op.
+		 * As such, we get the rest of the attributes, but not
+		 * Owner or Owner_group.
 		 * nb: nfscl_loadattrcache() needs to be told that these
 		 *     partial attributes from a write rpc are being
 		 *     passed in, via a argument flag.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 00:53:16 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C00F0106566C
	for ; Wed, 29 Jun 2011 00:53:16 +0000 (UTC)
	(envelope-from gerald@pfeifer.com)
Received: from relay01.pair.com (relay01.pair.com [209.68.5.15])
	by mx1.freebsd.org (Postfix) with SMTP id 7E20D8FC0C
	for ; Wed, 29 Jun 2011 00:53:16 +0000 (UTC)
Received: (qmail 28000 invoked from network); 29 Jun 2011 00:26:32 -0000
Received: from 109.43.28.197 (HELO ip-109-43-28-197.web.vodafone.de)
	(109.43.28.197)
	by relay01.pair.com with SMTP; 29 Jun 2011 00:26:32 -0000
X-pair-Authenticated: 109.43.28.197
Date: Wed, 29 Jun 2011 02:26:31 +0200 (CEST)
From: Gerald Pfeifer 
To: Andriy Gapon 
In-Reply-To: <4DEC748A.8000204@FreeBSD.org>
Message-ID: 
References: <201106052101.p55L1feL097420@svn.freebsd.org>
	<86zklwezwb.fsf@gmail.com> <4DEC748A.8000204@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Gerald Pfeifer ,
	Pan Tsu 
Subject: Re: svn commit: r222723 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 00:53:16 -0000

On Mon, 6 Jun 2011, Andriy Gapon wrote:
> Woops!  I admit I just copied the description and the patch from the PR.
> How inattentive I could be while doing that?
> 
> Gerald, should the patch have actually introduced SNDCTL_DSP_HALT as the
> description says?

Yikes!  You are totally right, Pan Tsu and Andriy.

Below you'll find the corresponding patch I got into Wine upstream,
so clearly this should have been about SNDCTL_DSP_HALT.

Sorry about the snafu on this and the delay in getting back to this;
in between business travel and vacation I haven't been home for more
than three weeks.

Gerald

==== patch ====
From: Gerald Pfeifer 
To: wine-patches@winehq.org
Cc: Andrew Eikum 
Date: Thu, 19 May 2011 08:24:23 -0600 (MDT)
Subject: wineoss.drv: Cope with system which lack SNDCTL_DSP_HALT.

This is the last patch that is necessary to make vanilla Wine build
on current versions of FreeBSD.

I will also send a summary in response to Andrew's question around
this

Gerald
---
 dlls/wineoss.drv/mmdevdrv.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index 7dec1e0..0edcb25 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -53,6 +53,13 @@
 #include "audiopolicy.h"
 #include "audioclient.h"
 
+
+/* Some implementations of OSS, such as FreeBSD older than 9.0, lack
+   SNDCTL_DSP_HALT which is just a synonym for the older SNDCTL_DSP_RESET. */
+#ifndef SNDCTL_DSP_HALT
+#define SNDCTL_DSP_HALT SNDCTL_DSP_RESET
+#endif
+
 WINE_DEFAULT_DEBUG_CHANNEL(oss);
 
 #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
-- 
1.7.4.1

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 05:41:15 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 306191065670;
	Wed, 29 Jun 2011 05:41:15 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 15F5F8FC12;
	Wed, 29 Jun 2011 05:41:15 +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 p5T5fEgi081098;
	Wed, 29 Jun 2011 05:41:14 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5T5fEhP081096;
	Wed, 29 Jun 2011 05:41:14 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201106290541.p5T5fEhP081096@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Wed, 29 Jun 2011 05:41:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223660 - head/sys/geom/part
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 05:41:15 -0000

Author: ae
Date: Wed Jun 29 05:41:14 2011
New Revision: 223660
URL: http://svn.freebsd.org/changeset/base/223660

Log:
  Initialize elements of state array when creating the GPT table.
  This fixes the problem, when the secondary GPT header is not erased when
  partition table destroyed. Move equal operations from g_part_gpt_create
  and g_part_gpt_recover to the separate function g_gpt_set_defaults.
  
  Reported by:	dwhite
  MFC after:	1 week

Modified:
  head/sys/geom/part/g_part_gpt.c

Modified: head/sys/geom/part/g_part_gpt.c
==============================================================================
--- head/sys/geom/part/g_part_gpt.c	Wed Jun 29 01:32:50 2011	(r223659)
+++ head/sys/geom/part/g_part_gpt.c	Wed Jun 29 05:41:14 2011	(r223660)
@@ -88,6 +88,7 @@ struct g_part_gpt_entry {
 
 static void g_gpt_printf_utf16(struct sbuf *, uint16_t *, size_t);
 static void g_gpt_utf8_to_utf16(const uint8_t *, uint16_t *, size_t);
+static void g_gpt_set_defaults(struct g_part_table *, struct g_provider *);
 
 static int g_part_gpt_add(struct g_part_table *, struct g_part_entry *,
     struct g_part_parms *);
@@ -493,12 +494,7 @@ g_part_gpt_create(struct g_part_table *b
 	table->mbr[DOSPARTOFF + 6] = 0xff;		/* esect */
 	table->mbr[DOSPARTOFF + 7] = 0xff;		/* ecyl */
 	le32enc(table->mbr + DOSPARTOFF + 8, 1);	/* start */
-	le32enc(table->mbr + DOSPARTOFF + 12, MIN(last, 0xffffffffLL));
-
-	table->lba[GPT_ELT_PRIHDR] = 1;
-	table->lba[GPT_ELT_PRITBL] = 2;
-	table->lba[GPT_ELT_SECHDR] = last;
-	table->lba[GPT_ELT_SECTBL] = last - tblsz;
+	le32enc(table->mbr + DOSPARTOFF + 12, MIN(last, UINT32_MAX));
 
 	/* Allocate space for the header */
 	table->hdr = g_malloc(sizeof(struct gpt_hdr), M_WAITOK | M_ZERO);
@@ -506,14 +502,11 @@ g_part_gpt_create(struct g_part_table *b
 	bcopy(GPT_HDR_SIG, table->hdr->hdr_sig, sizeof(table->hdr->hdr_sig));
 	table->hdr->hdr_revision = GPT_HDR_REVISION;
 	table->hdr->hdr_size = offsetof(struct gpt_hdr, padding);
-	table->hdr->hdr_lba_start = 2 + tblsz;
-	table->hdr->hdr_lba_end = last - tblsz - 1;
 	kern_uuidgen(&table->hdr->hdr_uuid, 1);
 	table->hdr->hdr_entries = basetable->gpt_entries;
 	table->hdr->hdr_entsz = sizeof(struct gpt_ent);
 
-	basetable->gpt_first = table->hdr->hdr_lba_start;
-	basetable->gpt_last = table->hdr->hdr_lba_end;
+	g_gpt_set_defaults(basetable, pp);
 	return (0);
 }
 
@@ -815,32 +808,10 @@ g_part_gpt_read(struct g_part_table *bas
 static int
 g_part_gpt_recover(struct g_part_table *basetable)
 {
-	struct g_part_gpt_table *table;
-	struct g_provider *pp;
-	uint64_t last;
-	size_t tblsz;
-
-	table = (struct g_part_gpt_table *)basetable;
-	pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider;
-	last = pp->mediasize / pp->sectorsize - 1;
-	tblsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz +
-	    pp->sectorsize - 1) / pp->sectorsize;
-
-	table->lba[GPT_ELT_PRIHDR] = 1;
-	table->lba[GPT_ELT_PRITBL] = 2;
-	table->lba[GPT_ELT_SECHDR] = last;
-	table->lba[GPT_ELT_SECTBL] = last - tblsz;
-	table->state[GPT_ELT_PRIHDR] = GPT_STATE_OK;
-	table->state[GPT_ELT_PRITBL] = GPT_STATE_OK;
-	table->state[GPT_ELT_SECHDR] = GPT_STATE_OK;
-	table->state[GPT_ELT_SECTBL] = GPT_STATE_OK;
-	table->hdr->hdr_lba_start = 2 + tblsz;
-	table->hdr->hdr_lba_end = last - tblsz - 1;
 
-	basetable->gpt_first = table->hdr->hdr_lba_start;
-	basetable->gpt_last = table->hdr->hdr_lba_end;
+	g_gpt_set_defaults(basetable,
+	    LIST_FIRST(&basetable->gpt_gp->consumer)->provider);
 	basetable->gpt_corrupt = 0;
-
 	return (0);
 }
 
@@ -1039,6 +1010,34 @@ g_part_gpt_write(struct g_part_table *ba
 }
 
 static void
+g_gpt_set_defaults(struct g_part_table *basetable, struct g_provider *pp)
+{
+	struct g_part_gpt_table *table;
+	quad_t last;
+	size_t tblsz;
+
+	table = (struct g_part_gpt_table *)basetable;
+	last = pp->mediasize / pp->sectorsize - 1;
+	tblsz = (basetable->gpt_entries * sizeof(struct gpt_ent) +
+	    pp->sectorsize - 1) / pp->sectorsize;
+
+	table->lba[GPT_ELT_PRIHDR] = 1;
+	table->lba[GPT_ELT_PRITBL] = 2;
+	table->lba[GPT_ELT_SECHDR] = last;
+	table->lba[GPT_ELT_SECTBL] = last - tblsz;
+	table->state[GPT_ELT_PRIHDR] = GPT_STATE_OK;
+	table->state[GPT_ELT_PRITBL] = GPT_STATE_OK;
+	table->state[GPT_ELT_SECHDR] = GPT_STATE_OK;
+	table->state[GPT_ELT_SECTBL] = GPT_STATE_OK;
+
+	table->hdr->hdr_lba_start = 2 + tblsz;
+	table->hdr->hdr_lba_end = last - tblsz - 1;
+
+	basetable->gpt_first = table->hdr->hdr_lba_start;
+	basetable->gpt_last = table->hdr->hdr_lba_end;
+}
+
+static void
 g_gpt_printf_utf16(struct sbuf *sb, uint16_t *str, size_t len)
 {
 	u_int bo;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 06:45:44 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9ABCF1065674;
	Wed, 29 Jun 2011 06:45:44 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8AFAB8FC18;
	Wed, 29 Jun 2011 06:45:44 +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 p5T6jiKs082951;
	Wed, 29 Jun 2011 06:45:44 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5T6jioe082949;
	Wed, 29 Jun 2011 06:45:44 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201106290645.p5T6jioe082949@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Wed, 29 Jun 2011 06:45:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223661 - head/sbin/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 06:45:44 -0000

Author: ae
Date: Wed Jun 29 06:45:44 2011
New Revision: 223661
URL: http://svn.freebsd.org/changeset/base/223661

Log:
  Improve error reporting. Use corresponding error message when file to be
  preprocessed is missing. Also suggest to use absolute pathname if -p option
  is specified.
  
  PR:             bin/156653
  MFC after:      2 weeks

Modified:
  head/sbin/ipfw/main.c

Modified: head/sbin/ipfw/main.c
==============================================================================
--- head/sbin/ipfw/main.c	Wed Jun 29 05:41:14 2011	(r223660)
+++ head/sbin/ipfw/main.c	Wed Jun 29 06:45:44 2011	(r223661)
@@ -262,7 +262,7 @@ ipfw_main(int oldac, char **oldav)
 	save_av = av;
 
 	optind = optreset = 1;	/* restart getopt() */
-	while ((ch = getopt(ac, av, "abcdefhinNqs:STtv")) != -1)
+	while ((ch = getopt(ac, av, "abcdefhinNp:qs:STtv")) != -1)
 		switch (ch) {
 		case 'a':
 			do_acct = 1;
@@ -306,6 +306,10 @@ ipfw_main(int oldac, char **oldav)
 			co.do_resolv = 1;
 			break;
 
+		case 'p':
+			errx(EX_USAGE, "An absolute pathname must be used "
+			    "with -p option.");
+
 		case 'q':
 			co.do_quiet = 1;
 			break;
@@ -603,9 +607,12 @@ main(int ac, char *av[])
 	 * as a file to be preprocessed.
 	 */
 
-	if (ac > 1 && av[ac - 1][0] == '/' && access(av[ac - 1], R_OK) == 0)
-		ipfw_readfile(ac, av);
-	else {
+	if (ac > 1 && av[ac - 1][0] == '/') {
+		if (access(av[ac - 1], R_OK) == 0)
+			ipfw_readfile(ac, av);
+		else
+			err(EX_USAGE, "pathname: %s", av[ac - 1]);
+	} else {
 		if (ipfw_main(ac, av)) {
 			errx(EX_USAGE,
 			    "usage: ipfw [options]\n"

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 08:28:39 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81EA1106566B;
	Wed, 29 Jun 2011 08:28:39 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 726E08FC13;
	Wed, 29 Jun 2011 08:28:39 +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 p5T8SdER086016;
	Wed, 29 Jun 2011 08:28:39 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5T8SdGB086014;
	Wed, 29 Jun 2011 08:28:39 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201106290828.p5T8SdGB086014@svn.freebsd.org>
From: Andriy Gapon 
Date: Wed, 29 Jun 2011 08:28:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223662 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 08:28:39 -0000

Author: avg
Date: Wed Jun 29 08:28:39 2011
New Revision: 223662
URL: http://svn.freebsd.org/changeset/base/223662

Log:
  revert r222723: wrong change was committed
  
  The commit intended to add SNDCTL_DSP_HALT, but actually added
  SNDCTL_SEQ_HALT, which is not defined in the OSS specs.
  
  Reported by:	Pan Tsu 
  Pointyhat to:	gerald, avg

Modified:
  head/sys/sys/soundcard.h

Modified: head/sys/sys/soundcard.h
==============================================================================
--- head/sys/sys/soundcard.h	Wed Jun 29 06:45:44 2011	(r223661)
+++ head/sys/sys/soundcard.h	Wed Jun 29 08:28:39 2011	(r223662)
@@ -311,8 +311,7 @@ typedef struct _snd_capabilities {
  * IOCTL Commands for /dev/sequencer
  */
 
-#define SNDCTL_SEQ_HALT		_IO  ('Q', 0)
-#define SNDCTL_SEQ_RESET	SNDCTL_SEQ_HALT	/* Historic interface */
+#define SNDCTL_SEQ_RESET	_IO  ('Q', 0)
 #define SNDCTL_SEQ_SYNC		_IO  ('Q', 1)
 #define SNDCTL_SYNTH_INFO	_IOWR('Q', 2, struct synth_info)
 #define SNDCTL_SEQ_CTRLRATE	_IOWR('Q', 3, int) /* Set/get timer res.(hz) */

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 08:32:37 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF5B6106566C;
	Wed, 29 Jun 2011 08:32:37 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E06758FC17;
	Wed, 29 Jun 2011 08:32:37 +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 p5T8Wbm2086227;
	Wed, 29 Jun 2011 08:32:37 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5T8Wbrv086225;
	Wed, 29 Jun 2011 08:32:37 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201106290832.p5T8Wbrv086225@svn.freebsd.org>
From: Andriy Gapon 
Date: Wed, 29 Jun 2011 08:32:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223663 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 08:32:38 -0000

Author: avg
Date: Wed Jun 29 08:32:37 2011
New Revision: 223663
URL: http://svn.freebsd.org/changeset/base/223663

Log:
  add SNDCTL_DSP_HALT specified by OSS
  
  This is really a new name for SNDCTL_DSP_RESET.
  And this what commit r222723 should really have been in the first place.
  
  PR:		kern/156874
  Submitted by:	gerald
  MFC after:	1 week

Modified:
  head/sys/sys/soundcard.h

Modified: head/sys/sys/soundcard.h
==============================================================================
--- head/sys/sys/soundcard.h	Wed Jun 29 08:28:39 2011	(r223662)
+++ head/sys/sys/soundcard.h	Wed Jun 29 08:32:37 2011	(r223663)
@@ -775,7 +775,8 @@ typedef struct {
  * IOCTL commands for /dev/dsp and /dev/audio
  */
 
-#define SNDCTL_DSP_RESET	_IO  ('P', 0)
+#define SNDCTL_DSP_HALT		_IO  ('P', 0)
+#define SNDCTL_DSP_RESET	SNDCTL_DSP_HALT
 #define SNDCTL_DSP_SYNC		_IO  ('P', 1)
 #define SNDCTL_DSP_SPEED	_IOWR('P', 2, int)
 #define SNDCTL_DSP_STEREO	_IOWR('P', 3, int)

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 09:35:40 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A51DF106564A;
	Wed, 29 Jun 2011 09:35:40 +0000 (UTC)
	(envelope-from kevlo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 95AAD8FC0C;
	Wed, 29 Jun 2011 09:35:40 +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 p5T9ZekU088180;
	Wed, 29 Jun 2011 09:35:40 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5T9ZeWQ088178;
	Wed, 29 Jun 2011 09:35:40 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <201106290935.p5T9ZeWQ088178@svn.freebsd.org>
From: Kevin Lo 
Date: Wed, 29 Jun 2011 09:35:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223665 - head/sys/arm/mv
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 09:35:40 -0000

Author: kevlo
Date: Wed Jun 29 09:35:40 2011
New Revision: 223665
URL: http://svn.freebsd.org/changeset/base/223665

Log:
  Typo
  
  Submitted by:	Damjan Marion 
  MFC after:	3 days

Modified:
  head/sys/arm/mv/common.c

Modified: head/sys/arm/mv/common.c
==============================================================================
--- head/sys/arm/mv/common.c	Wed Jun 29 08:50:57 2011	(r223664)
+++ head/sys/arm/mv/common.c	Wed Jun 29 09:35:40 2011	(r223665)
@@ -122,7 +122,7 @@ static struct soc_node_spec soc_nodes[] 
 	{ "mrvl,sata", &decode_win_sata_setup, NULL },
 	{ "mrvl,xor", &decode_win_xor_setup, &decode_win_xor_dump },
 	{ "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump },
-	{ "mvrl,pcie", &decode_win_pcie_setup, NULL },
+	{ "mrvl,pcie", &decode_win_pcie_setup, NULL },
 	{ NULL, NULL, NULL },
 };
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 10:06:59 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2EFC5106566C;
	Wed, 29 Jun 2011 10:06:59 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E1078FC0C;
	Wed, 29 Jun 2011 10:06: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 p5TA6xxH089173;
	Wed, 29 Jun 2011 10:06:59 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TA6w0m089164;
	Wed, 29 Jun 2011 10:06:58 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201106291006.p5TA6w0m089164@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Wed, 29 Jun 2011 10:06:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223666 - in head: sbin/ipfw sys/netinet
	sys/netinet/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 10:06:59 -0000

Author: ae
Date: Wed Jun 29 10:06:58 2011
New Revision: 223666
URL: http://svn.freebsd.org/changeset/base/223666

Log:
  Add new rule actions "call" and "return" to ipfw. They make
  possible to organize subroutines with rules.
  
  The "call" action saves the current rule number in the internal
  stack and rules processing continues from the first rule with
  specified number (similar to skipto action). If later a rule with
  "return" action is encountered, the processing returns to the first
  rule with number of "call" rule saved in the stack plus one or higher.
  
  Submitted by:	Vadim Goncharov
  Discussed by:	ipfw@, luigi@

Modified:
  head/sbin/ipfw/ipfw.8
  head/sbin/ipfw/ipfw2.c
  head/sbin/ipfw/ipfw2.h
  head/sys/netinet/ip_fw.h
  head/sys/netinet/ip_var.h
  head/sys/netinet/ipfw/ip_fw2.c
  head/sys/netinet/ipfw/ip_fw_log.c
  head/sys/netinet/ipfw/ip_fw_sockopt.c

Modified: head/sbin/ipfw/ipfw.8
==============================================================================
--- head/sbin/ipfw/ipfw.8	Wed Jun 29 09:35:40 2011	(r223665)
+++ head/sbin/ipfw/ipfw.8	Wed Jun 29 10:06:58 2011	(r223666)
@@ -1,7 +1,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 14, 2011
+.Dd June 29, 2011
 .Dt IPFW 8
 .Os
 .Sh NAME
@@ -822,6 +822,78 @@ skipto, but care should be used, as no d
 is possible in this case so the rules are always walked to find it,
 starting from the 
 .Cm skipto .
+.It Cm call Ar number | tablearg
+The current rule number is saved in the internal stack and
+ruleset processing continues with the first rule numbered
+.Ar number
+or higher.
+If later a rule with the
+.Cm return
+action is encountered, the processing returns to the first rule
+with number of this
+.Cm call
+rule plus one or higher
+(the same behaviour as with packets returning from
+.Xr divert 4
+socket after a
+.Cm divert
+action).
+This could be used to make somewhat like an assembly language
+.Dq subroutine
+calls to rules with common checks for different interfaces, etc.
+.Pp
+Rule with any number could be called, not just forward jumps as with
+.Cm skipto .
+So, to prevent endless loops in case of mistakes, both
+.Cm call
+and
+.Cm return
+actions don't do any jumps and simply go to the next rule if memory
+can't be allocated or stack overflowed/undeflowed.
+.Pp
+Internally stack for rule numbers is implemented using
+.Xr mbuf_tags 9
+facility and currently has size of 16 entries.
+As mbuf tags are lost when packet leaves the kernel,
+.Cm divert
+should not be used in subroutines to avoid endless loops
+and other undesired effects.
+.It Cm return
+Takes rule number saved to internal stack by the last
+.Cm call
+action and returns ruleset processing to the first rule
+with number greater than number of corresponding
+.Cm call
+rule. See description of the
+.Cm call
+action for more details.
+.Pp
+Note that
+.Cm return
+rules usually end a
+.Dq subroutine
+and thus are unconditional, but
+.Nm
+command-line utility currently requires every action except
+.Cm check-state
+to have body.
+While it is sometimes useful to return only on some packets,
+usually you want to print just
+.Dq return
+for readability.
+A workaround for this is to use new syntax and
+.Fl c
+switch:
+.Pp
+.Bd -literal -offset indent
+# Add a rule without actual body
+ipfw add 2999 return via any
+
+# List rules without "from any to any" part
+ipfw -c list
+.Ed
+.Pp
+This cosmetic annoyance may be fixed in future releases.
 .It Cm tee Ar port
 Send a copy of packets matching this rule to the
 .Xr divert 4
@@ -3253,3 +3325,18 @@ for the respective conversations.
 To avoid failures of network error detection and path MTU discovery,
 ICMP error messages may need to be allowed explicitly through static
 rules.
+.Pp
+Rules using
+.Cm call
+and
+.Cm return
+actions may lead to confusing behaviour if ruleset has mistakes,
+and/or interaction with other subsystems (netgraph, dummynet, etc.) is used.
+One possible case for this is packet leaving
+.Nm
+in subroutine on the input pass, while later on output encountering unpaired
+.Cm return
+first.
+As the call stack is kept intact after input pass, packet will suddenly
+return to the rule number used on input pass, not on output one.
+Order of processing should be checked carefully to avoid such mistakes.

Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c	Wed Jun 29 09:35:40 2011	(r223665)
+++ head/sbin/ipfw/ipfw2.c	Wed Jun 29 10:06:58 2011	(r223666)
@@ -214,6 +214,8 @@ static struct _s_x rule_actions[] = {
 	{ "nat",		TOK_NAT },
 	{ "reass",		TOK_REASS },
 	{ "setfib",		TOK_SETFIB },
+	{ "call",		TOK_CALL },
+	{ "return",		TOK_RETURN },
 	{ NULL, 0 }	/* terminator */
 };
 
@@ -1136,6 +1138,13 @@ show_ipfw(struct ip_fw *rule, int pcwidt
 			printf("reass");
 			break;
 
+		case O_CALLRETURN:
+			if (cmd->len & F_NOT)
+				printf("return");
+			else
+				PRINT_UINT_ARG("call ", cmd->arg1);
+			break;
+
 		default:
 			printf("** unrecognized action %d len %d ",
 				cmd->opcode, cmd->len);
@@ -2771,6 +2780,9 @@ ipfw_add(char *av[])
 		goto chkarg;
 	case TOK_TEE:
 		action->opcode = O_TEE;
+		goto chkarg;
+	case TOK_CALL:
+		action->opcode = O_CALLRETURN;
 chkarg:
 		if (!av[0])
 			errx(EX_USAGE, "missing argument for %s", *(av - 1));
@@ -2863,6 +2875,10 @@ chkarg:
 		action->opcode = O_REASS;
 		break;
 
+	case TOK_RETURN:
+		fill_cmd(action, O_CALLRETURN, F_NOT, 0);
+		break;
+
 	default:
 		errx(EX_DATAERR, "invalid action %s\n", av[-1]);
 	}

Modified: head/sbin/ipfw/ipfw2.h
==============================================================================
--- head/sbin/ipfw/ipfw2.h	Wed Jun 29 09:35:40 2011	(r223665)
+++ head/sbin/ipfw/ipfw2.h	Wed Jun 29 10:06:58 2011	(r223666)
@@ -99,6 +99,8 @@ enum tokens {
 	TOK_CHECKSTATE,
 	TOK_NAT,
 	TOK_REASS,
+	TOK_CALL,
+	TOK_RETURN,
 
 	TOK_ALTQ,
 	TOK_LOG,

Modified: head/sys/netinet/ip_fw.h
==============================================================================
--- head/sys/netinet/ip_fw.h	Wed Jun 29 09:35:40 2011	(r223665)
+++ head/sys/netinet/ip_fw.h	Wed Jun 29 10:06:58 2011	(r223666)
@@ -57,6 +57,12 @@
 #define IP_FW_TABLEARG		65535	/* XXX should use 0 */
 
 /*
+ * Number of entries in the call stack of the call/return commands.
+ * Call stack currently is an uint16_t array with rule numbers.
+ */
+#define	IPFW_CALLSTACK_SIZE	16
+
+/*
  * The kernel representation of ipfw rules is made of a list of
  * 'instructions' (for all practical purposes equivalent to BPF
  * instructions), which specify which fields of the packet
@@ -195,6 +201,8 @@ enum ipfw_opcodes {		/* arguments (4 byt
 	
 	O_SOCKARG,		/* socket argument */
 
+	O_CALLRETURN,		/* arg1=called rule number */
+
 	O_LAST_OPCODE		/* not an opcode!		*/
 };
 

Modified: head/sys/netinet/ip_var.h
==============================================================================
--- head/sys/netinet/ip_var.h	Wed Jun 29 09:35:40 2011	(r223665)
+++ head/sys/netinet/ip_var.h	Wed Jun 29 10:06:58 2011	(r223666)
@@ -286,6 +286,7 @@ enum {
 };
 #define MTAG_IPFW	1148380143	/* IPFW-tagged cookie */
 #define MTAG_IPFW_RULE	1262273568	/* rule reference */
+#define	MTAG_IPFW_CALL	1308397630	/* call stack */
 
 struct ip_fw_args;
 typedef int	(*ip_fw_chk_ptr_t)(struct ip_fw_args *args);

Modified: head/sys/netinet/ipfw/ip_fw2.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw2.c	Wed Jun 29 09:35:40 2011	(r223665)
+++ head/sys/netinet/ipfw/ip_fw2.c	Wed Jun 29 10:06:58 2011	(r223666)
@@ -2095,6 +2095,123 @@ do {								\
 			    continue;
 			    break;	/* not reached */
 
+			case O_CALLRETURN: {
+				/*
+				 * Implementation of `subroutine' call/return,
+				 * in the stack carried in an mbuf tag. This
+				 * is different from `skipto' in that any call
+				 * address is possible (`skipto' must prevent
+				 * backward jumps to avoid endless loops).
+				 * We have `return' action when F_NOT flag is
+				 * present. The `m_tag_id' field is used as
+				 * stack pointer.
+				 */
+				struct m_tag *mtag;
+				uint16_t jmpto, *stack;
+
+#define	IS_CALL		((cmd->len & F_NOT) == 0)
+#define	IS_RETURN	((cmd->len & F_NOT) != 0)
+				/*
+				 * Hand-rolled version of m_tag_locate() with
+				 * wildcard `type'.
+				 * If not already tagged, allocate new tag.
+				 */
+				mtag = m_tag_first(m);
+				while (mtag != NULL) {
+					if (mtag->m_tag_cookie ==
+					    MTAG_IPFW_CALL)
+						break;
+					mtag = m_tag_next(m, mtag);
+				}
+				if (mtag == NULL && IS_CALL) {
+					mtag = m_tag_alloc(MTAG_IPFW_CALL, 0,
+					    IPFW_CALLSTACK_SIZE *
+					    sizeof(uint16_t), M_NOWAIT);
+					if (mtag != NULL)
+						m_tag_prepend(m, mtag);
+				}
+
+				/*
+				 * On error both `call' and `return' just
+				 * continue with next rule.
+				 */
+				if (IS_RETURN && (mtag == NULL ||
+				    mtag->m_tag_id == 0)) {
+					l = 0;		/* exit inner loop */
+					break;
+				}
+				if (IS_CALL && (mtag == NULL ||
+				    mtag->m_tag_id >= IPFW_CALLSTACK_SIZE)) {
+					printf("ipfw: call stack error, "
+					    "go to next rule\n");
+					l = 0;		/* exit inner loop */
+					break;
+				}
+
+				f->pcnt++;	/* update stats */
+				f->bcnt += pktlen;
+				f->timestamp = time_uptime;
+				stack = (uint16_t *)(mtag + 1);
+
+				/*
+				 * The `call' action may use cached f_pos
+				 * (in f->next_rule), whose version is written
+				 * in f->next_rule.
+				 * The `return' action, however, doesn't have
+				 * fixed jump address in cmd->arg1 and can't use
+				 * cache.
+				 */
+				if (IS_CALL) {
+					stack[mtag->m_tag_id] = f->rulenum;
+					mtag->m_tag_id++;
+					if (cmd->arg1 != IP_FW_TABLEARG &&
+					    (uintptr_t)f->x_next == chain->id) {
+						f_pos = (uintptr_t)f->next_rule;
+					} else {
+						jmpto = (cmd->arg1 ==
+						    IP_FW_TABLEARG) ? tablearg:
+						    cmd->arg1;
+						f_pos = ipfw_find_rule(chain,
+						    jmpto, 0);
+						/* update the cache */
+						if (cmd->arg1 !=
+						    IP_FW_TABLEARG) {
+							f->next_rule =
+							    (void *)(uintptr_t)
+							    f_pos;
+							f->x_next =
+							    (void *)(uintptr_t)
+							    chain->id;
+						}
+					}
+				} else {	/* `return' action */
+					mtag->m_tag_id--;
+					jmpto = stack[mtag->m_tag_id] + 1;
+					f_pos = ipfw_find_rule(chain, jmpto, 0);
+				}
+
+				/*
+				 * Skip disabled rules, and re-enter
+				 * the inner loop with the correct
+				 * f_pos, f, l and cmd.
+				 * Also clear cmdlen and skip_or
+				 */
+				for (; f_pos < chain->n_rules - 1 &&
+				    (V_set_disable &
+				    (1 << chain->map[f_pos]->set)); f_pos++)
+					;
+				/* Re-enter the inner loop at the dest rule. */
+				f = chain->map[f_pos];
+				l = f->cmd_len;
+				cmd = f->cmd;
+				cmdlen = 0;
+				skip_or = 0;
+				continue;
+				break;	/* NOTREACHED */
+			}
+#undef IS_CALL
+#undef IS_RETURN
+
 			case O_REJECT:
 				/*
 				 * Drop the packet and send a reject notice

Modified: head/sys/netinet/ipfw/ip_fw_log.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_log.c	Wed Jun 29 09:35:40 2011	(r223665)
+++ head/sys/netinet/ipfw/ip_fw_log.c	Wed Jun 29 10:06:58 2011	(r223666)
@@ -304,6 +304,13 @@ ipfw_log(struct ip_fw *f, u_int hlen, st
 		case O_REASS:
 			action = "Reass";
 			break;
+		case O_CALLRETURN:
+			if (cmd->len & F_NOT)
+				action = "Return";
+			else
+				snprintf(SNPARGS(action2, 0), "Call %d",
+				    cmd->arg1);
+			break;
 		default:
 			action = "UNKNOWN";
 			break;

Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_sockopt.c	Wed Jun 29 09:35:40 2011	(r223665)
+++ head/sys/netinet/ipfw/ip_fw_sockopt.c	Wed Jun 29 10:06:58 2011	(r223666)
@@ -752,6 +752,7 @@ check_ipfw_struct(struct ip_fw *rule, in
 #endif
 		case O_SKIPTO:
 		case O_REASS:
+		case O_CALLRETURN:
 check_size:
 			if (cmdlen != F_INSN_SIZE(ipfw_insn))
 				goto bad_size;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 13:01:10 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 74EE2106564A;
	Wed, 29 Jun 2011 13:01:10 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 641B68FC1C;
	Wed, 29 Jun 2011 13:01: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 p5TD1Am1098345;
	Wed, 29 Jun 2011 13:01:10 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TD1AxH098342;
	Wed, 29 Jun 2011 13:01:10 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201106291301.p5TD1AxH098342@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 29 Jun 2011 13:01:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223667 - head/contrib/ntp/ntpd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 13:01:10 -0000

Author: bz
Date: Wed Jun 29 13:01:10 2011
New Revision: 223667
URL: http://svn.freebsd.org/changeset/base/223667

Log:
  In case ntp cannot resolve a hostname on startup it will queue the entry
  for resolving by a child process that, upon success, will add the entry
  to the config of the running running parent process.
  
  Unfortunately there are a couple of bugs with this, fixed in various
  later versions of upstream in potentially different ways due to other
  code changes:
  
  1) Upon server [-46]  the [-46] are used as FQDN for later resolving
     which does not work.  Make sure we always pass the name (or IP there).
  
  2) The intermediate file to carry the information to the child process
     does not know about -4/-6 restrictions, so that a dual-stacked host
     could resolve to an IPv6 address but that might be unreachable (see
     r223626) leading to no working synchronization ignoring a IPv4 record.
     Thus alter the intermediate format to also pass the address family
     (AF_UNSPEC (default), AF_INET or AF_INET6) to the child process
     depending on -4 or -6.
  
  3) Make the child process to parse the new intermediate file format and
     save the address family for getaddrinfo() hints flags.
  
  4) Change child to always reload resolv.conf calling res_init() before
     trying to resolve names.  This will pick up resolv.conf changes or
     new resolv.confs should they have not existed or been empty or
     unusable on ntp startup.  This fix is more conditional in upstream
     versions but given FreeBSD has res_init there is no need for the
     configure logic as well.
  
  Approved by:	roberto
  Sponsored by:	Sandvine Incorporated
  MFC after:	9 days

Modified:
  head/contrib/ntp/ntpd/ntp_config.c
  head/contrib/ntp/ntpd/ntp_intres.c

Modified: head/contrib/ntp/ntpd/ntp_config.c
==============================================================================
--- head/contrib/ntp/ntpd/ntp_config.c	Wed Jun 29 10:06:58 2011	(r223666)
+++ head/contrib/ntp/ntpd/ntp_config.c	Wed Jun 29 13:01:10 2011	(r223667)
@@ -414,7 +414,7 @@ enum gnn_type {
 static	int getnetnum P((const char *, struct sockaddr_storage *, int,
 			 enum gnn_type));
 static	void save_resolve P((char *, int, int, int, int, u_int, int,
-    keyid_t, u_char *));
+    keyid_t, u_char *, u_char));
 static	void do_resolve_internal P((void));
 static	void abort_resolve P((void));
 #if !defined(VMS) && !defined(SYS_WINNT)
@@ -870,9 +870,9 @@ getconfig(
 						stoa(&peeraddr));
 			    }
 			} else if (errflg == -1) {
-				save_resolve(tokens[1], hmode, peerversion,
+				save_resolve(tokens[istart - 1], hmode, peerversion,
 				    minpoll, maxpoll, peerflags, ttl,
-				    peerkey, peerkeystr);
+				    peerkey, peerkeystr, peeraddr.ss_family);
 			}
 			break;
 
@@ -2325,7 +2325,8 @@ save_resolve(
 	u_int flags,
 	int ttl,
 	keyid_t keyid,
-	u_char *keystr
+	u_char *keystr,
+	u_char peeraf
 	)
 {
 #ifndef SYS_VXWORKS
@@ -2365,11 +2366,11 @@ save_resolve(
 	}
 #endif
 
-	(void)fprintf(res_fp, "%s %d %d %d %d %d %d %u %s\n", name,
+	(void)fprintf(res_fp, "%s %u %d %d %d %d %d %d %u %s\n", name, peeraf,
 	    mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr);
 #ifdef DEBUG
 	if (debug > 1)
-		printf("config: %s %d %d %d %d %x %d %u %s\n", name, mode,
+		printf("config: %s %u %d %d %d %d %x %d %u %s\n", name, peeraf, mode,
 		    version, minpoll, maxpoll, flags, ttl, keyid, keystr);
 #endif
 

Modified: head/contrib/ntp/ntpd/ntp_intres.c
==============================================================================
--- head/contrib/ntp/ntpd/ntp_intres.c	Wed Jun 29 10:06:58 2011	(r223666)
+++ head/contrib/ntp/ntpd/ntp_intres.c	Wed Jun 29 13:01:10 2011	(r223667)
@@ -29,6 +29,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 /**/
@@ -111,15 +112,16 @@ static	int resolve_value;	/* next value 
  * is supposed to consist of entries in the following order
  */
 #define	TOK_HOSTNAME	0
-#define	TOK_HMODE	1
-#define	TOK_VERSION	2
-#define TOK_MINPOLL	3
-#define TOK_MAXPOLL	4
-#define	TOK_FLAGS	5
-#define TOK_TTL		6
-#define	TOK_KEYID	7
-#define TOK_KEYSTR	8
-#define	NUMTOK		9
+#define	TOK_PEERAF	1
+#define	TOK_HMODE	2
+#define	TOK_VERSION	3
+#define TOK_MINPOLL	4
+#define TOK_MAXPOLL	5
+#define	TOK_FLAGS	6
+#define TOK_TTL		7
+#define	TOK_KEYID	8
+#define TOK_KEYSTR	9
+#define	NUMTOK		10
 
 #define	MAXLINESIZE	512
 
@@ -140,7 +142,7 @@ char *req_file;		/* name of the file wit
 static	void	checkparent	P((void));
 static	void	removeentry	P((struct conf_entry *));
 static	void	addentry	P((char *, int, int, int, int, u_int,
-				   int, keyid_t, char *));
+				   int, keyid_t, char *, u_char));
 static	int	findhostaddr	P((struct conf_entry *));
 static	void	openntp		P((void));
 static	int	request		P((struct conf_peer *));
@@ -397,7 +399,8 @@ addentry(
 	u_int flags,
 	int ttl,
 	keyid_t keyid,
-	char *keystr
+	char *keystr,
+	u_char peeraf
 	)
 {
 	register char *cp;
@@ -407,7 +410,7 @@ addentry(
 #ifdef DEBUG
 	if (debug > 1)
 		msyslog(LOG_INFO, 
-		    "intres: <%s> %d %d %d %d %x %d %x %s\n", name,
+		    "intres: <%s> %u %d %d %d %d %x %d %x %s\n", name, peeraf,
 		    mode, version, minpoll, maxpoll, flags, ttl, keyid,
 		    keystr);
 #endif
@@ -422,6 +425,7 @@ addentry(
 	ce->ce_peeraddr6 = in6addr_any;
 #endif
 	ANYSOCK(&ce->peer_store);
+	ce->peer_store.ss_family = peeraf;	/* Save AF for getaddrinfo hints. */
 	ce->ce_hmode = (u_char)mode;
 	ce->ce_version = (u_char)version;
 	ce->ce_minpoll = (u_char)minpoll;
@@ -482,7 +486,8 @@ findhostaddr(
 			entry->ce_name));
 
 		memset(&hints, 0, sizeof(hints));
-		hints.ai_family = AF_UNSPEC;
+		hints.ai_family = entry->peer_store.ss_family;
+		hints.ai_socktype = SOCK_DGRAM;
 		/*
 		 * If the IPv6 stack is not available look only for IPv4 addresses
 		 */
@@ -1051,6 +1056,13 @@ readconf(
 			}
 		}
 
+		if (intval[TOK_PEERAF] != AF_UNSPEC && intval[TOK_PEERAF] !=
+		    AF_INET && intval[TOK_PEERAF] != AF_INET6) {
+			msyslog(LOG_ERR, "invalid peer address family (%u) in "
+			    "file %s", intval[TOK_PEERAF], name);
+			exit(1);
+		}
+
 		if (intval[TOK_HMODE] != MODE_ACTIVE &&
 		    intval[TOK_HMODE] != MODE_CLIENT &&
 		    intval[TOK_HMODE] != MODE_BROADCAST) {
@@ -1107,7 +1119,7 @@ readconf(
 		addentry(token[TOK_HOSTNAME], (int)intval[TOK_HMODE],
 			 (int)intval[TOK_VERSION], (int)intval[TOK_MINPOLL],
 			 (int)intval[TOK_MAXPOLL], flags, (int)intval[TOK_TTL],
-			 intval[TOK_KEYID], token[TOK_KEYSTR]);
+			 intval[TOK_KEYID], token[TOK_KEYSTR], (u_char)intval[TOK_PEERAF]);
 	}
 }
 
@@ -1129,6 +1141,9 @@ doconfigure(
 			    dores ? "with" : "without" );
 #endif
 
+	if (dores)         /* Reload /etc/resolv.conf - bug 1226 */
+		res_init();
+
 	ce = confentries;
 	while (ce != NULL) {
 #ifdef DEBUG

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 13:03:05 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 92D80106566B;
	Wed, 29 Jun 2011 13:03:05 +0000 (UTC)
	(envelope-from jonathan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 817768FC12;
	Wed, 29 Jun 2011 13:03: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 p5TD358B098446;
	Wed, 29 Jun 2011 13:03:05 GMT
	(envelope-from jonathan@svn.freebsd.org)
Received: (from jonathan@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TD35nf098438;
	Wed, 29 Jun 2011 13:03:05 GMT
	(envelope-from jonathan@svn.freebsd.org)
Message-Id: <201106291303.p5TD35nf098438@svn.freebsd.org>
From: Jonathan Anderson 
Date: Wed, 29 Jun 2011 13:03:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223668 - in head/sys: amd64/amd64 arm/arm conf
	i386/i386 kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 13:03:05 -0000

Author: jonathan
Date: Wed Jun 29 13:03:05 2011
New Revision: 223668
URL: http://svn.freebsd.org/changeset/base/223668

Log:
  We may split today's CAPABILITIES into CAPABILITY_MODE (which has
  to do with global namespaces) and CAPABILITIES (which has to do with
  constraining file descriptors). Just in case, and because it's a better
  name anyway, let's move CAPABILITIES out of the way.
  
  Also, change opt_capabilities.h to opt_capsicum.h; for now, this will
  only hold CAPABILITY_MODE, but it will probably also hold the new
  CAPABILITIES (implying constrained file descriptors) in the future.
  
  Approved by: rwatson
  Sponsored by: Google UK Ltd

Modified:
  head/sys/amd64/amd64/sys_machdep.c
  head/sys/arm/arm/sys_machdep.c
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/i386/i386/sys_machdep.c
  head/sys/kern/subr_trap.c
  head/sys/kern/sys_capability.c

Modified: head/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- head/sys/amd64/amd64/sys_machdep.c	Wed Jun 29 13:01:10 2011	(r223667)
+++ head/sys/amd64/amd64/sys_machdep.c	Wed Jun 29 13:03:05 2011	(r223668)
@@ -33,7 +33,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_capabilities.h"
+#include "opt_capsicum.h"
 
 #include 
 #include 
@@ -180,7 +180,7 @@ sysarch(td, uap)
 	uint64_t a64base;
 	struct i386_ioperm_args iargs;
 
-#ifdef CAPABILITIES
+#ifdef CAPABILITY_MODE
 	/*
 	 * Whitelist of operations which are safe enough for capability mode.
 	 */

Modified: head/sys/arm/arm/sys_machdep.c
==============================================================================
--- head/sys/arm/arm/sys_machdep.c	Wed Jun 29 13:01:10 2011	(r223667)
+++ head/sys/arm/arm/sys_machdep.c	Wed Jun 29 13:03:05 2011	(r223668)
@@ -36,7 +36,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_capabilities.h"
+#include "opt_capsicum.h"
 
 #include 
 #include 
@@ -107,7 +107,7 @@ sysarch(td, uap)
 {
 	int error;
 
-#ifdef CAPABILITIES
+#ifdef CAPABILITY_MODE
 	/*
 	 * Whitelist of operations which are safe enough for capability mode.
 	 */

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Wed Jun 29 13:01:10 2011	(r223667)
+++ head/sys/conf/NOTES	Wed Jun 29 13:03:05 2011	(r223668)
@@ -1162,7 +1162,7 @@ options 	MAC_STUB
 options 	MAC_TEST
 
 # Support for Capsicum
-options 	CAPABILITIES
+options 	CAPABILITY_MODE
 
 
 #####################################################################

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Wed Jun 29 13:01:10 2011	(r223667)
+++ head/sys/conf/options	Wed Jun 29 13:03:05 2011	(r223668)
@@ -63,7 +63,7 @@ SYSCTL_DEBUG	opt_sysctl.h
 ADAPTIVE_LOCKMGRS
 ALQ
 AUDIT		opt_global.h
-CAPABILITIES	opt_capabilities.h
+CAPABILITY_MODE	opt_capsicum.h
 CODA_COMPAT_5	opt_coda.h
 COMPAT_43	opt_compat.h
 COMPAT_43TTY	opt_compat.h

Modified: head/sys/i386/i386/sys_machdep.c
==============================================================================
--- head/sys/i386/i386/sys_machdep.c	Wed Jun 29 13:01:10 2011	(r223667)
+++ head/sys/i386/i386/sys_machdep.c	Wed Jun 29 13:03:05 2011	(r223668)
@@ -32,7 +32,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_capabilities.h"
+#include "opt_capsicum.h"
 #include "opt_kstack_pages.h"
 
 #include 
@@ -111,7 +111,7 @@ sysarch(td, uap)
 
 	AUDIT_ARG_CMD(uap->op);
 
-#ifdef CAPABILITIES
+#ifdef CAPABILITY_MODE
 	/*
 	 * Whitelist of operations which are safe enough for capability mode.
 	 */

Modified: head/sys/kern/subr_trap.c
==============================================================================
--- head/sys/kern/subr_trap.c	Wed Jun 29 13:01:10 2011	(r223667)
+++ head/sys/kern/subr_trap.c	Wed Jun 29 13:03:05 2011	(r223668)
@@ -44,7 +44,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_capabilities.h"
+#include "opt_capsicum.h"
 #include "opt_ktrace.h"
 #include "opt_kdtrace.h"
 #include "opt_sched.h"
@@ -313,7 +313,7 @@ syscallenter(struct thread *td, struct s
 				goto retval;
 		}
 
-#ifdef CAPABILITIES
+#ifdef CAPABILITY_MODE
 		/*
 		 * In capability mode, we only allow access to system calls
 		 * flagged with SYF_CAPENABLED.

Modified: head/sys/kern/sys_capability.c
==============================================================================
--- head/sys/kern/sys_capability.c	Wed Jun 29 13:01:10 2011	(r223667)
+++ head/sys/kern/sys_capability.c	Wed Jun 29 13:03:05 2011	(r223668)
@@ -36,7 +36,7 @@
  *
  */
 
-#include "opt_capabilities.h"
+#include "opt_capsicum.h"
 
 #include 
 __FBSDID("$FreeBSD$");
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef CAPABILITIES
+#ifdef CAPABILITY_MODE
 
 FEATURE(security_capabilities, "Capsicum Capability Mode");
 
@@ -99,7 +99,7 @@ cap_getmode(struct thread *td, struct ca
 	return (copyout(&i, uap->modep, sizeof(i)));
 }
 
-#else /* !CAPABILITIES */
+#else /* !CAPABILITY_MODE */
 
 int
 cap_enter(struct thread *td, struct cap_enter_args *uap)
@@ -115,4 +115,4 @@ cap_getmode(struct thread *td, struct ca
 	return (ENOSYS);
 }
 
-#endif /* CAPABILITIES */
+#endif /* CAPABILITY_MODE */

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 13:12:16 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4B3F9106566C;
	Wed, 29 Jun 2011 13:12:16 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B6FA8FC08;
	Wed, 29 Jun 2011 13:12: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 p5TDCGT4098797;
	Wed, 29 Jun 2011 13:12:16 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TDCG1X098795;
	Wed, 29 Jun 2011 13:12:16 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201106291312.p5TDCG1X098795@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 29 Jun 2011 13:12:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223670 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 13:12:16 -0000

Author: bz
Date: Wed Jun 29 13:12:15 2011
New Revision: 223670
URL: http://svn.freebsd.org/changeset/base/223670

Log:
  Clarify that we broke pfsync(4) backward compat with the pf commit r223637.
  
  Suggested by:	Anton Yuzhaninov (citrin citrin.ru)

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Jun 29 13:06:42 2011	(r223669)
+++ head/UPDATING	Wed Jun 29 13:12:15 2011	(r223670)
@@ -25,6 +25,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 20110628:
 	The packet filter (pf) code has been updated to OpenBSD 4.5.
 	You need to update userland tools to be in sync with kernel.
+	This update breaks backward compatibility with earlier pfsync(4)
+	versions.  Care must be taken when updating redundant firewall setups.
 
 20110608:
 	The following sysctls and tunables are retired on x86 platforms:

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 13:21:52 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EEA0E1065673;
	Wed, 29 Jun 2011 13:21:52 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C56878FC20;
	Wed, 29 Jun 2011 13:21: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 p5TDLqN2099103;
	Wed, 29 Jun 2011 13:21:52 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TDLqve099101;
	Wed, 29 Jun 2011 13:21:52 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201106291321.p5TDLqve099101@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 29 Jun 2011 13:21:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223671 - head/sys/dev/ath
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 13:21:53 -0000

Author: adrian
Date: Wed Jun 29 13:21:52 2011
New Revision: 223671
URL: http://svn.freebsd.org/changeset/base/223671

Log:
  Fix a corner case in STA beacon processing when a CSA is received but
  the AP doesn't transmit beacons.
  
  If the AP requests a CSA (ie, a channel switch) and then enters CAC
  (channel availability check) for 60 seconds, it doesn't send beacons
  and it just listens for radar events (and other things which we don't
  do yet.)
  
  Now, ath_newstate() was not resetting the beacon timer config on
  a transition to the RUN state when in STA mode - it was setting
  sc_syncbeacon, which simply updates the beacon config from the
  contents of the next received beacon.
  
  This means the STA never generates beacon miss events.
  
  If the AP goes into CAC for 60 seconds and recovers, the STA will
  happily receive the first beacon and reconfigure timers.
  But if it gets a radar event after that, it'll change channel
  again, not notify the station that it's changed channel..
  and since the station is happily waiting for the first beacon
  to configure the beacon timer details from, it won't ever
  generate a beacon miss interrupt and it'll sit there forever
  (or until the AP appears on that channel once again.)
  
  This change forces the last known beacon timer config to be
  written to hardware on a transition from CSA->RUN in STA mode.
  This forces bmiss events to occur and the STA will eventually
  (after a handful of beacon miss events) begin scanning for
  another access point.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Wed Jun 29 13:12:15 2011	(r223670)
+++ head/sys/dev/ath/if_ath.c	Wed Jun 29 13:21:52 2011	(r223671)
@@ -4693,6 +4693,7 @@ ath_newstate(struct ieee80211vap *vap, e
 	struct ieee80211_node *ni = NULL;
 	int i, error, stamode;
 	u_int32_t rfilt;
+	int csa_run_transition = 0;
 	static const HAL_LED_STATE leds[] = {
 	    HAL_LED_INIT,	/* IEEE80211_S_INIT */
 	    HAL_LED_SCAN,	/* IEEE80211_S_SCAN */
@@ -4708,6 +4709,9 @@ ath_newstate(struct ieee80211vap *vap, e
 		ieee80211_state_name[vap->iv_state],
 		ieee80211_state_name[nstate]);
 
+	if (vap->iv_state == IEEE80211_S_CSA && nstate == IEEE80211_S_RUN)
+		csa_run_transition = 1;
+
 	callout_drain(&sc->sc_cal_ch);
 	ath_hal_setledstate(ah, leds[nstate]);	/* set LED */
 
@@ -4814,8 +4818,14 @@ ath_newstate(struct ieee80211vap *vap, e
 			 * Defer beacon timer configuration to the next
 			 * beacon frame so we have a current TSF to use
 			 * (any TSF collected when scanning is likely old).
+			 * However if it's due to a CSA -> RUN transition,
+			 * force a beacon update so we pick up a lack of
+			 * beacons from an AP in CAC and thus force a
+			 * scan.
 			 */
 			sc->sc_syncbeacon = 1;
+			if (csa_run_transition)
+				ath_beacon_config(sc, vap);
 			break;
 		case IEEE80211_M_MONITOR:
 			/*

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 14:47:21 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F09B1065670;
	Wed, 29 Jun 2011 14:47:21 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E5E58FC17;
	Wed, 29 Jun 2011 14:47:21 +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 p5TElLjp001974;
	Wed, 29 Jun 2011 14:47:21 GMT
	(envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TElLoI001972;
	Wed, 29 Jun 2011 14:47:21 GMT
	(envelope-from hselasky@svn.freebsd.org)
Message-Id: <201106291447.p5TElLoI001972@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Wed, 29 Jun 2011 14:47:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223672 - head/sys/dev/uart
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 14:47:21 -0000

Author: hselasky
Date: Wed Jun 29 14:47:20 2011
New Revision: 223672
URL: http://svn.freebsd.org/changeset/base/223672

Log:
  Add support for a MosChip PCI express serial port adapter.
  
  MFC after:	1 week

Modified:
  head/sys/dev/uart/uart_bus_pci.c

Modified: head/sys/dev/uart/uart_bus_pci.c
==============================================================================
--- head/sys/dev/uart/uart_bus_pci.c	Wed Jun 29 13:21:52 2011	(r223671)
+++ head/sys/dev/uart/uart_bus_pci.c	Wed Jun 29 14:47:20 2011	(r223672)
@@ -113,6 +113,8 @@ static struct pci_id pci_ns8250_ids[] = 
 { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
 { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
 { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
+{ 0x9710, 0x9900, 0xa000, 0x1000,
+	"MosChip MCS9900 PCIe to Peripheral Controller", 0x10 },
 { 0x9710, 0x9901, 0xa000, 0x1000,
 	"MosChip MCS9901 PCIe to Peripheral Controller", 0x10 },
 { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 },

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 15:17:29 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4D79106566B;
	Wed, 29 Jun 2011 15:17:29 +0000 (UTC)
	(envelope-from gber@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D4A2E8FC19;
	Wed, 29 Jun 2011 15:17:29 +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 p5TFHTgC002905;
	Wed, 29 Jun 2011 15:17:29 GMT (envelope-from gber@svn.freebsd.org)
Received: (from gber@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TFHTLp002903;
	Wed, 29 Jun 2011 15:17:29 GMT (envelope-from gber@svn.freebsd.org)
Message-Id: <201106291517.p5TFHTLp002903@svn.freebsd.org>
From: Grzegorz Bernacki 
Date: Wed, 29 Jun 2011 15:17:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223673 - head/sys/nfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 15:17:30 -0000

Author: gber
Date: Wed Jun 29 15:17:29 2011
New Revision: 223673
URL: http://svn.freebsd.org/changeset/base/223673

Log:
  Set proper root device name when legacy NFS client is compiled into kernel.
  
  Approved by:     cognet (mentor)

Modified:
  head/sys/nfs/bootp_subr.c

Modified: head/sys/nfs/bootp_subr.c
==============================================================================
--- head/sys/nfs/bootp_subr.c	Wed Jun 29 14:47:20 2011	(r223672)
+++ head/sys/nfs/bootp_subr.c	Wed Jun 29 15:17:29 2011	(r223673)
@@ -44,6 +44,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_bootp.h"
+#include "opt_nfs.h"
 
 #include 
 #include 
@@ -1699,6 +1700,9 @@ bootpc_init(void)
 	}
 
 	rootdevnames[0] = "nfs:";
+#ifdef NFSCLIENT
+	rootdevnames[1] = "oldnfs:";
+#endif
 	mountopts(&nd->root_args, NULL);
 
 	for (ifctx = gctx->interfaces; ifctx != NULL; ifctx = ifctx->next)

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 16:20:52 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5F9D106566C;
	Wed, 29 Jun 2011 16:20:52 +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 C479C8FC0C;
	Wed, 29 Jun 2011 16:20: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 p5TGKqCV004878;
	Wed, 29 Jun 2011 16:20:52 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TGKqc6004874;
	Wed, 29 Jun 2011 16:20:52 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201106291620.p5TGKqc6004874@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 29 Jun 2011 16:20:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223676 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 16:20:52 -0000

Author: jhb
Date: Wed Jun 29 16:20:52 2011
New Revision: 223676
URL: http://svn.freebsd.org/changeset/base/223676

Log:
  - Add read-only sysctls for all of the tunables supported by the igb and
    em drivers.
  - Make the per-instance 'enable_aim' sysctl truly per-instance by having it
    change a per-instance variable (which is used to control AIM) rather
    than having all of the per-instance sysctls operate on a single global
    variable.
  
  Reviewed by:	jfv (earlier version)
  MFC after:	1 week

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_igb.h

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Wed Jun 29 16:16:59 2011	(r223675)
+++ head/sys/dev/e1000/if_em.c	Wed Jun 29 16:20:52 2011	(r223676)
@@ -330,42 +330,71 @@ MODULE_DEPEND(em, ether, 1, 1, 1);
 #define CSUM_TSO	0
 #endif
 
+SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters");
+
 static int em_tx_int_delay_dflt = EM_TICKS_TO_USECS(EM_TIDV);
 static int em_rx_int_delay_dflt = EM_TICKS_TO_USECS(EM_RDTR);
 TUNABLE_INT("hw.em.tx_int_delay", &em_tx_int_delay_dflt);
 TUNABLE_INT("hw.em.rx_int_delay", &em_rx_int_delay_dflt);
+SYSCTL_INT(_hw_em, OID_AUTO, tx_int_delay, CTLFLAG_RDTUN, &em_tx_int_delay_dflt,
+    0, "Default transmit interrupt delay in usecs");
+SYSCTL_INT(_hw_em, OID_AUTO, rx_int_delay, CTLFLAG_RDTUN, &em_rx_int_delay_dflt,
+    0, "Default receive interrupt delay in usecs");
 
 static int em_tx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_TADV);
 static int em_rx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_RADV);
 TUNABLE_INT("hw.em.tx_abs_int_delay", &em_tx_abs_int_delay_dflt);
 TUNABLE_INT("hw.em.rx_abs_int_delay", &em_rx_abs_int_delay_dflt);
+SYSCTL_INT(_hw_em, OID_AUTO, tx_abs_int_delay, CTLFLAG_RDTUN,
+    &em_tx_abs_int_delay_dflt, 0,
+    "Default transmit interrupt delay limit in usecs");
+SYSCTL_INT(_hw_em, OID_AUTO, rx_abs_int_delay, CTLFLAG_RDTUN,
+    &em_rx_abs_int_delay_dflt, 0,
+    "Default receive interrupt delay limit in usecs");
 
 static int em_rxd = EM_DEFAULT_RXD;
 static int em_txd = EM_DEFAULT_TXD;
 TUNABLE_INT("hw.em.rxd", &em_rxd);
 TUNABLE_INT("hw.em.txd", &em_txd);
+SYSCTL_INT(_hw_em, OID_AUTO, rxd, CTLFLAG_RDTUN, &em_rxd, 0,
+    "Number of receive descriptors per queue");
+SYSCTL_INT(_hw_em, OID_AUTO, txd, CTLFLAG_RDTUN, &em_txd, 0,
+    "Number of transmit descriptors per queue");
 
 static int em_smart_pwr_down = FALSE;
 TUNABLE_INT("hw.em.smart_pwr_down", &em_smart_pwr_down);
+SYSCTL_INT(_hw_em, OID_AUTO, smart_pwr_down, CTLFLAG_RDTUN, &em_smart_pwr_down,
+    0, "Set to true to leave smart power down enabled on newer adapters");
 
 /* Controls whether promiscuous also shows bad packets */
 static int em_debug_sbp = FALSE;
 TUNABLE_INT("hw.em.sbp", &em_debug_sbp);
+SYSCTL_INT(_hw_em, OID_AUTO, sbp, CTLFLAG_RDTUN, &em_debug_sbp, 0,
+    "Show bad packets in promiscuous mode");
 
 static int em_enable_msix = TRUE;
 TUNABLE_INT("hw.em.enable_msix", &em_enable_msix);
+SYSCTL_INT(_hw_em, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &em_enable_msix, 0,
+    "Enable MSI-X interrupts");
 
 /* How many packets rxeof tries to clean at a time */
 static int em_rx_process_limit = 100;
 TUNABLE_INT("hw.em.rx_process_limit", &em_rx_process_limit);
+SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN,
+    &em_rx_process_limit, 0,
+    "Maximum number of received packets to process at a time, -1 means unlimited");
 
 /* Flow control setting - default to FULL */
 static int em_fc_setting = e1000_fc_full;
 TUNABLE_INT("hw.em.fc_setting", &em_fc_setting);
+SYSCTL_INT(_hw_em, OID_AUTO, fc_setting, CTLFLAG_RDTUN, &em_fc_setting, 0,
+    "Flow control");
 
 /* Energy efficient ethernet - default to OFF */
 static int eee_setting = 0;
 TUNABLE_INT("hw.em.eee_setting", &eee_setting);
+SYSCTL_INT(_hw_em, OID_AUTO, eee_setting, CTLFLAG_RDTUN, &eee_setting, 0,
+    "Enable Energy Efficient Ethernet");
 
 /* Global used in WOL setup with multiport cards */
 static int global_quad_port_a = 0;

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Wed Jun 29 16:16:59 2011	(r223675)
+++ head/sys/dev/e1000/if_igb.c	Wed Jun 29 16:20:52 2011	(r223676)
@@ -300,11 +300,17 @@ MODULE_DEPEND(igb, ether, 1, 1, 1);
  *  Tunable default values.
  *********************************************************************/
 
+SYSCTL_NODE(_hw, OID_AUTO, igb, CTLFLAG_RD, 0, "IGB driver parameters");
+
 /* Descriptor defaults */
 static int igb_rxd = IGB_DEFAULT_RXD;
 static int igb_txd = IGB_DEFAULT_TXD;
 TUNABLE_INT("hw.igb.rxd", &igb_rxd);
 TUNABLE_INT("hw.igb.txd", &igb_txd);
+SYSCTL_INT(_hw_igb, OID_AUTO, rxd, CTLFLAG_RDTUN, &igb_rxd, 0,
+    "Number of receive descriptors per queue");
+SYSCTL_INT(_hw_igb, OID_AUTO, txd, CTLFLAG_RDTUN, &igb_txd, 0,
+    "Number of transmit descriptors per queue");
 
 /*
 ** AIM: Adaptive Interrupt Moderation
@@ -314,6 +320,8 @@ TUNABLE_INT("hw.igb.txd", &igb_txd);
 */
 static int igb_enable_aim = TRUE;
 TUNABLE_INT("hw.igb.enable_aim", &igb_enable_aim);
+SYSCTL_INT(_hw_igb, OID_AUTO, enable_aim, CTLFLAG_RW, &igb_enable_aim, 0,
+    "Enable adaptive interrupt moderation");
 
 /*
  * MSIX should be the default for best performance,
@@ -321,12 +329,16 @@ TUNABLE_INT("hw.igb.enable_aim", &igb_en
  */         
 static int igb_enable_msix = 1;
 TUNABLE_INT("hw.igb.enable_msix", &igb_enable_msix);
+SYSCTL_INT(_hw_igb, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &igb_enable_msix, 0,
+    "Enable MSI-X interrupts");
 
 /*
 ** Tuneable Interrupt rate
 */
 static int igb_max_interrupt_rate = 8000;
 TUNABLE_INT("hw.igb.max_interrupt_rate", &igb_max_interrupt_rate);
+SYSCTL_INT(_hw_igb, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN,
+    &igb_max_interrupt_rate, 0, "Maximum interrupts per second");
 
 /*
 ** Header split causes the packet header to
@@ -338,6 +350,8 @@ TUNABLE_INT("hw.igb.max_interrupt_rate",
 */
 static bool igb_header_split = FALSE;
 TUNABLE_INT("hw.igb.hdr_split", &igb_header_split);
+SYSCTL_INT(_hw_igb, OID_AUTO, header_split, CTLFLAG_RDTUN, &igb_header_split, 0,
+    "Enable receive mbuf header split");
 
 /*
 ** This will autoconfigure based on
@@ -345,10 +359,15 @@ TUNABLE_INT("hw.igb.hdr_split", &igb_hea
 */
 static int igb_num_queues = 0;
 TUNABLE_INT("hw.igb.num_queues", &igb_num_queues);
+SYSCTL_INT(_hw_igb, OID_AUTO, num_queues, CTLFLAG_RDTUN, &igb_num_queues, 0,
+    "Number of queues to configure, 0 indicates autoconfigure");
 
 /* How many packets rxeof tries to clean at a time */
 static int igb_rx_process_limit = 100;
 TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit);
+SYSCTL_INT(_hw_igb, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN,
+    &igb_rx_process_limit, 0,
+    "Maximum number of received packets to process at a time, -1 means unlimited");
 
 /*********************************************************************
  *  Device identification routine
@@ -435,10 +454,9 @@ igb_attach(device_t dev)
 	    OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0,
 	    igb_sysctl_nvm_info, "I", "NVM Information");
 
-	SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
-	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-	    OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW,
-	    &igb_enable_aim, 1, "Interrupt Moderation");
+	igb_set_sysctl_value(adapter, "enable_aim",
+	    "Interrupt Moderation", &adapter->enable_aim,
+	    igb_enable_aim);
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
 	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
@@ -1498,7 +1516,7 @@ igb_msix_que(void *arg)
 
 	more_rx = igb_rxeof(que, adapter->rx_process_limit, NULL);
 
-	if (igb_enable_aim == FALSE)
+	if (adapter->enable_aim == FALSE)
 		goto no_calc;
 	/*
 	** Do Adaptive Interrupt Moderation:

Modified: head/sys/dev/e1000/if_igb.h
==============================================================================
--- head/sys/dev/e1000/if_igb.h	Wed Jun 29 16:16:59 2011	(r223675)
+++ head/sys/dev/e1000/if_igb.h	Wed Jun 29 16:20:52 2011	(r223676)
@@ -402,6 +402,7 @@ struct adapter {
 	u16		link_duplex;
 	u32		smartspeed;
 	u32		dmac;
+	int		enable_aim;
 
 	/* Interface queues */
 	struct igb_queue	*queues;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 16:40:41 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD7A51065675;
	Wed, 29 Jun 2011 16:40:41 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B1BF8FC16;
	Wed, 29 Jun 2011 16:40:41 +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 p5TGefUe005555;
	Wed, 29 Jun 2011 16:40:41 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TGefJ3005540;
	Wed, 29 Jun 2011 16:40:41 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201106291640.p5TGefJ3005540@svn.freebsd.org>
From: Alan Cox 
Date: Wed, 29 Jun 2011 16:40:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223677 - in head/sys: amd64/amd64 arm/arm fs/tmpfs
	i386/i386 i386/xen ia64/ia64 kern mips/mips ufs/ffs vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 16:40:41 -0000

Author: alc
Date: Wed Jun 29 16:40:41 2011
New Revision: 223677
URL: http://svn.freebsd.org/changeset/base/223677

Log:
  Add a new option, OBJPR_NOTMAPPED, to vm_object_page_remove().  Passing this
  option to vm_object_page_remove() asserts that the specified range of pages
  is not mapped, or more precisely that none of these pages have any managed
  mappings.  Thus, vm_object_page_remove() need not call pmap_remove_all() on
  the pages.
  
  This change not only saves time by eliminating pointless calls to
  pmap_remove_all(), but it also eliminates an inconsistency in the use of
  pmap_remove_all() versus related functions, like pmap_remove_write().  It
  eliminates harmless but pointless calls to pmap_remove_all() that were being
  performed on PG_UNMANAGED pages.
  
  Update all of the existing assertions on pmap_remove_all() to reflect this
  change.
  
  Reviewed by:	kib

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/arm/arm/pmap.c
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/xen/pmap.c
  head/sys/ia64/ia64/pmap.c
  head/sys/kern/uipc_shm.c
  head/sys/kern/vfs_subr.c
  head/sys/mips/mips/pmap.c
  head/sys/ufs/ffs/ffs_inode.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_object.h
  head/sys/vm/vnode_pager.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/amd64/amd64/pmap.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -2847,8 +2847,8 @@ pmap_remove_all(vm_page_t m)
 	vm_offset_t va;
 	vm_page_t free;
 
-	KASSERT((m->flags & PG_FICTITIOUS) == 0,
-	    ("pmap_remove_all: page %p is fictitious", m));
+	KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0,
+	    ("pmap_remove_all: page %p is not managed", m));
 	free = NULL;
 	vm_page_lock_queues();
 	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));

Modified: head/sys/arm/arm/pmap.c
==============================================================================
--- head/sys/arm/arm/pmap.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/arm/arm/pmap.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -3120,8 +3120,8 @@ pmap_remove_all(vm_page_t m)
 	pmap_t curpm;
 	int flags = 0;
 
-	KASSERT((m->flags & PG_FICTITIOUS) == 0,
-	    ("pmap_remove_all: page %p is fictitious", m));
+	KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0,
+	    ("pmap_remove_all: page %p is not managed", m));
 	if (TAILQ_EMPTY(&m->md.pv_list))
 		return;
 	vm_page_lock_queues();

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_subr.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/fs/tmpfs/tmpfs_subr.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -926,7 +926,7 @@ tmpfs_reg_resize(struct vnode *vp, off_t
 		if (newpages < oldpages) {
 			swap_pager_freespace(uobj, newpages, oldpages -
 			    newpages);
-			vm_object_page_remove(uobj, newpages, 0, FALSE);
+			vm_object_page_remove(uobj, newpages, 0, 0);
 		}
 
 		/*

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/i386/i386/pmap.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -2927,8 +2927,8 @@ pmap_remove_all(vm_page_t m)
 	vm_offset_t va;
 	vm_page_t free;
 
-	KASSERT((m->flags & PG_FICTITIOUS) == 0,
-	    ("pmap_remove_all: page %p is fictitious", m));
+	KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0,
+	    ("pmap_remove_all: page %p is not managed", m));
 	free = NULL;
 	vm_page_lock_queues();
 	sched_pin();

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/i386/xen/pmap.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -2421,8 +2421,8 @@ pmap_remove_all(vm_page_t m)
 	pt_entry_t *pte, tpte;
 	vm_page_t free;
 
-	KASSERT((m->flags & PG_FICTITIOUS) == 0,
-	    ("pmap_remove_all: page %p is fictitious", m));
+	KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0,
+	    ("pmap_remove_all: page %p is not managed", m));
 	free = NULL;
 	vm_page_lock_queues();
 	sched_pin();

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/ia64/ia64/pmap.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -1424,8 +1424,8 @@ pmap_remove_all(vm_page_t m)
 	pmap_t oldpmap;
 	pv_entry_t pv;
 
-	KASSERT((m->flags & PG_FICTITIOUS) == 0,
-	    ("pmap_remove_all: page %p is fictitious", m));
+	KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0,
+	    ("pmap_remove_all: page %p is not managed", m));
 	vm_page_lock_queues();
 	while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
 		struct ia64_lpte *pte;

Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/kern/uipc_shm.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -264,7 +264,7 @@ shm_dotruncate(struct shmfd *shmfd, off_
 		/* Toss in memory pages. */
 		if (nobjsize < object->size)
 			vm_object_page_remove(object, nobjsize, object->size,
-			    FALSE);
+			    0);
 
 		/* Toss pages from swap. */
 		if (object->type == OBJT_SWAP)

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/kern/vfs_subr.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -1190,8 +1190,8 @@ bufobj_invalbuf(struct bufobj *bo, int f
 	 */
 	if (bo->bo_object != NULL && (flags & (V_ALT | V_NORMAL)) == 0) {
 		VM_OBJECT_LOCK(bo->bo_object);
-		vm_object_page_remove(bo->bo_object, 0, 0,
-			(flags & V_SAVE) ? TRUE : FALSE);
+		vm_object_page_remove(bo->bo_object, 0, 0, (flags & V_SAVE) ?
+		    OBJPR_CLEANONLY : 0);
 		VM_OBJECT_UNLOCK(bo->bo_object);
 	}
 

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/mips/mips/pmap.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -1711,8 +1711,8 @@ pmap_remove_all(vm_page_t m)
 	pv_entry_t pv;
 	pt_entry_t *pte, tpte;
 
-	KASSERT((m->flags & PG_FICTITIOUS) == 0,
-	    ("pmap_remove_all: page %p is fictitious", m));
+	KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0,
+	    ("pmap_remove_all: page %p is not managed", m));
 	vm_page_lock_queues();
 
 	if (m->md.pv_flags & PV_TABLE_REF)

Modified: head/sys/ufs/ffs/ffs_inode.c
==============================================================================
--- head/sys/ufs/ffs/ffs_inode.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/ufs/ffs/ffs_inode.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -128,7 +128,7 @@ ffs_pages_remove(struct vnode *vp, vm_pi
 	if ((object = vp->v_object) == NULL)
 		return;
 	VM_OBJECT_LOCK(object);
-	vm_object_page_remove(object, start, end, FALSE);
+	vm_object_page_remove(object, start, end, 0);
 	VM_OBJECT_UNLOCK(object);
 }
 

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/vm/vm_map.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -2708,7 +2708,15 @@ vm_map_entry_delete(vm_map_t map, vm_map
 		    ((object->flags & (OBJ_NOSPLIT|OBJ_ONEMAPPING)) == OBJ_ONEMAPPING ||
 		    object == kernel_object || object == kmem_object)) {
 			vm_object_collapse(object);
-			vm_object_page_remove(object, offidxstart, offidxend, FALSE);
+
+			/*
+			 * The option OBJPR_NOTMAPPED can be passed here
+			 * because vm_map_delete() already performed
+			 * pmap_remove() on the only mapping to this range
+			 * of pages. 
+			 */
+			vm_object_page_remove(object, offidxstart, offidxend,
+			    OBJPR_NOTMAPPED);
 			if (object->type == OBJT_SWAP)
 				swap_pager_freespace(object, offidxstart, count);
 			if (offidxend >= object->size &&

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/vm/vm_object.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -923,6 +923,10 @@ vm_object_page_collect_flush(vm_object_t
  * We invalidate (remove) all pages from the address space
  * for semantic correctness.
  *
+ * If the backing object is a device object with unmanaged pages, then any
+ * mappings to the specified range of pages must be removed before this
+ * function is called.
+ *
  * Note: certain anonymous maps, such as MAP_NOSYNC maps,
  * may start out with a NULL object.
  */
@@ -978,12 +982,19 @@ vm_object_sync(vm_object_t object, vm_oo
 	}
 	if ((object->type == OBJT_VNODE ||
 	     object->type == OBJT_DEVICE) && invalidate) {
-		boolean_t purge;
-		purge = old_msync || (object->type == OBJT_DEVICE);
-		vm_object_page_remove(object,
-		    OFF_TO_IDX(offset),
-		    OFF_TO_IDX(offset + size + PAGE_MASK),
-		    purge ? FALSE : TRUE);
+		if (object->type == OBJT_DEVICE)
+			/*
+			 * The option OBJPR_NOTMAPPED must be passed here
+			 * because vm_object_page_remove() cannot remove
+			 * unmanaged mappings.
+			 */
+			flags = OBJPR_NOTMAPPED;
+		else if (old_msync)
+			flags = 0;
+		else
+			flags = OBJPR_CLEANONLY;
+		vm_object_page_remove(object, OFF_TO_IDX(offset),
+		    OFF_TO_IDX(offset + size + PAGE_MASK), flags);
 	}
 	VM_OBJECT_UNLOCK(object);
 }
@@ -1754,76 +1765,70 @@ vm_object_collapse(vm_object_t object)
  *	vm_object_page_remove:
  *
  *	For the given object, either frees or invalidates each of the
- *	specified pages.  In general, a page is freed.  However, if a
- *	page is wired for any reason other than the existence of a
- *	managed, wired mapping, then it may be invalidated but not
- *	removed from the object.  Pages are specified by the given
- *	range ["start", "end") and Boolean "clean_only".  As a
- *	special case, if "end" is zero, then the range extends from
- *	"start" to the end of the object.  If "clean_only" is TRUE,
- *	then only the non-dirty pages within the specified range are
- *	affected.
- *
- *	In general, this operation should only be performed on objects
- *	that contain managed pages.  There are two exceptions.  First,
- *	it may be performed on the kernel and kmem objects.  Second,
- *	it may be used by msync(..., MS_INVALIDATE) to invalidate
- *	device-backed pages.  In both of these cases, "clean_only"
- *	must be FALSE.
+ *	specified pages.  In general, a page is freed.  However, if a page is
+ *	wired for any reason other than the existence of a managed, wired
+ *	mapping, then it may be invalidated but not removed from the object.
+ *	Pages are specified by the given range ["start", "end") and the option
+ *	OBJPR_CLEANONLY.  As a special case, if "end" is zero, then the range
+ *	extends from "start" to the end of the object.  If the option
+ *	OBJPR_CLEANONLY is specified, then only the non-dirty pages within the
+ *	specified range are affected.  If the option OBJPR_NOTMAPPED is
+ *	specified, then the pages within the specified range must have no
+ *	mappings.  Otherwise, if this option is not specified, any mappings to
+ *	the specified pages are removed before the pages are freed or
+ *	invalidated.
+ *
+ *	In general, this operation should only be performed on objects that
+ *	contain managed pages.  There are, however, two exceptions.  First, it
+ *	is performed on the kernel and kmem objects by vm_map_entry_delete().
+ *	Second, it is used by msync(..., MS_INVALIDATE) to invalidate device-
+ *	backed pages.  In both of these cases, the option OBJPR_CLEANONLY must
+ *	not be specified and the option OBJPR_NOTMAPPED must be specified.
  *
  *	The object must be locked.
  */
 void
 vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end,
-    boolean_t clean_only)
+    int options)
 {
 	vm_page_t p, next;
 	int wirings;
 
 	VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
+	KASSERT((object->type != OBJT_DEVICE && object->type != OBJT_PHYS) ||
+	    (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) == OBJPR_NOTMAPPED,
+	    ("vm_object_page_remove: illegal options for object %p", object));
 	if (object->resident_page_count == 0)
 		goto skipmemq;
-
-	/*
-	 * Since physically-backed objects do not use managed pages, we can't
-	 * remove pages from the object (we must instead remove the page
-	 * references, and then destroy the object).
-	 */
-	KASSERT(object->type != OBJT_PHYS || object == kernel_object ||
-	    object == kmem_object,
-	    ("attempt to remove pages from a physical object"));
-
 	vm_object_pip_add(object, 1);
 again:
 	p = vm_page_find_least(object, start);
 
 	/*
-	 * Assert: the variable p is either (1) the page with the
-	 * least pindex greater than or equal to the parameter pindex
-	 * or (2) NULL.
+	 * Here, the variable "p" is either (1) the page with the least pindex
+	 * greater than or equal to the parameter "start" or (2) NULL. 
 	 */
-	for (;
-	     p != NULL && (p->pindex < end || end == 0);
-	     p = next) {
+	for (; p != NULL && (p->pindex < end || end == 0); p = next) {
 		next = TAILQ_NEXT(p, listq);
 
 		/*
-		 * If the page is wired for any reason besides the
-		 * existence of managed, wired mappings, then it cannot
-		 * be freed.  For example, fictitious pages, which
-		 * represent device memory, are inherently wired and
-		 * cannot be freed.  They can, however, be invalidated
-		 * if "clean_only" is FALSE.
+		 * If the page is wired for any reason besides the existence
+		 * of managed, wired mappings, then it cannot be freed.  For
+		 * example, fictitious pages, which represent device memory,
+		 * are inherently wired and cannot be freed.  They can,
+		 * however, be invalidated if the option OBJPR_CLEANONLY is
+		 * not specified.
 		 */
 		vm_page_lock(p);
 		if ((wirings = p->wire_count) != 0 &&
 		    (wirings = pmap_page_wired_mappings(p)) != p->wire_count) {
-			/* Fictitious pages do not have managed mappings. */
-			if ((p->flags & PG_FICTITIOUS) == 0)
+			if ((options & OBJPR_NOTMAPPED) == 0) {
 				pmap_remove_all(p);
-			/* Account for removal of managed, wired mappings. */
-			p->wire_count -= wirings;
-			if (!clean_only) {
+				/* Account for removal of wired mappings. */
+				if (wirings != 0)
+					p->wire_count -= wirings;
+			}
+			if ((options & OBJPR_CLEANONLY) == 0) {
 				p->valid = 0;
 				vm_page_undirty(p);
 			}
@@ -1834,17 +1839,20 @@ again:
 			goto again;
 		KASSERT((p->flags & PG_FICTITIOUS) == 0,
 		    ("vm_object_page_remove: page %p is fictitious", p));
-		if (clean_only && p->valid) {
-			pmap_remove_write(p);
+		if ((options & OBJPR_CLEANONLY) != 0 && p->valid != 0) {
+			if ((options & OBJPR_NOTMAPPED) == 0)
+				pmap_remove_write(p);
 			if (p->dirty) {
 				vm_page_unlock(p);
 				continue;
 			}
 		}
-		pmap_remove_all(p);
-		/* Account for removal of managed, wired mappings. */
-		if (wirings != 0)
-			p->wire_count -= wirings;
+		if ((options & OBJPR_NOTMAPPED) == 0) {
+			pmap_remove_all(p);
+			/* Account for removal of wired mappings. */
+			if (wirings != 0)
+				p->wire_count -= wirings;
+		}
 		vm_page_free(p);
 		vm_page_unlock(p);
 	}
@@ -1991,9 +1999,8 @@ vm_object_coalesce(vm_object_t prev_obje
 	 * deallocation.
 	 */
 	if (next_pindex < prev_object->size) {
-		vm_object_page_remove(prev_object,
-				      next_pindex,
-				      next_pindex + next_size, FALSE);
+		vm_object_page_remove(prev_object, next_pindex, next_pindex +
+		    next_size, 0);
 		if (prev_object->type == OBJT_SWAP)
 			swap_pager_freespace(prev_object,
 					     next_pindex, next_size);

Modified: head/sys/vm/vm_object.h
==============================================================================
--- head/sys/vm/vm_object.h	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/vm/vm_object.h	Wed Jun 29 16:40:41 2011	(r223677)
@@ -168,6 +168,12 @@ struct vm_object {
 #define OBJPC_INVAL	0x2			/* invalidate */
 #define OBJPC_NOSYNC	0x4			/* skip if PG_NOSYNC */
 
+/*
+ * The following options are supported by vm_object_page_remove().
+ */
+#define	OBJPR_CLEANONLY	0x1		/* Don't remove dirty pages. */
+#define	OBJPR_NOTMAPPED	0x2		/* Don't unmap pages. */
+
 TAILQ_HEAD(object_q, vm_object);
 
 extern struct object_q vm_object_list;	/* list of allocated objects */
@@ -219,7 +225,8 @@ void vm_object_set_writeable_dirty (vm_o
 void vm_object_init (void);
 void vm_object_page_clean(vm_object_t object, vm_ooffset_t start,
     vm_ooffset_t end, int flags);
-void vm_object_page_remove (vm_object_t, vm_pindex_t, vm_pindex_t, boolean_t);
+void vm_object_page_remove(vm_object_t object, vm_pindex_t start,
+    vm_pindex_t end, int options);
 boolean_t vm_object_populate(vm_object_t, vm_pindex_t, vm_pindex_t);
 void vm_object_print(long addr, boolean_t have_addr, long count, char *modif);
 void vm_object_reference (vm_object_t);

Modified: head/sys/vm/vnode_pager.c
==============================================================================
--- head/sys/vm/vnode_pager.c	Wed Jun 29 16:20:52 2011	(r223676)
+++ head/sys/vm/vnode_pager.c	Wed Jun 29 16:40:41 2011	(r223677)
@@ -387,7 +387,7 @@ vnode_pager_setsize(vp, nsize)
 		 */
 		if (nobjsize < object->size)
 			vm_object_page_remove(object, nobjsize, object->size,
-			    FALSE);
+			    0);
 		/*
 		 * this gets rid of garbage at the end of a page that is now
 		 * only partially backed by the vnode.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 17:32:53 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 30F54106564A;
	Wed, 29 Jun 2011 17:32:53 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 20B948FC15;
	Wed, 29 Jun 2011 17:32: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 p5THWrvs007389;
	Wed, 29 Jun 2011 17:32:53 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5THWrEj007387;
	Wed, 29 Jun 2011 17:32:53 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201106291732.p5THWrEj007387@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 29 Jun 2011 17:32:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223683 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 17:32:53 -0000

Author: yongari
Date: Wed Jun 29 17:32:52 2011
New Revision: 223683
URL: http://svn.freebsd.org/changeset/base/223683

Log:
  Document two known hardware errata which requires manual link
  configuration.
  
  Submitted by:	Aries Lee (arieslee <> jmicron com)

Modified:
  head/share/man/man4/jme.4

Modified: head/share/man/man4/jme.4
==============================================================================
--- head/share/man/man4/jme.4	Wed Jun 29 17:20:10 2011	(r223682)
+++ head/share/man/man4/jme.4	Wed Jun 29 17:32:52 2011	(r223683)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 20, 2010
+.Dd June 29, 2011
 .Dt JME 4
 .Os
 .Sh NAME
@@ -178,3 +178,17 @@ address once station address is reprogra
 It is highly recommended not to reprogram station address and
 it is responsibility of administrator to store original station
 address into a safe place when station address should be changed.
+.Pp
+There are two known 1000baseT link establishment issues with JMC25x.
+If the full mask revision number of JMC25x controller is less than
+or equal to 4 and link partner enabled IEEE 802.3az Energy Efficient
+Ethernet feature,  the controller would not be able to establish a
+1000baseT link.
+Also if the length of cable is longer than 120 meters, controller
+can not establish a 1000baseT link.
+The known workaround for the issue is to force manual link
+configuration with 100baseTX instead of relying on auto-negotiation.
+The full mask revision number of controller could be checked with
+verbose kernel boot option.
+Use lower nibble of chip revision number to get full mask revision of
+the controller. 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 29 22:12:43 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C45AD1065673;
	Wed, 29 Jun 2011 22:12:43 +0000 (UTC)
	(envelope-from mckusick@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B4A3F8FC13;
	Wed, 29 Jun 2011 22:12:43 +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 p5TMChZU016043;
	Wed, 29 Jun 2011 22:12:43 GMT
	(envelope-from mckusick@svn.freebsd.org)
Received: (from mckusick@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5TMCh5n016041;
	Wed, 29 Jun 2011 22:12:43 GMT
	(envelope-from mckusick@svn.freebsd.org)
Message-Id: <201106292212.p5TMCh5n016041@svn.freebsd.org>
From: Kirk McKusick 
Date: Wed, 29 Jun 2011 22:12:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223687 - head/sys/ufs/ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 29 Jun 2011 22:12:43 -0000

Author: mckusick
Date: Wed Jun 29 22:12:43 2011
New Revision: 223687
URL: http://svn.freebsd.org/changeset/base/223687

Log:
  Handle the FREEDEP case in softdep_sync_buf().
  This fix failed to get added in -r223325.
  
  Submitted by:	Peter Holm

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Wed Jun 29 21:32:52 2011	(r223686)
+++ head/sys/ufs/ffs/ffs_softdep.c	Wed Jun 29 22:12:43 2011	(r223687)
@@ -12081,6 +12081,7 @@ top:
 			continue;
 
 		case D_FREEWORK:
+		case D_FREEDEP:
 			continue;
 
 		default:

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 05:20:03 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2A595106564A;
	Thu, 30 Jun 2011 05:20:03 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EE8238FC12;
	Thu, 30 Jun 2011 05:20:02 +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 p5U5K2IE028838;
	Thu, 30 Jun 2011 05:20:02 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5U5K2Es028835;
	Thu, 30 Jun 2011 05:20:02 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201106300520.p5U5K2Es028835@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 30 Jun 2011 05:20:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223688 - head/sys/dev/mii
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 05:20:03 -0000

Author: imp
Date: Thu Jun 30 05:20:02 2011
New Revision: 223688
URL: http://svn.freebsd.org/changeset/base/223688

Log:
  Add detection for the Marvel 88E1149R and treat it just like the
  88E1149.

Modified:
  head/sys/dev/mii/e1000phy.c
  head/sys/dev/mii/miidevs

Modified: head/sys/dev/mii/e1000phy.c
==============================================================================
--- head/sys/dev/mii/e1000phy.c	Wed Jun 29 22:12:43 2011	(r223687)
+++ head/sys/dev/mii/e1000phy.c	Thu Jun 30 05:20:02 2011	(r223688)
@@ -107,6 +107,7 @@ static const struct mii_phydesc e1000phy
 	MII_PHY_DESC(xxMARVELL, E1116),
 	MII_PHY_DESC(xxMARVELL, E1116R),
 	MII_PHY_DESC(xxMARVELL, E1118),
+	MII_PHY_DESC(xxMARVELL, E1149R),
 	MII_PHY_DESC(xxMARVELL, E3016),
 	MII_PHY_DESC(xxMARVELL, PHYG65G),
 	MII_PHY_END
@@ -147,6 +148,7 @@ e1000phy_attach(device_t dev)
 			sc->mii_flags |= MIIF_HAVEFIBER;
 		break;
 	case MII_MODEL_xxMARVELL_E1149:
+	case MII_MODEL_xxMARVELL_E1149R:
 		/*
 		 * Some 88E1149 PHY's page select is initialized to
 		 * point to other bank instead of copper/fiber bank
@@ -208,6 +210,7 @@ e1000phy_reset(struct mii_softc *sc)
 		case MII_MODEL_xxMARVELL_E1116:
 		case MII_MODEL_xxMARVELL_E1118:
 		case MII_MODEL_xxMARVELL_E1149:
+		case MII_MODEL_xxMARVELL_E1149R:
 		case MII_MODEL_xxMARVELL_PHYG65G:
 			/* Disable energy detect mode. */
 			reg &= ~E1000_SCR_EN_DETECT_MASK;
@@ -240,7 +243,8 @@ e1000phy_reset(struct mii_softc *sc)
 		PHY_WRITE(sc, E1000_SCR, reg);
 
 		if (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116 ||
-		    sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1149) {
+		    sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1149 ||
+		    sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1149R) {
 			PHY_WRITE(sc, E1000_EADR, 2);
 			reg = PHY_READ(sc, E1000_SCR);
 			reg |= E1000_SCR_RGMII_POWER_UP;

Modified: head/sys/dev/mii/miidevs
==============================================================================
--- head/sys/dev/mii/miidevs	Wed Jun 29 22:12:43 2011	(r223687)
+++ head/sys/dev/mii/miidevs	Thu Jun 30 05:20:02 2011	(r223688)
@@ -248,6 +248,7 @@ model xxMARVELL E1111		0x000c Marvell 88
 model xxMARVELL E1116		0x0021 Marvell 88E1116 Gigabit PHY
 model xxMARVELL E1116R		0x0024 Marvell 88E1116R Gigabit PHY
 model xxMARVELL E1118		0x0022 Marvell 88E1118 Gigabit PHY
+model xxMARVELL E1149R		0x0025 Marvell 88E1149R Quad Gigabit PHY
 model xxMARVELL E3016		0x0026 Marvell 88E3016 10/100 Fast Ethernet PHY
 model xxMARVELL PHYG65G		0x0027 Marvell PHYG65G Gigabit PHY
 model MARVELL E1000		0x0005 Marvell 88E1000 Gigabit PHY

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 05:28:11 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 14725106564A;
	Thu, 30 Jun 2011 05:28:11 +0000 (UTC)
	(envelope-from jeff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 043A08FC08;
	Thu, 30 Jun 2011 05:28:11 +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 p5U5SAJt029109;
	Thu, 30 Jun 2011 05:28:10 GMT (envelope-from jeff@svn.freebsd.org)
Received: (from jeff@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5U5SAYS029107;
	Thu, 30 Jun 2011 05:28:10 GMT (envelope-from jeff@svn.freebsd.org)
Message-Id: <201106300528.p5U5SAYS029107@svn.freebsd.org>
From: Jeff Roberson 
Date: Thu, 30 Jun 2011 05:28:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223689 - head/sbin/fsck_ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 05:28:11 -0000

Author: jeff
Date: Thu Jun 30 05:28:10 2011
New Revision: 223689
URL: http://svn.freebsd.org/changeset/base/223689

Log:
   - Handle the JOP_SYNC case as appropriate.
  
  Reported by:	pho

Modified:
  head/sbin/fsck_ffs/suj.c

Modified: head/sbin/fsck_ffs/suj.c
==============================================================================
--- head/sbin/fsck_ffs/suj.c	Thu Jun 30 05:20:02 2011	(r223688)
+++ head/sbin/fsck_ffs/suj.c	Thu Jun 30 05:28:10 2011	(r223689)
@@ -2261,6 +2261,7 @@ suj_build(void)
 				blk_build((struct jblkrec *)rec);
 				break;
 			case JOP_TRUNC:
+			case JOP_SYNC:
 				ino_build_trunc((struct jtrncrec *)rec);
 				break;
 			default:

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 09:20:27 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35842106567A;
	Thu, 30 Jun 2011 09:20:27 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 25D348FC19;
	Thu, 30 Jun 2011 09:20: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 p5U9KRis035899;
	Thu, 30 Jun 2011 09:20:27 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5U9KRP6035897;
	Thu, 30 Jun 2011 09:20:27 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201106300920.p5U9KRP6035897@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Thu, 30 Jun 2011 09:20:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223690 - head/usr.bin/quota
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 09:20:27 -0000

Author: pluknet
Date: Thu Jun 30 09:20:26 2011
New Revision: 223690
URL: http://svn.freebsd.org/changeset/base/223690

Log:
  Fix quota(1) output.
  
  - Fix calculation of 1024-byte sized blocks from disk blocks shown when -h
  option isn't specified. It was broken with quota64 integration.
  - In prthumanval(): limit the size of a buffer passed to humanize_number()
  to a width of 5 bytes but allow a shorter length if requested. That's what
  users expect.
  
  PR:		bin/150151
  Reviewed by:	Kirk McKusick

Modified:
  head/usr.bin/quota/quota.c

Modified: head/usr.bin/quota/quota.c
==============================================================================
--- head/usr.bin/quota/quota.c	Thu Jun 30 05:28:10 2011	(r223689)
+++ head/usr.bin/quota/quota.c	Thu Jun 30 09:20:26 2011	(r223690)
@@ -264,8 +264,11 @@ prthumanval(int len, u_int64_t bytes)
 {
 	char buf[len + 1];
 
-	humanize_number(buf, sizeof(buf), bytes, "", HN_AUTOSCALE,
-	    HN_B | HN_NOSPACE | HN_DECIMAL);
+	/*
+	 * Limit the width to 5 bytes as that is what users expect.
+	 */
+	humanize_number(buf, sizeof(buf) < 5 ? sizeof(buf) : 5, bytes, "",
+	    HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
 
 	(void)printf(" %*s", len, buf);
 }
@@ -352,10 +355,13 @@ showquotas(int type, u_long id, const ch
 			prthumanval(7, dbtob(qup->dqblk.dqb_bhardlimit));
 		} else {
 			printf(" %7ju%c %7ju %7ju",
-			    dbtob(1024) * (uintmax_t)qup->dqblk.dqb_curblocks,
+			    (uintmax_t)dbtob(qup->dqblk.dqb_curblocks)
+				/ 1024,
 			    (msgb == NULL) ? ' ' : '*',
-			    dbtob(1024) * (uintmax_t)qup->dqblk.dqb_bsoftlimit,
-			    dbtob(1024) * (uintmax_t)qup->dqblk.dqb_bhardlimit);
+			    (uintmax_t)dbtob(qup->dqblk.dqb_bsoftlimit)
+				/ 1024,
+			    (uintmax_t)dbtob(qup->dqblk.dqb_bhardlimit)
+				/ 1024);
 		}
 		if (msgb != NULL)
 			bgrace = timeprt(qup->dqblk.dqb_btime);

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 10:56:02 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA2D0106564A;
	Thu, 30 Jun 2011 10:56:02 +0000 (UTC)
	(envelope-from jonathan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A8BAE8FC08;
	Thu, 30 Jun 2011 10:56:02 +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 p5UAu2VP041001;
	Thu, 30 Jun 2011 10:56:02 GMT
	(envelope-from jonathan@svn.freebsd.org)
Received: (from jonathan@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5UAu2Ze040992;
	Thu, 30 Jun 2011 10:56:02 GMT
	(envelope-from jonathan@svn.freebsd.org)
Message-Id: <201106301056.p5UAu2Ze040992@svn.freebsd.org>
From: Jonathan Anderson 
Date: Thu, 30 Jun 2011 10:56:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223692 - in head/sys: amd64/amd64 arm/arm i386/i386
	kern sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 10:56:02 -0000

Author: jonathan
Date: Thu Jun 30 10:56:02 2011
New Revision: 223692
URL: http://svn.freebsd.org/changeset/base/223692

Log:
  Add some checks to ensure that Capsicum is behaving correctly, and add some
  more explicit comments about what's going on and what future maintainers
  need to do when e.g. adding a new operation to a sys_machdep.c.
  
  Approved by: mentor(rwatson), re(bz)

Modified:
  head/sys/amd64/amd64/sys_machdep.c
  head/sys/arm/arm/sys_machdep.c
  head/sys/i386/i386/sys_machdep.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_exec.c
  head/sys/kern/uipc_shm.c
  head/sys/kern/uipc_syscalls.c
  head/sys/sparc64/sparc64/sys_machdep.c

Modified: head/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- head/sys/amd64/amd64/sys_machdep.c	Thu Jun 30 10:19:43 2011	(r223691)
+++ head/sys/amd64/amd64/sys_machdep.c	Thu Jun 30 10:56:02 2011	(r223692)
@@ -182,26 +182,28 @@ sysarch(td, uap)
 
 #ifdef CAPABILITY_MODE
 	/*
-	 * Whitelist of operations which are safe enough for capability mode.
+	 * When adding new operations, add a new case statement here to
+	 * explicitly indicate whether or not the operation is safe to
+	 * perform in capability mode.
 	 */
 	if (IN_CAPABILITY_MODE(td)) {
 		switch (uap->op) {
-			case I386_GET_LDT:
-			case I386_SET_LDT:
-			case I386_GET_IOPERM:
-			case I386_GET_FSBASE:
-			case I386_SET_FSBASE:
-			case I386_GET_GSBASE:
-			case I386_SET_GSBASE:
-			case AMD64_GET_FSBASE:
-			case AMD64_SET_FSBASE:
-			case AMD64_GET_GSBASE:
-			case AMD64_SET_GSBASE:
-				break;
+		case I386_GET_LDT:
+		case I386_SET_LDT:
+		case I386_GET_IOPERM:
+		case I386_GET_FSBASE:
+		case I386_SET_FSBASE:
+		case I386_GET_GSBASE:
+		case I386_SET_GSBASE:
+		case AMD64_GET_FSBASE:
+		case AMD64_SET_FSBASE:
+		case AMD64_GET_GSBASE:
+		case AMD64_SET_GSBASE:
+			break;
 
-			case I386_SET_IOPERM:
-			default:
-				return (ECAPMODE);
+		case I386_SET_IOPERM:
+		default:
+			return (ECAPMODE);
 		}
 	}
 #endif

Modified: head/sys/arm/arm/sys_machdep.c
==============================================================================
--- head/sys/arm/arm/sys_machdep.c	Thu Jun 30 10:19:43 2011	(r223691)
+++ head/sys/arm/arm/sys_machdep.c	Thu Jun 30 10:56:02 2011	(r223692)
@@ -109,18 +109,20 @@ sysarch(td, uap)
 
 #ifdef CAPABILITY_MODE
 	/*
-	 * Whitelist of operations which are safe enough for capability mode.
+	 * When adding new operations, add a new case statement here to
+	 * explicitly indicate whether or not the operation is safe to
+	 * perform in capability mode.
 	 */
 	if (IN_CAPABILITY_MODE(td)) {
 		switch (uap->op) {
-			case ARM_SYNC_ICACHE:
-			case ARM_DRAIN_WRITEBUF:
-			case ARM_SET_TP:
-			case ARM_GET_TP:
-				break;
+		case ARM_SYNC_ICACHE:
+		case ARM_DRAIN_WRITEBUF:
+		case ARM_SET_TP:
+		case ARM_GET_TP:
+			break;
 
-			default:
-				return (ECAPMODE);
+		default:
+			return (ECAPMODE);
 		}
 	}
 #endif

Modified: head/sys/i386/i386/sys_machdep.c
==============================================================================
--- head/sys/i386/i386/sys_machdep.c	Thu Jun 30 10:19:43 2011	(r223691)
+++ head/sys/i386/i386/sys_machdep.c	Thu Jun 30 10:56:02 2011	(r223692)
@@ -113,22 +113,24 @@ sysarch(td, uap)
 
 #ifdef CAPABILITY_MODE
 	/*
-	 * Whitelist of operations which are safe enough for capability mode.
+	 * When adding new operations, add a new case statement here to
+	 * explicitly indicate whether or not the operation is safe to
+	 * perform in capability mode.
 	 */
 	if (IN_CAPABILITY_MODE(td)) {
 		switch (uap->op) {
-			case I386_GET_LDT:
-			case I386_SET_LDT:
-			case I386_GET_IOPERM:
-			case I386_GET_FSBASE:
-			case I386_SET_FSBASE:
-			case I386_GET_GSBASE:
-			case I386_SET_GSBASE:
-				break;
+		case I386_GET_LDT:
+		case I386_SET_LDT:
+		case I386_GET_IOPERM:
+		case I386_GET_FSBASE:
+		case I386_SET_FSBASE:
+		case I386_GET_GSBASE:
+		case I386_SET_GSBASE:
+			break;
 
-			case I386_SET_IOPERM:
-			default:
-				return (ECAPMODE);
+		case I386_SET_IOPERM:
+		default:
+			return (ECAPMODE);
 		}
 	}
 #endif

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Thu Jun 30 10:19:43 2011	(r223691)
+++ head/sys/kern/imgact_elf.c	Thu Jun 30 10:56:02 2011	(r223692)
@@ -31,10 +31,12 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_capsicum.h"
 #include "opt_compat.h"
 #include "opt_core.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -578,6 +580,15 @@ __elfN(load_file)(struct proc *p, const 
 	u_long base_addr = 0;
 	int vfslocked, error, i, numsegs;
 
+#ifdef CAPABILITY_MODE
+	/*
+	 * XXXJA: This check can go away once we are sufficiently confident
+	 * that the checks in namei() are correct.
+	 */
+	if (IN_CAPABILITY_MODE(curthread))
+		return (ECAPMODE);
+#endif
+
 	tempdata = malloc(sizeof(*tempdata), M_TEMP, M_WAITOK);
 	nd = &tempdata->nd;
 	attr = &tempdata->attr;

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Thu Jun 30 10:19:43 2011	(r223691)
+++ head/sys/kern/kern_exec.c	Thu Jun 30 10:56:02 2011	(r223692)
@@ -27,12 +27,14 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_capsicum.h"
 #include "opt_hwpmc_hooks.h"
 #include "opt_kdtrace.h"
 #include "opt_ktrace.h"
 #include "opt_vm.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -415,6 +417,18 @@ do_execve(td, args, mac_p)
 
 interpret:
 	if (args->fname != NULL) {
+#ifdef CAPABILITY_MODE
+		/*
+		 * While capability mode can't reach this point via direct
+		 * path arguments to execve(), we also don't allow
+		 * interpreters to be used in capability mode (for now).
+		 * Catch indirect lookups and return a permissions error.
+		 */
+		if (IN_CAPABILITY_MODE(td)) {
+			error = ECAPMODE;
+			goto exec_fail;
+		}
+#endif
 		error = namei(&nd);
 		if (error)
 			goto exec_fail;
@@ -631,6 +645,13 @@ interpret:
 	 * Don't honor setuid/setgid if the filesystem prohibits it or if
 	 * the process is being traced.
 	 *
+	 * We disable setuid/setgid/etc in compatibility mode on the basis
+	 * that most setugid applications are not written with that
+	 * environment in mind, and will therefore almost certainly operate
+	 * incorrectly. In principle there's no reason that setugid
+	 * applications might not be useful in capability mode, so we may want
+	 * to reconsider this conservative design choice in the future.
+	 *
 	 * XXXMAC: For the time being, use NOSUID to also prohibit
 	 * transitions on the file system.
 	 */
@@ -646,6 +667,9 @@ interpret:
 #endif
 
 	if (credential_changing &&
+#ifdef CAPABILITY_MODE
+	    ((oldcred->cr_flags & CRED_FLAG_CAPMODE) == 0) &&
+#endif
 	    (imgp->vp->v_mount->mnt_flag & MNT_NOSUID) == 0 &&
 	    (p->p_flag & P_TRACED) == 0) {
 		/*

Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c	Thu Jun 30 10:19:43 2011	(r223691)
+++ head/sys/kern/uipc_shm.c	Thu Jun 30 10:56:02 2011	(r223692)
@@ -55,7 +55,10 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_capsicum.h"
+
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -486,6 +489,14 @@ shm_open(struct thread *td, struct shm_o
 	mode_t cmode;
 	int fd, error;
 
+#ifdef CAPABILITY_MODE
+	/*
+	 * shm_open(2) is only allowed for anonymous objects.
+	 */
+	if (IN_CAPABILITY_MODE(td) && (uap->path != SHM_ANON))
+		return (ECAPMODE);
+#endif
+
 	if ((uap->flags & O_ACCMODE) != O_RDONLY &&
 	    (uap->flags & O_ACCMODE) != O_RDWR)
 		return (EINVAL);

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Thu Jun 30 10:19:43 2011	(r223691)
+++ head/sys/kern/uipc_syscalls.c	Thu Jun 30 10:56:02 2011	(r223692)
@@ -35,6 +35,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_capsicum.h"
 #include "opt_inet.h"
 #include "opt_inet6.h"
 #include "opt_sctp.h"
@@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -675,6 +677,11 @@ sendit(td, s, mp, flags)
 	struct sockaddr *to;
 	int error;
 
+#ifdef CAPABILITY_MODE
+	if (IN_CAPABILITY_MODE(td) && (mp->msg_name != NULL))
+		return (ECAPMODE);
+#endif
+
 	if (mp->msg_name != NULL) {
 		error = getsockaddr(&to, mp->msg_name, mp->msg_namelen);
 		if (error) {

Modified: head/sys/sparc64/sparc64/sys_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/sys_machdep.c	Thu Jun 30 10:19:43 2011	(r223691)
+++ head/sys/sparc64/sparc64/sys_machdep.c	Thu Jun 30 10:56:02 2011	(r223692)
@@ -26,8 +26,11 @@
  * $FreeBSD$
  */
 
+#include "opt_capsicum.h"
+
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -53,6 +56,24 @@ sysarch(struct thread *td, struct sysarc
 {
 	int error;
 
+#ifdef CAPABILITY_MODE
+	/*
+	 * When adding new operations, add a new case statement here to
+	 * explicitly indicate whether or not the operation is safe to
+	 * perform in capability mode.
+	 */
+	if (IN_CAPABILITY_MODE(td)) {
+		switch (uap->op) {
+		case SPARC_SIGTRAMP_INSTALL:
+		case SPARC_UTRAP_INSTALL:
+			break;
+
+		default:
+			return (ECAPMODE);
+		}
+	}
+#endif
+
 	mtx_lock(&Giant);
 	switch (uap->op) {
 	case SPARC_SIGTRAMP_INSTALL:

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 15:22:49 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE38E106566C;
	Thu, 30 Jun 2011 15:22:49 +0000 (UTC)
	(envelope-from jonathan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 948158FC21;
	Thu, 30 Jun 2011 15:22: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 p5UFMn16049078;
	Thu, 30 Jun 2011 15:22:49 GMT
	(envelope-from jonathan@svn.freebsd.org)
Received: (from jonathan@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5UFMnxo049075;
	Thu, 30 Jun 2011 15:22:49 GMT
	(envelope-from jonathan@svn.freebsd.org)
Message-Id: <201106301522.p5UFMnxo049075@svn.freebsd.org>
From: Jonathan Anderson 
Date: Thu, 30 Jun 2011 15:22:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223694 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 15:22:49 -0000

Author: jonathan
Date: Thu Jun 30 15:22:49 2011
New Revision: 223694
URL: http://svn.freebsd.org/changeset/base/223694

Log:
  When Capsicum starts creating capabilities to wrap existing file
  descriptors, we will want to allocate a new descriptor without installing
  it in the FD array.
  
  Split falloc() into falloc_noinstall() and finstall(), and rewrite
  falloc() to call them with appropriate atomicity.
  
  Approved by: mentor (rwatson), re (bz)

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/sys/filedesc.h

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Thu Jun 30 14:10:49 2011	(r223693)
+++ head/sys/kern/kern_descrip.c	Thu Jun 30 15:22:49 2011	(r223694)
@@ -1561,54 +1561,85 @@ fdavail(struct thread *td, int n)
 int
 falloc(struct thread *td, struct file **resultfp, int *resultfd, int flags)
 {
-	struct proc *p = td->td_proc;
 	struct file *fp;
-	int error, i;
+	int error, fd;
+
+	error = falloc_noinstall(td, &fp);
+	if (error)
+		return (error);		/* no reference held on error */
+
+	error = finstall(td, fp, &fd, flags);
+	if (error) {
+		fdrop(fp, td);		/* one reference (fp only) */
+		return (error);
+	}
+
+	if (resultfp != NULL)
+		*resultfp = fp;		/* copy out result */
+	else
+		fdrop(fp, td);		/* release local reference */
+
+	if (resultfd != NULL)
+		*resultfd = fd;
+
+	return (0);
+}
+
+/*
+ * Create a new open file structure without allocating a file descriptor.
+ */
+int
+falloc_noinstall(struct thread *td, struct file **resultfp)
+{
+	struct file *fp;
 	int maxuserfiles = maxfiles - (maxfiles / 20);
 	static struct timeval lastfail;
 	static int curfail;
 
-	fp = uma_zalloc(file_zone, M_WAITOK | M_ZERO);
+	KASSERT(resultfp != NULL, ("%s: resultfp == NULL", __func__));
+
 	if ((openfiles >= maxuserfiles &&
 	    priv_check(td, PRIV_MAXFILES) != 0) ||
 	    openfiles >= maxfiles) {
 		if (ppsratecheck(&lastfail, &curfail, 1)) {
-			printf("kern.maxfiles limit exceeded by uid %i, please see tuning(7).\n",
-				td->td_ucred->cr_ruid);
+			printf("kern.maxfiles limit exceeded by uid %i, "
+			    "please see tuning(7).\n", td->td_ucred->cr_ruid);
 		}
-		uma_zfree(file_zone, fp);
 		return (ENFILE);
 	}
 	atomic_add_int(&openfiles, 1);
-
-	/*
-	 * If the process has file descriptor zero open, add the new file
-	 * descriptor to the list of open files at that point, otherwise
-	 * put it at the front of the list of open files.
-	 */
+	fp = uma_zalloc(file_zone, M_WAITOK | M_ZERO);
 	refcount_init(&fp->f_count, 1);
-	if (resultfp)
-		fhold(fp);
 	fp->f_cred = crhold(td->td_ucred);
 	fp->f_ops = &badfileops;
 	fp->f_data = NULL;
 	fp->f_vnode = NULL;
-	FILEDESC_XLOCK(p->p_fd);
-	if ((error = fdalloc(td, 0, &i))) {
-		FILEDESC_XUNLOCK(p->p_fd);
-		fdrop(fp, td);
-		if (resultfp)
-			fdrop(fp, td);
+	*resultfp = fp;
+	return (0);
+}
+
+/*
+ * Install a file in a file descriptor table.
+ */
+int
+finstall(struct thread *td, struct file *fp, int *fd, int flags)
+{
+	struct filedesc *fdp = td->td_proc->p_fd;
+	int error;
+
+	KASSERT(fd != NULL, ("%s: fd == NULL", __func__));
+	KASSERT(fp != NULL, ("%s: fp == NULL", __func__));
+
+	FILEDESC_XLOCK(fdp);
+	if ((error = fdalloc(td, 0, fd))) {
+		FILEDESC_XUNLOCK(fdp);
 		return (error);
 	}
-	p->p_fd->fd_ofiles[i] = fp;
+	fhold(fp);
+	fdp->fd_ofiles[*fd] = fp;
 	if ((flags & O_CLOEXEC) != 0)
-		p->p_fd->fd_ofileflags[i] |= UF_EXCLOSE;
-	FILEDESC_XUNLOCK(p->p_fd);
-	if (resultfp)
-		*resultfp = fp;
-	if (resultfd)
-		*resultfd = i;
+		fdp->fd_ofileflags[*fd] |= UF_EXCLOSE;
+	FILEDESC_XUNLOCK(fdp);
 	return (0);
 }
 

Modified: head/sys/sys/filedesc.h
==============================================================================
--- head/sys/sys/filedesc.h	Thu Jun 30 14:10:49 2011	(r223693)
+++ head/sys/sys/filedesc.h	Thu Jun 30 15:22:49 2011	(r223694)
@@ -113,6 +113,8 @@ int	dupfdopen(struct thread *td, struct 
 	    int mode, int error);
 int	falloc(struct thread *td, struct file **resultfp, int *resultfd,
 	    int flags);
+int	falloc_noinstall(struct thread *td, struct file **resultfp);
+int	finstall(struct thread *td, struct file *fp, int *resultfp, int flags);
 int	fdalloc(struct thread *td, int minfd, int *result);
 int	fdavail(struct thread *td, int n);
 int	fdcheckstd(struct thread *td);

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 16:08:56 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5BA8106564A;
	Thu, 30 Jun 2011 16:08:56 +0000 (UTC) (envelope-from dfr@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C28898FC0C;
	Thu, 30 Jun 2011 16:08:56 +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 p5UG8u5I050579;
	Thu, 30 Jun 2011 16:08:56 GMT (envelope-from dfr@svn.freebsd.org)
Received: (from dfr@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5UG8ulA050570;
	Thu, 30 Jun 2011 16:08:56 GMT (envelope-from dfr@svn.freebsd.org)
Message-Id: <201106301608.p5UG8ulA050570@svn.freebsd.org>
From: Doug Rabson 
Date: Thu, 30 Jun 2011 16:08:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223695 - in head/sys/boot: . common ficl/amd64
	i386/libi386 userboot userboot/ficl userboot/libstand
	userboot/libstand/amd64 userboot/test userboot/userboot
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 16:08:56 -0000

Author: dfr
Date: Thu Jun 30 16:08:56 2011
New Revision: 223695
URL: http://svn.freebsd.org/changeset/base/223695

Log:
  Add a version of the FreeBSD bootloader which can run in userland, packaged
  as a shared library. This is intended to be used by BHyVe to load FreeBSD
  kernels into new virtual machines.

Added:
  head/sys/boot/common/disk.c   (contents, props changed)
  head/sys/boot/common/disk.h   (contents, props changed)
  head/sys/boot/ficl/amd64/
  head/sys/boot/ficl/amd64/sysdep.c   (contents, props changed)
  head/sys/boot/ficl/amd64/sysdep.h   (contents, props changed)
  head/sys/boot/userboot/
  head/sys/boot/userboot/Makefile   (contents, props changed)
  head/sys/boot/userboot/ficl/
  head/sys/boot/userboot/ficl/Makefile   (contents, props changed)
  head/sys/boot/userboot/libstand/
  head/sys/boot/userboot/libstand/Makefile   (contents, props changed)
  head/sys/boot/userboot/libstand/amd64/
  head/sys/boot/userboot/libstand/amd64/_setjmp.S   (contents, props changed)
  head/sys/boot/userboot/test/
  head/sys/boot/userboot/test/Makefile   (contents, props changed)
  head/sys/boot/userboot/test/test.c   (contents, props changed)
  head/sys/boot/userboot/userboot/
  head/sys/boot/userboot/userboot.h   (contents, props changed)
  head/sys/boot/userboot/userboot/Makefile   (contents, props changed)
  head/sys/boot/userboot/userboot/autoload.c   (contents, props changed)
  head/sys/boot/userboot/userboot/bootinfo.c   (contents, props changed)
  head/sys/boot/userboot/userboot/bootinfo32.c   (contents, props changed)
  head/sys/boot/userboot/userboot/bootinfo64.c   (contents, props changed)
  head/sys/boot/userboot/userboot/conf.c   (contents, props changed)
  head/sys/boot/userboot/userboot/copy.c   (contents, props changed)
  head/sys/boot/userboot/userboot/devicename.c   (contents, props changed)
  head/sys/boot/userboot/userboot/elf32_freebsd.c   (contents, props changed)
  head/sys/boot/userboot/userboot/elf64_freebsd.c   (contents, props changed)
  head/sys/boot/userboot/userboot/host.c   (contents, props changed)
  head/sys/boot/userboot/userboot/libuserboot.h   (contents, props changed)
  head/sys/boot/userboot/userboot/main.c   (contents, props changed)
  head/sys/boot/userboot/userboot/userboot_cons.c   (contents, props changed)
  head/sys/boot/userboot/userboot/userboot_disk.c   (contents, props changed)
  head/sys/boot/userboot/userboot/version   (contents, props changed)
Modified:
  head/sys/boot/Makefile.amd64
  head/sys/boot/common/Makefile.inc
  head/sys/boot/common/load_elf.c
  head/sys/boot/common/reloc_elf.c
  head/sys/boot/i386/libi386/bioscd.c

Modified: head/sys/boot/Makefile.amd64
==============================================================================
--- head/sys/boot/Makefile.amd64	Thu Jun 30 15:22:49 2011	(r223694)
+++ head/sys/boot/Makefile.amd64	Thu Jun 30 16:08:56 2011	(r223695)
@@ -2,3 +2,4 @@
 
 SUBDIR+=		efi
 SUBDIR+=		zfs
+SUBDIR+=		userboot

Modified: head/sys/boot/common/Makefile.inc
==============================================================================
--- head/sys/boot/common/Makefile.inc	Thu Jun 30 15:22:49 2011	(r223694)
+++ head/sys/boot/common/Makefile.inc	Thu Jun 30 16:08:56 2011	(r223695)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-SRCS+=	boot.c commands.c console.c devopen.c interp.c 
+SRCS+=	boot.c commands.c console.c devopen.c disk.c interp.c 
 SRCS+=	interp_backslash.c interp_parse.c ls.c misc.c 
 SRCS+=	module.c panic.c
 

Added: head/sys/boot/common/disk.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/boot/common/disk.c	Thu Jun 30 16:08:56 2011	(r223695)
@@ -0,0 +1,788 @@
+/*-
+ * Copyright (c) 1998 Michael Smith 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * MBR/GPT partitioned disk device handling.
+ *
+ * Ideas and algorithms from:
+ *
+ * - NetBSD libi386/biosdisk.c
+ * - FreeBSD biosboot/disk.c
+ *
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include "disk.h"
+
+#ifdef DISK_DEBUG
+# define DEBUG(fmt, args...)	printf("%s: " fmt "\n" , __func__ , ## args)
+#else
+# define DEBUG(fmt, args...)
+#endif
+
+/*
+ * Search for a slice with the following preferences:
+ *
+ * 1: Active FreeBSD slice
+ * 2: Non-active FreeBSD slice
+ * 3: Active Linux slice
+ * 4: non-active Linux slice
+ * 5: Active FAT/FAT32 slice
+ * 6: non-active FAT/FAT32 slice
+ */
+#define PREF_RAWDISK	0
+#define PREF_FBSD_ACT	1
+#define PREF_FBSD	2
+#define PREF_LINUX_ACT	3
+#define PREF_LINUX	4
+#define PREF_DOS_ACT	5
+#define PREF_DOS	6
+#define PREF_NONE	7
+
+#ifdef LOADER_GPT_SUPPORT
+
+struct gpt_part {
+	int		gp_index;
+	uuid_t		gp_type;
+	uint64_t	gp_start;
+	uint64_t	gp_end;
+};
+
+static uuid_t efi = GPT_ENT_TYPE_EFI;
+static uuid_t freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT;
+static uuid_t freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
+static uuid_t freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
+static uuid_t freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
+static uuid_t ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA;
+
+#endif
+
+/* Given a size in 512 byte sectors, convert it to a human-readable number. */
+static char *
+display_size(uint64_t size)
+{
+	static char buf[80];
+	char unit;
+
+	size /= 2;
+	unit = 'K';
+	if (size >= 10485760000LL) {
+		size /= 1073741824;
+		unit = 'T';
+	} else if (size >= 10240000) {
+		size /= 1048576;
+		unit = 'G';
+	} else if (size >= 10000) {
+		size /= 1024;
+		unit = 'M';
+	}
+	sprintf(buf, "%.6ld%cB", (long)size, unit);
+	return (buf);
+}
+
+static void
+disk_checkextended(struct disk_devdesc *dev,
+    struct dos_partition *slicetab, int slicenum, int *nslicesp)
+{
+	uint8_t			buf[DISK_SECSIZE];
+	struct dos_partition	*dp;
+	uint32_t		base;
+	int			rc, i, start, end;
+
+	dp = &slicetab[slicenum];
+	start = *nslicesp;
+
+	if (dp->dp_size == 0)
+		goto done;
+	if (dp->dp_typ != DOSPTYP_EXT)
+		goto done;
+	rc = dev->d_dev->dv_strategy(dev, F_READ, dp->dp_start, DISK_SECSIZE,
+		(char *) buf, NULL);
+	if (rc)
+		goto done;
+	if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) {
+		DEBUG("no magic in extended table");
+		goto done;
+	}
+	base = dp->dp_start;
+	dp = (struct dos_partition *) &buf[DOSPARTOFF];
+	for (i = 0; i < NDOSPART; i++, dp++) {
+		if (dp->dp_size == 0)
+			continue;
+		if (*nslicesp == NEXTDOSPART)
+			goto done;
+		dp->dp_start += base;
+		bcopy(dp, &slicetab[*nslicesp], sizeof(*dp));
+		(*nslicesp)++;
+	}
+	end = *nslicesp;
+
+	/*
+	 * now, recursively check the slices we just added
+	 */
+	for (i = start; i < end; i++)
+		disk_checkextended(dev, slicetab, i, nslicesp);
+done:
+	return;
+}
+
+static int
+disk_readslicetab(struct disk_devdesc *dev,
+    struct dos_partition **slicetabp, int *nslicesp)
+{
+	struct dos_partition	*slicetab = NULL;
+	int			nslices, i;
+	int			rc;
+	uint8_t			buf[DISK_SECSIZE];
+
+	/*
+	 * Find the slice in the DOS slice table.
+	 */
+	rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE,
+		(char *) buf, NULL);
+	if (rc) {
+		DEBUG("error reading MBR");
+		return (rc);
+	}
+
+	/*
+	 * Check the slice table magic.
+	 */
+	if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) {
+		DEBUG("no slice table/MBR (no magic)");
+		return (rc);
+	}
+
+	/*
+	 * copy the partition table, then pick up any extended partitions.
+	 */
+	slicetab = malloc(NEXTDOSPART * sizeof(struct dos_partition));
+	bcopy(buf + DOSPARTOFF, slicetab,
+		sizeof(struct dos_partition) * NDOSPART);
+	nslices = NDOSPART;		/* extended slices start here */
+	for (i = 0; i < NDOSPART; i++)
+		disk_checkextended(dev, slicetab, i, &nslices);
+
+	*slicetabp = slicetab;
+	*nslicesp = nslices;
+	return (0);
+}
+
+/*
+ * Search for the best MBR slice (typically the first FreeBSD slice).
+ */
+static int
+disk_bestslice(struct dos_partition *slicetab, int nslices)
+{
+	struct dos_partition *dp;
+	int pref, preflevel;
+	int i, prefslice;
+
+	prefslice = 0;
+	preflevel = PREF_NONE;
+
+	dp = &slicetab[0];
+	for (i = 0; i < nslices; i++, dp++) {
+		switch (dp->dp_typ) {
+		case DOSPTYP_386BSD:		/* FreeBSD */
+			pref = dp->dp_flag & 0x80 ? PREF_FBSD_ACT : PREF_FBSD;
+			break;
+
+		case DOSPTYP_LINUX:
+			pref = dp->dp_flag & 0x80 ? PREF_LINUX_ACT : PREF_LINUX;
+			break;
+
+		case 0x01:		/* DOS/Windows */
+		case 0x04:
+		case 0x06:
+		case 0x0b:
+		case 0x0c:
+		case 0x0e:
+			pref = dp->dp_flag & 0x80 ? PREF_DOS_ACT : PREF_DOS;
+			break;
+
+		default:
+		        pref = PREF_NONE;
+		}
+		if (pref < preflevel) {
+			preflevel = pref;
+			prefslice = i + 1;
+		}
+	}
+	return (prefslice);
+}
+
+static int
+disk_openmbr(struct disk_devdesc *dev)
+{
+	struct dos_partition	*slicetab = NULL, *dptr;
+	int			nslices, sector, slice;
+	int			rc;
+	uint8_t			buf[DISK_SECSIZE];
+	struct disklabel	*lp;
+
+	/*
+	 * Following calculations attempt to determine the correct value
+	 * for dev->d_offset by looking for the slice and partition specified,
+	 * or searching for reasonable defaults.
+	 */
+	rc = disk_readslicetab(dev, &slicetab, &nslices);
+	if (rc)
+		return (rc);
+
+	/*
+	 * if a slice number was supplied but not found, this is an error.
+	 */
+	if (dev->d_slice > 0) {
+		slice = dev->d_slice - 1;
+		if (slice >= nslices) {
+			DEBUG("slice %d not found", slice);
+			rc = EPART;
+			goto out;
+		}
+	}
+
+	/*
+	 * Check for the historically bogus MBR found on true dedicated disks
+	 */
+	if (slicetab[3].dp_typ == DOSPTYP_386BSD &&
+	    slicetab[3].dp_start == 0 && slicetab[3].dp_size == 50000) {
+		sector = 0;
+		goto unsliced;
+	}
+
+	/*
+	 * Try to auto-detect the best slice; this should always give
+	 * a slice number
+	 */
+	if (dev->d_slice == 0) {
+		slice = disk_bestslice(slicetab, nslices);
+		if (slice == -1) {
+			rc = ENOENT;
+			goto out;
+		}
+		dev->d_slice = slice;
+	}
+
+	/*
+	 * Accept the supplied slice number unequivocally (we may be looking
+	 * at a DOS partition).
+	 * Note: we number 1-4, offsets are 0-3
+	 */
+	dptr = &slicetab[dev->d_slice - 1];
+	sector = dptr->dp_start;
+	DEBUG("slice entry %d at %d, %d sectors",
+		dev->d_slice - 1, sector, dptr->dp_size);
+
+unsliced:
+	/*
+	 * Now we have the slice offset, look for the partition in the
+	 * disklabel if we have a partition to start with.
+	 *
+	 * XXX we might want to check the label checksum.
+	 */
+	if (dev->d_partition < 0) {
+		/* no partition, must be after the slice */
+		DEBUG("opening raw slice");
+		dev->d_offset = sector;
+		rc = 0;
+		goto out;
+	}
+
+	rc = dev->d_dev->dv_strategy(dev, F_READ, sector + LABELSECTOR,
+            DISK_SECSIZE, (char *) buf, NULL);
+	if (rc) {
+		DEBUG("error reading disklabel");
+		goto out;
+	}
+
+	lp = (struct disklabel *) buf;
+
+	if (lp->d_magic != DISKMAGIC) {
+		DEBUG("no disklabel");
+		rc = ENOENT;
+		goto out;
+	}
+	if (dev->d_partition >= lp->d_npartitions) {
+		DEBUG("partition '%c' exceeds partitions in table (a-'%c')",
+		  'a' + dev->d_partition,
+		  'a' + lp->d_npartitions);
+		rc = EPART;
+		goto out;
+	}
+
+	dev->d_offset =
+		lp->d_partitions[dev->d_partition].p_offset -
+		lp->d_partitions[RAW_PART].p_offset +
+		sector;
+	rc = 0;
+
+out:
+	if (slicetab)
+		free(slicetab);
+	return (rc);
+}
+
+/*
+ * Print out each valid partition in the disklabel of a FreeBSD slice.
+ * For size calculations, we assume a 512 byte sector size.
+ */
+static void
+disk_printbsdslice(struct disk_devdesc *dev, daddr_t offset,
+    char *prefix, int verbose)
+{
+	char			line[80];
+	char			buf[DISK_SECSIZE];
+	struct disklabel	*lp;
+	int			i, rc, fstype;
+
+	/* read disklabel */
+	rc = dev->d_dev->dv_strategy(dev, F_READ, offset + LABELSECTOR,
+		DISK_SECSIZE, (char *) buf, NULL);
+	if (rc)
+		return;
+	lp =(struct disklabel *)(&buf[0]);
+	if (lp->d_magic != DISKMAGIC) {
+		sprintf(line, "%s: FFS  bad disklabel\n", prefix);
+		pager_output(line);
+		return;
+	}
+
+	/* Print partitions */
+	for (i = 0; i < lp->d_npartitions; i++) {
+		/*
+		 * For each partition, make sure we know what type of fs it
+		 * is.  If not, then skip it.
+		 */
+		fstype = lp->d_partitions[i].p_fstype;
+		if (fstype != FS_BSDFFS &&
+		    fstype != FS_SWAP &&
+		    fstype != FS_VINUM)
+			continue;
+
+		/* Only print out statistics in verbose mode */
+		if (verbose)
+			sprintf(line, "  %s%c: %s %s (%d - %d)\n",
+				prefix, 'a' + i,
+			    (fstype == FS_SWAP) ? "swap " :
+			    (fstype == FS_VINUM) ? "vinum" :
+			    "FFS  ",
+			    display_size(lp->d_partitions[i].p_size),
+			    lp->d_partitions[i].p_offset,
+			    (lp->d_partitions[i].p_offset
+			     + lp->d_partitions[i].p_size));
+		else
+			sprintf(line, "  %s%c: %s\n", prefix, 'a' + i,
+			    (fstype == FS_SWAP) ? "swap" :
+			    (fstype == FS_VINUM) ? "vinum" :
+			    "FFS");
+		pager_output(line);
+	}
+}
+
+static void
+disk_printslice(struct disk_devdesc *dev, int slice,
+    struct dos_partition *dp, char *prefix, int verbose)
+{
+	char stats[80];
+	char line[80];
+
+	if (verbose)
+		sprintf(stats, " %s (%d - %d)", display_size(dp->dp_size),
+		    dp->dp_start, dp->dp_start + dp->dp_size);
+	else
+		stats[0] = '\0';
+
+	switch (dp->dp_typ) {
+	case DOSPTYP_386BSD:
+		disk_printbsdslice(dev, (daddr_t)dp->dp_start,
+		     prefix, verbose);
+		return;
+	case DOSPTYP_LINSWP:
+		sprintf(line, "%s: Linux swap%s\n", prefix, stats);
+		break;
+	case DOSPTYP_LINUX:
+		/*
+		 * XXX
+		 * read the superblock to confirm this is an ext2fs partition?
+		 */
+		sprintf(line, "%s: ext2fs%s\n", prefix, stats);
+		break;
+	case 0x00:				/* unused partition */
+	case DOSPTYP_EXT:
+		return;
+	case 0x01:
+		sprintf(line, "%s: FAT-12%s\n", prefix, stats);
+		break;
+	case 0x04:
+	case 0x06:
+	case 0x0e:
+		sprintf(line, "%s: FAT-16%s\n", prefix, stats);
+		break;
+	case 0x07:
+		sprintf(line, "%s: NTFS/HPFS%s\n", prefix, stats);
+		break;
+	case 0x0b:
+	case 0x0c:
+		sprintf(line, "%s: FAT-32%s\n", prefix, stats);
+		break;
+	default:
+		sprintf(line, "%s: Unknown fs: 0x%x %s\n", prefix, dp->dp_typ,
+		    stats);
+	}
+	pager_output(line);
+}
+
+int
+disk_printmbr(struct disk_devdesc *dev, char *prefix, int verbose)
+{
+	struct dos_partition	*slicetab;
+	int			nslices, i;
+	int			rc;
+	char			line[80];
+
+	rc = disk_readslicetab(dev, &slicetab, &nslices);
+	if (rc)
+		return (rc);
+	for (i = 0; i < nslices; i++) {
+		sprintf(line, "%ss%d", prefix, i + 1);
+		disk_printslice(dev, i, &slicetab[i], line, verbose);
+	}
+	free(slicetab);
+	return (0);
+}
+
+#ifdef LOADER_GPT_SUPPORT
+
+static int
+disk_readgpt(struct disk_devdesc *dev, struct gpt_part **gptp, int *ngptp)
+{
+	struct dos_partition	*dp;
+	struct gpt_hdr		*hdr;
+	struct gpt_ent		*ent;
+	struct gpt_part		*gptab = NULL;
+	int			entries_per_sec, rc, i, part;
+	daddr_t			lba, elba;
+	uint8_t			gpt[DISK_SECSIZE], tbl[DISK_SECSIZE];
+
+	/*
+	 * Following calculations attempt to determine the correct value
+	 * for dev->d_offset by looking for the slice and partition specified,
+	 * or searching for reasonable defaults.
+	 */
+	rc = 0;
+
+	/* First, read the MBR and see if we have a PMBR. */
+	rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE,
+		(char *) tbl, NULL);
+	if (rc) {
+		DEBUG("error reading MBR");
+		return (EIO);
+	}
+
+	/* Check the slice table magic. */
+	if (tbl[0x1fe] != 0x55 || tbl[0x1ff] != 0xaa)
+		return (ENXIO);
+
+	/* Check for GPT slice. */
+	part = 0;
+	dp = (struct dos_partition *)(tbl + DOSPARTOFF);
+	for (i = 0; i < NDOSPART; i++) {
+		if (dp[i].dp_typ == 0xee)
+			part++;
+		else if ((part != 1) && (dp[i].dp_typ != 0x00))
+			return (EINVAL);
+	}
+	if (part != 1)
+		return (EINVAL);
+
+	/* Read primary GPT table header. */
+	rc = dev->d_dev->dv_strategy(dev, F_READ, 1, DISK_SECSIZE,
+		(char *) gpt, NULL);
+	if (rc) {
+		DEBUG("error reading GPT header");
+		return (EIO);
+	}
+	hdr = (struct gpt_hdr *)gpt;
+	if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 ||
+	    hdr->hdr_lba_self != 1 || hdr->hdr_revision < 0x00010000 ||
+	    hdr->hdr_entsz < sizeof(*ent) ||
+	    DISK_SECSIZE % hdr->hdr_entsz != 0) {
+		DEBUG("Invalid GPT header\n");
+		return (EINVAL);
+	}
+
+	/* Walk the partition table to count valid partitions. */
+	part = 0;
+	entries_per_sec = DISK_SECSIZE / hdr->hdr_entsz;
+	elba = hdr->hdr_lba_table + hdr->hdr_entries / entries_per_sec;
+	for (lba = hdr->hdr_lba_table; lba < elba; lba++) {
+		rc = dev->d_dev->dv_strategy(dev, F_READ, lba, DISK_SECSIZE,
+			(char *) tbl, NULL);
+		if (rc) {
+			DEBUG("error reading GPT table");
+			return (EIO);
+		}
+		for (i = 0; i < entries_per_sec; i++) {
+			ent = (struct gpt_ent *)(tbl + i * hdr->hdr_entsz);
+			if (uuid_is_nil(&ent->ent_type, NULL) ||
+			    ent->ent_lba_start == 0 ||
+			    ent->ent_lba_end < ent->ent_lba_start)
+				continue;
+			part++;
+		}
+	}
+
+	/* Save the important information about all the valid partitions. */
+	if (part != 0) {
+		gptab = malloc(part * sizeof(struct gpt_part));
+		part = 0;
+		for (lba = hdr->hdr_lba_table; lba < elba; lba++) {
+			rc = dev->d_dev->dv_strategy(dev, F_READ, lba, DISK_SECSIZE,
+				(char *) tbl, NULL);
+			if (rc) {
+				DEBUG("error reading GPT table");
+				free(gptab);
+				return (EIO);
+			}
+			for (i = 0; i < entries_per_sec; i++) {
+				ent = (struct gpt_ent *)(tbl + i * hdr->hdr_entsz);
+				if (uuid_is_nil(&ent->ent_type, NULL) ||
+				    ent->ent_lba_start == 0 ||
+				    ent->ent_lba_end < ent->ent_lba_start)
+					continue;
+				gptab[part].gp_index = (lba - hdr->hdr_lba_table) *
+					entries_per_sec + i + 1;
+				gptab[part].gp_type = ent->ent_type;
+				gptab[part].gp_start = ent->ent_lba_start;
+				gptab[part].gp_end = ent->ent_lba_end;
+				part++;
+			}
+		}
+	}
+
+	*gptp = gptab;
+	*ngptp = part;
+	return (0);
+}
+
+static struct gpt_part *
+disk_bestgpt(struct gpt_part *gpt, int ngpt)
+{
+	struct gpt_part *gp, *prefpart;
+	int i, pref, preflevel;
+
+	prefpart = NULL;
+	preflevel = PREF_NONE;
+
+	gp = gpt;
+	for (i = 0; i < ngpt; i++, gp++) {
+		/* Windows. XXX: Also Linux. */
+		if (uuid_equal(&gp->gp_type, &ms_basic_data, NULL))
+			pref = PREF_DOS;
+		/* FreeBSD */
+		else if (uuid_equal(&gp->gp_type, &freebsd_ufs, NULL) ||
+		         uuid_equal(&gp->gp_type, &freebsd_zfs, NULL))
+			pref = PREF_FBSD;
+		else
+			pref = PREF_NONE;
+		if (pref < preflevel) {
+			preflevel = pref;
+			prefpart = gp;
+		}
+	}
+	return (prefpart);
+}
+
+int
+disk_opengpt(struct disk_devdesc *dev)
+{
+	struct gpt_part		*gpt = NULL, *gp;
+	int			rc, ngpt, i;
+
+	rc = disk_readgpt(dev, &gpt, &ngpt);
+	if (rc)
+		return (rc);
+
+	/* Is this a request for the whole disk? */
+	if (dev->d_slice < 0) {
+		dev->d_offset = 0;
+		rc = 0;
+		goto out;
+	}
+
+	/*
+	 * If a partition number was supplied, then the user is trying to use
+	 * an MBR address rather than a GPT address, so fail.
+	 */
+	if (dev->d_partition != 0xff) {
+		rc = ENOENT;
+		goto out;
+	}
+
+	/* If a slice number was supplied but not found, this is an error. */
+	gp = NULL;
+	if (dev->d_slice > 0) {
+		for (i = 0; i < ngpt; i++) {
+			if (gpt[i].gp_index == dev->d_slice) {
+				gp = &gpt[i];
+				break;
+			}
+		}
+		if (gp == NULL) {
+			DEBUG("partition %d not found", dev->d_slice);
+			rc = ENOENT;
+			goto out;
+		}
+	}
+
+	/* Try to auto-detect the best partition. */
+	if (dev->d_slice == 0) {
+		gp = disk_bestgpt(gpt, ngpt);
+		if (gp == NULL) {
+			rc = ENOENT;
+			goto out;
+		}
+		dev->d_slice = gp->gp_index;
+	}
+
+	dev->d_offset = gp->gp_start;
+	rc = 0;
+
+out:
+	if (gpt)
+		free(gpt);
+	return (rc);
+}
+
+static void
+disk_printgptpart(struct disk_devdesc *dev, struct gpt_part *gp,
+    char *prefix, int verbose)
+{
+	char stats[80];
+	char line[96];
+
+	if (verbose)
+		sprintf(stats, " %s",
+			display_size(gp->gp_end + 1 - gp->gp_start));
+	else
+		stats[0] = '\0';
+
+	if (uuid_equal(&gp->gp_type, &efi, NULL))
+		sprintf(line, "%s: EFI         %s\n", prefix, stats);
+	else if (uuid_equal(&gp->gp_type, &ms_basic_data, NULL))
+		sprintf(line, "%s: FAT/NTFS    %s\n", prefix, stats);
+	else if (uuid_equal(&gp->gp_type, &freebsd_boot, NULL))
+		sprintf(line, "%s: FreeBSD boot%s\n", prefix, stats);
+	else if (uuid_equal(&gp->gp_type, &freebsd_ufs, NULL))
+		sprintf(line, "%s: FreeBSD UFS %s\n", prefix, stats);
+	else if (uuid_equal(&gp->gp_type, &freebsd_zfs, NULL))
+		sprintf(line, "%s: FreeBSD ZFS %s\n", prefix, stats);
+	else if (uuid_equal(&gp->gp_type, &freebsd_swap, NULL))
+		sprintf(line, "%s: FreeBSD swap%s\n", prefix, stats);
+	else
+		sprintf(line,
+		    "%s: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x%s\n",
+		    prefix,
+		    gp->gp_type.time_low, gp->gp_type.time_mid,
+		    gp->gp_type.time_hi_and_version,
+		    gp->gp_type.clock_seq_hi_and_reserved,
+		    gp->gp_type.clock_seq_low,
+		    gp->gp_type.node[0],
+		    gp->gp_type.node[1],
+		    gp->gp_type.node[2],
+		    gp->gp_type.node[3],
+		    gp->gp_type.node[4],
+		    gp->gp_type.node[5],
+		    stats);
+	pager_output(line);
+}
+
+static int
+disk_printgpt(struct disk_devdesc *dev, char *prefix, int verbose)
+{
+	struct gpt_part		*gpt = NULL;
+	int			rc, ngpt, i;
+	char			line[80];
+
+	rc = disk_readgpt(dev, &gpt, &ngpt);
+	if (rc)
+		return (rc);
+	for (i = 0; i < ngpt; i++) {
+		sprintf(line, "%sp%d", prefix, i + 1);
+		disk_printgptpart(dev, &gpt[i], line, verbose);
+	}
+	free(gpt);
+	return (0);
+}
+
+#endif
+
+int
+disk_open(struct disk_devdesc *dev)
+{
+	int rc;
+
+	/*
+	 * While we are reading disk metadata, make sure we do it relative
+	 * to the start of the disk
+	 */
+	dev->d_offset = 0;
+
+#ifdef LOADER_GPT_SUPPORT
+	rc = disk_opengpt(dev);
+	if (rc)
+#endif
+		rc = disk_openmbr(dev);
+
+	return (rc);
+}
+
+void
+disk_print(struct disk_devdesc *dev, char *prefix, int verbose)
+{
+	int			rc;
+
+#ifdef LOADER_GPT_SUPPORT
+	rc = disk_printgpt(dev, prefix, verbose);
+	if (rc == 0)
+		return;
+#endif
+	disk_printmbr(dev, prefix, verbose);
+}

Added: head/sys/boot/common/disk.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/boot/common/disk.h	Thu Jun 30 16:08:56 2011	(r223695)
@@ -0,0 +1,99 @@
+/*-
+ * Copyright (c) 2011 Google, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * Device descriptor for partitioned disks. We assume that all disk addresses
+ * are 512 byte block offsets from the start of the disk. To use, set the
+ * d_slice and d_partition variables as follows:
+ *
+ * Whole disk access:
+ *
+ * 	d_slice = -1
+ * 	d_partition = -1
+ *
+ * Whole MBR slice:
+ *
+ * 	d_slice = MBR slice number (typically 1..4)
+ * 	d_partition = -1
+ *
+ * BSD disklabel partition within an MBR slice:
+ *
+ * 	d_slice = MBR slice number (typically 1..4)
+ * 	d_partition = disklabel partition (typically 0..7)
+ *
+ * GPT partition:
+ *
+ * 	d_slice = GPT partition number (typically 1..N)
+ * 	d_partition = 255
+ *
+ * For both MBR and GPT, to automatically find the 'best' slice or partition,
+ * set d_slice to zero. This uses the partition type to decide which partition
+ * to use according to the following list of preferences:
+ *
+ * 	FreeBSD (active)
+ * 	FreeBSD (inactive)
+ * 	Linux (active)
+ * 	Linux (inactive)
+ * 	DOS/Windows (active)
+ * 	DOS/Windows (inactive)
+ *
+ * Active MBR slices (marked as bootable) are preferred over inactive. GPT
+ * doesn't have the concept of active/inactive partitions. In both MBR and GPT,
+ * if there are multiple slices/partitions of a given type, the first one
+ * is chosen.
+ *
+ * The low-level disk device will typically call slice_open() from its open
+ * method to interpret the disk partition tables according to the rules above.
+ * This will initialize d_offset to the block offset of the start of the
+ * selected partition - this offset should be added to the offset passed to
+ * the device's strategy method.
+ */
+
+#define DISK_SECSIZE	512
+
+struct disk_devdesc
+{
+	struct devsw	*d_dev;
+	int		d_type;
+	int		d_unit;
+	void		*d_opendata;
+	int		d_slice;
+	int		d_partition;
+	int		d_offset;
+};
+
+/*
+ * Parse disk metadata and initialise dev->d_offset.
+ */
+extern int disk_open(struct disk_devdesc * dev);
+
+/*
+ * Print information about slices on a disk.  For the size calculations we
+ * assume a 512 byte sector.
+ */
+extern void disk_print(struct disk_devdesc *dev, char *prefix, int verbose);

Modified: head/sys/boot/common/load_elf.c
==============================================================================
--- head/sys/boot/common/load_elf.c	Thu Jun 30 15:22:49 2011	(r223694)
+++ head/sys/boot/common/load_elf.c	Thu Jun 30 16:08:56 2011	(r223695)
@@ -260,7 +260,7 @@ __elfN(loadimage)(struct preloaded_file 
     firstaddr = lastaddr = 0;
     ehdr = ef->ehdr;
     if (ef->kernel) {
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
 #if __ELF_WORD_SIZE == 64
 	off = - (off & 0xffffffffff000000ull);/* x86_64 relocates after locore */
 #else

Modified: head/sys/boot/common/reloc_elf.c
==============================================================================
--- head/sys/boot/common/reloc_elf.c	Thu Jun 30 15:22:49 2011	(r223694)
+++ head/sys/boot/common/reloc_elf.c	Thu Jun 30 16:08:56 2011	(r223695)
@@ -78,7 +78,7 @@ __elfN(reloc)(struct elf_file *ef, symad
 	}
 
 	return (0);
-#elif defined(__i386__) && __ELF_WORD_SIZE == 64
+#elif (defined(__i386__) || defined(__amd64__)) && __ELF_WORD_SIZE == 64
 	Elf64_Addr *where, val;
 	Elf_Addr addend, addr;
 	Elf_Size rtype, symidx;

Added: head/sys/boot/ficl/amd64/sysdep.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/boot/ficl/amd64/sysdep.c	Thu Jun 30 16:08:56 2011	(r223695)
@@ -0,0 +1,101 @@
+/*******************************************************************
+** s y s d e p . c
+** Forth Inspired Command Language
+** Author: John Sadler (john_sadler@alum.mit.edu)
+** Created: 16 Oct 1997
+** Implementations of FICL external interface functions... 
+**
+*******************************************************************/
+
+/* $FreeBSD$ */
+
+#ifdef TESTMAIN
+#include 
+#include 
+#else
+#include 
+#endif
+#include "ficl.h"
+
+/*
+*******************  FreeBSD  P O R T   B E G I N S   H E R E ******************** Michael Smith
+*/
+
+#if PORTABLE_LONGMULDIV == 0
+DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y)
+{
+    DPUNS q;
+    u_int64_t qx;
+
+    qx = (u_int64_t)x * (u_int64_t) y;
+
+    q.hi = (u_int32_t)( qx >> 32 );
+    q.lo = (u_int32_t)( qx & 0xFFFFFFFFL);
+
+    return q;
+}
+
+UNSQR ficlLongDiv(DPUNS q, FICL_UNS y)
+{
+    UNSQR result;
+    u_int64_t qx, qh;
+
+    qh = q.hi;
+    qx = (qh << 32) | q.lo;
+
+    result.quot = qx / y;
+    result.rem  = qx % y;
+
+    return result;
+}
+#endif
+
+void  ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
+{
+    IGNORE(pVM);
+
+    while(*msg != 0)
+	putchar(*(msg++));
+    if (fNewline)
+	putchar('\n');
+
+   return;
+}
+
+void *ficlMalloc (size_t size)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 16:44:54 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2052E106579F;
	Thu, 30 Jun 2011 16:44:54 +0000 (UTC)
	(envelope-from grehan@freebsd.org)
Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12])
	by mx1.freebsd.org (Postfix) with ESMTP id D0EA08FC0A;
	Thu, 30 Jun 2011 16:44:53 +0000 (UTC)
Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57])
	by alto.onthenet.com.au (Postfix) with ESMTPS id C9EFE11CAB;
	Fri,  1 Jul 2011 02:24:33 +1000 (EST)
Received: from Peter-Grehans-MacBook-Pro.local (pos-ext.netapp.com
	[198.95.226.40]) by dommail.onthenet.com.au (MOS 4.1.10-GA)
	with ESMTP id AWT04768 (AUTH peterg@ptree32.com.au);
	Fri, 1 Jul 2011 02:14:36 +1000
Message-ID: <4E0CA0E8.9090805@freebsd.org>
Date: Thu, 30 Jun 2011 10:14:32 -0600
From: Peter Grehan 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
	rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
MIME-Version: 1.0
To: Doug Rabson 
References: <201106301608.p5UG8ulA050570@svn.freebsd.org>
In-Reply-To: <201106301608.p5UG8ulA050570@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r223695 - in head/sys/boot: . common ficl/amd64
 i386/libi386
 userboot userboot/ficl userboot/libstand userboot/libstand/amd64
 userboot/test userboot/userboot
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 16:44:54 -0000

> Log:
>    Add a version of the FreeBSD bootloader which can run in userland, packaged
>    as a shared library. This is intended to be used by BHyVe to load FreeBSD
>    kernels into new virtual machines.

  Thankyou so much for this work Doug !

later,

Peter.

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 16:56:55 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7C7BC106566C;
	Thu, 30 Jun 2011 16:56:55 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6CF0F8FC08;
	Thu, 30 Jun 2011 16:56:55 +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 p5UGutIN052093;
	Thu, 30 Jun 2011 16:56:55 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5UGutCd052090;
	Thu, 30 Jun 2011 16:56:55 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201106301656.p5UGutCd052090@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 30 Jun 2011 16:56:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223697 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 16:56:55 -0000

Author: tuexen
Date: Thu Jun 30 16:56:55 2011
New Revision: 223697
URL: http://svn.freebsd.org/changeset/base/223697

Log:
  Add the missing sca_keylength field to the sctp_authkey structure,
  which is used the the SCTP_AUTH_KEY socket option.
  
  MFC after: 1 month.

Modified:
  head/sys/netinet/sctp_uio.h
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_uio.h
==============================================================================
--- head/sys/netinet/sctp_uio.h	Thu Jun 30 16:13:00 2011	(r223696)
+++ head/sys/netinet/sctp_uio.h	Thu Jun 30 16:56:55 2011	(r223697)
@@ -591,6 +591,7 @@ struct sctp_authchunk {
 struct sctp_authkey {
 	sctp_assoc_t sca_assoc_id;
 	uint16_t sca_keynumber;
+	uint16_t sca_keylength;
 	uint8_t sca_key[];
 };
 

Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c	Thu Jun 30 16:13:00 2011	(r223696)
+++ head/sys/netinet/sctp_usrreq.c	Thu Jun 30 16:56:55 2011	(r223697)
@@ -3571,8 +3571,18 @@ sctp_setopt(struct socket *so, int optna
 			size_t size;
 
 			SCTP_CHECK_AND_CAST(sca, optval, struct sctp_authkey, optsize);
+			if (sca->sca_keylength == 0) {
+				size = optsize - sizeof(struct sctp_authkey);
+			} else {
+				if (sca->sca_keylength + sizeof(struct sctp_authkey) <= optsize) {
+					size = sca->sca_keylength;
+				} else {
+					SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+					error = EINVAL;
+					break;
+				}
+			}
 			SCTP_FIND_STCB(inp, stcb, sca->sca_assoc_id);
-			size = optsize - sizeof(struct sctp_authkey);
 
 			if (stcb) {
 				shared_keys = &stcb->asoc.shared_keys;

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 19:23:17 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5932106567B;
	Thu, 30 Jun 2011 19:23:17 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D61918FC14;
	Thu, 30 Jun 2011 19:23:17 +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 p5UJNHMd056471;
	Thu, 30 Jun 2011 19:23:17 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5UJNHXB056469;
	Thu, 30 Jun 2011 19:23:17 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201106301923.p5UJNHXB056469@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 30 Jun 2011 19:23:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223699 - head/sys/dev/ahci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 19:23:18 -0000

Author: mav
Date: Thu Jun 30 19:23:17 2011
New Revision: 223699
URL: http://svn.freebsd.org/changeset/base/223699

Log:
  Add ID for Marvell 88SE9125 SATA controller.
  
  PR:		kern/157843
  MFC after:	1 week

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Thu Jun 30 17:37:42 2011	(r223698)
+++ head/sys/dev/ahci/ahci.c	Thu Jun 30 19:23:17 2011	(r223699)
@@ -195,6 +195,7 @@ static struct {
 	{0x91201b4b, 0x00, "Marvell 88SE912x",	AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES},
 	{0x91231b4b, 0x11, "Marvell 88SE912x",	AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x91231b4b, 0x00, "Marvell 88SE912x",	AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES},
+	{0x91251b4b, 0x00, "Marvell 88SE9125",	AHCI_Q_NOBSYRES},
 	{0x91721b4b, 0x00, "Marvell 88SE9172",	AHCI_Q_NOBSYRES},
 	{0x91821b4b, 0x00, "Marvell 88SE9182",	AHCI_Q_NOBSYRES},
 	{0x06201103, 0x00, "HighPoint RocketRAID 620",	AHCI_Q_NOBSYRES},

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 20:34:55 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D93E1065672;
	Thu, 30 Jun 2011 20:34:55 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6C0B68FC21;
	Thu, 30 Jun 2011 20:34:55 +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 p5UKYt4E058592;
	Thu, 30 Jun 2011 20:34:55 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5UKYt6M058589;
	Thu, 30 Jun 2011 20:34:55 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201106302034.p5UKYt6M058589@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Thu, 30 Jun 2011 20:34:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223700 - head/sys/ia64/ia64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 20:34:55 -0000

Author: marcel
Date: Thu Jun 30 20:34:55 2011
New Revision: 223700
URL: http://svn.freebsd.org/changeset/base/223700

Log:
  Change the management of nested faults by switching to physical
  addressing while reading or writing the trap frame. It's not
  possible to guarantee that the one translation cache entry that
  we depend on is not going to get purged by the CPU. We already
  know that global shootdowns (ptc.g and/or ptc.ga) can (and will)
  cause multiple TC entries to get purged and we initialize tried
  to handle that by serializing kernel entry with these operations.
  However, we need to serialize kernel exit as well.
  
  But even if we can serialize, it appears that CPU threads within
  a core can affect each other's TC entries beyond the global
  shootdown. This would mean serializing any and all translatation
  cache updates with the threads in a core with the kernel entry
  and exit of any thread in that core. This is just too painful
  and complicated.
  
  Since we already properly coded for the 2 nested faults that we
  can get, all we need to do is use those to obtain the physical
  address of the trap frame, switch to physical mode and in that
  way eliminate any further faults. The trap frame is already
  aligned to 1KB boundaries to make sure we don't cross the page
  boundary, this is safe to do.
  
  We still need to serialize ptc.g or ptc.ga across CPUs because
  the platform can only have 1 such operation outstanding at the
  same time. We can now use a regular (spin) lock for this.
  
  Also, it has been observed that we can get a nested TLB faults
  for region 7 virtual addresses. This was unexpected. For now,
  we enhance the nested TLB fault handler to deal with those as
  well, but it needs to be understood.

Modified:
  head/sys/ia64/ia64/exception.S
  head/sys/ia64/ia64/pmap.c

Modified: head/sys/ia64/ia64/exception.S
==============================================================================
--- head/sys/ia64/ia64/exception.S	Thu Jun 30 19:23:17 2011	(r223699)
+++ head/sys/ia64/ia64/exception.S	Thu Jun 30 20:34:55 2011	(r223700)
@@ -50,9 +50,6 @@ __FBSDID("$FreeBSD$");
 
 	.section .ivt.data, "aw"
 
-	.global pmap_ptc_g_sem
-pmap_ptc_g_sem:	data8	0
-
 	.global ia64_kptdir
 ia64_kptdir:	data8	0
 
@@ -151,58 +148,51 @@ ENTRY_NOPROFILE(exception_save, 0)
 }
 {	.mmi
 	mov		ar.rsc=0
-	sub		r19=r23,r30
-	add		r31=8,r30
-	;;
-}
-{	.mmi
 	mov		r22=cr.iip
-	nop		0
 	addl		r29=NTLBRT_SAVE,r0	// 22-bit restart token.
 	;;
 }
 
 	/*
-	 * We have a 1KB aligned trapframe, pointed to by sp. If we write
-	 * to the trapframe, we may trigger a data nested TLB fault. By
-	 * aligning the trapframe on a 1KB boundary, we guarantee that if
-	 * we get a data nested TLB fault, it will be on the very first
-	 * write. Since the data nested TLB fault does not preserve any
-	 * state, we have to be careful what we clobber. Consequently, we
-	 * have to be careful what we use here. Below a list of registers
-	 * that are currently alive:
+	 * We have a 1KB aligned trapframe, pointed to by r30. We can't
+	 * reliably write to the trapframe using virtual addressing, due
+	 * to the fact that TC entries we depend on can be removed by:
+	 * 1.  ptc.g instructions issued by other threads/cores/CPUs, or
+	 * 2.  TC modifications in another thread on the same core.
+	 * When our TC entry gets removed, we get nested TLB faults and
+	 * since no state is saved, we can only deal with those when
+	 * explicitly coded and expected.
+	 * As such, we switch to physical addressing and account for the
+	 * fact that the tpa instruction can cause a nested TLB fault.
+	 * Since the data nested TLB fault does not preserve any state,
+	 * we have to be careful what we clobber. Consequently, we have
+	 * to be careful what we use here. Below a list of registers that
+	 * are considered alive:
 	 *	r16,r17=arguments
 	 *	r18=pr, r19=length, r20=unat, r21=rsc, r22=iip, r23=TOS
-	 *	r29=restart point
-	 *	r30,r31=trapframe pointers
+	 *	r29=restart token
+	 *	r30=trapframe pointers
 	 *	p14,p15=memory stack switch
 	 */
-
-	/* PTC.G enter non-exclusive */
-	mov	r24 = ar.ccv
-	movl	r25 = pmap_ptc_g_sem
-	;;
-.ptc_g_0:
-	ld8.acq	r26 = [r25]
-	;;
-	tbit.nz	p12, p0 = r26, 63
-(p12)	br.cond.spnt.few .ptc_g_0
-	;;
-	mov	ar.ccv = r26
-	adds	r27 = 1, r26
+exception_save_restart:
+	tpa		r24=r30			// Nested TLB fault possible
+	sub		r19=r23,r30
+	nop		0
 	;;
-	cmpxchg8.rel	r27 = [r25], r27, ar.ccv
+
+	rsm		psr.dt
+	add		r29=16,r19		// Clobber restart token
+	mov		r30=r24
 	;;
-	cmp.ne	p12, p0 = r26, r27
-(p12)	br.cond.spnt.few .ptc_g_0
+	srlz.d
+	add		r31=8,r24
 	;;
-	mov	ar.ccv = r24
 
-exception_save_restart:
+	// r18=pr, r19=length, r20=unat, r21=rsc, r22=iip, r23=TOS
+	// r29=delta
 {	.mmi
 	st8		[r30]=r19,16		// length
 	st8		[r31]=r0,16		// flags
-	add		r29=16,r19		// Clobber restart token
 	;;
 }
 {	.mmi
@@ -218,6 +208,7 @@ exception_save_restart:
 	;;
 }
 	// r18=pr, r19=rnat, r20=bspstore, r21=rsc, r22=iip, r23=rp
+	// r24=pfs
 {	.mmi
 	st8		[r30]=r23,16		// rp
 	st8		[r31]=r18,16		// pr
@@ -275,7 +266,7 @@ exception_save_restart:
 	sub		r18=r18,r20
 	;;
 }
-	// r19=ifs, r22=iip
+	// r18=ndirty, r19=ifs, r22=iip
 {	.mmi
 	st8		[r31]=r18,16		// ndirty
 	st8		[r30]=r19,16		// cfm
@@ -431,27 +422,10 @@ exception_save_restart:
 	;;
 }
 {	.mlx
-	ssm		psr.ic|psr.dfh
+	ssm		psr.dt|psr.ic|psr.dfh
 	movl		gp=__gp
 	;;
 }
-
-	/* PTC.G leave non-exclusive */
-	srlz.d
-	movl	r25 = pmap_ptc_g_sem
-	;;
-.ptc_g_1:
-	ld8.acq r26 = [r25]
-	;;
-	mov	ar.ccv = r26
-	adds	r27 = -1, r26
-	;;
-	cmpxchg8.rel	r27 = [r25], r27, ar.ccv
-	;;
-	cmp.ne	p12, p0 = r26, r27
-(p12)	br.cond.spnt.few .ptc_g_1
-	;;
-
 {	.mib
 	srlz.d
 	nop		0
@@ -469,34 +443,52 @@ END(exception_save)
 ENTRY_NOPROFILE(exception_restore, 0)
 {	.mmi
 	rsm		psr.i
-	add		r3=SIZEOF_TRAPFRAME-16,sp
-	add		r2=SIZEOF_TRAPFRAME,sp
+	add		sp=16,sp
+	nop		0
 	;;
 }
-{	.mmi
+
+	// The next instruction can fault. Let it be...
+	tpa		r9=sp
+	;;
+	rsm		psr.dt|psr.ic
+	add		r8=SIZEOF_SPECIAL+16,r9
+	;;
 	srlz.d
-	add		r8=SIZEOF_SPECIAL+32,sp
-	nop		0
+	add		r2=SIZEOF_TRAPFRAME-16,r9
+	add		r3=SIZEOF_TRAPFRAME-32,r9
 	;;
-}
-	// The next load can trap. Let it be...
+
+{	.mmi
 	ldf.fill	f15=[r2],-32		// f15
 	ldf.fill	f14=[r3],-32		// f14
-	add		sp=16,sp
+	nop		0
 	;;
+}
+{	.mmi
 	ldf.fill	f13=[r2],-32		// f13
 	ldf.fill	f12=[r3],-32		// f12
+	nop		0
 	;;
+}
+{	.mmi
 	ldf.fill	f11=[r2],-32		// f11
 	ldf.fill	f10=[r3],-32		// f10
+	nop		0
 	;;
+}
+{	.mmi
 	ldf.fill	f9=[r2],-32		// f9
 	ldf.fill	f8=[r3],-32		// f8
+	nop		0
 	;;
+}
+{	.mmi
 	ldf.fill	f7=[r2],-24		// f7
 	ldf.fill	f6=[r3],-16		// f6
+	nop		0
 	;;
-
+}
 {	.mmi
 	ld8		r8=[r8]			// unat (after)
 	;;
@@ -553,53 +545,53 @@ ENTRY_NOPROFILE(exception_restore, 0)
 	bsw.0
 	;;
 }
+{	.mii
+	ld8		r16=[r9]		// tf_length
+	add		r31=16,r9
+	add		r30=24,r9
+}
 {	.mmi
 	ld8.fill	r15=[r3],-16		// r15
 	ld8.fill	r14=[r2],-16		// r14
-	add		r31=16,sp
+	nop		0
 	;;
 }
 {	.mmi
-	ld8		r16=[sp]		// tf_length
 	ld8.fill	r11=[r3],-16		// r11
-	add		r30=24,sp
-	;;
-}
-{	.mmi
 	ld8.fill	r10=[r2],-16		// r10
-	ld8.fill	r9=[r3],-16		// r9
 	add		r16=r16,sp		// ar.k7
 	;;
 }
 {	.mmi
+	ld8.fill	r9=[r3],-16		// r9
 	ld8.fill	r8=[r2],-16		// r8
-	ld8.fill	r3=[r3]			// r3
+	nop		0
 	;;
 }
-	// We want nested TLB faults from here on...
-	rsm		psr.ic|psr.i
+{	.mmi
+	ld8.fill	r3=[r3]			// r3
 	ld8.fill	r2=[r2]			// r2
 	nop		0
 	;;
-	srlz.d
-	ld8.fill	sp=[r31],16		// sp
-	nop		0
-	;;
+}
 
+	ld8.fill	sp=[r31],16		// sp
 	ld8		r17=[r30],16		// unat
-	ld8		r29=[r31],16		// rp
 	;;
+	ld8		r29=[r31],16		// rp
 	ld8		r18=[r30],16		// pr
+	;;
 	ld8		r28=[r31],16		// pfs
+	ld8		r20=[r30],24		// bspstore
 	mov		rp=r29
 	;;
-	ld8		r20=[r30],24		// bspstore
 	ld8		r21=[r31],24		// rnat
 	mov		ar.pfs=r28
 	;;
 	ld8.fill	r26=[r30],16		// tp
 	ld8		r22=[r31],16		// rsc
 	;;
+
 {	.mmi
 	ld8		r23=[r30],16		// fpsr
 	ld8		r24=[r31],16		// psr
@@ -636,6 +628,11 @@ ENTRY_NOPROFILE(exception_restore, 0)
 	addl		r29=NTLBRT_RESTORE,r0	// 22-bit restart token 
 	;;
 }
+
+	ssm		psr.dt
+	;;
+	srlz.d
+
 exception_restore_restart:
 {	.mmi
 	mov		r30=ar.bspstore
@@ -1015,15 +1012,33 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400)
 	// here are direct mapped region 7 addresses, we have no problem
 	// constructing physical addresses.
 
-{	.mlx
+{	.mmi
+	mov		cr.ifa=r30
+	mov		r26=rr[r30]
+	extr.u		r27=r30,61,3
+	;;
+}
+{	.mii
 	nop		0
-	movl		r27=ia64_kptdir
+	dep		r26=0,r26,0,2
+	cmp.eq		p12,p13=7,r27
 	;;
 }
 {	.mii
-	ld8		r27=[r27]
-	extr.u		r28=r30,3*PAGE_SHIFT-8, PAGE_SHIFT-3	// dir L0 index
-	extr.u		r26=r30,2*PAGE_SHIFT-5, PAGE_SHIFT-3	// dir L1 index
+	mov		cr.itir=r26
+(p12)	dep		r28=0,r30,61,3
+(p13)	extr.u		r28=r30,3*PAGE_SHIFT-8, PAGE_SHIFT-3	// dir L0 index
+	;;
+}
+{	.mlx
+(p12)	add		r28=PTE_PRESENT+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+PTE_AR_RWX+PTE_MA_WB,r28
+(p13)	movl		r27=ia64_kptdir
+	;;
+}
+{	.mib
+(p13)	ld8		r27=[r27]
+(p13)	extr.u		r26=r30,2*PAGE_SHIFT-5, PAGE_SHIFT-3	// dir L1 index
+(p12)	br.cond.spnt.few 1f
 	;;
 }
 {	.mmi
@@ -1040,58 +1055,48 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400)
 	extr.u		r28=r30,PAGE_SHIFT,PAGE_SHIFT-5		// pte index
 	;;
 }
-{	.mmi
+{	.mii
 	shladd		r27=r26,3,r27
+	shl		r28=r28,5
 	;;
-	mov		r26=rr[r30]
 	dep		r27=0,r27,61,3
 	;;
 }
-{	.mii
 	ld8		r27=[r27]				// pte page
-	shl		r28=r28,5
-	dep		r26=0,r26,0,2
 	;;
-}
-{	.mmi
 	add		r27=r28,r27
 	;;
-	mov		cr.ifa=r30
 	dep		r27=0,r27,61,3
 	;;
-}
-{	.mmi
-	ld8		r28=[r27]		// pte
+	ld8		r28=[r27]				// pte
 	;;
-	mov		cr.itir=r26
 	or		r28=PTE_DIRTY+PTE_ACCESSED,r28
 	;;
-}
-{	.mmi
 	st8		[r27]=r28
 	;;
-	addl		r26=NTLBRT_SAVE,r0
-	addl		r27=NTLBRT_RESTORE,r0
-}
+	ssm		psr.dt
+	;;
+1:
 {	.mmi
 	itc.d		r28
 	;;
-	ssm		psr.dt
-	cmp.eq		p12,p0=r29,r26
+	addl		r26=NTLBRT_SAVE,r0
+	addl		r27=NTLBRT_RESTORE,r0
 	;;
 }
-{	.mib
+{	.mmi
 	srlz.d
+	cmp.eq		p12,p0=r29,r26
 	cmp.eq		p13,p0=r29,r27
-(p12)	br.cond.sptk.few	exception_save_restart
 	;;
 }
-{	.mib
-	nop		0
+{	.mbb
 	nop		0
+(p12)	br.cond.sptk.few	exception_save_restart
 (p13)	br.cond.sptk.few	exception_restore_restart
 	;;
 }
+
 {	.mlx
 	mov		r26=ar.bsp
 	movl		r29=kstack

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Thu Jun 30 19:23:17 2011	(r223699)
+++ head/sys/ia64/ia64/pmap.c	Thu Jun 30 20:34:55 2011	(r223700)
@@ -179,7 +179,7 @@ static uint64_t pmap_ptc_e_count2 = 2;
 static uint64_t pmap_ptc_e_stride1 = 0x2000;
 static uint64_t pmap_ptc_e_stride2 = 0x100000000;
 
-extern volatile u_long pmap_ptc_g_sem;
+struct mtx pmap_ptc_mutex;
 
 /*
  * Data for the RID allocator
@@ -338,6 +338,8 @@ pmap_bootstrap()
 		       pmap_ptc_e_stride1,
 		       pmap_ptc_e_stride2);
 
+	mtx_init(&pmap_ptc_mutex, "PTC.G mutex", NULL, MTX_SPIN);
+
 	/*
 	 * Setup RIDs. RIDs 0..7 are reserved for the kernel.
 	 *
@@ -528,11 +530,11 @@ pmap_invalidate_page(vm_offset_t va)
 {
 	struct ia64_lpte *pte;
 	struct pcpu *pc;
-	uint64_t tag, sem;
-	register_t is;
+	uint64_t tag;
 	u_int vhpt_ofs;
 
 	critical_enter();
+
 	vhpt_ofs = ia64_thash(va) - PCPU_GET(md.vhpt);
 	tag = ia64_ttag(va);
 	STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
@@ -540,34 +542,16 @@ pmap_invalidate_page(vm_offset_t va)
 		atomic_cmpset_64(&pte->tag, tag, 1UL << 63);
 	}
 
-	/* PTC.G enter exclusive */
-	is = intr_disable();
-
-	/* Atomically assert writer after all writers have gone. */
-	do {
-		/* Wait until there's no more writer. */
-		do {
-			sem = atomic_load_acq_long(&pmap_ptc_g_sem);
-			tag = sem | (1ul << 63);
-		} while (sem == tag);
-	} while (!atomic_cmpset_rel_long(&pmap_ptc_g_sem, sem, tag));
-
-	/* Wait until all readers are gone. */
-	tag = (1ul << 63);
-	do {
-		sem = atomic_load_acq_long(&pmap_ptc_g_sem);
-	} while (sem != tag);
+	mtx_lock_spin(&pmap_ptc_mutex);
 
 	ia64_ptc_ga(va, PAGE_SHIFT << 2);
 	ia64_mf();
 	ia64_srlz_i();
 
-	/* PTC.G leave exclusive */
-	atomic_store_rel_long(&pmap_ptc_g_sem, 0);
+	mtx_unlock_spin(&pmap_ptc_mutex);
 
 	ia64_invala();
 
-	intr_restore(is);
 	critical_exit();
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 20:55:16 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E85B7106566C;
	Thu, 30 Jun 2011 20:55:16 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D84B28FC13;
	Thu, 30 Jun 2011 20:55: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 p5UKtG2Q059306;
	Thu, 30 Jun 2011 20:55:16 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5UKtGO7059304;
	Thu, 30 Jun 2011 20:55:16 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201106302055.p5UKtGO7059304@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Thu, 30 Jun 2011 20:55:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223701 - head/contrib/sendmail/src
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 20:55:17 -0000

Author: trasz
Date: Thu Jun 30 20:55:16 2011
New Revision: 223701
URL: http://svn.freebsd.org/changeset/base/223701

Log:
  Make Sendmail properly set login class and cpumask.

Modified:
  head/contrib/sendmail/src/deliver.c

Modified: head/contrib/sendmail/src/deliver.c
==============================================================================
--- head/contrib/sendmail/src/deliver.c	Thu Jun 30 20:34:55 2011	(r223700)
+++ head/contrib/sendmail/src/deliver.c	Thu Jun 30 20:55:16 2011	(r223701)
@@ -2416,6 +2416,12 @@ tryhost:
 				else
 					pwd = sm_getpwnam(contextaddr->q_user);
 				sucflags = LOGIN_SETRESOURCES|LOGIN_SETPRIORITY;
+#ifdef LOGIN_SETCPUMASK
+				sucflags |= LOGIN_SETCPUMASK;
+#endif /* LOGIN_SETCPUMASK */
+#ifdef LOGIN_SETLOGINCLASS
+				sucflags |= LOGIN_SETLOGINCLASS;
+#endif /* LOGIN_SETLOGINCLASS */
 #ifdef LOGIN_SETMAC
 				sucflags |= LOGIN_SETMAC;
 #endif /* LOGIN_SETMAC */

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 30 20:58:39 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1AB8D106566B;
	Thu, 30 Jun 2011 20:58:39 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A9718FC14;
	Thu, 30 Jun 2011 20:58:39 +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 p5UKwc7N059440;
	Thu, 30 Jun 2011 20:58:38 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5UKwcNC059438;
	Thu, 30 Jun 2011 20:58:38 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201106302058.p5UKwcNC059438@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Thu, 30 Jun 2011 20:58:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223702 - head/contrib/lukemftpd/src
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 30 Jun 2011 20:58:39 -0000

Author: trasz
Date: Thu Jun 30 20:58:38 2011
New Revision: 223702
URL: http://svn.freebsd.org/changeset/base/223702

Log:
  Make lukemftpd properly set login class and cpumask.

Modified:
  head/contrib/lukemftpd/src/ftpd.c

Modified: head/contrib/lukemftpd/src/ftpd.c
==============================================================================
--- head/contrib/lukemftpd/src/ftpd.c	Thu Jun 30 20:55:16 2011	(r223701)
+++ head/contrib/lukemftpd/src/ftpd.c	Thu Jun 30 20:58:38 2011	(r223702)
@@ -1263,8 +1263,9 @@ end_login(void)
 	curclass.type = CLASS_REAL;
 	(void) seteuid((uid_t)0);
 #ifdef	LOGIN_CAP
-	setusercontext(NULL, getpwuid(0), 0,
-		       LOGIN_SETPRIORITY|LOGIN_SETRESOURCES|LOGIN_SETUMASK|LOGIN_SETMAC);
+	setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN |
+		       LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH |
+		       LOGIN_SETENV));
 #endif
 #ifdef USE_PAM
 	if (pamh) {
@@ -1427,9 +1428,8 @@ pass(const char *passwd)
 #endif
 	}
 	setsid();
-	setusercontext(lc, pw, 0,
-		LOGIN_SETLOGIN|LOGIN_SETGROUP|LOGIN_SETPRIORITY|
-		LOGIN_SETRESOURCES|LOGIN_SETUMASK|LOGIN_SETMAC);
+	setusercontext(lc, pw, 0, LOGIN_SETALL &
+		       ~(LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV));
 #else
 	(void) initgroups(pw->pw_name, pw->pw_gid);
 			/* cache groups for cmds.c::matchgroup() */

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 05:15:28 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0F4A91065995;
	Fri,  1 Jul 2011 05:14:57 +0000 (UTC)
	(envelope-from julian@freebsd.org)
Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16])
	by mx1.freebsd.org (Postfix) with ESMTP id D42A68FC14;
	Fri,  1 Jul 2011 05:14:56 +0000 (UTC)
Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137])
	(authenticated bits=0)
	by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p615En0G087346
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Thu, 30 Jun 2011 22:14:53 -0700 (PDT)
	(envelope-from julian@freebsd.org)
Message-ID: <4E0D57C4.4070502@freebsd.org>
Date: Thu, 30 Jun 2011 22:14:44 -0700
From: Julian Elischer 
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US;
	rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
MIME-Version: 1.0
To: "Andrey V. Elsukov" 
References: <201106291006.p5TA6w0m089164@svn.freebsd.org>
In-Reply-To: <201106291006.p5TA6w0m089164@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r223666 - in head: sbin/ipfw sys/netinet
	sys/netinet/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 05:15:28 -0000

On 6/29/11 3:06 AM, Andrey V. Elsukov wrote:
> Author: ae
> Date: Wed Jun 29 10:06:58 2011
> New Revision: 223666
> URL: http://svn.freebsd.org/changeset/base/223666
>
> Log:
>    Add new rule actions "call" and "return" to ipfw. They make
>    possible to organize subroutines with rules.
>
>    The "call" action saves the current rule number in the internal
>    stack and rules processing continues from the first rule with
>    specified number (similar to skipto action). If later a rule with
>    "return" action is encountered, the processing returns to the first
>    rule with number of "call" rule saved in the stack plus one or higher.
>
>    Submitted by:	Vadim Goncharov
>    Discussed by:	ipfw@, luigi@
>
> Modified:
what happens if the return target is removed in the meanwhile?


From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 05:41:48 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B088A106567A;
	Fri,  1 Jul 2011 05:41:48 +0000 (UTC)
	(envelope-from luigi@onelab2.iet.unipi.it)
Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238])
	by mx1.freebsd.org (Postfix) with ESMTP id 739D98FC15;
	Fri,  1 Jul 2011 05:41:48 +0000 (UTC)
Received: by onelab2.iet.unipi.it (Postfix, from userid 275)
	id 582E47300A; Fri,  1 Jul 2011 07:58:30 +0200 (CEST)
Date: Fri, 1 Jul 2011 07:58:30 +0200
From: Luigi Rizzo 
To: Julian Elischer 
Message-ID: <20110701055830.GA72689@onelab2.iet.unipi.it>
References: <201106291006.p5TA6w0m089164@svn.freebsd.org>
	<4E0D57C4.4070502@freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4E0D57C4.4070502@freebsd.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r223666 - in head: sbin/ipfw sys/netinet
	sys/netinet/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 05:41:48 -0000

On Thu, Jun 30, 2011 at 10:14:44PM -0700, Julian Elischer wrote:
> On 6/29/11 3:06 AM, Andrey V. Elsukov wrote:
> >Author: ae
> >Date: Wed Jun 29 10:06:58 2011
> >New Revision: 223666
> >URL: http://svn.freebsd.org/changeset/base/223666
> >
> >Log:
> >   Add new rule actions "call" and "return" to ipfw. They make
> >   possible to organize subroutines with rules.
> >
> >   The "call" action saves the current rule number in the internal
> >   stack and rules processing continues from the first rule with
> >   specified number (similar to skipto action). If later a rule with
> >   "return" action is encountered, the processing returns to the first
> >   rule with number of "call" rule saved in the stack plus one or higher.
> >
> >   Submitted by:	Vadim Goncharov
> >   Discussed by:	ipfw@, luigi@
> >
> >Modified:
> what happens if the return target is removed in the meanwhile?

i suppose it has the same vulnerability of skipto: if the target
goes away you continue from the next rule.

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 06:01:48 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ECFCB1065678;
	Fri,  1 Jul 2011 06:01:48 +0000 (UTC)
	(envelope-from bu7cher@yandex.ru)
Received: from forward14.mail.yandex.net (forward14.mail.yandex.net
	[95.108.130.92])
	by mx1.freebsd.org (Postfix) with ESMTP id 821098FC17;
	Fri,  1 Jul 2011 06:01:48 +0000 (UTC)
Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net [95.108.131.192])
	by forward14.mail.yandex.net (Yandex) with ESMTP id 982811982226;
	Fri,  1 Jul 2011 10:01:46 +0400 (MSD)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
	t=1309500106; bh=BAxu0h0KG27ympp3ptfJMoUUHDXXHVOFDbMEU/nQJ2g=;
	h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References:
	In-Reply-To:Content-Type;
	b=XWuMBn4sjSpFRhFR+YR8ZwAinyYLSEv7d+dKTQ4ldCHr4OyBHLErjrjUh/Ly/kd9n
	j83ZsJR+x4mEKa6ON15M4SSByVf4nXY2FtzzlVWr7vp6GFV2ou5oIyq86tosF0Vra/
	vjUey4gAOhmoVqkxOnp2TIJbDbHEtB9S174gxQp0=
Received: from [127.0.0.1] (unknown [77.72.136.146])
	by smtp14.mail.yandex.net (Yandex) with ESMTPSA id 31D2B19B80B0;
	Fri,  1 Jul 2011 10:01:46 +0400 (MSD)
Message-ID: <4E0D62C5.4000909@yandex.ru>
Date: Fri, 01 Jul 2011 10:01:41 +0400
From: "Andrey V. Elsukov" 
User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231)
MIME-Version: 1.0
To: Julian Elischer 
References: <201106291006.p5TA6w0m089164@svn.freebsd.org>
	<4E0D57C4.4070502@freebsd.org>
In-Reply-To: <4E0D57C4.4070502@freebsd.org>
X-Enigmail-Version: 1.1.1
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enig86C19A5E55178CF0AD2E2E93"
X-Yandex-Spam: 1
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r223666 - in head: sbin/ipfw sys/netinet
	sys/netinet/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 06:01:49 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig86C19A5E55178CF0AD2E2E93
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

On 01.07.2011 9:14, Julian Elischer wrote:
>>    The "call" action saves the current rule number in the internal
>>    stack and rules processing continues from the first rule with
>>    specified number (similar to skipto action). If later a rule with
>>    "return" action is encountered, the processing returns to the first=

>>    rule with number of "call" rule saved in the stack plus one or high=
er.
>>
>>    Submitted by:    Vadim Goncharov
>>    Discussed by:    ipfw@, luigi@
>>
>> Modified:
> what happens if the return target is removed in the meanwhile?

This implementation does not keep pointer to the rule, only rule number.
So return action will work like "skipto ".
If you remove rule with call action it will search first rule with number=
 greater
than it had.

--=20
WBR, Andrey V. Elsukov


--------------enig86C19A5E55178CF0AD2E2E93
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)

iQEcBAEBAgAGBQJODWLJAAoJEAHF6gQQyKF6niIH/3BKq9iT3W+GQTiGFf5L3NbI
35fk9TzHn/4YUb2vltbmvnoVM8uVu4K2EGXcdtTjNtNFhC3y08KPaPhTdTArBGbF
lBiicQU+0ThDbtH79etC3LAVZekfdAFIFgaCFsi/4dweuycZEhZccQ2nQBG6zCHb
MwqFfQtT29zH0IplplxDySMu1KIdbLRU1KpobjseoCnfqn9x+ZkT3kzdk1DaoMev
9z9JEsfumuutxTaTumR4+48VCNFSVZbWBnMJ6XsgED3OJS3GEHv4xUnoLiWSiA91
xoMHC/zjJk/CVii9kU3XfzvpT+JtlH8NzSwj1eDnt1ZCSrpjX5uT27iuJFRWMYE=
=qrDc
-----END PGP SIGNATURE-----

--------------enig86C19A5E55178CF0AD2E2E93--

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 08:27:03 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6AFF106564A;
	Fri,  1 Jul 2011 08:27:03 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C7D538FC16;
	Fri,  1 Jul 2011 08:27: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 p618R3gc079990;
	Fri, 1 Jul 2011 08:27:03 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p618R317079988;
	Fri, 1 Jul 2011 08:27:03 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201107010827.p618R317079988@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Fri, 1 Jul 2011 08:27:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223706 - head/sys/netgraph/netflow
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 08:27:03 -0000

Author: glebius
Date: Fri Jul  1 08:27:03 2011
New Revision: 223706
URL: http://svn.freebsd.org/changeset/base/223706

Log:
  Fix double free.
  
  Submitted by:	Alexander V. Chernikov 

Modified:
  head/sys/netgraph/netflow/netflow_v9.c

Modified: head/sys/netgraph/netflow/netflow_v9.c
==============================================================================
--- head/sys/netgraph/netflow/netflow_v9.c	Fri Jul  1 03:29:49 2011	(r223705)
+++ head/sys/netgraph/netflow/netflow_v9.c	Fri Jul  1 08:27:03 2011	(r223706)
@@ -398,7 +398,6 @@ get_export9_dgram(priv_p priv, fib_expor
 
 		item = ng_package_data(m, NG_NOFLAGS);
 		if (item == NULL) {
-			m_free(m);
 			free(t, M_NETFLOW_GENERAL);
 			return (NULL);
 		}

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 10:54:47 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85301106566C;
	Fri,  1 Jul 2011 10:54:47 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 759E98FC16;
	Fri,  1 Jul 2011 10:54:47 +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 p61Asl38084438;
	Fri, 1 Jul 2011 10:54:47 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p61AslSs084436;
	Fri, 1 Jul 2011 10:54:47 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201107011054.p61AslSs084436@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Fri, 1 Jul 2011 10:54:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223708 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 10:54:47 -0000

Author: pluknet
Date: Fri Jul  1 10:54:47 2011
New Revision: 223708
URL: http://svn.freebsd.org/changeset/base/223708

Log:
  Update and sort the list of the available keywords.

Modified:
  head/bin/ps/ps.1

Modified: head/bin/ps/ps.1
==============================================================================
--- head/bin/ps/ps.1	Fri Jul  1 10:25:48 2011	(r223707)
+++ head/bin/ps/ps.1	Fri Jul  1 10:54:47 2011	(r223708)
@@ -492,6 +492,8 @@ command
 command and arguments
 .It Cm cpu
 short-term CPU usage factor (for scheduling)
+.It Cm emul
+system-call emulation environment
 .It Cm etime
 elapsed running time, format
 .Op days- Ns
@@ -527,6 +529,8 @@ lock currently blocked on (as a symbolic
 login name of user who started the session
 .It Cm lstart
 time started
+.It Cm lwp
+process thread-id
 .It Cm majflt
 total page faults
 .It Cm minflt
@@ -542,6 +546,8 @@ nice value (alias
 .Cm ni )
 .It Cm nivcsw
 total involuntary context switches
+.It Cm nlwp
+number of threads tied to a process
 .It Cm nsigs
 total signals taken (alias
 .Cm nsignals )
@@ -562,8 +568,6 @@ pageins (same as majflt)
 process group number
 .It Cm pid
 process ID
-.It Cm poip
-pageouts in progress
 .It Cm ppid
 parent process ID
 .It Cm pri
@@ -574,8 +578,6 @@ core residency time (in seconds; 127 = i
 real group ID
 .It Cm rgroup
 group name (from rgid)
-.It Cm rlink
-reverse link on run queue, or 0
 .It Cm rss
 resident set size
 .It Cm rtprio
@@ -630,8 +632,6 @@ text size (in Kbytes)
 control terminal name (two letter abbreviation)
 .It Cm tty
 full name of control terminal
-.It Cm uprocp
-process pointer
 .It Cm ucomm
 name to be used for accounting
 .It Cm uid
@@ -640,6 +640,8 @@ effective user ID (alias
 .It Cm upr
 scheduling priority on return from system call (alias
 .Cm usrpri )
+.It Cm uprocp
+process pointer
 .It Cm user
 user name (from UID)
 .It Cm usertime

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 10:57:11 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0C4BB1065673;
	Fri,  1 Jul 2011 10:57:11 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D7D968FC0A;
	Fri,  1 Jul 2011 10:57: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 p61AvAjG088422;
	Fri, 1 Jul 2011 10:57:10 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p61AvA0l088420;
	Fri, 1 Jul 2011 10:57:10 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201107011057.p61AvA0l088420@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Fri, 1 Jul 2011 10:57:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223709 - head/bin/ps
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 10:57:11 -0000

Author: pluknet
Date: Fri Jul  1 10:57:10 2011
New Revision: 223709
URL: http://svn.freebsd.org/changeset/base/223709

Log:
  Bump date after the previous commit.

Modified:
  head/bin/ps/ps.1

Modified: head/bin/ps/ps.1
==============================================================================
--- head/bin/ps/ps.1	Fri Jul  1 10:54:47 2011	(r223708)
+++ head/bin/ps/ps.1	Fri Jul  1 10:57:10 2011	(r223709)
@@ -29,7 +29,7 @@
 .\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd June 14, 2011
+.Dd July 1, 2011
 .Dt PS 1
 .Os
 .Sh NAME

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 12:13:48 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CE1D6106566B;
	Fri,  1 Jul 2011 12:13:48 +0000 (UTC)
	(envelope-from jonathan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BE6C38FC1A;
	Fri,  1 Jul 2011 12:13:48 +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 p61CDmOQ090770;
	Fri, 1 Jul 2011 12:13:48 GMT (envelope-from jonathan@svn.freebsd.org)
Received: (from jonathan@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p61CDmXj090766;
	Fri, 1 Jul 2011 12:13:48 GMT (envelope-from jonathan@svn.freebsd.org)
Message-Id: <201107011213.p61CDmXj090766@svn.freebsd.org>
From: Jonathan Anderson 
Date: Fri, 1 Jul 2011 12:13:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223710 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 12:13:48 -0000

Author: jonathan
Date: Fri Jul  1 12:13:48 2011
New Revision: 223710
URL: http://svn.freebsd.org/changeset/base/223710

Log:
  Define cap_rights_t and DTYPE_CAPABILITY, which are required to
  implement Capsicum capabilities.
  
  Approved by: mentor (rwatson), re (bz)

Modified:
  head/sys/sys/_types.h
  head/sys/sys/file.h
  head/sys/sys/types.h

Modified: head/sys/sys/_types.h
==============================================================================
--- head/sys/sys/_types.h	Fri Jul  1 10:57:10 2011	(r223709)
+++ head/sys/sys/_types.h	Fri Jul  1 12:13:48 2011	(r223710)
@@ -38,6 +38,7 @@
 typedef	__uint32_t	__blksize_t;	/* file block size */
 typedef	__int64_t	__blkcnt_t;	/* file block count */
 typedef	__int32_t	__clockid_t;	/* clock_gettime()... */
+typedef	__uint64_t	__cap_rights_t;	/* capability rights */
 typedef	__uint32_t	__fflags_t;	/* file flags */
 typedef	__uint64_t	__fsblkcnt_t;
 typedef	__uint64_t	__fsfilcnt_t;

Modified: head/sys/sys/file.h
==============================================================================
--- head/sys/sys/file.h	Fri Jul  1 10:57:10 2011	(r223709)
+++ head/sys/sys/file.h	Fri Jul  1 12:13:48 2011	(r223710)
@@ -64,6 +64,7 @@ struct socket;
 #define	DTYPE_SEM	9	/* posix semaphore */
 #define	DTYPE_PTS	10	/* pseudo teletype master device */
 #define	DTYPE_DEV	11	/* Device specific fd type */
+#define	DTYPE_CAPABILITY	12	/* capability */
 
 #ifdef _KERNEL
 

Modified: head/sys/sys/types.h
==============================================================================
--- head/sys/sys/types.h	Fri Jul  1 10:57:10 2011	(r223709)
+++ head/sys/sys/types.h	Fri Jul  1 12:13:48 2011	(r223710)
@@ -89,6 +89,8 @@ typedef	__blkcnt_t	blkcnt_t;
 #define	_BLKCNT_T_DECLARED
 #endif
 
+typedef	__cap_rights_t	cap_rights_t;
+
 #ifndef _CLOCK_T_DECLARED
 typedef	__clock_t	clock_t;
 #define	_CLOCK_T_DECLARED

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 18:32:00 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0F3A4106564A;
	Fri,  1 Jul 2011 18:31:59 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A105F8FC08;
	Fri,  1 Jul 2011 18:31: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 p61IVxiH002083;
	Fri, 1 Jul 2011 18:31:59 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p61IVx62002080;
	Fri, 1 Jul 2011 18:31:59 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201107011831.p61IVx62002080@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 1 Jul 2011 18:31:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223712 - in head/sys/boot: common userboot/userboot
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 18:32:00 -0000

Author: marius
Date: Fri Jul  1 18:31:59 2011
New Revision: 223712
URL: http://svn.freebsd.org/changeset/base/223712

Log:
  Fix r223695 to compile on architectures which don't use the MBR scheme; wrap
  the MBR support in the common part of the loader in #ifdef's and enable it
  only for userboot for now.

Modified:
  head/sys/boot/common/disk.c
  head/sys/boot/userboot/userboot/Makefile

Modified: head/sys/boot/common/disk.c
==============================================================================
--- head/sys/boot/common/disk.c	Fri Jul  1 12:30:34 2011	(r223711)
+++ head/sys/boot/common/disk.c	Fri Jul  1 18:31:59 2011	(r223712)
@@ -93,6 +93,8 @@ static uuid_t ms_basic_data = GPT_ENT_TY
 
 #endif
 
+#if defined(LOADER_GPT_SUPPORT) || defined(LOADER_MBR_SUPPORT)
+
 /* Given a size in 512 byte sectors, convert it to a human-readable number. */
 static char *
 display_size(uint64_t size)
@@ -116,6 +118,10 @@ display_size(uint64_t size)
 	return (buf);
 }
 
+#endif
+
+#ifdef LOADER_MBR_SUPPORT
+
 static void
 disk_checkextended(struct disk_devdesc *dev,
     struct dos_partition *slicetab, int slicenum, int *nslicesp)
@@ -469,7 +475,7 @@ disk_printslice(struct disk_devdesc *dev
 	pager_output(line);
 }
 
-int
+static int
 disk_printmbr(struct disk_devdesc *dev, char *prefix, int verbose)
 {
 	struct dos_partition	*slicetab;
@@ -488,6 +494,8 @@ disk_printmbr(struct disk_devdesc *dev, 
 	return (0);
 }
 
+#endif
+
 #ifdef LOADER_GPT_SUPPORT
 
 static int
@@ -630,7 +638,7 @@ disk_bestgpt(struct gpt_part *gpt, int n
 	return (prefpart);
 }
 
-int
+static int
 disk_opengpt(struct disk_devdesc *dev)
 {
 	struct gpt_part		*gpt = NULL, *gp;
@@ -759,6 +767,7 @@ disk_open(struct disk_devdesc *dev)
 {
 	int rc;
 
+	rc = 0;
 	/*
 	 * While we are reading disk metadata, make sure we do it relative
 	 * to the start of the disk
@@ -769,7 +778,9 @@ disk_open(struct disk_devdesc *dev)
 	rc = disk_opengpt(dev);
 	if (rc)
 #endif
+#ifdef LOADER_MBR_SUPPORT
 		rc = disk_openmbr(dev);
+#endif
 
 	return (rc);
 }
@@ -777,12 +788,12 @@ disk_open(struct disk_devdesc *dev)
 void
 disk_print(struct disk_devdesc *dev, char *prefix, int verbose)
 {
-	int			rc;
 
 #ifdef LOADER_GPT_SUPPORT
-	rc = disk_printgpt(dev, prefix, verbose);
-	if (rc == 0)
+	if (disk_printgpt(dev, prefix, verbose) == 0)
 		return;
 #endif
+#ifdef LOADER_MBR_SUPPORT
 	disk_printmbr(dev, prefix, verbose);
+#endif
 }

Modified: head/sys/boot/userboot/userboot/Makefile
==============================================================================
--- head/sys/boot/userboot/userboot/Makefile	Fri Jul  1 12:30:34 2011	(r223711)
+++ head/sys/boot/userboot/userboot/Makefile	Fri Jul  1 18:31:59 2011	(r223712)
@@ -32,7 +32,7 @@ CFLAGS+=	-I${.CURDIR}/../../common
 CFLAGS+=	-I${.CURDIR}/../../..
 CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand
 CFLAGS+=	-ffreestanding -I.
-CFLAGS+=	-DLOADER_GPT_SUPPORT
+CFLAGS+=	-DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT
 
 LDFLAGS+=	-nostdlib -Wl,-Bsymbolic
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 19:22:27 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E0C7F106566B;
	Fri,  1 Jul 2011 19:22:27 +0000 (UTC) (envelope-from sem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D0B658FC15;
	Fri,  1 Jul 2011 19:22: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 p61JMRsr003552;
	Fri, 1 Jul 2011 19:22:27 GMT (envelope-from sem@svn.freebsd.org)
Received: (from sem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p61JMRW3003550;
	Fri, 1 Jul 2011 19:22:27 GMT (envelope-from sem@svn.freebsd.org)
Message-Id: <201107011922.p61JMRW3003550@svn.freebsd.org>
From: Sergey Matveychuk 
Date: Fri, 1 Jul 2011 19:22:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223713 - head/sbin/natd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 19:22:28 -0000

Author: sem (ports committer)
Date: Fri Jul  1 19:22:27 2011
New Revision: 223713
URL: http://svn.freebsd.org/changeset/base/223713

Log:
  Fix a typo.
  
  Approved by:	kib

Modified:
  head/sbin/natd/natd.8

Modified: head/sbin/natd/natd.8
==============================================================================
--- head/sbin/natd/natd.8	Fri Jul  1 18:31:59 2011	(r223712)
+++ head/sbin/natd/natd.8	Fri Jul  1 19:22:27 2011	(r223713)
@@ -473,7 +473,7 @@ This option is intended to be used with 
 packets received on this port are checked against
 internal translation tables of every configured instance.
 If an entry is found, packet is aliased according to that entry.
-In no entry was found in any of the instances, packet is passed
+If no entry was found in any of the instances, packet is passed
 unchanged, and no new entry will be created.
 See the section
 .Sx MULTIPLE INSTANCES

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  1 20:45:56 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5ECC7106566C;
	Fri,  1 Jul 2011 20:45:56 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 43D888FC08;
	Fri,  1 Jul 2011 20:45:56 +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 p61Kjuo4005989;
	Fri, 1 Jul 2011 20:45:56 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p61Kju11005984;
	Fri, 1 Jul 2011 20:45:56 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201107012045.p61Kju11005984@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Fri, 1 Jul 2011 20:45:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223715 - head/contrib/gcc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 01 Jul 2011 20:45:56 -0000

Author: uqs
Date: Fri Jul  1 20:45:55 2011
New Revision: 223715
URL: http://svn.freebsd.org/changeset/base/223715

Log:
  - Fix typo in check_for_nested_with_variably_modified present
  - Implement -Wvariable-decl.
  - Port -Wtrampolines support from gcc3.
  (all three also via OpenBSD)
  
  PR:		gnu/127136, gnu/157019
  Submitted by:	Henning Petersen, Pedro Giffuni
  MFC after:	6 weeks

Modified:
  head/contrib/gcc/c-decl.c
  head/contrib/gcc/c.opt
  head/contrib/gcc/common.opt
  head/contrib/gcc/tree-nested.c

Modified: head/contrib/gcc/c-decl.c
==============================================================================
--- head/contrib/gcc/c-decl.c	Fri Jul  1 19:23:25 2011	(r223714)
+++ head/contrib/gcc/c-decl.c	Fri Jul  1 20:45:55 2011	(r223715)
@@ -4340,6 +4340,8 @@ grokdeclarator (const struct c_declarato
 			  pedwarn ("ISO C90 forbids variable-size array %qs",
 				   name);
 		      }
+		    if (warn_variable_decl)
+		      warning (0, "variable-sized array %qs", name);
 		  }
 
 		if (integer_zerop (size))

Modified: head/contrib/gcc/c.opt
==============================================================================
--- head/contrib/gcc/c.opt	Fri Jul  1 19:23:25 2011	(r223714)
+++ head/contrib/gcc/c.opt	Fri Jul  1 20:45:55 2011	(r223715)
@@ -404,6 +404,10 @@ Wtraditional
 C ObjC Var(warn_traditional)
 Warn about features not present in traditional C
 
+Wtrampolines
+Common Var(warn_trampolines)
+Warn when trampolines are emitted
+
 Wtrigraphs
 C ObjC C++ ObjC++
 Warn if trigraphs are encountered that might affect the meaning of the program

Modified: head/contrib/gcc/common.opt
==============================================================================
--- head/contrib/gcc/common.opt	Fri Jul  1 19:23:25 2011	(r223714)
+++ head/contrib/gcc/common.opt	Fri Jul  1 20:45:55 2011	(r223715)
@@ -189,6 +189,10 @@ Wunused-variable
 Common Var(warn_unused_variable)
 Warn when a variable is unused
 
+Wvariable-decl
+Common Var(warn_variable_decl)
+Warn about variable-sized declarations.
+
 Wvolatile-register-var
 Common Var(warn_register_var)
 Warn when a register variable is declared volatile

Modified: head/contrib/gcc/tree-nested.c
==============================================================================
--- head/contrib/gcc/tree-nested.c	Fri Jul  1 19:23:25 2011	(r223714)
+++ head/contrib/gcc/tree-nested.c	Fri Jul  1 20:45:55 2011	(r223715)
@@ -750,7 +750,7 @@ check_for_nested_with_variably_modified 
   for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
     {
       for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = TREE_CHAIN (arg))
-	if (variably_modified_type_p (TREE_TYPE (arg), 0), orig_fndecl)
+	if (variably_modified_type_p (TREE_TYPE (arg), orig_fndecl))
 	  return true;
 
       if (check_for_nested_with_variably_modified (cgn->decl, orig_fndecl))
@@ -1621,6 +1621,10 @@ convert_tramp_reference (tree *tp, int *
 	 it doesn't need a trampoline.  */
       if (DECL_NO_STATIC_CHAIN (decl))
 	break;
+      if (warn_trampolines)
+	{
+	warning(0, "local function address taken needing trampoline generation");
+	}
 
       /* Lookup the immediate parent of the callee, as that's where
 	 we need to insert the trampoline.  */

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 10:17:26 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB52D106564A;
	Sat,  2 Jul 2011 10:17:26 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ABA6B8FC16;
	Sat,  2 Jul 2011 10:17: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 p62AHQGV035192;
	Sat, 2 Jul 2011 10:17:26 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62AHQX5035190;
	Sat, 2 Jul 2011 10:17:26 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201107021017.p62AHQX5035190@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 2 Jul 2011 10:17:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223718 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 10:17:26 -0000

Author: marius
Date: Sat Jul  2 10:17:26 2011
New Revision: 223718
URL: http://svn.freebsd.org/changeset/base/223718

Log:
  Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to
  merge the two.

Modified:
  head/sys/sparc64/sparc64/exception.S

Modified: head/sys/sparc64/sparc64/exception.S
==============================================================================
--- head/sys/sparc64/sparc64/exception.S	Sat Jul  2 00:38:10 2011	(r223717)
+++ head/sys/sparc64/sparc64/exception.S	Sat Jul  2 10:17:26 2011	(r223718)
@@ -369,11 +369,18 @@ ENTRY(rsf_fatal)
 	sir
 END(rsf_fatal)
 
-	.comm	intrnames, IV_MAX * (MAXCOMLEN + 1)
-	.comm	eintrnames, 0
+	.data
+	_ALIGN_DATA
+	.globl	intrnames, eintrnames
+intrnames:
+	.space	IV_MAX * (MAXCOMLEN + 1)
+eintrnames:
+	.globl	intrcnt, eintrcnt
+intrcnt:
+	.space	IV_MAX * 8
+eintrcnt:
 
-	.comm	intrcnt, IV_MAX * 8
-	.comm	eintrcnt, 0
+	.text
 
 /*
  * Trap table and associated macros

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 11:14:54 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5BF2106566B;
	Sat,  2 Jul 2011 11:14:54 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A40848FC0A;
	Sat,  2 Jul 2011 11:14: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 p62BEsaq037451;
	Sat, 2 Jul 2011 11:14:54 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62BEssr037439;
	Sat, 2 Jul 2011 11:14:54 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201107021114.p62BEssr037439@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 2 Jul 2011 11:14:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223719 - in head/sys: boot/sparc64/loader
	sparc64/include sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 11:14:54 -0000

Author: marius
Date: Sat Jul  2 11:14:54 2011
New Revision: 223719
URL: http://svn.freebsd.org/changeset/base/223719

Log:
  - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from
    the TLBs in order to get rid of the user mappings but instead traverse
    them an flush only the latter like we also do for the Spitfire-class.
    Also flushing the unlocked kernel entries can cause instant faults which
    when called from within cpu_switch() are handled with the scheduler lock
    held which in turn can cause timeouts on the acquisition of the lock by
    other CPUs. This was easily seen with a 16-core V890 but occasionally
    also happened with 2-way machines.
    While at it, move the SPARC64-V support code entirely to zeus.c. This
    causes a little bit of duplication but is less confusing than partially
    using Cheetah-class bits for these.
  - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024-
    entry, 2-way set associative TLB.
  - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure
    that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back.
  
  Tested by:      Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V)

Modified:
  head/sys/boot/sparc64/loader/main.c
  head/sys/sparc64/include/cache.h
  head/sys/sparc64/include/cpu.h
  head/sys/sparc64/include/tlb.h
  head/sys/sparc64/sparc64/cache.c
  head/sys/sparc64/sparc64/cheetah.c
  head/sys/sparc64/sparc64/machdep.c
  head/sys/sparc64/sparc64/mp_machdep.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/sparc64/sparc64/spitfire.c
  head/sys/sparc64/sparc64/zeus.c

Modified: head/sys/boot/sparc64/loader/main.c
==============================================================================
--- head/sys/boot/sparc64/loader/main.c	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/boot/sparc64/loader/main.c	Sat Jul  2 11:14:54 2011	(r223719)
@@ -96,10 +96,10 @@ static struct mmu_ops {
 typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3,
     void *openfirmware);
 
-static inline u_long dtlb_get_data_sun4u(u_int);
+static inline u_long dtlb_get_data_sun4u(u_int, u_int);
 static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t);
 static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t);
-static inline u_long itlb_get_data_sun4u(u_int);
+static inline u_long itlb_get_data_sun4u(u_int, u_int);
 static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t);
 static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t);
 static void itlb_relocate_locked0_sun4u(void);
@@ -136,6 +136,7 @@ u_int itlb_slot;
 static int cpu_impl;
 static u_int dtlb_slot_max;
 static u_int itlb_slot_max;
+static u_int tlb_locked;
 
 static vm_offset_t curkva = 0;
 static vm_offset_t heapva;
@@ -355,42 +356,55 @@ __elfN(exec)(struct preloaded_file *fp)
 }
 
 static inline u_long
-dtlb_get_data_sun4u(u_int slot)
+dtlb_get_data_sun4u(u_int tlb, u_int slot)
 {
+	u_long data, pstate;
 
+	slot = TLB_DAR_SLOT(tlb, slot);
 	/*
-	 * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work
-	 * around errata of USIII and beyond.
+	 * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to
+	 * work around errata of USIII and beyond.
 	 */
-	(void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG);
-	return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG));
+	pstate = rdpr(pstate);
+	wrpr(pstate, pstate & ~PSTATE_IE, 0);
+	(void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+	data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+	wrpr(pstate, pstate, 0);
+	return (data);
 }
 
 static inline u_long
-itlb_get_data_sun4u(u_int slot)
+itlb_get_data_sun4u(u_int tlb, u_int slot)
 {
+	u_long data, pstate;
 
+	slot = TLB_DAR_SLOT(tlb, slot);
 	/*
-	 * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work
-	 * around errata of USIII and beyond.
+	 * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to
+	 * work around errata of USIII and beyond.
 	 */
-	(void)ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG);
-	return (ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG));
+	pstate = rdpr(pstate);
+	wrpr(pstate, pstate & ~PSTATE_IE, 0);
+	(void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+	data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+	wrpr(pstate, pstate, 0);
+	return (data);
 }
 
 static vm_offset_t
 dtlb_va_to_pa_sun4u(vm_offset_t va)
 {
 	u_long pstate, reg;
-	int i;
+	u_int i, tlb;
 
 	pstate = rdpr(pstate);
 	wrpr(pstate, pstate & ~PSTATE_IE, 0);
 	for (i = 0; i < dtlb_slot_max; i++) {
-		reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG);
+		reg = ldxa(TLB_DAR_SLOT(tlb_locked, i),
+		    ASI_DTLB_TAG_READ_REG);
 		if (TLB_TAR_VA(reg) != va)
 			continue;
-		reg = dtlb_get_data_sun4u(i);
+		reg = dtlb_get_data_sun4u(tlb_locked, i);
 		wrpr(pstate, pstate, 0);
 		reg >>= TD_PA_SHIFT;
 		if (cpu_impl == CPU_IMPL_SPARC64V ||
@@ -411,10 +425,11 @@ itlb_va_to_pa_sun4u(vm_offset_t va)
 	pstate = rdpr(pstate);
 	wrpr(pstate, pstate & ~PSTATE_IE, 0);
 	for (i = 0; i < itlb_slot_max; i++) {
-		reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG);
+		reg = ldxa(TLB_DAR_SLOT(tlb_locked, i),
+		    ASI_ITLB_TAG_READ_REG);
 		if (TLB_TAR_VA(reg) != va)
 			continue;
-		reg = itlb_get_data_sun4u(i);
+		reg = itlb_get_data_sun4u(tlb_locked, i);
 		wrpr(pstate, pstate, 0);
 		reg >>= TD_PA_SHIFT;
 		if (cpu_impl == CPU_IMPL_SPARC64V ||
@@ -458,14 +473,14 @@ itlb_relocate_locked0_sun4u(void)
 	pstate = rdpr(pstate);
 	wrpr(pstate, pstate & ~PSTATE_IE, 0);
 
-	data = itlb_get_data_sun4u(0);
+	data = itlb_get_data_sun4u(tlb_locked, 0);
 	if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) {
 		wrpr(pstate, pstate, 0);
 		return;
 	}
 
 	/* Flush the mapping of slot 0. */
-	tag = ldxa(TLB_DAR_SLOT(0), ASI_ITLB_TAG_READ_REG);
+	tag = ldxa(TLB_DAR_SLOT(tlb_locked, 0), ASI_ITLB_TAG_READ_REG);
 	stxa(TLB_DEMAP_VA(TLB_TAR_VA(tag)) | TLB_DEMAP_PRIMARY |
 	    TLB_DEMAP_PAGE, ASI_IMMU_DEMAP, 0);
 	flush(0);	/* The USIII-family ignores the address. */
@@ -475,11 +490,12 @@ itlb_relocate_locked0_sun4u(void)
 	 * that formerly were in slot 0.
 	 */
 	for (i = 1; i < itlb_slot_max; i++) {
-		if ((itlb_get_data_sun4u(i) & TD_V) != 0)
+		if ((itlb_get_data_sun4u(tlb_locked, i) & TD_V) != 0)
 			continue;
 
 		stxa(AA_IMMU_TAR, ASI_IMMU, tag);
-		stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data);
+		stxa(TLB_DAR_SLOT(tlb_locked, i), ASI_ITLB_DATA_ACCESS_REG,
+		    data);
 		flush(0);	/* The USIII-family ignores the address. */
 		break;
 	}
@@ -651,6 +667,26 @@ tlb_init_sun4u(void)
 	phandle_t bsp;
 
 	cpu_impl = VER_IMPL(rdpr(ver));
+	switch (cpu_impl) {
+	case CPU_IMPL_SPARC64:
+	case CPU_IMPL_ULTRASPARCI:
+	case CPU_IMPL_ULTRASPARCII:
+	case CPU_IMPL_ULTRASPARCIIi:
+	case CPU_IMPL_ULTRASPARCIIe:
+		tlb_locked = TLB_DAR_T32;
+		break;
+	case CPU_IMPL_ULTRASPARCIII:
+	case CPU_IMPL_ULTRASPARCIIIp:
+	case CPU_IMPL_ULTRASPARCIIIi:
+	case CPU_IMPL_ULTRASPARCIIIip:
+	case CPU_IMPL_ULTRASPARCIV:
+	case CPU_IMPL_ULTRASPARCIVp:
+		tlb_locked = TLB_DAR_T16;
+		break;
+	case CPU_IMPL_SPARC64V:
+		tlb_locked = TLB_DAR_FTLB;
+		break;
+	}
 	bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u());
 	if (bsp == 0)
 		panic("%s: no node for bootcpu?!?!", __func__);
@@ -821,21 +857,23 @@ pmap_print_tlb_sun4u(void)
 	pstate = rdpr(pstate);
 	for (i = 0; i < itlb_slot_max; i++) {
 		wrpr(pstate, pstate & ~PSTATE_IE, 0);
-		tte = itlb_get_data_sun4u(i);
+		tte = itlb_get_data_sun4u(tlb_locked, i);
 		wrpr(pstate, pstate, 0);
 		if (!(tte & TD_V))
 			continue;
-		tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG);
+		tag = ldxa(TLB_DAR_SLOT(tlb_locked, i),
+		    ASI_ITLB_TAG_READ_REG);
 		printf("iTLB-%2u: ", i);
 		pmap_print_tte_sun4u(tag, tte);
 	}
 	for (i = 0; i < dtlb_slot_max; i++) {
 		wrpr(pstate, pstate & ~PSTATE_IE, 0);
-		tte = dtlb_get_data_sun4u(i);
+		tte = dtlb_get_data_sun4u(tlb_locked, i);
 		wrpr(pstate, pstate, 0);
 		if (!(tte & TD_V))
 			continue;
-		tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG);
+		tag = ldxa(TLB_DAR_SLOT(tlb_locked, i),
+		    ASI_DTLB_TAG_READ_REG);
 		printf("dTLB-%2u: ", i);
 		pmap_print_tte_sun4u(tag, tte);
 	}

Modified: head/sys/sparc64/include/cache.h
==============================================================================
--- head/sys/sparc64/include/cache.h	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/include/cache.h	Sat Jul  2 11:14:54 2011	(r223719)
@@ -110,15 +110,16 @@ cache_flush_t spitfire_cache_flush;
 dcache_page_inval_t spitfire_dcache_page_inval;
 icache_page_inval_t spitfire_icache_page_inval;
 
+cache_enable_t zeus_cache_enable;
+cache_flush_t zeus_cache_flush;
+dcache_page_inval_t zeus_dcache_page_inval;
+icache_page_inval_t zeus_icache_page_inval;
+
 extern cache_enable_t *cache_enable;
 extern cache_flush_t *cache_flush;
 extern dcache_page_inval_t *dcache_page_inval;
 extern icache_page_inval_t *icache_page_inval;
 
-cache_flush_t zeus_cache_flush;
-dcache_page_inval_t zeus_dcache_page_inval;
-icache_page_inval_t zeus_icache_page_inval;
-
 #endif /* KERNEL */
 
 #endif /* !LOCORE */

Modified: head/sys/sparc64/include/cpu.h
==============================================================================
--- head/sys/sparc64/include/cpu.h	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/include/cpu.h	Sat Jul  2 11:14:54 2011	(r223719)
@@ -57,6 +57,7 @@ void	cpu_halt(void);
 void	cpu_reset(void);
 void	fork_trampoline(void);
 void	swi_vm(void *v);
+void	zeus_init(u_int cpu_impl);
 
 static __inline u_int64_t
 get_cyclecount(void)

Modified: head/sys/sparc64/include/tlb.h
==============================================================================
--- head/sys/sparc64/include/tlb.h	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/include/tlb.h	Sat Jul  2 11:14:54 2011	(r223719)
@@ -44,7 +44,17 @@
 	(TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK))
 
 #define	TLB_DAR_SLOT_SHIFT		(3)
-#define	TLB_DAR_SLOT(slot)		((slot) << TLB_DAR_SLOT_SHIFT)
+#define	TLB_DAR_TLB_SHIFT		(16)
+#define	TLB_DAR_SLOT(tlb, slot)						\
+	((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT)
+#define	TLB_DAR_T16			(0)	/* US-III{,i,+}, IV{,+} */
+#define	TLB_DAR_T32			(0)	/* US-I, II{,e,i} */
+#define	TLB_DAR_DT512_0			(2)	/* US-III{,i,+}, IV{,+} */
+#define	TLB_DAR_DT512_1			(3)	/* US-III{,i,+}, IV{,+} */
+#define	TLB_DAR_IT128			(2)	/* US-III{,i,+}, IV */
+#define	TLB_DAR_IT512			(2)	/* US-IV+ */
+#define	TLB_DAR_FTLB			(0)	/* SPARC64 V, VI, VII, VIIIfx */
+#define	TLB_DAR_STLB			(2)	/* SPARC64 V, VI, VII, VIIIfx */
 
 #define	TAR_VPN_SHIFT			(13)
 #define	TAR_CTX_MASK			((1 << TAR_VPN_SHIFT) - 1)
@@ -156,6 +166,9 @@ tlb_flush_user_t cheetah_tlb_flush_user;
 tlb_flush_nonlocked_t spitfire_tlb_flush_nonlocked;
 tlb_flush_user_t spitfire_tlb_flush_user;
 
+tlb_flush_nonlocked_t zeus_tlb_flush_nonlocked;
+tlb_flush_user_t zeus_tlb_flush_user;
+
 extern tlb_flush_nonlocked_t *tlb_flush_nonlocked;
 extern tlb_flush_user_t *tlb_flush_user;
 

Modified: head/sys/sparc64/sparc64/cache.c
==============================================================================
--- head/sys/sparc64/sparc64/cache.c	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/sparc64/cache.c	Sat Jul  2 11:14:54 2011	(r223719)
@@ -169,12 +169,12 @@ cache_init(struct pcpu *pcpu)
 		tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked;
 		tlb_flush_user = cheetah_tlb_flush_user;
 	} else if (pcpu->pc_impl == CPU_IMPL_SPARC64V) {
-		cache_enable = cheetah_cache_enable;
+		cache_enable = zeus_cache_enable;
 		cache_flush = zeus_cache_flush;
 		dcache_page_inval = zeus_dcache_page_inval;
 		icache_page_inval = zeus_icache_page_inval;
-		tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked;
-		tlb_flush_user = cheetah_tlb_flush_user;
+		tlb_flush_nonlocked = zeus_tlb_flush_nonlocked;
+		tlb_flush_user = zeus_tlb_flush_user;
 	} else if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCI &&
 	    pcpu->pc_impl < CPU_IMPL_ULTRASPARCIII) {
 		cache_enable = spitfire_cache_enable;

Modified: head/sys/sparc64/sparc64/cheetah.c
==============================================================================
--- head/sys/sparc64/sparc64/cheetah.c	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/sparc64/cheetah.c	Sat Jul  2 11:14:54 2011	(r223719)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2003 Jake Burkholder.
- * Copyright (c) 2005, 2008, 2010 Marius Strobl 
+ * Copyright (c) 2005 - 2011 Marius Strobl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -28,8 +28,6 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_pmap.h"
-
 #include 
 #include 
 #include 
@@ -45,17 +43,19 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 
 #define	CHEETAH_ICACHE_TAG_LOWER	0x30
+#define	CHEETAH_T16_ENTRIES		16
+#define	CHEETAH_DT512_ENTRIES		512
+#define	CHEETAH_IT128_ENTRIES		128
+#define	CHEETAH_IT512_ENTRIES		512
 
 /*
- * CPU-specific initialization - this is used for both the Sun Cheetah and
- * later as well as the Fujitsu Zeus and later CPUs.
+ * CPU-specific initialization for Sun Cheetah and later CPUs
  */
 void
 cheetah_init(u_int cpu_impl)
@@ -78,14 +78,6 @@ cheetah_init(u_int cpu_impl)
 	stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0);
 	membar(Sync);
 
-	if (cpu_impl == CPU_IMPL_SPARC64V) {
-		/* Ensure MCNTL_JPS1_TSBP is 0. */
-		val = ldxa(AA_MCNTL, ASI_MCNTL);
-		val &= ~MCNTL_JPS1_TSBP;
-		stxa(AA_MCNTL, ASI_MCNTL, val);
-		return;
-	}
-
 	/*
 	 * Configure the first large dTLB to hold 4MB pages (e.g. for direct
 	 * mappings) for all three contexts and ensure the second one is set
@@ -223,33 +215,92 @@ cheetah_icache_page_inval(vm_paddr_t pa 
 
 }
 
-#define	cheetah_dmap_all() do {						\
-	stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0);				\
-	stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0);				\
-	flush(KERNBASE);						\
-} while (0)
-
 /*
- * Flush all non-locked mappings from the TLB.
+ * Flush all non-locked mappings from the TLBs.
  */
 void
 cheetah_tlb_flush_nonlocked(void)
 {
 
-	cheetah_dmap_all();
+	stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0);
+	stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0);
+	flush(KERNBASE);
 }
 
 /*
- * Flush all user mappings from the TLB.
+ * Flush all user mappings from the TLBs.
  */
 void
-cheetah_tlb_flush_user()
+cheetah_tlb_flush_user(void)
 {
+	u_long data, tag;
+	register_t s;
+	u_int i, slot;
 
 	/*
-	 * Just use cheetah_dmap_all() and accept somes TLB misses
-	 * rather than searching all 1040 D-TLB and 144 I-TLB slots
-	 * for non-kernel mappings.
+	 * We read ASI_{D,I}TLB_DATA_ACCESS_REG twice back-to-back in order
+	 * to work around errata of USIII and beyond.
 	 */
-	cheetah_dmap_all();
+	for (i = 0; i < CHEETAH_T16_ENTRIES; i++) {
+		slot = TLB_DAR_SLOT(TLB_DAR_T16, i);
+		s = intr_disable();
+		(void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+		data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+		intr_restore(s);
+		tag = ldxa(slot, ASI_DTLB_TAG_READ_REG);
+		if ((data & TD_V) != 0 && (data & TD_L) == 0 &&
+		    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+			stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0);
+		s = intr_disable();
+		(void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+		data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+		intr_restore(s);
+		tag = ldxa(slot, ASI_ITLB_TAG_READ_REG);
+		if ((data & TD_V) != 0 && (data & TD_L) == 0 &&
+		    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+			stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0);
+	}
+	for (i = 0; i < CHEETAH_DT512_ENTRIES; i++) {
+		slot = TLB_DAR_SLOT(TLB_DAR_DT512_0, i);
+		s = intr_disable();
+		(void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+		data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+		intr_restore(s);
+		tag = ldxa(slot, ASI_DTLB_TAG_READ_REG);
+		if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+			stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0);
+		slot = TLB_DAR_SLOT(TLB_DAR_DT512_1, i);
+		s = intr_disable();
+		(void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+		data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+		intr_restore(s);
+		tag = ldxa(slot, ASI_DTLB_TAG_READ_REG);
+		if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+			stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0);
+	}
+	if (PCPU_GET(impl) == CPU_IMPL_ULTRASPARCIVp) {
+		for (i = 0; i < CHEETAH_IT512_ENTRIES; i++) {
+			slot = TLB_DAR_SLOT(TLB_DAR_IT512, i);
+			s = intr_disable();
+			(void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+			data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+			intr_restore(s);
+			tag = ldxa(slot, ASI_ITLB_TAG_READ_REG);
+			if ((data & TD_V) != 0 &&
+			    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+				stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0);
+		}
+	} else {
+		for (i = 0; i < CHEETAH_IT128_ENTRIES; i++) {
+			slot = TLB_DAR_SLOT(TLB_DAR_IT128, i);
+			s = intr_disable();
+			(void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+			data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+			tag = ldxa(slot, ASI_ITLB_TAG_READ_REG);
+			intr_restore(s);
+			if ((data & TD_V) != 0 &&
+			    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+				stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0);
+		}
+	}
 }

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/sparc64/machdep.c	Sat Jul  2 11:14:54 2011	(r223719)
@@ -348,9 +348,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 	/*
 	 * Do CPU-specific initialization.
 	 */
-	if (cpu_impl == CPU_IMPL_SPARC64V ||
-	    cpu_impl >= CPU_IMPL_ULTRASPARCIII)
+	if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
 		cheetah_init(cpu_impl);
+	else if (cpu_impl == CPU_IMPL_SPARC64V)
+		zeus_init(cpu_impl);
 
 	/*
 	 * Clear (S)TICK timer (including NPT).

Modified: head/sys/sparc64/sparc64/mp_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/mp_machdep.c	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/sparc64/mp_machdep.c	Sat Jul  2 11:14:54 2011	(r223719)
@@ -428,9 +428,11 @@ cpu_mp_bootstrap(struct pcpu *pc)
 	csa = &cpu_start_args;
 
 	/* Do CPU-specific initialization. */
-	if (pc->pc_impl == CPU_IMPL_SPARC64V ||
-	    pc->pc_impl >= CPU_IMPL_ULTRASPARCIII)
+	if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII)
 		cheetah_init(pc->pc_impl);
+	else if (pc->pc_impl == CPU_IMPL_SPARC64V)
+		zeus_init(pc->pc_impl);
+
 	/*
 	 * Enable the caches.  Note that his may include applying workarounds.
 	 */

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/sparc64/pmap.c	Sat Jul  2 11:14:54 2011	(r223719)
@@ -247,7 +247,7 @@ PMAP_STATS_VAR(pmap_ncopy_page_soc);
 PMAP_STATS_VAR(pmap_nnew_thread);
 PMAP_STATS_VAR(pmap_nnew_thread_oc);
 
-static inline u_long dtlb_get_data(u_int slot);
+static inline u_long dtlb_get_data(u_int tlb, u_int slot);
 
 /*
  * Quick sort callout for comparing memory regions
@@ -288,15 +288,21 @@ om_cmp(const void *a, const void *b)
 }
 
 static inline u_long
-dtlb_get_data(u_int slot)
+dtlb_get_data(u_int tlb, u_int slot)
 {
+	u_long data;
+	register_t s;
 
+	slot = TLB_DAR_SLOT(tlb, slot);
 	/*
-	 * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work
-	 * around errata of USIII and beyond.
+	 * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to
+	 * work around errata of USIII and beyond.
 	 */
-	(void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG);
-	return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG));
+	s = intr_disable();
+	(void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+	data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+	intr_restore(s);
+	return (data);
 }
 
 /*
@@ -392,7 +398,9 @@ pmap_bootstrap(u_int cpu_impl)
 	} else {
 		dtlb_slots_avail = 0;
 		for (i = 0; i < dtlb_slots; i++) {
-			data = dtlb_get_data(i);
+			data = dtlb_get_data(cpu_impl ==
+			    CPU_IMPL_ULTRASPARCIII ? TLB_DAR_T16 :
+			    TLB_DAR_T32, i);
 			if ((data & (TD_V | TD_L)) != (TD_V | TD_L))
 				dtlb_slots_avail++;
 		}

Modified: head/sys/sparc64/sparc64/spitfire.c
==============================================================================
--- head/sys/sparc64/sparc64/spitfire.c	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/sparc64/spitfire.c	Sat Jul  2 11:14:54 2011	(r223719)
@@ -140,47 +140,45 @@ spitfire_icache_page_inval(vm_paddr_t pa
 }
 
 /*
- * Flush all non-locked mappings from the TLB.
+ * Flush all non-locked mappings from the TLBs.
  */
 void
 spitfire_tlb_flush_nonlocked(void)
 {
-	int i;
+	u_int i;
+	u_int slot;
 
 	for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) {
-		if ((ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG) &
-		    TD_L) == 0)
-			stxa_sync(TLB_DAR_SLOT(i),
-			    ASI_DTLB_DATA_ACCESS_REG, 0);
-		if ((ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG) &
-		    TD_L) == 0)
-			stxa_sync(TLB_DAR_SLOT(i),
-			    ASI_ITLB_DATA_ACCESS_REG, 0);
+		slot = TLB_DAR_SLOT(TLB_DAR_T32, i);
+		if ((ldxa(slot, ASI_DTLB_DATA_ACCESS_REG) & TD_L) == 0)
+			stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0);
+		if ((ldxa(slot, ASI_ITLB_DATA_ACCESS_REG) & TD_L) == 0)
+			stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0);
 	}
 }
 
 /*
- * Flush all user mappings from the TLB.
+ * Flush all user mappings from the TLBs.
  */
 void
 spitfire_tlb_flush_user(void)
 {
 	u_long data;
 	u_long tag;
-	int i;
+	u_int i;
+	u_int slot;
 
 	for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) {
-		data = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG);
-		tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG);
+		slot = TLB_DAR_SLOT(TLB_DAR_T32, i);
+		data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+		tag = ldxa(slot, ASI_DTLB_TAG_READ_REG);
 		if ((data & TD_V) != 0 && (data & TD_L) == 0 &&
 		    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
-			stxa_sync(TLB_DAR_SLOT(i),
-			    ASI_DTLB_DATA_ACCESS_REG, 0);
-		data = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG);
-		tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG);
+			stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0);
+		data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+		tag = ldxa(slot, ASI_ITLB_TAG_READ_REG);
 		if ((data & TD_V) != 0 && (data & TD_L) == 0 &&
 		    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
-			stxa_sync(TLB_DAR_SLOT(i),
-			    ASI_ITLB_DATA_ACCESS_REG, 0);
+			stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0);
 	}
 }

Modified: head/sys/sparc64/sparc64/zeus.c
==============================================================================
--- head/sys/sparc64/sparc64/zeus.c	Sat Jul  2 10:17:26 2011	(r223718)
+++ head/sys/sparc64/sparc64/zeus.c	Sat Jul  2 11:14:54 2011	(r223719)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2010 Marius Strobl 
+ * Copyright (c) 2010 - 2011 Marius Strobl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,64 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define	ZEUS_FTLB_ENTRIES	32
+#define	ZEUS_STLB_ENTRIES	2048
+
+/*
+ * CPU-specific initialization for Fujitsu Zeus CPUs
+ */
+void
+zeus_init(u_int cpu_impl)
+{
+	u_long val;
+
+	/* Ensure the TSB Extension Registers hold 0 as TSB_Base. */
+
+	stxa(AA_DMMU_TSB_PEXT_REG, ASI_DMMU, 0);
+	stxa(AA_IMMU_TSB_PEXT_REG, ASI_IMMU, 0);
+	membar(Sync);
+
+	stxa(AA_DMMU_TSB_SEXT_REG, ASI_DMMU, 0);
+	/*
+	 * NB: the secondary context was removed from the iMMU.
+	 */
+	membar(Sync);
+
+	stxa(AA_DMMU_TSB_NEXT_REG, ASI_DMMU, 0);
+	stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0);
+	membar(Sync);
+
+	val = ldxa(AA_MCNTL, ASI_MCNTL);
+	/* Ensure MCNTL_JPS1_TSBP is 0. */
+	val &= ~MCNTL_JPS1_TSBP;
+	/*
+	 * Ensure 4-Mbyte page entries are stored in the 1024-entry, 2-way set
+	 * associative TLB.
+	 */
+	val = (val & ~MCNTL_RMD_MASK) | MCNTL_RMD_1024;
+	stxa(AA_MCNTL, ASI_MCNTL, val);
+}
+
+/*
+ * Enable level 1 caches.
+ */
+void
+zeus_cache_enable(u_int cpu_impl)
+{
+	u_long lsu;
+
+	lsu = ldxa(0, ASI_LSU_CTL_REG);
+	stxa(0, ASI_LSU_CTL_REG, lsu | LSU_IC | LSU_DC);
+	flush(KERNBASE);
+}
 
 /*
  * Flush all lines from the level 1 caches.
@@ -63,3 +120,52 @@ zeus_icache_page_inval(vm_paddr_t pa __u
 {
 
 }
+
+/*
+ * Flush all non-locked mappings from the TLBs.
+ */
+void
+zeus_tlb_flush_nonlocked(void)
+{
+
+	stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0);
+	stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0);
+	flush(KERNBASE);
+}
+
+/*
+ * Flush all user mappings from the TLBs.
+ */
+void
+zeus_tlb_flush_user(void)
+{
+	u_long data, tag;
+	u_int i, slot;
+
+	for (i = 0; i < ZEUS_FTLB_ENTRIES; i++) {
+		slot = TLB_DAR_SLOT(TLB_DAR_FTLB, i);
+		data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+		tag = ldxa(slot, ASI_DTLB_TAG_READ_REG);
+		if ((data & TD_V) != 0 && (data & TD_L) == 0 &&
+		    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+			stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0);
+		data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+		tag = ldxa(slot, ASI_ITLB_TAG_READ_REG);
+		if ((data & TD_V) != 0 && (data & TD_L) == 0 &&
+		    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+			stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0);
+	}
+	for (i = 0; i < ZEUS_STLB_ENTRIES; i++) {
+		slot = TLB_DAR_SLOT(TLB_DAR_STLB, i);
+		data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG);
+		tag = ldxa(slot, ASI_DTLB_TAG_READ_REG);
+		if ((data & TD_V) != 0 && (data & TD_L) == 0 &&
+		    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+			stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0);
+		data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG);
+		tag = ldxa(slot, ASI_ITLB_TAG_READ_REG);
+		if ((data & TD_V) != 0 && (data & TD_L) == 0 &&
+		    TLB_TAR_CTX(tag) != TLB_CTX_KERNEL)
+			stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0);
+	}
+}

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 11:46:23 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76BE0106566C;
	Sat,  2 Jul 2011 11:46:23 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 66C338FC15;
	Sat,  2 Jul 2011 11:46:23 +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 p62BkNx0038490;
	Sat, 2 Jul 2011 11:46:23 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62BkNYc038488;
	Sat, 2 Jul 2011 11:46:23 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201107021146.p62BkNYc038488@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 2 Jul 2011 11:46:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223720 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 11:46:23 -0000

Author: marius
Date: Sat Jul  2 11:46:23 2011
New Revision: 223720
URL: http://svn.freebsd.org/changeset/base/223720

Log:
  Don't waste a delay slot.

Modified:
  head/sys/sparc64/sparc64/mp_exception.S

Modified: head/sys/sparc64/sparc64/mp_exception.S
==============================================================================
--- head/sys/sparc64/sparc64/mp_exception.S	Sat Jul  2 11:14:54 2011	(r223719)
+++ head/sys/sparc64/sparc64/mp_exception.S	Sat Jul  2 11:46:23 2011	(r223720)
@@ -247,8 +247,8 @@ ENTRY(tl_ipi_tlb_range_demap)
 	ldx	[%g5 + ITA_START], %g1
 	ldx	[%g5 + ITA_END], %g2
 
-1:	or	%g1, %g3, %g4
 	sethi	%hi(KERNBASE), %g6
+1:	or	%g1, %g3, %g4
 	stxa	%g0, [%g4] ASI_DMMU_DEMAP
 	stxa	%g0, [%g4] ASI_IMMU_DEMAP
 	flush	%g6
@@ -257,7 +257,7 @@ ENTRY(tl_ipi_tlb_range_demap)
 	add	%g1, %g6, %g1
 	cmp	%g1, %g2
 	blt,a,pt %xcc, 1b
-	 nop
+	 sethi	%hi(KERNBASE), %g6
 
 	IPI_DONE(%g5, %g1, %g2, %g3, %g4, %g6)
 	retry

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 12:56:03 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBD03106564A;
	Sat,  2 Jul 2011 12:56:03 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9265C8FC13;
	Sat,  2 Jul 2011 12:56: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 p62Cu3aj040539;
	Sat, 2 Jul 2011 12:56:03 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62Cu3Yp040536;
	Sat, 2 Jul 2011 12:56:03 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201107021256.p62Cu3Yp040536@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 2 Jul 2011 12:56:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223721 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 12:56:03 -0000

Author: marius
Date: Sat Jul  2 12:56:03 2011
New Revision: 223721
URL: http://svn.freebsd.org/changeset/base/223721

Log:
  UltraSPARC-IV CPUs seem to be affected by a not publicly documented
  erratum causing them to trigger stray vector interrupts accompanied by a
  state in which they even fault on locked TLB entries. Just retrying the
  instruction in that case gets the CPU back on track though. OpenSolaris
  also just ignores a certain number of stray vector interrupts.
  While at it, implement the stray vector interrupt handling for SPARC64-VI
  which use these for indicating uncorrectable errors in interrupt packets.

Modified:
  head/sys/sparc64/sparc64/exception.S
  head/sys/sparc64/sparc64/interrupt.S

Modified: head/sys/sparc64/sparc64/exception.S
==============================================================================
--- head/sys/sparc64/sparc64/exception.S	Sat Jul  2 11:46:23 2011	(r223720)
+++ head/sys/sparc64/sparc64/exception.S	Sat Jul  2 12:56:03 2011	(r223721)
@@ -585,7 +585,8 @@ END(tl0_sfsr_trap)
 	andcc	%g1, IRSR_BUSY, %g0
 	bnz,a,pt %xcc, intr_vector
 	 nop
-	sir
+	ba,a,pt	%xcc, intr_vector_stray
+	 nop
 	.align	32
 	.endm
 

Modified: head/sys/sparc64/sparc64/interrupt.S
==============================================================================
--- head/sys/sparc64/sparc64/interrupt.S	Sat Jul  2 11:46:23 2011	(r223720)
+++ head/sys/sparc64/sparc64/interrupt.S	Sat Jul  2 12:56:03 2011	(r223721)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "assym.s"
 
@@ -153,6 +154,29 @@ ENTRY(intr_vector)
 	retry
 END(intr_vector)
 
+ENTRY(intr_vector_stray)
+	/*
+	 * SPARC64-VI trigger stray vector interrupts in order to indicate
+	 * uncorrectable errors in interrupt packets, which still need to be
+	 * acknowledged though.
+	 * US-IV occasionally trigger stray vector interrupts for reasons
+	 * unknown accompanied by a state in which they even fault on locked
+	 * TLB entries so we can't even log these here.  Just retrying the
+	 * instruction in that case gets the CPU back on track.
+	 */
+	rdpr	%ver, %g1
+	srlx	%g1, VER_IMPL_SHIFT, %g1
+	sll	%g1, VER_IMPL_SIZE, %g1
+	srl	%g1, VER_IMPL_SIZE, %g1
+	cmp	%g1, CPU_IMPL_SPARC64VI
+	bne,a,pn %icc, 1f
+	 nop
+	stxa	%g0, [%g0] ASI_INTR_RECEIVE
+	membar	#Sync
+
+1:	retry
+END(intr_vector_stray)
+
 ENTRY(intr_fast)
 	save	%sp, -CCFSZ, %sp
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 13:54:20 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B96B1065687;
	Sat,  2 Jul 2011 13:54:20 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B1FE8FC23;
	Sat,  2 Jul 2011 13:54:20 +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 p62DsKjN042700;
	Sat, 2 Jul 2011 13:54:20 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62DsKnm042696;
	Sat, 2 Jul 2011 13:54:20 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201107021354.p62DsKnm042696@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 2 Jul 2011 13:54:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223722 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 13:54:20 -0000

Author: ed
Date: Sat Jul  2 13:54:20 2011
New Revision: 223722
URL: http://svn.freebsd.org/changeset/base/223722

Log:
  Reintroduce the cioctl() hook in the TTY layer for digi(4).
  
  The cioctl() hook can be used by drivers to add ioctls to the *.init and
  *.lock devices. This commit breaks the ttydevsw ABI, since this
  structure didn't provide any padding. To prevent ABI breakage in the
  future, add a tsw_spare.
  
  Submitted by:	Peter Jeremy 
  Obtained from:	kern/152254 (slightly modified)

Modified:
  head/sys/kern/tty.c
  head/sys/sys/tty.h
  head/sys/sys/ttydevsw.h

Modified: head/sys/kern/tty.c
==============================================================================
--- head/sys/kern/tty.c	Sat Jul  2 12:56:03 2011	(r223721)
+++ head/sys/kern/tty.c	Sat Jul  2 13:54:20 2011	(r223722)
@@ -91,7 +91,7 @@ static const char	*dev_console_filename;
 			HUPCL|CLOCAL|CCTS_OFLOW|CRTS_IFLOW|CDTR_IFLOW|\
 			CDSR_OFLOW|CCAR_OFLOW)
 
-#define	TTY_CALLOUT(tp,d) ((d) != (tp)->t_dev && (d) != dev_console)
+#define	TTY_CALLOUT(tp,d) (dev2unit(d) & TTYUNIT_CALLOUT)
 
 /*
  * Set TTY buffer sizes.
@@ -772,6 +772,10 @@ ttyil_ioctl(struct cdev *dev, u_long cmd
 		goto done;
 	}
 
+	error = ttydevsw_cioctl(tp, dev2unit(dev), cmd, data, td);
+	if (error != ENOIOCTL)
+		goto done;
+
 	switch (cmd) {
 	case TIOCGETA:
 		/* Obtain terminal flags through tcgetattr(). */
@@ -878,6 +882,13 @@ ttydevsw_defioctl(struct tty *tp, u_long
 }
 
 static int
+ttydevsw_defcioctl(struct tty *tp, int unit, u_long cmd, caddr_t data, struct thread *td)
+{
+
+	return (ENOIOCTL);
+}
+
+static int
 ttydevsw_defparam(struct tty *tp, struct termios *t)
 {
 
@@ -955,6 +966,7 @@ tty_alloc_mutex(struct ttydevsw *tsw, vo
 	PATCH_FUNC(outwakeup);
 	PATCH_FUNC(inwakeup);
 	PATCH_FUNC(ioctl);
+	PATCH_FUNC(cioctl);
 	PATCH_FUNC(param);
 	PATCH_FUNC(modem);
 	PATCH_FUNC(mmap);
@@ -1190,13 +1202,13 @@ tty_makedev(struct tty *tp, struct ucred
 
 	/* Slave call-in devices. */
 	if (tp->t_flags & TF_INITLOCK) {
-		dev = make_dev_cred(&ttyil_cdevsw, 0, cred,
+		dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_INIT, cred,
 		    uid, gid, mode, "%s%s.init", prefix, name);
 		dev_depends(tp->t_dev, dev);
 		dev->si_drv1 = tp;
 		dev->si_drv2 = &tp->t_termios_init_in;
 
-		dev = make_dev_cred(&ttyil_cdevsw, 0, cred,
+		dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_LOCK, cred,
 		    uid, gid, mode, "%s%s.lock", prefix, name);
 		dev_depends(tp->t_dev, dev);
 		dev->si_drv1 = tp;
@@ -1205,20 +1217,22 @@ tty_makedev(struct tty *tp, struct ucred
 
 	/* Call-out devices. */
 	if (tp->t_flags & TF_CALLOUT) {
-		dev = make_dev_cred(&ttydev_cdevsw, 0, cred,
+		dev = make_dev_cred(&ttydev_cdevsw, TTYUNIT_CALLOUT, cred,
 		    UID_UUCP, GID_DIALER, 0660, "cua%s", name);
 		dev_depends(tp->t_dev, dev);
 		dev->si_drv1 = tp;
 
 		/* Slave call-out devices. */
 		if (tp->t_flags & TF_INITLOCK) {
-			dev = make_dev_cred(&ttyil_cdevsw, 0, cred,
+			dev = make_dev_cred(&ttyil_cdevsw, 
+			    TTYUNIT_CALLOUT | TTYUNIT_INIT, cred,
 			    UID_UUCP, GID_DIALER, 0660, "cua%s.init", name);
 			dev_depends(tp->t_dev, dev);
 			dev->si_drv1 = tp;
 			dev->si_drv2 = &tp->t_termios_init_out;
 
-			dev = make_dev_cred(&ttyil_cdevsw, 0, cred,
+			dev = make_dev_cred(&ttyil_cdevsw,
+			    TTYUNIT_CALLOUT | TTYUNIT_LOCK, cred,
 			    UID_UUCP, GID_DIALER, 0660, "cua%s.lock", name);
 			dev_depends(tp->t_dev, dev);
 			dev->si_drv1 = tp;

Modified: head/sys/sys/tty.h
==============================================================================
--- head/sys/sys/tty.h	Sat Jul  2 12:56:03 2011	(r223721)
+++ head/sys/sys/tty.h	Sat Jul  2 13:54:20 2011	(r223722)
@@ -152,6 +152,11 @@ struct xtty {
 
 #ifdef _KERNEL
 
+/* Used to distinguish between normal, callout, lock and init devices. */
+#define	TTYUNIT_INIT		0x1
+#define	TTYUNIT_LOCK		0x2
+#define	TTYUNIT_CALLOUT		0x4
+
 /* Allocation and deallocation. */
 struct tty *tty_alloc(struct ttydevsw *tsw, void *softc);
 struct tty *tty_alloc_mutex(struct ttydevsw *tsw, void *softc, struct mtx *mtx);

Modified: head/sys/sys/ttydevsw.h
==============================================================================
--- head/sys/sys/ttydevsw.h	Sat Jul  2 12:56:03 2011	(r223721)
+++ head/sys/sys/ttydevsw.h	Sat Jul  2 13:54:20 2011	(r223722)
@@ -46,6 +46,8 @@ typedef void tsw_outwakeup_t(struct tty 
 typedef void tsw_inwakeup_t(struct tty *tp);
 typedef int tsw_ioctl_t(struct tty *tp, u_long cmd, caddr_t data,
     struct thread *td);
+typedef int tsw_cioctl_t(struct tty *tp, int unit, u_long cmd, caddr_t data,
+    struct thread *td);
 typedef int tsw_param_t(struct tty *tp, struct termios *t);
 typedef int tsw_modem_t(struct tty *tp, int sigon, int sigoff);
 typedef int tsw_mmap_t(struct tty *tp, vm_ooffset_t offset,
@@ -63,6 +65,7 @@ struct ttydevsw {
 	tsw_inwakeup_t	*tsw_inwakeup;	/* Input can be stored again. */
 
 	tsw_ioctl_t	*tsw_ioctl;	/* ioctl() hooks. */
+	tsw_cioctl_t	*tsw_cioctl;	/* ioctl() on control devices. */
 	tsw_param_t	*tsw_param;	/* TIOCSETA device parameter setting. */
 	tsw_modem_t	*tsw_modem;	/* Modem sigon/sigoff. */
 
@@ -70,6 +73,8 @@ struct ttydevsw {
 	tsw_pktnotify_t	*tsw_pktnotify;	/* TIOCPKT events. */
 
 	tsw_free_t	*tsw_free;	/* Destructor. */
+
+	void		*tsw_spare[4];	/* For future use. */
 };
 
 static __inline int
@@ -126,6 +131,15 @@ ttydevsw_ioctl(struct tty *tp, u_long cm
 }
 
 static __inline int
+ttydevsw_cioctl(struct tty *tp, int unit, u_long cmd, caddr_t data, struct thread *td)
+{
+	tty_lock_assert(tp, MA_OWNED);
+	MPASS(!tty_gone(tp));
+
+	return tp->t_devsw->tsw_cioctl(tp, unit, cmd, data, td);
+}
+
+static __inline int
 ttydevsw_param(struct tty *tp, struct termios *t)
 {
 	MPASS(!tty_gone(tp));

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 15:13:58 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C50EE106567D;
	Sat,  2 Jul 2011 15:13:58 +0000 (UTC)
	(envelope-from minimarmot@gmail.com)
Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B4C78FC0A;
	Sat,  2 Jul 2011 15:13:57 +0000 (UTC)
Received: by gwb15 with SMTP id 15so2054800gwb.13
	for ; Sat, 02 Jul 2011 08:13:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=8X+2FohYYfmM/KK4zQa6rrUCIOAEj4XJrEL5o0zMg8A=;
	b=FAewlmzijX2SV7yJdfFKlDRdGdchedHIAGsSxHt0wiwT6J0eBlRa15DoYTw/NbO3IR
	LTbBxh63HtaS9haHe7iuckDGgX7S6p7znWYsUeJwL7dt70rMiRiLkjVmI/YZJomzCDU/
	ogc0yIFzlzYyjNxv4KJHg/3tARwSE44V0hVYs=
MIME-Version: 1.0
Received: by 10.236.111.37 with SMTP id v25mr5723461yhg.292.1309619637528;
	Sat, 02 Jul 2011 08:13:57 -0700 (PDT)
Received: by 10.236.102.169 with HTTP; Sat, 2 Jul 2011 08:13:57 -0700 (PDT)
In-Reply-To: <201107021354.p62DsKnm042696@svn.freebsd.org>
References: <201107021354.p62DsKnm042696@svn.freebsd.org>
Date: Sat, 2 Jul 2011 11:13:57 -0400
Message-ID: 
From: Ben Kaduk 
To: Ed Schouten 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r223722 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 15:13:58 -0000

On Sat, Jul 2, 2011 at 9:54 AM, Ed Schouten  wrote:
> Author: ed
> Date: Sat Jul =A02 13:54:20 2011
> New Revision: 223722
> URL: http://svn.freebsd.org/changeset/base/223722
>
> Log:
> =A0Reintroduce the cioctl() hook in the TTY layer for digi(4).
>
> =A0The cioctl() hook can be used by drivers to add ioctls to the *.init a=
nd
> =A0*.lock devices. This commit breaks the ttydevsw ABI, since this

Aren't __FreeBSD_version bumps cheap, these days?

-Ben Kaduk

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 15:34:42 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0521E106564A;
	Sat,  2 Jul 2011 15:34:42 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id D28E58FC0A;
	Sat,  2 Jul 2011 15:34:41 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 5B10C46B45;
	Sat,  2 Jul 2011 11:34:41 -0400 (EDT)
Date: Sat, 2 Jul 2011 16:34:41 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Sergey Kandaurov 
In-Reply-To: 
Message-ID: 
References: <201106241440.p5OEeMER058307@svn.freebsd.org>
	
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="621616949-1270408066-1309620881=:58285"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jonathan Anderson 
Subject: Re: svn commit: r223505 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 15:34:42 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--621616949-1270408066-1309620881=:58285
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT

On Fri, 24 Jun 2011, Sergey Kandaurov wrote:

> On 24 June 2011 18:40, Jonathan Anderson  wrote:
>> Author: jonathan
>> Date: Fri Jun 24 14:40:22 2011
>> New Revision: 223505
>> URL: http://svn.freebsd.org/changeset/base/223505
>>
>> Log:  Tidy up a capabilities-related comment.
>>
>>  This comment refers to an #ifdef that hasn't been merged [yet?]; remove 
>> it.
>>
>>  Approved by: rwatson
>
> Thanks! Can you close PR kern/148801 as well?
>
> This comment was mistakenly left after "Sweep kernel replacing suser(9) 
> calls with priv(9) calls" (svn r164033 by rwatson@) in which the exp. 
> CAPABILITIES facility transformed to currently operating priv(9). After that 
> the comment has lost its relevance. May be applied down to 7.x.

And, Capsicum capabilities are quite different from POSIX capabilities.

Robert
--621616949-1270408066-1309620881=:58285--

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 15:41:23 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 499ED1065678;
	Sat,  2 Jul 2011 15:41:23 +0000 (UTC)
	(envelope-from jonathan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 39DEA8FC0A;
	Sat,  2 Jul 2011 15:41:23 +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 p62FfNn7046081;
	Sat, 2 Jul 2011 15:41:23 GMT (envelope-from jonathan@svn.freebsd.org)
Received: (from jonathan@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62FfN67046078;
	Sat, 2 Jul 2011 15:41:23 GMT (envelope-from jonathan@svn.freebsd.org)
Message-Id: <201107021541.p62FfN67046078@svn.freebsd.org>
From: Jonathan Anderson 
Date: Sat, 2 Jul 2011 15:41:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223723 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 15:41:23 -0000

Author: jonathan
Date: Sat Jul  2 15:41:22 2011
New Revision: 223723
URL: http://svn.freebsd.org/changeset/base/223723

Log:
  Define the CAPABILITIES kernel option.
  
  This option will enable Capsicum capabilities, which provide a fine-grained
  mask on operations that can be performed on file descriptors.
  
  Approved by: mentor (rwatson), re (Capsicum blanket ok)
  Sponsored by: Google Inc

Modified:
  head/sys/conf/NOTES
  head/sys/conf/options

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Sat Jul  2 13:54:20 2011	(r223722)
+++ head/sys/conf/NOTES	Sat Jul  2 15:41:22 2011	(r223723)
@@ -1162,7 +1162,8 @@ options 	MAC_STUB
 options 	MAC_TEST
 
 # Support for Capsicum
-options 	CAPABILITY_MODE
+options 	CAPABILITIES	# fine-grained rights on file descriptors
+options 	CAPABILITY_MODE	# sandboxes with no global namespace access
 
 
 #####################################################################

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Sat Jul  2 13:54:20 2011	(r223722)
+++ head/sys/conf/options	Sat Jul  2 15:41:22 2011	(r223723)
@@ -63,6 +63,7 @@ SYSCTL_DEBUG	opt_sysctl.h
 ADAPTIVE_LOCKMGRS
 ALQ
 AUDIT		opt_global.h
+CAPABILITIES	opt_capsicum.h
 CAPABILITY_MODE	opt_capsicum.h
 CODA_COMPAT_5	opt_coda.h
 COMPAT_43	opt_compat.h

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 18:33:29 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC000106564A;
	Sat,  2 Jul 2011 18:33:28 +0000 (UTC)
	(envelope-from uqs@spoerlein.net)
Received: from acme.spoerlein.net (acme.spoerlein.net
	[IPv6:2a01:4f8:131:23c2::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 323288FC12;
	Sat,  2 Jul 2011 18:33:28 +0000 (UTC)
Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1])
	by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id p62IXLsQ018189
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);
	Sat, 2 Jul 2011 20:33:21 +0200 (CEST)
	(envelope-from uqs@spoerlein.net)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net;
	s=dkim200908; t=1309631602;
	bh=H7kGlo6/Vjp0rClWEtRLXfK1X4/++5g4XKcboPc//V8=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	Content-Type:In-Reply-To;
	b=HdWNSXIa37mCIqT0XUSzcRhMaTzQa8cJoMicMRjDRjA6KyFjTvFdCMO15dEXOrat9
	/6g1ZWGh9xM6ocwlldQbdpG696KHpEOHKXfszATGvW7OtRYMmeURyvVVfs5G6ZT33e
	OJTCrCJSE3DCsPCd6Yzz4sLSILZfCW8PLv+YkBB8=
Date: Sat, 2 Jul 2011 20:33:21 +0200
From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= 
To: Doug Barton 
Message-ID: <20110702183320.GB8485@acme.spoerlein.net>
Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= ,
	Doug Barton , Warner Losh ,
	Robert Watson , Joel Dahl ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	svn-src-head@FreeBSD.org
References: <201106110908.p5B98kkE066709@svn.freebsd.org>
	
	<4DF3B12C.8020505@FreeBSD.org>
	<9583277B-6EC0-4B7F-9640-2B128A96C6B8@bsdimp.com>
	<4DF3D633.5060506@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4DF3D633.5060506@FreeBSD.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	Robert Watson ,
	Joel Dahl , svn-src-head@FreeBSD.org,
	Warner Losh 
Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 18:33:29 -0000

On Sat, 11.06.2011 at 13:55:15 -0700, Doug Barton wrote:
> On 6/11/2011 1:02 PM, Warner Losh wrote:
> >
> > On Jun 11, 2011, at 12:17 PM, Doug Barton wrote:
> >
> >> On 6/11/2011 6:07 AM, Robert Watson wrote:
> >>> To me, this seems like the wrong direction.  Over the last decade, we've
> >>> been trying to move away from conditional compilation of features to
> >>> having them be loadable as modules.
> >>
> >> FWIW, I agree. I'm wondering though, is there still a performance penalty for modules? My understanding in the past was that there is, although for most use cases it's in the statistical noise. Is that still true?
> >
> > At run time, I believe that's true.  At load time, lots of modules can take a few seconds longer.
> 
> I have 3 or 4 modules loaded via loader.conf at boot time. They take at 
> least 2 seconds each. IMO loading everything via loader.conf would slow 
> the boot so much as to be a non-starter.
> 
> OTOH, I could imagine an rc.d script that depends on mountcritlocal that 
> could load a list of modules. Unless I'm missing something that would be 
> several times faster.

I suspect this is your BIOS' fault. I load 22 modules via loader.conf
and the loader takes 2, at most 3, seconds to load them all (next to the
kernel). This is true for all machines that I own/owned.

As you can guess, I'm very much in favour of moving modules from GENERIC
to loader.conf ...

Uli

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 19:05:34 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 7A8031065673; Sat,  2 Jul 2011 19:05:34 +0000 (UTC)
Date: Sat, 2 Jul 2011 19:05:34 +0000
From: Alexander Best 
To: Ulrich =?iso-8859-15?Q?Sp=F6rlein?= ,
	Doug Barton , Warner Losh ,
	Robert Watson , Joel Dahl ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	svn-src-head@FreeBSD.org
Message-ID: <20110702190534.GA48471@freebsd.org>
References: <201106110908.p5B98kkE066709@svn.freebsd.org>
	
	<4DF3B12C.8020505@FreeBSD.org>
	<9583277B-6EC0-4B7F-9640-2B128A96C6B8@bsdimp.com>
	<4DF3D633.5060506@FreeBSD.org>
	<20110702183320.GB8485@acme.spoerlein.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20110702183320.GB8485@acme.spoerlein.net>
Cc: 
Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 19:05:34 -0000

On Sat Jul  2 11, Ulrich Spörlein wrote:
> On Sat, 11.06.2011 at 13:55:15 -0700, Doug Barton wrote:
> > On 6/11/2011 1:02 PM, Warner Losh wrote:
> > >
> > > On Jun 11, 2011, at 12:17 PM, Doug Barton wrote:
> > >
> > >> On 6/11/2011 6:07 AM, Robert Watson wrote:
> > >>> To me, this seems like the wrong direction.  Over the last decade, we've
> > >>> been trying to move away from conditional compilation of features to
> > >>> having them be loadable as modules.
> > >>
> > >> FWIW, I agree. I'm wondering though, is there still a performance penalty for modules? My understanding in the past was that there is, although for most use cases it's in the statistical noise. Is that still true?
> > >
> > > At run time, I believe that's true.  At load time, lots of modules can take a few seconds longer.
> > 
> > I have 3 or 4 modules loaded via loader.conf at boot time. They take at 
> > least 2 seconds each. IMO loading everything via loader.conf would slow 
> > the boot so much as to be a non-starter.
> > 
> > OTOH, I could imagine an rc.d script that depends on mountcritlocal that 
> > could load a list of modules. Unless I'm missing something that would be 
> > several times faster.
> 
> I suspect this is your BIOS' fault. I load 22 modules via loader.conf
> and the loader takes 2, at most 3, seconds to load them all (next to the
> kernel). This is true for all machines that I own/owned.

actually i recenly switched from using kernel modules to one big kernel entity,
simply because i had the same problem. each module was taking ~ 3-5 seconds to
load. make that 10 modules and you have additional loading time of almost half
a minute. now that i'm using one big kernel entity i was able to reduce the
loading time to ~ 4 seconds plus an extra 3 seconds for nvidia.ko.

i could upload two videos demonstrating the huge differences between both
schemes on my computer, if somebody is interested in it.

cheers.
alex

> 
> As you can guess, I'm very much in favour of moving modules from GENERIC
> to loader.conf ...
> 
> Uli

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 20:26:38 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D8BE1065672;
	Sat,  2 Jul 2011 20:26:38 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 22F3B8FC13;
	Sat,  2 Jul 2011 20:26: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 p62KQce0054567;
	Sat, 2 Jul 2011 20:26:38 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62KQc8j054565;
	Sat, 2 Jul 2011 20:26:38 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201107022026.p62KQc8j054565@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sat, 2 Jul 2011 20:26:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223727 - head/sys/dev/sound/usb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 20:26:38 -0000

Author: hselasky
Date: Sat Jul  2 20:26:37 2011
New Revision: 223727
URL: http://svn.freebsd.org/changeset/base/223727

Log:
  Fix problem about USB MIDI TX data format, that some devices only accept
  a maximum of 4 bytes (one command) per short terminated USB transfer.
  Optimise the TX case by sending multiple USB frames.
  
  MFC after:	1 week

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==============================================================================
--- head/sys/dev/sound/usb/uaudio.c	Sat Jul  2 20:14:40 2011	(r223726)
+++ head/sys/dev/sound/usb/uaudio.c	Sat Jul  2 20:26:37 2011	(r223727)
@@ -192,7 +192,8 @@ struct uaudio_chan {
 };
 
 #define	UMIDI_CABLES_MAX   16		/* units */
-#define	UMIDI_BULK_SIZE  1024		/* bytes */
+#define	UMIDI_TX_FRAMES	   64		/* units */
+#define	UMIDI_TX_BUFFER    (UMIDI_TX_FRAMES * 4)	/* bytes */
 
 enum {
 	UMIDI_TX_TRANSFER,
@@ -497,8 +498,8 @@ static const struct usb_config
 		.type = UE_BULK,
 		.endpoint = UE_ADDR_ANY,
 		.direction = UE_DIR_OUT,
-		.bufsize = UMIDI_BULK_SIZE,
-		.flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
+		.bufsize = UMIDI_TX_BUFFER,
+		.frames = UMIDI_TX_FRAMES,
 		.callback = &umidi_bulk_write_callback,
 	},
 
@@ -507,7 +508,7 @@ static const struct usb_config
 		.endpoint = UE_ADDR_ANY,
 		.direction = UE_DIR_IN,
 		.bufsize = 4,	/* bytes */
-		.flags = {.pipe_bof = 1,.short_xfer_ok = 1,.proxy_buffer = 1,},
+		.flags = {.short_xfer_ok = 1,.proxy_buffer = 1,},
 		.callback = &umidi_bulk_read_callback,
 	},
 };
@@ -3541,7 +3542,7 @@ umidi_bulk_write_callback(struct usb_xfe
 	struct umidi_sub_chan *sub;
 	struct usb_page_cache *pc;
 	uint32_t actlen;
-	uint16_t total_length;
+	uint16_t nframes;
 	uint8_t buf;
 	uint8_t start_cable;
 	uint8_t tr_any;
@@ -3549,6 +3550,10 @@ umidi_bulk_write_callback(struct usb_xfe
 
 	usbd_xfer_status(xfer, &len, NULL, NULL, NULL);
 
+	/*
+	 * NOTE: Some MIDI devices only accept 4 bytes of data per
+	 * short terminated USB transfer.
+	 */
 	switch (USB_GET_STATE(xfer)) {
 	case USB_ST_TRANSFERRED:
 		DPRINTF("actlen=%d bytes\n", len);
@@ -3557,10 +3562,9 @@ umidi_bulk_write_callback(struct usb_xfe
 tr_setup:
 		DPRINTF("start\n");
 
-		total_length = 0;	/* reset */
+		nframes = 0;	/* reset */
 		start_cable = chan->curr_cable;
 		tr_any = 0;
-		pc = usbd_xfer_get_frame(xfer, 0);
 
 		while (1) {
 
@@ -3569,51 +3573,54 @@ tr_setup:
 			sub = &chan->sub[chan->curr_cable];
 
 			if (sub->write_open) {
-				usb_fifo_get_data(sub->fifo.fp[USB_FIFO_TX],
-				    pc, total_length, 1, &actlen, 0);
+				usb_fifo_get_data_linear(sub->fifo.fp[USB_FIFO_TX],
+				    &buf, 1, &actlen, 0);
 			} else {
 				actlen = 0;
 			}
 
 			if (actlen) {
-				usbd_copy_out(pc, total_length, &buf, 1);
 
 				tr_any = 1;
 
-				DPRINTF("byte=0x%02x\n", buf);
+				DPRINTF("byte=0x%02x from FIFO %u\n", buf,
+				    (unsigned int)chan->curr_cable);
 
 				if (umidi_convert_to_usb(sub, chan->curr_cable, buf)) {
 
-					DPRINTF("sub= %02x %02x %02x %02x\n",
+					DPRINTF("sub=0x%02x 0x%02x 0x%02x 0x%02x\n",
 					    sub->temp_cmd[0], sub->temp_cmd[1],
 					    sub->temp_cmd[2], sub->temp_cmd[3]);
 
-					usbd_copy_in(pc, total_length,
-					    sub->temp_cmd, 4);
+					usbd_xfer_set_frame_offset(xfer, 4 * nframes, nframes);
+					usbd_xfer_set_frame_len(xfer, nframes, 4);
 
-					total_length += 4;
+					pc = usbd_xfer_get_frame(xfer, nframes);
 
-					if (total_length >= UMIDI_BULK_SIZE) {
+					usbd_copy_in(pc, 0, sub->temp_cmd, 4);
+
+					nframes++;
+					if (nframes >= UMIDI_TX_FRAMES)
 						break;
-					}
 				} else {
 					continue;
 				}
 			}
+
 			chan->curr_cable++;
-			if (chan->curr_cable >= chan->max_cable) {
+			if (chan->curr_cable >= chan->max_cable)
 				chan->curr_cable = 0;
-			}
+
 			if (chan->curr_cable == start_cable) {
-				if (tr_any == 0) {
+				if (tr_any == 0)
 					break;
-				}
 				tr_any = 0;
 			}
 		}
 
-		if (total_length) {
-			usbd_xfer_set_frame_len(xfer, 0, total_length);
+		if (nframes > 0) {
+			DPRINTF("Transferring %d frames\n", (int)nframes);
+			usbd_xfer_set_frames(xfer, nframes);
 			usbd_transfer_submit(xfer);
 		}
 		break;

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 20:58:34 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C18F5106564A;
	Sat,  2 Jul 2011 20:58:33 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AFE8E8FC12;
	Sat,  2 Jul 2011 20:58:33 +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 p62KwXGg055473;
	Sat, 2 Jul 2011 20:58:33 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62KwXxE055471;
	Sat, 2 Jul 2011 20:58:33 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201107022058.p62KwXxE055471@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sat, 2 Jul 2011 20:58:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223728 - head/sys/dev/usb/input
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 20:58:34 -0000

Author: hselasky
Date: Sat Jul  2 20:58:33 2011
New Revision: 223728
URL: http://svn.freebsd.org/changeset/base/223728

Log:
  Fix for "nomatch" event for ums and ukbd drivers when uhid is loaded.
  
  MFC after:	3 days

Modified:
  head/sys/dev/usb/input/uhid.c

Modified: head/sys/dev/usb/input/uhid.c
==============================================================================
--- head/sys/dev/usb/input/uhid.c	Sat Jul  2 20:26:37 2011	(r223727)
+++ head/sys/dev/usb/input/uhid.c	Sat Jul  2 20:58:33 2011	(r223728)
@@ -634,6 +634,18 @@ uhid_probe(device_t dev)
 	if (usb_test_quirk(uaa, UQ_HID_IGNORE))
 		return (ENXIO);
 
+	/*
+	 * Don't attach to mouse and keyboard devices, hence then no
+	 * "nomatch" event is generated and then ums and ukbd won't
+	 * attach properly when loaded.
+	 */
+	if ((uaa->info.bInterfaceClass == UICLASS_HID) &&
+	    (uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) &&
+	    ((uaa->info.bInterfaceProtocol == UIPROTO_BOOT_KEYBOARD) ||
+	     (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE))) {
+		return (ENXIO);
+	}
+
 	return (BUS_PROBE_GENERIC);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 22:25:25 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99E68106566B;
	Sat,  2 Jul 2011 22:25:25 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au
	[211.29.132.198])
	by mx1.freebsd.org (Postfix) with ESMTP id 27A318FC17;
	Sat,  2 Jul 2011 22:25:24 +0000 (UTC)
Received: from server.vk2pj.dyndns.org
	(c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103])
	by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p62MPMTT014200
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sun, 3 Jul 2011 08:25:23 +1000
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p62MPL1j001396;
	Sun, 3 Jul 2011 08:25:21 +1000 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p62MPKP8001395;
	Sun, 3 Jul 2011 08:25:20 +1000 (EST) (envelope-from peter)
Date: Sun, 3 Jul 2011 08:25:20 +1000
From: Peter Jeremy 
To: Ben Kaduk 
Message-ID: <20110702222520.GA28815@server.vk2pj.dyndns.org>
References: <201107021354.p62DsKnm042696@svn.freebsd.org>
	
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="PEIAKu/WMn1b1Hv9"
Content-Disposition: inline
In-Reply-To: 
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ed Schouten 
Subject: Re: svn commit: r223722 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 22:25:25 -0000


--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2011-Jul-02 11:13:57 -0400, Ben Kaduk  wrote:
>On Sat, Jul 2, 2011 at 9:54 AM, Ed Schouten  wrote:
>> =A0Reintroduce the cioctl() hook in the TTY layer for digi(4).

Thanks Ed.

>> =A0The cioctl() hook can be used by drivers to add ioctls to the *.init =
and
>> =A0*.lock devices. This commit breaks the ttydevsw ABI, since this
>
>Aren't __FreeBSD_version bumps cheap, these days?

A __FreeBSD_version bump can help a driver determine whether specific
functionality is available in the kernel but that doesn't solve this
particular issue.

A struct ttydevsw is allocated and populated by a TTY device driver
and passed to the generic TTY code to define callbacks from the
generic code into the driver.  Consider the case where a module
compiled with an old struct ttydevsw definition is loaded into a new
kernel - the generic TTY code will attempt to reference ttydevsw
fields that aren't defined by the driver, with results that won't be
pretty.

--=20
Peter Jeremy

--PEIAKu/WMn1b1Hv9
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iEYEARECAAYFAk4PmtAACgkQ/opHv/APuIeX8QCfZHpQ6DnaY55zRfjddq/S3sRw
mW4An23PaaPTgA1ZIx393g78U+BQVYEv
=ZXJy
-----END PGP SIGNATURE-----

--PEIAKu/WMn1b1Hv9--

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 23:34:47 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 84DE8106564A;
	Sat,  2 Jul 2011 23:34:47 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 755B78FC0A;
	Sat,  2 Jul 2011 23:34:47 +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 p62NYlpw060084;
	Sat, 2 Jul 2011 23:34:47 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62NYlmc060082;
	Sat, 2 Jul 2011 23:34:47 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201107022334.p62NYlmc060082@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 2 Jul 2011 23:34:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223729 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 23:34:47 -0000

Author: alc
Date: Sat Jul  2 23:34:47 2011
New Revision: 223729
URL: http://svn.freebsd.org/changeset/base/223729

Log:
  Initialize marker pages as held rather than fictitious/wired.  Marking the
  page as held is more useful as a safety precaution in case someone forgets
  to check for PG_MARKER.
  
  Reviewed by:	kib

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==============================================================================
--- head/sys/vm/vm_pageout.c	Sat Jul  2 20:58:33 2011	(r223728)
+++ head/sys/vm/vm_pageout.c	Sat Jul  2 23:34:47 2011	(r223729)
@@ -216,15 +216,21 @@ static void vm_req_vmdaemon(int req);
 #endif
 static void vm_pageout_page_stats(void);
 
+/*
+ * Initialize a dummy page for marking the caller's place in the specified
+ * paging queue.  In principle, this function only needs to set the flag
+ * PG_MARKER.  Nonetheless, it sets the flag VPO_BUSY and initializes the hold
+ * count to one as safety precautions.
+ */ 
 static void
 vm_pageout_init_marker(vm_page_t marker, u_short queue)
 {
 
 	bzero(marker, sizeof(*marker));
-	marker->flags = PG_FICTITIOUS | PG_MARKER;
+	marker->flags = PG_MARKER;
 	marker->oflags = VPO_BUSY;
 	marker->queue = queue;
-	marker->wire_count = 1;
+	marker->hold_count = 1;
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  2 23:42:05 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7C7291065675;
	Sat,  2 Jul 2011 23:42:05 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 630398FC0A;
	Sat,  2 Jul 2011 23:42: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 p62Ng5KS060410;
	Sat, 2 Jul 2011 23:42:05 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62Ng5FJ060404;
	Sat, 2 Jul 2011 23:42:05 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201107022342.p62Ng5FJ060404@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 2 Jul 2011 23:42:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223732 - in head/sys: amd64/amd64 i386/i386 i386/xen
	ia64/ia64 mips/mips
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 02 Jul 2011 23:42:05 -0000

Author: alc
Date: Sat Jul  2 23:42:04 2011
New Revision: 223732
URL: http://svn.freebsd.org/changeset/base/223732

Log:
  When iterating over a paging queue, explicitly check for PG_MARKER, instead
  of relying on zeroed memory being interpreted as an empty PV list.
  
  Reviewed by:	kib

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/xen/pmap.c
  head/sys/ia64/ia64/pmap.c
  head/sys/mips/mips/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Sat Jul  2 23:41:11 2011	(r223731)
+++ head/sys/amd64/amd64/pmap.c	Sat Jul  2 23:42:04 2011	(r223732)
@@ -2104,7 +2104,7 @@ pmap_collect(pmap_t locked_pmap, struct 
 	vm_page_t m, free;
 
 	TAILQ_FOREACH(m, &vpq->pl, pageq) {
-		if (m->hold_count || m->busy)
+		if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy)
 			continue;
 		TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) {
 			va = pv->pv_va;

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Sat Jul  2 23:41:11 2011	(r223731)
+++ head/sys/i386/i386/pmap.c	Sat Jul  2 23:42:04 2011	(r223732)
@@ -2188,7 +2188,7 @@ pmap_collect(pmap_t locked_pmap, struct 
 
 	sched_pin();
 	TAILQ_FOREACH(m, &vpq->pl, pageq) {
-		if (m->hold_count || m->busy)
+		if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy)
 			continue;
 		TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) {
 			va = pv->pv_va;

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Sat Jul  2 23:41:11 2011	(r223731)
+++ head/sys/i386/xen/pmap.c	Sat Jul  2 23:42:04 2011	(r223732)
@@ -2012,7 +2012,7 @@ pmap_collect(pmap_t locked_pmap, struct 
 
 	sched_pin();
 	TAILQ_FOREACH(m, &vpq->pl, pageq) {
-		if (m->hold_count || m->busy)
+		if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy)
 			continue;
 		TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) {
 			va = pv->pv_va;

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Sat Jul  2 23:41:11 2011	(r223731)
+++ head/sys/ia64/ia64/pmap.c	Sat Jul  2 23:42:04 2011	(r223732)
@@ -774,7 +774,7 @@ get_pv_entry(pmap_t locked_pmap)
 	vpq = &vm_page_queues[PQ_INACTIVE];
 retry:
 	TAILQ_FOREACH(m, &vpq->pl, pageq) {
-		if (m->hold_count || m->busy)
+		if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy)
 			continue;
 		TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) {
 			va = pv->pv_va;

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Sat Jul  2 23:41:11 2011	(r223731)
+++ head/sys/mips/mips/pmap.c	Sat Jul  2 23:42:04 2011	(r223732)
@@ -1414,7 +1414,7 @@ get_pv_entry(pmap_t locked_pmap)
 	vpq = &vm_page_queues[PQ_INACTIVE];
 retry:
 	TAILQ_FOREACH(m, &vpq->pl, pageq) {
-		if (m->hold_count || m->busy)
+		if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy)
 			continue;
 		TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) {
 			va = pv->pv_va;