From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 26 00:52:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C0F11065677; Sun, 26 Feb 2012 00:52:11 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6582B8FC1A; Sun, 26 Feb 2012 00:52:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1Q0qBnh040780; Sun, 26 Feb 2012 00:52:11 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1Q0qBmW040778; Sun, 26 Feb 2012 00:52:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202260052.q1Q0qBmW040778@svn.freebsd.org> From: Christian Brueffer Date: Sun, 26 Feb 2012 00:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232167 - stable/9/share/man/man4 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 00:52:11 -0000 Author: brueffer Date: Sun Feb 26 00:52:10 2012 New Revision: 232167 URL: http://svn.freebsd.org/changeset/base/232167 Log: MFC: r232056 Rename DESCRIPTION section to HARDWARE, so this manpage can be used for automatic hardware notes generation. Modified: stable/9/share/man/man4/isci.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/isci.4 ============================================================================== --- stable/9/share/man/man4/isci.4 Sat Feb 25 21:06:39 2012 (r232166) +++ stable/9/share/man/man4/isci.4 Sun Feb 26 00:52:10 2012 (r232167) @@ -52,7 +52,7 @@ Or, to load the driver as a module at bo .Bd -literal -offset indent isci_load="YES" .Ed -.Sh DESCRIPTION +.Sh HARDWARE The .Nm driver provides support for Intel C600 From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 26 00:54:14 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB43A1065672; Sun, 26 Feb 2012 00:54:14 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A7238FC14; Sun, 26 Feb 2012 00:54:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1Q0sESE040888; Sun, 26 Feb 2012 00:54:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1Q0sEcT040885; Sun, 26 Feb 2012 00:54:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202260054.q1Q0sEcT040885@svn.freebsd.org> From: Christian Brueffer Date: Sun, 26 Feb 2012 00:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232168 - in stable/9/release/doc: en_US.ISO8859-1/hardware share/misc X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 00:54:14 -0000 Author: brueffer Date: Sun Feb 26 00:54:13 2012 New Revision: 232168 URL: http://svn.freebsd.org/changeset/base/232168 Log: MFC: r232060 Add isci(4) to the hardware notes. Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml stable/9/release/doc/share/misc/dev.archlist.txt Directory Properties: stable/9/release/ (props changed) stable/9/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/9/release/picobsd/tinyware/passwd/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Feb 26 00:52:10 2012 (r232167) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Feb 26 00:54:13 2012 (r232168) @@ -790,6 +790,8 @@ &hwlist.ips; + &hwlist.isci; + &hwlist.isp; &hwlist.mfi; Modified: stable/9/release/doc/share/misc/dev.archlist.txt ============================================================================== --- stable/9/release/doc/share/misc/dev.archlist.txt Sun Feb 26 00:52:10 2012 (r232167) +++ stable/9/release/doc/share/misc/dev.archlist.txt Sun Feb 26 00:54:13 2012 (r232168) @@ -80,6 +80,7 @@ ida i386 ie i386 iir i386,ia64,amd64 ips i386,amd64 +isci i386,amd64 ixgb i386,amd64 kue i386,pc98,ia64,amd64,powerpc lge i386,pc98,amd64 From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 26 10:20:13 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0EA61065672; Sun, 26 Feb 2012 10:20:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF54D8FC14; Sun, 26 Feb 2012 10:20:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QAKDY0058911; Sun, 26 Feb 2012 10:20:13 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QAKDpn058909; Sun, 26 Feb 2012 10:20:13 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202261020.q1QAKDpn058909@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 26 Feb 2012 10:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232171 - stable/9/sys/netinet/ipfw X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 10:20:14 -0000 Author: ae Date: Sun Feb 26 10:20:13 2012 New Revision: 232171 URL: http://svn.freebsd.org/changeset/base/232171 Log: MFC r231991: Don't use `m' after m_megapullup. PR: kern/165373 Modified: stable/9/sys/netinet/ipfw/ip_fw_nat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_nat.c Sun Feb 26 06:04:44 2012 (r232170) +++ stable/9/sys/netinet/ipfw/ip_fw_nat.c Sun Feb 26 10:20:13 2012 (r232171) @@ -315,7 +315,7 @@ ipfw_nat(struct ip_fw_args *args, struct } if (retval == PKT_ALIAS_RESPOND) - m->m_flags |= M_SKIP_FIREWALL; + mcl->m_flags |= M_SKIP_FIREWALL; mcl->m_pkthdr.len = mcl->m_len = ntohs(ip->ip_len); /* From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 26 21:24:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70AEA106566B; Sun, 26 Feb 2012 21:24:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 420F68FC08; Sun, 26 Feb 2012 21:24:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QLO3Vk083687; Sun, 26 Feb 2012 21:24:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QLO3O8083685; Sun, 26 Feb 2012 21:24:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201202262124.q1QLO3O8083685@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 26 Feb 2012 21:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232198 - stable/9/sys/dev/sound/usb X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 21:24:03 -0000 Author: hselasky Date: Sun Feb 26 21:24:02 2012 New Revision: 232198 URL: http://svn.freebsd.org/changeset/base/232198 Log: MFC r232039: Avoid creating PCM devices for MIDI only adapters. Modified: stable/9/sys/dev/sound/usb/uaudio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Sun Feb 26 20:56:49 2012 (r232197) +++ stable/9/sys/dev/sound/usb/uaudio.c Sun Feb 26 21:24:02 2012 (r232198) @@ -626,21 +626,21 @@ uaudio_attach(device_t dev) sc->sc_mixer_count); if (sc->sc_play_chan.valid) { - device_printf(dev, "Play: %d Hz, %d ch, %s format\n", + device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", sc->sc_play_chan.sample_rate, sc->sc_play_chan.p_asf1d->bNrChannels, sc->sc_play_chan.p_fmt->description); } else { - device_printf(dev, "No playback!\n"); + device_printf(dev, "No playback.\n"); } if (sc->sc_rec_chan.valid) { - device_printf(dev, "Record: %d Hz, %d ch, %s format\n", + device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", sc->sc_rec_chan.sample_rate, sc->sc_rec_chan.p_asf1d->bNrChannels, sc->sc_rec_chan.p_fmt->description); } else { - device_printf(dev, "No recording!\n"); + device_printf(dev, "No recording.\n"); } if (sc->sc_midi_chan.valid) { @@ -648,9 +648,9 @@ uaudio_attach(device_t dev) if (umidi_probe(dev)) { goto detach; } - device_printf(dev, "MIDI sequencer\n"); + device_printf(dev, "MIDI sequencer.\n"); } else { - device_printf(dev, "No midi sequencer\n"); + device_printf(dev, "No midi sequencer.\n"); } DPRINTF("doing child attach\n"); @@ -659,13 +659,21 @@ uaudio_attach(device_t dev) sc->sc_sndcard_func.func = SCF_PCM; - child = device_add_child(dev, "pcm", -1); + /* + * Only attach a PCM device if we have a playback, recording + * or mixer device present: + */ + if (sc->sc_play_chan.valid || + sc->sc_rec_chan.valid || + sc->sc_mix_info) { + child = device_add_child(dev, "pcm", -1); - if (child == NULL) { - DPRINTF("out of memory\n"); - goto detach; + if (child == NULL) { + DPRINTF("out of memory\n"); + goto detach; + } + device_set_ivars(child, &sc->sc_sndcard_func); } - device_set_ivars(child, &sc->sc_sndcard_func); if (bus_generic_attach(dev)) { DPRINTF("child attach failed\n"); From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 27 17:29:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC16F106577F; Mon, 27 Feb 2012 17:29:43 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 354FF8FC15; Mon, 27 Feb 2012 17:29:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHTgOT029040; Mon, 27 Feb 2012 17:29:42 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHTgBj029038; Mon, 27 Feb 2012 17:29:42 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202271729.q1RHTgBj029038@svn.freebsd.org> From: Sean Bruno Date: Mon, 27 Feb 2012 17:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232229 - stable/9/sys/dev/isci X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 17:29:44 -0000 Author: sbruno Date: Mon Feb 27 17:29:42 2012 New Revision: 232229 URL: http://svn.freebsd.org/changeset/base/232229 Log: MFC r231860 During work to port isci(4) to stable/7 I noted that the maxio portion of struct ccb_pathinq from sys/cam/cam_ccb.h wasn't added to stable/7 at all and didn't appear in stable/8 until svn R195534. Since __FreeBSD_version did not get bumped until svn R195634, assume that maxio is valid at 800102 or higher. Obtained from: Yahoo! Inc. Modified: stable/9/sys/dev/isci/isci_controller.c Modified: stable/9/sys/dev/isci/isci_controller.c ============================================================================== --- stable/9/sys/dev/isci/isci_controller.c Mon Feb 27 17:29:37 2012 (r232228) +++ stable/9/sys/dev/isci/isci_controller.c Mon Feb 27 17:29:42 2012 (r232229) @@ -549,7 +549,7 @@ void isci_action(struct cam_sim *sim, un cpi->hba_eng_cnt = 0; cpi->max_target = SCI_MAX_REMOTE_DEVICES - 1; cpi->max_lun = ISCI_MAX_LUN; -#if __FreeBSD_version >= 704100 +#if __FreeBSD_version >= 800102 cpi->maxio = isci_io_request_get_max_io_size(); #endif cpi->unit_number = cam_sim_unit(sim); From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 27 17:41:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F93F106564A; Mon, 27 Feb 2012 17:41:24 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8E258FC0A; Mon, 27 Feb 2012 17:41:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHfNtf029653; Mon, 27 Feb 2012 17:41:23 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHfNDL029651; Mon, 27 Feb 2012 17:41:23 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202271741.q1RHfNDL029651@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 27 Feb 2012 17:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232234 - stable/9/usr.bin/fstat X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 17:41:24 -0000 Author: pluknet Date: Mon Feb 27 17:41:23 2012 New Revision: 232234 URL: http://svn.freebsd.org/changeset/base/232234 Log: Backout r230934 (MFCed as r231859) which didn't work with unix sockets and several filesystem layers mounted at the specified path. Pointy hat to: pluknet Reported by: flo via broken tinderbox Modified: stable/9/usr.bin/fstat/fstat.c Directory Properties: stable/9/usr.bin/fstat/ (props changed) Modified: stable/9/usr.bin/fstat/fstat.c ============================================================================== --- stable/9/usr.bin/fstat/fstat.c Mon Feb 27 17:39:34 2012 (r232233) +++ stable/9/usr.bin/fstat/fstat.c Mon Feb 27 17:41:23 2012 (r232234) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -225,53 +224,28 @@ static void print_file_info(struct procstat *procstat, struct filestat *fst, const char *uname, const char *cmd, int pid) { - struct sockstat sock; struct vnstat vn; DEVS *d; const char *filename; int error, fsmatch = 0; char errbuf[_POSIX2_LINE_MAX]; - error = 0; filename = NULL; if (checkfile != 0) { - switch (fst->fs_type) { - case PS_FST_TYPE_VNODE: - case PS_FST_TYPE_FIFO: - error = procstat_get_vnode_info(procstat, fst, &vn, errbuf); - break; - case PS_FST_TYPE_SOCKET: - error = procstat_get_socket_info(procstat, fst, &sock, errbuf); - break; - default: + if (fst->fs_type != PS_FST_TYPE_VNODE && + fst->fs_type != PS_FST_TYPE_FIFO) return; - } + error = procstat_get_vnode_info(procstat, fst, &vn, errbuf); if (error != 0) return; for (d = devs; d != NULL; d = d->next) - switch (fst->fs_type) { - case PS_FST_TYPE_VNODE: - case PS_FST_TYPE_FIFO: - if (d->fsid == vn.vn_fsid) { - fsmatch = 1; - if ((unsigned)d->ino == vn.vn_fileid) { - filename = d->name; - break; - } - } - break; - case PS_FST_TYPE_SOCKET: - if (sock.dom_family == AF_UNIX) { - fsmatch = 1; - if (strcmp(((struct sockaddr_un *) - (&sock.sa_local))->sun_path, - d->name) == 0) { - filename = d->name; - break; - } + if (d->fsid == vn.vn_fsid) { + fsmatch = 1; + if ((unsigned)d->ino == vn.vn_fileid) { + filename = d->name; + break; } - break; } if (fsmatch == 0 || (filename == NULL && fsflg == 0)) return; From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 27 18:17:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D93801065670; Mon, 27 Feb 2012 18:17:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C83E18FC08; Mon, 27 Feb 2012 18:17:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RIH3ro030855; Mon, 27 Feb 2012 18:17:03 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RIH396030852; Mon, 27 Feb 2012 18:17:03 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202271817.q1RIH396030852@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 27 Feb 2012 18:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232235 - stable/9/sys/dev/fb X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 18:17:04 -0000 Author: jkim Date: Mon Feb 27 18:17:03 2012 New Revision: 232235 URL: http://svn.freebsd.org/changeset/base/232235 Log: MFC: r231841, r231842 Properly check VESA video mode number. Modified: stable/9/sys/dev/fb/vesa.c stable/9/sys/dev/fb/vesa.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/fb/vesa.c ============================================================================== --- stable/9/sys/dev/fb/vesa.c Mon Feb 27 17:41:23 2012 (r232234) +++ stable/9/sys/dev/fb/vesa.c Mon Feb 27 18:17:03 2012 (r232235) @@ -1311,7 +1311,9 @@ vesa_set_mode(video_adapter_t *adp, int if (!(info.vi_flags & V_INFO_GRAPHICS)) info.vi_flags &= ~V_INFO_LINEAR; - if (vesa_bios_set_mode(mode | ((info.vi_flags & V_INFO_LINEAR) ? 0x4000 : 0))) + if ((info.vi_flags & V_INFO_LINEAR) != 0) + mode |= 0x4000; + if (vesa_bios_set_mode(mode)) return (1); /* Palette format is reset by the above VBE function call. */ @@ -1329,7 +1331,7 @@ vesa_set_mode(video_adapter_t *adp, int #if VESA_DEBUG > 0 printf("VESA: mode set!\n"); #endif - vesa_adp->va_mode = mode; + vesa_adp->va_mode = mode & 0x1ff; /* Mode number is 9-bit. */ vesa_adp->va_flags &= ~V_ADP_COLOR; vesa_adp->va_flags |= (info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0; Modified: stable/9/sys/dev/fb/vesa.h ============================================================================== --- stable/9/sys/dev/fb/vesa.h Mon Feb 27 17:41:23 2012 (r232234) +++ stable/9/sys/dev/fb/vesa.h Mon Feb 27 18:17:03 2012 (r232235) @@ -126,7 +126,7 @@ struct vesa_mode #ifdef _KERNEL -#define VESA_MODE(x) ((x) >= M_VESA_BASE) +#define VESA_MODE(x) ((x) >= M_VESA_BASE && (x) <= M_VESA_MODE_MAX) int vesa_load_ioctl(void); int vesa_unload_ioctl(void); From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 27 18:28:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6EEC1065673; Mon, 27 Feb 2012 18:28:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C58998FC0C; Mon, 27 Feb 2012 18:28:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RISI8h031359; Mon, 27 Feb 2012 18:28:18 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RISIWB031357; Mon, 27 Feb 2012 18:28:18 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202271828.q1RISIWB031357@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 27 Feb 2012 18:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232236 - stable/9/sys/dev/fb X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 18:28:19 -0000 Author: jkim Date: Mon Feb 27 18:28:18 2012 New Revision: 232236 URL: http://svn.freebsd.org/changeset/base/232236 Log: MFC: r231843, r232061, r232063, r232065, r232069 - Set the initial mode for the adapter after executing VESA BIOS POST. - Probe supported states for save/restore function. - Defer to VGA methods if no state is supported. Modified: stable/9/sys/dev/fb/vesa.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/fb/vesa.c ============================================================================== --- stable/9/sys/dev/fb/vesa.c Mon Feb 27 18:17:03 2012 (r232235) +++ stable/9/sys/dev/fb/vesa.c Mon Feb 27 18:28:18 2012 (r232236) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith - * Copyright (c) 2009-2010 Jung-uk Kim + * Copyright (c) 2009-2012 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -80,6 +80,7 @@ typedef struct adp_state adp_state_t; static struct mtx vesa_lock; +static int vesa_state; static void *vesa_state_buf = NULL; static uint32_t vesa_state_buf_offs = 0; static ssize_t vesa_state_buf_size = 0; @@ -205,13 +206,7 @@ static int vesa_bios_load_palette2(int s #define STATE_SIZE 0 #define STATE_SAVE 1 #define STATE_LOAD 2 -#define STATE_HW (1<<0) -#define STATE_DATA (1<<1) -#define STATE_DAC (1<<2) -#define STATE_REG (1<<3) -#define STATE_MOST (STATE_HW | STATE_DATA | STATE_REG) -#define STATE_ALL (STATE_HW | STATE_DATA | STATE_DAC | STATE_REG) -static ssize_t vesa_bios_state_buf_size(void); +static ssize_t vesa_bios_state_buf_size(int); static int vesa_bios_save_restore(int code, void *p); #ifdef MODE_TABLE_BROKEN static int vesa_bios_get_line_length(void); @@ -509,14 +504,14 @@ vesa_bios_load_palette2(int start, int c } static ssize_t -vesa_bios_state_buf_size(void) +vesa_bios_state_buf_size(int state) { x86regs_t regs; x86bios_init_regs(®s); regs.R_AX = 0x4f04; /* regs.R_DL = STATE_SIZE; */ - regs.R_CX = STATE_MOST; + regs.R_CX = state; x86bios_intr(®s, 0x10); @@ -537,7 +532,7 @@ vesa_bios_save_restore(int code, void *p x86bios_init_regs(®s); regs.R_AX = 0x4f04; regs.R_DL = code; - regs.R_CX = STATE_MOST; + regs.R_CX = vesa_state; regs.R_ES = X86BIOS_PHYSTOSEG(vesa_state_buf_offs); regs.R_BX = X86BIOS_PHYSTOOFF(vesa_state_buf_offs); @@ -1041,7 +1036,12 @@ vesa_bios_init(void) x86bios_free(vmbuf, sizeof(*buf)); - vesa_state_buf_size = vesa_bios_state_buf_size(); + /* Probe supported save/restore states. */ + for (i = 0; i < 4; i++) + if (vesa_bios_state_buf_size(1 << i) > 0) + vesa_state |= 1 << i; + if (vesa_state != 0) + vesa_state_buf_size = vesa_bios_state_buf_size(vesa_state); vesa_palette = x86bios_alloc(&vesa_palette_offs, VESA_PALETTE_SIZE + vesa_state_buf_size, M_WAITOK); if (vesa_state_buf_size > 0) { @@ -1451,15 +1451,13 @@ static int vesa_save_state(video_adapter_t *adp, void *p, size_t size) { - if (adp != vesa_adp) + if (adp != vesa_adp || vesa_state_buf_size == 0) return ((*prevvidsw->save_state)(adp, p, size)); - if (vesa_state_buf_size == 0) - return (1); if (size == 0) return (offsetof(adp_state_t, regs) + vesa_state_buf_size); if (size < (offsetof(adp_state_t, regs) + vesa_state_buf_size)) - return (1); + return (EINVAL); ((adp_state_t *)p)->sig = V_STATE_SIG; bzero(((adp_state_t *)p)->regs, vesa_state_buf_size); @@ -1469,18 +1467,20 @@ vesa_save_state(video_adapter_t *adp, vo static int vesa_load_state(video_adapter_t *adp, void *p) { + int mode; - if ((adp != vesa_adp) || (((adp_state_t *)p)->sig != V_STATE_SIG)) + if (adp != vesa_adp) return ((*prevvidsw->load_state)(adp, p)); - if (vesa_state_buf_size == 0) - return (1); - /* Try BIOS POST to restore a sane state. */ (void)vesa_bios_post(); - (void)int10_set_mode(adp->va_initial_bios_mode); - (void)vesa_set_mode(adp, adp->va_mode); + mode = adp->va_mode; + (void)vesa_set_mode(adp, adp->va_initial_mode); + if (mode != adp->va_initial_mode) + (void)vesa_set_mode(adp, mode); + if (((adp_state_t *)p)->sig != V_STATE_SIG) + return ((*prevvidsw->load_state)(adp, p)); return (vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs)); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 28 15:52:02 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 796BA106566B; Tue, 28 Feb 2012 15:52:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DDC98FC13; Tue, 28 Feb 2012 15:52:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SFq2ji077489; Tue, 28 Feb 2012 15:52:02 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SFq2AI077486; Tue, 28 Feb 2012 15:52:02 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202281552.q1SFq2AI077486@svn.freebsd.org> From: Rick Macklem Date: Tue, 28 Feb 2012 15:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232259 - in stable/9/sys: fs/nfsserver i386/conf X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 15:52:02 -0000 Author: rmacklem Date: Tue Feb 28 15:52:01 2012 New Revision: 232259 URL: http://svn.freebsd.org/changeset/base/232259 Log: MFC: r232050 hrs@ reported a panic to freebsd-stable@ under the subject line "panic in 8.3-PRERELEASE" on Feb. 22, 2012. This panic was caused by use of a mix of tsleep() and msleep() calls on the same event in the new NFS server DRC code. It did "mtx_unlock(); tsleep();" in two places, which kib@ noted introduced a slight risk that the wakeup() would occur before the tsleep(), resulting in a 10sec delay before waking up. This patch fixes the problem by replacing "mtx_unlock(); tsleep();" with mtx_sleep(..PDROP..). It also changes a nfsmsleep() call to mtx_sleep() so that the code uses mtx_sleep() consistently within the file. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdcache.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdcache.c Tue Feb 28 15:47:39 2012 (r232258) +++ stable/9/sys/fs/nfsserver/nfs_nfsdcache.c Tue Feb 28 15:52:01 2012 (r232259) @@ -336,9 +336,8 @@ loop: nfsaddr_match(NETFAMILY(rp), &rp->rc_haddr, nd->nd_nam)) { if ((rp->rc_flag & RC_LOCKED) != 0) { rp->rc_flag |= RC_WANTED; - NFSUNLOCKCACHE(); - (void) tsleep((caddr_t)rp, PZERO - 1, - "nfsrc", 10 * hz); + (void)mtx_sleep(rp, NFSCACHEMUTEXPTR, + (PZERO - 1) | PDROP, "nfsrc", 10 * hz); goto loop; } if (rp->rc_flag == 0) @@ -622,8 +621,8 @@ tryagain: rp = hitrp; if ((rp->rc_flag & RC_LOCKED) != 0) { rp->rc_flag |= RC_WANTED; - NFSUNLOCKCACHE(); - (void) tsleep((caddr_t)rp, PZERO-1, "nfsrc", 10 * hz); + (void)mtx_sleep(rp, NFSCACHEMUTEXPTR, + (PZERO - 1) | PDROP, "nfsrc", 10 * hz); goto tryagain; } if (rp->rc_flag == 0) @@ -694,7 +693,7 @@ nfsrc_lock(struct nfsrvcache *rp) NFSCACHELOCKREQUIRED(); while ((rp->rc_flag & RC_LOCKED) != 0) { rp->rc_flag |= RC_WANTED; - (void) nfsmsleep((caddr_t)rp, NFSCACHEMUTEXPTR, PZERO - 1, + (void)mtx_sleep(rp, NFSCACHEMUTEXPTR, PZERO - 1, "nfsrc", 0); } rp->rc_flag |= RC_LOCKED; From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 28 23:30:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C28F9106564A; Tue, 28 Feb 2012 23:30:19 +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 B168F8FC14; Tue, 28 Feb 2012 23:30:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SNUJK9097118; Tue, 28 Feb 2012 23:30:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SNUJ2a097116; Tue, 28 Feb 2012 23:30:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202282330.q1SNUJ2a097116@svn.freebsd.org> From: Xin LI Date: Tue, 28 Feb 2012 23:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232277 - stable/9/include X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 23:30:19 -0000 Author: delphij Date: Tue Feb 28 23:30:19 2012 New Revision: 232277 URL: http://svn.freebsd.org/changeset/base/232277 Log: MFC r228924: In POSIX.1-2008: P_tmpdir [OB XSI] Default directory prefix for tempnam(). This macro is used in a lot of places in legacy applications, and is why we see a lot of programs written for e.g. Linux store volatile temporary files in /var/tmp and not /tmp. Modified: stable/9/include/stdio.h Directory Properties: stable/9/include/ (props changed) Modified: stable/9/include/stdio.h ============================================================================== --- stable/9/include/stdio.h Tue Feb 28 22:30:58 2012 (r232276) +++ stable/9/include/stdio.h Tue Feb 28 23:30:19 2012 (r232277) @@ -202,7 +202,7 @@ __END_DECLS /* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ #if __XSI_VISIBLE -#define P_tmpdir "/var/tmp/" +#define P_tmpdir "/tmp/" #endif #define L_tmpnam 1024 /* XXX must be == PATH_MAX */ #define TMP_MAX 308915776 From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 29 00:52:57 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68E15106566C; Wed, 29 Feb 2012 00:52:57 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 491608FC13; Wed, 29 Feb 2012 00:52: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 q1T0qvF7099730; Wed, 29 Feb 2012 00:52:57 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1T0qv1E099725; Wed, 29 Feb 2012 00:52:57 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201202290052.q1T0qv1E099725@svn.freebsd.org> From: Andrew Thompson Date: Wed, 29 Feb 2012 00:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232279 - in stable/9: share/man/man4 sys/i386/conf sys/net X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 00:52:57 -0000 Author: thompsa Date: Wed Feb 29 00:52:56 2012 New Revision: 232279 URL: http://svn.freebsd.org/changeset/base/232279 Log: MFC r232008,232010,232080,232089 Using the flowid in the mbuf assumes the network card is giving a good hash for the traffic flow, this may not be the case giving poor traffic distribution. Add a sysctl which allows us to fall back to our own flow hash code. PR: kern/164901 Modified: stable/9/share/man/man4/lagg.4 stable/9/sys/net/ieee8023ad_lacp.c stable/9/sys/net/if_lagg.c stable/9/sys/net/if_lagg.h Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/share/man/man4/lagg.4 ============================================================================== --- stable/9/share/man/man4/lagg.4 Wed Feb 29 00:30:18 2012 (r232278) +++ stable/9/share/man/man4/lagg.4 Wed Feb 29 00:52:56 2012 (r232279) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 18, 2010 +.Dd February 23, 2012 .Dt LAGG 4 .Os .Sh NAME @@ -133,6 +133,21 @@ variable in .Pp The MTU of the first interface to be added is used as the lagg MTU. All additional interfaces are required to have exactly the same value. +.Pp +The +.Ic loadbalance +and +.Ic lacp +modes will use the RSS hash from the network card if available to avoid +computing one, this may give poor traffic distribution if the hash is invalid +or uses less of the protocol header information. +Local hash computation can be forced per interface by setting the +.Va net.link.lagg.X.use_flowid +.Xr sysctl 8 +variable to zero where X is the interface number. +The default for new interfaces is set via the +.Va net.link.lagg.default_use_flowid +.Xr sysctl 8 . .Sh EXAMPLES Create a 802.3ad link aggregation using LACP with two .Xr bge 4 Modified: stable/9/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/9/sys/net/ieee8023ad_lacp.c Wed Feb 29 00:30:18 2012 (r232278) +++ stable/9/sys/net/ieee8023ad_lacp.c Wed Feb 29 00:52:56 2012 (r232279) @@ -812,7 +812,7 @@ lacp_select_tx_port(struct lagg_softc *s return (NULL); } - if (m->m_flags & M_FLOWID) + if (sc->use_flowid && (m->m_flags & M_FLOWID)) hash = m->m_pkthdr.flowid; else hash = lagg_hashmbuf(m, lsc->lsc_hashkey); Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Wed Feb 29 00:30:18 2012 (r232278) +++ stable/9/sys/net/if_lagg.c Wed Feb 29 00:52:56 2012 (r232279) @@ -171,6 +171,11 @@ static int lagg_failover_rx_all = 0; /* SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW, &lagg_failover_rx_all, 0, "Accept input from any interface in a failover lagg"); +static int def_use_flowid = 1; /* Default value for using M_FLOWID */ +TUNABLE_INT("net.link.lagg.default_use_flowid", &def_use_flowid); +SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RW, + &def_use_flowid, 0, + "Default setting for using flow id for load sharing"); static int lagg_modevent(module_t mod, int type, void *data) @@ -261,6 +266,8 @@ lagg_clone_create(struct if_clone *ifc, struct ifnet *ifp; int i, error = 0; static const u_char eaddr[6]; /* 00:00:00:00:00:00 */ + struct sysctl_oid *oid; + char num[14]; /* sufficient for 32 bits */ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); @@ -269,6 +276,15 @@ lagg_clone_create(struct if_clone *ifc, return (ENOSPC); } + sysctl_ctx_init(&sc->ctx); + snprintf(num, sizeof(num), "%u", unit); + sc->use_flowid = def_use_flowid; + oid = SYSCTL_ADD_NODE(&sc->ctx, &SYSCTL_NODE_CHILDREN(_net_link, lagg), + OID_AUTO, num, CTLFLAG_RD, NULL, ""); + SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, + "Use flow id for load sharing"); + sc->sc_proto = LAGG_PROTO_NONE; for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; i++) { if (lagg_protos[i].ti_proto == LAGG_PROTO_DEFAULT) { @@ -349,6 +365,7 @@ lagg_clone_destroy(struct ifnet *ifp) LAGG_WUNLOCK(sc); + sysctl_ctx_free(&sc->ctx); ifmedia_removeall(&sc->sc_media); ether_ifdetach(ifp); if_free_type(ifp, IFT_ETHER); @@ -1676,7 +1693,7 @@ lagg_lb_start(struct lagg_softc *sc, str struct lagg_port *lp = NULL; uint32_t p = 0; - if (m->m_flags & M_FLOWID) + if (sc->use_flowid && (m->m_flags & M_FLOWID)) p = m->m_pkthdr.flowid; else p = lagg_hashmbuf(m, lb->lb_key); Modified: stable/9/sys/net/if_lagg.h ============================================================================== --- stable/9/sys/net/if_lagg.h Wed Feb 29 00:30:18 2012 (r232278) +++ stable/9/sys/net/if_lagg.h Wed Feb 29 00:52:56 2012 (r232279) @@ -21,6 +21,8 @@ #ifndef _NET_LAGG_H #define _NET_LAGG_H +#include + /* * Global definitions */ @@ -202,6 +204,8 @@ struct lagg_softc { eventhandler_tag vlan_attach; eventhandler_tag vlan_detach; #endif + struct sysctl_ctx_list ctx; /* sysctl variables */ + int use_flowid; /* use M_FLOWID */ }; struct lagg_port { From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 29 01:36:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 638011065670; Wed, 29 Feb 2012 01:36:01 +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 44CA98FC1D; Wed, 29 Feb 2012 01:36: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 q1T1a1Rm001370; Wed, 29 Feb 2012 01:36:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1T1a1de001366; Wed, 29 Feb 2012 01:36:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202290136.q1T1a1de001366@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Feb 2012 01:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232283 - stable/9/sys/fs/msdosfs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 01:36:01 -0000 Author: kib Date: Wed Feb 29 01:36:00 2012 New Revision: 232283 URL: http://svn.freebsd.org/changeset/base/232283 Log: MFC r231998: Use DOINGASYNC() to test for async allowance, to honor VFS syncing requests. Modified: stable/9/sys/fs/msdosfs/msdosfs_denode.c stable/9/sys/fs/msdosfs/msdosfs_lookup.c stable/9/sys/fs/msdosfs/msdosfs_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_denode.c Wed Feb 29 01:35:21 2012 (r232282) +++ stable/9/sys/fs/msdosfs/msdosfs_denode.c Wed Feb 29 01:36:00 2012 (r232283) @@ -431,7 +431,7 @@ detrunc(dep, length, flags, cred, td) if (allerror) printf("detrunc(): vtruncbuf error %d\n", allerror); #endif - error = deupdat(dep, !(DETOV(dep)->v_mount->mnt_flag & MNT_ASYNC)); + error = deupdat(dep, !DOINGASYNC((DETOV(dep)))); if (error != 0 && allerror == 0) allerror = error; #ifdef MSDOSFS_DEBUG @@ -510,7 +510,7 @@ deextend(dep, length, cred) } dep->de_FileSize = length; dep->de_flag |= DE_UPDATE | DE_MODIFIED; - return (deupdat(dep, !(DETOV(dep)->v_mount->mnt_flag & MNT_ASYNC))); + return (deupdat(dep, !DOINGASYNC(DETOV(dep)))); } /* Modified: stable/9/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_lookup.c Wed Feb 29 01:35:21 2012 (r232282) +++ stable/9/sys/fs/msdosfs/msdosfs_lookup.c Wed Feb 29 01:36:00 2012 (r232283) @@ -690,7 +690,7 @@ createde(dep, ddep, depp, cnp) while (--ddep->de_fndcnt >= 0) { if (!(ddep->de_fndoffset & pmp->pm_crbomask)) { - if (DETOV(ddep)->v_mount->mnt_flag & MNT_ASYNC) + if (DOINGASYNC(DETOV(ddep))) bdwrite(bp); else if ((error = bwrite(bp)) != 0) return error; @@ -720,7 +720,7 @@ createde(dep, ddep, depp, cnp) } } - if (DETOV(ddep)->v_mount->mnt_flag & MNT_ASYNC) + if (DOINGASYNC(DETOV(ddep))) bdwrite(bp); else if ((error = bwrite(bp)) != 0) return error; @@ -1022,7 +1022,7 @@ removede(pdep, dep) || ep->deAttributes != ATTR_WIN95) break; } - if (DETOV(pdep)->v_mount->mnt_flag & MNT_ASYNC) + if (DOINGASYNC(DETOV(pdep))) bdwrite(bp); else if ((error = bwrite(bp)) != 0) return error; Modified: stable/9/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vnops.c Wed Feb 29 01:35:21 2012 (r232282) +++ stable/9/sys/fs/msdosfs/msdosfs_vnops.c Wed Feb 29 01:36:00 2012 (r232283) @@ -1249,7 +1249,7 @@ abortit: putushort(dotdotp->deStartCluster, dp->de_StartCluster); if (FAT32(pmp)) putushort(dotdotp->deHighClust, dp->de_StartCluster >> 16); - if (fvp->v_mount->mnt_flag & MNT_ASYNC) + if (DOINGASYNC(fvp)) bdwrite(bp); else if ((error = bwrite(bp)) != 0) { /* XXX should downgrade to ro here, fs is corrupt */ @@ -1383,7 +1383,7 @@ msdosfs_mkdir(ap) putushort(denp[1].deHighClust, pdep->de_StartCluster >> 16); } - if (ap->a_dvp->v_mount->mnt_flag & MNT_ASYNC) + if (DOINGASYNC(ap->a_dvp)) bdwrite(bp); else if ((error = bwrite(bp)) != 0) goto bad; From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 29 01:39:41 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED3A1106566B; Wed, 29 Feb 2012 01:39:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D849F8FC16; Wed, 29 Feb 2012 01:39:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1T1dd8U001564; Wed, 29 Feb 2012 01:39:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1T1ddtj001562; Wed, 29 Feb 2012 01:39:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202290139.q1T1ddtj001562@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Feb 2012 01:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232285 - stable/9/sys/ufs/ufs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 01:39:41 -0000 Author: kib Date: Wed Feb 29 01:39:39 2012 New Revision: 232285 URL: http://svn.freebsd.org/changeset/base/232285 Log: MFC r232003: Properly lock DQREF() with dqhlock. Missed locking caused counter corruption. Assert that the dq reference value is sane before decrementing it. Modified: stable/9/sys/ufs/ufs/ufs_quota.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ufs/ufs_quota.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_quota.c Wed Feb 29 01:38:36 2012 (r232284) +++ stable/9/sys/ufs/ufs/ufs_quota.c Wed Feb 29 01:39:39 2012 (r232285) @@ -1469,6 +1469,7 @@ dqrele(struct vnode *vp, struct dquot *d if (dq == NODQUOT) return; DQH_LOCK(); + KASSERT(dq->dq_cnt > 0, ("Lost dq %p reference 1", dq)); if (dq->dq_cnt > 1) { dq->dq_cnt--; DQH_UNLOCK(); @@ -1479,6 +1480,7 @@ sync: (void) dqsync(vp, dq); DQH_LOCK(); + KASSERT(dq->dq_cnt > 0, ("Lost dq %p reference 2", dq)); if (--dq->dq_cnt > 0) { DQH_UNLOCK(); @@ -1658,6 +1660,7 @@ quotaref(vp, qrp) */ found = 0; ip = VTOI(vp); + mtx_lock(&dqhlock); for (i = 0; i < MAXQUOTAS; i++) { if ((dq = ip->i_dquot[i]) == NODQUOT) continue; @@ -1665,6 +1668,7 @@ quotaref(vp, qrp) qrp[i] = dq; found++; } + mtx_unlock(&dqhlock); return (found); } From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 29 06:19:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A4E3106566B; Wed, 29 Feb 2012 06:19:01 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B09F8FC15; Wed, 29 Feb 2012 06:19: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 q1T6J0H9012251; Wed, 29 Feb 2012 06:19:00 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1T6J0h3012246; Wed, 29 Feb 2012 06:19:00 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202290619.q1T6J0h3012246@svn.freebsd.org> From: David Xu Date: Wed, 29 Feb 2012 06:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232290 - in stable/9: lib/libc/sys sys/compat/freebsd32 sys/i386/conf sys/kern sys/sys X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 06:19:01 -0000 Author: davidxu Date: Wed Feb 29 06:19:00 2012 New Revision: 232290 URL: http://svn.freebsd.org/changeset/base/232290 Log: MFC 230857: If multiple threads call kevent() to get AIO events on same kqueue fd, it is possible that a single AIO event will be reported to multiple threads, it is not threading friendly, and the existing API can not control this behavior. Allocate a kevent flags field sigev_notify_kevent_flags for AIO event notification in sigevent, and allow user to pass EV_CLEAR, EV_DISPATCH or EV_ONESHOT to AIO kernel code, user can control whether the event should be cleared once it is retrieved by a thread. This change should be comptaible with existing application, because the field should have already been zero-filled, and no additional action will be taken by kernel. PR: kern/156567 MFC 231006: Add 32-bit compat code for AIO kevent flags introduced in revision 230857. MFC 231724: Add notes about sigev_notify_kevent_flags introduced in revision 230857 which enables thread-friendly polling on same fd for AIO events. Reviewed by: delphij MFC 231777: Bump .Dd date for previous revision. Modified: stable/9/lib/libc/sys/kqueue.2 stable/9/sys/compat/freebsd32/freebsd32_signal.h stable/9/sys/kern/vfs_aio.c stable/9/sys/sys/signal.h Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/lib/libc/sys/kqueue.2 ============================================================================== --- stable/9/lib/libc/sys/kqueue.2 Wed Feb 29 05:48:29 2012 (r232289) +++ stable/9/lib/libc/sys/kqueue.2 Wed Feb 29 06:19:00 2012 (r232290) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2009 +.Dd February 15, 2012 .Dt KQUEUE 2 .Os .Sh NAME @@ -322,6 +322,9 @@ The sigevent portion of the AIO request .Va sigev_notify_kqueue containing the descriptor of the kqueue that the event should be attached to, +.Va sigev_notify_kevent_flags +containing the kevent flags which should be EV_ONESHOT, EV_CLEAR or +EV_DISPATCH, .Va sigev_value containing the udata value, and .Va sigev_notify Modified: stable/9/sys/compat/freebsd32/freebsd32_signal.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_signal.h Wed Feb 29 05:48:29 2012 (r232289) +++ stable/9/sys/compat/freebsd32/freebsd32_signal.h Wed Feb 29 06:19:00 2012 (r232290) @@ -92,6 +92,7 @@ struct sigevent32 { uint32_t _function; uint32_t _attribute; } _sigev_thread; + unsigned short _kevent_flags; uint32_t __spare__[8]; } _sigev_un; }; Modified: stable/9/sys/kern/vfs_aio.c ============================================================================== --- stable/9/sys/kern/vfs_aio.c Wed Feb 29 05:48:29 2012 (r232289) +++ stable/9/sys/kern/vfs_aio.c Wed Feb 29 06:19:00 2012 (r232290) @@ -1524,6 +1524,7 @@ aio_aqueue(struct thread *td, struct aio int error; int fd, kqfd; int jid; + u_short evflags; if (p->p_aioinfo == NULL) aio_init_aioinfo(p); @@ -1640,10 +1641,15 @@ aio_aqueue(struct thread *td, struct aio if (aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_KEVENT) goto no_kqueue; + evflags = aiocbe->uaiocb.aio_sigevent.sigev_notify_kevent_flags; + if ((evflags & ~(EV_CLEAR | EV_DISPATCH | EV_ONESHOT)) != 0) { + error = EINVAL; + goto aqueue_fail; + } kqfd = aiocbe->uaiocb.aio_sigevent.sigev_notify_kqueue; kev.ident = (uintptr_t)aiocbe->uuaiocb; kev.filter = EVFILT_AIO; - kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; + kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags; kev.data = (intptr_t)aiocbe; kev.udata = aiocbe->uaiocb.aio_sigevent.sigev_value.sival_ptr; error = kqfd_register(kqfd, &kev, td, 1); @@ -2688,6 +2694,7 @@ convert_sigevent32(struct sigevent32 *si break; case SIGEV_KEVENT: CP(*sig32, *sig, sigev_notify_kqueue); + CP(*sig32, *sig, sigev_notify_kevent_flags); PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); break; default: Modified: stable/9/sys/sys/signal.h ============================================================================== --- stable/9/sys/sys/signal.h Wed Feb 29 05:48:29 2012 (r232289) +++ stable/9/sys/sys/signal.h Wed Feb 29 06:19:00 2012 (r232290) @@ -169,12 +169,14 @@ struct sigevent { void (*_function)(union sigval); void *_attribute; /* pthread_attr_t * */ } _sigev_thread; + unsigned short _kevent_flags; long __spare__[8]; } _sigev_un; }; #if __BSD_VISIBLE #define sigev_notify_kqueue sigev_signo +#define sigev_notify_kevent_flags _sigev_un._kevent_flags #define sigev_notify_thread_id _sigev_un._threadid #endif #define sigev_notify_function _sigev_un._sigev_thread._function From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 29 09:47:27 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C54271065670; Wed, 29 Feb 2012 09:47:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAB7B8FC08; Wed, 29 Feb 2012 09:47:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1T9lR99019269; Wed, 29 Feb 2012 09:47:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1T9lRDV019249; Wed, 29 Feb 2012 09:47:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202290947.q1T9lRDV019249@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 29 Feb 2012 09:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232292 - in stable/9: contrib/netcat contrib/pf/pfctl etc/rc.d share/man/man4 sys/contrib/pf/net sys/fs/nfsclient sys/i386/conf sys/kern sys/net sys/netinet sys/netinet/ipfw sys/netine... X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 09:47:27 -0000 Author: bz Date: Wed Feb 29 09:47:26 2012 New Revision: 232292 URL: http://svn.freebsd.org/changeset/base/232292 Log: MFC r231852,232127: Merge multi-FIB IPv6 support. Extend the so far IPv4-only support for multiple routing tables (FIBs) introduced in r178888 to IPv6 providing feature parity. This includes an extended rtalloc(9) KPI for IPv6, the necessary adjustments to the network stack, and user land support as in netstat. Sponsored by: Cisco Systems, Inc. Modified: stable/9/contrib/netcat/netcat.c stable/9/contrib/pf/pfctl/parse.y stable/9/etc/rc.d/routing stable/9/share/man/man4/faith.4 stable/9/sys/contrib/pf/net/pf.c stable/9/sys/contrib/pf/net/pf_ioctl.c stable/9/sys/contrib/pf/net/pf_lb.c stable/9/sys/contrib/pf/net/pf_norm.c stable/9/sys/contrib/pf/net/pfvar.h stable/9/sys/fs/nfsclient/nfs_clport.c stable/9/sys/fs/nfsclient/nfs_clvfsops.c stable/9/sys/kern/uipc_socket.c stable/9/sys/net/flowtable.c stable/9/sys/net/if_faith.c stable/9/sys/net/route.c stable/9/sys/net/route.h stable/9/sys/netinet/in.c stable/9/sys/netinet/ipfw/ip_fw2.c stable/9/sys/netinet/sctp_os_bsd.h stable/9/sys/netinet/tcp_subr.c stable/9/sys/netinet6/icmp6.c stable/9/sys/netinet6/in6.c stable/9/sys/netinet6/in6_gif.c stable/9/sys/netinet6/in6_ifattach.c stable/9/sys/netinet6/in6_mcast.c stable/9/sys/netinet6/in6_rmx.c stable/9/sys/netinet6/in6_src.c stable/9/sys/netinet6/in6_var.h stable/9/sys/netinet6/ip6_forward.c stable/9/sys/netinet6/ip6_input.c stable/9/sys/netinet6/ip6_output.c stable/9/sys/netinet6/ip6_var.h stable/9/sys/netinet6/nd6.c stable/9/sys/netinet6/nd6_nbr.c stable/9/sys/netinet6/nd6_rtr.c stable/9/sys/netinet6/raw_ip6.c stable/9/sys/netipsec/ipsec_output.c stable/9/sys/nfs/bootp_subr.c stable/9/sys/nfsclient/nfs_vfsops.c stable/9/usr.bin/netstat/route.c Directory Properties: stable/9/contrib/netcat/ (props changed) stable/9/contrib/pf/ (props changed) stable/9/etc/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/usr.bin/netstat/ (props changed) Modified: stable/9/contrib/netcat/netcat.c ============================================================================== --- stable/9/contrib/netcat/netcat.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/contrib/netcat/netcat.c Wed Feb 29 09:47:26 2012 (r232292) @@ -605,8 +605,10 @@ remote_connect(const char *host, const c #endif if (rtableid) { - if (setfib(rtableid) == -1) - err(1, "setfib"); + if (setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, + sizeof(rtableid)) == -1) + err(1, "setsockopt(.., SO_SETFIB, %u, ..)", + rtableid); } /* Bind to a local port or source address if specified. */ @@ -678,8 +680,11 @@ local_listen(char *host, char *port, str continue; if (rtableid) { - if (setfib(rtableid) == -1) - err(1, "setfib"); + ret = setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, + sizeof(rtableid)); + if (ret == -1) + err(1, "setsockopt(.., SO_SETFIB, %u, ..)", + rtableid); } ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); Modified: stable/9/contrib/pf/pfctl/parse.y ============================================================================== --- stable/9/contrib/pf/pfctl/parse.y Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/contrib/pf/pfctl/parse.y Wed Feb 29 09:47:26 2012 (r232292) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -335,6 +338,7 @@ int expand_skip_interface(struct node_ int check_rulestate(int); int getservice(char *); int rule_label(struct pf_rule *, char *); +int rt_tableid_max(void); void mv_rules(struct pf_ruleset *, struct pf_ruleset *); void decide_address_family(struct node_host *, sa_family_t *); @@ -1174,7 +1178,7 @@ scrub_opt : NODF { scrub_opts.randomid = 1; } | RTABLE NUMBER { - if ($2 < 0 /* || $2 > RT_TABLEID_MAX */) { + if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); YYERROR; } @@ -1322,7 +1326,7 @@ antispoof_opt : label { antispoof_opts.label = $1; } | RTABLE NUMBER { - if ($2 < 0 /* || $2 > RT_TABLEID_MAX */ ) { + if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); YYERROR; } @@ -2361,7 +2365,7 @@ filter_opt : USER uids { filter_opts.prob = 1; } | RTABLE NUMBER { - if ($2 < 0 /* || $2 > RT_TABLEID_MAX */ ) { + if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); YYERROR; } @@ -4190,7 +4194,7 @@ tagged : /* empty */ { $$.neg = 0; $$. rtable : /* empty */ { $$ = -1; } | RTABLE NUMBER { - if ($2 < 0 /* || $2 > RT_TABLEID_MAX */ ) { + if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); YYERROR; } @@ -6051,3 +6055,23 @@ pfctl_load_anchors(int dev, struct pfctl return (0); } + +int +rt_tableid_max(void) +{ +#ifdef __FreeBSD__ + int fibs; + size_t l = sizeof(fibs); + + if (sysctlbyname("net.fibs", &fibs, &l, NULL, 0) == -1) + fibs = 16; /* XXX RT_MAXFIBS, at least limit it some. */ + /* + * As the OpenBSD code only compares > and not >= we need to adjust + * here given we only accept values of 0..n and want to avoid #ifdefs + * in the grammer. + */ + return (fibs - 1); +#else + return (RT_TABLEID_MAX); +#endif +} Modified: stable/9/etc/rc.d/routing ============================================================================== --- stable/9/etc/rc.d/routing Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/etc/rc.d/routing Wed Feb 29 09:47:26 2012 (r232292) @@ -137,12 +137,22 @@ static_inet() static_inet6() { - local _action i + local _action i fibs _action=$1 + # get the number of FIBs supported. + fibs=`sysctl -n net.fibs` + : ${fibs:=1} + # disallow "internal" addresses to appear on the wire - route ${_action} -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject - route ${_action} -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + i=0 + while test ${i} -lt ${fibs}; do + setfib -F ${i} route ${_action} \ + -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject + setfib -F ${i} route ${_action} \ + -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + i=$((i + 1)) + done case ${ipv6_defaultrouter} in [Nn][Oo] | '') @@ -214,8 +224,14 @@ static_inet6() # for the host case, you will allow to omit the identifiers. # Under this configuration, the packets will go to the default # interface. - route ${_action} -inet6 fe80:: -prefixlen 10 ::1 -reject - route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject + i=0 + while test ${i} -lt ${fibs}; do + setfib -F ${i} route ${_action} \ + -inet6 fe80:: -prefixlen 10 ::1 -reject + setfib -F ${i} route ${_action} \ + -inet6 ff02:: -prefixlen 16 ::1 -reject + i=$((i + 1)) + done case ${ipv6_default_interface} in '') Modified: stable/9/share/man/man4/faith.4 ============================================================================== --- stable/9/share/man/man4/faith.4 Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/share/man/man4/faith.4 Wed Feb 29 09:47:26 2012 (r232292) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 1999 +.Dd January 23, 2012 .Dt FAITH 4 .Os .Sh NAME @@ -58,7 +58,7 @@ variable in .Xr rc.conf 5 . .Pp Special action will be taken when IPv6 TCP traffic is seen on a router, -and the routing table suggests to route it to the +and the default routing table suggests to route it to the .Nm interface. In this case, the packet will be accepted by the router, Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/contrib/pf/net/pf.c Wed Feb 29 09:47:26 2012 (r232292) @@ -320,7 +320,7 @@ u_int8_t pf_get_wscale(struct mbuf *, u_int16_t pf_get_mss(struct mbuf *, int, u_int16_t, sa_family_t); u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, - u_int16_t); + int, u_int16_t); void pf_set_rt_ifp(struct pf_state *, struct pf_addr *); int pf_check_proto_cksum(struct mbuf *, int, int, @@ -3137,7 +3137,7 @@ pf_get_mss(struct mbuf *m, int off, u_in } u_int16_t -pf_calc_mss(struct pf_addr *addr, sa_family_t af, u_int16_t offer) +pf_calc_mss(struct pf_addr *addr, sa_family_t af, int rtableid, u_int16_t offer) { #ifdef INET struct sockaddr_in *dst; @@ -3166,11 +3166,7 @@ pf_calc_mss(struct pf_addr *addr, sa_fam dst->sin_len = sizeof(*dst); dst->sin_addr = addr->v4; #ifdef __FreeBSD__ -#ifdef RTF_PRCLONING - rtalloc_ign(&ro, (RTF_CLONING | RTF_PRCLONING)); -#else /* !RTF_PRCLONING */ - in_rtalloc_ign(&ro, 0, 0); -#endif + in_rtalloc_ign(&ro, 0, rtableid); #else /* ! __FreeBSD__ */ rtalloc_noclone(&ro, NO_CLONING); #endif @@ -3186,12 +3182,7 @@ pf_calc_mss(struct pf_addr *addr, sa_fam dst6->sin6_len = sizeof(*dst6); dst6->sin6_addr = addr->v6; #ifdef __FreeBSD__ -#ifdef RTF_PRCLONING - rtalloc_ign((struct route *)&ro6, - (RTF_CLONING | RTF_PRCLONING)); -#else /* !RTF_PRCLONING */ - rtalloc_ign((struct route *)&ro6, 0); -#endif + in6_rtalloc_ign(&ro6, 0, rtableid); #else /* ! __FreeBSD__ */ rtalloc_noclone((struct route *)&ro6, NO_CLONING); #endif @@ -3532,14 +3523,14 @@ pf_test_rule(struct pf_rule **rm, struct else if (r->proto && r->proto != pd->proto) r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&r->src.addr, saddr, af, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; /* tcp/udp only. port_op always 0 in other cases */ else if (r->src.port_op && !pf_match_port(r->src.port_op, r->src.port[0], r->src.port[1], sport)) r = r->skip[PF_SKIP_SRC_PORT].ptr; else if (PF_MISMATCHAW(&r->dst.addr, daddr, af, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; /* tcp/udp only. port_op always 0 in other cases */ else if (r->dst.port_op && !pf_match_port(r->dst.port_op, @@ -3988,9 +3979,10 @@ pf_create_state(struct pf_rule *r, struc } s->src.seqhi = htonl(arc4random()); /* Find mss option */ + int rtid = M_GETFIB(m); mss = pf_get_mss(m, off, th->th_off, pd->af); - mss = pf_calc_mss(pd->src, pd->af, mss); - mss = pf_calc_mss(pd->dst, pd->af, mss); + mss = pf_calc_mss(pd->src, pd->af, rtid, mss); + mss = pf_calc_mss(pd->dst, pd->af, rtid, mss); s->src.mss = mss; #ifdef __FreeBSD__ pf_send_tcp(NULL, r, pd->af, pd->dst, pd->src, th->th_dport, @@ -4072,10 +4064,10 @@ pf_test_fragment(struct pf_rule **rm, in else if (r->proto && r->proto != pd->proto) r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&r->src.addr, pd->src, af, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; else if (PF_MISMATCHAW(&r->dst.addr, pd->dst, af, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; else if (r->tos && !(r->tos == pd->tos)) r = TAILQ_NEXT(r, entries); @@ -5677,7 +5669,8 @@ pf_pull_hdr(struct mbuf *m, int off, voi } int -pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif) +pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif, + int rtableid) { #ifdef __FreeBSD__ #ifdef RADIX_MPATH @@ -5751,13 +5744,21 @@ pf_routable(struct pf_addr *addr, sa_fam goto out; #ifdef __FreeBSD__ -/* XXX MRT not always INET */ /* stick with table 0 though */ + switch (af) { +#ifdef INET6 + case AF_INET6: + in6_rtalloc_ign(&ro, 0, rtableid); + break; +#endif #ifdef INET - if (af == AF_INET) - in_rtalloc_ign((struct route *)&ro, 0, 0); - else + case AF_INET: + in_rtalloc_ign((struct route *)&ro, 0, rtableid); + break; #endif - rtalloc_ign((struct route *)&ro, 0); + default: + rtalloc_ign((struct route *)&ro, 0); /* No/default FIB. */ + break; + } #else /* ! __FreeBSD__ */ rtalloc_noclone((struct route *)&ro, NO_CLONING); #endif @@ -5803,7 +5804,8 @@ out: } int -pf_rtlabel_match(struct pf_addr *addr, sa_family_t af, struct pf_addr_wrap *aw) +pf_rtlabel_match(struct pf_addr *addr, sa_family_t af, struct pf_addr_wrap *aw, + int rtableid) { struct sockaddr_in *dst; #ifdef INET6 @@ -5835,16 +5837,21 @@ pf_rtlabel_match(struct pf_addr *addr, s } #ifdef __FreeBSD__ -# ifdef RTF_PRCLONING - rtalloc_ign((struct route *)&ro, (RTF_CLONING|RTF_PRCLONING)); -# else /* !RTF_PRCLONING */ + switch (af) { +#ifdef INET6 + case AF_INET6: + in6_rtalloc_ign(&ro, 0, rtableid); + break; +#endif #ifdef INET - if (af == AF_INET) - in_rtalloc_ign((struct route *)&ro, 0, 0); - else + case AF_INET: + in_rtalloc_ign((struct route *)&ro, 0, rtableid); + break; #endif + default: rtalloc_ign((struct route *)&ro, 0); -# endif + break; + } #else /* ! __FreeBSD__ */ rtalloc_noclone((struct route *)&ro, NO_CLONING); #endif @@ -5927,7 +5934,7 @@ pf_route(struct mbuf **m, struct pf_rule if (r->rt == PF_FASTROUTE) { #ifdef __FreeBSD__ - in_rtalloc(ro, 0); + in_rtalloc_ign(ro, 0, M_GETFIB(m0)); #else rtalloc(ro); #endif @@ -6893,7 +6900,7 @@ done: ("pf: dropping packet with ip options\n")); } - if ((s && s->tag) || r->rtableid) + if ((s && s->tag) || r->rtableid >= 0) #ifdef __FreeBSD__ pf_tag_packet(m, s ? s->tag : 0, r->rtableid, pd.pf_mtag); #else @@ -7437,7 +7444,7 @@ done: ("pf: dropping packet with dangerous v6 headers\n")); } - if ((s && s->tag) || r->rtableid) + if ((s && s->tag) || r->rtableid >= 0) #ifdef __FreeBSD__ pf_tag_packet(m, s ? s->tag : 0, r->rtableid, pd.pf_mtag); #else Modified: stable/9/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_ioctl.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/contrib/pf/net/pf_ioctl.c Wed Feb 29 09:47:26 2012 (r232292) @@ -1754,7 +1754,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t a } #ifdef __FreeBSD__ /* ROUTING */ - if (rule->rtableid > 0 && rule->rtableid > rt_numfibs) + if (rule->rtableid > 0 && rule->rtableid >= rt_numfibs) #else if (rule->rtableid > 0 && !rtable_exists(rule->rtableid)) #endif @@ -2035,7 +2035,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t a if (newrule->rtableid > 0 && #ifdef __FreeBSD__ /* ROUTING */ - newrule->rtableid > rt_numfibs) + newrule->rtableid >= rt_numfibs) #else !rtable_exists(newrule->rtableid)) #endif Modified: stable/9/sys/contrib/pf/net/pf_lb.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_lb.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/contrib/pf/net/pf_lb.c Wed Feb 29 09:47:26 2012 (r232292) @@ -261,7 +261,7 @@ pf_match_translation(struct pf_pdesc *pd else if (r->proto && r->proto != pd->proto) r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&src->addr, saddr, pd->af, - src->neg, kif)) + src->neg, kif, M_GETFIB(m))) r = r->skip[src == &r->src ? PF_SKIP_SRC_ADDR : PF_SKIP_DST_ADDR].ptr; else if (src->port_op && !pf_match_port(src->port_op, @@ -269,10 +269,11 @@ pf_match_translation(struct pf_pdesc *pd r = r->skip[src == &r->src ? PF_SKIP_SRC_PORT : PF_SKIP_DST_PORT].ptr; else if (dst != NULL && - PF_MISMATCHAW(&dst->addr, daddr, pd->af, dst->neg, NULL)) + PF_MISMATCHAW(&dst->addr, daddr, pd->af, dst->neg, NULL, + M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; else if (xdst != NULL && PF_MISMATCHAW(xdst, daddr, pd->af, - 0, NULL)) + 0, NULL, M_GETFIB(m))) r = TAILQ_NEXT(r, entries); else if (dst != NULL && dst->port_op && !pf_match_port(dst->port_op, dst->port[0], Modified: stable/9/sys/contrib/pf/net/pf_norm.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_norm.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/contrib/pf/net/pf_norm.c Wed Feb 29 09:47:26 2012 (r232292) @@ -1163,11 +1163,11 @@ pf_normalize_ip(struct mbuf **m0, int di r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&r->src.addr, (struct pf_addr *)&h->ip_src.s_addr, AF_INET, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; else if (PF_MISMATCHAW(&r->dst.addr, (struct pf_addr *)&h->ip_dst.s_addr, AF_INET, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; #ifdef __FreeBSD__ else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag)) @@ -1428,11 +1428,11 @@ pf_normalize_ip6(struct mbuf **m0, int d #endif else if (PF_MISMATCHAW(&r->src.addr, (struct pf_addr *)&h->ip6_src, AF_INET6, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; else if (PF_MISMATCHAW(&r->dst.addr, (struct pf_addr *)&h->ip6_dst, AF_INET6, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; else break; @@ -1593,13 +1593,13 @@ pf_normalize_tcp(int dir, struct pfi_kif else if (r->proto && r->proto != pd->proto) r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&r->src.addr, pd->src, af, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; else if (r->src.port_op && !pf_match_port(r->src.port_op, r->src.port[0], r->src.port[1], th->th_sport)) r = r->skip[PF_SKIP_SRC_PORT].ptr; else if (PF_MISMATCHAW(&r->dst.addr, pd->dst, af, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; else if (r->dst.port_op && !pf_match_port(r->dst.port_op, r->dst.port[0], r->dst.port[1], th->th_dport)) Modified: stable/9/sys/contrib/pf/net/pfvar.h ============================================================================== --- stable/9/sys/contrib/pf/net/pfvar.h Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/contrib/pf/net/pfvar.h Wed Feb 29 09:47:26 2012 (r232292) @@ -402,14 +402,18 @@ extern struct mtx pf_task_mtx; #endif /* PF_INET6_ONLY */ #endif /* PF_INET_INET6 */ -#define PF_MISMATCHAW(aw, x, af, neg, ifp) \ +/* + * XXX callers not FIB-aware in our version of pf yet. + * OpenBSD fixed it later it seems, 2010/05/07 13:33:16 claudio. + */ +#define PF_MISMATCHAW(aw, x, af, neg, ifp, rtid) \ ( \ (((aw)->type == PF_ADDR_NOROUTE && \ - pf_routable((x), (af), NULL)) || \ + pf_routable((x), (af), NULL, (rtid))) || \ (((aw)->type == PF_ADDR_URPFFAILED && (ifp) != NULL && \ - pf_routable((x), (af), (ifp))) || \ + pf_routable((x), (af), (ifp), (rtid))) || \ ((aw)->type == PF_ADDR_RTLABEL && \ - !pf_rtlabel_match((x), (af), (aw))) || \ + !pf_rtlabel_match((x), (af), (aw), (rtid))) || \ ((aw)->type == PF_ADDR_TABLE && \ !pfr_match_addr((aw)->p.tbl, (x), (af))) || \ ((aw)->type == PF_ADDR_DYNIFTL && \ @@ -1977,8 +1981,10 @@ int pf_normalize_tcp_stateful(struct mbu u_int32_t pf_state_expires(const struct pf_state *); void pf_purge_expired_fragments(void); -int pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *); -int pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *); +int pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *, + int); +int pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *, + int); #ifdef __FreeBSD__ int pf_socket_lookup(int, struct pf_pdesc *, struct inpcb *); #else Modified: stable/9/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clport.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/fs/nfsclient/nfs_clport.c Wed Feb 29 09:47:26 2012 (r232292) @@ -976,7 +976,8 @@ nfscl_getmyip(struct nfsmount *nmp, int sad.sin_len = sizeof (struct sockaddr_in); sad.sin_addr.s_addr = sin->sin_addr.s_addr; CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); - rt = rtalloc1((struct sockaddr *)&sad, 0, 0UL); + rt = rtalloc1_fib((struct sockaddr *)&sad, 0, 0UL, + curthread->td_proc->p_fibnum); if (rt != NULL) { if (rt->rt_ifp != NULL && rt->rt_ifa != NULL && @@ -1001,7 +1002,8 @@ nfscl_getmyip(struct nfsmount *nmp, int sad6.sin6_len = sizeof (struct sockaddr_in6); sad6.sin6_addr = sin6->sin6_addr; CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); - rt = rtalloc1((struct sockaddr *)&sad6, 0, 0UL); + rt = rtalloc1_fib((struct sockaddr *)&sad6, 0, 0UL, + curthread->td_proc->p_fibnum); if (rt != NULL) { if (rt->rt_ifp != NULL && rt->rt_ifa != NULL && Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Feb 29 09:47:26 2012 (r232292) @@ -459,10 +459,10 @@ nfs_mountroot(struct mount *mp) sin.sin_len = sizeof(sin); /* XXX MRT use table 0 for this sort of thing */ CURVNET_SET(TD_TO_VNET(td)); - error = rtrequest(RTM_ADD, (struct sockaddr *)&sin, + error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&sin, (struct sockaddr *)&nd->mygateway, (struct sockaddr *)&mask, - RTF_UP | RTF_GATEWAY, NULL); + RTF_UP | RTF_GATEWAY, NULL, RT_DEFAULT_FIB); CURVNET_RESTORE(); if (error) panic("nfs_mountroot: RTM_ADD: %d", error); Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/kern/uipc_socket.c Wed Feb 29 09:47:26 2012 (r232292) @@ -392,6 +392,7 @@ socreate(int dom, struct socket **aso, i so->so_type = type; so->so_cred = crhold(cred); if ((prp->pr_domain->dom_family == PF_INET) || + (prp->pr_domain->dom_family == PF_INET6) || (prp->pr_domain->dom_family == PF_ROUTE)) so->so_fibnum = td->td_proc->p_fibnum; else @@ -2498,12 +2499,13 @@ sosetopt(struct socket *so, struct socko case SO_SETFIB: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); - if (optval < 0 || optval > rt_numfibs) { + if (optval < 0 || optval >= rt_numfibs) { error = EINVAL; goto bad; } if (so->so_proto != NULL && ((so->so_proto->pr_domain->dom_family == PF_INET) || + (so->so_proto->pr_domain->dom_family == PF_INET6) || (so->so_proto->pr_domain->dom_family == PF_ROUTE))) { so->so_fibnum = optval; /* Note: ignore error */ Modified: stable/9/sys/net/flowtable.c ============================================================================== --- stable/9/sys/net/flowtable.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/net/flowtable.c Wed Feb 29 09:47:26 2012 (r232292) @@ -373,7 +373,7 @@ SYSCTL_VNET_PROC(_net_inet_flowtable, OI #ifndef RADIX_MPATH static void -in_rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum) +rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum) { rtalloc_ign_fib(ro, 0, fibnum); @@ -1314,7 +1314,7 @@ flowtable_alloc(char *name, int nentry, #ifdef RADIX_MPATH ft->ft_rtalloc = rtalloc_mpath_fib; #else - ft->ft_rtalloc = in_rtalloc_ign_wrapper; + ft->ft_rtalloc = rtalloc_ign_wrapper; #endif if (flags & FL_PCPU) { ft->ft_lock = flowtable_pcpu_lock; Modified: stable/9/sys/net/if_faith.c ============================================================================== --- stable/9/sys/net/if_faith.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/net/if_faith.c Wed Feb 29 09:47:26 2012 (r232292) @@ -338,7 +338,7 @@ faithprefix(in6) sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_addr = *in6; - rt = rtalloc1((struct sockaddr *)&sin6, 0, 0UL); + rt = in6_rtalloc1((struct sockaddr *)&sin6, 0, 0UL, RT_DEFAULT_FIB); if (rt && rt->rt_ifp && rt->rt_ifp->if_type == IFT_FAITH && (rt->rt_ifp->if_flags & IFF_UP) != 0) ret = 1; Modified: stable/9/sys/net/route.c ============================================================================== --- stable/9/sys/net/route.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/net/route.c Wed Feb 29 09:47:26 2012 (r232292) @@ -35,6 +35,7 @@ ***********************************************************************/ #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_route.h" #include "opt_mrouting.h" #include "opt_mpath.h" @@ -72,7 +73,11 @@ SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLA /* * Allow the boot code to allow LESS than RT_MAXFIBS to be used. * We can't do more because storage is statically allocated for now. - * (for compatibility reasons.. this will change). + * (for compatibility reasons.. this will change. When this changes, code should + * be refactored to protocol independent parts and protocol dependent parts, + * probably hanging of domain(9) specific storage to not need the full + * fib * af RNH allocation etc. but allow tuning the number of tables per + * address family). */ TUNABLE_INT("net.fibs", &rt_numfibs); @@ -82,6 +87,9 @@ TUNABLE_INT("net.fibs", &rt_numfibs); * changes for the FIB of the caller when adding a new set of addresses * to an interface. XXX this is a shotgun aproach to a problem that needs * a more fine grained solution.. that will come. + * XXX also has the problems getting the FIB from curthread which will not + * always work given the fib can be overridden and prefixes can be added + * from the network stack context. */ u_int rt_add_addr_allfibs = 1; SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RW, @@ -196,27 +204,23 @@ vnet_route_init(const void *unused __unu V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); for (dom = domains; dom; dom = dom->dom_next) { - if (dom->dom_rtattach) { - for (table = 0; table < rt_numfibs; table++) { - if ( (fam = dom->dom_family) == AF_INET || - table == 0) { - /* for now only AF_INET has > 1 table */ - /* XXX MRT - * rtattach will be also called - * from vfs_export.c but the - * offset will be 0 - * (only for AF_INET and AF_INET6 - * which don't need it anyhow) - */ - rnh = rt_tables_get_rnh_ptr(table, fam); - if (rnh == NULL) - panic("%s: rnh NULL", __func__); - dom->dom_rtattach((void **)rnh, - dom->dom_rtoffset); - } else { - break; - } - } + if (dom->dom_rtattach == NULL) + continue; + + for (table = 0; table < rt_numfibs; table++) { + fam = dom->dom_family; + if (table != 0 && fam != AF_INET6 && fam != AF_INET) + break; + + /* + * XXX MRT rtattach will be also called from + * vfs_export.c but the offset will be 0 (only for + * AF_INET and AF_INET6 which don't need it anyhow). + */ + rnh = rt_tables_get_rnh_ptr(table, fam); + if (rnh == NULL) + panic("%s: rnh NULL", __func__); + dom->dom_rtattach((void **)rnh, dom->dom_rtoffset); } } } @@ -233,20 +237,19 @@ vnet_route_uninit(const void *unused __u struct radix_node_head **rnh; for (dom = domains; dom; dom = dom->dom_next) { - if (dom->dom_rtdetach) { - for (table = 0; table < rt_numfibs; table++) { - if ( (fam = dom->dom_family) == AF_INET || - table == 0) { - /* For now only AF_INET has > 1 tbl. */ - rnh = rt_tables_get_rnh_ptr(table, fam); - if (rnh == NULL) - panic("%s: rnh NULL", __func__); - dom->dom_rtdetach((void **)rnh, - dom->dom_rtoffset); - } else { - break; - } - } + if (dom->dom_rtdetach == NULL) + continue; + + for (table = 0; table < rt_numfibs; table++) { + fam = dom->dom_family; + + if (table != 0 && fam != AF_INET6 && fam != AF_INET) + break; + + rnh = rt_tables_get_rnh_ptr(table, fam); + if (rnh == NULL) + panic("%s: rnh NULL", __func__); + dom->dom_rtdetach((void **)rnh, dom->dom_rtoffset); } } } @@ -274,7 +277,8 @@ sys_setfib(struct thread *td, struct set void rtalloc(struct route *ro) { - rtalloc_ign_fib(ro, 0UL, 0); + + rtalloc_ign_fib(ro, 0UL, RT_DEFAULT_FIB); } void @@ -294,7 +298,7 @@ rtalloc_ign(struct route *ro, u_long ign RTFREE(rt); ro->ro_rt = NULL; } - ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, ignore, 0); + ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, ignore, RT_DEFAULT_FIB); if (ro->ro_rt) RT_UNLOCK(ro->ro_rt); } @@ -324,7 +328,8 @@ rtalloc_ign_fib(struct route *ro, u_long struct rtentry * rtalloc1(struct sockaddr *dst, int report, u_long ignflags) { - return (rtalloc1_fib(dst, report, ignflags, 0)); + + return (rtalloc1_fib(dst, report, ignflags, RT_DEFAULT_FIB)); } struct rtentry * @@ -339,8 +344,15 @@ rtalloc1_fib(struct sockaddr *dst, int r int needlock; KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); - if (dst->sa_family != AF_INET) /* Only INET supports > 1 fib now */ - fibnum = 0; + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We support multiple FIBs. */ + break; + default: + fibnum = RT_DEFAULT_FIB; + break; + } rnh = rt_tables_get_rnh(fibnum, dst->sa_family); newrt = NULL; if (rnh == NULL) @@ -486,7 +498,8 @@ rtredirect(struct sockaddr *dst, int flags, struct sockaddr *src) { - rtredirect_fib(dst, gateway, netmask, flags, src, 0); + + rtredirect_fib(dst, gateway, netmask, flags, src, RT_DEFAULT_FIB); } void @@ -617,7 +630,8 @@ out: int rtioctl(u_long req, caddr_t data) { - return (rtioctl_fib(req, data, 0)); + + return (rtioctl_fib(req, data, RT_DEFAULT_FIB)); } /* @@ -647,7 +661,8 @@ rtioctl_fib(u_long req, caddr_t data, u_ struct ifaddr * ifa_ifwithroute(int flags, struct sockaddr *dst, struct sockaddr *gateway) { - return (ifa_ifwithroute_fib(flags, dst, gateway, 0)); + + return (ifa_ifwithroute_fib(flags, dst, gateway, RT_DEFAULT_FIB)); } struct ifaddr * @@ -732,7 +747,9 @@ rtrequest(int req, int flags, struct rtentry **ret_nrt) { - return (rtrequest_fib(req, dst, gateway, netmask, flags, ret_nrt, 0)); + + return (rtrequest_fib(req, dst, gateway, netmask, flags, ret_nrt, + RT_DEFAULT_FIB)); } int @@ -771,7 +788,8 @@ rtrequest_fib(int req, int rt_getifa(struct rt_addrinfo *info) { - return (rt_getifa_fib(info, 0)); + + return (rt_getifa_fib(info, RT_DEFAULT_FIB)); } /* @@ -1029,8 +1047,16 @@ rtrequest1_fib(int req, struct rt_addrin #define senderr(x) { error = x ; goto bad; } KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); - if (dst->sa_family != AF_INET) /* Only INET supports > 1 fib now */ - fibnum = 0; + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We support multiple FIBs. */ + break; + default: + fibnum = RT_DEFAULT_FIB; + break; + } + /* * Find the correct routing tree to use for this Address Family */ @@ -1136,8 +1162,7 @@ rtrequest1_fib(int req, struct rt_addrin rt->rt_flags = RTF_UP | flags; rt->rt_fibnum = fibnum; /* - * Add the gateway. Possibly re-malloc-ing the storage for it - * + * Add the gateway. Possibly re-malloc-ing the storage for it. */ RT_LOCK(rt); if ((error = rt_setgate(rt, dst, gateway)) != 0) { @@ -1186,12 +1211,15 @@ rtrequest1_fib(int req, struct rt_addrin #ifdef FLOWTABLE rt0 = NULL; - /* XXX - * "flow-table" only support IPv4 at the moment. - * XXX-BZ as of r205066 it would support IPv6. - */ + /* "flow-table" only supports IPv6 and IPv4 at the moment. */ + switch (dst->sa_family) { +#ifdef INET6 + case AF_INET6: +#endif #ifdef INET - if (dst->sa_family == AF_INET) { + case AF_INET: +#endif +#if defined(INET6) || defined(INET) rn = rnh->rnh_matchaddr(dst, rnh); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { struct sockaddr *mask; @@ -1230,9 +1258,9 @@ rtrequest1_fib(int req, struct rt_addrin } } } +#endif/* INET6 || INET */ } -#endif -#endif +#endif /* FLOWTABLE */ /* XXX mtu manipulation will be done in rnh_addaddr -- itojun */ rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes); @@ -1254,9 +1282,18 @@ rtrequest1_fib(int req, struct rt_addrin } #ifdef FLOWTABLE else if (rt0 != NULL) { + switch (dst->sa_family) { +#ifdef INET6 + case AF_INET6: + flowtable_route_flush(V_ip6_ft, rt0); + break; +#endif #ifdef INET - flowtable_route_flush(V_ip_ft, rt0); + case AF_INET: + flowtable_route_flush(V_ip_ft, rt0); + break; #endif + } RTFREE(rt0); } #endif @@ -1388,8 +1425,17 @@ rtinit1(struct ifaddr *ifa, int cmd, int dst = ifa->ifa_addr; netmask = ifa->ifa_netmask; } - if ( dst->sa_family != AF_INET) - fibnum = 0; + if (dst->sa_len == 0) + return(EINVAL); + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We support multiple FIBs. */ + break; + default: + fibnum = RT_DEFAULT_FIB; + break; + } if (fibnum == -1) { if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { startfib = endfib = curthread->td_proc->p_fibnum; @@ -1402,8 +1448,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int startfib = fibnum; endfib = fibnum; } - if (dst->sa_len == 0) - return(EINVAL); /* * If it's a delete, check that if it exists, @@ -1427,9 +1471,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int * Now go through all the requested tables (fibs) and do the * requested action. Realistically, this will either be fib 0 * for protocols that don't do multiple tables or all the - * tables for those that do. XXX For this version only AF_INET. - * When that changes code should be refactored to protocol - * independent parts and protocol dependent parts. + * tables for those that do. */ for ( fibnum = startfib; fibnum <= endfib; fibnum++) { if (cmd == RTM_DELETE) { @@ -1569,12 +1611,14 @@ rtinit1(struct ifaddr *ifa, int cmd, int return (error); } +#ifndef BURN_BRIDGES /* special one for inet internal use. may not use. */ int rtinit_fib(struct ifaddr *ifa, int cmd, int flags) { return (rtinit1(ifa, cmd, flags, -1)); } +#endif /* * Set up a routing table entry, normally @@ -1584,7 +1628,7 @@ int rtinit(struct ifaddr *ifa, int cmd, int flags) { struct sockaddr *dst; - int fib = 0; + int fib = RT_DEFAULT_FIB; if (flags & RTF_HOST) { dst = ifa->ifa_dstaddr; @@ -1592,7 +1636,12 @@ rtinit(struct ifaddr *ifa, int cmd, int dst = ifa->ifa_addr; } - if (dst->sa_family == AF_INET) + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We do support multiple FIBs. */ fib = -1; + break; + } return (rtinit1(ifa, cmd, flags, fib)); } Modified: stable/9/sys/net/route.h ============================================================================== --- stable/9/sys/net/route.h Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/net/route.h Wed Feb 29 09:47:26 2012 (r232292) @@ -111,6 +111,7 @@ struct rt_metrics { #endif #endif +#define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ extern u_int rt_numfibs; /* number fo usable routing tables */ /* * XXX kernel function pointer `rt_output' is visible to applications. @@ -405,8 +406,10 @@ void rtredirect(struct sockaddr *, stru int rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **); +#ifndef BURN_BRIDGES /* defaults to "all" FIBs */ int rtinit_fib(struct ifaddr *, int, int); +#endif /* XXX MRT NEW VERSIONS THAT USE FIBs * For now the protocol indepedent versions are the same as the AF_INET ones Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/netinet/in.c Wed Feb 29 09:47:26 2012 (r232292) @@ -938,7 +938,7 @@ in_ifinit(struct ifnet *ifp, struct in_i bzero(&ia_ro, sizeof(ia_ro)); *((struct sockaddr_in *)(&ia_ro.ro_dst)) = ia->ia_addr; - rtalloc_ign_fib(&ia_ro, 0, 0); + rtalloc_ign_fib(&ia_ro, 0, RT_DEFAULT_FIB); if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && (ia_ro.ro_rt->rt_ifp == V_loif)) { RT_LOCK(ia_ro.ro_rt); Modified: stable/9/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw2.c Wed Feb 29 07:33:07 2012 (r232291) +++ stable/9/sys/netinet/ipfw/ip_fw2.c Wed Feb 29 09:47:26 2012 (r232292) @@ -496,7 +496,7 @@ search_ip6_addr_net (struct in6_addr * i } static int -verify_path6(struct in6_addr *src, struct ifnet *ifp) +verify_path6(struct in6_addr *src, struct ifnet *ifp, u_int fib) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 29 12:13:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA0A91065673; Wed, 29 Feb 2012 12:13:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BF398FC15; Wed, 29 Feb 2012 12:13: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 q1TCD5SV026245; Wed, 29 Feb 2012 12:13:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1TCD5Xh026244; Wed, 29 Feb 2012 12:13:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202291213.q1TCD5Xh026244@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 29 Feb 2012 12:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232294 - stable/9/sys X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 12:13:05 -0000 Author: bz Date: Wed Feb 29 12:13:05 2012 New Revision: 232294 URL: http://svn.freebsd.org/changeset/base/232294 Log: Record MFC of r230981 (by hrs) done with r232292: Fix input validation in SO_SETFIB. Modified: Directory Properties: stable/9/sys/ (props changed) From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 29 18:42:00 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B0EC1065672; Wed, 29 Feb 2012 18:42:00 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 099448FC1A; Wed, 29 Feb 2012 18:42:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1TIfxMX039724; Wed, 29 Feb 2012 18:41:59 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1TIfx1r039722; Wed, 29 Feb 2012 18:41:59 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201202291841.q1TIfx1r039722@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 29 Feb 2012 18:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232310 - stable/9/sys/dev/xen/blkback X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 18:42:00 -0000 Author: gibbs Date: Wed Feb 29 18:41:59 2012 New Revision: 232310 URL: http://svn.freebsd.org/changeset/base/232310 Log: MFC r231883 =========== Fix regression in the handling of blkback close events for devices that are unplugged via QEMU. sys/dev/xen/blkback/blkback.c: Toolstack initiated closures change the frontend's state to Closing. The backend must change to Closing as well, even if we can't actually close yet, in order for the frontend to notice and start the closing process. Modified: stable/9/sys/dev/xen/blkback/blkback.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/xen/blkback/blkback.c ============================================================================== --- stable/9/sys/dev/xen/blkback/blkback.c Wed Feb 29 18:11:33 2012 (r232309) +++ stable/9/sys/dev/xen/blkback/blkback.c Wed Feb 29 18:41:59 2012 (r232310) @@ -3955,16 +3955,12 @@ xbb_frontend_changed(device_t dev, Xenbu xbb_connect(xbb); break; case XenbusStateClosing: - /* - * Frontend has acknowledged Closing request. - * Wait for Closed state. - */ - break; case XenbusStateClosed: mtx_lock(&xbb->lock); xbb_shutdown(xbb); mtx_unlock(&xbb->lock); - xenbus_set_state(xbb->dev, XenbusStateClosed); + if (frontend_state == XenbusStateClosed) + xenbus_set_state(xbb->dev, XenbusStateClosed); break; default: xenbus_dev_fatal(xbb->dev, EINVAL, "saw state %d at frontend", From owner-svn-src-stable-9@FreeBSD.ORG Thu Mar 1 00:22:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ACB6A106566C; Thu, 1 Mar 2012 00:22:52 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B48C8FC19; Thu, 1 Mar 2012 00:22: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 q210MqeL051820; Thu, 1 Mar 2012 00:22:52 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q210Mqb4051818; Thu, 1 Mar 2012 00:22:52 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201203010022.q210Mqb4051818@svn.freebsd.org> From: Justin Hibbits Date: Thu, 1 Mar 2012 00:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232324 - stable/9/sys/modules/scc X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 00:22:52 -0000 Author: jhibbits Date: Thu Mar 1 00:22:52 2012 New Revision: 232324 URL: http://svn.freebsd.org/changeset/base/232324 Log: MFC r232176: Fix the scc(4) module build. Without the file it's missing a required symbol. Approved by: nwhitehorn (mentor) Modified: stable/9/sys/modules/scc/Makefile Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/modules/scc/Makefile ============================================================================== --- stable/9/sys/modules/scc/Makefile Wed Feb 29 23:06:48 2012 (r232323) +++ stable/9/sys/modules/scc/Makefile Thu Mar 1 00:22:52 2012 (r232324) @@ -6,7 +6,7 @@ scc_bfe= scc_bfe_ebus.c scc_bfe_sbus.c .endif .if ${MACHINE_CPUARCH} == "powerpc" -scc_bfe= scc_bfe_macio.c scc_bfe_quicc.c +scc_bfe= scc_bfe_macio.c scc_bfe_quicc.c scc_dev_quicc.c .endif KMOD= scc From owner-svn-src-stable-9@FreeBSD.ORG Thu Mar 1 08:23:00 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AB961065688; Thu, 1 Mar 2012 08:23:00 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D82F8FC14; Thu, 1 Mar 2012 08:23:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q218Mxaa068132; Thu, 1 Mar 2012 08:22:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q218MxMt068129; Thu, 1 Mar 2012 08:22:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201203010822.q218MxMt068129@svn.freebsd.org> From: Martin Matuska Date: Thu, 1 Mar 2012 08:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232328 - stable/9/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 08:23:00 -0000 Author: mm Date: Thu Mar 1 08:22:59 2012 New Revision: 232328 URL: http://svn.freebsd.org/changeset/base/232328 Log: MFC r232064: Import illumos changeset 13608 [1]: add support for "-t " argument to zfs get References: https://www.illumos.org/issues/1936 Update zfs(8) manpage in respect of [1]. Fix typo in zfs(8) manpage. Obtained from: illumos (issue #1936) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 1 03:53:07 2012 (r232327) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 1 08:22:59 2012 (r232328) @@ -1,5 +1,5 @@ '\" te -.\" Copyright (c) 2011, Martin Matuska . +.\" Copyright (c) 2012, Martin Matuska . .\" All Rights Reserved. .\" .\" The contents of this file are subject to the terms of the @@ -18,8 +18,8 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright 2011 Nexenta Systems, Inc. All rights reserved. .\" Copyright (c) 2011 by Delphix. All rights reserved. +.\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" .\" $FreeBSD$ @@ -113,6 +113,7 @@ .Op Fl r Ns | Ns Fl d Ar depth .Op Fl Hp .Op Fl o Ar all | field Ns Op , Ns Ar ... +.Op Fl t Ar type Ns Op , Ns Ar ... .Op Fl s Ar source Ns Op , Ns Ar ... .Ar all | property Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot @@ -1753,7 +1754,7 @@ A comma-separated list of types to displ is one of .Sy filesystem , snapshot , volume , No or Sy all . For example, specifying -.Fl o Cm snapshot +.Fl t Cm snapshot displays only snapshots. .It Fl s Ar property A property for sorting the output by column in ascending order based on the @@ -1811,6 +1812,7 @@ section. .Op Fl r Ns | Ns Fl d Ar depth .Op Fl Hp .Op Fl o Ar all | field Ns Op , Ns Ar ... +.Op Fl t Ar type Ns Op , Ns Ar ... .Op Fl s Ar source Ns Op , Ns Ar ... .Ar all | property Ns Op , Ns Ar ... .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot @@ -1871,6 +1873,14 @@ Default values are The keyword .Cm all specifies all columns. +.It Fl t Ar type Ns Op , Ns Ar ... +A comma-separated list of types to display, where +.Ar type +is one of +.Sy filesystem , snapshot , volume , No or Sy all . +For example, specifying +.Fl t Cm snapshot +displays only snapshots. .It Fl s Ar source Ns Op , Ns Ar ... A comma-separated list of sources to display. Those properties coming from a source other than those in this list are ignored. Each source must be one of Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Mar 1 03:53:07 2012 (r232327) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Mar 1 08:22:59 2012 (r232328) @@ -227,7 +227,8 @@ get_usage(zfs_help_t idx) "[%][,...]\n")); case HELP_GET: return (gettext("\tget [-rHp] [-d max] " - "[-o \"all\" | field[,...]] [-s source[,...]]\n" + "[-o \"all\" | field[,...]] [-t type[,...]] " + "[-s source[,...]]\n" "\t <\"all\" | property[,...]> " "[filesystem|volume|snapshot] ...\n")); case HELP_INHERIT: @@ -1473,6 +1474,7 @@ zfs_do_get(int argc, char **argv) { zprop_get_cbdata_t cb = { 0 }; int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; + int types = ZFS_TYPE_DATASET; char *value, *fields; int ret = 0; int limit = 0; @@ -1489,7 +1491,7 @@ zfs_do_get(int argc, char **argv) cb.cb_type = ZFS_TYPE_DATASET; /* check options */ - while ((c = getopt(argc, argv, ":d:o:s:rHp")) != -1) { + while ((c = getopt(argc, argv, ":d:o:s:rt:Hp")) != -1) { switch (c) { case 'p': cb.cb_literal = B_TRUE; @@ -1607,6 +1609,37 @@ zfs_do_get(int argc, char **argv) } break; + case 't': + types = 0; + flags &= ~ZFS_ITER_PROP_LISTSNAPS; + while (*optarg != '\0') { + static char *type_subopts[] = { "filesystem", + "volume", "snapshot", "all", NULL }; + + switch (getsubopt(&optarg, type_subopts, + &value)) { + case 0: + types |= ZFS_TYPE_FILESYSTEM; + break; + case 1: + types |= ZFS_TYPE_VOLUME; + break; + case 2: + types |= ZFS_TYPE_SNAPSHOT; + break; + case 3: + types = ZFS_TYPE_DATASET; + break; + + default: + (void) fprintf(stderr, + gettext("invalid type '%s'\n"), + value); + usage(B_FALSE); + } + } + break; + case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -1650,7 +1683,7 @@ zfs_do_get(int argc, char **argv) cb.cb_first = B_TRUE; /* run for each object */ - ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_DATASET, NULL, + ret = zfs_for_each(argc, argv, flags, types, NULL, &cb.cb_proplist, limit, get_callback, &cb); if (cb.cb_proplist == &fake_name) From owner-svn-src-stable-9@FreeBSD.ORG Thu Mar 1 13:05:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7109106572F; Thu, 1 Mar 2012 13:05:31 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id CA5708FC12; Thu, 1 Mar 2012 13:05:30 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1S35G9-0008Xf-J1; Thu, 01 Mar 2012 16:37:25 +0400 Date: Thu, 1 Mar 2012 16:37:25 +0400 From: Slawa Olhovchenkov To: Gavin Atkinson Message-ID: <20120301123725.GF97848@zxy.spb.ru> References: <201201171352.q0HDq5n2092953@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201171352.q0HDq5n2092953@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r230266 - in stable/9/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 13:05:34 -0000 On Tue, Jan 17, 2012 at 01:52:05PM +0000, Gavin Atkinson wrote: > Author: gavin > Date: Tue Jan 17 13:52:04 2012 > New Revision: 230266 > URL: http://svn.freebsd.org/changeset/base/230266 > > Log: > Merge r229085 from head: > > Default to not performing the early-boot memory tests when we detect we > are booting inside a VM. There are three reasons to disable this: > > o It causes the VM host to believe that all the tested pages or RAM are > in use. This in turn may force the host to page out pages of RAM > belonging to other VMs, or otherwise cause problems with fair resource > sharing on the VM cluster. > o It adds significant time to the boot process (around 1 second/Gig in > testing) > o It is unnecessary - the host should have already verified that the > memory is functional etc. > > Note that this simply changes the default when in a VM - it can still be > overridden using the hw.memtest.tests tunable. > > Early MFC requested by: bz How about similar behaviour for /boot/loader? From owner-svn-src-stable-9@FreeBSD.ORG Thu Mar 1 15:51:20 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CB121065670; Thu, 1 Mar 2012 15:51:20 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 476798FC16; Thu, 1 Mar 2012 15:51: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 q21FpK5L085481; Thu, 1 Mar 2012 15:51:20 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21FpKd6085479; Thu, 1 Mar 2012 15:51:20 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201203011551.q21FpKd6085479@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 1 Mar 2012 15:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232343 - stable/9/sbin/mount_ntfs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 15:51:20 -0000 Author: jh Date: Thu Mar 1 15:51:19 2012 New Revision: 232343 URL: http://svn.freebsd.org/changeset/base/232343 Log: MFC r230642: Remove trailing whitespace. Modified: stable/9/sbin/mount_ntfs/mount_ntfs.c Directory Properties: stable/9/sbin/mount_ntfs/ (props changed) Modified: stable/9/sbin/mount_ntfs/mount_ntfs.c ============================================================================== --- stable/9/sbin/mount_ntfs/mount_ntfs.c Thu Mar 1 15:09:41 2012 (r232342) +++ stable/9/sbin/mount_ntfs/mount_ntfs.c Thu Mar 1 15:51:19 2012 (r232343) @@ -160,7 +160,7 @@ main(int argc, char *argv[]) } /* - * Resolve the mountpoint with realpath(3) and remove unnecessary + * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ (void)checkpath(dir, mntpath); From owner-svn-src-stable-9@FreeBSD.ORG Thu Mar 1 17:51:16 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7286E106567F; Thu, 1 Mar 2012 17:51:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42ECC8FC29; Thu, 1 Mar 2012 17:51:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q21HpGEZ089493; Thu, 1 Mar 2012 17:51:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21HpGt4089490; Thu, 1 Mar 2012 17:51:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203011751.q21HpGt4089490@svn.freebsd.org> From: Dimitry Andric Date: Thu, 1 Mar 2012 17:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232348 - in stable/9/sys: conf modules/hpt27xx X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 17:51:16 -0000 Author: dim Date: Thu Mar 1 17:51:15 2012 New Revision: 232348 URL: http://svn.freebsd.org/changeset/base/232348 Log: MFC r231982: When building with clang, disable -Wformat-security for sys/dev/hpt27xx/osm_bsd.c, since it gets the following warnings: sys/dev/hpt27xx/osm_bsd.c:1180:25: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] S_IRUSR | S_IWUSR, driver_name); ^~~~~~~~~~~ @/dev/hpt27xx/hpt27xx_config.h:46:21: note: expanded from: #define driver_name hpt27xx_driver_name ^~~~~~~~~~~~~~~~~~~ Since 'hpt27xx_driver_name' is a constant string symbol (coming from the proprietary hpt27xx_lib.o file), there is no security problem. Because this driver is provided by the vendor, and applying changes requires re-certification and other bureaucratic exercises, just disable the warning for now. Modified: stable/9/sys/conf/kern.mk stable/9/sys/modules/hpt27xx/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/kern.mk ============================================================================== --- stable/9/sys/conf/kern.mk Thu Mar 1 17:35:16 2012 (r232347) +++ stable/9/sys/conf/kern.mk Thu Mar 1 17:51:15 2012 (r232348) @@ -22,6 +22,7 @@ NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-cou NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow NO_WUNUSED_VALUE= -Wno-unused-value NO_WSELF_ASSIGN= -Wno-self-assign +NO_WFORMAT_SECURITY= -Wno-format-security # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. Modified: stable/9/sys/modules/hpt27xx/Makefile ============================================================================== --- stable/9/sys/modules/hpt27xx/Makefile Thu Mar 1 17:35:16 2012 (r232347) +++ stable/9/sys/modules/hpt27xx/Makefile Thu Mar 1 17:51:15 2012 (r232348) @@ -12,3 +12,6 @@ hpt27xx_lib.o: uudecode -p < ${HPT27XX}/$(MACHINE_ARCH)-elf.hpt27xx_lib.o.uu > ${.TARGET} .include + +CWARNFLAGS.osm_bsd.c= ${NO_WFORMAT_SECURITY} +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-stable-9@FreeBSD.ORG Thu Mar 1 17:54:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CA78106566B; Thu, 1 Mar 2012 17:54:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07FD58FC08; Thu, 1 Mar 2012 17:54:08 +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 q21Hs7bl089628; Thu, 1 Mar 2012 17:54:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21Hs7XX089626; Thu, 1 Mar 2012 17:54:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203011754.q21Hs7XX089626@svn.freebsd.org> From: Dimitry Andric Date: Thu, 1 Mar 2012 17:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232349 - stable/9/sys/cam/ctl X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 17:54:08 -0000 Author: dim Date: Thu Mar 1 17:54:07 2012 New Revision: 232349 URL: http://svn.freebsd.org/changeset/base/232349 Log: MFC r232074: Use a better way to silence unneeded internal declaration warnings in several sys/cam/ctl files. Suggested by: ed Reviewed by: ken Modified: stable/9/sys/cam/ctl/ctl_private.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/9/sys/cam/ctl/ctl_private.h Thu Mar 1 17:51:15 2012 (r232348) +++ stable/9/sys/cam/ctl/ctl_private.h Thu Mar 1 17:54:07 2012 (r232349) @@ -297,7 +297,7 @@ struct ctl_page_index { #define CTL_PAGE_DEFAULT 0x02 #define CTL_PAGE_SAVED 0x03 -static struct ctl_page_index page_index_template[] = { +static const struct ctl_page_index page_index_template[] = { {SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL, CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, {SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL, From owner-svn-src-stable-9@FreeBSD.ORG Thu Mar 1 22:32:31 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F06B61065672; Thu, 1 Mar 2012 22:32:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF8D18FC17; Thu, 1 Mar 2012 22:32:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q21MWUms000504; Thu, 1 Mar 2012 22:32:30 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21MWUbp000502; Thu, 1 Mar 2012 22:32:30 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201203012232.q21MWUbp000502@svn.freebsd.org> From: Sean Bruno Date: Thu, 1 Mar 2012 22:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232368 - stable/9/sys/dev/isci X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 22:32:31 -0000 Author: sbruno Date: Thu Mar 1 22:32:30 2012 New Revision: 232368 URL: http://svn.freebsd.org/changeset/base/232368 Log: MFC r232225 Update PCI-IDs with devices found on Intel SDP Return BUS_PROBE_DEFAULT so that non-default drivers may be loaded Modified: stable/9/sys/dev/isci/isci.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/isci/isci.c ============================================================================== --- stable/9/sys/dev/isci/isci.c Thu Mar 1 22:13:10 2012 (r232367) +++ stable/9/sys/dev/isci/isci.c Thu Mar 1 22:32:30 2012 (r232368) @@ -98,7 +98,11 @@ static struct _pcsid { 0x1d688086, "Intel(R) C600 Series Chipset SAS Controller" }, { 0x1d698086, "Intel(R) C600 Series Chipset SAS Controller" }, { 0x1d6a8086, "Intel(R) C600 Series Chipset SAS Controller (SATA mode)" }, - { 0x1d6b8086, "Intel(R) C600 Series Chipset SAS Controller (SATA mode)" }, + { 0x1d6b8086, "Intel(R) C600 Series Chipset SAS Controller (SATA mode)" }, + { 0x1d6c8086, "Intel(R) C600 Series Chipset SAS Controller" }, + { 0x1d6d8086, "Intel(R) C600 Series Chipset SAS Controller" }, + { 0x1d6e8086, "Intel(R) C600 Series Chipset SAS Controller" }, + { 0x1d6f8086, "Intel(R) C600 Series Chipset SAS Controller (SATA mode)" }, { 0x00000000, NULL } }; @@ -114,7 +118,7 @@ isci_probe (device_t device) if (ep->desc) { device_set_desc(device, ep->desc); - return (0); + return (BUS_PROBE_DEFAULT); } else return (ENXIO); From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 00:21:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 989BA106566C; Fri, 2 Mar 2012 00:21:08 +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 875C48FC1B; Fri, 2 Mar 2012 00:21:08 +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 q220L87G004557; Fri, 2 Mar 2012 00:21:08 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q220L801004555; Fri, 2 Mar 2012 00:21:08 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203020021.q220L801004555@svn.freebsd.org> From: Ed Maste Date: Fri, 2 Mar 2012 00:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232372 - stable/9/sys/x86/x86 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 00:21:08 -0000 Author: emaste Date: Fri Mar 2 00:21:07 2012 New Revision: 232372 URL: http://svn.freebsd.org/changeset/base/232372 Log: MFC r232267: Workaround for PCIe 4GB boundary issue Enforce a boundary of no more than 4GB - transfers crossing a 4GB boundary can lead to data corruption due to PCIe limitations. This change is a less-intrusive workaround that can be quickly merged back to older branches; a cleaner implementation will arrive in HEAD later but may require KPI changes. This change is based on a suggestion by jhb@. Sponsored by: Sandvine Incorporated Modified: stable/9/sys/x86/x86/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/x86/x86/busdma_machdep.c ============================================================================== --- stable/9/sys/x86/x86/busdma_machdep.c Fri Mar 2 00:15:52 2012 (r232371) +++ stable/9/sys/x86/x86/busdma_machdep.c Fri Mar 2 00:21:07 2012 (r232372) @@ -227,6 +227,14 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_dma_tag_t newtag; int error = 0; + /* Always enforce at least a 4GB (2GB for PAE) boundary. */ +#if defined(__amd64__) + if (boundary == 0 || boundary > ((bus_addr_t)1 << 32)) + boundary = (bus_size_t)1 << 32; +#elif defined(PAE) + if (boundary == 0 || boundary > ((bus_addr_t)1 << 31)) + boundary = (bus_size_t)1 << 31; +#endif /* Basic sanity checking */ if (boundary != 0 && boundary < maxsegsz) maxsegsz = boundary; From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 11:32:48 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E8DF1065672; Fri, 2 Mar 2012 11:32:48 +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 072008FC14; Fri, 2 Mar 2012 11:32: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 q22BWlgb028104; Fri, 2 Mar 2012 11:32:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22BWl86028098; Fri, 2 Mar 2012 11:32:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203021132.q22BWl86028098@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 2 Mar 2012 11:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232387 - in stable/9/sys: compat/linux compat/svr4 i386/ibcs2 i386/linux kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 11:32:48 -0000 Author: kib Date: Fri Mar 2 11:32:47 2012 New Revision: 232387 URL: http://svn.freebsd.org/changeset/base/232387 Log: MFC r231885: Fix misuse of the kernel map in miscellaneous image activators. Vnode-backed mappings cannot be put into the kernel map, since it is a system map. Modified: stable/9/sys/compat/linux/linux_misc.c stable/9/sys/compat/svr4/imgact_svr4.c stable/9/sys/i386/ibcs2/imgact_coff.c stable/9/sys/i386/linux/imgact_linux.c stable/9/sys/kern/imgact_gzip.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_misc.c ============================================================================== --- stable/9/sys/compat/linux/linux_misc.c Fri Mar 2 11:27:07 2012 (r232386) +++ stable/9/sys/compat/linux/linux_misc.c Fri Mar 2 11:32:47 2012 (r232387) @@ -229,9 +229,9 @@ linux_uselib(struct thread *td, struct l struct vattr attr; vm_offset_t vmaddr; unsigned long file_offset; - vm_offset_t buffer; unsigned long bss_size; char *library; + ssize_t aresid; int error; int locked, vfslocked; @@ -308,8 +308,8 @@ linux_uselib(struct thread *td, struct l if (error) goto cleanup; - /* Pull in executable header into kernel_map */ - error = vm_mmap(kernel_map, (vm_offset_t *)&a_out, PAGE_SIZE, + /* Pull in executable header into exec_map */ + error = vm_mmap(exec_map, (vm_offset_t *)&a_out, PAGE_SIZE, VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp, 0); if (error) goto cleanup; @@ -402,24 +402,15 @@ linux_uselib(struct thread *td, struct l if (error) goto cleanup; - /* map file into kernel_map */ - error = vm_mmap(kernel_map, &buffer, - round_page(a_out->a_text + a_out->a_data + file_offset), - VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp, - trunc_page(file_offset)); - if (error) + error = vn_rdwr(UIO_READ, vp, (void *)vmaddr, file_offset, + a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, + td->td_ucred, NOCRED, &aresid, td); + if (error != 0) goto cleanup; - - /* copy from kernel VM space to user space */ - error = copyout(PTRIN(buffer + file_offset), - (void *)vmaddr, a_out->a_text + a_out->a_data); - - /* release temporary kernel space */ - vm_map_remove(kernel_map, buffer, buffer + - round_page(a_out->a_text + a_out->a_data + file_offset)); - - if (error) + if (aresid != 0) { + error = ENOEXEC; goto cleanup; + } } else { #ifdef DEBUG printf("uselib: Page aligned binary %lu\n", file_offset); @@ -463,10 +454,9 @@ cleanup: VFS_UNLOCK_GIANT(vfslocked); } - /* Release the kernel mapping. */ + /* Release the temporary mapping. */ if (a_out) - vm_map_remove(kernel_map, (vm_offset_t)a_out, - (vm_offset_t)a_out + PAGE_SIZE); + kmem_free_wakeup(exec_map, (vm_offset_t)a_out, PAGE_SIZE); return (error); } Modified: stable/9/sys/compat/svr4/imgact_svr4.c ============================================================================== --- stable/9/sys/compat/svr4/imgact_svr4.c Fri Mar 2 11:27:07 2012 (r232386) +++ stable/9/sys/compat/svr4/imgact_svr4.c Fri Mar 2 11:32:47 2012 (r232387) @@ -66,8 +66,8 @@ exec_svr4_imgact(imgp) struct vmspace *vmspace; vm_offset_t vmaddr; unsigned long virtual_offset, file_offset; - vm_offset_t buffer; unsigned long bss_size; + ssize_t aresid; int error; if (((a_out->a_magic >> 16) & 0xff) != 0x64) @@ -145,21 +145,15 @@ exec_svr4_imgact(imgp) if (error) goto fail; - error = vm_mmap(kernel_map, &buffer, - round_page(a_out->a_text + a_out->a_data + file_offset), - VM_PROT_READ, VM_PROT_READ, 0, - OBJT_VNODE, imgp->vp, trunc_page(file_offset)); - if (error) - goto fail; - - error = copyout((caddr_t)(buffer + file_offset), (caddr_t)vmaddr, - a_out->a_text + a_out->a_data); - - vm_map_remove(kernel_map, buffer, - buffer + round_page(a_out->a_text + a_out->a_data + file_offset)); - - if (error) - goto fail; + error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset, + a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, + curthread->td_ucred, NOCRED, &aresid, curthread); + if (error != 0) + goto fail; + if (aresid != 0) { + error = ENOEXEC; + goto fail; + } /* * remove write enable on the 'text' part Modified: stable/9/sys/i386/ibcs2/imgact_coff.c ============================================================================== --- stable/9/sys/i386/ibcs2/imgact_coff.c Fri Mar 2 11:27:07 2012 (r232386) +++ stable/9/sys/i386/ibcs2/imgact_coff.c Fri Mar 2 11:32:47 2012 (r232387) @@ -146,10 +146,7 @@ load_coff_section(struct vmspace *vmspac error = copyout(data_buf, (caddr_t) map_addr, copy_len); - if (vm_map_remove(exec_map, - (vm_offset_t) data_buf, - (vm_offset_t) data_buf + PAGE_SIZE)) - panic("load_coff_section vm_map_remove failed"); + kmem_free_wakeup(exec_map, (vm_offset_t)data_buf, PAGE_SIZE); return error; } @@ -280,11 +277,7 @@ coff_load_file(struct thread *td, char * error = 0; dealloc_and_fail: - if (vm_map_remove(exec_map, - (vm_offset_t) ptr, - (vm_offset_t) ptr + PAGE_SIZE)) - panic("%s vm_map_remove failed", __func__); - + kmem_free_wakeup(exec_map, (vm_offset_t)ptr, PAGE_SIZE); fail: VOP_UNLOCK(vp, 0); unlocked_fail: @@ -421,10 +414,7 @@ exec_coff_imgact(imgp) } free(libbuf, M_TEMP); } - if (vm_map_remove(exec_map, - (vm_offset_t) buf, - (vm_offset_t) buf + len)) - panic("exec_coff_imgact vm_map_remove failed"); + kmem_free_wakeup(exec_map, (vm_offset_t)buf, len); if (error) goto fail; } Modified: stable/9/sys/i386/linux/imgact_linux.c ============================================================================== --- stable/9/sys/i386/linux/imgact_linux.c Fri Mar 2 11:27:07 2012 (r232386) +++ stable/9/sys/i386/linux/imgact_linux.c Fri Mar 2 11:32:47 2012 (r232387) @@ -64,8 +64,8 @@ exec_linux_imgact(struct image_params *i struct vmspace *vmspace; vm_offset_t vmaddr; unsigned long virtual_offset, file_offset; - vm_offset_t buffer; unsigned long bss_size; + ssize_t aresid; int error; if (((a_out->a_magic >> 16) & 0xff) != 0x64) @@ -144,21 +144,15 @@ exec_linux_imgact(struct image_params *i if (error) goto fail; - error = vm_mmap(kernel_map, &buffer, - round_page(a_out->a_text + a_out->a_data + file_offset), - VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, - imgp->vp, trunc_page(file_offset)); - if (error) - goto fail; - - error = copyout((void *)(uintptr_t)(buffer + file_offset), - (void *)vmaddr, a_out->a_text + a_out->a_data); - - vm_map_remove(kernel_map, buffer, - buffer + round_page(a_out->a_text + a_out->a_data + file_offset)); - - if (error) - goto fail; + error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset, + a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, + curthread->td_ucred, NOCRED, &aresid, curthread); + if (error != 0) + goto fail; + if (aresid != 0) { + error = ENOEXEC; + goto fail; + } /* * remove write enable on the 'text' part Modified: stable/9/sys/kern/imgact_gzip.c ============================================================================== --- stable/9/sys/kern/imgact_gzip.c Fri Mar 2 11:27:07 2012 (r232386) +++ stable/9/sys/kern/imgact_gzip.c Fri Mar 2 11:32:47 2012 (r232387) @@ -70,7 +70,7 @@ static int exec_gzip_imgact(imgp) struct image_params *imgp; { - int error, error2 = 0; + int error; const u_char *p = (const u_char *) imgp->image_header; struct imgact_gzip igz; struct inflate infl; @@ -136,22 +136,17 @@ exec_gzip_imgact(imgp) VM_PROT_READ|VM_PROT_EXECUTE,0); } - if (igz.inbuf) { - error2 = - vm_map_remove(kernel_map, (vm_offset_t) igz.inbuf, - (vm_offset_t) igz.inbuf + PAGE_SIZE); - } - if (igz.error || error || error2) { + if (igz.inbuf) + kmem_free_wakeup(exec_map, (vm_offset_t)igz.inbuf, PAGE_SIZE); + if (igz.error || error) { printf("Output=%lu ", igz.output); - printf("Inflate_error=%d igz.error=%d error2=%d where=%d\n", - error, igz.error, error2, igz.where); + printf("Inflate_error=%d igz.error=%d where=%d\n", + error, igz.error, igz.where); } if (igz.error) return igz.error; if (error) return ENOEXEC; - if (error2) - return error2; return 0; } @@ -314,18 +309,11 @@ NextByte(void *vp) if (igz->inbuf && igz->idx < (igz->offset + PAGE_SIZE)) { return igz->inbuf[(igz->idx++) - igz->offset]; } - if (igz->inbuf) { - error = vm_map_remove(kernel_map, (vm_offset_t) igz->inbuf, - (vm_offset_t) igz->inbuf + PAGE_SIZE); - if (error) { - igz->where = __LINE__; - igz->error = error; - return GZ_EOF; - } - } + if (igz->inbuf) + kmem_free_wakeup(exec_map, (vm_offset_t)igz->inbuf, PAGE_SIZE); igz->offset = igz->idx & ~PAGE_MASK; - error = vm_mmap(kernel_map, /* map */ + error = vm_mmap(exec_map, /* map */ (vm_offset_t *) & igz->inbuf, /* address */ PAGE_SIZE, /* size */ VM_PROT_READ, /* protection */ From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 11:47:35 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6184A106564A; Fri, 2 Mar 2012 11:47:35 +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 4196E8FC18; Fri, 2 Mar 2012 11:47:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q22BlZYH028615; Fri, 2 Mar 2012 11:47:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22BlZ56028611; Fri, 2 Mar 2012 11:47:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203021147.q22BlZ56028611@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 2 Mar 2012 11:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232388 - in stable/9/lib/libc: gen include X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 11:47:35 -0000 Author: kib Date: Fri Mar 2 11:47:34 2012 New Revision: 232388 URL: http://svn.freebsd.org/changeset/base/232388 Log: MFC r231868: Fetch the aux vector for the static libc, and use the entries to initialize the cache of the system information as it was done for the dynamic libc. This removes several sysctls from the static binary startup. Use the aux vector to fill the single struct dl_phdr_info describing the static binary itself, to implement dl_iterate_phdr(3) for the static binaries. Modified: stable/9/lib/libc/gen/aux.c stable/9/lib/libc/gen/dlfcn.c stable/9/lib/libc/include/libc_private.h Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/aux.c ============================================================================== --- stable/9/lib/libc/gen/aux.c Fri Mar 2 11:32:47 2012 (r232387) +++ stable/9/lib/libc/gen/aux.c Fri Mar 2 11:47:34 2012 (r232388) @@ -1,5 +1,5 @@ /*- - * Copyright 2010 Konstantin Belousov . + * Copyright 2010, 2012 Konstantin Belousov . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,10 +36,34 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -Elf_Auxinfo *__elf_aux_vector; +extern char **environ; +extern int _DYNAMIC; +#pragma weak _DYNAMIC -static pthread_once_t aux_once = PTHREAD_ONCE_INIT; +void *__elf_aux_vector; +static pthread_once_t aux_vector_once = PTHREAD_ONCE_INIT; + +static void +init_aux_vector_once(void) +{ + Elf_Addr *sp; + + sp = (Elf_Addr *)environ; + while (*sp++ != 0) + ; + __elf_aux_vector = (Elf_Auxinfo *)sp; +} +void +__init_elf_aux_vector(void) +{ + + if (&_DYNAMIC != NULL) + return; + _once(&aux_vector_once, init_aux_vector_once); +} + +static pthread_once_t aux_once = PTHREAD_ONCE_INIT; static int pagesize, osreldate, canary_len, ncpus, pagesizes_len; static char *canary, *pagesizes; @@ -86,6 +110,7 @@ _elf_aux_info(int aux, void *buf, int bu { int res; + __init_elf_aux_vector(); if (__elf_aux_vector == NULL) return (ENOSYS); _once(&aux_once, init_aux); Modified: stable/9/lib/libc/gen/dlfcn.c ============================================================================== --- stable/9/lib/libc/gen/dlfcn.c Fri Mar 2 11:32:47 2012 (r232387) +++ stable/9/lib/libc/gen/dlfcn.c Fri Mar 2 11:47:34 2012 (r232388) @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" static char sorry[] = "Service unavailable"; @@ -138,13 +142,58 @@ _rtld_thread_init(void * li) _rtld_error(sorry); } +static pthread_once_t dl_phdr_info_once = PTHREAD_ONCE_INIT; +static struct dl_phdr_info phdr_info; + +static void +dl_init_phdr_info(void) +{ + Elf_Auxinfo *auxp; + size_t phent; + unsigned int i; + + phent = 0; + for (auxp = __elf_aux_vector; auxp->a_type != AT_NULL; auxp++) { + switch (auxp->a_type) { + case AT_BASE: + phdr_info.dlpi_addr = (Elf_Addr)auxp->a_un.a_ptr; + break; + case AT_EXECPATH: + phdr_info.dlpi_name = (const char *)auxp->a_un.a_ptr; + break; + case AT_PHDR: + phdr_info.dlpi_phdr = + (const Elf_Phdr *)auxp->a_un.a_ptr; + break; + case AT_PHENT: + phent = auxp->a_un.a_val; + break; + case AT_PHNUM: + phdr_info.dlpi_phnum = (Elf_Half)auxp->a_un.a_val; + break; + } + } + for (i = 0; i < phdr_info.dlpi_phnum; i++) { + if (phdr_info.dlpi_phdr[i].p_type == PT_TLS) { + phdr_info.dlpi_tls_modid = 1; + phdr_info.dlpi_tls_data = + (void*)phdr_info.dlpi_phdr[i].p_vaddr; + } + } + phdr_info.dlpi_adds = 1; +} + #pragma weak dl_iterate_phdr int dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *), void *data) { - _rtld_error(sorry); - return 0; + + __init_elf_aux_vector(); + if (__elf_aux_vector == NULL) + return (1); + _once(&dl_phdr_info_once, dl_init_phdr_info); + return (callback(&phdr_info, sizeof(phdr_info), data)); } #pragma weak fdlopen Modified: stable/9/lib/libc/include/libc_private.h ============================================================================== --- stable/9/lib/libc/include/libc_private.h Fri Mar 2 11:32:47 2012 (r232387) +++ stable/9/lib/libc/include/libc_private.h Fri Mar 2 11:47:34 2012 (r232388) @@ -44,6 +44,15 @@ extern int __isthreaded; /* + * Elf_Auxinfo *__elf_aux_vector, the pointer to the ELF aux vector + * provided by kernel. Either set for us by rtld, or found at runtime + * on stack for static binaries. + * + * Type is void to avoid polluting whole libc with ELF types. + */ +extern void *__elf_aux_vector; + +/* * libc should use libc_dlopen internally, which respects a global * flag where loading of new shared objects can be restricted. */ @@ -229,6 +238,7 @@ int _execvpe(const char *, char * const int _elf_aux_info(int aux, void *buf, int buflen); struct dl_phdr_info; int __elf_phdr_match_addr(struct dl_phdr_info *, void *); +void __init_elf_aux_vector(void); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 11:50:38 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17B25106566B; Fri, 2 Mar 2012 11:50:38 +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 02BDC8FC08; Fri, 2 Mar 2012 11:50:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q22BobT1028756; Fri, 2 Mar 2012 11:50:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22BobPu028754; Fri, 2 Mar 2012 11:50:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203021150.q22BobPu028754@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 2 Mar 2012 11:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232389 - stable/9/lib/libc/gen X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 11:50:38 -0000 Author: kib Date: Fri Mar 2 11:50:37 2012 New Revision: 232389 URL: http://svn.freebsd.org/changeset/base/232389 Log: MFC r231869: Document dl_iterate_phdr(3). MFC r231873: Fix cross-references. Added: stable/9/lib/libc/gen/dl_iterate_phdr.3 - copied, changed from r231869, head/lib/libc/gen/dl_iterate_phdr.3 Modified: Directory Properties: stable/9/lib/libc/ (props changed) Copied and modified: stable/9/lib/libc/gen/dl_iterate_phdr.3 (from r231869, head/lib/libc/gen/dl_iterate_phdr.3) ============================================================================== --- head/lib/libc/gen/dl_iterate_phdr.3 Fri Feb 17 10:51:40 2012 (r231869, copy source) +++ stable/9/lib/libc/gen/dl_iterate_phdr.3 Fri Mar 2 11:50:37 2012 (r232389) @@ -23,7 +23,7 @@ .Nd iterate over program headers .Sh LIBRARY For the dynamically linked binaries, the service is provided by -.Xr ld-elf.so.1 5 +.Xr ld-elf.so.1 1 dynamic linker. Statically linked programs use an implementation of .Fn dl_iterate_phdr @@ -105,7 +105,7 @@ returns the value returned by the last call executed. .Sh SEE ALSO .Xr ld 1 , -.Xr ld-elf.so 1 , +.Xr ld-elf.so.1 1 , .Xr dlopen 3 , .Xr elf 5 .Sh HISTORY From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 21:17:25 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84983106566B; Fri, 2 Mar 2012 21:17:25 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F56F8FC08; Fri, 2 Mar 2012 21:17:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q22LHPP0047626; Fri, 2 Mar 2012 21:17:25 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22LHP87047624; Fri, 2 Mar 2012 21:17:25 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203022117.q22LHP87047624@svn.freebsd.org> From: Ed Schouten Date: Fri, 2 Mar 2012 21:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232404 - stable/9/share/man/man9 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 21:17:25 -0000 Author: ed Date: Fri Mar 2 21:17:24 2012 New Revision: 232404 URL: http://svn.freebsd.org/changeset/base/232404 Log: MFC r231376: Remove outdated piece of information. devtoname() always returns a pathname to the device. It will never return a #major/minor string. Modified: stable/9/share/man/man9/devtoname.9 Directory Properties: stable/9/share/man/ (props changed) stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/devtoname.9 ============================================================================== --- stable/9/share/man/man9/devtoname.9 Fri Mar 2 20:38:04 2012 (r232403) +++ stable/9/share/man/man9/devtoname.9 Fri Mar 2 21:17:24 2012 (r232404) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2012 +.Dd February 10, 2012 .Dt DEVTONAME 9 .Os .Sh NAME @@ -41,15 +41,6 @@ The function returns a pointer to the name of the device passed to it. The name is whatever was set to it in .Fn make_dev . -If no name is associated with -.Va dev , -a pointer to a string consisting of a -.Dq # -followed by -.Dq Va major Ns / Ns Va minor -as it applies to -.Va dev -is returned. .Sh HISTORY The .Fn devtoname From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 21:29:58 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48A631065672; Fri, 2 Mar 2012 21:29:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30D7D8FC13; Fri, 2 Mar 2012 21:29: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 q22LTwxH048065; Fri, 2 Mar 2012 21:29:58 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22LTvMY048053; Fri, 2 Mar 2012 21:29:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203022129.q22LTvMY048053@svn.freebsd.org> From: Ed Schouten Date: Fri, 2 Mar 2012 21:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232405 - in stable/9/sys: compat/linux dev/iscsi/initiator dev/sound/pcm dev/usb netgraph security/mac_biba security/mac_lomac security/mac_mls vm X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 21:29:58 -0000 Author: ed Date: Fri Mar 2 21:29:57 2012 New Revision: 232405 URL: http://svn.freebsd.org/changeset/base/232405 Log: MFC r231378: Remove direct access to si_name. Code should just use the devtoname() function to obtain the name of a character device. Also add const keywords to pieces of code that need it to build properly. Modified: stable/9/sys/compat/linux/linux_stats.c stable/9/sys/compat/linux/linux_util.c stable/9/sys/compat/linux/linux_util.h stable/9/sys/dev/iscsi/initiator/isc_sm.c stable/9/sys/dev/sound/pcm/mixer.c stable/9/sys/dev/usb/usb_dev.c stable/9/sys/netgraph/ng_device.c stable/9/sys/security/mac_biba/mac_biba.c stable/9/sys/security/mac_lomac/mac_lomac.c stable/9/sys/security/mac_mls/mac_mls.c stable/9/sys/vm/swap_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_stats.c ============================================================================== --- stable/9/sys/compat/linux/linux_stats.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/compat/linux/linux_stats.c Fri Mar 2 21:29:57 2012 (r232405) @@ -66,7 +66,7 @@ translate_vnhook_major_minor(struct vnod int major, minor; if (vp->v_type == VCHR && vp->v_rdev != NULL && - linux_driver_get_major_minor(vp->v_rdev->si_name, + linux_driver_get_major_minor(devtoname(vp->v_rdev), &major, &minor) == 0) { sb->st_rdev = (major << 8 | minor); } @@ -149,14 +149,14 @@ translate_fd_major_minor(struct thread * return; vp = fp->f_vnode; if (vp != NULL && vp->v_rdev != NULL && - linux_driver_get_major_minor(vp->v_rdev->si_name, + linux_driver_get_major_minor(devtoname(vp->v_rdev), &major, &minor) == 0) { buf->st_rdev = (major << 8 | minor); } else if (fp->f_type == DTYPE_PTS) { struct tty *tp = fp->f_data; /* Convert the numbers for the slave device. */ - if (linux_driver_get_major_minor(tp->t_dev->si_name, + if (linux_driver_get_major_minor(devtoname(tp->t_dev), &major, &minor) == 0) { buf->st_rdev = (major << 8 | minor); } Modified: stable/9/sys/compat/linux/linux_util.c ============================================================================== --- stable/9/sys/compat/linux/linux_util.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/compat/linux/linux_util.c Fri Mar 2 21:29:57 2012 (r232405) @@ -124,7 +124,7 @@ linux_driver_get_name_dev(device_t dev) } int -linux_driver_get_major_minor(char *node, int *major, int *minor) +linux_driver_get_major_minor(const char *node, int *major, int *minor) { struct device_element *de; Modified: stable/9/sys/compat/linux/linux_util.h ============================================================================== --- stable/9/sys/compat/linux/linux_util.h Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/compat/linux/linux_util.h Fri Mar 2 21:29:57 2012 (r232405) @@ -97,7 +97,7 @@ struct linux_device_handler { int linux_device_register_handler(struct linux_device_handler *h); int linux_device_unregister_handler(struct linux_device_handler *h); char *linux_driver_get_name_dev(device_t dev); -int linux_driver_get_major_minor(char *node, int *major, int *minor); +int linux_driver_get_major_minor(const char *node, int *major, int *minor); char *linux_get_char_devices(void); void linux_free_get_char_devices(char *string); Modified: stable/9/sys/dev/iscsi/initiator/isc_sm.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/isc_sm.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/dev/iscsi/initiator/isc_sm.c Fri Mar 2 21:29:57 2012 (r232405) @@ -652,13 +652,13 @@ static void isc_add_sysctls(isc_session_t *sp) { debug_called(8); - sdebug(6, "sid=%d %s", sp->sid, sp->dev->si_name); + sdebug(6, "sid=%d %s", sp->sid, devtoname(sp->dev)); sysctl_ctx_init(&sp->clist); sp->oid = SYSCTL_ADD_NODE(&sp->clist, SYSCTL_CHILDREN(sp->isc->oid), OID_AUTO, - sp->dev->si_name+5, // iscsi0 + devtoname(sp->dev) + 5, // iscsi0 CTLFLAG_RD, 0, "initiator"); Modified: stable/9/sys/dev/sound/pcm/mixer.c ============================================================================== --- stable/9/sys/dev/sound/pcm/mixer.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/dev/sound/pcm/mixer.c Fri Mar 2 21:29:57 2012 (r232405) @@ -1463,7 +1463,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, * * XXX Described by Hannu@4Front, but not found in * soundcard.h. - strlcpy(mi->devnode, d->mixer_dev->si_name, + strlcpy(mi->devnode, devtoname(d->mixer_dev), sizeof(mi->devnode)); mi->legacy_device = i; */ Modified: stable/9/sys/dev/usb/usb_dev.c ============================================================================== --- stable/9/sys/dev/usb/usb_dev.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/dev/usb/usb_dev.c Fri Mar 2 21:29:57 2012 (r232405) @@ -842,7 +842,7 @@ usb_open(struct cdev *dev, int fflags, i struct usb_cdev_privdata *cpd; int err, ep; - DPRINTFN(2, "%s fflags=0x%08x\n", dev->si_name, fflags); + DPRINTFN(2, "%s fflags=0x%08x\n", devtoname(dev), fflags); KASSERT(fflags & (FREAD|FWRITE), ("invalid open flags")); if (((fflags & FREAD) && !(pd->mode & FREAD)) || Modified: stable/9/sys/netgraph/ng_device.c ============================================================================== --- stable/9/sys/netgraph/ng_device.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/netgraph/ng_device.c Fri Mar 2 21:29:57 2012 (r232405) @@ -203,6 +203,7 @@ ng_device_rcvmsg(node_p node, item_p ite const priv_p priv = NG_NODE_PRIVATE(node); struct ng_mesg *msg; struct ng_mesg *resp = NULL; + const char *dn; int error = 0; NGI_GET_MSG(item, msg); @@ -217,8 +218,8 @@ ng_device_rcvmsg(node_p node, item_p ite if (resp == NULL) ERROUT(ENOMEM); - strlcpy((char *)resp->data, priv->ngddev->si_name, - strlen(priv->ngddev->si_name) + 1); + dn = devtoname(priv->ngddev); + strlcpy((char *)resp->data, dn, strlen(dn) + 1); break; default: Modified: stable/9/sys/security/mac_biba/mac_biba.c ============================================================================== --- stable/9/sys/security/mac_biba/mac_biba.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/security/mac_biba/mac_biba.c Fri Mar 2 21:29:57 2012 (r232405) @@ -948,18 +948,20 @@ biba_devfs_create_device(struct ucred *c struct cdev *dev, struct devfs_dirent *de, struct label *delabel) { struct mac_biba *mb; + const char *dn; int biba_type; mb = SLOT(delabel); - if (strcmp(dev->si_name, "null") == 0 || - strcmp(dev->si_name, "zero") == 0 || - strcmp(dev->si_name, "random") == 0 || - strncmp(dev->si_name, "fd/", strlen("fd/")) == 0) + dn = devtoname(dev); + if (strcmp(dn, "null") == 0 || + strcmp(dn, "zero") == 0 || + strcmp(dn, "random") == 0 || + strncmp(dn, "fd/", strlen("fd/")) == 0) biba_type = MAC_BIBA_TYPE_EQUAL; else if (ptys_equal && - (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || - strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || - strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) + (strncmp(dn, "ttyp", strlen("ttyp")) == 0 || + strncmp(dn, "pts/", strlen("pts/")) == 0 || + strncmp(dn, "ptyp", strlen("ptyp")) == 0)) biba_type = MAC_BIBA_TYPE_EQUAL; else biba_type = MAC_BIBA_TYPE_HIGH; Modified: stable/9/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- stable/9/sys/security/mac_lomac/mac_lomac.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/security/mac_lomac/mac_lomac.c Fri Mar 2 21:29:57 2012 (r232405) @@ -1032,19 +1032,21 @@ lomac_devfs_create_device(struct ucred * struct cdev *dev, struct devfs_dirent *de, struct label *delabel) { struct mac_lomac *ml; + const char *dn; int lomac_type; ml = SLOT(delabel); - if (strcmp(dev->si_name, "null") == 0 || - strcmp(dev->si_name, "zero") == 0 || - strcmp(dev->si_name, "random") == 0 || - strncmp(dev->si_name, "fd/", strlen("fd/")) == 0 || - strncmp(dev->si_name, "ttyv", strlen("ttyv")) == 0) + dn = devtoname(dev); + if (strcmp(dn, "null") == 0 || + strcmp(dn, "zero") == 0 || + strcmp(dn, "random") == 0 || + strncmp(dn, "fd/", strlen("fd/")) == 0 || + strncmp(dn, "ttyv", strlen("ttyv")) == 0) lomac_type = MAC_LOMAC_TYPE_EQUAL; else if (ptys_equal && - (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || - strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || - strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) + (strncmp(dn, "ttyp", strlen("ttyp")) == 0 || + strncmp(dn, "pts/", strlen("pts/")) == 0 || + strncmp(dn, "ptyp", strlen("ptyp")) == 0)) lomac_type = MAC_LOMAC_TYPE_EQUAL; else lomac_type = MAC_LOMAC_TYPE_HIGH; Modified: stable/9/sys/security/mac_mls/mac_mls.c ============================================================================== --- stable/9/sys/security/mac_mls/mac_mls.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/security/mac_mls/mac_mls.c Fri Mar 2 21:29:57 2012 (r232405) @@ -908,21 +908,23 @@ mls_devfs_create_device(struct ucred *cr struct cdev *dev, struct devfs_dirent *de, struct label *delabel) { struct mac_mls *mm; + const char *dn; int mls_type; mm = SLOT(delabel); - if (strcmp(dev->si_name, "null") == 0 || - strcmp(dev->si_name, "zero") == 0 || - strcmp(dev->si_name, "random") == 0 || - strncmp(dev->si_name, "fd/", strlen("fd/")) == 0) + dn = devtoname(dev); + if (strcmp(dn, "null") == 0 || + strcmp(dn, "zero") == 0 || + strcmp(dn, "random") == 0 || + strncmp(dn, "fd/", strlen("fd/")) == 0) mls_type = MAC_MLS_TYPE_EQUAL; - else if (strcmp(dev->si_name, "kmem") == 0 || - strcmp(dev->si_name, "mem") == 0) + else if (strcmp(dn, "kmem") == 0 || + strcmp(dn, "mem") == 0) mls_type = MAC_MLS_TYPE_HIGH; else if (ptys_equal && - (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || - strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || - strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) + (strncmp(dn, "ttyp", strlen("ttyp")) == 0 || + strncmp(dn, "pts/", strlen("pts/")) == 0 || + strncmp(dn, "ptyp", strlen("ptyp")) == 0)) mls_type = MAC_MLS_TYPE_EQUAL; else mls_type = MAC_MLS_TYPE_LOW; Modified: stable/9/sys/vm/swap_pager.c ============================================================================== --- stable/9/sys/vm/swap_pager.c Fri Mar 2 21:17:24 2012 (r232404) +++ stable/9/sys/vm/swap_pager.c Fri Mar 2 21:29:57 2012 (r232405) @@ -2320,7 +2320,7 @@ swapoff_all(void) TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { mtx_unlock(&sw_dev_mtx); if (vn_isdisk(sp->sw_vp, NULL)) - devname = sp->sw_vp->v_rdev->si_name; + devname = devtoname(sp->sw_vp->v_rdev); else devname = "[file]"; error = swapoff_one(sp, thread0.td_ucred); @@ -2358,7 +2358,7 @@ int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len) { struct swdevt *sp; - char *tmp_devname; + const char *tmp_devname; int error, n; n = 0; @@ -2376,7 +2376,7 @@ swap_dev_info(int name, struct xswdev *x xs->xsw_used = sp->sw_used; if (devname != NULL) { if (vn_isdisk(sp->sw_vp, NULL)) - tmp_devname = sp->sw_vp->v_rdev->si_name; + tmp_devname = devtoname(sp->sw_vp->v_rdev); else tmp_devname = "[file]"; strncpy(devname, tmp_devname, len); From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 21:36:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4CCF1065679; Fri, 2 Mar 2012 21:36:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FE948FC16; Fri, 2 Mar 2012 21:36: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 q22LaOZH048361; Fri, 2 Mar 2012 21:36:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22LaOPJ048359; Fri, 2 Mar 2012 21:36:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203022136.q22LaOPJ048359@svn.freebsd.org> From: Ed Schouten Date: Fri, 2 Mar 2012 21:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232406 - stable/9/usr.sbin/vipw X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 21:36:24 -0000 Author: ed Date: Fri Mar 2 21:36:24 2012 New Revision: 232406 URL: http://svn.freebsd.org/changeset/base/232406 Log: MFC r231383, r231385 and r231648: Detect file modification properly by using tv_nsec. POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond precision to detect file modification. Modified: stable/9/usr.sbin/vipw/vipw.8 Directory Properties: stable/9/usr.sbin/vipw/ (props changed) Modified: stable/9/usr.sbin/vipw/vipw.8 ============================================================================== --- stable/9/usr.sbin/vipw/vipw.8 Fri Mar 2 21:29:57 2012 (r232405) +++ stable/9/usr.sbin/vipw/vipw.8 Fri Mar 2 21:36:24 2012 (r232406) @@ -28,7 +28,7 @@ .\" @(#)vipw.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd February 14, 2012 .Dt VIPW 8 .Os .Sh NAME @@ -112,8 +112,11 @@ utility appeared in .Bx 4.0 . .Sh BUGS The mechanism for checking for password file modifications requires that +the modification time of the password file changes. +This means that in a default configuration where file system timestamps +are not calculated with sub-second precision, .Ev EDITOR -run for at least one second. +has to run for at least one second. Non-interactive editor scripts should invoke .Xr sleep 1 or equivalent to ensure this happens. From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 21:38:27 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 838641065672; Fri, 2 Mar 2012 21:38:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F6648FC15; Fri, 2 Mar 2012 21:38:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q22LcRxR048505; Fri, 2 Mar 2012 21:38:27 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22LcRZ2048502; Fri, 2 Mar 2012 21:38:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203022138.q22LcRZ2048502@svn.freebsd.org> From: Ed Schouten Date: Fri, 2 Mar 2012 21:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232408 - stable/9/lib/libc/gen X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 21:38:27 -0000 Author: ed Date: Fri Mar 2 21:38:27 2012 New Revision: 232408 URL: http://svn.freebsd.org/changeset/base/232408 Log: MFC r231514: Set read buffer size to multiple of sizeof(struct futx). If the utmpx database gets updated while an application is reading it, there is a chance the reading application processes partially overwritten entries. To solve this, make sure we always read a multiple of sizeof(struct futx) at a time. Modified: stable/9/lib/libc/gen/getutxent.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/getutxent.c ============================================================================== --- stable/9/lib/libc/gen/getutxent.c Fri Mar 2 21:38:06 2012 (r232407) +++ stable/9/lib/libc/gen/getutxent.c Fri Mar 2 21:38:27 2012 (r232408) @@ -70,13 +70,18 @@ setutxdb(int db, const char *file) if (uf == NULL) return (-1); - /* Safety check: never use broken files. */ - if (db != UTXDB_LOG && _fstat(fileno(uf), &sb) != -1 && - sb.st_size % sizeof(struct futx) != 0) { - fclose(uf); - uf = NULL; - errno = EFTYPE; - return (-1); + if (db != UTXDB_LOG) { + /* Safety check: never use broken files. */ + if (_fstat(fileno(uf), &sb) != -1 && + sb.st_size % sizeof(struct futx) != 0) { + fclose(uf); + uf = NULL; + errno = EFTYPE; + return (-1); + } + /* Prevent reading of partial records. */ + (void)setvbuf(uf, NULL, _IOFBF, + rounddown(BUFSIZ, sizeof(struct futx))); } udb = db; From owner-svn-src-stable-9@FreeBSD.ORG Fri Mar 2 23:54:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4CD1106564A; Fri, 2 Mar 2012 23:54:11 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2E968FC0C; Fri, 2 Mar 2012 23:54:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q22NsBvH053183; Fri, 2 Mar 2012 23:54:11 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22NsBib053179; Fri, 2 Mar 2012 23:54:11 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201203022354.q22NsBib053179@svn.freebsd.org> From: Josh Paetzel Date: Fri, 2 Mar 2012 23:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232415 - stable/9/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 23:54:11 -0000 Author: jpaetzel Date: Fri Mar 2 23:54:11 2012 New Revision: 232415 URL: http://svn.freebsd.org/changeset/base/232415 Log: MFC r227368 Welcome the initial patches for OSX bootcamp support!!! This should let you select the ada0p3 hybrid MBR/GPT partition, and do an installation to it. Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh stable/9/usr.sbin/pc-sysinstall/backend/parseconfig.sh Directory Properties: stable/9/usr.sbin/pc-sysinstall/ (props changed) Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Fri Mar 2 22:24:15 2012 (r232414) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Fri Mar 2 23:54:11 2012 (r232415) @@ -179,7 +179,9 @@ setup_gpart_partitions() else PARTLETTER="a" CURPART="1" - rc_halt "gpart create -s BSD ${_wSlice}" + if [ "${_pType}" = "mbr" ] ; then + rc_halt "gpart create -s BSD ${_wSlice}" + fi fi while read line @@ -255,6 +257,9 @@ setup_gpart_partitions() if [ "${CURPART}" = "1" -a "$_pType" = "mbr" ] ; then export FOUNDROOT="0" fi + if [ "${CURPART}" = "1" -a "$_pType" = "gptslice" ] ; then + export FOUNDROOT="0" + fi fi check_for_mount "${MNT}" "/boot" @@ -266,6 +271,9 @@ setup_gpart_partitions() if [ "${CURPART}" != "1" -a "${_pType}" = "mbr" ] ; then exit_err "/boot partition must be first partition" fi + if [ "${CURPART}" != "1" -a "${_pType}" = "gptslice" ] ; then + exit_err "/boot partition must be first partition" + fi if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" -a "${FS}" != "UFS+SUJ" ] ; then exit_err "/boot partition must be formatted with UFS" @@ -287,7 +295,7 @@ setup_gpart_partitions() # Check if using zfs mirror echo ${XTRAOPTS} | grep -q "mirror" 2>/dev/null if [ $? -eq 0 -a "$FS" = "ZFS" ] ; then - if [ "${_pType}" = "gpt" ] ; then + if [ "${_pType}" = "gpt" -o "${_pType}" = "gptslice" ] ; then XTRAOPTS=$(setup_zfs_mirror_parts "$XTRAOPTS" "${_pDisk}p${CURPART}") else XTRAOPTS=$(setup_zfs_mirror_parts "$XTRAOPTS" "${_wSlice}") @@ -305,11 +313,17 @@ setup_gpart_partitions() if [ "${_pType}" = "gpt" ] ; then if [ "$CURPART" = "2" ] ; then # If this is GPT, make sure first partition is aligned to 4k + sleep 2 rc_halt "gpart add -b 2016 ${SOUT} -t ${PARTYPE} ${_pDisk}" else + sleep 2 rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${_pDisk}" fi + elif [ "${_pType}" = "gptslice" ]; then + sleep 2 + rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${_wSlice}" else + sleep 2 rc_halt "gpart add ${SOUT} -t ${PARTYPE} -i ${CURPART} ${_wSlice}" fi @@ -338,7 +352,7 @@ setup_gpart_partitions() echo "${ENCPASS}" >${PARTDIR}-enc/${_dFile}p${CURPART}-encpass fi else - # MBR Partition + # MBR Partition or GPT slice _dFile="`echo $_wSlice | sed 's|/|-|g'`" echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}:${IMAGE}" >${PARTDIR}/${_dFile}${PARTLETTER} # Clear out any headers @@ -422,7 +436,7 @@ populate_disk_label() if [ "$type" = "mbr" ] ; then wrkslice="${diskid}s${slicenum}" fi - if [ "$type" = "gpt" ] ; then + if [ "$type" = "gpt" -o "$type" = "gptslice" ] ; then wrkslice="${diskid}p${slicenum}" fi @@ -459,6 +473,9 @@ setup_disk_label() if [ "$type" = "gpt" -a ! -e "${disk}p${pnum}" ] ; then exit_err "ERROR: The partition ${i} doesn't exist! gpart failure!" fi + if [ "$type" = "gptslice" -a ! -e "${disk}p${pnum}" ] ; then + exit_err "ERROR: The partition ${i} doesn't exist! gpart failure!" + fi done # Setup some files which we'll be referring to Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Fri Mar 2 22:24:15 2012 (r232414) +++ stable/9/usr.sbin/pc-sysinstall/backend/functions-disk.sh Fri Mar 2 23:54:11 2012 (r232415) @@ -496,6 +496,13 @@ setup_disk_slice() run_gpart_slice "${DISK}" "${BMANAGER}" "${s}" ;; + p1|p2|p3|p4|p5|p6|p7|p8|p9|p10|p11|p12|p13|p14|p15|p16|p17|p18|p19|p20) + tmpSLICE="${DISK}${PTYPE}" + # Get the number of the gpt partition we are working on + s="`echo ${PTYPE} | awk '{print substr($0,length,1)}'`" + run_gpart_gpt_part "${DISK}" "${BMANAGER}" "${s}" + ;; + free) tmpSLICE="${DISK}s${LASTSLICE}" run_gpart_free "${DISK}" "${LASTSLICE}" "${BMANAGER}" @@ -704,6 +711,58 @@ run_gpart_full() fi }; +# Function which runs gpart on a specified gpt partition +run_gpart_gpt_part() +{ + DISK=$1 + + # Set the slice we will use later + slice="${1}p${3}" + + # Set our sysctl so we can overwrite any geom using drives + sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT} + + # Get the number of the slice we are working on + slicenum="$3" + + # Stop any journaling + stop_gjournal "${slice}" + + # Make sure we have disabled swap on this drive + if [ -e "${slice}b" ] + then + swapoff ${slice}b >/dev/null 2>/dev/null + swapoff ${slice}b.eli >/dev/null 2>/dev/null + fi + + # Modify partition type + echo_log "Running gpart modify on ${DISK}" + rc_halt "gpart modify -t freebsd -i ${slicenum} ${DISK}" + sleep 2 + + # Clean up old partition + echo_log "Cleaning up $slice" + rc_halt "dd if=/dev/zero of=${DISK}p${slicenum} count=1024" + + sleep 4 + + # Init the MBR partition + rc_halt "gpart create -s BSD ${DISK}p${slicenum}" + + # Set the slice to the format we'll be using for gpart later + slice=`echo "${1}:${3}:gptslice" | sed 's|/|-|g'` + + # Lets save our slice, so we know what to look for in the config file later on + if [ -z "$WORKINGSLICES" ] + then + WORKINGSLICES="${slice}" + export WORKINGSLICES + else + WORKINGSLICES="${WORKINGSLICES} ${slice}" + export WORKINGSLICES + fi +}; + # Function which runs gpart on a specified s1-4 slice run_gpart_slice() { Modified: stable/9/usr.sbin/pc-sysinstall/backend/parseconfig.sh ============================================================================== --- stable/9/usr.sbin/pc-sysinstall/backend/parseconfig.sh Fri Mar 2 22:24:15 2012 (r232414) +++ stable/9/usr.sbin/pc-sysinstall/backend/parseconfig.sh Fri Mar 2 23:54:11 2012 (r232415) @@ -70,7 +70,6 @@ check_value installMode "fresh upgrade e check_value installType "PCBSD FreeBSD" check_value installMedium "dvd usb ftp rsync image local" check_value packageType "uzip tar rsync split" -if_check_value_exists partition "all s1 s2 s3 s4 free image" if_check_value_exists mirrorbal "load prefer round-robin split" # We passed all sanity checks! Yay, lets start the install From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 00:36:31 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E651106566B; Sat, 3 Mar 2012 00:36:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D5B18FC08; Sat, 3 Mar 2012 00:36:31 +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 q230aVv6054687; Sat, 3 Mar 2012 00:36:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q230aVAC054685; Sat, 3 Mar 2012 00:36:31 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203030036.q230aVAC054685@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 3 Mar 2012 00:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232417 - stable/9/sys/boot/i386/libi386 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 00:36:31 -0000 Author: jkim Date: Sat Mar 3 00:36:30 2012 New Revision: 232417 URL: http://svn.freebsd.org/changeset/base/232417 Log: MFC: r232309 Fix a long standing bug. The caller expects a non-zero value for success. Luckily keyboard probing was turned off by default from the first revision. Modified: stable/9/sys/boot/i386/libi386/vidconsole.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/libi386/vidconsole.c ============================================================================== --- stable/9/sys/boot/i386/libi386/vidconsole.c Sat Mar 3 00:11:46 2012 (r232416) +++ stable/9/sys/boot/i386/libi386/vidconsole.c Sat Mar 3 00:36:30 2012 (r232417) @@ -623,10 +623,10 @@ probe_keyboard(void) #endif if (i == KBD_ECHO) { /* got the right answer */ - return (0); + return (1); } } - return (1); + return (0); } #endif /* KEYBOARD_PROBE */ From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 02:13:53 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBD541065670; Sat, 3 Mar 2012 02:13:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA4078FC08; Sat, 3 Mar 2012 02:13:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q232DrcE058090; Sat, 3 Mar 2012 02:13:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q232Dr4m058088; Sat, 3 Mar 2012 02:13:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203030213.q232Dr4m058088@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 3 Mar 2012 02:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232427 - stable/9/release X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 02:13:54 -0000 Author: nwhitehorn Date: Sat Mar 3 02:13:53 2012 New Revision: 232427 URL: http://svn.freebsd.org/changeset/base/232427 Log: MFC r230482-230484,r230997: Per popular demand, if installing from a graphics terminal, show the installer log in real time on VTY 3, and spawn a shell on VTY 4. PR: bin/161048 Modified: stable/9/release/rc.local Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/rc.local ============================================================================== --- stable/9/release/rc.local Sat Mar 3 01:33:10 2012 (r232426) +++ stable/9/release/rc.local Sat Mar 3 02:13:53 2012 (r232427) @@ -12,12 +12,21 @@ MACHINE=`uname -m` kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then - # Syscons: use xterm + # Syscons: use xterm, start interesting things on other VTYs if [ ${MACHINE} = "pc98" ]; then TERM=cons25w else TERM=xterm fi + + if [ -z "$EXTERNAL_VTY_STARTED" ]; then + # Init will clean these processes up if/when the system + # goes multiuser + touch /tmp/bsdinstall_log + tail -f /tmp/bsdinstall_log > /dev/ttyv2 & + /usr/libexec/getty autologin ttyv3 & + EXTERNAL_VTY_STARTED=1 + fi else # Serial or other console echo From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 02:14:59 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE9A31065670; Sat, 3 Mar 2012 02:14:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B34BE8FC08; Sat, 3 Mar 2012 02:14: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 q232Ex55058174; Sat, 3 Mar 2012 02:14:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q232Ex5V058172; Sat, 3 Mar 2012 02:14:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203030214.q232Ex5V058172@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 3 Mar 2012 02:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232428 - stable/9/sys/powerpc/ofw X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 02:15:00 -0000 Author: nwhitehorn Date: Sat Mar 3 02:14:59 2012 New Revision: 232428 URL: http://svn.freebsd.org/changeset/base/232428 Log: MFC r231046: Inherit from PCI bridge driver instead of manually specifying all of its methods. Obtained from: sparc64 Modified: stable/9/sys/powerpc/ofw/ofw_pcib_pci.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_pcib_pci.c Sat Mar 3 02:13:53 2012 (r232427) +++ stable/9/sys/powerpc/ofw/ofw_pcib_pci.c Sat Mar 3 02:14:59 2012 (r232428) @@ -56,31 +56,10 @@ static int ofw_pcib_pci_route_interrupt( static device_method_t ofw_pcib_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ofw_pcib_pci_probe), - DEVMETHOD(device_attach, ofw_pcib_pci_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_read_ivar, pcib_read_ivar), - DEVMETHOD(bus_write_ivar, pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(device_attach, ofw_pcib_pci_attach), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), - DEVMETHOD(pcib_read_config, pcib_read_config), - DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, ofw_pcib_pci_route_interrupt), - DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), - DEVMETHOD(pcib_release_msi, pcib_release_msi), - DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), - DEVMETHOD(pcib_release_msix, pcib_release_msix), - DEVMETHOD(pcib_map_msi, pcib_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_pci_get_node), @@ -101,8 +80,8 @@ struct ofw_pcib_softc { struct ofw_bus_iinfo ops_iinfo; }; -DEFINE_CLASS_0(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, - sizeof(struct ofw_pcib_softc)); +DEFINE_CLASS_1(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, + sizeof(struct ofw_pcib_softc), pcib_driver); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_pci_driver, pcib_devclass, 0, 0); static int From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 02:15:53 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2610C1065674; Sat, 3 Mar 2012 02:15:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 145778FC13; Sat, 3 Mar 2012 02:15:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q232FqEi058261; Sat, 3 Mar 2012 02:15:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q232FqUo058258; Sat, 3 Mar 2012 02:15:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203030215.q232FqUo058258@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 3 Mar 2012 02:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232429 - in stable/9/sys/powerpc: ofw ps3 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 02:15:53 -0000 Author: nwhitehorn Date: Sat Mar 3 02:15:52 2012 New Revision: 232429 URL: http://svn.freebsd.org/changeset/base/232429 Log: MFC r230992: Avoid warnings about duplicate modules. Modified: stable/9/sys/powerpc/ofw/ofw_syscons.c stable/9/sys/powerpc/ps3/ps3_syscons.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_syscons.c Sat Mar 3 02:14:59 2012 (r232428) +++ stable/9/sys/powerpc/ofw/ofw_syscons.c Sat Mar 3 02:15:52 2012 (r232429) @@ -984,7 +984,7 @@ static driver_t ofwfb_sc_driver = { static devclass_t sc_devclass; -DRIVER_MODULE(sc, nexus, ofwfb_sc_driver, sc_devclass, 0, 0); +DRIVER_MODULE(ofwfb, nexus, ofwfb_sc_driver, sc_devclass, 0, 0); /* * Define a stub keyboard driver in case one hasn't been Modified: stable/9/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- stable/9/sys/powerpc/ps3/ps3_syscons.c Sat Mar 3 02:14:59 2012 (r232428) +++ stable/9/sys/powerpc/ps3/ps3_syscons.c Sat Mar 3 02:15:52 2012 (r232429) @@ -749,7 +749,7 @@ static driver_t ps3fb_sc_driver = { static devclass_t sc_devclass; -DRIVER_MODULE(sc, nexus, ps3fb_sc_driver, sc_devclass, 0, 0); +DRIVER_MODULE(ps3fb, nexus, ps3fb_sc_driver, sc_devclass, 0, 0); /* * Define a stub keyboard driver in case one hasn't been From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 02:16:45 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4E90106566B; Sat, 3 Mar 2012 02:16:45 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A307D8FC14; Sat, 3 Mar 2012 02:16:45 +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 q232GjYO058345; Sat, 3 Mar 2012 02:16:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q232GjC7058343; Sat, 3 Mar 2012 02:16:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203030216.q232GjC7058343@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 3 Mar 2012 02:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232430 - stable/9/sys/powerpc/powermac X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 02:16:45 -0000 Author: nwhitehorn Date: Sat Mar 3 02:16:45 2012 New Revision: 232430 URL: http://svn.freebsd.org/changeset/base/232430 Log: MFC r231770: Improve error handling in smusat(4). Modified: stable/9/sys/powerpc/powermac/smusat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/powermac/smusat.c ============================================================================== --- stable/9/sys/powerpc/powermac/smusat.c Sat Mar 3 02:15:52 2012 (r232429) +++ stable/9/sys/powerpc/powermac/smusat.c Sat Mar 3 02:16:45 2012 (r232430) @@ -202,33 +202,46 @@ static int smusat_updatecache(device_t dev) { uint8_t reg = 0x3f; + uint8_t value[16]; struct smusat_softc *sc = device_get_softc(dev); + int error; struct iic_msg msgs[2] = { {0, IIC_M_WR | IIC_M_NOSTOP, 1, ®}, - {0, IIC_M_RD, 16, sc->sc_cache}, + {0, IIC_M_RD, 16, value}, }; msgs[0].slave = msgs[1].slave = iicbus_get_addr(dev); - sc->sc_last_update = time_uptime; + error = iicbus_transfer(dev, msgs, 2); + if (error) + return (error); - return (iicbus_transfer(dev, msgs, 2)); + sc->sc_last_update = time_uptime; + memcpy(sc->sc_cache, value, sizeof(value)); + return (0); } static int smusat_sensor_read(struct smu_sensor *sens) { - int value; + int value, error; device_t dev; struct smusat_softc *sc; dev = sens->dev; sc = device_get_softc(dev); + error = 0; if (time_uptime - sc->sc_last_update > 1) - smusat_updatecache(dev); + error = smusat_updatecache(dev); + if (error) + return (-error); value = (sc->sc_cache[sens->reg*2] << 8) + sc->sc_cache[sens->reg*2 + 1]; + if (value == 0xffff) { + sc->sc_last_update = 0; /* Result was bad, don't cache */ + return (-EINVAL); + } switch (sens->type) { case SMU_TEMP_SENSOR: From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 02:19:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD70D106566C; Sat, 3 Mar 2012 02:19:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9F618FC12; Sat, 3 Mar 2012 02:19:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q232JXD5058496; Sat, 3 Mar 2012 02:19:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q232JXcN058488; Sat, 3 Mar 2012 02:19:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203030219.q232JXcN058488@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 3 Mar 2012 02:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232431 - in stable/9/sys/powerpc: aim include powerpc ps3 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 02:19:33 -0000 Author: nwhitehorn Date: Sat Mar 3 02:19:33 2012 New Revision: 232431 URL: http://svn.freebsd.org/changeset/base/232431 Log: MFC r230123,230139: Rework SLB trap handling so that double-faults into an SLB trap handler are possible, and double faults within an SLB trap handler are not. The result is that it possible to take an SLB fault at any time, on any address, for any reason, at any point in the kernel. This lets us do two important things. First, it removes the (soft) 16 GB RAM ceiling on PPC64 as well as any architectural limitations on KVA space. Second, it lets the kernel tolerate poorly designed hypervisors that have a tendency to fail to restore the SLB properly after a hypervisor context switch. Now that we can tolerate LPAR context switches on the PS3 hypervisor, going to hypervisor-idle on both threads will not hang the kernel. Modified: stable/9/sys/powerpc/aim/machdep.c stable/9/sys/powerpc/aim/slb.c stable/9/sys/powerpc/aim/trap.c stable/9/sys/powerpc/aim/trap_subr64.S stable/9/sys/powerpc/include/pcpu.h stable/9/sys/powerpc/powerpc/genassym.c stable/9/sys/powerpc/ps3/platform_ps3.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/aim/machdep.c ============================================================================== --- stable/9/sys/powerpc/aim/machdep.c Sat Mar 3 02:16:45 2012 (r232430) +++ stable/9/sys/powerpc/aim/machdep.c Sat Mar 3 02:19:33 2012 (r232431) @@ -238,6 +238,7 @@ extern void *trapcode64; extern void *rstcode, *rstsize; #endif extern void *trapcode, *trapsize; +extern void *slbtrap, *slbtrapsize; extern void *alitrap, *alisize; extern void *dsitrap, *dsisize; extern void *decrint, *decrsize; @@ -485,8 +486,8 @@ powerpc_init(vm_offset_t startkernel, vm bcopy(&dsitrap, (void *)(EXC_DSI + trap_offset), (size_t)&dsisize); bcopy(generictrap, (void *)EXC_ISI, (size_t)&trapsize); #ifdef __powerpc64__ - bcopy(generictrap, (void *)EXC_DSE, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_ISE, (size_t)&trapsize); + bcopy(&slbtrap, (void *)EXC_DSE, (size_t)&slbtrapsize); + bcopy(&slbtrap, (void *)EXC_ISE, (size_t)&slbtrapsize); #endif bcopy(generictrap, (void *)EXC_EXI, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_FPU, (size_t)&trapsize); Modified: stable/9/sys/powerpc/aim/slb.c ============================================================================== --- stable/9/sys/powerpc/aim/slb.c Sat Mar 3 02:16:45 2012 (r232430) +++ stable/9/sys/powerpc/aim/slb.c Sat Mar 3 02:19:33 2012 (r232431) @@ -410,15 +410,11 @@ slb_alloc_tree(void) /* Lock entries mapping kernel text and stacks */ -#define SLB_SPILLABLE(slbe) \ - (((slbe & SLBE_ESID_MASK) < VM_MIN_KERNEL_ADDRESS && \ - (slbe & SLBE_ESID_MASK) > 16*SEGMENT_LENGTH) || \ - (slbe & SLBE_ESID_MASK) > VM_MAX_KERNEL_ADDRESS) void slb_insert_kernel(uint64_t slbe, uint64_t slbv) { struct slb *slbcache; - int i, j; + int i; /* We don't want to be preempted while modifying the kernel map */ critical_enter(); @@ -438,15 +434,9 @@ slb_insert_kernel(uint64_t slbe, uint64_ slbcache[USER_SLB_SLOT].slbe = 1; } - for (i = mftb() % n_slbs, j = 0; j < n_slbs; j++, i = (i+1) % n_slbs) { - if (i == USER_SLB_SLOT) - continue; - - if (SLB_SPILLABLE(slbcache[i].slbe)) - break; - } - - KASSERT(j < n_slbs, ("All kernel SLB slots locked!")); + i = mftb() % n_slbs; + if (i == USER_SLB_SLOT) + i = (i+1) % n_slbs; fillkernslb: KASSERT(i != USER_SLB_SLOT, Modified: stable/9/sys/powerpc/aim/trap.c ============================================================================== --- stable/9/sys/powerpc/aim/trap.c Sat Mar 3 02:16:45 2012 (r232430) +++ stable/9/sys/powerpc/aim/trap.c Sat Mar 3 02:19:33 2012 (r232431) @@ -88,7 +88,9 @@ static int handle_onfault(struct trapfra static void syscall(struct trapframe *frame); #ifdef __powerpc64__ -static int handle_slb_spill(pmap_t pm, vm_offset_t addr); + void handle_kernel_slb_spill(int, register_t, register_t); +static int handle_user_slb_spill(pmap_t pm, vm_offset_t addr); +extern int n_slbs; #endif int setfault(faultbuf); /* defined in locore.S */ @@ -191,7 +193,7 @@ trap(struct trapframe *frame) #ifdef __powerpc64__ case EXC_ISE: case EXC_DSE: - if (handle_slb_spill(&p->p_vmspace->vm_pmap, + if (handle_user_slb_spill(&p->p_vmspace->vm_pmap, (type == EXC_ISE) ? frame->srr0 : frame->cpu.aim.dar) != 0) sig = SIGSEGV; @@ -259,27 +261,20 @@ trap(struct trapframe *frame) KASSERT(cold || td->td_ucred != NULL, ("kernel trap doesn't have ucred")); switch (type) { - case EXC_DSI: - if (trap_pfault(frame, 0) == 0) - return; - break; #ifdef __powerpc64__ case EXC_DSE: if ((frame->cpu.aim.dar & SEGMENT_MASK) == USER_ADDR) { __asm __volatile ("slbmte %0, %1" :: - "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), - "r"(USER_SLB_SLBE)); + "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), + "r"(USER_SLB_SLBE)); return; } - - /* FALLTHROUGH */ - case EXC_ISE: - if (handle_slb_spill(kernel_pmap, - (type == EXC_ISE) ? frame->srr0 : - frame->cpu.aim.dar) != 0) - panic("Fault handling kernel SLB miss"); - return; + break; #endif + case EXC_DSI: + if (trap_pfault(frame, 0) == 0) + return; + break; case EXC_MCHK: if (handle_onfault(frame)) return; @@ -326,8 +321,7 @@ printtrap(u_int vector, struct trapframe printf("%s %s trap:\n", isfatal ? "fatal" : "handled", user ? "user" : "kernel"); printf("\n"); - printf(" exception = 0x%x (%s)\n", vector >> 8, - trapname(vector)); + printf(" exception = 0x%x (%s)\n", vector, trapname(vector)); switch (vector) { case EXC_DSE: case EXC_DSI: @@ -486,8 +480,54 @@ syscall(struct trapframe *frame) } #ifdef __powerpc64__ +/* Handle kernel SLB faults -- runs in real mode, all seat belts off */ +void +handle_kernel_slb_spill(int type, register_t dar, register_t srr0) +{ + struct slb *slbcache; + uint64_t slbe, slbv; + uint64_t esid, addr; + int i; + + addr = (type == EXC_ISE) ? srr0 : dar; + slbcache = PCPU_GET(slb); + esid = (uintptr_t)addr >> ADDR_SR_SHFT; + slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; + + /* See if the hardware flushed this somehow (can happen in LPARs) */ + for (i = 0; i < n_slbs; i++) + if (slbcache[i].slbe == (slbe | (uint64_t)i)) + return; + + /* Not in the map, needs to actually be added */ + slbv = kernel_va_to_slbv(addr); + if (slbcache[USER_SLB_SLOT].slbe == 0) { + for (i = 0; i < n_slbs; i++) { + if (i == USER_SLB_SLOT) + continue; + if (!(slbcache[i].slbe & SLBE_VALID)) + goto fillkernslb; + } + + if (i == n_slbs) + slbcache[USER_SLB_SLOT].slbe = 1; + } + + /* Sacrifice a random SLB entry that is not the user entry */ + i = mftb() % n_slbs; + if (i == USER_SLB_SLOT) + i = (i+1) % n_slbs; + +fillkernslb: + /* Write new entry */ + slbcache[i].slbv = slbv; + slbcache[i].slbe = slbe | (uint64_t)i; + + /* Trap handler will restore from cache on exit */ +} + static int -handle_slb_spill(pmap_t pm, vm_offset_t addr) +handle_user_slb_spill(pmap_t pm, vm_offset_t addr) { struct slb *user_entry; uint64_t esid; @@ -495,12 +535,6 @@ handle_slb_spill(pmap_t pm, vm_offset_t esid = (uintptr_t)addr >> ADDR_SR_SHFT; - if (pm == kernel_pmap) { - slb_insert_kernel((esid << SLBE_ESID_SHIFT) | SLBE_VALID, - kernel_va_to_slbv(addr)); - return (0); - } - PMAP_LOCK(pm); user_entry = user_va_to_slb_entry(pm, addr); Modified: stable/9/sys/powerpc/aim/trap_subr64.S ============================================================================== --- stable/9/sys/powerpc/aim/trap_subr64.S Sat Mar 3 02:16:45 2012 (r232430) +++ stable/9/sys/powerpc/aim/trap_subr64.S Sat Mar 3 02:19:33 2012 (r232431) @@ -112,6 +112,9 @@ restore_kernsrs: * r31 scratch * r1 kernel stack * SRR0/1 as at start of trap + * + * NOTE: SPRG1 is never used while the MMU is on, making it safe to reuse + * in any real-mode fault handler, including those handling double faults. */ #define FRAME_SETUP(savearea) \ /* Have to enable translation to allow access of kernel stack: */ \ @@ -120,11 +123,11 @@ restore_kernsrs: std %r30,(savearea+CPUSAVE_SRR0)(%r31); /* save SRR0 */ \ mfsrr1 %r30; \ std %r30,(savearea+CPUSAVE_SRR1)(%r31); /* save SRR1 */ \ + mfsprg1 %r31; /* get saved SP (clears SPRG1) */ \ mfmsr %r30; \ ori %r30,%r30,(PSL_DR|PSL_IR|PSL_RI)@l; /* relocation on */ \ mtmsr %r30; /* stack can now be accessed */ \ isync; \ - mfsprg1 %r31; /* get saved SP */ \ stdu %r31,-(FRAMELEN+288)(%r1); /* save it in the callframe */ \ std %r0, FRAME_0+48(%r1); /* save r0 in the trapframe */ \ std %r31,FRAME_1+48(%r1); /* save SP " " */ \ @@ -201,7 +204,7 @@ restore_kernsrs: mtctr %r4; \ mtxer %r5; \ mtlr %r6; \ - mtsprg1 %r7; /* save cr */ \ + mtsprg2 %r7; /* save cr */ \ ld %r31,FRAME_31+48(%r1); /* restore r0-31 */ \ ld %r30,FRAME_30+48(%r1); \ ld %r29,FRAME_29+48(%r1); \ @@ -235,16 +238,15 @@ restore_kernsrs: ld %r0, FRAME_0+48(%r1); \ ld %r1, FRAME_1+48(%r1); \ /* Can't touch %r1 from here on */ \ - mtsprg2 %r2; /* save r2 & r3 */ \ - mtsprg3 %r3; \ + mtsprg3 %r3; /* save r3 */ \ /* Disable translation, machine check and recoverability: */ \ - mfmsr %r2; \ - andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l; \ - mtmsr %r2; \ + mfmsr %r3; \ + andi. %r3,%r3,~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l; \ + mtmsr %r3; \ isync; \ /* Decide whether we return to user mode: */ \ - GET_CPUINFO(%r2); \ - ld %r3,(savearea+CPUSAVE_SRR1)(%r2); \ + GET_CPUINFO(%r3); \ + ld %r3,(savearea+CPUSAVE_SRR1)(%r3); \ mtcr %r3; \ bf 17,1f; /* branch if PSL_PR is false */ \ /* Restore user SRs */ \ @@ -262,15 +264,15 @@ restore_kernsrs: ld %r29,(savearea+CPUSAVE_R29)(%r3); \ ld %r28,(savearea+CPUSAVE_R28)(%r3); \ ld %r27,(savearea+CPUSAVE_R27)(%r3); \ -1: mfsprg1 %r2; /* restore cr */ \ - mtcr %r2; \ - GET_CPUINFO(%r2); \ - ld %r3,(savearea+CPUSAVE_SRR0)(%r2); /* restore srr0 */ \ +1: mfsprg2 %r3; /* restore cr */ \ + mtcr %r3; \ + GET_CPUINFO(%r3); \ + ld %r3,(savearea+CPUSAVE_SRR0)(%r3); /* restore srr0 */ \ mtsrr0 %r3; \ - ld %r3,(savearea+CPUSAVE_SRR1)(%r2); /* restore srr1 */ \ + GET_CPUINFO(%r3); \ + ld %r3,(savearea+CPUSAVE_SRR1)(%r3); /* restore srr1 */ \ mtsrr1 %r3; \ - mfsprg2 %r2; /* restore r2 & r3 */ \ - mfsprg3 %r3 + mfsprg3 %r3 /* restore r3 */ #ifdef SMP /* @@ -329,6 +331,151 @@ CNAME(trapcode): CNAME(trapsize) = .-CNAME(trapcode) /* + * For SLB misses: do special things for the kernel + * + * Note: SPRG1 is always safe to overwrite any time the MMU is on, which is + * the only time this can be called. + */ + .globl CNAME(slbtrap),CNAME(slbtrapsize) +CNAME(slbtrap): + mtsprg1 %r1 /* save SP */ + GET_CPUINFO(%r1) + std %r2,(PC_SLBSAVE+16)(%r1) + mfcr %r2 /* save CR */ + std %r2,(PC_SLBSAVE+104)(%r1) + mfsrr1 %r2 /* test kernel mode */ + mtcr %r2 + bf 17,1f /* branch if PSL_PR is false */ + /* User mode */ + ld %r2,(PC_SLBSAVE+104)(%r1) /* Restore CR */ + mtcr %r2 + ld %r2,(PC_SLBSAVE+16)(%r1) /* Restore R2 */ + mflr %r1 /* Save the old LR in r1 */ + mtsprg2 %r1 /* And then in SPRG2 */ + li %r1, 0x80 /* How to get the vector from LR */ + bla generictrap /* LR & SPRG3 is exception # */ +1: mflr %r2 /* Save the old LR in r2 */ + bla kern_slbtrap +CNAME(slbtrapsize) = .-CNAME(slbtrap) + +kern_slbtrap: + std %r2,(PC_SLBSAVE+136)(%r1) /* old LR */ + std %r3,(PC_SLBSAVE+24)(%r1) /* save R3 */ + + /* Check if this needs to be handled as a regular trap (userseg miss) */ + mflr %r2 + andi. %r2,%r2,0xff80 + cmpwi %r2,0x380 + bne 1f + mfdar %r2 + b 2f +1: mfsrr0 %r2 +2: /* r2 now contains the fault address */ + lis %r3,SEGMENT_MASK@highesta + ori %r3,%r3,SEGMENT_MASK@highera + sldi %r3,%r3,32 + oris %r3,%r3,SEGMENT_MASK@ha + ori %r3,%r3,SEGMENT_MASK@l + and %r2,%r2,%r3 /* R2 = segment base address */ + lis %r3,USER_ADDR@highesta + ori %r3,%r3,USER_ADDR@highera + sldi %r3,%r3,32 + oris %r3,%r3,USER_ADDR@ha + ori %r3,%r3,USER_ADDR@l + cmpd %r2,%r3 /* Compare fault base to USER_ADDR */ + bne 3f + + /* User seg miss, handle as a regular trap */ + ld %r2,(PC_SLBSAVE+104)(%r1) /* Restore CR */ + mtcr %r2 + ld %r2,(PC_SLBSAVE+16)(%r1) /* Restore R2,R3 */ + ld %r3,(PC_SLBSAVE+24)(%r1) + ld %r1,(PC_SLBSAVE+136)(%r1) /* Save the old LR in r1 */ + mtsprg2 %r1 /* And then in SPRG2 */ + li %r1, 0x80 /* How to get the vector from LR */ + b generictrap /* Retain old LR using b */ + +3: /* Real kernel SLB miss */ + std %r0,(PC_SLBSAVE+0)(%r1) /* free all volatile regs */ + mfsprg1 %r2 /* Old R1 */ + std %r2,(PC_SLBSAVE+8)(%r1) + /* R2,R3 already saved */ + std %r4,(PC_SLBSAVE+32)(%r1) + std %r5,(PC_SLBSAVE+40)(%r1) + std %r6,(PC_SLBSAVE+48)(%r1) + std %r7,(PC_SLBSAVE+56)(%r1) + std %r8,(PC_SLBSAVE+64)(%r1) + std %r9,(PC_SLBSAVE+72)(%r1) + std %r10,(PC_SLBSAVE+80)(%r1) + std %r11,(PC_SLBSAVE+88)(%r1) + std %r12,(PC_SLBSAVE+96)(%r1) + /* CR already saved */ + mfxer %r2 /* save XER */ + std %r2,(PC_SLBSAVE+112)(%r1) + mflr %r2 /* save LR (SP already saved) */ + std %r2,(PC_SLBSAVE+120)(%r1) + mfctr %r2 /* save CTR */ + std %r2,(PC_SLBSAVE+128)(%r1) + + /* Call handler */ + addi %r1,%r1,PC_SLBSTACK-48+1024 + li %r2,~15 + and %r1,%r1,%r2 + lis %r3,tocbase@ha + ld %r2,tocbase@l(%r3) + mflr %r3 + andi. %r3,%r3,0xff80 + mfdar %r4 + mfsrr0 %r5 + bl handle_kernel_slb_spill + nop + + /* Save r28-31, restore r4-r12 */ + GET_CPUINFO(%r1) + ld %r4,(PC_SLBSAVE+32)(%r1) + ld %r5,(PC_SLBSAVE+40)(%r1) + ld %r6,(PC_SLBSAVE+48)(%r1) + ld %r7,(PC_SLBSAVE+56)(%r1) + ld %r8,(PC_SLBSAVE+64)(%r1) + ld %r9,(PC_SLBSAVE+72)(%r1) + ld %r10,(PC_SLBSAVE+80)(%r1) + ld %r11,(PC_SLBSAVE+88)(%r1) + ld %r12,(PC_SLBSAVE+96)(%r1) + std %r28,(PC_SLBSAVE+64)(%r1) + std %r29,(PC_SLBSAVE+72)(%r1) + std %r30,(PC_SLBSAVE+80)(%r1) + std %r31,(PC_SLBSAVE+88)(%r1) + + /* Restore kernel mapping */ + bl restore_kernsrs + + /* Restore remaining registers */ + ld %r28,(PC_SLBSAVE+64)(%r1) + ld %r29,(PC_SLBSAVE+72)(%r1) + ld %r30,(PC_SLBSAVE+80)(%r1) + ld %r31,(PC_SLBSAVE+88)(%r1) + + ld %r2,(PC_SLBSAVE+104)(%r1) + mtcr %r2 + ld %r2,(PC_SLBSAVE+112)(%r1) + mtxer %r2 + ld %r2,(PC_SLBSAVE+120)(%r1) + mtlr %r2 + ld %r2,(PC_SLBSAVE+128)(%r1) + mtctr %r2 + ld %r2,(PC_SLBSAVE+136)(%r1) + mtlr %r2 + + /* Restore r0-r3 */ + ld %r0,(PC_SLBSAVE+0)(%r1) + ld %r2,(PC_SLBSAVE+16)(%r1) + ld %r3,(PC_SLBSAVE+24)(%r1) + mfsprg1 %r1 + + /* Back to whatever we were doing */ + rfid + +/* * For ALI: has to save DSISR and DAR */ .globl CNAME(alitrap),CNAME(alisize) Modified: stable/9/sys/powerpc/include/pcpu.h ============================================================================== --- stable/9/sys/powerpc/include/pcpu.h Sat Mar 3 02:16:45 2012 (r232430) +++ stable/9/sys/powerpc/include/pcpu.h Sat Mar 3 02:19:33 2012 (r232431) @@ -55,7 +55,9 @@ struct pmap; #define PCPU_MD_AIM64_FIELDS \ struct slb pc_slb[64]; \ - struct slb **pc_userslb; + struct slb **pc_userslb; \ + register_t pc_slbsave[18]; \ + uint8_t pc_slbstack[1024]; #ifdef __powerpc64__ #define PCPU_MD_AIM_FIELDS PCPU_MD_AIM64_FIELDS Modified: stable/9/sys/powerpc/powerpc/genassym.c ============================================================================== --- stable/9/sys/powerpc/powerpc/genassym.c Sat Mar 3 02:16:45 2012 (r232430) +++ stable/9/sys/powerpc/powerpc/genassym.c Sat Mar 3 02:19:33 2012 (r232431) @@ -107,8 +107,11 @@ ASSYM(USER_ADDR, USER_ADDR); #ifdef __powerpc64__ ASSYM(PC_KERNSLB, offsetof(struct pcpu, pc_slb)); ASSYM(PC_USERSLB, offsetof(struct pcpu, pc_userslb)); +ASSYM(PC_SLBSAVE, offsetof(struct pcpu, pc_slbsave)); +ASSYM(PC_SLBSTACK, offsetof(struct pcpu, pc_slbstack)); ASSYM(USER_SLB_SLOT, USER_SLB_SLOT); ASSYM(USER_SLB_SLBE, USER_SLB_SLBE); +ASSYM(SEGMENT_MASK, SEGMENT_MASK); #else ASSYM(PM_SR, offsetof(struct pmap, pm_sr)); ASSYM(USER_SR, USER_SR); Modified: stable/9/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- stable/9/sys/powerpc/ps3/platform_ps3.c Sat Mar 3 02:16:45 2012 (r232430) +++ stable/9/sys/powerpc/ps3/platform_ps3.c Sat Mar 3 02:19:33 2012 (r232431) @@ -247,16 +247,6 @@ ps3_real_maxaddr(platform_t plat) static void ps3_cpu_idle(void) { - static volatile int pausing = 0; - - /* - * XXX: It appears that the PS3 can livelock if both threads - * call lv1_pause(0) simultaneously. - */ - if (!atomic_cmpset_int(&pausing, 0, 1)) - return; - lv1_pause(0); - pausing = 0; } From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 02:20:47 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17FA1106564A; Sat, 3 Mar 2012 02:20:47 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0D458FC0A; Sat, 3 Mar 2012 02:20:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q232KkU5058594; Sat, 3 Mar 2012 02:20:46 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q232KkMr058591; Sat, 3 Mar 2012 02:20:46 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203030220.q232KkMr058591@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 3 Mar 2012 02:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232432 - stable/9/sys/boot/powerpc/boot1.chrp X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 02:20:47 -0000 Author: nwhitehorn Date: Sat Mar 3 02:20:46 2012 New Revision: 232432 URL: http://svn.freebsd.org/changeset/base/232432 Log: MFC r231810: Make sure to synchronize icache for the newly loaded loader. Not an issue on most systems, when the relevant icache lines are not full. Modified: stable/9/sys/boot/powerpc/boot1.chrp/Makefile stable/9/sys/boot/powerpc/boot1.chrp/boot1.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) Modified: stable/9/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- stable/9/sys/boot/powerpc/boot1.chrp/Makefile Sat Mar 3 02:19:33 2012 (r232431) +++ stable/9/sys/boot/powerpc/boot1.chrp/Makefile Sat Mar 3 02:20:46 2012 (r232432) @@ -8,17 +8,18 @@ BINDIR?= /boot INSTALLFLAGS= -b FILES= boot1.hfs -SRCS= boot1.c ashldi3.c +SRCS= boot1.c ashldi3.c syncicache.c INTERNALPROG= NO_MAN= CFLAGS= -ffreestanding -msoft-float -Os \ - -I${.CURDIR}/../../common -I${.CURDIR}/../../../ + -I${.CURDIR}/../../common -I${.CURDIR}/../../../ \ + -D_STANDALONE LDFLAGS=-nostdlib -static -N .include "${.CURDIR}/../Makefile.inc" -.PATH: ${.CURDIR}/../../../libkern ${.CURDIR} +.PATH: ${.CURDIR}/../../../libkern ${.CURDIR}/../../../../lib/libc/powerpc/gen ${.CURDIR} # The following inserts out objects into a template HFS # created by generate-hfs.sh Modified: stable/9/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- stable/9/sys/boot/powerpc/boot1.chrp/boot1.c Sat Mar 3 02:19:33 2012 (r232431) +++ stable/9/sys/boot/powerpc/boot1.chrp/boot1.c Sat Mar 3 02:20:46 2012 (r232432) @@ -77,6 +77,8 @@ static int __sputc(char c, void *arg); static char *__uitoa(char *buf, u_int val, int base); static char *__ultoa(char *buf, u_long val, int base); +void __syncicache(void *, int); + /* * Open Firmware interface functions */ @@ -523,6 +525,7 @@ load(const char *fname) } if (ph.p_filesz != ph.p_memsz) bzero(p + ph.p_filesz, ph.p_memsz - ph.p_filesz); + __syncicache(p, ph.p_memsz); } ofw_close(bootdev); (*(void (*)(void *, int, ofwfp_t, char *, int))eh.e_entry)(NULL, 0, From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 02:23:10 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D43D106564A; Sat, 3 Mar 2012 02:23:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5AE58FC18; Sat, 3 Mar 2012 02:23: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 q232N9vA058740; Sat, 3 Mar 2012 02:23:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q232N9kX058737; Sat, 3 Mar 2012 02:23:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203030223.q232N9kX058737@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 3 Mar 2012 02:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232433 - in stable/9/usr.sbin/bsdinstall: distextract distfetch X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 02:23:10 -0000 Author: nwhitehorn Date: Sat Mar 3 02:23:09 2012 New Revision: 232433 URL: http://svn.freebsd.org/changeset/base/232433 Log: MFC r232200: Fix segfault if distfetch and distextract binaries are run standalone without the DISTRIBUTIONS environment variable set. PR: bin/165492 Submitted by: Fernando Apesteguia Modified: stable/9/usr.sbin/bsdinstall/distextract/distextract.c stable/9/usr.sbin/bsdinstall/distfetch/distfetch.c Directory Properties: stable/9/usr.sbin/bsdinstall/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/distextract/distextract.c ============================================================================== --- stable/9/usr.sbin/bsdinstall/distextract/distextract.c Sat Mar 3 02:20:46 2012 (r232432) +++ stable/9/usr.sbin/bsdinstall/distextract/distextract.c Sat Mar 3 02:23:09 2012 (r232433) @@ -38,9 +38,16 @@ static int extract_files(int nfiles, con int main(void) { - char *diststring = strdup(getenv("DISTRIBUTIONS")); + char *diststring; const char **dists; int i, retval, ndists = 0; + + if (getenv("DISTRIBUTIONS") == NULL) { + fprintf(stderr, "DISTRIBUTIONS variable is not set\n"); + return (1); + } + + diststring = strdup(getenv("DISTRIBUTIONS")); for (i = 0; diststring[i] != 0; i++) if (isspace(diststring[i]) && !isspace(diststring[i+1])) ndists++; Modified: stable/9/usr.sbin/bsdinstall/distfetch/distfetch.c ============================================================================== --- stable/9/usr.sbin/bsdinstall/distfetch/distfetch.c Sat Mar 3 02:20:46 2012 (r232432) +++ stable/9/usr.sbin/bsdinstall/distfetch/distfetch.c Sat Mar 3 02:23:09 2012 (r232433) @@ -37,9 +37,16 @@ static int fetch_files(int nfiles, char int main(void) { - char *diststring = strdup(getenv("DISTRIBUTIONS")); + char *diststring; char **urls; int i, nfetched, ndists = 0; + + if (getenv("DISTRIBUTIONS") == NULL) { + fprintf(stderr, "DISTRIBUTIONS variable is not set\n"); + return (1); + } + + diststring = strdup(getenv("DISTRIBUTIONS")); for (i = 0; diststring[i] != 0; i++) if (isspace(diststring[i]) && !isspace(diststring[i+1])) ndists++; From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 02:35:46 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 872A41065672; Sat, 3 Mar 2012 02:35:46 +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 75D958FC16; Sat, 3 Mar 2012 02:35:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q232ZkJd059188; Sat, 3 Mar 2012 02:35:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q232Zka8059186; Sat, 3 Mar 2012 02:35:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201203030235.q232Zka8059186@svn.freebsd.org> From: Xin LI Date: Sat, 3 Mar 2012 02:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232434 - stable/9/etc X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 02:35:46 -0000 Author: delphij Date: Sat Mar 3 02:35:45 2012 New Revision: 232434 URL: http://svn.freebsd.org/changeset/base/232434 Log: MFC r231888: Put the signal trap output to standard error instead of standard output. Without this change, pressing ^T could result in rc.d script putting junk strings like: Script running in configuration files when redirecting standard output to these files. Modified: stable/9/etc/rc.subr Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.subr ============================================================================== --- stable/9/etc/rc.subr Sat Mar 3 02:23:09 2012 (r232433) +++ stable/9/etc/rc.subr Sat Mar 3 02:35:45 2012 (r232434) @@ -1027,9 +1027,9 @@ run_rc_script() if [ -n "$rc_fast_and_loose" ]; then set $_arg; . $_file else - ( trap "echo Script $_file interrupted; kill -QUIT $$" 3 - trap "echo Script $_file interrupted; exit 1" 2 - trap "echo Script $_file running" 29 + ( trap "echo Script $_file interrupted >&2 ; kill -QUIT $$" 3 + trap "echo Script $_file interrupted >&2 ; exit 1" 2 + trap "echo Script $_file running >&2" 29 set $_arg; . $_file ) fi fi From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 05:14:38 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3030106566C; Sat, 3 Mar 2012 05:14:37 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E15D48FC14; Sat, 3 Mar 2012 05:14: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 q235Ebfk064665; Sat, 3 Mar 2012 05:14:37 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q235Ebr2064663; Sat, 3 Mar 2012 05:14:37 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201203030514.q235Ebr2064663@svn.freebsd.org> From: Ken Smith Date: Sat, 3 Mar 2012 05:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232436 - stable/9/usr.sbin/pkg_install/add X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 05:14:38 -0000 Author: kensmith Date: Sat Mar 3 05:14:37 2012 New Revision: 232436 URL: http://svn.freebsd.org/changeset/base/232436 Log: Merge r232435: > Add entry for packages-8.3-release directory. Insta-merge because this is part of the prep work for branching releng/8.3 as part of doing 8.3-RC1. Modified: stable/9/usr.sbin/pkg_install/add/main.c Directory Properties: stable/9/usr.sbin/pkg_install/add/ (props changed) Modified: stable/9/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/9/usr.sbin/pkg_install/add/main.c Sat Mar 3 05:04:47 2012 (r232435) +++ stable/9/usr.sbin/pkg_install/add/main.c Sat Mar 3 05:14:37 2012 (r232436) @@ -87,6 +87,7 @@ struct { { 800000, 800499, "/packages-8.0-release" }, { 801000, 801499, "/packages-8.1-release" }, { 802000, 802499, "/packages-8.2-release" }, + { 803000, 803499, "/packages-8.3-release" }, { 900000, 900499, "/packages-9.0-release" }, { 300000, 399000, "/packages-3-stable" }, { 400000, 499000, "/packages-4-stable" }, From owner-svn-src-stable-9@FreeBSD.ORG Sat Mar 3 10:11:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DDCF106564A; Sat, 3 Mar 2012 10:11:19 +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 1CD7B8FC0C; Sat, 3 Mar 2012 10:11:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q23ABJiI074776; Sat, 3 Mar 2012 10:11:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q23ABInC074774; Sat, 3 Mar 2012 10:11:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203031011.q23ABInC074774@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 3 Mar 2012 10:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232451 - stable/9/sys/i386/linux X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 10:11:19 -0000 Author: kib Date: Sat Mar 3 10:11:18 2012 New Revision: 232451 URL: http://svn.freebsd.org/changeset/base/232451 Log: MFC r232143: Do not write to the user address directly, use suword(). Modified: stable/9/sys/i386/linux/linux_sysvec.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/9/sys/i386/linux/linux_sysvec.c Sat Mar 3 09:19:20 2012 (r232450) +++ stable/9/sys/i386/linux/linux_sysvec.c Sat Mar 3 10:11:18 2012 (r232451) @@ -227,11 +227,11 @@ linux_fixup(register_t **stack_base, str argv = *stack_base; envp = *stack_base + (imgp->args->argc + 1); (*stack_base)--; - **stack_base = (intptr_t)(void *)envp; + suword(*stack_base, (intptr_t)(void *)envp); (*stack_base)--; - **stack_base = (intptr_t)(void *)argv; + suword(*stack_base, (intptr_t)(void *)argv); (*stack_base)--; - **stack_base = imgp->args->argc; + suword(*stack_base, imgp->args->argc); return (0); } @@ -286,7 +286,7 @@ elf_linux_fixup(register_t **stack_base, imgp->auxargs = NULL; (*stack_base)--; - **stack_base = (register_t)imgp->args->argc; + suword(*stack_base, (register_t)imgp->args->argc); return (0); }