From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 12:11:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABA781065674; Mon, 20 Aug 2012 12:11:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 951DB8FC18; Mon, 20 Aug 2012 12:11: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 q7KCB9sa032133; Mon, 20 Aug 2012 12:11:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KCB945032131; Mon, 20 Aug 2012 12:11:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208201211.q7KCB945032131@svn.freebsd.org> From: Alexander Motin Date: Mon, 20 Aug 2012 12:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239416 - stable/8/sys/dev/mps X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 12:11:10 -0000 Author: mav Date: Mon Aug 20 12:11:09 2012 New Revision: 239416 URL: http://svn.freebsd.org/changeset/base/239416 Log: MFC r238969: Fix kernel panic on `camcontrol reset` for specific target, caused by uninitialized cm_targ in mpssas_action_resetdev(). Modified: stable/8/sys/dev/mps/mps_sas.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/mps/mps_sas.c ============================================================================== --- stable/8/sys/dev/mps/mps_sas.c Mon Aug 20 12:09:02 2012 (r239415) +++ stable/8/sys/dev/mps/mps_sas.c Mon Aug 20 12:11:09 2012 (r239416) @@ -3003,6 +3003,7 @@ mpssas_action_resetdev(struct mpssas_sof tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete = mpssas_resetdev_complete; tm->cm_complete_data = ccb; + tm->cm_targ = targ; mps_map_command(sc, tm); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 13:08:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 265E3106564A; Mon, 20 Aug 2012 13:08:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E82C58FC0C; Mon, 20 Aug 2012 13:08: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 q7KD8bgs038149; Mon, 20 Aug 2012 13:08:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KD8bl4038147; Mon, 20 Aug 2012 13:08:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201208201308.q7KD8bl4038147@svn.freebsd.org> From: Glen Barber Date: Mon, 20 Aug 2012 13:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239421 - stable/8/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 13:08:38 -0000 Author: gjb (doc,ports committer) Date: Mon Aug 20 13:08:37 2012 New Revision: 239421 URL: http://svn.freebsd.org/changeset/base/239421 Log: MFC r239216, r239217: r239216: - Remove a leading space that breaks rendering r239217: - Fix source dataset snapshot name in Example 15. - Bump date. Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Aug 20 13:07:22 2012 (r239420) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Aug 20 13:08:37 2012 (r239421) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd August 12, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -2241,7 +2241,7 @@ properties, and current snapshot and fil is received. If the .Fl F flag is specified when this stream is received, snapshots and file systems that - do not exist on the sending side are destroyed. +do not exist on the sending side are destroyed. .It Fl D Generate a deduplicated stream. Blocks which would have been sent multiple times in the send stream will only be sent once. The receiving system must @@ -3021,9 +3021,9 @@ a new snapshot, as follows: .Li # Ic zfs destroy -r pool/users@7daysago .Li # Ic zfs rename -r pool/users@6daysago @7daysago .Li # Ic zfs rename -r pool/users@5daysago @6daysago -.Li # Ic zfs rename -r pool/users@yesterday @5daysago -.Li # Ic zfs rename -r pool/users@yesterday @4daysago -.Li # Ic zfs rename -r pool/users@yesterday @3daysago +.Li # Ic zfs rename -r pool/users@4daysago @5daysago +.Li # Ic zfs rename -r pool/users@3daysago @4daysago +.Li # Ic zfs rename -r pool/users@2daysago @3daysago .Li # Ic zfs rename -r pool/users@yesterday @2daysago .Li # Ic zfs rename -r pool/users@today @yesterday .Li # Ic zfs snapshot -r pool/users@today From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 14:10:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A22E1065670; Mon, 20 Aug 2012 14:10:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6408FC1D; Mon, 20 Aug 2012 14:10: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 q7KEA18K044660; Mon, 20 Aug 2012 14:10:01 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEA1qq044658; Mon, 20 Aug 2012 14:10:01 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201410.q7KEA1qq044658@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239424 - stable/8/lib/libc/string X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 14:10:01 -0000 Author: emaste Date: Mon Aug 20 14:10:00 2012 New Revision: 239424 URL: http://svn.freebsd.org/changeset/base/239424 Log: MFC r238853: Correct BUGS description of static buffer use Since r142667 strerror has unconditionally returned a pointer to a static buffer. Modified: stable/8/lib/libc/string/strerror.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/string/strerror.3 ============================================================================== --- stable/8/lib/libc/string/strerror.3 Mon Aug 20 14:05:19 2012 (r239423) +++ stable/8/lib/libc/string/strerror.3 Mon Aug 20 14:10:00 2012 (r239424) @@ -174,10 +174,10 @@ function was implemented in by .An Wes Peters Aq wes@FreeBSD.org . .Sh BUGS -For unknown error numbers, the +The .Fn strerror -function will return its result in a static buffer which -may be overwritten by subsequent calls. +function returns its result in a static buffer which +will be overwritten by subsequent calls. .Pp The return type for .Fn strerror From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 14:14:20 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8271E106566C; Mon, 20 Aug 2012 14:14:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6A08FC1A; Mon, 20 Aug 2012 14:14: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 q7KEEK45045162; Mon, 20 Aug 2012 14:14:20 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEEKT8045160; Mon, 20 Aug 2012 14:14:20 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201414.q7KEEKT8045160@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239426 - stable/8/sys/dev/usb/quirk X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 14:14:20 -0000 Author: emaste Date: Mon Aug 20 14:14:19 2012 New Revision: 239426 URL: http://svn.freebsd.org/changeset/base/239426 Log: MFC r238718: Quirk MS keyboard so that function keys work The function keys on a Microsoft Natural Egronomic Keyboard 4000 have been repurposed as "Help", "Undo", "Redo" etc., and a special "F Lock" key is required to return them to their normal purpose. This change enables the UQ_KBD_BOOTPROTO quirk for the MS Natural 4000 keyboard to get the keys working again. More extensive changes to the USB keyboard infrastructure would be needed to fully support the "F Lock" mode and the extended keys on this keyboard. PR: usb/116947 Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Aug 20 14:12:24 2012 (r239425) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Aug 20 14:14:19 2012 (r239426) @@ -123,6 +123,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(METAGEEK2, WISPYDBX, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), USB_QUIRK(TENX, UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR), /* MS keyboards do weird things */ + USB_QUIRK(MICROSOFT, NATURAL4000, 0x0000, 0xFFFF, UQ_KBD_BOOTPROTO), USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 16:13:17 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35460106564A; Mon, 20 Aug 2012 16:13:17 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EF438FC14; Mon, 20 Aug 2012 16:13: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 q7KGDGEs059649; Mon, 20 Aug 2012 16:13:16 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGDG0q059647; Mon, 20 Aug 2012 16:13:16 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208201613.q7KGDG0q059647@svn.freebsd.org> From: Jim Harris Date: Mon, 20 Aug 2012 16:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239442 - stable/8/sys/geom/virstor X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 16:13:17 -0000 Author: jimharris Date: Mon Aug 20 16:13:16 2012 New Revision: 239442 URL: http://svn.freebsd.org/changeset/base/239442 Log: MRC r239021: In virstor_ctl_stop(), check for a valid softc before trying to update metadata. Modified: stable/8/sys/geom/virstor/g_virstor.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/virstor/g_virstor.c ============================================================================== --- stable/8/sys/geom/virstor/g_virstor.c Mon Aug 20 16:11:13 2012 (r239441) +++ stable/8/sys/geom/virstor/g_virstor.c Mon Aug 20 16:13:16 2012 (r239442) @@ -231,6 +231,12 @@ virstor_ctl_stop(struct gctl_req *req, s return; } sc = virstor_find_geom(cp, name); + if (sc == NULL) { + gctl_error(req, "Don't know anything about '%s'", name); + g_topology_unlock(); + return; + } + LOG_MSG(LVL_INFO, "Stopping %s by the userland command", sc->geom->name); update_metadata(sc); From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 16:38:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2DAD1065688; Mon, 20 Aug 2012 16:38:58 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCA728FC0C; Mon, 20 Aug 2012 16:38:58 +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 q7KGcwbS062529; Mon, 20 Aug 2012 16:38:58 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGcwhO062527; Mon, 20 Aug 2012 16:38:58 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201208201638.q7KGcwhO062527@svn.freebsd.org> From: Warren Block Date: Mon, 20 Aug 2012 16:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239445 - stable/8/usr.sbin/lpr/lpd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 16:38:59 -0000 Author: wblock (doc committer) Date: Mon Aug 20 16:38:58 2012 New Revision: 239445 URL: http://svn.freebsd.org/changeset/base/239445 Log: MFC r239233: Correct description of minfree to kilobytes rather than blocks. PR: 125921 Submitted by: Andre Albsmeier Modified: stable/8/usr.sbin/lpr/lpd/lpd.8 Directory Properties: stable/8/usr.sbin/lpr/lpd/ (props changed) Modified: stable/8/usr.sbin/lpr/lpd/lpd.8 ============================================================================== --- stable/8/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:37:41 2012 (r239444) +++ stable/8/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:38:58 2012 (r239445) @@ -156,7 +156,7 @@ machine with the printer. .Pp The file .Em minfree -in each spool directory contains the number of disk blocks to leave free +in each spool directory contains the number of kilobytes to leave free so that the line printer queue will not completely fill the disk. The .Em minfree From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 18:16:40 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B42B106564A; Mon, 20 Aug 2012 18:16:40 +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 355AB8FC0A; Mon, 20 Aug 2012 18:16: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 q7KIGeZR073803; Mon, 20 Aug 2012 18:16:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIGeVS073801; Mon, 20 Aug 2012 18:16:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201816.q7KIGeVS073801@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239457 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 18:16:40 -0000 Author: delphij Date: Mon Aug 20 18:16:39 2012 New Revision: 239457 URL: http://svn.freebsd.org/changeset/base/239457 Log: MFC r239084: Add PCI IDs for various new High Point RocketRAID 43xx and 3xxx devices. Obtained from: FreeNAS Modified: stable/8/share/man/man4/hptiop.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/hptiop.4 ============================================================================== --- stable/8/share/man/man4/hptiop.4 Mon Aug 20 18:10:48 2012 (r239456) +++ stable/8/share/man/man4/hptiop.4 Mon Aug 20 18:16:39 2012 (r239457) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2011 +.Dd August 5, 2012 .Dt HPTIOP 4 .Os .Sh NAME @@ -58,34 +58,46 @@ driver supports the following SAS and SA .Pp .Bl -bullet -compact .It -HighPoint RocketRAID 4320 +HighPoint RocketRAID 4322 .It HighPoint RocketRAID 4321 .It -HighPoint RocketRAID 4322 +HighPoint RocketRAID 4320 .It -HighPoint RocketRAID 3220 +HighPoint RocketRAID 4311 .It -HighPoint RocketRAID 3320 +HighPoint RocketRAID 4310 .It -HighPoint RocketRAID 3410 +HighPoint RocketRAID 4211 .It -HighPoint RocketRAID 3520 +HighPoint RocketRAID 4210 .It -HighPoint RocketRAID 3510 +HighPoint RocketRAID 3560 .It -HighPoint RocketRAID 3511 +HighPoint RocketRAID 3540 .It -HighPoint RocketRAID 3521 +HighPoint RocketRAID 3530 .It HighPoint RocketRAID 3522 .It -HighPoint RocketRAID 3540 +HighPoint RocketRAID 3521 .It -HighPoint RocketRAID 3120 +HighPoint RocketRAID 3520 +.It +HighPoint RocketRAID 3511 +.It +HighPoint RocketRAID 3510 +.It +HighPoint RocketRAID 3410 +.It +HighPoint RocketRAID 3320 +.It +HighPoint RocketRAID 3220 .It HighPoint RocketRAID 3122 .It +HighPoint RocketRAID 3120 +.It HighPoint RocketRAID 3020 .El .Sh NOTES From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 18:26:17 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D603810656EA; Mon, 20 Aug 2012 18:26:17 +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 7DF758FC24; Mon, 20 Aug 2012 18:26: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 q7KIQHHa074988; Mon, 20 Aug 2012 18:26:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIQHYR074985; Mon, 20 Aug 2012 18:26:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201826.q7KIQHYR074985@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239459 - in stable: 7/contrib/opie/libopie 8/contrib/opie/libopie 9/contrib/opie/libopie X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 18:26:18 -0000 Author: delphij Date: Mon Aug 20 18:26:16 2012 New Revision: 239459 URL: http://svn.freebsd.org/changeset/base/239459 Log: MFC r239169: RFC 2289 requires all hashes be stored in little endian format before folding to 64 bits, while SHA1 code is big endian. Therefore, a bswap32 is required before using the value. Without this change, the implementation does not conform to test vector found in RFC 2289. PR: bin/170519 Submitted by: Arthur Mesh (with changes) Modified: stable/8/contrib/opie/libopie/hash.c stable/8/contrib/opie/libopie/hashlen.c Directory Properties: stable/8/contrib/opie/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/opie/libopie/hash.c stable/7/contrib/opie/libopie/hashlen.c stable/9/contrib/opie/libopie/hash.c stable/9/contrib/opie/libopie/hashlen.c Directory Properties: stable/7/contrib/opie/ (props changed) stable/9/contrib/opie/ (props changed) Modified: stable/8/contrib/opie/libopie/hash.c ============================================================================== --- stable/8/contrib/opie/libopie/hash.c Mon Aug 20 18:19:06 2012 (r239458) +++ stable/8/contrib/opie/libopie/hash.c Mon Aug 20 18:26:16 2012 (r239459) @@ -17,6 +17,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -39,6 +41,13 @@ unsigned algorithm) SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); }; break; case 4: Modified: stable/8/contrib/opie/libopie/hashlen.c ============================================================================== --- stable/8/contrib/opie/libopie/hashlen.c Mon Aug 20 18:19:06 2012 (r239458) +++ stable/8/contrib/opie/libopie/hashlen.c Mon Aug 20 18:26:16 2012 (r239459) @@ -14,6 +14,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -36,6 +38,13 @@ VOIDPTR in AND struct opie_otpkey *out A SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); break; } case 4: { From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 18:33:24 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22E931065795; Mon, 20 Aug 2012 18:33:24 +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 0BFB58FC15; Mon, 20 Aug 2012 18:33: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 q7KIXN1p075948; Mon, 20 Aug 2012 18:33:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIXNha075947; Mon, 20 Aug 2012 18:33:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201833.q7KIXNha075947@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239463 - in stable: 7/share/man/man5 8/share/man/man5 9/share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 18:33:24 -0000 Author: delphij Date: Mon Aug 20 18:33:23 2012 New Revision: 239463 URL: http://svn.freebsd.org/changeset/base/239463 Log: MFC r238631: Import an updated version of moduli(5) manual page from OpenBSD. Modified: stable/8/share/man/man5/moduli.5 Directory Properties: stable/8/share/man/man5/ (props changed) Changes in other areas also in this revision: Modified: stable/7/share/man/man5/moduli.5 stable/9/share/man/man5/moduli.5 Directory Properties: stable/7/share/man/man5/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/moduli.5 ============================================================================== --- stable/8/share/man/man5/moduli.5 Mon Aug 20 18:33:03 2012 (r239462) +++ stable/8/share/man/man5/moduli.5 Mon Aug 20 18:33:23 2012 (r239463) @@ -1,159 +1,125 @@ -.\" $OpenBSD: moduli.5,v 1.3 2001/06/24 18:50:52 provos Exp $ +.\" $OpenBSD: moduli.5,v 1.16 2011/11/28 08:46:27 eric Exp $ .\" -.\" Copyright 1997, 2000 William Allen Simpson -.\" All rights reserved. +.\" Copyright (c) 2008 Damien Miller .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software designed by William Allen Simpson. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" $FreeBSD$ .\" -.Dd July 28, 1997 +.Dd July 19, 2012 .Dt MODULI 5 .Os .Sh NAME .Nm moduli -.Nd system moduli file +.Nd Diffie-Hellman moduli .Sh DESCRIPTION The -.Nm -file contains the system-wide Diffie-Hellman prime moduli for the -.Xr photurisd 8 -and +.Pa /etc/ssh/moduli +file contains prime numbers and generators for use by .Xr sshd 8 -programs. +in the Diffie-Hellman Group Exchange key exchange method. .Pp -Each line in this file contains the following fields: -.Va Time , Type , Tests , Tries , Size , Generator , -and -.Va Modulus . -The fields are separated by white space (tab or blank). -.Bl -tag -width indent -.It Va Time Pq Vt yyyymmddhhmmss -Specifies the system time that the line was appended to the file. -The value 00000000000000 means unknown (historic). -.\"The file is sorted in ascending order. -.It Va Type Pq Vt decimal -Specifies the internal structure of the prime modulus. +New moduli may be generated with +.Xr ssh-keygen 1 +using a two-step process. +An initial +.Em candidate generation +pass, using +.Ic ssh-keygen -G , +calculates numbers that are likely to be useful. +A second +.Em primality testing +pass, using +.Ic ssh-keygen -T , +provides a high degree of assurance that the numbers are prime and are +safe for use in Diffie-Hellman operations by +.Xr sshd 8 . +This +.Nm +format is used as the output from each pass. .Pp -.Bl -tag -width indent -compact -.It 0 -unknown; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -unstructured; -a common large number. -.It 2 -safe (p = 2q + 1); -meets basic structural requirements. -.It 3 -Schnorr. -.It 4 -Sophie-Germaine (q = (p-1)/2); -usually generated in the process of testing safe or strong primes. -.It 5 -strong; -useful for RSA public key generation. -.El -.It Xo -.Va Tests Pq Vt decimal -(bit field) -.Xc -Specifies the methods used in checking for primality. -Usually, more than one test is used. +The file consists of newline-separated records, one per modulus, +containing seven space-separated fields. +These fields are as follows: +.Bl -tag -width Description -offset indent +.It timestamp +The time that the modulus was last processed as YYYYMMDDHHMMSS. +.It type +Decimal number specifying the internal structure of the prime modulus. +Supported types are: .Pp -.Bl -tag -width indent -compact +.Bl -tag -width 0x00 -compact .It 0 -not tested; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -composite; -failed one or more tests. -In this case, the highest bit specifies the test that failed. +Unknown, not tested. .It 2 -sieve; -checked for division by a range of smaller primes. +"Safe" prime; (p-1)/2 is also prime. .It 4 -Miller-Rabin. -.It 8 -Jacobi. -.It 16 -Elliptic Curve. +Sophie Germain; 2p+1 is also prime. .El -.It Va Tries Pq Vt decimal -Depends on the value of the highest valid Test bit, -where the method specified is: .Pp -.Bl -tag -width indent -compact -.It 0 -not tested -(always zero). -.It 1 -composite -(irrelevant). -.It 2 -sieve; -number of primes sieved. -Commonly on the order of 32,000,000. -.It 4 -Miller-Rabin; -number of M-R iterations. -Commonly on the order of 32 to 64. -.It 8 -Jacobi; -unknown -(always zero). -.It 16 -Elliptic Curve; -unused -(always zero). -.El -.It Va Size Pq Vt decimal -Specifies the number of significant bits. -.It Va Generator Pq Vt "hex string" -Specifies the best generator for a Diffie-Hellman exchange. -0 = unknown or variable, -2, 3, 5, etc. -.It Va Modulus Pq Vt "hex string" -The prime modulus. +Moduli candidates initially produced by +.Xr ssh-keygen 1 +are Sophie Germain primes (type 4). +Further primality testing with +.Xr ssh-keygen 1 +produces safe prime moduli (type 2) that are ready for use in +.Xr sshd 8 . +Other types are not used by OpenSSH. +.It tests +Decimal number indicating the type of primality tests that the number +has been subjected to represented as a bitmask of the following values: +.Pp +.Bl -tag -width 0x00 -compact +.It 0x00 +Not tested. +.It 0x01 +Composite number \(en not prime. +.It 0x02 +Sieve of Eratosthenes. +.It 0x04 +Probabilistic Miller-Rabin primality tests. .El .Pp -The file is searched for moduli that meet the appropriate -.Va Time , Size -and -.Va Generator -criteria. -When more than one meet the criteria, -the selection should be weighted toward newer moduli, -without completely disqualifying older moduli. -.Sh FILES -.Bl -tag -width ".Pa /etc/ssh/moduli" -compact -.It Pa /etc/ssh/moduli +The +.Xr ssh-keygen 1 +moduli candidate generation uses the Sieve of Eratosthenes (flag 0x02). +Subsequent +.Xr ssh-keygen 1 +primality tests are Miller-Rabin tests (flag 0x04). +.It trials +Decimal number indicating the number of primality trials +that have been performed on the modulus. +.It size +Decimal number indicating the size of the prime in bits. +.It generator +The recommended generator for use with this modulus (hexadecimal). +.It modulus +The modulus itself in hexadecimal. .El +.Pp +When performing Diffie-Hellman Group Exchange, +.Xr sshd 8 +first estimates the size of the modulus required to produce enough +Diffie-Hellman output to sufficiently key the selected symmetric cipher. +.Xr sshd 8 +then randomly selects a modulus from +.Fa /etc/ssh/moduli +that best meets the size requirement. .Sh SEE ALSO -.Xr photurisd 8 , +.Xr ssh-keygen 1 , .Xr sshd 8 +.Rs +.%R RFC 4419 +.%T "Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol" +.%D 2006 +.Re From owner-svn-src-stable-8@FreeBSD.ORG Mon Aug 20 19:26:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84C03106564A; Mon, 20 Aug 2012 19:26:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7258FC15; Mon, 20 Aug 2012 19:26: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 q7KJQi51081715; Mon, 20 Aug 2012 19:26:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KJQiMY081712; Mon, 20 Aug 2012 19:26:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201926.q7KJQiMY081712@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 19:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239467 - stable/8/contrib/ntp/ntpd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2012 19:26:44 -0000 Author: emaste Date: Mon Aug 20 19:26:43 2012 New Revision: 239467 URL: http://svn.freebsd.org/changeset/base/239467 Log: MFC r232844: Remove extraneous log message When ntp switched between PLL and FLL mode it produced a log message "kernel time sync status change %04x". This issue is reported in ntp bug 452[1] which claims that this behaviour is normal and the log message isn't necessary. I'm not sure exactly when it was removed, but it's gone in the latest ntp release (4.2.6p5). [1] http://bugs.ntp.org/show_bug.cgi?id=452 Modified: stable/8/contrib/ntp/ntpd/ntp_loopfilter.c Directory Properties: stable/8/contrib/ntp/ (props changed) Modified: stable/8/contrib/ntp/ntpd/ntp_loopfilter.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 19:23:32 2012 (r239466) +++ stable/8/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 19:26:43 2012 (r239467) @@ -646,12 +646,6 @@ local_clock( msyslog(LOG_NOTICE, "kernel time sync error %04x", ntv.status); ntv.status &= ~(STA_PPSFREQ | STA_PPSTIME); - } else { - if ((ntv.status ^ pll_status) & ~STA_FLL) - NLOG(NLOG_SYNCEVENT | NLOG_SYSEVENT) - msyslog(LOG_NOTICE, - "kernel time sync status change %04x", - ntv.status); } pll_status = ntv.status; #ifdef STA_NANO From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 00:05:45 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06A90106564A; Tue, 21 Aug 2012 00:05:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0F3C8FC1A; Tue, 21 Aug 2012 00:05: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 q7L05ix0019041; Tue, 21 Aug 2012 00:05:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L05iF7019029; Tue, 21 Aug 2012 00:05:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208210005.q7L05iF7019029@svn.freebsd.org> From: Ed Maste Date: Tue, 21 Aug 2012 00:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239473 - in stable/8/sys: dev/virtio dev/virtio/balloon dev/virtio/block dev/virtio/network dev/virtio/pci modules modules/virtio X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 00:05:45 -0000 Author: emaste Date: Tue Aug 21 00:05:44 2012 New Revision: 239473 URL: http://svn.freebsd.org/changeset/base/239473 Log: MFC r227652, r228301, r234270, r234349 Sync Bryan Venteicher's virtio base, PCI front-end, and net/block/balloon drivers from HEAD. Added: - copied from r227652, head/sys/dev/virtio/ stable/8/sys/modules/virtio/ - copied from r227652, head/sys/modules/virtio/ Directory Properties: stable/8/sys/dev/virtio/ (props changed) Modified: stable/8/sys/dev/virtio/balloon/virtio_balloon.c stable/8/sys/dev/virtio/balloon/virtio_balloon.h stable/8/sys/dev/virtio/block/virtio_blk.c stable/8/sys/dev/virtio/block/virtio_blk.h stable/8/sys/dev/virtio/network/if_vtnet.c stable/8/sys/dev/virtio/network/if_vtnetvar.h stable/8/sys/dev/virtio/network/virtio_net.h stable/8/sys/dev/virtio/pci/virtio_pci.c stable/8/sys/dev/virtio/pci/virtio_pci.h stable/8/sys/dev/virtio/virtio.h stable/8/sys/dev/virtio/virtio_ring.h stable/8/sys/dev/virtio/virtqueue.c stable/8/sys/dev/virtio/virtqueue.h stable/8/sys/modules/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/balloon/virtio_balloon.c Tue Aug 21 00:05:44 2012 (r239473) @@ -122,6 +122,9 @@ static void vtballoon_add_sysctl(struct */ #define VTBALLOON_PAGES_PER_REQUEST 256 +/* Must be able to fix all pages frames in one page (segment). */ +CTASSERT(VTBALLOON_PAGES_PER_REQUEST * sizeof(uint32_t) <= PAGE_SIZE); + #define VTBALLOON_MTX(_sc) &(_sc)->vtballoon_mtx #define VTBALLOON_LOCK_INIT(_sc, _name) mtx_init(VTBALLOON_MTX((_sc)), _name, \ "VirtIO Balloon Lock", MTX_SPIN) @@ -138,7 +141,7 @@ static device_method_t vtballoon_methods /* VirtIO methods. */ DEVMETHOD(virtio_config_change, vtballoon_config_change), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtballoon_driver = { @@ -402,13 +405,13 @@ vtballoon_send_page_frames(struct vtball error = virtqueue_enqueue(vq, vq, &sg, 1, 0); KASSERT(error == 0, ("error enqueuing page frames to virtqueue")); + virtqueue_notify(vq); /* * Inflate and deflate operations are done synchronously. The * interrupt handler will wake us up. */ VTBALLOON_LOCK(sc); - virtqueue_notify(vq); while ((c = virtqueue_dequeue(vq, NULL)) == NULL) msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); @@ -475,7 +478,6 @@ vtballoon_update_size(struct vtballoon_s virtio_write_dev_config_4(sc->vtballoon_dev, offsetof(struct virtio_balloon_config, actual), htole32(sc->vtballoon_current_npages)); - } static int Modified: stable/8/sys/dev/virtio/balloon/virtio_balloon.h ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/balloon/virtio_balloon.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 IBM 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$ */ Modified: stable/8/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/block/virtio_blk.c Tue Aug 21 00:05:44 2012 (r239473) @@ -70,8 +70,8 @@ struct vtblk_softc { uint32_t vtblk_flags; #define VTBLK_FLAG_INDIRECT 0x0001 #define VTBLK_FLAG_READONLY 0x0002 -#define VTBLK_FLAG_DETACHING 0x0004 -#define VTBLK_FLAG_SUSPENDED 0x0008 +#define VTBLK_FLAG_DETACH 0x0004 +#define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_DUMPING 0x0010 struct virtqueue *vtblk_vq; @@ -82,14 +82,12 @@ struct vtblk_softc { TAILQ_HEAD(, vtblk_request) vtblk_req_free; TAILQ_HEAD(, vtblk_request) - vtblk_req_ready; + vtblk_req_ready; struct taskqueue *vtblk_tq; struct task vtblk_intr_task; - int vtblk_sector_size; int vtblk_max_nsegs; - int vtblk_unit; int vtblk_request_count; struct vtblk_request vtblk_dump_request; @@ -118,6 +116,13 @@ static int vtblk_suspend(device_t); static int vtblk_resume(device_t); static int vtblk_shutdown(device_t); +static int vtblk_open(struct disk *); +static int vtblk_close(struct disk *); +static int vtblk_ioctl(struct disk *, u_long, void *, int, + struct thread *); +static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); +static void vtblk_strategy(struct bio *); + static void vtblk_negotiate_features(struct vtblk_softc *); static int vtblk_maximum_segments(struct vtblk_softc *, struct virtio_blk_config *); @@ -126,13 +131,7 @@ static void vtblk_alloc_disk(struct vtbl struct virtio_blk_config *); static void vtblk_create_disk(struct vtblk_softc *); -static int vtblk_open(struct disk *); -static int vtblk_close(struct disk *); -static int vtblk_ioctl(struct disk *, u_long, void *, int, - struct thread *); -static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); -static void vtblk_strategy(struct bio *); - +static int vtblk_quiesce(struct vtblk_softc *); static void vtblk_startio(struct vtblk_softc *); static struct vtblk_request * vtblk_bio_request(struct vtblk_softc *); static int vtblk_execute_request(struct vtblk_softc *, @@ -150,6 +149,7 @@ static int vtblk_flush_dump(struct vtblk static int vtblk_poll_request(struct vtblk_softc *, struct vtblk_request *); +static void vtblk_finish_completed(struct vtblk_softc *); static void vtblk_drain_vq(struct vtblk_softc *, int); static void vtblk_drain(struct vtblk_softc *); @@ -163,7 +163,8 @@ static struct vtblk_request * vtblk_dequ static void vtblk_enqueue_ready(struct vtblk_softc *, struct vtblk_request *); -static void vtblk_bio_error(struct bio *, int); +static int vtblk_request_error(struct vtblk_request *); +static void vtblk_finish_bio(struct bio *, int); /* Tunables. */ static int vtblk_no_ident = 0; @@ -185,16 +186,14 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ mtx_init(VTBLK_MTX((_sc)), (_name), \ "VTBLK Lock", MTX_DEF) #define VTBLK_LOCK(_sc) mtx_lock(VTBLK_MTX((_sc))) -#define VTBLK_TRYLOCK(_sc) mtx_trylock(VTBLK_MTX((_sc))) #define VTBLK_UNLOCK(_sc) mtx_unlock(VTBLK_MTX((_sc))) #define VTBLK_LOCK_DESTROY(_sc) mtx_destroy(VTBLK_MTX((_sc))) #define VTBLK_LOCK_ASSERT(_sc) mtx_assert(VTBLK_MTX((_sc)), MA_OWNED) #define VTBLK_LOCK_ASSERT_NOTOWNED(_sc) \ mtx_assert(VTBLK_MTX((_sc)), MA_NOTOWNED) -#define VTBLK_BIO_SEGMENTS(_bp) sglist_count((_bp)->bio_data, (_bp)->bio_bcount) - #define VTBLK_DISK_NAME "vtbd" +#define VTBLK_QUIESCE_TIMEOUT (30 * hz) /* * Each block request uses at least two segments - one for the header @@ -213,7 +212,7 @@ static device_method_t vtblk_methods[] = DEVMETHOD(device_resume, vtblk_resume), DEVMETHOD(device_shutdown, vtblk_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtblk_driver = { @@ -281,7 +280,6 @@ vtblk_attach(device_t dev) sc = device_get_softc(dev); sc->vtblk_dev = dev; - sc->vtblk_unit = device_get_unit(dev); VTBLK_LOCK_INIT(sc, device_get_nameunit(dev)); @@ -299,13 +297,8 @@ vtblk_attach(device_t dev) sc->vtblk_flags |= VTBLK_FLAG_READONLY; /* Get local copy of config. */ - if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY) == 0) { - bzero(&blkcfg, sizeof(struct virtio_blk_config)); - virtio_read_device_config(dev, 0, &blkcfg, - offsetof(struct virtio_blk_config, physical_block_exp)); - } else - virtio_read_device_config(dev, 0, &blkcfg, - sizeof(struct virtio_blk_config)); + virtio_read_device_config(dev, 0, &blkcfg, + sizeof(struct virtio_blk_config)); /* * With the current sglist(9) implementation, it is not easy @@ -323,11 +316,13 @@ vtblk_attach(device_t dev) } sc->vtblk_max_nsegs = vtblk_maximum_segments(sc, &blkcfg); + if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { + error = EINVAL; + device_printf(dev, "fewer than minimum number of segments " + "allowed: %d\n", sc->vtblk_max_nsegs); + goto fail; + } - /* - * Allocate working sglist. The number of segments may be too - * large to safely store on the stack. - */ sc->vtblk_sglist = sglist_alloc(sc->vtblk_max_nsegs, M_NOWAIT); if (sc->vtblk_sglist == NULL) { error = ENOMEM; @@ -385,7 +380,7 @@ vtblk_detach(device_t dev) sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags |= VTBLK_FLAG_DETACHING; + sc->vtblk_flags |= VTBLK_FLAG_DETACH; if (device_is_attached(dev)) vtblk_stop(sc); VTBLK_UNLOCK(sc); @@ -417,15 +412,19 @@ static int vtblk_suspend(device_t dev) { struct vtblk_softc *sc; + int error; sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags |= VTBLK_FLAG_SUSPENDED; - /* TODO Wait for any inflight IO to complete? */ + sc->vtblk_flags |= VTBLK_FLAG_SUSPEND; + /* XXX BMV: virtio_stop(), etc needed here? */ + error = vtblk_quiesce(sc); + if (error) + sc->vtblk_flags &= ~VTBLK_FLAG_SUSPEND; VTBLK_UNLOCK(sc); - return (0); + return (error); } static int @@ -436,8 +435,9 @@ vtblk_resume(device_t dev) sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags &= ~VTBLK_FLAG_SUSPENDED; - /* TODO Resume IO? */ + /* XXX BMV: virtio_reinit(), etc needed here? */ + sc->vtblk_flags &= ~VTBLK_FLAG_SUSPEND; + vtblk_startio(sc); VTBLK_UNLOCK(sc); return (0); @@ -458,7 +458,7 @@ vtblk_open(struct disk *dp) if ((sc = dp->d_drv1) == NULL) return (ENXIO); - return (sc->vtblk_flags & VTBLK_FLAG_DETACHING ? ENXIO : 0); + return (sc->vtblk_flags & VTBLK_FLAG_DETACH ? ENXIO : 0); } static int @@ -498,11 +498,7 @@ vtblk_dump(void *arg, void *virtual, vm_ if ((sc = dp->d_drv1) == NULL) return (ENXIO); - if (VTBLK_TRYLOCK(sc) == 0) { - device_printf(sc->vtblk_dev, - "softc already locked, cannot dump...\n"); - return (EBUSY); - } + VTBLK_LOCK(sc); if ((sc->vtblk_flags & VTBLK_FLAG_DUMPING) == 0) { vtblk_prepare_dump(sc); @@ -513,6 +509,10 @@ vtblk_dump(void *arg, void *virtual, vm_ error = vtblk_write_dump(sc, virtual, offset, length); else if (virtual == NULL && offset == 0) error = vtblk_flush_dump(sc); + else { + error = EINVAL; + sc->vtblk_flags &= ~VTBLK_FLAG_DUMPING; + } VTBLK_UNLOCK(sc); @@ -525,7 +525,7 @@ vtblk_strategy(struct bio *bp) struct vtblk_softc *sc; if ((sc = bp->bio_disk->d_drv1) == NULL) { - vtblk_bio_error(bp, EINVAL); + vtblk_finish_bio(bp, EINVAL); return; } @@ -535,29 +535,37 @@ vtblk_strategy(struct bio *bp) */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { - vtblk_bio_error(bp, EROFS); + vtblk_finish_bio(bp, EROFS); return; } +#ifdef INVARIANTS /* * Prevent read/write buffers spanning too many segments from * getting into the queue. This should only trip if d_maxsize * was incorrectly set. */ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - KASSERT(VTBLK_BIO_SEGMENTS(bp) <= sc->vtblk_max_nsegs - - VTBLK_MIN_SEGMENTS, + int nsegs, max_nsegs; + + nsegs = sglist_count(bp->bio_data, bp->bio_bcount); + max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; + + KASSERT(nsegs <= max_nsegs, ("bio spanned too many segments: %d, max: %d", - VTBLK_BIO_SEGMENTS(bp), - sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS)); + nsegs, max_nsegs)); } +#endif VTBLK_LOCK(sc); - if ((sc->vtblk_flags & VTBLK_FLAG_DETACHING) == 0) { + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) + vtblk_finish_bio(bp, ENXIO); + else { bioq_disksort(&sc->vtblk_bioq, bp); - vtblk_startio(sc); - } else - vtblk_bio_error(bp, ENXIO); + + if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) + vtblk_startio(sc); + } VTBLK_UNLOCK(sc); } @@ -622,7 +630,7 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_ioctl = vtblk_ioctl; dp->d_strategy = vtblk_strategy; dp->d_name = VTBLK_DISK_NAME; - dp->d_unit = sc->vtblk_unit; + dp->d_unit = device_get_unit(dev); dp->d_drv1 = sc; if ((sc->vtblk_flags & VTBLK_FLAG_READONLY) == 0) @@ -632,10 +640,9 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_mediasize = blkcfg->capacity * 512; if (virtio_with_feature(dev, VIRTIO_BLK_F_BLK_SIZE)) - sc->vtblk_sector_size = blkcfg->blk_size; + dp->d_sectorsize = blkcfg->blk_size; else - sc->vtblk_sector_size = 512; - dp->d_sectorsize = sc->vtblk_sector_size; + dp->d_sectorsize = 512; /* * The VirtIO maximum I/O size is given in terms of segments. @@ -685,6 +692,26 @@ vtblk_create_disk(struct vtblk_softc *sc disk_create(dp, DISK_VERSION); } +static int +vtblk_quiesce(struct vtblk_softc *sc) +{ + int error; + + error = 0; + + VTBLK_LOCK_ASSERT(sc); + + while (!virtqueue_empty(sc->vtblk_vq)) { + if (mtx_sleep(&sc->vtblk_vq, VTBLK_MTX(sc), PRIBIO, "vtblkq", + VTBLK_QUIESCE_TIMEOUT) == EWOULDBLOCK) { + error = EBUSY; + break; + } + } + + return (error); +} + static void vtblk_startio(struct vtblk_softc *sc) { @@ -697,9 +724,6 @@ vtblk_startio(struct vtblk_softc *sc) VTBLK_LOCK_ASSERT(sc); - if (sc->vtblk_flags & VTBLK_FLAG_SUSPENDED) - return; - while (!virtqueue_full(vq)) { if ((req = vtblk_dequeue_ready(sc)) == NULL) req = vtblk_bio_request(sc); @@ -752,9 +776,8 @@ vtblk_bio_request(struct vtblk_softc *sc req->vbr_hdr.sector = bp->bio_offset / 512; break; default: - KASSERT(0, ("bio with unhandled cmd: %d", bp->bio_cmd)); - req->vbr_hdr.type = -1; - break; + panic("%s: bio with unhandled cmd: %d", __FUNCTION__, + bp->bio_cmd); } if (bp->bio_flags & BIO_ORDERED) @@ -768,7 +791,7 @@ vtblk_execute_request(struct vtblk_softc { struct sglist *sg; struct bio *bp; - int writable, error; + int readable, writable, error; sg = sc->vtblk_sglist; bp = req->vbr_bp; @@ -799,10 +822,9 @@ vtblk_execute_request(struct vtblk_softc KASSERT(sg->sg_nseg >= VTBLK_MIN_SEGMENTS, ("fewer than min segments: %d", sg->sg_nseg)); - error = virtqueue_enqueue(sc->vtblk_vq, req, sg, - sg->sg_nseg - writable, writable); + readable = sg->sg_nseg - writable; - return (error); + return (virtqueue_enqueue(sc->vtblk_vq, req, sg, readable, writable)); } static int @@ -822,37 +844,23 @@ static void vtblk_intr_task(void *arg, int pending) { struct vtblk_softc *sc; - struct vtblk_request *req; struct virtqueue *vq; - struct bio *bp; sc = arg; vq = sc->vtblk_vq; VTBLK_LOCK(sc); - if (sc->vtblk_flags & VTBLK_FLAG_DETACHING) { + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { VTBLK_UNLOCK(sc); return; } - while ((req = virtqueue_dequeue(vq, NULL)) != NULL) { - bp = req->vbr_bp; + vtblk_finish_completed(sc); - if (req->vbr_ack == VIRTIO_BLK_S_OK) - bp->bio_resid = 0; - else { - bp->bio_flags |= BIO_ERROR; - if (req->vbr_ack == VIRTIO_BLK_S_UNSUPP) - bp->bio_error = ENOTSUP; - else - bp->bio_error = EIO; - } - - biodone(bp); - vtblk_enqueue_request(sc, req); - } - - vtblk_startio(sc); + if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) + vtblk_startio(sc); + else + wakeup(&sc->vtblk_vq); if (virtqueue_enable_intr(vq) != 0) { virtqueue_disable_intr(vq); @@ -905,9 +913,10 @@ vtblk_get_ident(struct vtblk_softc *sc) VTBLK_LOCK(sc); error = vtblk_poll_request(sc, req); - vtblk_enqueue_request(sc, req); VTBLK_UNLOCK(sc); + vtblk_enqueue_request(sc, req); + if (error) { device_printf(sc->vtblk_dev, "error getting device identifier: %d\n", error); @@ -1006,17 +1015,35 @@ vtblk_poll_request(struct vtblk_softc *s r = virtqueue_poll(vq, NULL); KASSERT(r == req, ("unexpected request response")); - if (req->vbr_ack != VIRTIO_BLK_S_OK) { - error = req->vbr_ack == VIRTIO_BLK_S_UNSUPP ? ENOTSUP : EIO; - if (bootverbose) - device_printf(dev, - "vtblk_poll_request: IO error: %d\n", error); + error = vtblk_request_error(req); + if (error && bootverbose) { + device_printf(dev, "vtblk_poll_request: IO error: %d\n", + error); } return (error); } static void +vtblk_finish_completed(struct vtblk_softc *sc) +{ + struct vtblk_request *req; + struct bio *bp; + int error; + + while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { + bp = req->vbr_bp; + + error = vtblk_request_error(req); + if (error) + disk_err(bp, "hard error", -1, 1); + + vtblk_finish_bio(bp, error); + vtblk_enqueue_request(sc, req); + } +} + +static void vtblk_drain_vq(struct vtblk_softc *sc, int skip_done) { struct virtqueue *vq; @@ -1028,7 +1055,7 @@ vtblk_drain_vq(struct vtblk_softc *sc, i while ((req = virtqueue_drain(vq, &last)) != NULL) { if (!skip_done) - vtblk_bio_error(req->vbr_bp, ENXIO); + vtblk_finish_bio(req->vbr_bp, ENXIO); vtblk_enqueue_request(sc, req); } @@ -1045,17 +1072,19 @@ vtblk_drain(struct vtblk_softc *sc) bioq = &sc->vtblk_bioq; - if (sc->vtblk_vq != NULL) + if (sc->vtblk_vq != NULL) { + vtblk_finish_completed(sc); vtblk_drain_vq(sc, 0); + } while ((req = vtblk_dequeue_ready(sc)) != NULL) { - vtblk_bio_error(req->vbr_bp, ENXIO); + vtblk_finish_bio(req->vbr_bp, ENXIO); vtblk_enqueue_request(sc, req); } while (bioq_first(bioq) != NULL) { bp = bioq_takefirst(bioq); - vtblk_bio_error(bp, ENXIO); + vtblk_finish_bio(bp, ENXIO); } vtblk_free_requests(sc); @@ -1065,9 +1094,9 @@ static int vtblk_alloc_requests(struct vtblk_softc *sc) { struct vtblk_request *req; - int i, size; + int i, nreqs; - size = virtqueue_size(sc->vtblk_vq); + nreqs = virtqueue_size(sc->vtblk_vq); /* * Preallocate sufficient requests to keep the virtqueue full. Each @@ -1075,9 +1104,9 @@ vtblk_alloc_requests(struct vtblk_softc * the number allocated when indirect descriptors are not available. */ if ((sc->vtblk_flags & VTBLK_FLAG_INDIRECT) == 0) - size /= VTBLK_MIN_SEGMENTS; + nreqs /= VTBLK_MIN_SEGMENTS; - for (i = 0; i < size; i++) { + for (i = 0; i < nreqs; i++) { req = uma_zalloc(vtblk_req_zone, M_NOWAIT); if (req == NULL) return (ENOMEM); @@ -1094,6 +1123,9 @@ vtblk_free_requests(struct vtblk_softc * { struct vtblk_request *req; + KASSERT(TAILQ_EMPTY(&sc->vtblk_req_ready), + ("ready requests left on queue")); + while ((req = vtblk_dequeue_request(sc)) != NULL) { sc->vtblk_request_count--; uma_zfree(vtblk_req_zone, req); @@ -1141,9 +1173,35 @@ vtblk_enqueue_ready(struct vtblk_softc * TAILQ_INSERT_HEAD(&sc->vtblk_req_ready, req, vbr_link); } +static int +vtblk_request_error(struct vtblk_request *req) +{ + int error; + + switch (req->vbr_ack) { + case VIRTIO_BLK_S_OK: + error = 0; + break; + case VIRTIO_BLK_S_UNSUPP: + error = ENOTSUP; + break; + default: + error = EIO; + break; + } + + return (error); +} + static void -vtblk_bio_error(struct bio *bp, int error) +vtblk_finish_bio(struct bio *bp, int error) { - biofinish(bp, NULL, error); + if (error) { + bp->bio_resid = bp->bio_bcount; + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; + } + + biodone(bp); } Modified: stable/8/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/block/virtio_blk.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 IBM 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$ */ @@ -39,16 +62,6 @@ struct virtio_blk_config { /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ uint32_t blk_size; - - /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */ - /* exponent for physical block per logical block. */ - uint8_t physical_block_exp; - /* alignment offset in logical blocks. */ - uint8_t alignment_offset; - /* minimum I/O size without performance penalty in logical blocks. */ - uint16_t min_io_size; - /* optimal sustained I/O size in logical blocks. */ - uint32_t opt_io_size; } __packed; /* Modified: stable/8/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/network/if_vtnet.c Tue Aug 21 00:05:44 2012 (r239473) @@ -223,7 +223,7 @@ static device_method_t vtnet_methods[] = /* VirtIO methods. */ DEVMETHOD(virtio_config_change, vtnet_config_change), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtnet_driver = { @@ -317,8 +317,20 @@ vtnet_attach(device_t dev) if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { sc->vtnet_flags |= VTNET_FLAG_CTRL_VQ; - if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_RX)) + if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_RX)) { + sc->vtnet_mac_filter = malloc( + sizeof(struct vtnet_mac_filter), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (sc->vtnet_mac_filter == NULL) { + device_printf(dev, + "cannot allocate mac filter table\n"); + error = ENOMEM; + goto fail; + } + sc->vtnet_flags |= VTNET_FLAG_CTRL_RX; + } + if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) sc->vtnet_flags |= VTNET_FLAG_VLAN_FILTER; } @@ -505,7 +517,12 @@ vtnet_detach(device_t dev) sc->vtnet_vlan_detach = NULL; } - if (ifp) { + if (sc->vtnet_mac_filter != NULL) { + free(sc->vtnet_mac_filter, M_DEVBUF); + sc->vtnet_mac_filter = NULL; + } + + if (ifp != NULL) { if_free(ifp); sc->vtnet_ifp = NULL; } @@ -742,17 +759,11 @@ vtnet_update_link_status(struct vtnet_so if (link && ((sc->vtnet_flags & VTNET_FLAG_LINK) == 0)) { sc->vtnet_flags |= VTNET_FLAG_LINK; - if (bootverbose) - device_printf(dev, "Link is up\n"); - if_link_state_change(ifp, LINK_STATE_UP); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) vtnet_start_locked(ifp); } else if (!link && (sc->vtnet_flags & VTNET_FLAG_LINK)) { sc->vtnet_flags &= ~VTNET_FLAG_LINK; - if (bootverbose) - device_printf(dev, "Link is down\n"); - if_link_state_change(ifp, LINK_STATE_DOWN); } } @@ -1105,7 +1116,7 @@ vtnet_alloc_rxbuf(struct vtnet_softc *sc KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG, ("chained Rx mbuf requested without LRO_NOMRG")); - for (i = 0; i < nbufs - 1; i++) { + for (i = 1; i < nbufs; i++) { m = m_getjcl(M_DONTWAIT, MT_DATA, 0, clsize); if (m == NULL) goto fail; @@ -1143,9 +1154,8 @@ vtnet_replace_rxbuf(struct vtnet_softc * clsize = sc->vtnet_rx_mbuf_size; nreplace = 0; - if (m->m_next != NULL) - KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG, - ("chained Rx mbuf without LRO_NOMRG")); + KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG || + m->m_next == NULL, ("chained Rx mbuf without LRO_NOMRG")); /* * Since LRO_NOMRG mbuf chains are so large, we want to avoid @@ -1275,8 +1285,8 @@ vtnet_enqueue_rxbuf(struct vtnet_softc * int offset, error; VTNET_LOCK_ASSERT(sc); - if ((sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG) == 0) - KASSERT(m->m_next == NULL, ("chained Rx mbuf")); + KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG || + m->m_next == NULL, ("chained Rx mbuf without LRO_NOMRG")); sglist_init(&sg, VTNET_MAX_RX_SEGS, segs); @@ -1688,7 +1698,8 @@ vtnet_rxeof(struct vtnet_softc *sc, int break; } - virtqueue_notify(vq); + if (deq > 0) + virtqueue_notify(vq); if (rx_npktsp != NULL) *rx_npktsp = rx_npkts; @@ -1946,9 +1957,14 @@ vtnet_encap(struct vtnet_softc *sc, stru struct mbuf *m; int error; + m = *m_head; + txhdr = uma_zalloc(vtnet_tx_header_zone, M_NOWAIT | M_ZERO); - if (txhdr == NULL) + if (txhdr == NULL) { + *m_head = NULL; + m_freem(m); return (ENOMEM); + } /* * Always use the non-mergeable header to simplify things. When @@ -1957,21 +1973,22 @@ vtnet_encap(struct vtnet_softc *sc, stru * the correct header size to the host. */ hdr = &txhdr->vth_uhdr.hdr; - m = *m_head; - - error = ENOBUFS; if (m->m_flags & M_VLANTAG) { m = ether_vlanencap(m, m->m_pkthdr.ether_vtag); - if ((*m_head = m) == NULL) + if ((*m_head = m) == NULL) { + error = ENOBUFS; goto fail; + } m->m_flags &= ~M_VLANTAG; } if (m->m_pkthdr.csum_flags != 0) { m = vtnet_tx_offload(sc, m, hdr); - if ((*m_head = m) == NULL) + if ((*m_head = m) == NULL) { + error = ENOBUFS; goto fail; + } } error = vtnet_enqueue_txbuf(sc, m_head, txhdr); @@ -2387,6 +2404,7 @@ vtnet_rx_filter_mac(struct vtnet_softc * uint8_t ack; ifp = sc->vtnet_ifp; + filter = sc->vtnet_mac_filter; ucnt = 0; mcnt = 0; promisc = 0; @@ -2397,19 +2415,6 @@ vtnet_rx_filter_mac(struct vtnet_softc * KASSERT(sc->vtnet_flags & VTNET_FLAG_CTRL_RX, ("CTRL_RX feature not negotiated")); - /* - * Allocate the MAC filtering table. Note we could do this - * at attach time, but it is probably not worth keeping it - * around for an infrequent occurrence. - */ - filter = malloc(sizeof(struct vtnet_mac_filter), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (filter == NULL) { - device_printf(sc->vtnet_dev, - "cannot allocate MAC address filtering table\n"); - return; - } - /* Unicast MAC addresses: */ if_addr_rlock(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { @@ -2481,8 +2486,6 @@ vtnet_rx_filter_mac(struct vtnet_softc * if_printf(ifp, "error setting host MAC filter table\n"); out: - free(filter, M_DEVBUF); - if (promisc) if (vtnet_set_promisc(sc, 1) != 0) if_printf(ifp, "cannot enable promiscuous mode\n"); Modified: stable/8/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/network/if_vtnetvar.h Tue Aug 21 00:05:44 2012 (r239473) @@ -99,6 +99,7 @@ struct vtnet_softc { #define VTNET_MEDIATYPE (IFM_ETHER | IFM_1000_T | IFM_FDX) char vtnet_hwaddr[ETHER_ADDR_LEN]; + struct vtnet_mac_filter *vtnet_mac_filter; /* * During reset, the host's VLAN filtering table is lost. The * array below is used to restore all the VLANs configured on Modified: stable/8/sys/dev/virtio/network/virtio_net.h ============================================================================== --- head/sys/dev/virtio/network/virtio_net.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/network/virtio_net.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 IBM 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$ */ Modified: stable/8/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/pci/virtio_pci.c Tue Aug 21 00:05:44 2012 (r239473) @@ -189,7 +189,7 @@ static device_method_t vtpci_methods[] = DEVMETHOD(virtio_bus_read_device_config, vtpci_read_dev_config), DEVMETHOD(virtio_bus_write_device_config, vtpci_write_dev_config), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtpci_driver = { Modified: stable/8/sys/dev/virtio/pci/virtio_pci.h ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/pci/virtio_pci.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,4 +1,4 @@ -/* +/*- * Copyright IBM Corp. 2007 * * Authors: @@ -7,6 +7,29 @@ * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 IBM 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$ */ Modified: stable/8/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/virtio.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 02:52:25 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B458B106564A; Tue, 21 Aug 2012 02:52:25 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84F4B8FC17; Tue, 21 Aug 2012 02:52: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 q7L2qP26044413; Tue, 21 Aug 2012 02:52:25 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L2qPhI044411; Tue, 21 Aug 2012 02:52:25 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201208210252.q7L2qPhI044411@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 21 Aug 2012 02:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239475 - stable/8/sys/netinet/khelp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 02:52:25 -0000 Author: lstewart Date: Tue Aug 21 02:52:25 2012 New Revision: 239475 URL: http://svn.freebsd.org/changeset/base/239475 Log: MFC r239346: The TCP PAWS fix for kernels with fast tick rates (r231767) changed the TCP timestamp related stack variables to reference ms directly instead of ticks. The h_ertt(4) Khelp module relies on TCP timestamp information in order to calculate its enhanced RTT estimates, but was not updated as part of r231767. Consequently, h_ertt has not been calculating correct RTT estimates since r231767 was comitted, which in turn broke all delay-based congestion control algorithms because they rely on the h_ertt RTT estimates. Fix the breakage by switching h_ertt to use tcp_ts_getticks() in place of all previous uses of the ticks variable. This ensures all timestamp related variables in h_ertt use the same units as the TCP stack and therefore results in meaningful comparisons and RTT estimate calculations. Reported & tested by: Naeem Khademi (naeemk at ifi uio no) Discussed with: bz Modified: stable/8/sys/netinet/khelp/h_ertt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/khelp/h_ertt.c ============================================================================== --- stable/8/sys/netinet/khelp/h_ertt.c Tue Aug 21 02:17:06 2012 (r239474) +++ stable/8/sys/netinet/khelp/h_ertt.c Tue Aug 21 02:52:25 2012 (r239475) @@ -151,11 +151,13 @@ marked_packet_rtt(struct txseginfo *txsi *prtt_bytes_adjust += *pmeasurenext_len; } else { if (mflag & FORCED_MEASUREMENT) { - e_t->markedpkt_rtt = ticks - *pmeasurenext + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + *pmeasurenext + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt + *pmeasurenext_len - *prtt_bytes_adjust; } else { - e_t->markedpkt_rtt = ticks - txsi->tx_ts + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + txsi->tx_ts + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt - *prtt_bytes_adjust; } @@ -349,7 +351,7 @@ ertt_packet_measurement_hook(int hhook_t */ if (!e_t->dlyack_rx || multiack || new_sacked_bytes) { /* Make an accurate new measurement. */ - e_t->rtt = ticks - txsi->tx_ts + 1; + e_t->rtt = tcp_ts_getticks() - txsi->tx_ts + 1; if (e_t->rtt < e_t->minrtt || e_t->minrtt == 0) e_t->minrtt = e_t->rtt; @@ -477,7 +479,7 @@ ertt_add_tx_segment_info_hook(int hhook_ tp->ts_offset; txsi->rx_ts = ntohl(to->to_tsecr); } else { - txsi->tx_ts = ticks; + txsi->tx_ts = tcp_ts_getticks(); txsi->rx_ts = 0; /* No received time stamp. */ } TAILQ_INSERT_TAIL(&e_t->txsegi_q, txsi, txsegi_lnk); From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 10:30:57 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C04C0106566C; Tue, 21 Aug 2012 10:30:57 +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 A9CDF8FC0C; Tue, 21 Aug 2012 10:30:57 +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 q7LAUvTp017584; Tue, 21 Aug 2012 10:30:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LAUv53017582; Tue, 21 Aug 2012 10:30:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208211030.q7LAUv53017582@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Aug 2012 10:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239490 - stable/8/sys/dev/esp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 10:30:57 -0000 Author: marius Date: Tue Aug 21 10:30:57 2012 New Revision: 239490 URL: http://svn.freebsd.org/changeset/base/239490 Log: MFC: r239089 - Merge from NetBSD: When issuing a non-DMA command, make sure to set the "remaining length of command to be transferred via DMA" (sc_cmdlen) to zero up-front, otherwise we might get confused on command competition interrupt (no DMA active but still data left to transfer). - Implement handling of MSG_IGN_WIDE_RESIDUE which some targets produce, as just rejecting these leads to a resend and disconnect loop. Reported and tested by: mjacob Modified: stable/8/sys/dev/esp/ncr53c9x.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/dev/esp/ncr53c9x.c ============================================================================== --- stable/8/sys/dev/esp/ncr53c9x.c Tue Aug 21 09:55:57 2012 (r239489) +++ stable/8/sys/dev/esp/ncr53c9x.c Tue Aug 21 10:30:57 2012 (r239490) @@ -26,7 +26,7 @@ * */ -/* $NetBSD: ncr53c9x.c,v 1.143 2011/07/31 18:39:00 jakllsch Exp $ */ +/* $NetBSD: ncr53c9x.c,v 1.145 2012/06/18 21:23:56 martin Exp $ */ /*- * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -256,7 +256,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s return (EINVAL); } - device_printf(sc->sc_dev, "%s, %dMHz, SCSI ID %d\n", + device_printf(sc->sc_dev, "%s, %d MHz, SCSI ID %d\n", ncr53c9x_variant_names[sc->sc_rev], sc->sc_freq, sc->sc_id); sc->sc_ntarg = (sc->sc_rev == NCR_VARIANT_FAS366) ? 16 : 8; @@ -890,11 +890,8 @@ ncr53c9x_select(struct ncr53c9x_softc *s sc->sc_cmdp = cmd; error = NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &dmasize); - if (error != 0) { - sc->sc_cmdlen = 0; - sc->sc_cmdp = NULL; + if (error != 0) goto cmd; - } /* Program the SCSI counter. */ NCR_SET_COUNT(sc, dmasize); @@ -920,6 +917,7 @@ cmd: */ /* Now get the command into the FIFO. */ + sc->sc_cmdlen = 0; ncr53c9x_wrfifo(sc, cmd, clen); /* And get the target's attention. */ @@ -1771,7 +1769,7 @@ ncr53c9x_msgin(struct ncr53c9x_softc *sc struct ncr53c9x_linfo *li; struct ncr53c9x_tinfo *ti; uint8_t *pb; - int lun, plen; + int len, lun; NCR_LOCK_ASSERT(sc, MA_OWNED); @@ -1818,15 +1816,15 @@ ncr53c9x_msgin(struct ncr53c9x_softc *sc */ case NCR_RESELECTED: pb = sc->sc_imess + 1; - plen = sc->sc_imlen - 1; + len = sc->sc_imlen - 1; break; default: pb = sc->sc_imess; - plen = sc->sc_imlen; + len = sc->sc_imlen; } - if (__verify_msg_format(pb, plen)) + if (__verify_msg_format(pb, len)) goto gotit; } @@ -1963,6 +1961,29 @@ gotit: sc->sc_dleft = ecb->dleft; break; + case MSG_IGN_WIDE_RESIDUE: + NCR_MSGS(("ignore wide residue (%d bytes)", + sc->sc_imess[1])); + if (sc->sc_imess[1] != 1) { + xpt_print_path(ecb->ccb->ccb_h.path); + printf("unexpected MESSAGE IGNORE WIDE " + "RESIDUE (%d bytes); sending REJECT\n", + sc->sc_imess[1]); + goto reject; + } + /* + * If there was a last transfer of an even number of + * bytes, wipe the "done" memory and adjust by one + * byte (sc->sc_imess[1]). + */ + len = sc->sc_dleft - ecb->dleft; + if (len != 0 && (len & 1) == 0) { + ecb->flags &= ~ECB_TENTATIVE_DONE; + sc->sc_dp = (char *)sc->sc_dp - 1; + sc->sc_dleft--; + } + break; + case MSG_EXTENDED: NCR_MSGS(("extended(%x) ", sc->sc_imess[2])); switch (sc->sc_imess[2]) { @@ -2272,6 +2293,7 @@ cmd: /* * XXX FIFO size */ + sc->sc_cmdlen = 0; ncr53c9x_flushfifo(sc); ncr53c9x_wrfifo(sc, sc->sc_omp, sc->sc_omlen); NCRCMD(sc, NCRCMD_TRANS); @@ -2811,9 +2833,10 @@ again: * (Timing problems?) */ if (sc->sc_features & NCR_F_DMASELECT) { - if (sc->sc_cmdlen == 0) + if (sc->sc_cmdlen == 0) { /* Hope for the best... */ break; + } } else if ((NCR_READ_REG(sc, NCR_FFLAG) & NCRFIFO_FF) == 0) { /* Hope for the best... */ @@ -2986,11 +3009,8 @@ msgin: sc->sc_cmdp = (void *)&ecb->cmd.cmd; error = NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &size); - if (error != 0) { - sc->sc_cmdlen = 0; - sc->sc_cmdp = NULL; + if (error != 0) goto cmd; - } /* Program the SCSI counter. */ NCR_SET_COUNT(sc, size); @@ -3005,6 +3025,7 @@ msgin: break; } cmd: + sc->sc_cmdlen = 0; ncr53c9x_wrfifo(sc, (uint8_t *)&ecb->cmd.cmd, ecb->clen); NCRCMD(sc, NCRCMD_TRANS); sc->sc_prevphase = COMMAND_PHASE; @@ -3046,7 +3067,7 @@ setup_xfer: goto finish; } - /* Target returned to data phase: wipe "done" memory */ + /* Target returned to data phase: wipe "done" memory. */ ecb->flags &= ~ECB_TENTATIVE_DONE; /* Program the SCSI counter. */ @@ -3105,8 +3126,8 @@ shortcut: * overhead to pay. For example, selecting, sending a message * and command and then doing some work can be done in one "pass". * - * The delay is a heuristic. It is 2 when at 20MHz, 2 at 25MHz and 1 - * at 40MHz. This needs testing. + * The delay is a heuristic. It is 2 when at 20 MHz, 2 at 25 MHz and + * 1 at 40 MHz. This needs testing. */ microtime(&wait); wait.tv_usec += 50 / sc->sc_freq; @@ -3191,8 +3212,7 @@ ncr53c9x_callout(void *arg) ncr53c9x_abort(sc, ecb); /* Disable sync mode if stuck in a data phase. */ - if (ecb == sc->sc_nexus && - ti->curr.offset != 0 && + if (ecb == sc->sc_nexus && ti->curr.offset != 0 && (sc->sc_phase & (MSGI | CDI)) == 0) { /* XXX ASYNC CALLBACK! */ ti->goal.offset = 0; From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 11:43:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4AA0106567A; Tue, 21 Aug 2012 11:43:01 +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 B516B8FC16; Tue, 21 Aug 2012 11:43: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 q7LBh1V3028075; Tue, 21 Aug 2012 11:43:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LBh1Tl028073; Tue, 21 Aug 2012 11:43:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208211143.q7LBh1Tl028073@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Aug 2012 11:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239495 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 11:43:02 -0000 Author: mav Date: Tue Aug 21 11:43:01 2012 New Revision: 239495 URL: http://svn.freebsd.org/changeset/base/239495 Log: MFC r238673: Use 16bit PIO instead of 32bit in case of misaligned buffer. It fixes kernel panic during CD write with cdrecord on sparc64. Modified: stable/8/sys/dev/ata/ata-lowlevel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/8/sys/dev/ata/ata-lowlevel.c Tue Aug 21 11:40:31 2012 (r239494) +++ stable/8/sys/dev/ata/ata-lowlevel.c Tue Aug 21 11:43:01 2012 (r239495) @@ -836,23 +836,21 @@ static void ata_pio_read(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_INSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1); - ((uint8_t *)request->data + request->donecount + - (size & ~1))[0] = buf[0]; + (addr + (size & ~1))[0] = buf[0]; } } else - ATA_IDX_INSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_INSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s read data overrun %d>%d\n", @@ -867,23 +865,21 @@ static void ata_pio_write(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_OUTSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { - buf[0] = ((uint8_t *)request->data + request->donecount + - (size & ~1))[0]; + buf[0] = (addr + (size & ~1))[0]; ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1); } } else - ATA_IDX_OUTSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s write data underrun %d>%d\n", From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 21:01:25 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56E521065687; Tue, 21 Aug 2012 21:01:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACFC78FC12; Tue, 21 Aug 2012 21:01: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 q7LL1OFE005240; Tue, 21 Aug 2012 21:01:24 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LL1Oi1005237; Tue, 21 Aug 2012 21:01:24 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212101.q7LL1Oi1005237@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239535 - stable/8/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 21:01:25 -0000 Author: pfg Date: Tue Aug 21 21:01:24 2012 New Revision: 239535 URL: http://svn.freebsd.org/changeset/base/239535 Log: MFC r238509: Use libc's strndup() instead of Dtrace's reimplementation. Corresponds partially to OpenSolaris change: PSARC 2010/299 GNU/Linux/BSD compatibility functions 6901783 strndup would be nice. Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Tue Aug 21 21:00:33 2012 (r239534) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Tue Aug 21 21:01:24 2012 (r239535) @@ -29,23 +29,6 @@ #include #include -#include - -/* - * Create a copy of string s, but only duplicate the first n bytes. - */ -char * -strndup(const char *s, size_t n) -{ - char *s2 = malloc(n + 1); - - if (s2 == NULL) - longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); - - (void) strncpy(s2, s, n); - s2[n] = '\0'; - return (s2); -} /* * Transform string s inline, converting each embedded C escape sequence string Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Tue Aug 21 21:00:33 2012 (r239534) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Tue Aug 21 21:01:24 2012 (r239535) @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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. @@ -20,14 +19,12 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _DT_STRING_H #define _DT_STRING_H -#pragma ident "%Z%%M% %I% %E% SMI" #include #include @@ -36,7 +33,6 @@ extern "C" { #endif -extern char *strndup(const char *, size_t); extern size_t stresc2chr(char *); extern char *strchr2esc(const char *, size_t); extern const char *strbasename(const char *); From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 21:06:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5218D1065763; Tue, 21 Aug 2012 21:06:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B56308FC19; Tue, 21 Aug 2012 21:06: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 q7LL6HBh005962; Tue, 21 Aug 2012 21:06:17 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LL6HwA005958; Tue, 21 Aug 2012 21:06:17 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212106.q7LL6HwA005958@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239537 - in stable/8/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/include cmd/dtrace/test/tst/common/pragma lib/libdtrace/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 21:06:18 -0000 Author: pfg Date: Tue Aug 21 21:06:17 2012 New Revision: 239537 URL: http://svn.freebsd.org/changeset/base/239537 Log: MFC r238558: Dtrace: improve handling of library paths. Merge changes from illumos 906 dtrace depends_on pragma should search all library paths, not just the current one 949 dtrace should only include the first instance of a library found on its library path Obtained from: Illumos Added: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/ - copied from r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh - copied unchanged from r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh (from r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh Tue Aug 21 21:06:17 2012 (r239537, copy of r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh) @@ -0,0 +1,76 @@ +# +# CDDL HEADER START +# +# 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] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2011, Joyent Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Test to catch that we properly look for libraries dependencies in +# our full library parth +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +libdira=${TMPDIR:-/tmp}/libdepa.$$ +libdirb=${TMPDIR:-/tmp}/libdepb.$$ +libdirc=${TMPDIR:-/tmp}/libdepc.$$ +dtrace=$1 + +setup_libs() +{ + mkdir $libdira + mkdir $libdirb + mkdir $libdirc + cat > $libdira/liba.$$.d < $libdirb/libb.$$.d < $libdirb/libc.$$.d < $libdirb/libd.$$.d < $libdirc/libe.$$.d < $libdirc/libf.$$.d <dt_lib_dep); dld != NULL; + dld = dt_list_next(dld)) { + end = strrchr(dld->dtld_library, '/'); + /* dt_lib_depend_add ensures this */ + assert(end != NULL); + if (strcmp(end + 1, dp->d_name) == 0) + break; + } + + if (dld != NULL) { + dt_dprintf("skipping library %s, already processed " + "library with the same name: %s", dp->d_name, + dld->dtld_library); + continue; + } + dtp->dt_filetag = fname; if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) - goto err; + return (-1); /* preserve dt_errno */ rv = dt_compile(dtp, DT_CTX_DPROG, DTRACE_PROBESPEC_NAME, NULL, @@ -2203,7 +2221,7 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons if (rv != NULL && dtp->dt_errno && (dtp->dt_errno != EDT_COMPILER || dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) - goto err; + return (-1); /* preserve dt_errno */ if (dtp->dt_errno) dt_dprintf("error parsing library %s: %s\n", @@ -2214,6 +2232,27 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons } (void) closedir(dirp); + + return (0); +} + +/* + * Perform a topological sorting of all the libraries found across the entire + * dt_lib_path. Once sorted, compile each one in topological order to cache its + * inlines and translators, etc. We silently ignore any missing directories and + * other files found therein. We only fail (and thereby fail dt_load_libs()) if + * we fail to compile a library and the error is something other than #pragma D + * depends_on. Dependency errors are silently ignored to permit a library + * directory to contain libraries which may not be accessible depending on our + * privileges. + */ +static int +dt_load_libs_sort(dtrace_hdl_t *dtp) +{ + dtrace_prog_t *pgp; + FILE *fp; + dt_lib_depend_t *dld; + /* * Finish building the graph containing the library dependencies * and perform a topological sort to generate an ordered list @@ -2274,7 +2313,14 @@ dt_load_libs(dtrace_hdl_t *dtp) dtp->dt_cflags |= DTRACE_C_NOLIBS; - for (dirp = dt_list_next(&dtp->dt_lib_path); + /* + * /usr/lib/dtrace is always at the head of the list. The rest of the + * list is specified in the precedence order the user requested. Process + * everything other than the head first. DTRACE_C_NOLIBS has already + * been spcified so dt_vopen will ensure that there is always one entry + * in dt_lib_path. + */ + for (dirp = dt_list_next(dt_list_next(&dtp->dt_lib_path)); dirp != NULL; dirp = dt_list_next(dirp)) { if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) { dtp->dt_cflags &= ~DTRACE_C_NOLIBS; @@ -2282,6 +2328,16 @@ dt_load_libs(dtrace_hdl_t *dtp) } } + /* Handle /usr/lib/dtrace */ + dirp = dt_list_next(&dtp->dt_lib_path); + if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) { + dtp->dt_cflags &= ~DTRACE_C_NOLIBS; + return (-1); /* errno is set for us */ + } + + if (dt_load_libs_sort(dtp) < 0) + return (-1); /* errno is set for us */ + return (0); } Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Aug 21 21:06:07 2012 (r239536) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Aug 21 21:06:17 2012 (r239537) @@ -21,7 +21,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2011, Joyent Inc. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -31,9 +31,13 @@ #if defined(sun) #include #endif +#include #include #include +#include +#include + #include #include #include @@ -201,6 +205,29 @@ dt_pragma_binding(const char *prname, dt dtp->dt_globals->dh_defer = &dt_pragma_apply; } +static void +dt_pragma_depends_finddep(dtrace_hdl_t *dtp, const char *lname, char *lib, + size_t len) +{ + dt_dirpath_t *dirp; + struct stat sbuf; + int found = 0; + + for (dirp = dt_list_next(&dtp->dt_lib_path); dirp != NULL; + dirp = dt_list_next(dirp)) { + (void) snprintf(lib, len, "%s/%s", dirp->dir_path, lname); + + if (stat(lib, &sbuf) == 0) { + found = 1; + break; + } + } + + if (!found) + xyerror(D_PRAGMA_DEPEND, + "failed to find dependency in libpath: %s", lname); +} + /* * The #pragma depends_on directive can be used to express a dependency on a * module, provider or library which if not present will cause processing to @@ -230,16 +257,13 @@ dt_pragma_depends(const char *prname, dt if (yypcb->pcb_cflags & DTRACE_C_CTL) { assert(dtp->dt_filetag != NULL); - /* - * We have the file we are working on in dtp->dt_filetag - * so find that node and add the dependency in. - */ + dt_pragma_depends_finddep(dtp, nnp->dn_string, lib, + sizeof (lib)); + dld = dt_lib_depend_lookup(&dtp->dt_lib_dep, dtp->dt_filetag); assert(dld != NULL); - (void) snprintf(lib, sizeof (lib), "%s%s", - dld->dtld_libpath, nnp->dn_string); if ((dt_lib_depend_add(dtp, &dld->dtld_dependencies, lib)) != 0) { xyerror(D_PRAGMA_DEPEND, @@ -261,8 +285,8 @@ dt_pragma_depends(const char *prname, dt dtp->dt_filetag); assert(dld != NULL); - (void) snprintf(lib, sizeof (lib), "%s%s", - dld->dtld_libpath, nnp->dn_string); + dt_pragma_depends_finddep(dtp, nnp->dn_string, lib, + sizeof (lib)); dld = dt_lib_depend_lookup(&dtp->dt_lib_dep_sorted, lib); assert(dld != NULL); From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 21:11:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B18BA1065689; Tue, 21 Aug 2012 21:11:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A7B38FC1C; Tue, 21 Aug 2012 21:11: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 q7LLBxH9007144; Tue, 21 Aug 2012 21:11:59 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLBxx4007141; Tue, 21 Aug 2012 21:11:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212111.q7LLBxx4007141@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239539 - in stable/8/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/sizeof lib/libdtrace/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 21:11:59 -0000 Author: pfg Date: Tue Aug 21 21:11:59 2012 New Revision: 239539 URL: http://svn.freebsd.org/changeset/base/239539 Log: MFC 238457: 1458 D compiler fails to generate error on sizeof() an undefined struct Reference: https://www.illumos.org/issues/1458 Obtained from: Illumos Added: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d - copied unchanged from r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d (from r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Tue Aug 21 21:11:59 2012 (r239539, copy of r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * 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] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent Inc. All rights reserved. + */ + +BEGIN +{ + trace(sizeof (struct suckitlarry)); + exit(0); +} Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 21 21:11:35 2012 (r239538) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 21 21:11:59 2012 (r239539) @@ -22,7 +22,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2011, Joyent Inc. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -725,12 +725,19 @@ dt_node_type_name(const dt_node_t *dnp, size_t dt_node_type_size(const dt_node_t *dnp) { + ctf_id_t base; + if (dnp->dn_kind == DT_NODE_STRING) return (strlen(dnp->dn_string) + 1); if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL) return (dt_ident_size(dnp->dn_ident)); + base = ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type); + + if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD) + return (0); + return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type)); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 21:21:52 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 673B01065672; Tue, 21 Aug 2012 21:21:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50A588FC12; Tue, 21 Aug 2012 21: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 q7LLLqK7008602; Tue, 21 Aug 2012 21:21:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLLq5Y008598; Tue, 21 Aug 2012 21:21:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212121.q7LLLq5Y008598@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239541 - stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 21:21:52 -0000 Author: pfg Date: Tue Aug 21 21:21:51 2012 New Revision: 239541 URL: http://svn.freebsd.org/changeset/base/239541 Log: MFC 237817: Bump dtrace_helper_actions_max from 32 to 128 Dave Pacheco from Joyent (and Dtrace.org) bumped the cap to 1024 but, according to his blog, 128 is the recommended minimum. For now bump it safely to 128 although we may have to bump it further if there is demand in the future. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 21 21:21:29 2012 (r239540) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 21 21:21:51 2012 (r239541) @@ -157,7 +157,7 @@ dtrace_optval_t dtrace_dof_maxsize = (25 size_t dtrace_global_maxsize = (16 * 1024); size_t dtrace_actions_max = (16 * 1024); size_t dtrace_retain_max = 1024; -dtrace_optval_t dtrace_helper_actions_max = 32; +dtrace_optval_t dtrace_helper_actions_max = 128; dtrace_optval_t dtrace_helper_providers_max = 32; dtrace_optval_t dtrace_dstate_defsize = (1 * 1024 * 1024); size_t dtrace_strsize_default = 256; From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 21:46:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB491065674; Tue, 21 Aug 2012 21:46:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89D978FC23; Tue, 21 Aug 2012 21:46: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 q7LLkiuB012031; Tue, 21 Aug 2012 21:46:44 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLkiBl012029; Tue, 21 Aug 2012 21:46:44 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212146.q7LLkiBl012029@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239543 - stable/8/bin/sh X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 21:46:44 -0000 Author: pfg Date: Tue Aug 21 21:46:44 2012 New Revision: 239543 URL: http://svn.freebsd.org/changeset/base/239543 Log: MFC r238377: Merge libedit adjustment from NetBSD. On recent versions of NetBSD's libedit, el_gets now sets el_len to -1 on error so we can distinguish between a NULL string and an error. This fixes sh from exiting with newer versions of libedit now allowing EINTR to return. Obtained from: NetBSD Reviewed by: jilles Modified: stable/8/bin/sh/input.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/input.c ============================================================================== --- stable/8/bin/sh/input.c Tue Aug 21 21:46:01 2012 (r239542) +++ stable/8/bin/sh/input.c Tue Aug 21 21:46:44 2012 (r239543) @@ -190,7 +190,7 @@ retry: if (rl_cp == NULL) rl_cp = el_gets(el, &el_len); if (rl_cp == NULL) - nr = 0; + nr = el_len == 0 ? 0 : -1; else { nr = el_len; if (nr > BUFSIZ - 1) From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 22 05:23:57 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B967106566C; Wed, 22 Aug 2012 05:23:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 258AC8FC22; Wed, 22 Aug 2012 05:23:57 +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 q7M5NvRD072200; Wed, 22 Aug 2012 05:23:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5NuAE072198; Wed, 22 Aug 2012 05:23:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220523.q7M5NuAE072198@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239556 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 05:23:57 -0000 Author: kib Date: Wed Aug 22 05:23:56 2012 New Revision: 239556 URL: http://svn.freebsd.org/changeset/base/239556 Log: MFC r239135: Always initialize pl_event. Modified: stable/8/sys/kern/sys_process.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Wed Aug 22 05:18:38 2012 (r239555) +++ stable/8/sys/kern/sys_process.c Wed Aug 22 05:23:56 2012 (r239556) @@ -1156,6 +1156,7 @@ kern_ptrace(struct thread *td, int req, #endif pl = addr; pl->pl_lwpid = td2->td_tid; + pl->pl_event = PL_EVENT_NONE; pl->pl_flags = 0; if (td2->td_dbgflags & TDB_XSIG) { pl->pl_event = PL_EVENT_SIGNAL; From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 22 05:28:56 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C9611065677; Wed, 22 Aug 2012 05:28:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16F298FC12; Wed, 22 Aug 2012 05:28: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 q7M5StW6072915; Wed, 22 Aug 2012 05:28:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5StrY072913; Wed, 22 Aug 2012 05:28:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220528.q7M5StrY072913@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239558 - stable/8/sys/dev/md X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 05:28:56 -0000 Author: kib Date: Wed Aug 22 05:28:55 2012 New Revision: 239558 URL: http://svn.freebsd.org/changeset/base/239558 Log: MFC r239038: Remove verbose unused commented out debugging printf. Modified: stable/8/sys/dev/md/md.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Wed Aug 22 05:26:54 2012 (r239557) +++ stable/8/sys/dev/md/md.c Wed Aug 22 05:28:55 2012 (r239558) @@ -680,12 +680,6 @@ mdstart_swap(struct md_s *sc, struct bio /* Actions on further pages start at offset 0 */ p += PAGE_SIZE - offs; offs = 0; -#if 0 -if (bootverbose || bp->bio_offset / PAGE_SIZE < 17) -printf("wire_count %d busy %d flags %x hold_count %d act_count %d queue %d valid %d dirty %d @ %d\n", - m->wire_count, m->busy, - m->flags, m->hold_count, m->act_count, m->queue, m->valid, m->dirty, i); -#endif } vm_object_pip_subtract(sc->object, 1); vm_object_set_writeable_dirty(sc->object); From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 22 05:38:07 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67F19106564A; Wed, 22 Aug 2012 05:38:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 518368FC0C; Wed, 22 Aug 2012 05:38: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 q7M5c7JI074253; Wed, 22 Aug 2012 05:38:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5c74i074251; Wed, 22 Aug 2012 05:38:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220538.q7M5c74i074251@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239561 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 05:38:07 -0000 Author: kib Date: Wed Aug 22 05:38:06 2012 New Revision: 239561 URL: http://svn.freebsd.org/changeset/base/239561 Log: MFC r239125: Do not apply errata 721 workaround when under hypervisor, since typical hypervisor does not implement access to the required MSR, causing #GP on boot. Modified: stable/8/sys/amd64/amd64/initcpu.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/8/sys/amd64/amd64/initcpu.c Wed Aug 22 05:36:10 2012 (r239560) +++ stable/8/sys/amd64/amd64/initcpu.c Wed Aug 22 05:38:06 2012 (r239561) @@ -91,11 +91,17 @@ init_amd(void) * * http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf * http://support.amd.com/us/Processor_TechDocs/44739_12h_Rev_Gd.pdf + * + * Hypervisors do not provide access to the errata MSR, + * causing #GP exception on attempt to apply the errata. The + * MSR write shall be done on host and persist globally + * anyway, so do not try to do it when under virtualization. */ switch (CPUID_TO_FAMILY(cpu_id)) { case 0x10: case 0x12: - wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); + if ((cpu_feature2 & CPUID2_HV) == 0) + wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } } From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 22 08:27:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C73D4106564A; Wed, 22 Aug 2012 08:27:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7FC48FC14; Wed, 22 Aug 2012 08:27: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 q7M8Rb5a096137; Wed, 22 Aug 2012 08:27:37 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M8RbPm096132; Wed, 22 Aug 2012 08:27:37 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201208220827.q7M8RbPm096132@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 22 Aug 2012 08:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239563 - in stable/8/usr.sbin: . pkg X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 08:27:37 -0000 Author: bapt Date: Wed Aug 22 08:27:37 2012 New Revision: 239563 URL: http://svn.freebsd.org/changeset/base/239563 Log: MFC: r234313,234315,234322,234351,234870,235726,238461 add usr.sbin/pkg which is a bootstrap tool for pkgng. it respects PACKAGESITE, PACKAGEROOT, and a new environment variable ABI (if a user want to use a different API from the base one for its packages) it has no man page on purpose to avoid hidding the pkg(8) man page from the pkgng package. for now uses pkgbeta.FreeBSD.org as default mirror to find its package it respects MK_PKGTOOLS Added: - copied from r234313, head/usr.sbin/pkg/ Directory Properties: stable/8/usr.sbin/pkg/ (props changed) Modified: stable/8/usr.sbin/Makefile (contents, props changed) stable/8/usr.sbin/pkg/Makefile stable/8/usr.sbin/pkg/pkg.c Directory Properties: stable/8/usr.sbin/ (props changed) Modified: stable/8/usr.sbin/Makefile ============================================================================== --- stable/8/usr.sbin/Makefile Wed Aug 22 06:37:30 2012 (r239562) +++ stable/8/usr.sbin/Makefile Wed Aug 22 08:27:37 2012 (r239563) @@ -364,6 +364,7 @@ _ftp-proxy= ftp-proxy .if ${MK_PKGTOOLS} != "no" _pkg_install= pkg_install +SUBDIR+= pkg .endif # XXX MK_TOOLCHAIN? Modified: stable/8/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Sun Apr 15 15:13:36 2012 (r234313) +++ stable/8/usr.sbin/pkg/Makefile Wed Aug 22 08:27:37 2012 (r239563) @@ -4,6 +4,7 @@ PROG= pkg SRC= pkg.c NO_MAN= yes +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} LDADD= -larchive -lelf -lfetch .include Modified: stable/8/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sun Apr 15 15:13:36 2012 (r234313) +++ stable/8/usr.sbin/pkg/pkg.c Wed Aug 22 08:27:37 2012 (r239563) @@ -27,11 +27,10 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include #include #include +#include #include #include @@ -39,24 +38,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include #include #include -#include #include "elf_tables.h" #define _LOCALBASE "/usr/local" #define _PKGS_URL "http://pkgbeta.FreeBSD.org" -#define _DEFAULT_TMP "/tmp" static const char * -elf_corres_to_string(struct _elf_corres* m, int e) +elf_corres_to_string(struct _elf_corres *m, int e) { - int i = 0; + int i; for (i = 0; m[i].string != NULL; i++) if (m[i].elf_nb == e) @@ -69,29 +68,30 @@ static int pkg_get_myabi(char *dest, size_t sz) { Elf *elf; - GElf_Ehdr elfhdr; - GElf_Shdr shdr; Elf_Data *data; Elf_Note note; Elf_Scn *scn; char *src, *osname; const char *abi; + GElf_Ehdr elfhdr; + GElf_Shdr shdr; int fd, i, ret; uint32_t version; version = 0; - ret = 0; + ret = -1; scn = NULL; abi = NULL; if (elf_version(EV_CURRENT) == EV_NONE) { - warnx("ELF library initialization failed: %s", elf_errmsg(-1)); - return -1; + warnx("ELF library initialization failed: %s", + elf_errmsg(-1)); + return (-1); } if ((fd = open("/bin/sh", O_RDONLY)) < 0) { warn("open()"); - return -1; + return (-1); } if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { @@ -119,13 +119,13 @@ pkg_get_myabi(char *dest, size_t sz) if (scn == NULL) { ret = -1; - warn("fail to get the note section"); + warn("failed to get the note section"); goto cleanup; } data = elf_getdata(scn, NULL); src = data->d_buf; - while (1) { + for (;;) { memcpy(¬e, src, sizeof(Elf_Note)); src += sizeof(Elf_Note); if (note.n_type == NT_VERSION) @@ -143,52 +143,50 @@ pkg_get_myabi(char *dest, size_t sz) osname[i] = (char)tolower(osname[i]); snprintf(dest, sz, "%s:%d:%s:%s", - osname, - version / 100000, - elf_corres_to_string(mach_corres, (int) elfhdr.e_machine), + osname, version / 100000, + elf_corres_to_string(mach_corres, (int)elfhdr.e_machine), elf_corres_to_string(wordsize_corres, - (int)elfhdr.e_ident[EI_CLASS])); + (int)elfhdr.e_ident[EI_CLASS])); + + ret = 0; switch (elfhdr.e_machine) { - case EM_ARM: - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s:%s", - elf_corres_to_string(endian_corres, - (int) elfhdr.e_ident[EI_DATA]), - (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? - "eabi" : "oabi", - (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? - "softfp" : "vfp"); + case EM_ARM: + snprintf(dest + strlen(dest), sz - strlen(dest), + ":%s:%s:%s", elf_corres_to_string(endian_corres, + (int)elfhdr.e_ident[EI_DATA]), + (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? + "eabi" : "oabi", + (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? + "softfp" : "vfp"); + break; + case EM_MIPS: + /* + * this is taken from binutils sources: + * include/elf/mips.h + * mapping is figured out from binutils: + * gas/config/tc-mips.c + */ + switch (elfhdr.e_flags & EF_MIPS_ABI) { + case E_MIPS_ABI_O32: + abi = "o32"; break; - case EM_MIPS: - /* - * this is taken from binutils sources: - * include/elf/mips.h - * mapping is figured out from binutils: - * gas/config/tc-mips.c - */ - switch (elfhdr.e_flags & EF_MIPS_ABI) { - case E_MIPS_ABI_O32: - abi = "o32"; - break; - case E_MIPS_ABI_N32: - abi = "n32"; - break; - default: - if (elfhdr.e_ident[EI_DATA] == - ELFCLASS32) - abi = "o32"; - else if (elfhdr.e_ident[EI_DATA] == - ELFCLASS64) - abi = "n64"; - break; - } - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s", - elf_corres_to_string(endian_corres, - (int) elfhdr.e_ident[EI_DATA]), - abi); + case E_MIPS_ABI_N32: + abi = "n32"; + break; + default: + if (elfhdr.e_ident[EI_DATA] == + ELFCLASS32) + abi = "o32"; + else if (elfhdr.e_ident[EI_DATA] == + ELFCLASS64) + abi = "n64"; break; + } + snprintf(dest + strlen(dest), sz - strlen(dest), + ":%s:%s", elf_corres_to_string(endian_corres, + (int)elfhdr.e_ident[EI_DATA]), abi); + break; } cleanup: @@ -207,17 +205,22 @@ extract_pkg_static(int fd, char *p, int char *end; int ret, r; - ret = 0; + ret = -1; a = archive_read_new(); + if (a == NULL) { + warn("archive_read_new"); + return (ret); + } archive_read_support_compression_all(a); archive_read_support_format_tar(a); - lseek(fd, 0, 0); + if (lseek(fd, 0, 0) == -1) { + warn("lseek"); + goto cleanup; + } if (archive_read_open_fd(a, fd, 4096) != ARCHIVE_OK) { - warnx("archive_read_open_fd: %s", - archive_error_string(a)); - ret = -1; + warnx("archive_read_open_fd: %s", archive_error_string(a)); goto cleanup; } @@ -229,22 +232,22 @@ extract_pkg_static(int fd, char *p, int if (strcmp(end, "/pkg-static") == 0) { r = archive_read_extract(a, ae, - ARCHIVE_EXTRACT_OWNER |ARCHIVE_EXTRACT_PERM| - ARCHIVE_EXTRACT_TIME |ARCHIVE_EXTRACT_ACL | - ARCHIVE_EXTRACT_FFLAGS|ARCHIVE_EXTRACT_XATTR); - snprintf(p, sz, archive_entry_pathname(ae)); + ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM | + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_ACL | + ARCHIVE_EXTRACT_FFLAGS | ARCHIVE_EXTRACT_XATTR); + strlcpy(p, archive_entry_pathname(ae), sz); break; } } - if (r != ARCHIVE_OK) { + if (r == ARCHIVE_OK) + ret = 0; + else warnx("fail to extract pkg-static"); - ret = -1; - } cleanup: archive_read_finish(a); - return ret; + return (ret); } @@ -255,129 +258,185 @@ install_pkg_static(char *path, char *pkg pid_t pid; switch ((pid = fork())) { - case -1: - return (-1); - case 0: - execl(path, "pkg-static", "add", pkgpath, (char *)NULL); - _exit(1); /* NOT REACHED */ - default: - break; + case -1: + return (-1); + case 0: + execl(path, "pkg-static", "add", pkgpath, (char *)NULL); + _exit(1); + default: + break; } - while (waitpid(pid, &pstat, 0) == -1) { + while (waitpid(pid, &pstat, 0) == -1) if (errno != EINTR) return (-1); - } - return (WEXITSTATUS(pstat)); + if (WEXITSTATUS(pstat)) + return (WEXITSTATUS(pstat)); + else if (WIFSIGNALED(pstat)) + return (128 & (WTERMSIG(pstat))); + return (pstat); } static int bootstrap_pkg(void) { - struct url_stat st; FILE *remote; - time_t begin_dl; - time_t now; - time_t last = 0; + FILE *config; + char *site; char url[MAXPATHLEN]; + char conf[MAXPATHLEN]; char abi[BUFSIZ]; char tmppkg[MAXPATHLEN]; char buf[10240]; char pkgstatic[MAXPATHLEN]; int fd, retry, ret; + struct url_stat st; off_t done, r; + time_t now; + time_t last; done = 0; - ret = 0; - retry = 3; + last = 0; + ret = -1; remote = NULL; + config = NULL; - printf("Bootstraping pkg please wait\n"); + printf("Bootstrapping pkg please wait\n"); if (pkg_get_myabi(abi, MAXPATHLEN) != 0) { - warnx("fail to determine my abi"); - return -1; + warnx("failed to determine the system ABI"); + return (-1); } - if (getenv("PACKAGESITE") != NULL) { - snprintf(url, MAXPATHLEN, "%s/pkg.txz", - getenv("PACKAGESITE")); - } else { + if (getenv("PACKAGESITE") != NULL) + snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", getenv("PACKAGESITE")); + else snprintf(url, MAXPATHLEN, "%s/%s/latest/Latest/pkg.txz", getenv("PACKAGEROOT") ? getenv("PACKAGEROOT") : _PKGS_URL, getenv("ABI") ? getenv("ABI") : abi); - } snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : "/tmp"); + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); if ((fd = mkstemp(tmppkg)) == -1) { warn("mkstemp()"); - return -1; + return (-1); } - while (remote == NULL) { + retry = 3; + do { remote = fetchXGetURL(url, &st, ""); - if (remote == NULL) { - --retry; - if (retry == 0) { - warnx("Error fetching %s: %s", url, - fetchLastErrString); - ret = 1; - goto cleanup; - } + if (remote == NULL) sleep(1); - } - } + } while (remote == NULL && retry-- > 0); + + if (remote == NULL) + goto fetchfail; - begin_dl = time(NULL); while (done < st.size) { if ((r = fread(buf, 1, sizeof(buf), remote)) < 1) break; if (write(fd, buf, r) != r) { warn("write()"); - ret = -1; goto cleanup; } done += r; now = time(NULL); - if (now > last || done == st.size) { + if (now > last || done == st.size) last = now; - } } - if (ferror(remote)) { - warnx("Error fetching %s: %s", url, - fetchLastErrString); - ret = 1; - goto cleanup; - } + if (ferror(remote)) + goto fetchfail; if ((ret = extract_pkg_static(fd, pkgstatic, MAXPATHLEN)) == 0) ret = install_pkg_static(pkgstatic, tmppkg); + snprintf(conf, MAXPATHLEN, "%s/etc/pkg.conf", + getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); + + if (access(conf, R_OK) == -1) { + site = strrchr(url, '/'); + if (site == NULL) + goto cleanup; + site[0] = '\0'; + site = strrchr(url, '/'); + if (site == NULL) + goto cleanup; + site[0] = '\0'; + + config = fopen(conf, "w+"); + if (config == NULL) + goto cleanup; + fprintf(config, "packagesite: %s\n", url); + fclose(config); + } + + goto cleanup; + +fetchfail: + warnx("Error fetching %s: %s", url, fetchLastErrString); + cleanup: + if (remote != NULL) + fclose(remote); close(fd); unlink(tmppkg); - return 0; + return (ret); +} + +static const char confirmation_message[] = +"The package management tool is not yet installed on your system.\n" +"Do you want to fetch and install it now? [y/N]: "; + +static int +pkg_query_yes_no(void) +{ + int ret, c; + + c = getchar(); + + if (c == 'y' || c == 'Y') + ret = 1; + else + ret = 0; + + while (c != '\n' && c != EOF) + c = getchar(); + + return (ret); } int -main(__unused int argc, char * argv[]) +main(__unused int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", - getenv("LOCALBASE") ? getenv("LOCALBASE"): _LOCALBASE); + getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); - if (access(pkgpath, X_OK) == -1) - bootstrap_pkg(); + if (access(pkgpath, X_OK) == -1) { + /* + * Do not ask for confirmation if either of stdin or stdout is + * not tty. Check the environment to see if user has answer + * tucked in there already. + */ + if (getenv("ALWAYS_ASSUME_YES") == NULL && + isatty(fileno(stdin))) { + printf("%s", confirmation_message); + if (pkg_query_yes_no() == 0) + exit(EXIT_FAILURE); + } + if (bootstrap_pkg() != 0) + exit(EXIT_FAILURE); + } execv(pkgpath, argv); - return (EXIT_SUCCESS); + /* NOT REACHED */ + return (EXIT_FAILURE); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 22 17:16:06 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17890106564A; Wed, 22 Aug 2012 17:16:06 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBD458FC15; Wed, 22 Aug 2012 17:16: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 q7MHG5xB065782; Wed, 22 Aug 2012 17:16:05 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MHG5vq065777; Wed, 22 Aug 2012 17:16:05 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201208221716.q7MHG5vq065777@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 22 Aug 2012 17:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239566 - in stable/8/sys: kern vm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 17:16:06 -0000 Author: mdf Date: Wed Aug 22 17:16:05 2012 New Revision: 239566 URL: http://svn.freebsd.org/changeset/base/239566 Log: MFC r238502: Fix a bug with memguard(9) on 32-bit architectures without a VM_KMEM_MAX_SIZE. The code was not taking into account the size of the kernel_map, which the kmem_map is allocated from, so it could produce a sub-map size too large to fit. The simplest solution is to ignore VM_KMEM_MAX entirely and base the memguard map's size off the kernel_map's size, since this is always relevant and always smaller. Found by: Justin Hibbits Modified: stable/8/sys/kern/kern_malloc.c stable/8/sys/vm/memguard.c stable/8/sys/vm/memguard.h stable/8/sys/vm/vm_map.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/kern/kern_malloc.c ============================================================================== --- stable/8/sys/kern/kern_malloc.c Wed Aug 22 17:13:00 2012 (r239565) +++ stable/8/sys/kern/kern_malloc.c Wed Aug 22 17:16:05 2012 (r239566) @@ -646,7 +646,7 @@ kmeminit(void *dummy) init_param3(vm_kmem_size / PAGE_SIZE); #ifdef DEBUG_MEMGUARD - tmp = memguard_fudge(vm_kmem_size, vm_kmem_size_max); + tmp = memguard_fudge(vm_kmem_size, kernel_map); #else tmp = vm_kmem_size; #endif Modified: stable/8/sys/vm/memguard.c ============================================================================== --- stable/8/sys/vm/memguard.c Wed Aug 22 17:13:00 2012 (r239565) +++ stable/8/sys/vm/memguard.c Wed Aug 22 17:16:05 2012 (r239566) @@ -156,16 +156,18 @@ SYSCTL_ULONG(_vm_memguard, OID_AUTO, fre * the kmem_map. The memguard memory will be a submap. */ unsigned long -memguard_fudge(unsigned long km_size, unsigned long km_max) +memguard_fudge(unsigned long km_size, const struct vm_map *parent_map) { - u_long mem_pgs = cnt.v_page_count; + u_long mem_pgs, parent_size; vm_memguard_divisor = 10; TUNABLE_INT_FETCH("vm.memguard.divisor", &vm_memguard_divisor); + parent_size = vm_map_max(parent_map) - vm_map_min(parent_map) + + PAGE_SIZE; /* Pick a conservative value if provided value sucks. */ if ((vm_memguard_divisor <= 0) || - ((km_size / vm_memguard_divisor) == 0)) + ((parent_size / vm_memguard_divisor) == 0)) vm_memguard_divisor = 10; /* * Limit consumption of physical pages to @@ -174,20 +176,19 @@ memguard_fudge(unsigned long km_size, un * This prevents memguard's page promotions from completely * using up memory, since most malloc(9) calls are sub-page. */ + mem_pgs = cnt.v_page_count; memguard_physlimit = (mem_pgs / vm_memguard_divisor) * PAGE_SIZE; /* * We want as much KVA as we can take safely. Use at most our - * allotted fraction of kmem_max. Limit this to twice the - * physical memory to avoid using too much memory as pagetable - * pages. + * allotted fraction of the parent map's size. Limit this to + * twice the physical memory to avoid using too much memory as + * pagetable pages (size must be multiple of PAGE_SIZE). */ - memguard_mapsize = km_max / vm_memguard_divisor; - /* size must be multiple of PAGE_SIZE */ - memguard_mapsize = round_page(memguard_mapsize); + memguard_mapsize = round_page(parent_size / vm_memguard_divisor); if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; - if (km_size + memguard_mapsize > km_max) - return (km_max); + if (km_size + memguard_mapsize > parent_size) + memguard_mapsize = 0; return (km_size + memguard_mapsize); } Modified: stable/8/sys/vm/memguard.h ============================================================================== --- stable/8/sys/vm/memguard.h Wed Aug 22 17:13:00 2012 (r239565) +++ stable/8/sys/vm/memguard.h Wed Aug 22 17:16:05 2012 (r239566) @@ -35,7 +35,7 @@ struct malloc_type; struct vm_map; #ifdef DEBUG_MEMGUARD -unsigned long memguard_fudge(unsigned long, unsigned long); +unsigned long memguard_fudge(unsigned long, const struct vm_map *); void memguard_init(struct vm_map *); void *memguard_alloc(unsigned long, int); void *memguard_realloc(void *, unsigned long, struct malloc_type *, int); Modified: stable/8/sys/vm/vm_map.h ============================================================================== --- stable/8/sys/vm/vm_map.h Wed Aug 22 17:13:00 2012 (r239565) +++ stable/8/sys/vm/vm_map.h Wed Aug 22 17:16:05 2012 (r239566) @@ -198,13 +198,13 @@ struct vm_map { #ifdef _KERNEL static __inline vm_offset_t -vm_map_max(vm_map_t map) +vm_map_max(const struct vm_map *map) { return (map->max_offset); } static __inline vm_offset_t -vm_map_min(vm_map_t map) +vm_map_min(const struct vm_map *map) { return (map->min_offset); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 22 20:07:11 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F25961065AAF; Wed, 22 Aug 2012 20:07:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D45908FC08; Wed, 22 Aug 2012 20:07: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 q7MK7AgU090138; Wed, 22 Aug 2012 20:07:10 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK7APC090128; Wed, 22 Aug 2012 20:07:10 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208222007.q7MK7APC090128@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 22 Aug 2012 20:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239590 - stable/8/lib/libedit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 20:07:11 -0000 Author: pfg Date: Wed Aug 22 20:07:10 2012 New Revision: 239590 URL: http://svn.freebsd.org/changeset/base/239590 Log: MFC r238178, 238624, 238810: Re-merge a couple of changes from NetBSD libedit. bin/sh has been taught about el_gets setting the count to -1 on error, so now we can partially revert r238173 to reduce differences with NetBSD's implementation. Also fix some warnings to be more in sync with NetBSD. Obtained from: NetBSD Modified: stable/8/lib/libedit/chared.c stable/8/lib/libedit/chared.h stable/8/lib/libedit/editline.3 stable/8/lib/libedit/el.h stable/8/lib/libedit/makelist stable/8/lib/libedit/read.c stable/8/lib/libedit/sig.c stable/8/lib/libedit/sig.h stable/8/lib/libedit/tokenizer.c Directory Properties: stable/8/lib/libedit/ (props changed) Modified: stable/8/lib/libedit/chared.c ============================================================================== --- stable/8/lib/libedit/chared.c Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/chared.c Wed Aug 22 20:07:10 2012 (r239590) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: chared.c,v 1.25 2005/08/08 01:41:30 christos Exp $ + * $NetBSD: chared.c,v 1.27 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -59,12 +59,12 @@ cv_undo(EditLine *el) { c_undo_t *vu = &el->el_chared.c_undo; c_redo_t *r = &el->el_chared.c_redo; - unsigned int size; + size_t size; /* Save entire line for undo */ size = el->el_line.lastchar - el->el_line.buffer; vu->len = size; - vu->cursor = el->el_line.cursor - el->el_line.buffer; + vu->cursor = (int)(el->el_line.cursor - el->el_line.buffer); memcpy(vu->buf, el->el_line.buffer, size); /* save command info for redo */ @@ -83,7 +83,7 @@ cv_yank(EditLine *el, const char *ptr, i { c_kill_t *k = &el->el_chared.c_kill; - memcpy(k->buf, ptr, size +0u); + memcpy(k->buf, ptr, (size_t)size); k->last = k->buf + size; } @@ -97,7 +97,7 @@ c_insert(EditLine *el, int num) char *cp; if (el->el_line.lastchar + num >= el->el_line.limit) { - if (!ch_enlargebufs(el, num +0u)) + if (!ch_enlargebufs(el, (size_t)num)) return; /* can't go past end of buffer */ } @@ -118,7 +118,7 @@ c_delafter(EditLine *el, int num) { if (el->el_line.cursor + num > el->el_line.lastchar) - num = el->el_line.lastchar - el->el_line.cursor; + num = (int)(el->el_line.lastchar - el->el_line.cursor); if (el->el_map.current != el->el_map.emacs) { cv_undo(el); @@ -159,7 +159,7 @@ c_delbefore(EditLine *el, int num) { if (el->el_line.cursor - num < el->el_line.buffer) - num = el->el_line.cursor - el->el_line.buffer; + num = (int)(el->el_line.cursor - el->el_line.buffer); if (el->el_map.current != el->el_map.emacs) { cv_undo(el); @@ -375,7 +375,7 @@ cv_delfini(EditLine *el) /* sanity */ return; - size = el->el_line.cursor - el->el_chared.c_vcmd.pos; + size = (int)(el->el_line.cursor - el->el_chared.c_vcmd.pos); if (size == 0) size = 1; el->el_line.cursor = el->el_chared.c_vcmd.pos; @@ -529,8 +529,7 @@ ch_reset(EditLine *el, int mclear) } private void -ch__clearmacro(el) - EditLine *el; +ch__clearmacro(EditLine *el) { c_macro_t *ma = &el->el_chared.c_macro; while (ma->level >= 0) @@ -542,9 +541,7 @@ ch__clearmacro(el) * Returns 1 if successful, 0 if not. */ protected int -ch_enlargebufs(el, addlen) - EditLine *el; - size_t addlen; +ch_enlargebufs(EditLine *el, size_t addlen) { size_t sz, newsz; char *newbuffer, *oldbuf, *oldkbuf; @@ -695,12 +692,12 @@ protected int c_gets(EditLine *el, char *buf, const char *prompt) { char ch; - int len; + ssize_t len; char *cp = el->el_line.buffer; if (prompt) { len = strlen(prompt); - memcpy(cp, prompt, len + 0u); + memcpy(cp, prompt, (size_t)len); cp += len; } len = 0; @@ -721,7 +718,7 @@ c_gets(EditLine *el, char *buf, const ch case '\010': /* Delete and backspace */ case '\177': - if (len <= 0) { + if (len == 0) { len = -1; break; } @@ -749,7 +746,7 @@ c_gets(EditLine *el, char *buf, const ch el->el_line.buffer[0] = '\0'; el->el_line.lastchar = el->el_line.buffer; el->el_line.cursor = el->el_line.buffer; - return len; + return (int)len; } @@ -771,6 +768,6 @@ c_hpos(EditLine *el) ptr >= el->el_line.buffer && *ptr != '\n'; ptr--) continue; - return (el->el_line.cursor - ptr - 1); + return (int)(el->el_line.cursor - ptr - 1); } } Modified: stable/8/lib/libedit/chared.h ============================================================================== --- stable/8/lib/libedit/chared.h Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/chared.h Wed Aug 22 20:07:10 2012 (r239590) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)chared.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: chared.h,v 1.17 2006/03/06 21:11:56 christos Exp $ + * $NetBSD: chared.h,v 1.18 2009/02/15 21:55:23 christos Exp $ * $FreeBSD$ */ @@ -70,7 +70,7 @@ typedef struct c_macro_t { * Undo information for vi - no undo in emacs (yet) */ typedef struct c_undo_t { - int len; /* length of saved line */ + ssize_t len; /* length of saved line */ int cursor; /* position of saved cursor */ char *buf; /* full saved text */ } c_undo_t; Modified: stable/8/lib/libedit/editline.3 ============================================================================== --- stable/8/lib/libedit/editline.3 Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/editline.3 Wed Aug 22 20:07:10 2012 (r239590) @@ -165,6 +165,11 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. +If an error occurred, +.Fa count +is set to \-1 and +.Dv errno +contains the error code that caused it. The return value may not remain valid across calls to .Fn el_gets and must be copied if the data is to be retained. Modified: stable/8/lib/libedit/el.h ============================================================================== --- stable/8/lib/libedit/el.h Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/el.h Wed Aug 22 20:07:10 2012 (r239590) @@ -115,6 +115,7 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ + int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: stable/8/lib/libedit/makelist ============================================================================== --- stable/8/lib/libedit/makelist Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/makelist Wed Aug 22 20:07:10 2012 (r239590) @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: makelist,v 1.10 2005/08/08 14:04:49 christos Exp $ +# $NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $ # $FreeBSD$ # # Copyright (c) 1992, 1993 @@ -141,7 +141,7 @@ case $FLAG in # -fh) cat $FILES | $AWK '/el_action_t/ { print $3 }' | \ - sort | LC_ALL=C tr 'a-z' 'A-Z' | $AWK ' + sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK ' BEGIN { printf("/* Automatically generated file, do not edit */\n"); printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n"); Modified: stable/8/lib/libedit/read.c ============================================================================== --- stable/8/lib/libedit/read.c Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/read.c Wed Aug 22 20:07:10 2012 (r239590) @@ -235,9 +235,12 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; + el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ + if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ + el->el_errno = num == 0 ? 0 : errno; return (num); + } #ifdef KANJI if ((*ch & 0200)) { @@ -289,14 +292,21 @@ read_char(EditLine *el, char *cp) ssize_t num_read; int tried = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) + again: + el->el_signal->sig_no = 0; + while ((num_read = read(el->el_infd, cp, 1)) == -1) { + if (el->el_signal->sig_no == SIGCONT) { + sig_set(el); + el_set(el, EL_REFRESH); + goto again; + } if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - + } return (int)num_read; } @@ -403,10 +413,13 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; + int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ + if (nread == NULL) + nread = &nrb; *nread = 0; if (el->el_flags & NO_TTY) { @@ -427,12 +440,13 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } + if (num == -1) + el->el_errno = errno; el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + goto done; } @@ -443,8 +457,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); if (chrs == 0) { if (tty_rawmode(el) < 0) { - if (nread) - *nread = 0; + errno = 0; + *nread = 0; return (NULL); } } @@ -457,6 +471,7 @@ el_gets(EditLine *el, int *nread) if (el->el_flags & EDIT_DISABLED) { char *cp; size_t idx; + if ((el->el_flags & UNBUFFERED) == 0) cp = el->el_line.buffer; else @@ -480,11 +495,13 @@ el_gets(EditLine *el, int *nread) break; } + if (num == -1) { + el->el_errno = errno; + } + el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + goto done; } for (num = OKCMD; num == OKCMD;) { /* while still editing this @@ -617,12 +634,17 @@ el_gets(EditLine *el, int *nread) /* make sure the tty is set up correctly */ if ((el->el_flags & UNBUFFERED) == 0) { read_finish(el); - if (nread) - *nread = num; + *nread = num != -1 ? num : 0; } else { - if (nread) - *nread = - (int)(el->el_line.lastchar - el->el_line.buffer); + *nread = (int)(el->el_line.lastchar - el->el_line.buffer); } - return (num ? el->el_line.buffer : NULL); +done: + if (*nread == 0) { + if (num == -1) { + *nread = -1; + errno = el->el_errno; + } + return NULL; + } else + return el->el_line.buffer; } Modified: stable/8/lib/libedit/sig.c ============================================================================== --- stable/8/lib/libedit/sig.c Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/sig.c Wed Aug 22 20:07:10 2012 (r239590) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $ + * $NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -73,6 +73,8 @@ sig_handler(int signo) (void) sigaddset(&nset, signo); (void) sigprocmask(SIG_BLOCK, &nset, &oset); + sel->el_signal->sig_no = signo; + switch (signo) { case SIGCONT: tty_rawmode(sel); @@ -158,12 +160,12 @@ sig_set(EditLine *el) struct sigaction osa, nsa; nsa.sa_handler = sig_handler; + nsa.sa_flags = 0; sigemptyset(&nsa.sa_mask); (void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset); for (i = 0; sighdl[i] != -1; i++) { - nsa.sa_flags = SIGINT ? 0 : SA_RESTART; /* This could happen if we get interrupted */ if (sigaction(sighdl[i], &nsa, &osa) != -1 && osa.sa_handler != sig_handler) Modified: stable/8/lib/libedit/sig.h ============================================================================== --- stable/8/lib/libedit/sig.h Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/sig.h Wed Aug 22 20:07:10 2012 (r239590) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sig.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ + * $NetBSD: sig.h,v 1.8 2009/02/19 15:20:22 christos Exp $ * $FreeBSD$ */ @@ -61,6 +61,7 @@ typedef struct { struct sigaction sig_action[ALLSIGSNO]; sigset_t sig_set; + volatile sig_atomic_t sig_no; } *el_signal_t; protected void sig_end(EditLine*); Modified: stable/8/lib/libedit/tokenizer.c ============================================================================== --- stable/8/lib/libedit/tokenizer.c Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/tokenizer.c Wed Aug 22 20:07:10 2012 (r239590) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: tokenizer.c,v 1.14 2003/12/05 13:37:48 lukem Exp $ + * $NetBSD: tokenizer.c,v 1.15 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -198,7 +198,7 @@ tok_line(Tokenizer *tok, const LineInfo ptr = ""; if (ptr == line->cursor) { cc = tok->argc; - co = tok->wptr - tok->wstart; + co = (int)(tok->wptr - tok->wstart); } switch (*ptr) { case '\'': @@ -417,7 +417,7 @@ tok_line(Tokenizer *tok, const LineInfo tok_line_outok: if (cc == -1 && co == -1) { cc = tok->argc; - co = tok->wptr - tok->wstart; + co = (int)(tok->wptr - tok->wstart); } if (cursorc != NULL) *cursorc = cc; From owner-svn-src-stable-8@FreeBSD.ORG Wed Aug 22 20:34:24 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F8AA106564A; Wed, 22 Aug 2012 20:34:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE2288FC14; Wed, 22 Aug 2012 20:34: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 q7MKYNv0093644; Wed, 22 Aug 2012 20:34:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MKYNxn093642; Wed, 22 Aug 2012 20:34:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208222034.q7MKYNxn093642@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 20:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239592 - stable/8/sys/vm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 20:34:24 -0000 Author: kib Date: Wed Aug 22 20:34:23 2012 New Revision: 239592 URL: http://svn.freebsd.org/changeset/base/239592 Log: MFC r239247: Adjust the r205536, by allowing a non-zero offset for anonymous mappings for a.out binaries. Apparently, a.out ld.so from FreeBSD 1.1.5.1 can issue such requests. Modified: stable/8/sys/vm/vm_mmap.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/vm/vm_mmap.c ============================================================================== --- stable/8/sys/vm/vm_mmap.c Wed Aug 22 20:22:55 2012 (r239591) +++ stable/8/sys/vm/vm_mmap.c Wed Aug 22 20:34:23 2012 (r239592) @@ -202,11 +202,24 @@ mmap(td, uap) pos = uap->pos; fp = NULL; - /* make sure mapping fits into numeric range etc */ - if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && - curproc->p_osrel >= P_OSREL_MAP_ANON) || - ((flags & MAP_ANON) && (uap->fd != -1 || pos != 0))) - return (EINVAL); + + /* + * Enforce the constraints. + * Mapping of length 0 is only allowed for old binaries. + * Anonymous mapping shall specify -1 as filedescriptor and + * zero position for new code. Be nice to ancient a.out + * binaries and correct pos for anonymous mapping, since old + * ld.so sometimes issues anonymous map requests with non-zero + * pos. + */ + if (!SV_CURPROC_FLAG(SV_AOUT)) { + if ((uap->len == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) || + ((flags & MAP_ANON) != 0 && (uap->fd != -1 || pos != 0))) + return (EINVAL); + } else { + if ((flags & MAP_ANON) != 0) + pos = 0; + } if (flags & MAP_STACK) { if ((uap->fd != -1) || From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 23 00:39:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2451A1065672; Thu, 23 Aug 2012 00:39:09 +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 0ED958FC16; Thu, 23 Aug 2012 00:39: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 q7N0d8EF025775; Thu, 23 Aug 2012 00:39:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N0d8dQ025773; Thu, 23 Aug 2012 00:39:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208230039.q7N0d8dQ025773@svn.freebsd.org> From: Xin LI Date: Thu, 23 Aug 2012 00:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239600 - in stable: 8/etc 9/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2012 00:39:09 -0000 Author: delphij Date: Thu Aug 23 00:39:08 2012 New Revision: 239600 URL: http://svn.freebsd.org/changeset/base/239600 Log: MFC r239464: As of r232844 we no longer need the maxpoll 9 workaround. Modified: stable/8/etc/ntp.conf Directory Properties: stable/8/etc/ (props changed) Changes in other areas also in this revision: Modified: stable/9/etc/ntp.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/8/etc/ntp.conf ============================================================================== --- stable/8/etc/ntp.conf Wed Aug 22 23:44:12 2012 (r239599) +++ stable/8/etc/ntp.conf Thu Aug 23 00:39:08 2012 (r239600) @@ -18,12 +18,11 @@ # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # # The option `iburst' is used for faster initial synchronisation. -# The option `maxpoll 9' is used to prevent PLL/FLL flipping on FreeBSD. # -server 0.freebsd.pool.ntp.org iburst maxpoll 9 -server 1.freebsd.pool.ntp.org iburst maxpoll 9 -server 2.freebsd.pool.ntp.org iburst maxpoll 9 -#server 3.freebsd.pool.ntp.org iburst maxpoll 9 +server 0.freebsd.pool.ntp.org iburst +server 1.freebsd.pool.ntp.org iburst +server 2.freebsd.pool.ntp.org iburst +#server 3.freebsd.pool.ntp.org iburst # # If you want to pick yourself which country's public NTP server @@ -31,9 +30,9 @@ server 2.freebsd.pool.ntp.org iburst max # the next ones and replace CC with the country's abbreviation. # Make sure that the hostnames resolve to a proper IP address! # -# server 0.CC.pool.ntp.org iburst maxpoll 9 -# server 1.CC.pool.ntp.org iburst maxpoll 9 -# server 2.CC.pool.ntp.org iburst maxpoll 9 +# server 0.CC.pool.ntp.org iburst +# server 1.CC.pool.ntp.org iburst +# server 2.CC.pool.ntp.org iburst # # Security: Only accept NTP traffic from the following hosts. From owner-svn-src-stable-8@FreeBSD.ORG Thu Aug 23 17:09:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB280106578C; Thu, 23 Aug 2012 17:09:59 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36AC38FC1B; Thu, 23 Aug 2012 17:09: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 q7NH9xeO063498; Thu, 23 Aug 2012 17:09:59 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NH9xg5063496; Thu, 23 Aug 2012 17:09:59 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208231709.q7NH9xg5063496@svn.freebsd.org> From: Bernhard Schmidt Date: Thu, 23 Aug 2012 17:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239616 - stable/8/sys/net80211 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2012 17:10:00 -0000 Author: bschmidt Date: Thu Aug 23 17:09:58 2012 New Revision: 239616 URL: http://svn.freebsd.org/changeset/base/239616 Log: MFC r231187: Update the 802.11s IE numbers to represent the latest 802.11 amendment standard. This update breaks compatibility with older mesh setups but is necessary as the previous IDs are used by another amendment leading to unexpected results when trying to associate with an accesspoint using the affected IDs. Discussed with: re Tested by: honestqiao at gmail dot com Modified: stable/8/sys/net80211/ieee80211.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net80211/ieee80211.h ============================================================================== --- stable/8/sys/net80211/ieee80211.h Thu Aug 23 17:09:52 2012 (r239615) +++ stable/8/sys/net80211/ieee80211.h Thu Aug 23 17:09:58 2012 (r239616) @@ -708,27 +708,32 @@ enum { IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ /* - * 802.11s IEs based on D3.03 spec and were not assigned by - * ANA. Beware changing them because some of them are being - * kept compatible with Linux. + * 802.11s IEs + * NB: On vanilla Linux still IEEE80211_ELEMID_MESHPEER = 55, + * but they defined a new with id 117 called PEER_MGMT. + * NB: complies with open80211 */ - IEEE80211_ELEMID_MESHCONF = 51, - IEEE80211_ELEMID_MESHID = 52, - IEEE80211_ELEMID_MESHLINK = 35, - IEEE80211_ELEMID_MESHCNGST = 36, - IEEE80211_ELEMID_MESHPEER = 55, - IEEE80211_ELEMID_MESHCSA = 38, - IEEE80211_ELEMID_MESHTIM = 39, - IEEE80211_ELEMID_MESHAWAKEW = 40, - IEEE80211_ELEMID_MESHBEACONT = 41, - IEEE80211_ELEMID_MESHPANN = 48, - IEEE80211_ELEMID_MESHRANN = 49, - IEEE80211_ELEMID_MESHPREQ = 68, - IEEE80211_ELEMID_MESHPREP = 69, - IEEE80211_ELEMID_MESHPERR = 70, - IEEE80211_ELEMID_MESHPXU = 53, - IEEE80211_ELEMID_MESHPXUC = 54, - IEEE80211_ELEMID_MESHAH = 60, /* Abbreviated Handshake */ + IEEE80211_ELEMID_MESHCONF = 113, + IEEE80211_ELEMID_MESHID = 114, + IEEE80211_ELEMID_MESHLINK = 115, + IEEE80211_ELEMID_MESHCNGST = 116, + IEEE80211_ELEMID_MESHPEER = 117, + IEEE80211_ELEMID_MESHCSA = 118, + IEEE80211_ELEMID_MESHTIM = 39, /* XXX: remove */ + IEEE80211_ELEMID_MESHAWAKEW = 119, + IEEE80211_ELEMID_MESHBEACONT = 120, + /* 121-124 MMCAOP not implemented yet */ + IEEE80211_ELEMID_MESHPANN = 125, /* XXX: is GANN now, not used */ + IEEE80211_ELEMID_MESHRANN = 126, + /* 127 Extended Capabilities */ + /* 128-129 reserved */ + IEEE80211_ELEMID_MESHPREQ = 130, + IEEE80211_ELEMID_MESHPREP = 131, + IEEE80211_ELEMID_MESHPERR = 132, + /* 133-136 reserved */ + IEEE80211_ELEMID_MESHPXU = 137, + IEEE80211_ELEMID_MESHPXUC = 138, + IEEE80211_ELEMID_MESHAH = 60, /* XXX: remove */ }; struct ieee80211_tim_ie { From owner-svn-src-stable-8@FreeBSD.ORG Fri Aug 24 14:22:48 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20597106564A; Fri, 24 Aug 2012 14:22:48 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08DFB8FC0C; Fri, 24 Aug 2012 14:22: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 q7OEMlsb051427; Fri, 24 Aug 2012 14:22:47 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OEMlJm051425; Fri, 24 Aug 2012 14:22:47 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208241422.q7OEMlJm051425@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 24 Aug 2012 14:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239651 - stable/8/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2012 14:22:48 -0000 Author: bschmidt Date: Fri Aug 24 14:22:47 2012 New Revision: 239651 URL: http://svn.freebsd.org/changeset/base/239651 Log: MFC r239649: Document update of 802.11s IE identifiers. Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Directory Properties: stable/8/release/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 14:11:54 2012 (r239650) +++ stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 14:22:47 2012 (r239651) @@ -718,6 +718,13 @@ &os; virtual network stack (vnet) now supports IPv4 multicast routing. + + The IEEE 802.11s element identifiers have + been updated to reflect the final version of the amendment. This + update breaks compatibility with older mesh setups but is necessary + as the previous IDs are used by another amendment leading to + unexpected results when trying to associate with an accesspoint + using the affected IDs.