From owner-svn-src-stable@FreeBSD.ORG Sun Feb 27 09:12:25 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2749106564A; Sun, 27 Feb 2011 09:12:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF2458FC25; Sun, 27 Feb 2011 09:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1R9COBN063612; Sun, 27 Feb 2011 09:12:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1R9COAT063609; Sun, 27 Feb 2011 09:12:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201102270912.p1R9COAT063609@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Feb 2011 09:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219080 - in stable/8: include share/man/man3 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 09:12:25 -0000 Author: kib Date: Sun Feb 27 09:12:24 2011 New Revision: 219080 URL: http://svn.freebsd.org/changeset/base/219080 Log: MFC r218881: Add restrict keyword to pthread_sigmask prototype and manpage. Modified: stable/8/include/signal.h stable/8/share/man/man3/pthread_sigmask.3 Directory Properties: stable/8/include/ (props changed) stable/8/share/man/man3/ (props changed) Modified: stable/8/include/signal.h ============================================================================== --- stable/8/include/signal.h Sun Feb 27 02:06:09 2011 (r219079) +++ stable/8/include/signal.h Sun Feb 27 09:12:24 2011 (r219080) @@ -73,7 +73,8 @@ int raise(int); #if __POSIX_VISIBLE || __XSI_VISIBLE int kill(__pid_t, int); int pthread_kill(__pthread_t, int); -int pthread_sigmask(int, const __sigset_t *, __sigset_t *); +int pthread_sigmask(int, const __sigset_t * __restrict, + __sigset_t * __restrict); int sigaction(int, const struct sigaction * __restrict, struct sigaction * __restrict); int sigaddset(sigset_t *, int); Modified: stable/8/share/man/man3/pthread_sigmask.3 ============================================================================== --- stable/8/share/man/man3/pthread_sigmask.3 Sun Feb 27 02:06:09 2011 (r219079) +++ stable/8/share/man/man3/pthread_sigmask.3 Sun Feb 27 09:12:24 2011 (r219080) @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 27, 2000 +.Dd February 19, 2011 .Dt PTHREAD_SIGMASK 3 .Os .Sh NAME @@ -38,7 +38,8 @@ .In pthread.h .In signal.h .Ft int -.Fn pthread_sigmask "int how" "const sigset_t *set" "sigset_t *oset" +.Fn pthread_sigmask "int how" "const sigset_t * restrict set" \ + "sigset_t * restrict oset" .Sh DESCRIPTION The .Fn pthread_sigmask From owner-svn-src-stable@FreeBSD.ORG Sun Feb 27 17:30:45 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA5AE1065677; Sun, 27 Feb 2011 17:30:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9A9E8FC15; Sun, 27 Feb 2011 17:30:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RHUjjD096316; Sun, 27 Feb 2011 17:30:45 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RHUjc3096314; Sun, 27 Feb 2011 17:30:45 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201102271730.p1RHUjc3096314@svn.freebsd.org> From: Glen Barber Date: Sun, 27 Feb 2011 17:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219087 - stable/8/sbin/newfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 17:30:45 -0000 Author: gjb (doc committer) Date: Sun Feb 27 17:30:45 2011 New Revision: 219087 URL: http://svn.freebsd.org/changeset/base/219087 Log: MFC 212498: Rewording and typo fixes in newfs(8). PR: 150490 Modified: stable/8/sbin/newfs/newfs.8 Directory Properties: stable/8/sbin/newfs/ (props changed) Modified: stable/8/sbin/newfs/newfs.8 ============================================================================== --- stable/8/sbin/newfs/newfs.8 Sun Feb 27 17:14:06 2011 (r219086) +++ stable/8/sbin/newfs/newfs.8 Sun Feb 27 17:30:45 2011 (r219087) @@ -79,10 +79,10 @@ The following options define the general Erase the content of the disk before making the filesystem. The reserved area in front of the superblock (for bootcode) will not be erased. -This is a relevant option for flash based storage devices that use -wear levelling algorithms. +This option is only relevant for flash based storage devices that use +wear-leveling algorithms. -NB: Erasing may take as long time as writing every sector on the disk. +Erasing may take a long time as it writes to every sector on the disk. .It Fl J Enable journaling on the new file system via gjournal. See From owner-svn-src-stable@FreeBSD.ORG Sun Feb 27 18:23:28 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C05C11065675; Sun, 27 Feb 2011 18:23:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE9B88FC21; Sun, 27 Feb 2011 18:23:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RINSsg098052; Sun, 27 Feb 2011 18:23:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RINS5l098050; Sun, 27 Feb 2011 18:23:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201102271823.p1RINS5l098050@svn.freebsd.org> From: Glen Barber Date: Sun, 27 Feb 2011 18:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219088 - stable/8/sbin/quotacheck X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 18:23:28 -0000 Author: gjb (doc committer) Date: Sun Feb 27 18:23:28 2011 New Revision: 219088 URL: http://svn.freebsd.org/changeset/base/219088 Log: MFC 205076 [1]: Fix reference to fsck(8). PR: 154215 Submitted by: Mats Erik Andersson (debian of gisladisker se) Obtained from: uqs [1] Modified: stable/8/sbin/quotacheck/quotacheck.8 Directory Properties: stable/8/sbin/quotacheck/ (props changed) Modified: stable/8/sbin/quotacheck/quotacheck.8 ============================================================================== --- stable/8/sbin/quotacheck/quotacheck.8 Sun Feb 27 17:30:45 2011 (r219087) +++ stable/8/sbin/quotacheck/quotacheck.8 Sun Feb 27 18:23:28 2011 (r219088) @@ -82,7 +82,7 @@ is zero, parallel passes are run as per .Xr fsck 8 . This option is deprecated and parallel passes are always run as per -.Xf fsck 8. +.Xr fsck 8 . .It Fl u Only user quotas listed in .Pa /etc/fstab From owner-svn-src-stable@FreeBSD.ORG Mon Feb 28 16:39:16 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3900C1065672; Mon, 28 Feb 2011 16:39:16 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D83F8FC23; Mon, 28 Feb 2011 16:39:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SGdGfN045492; Mon, 28 Feb 2011 16:39:16 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SGdFPf045488; Mon, 28 Feb 2011 16:39:15 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201102281639.p1SGdFPf045488@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 28 Feb 2011 16:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219099 - stable/8/sys/dev/mps X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 16:39:16 -0000 Author: ken Date: Mon Feb 28 16:39:15 2011 New Revision: 219099 URL: http://svn.freebsd.org/changeset/base/219099 Log: MFC: r219036 Silence 'out of chain frames' warnings and bump the number of frames. mps.c: Hide the 'out of chain frames' warning behind MPS_INFO. mps_sas.c: Hide the SIM queue freeze/unfreeze messages behind MPS_INFO. mpsvar.h: Bump the number of chain frames from 1024 to 2048. From testing, it looks like this makes it less likely that we'll run out of chain frames, and it doesn't cost much memory (32K). Modified: stable/8/sys/dev/mps/mps.c stable/8/sys/dev/mps/mps_sas.c stable/8/sys/dev/mps/mpsvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mps/mps.c ============================================================================== --- stable/8/sys/dev/mps/mps.c Mon Feb 28 15:58:30 2011 (r219098) +++ stable/8/sys/dev/mps/mps.c Mon Feb 28 16:39:15 2011 (r219099) @@ -1705,7 +1705,7 @@ mps_data_cb(void *arg, bus_dma_segment_t sflags, nsegs - i); if (error != 0) { /* Resource shortage, roll back! */ - mps_printf(sc, "out of chain frames\n"); + mps_dprint(sc, MPS_INFO, "out of chain frames\n"); cm->cm_flags |= MPS_CM_FLAGS_CHAIN_FAILED; mps_complete_command(cm); return; Modified: stable/8/sys/dev/mps/mps_sas.c ============================================================================== --- stable/8/sys/dev/mps/mps_sas.c Mon Feb 28 15:58:30 2011 (r219098) +++ stable/8/sys/dev/mps/mps_sas.c Mon Feb 28 16:39:15 2011 (r219099) @@ -1542,8 +1542,8 @@ mpssas_scsiio_complete(struct mps_softc if ((sassc->flags & MPSSAS_QUEUE_FROZEN) == 0) { xpt_freeze_simq(sassc->sim, 1); sassc->flags |= MPSSAS_QUEUE_FROZEN; - mps_printf(sc, "Error sending command, freezing " - "SIM queue\n"); + mps_dprint(sc, MPS_INFO, "Error sending command, " + "freezing SIM queue\n"); } } @@ -1556,7 +1556,8 @@ mpssas_scsiio_complete(struct mps_softc if (sassc->flags & MPSSAS_QUEUE_FROZEN) { ccb->ccb_h.status |= CAM_RELEASE_SIMQ; sassc->flags &= ~MPSSAS_QUEUE_FROZEN; - mps_printf(sc, "Unfreezing SIM queue\n"); + mps_dprint(sc, MPS_INFO, + "Unfreezing SIM queue\n"); } } else { ccb->ccb_h.status |= CAM_DEV_QFRZN; Modified: stable/8/sys/dev/mps/mpsvar.h ============================================================================== --- stable/8/sys/dev/mps/mpsvar.h Mon Feb 28 15:58:30 2011 (r219098) +++ stable/8/sys/dev/mps/mpsvar.h Mon Feb 28 16:39:15 2011 (r219099) @@ -34,7 +34,7 @@ #define MPS_REQ_FRAMES 1024 #define MPS_EVT_REPLY_FRAMES 32 #define MPS_REPLY_FRAMES MPS_REQ_FRAMES -#define MPS_CHAIN_FRAMES 1024 +#define MPS_CHAIN_FRAMES 2048 #define MPS_SENSE_LEN SSD_FULL_SIZE #define MPS_MSI_COUNT 1 #define MPS_SGE64_SIZE 12 From owner-svn-src-stable@FreeBSD.ORG Mon Feb 28 21:21:25 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 567AF1065674; Mon, 28 Feb 2011 21:21:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4429F8FC14; Mon, 28 Feb 2011 21:21:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SLLPvE052215; Mon, 28 Feb 2011 21:21:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SLLPNK052212; Mon, 28 Feb 2011 21:21:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282121.p1SLLPNK052212@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 21:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219104 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 21:21:25 -0000 Author: yongari Date: Mon Feb 28 21:21:24 2011 New Revision: 219104 URL: http://svn.freebsd.org/changeset/base/219104 Log: MFC r217857: Prefer MSI-X to MSI on controllers that support MSI-X. All recent PCIe controllers(RTL8102E or later and RTL8168/8111C or later) supports either 2 or 4 MSI-X messages. Unfortunately vendor did not publicly release RSS related information yet. However switching to MSI-X is one-step forward to support RSS. Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Feb 28 20:55:41 2011 (r219103) +++ stable/8/sys/dev/re/if_re.c Mon Feb 28 21:21:24 2011 (r219104) @@ -159,6 +159,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); +static int msix_disable = 0; +TUNABLE_INT("hw.re.msix_disable", &msix_disable); static int prefer_iomap = 0; TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap); @@ -1176,7 +1178,7 @@ re_attach(device_t dev) int hwrev; u_int16_t devid, re_did = 0; int error = 0, i, phy, rid; - int msic, reg; + int msic, msixc, reg; uint8_t cfg; sc = device_get_softc(dev); @@ -1226,18 +1228,51 @@ re_attach(device_t dev) sc->rl_btag = rman_get_bustag(sc->rl_res); sc->rl_bhandle = rman_get_bushandle(sc->rl_res); - msic = 0; - if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { + msic = pci_msi_count(dev); + msixc = pci_msix_count(dev); + if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) sc->rl_flags |= RL_FLAG_PCIE; - msic = pci_msi_count(dev); - if (bootverbose) - device_printf(dev, "MSI count : %d\n", msic); + if (bootverbose) { + device_printf(dev, "MSI count : %d\n", msic); + device_printf(dev, "MSI-X count : %d\n", msixc); + } + if (msix_disable > 0) + msixc = 0; + if (msi_disable > 0) + msic = 0; + /* Prefer MSI-X to MSI. */ + if (msixc > 0) { + msixc = 1; + rid = PCIR_BAR(4); + sc->rl_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->rl_res_pba == NULL) { + device_printf(sc->rl_dev, + "could not allocate MSI-X PBA resource\n"); + } + if (sc->rl_res_pba != NULL && + pci_alloc_msix(dev, &msixc) == 0) { + if (msixc == 1) { + device_printf(dev, "Using %d MSI-X message\n", + msixc); + sc->rl_flags |= RL_FLAG_MSIX; + } else + pci_release_msi(dev); + } + if ((sc->rl_flags & RL_FLAG_MSIX) == 0) { + if (sc->rl_res_pba != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->rl_res_pba); + sc->rl_res_pba = NULL; + msixc = 0; + } } - if (msic > 0 && msi_disable == 0) { + /* Prefer MSI to INTx. */ + if (msixc == 0 && msic > 0) { msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { - device_printf(dev, "Using %d MSI messages\n", + device_printf(dev, "Using %d MSI message\n", msic); sc->rl_flags |= RL_FLAG_MSI; /* Explicitly set MSI enable bit. */ @@ -1249,10 +1284,12 @@ re_attach(device_t dev) } else pci_release_msi(dev); } + if ((sc->rl_flags & RL_FLAG_MSI) == 0) + msic = 0; } /* Allocate interrupt */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { rid = 0; sc->rl_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -1539,7 +1576,7 @@ re_attach(device_t dev) #endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); @@ -1631,7 +1668,7 @@ re_detach(device_t dev) } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { if (sc->rl_irq[0] != NULL) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq[0]); @@ -1647,6 +1684,10 @@ re_detach(device_t dev) } pci_release_msi(dev); } + if (sc->rl_res_pba) { + rid = PCIR_BAR(4); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); + } if (sc->rl_res) bus_release_resource(dev, sc->rl_res_type, sc->rl_res_id, sc->rl_res); Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Mon Feb 28 20:55:41 2011 (r219103) +++ stable/8/sys/pci/if_rlreg.h Mon Feb 28 21:21:24 2011 (r219104) @@ -864,6 +864,7 @@ struct rl_softc { struct resource *rl_res; int rl_res_id; int rl_res_type; + struct resource *rl_res_pba; struct resource *rl_irq[RL_MSI_MESSAGES]; void *rl_intrhand[RL_MSI_MESSAGES]; device_t rl_miibus; @@ -908,6 +909,7 @@ struct rl_softc { #define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_CMDSTOP 0x0200 #define RL_FLAG_MACRESET 0x0400 +#define RL_FLAG_MSIX 0x0800 #define RL_FLAG_WOLRXENB 0x1000 #define RL_FLAG_MACSLEEP 0x2000 #define RL_FLAG_PCIE 0x4000 From owner-svn-src-stable@FreeBSD.ORG Mon Feb 28 21:25:35 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD5CF106564A; Mon, 28 Feb 2011 21:25:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AF3F8FC0A; Mon, 28 Feb 2011 21:25:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SLPZqO052354; Mon, 28 Feb 2011 21:25:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SLPZhx052351; Mon, 28 Feb 2011 21:25:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282125.p1SLPZhx052351@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 21:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219105 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 21:25:35 -0000 Author: yongari Date: Mon Feb 28 21:25:35 2011 New Revision: 219105 URL: http://svn.freebsd.org/changeset/base/219105 Log: MFC r217857: Prefer MSI-X to MSI on controllers that support MSI-X. All recent PCIe controllers(RTL8102E or later and RTL8168/8111C or later) supports either 2 or 4 MSI-X messages. Unfortunately vendor did not publicly release RSS related information yet. However switching to MSI-X is one-step forward to support RSS. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Mon Feb 28 21:21:24 2011 (r219104) +++ stable/7/sys/dev/re/if_re.c Mon Feb 28 21:25:35 2011 (r219105) @@ -159,6 +159,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); +static int msix_disable = 0; +TUNABLE_INT("hw.re.msix_disable", &msix_disable); static int prefer_iomap = 0; TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap); @@ -1177,7 +1179,7 @@ re_attach(device_t dev) int hwrev; u_int16_t devid, re_did = 0; int error = 0, i, phy, rid; - int msic, reg; + int msic, msixc, reg; uint8_t cfg; sc = device_get_softc(dev); @@ -1227,18 +1229,51 @@ re_attach(device_t dev) sc->rl_btag = rman_get_bustag(sc->rl_res); sc->rl_bhandle = rman_get_bushandle(sc->rl_res); - msic = 0; - if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { + msic = pci_msi_count(dev); + msixc = pci_msix_count(dev); + if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) sc->rl_flags |= RL_FLAG_PCIE; - msic = pci_msi_count(dev); - if (bootverbose) - device_printf(dev, "MSI count : %d\n", msic); + if (bootverbose) { + device_printf(dev, "MSI count : %d\n", msic); + device_printf(dev, "MSI-X count : %d\n", msixc); + } + if (msix_disable > 0) + msixc = 0; + if (msi_disable > 0) + msic = 0; + /* Prefer MSI-X to MSI. */ + if (msixc > 0) { + msixc = 1; + rid = PCIR_BAR(4); + sc->rl_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->rl_res_pba == NULL) { + device_printf(sc->rl_dev, + "could not allocate MSI-X PBA resource\n"); + } + if (sc->rl_res_pba != NULL && + pci_alloc_msix(dev, &msixc) == 0) { + if (msixc == 1) { + device_printf(dev, "Using %d MSI-X message\n", + msixc); + sc->rl_flags |= RL_FLAG_MSIX; + } else + pci_release_msi(dev); + } + if ((sc->rl_flags & RL_FLAG_MSIX) == 0) { + if (sc->rl_res_pba != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->rl_res_pba); + sc->rl_res_pba = NULL; + msixc = 0; + } } - if (msic > 0 && msi_disable == 0) { + /* Prefer MSI to INTx. */ + if (msixc == 0 && msic > 0) { msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { - device_printf(dev, "Using %d MSI messages\n", + device_printf(dev, "Using %d MSI message\n", msic); sc->rl_flags |= RL_FLAG_MSI; /* Explicitly set MSI enable bit. */ @@ -1250,10 +1285,12 @@ re_attach(device_t dev) } else pci_release_msi(dev); } + if ((sc->rl_flags & RL_FLAG_MSI) == 0) + msic = 0; } /* Allocate interrupt */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { rid = 0; sc->rl_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -1540,7 +1577,7 @@ re_attach(device_t dev) #endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); @@ -1632,7 +1669,7 @@ re_detach(device_t dev) } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { if (sc->rl_irq[0] != NULL) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq[0]); @@ -1648,6 +1685,10 @@ re_detach(device_t dev) } pci_release_msi(dev); } + if (sc->rl_res_pba) { + rid = PCIR_BAR(4); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); + } if (sc->rl_res) bus_release_resource(dev, sc->rl_res_type, sc->rl_res_id, sc->rl_res); Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Mon Feb 28 21:21:24 2011 (r219104) +++ stable/7/sys/pci/if_rlreg.h Mon Feb 28 21:25:35 2011 (r219105) @@ -864,6 +864,7 @@ struct rl_softc { struct resource *rl_res; int rl_res_id; int rl_res_type; + struct resource *rl_res_pba; struct resource *rl_irq[RL_MSI_MESSAGES]; void *rl_intrhand[RL_MSI_MESSAGES]; device_t rl_miibus; @@ -908,6 +909,7 @@ struct rl_softc { #define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_CMDSTOP 0x0200 #define RL_FLAG_MACRESET 0x0400 +#define RL_FLAG_MSIX 0x0800 #define RL_FLAG_WOLRXENB 0x1000 #define RL_FLAG_MACSLEEP 0x2000 #define RL_FLAG_PCIE 0x4000 From owner-svn-src-stable@FreeBSD.ORG Mon Feb 28 23:28:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A376106564A; Mon, 28 Feb 2011 23:28:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242698FC08; Mon, 28 Feb 2011 23:28:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SNSa27059970; Mon, 28 Feb 2011 23:28:36 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNSZZK059958; Mon, 28 Feb 2011 23:28:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201102282328.p1SNSZZK059958@svn.freebsd.org> From: Robert Watson Date: Mon, 28 Feb 2011 23:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219107 - in stable/8/sys: amd64/amd64 amd64/include boot/common cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:28:36 -0000 Author: rwatson Date: Mon Feb 28 23:28:35 2011 New Revision: 219107 URL: http://svn.freebsd.org/changeset/base/219107 Log: Merge userspace DTrace support from head to stable/8: r209721: Merge from vendor-sys/opensolaris: * add fasttrap files r209731: Introduce USD_{SET,GET}{BASE,LIMIT}. These help setting up the user segment descriptor hi and lo values. Idea from Solaris. Reviewed by: kib r209763: Fix style issues with the previous commit, namely use-tab-instead-of-space and don't use underscores in macro variables. Pointed out by: bde r210292: Fix typo in comment. r210357: MFamd64: Add USD_GETBASE(), USD_SETBASE(), USD_GETLIMIT() and USD_SETLIMIT(). r210611: Bump the witness pendlist to 768 to accomodate the increased number of spinlocks. r211553: Add sysname to struct opensolaris_utsname. This is needed by one DTrace test. r211566: Add a sysname char * to struct opensolaris_utsname. r211606: Add the FreeBSD definition for the fasttrap ioctls. r211607: Add a function compatibility function dtrace_instr_size_isa() that on FreeBSD does the same as dtrace_dis_isize(). r211608: Kernel DTrace support for: o uregs (sson@) o ustack (sson@) o /dev/dtrace/helper device (needed for USDT probes) r211610: Add more compatibility structure members needed by the upcoming fasttrap DTrace device. r211611: Destroy the helper device when unloading. r211613: Fix style issues. r211614: Bump KDTRACE_THREAD_ZERO and use M_ZERO as a malloc flag instead of calling bzero. r211615: Remove an elif and add an or-clause. r211616: Add an extra comment to the SDT probes definition. This allows us to get use '-' in probe names, matching the probe names in Solaris. Add userland SDT probes definitions to sys/sdt.h. r211617: Call the systrace_probe_func() when the error value. r211618: Port this to FreeBSD. We miss some suword functions, so we use copyout. r211738: Port the fasttrap provider to FreeBSD. This provider is responsible for injecting debugging probes in the userland programs and is the basis for the pid provider and the usdt provider. r211744: MD fasttrap implementation. r211745: Replace a pksignal() call with tdksignal(). Pointed out by: kib r211746: Update for the recent location of the fasttrap code. r211747: Replace structure assignments with explicity memcpy calls. This allows Clang to compile this file: it was using the builtin memcpy and we want to use the memcpy defined in gptboot.c. (Clang can't compile boot2 yet). Submitted by: Dimitry Andric Reviewed by: jhb r211751: Add a trap code for DTrace induced traps. r211752: Add two DTrace trap type values. Used by fasttrap. r211753: Enable fasttrap and make dtraceall depend on fasttrap when building i386 or amd64. r211804: Call the necessary DTrace function pointers when we have different kinds of traps. r211813: Add the necessary DTrace function pointers. r211839: Sync DTrace bits with amd64 and fix the build. r211924: Register an interrupt vector for DTrace return probes. There is some code missing in lapic to make sure that we don't overwrite this entry, but this will be done on a sequent commit. r211925: Replace a memory barrier with a mutex barrier. r211926: Add the path necessary to find fasttrap_isa.h to CFLAGS. r211929: Remove debugging. r212004: When DTrace is enabled, make sure we don't overwrite the IDT_DTRACE_RET entry with an IRQ for some hardware component. Reviewed by: jhb r212093: Make the /dev/dtrace/helper node have the mode 0660. This allows programs that refuse to run as root (pgsql) to install probes when their user is part of the wheel group. r212357: Fix two bugs in DTrace: * when the process exits, remove the associated USDT probes * when the process forks, duplicate the USDT probes. r212465: Avoid a LOR (sleepable after non-sleepable) in fasttrap_tracepoint_enable(). r212494: Revamp locking a bit. This fixes three problems: * processes now can't go away while we are inserting probes (fixes a panic) * if a trap happens, we won't be holding the process lock (fixes a hang) * fix a LOR between the process lock and the fasttrap bucket list lock Thanks to kib for pointing some problems. r212568: Bump __FreeBSD_version to reflect the userland DTrace changes Sponsored by: The FreeBSD Foundation Userspace DTrace work by: rpaulo Added: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h - copied, changed from r209721, head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/intel/dtrace/ - copied from r209721, head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/ stable/8/sys/cddl/contrib/opensolaris/uts/sparc/dtrace/ - copied from r209721, head/sys/cddl/contrib/opensolaris/uts/sparc/dtrace/ stable/8/sys/cddl/dev/dtrace/amd64/regset.h - copied unchanged from r211608, head/sys/cddl/dev/dtrace/amd64/regset.h stable/8/sys/cddl/dev/dtrace/i386/regset.h - copied unchanged from r211608, head/sys/cddl/dev/dtrace/i386/regset.h Modified: stable/8/sys/amd64/amd64/exception.S stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/amd64/trap.c stable/8/sys/amd64/include/segments.h stable/8/sys/amd64/include/trap.h stable/8/sys/boot/common/ufsread.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c stable/8/sys/cddl/compat/opensolaris/sys/misc.h stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h stable/8/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c stable/8/sys/cddl/dev/dtrace/amd64/instr_size.c stable/8/sys/cddl/dev/dtrace/dtrace_cddl.h stable/8/sys/cddl/dev/dtrace/dtrace_ioctl.c stable/8/sys/cddl/dev/dtrace/dtrace_load.c stable/8/sys/cddl/dev/dtrace/dtrace_unload.c stable/8/sys/cddl/dev/dtrace/i386/dtrace_isa.c stable/8/sys/cddl/dev/dtrace/i386/instr_size.c stable/8/sys/cddl/dev/systrace/systrace.c stable/8/sys/i386/i386/exception.s stable/8/sys/i386/i386/machdep.c stable/8/sys/i386/i386/trap.c stable/8/sys/i386/include/segments.h stable/8/sys/i386/include/trap.h stable/8/sys/kern/kern_dtrace.c stable/8/sys/kern/kern_exec.c stable/8/sys/kern/kern_exit.c stable/8/sys/kern/kern_fork.c stable/8/sys/kern/kern_priv.c stable/8/sys/kern/kern_proc.c stable/8/sys/kern/kern_sig.c stable/8/sys/kern/kern_timeout.c stable/8/sys/kern/subr_trap.c stable/8/sys/kern/subr_witness.c stable/8/sys/kern/vfs_cache.c stable/8/sys/kern/vfs_lookup.c stable/8/sys/kern/vfs_syscalls.c stable/8/sys/modules/dtrace/Makefile stable/8/sys/modules/dtrace/dtrace/Makefile stable/8/sys/modules/dtrace/dtraceall/dtraceall.c stable/8/sys/modules/dtrace/fasttrap/Makefile stable/8/sys/net/vnet.c stable/8/sys/opencrypto/deflate.c stable/8/sys/security/mac/mac_framework.c stable/8/sys/security/mac/mac_internal.h stable/8/sys/sys/dtrace_bsd.h stable/8/sys/sys/param.h stable/8/sys/sys/priv.h stable/8/sys/sys/sdt.h stable/8/sys/sys/signal.h stable/8/sys/sys/sysent.h stable/8/sys/tools/vnode_if.awk stable/8/sys/x86/x86/local_apic.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/exception.S ============================================================================== --- stable/8/sys/amd64/amd64/exception.S Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/amd64/exception.S Mon Feb 28 23:28:35 2011 (r219107) @@ -108,6 +108,10 @@ IDTVEC(dbg) TRAP_NOEN(T_TRCTRAP) IDTVEC(bpt) TRAP_NOEN(T_BPTFLT) +#ifdef KDTRACE_HOOKS +IDTVEC(dtrace_ret) + TRAP_NOEN(T_DTRACE_RET) +#endif /* Regular traps; The cpu does not supply tf_err for these. */ #define TRAP(a) \ Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/amd64/machdep.c Mon Feb 28 23:28:35 2011 (r219107) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_msgbuf.h" #include "opt_perfmon.h" #include "opt_sched.h" +#include "opt_kdtrace.h" #include #include @@ -1094,6 +1095,9 @@ extern inthand_t IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), IDTVEC(xmm), IDTVEC(dblfault), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif IDTVEC(fast_syscall), IDTVEC(fast_syscall32); #ifdef DDB @@ -1624,6 +1628,9 @@ hammer_time(u_int64_t modulep, u_int64_t setidt(IDT_AC, &IDTVEC(align), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_MC, &IDTVEC(mchk), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_XF, &IDTVEC(xmm), SDT_SYSIGT, SEL_KPL, 0); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYSIGT, SEL_UPL, 0); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; Modified: stable/8/sys/amd64/amd64/trap.c ============================================================================== --- stable/8/sys/amd64/amd64/trap.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/amd64/trap.c Mon Feb 28 23:28:35 2011 (r219107) @@ -113,6 +113,13 @@ dtrace_doubletrap_func_t dtrace_doubletr * implementation opaque. */ systrace_probe_func_t systrace_probe_func; + +/* + * These hooks are necessary for the pid, usdt and fasttrap providers. + */ +dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif extern void trap(struct trapframe *frame); @@ -243,6 +250,55 @@ trap(struct trapframe *frame) if (dtrace_trap_func != NULL) if ((*dtrace_trap_func)(frame, type)) goto out; + if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || + type == T_BPTFLT) { + struct reg regs; + + regs.r_r15 = frame->tf_r15; + regs.r_r14 = frame->tf_r14; + regs.r_r13 = frame->tf_r13; + regs.r_r12 = frame->tf_r12; + regs.r_r11 = frame->tf_r11; + regs.r_r10 = frame->tf_r10; + regs.r_r9 = frame->tf_r9; + regs.r_r8 = frame->tf_r8; + regs.r_rdi = frame->tf_rdi; + regs.r_rsi = frame->tf_rsi; + regs.r_rbp = frame->tf_rbp; + regs.r_rbx = frame->tf_rbx; + regs.r_rdx = frame->tf_rdx; + regs.r_rcx = frame->tf_rcx; + regs.r_rax = frame->tf_rax; + regs.r_rip = frame->tf_rip; + regs.r_cs = frame->tf_cs; + regs.r_rflags = frame->tf_rflags; + regs.r_rsp = frame->tf_rsp; + regs.r_ss = frame->tf_ss; + if (frame->tf_flags & TF_HASSEGS) { + regs.r_ds = frame->tf_ds; + regs.r_es = frame->tf_es; + regs.r_fs = frame->tf_fs; + regs.r_gs = frame->tf_gs; + } else { + regs.r_ds = 0; + regs.r_es = 0; + regs.r_fs = 0; + regs.r_gs = 0; + } + if (type == T_DTRACE_PROBE && + dtrace_fasttrap_probe_ptr != NULL && + dtrace_fasttrap_probe_ptr(®s) == 0) + goto out; + if (type == T_BPTFLT && + dtrace_pid_probe_ptr != NULL && + dtrace_pid_probe_ptr(®s) == 0) + goto out; + if (type == T_DTRACE_RET && + dtrace_return_probe_ptr != NULL && + dtrace_return_probe_ptr(®s) == 0) + goto out; + + } #endif if ((frame->tf_rflags & PSL_I) == 0) { Modified: stable/8/sys/amd64/include/segments.h ============================================================================== --- stable/8/sys/amd64/include/segments.h Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/include/segments.h Mon Feb 28 23:28:35 2011 (r219107) @@ -74,6 +74,13 @@ struct user_segment_descriptor { u_int64_t sd_hibase:8; /* segment base address (msb) */ } __packed; +#define USD_GETBASE(sd) (((sd)->sd_lobase) | (sd)->sd_hibase << 24) +#define USD_SETBASE(sd, b) (sd)->sd_lobase = (b); \ + (sd)->sd_hibase = ((b) >> 24); +#define USD_GETLIMIT(sd) (((sd)->sd_lolimit) | (sd)->sd_hilimit << 16) +#define USD_SETLIMIT(sd, l) (sd)->sd_lolimit = (l); \ + (sd)->sd_hilimit = ((l) >> 16); + /* * System segment descriptors (128 bit wide) */ @@ -207,6 +214,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ +#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: stable/8/sys/amd64/include/trap.h ============================================================================== --- stable/8/sys/amd64/include/trap.h Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/include/trap.h Mon Feb 28 23:28:35 2011 (r219107) @@ -62,6 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ +#define T_DTRACE_RET 31 /* DTrace pid return */ +#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/boot/common/ufsread.c Mon Feb 28 23:28:35 2011 (r219107) @@ -223,14 +223,19 @@ fsread(ino_t inode, void *buf, size_t nb return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); #elif defined(UFS2_ONLY) - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); #else if (fs->fs_magic == FS_UFS1_MAGIC) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); else - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); + #endif inomap = inode; fs_off = 0; Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c Mon Feb 28 23:28:35 2011 (r219107) @@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$"); char hw_serial[11] = "0"; struct opensolaris_utsname utsname = { - .nodename = "unset" + .nodename = "unset", + .sysname = "SunOS" }; int Modified: stable/8/sys/cddl/compat/opensolaris/sys/misc.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/misc.h Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/cddl/compat/opensolaris/sys/misc.h Mon Feb 28 23:28:35 2011 (r219107) @@ -46,6 +46,7 @@ #ifdef _KERNEL struct opensolaris_utsname { char *nodename; + char *sysname; }; extern char hw_serial[11]; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 28 23:28:35 2011 (r219107) @@ -551,20 +551,16 @@ static void dtrace_enabling_provide(dtra static int dtrace_enabling_match(dtrace_enabling_t *, int *); static void dtrace_enabling_matchall(void); static dtrace_state_t *dtrace_anon_grab(void); -#if defined(sun) static uint64_t dtrace_helper(int, dtrace_mstate_t *, dtrace_state_t *, uint64_t, uint64_t); static dtrace_helpers_t *dtrace_helpers_create(proc_t *); -#endif static void dtrace_buffer_drop(dtrace_buffer_t *); static intptr_t dtrace_buffer_reserve(dtrace_buffer_t *, size_t, size_t, dtrace_state_t *, dtrace_mstate_t *); static int dtrace_state_option(dtrace_state_t *, dtrace_optid_t, dtrace_optval_t); static int dtrace_ecb_create_enable(dtrace_probe_t *, void *); -#if defined(sun) static void dtrace_helper_provider_destroy(dtrace_helper_provider_t *); -#endif uint16_t dtrace_load16(uintptr_t); uint32_t dtrace_load32(uintptr_t); uint64_t dtrace_load64(uintptr_t); @@ -2784,6 +2780,21 @@ dtrace_dif_variable(dtrace_mstate_t *mst return (dtrace_getreg(lwp->lwp_regs, ndx)); return (0); } +#else + case DIF_VAR_UREGS: { + struct trapframe *tframe; + + if (!dtrace_priv_proc(state)) + return (0); + + if ((tframe = curthread->td_frame) == NULL) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = 0; + return (0); + } + + return (dtrace_getreg(tframe, ndx)); + } #endif case DIF_VAR_CURTHREAD: @@ -2839,7 +2850,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst } return (mstate->dtms_stackdepth); -#if defined(sun) case DIF_VAR_USTACKDEPTH: if (!dtrace_priv_proc(state)) return (0); @@ -2859,7 +2869,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst mstate->dtms_present |= DTRACE_MSTATE_USTACKDEPTH; } return (mstate->dtms_ustackdepth); -#endif case DIF_VAR_CALLER: if (!dtrace_priv_kernel(state)) @@ -2896,7 +2905,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst } return (mstate->dtms_caller); -#if defined(sun) case DIF_VAR_UCALLER: if (!dtrace_priv_proc(state)) return (0); @@ -2920,7 +2928,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst } return (mstate->dtms_ucaller); -#endif case DIF_VAR_PROBEPROV: ASSERT(mstate->dtms_present & DTRACE_MSTATE_PROBE); @@ -5736,7 +5743,6 @@ dtrace_action_chill(dtrace_mstate_t *mst cpu->cpu_dtrace_chilled += val; } -#if defined(sun) static void dtrace_action_ustack(dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t *buf, uint64_t arg) @@ -5849,7 +5855,6 @@ dtrace_action_ustack(dtrace_mstate_t *ms out: mstate->dtms_scratch_ptr = old; } -#endif /* * If you're looking for the epicenter of DTrace, you just found it. This @@ -6172,7 +6177,6 @@ dtrace_probe(dtrace_id_t id, uintptr_t a (uint32_t *)arg0); continue; -#if defined(sun) case DTRACEACT_JSTACK: case DTRACEACT_USTACK: if (!dtrace_priv_proc(state)) @@ -6214,7 +6218,6 @@ dtrace_probe(dtrace_id_t id, uintptr_t a DTRACE_USTACK_NFRAMES(rec->dtrd_arg) + 1); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); continue; -#endif default: break; @@ -8141,7 +8144,6 @@ dtrace_helper_provide(dof_helper_t *dhp, dtrace_enabling_matchall(); } -#if defined(sun) static void dtrace_helper_provider_remove_one(dof_helper_t *dhp, dof_sec_t *sec, pid_t pid) { @@ -8189,7 +8191,6 @@ dtrace_helper_provider_remove(dof_helper dtrace_helper_provider_remove_one(dhp, sec, pid); } } -#endif /* * DTrace Meta Provider-to-Framework API Functions @@ -8729,7 +8730,6 @@ dtrace_difo_validate(dtrace_difo_t *dp, return (err); } -#if defined(sun) /* * Validate a DTrace DIF object that it is to be used as a helper. Helpers * are much more constrained than normal DIFOs. Specifically, they may @@ -8887,7 +8887,6 @@ dtrace_difo_validate_helper(dtrace_difo_ return (err); } -#endif /* * Returns 1 if the expression in the DIF object can be cached on a per-thread @@ -9219,7 +9218,6 @@ dtrace_difo_init(dtrace_difo_t *dp, dtra dtrace_difo_hold(dp); } -#if defined(sun) static dtrace_difo_t * dtrace_difo_duplicate(dtrace_difo_t *dp, dtrace_vstate_t *vstate) { @@ -9263,7 +9261,6 @@ dtrace_difo_duplicate(dtrace_difo_t *dp, dtrace_difo_init(new, vstate); return (new); } -#endif static void dtrace_difo_destroy(dtrace_difo_t *dp, dtrace_vstate_t *vstate) @@ -13791,7 +13788,6 @@ dtrace_anon_property(void) } } -#if defined(sun) /* * DTrace Helper Functions */ @@ -13855,9 +13851,7 @@ dtrace_helper_trace(dtrace_helper_action ((uint64_t *)(uintptr_t)svar->dtsv_data)[curcpu]; } } -#endif -#if defined(sun) static uint64_t dtrace_helper(int which, dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t arg0, uint64_t arg1) @@ -13865,7 +13859,7 @@ dtrace_helper(int which, dtrace_mstate_t uint16_t *flags = &cpu_core[curcpu].cpuc_dtrace_flags; uint64_t sarg0 = mstate->dtms_arg[0]; uint64_t sarg1 = mstate->dtms_arg[1]; - uint64_t rval; + uint64_t rval = 0; dtrace_helpers_t *helpers = curproc->p_dtrace_helpers; dtrace_helper_action_t *helper; dtrace_vstate_t *vstate; @@ -14056,9 +14050,7 @@ dtrace_helper_destroygen(int gen) return (0); } -#endif -#if defined(sun) static int dtrace_helper_validate(dtrace_helper_action_t *helper) { @@ -14073,9 +14065,7 @@ dtrace_helper_validate(dtrace_helper_act return (err == 0); } -#endif -#if defined(sun) static int dtrace_helper_action_add(int which, dtrace_ecbdesc_t *ep) { @@ -14622,12 +14612,17 @@ dtrace_helpers_create(proc_t *p) return (help); } -static void -dtrace_helpers_destroy(void) +#if defined(sun) +static +#endif +void +dtrace_helpers_destroy(proc_t *p) { dtrace_helpers_t *help; dtrace_vstate_t *vstate; +#if defined(sun) proc_t *p = curproc; +#endif int i; mutex_enter(&dtrace_lock); @@ -14714,7 +14709,10 @@ dtrace_helpers_destroy(void) mutex_exit(&dtrace_lock); } -static void +#if defined(sun) +static +#endif +void dtrace_helpers_duplicate(proc_t *from, proc_t *to) { dtrace_helpers_t *help, *newhelp; @@ -14795,7 +14793,6 @@ dtrace_helpers_duplicate(proc_t *from, p if (hasprovs) dtrace_helper_provider_register(to, newhelp, NULL); } -#endif #if defined(sun) /* @@ -16466,6 +16463,7 @@ _fini(void) #else static d_ioctl_t dtrace_ioctl; +static d_ioctl_t dtrace_ioctl_helper; static void dtrace_load(void *); static int dtrace_unload(void); #if __FreeBSD_version < 800039 @@ -16474,6 +16472,7 @@ static struct clonedevs *dtrace_clones; static eventhandler_tag eh_tag; /* Event handler tag. */ #else static struct cdev *dtrace_dev; +static struct cdev *helper_dev; #endif void dtrace_invop_init(void); @@ -16488,6 +16487,13 @@ static struct cdevsw dtrace_cdevsw = { .d_name = "dtrace", }; +static struct cdevsw helper_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE | D_NEEDMINOR, + .d_ioctl = dtrace_ioctl_helper, + .d_name = "helper", +}; + #include #if __FreeBSD_version < 800039 #include Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 28 23:28:35 2011 (r219107) @@ -17,6 +17,10 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END + * + * Portions Copyright 2010 The FreeBSD Foundation + * + * $FreeBSD$ */ /* @@ -24,7 +28,9 @@ * Use is subject to license terms. */ +#if defined(sun) #pragma ident "%Z%%M% %I% %E% SMI" +#endif #include #include @@ -32,11 +38,15 @@ #include #include #include +#if defined(sun) #include +#endif #include #include #include +#if defined(sun) #include +#endif #include #include #include @@ -44,9 +54,17 @@ #include #include #include -#include #include +#if defined(sun) #include +#endif +#include +#include +#if !defined(sun) +#include +#include +#include +#endif /* * User-Land Trap-Based Tracing @@ -125,11 +143,20 @@ * never hold the provider lock and creation lock simultaneously */ -static dev_info_t *fasttrap_devi; +static d_open_t fasttrap_open; +static d_ioctl_t fasttrap_ioctl; + +static struct cdevsw fasttrap_cdevsw = { + .d_version = D_VERSION, + .d_open = fasttrap_open, + .d_ioctl = fasttrap_ioctl, + .d_name = "fasttrap", +}; +static struct cdev *fasttrap_cdev; static dtrace_meta_provider_id_t fasttrap_meta_id; -static timeout_id_t fasttrap_timeout; -static kmutex_t fasttrap_cleanup_mtx; +static struct callout fasttrap_timeout; +static struct mtx fasttrap_cleanup_mtx; static uint_t fasttrap_cleanup_work; /* @@ -181,6 +208,10 @@ static void fasttrap_proc_release(fasttr #define FASTTRAP_PROCS_INDEX(pid) ((pid) & fasttrap_procs.fth_mask) +#if !defined(sun) +static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU]; +#endif + static int fasttrap_highbit(ulong_t i) { @@ -229,6 +260,7 @@ fasttrap_hash_str(const char *p) void fasttrap_sigtrap(proc_t *p, kthread_t *t, uintptr_t pc) { +#if defined(sun) sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); sqp->sq_info.si_signo = SIGTRAP; @@ -241,6 +273,17 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t if (t != NULL) aston(t); +#else + ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); + + ksiginfo_init(ksi); + ksi->ksi_signo = SIGTRAP; + ksi->ksi_code = TRAP_DTRACE; + ksi->ksi_addr = (caddr_t)pc; + PROC_LOCK(p); + (void) tdksignal(t, SIGTRAP, ksi); + PROC_UNLOCK(p); +#endif } /* @@ -257,9 +300,9 @@ fasttrap_mod_barrier(uint64_t gen) fasttrap_mod_gen++; - for (i = 0; i < NCPU; i++) { - mutex_enter(&cpu_core[i].cpuc_pid_lock); - mutex_exit(&cpu_core[i].cpuc_pid_lock); + CPU_FOREACH(i) { + mutex_enter(&fasttrap_cpuc_pid_lock[i]); + mutex_exit(&fasttrap_cpuc_pid_lock[i]); } } @@ -274,16 +317,15 @@ fasttrap_pid_cleanup_cb(void *data) fasttrap_provider_t **fpp, *fp; fasttrap_bucket_t *bucket; dtrace_provider_id_t provid; - int i, later; + int i, later = 0; static volatile int in = 0; ASSERT(in == 0); in = 1; - mutex_enter(&fasttrap_cleanup_mtx); while (fasttrap_cleanup_work) { fasttrap_cleanup_work = 0; - mutex_exit(&fasttrap_cleanup_mtx); + mtx_unlock(&fasttrap_cleanup_mtx); later = 0; @@ -349,10 +391,12 @@ fasttrap_pid_cleanup_cb(void *data) mutex_exit(&bucket->ftb_mtx); } - mutex_enter(&fasttrap_cleanup_mtx); + mtx_lock(&fasttrap_cleanup_mtx); } +#if 0 ASSERT(fasttrap_timeout != 0); +#endif /* * If we were unable to remove a retired provider, try again after @@ -364,14 +408,17 @@ fasttrap_pid_cleanup_cb(void *data) * get a chance to do that work if and when the timeout is reenabled * (if detach fails). */ - if (later > 0 && fasttrap_timeout != (timeout_id_t)1) - fasttrap_timeout = timeout(&fasttrap_pid_cleanup_cb, NULL, hz); + if (later > 0 && callout_active(&fasttrap_timeout)) + callout_reset(&fasttrap_timeout, hz, &fasttrap_pid_cleanup_cb, + NULL); else if (later > 0) fasttrap_cleanup_work = 1; - else - fasttrap_timeout = 0; + else { +#if !defined(sun) + /* Nothing to be done for FreeBSD */ +#endif + } - mutex_exit(&fasttrap_cleanup_mtx); in = 0; } @@ -381,11 +428,11 @@ fasttrap_pid_cleanup_cb(void *data) static void fasttrap_pid_cleanup(void) { - mutex_enter(&fasttrap_cleanup_mtx); + + mtx_lock(&fasttrap_cleanup_mtx); fasttrap_cleanup_work = 1; - if (fasttrap_timeout == 0) - fasttrap_timeout = timeout(&fasttrap_pid_cleanup_cb, NULL, 1); - mutex_exit(&fasttrap_cleanup_mtx); + callout_reset(&fasttrap_timeout, 1, &fasttrap_pid_cleanup_cb, NULL); + mtx_unlock(&fasttrap_cleanup_mtx); } /* @@ -400,9 +447,35 @@ fasttrap_fork(proc_t *p, proc_t *cp) pid_t ppid = p->p_pid; int i; +#if defined(sun) ASSERT(curproc == p); ASSERT(p->p_proc_flag & P_PR_LOCK); +#else + PROC_LOCK_ASSERT(p, MA_OWNED); +#endif +#if defined(sun) ASSERT(p->p_dtrace_count > 0); +#else + if (p->p_dtrace_helpers) { + /* + * dtrace_helpers_duplicate() allocates memory. + */ + _PHOLD(cp); + PROC_UNLOCK(p); + PROC_UNLOCK(cp); + dtrace_helpers_duplicate(p, cp); + PROC_LOCK(cp); + PROC_LOCK(p); + _PRELE(cp); + } + /* + * This check is purposely here instead of in kern_fork.c because, + * for legal resons, we cannot include the dtrace_cddl.h header + * inside kern_fork.c and insert if-clause there. + */ + if (p->p_dtrace_count == 0) + return; +#endif ASSERT(cp->p_dtrace_count == 0); /* @@ -419,9 +492,13 @@ fasttrap_fork(proc_t *p, proc_t *cp) * We don't have to worry about the child process disappearing * because we're in fork(). */ - mutex_enter(&cp->p_lock); +#if defined(sun) + mtx_lock_spin(&cp->p_slock); sprlock_proc(cp); - mutex_exit(&cp->p_lock); + mtx_unlock_spin(&cp->p_slock); +#else + _PHOLD(cp); +#endif /* * Iterate over every tracepoint looking for ones that belong to the @@ -451,8 +528,12 @@ fasttrap_fork(proc_t *p, proc_t *cp) mutex_exit(&bucket->ftb_mtx); } +#if defined(sun) mutex_enter(&cp->p_lock); sprunlock(cp); +#else + _PRELE(cp); +#endif } /* @@ -463,24 +544,30 @@ fasttrap_fork(proc_t *p, proc_t *cp) static void fasttrap_exec_exit(proc_t *p) { +#if defined(sun) ASSERT(p == curproc); - ASSERT(MUTEX_HELD(&p->p_lock)); - - mutex_exit(&p->p_lock); +#endif + PROC_LOCK_ASSERT(p, MA_OWNED); + _PHOLD(p); + PROC_UNLOCK(p); /* * We clean up the pid provider for this process here; user-land * static probes are handled by the meta-provider remove entry point. */ fasttrap_provider_retire(p->p_pid, FASTTRAP_PID_NAME, 0); - - mutex_enter(&p->p_lock); +#if !defined(sun) + if (p->p_dtrace_helpers) + dtrace_helpers_destroy(p); +#endif + PROC_LOCK(p); + _PRELE(p); } /*ARGSUSED*/ static void -fasttrap_pid_provide(void *arg, const dtrace_probedesc_t *desc) +fasttrap_pid_provide(void *arg, dtrace_probedesc_t *desc) { /* * There are no "default" pid probes. @@ -504,7 +591,9 @@ fasttrap_tracepoint_enable(proc_t *p, fa ASSERT(probe->ftp_tps[index].fit_tp->ftt_pid == pid); +#if defined(sun) ASSERT(!(p->p_flag & SVFORK)); +#endif /* * Before we make any modifications, make sure we've imposed a barrier @@ -610,7 +699,9 @@ again: * Increment the count of the number of tracepoints active in * the victim process. */ +#if defined(sun) ASSERT(p->p_proc_flag & P_PR_LOCK); +#endif p->p_dtrace_count++; return (rc); @@ -666,7 +757,7 @@ fasttrap_tracepoint_disable(proc_t *p, f fasttrap_bucket_t *bucket; fasttrap_provider_t *provider = probe->ftp_prov; fasttrap_tracepoint_t **pp, *tp; - fasttrap_id_t *id, **idp; + fasttrap_id_t *id, **idp = NULL; pid_t pid; uintptr_t pc; @@ -800,7 +891,9 @@ fasttrap_tracepoint_disable(proc_t *p, f * Decrement the count of the number of tracepoints active * in the victim process. */ +#if defined(sun) ASSERT(p->p_proc_flag & P_PR_LOCK); +#endif p->p_dtrace_count--; } @@ -851,26 +944,31 @@ fasttrap_enable_callbacks(void) static void fasttrap_disable_callbacks(void) { +#if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); +#endif + mutex_enter(&fasttrap_count_mtx); ASSERT(fasttrap_pid_count > 0); fasttrap_pid_count--; if (fasttrap_pid_count == 0) { +#if defined(sun) cpu_t *cur, *cpu = CPU; for (cur = cpu->cpu_next_onln; cur != cpu; cur = cur->cpu_next_onln) { rw_enter(&cur->cpu_ft_lock, RW_WRITER); } - +#endif dtrace_pid_probe_ptr = NULL; dtrace_return_probe_ptr = NULL; - +#if defined(sun) for (cur = cpu->cpu_next_onln; cur != cpu; cur = cur->cpu_next_onln) { rw_exit(&cur->cpu_ft_lock); } +#endif } mutex_exit(&fasttrap_count_mtx); } @@ -880,13 +978,16 @@ static void fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg) { fasttrap_probe_t *probe = parg; - proc_t *p; + proc_t *p = NULL; int i, rc; + ASSERT(probe != NULL); ASSERT(!probe->ftp_enabled); ASSERT(id == probe->ftp_id); +#if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); +#endif /* * Increment the count of enabled probes on this probe's provider; @@ -911,6 +1012,7 @@ fasttrap_pid_enable(void *arg, dtrace_id * a fork in which the traced process is being born and we're copying * USDT probes. Otherwise, the process is gone so bail. */ +#if defined(sun) if ((p = sprlock(probe->ftp_pid)) == NULL) { if ((curproc->p_flag & SFORKING) == 0) return; @@ -934,12 +1036,23 @@ fasttrap_pid_enable(void *arg, dtrace_id ASSERT(!(p->p_flag & SVFORK)); mutex_exit(&p->p_lock); +#else + if ((p = pfind(probe->ftp_pid)) == NULL) + return; +#endif /* * We have to enable the trap entry point before any user threads have * the chance to execute the trap instruction we're about to place * in their process's text. */ +#ifdef __FreeBSD__ + /* + * pfind() returns a locked process. + */ + _PHOLD(p); + PROC_UNLOCK(p); +#endif fasttrap_enable_callbacks(); /* @@ -967,8 +1080,12 @@ fasttrap_pid_enable(void *arg, dtrace_id i--; } +#if defined(sun) mutex_enter(&p->p_lock); sprunlock(p); +#else + PRELE(p); +#endif /* * Since we're not actually enabling this probe, @@ -978,9 +1095,12 @@ fasttrap_pid_enable(void *arg, dtrace_id return; } } - +#if defined(sun) mutex_enter(&p->p_lock); sprunlock(p); +#else + PRELE(p); +#endif probe->ftp_enabled = 1; } @@ -996,18 +1116,22 @@ fasttrap_pid_disable(void *arg, dtrace_i ASSERT(id == probe->ftp_id); + mutex_enter(&provider->ftp_mtx); + /* * We won't be able to acquire a /proc-esque lock on the process * iff the process is dead and gone. In this case, we rely on the * provider lock as a point of mutual exclusion to prevent other * DTrace consumers from disabling this probe. */ - if ((p = sprlock(probe->ftp_pid)) != NULL) { - ASSERT(!(p->p_flag & SVFORK)); - mutex_exit(&p->p_lock); + if ((p = pfind(probe->ftp_pid)) == NULL) { + mutex_exit(&provider->ftp_mtx); + return; } - - mutex_enter(&provider->ftp_mtx); +#ifdef __FreeBSD__ + _PHOLD(p); + PROC_UNLOCK(p); +#endif /* * Disable all the associated tracepoints (for fully enabled probes). @@ -1030,9 +1154,6 @@ fasttrap_pid_disable(void *arg, dtrace_i if (provider->ftp_retired && !provider->ftp_marked) whack = provider->ftp_marked = 1; mutex_exit(&provider->ftp_mtx); - - mutex_enter(&p->p_lock); - sprunlock(p); } else { /* * If the process is dead, we're just waiting for the @@ -1046,12 +1167,17 @@ fasttrap_pid_disable(void *arg, dtrace_i if (whack) fasttrap_pid_cleanup(); +#ifdef __FreeBSD__ + PRELE(p); +#endif if (!probe->ftp_enabled) return; probe->ftp_enabled = 0; +#if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); +#endif fasttrap_disable_callbacks(); } @@ -1163,6 +1289,7 @@ fasttrap_proc_lookup(pid_t pid) fasttrap_bucket_t *bucket; fasttrap_proc_t *fprc, *new_fprc; + bucket = &fasttrap_procs.fth_table[FASTTRAP_PROCS_INDEX(pid)]; mutex_enter(&bucket->ftb_mtx); @@ -1189,6 +1316,10 @@ fasttrap_proc_lookup(pid_t pid) new_fprc->ftpc_pid = pid; new_fprc->ftpc_rcount = 1; new_fprc->ftpc_acount = 1; +#if !defined(sun) + mutex_init(&new_fprc->ftpc_mtx, "fasttrap proc mtx", MUTEX_DEFAULT, + NULL); +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Feb 28 23:36:03 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8DE01065697; Mon, 28 Feb 2011 23:36:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A67ED8FC20; Mon, 28 Feb 2011 23:36:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SNa3IA060558; Mon, 28 Feb 2011 23:36:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNa3fF060555; Mon, 28 Feb 2011 23:36:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282336.p1SNa3fF060555@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 23:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219108 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:36:03 -0000 Author: yongari Date: Mon Feb 28 23:36:03 2011 New Revision: 219108 URL: http://svn.freebsd.org/changeset/base/219108 Log: MFC r217868: Remove TX taskqueue and directly invoke re_start in interrupt task. Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Feb 28 23:28:35 2011 (r219107) +++ stable/8/sys/dev/re/if_re.c Mon Feb 28 23:36:03 2011 (r219108) @@ -254,9 +254,9 @@ static int re_poll_locked (struct ifnet #endif static int re_intr (void *); static void re_tick (void *); -static void re_tx_task (void *, int); static void re_int_task (void *, int); static void re_start (struct ifnet *); +static void re_start_locked (struct ifnet *); static int re_ioctl (struct ifnet *, u_long, caddr_t); static void re_init (void *); static void re_init_locked (struct rl_softc *); @@ -1524,7 +1524,6 @@ re_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = RL_IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - TASK_INIT(&sc->rl_txtask, 1, re_tx_task, ifp); TASK_INIT(&sc->rl_inttask, 0, re_int_task, sc); /* @@ -1634,7 +1633,6 @@ re_detach(device_t dev) RL_UNLOCK(sc); callout_drain(&sc->rl_stat_callout); taskqueue_drain(taskqueue_fast, &sc->rl_inttask); - taskqueue_drain(taskqueue_fast, &sc->rl_txtask); /* * Force off the IFF_UP flag here, in case someone * still had a BPF descriptor attached to this @@ -2365,7 +2363,7 @@ re_poll_locked(struct ifnet *ifp, enum p re_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ u_int16_t status; @@ -2468,7 +2466,7 @@ re_int_task(void *arg, int npending) } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); RL_UNLOCK(sc); @@ -2673,19 +2671,21 @@ re_encap(struct rl_softc *sc, struct mbu } static void -re_tx_task(void *arg, int npending) +re_start(struct ifnet *ifp) { - struct ifnet *ifp; + struct rl_softc *sc; - ifp = arg; - re_start(ifp); + sc = ifp->if_softc; + RL_LOCK(sc); + re_start_locked(ifp); + RL_UNLOCK(sc); } /* * Main transmit routine for C+ and gigE NICs. */ static void -re_start(struct ifnet *ifp) +re_start_locked(struct ifnet *ifp) { struct rl_softc *sc; struct mbuf *m_head; @@ -2693,13 +2693,9 @@ re_start(struct ifnet *ifp) sc = ifp->if_softc; - RL_LOCK(sc); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) { - RL_UNLOCK(sc); + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) return; - } for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && sc->rl_ldata.rl_tx_free > 1;) { @@ -2729,7 +2725,6 @@ re_start(struct ifnet *ifp) if (sc->rl_ldata.rl_tx_free != sc->rl_ldata.rl_tx_desc_cnt) CSR_WRITE_4(sc, RL_TIMERCNT, 1); #endif - RL_UNLOCK(sc); return; } @@ -2757,8 +2752,6 @@ re_start(struct ifnet *ifp) * Set a timeout in case the chip goes out to lunch. */ sc->rl_watchdog_timer = 5; - - RL_UNLOCK(sc); } static void @@ -3278,7 +3271,7 @@ re_watchdog(struct rl_softc *sc) if_printf(ifp, "watchdog timeout (missed Tx interrupts) " "-- recovering\n"); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); return; } @@ -3289,7 +3282,7 @@ re_watchdog(struct rl_softc *sc) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); } /* Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:28:35 2011 (r219107) +++ stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:36:03 2011 (r219108) @@ -893,7 +893,6 @@ struct rl_softc { int rxcycles; #endif - struct task rl_txtask; struct task rl_inttask; int rl_txstart; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 28 23:37:38 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E73BD106566B; Mon, 28 Feb 2011 23:37:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4F468FC0A; Mon, 28 Feb 2011 23:37:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SNbcjd060684; Mon, 28 Feb 2011 23:37:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNbcRO060681; Mon, 28 Feb 2011 23:37:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282337.p1SNbcRO060681@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 23:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219109 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:37:39 -0000 Author: yongari Date: Mon Feb 28 23:37:38 2011 New Revision: 219109 URL: http://svn.freebsd.org/changeset/base/219109 Log: MFC r217868: Remove TX taskqueue and directly invoke re_start in interrupt task. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Mon Feb 28 23:36:03 2011 (r219108) +++ stable/7/sys/dev/re/if_re.c Mon Feb 28 23:37:38 2011 (r219109) @@ -254,9 +254,9 @@ static void re_poll_locked (struct ifnet #endif static int re_intr (void *); static void re_tick (void *); -static void re_tx_task (void *, int); static void re_int_task (void *, int); static void re_start (struct ifnet *); +static void re_start_locked (struct ifnet *); static int re_ioctl (struct ifnet *, u_long, caddr_t); static void re_init (void *); static void re_init_locked (struct rl_softc *); @@ -1525,7 +1525,6 @@ re_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = RL_IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - TASK_INIT(&sc->rl_txtask, 1, re_tx_task, ifp); TASK_INIT(&sc->rl_inttask, 0, re_int_task, sc); /* @@ -1635,7 +1634,6 @@ re_detach(device_t dev) RL_UNLOCK(sc); callout_drain(&sc->rl_stat_callout); taskqueue_drain(taskqueue_fast, &sc->rl_inttask); - taskqueue_drain(taskqueue_fast, &sc->rl_txtask); /* * Force off the IFF_UP flag here, in case someone * still had a BPF descriptor attached to this @@ -2360,7 +2358,7 @@ re_poll_locked(struct ifnet *ifp, enum p re_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ u_int16_t status; @@ -2462,7 +2460,7 @@ re_int_task(void *arg, int npending) } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); RL_UNLOCK(sc); @@ -2667,19 +2665,21 @@ re_encap(struct rl_softc *sc, struct mbu } static void -re_tx_task(void *arg, int npending) +re_start(struct ifnet *ifp) { - struct ifnet *ifp; + struct rl_softc *sc; - ifp = arg; - re_start(ifp); + sc = ifp->if_softc; + RL_LOCK(sc); + re_start_locked(ifp); + RL_UNLOCK(sc); } /* * Main transmit routine for C+ and gigE NICs. */ static void -re_start(struct ifnet *ifp) +re_start_locked(struct ifnet *ifp) { struct rl_softc *sc; struct mbuf *m_head; @@ -2687,13 +2687,9 @@ re_start(struct ifnet *ifp) sc = ifp->if_softc; - RL_LOCK(sc); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) { - RL_UNLOCK(sc); + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) return; - } for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && sc->rl_ldata.rl_tx_free > 1;) { @@ -2723,7 +2719,6 @@ re_start(struct ifnet *ifp) if (sc->rl_ldata.rl_tx_free != sc->rl_ldata.rl_tx_desc_cnt) CSR_WRITE_4(sc, RL_TIMERCNT, 1); #endif - RL_UNLOCK(sc); return; } @@ -2751,8 +2746,6 @@ re_start(struct ifnet *ifp) * Set a timeout in case the chip goes out to lunch. */ sc->rl_watchdog_timer = 5; - - RL_UNLOCK(sc); } static void @@ -3272,7 +3265,7 @@ re_watchdog(struct rl_softc *sc) if_printf(ifp, "watchdog timeout (missed Tx interrupts) " "-- recovering\n"); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); return; } @@ -3283,7 +3276,7 @@ re_watchdog(struct rl_softc *sc) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); } /* Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Mon Feb 28 23:36:03 2011 (r219108) +++ stable/7/sys/pci/if_rlreg.h Mon Feb 28 23:37:38 2011 (r219109) @@ -893,7 +893,6 @@ struct rl_softc { int rxcycles; #endif - struct task rl_txtask; struct task rl_inttask; int rl_txstart; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 28 23:41:27 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F12C71065670; Mon, 28 Feb 2011 23:41:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE2D98FC08; Mon, 28 Feb 2011 23:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SNfRsq060995; Mon, 28 Feb 2011 23:41:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNfRis060992; Mon, 28 Feb 2011 23:41:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282341.p1SNfRis060992@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 23:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219110 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:41:28 -0000 Author: yongari Date: Mon Feb 28 23:41:27 2011 New Revision: 219110 URL: http://svn.freebsd.org/changeset/base/219110 Log: MFC r217902: Do not use interrupt taskqueue on controllers with MSI/MSI-X capability. One of reason using interrupt taskqueue in re(4) was to reduce number of TX/RX interrupts under load because re(4) controllers have no good TX/RX interrupt moderation mechanism. Basic TX interrupt moderation is done by hardware for most controllers but RX interrupt moderation through undocumented register showed poor RX performance so it was disabled in r215025. Using taskqueue to handle RX interrupt greatly reduced number of interrupts but re(4) consumed all available CPU cycles to run the taskqueue under high TX/RX network load. This can happen even with RTL810x fast ethernet controller and I believe this is not acceptable for most systems. To mitigate the issue, use one-shot timer register to moderate RX interrupts. The timer register provides programmable one-shot timer and can be used to suppress interrupt generation. The timer runs at 125MHZ on PCIe controllers so the minimum time allowed for the timer is 8ns. Data sheet says the register is 32 bits but experimentation shows only lower 13 bits are valid so maximum time that can be programmed is 65.528us. This yields theoretical maximum number of RX interrupts that could be generated per second is about 15260. Combined with TX completion interrupts re(4) shall generate less than 20k interrupts. This number is still slightly high compared to other intelligent ethernet controllers but system is very responsive even under high network load. Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount of time to delay RX interrupt processing in units of us. Value 0 completely disables RX interrupt moderation. To provide old behavior for controllers that have MSI/MSI-X capability, introduce a new tunable hw.re.intr_filter. If the tunable is set to non-zero value, driver will use interrupt taskqueue. The default value of the tunable is 0. This tunable has no effect on controllers that has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled by administrator. While I'm here cleanup interrupt setup/teardown since re(4) uses single MSI/MSI-X message at this moment. Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Feb 28 23:37:38 2011 (r219109) +++ stable/8/sys/dev/re/if_re.c Mon Feb 28 23:41:27 2011 (r219110) @@ -157,6 +157,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); #include "miibus_if.h" /* Tunables. */ +static int intr_filter = 0; +TUNABLE_INT("hw.re.intr_filter", &intr_filter); static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); static int msix_disable = 0; @@ -253,6 +255,7 @@ static int re_poll (struct ifnet *, enu static int re_poll_locked (struct ifnet *, enum poll_cmd, int); #endif static int re_intr (void *); +static void re_intr_msi (void *); static void re_tick (void *); static void re_int_task (void *, int); static void re_start (struct ifnet *); @@ -290,6 +293,8 @@ static int re_diag (struct rl_softc *); static void re_add_sysctls (struct rl_softc *); static int re_sysctl_stats (SYSCTL_HANDLER_ARGS); +static int sysctl_int_range (SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_re_int_mod (SYSCTL_HANDLER_ARGS); static device_method_t re_methods[] = { /* Device interface */ @@ -1574,19 +1579,19 @@ re_attach(device_t dev) } #endif +#ifdef RE_TX_MODERATION + intr_filter = 1; +#endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + error = bus_setup_intr(dev, sc->rl_irq[0], + INTR_TYPE_NET | INTR_MPSAFE, NULL, re_intr_msi, sc, + &sc->rl_intrhand[0]); + } else { error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); - else { - for (i = 0; i < RL_MSI_MESSAGES; i++) { - error = bus_setup_intr(dev, sc->rl_irq[i], - INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, - &sc->rl_intrhand[i]); - if (error != 0) - break; - } } if (error) { device_printf(dev, "couldn't set up irq\n"); @@ -1657,31 +1662,22 @@ re_detach(device_t dev) * stopped here. */ - for (i = 0; i < RL_MSI_MESSAGES; i++) { - if (sc->rl_intrhand[i] != NULL) { - bus_teardown_intr(dev, sc->rl_irq[i], - sc->rl_intrhand[i]); - sc->rl_intrhand[i] = NULL; - } + if (sc->rl_intrhand[0] != NULL) { + bus_teardown_intr(dev, sc->rl_irq[0], sc->rl_intrhand[0]); + sc->rl_intrhand[0] = NULL; } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { - if (sc->rl_irq[0] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, 0, - sc->rl_irq[0]); - sc->rl_irq[0] = NULL; - } - } else { - for (i = 0, rid = 1; i < RL_MSI_MESSAGES; i++, rid++) { - if (sc->rl_irq[i] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, rid, - sc->rl_irq[i]); - sc->rl_irq[i] = NULL; - } - } - pci_release_msi(dev); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + rid = 0; + else + rid = 1; + if (sc->rl_irq[0] != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->rl_irq[0]); + sc->rl_irq[0] = NULL; } + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0) + pci_release_msi(dev); if (sc->rl_res_pba) { rid = PCIR_BAR(4); bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); @@ -1970,6 +1966,7 @@ re_rx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -1993,6 +1990,7 @@ re_jrx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -2478,6 +2476,87 @@ re_int_task(void *arg, int npending) CSR_WRITE_2(sc, RL_IMR, RL_INTRS_CPLUS); } +static void +re_intr_msi(void *xsc) +{ + struct rl_softc *sc; + struct ifnet *ifp; + uint16_t intrs, status; + + sc = xsc; + RL_LOCK(sc); + + ifp = sc->rl_ifp; +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + RL_UNLOCK(sc); + return; + } +#endif + /* Disable interrupts. */ + CSR_WRITE_2(sc, RL_IMR, 0); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + RL_UNLOCK(sc); + return; + } + + intrs = RL_INTRS_CPLUS; + status = CSR_READ_2(sc, RL_ISR); + CSR_WRITE_2(sc, RL_ISR, status); + if (sc->rl_int_rx_act > 0) { + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + status &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + } + + if (status & (RL_ISR_TIMEOUT_EXPIRED | RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) { + re_rxeof(sc, NULL); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (sc->rl_int_rx_mod != 0 && + (status & (RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) != 0) { + /* Rearm one-shot timer. */ + CSR_WRITE_4(sc, RL_TIMERCNT, 1); + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN); + sc->rl_int_rx_act = 1; + } else { + intrs |= RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN; + sc->rl_int_rx_act = 0; + } + } + } + + /* + * Some chips will ignore a second TX request issued + * while an existing transmission is in progress. If + * the transmitter goes idle but there are still + * packets waiting to be sent, we need to restart the + * channel here to flush them out. This only seems to + * be required with the PCIe devices. + */ + if ((status & (RL_ISR_TX_OK | RL_ISR_TX_DESC_UNAVAIL)) && + (sc->rl_flags & RL_FLAG_PCIE)) + CSR_WRITE_1(sc, sc->rl_txstart, RL_TXSTART_START); + if (status & (RL_ISR_TX_OK | RL_ISR_TX_ERR | RL_ISR_TX_DESC_UNAVAIL)) + re_txeof(sc); + + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + re_init_locked(sc); + } + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + re_start_locked(ifp); + CSR_WRITE_2(sc, RL_IMR, intrs); + } + RL_UNLOCK(sc); +} + static int re_encap(struct rl_softc *sc, struct mbuf **m_head) { @@ -3007,18 +3086,35 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); #endif -#ifdef RE_TX_MODERATION /* * Initialize the timer interrupt register so that * a timer interrupt will be generated once the timer * reaches a certain number of ticks. The timer is - * reloaded on each transmit. This gives us TX interrupt + * reloaded on each transmit. + */ +#ifdef RE_TX_MODERATION + /* + * Use timer interrupt register to moderate TX interrupt * moderation, which dramatically improves TX frame rate. */ if (sc->rl_type == RL_8169) CSR_WRITE_4(sc, RL_TIMERINT_8169, 0x800); else CSR_WRITE_4(sc, RL_TIMERINT, 0x400); +#else + /* + * Use timer interrupt register to moderate RX interrupt + * moderation. + */ + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, + RL_USECS(sc->rl_int_rx_mod)); + } else { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, RL_USECS(0)); + } #endif /* @@ -3535,6 +3631,7 @@ re_add_sysctls(struct rl_softc *sc) { struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; + int error; ctx = device_get_sysctl_ctx(sc->rl_dev); children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev)); @@ -3542,6 +3639,26 @@ re_add_sysctls(struct rl_softc *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, re_sysctl_stats, "I", "Statistics Information"); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + return; + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "int_rx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->rl_int_rx_mod, 0, + sysctl_hw_re_int_mod, "I", "re RX interrupt moderation"); + /* Pull in device tunables. */ + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + error = resource_int_value(device_get_name(sc->rl_dev), + device_get_unit(sc->rl_dev), "int_rx_mod", &sc->rl_int_rx_mod); + if (error == 0) { + if (sc->rl_int_rx_mod < RL_TIMER_MIN || + sc->rl_int_rx_mod > RL_TIMER_MAX) { + device_printf(sc->rl_dev, "int_rx_mod value out of " + "range; using default: %d\n", + RL_TIMER_DEFAULT); + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + } + } + } static int @@ -3619,3 +3736,29 @@ done: return (error); } + +static int +sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) +{ + int error, value; + + if (arg1 == NULL) + return (EINVAL); + value = *(int *)arg1; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || req->newptr == NULL) + return (error); + if (value < low || value > high) + return (EINVAL); + *(int *)arg1 = value; + + return (0); +} + +static int +sysctl_hw_re_int_mod(SYSCTL_HANDLER_ARGS) +{ + + return (sysctl_int_range(oidp, arg1, arg2, req, RL_TIMER_MIN, + RL_TIMER_MAX)); +} Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:37:38 2011 (r219109) +++ stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:41:27 2011 (r219110) @@ -497,6 +497,14 @@ #define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ +/* Timer interrupt register */ +#define RL_TIMERINT_8169_VAL 0x00001FFF +#define RL_TIMER_MIN 0 +#define RL_TIMER_MAX 65 /* 65.528us */ +#define RL_TIMER_DEFAULT RL_TIMER_MAX +#define RL_TIMER_PCIE_CLK 125 /* 125MHZ */ +#define RL_USECS(x) ((x) * RL_TIMER_PCIE_CLK) + /* * Gigabit PHY access register (8169 only) */ @@ -896,6 +904,8 @@ struct rl_softc { struct task rl_inttask; int rl_txstart; + int rl_int_rx_act; + int rl_int_rx_mod; uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 #define RL_FLAG_AUTOPAD 0x0002 From owner-svn-src-stable@FreeBSD.ORG Mon Feb 28 23:46:59 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A263106564A; Mon, 28 Feb 2011 23:46:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8711E8FC14; Mon, 28 Feb 2011 23:46:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SNkx1b061456; Mon, 28 Feb 2011 23:46:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNkxPf061452; Mon, 28 Feb 2011 23:46:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282346.p1SNkxPf061452@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 23:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219111 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:46:59 -0000 Author: yongari Date: Mon Feb 28 23:46:59 2011 New Revision: 219111 URL: http://svn.freebsd.org/changeset/base/219111 Log: MFC r217902: Do not use interrupt taskqueue on controllers with MSI/MSI-X capability. One of reason using interrupt taskqueue in re(4) was to reduce number of TX/RX interrupts under load because re(4) controllers have no good TX/RX interrupt moderation mechanism. Basic TX interrupt moderation is done by hardware for most controllers but RX interrupt moderation through undocumented register showed poor RX performance so it was disabled in r215025. Using taskqueue to handle RX interrupt greatly reduced number of interrupts but re(4) consumed all available CPU cycles to run the taskqueue under high TX/RX network load. This can happen even with RTL810x fast ethernet controller and I believe this is not acceptable for most systems. To mitigate the issue, use one-shot timer register to moderate RX interrupts. The timer register provides programmable one-shot timer and can be used to suppress interrupt generation. The timer runs at 125MHZ on PCIe controllers so the minimum time allowed for the timer is 8ns. Data sheet says the register is 32 bits but experimentation shows only lower 13 bits are valid so maximum time that can be programmed is 65.528us. This yields theoretical maximum number of RX interrupts that could be generated per second is about 15260. Combined with TX completion interrupts re(4) shall generate less than 20k interrupts. This number is still slightly high compared to other intelligent ethernet controllers but system is very responsive even under high network load. Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount of time to delay RX interrupt processing in units of us. Value 0 completely disables RX interrupt moderation. To provide old behavior for controllers that have MSI/MSI-X capability, introduce a new tunable hw.re.intr_filter. If the tunable is set to non-zero value, driver will use interrupt taskqueue. The default value of the tunable is 0. This tunable has no effect on controllers that has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled by administrator. While I'm here cleanup interrupt setup/teardown since re(4) uses single MSI/MSI-X message at this moment. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Mon Feb 28 23:41:27 2011 (r219110) +++ stable/7/sys/dev/re/if_re.c Mon Feb 28 23:46:59 2011 (r219111) @@ -157,6 +157,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); #include "miibus_if.h" /* Tunables. */ +static int intr_filter = 0; +TUNABLE_INT("hw.re.intr_filter", &intr_filter); static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); static int msix_disable = 0; @@ -253,6 +255,7 @@ static void re_poll (struct ifnet *, en static void re_poll_locked (struct ifnet *, enum poll_cmd, int); #endif static int re_intr (void *); +static void re_intr_msi (void *); static void re_tick (void *); static void re_int_task (void *, int); static void re_start (struct ifnet *); @@ -290,6 +293,8 @@ static int re_diag (struct rl_softc *); static void re_add_sysctls (struct rl_softc *); static int re_sysctl_stats (SYSCTL_HANDLER_ARGS); +static int sysctl_int_range (SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_re_int_mod (SYSCTL_HANDLER_ARGS); static device_method_t re_methods[] = { /* Device interface */ @@ -1575,19 +1580,19 @@ re_attach(device_t dev) } #endif +#ifdef RE_TX_MODERATION + intr_filter = 1; +#endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + error = bus_setup_intr(dev, sc->rl_irq[0], + INTR_TYPE_NET | INTR_MPSAFE, NULL, re_intr_msi, sc, + &sc->rl_intrhand[0]); + } else { error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); - else { - for (i = 0; i < RL_MSI_MESSAGES; i++) { - error = bus_setup_intr(dev, sc->rl_irq[i], - INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, - &sc->rl_intrhand[i]); - if (error != 0) - break; - } } if (error) { device_printf(dev, "couldn't set up irq\n"); @@ -1658,31 +1663,22 @@ re_detach(device_t dev) * stopped here. */ - for (i = 0; i < RL_MSI_MESSAGES; i++) { - if (sc->rl_intrhand[i] != NULL) { - bus_teardown_intr(dev, sc->rl_irq[i], - sc->rl_intrhand[i]); - sc->rl_intrhand[i] = NULL; - } + if (sc->rl_intrhand[0] != NULL) { + bus_teardown_intr(dev, sc->rl_irq[0], sc->rl_intrhand[0]); + sc->rl_intrhand[0] = NULL; } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { - if (sc->rl_irq[0] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, 0, - sc->rl_irq[0]); - sc->rl_irq[0] = NULL; - } - } else { - for (i = 0, rid = 1; i < RL_MSI_MESSAGES; i++, rid++) { - if (sc->rl_irq[i] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, rid, - sc->rl_irq[i]); - sc->rl_irq[i] = NULL; - } - } - pci_release_msi(dev); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + rid = 0; + else + rid = 1; + if (sc->rl_irq[0] != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->rl_irq[0]); + sc->rl_irq[0] = NULL; } + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0) + pci_release_msi(dev); if (sc->rl_res_pba) { rid = PCIR_BAR(4); bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); @@ -1971,6 +1967,7 @@ re_rx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -1994,6 +1991,7 @@ re_jrx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -2472,6 +2470,87 @@ re_int_task(void *arg, int npending) CSR_WRITE_2(sc, RL_IMR, RL_INTRS_CPLUS); } +static void +re_intr_msi(void *xsc) +{ + struct rl_softc *sc; + struct ifnet *ifp; + uint16_t intrs, status; + + sc = xsc; + RL_LOCK(sc); + + ifp = sc->rl_ifp; +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + RL_UNLOCK(sc); + return; + } +#endif + /* Disable interrupts. */ + CSR_WRITE_2(sc, RL_IMR, 0); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + RL_UNLOCK(sc); + return; + } + + intrs = RL_INTRS_CPLUS; + status = CSR_READ_2(sc, RL_ISR); + CSR_WRITE_2(sc, RL_ISR, status); + if (sc->rl_int_rx_act > 0) { + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + status &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + } + + if (status & (RL_ISR_TIMEOUT_EXPIRED | RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) { + re_rxeof(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (sc->rl_int_rx_mod != 0 && + (status & (RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) != 0) { + /* Rearm one-shot timer. */ + CSR_WRITE_4(sc, RL_TIMERCNT, 1); + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN); + sc->rl_int_rx_act = 1; + } else { + intrs |= RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN; + sc->rl_int_rx_act = 0; + } + } + } + + /* + * Some chips will ignore a second TX request issued + * while an existing transmission is in progress. If + * the transmitter goes idle but there are still + * packets waiting to be sent, we need to restart the + * channel here to flush them out. This only seems to + * be required with the PCIe devices. + */ + if ((status & (RL_ISR_TX_OK | RL_ISR_TX_DESC_UNAVAIL)) && + (sc->rl_flags & RL_FLAG_PCIE)) + CSR_WRITE_1(sc, sc->rl_txstart, RL_TXSTART_START); + if (status & (RL_ISR_TX_OK | RL_ISR_TX_ERR | RL_ISR_TX_DESC_UNAVAIL)) + re_txeof(sc); + + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + re_init_locked(sc); + } + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + re_start_locked(ifp); + CSR_WRITE_2(sc, RL_IMR, intrs); + } + RL_UNLOCK(sc); +} + static int re_encap(struct rl_softc *sc, struct mbuf **m_head) { @@ -3001,18 +3080,35 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); #endif -#ifdef RE_TX_MODERATION /* * Initialize the timer interrupt register so that * a timer interrupt will be generated once the timer * reaches a certain number of ticks. The timer is - * reloaded on each transmit. This gives us TX interrupt + * reloaded on each transmit. + */ +#ifdef RE_TX_MODERATION + /* + * Use timer interrupt register to moderate TX interrupt * moderation, which dramatically improves TX frame rate. */ if (sc->rl_type == RL_8169) CSR_WRITE_4(sc, RL_TIMERINT_8169, 0x800); else CSR_WRITE_4(sc, RL_TIMERINT, 0x400); +#else + /* + * Use timer interrupt register to moderate RX interrupt + * moderation. + */ + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, + RL_USECS(sc->rl_int_rx_mod)); + } else { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, RL_USECS(0)); + } #endif /* @@ -3529,6 +3625,7 @@ re_add_sysctls(struct rl_softc *sc) { struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; + int error; ctx = device_get_sysctl_ctx(sc->rl_dev); children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev)); @@ -3536,6 +3633,26 @@ re_add_sysctls(struct rl_softc *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, re_sysctl_stats, "I", "Statistics Information"); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + return; + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "int_rx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->rl_int_rx_mod, 0, + sysctl_hw_re_int_mod, "I", "re RX interrupt moderation"); + /* Pull in device tunables. */ + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + error = resource_int_value(device_get_name(sc->rl_dev), + device_get_unit(sc->rl_dev), "int_rx_mod", &sc->rl_int_rx_mod); + if (error == 0) { + if (sc->rl_int_rx_mod < RL_TIMER_MIN || + sc->rl_int_rx_mod > RL_TIMER_MAX) { + device_printf(sc->rl_dev, "int_rx_mod value out of " + "range; using default: %d\n", + RL_TIMER_DEFAULT); + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + } + } + } static int @@ -3613,3 +3730,29 @@ done: return (error); } + +static int +sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) +{ + int error, value; + + if (arg1 == NULL) + return (EINVAL); + value = *(int *)arg1; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || req->newptr == NULL) + return (error); + if (value < low || value > high) + return (EINVAL); + *(int *)arg1 = value; + + return (0); +} + +static int +sysctl_hw_re_int_mod(SYSCTL_HANDLER_ARGS) +{ + + return (sysctl_int_range(oidp, arg1, arg2, req, RL_TIMER_MIN, + RL_TIMER_MAX)); +} Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Mon Feb 28 23:41:27 2011 (r219110) +++ stable/7/sys/pci/if_rlreg.h Mon Feb 28 23:46:59 2011 (r219111) @@ -497,6 +497,14 @@ #define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ +/* Timer interrupt register */ +#define RL_TIMERINT_8169_VAL 0x00001FFF +#define RL_TIMER_MIN 0 +#define RL_TIMER_MAX 65 /* 65.528us */ +#define RL_TIMER_DEFAULT RL_TIMER_MAX +#define RL_TIMER_PCIE_CLK 125 /* 125MHZ */ +#define RL_USECS(x) ((x) * RL_TIMER_PCIE_CLK) + /* * Gigabit PHY access register (8169 only) */ @@ -896,6 +904,8 @@ struct rl_softc { struct task rl_inttask; int rl_txstart; + int rl_int_rx_act; + int rl_int_rx_mod; uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 #define RL_FLAG_AUTOPAD 0x0002 From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 00:01:34 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF848106568D; Tue, 1 Mar 2011 00:01:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9408F8FC1A; Tue, 1 Mar 2011 00:01:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2101YRZ062633; Tue, 1 Mar 2011 00:01:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2101YGI062630; Tue, 1 Mar 2011 00:01:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010001.p2101YGI062630@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219112 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:01:34 -0000 Author: yongari Date: Tue Mar 1 00:01:34 2011 New Revision: 219112 URL: http://svn.freebsd.org/changeset/base/219112 Log: MFC r217911: Add support for RTL8105E PCIe Fast Ethernet controller. It seems the controller has a kind of embedded controller/memory and vendor applies a large set of magic code via undocumented PHY registers in device initialization stage. I guess it's a firmware image for the embedded controller in RTL8105E since the code is too big compared to other DSP fixups. However I have no idea what that magic code does and what's purpose of the embedded controller. Fortunately driver seems to still work without loading the firmware. While I'm here change device description of RTL810xE controller. H/W donated by: Realtek Semiconductor Corp. Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Feb 28 23:46:59 2011 (r219111) +++ stable/8/sys/dev/re/if_re.c Tue Mar 1 00:01:34 2011 (r219112) @@ -177,7 +177,7 @@ static struct rl_type re_devs[] = { { RT_VENDORID, RT_DEVICEID_8139, 0, "RealTek 8139C+ 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8101E, 0, - "RealTek 8101E/8102E/8102EL/8103E PCIe 10/100baseTX" }, + "RealTek 810xE PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, @@ -1376,6 +1377,11 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8105E: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; + break; case RL_HWREV_8168B_SPIN1: case RL_HWREV_8168B_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:46:59 2011 (r219111) +++ stable/8/sys/pci/if_rlreg.h Tue Mar 1 00:01:34 2011 (r219112) @@ -176,6 +176,7 @@ #define RL_HWREV_8168C 0x3C000000 #define RL_HWREV_8168C_SPIN2 0x3C400000 #define RL_HWREV_8168CP 0x3C800000 +#define RL_HWREV_8105E 0x40800000 #define RL_HWREV_8139 0x60000000 #define RL_HWREV_8139A 0x70000000 #define RL_HWREV_8139AG 0x70800000 From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 00:02:46 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD60B106566B; Tue, 1 Mar 2011 00:02:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B12E48FC21; Tue, 1 Mar 2011 00:02:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2102kZw062766; Tue, 1 Mar 2011 00:02:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2102kFN062763; Tue, 1 Mar 2011 00:02:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010002.p2102kFN062763@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219113 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:02:47 -0000 Author: yongari Date: Tue Mar 1 00:02:46 2011 New Revision: 219113 URL: http://svn.freebsd.org/changeset/base/219113 Log: MFC r217911: Add support for RTL8105E PCIe Fast Ethernet controller. It seems the controller has a kind of embedded controller/memory and vendor applies a large set of magic code via undocumented PHY registers in device initialization stage. I guess it's a firmware image for the embedded controller in RTL8105E since the code is too big compared to other DSP fixups. However I have no idea what that magic code does and what's purpose of the embedded controller. Fortunately driver seems to still work without loading the firmware. While I'm here change device description of RTL810xE controller. H/W donated by: Realtek Semiconductor Corp. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Tue Mar 1 00:01:34 2011 (r219112) +++ stable/7/sys/dev/re/if_re.c Tue Mar 1 00:02:46 2011 (r219113) @@ -177,7 +177,7 @@ static struct rl_type re_devs[] = { { RT_VENDORID, RT_DEVICEID_8139, 0, "RealTek 8139C+ 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8101E, 0, - "RealTek 8101E/8102E/8102EL/8103E PCIe 10/100baseTX" }, + "RealTek 810xE PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, @@ -1377,6 +1378,11 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8105E: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; + break; case RL_HWREV_8168B_SPIN1: case RL_HWREV_8168B_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Tue Mar 1 00:01:34 2011 (r219112) +++ stable/7/sys/pci/if_rlreg.h Tue Mar 1 00:02:46 2011 (r219113) @@ -176,6 +176,7 @@ #define RL_HWREV_8168C 0x3C000000 #define RL_HWREV_8168C_SPIN2 0x3C400000 #define RL_HWREV_8168CP 0x3C800000 +#define RL_HWREV_8105E 0x40800000 #define RL_HWREV_8139 0x60000000 #define RL_HWREV_8139A 0x70000000 #define RL_HWREV_8139AG 0x70800000 From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 00:04:35 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C4371065672; Tue, 1 Mar 2011 00:04:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14D928FC2E; Tue, 1 Mar 2011 00:04:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2104YWg062948; Tue, 1 Mar 2011 00:04:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2104YeB062946; Tue, 1 Mar 2011 00:04:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010004.p2104YeB062946@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219114 - stable/8/sys/dev/re X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:04:35 -0000 Author: yongari Date: Tue Mar 1 00:04:34 2011 New Revision: 219114 URL: http://svn.freebsd.org/changeset/base/219114 Log: MFC r218289: Disable TX IP checksum offloading for RTL8168C controllers. The controller in question generates frames with bad IP checksum value if packets contain IP options. For instance, packets generated by ping(8) with record route option have wrong IP checksum value. The controller correctly computes checksum for normal TCP/UDP packets though. There are two known RTL8168/8111C variants in market and the issue I observed happened on RL_HWREV_8168C_SPIN2. I'm not sure RL_HWREV_8168C also has the same issue but it would be better to assume it has the same issue since they shall share same core. RTL8102E which is supposed to be released at the time of RTL8168/8111C announcement does not have the issue. Tested by: Konstantin V. Krotov ( kkv <> insysnet dot ru ) Modified: stable/8/sys/dev/re/if_re.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Tue Mar 1 00:02:46 2011 (r219113) +++ stable/8/sys/dev/re/if_re.c Tue Mar 1 00:04:34 2011 (r219114) @@ -1527,7 +1527,16 @@ re_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = re_ioctl; ifp->if_start = re_start; - ifp->if_hwassist = RE_CSUM_FEATURES | CSUM_TSO; + /* + * RTL8168/8111C generates wrong IP checksummed frame if the + * packet has IP options so disable TX IP checksum offloading. + */ + if (sc->rl_hwrev->rl_rev == RL_HWREV_8168C || + sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2) + ifp->if_hwassist = CSUM_TCP | CSUM_UDP; + else + ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + ifp->if_hwassist |= CSUM_TSO; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4; ifp->if_capenable = ifp->if_capabilities; ifp->if_init = re_init; @@ -3209,6 +3218,7 @@ re_ioctl(struct ifnet *ifp, u_long comma struct rl_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; + uint32_t rev; int error = 0; switch (command) { @@ -3294,9 +3304,14 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; - if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) - ifp->if_hwassist |= RE_CSUM_FEATURES; - else + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) { + rev = sc->rl_hwrev->rl_rev; + if (rev == RL_HWREV_8168C || + rev == RL_HWREV_8168C_SPIN2) + ifp->if_hwassist |= CSUM_TCP | CSUM_UDP; + else + ifp->if_hwassist |= RE_CSUM_FEATURES; + } else ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 00:05:47 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 312DE106564A; Tue, 1 Mar 2011 00:05:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05BA48FC19; Tue, 1 Mar 2011 00:05:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2105kMH063089; Tue, 1 Mar 2011 00:05:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2105kRh063087; Tue, 1 Mar 2011 00:05:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010005.p2105kRh063087@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219115 - stable/7/sys/dev/re X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:05:47 -0000 Author: yongari Date: Tue Mar 1 00:05:46 2011 New Revision: 219115 URL: http://svn.freebsd.org/changeset/base/219115 Log: MFC r218289: Disable TX IP checksum offloading for RTL8168C controllers. The controller in question generates frames with bad IP checksum value if packets contain IP options. For instance, packets generated by ping(8) with record route option have wrong IP checksum value. The controller correctly computes checksum for normal TCP/UDP packets though. There are two known RTL8168/8111C variants in market and the issue I observed happened on RL_HWREV_8168C_SPIN2. I'm not sure RL_HWREV_8168C also has the same issue but it would be better to assume it has the same issue since they shall share same core. RTL8102E which is supposed to be released at the time of RTL8168/8111C announcement does not have the issue. Tested by: Konstantin V. Krotov ( kkv <> insysnet dot ru ) Modified: stable/7/sys/dev/re/if_re.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Tue Mar 1 00:04:34 2011 (r219114) +++ stable/7/sys/dev/re/if_re.c Tue Mar 1 00:05:46 2011 (r219115) @@ -1528,7 +1528,16 @@ re_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = re_ioctl; ifp->if_start = re_start; - ifp->if_hwassist = RE_CSUM_FEATURES | CSUM_TSO; + /* + * RTL8168/8111C generates wrong IP checksummed frame if the + * packet has IP options so disable TX IP checksum offloading. + */ + if (sc->rl_hwrev->rl_rev == RL_HWREV_8168C || + sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2) + ifp->if_hwassist = CSUM_TCP | CSUM_UDP; + else + ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + ifp->if_hwassist |= CSUM_TSO; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4; ifp->if_capenable = ifp->if_capabilities; ifp->if_init = re_init; @@ -3203,6 +3212,7 @@ re_ioctl(struct ifnet *ifp, u_long comma struct rl_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; + uint32_t rev; int error = 0; switch (command) { @@ -3288,9 +3298,14 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; - if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) - ifp->if_hwassist |= RE_CSUM_FEATURES; - else + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) { + rev = sc->rl_hwrev->rl_rev; + if (rev == RL_HWREV_8168C || + rev == RL_HWREV_8168C_SPIN2) + ifp->if_hwassist |= CSUM_TCP | CSUM_UDP; + else + ifp->if_hwassist |= RE_CSUM_FEATURES; + } else ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 00:07:38 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1107106564A; Tue, 1 Mar 2011 00:07:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8571F8FC08; Tue, 1 Mar 2011 00:07:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2107cc0063281; Tue, 1 Mar 2011 00:07:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2107chi063278; Tue, 1 Mar 2011 00:07:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010007.p2107chi063278@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219116 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:07:38 -0000 Author: yongari Date: Tue Mar 1 00:07:38 2011 New Revision: 219116 URL: http://svn.freebsd.org/changeset/base/219116 Log: MFC r218760: Add initial support for RTL8401E PCIe Fast Ethernet. PR: 154789 Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Tue Mar 1 00:05:46 2011 (r219115) +++ stable/8/sys/dev/re/if_re.c Tue Mar 1 00:07:38 2011 (r219116) @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8401E, RL_8169, "8401E", RL_MTU }, { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, @@ -1377,6 +1378,7 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8401E: case RL_HWREV_8105E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | @@ -1502,8 +1504,11 @@ re_attach(device_t dev) } /* Take PHY out of power down mode. */ - if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) + if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) { CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80); + if (hw_rev->rl_rev == RL_HWREV_8401E) + CSR_WRITE_1(sc, 0xD1, CSR_READ_1(sc, 0xD1) & ~0x08); + } if ((sc->rl_flags & RL_FLAG_PHYWAKE) != 0) { re_gmii_writereg(dev, 1, 0x1f, 0); re_gmii_writereg(dev, 1, 0x0e, 0); Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Tue Mar 1 00:05:46 2011 (r219115) +++ stable/8/sys/pci/if_rlreg.h Tue Mar 1 00:07:38 2011 (r219116) @@ -160,6 +160,7 @@ #define RL_HWREV_8110S 0x04000000 #define RL_HWREV_8169_8110SB 0x10000000 #define RL_HWREV_8169_8110SC 0x18000000 +#define RL_HWREV_8401E 0x24000000 #define RL_HWREV_8102EL 0x24800000 #define RL_HWREV_8102EL_SPIN1 0x24C00000 #define RL_HWREV_8168D 0x28000000 From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 00:08:50 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18435106566C; Tue, 1 Mar 2011 00:08:50 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0B5A8FC1E; Tue, 1 Mar 2011 00:08:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2108nYm063399; Tue, 1 Mar 2011 00:08:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2108nM2063396; Tue, 1 Mar 2011 00:08:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010008.p2108nM2063396@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219117 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:08:50 -0000 Author: yongari Date: Tue Mar 1 00:08:49 2011 New Revision: 219117 URL: http://svn.freebsd.org/changeset/base/219117 Log: MFC r218760: Add initial support for RTL8401E PCIe Fast Ethernet. PR: 154789 Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Tue Mar 1 00:07:38 2011 (r219116) +++ stable/7/sys/dev/re/if_re.c Tue Mar 1 00:08:49 2011 (r219117) @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8401E, RL_8169, "8401E", RL_MTU }, { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, @@ -1378,6 +1379,7 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8401E: case RL_HWREV_8105E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | @@ -1503,8 +1505,11 @@ re_attach(device_t dev) } /* Take PHY out of power down mode. */ - if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) + if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) { CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80); + if (hw_rev->rl_rev == RL_HWREV_8401E) + CSR_WRITE_1(sc, 0xD1, CSR_READ_1(sc, 0xD1) & ~0x08); + } if ((sc->rl_flags & RL_FLAG_PHYWAKE) != 0) { re_gmii_writereg(dev, 1, 0x1f, 0); re_gmii_writereg(dev, 1, 0x0e, 0); Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Tue Mar 1 00:07:38 2011 (r219116) +++ stable/7/sys/pci/if_rlreg.h Tue Mar 1 00:08:49 2011 (r219117) @@ -160,6 +160,7 @@ #define RL_HWREV_8110S 0x04000000 #define RL_HWREV_8169_8110SB 0x10000000 #define RL_HWREV_8169_8110SC 0x18000000 +#define RL_HWREV_8401E 0x24000000 #define RL_HWREV_8102EL 0x24800000 #define RL_HWREV_8102EL_SPIN1 0x24C00000 #define RL_HWREV_8168D 0x28000000 From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 00:11:44 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5799106566B; Tue, 1 Mar 2011 00:11:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99B648FC16; Tue, 1 Mar 2011 00:11:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p210BiDQ063668; Tue, 1 Mar 2011 00:11:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p210Bi0C063666; Tue, 1 Mar 2011 00:11:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010011.p210Bi0C063666@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219118 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:11:44 -0000 Author: yongari Date: Tue Mar 1 00:11:44 2011 New Revision: 219118 URL: http://svn.freebsd.org/changeset/base/219118 Log: MFC r217914: Document newly added tunables. hw.re.intr_filter hw.re.msix_disable dev.re.%d.int_rx_mod Modified: stable/8/share/man/man4/re.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/re.4 ============================================================================== --- stable/8/share/man/man4/re.4 Tue Mar 1 00:08:49 2011 (r219117) +++ stable/8/share/man/man4/re.4 Tue Mar 1 00:11:44 2011 (r219118) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2011 +.Dd January 26, 2011 .Dt RE 4 .Os .Sh NAME @@ -175,15 +175,39 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" +.It Va hw.re.intr_filter +This tunable makes driver use interrupt filter handler on +controllers that support MSI/MSI-X capability. +If MSI/MSI-X is disabled by administrator this tunable has no +effect and driver will use interrupt filter handler. +The default value is 0 to use interrupt thread handler. .It Va hw.re.msi_disable This tunable disables MSI support on the Ethernet hardware. The default value is 0. +.It Va hw.re.msix_disable +This tunable disables MSI-X support on the Ethernet hardware. +The default value is 0. .It Va hw.re.prefer_iomap This tunable controls which register mapping should be used on the specified device. A non-zero value enables I/O space register mapping. The default value is 0 to use memory space register mapping. .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.re.%d.int_rx_mod +Maximum amount of time to delay receive interrupt processing in +units of 1us. +The accepted range is 0 to 65, the default is 65(65us). +Value 0 completely disables the interrupt moderation. +The interface need to be brought down and up again before a change +takes effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 00:13:51 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49E80106566C; Tue, 1 Mar 2011 00:13:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E20C8FC1A; Tue, 1 Mar 2011 00:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p210Dps5063886; Tue, 1 Mar 2011 00:13:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p210DpUL063884; Tue, 1 Mar 2011 00:13:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010013.p210DpUL063884@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219119 - stable/7/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:13:51 -0000 Author: yongari Date: Tue Mar 1 00:13:50 2011 New Revision: 219119 URL: http://svn.freebsd.org/changeset/base/219119 Log: MFC r217914: Document newly added tunables. hw.re.intr_filter hw.re.msix_disable dev.re.%d.int_rx_mod Modified: stable/7/share/man/man4/re.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Tue Mar 1 00:11:44 2011 (r219118) +++ stable/7/share/man/man4/re.4 Tue Mar 1 00:13:50 2011 (r219119) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2011 +.Dd January 26, 2011 .Dt RE 4 .Os .Sh NAME @@ -175,15 +175,39 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" +.It Va hw.re.intr_filter +This tunable makes driver use interrupt filter handler on +controllers that support MSI/MSI-X capability. +If MSI/MSI-X is disabled by administrator this tunable has no +effect and driver will use interrupt filter handler. +The default value is 0 to use interrupt thread handler. .It Va hw.re.msi_disable This tunable disables MSI support on the Ethernet hardware. The default value is 0. +.It Va hw.re.msix_disable +This tunable disables MSI-X support on the Ethernet hardware. +The default value is 0. .It Va hw.re.prefer_iomap This tunable controls which register mapping should be used on the specified device. A non-zero value enables I/O space register mapping. The default value is 0 to use memory space register mapping. .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.re.%d.int_rx_mod +Maximum amount of time to delay receive interrupt processing in +units of 1us. +The accepted range is 0 to 65, the default is 65(65us). +Value 0 completely disables the interrupt moderation. +The interface need to be brought down and up again before a change +takes effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 17:22:26 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC6131065670; Tue, 1 Mar 2011 17:22:26 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 94AEF8FC1C; Tue, 1 Mar 2011 17:22:25 +0000 (UTC) Received: by eyg7 with SMTP id 7so1953979eyg.13 for ; Tue, 01 Mar 2011 09:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UWwJacA8A3wS3HJXB8OQcThxQUwsMJzkXCGBgriTPc0=; b=UjulS1mZ0Kc0M9qzXaaunQAIEpp3cIBaSO1Vmf5+gDLo3QIN3CGpQBitTIi+00hPam OTGfYtw/qh4q5DxVN5wVEMkIOgA0LHpHMdJbmezXzWeo1fm3Qew3QHN4Vxd2NdDvGFKB QCEUldQf5je94NnwrU7f223KeSLTLtBo1CyIM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=iHP88OpSEGbS5GUvRsTEj8vn3VrnHQRZI1T6vc1BpCV+kErgzjXqD7rT26Ohvu3d2X fopHYTBfY7HKXJYXr7yjwBn8lzXZTZsq7tum+Clh19O1udhboTlTPJUmfiOgsHmtyynt cfxZfRYWSl684v6orfq96wDPiFwZ3dbckUI/w= MIME-Version: 1.0 Received: by 10.213.29.198 with SMTP id r6mr2785989ebc.48.1298998502351; Tue, 01 Mar 2011 08:55:02 -0800 (PST) Received: by 10.213.23.13 with HTTP; Tue, 1 Mar 2011 08:55:02 -0800 (PST) In-Reply-To: <201102282328.p1SNSZZK059958@svn.freebsd.org> References: <201102282328.p1SNSZZK059958@svn.freebsd.org> Date: Tue, 1 Mar 2011 11:55:02 -0500 Message-ID: From: Ryan Stone To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r219107 - in stable/8/sys: amd64/amd64 amd64/include boot/common cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 17:22:26 -0000 I'm a bit confused. The 8.2 release notes claim that userland dtrace support was added to 8.2. Is this incorrect? http://www.freebsd.org/releases/8.2R/relnotes.html Userland support for the dtrace(1) subsystem has been added. This allows inspection of userland software itself and its correlation with the kernel, thus allowing a much better picture of what exactly is going on behind the scenes. The dtruss(1) utility has been added and libproc has been updated to support the facility.[r214983] From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 17:47:41 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2CA2106566B; Tue, 1 Mar 2011 17:47:41 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7948B8FC17; Tue, 1 Mar 2011 17:47:41 +0000 (UTC) Received: from lemongrass.sec.cl.cam.ac.uk (lemongrass.sec.cl.cam.ac.uk [128.232.18.47]) by cyrus.watson.org (Postfix) with ESMTPSA id AB04446B2E; Tue, 1 Mar 2011 12:47:40 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Tue, 1 Mar 2011 17:47:39 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201102282328.p1SNSZZK059958@svn.freebsd.org> To: Ryan Stone X-Mailer: Apple Mail (2.1082) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r219107 - in stable/8/sys: amd64/amd64 amd64/include boot/common cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 17:47:41 -0000 On 1 Mar 2011, at 16:55, Ryan Stone wrote: > I'm a bit confused. The 8.2 release notes claim that userland dtrace > support was added to 8.2. Is this incorrect? >=20 > http://www.freebsd.org/releases/8.2R/relnotes.html >=20 > Userland support for the dtrace(1) subsystem has been added. This > allows inspection of userland software itself and its correlation with > the kernel, thus allowing a much better picture of what exactly is > going on behind the scenes. The dtruss(1) utility has been added and > libproc has been updated to support the facility.[r214983] I think that's accurate but slightly misleading; the description of what = is possible above was the case in 8.2, but there was a significant chunk = of stuff not in 8.2 that I would also think of as part of userland = dtrace. So dtruss(1) worked fine, but that relies on tracing of kernel = bits, whereas the userland dtrace stuff I just MFC'd has to do with = userspace components (such as applications, language runtimes, and so = on) can expose their own probes, and be instrumented. So perhaps I = should have said "even more userland DTrace", but realistically, this = was a significant part of what most people would call userland DTrace. Robert= From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 18:05:58 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BA9B1065674; Tue, 1 Mar 2011 18:05:58 +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 39EFC8FC15; Tue, 1 Mar 2011 18:05:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21I5wX5046867; Tue, 1 Mar 2011 18:05:58 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21I5w53046865; Tue, 1 Mar 2011 18:05:58 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201103011805.p21I5w53046865@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 1 Mar 2011 18:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219142 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 18:05:58 -0000 Author: jh Date: Tue Mar 1 18:05:57 2011 New Revision: 219142 URL: http://svn.freebsd.org/changeset/base/219142 Log: MFC r187105 by obrien: Fix issue where ata_atapicmd() can never really return EBUSY which is expected in acd_fixate(). This should fix various problems folks are having with 'burncd' reporting "burncd: ioctl(CDRIOCFIXATE): Input/output error" during the fixate phase when "fixate" is issued together with the "data" command. PR: 95979 Modified: stable/7/sys/dev/ata/ata-queue.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/ata-queue.c ============================================================================== --- stable/7/sys/dev/ata/ata-queue.c Tue Mar 1 17:39:27 2011 (r219141) +++ stable/7/sys/dev/ata/ata-queue.c Tue Mar 1 18:05:57 2011 (r219142) @@ -443,7 +443,8 @@ ata_completed(void *context, int dummy) printf("\n"); } - if ((request->u.atapi.sense.key & ATA_SENSE_KEY_MASK ? + if (!request->result && + (request->u.atapi.sense.key & ATA_SENSE_KEY_MASK ? request->u.atapi.sense.key & ATA_SENSE_KEY_MASK : request->error)) request->result = EIO; From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 20:27:03 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 165351065675; Tue, 1 Mar 2011 20:27:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 046588FC17; Tue, 1 Mar 2011 20:27:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21KR2Kd056796; Tue, 1 Mar 2011 20:27:02 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21KR2js056794; Tue, 1 Mar 2011 20:27:02 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103012027.p21KR2js056794@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 1 Mar 2011 20:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219143 - stable/8/sys/compat/linux X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 20:27:03 -0000 Author: dchagin Date: Tue Mar 1 20:27:02 2011 New Revision: 219143 URL: http://svn.freebsd.org/changeset/base/219143 Log: MFC r217743: Style(9) fix. Modified: stable/8/sys/compat/linux/linux_signal.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/linux/linux_signal.c ============================================================================== --- stable/8/sys/compat/linux/linux_signal.c Tue Mar 1 18:05:57 2011 (r219142) +++ stable/8/sys/compat/linux/linux_signal.c Tue Mar 1 20:27:02 2011 (r219143) @@ -526,7 +526,7 @@ linux_kill(struct thread *td, struct lin * Allow signal 0 as a means to check for privileges */ if (!LINUX_SIG_VALID(args->signum) && args->signum != 0) - return EINVAL; + return (EINVAL); if (args->signum > 0 && args->signum <= LINUX_SIGTBLSZ) tmp.signum = linux_to_bsd_signal[_SIG_IDX(args->signum)]; From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 20:44:15 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CA7B106566C; Tue, 1 Mar 2011 20:44:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB3B8FC08; Tue, 1 Mar 2011 20:44:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21KiERO058086; Tue, 1 Mar 2011 20:44:14 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21KiEks058073; Tue, 1 Mar 2011 20:44:14 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103012044.p21KiEks058073@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 1 Mar 2011 20:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219144 - in stable/8/sys: amd64/amd64 amd64/linux32 compat/linprocfs fs/procfs i386/linux kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 20:44:15 -0000 Author: dchagin Date: Tue Mar 1 20:44:14 2011 New Revision: 219144 URL: http://svn.freebsd.org/changeset/base/219144 Log: MFC r217896: Add macro to test the sv_flags of any process. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures. Modified: stable/8/sys/amd64/amd64/vm_machdep.c stable/8/sys/amd64/linux32/linux32_machdep.c stable/8/sys/compat/linprocfs/linprocfs.c stable/8/sys/fs/procfs/procfs_dbregs.c stable/8/sys/fs/procfs/procfs_fpregs.c stable/8/sys/fs/procfs/procfs_map.c stable/8/sys/fs/procfs/procfs_regs.c stable/8/sys/i386/linux/linux_machdep.c stable/8/sys/kern/kern_jail.c stable/8/sys/kern/sys_process.c stable/8/sys/sys/sysent.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/vm_machdep.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/amd64/amd64/vm_machdep.c Tue Mar 1 20:44:14 2011 (r219144) @@ -445,7 +445,7 @@ cpu_set_upcall_kse(struct thread *td, vo cpu_thread_clean(td); #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { /* * Set the trap frame to point at the beginning of the uts * function. @@ -496,7 +496,7 @@ cpu_set_user_tls(struct thread *td, void return (EINVAL); #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { td->td_pcb->pcb_gsbase = (register_t)tls_base; return (0); } Modified: stable/8/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_machdep.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/amd64/linux32/linux32_machdep.c Tue Mar 1 20:44:14 2011 (r219144) @@ -231,7 +231,7 @@ linux_execve(struct thread *td, struct l * linux_proc_init, this leads to a panic on KASSERT * because such process has p->p_emuldata == NULL. */ - if (td->td_proc->p_sysent == &elf_linux_sysvec) + if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) error = linux_proc_init(td, 0, 0); return (error); } Modified: stable/8/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/8/sys/compat/linprocfs/linprocfs.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/compat/linprocfs/linprocfs.c Tue Mar 1 20:44:14 2011 (r219144) @@ -927,7 +927,7 @@ do { \ #ifdef COMPAT_FREEBSD32 env_vector32 = NULL; - if ((p->p_sysent->sv_flags & SV_ILP32) != 0) { + if (SV_PROC_FLAG(p, SV_ILP32) != 0) { env_vector32 = malloc(sizeof(*env_vector32) * MAX_ARGV_STR, M_TEMP, M_WAITOK); elm_len = sizeof(int32_t); Modified: stable/8/sys/fs/procfs/procfs_dbregs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_dbregs.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/fs/procfs/procfs_dbregs.c Tue Mar 1 20:44:14 2011 (r219144) @@ -107,7 +107,7 @@ procfs_doprocdbregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: stable/8/sys/fs/procfs/procfs_fpregs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_fpregs.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/fs/procfs/procfs_fpregs.c Tue Mar 1 20:44:14 2011 (r219144) @@ -106,7 +106,7 @@ procfs_doprocfpregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: stable/8/sys/fs/procfs/procfs_map.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_map.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/fs/procfs/procfs_map.c Tue Mar 1 20:44:14 2011 (r219144) @@ -100,8 +100,8 @@ procfs_doprocmap(PFS_FILL_ARGS) return (EOPNOTSUPP); #ifdef COMPAT_FREEBSD32 - if (curproc->p_sysent->sv_flags & SV_ILP32) { - if (!(p->p_sysent->sv_flags & SV_ILP32)) + if (SV_CURPROC_FLAG(SV_ILP32)) { + if (!(SV_PROC_FLAG(p, SV_ILP32))) return (EOPNOTSUPP); wrap32 = 1; } Modified: stable/8/sys/fs/procfs/procfs_regs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_regs.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/fs/procfs/procfs_regs.c Tue Mar 1 20:44:14 2011 (r219144) @@ -106,7 +106,7 @@ procfs_doprocregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if ((SV_PROC_FLAG(td2->td_proc, SV_ILP32)) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: stable/8/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/8/sys/i386/linux/linux_machdep.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/i386/linux/linux_machdep.c Tue Mar 1 20:44:14 2011 (r219144) @@ -146,8 +146,8 @@ linux_execve(struct thread *td, struct l * linux_proc_init, this leads to a panic on KASSERT * because such process has p->p_emuldata == NULL */ - if (td->td_proc->p_sysent == &elf_linux_sysvec) - error = linux_proc_init(td, 0, 0); + if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) + error = linux_proc_init(td, 0, 0); return (error); } Modified: stable/8/sys/kern/kern_jail.c ============================================================================== --- stable/8/sys/kern/kern_jail.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/kern/kern_jail.c Tue Mar 1 20:44:14 2011 (r219144) @@ -745,7 +745,7 @@ kern_jail_set(struct thread *td, struct } #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { uint32_t hid32; error = vfs_copyopt(opts, "host.hostid", &hid32, sizeof(hid32)); @@ -1972,7 +1972,7 @@ kern_jail_get(struct thread *td, struct if (error != 0 && error != ENOENT) goto done_deref; #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { uint32_t hid32 = pr->pr_hostid; error = vfs_setopt(opts, "host.hostid", &hid32, sizeof(hid32)); Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/kern/sys_process.c Tue Mar 1 20:44:14 2011 (r219144) @@ -781,7 +781,7 @@ kern_ptrace(struct thread *td, int req, * Set the wrap controls accordingly. */ if (SV_CURPROC_FLAG(SV_ILP32)) { - if (td2->td_proc->p_sysent->sv_flags & SV_ILP32) + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32)) safe = 1; wrap32 = 1; } Modified: stable/8/sys/sys/sysent.h ============================================================================== --- stable/8/sys/sys/sysent.h Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/sys/sysent.h Tue Mar 1 20:44:14 2011 (r219144) @@ -116,8 +116,10 @@ struct sysentvec { #define SV_AOUT 0x008000 #define SV_ABI_MASK 0xff -#define SV_CURPROC_FLAG(x) (curproc->p_sysent->sv_flags & (x)) -#define SV_CURPROC_ABI() (curproc->p_sysent->sv_flags & SV_ABI_MASK) +#define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) +#define SV_PROC_ABI(p) ((p)->p_sysent->sv_flags & SV_ABI_MASK) +#define SV_CURPROC_FLAG(x) SV_PROC_FLAG(curproc, x) +#define SV_CURPROC_ABI() SV_PROC_ABI(curproc) /* same as ELFOSABI_XXX, to prevent header pollution */ #define SV_ABI_LINUX 3 #define SV_ABI_FREEBSD 9 From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 20:48:03 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D179D1065674; Tue, 1 Mar 2011 20:48:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF52A8FC19; Tue, 1 Mar 2011 20:48:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21Km3WN058425; Tue, 1 Mar 2011 20:48:03 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21Km3iq058423; Tue, 1 Mar 2011 20:48:03 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103012048.p21Km3iq058423@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 1 Mar 2011 20:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219145 - stable/8/sys/compat/linux X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 20:48:03 -0000 Author: dchagin Date: Tue Mar 1 20:48:03 2011 New Revision: 219145 URL: http://svn.freebsd.org/changeset/base/219145 Log: MFC r218005: Style(9) fix. Modified: stable/8/sys/compat/linux/linux_misc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/linux/linux_misc.c ============================================================================== --- stable/8/sys/compat/linux/linux_misc.c Tue Mar 1 20:44:14 2011 (r219144) +++ stable/8/sys/compat/linux/linux_misc.c Tue Mar 1 20:48:03 2011 (r219145) @@ -886,7 +886,7 @@ linux_waitpid(struct thread *td, struct return copyout(&tmpstat, args->status, sizeof(int)); } - return 0; + return (0); } int From owner-svn-src-stable@FreeBSD.ORG Tue Mar 1 21:29:01 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25BDB106566C; Tue, 1 Mar 2011 21:29:01 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 137648FC15; Tue, 1 Mar 2011 21:29:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21LT0DN061427; Tue, 1 Mar 2011 21:29:00 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LT0Ab061424; Tue, 1 Mar 2011 21:29:00 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201103012129.p21LT0Ab061424@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 1 Mar 2011 21:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219150 - stable/8/share/zoneinfo X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 21:29:01 -0000 Author: edwin Date: Tue Mar 1 21:29:00 2011 New Revision: 219150 URL: http://svn.freebsd.org/changeset/base/219150 Log: MFC of 219149, tzdata2011b: USA/Mercer County, North Dakota - Moved from Mountain time to Central time. Modified: stable/8/share/zoneinfo/northamerica stable/8/share/zoneinfo/zone.tab Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/northamerica ============================================================================== --- stable/8/share/zoneinfo/northamerica Tue Mar 1 21:24:50 2011 (r219149) +++ stable/8/share/zoneinfo/northamerica Tue Mar 1 21:29:00 2011 (r219150) @@ -1,5 +1,5 @@ #
-# %W%
+# @(#)northamerica	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -346,6 +346,27 @@ Zone America/North_Dakota/New_Salem -6:4
 			-7:00	US	M%sT	2003 Oct 26 02:00
 			-6:00	US	C%sT
 
+# From Josh Findley (2011-01-21):
+# ...it appears that Mercer County, North Dakota, changed from the
+# mountain time zone to the central time zone at the last transition from
+# daylight-saving to standard time (on Nov. 7, 2010):
+# 
+# http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
+# 
+# 
+# http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html
+# 
+
+# From Andy Lipscomb (2011-01-24):
+# ...according to the Census Bureau, the largest city is Beulah (although
+# it's commonly referred to as Beulah-Hazen, with Hazen being the next
+# largest city in Mercer County).  Google Maps places Beulah's city hall
+# at 4715'51" north, 10146'40" west, which yields an offset of 6h47'07".
+
+Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53
+			-7:00	US	M%sT	2010 Nov  7 2:00
+			-6:00	US	C%sT
+
 # US mountain time, represented by Denver
 #
 # Colorado, far western Kansas, Montana, western

Modified: stable/8/share/zoneinfo/zone.tab
==============================================================================
--- stable/8/share/zoneinfo/zone.tab	Tue Mar  1 21:24:50 2011	(r219149)
+++ stable/8/share/zoneinfo/zone.tab	Tue Mar  1 21:29:00 2011	(r219150)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.38
+# @(#)zone.tab	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -211,8 +211,8 @@ HT	+1832-07220	America/Port-au-Prince
 HU	+4730+01905	Europe/Budapest
 ID	-0610+10648	Asia/Jakarta	Java & Sumatra
 ID	-0002+10920	Asia/Pontianak	west & central Borneo
-ID	-0507+11924	Asia/Makassar	east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
-ID	-0232+14042	Asia/Jayapura	Irian Jaya & the Moluccas
+ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
+ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
 IL	+3146+03514	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
@@ -404,6 +404,7 @@ US	+411745-0863730	America/Indiana/Knox	
 US	+450628-0873651	America/Menominee	Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
 US	+470659-1011757	America/North_Dakota/Center	Central Time - North Dakota - Oliver County
 US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota - Morton County (except Mandan area)
+US	+471551-1014640	America/North_Dakota/Beulah	Central Time - North Dakota - Mercer County
 US	+394421-1045903	America/Denver	Mountain Time
 US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
 US	+364708-1084111	America/Shiprock	Mountain Time - Navajo

From owner-svn-src-stable@FreeBSD.ORG  Tue Mar  1 21:29:09 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5CB1C1065787;
	Tue,  1 Mar 2011 21:29:09 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 42C4F8FC17;
	Tue,  1 Mar 2011 21:29:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21LT962061476;
	Tue, 1 Mar 2011 21:29:09 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LT9hu061473;
	Tue, 1 Mar 2011 21:29:09 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103012129.p21LT9hu061473@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Mar 2011 21:29:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219151 - stable/7/share/zoneinfo
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:29:09 -0000

Author: edwin
Date: Tue Mar  1 21:29:08 2011
New Revision: 219151
URL: http://svn.freebsd.org/changeset/base/219151

Log:
  MFC of 219149, tzdata2011b:
  
  USA/Mercer County, North Dakota - Moved from Mountain time to Central time.

Modified:
  stable/7/share/zoneinfo/northamerica
  stable/7/share/zoneinfo/zone.tab
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/northamerica
==============================================================================
--- stable/7/share/zoneinfo/northamerica	Tue Mar  1 21:29:00 2011	(r219150)
+++ stable/7/share/zoneinfo/northamerica	Tue Mar  1 21:29:08 2011	(r219151)
@@ -1,5 +1,5 @@
 # 
-# %W%
+# @(#)northamerica	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -346,6 +346,27 @@ Zone America/North_Dakota/New_Salem -6:4
 			-7:00	US	M%sT	2003 Oct 26 02:00
 			-6:00	US	C%sT
 
+# From Josh Findley (2011-01-21):
+# ...it appears that Mercer County, North Dakota, changed from the
+# mountain time zone to the central time zone at the last transition from
+# daylight-saving to standard time (on Nov. 7, 2010):
+# 
+# http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
+# 
+# 
+# http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html
+# 
+
+# From Andy Lipscomb (2011-01-24):
+# ...according to the Census Bureau, the largest city is Beulah (although
+# it's commonly referred to as Beulah-Hazen, with Hazen being the next
+# largest city in Mercer County).  Google Maps places Beulah's city hall
+# at 4715'51" north, 10146'40" west, which yields an offset of 6h47'07".
+
+Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53
+			-7:00	US	M%sT	2010 Nov  7 2:00
+			-6:00	US	C%sT
+
 # US mountain time, represented by Denver
 #
 # Colorado, far western Kansas, Montana, western

Modified: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Tue Mar  1 21:29:00 2011	(r219150)
+++ stable/7/share/zoneinfo/zone.tab	Tue Mar  1 21:29:08 2011	(r219151)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.38
+# @(#)zone.tab	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -211,8 +211,8 @@ HT	+1832-07220	America/Port-au-Prince
 HU	+4730+01905	Europe/Budapest
 ID	-0610+10648	Asia/Jakarta	Java & Sumatra
 ID	-0002+10920	Asia/Pontianak	west & central Borneo
-ID	-0507+11924	Asia/Makassar	east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
-ID	-0232+14042	Asia/Jayapura	Irian Jaya & the Moluccas
+ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
+ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
 IL	+3146+03514	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
@@ -404,6 +404,7 @@ US	+411745-0863730	America/Indiana/Knox	
 US	+450628-0873651	America/Menominee	Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
 US	+470659-1011757	America/North_Dakota/Center	Central Time - North Dakota - Oliver County
 US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota - Morton County (except Mandan area)
+US	+471551-1014640	America/North_Dakota/Beulah	Central Time - North Dakota - Mercer County
 US	+394421-1045903	America/Denver	Mountain Time
 US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
 US	+364708-1084111	America/Shiprock	Mountain Time - Navajo

From owner-svn-src-stable@FreeBSD.ORG  Tue Mar  1 21:29:16 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89AF510656AB;
	Tue,  1 Mar 2011 21:29:16 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7743C8FC18;
	Tue,  1 Mar 2011 21:29:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21LTGqq061511;
	Tue, 1 Mar 2011 21:29:16 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LTGSI061508;
	Tue, 1 Mar 2011 21:29:16 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103012129.p21LTGSI061508@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Mar 2011 21:29:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219152 - stable/6/share/zoneinfo
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:29:16 -0000

Author: edwin
Date: Tue Mar  1 21:29:16 2011
New Revision: 219152
URL: http://svn.freebsd.org/changeset/base/219152

Log:
  MFC of 219149, tzdata2011b:
  
  USA/Mercer County, North Dakota - Moved from Mountain time to Central time.

Modified:
  stable/6/share/zoneinfo/northamerica
  stable/6/share/zoneinfo/zone.tab
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/northamerica
==============================================================================
--- stable/6/share/zoneinfo/northamerica	Tue Mar  1 21:29:08 2011	(r219151)
+++ stable/6/share/zoneinfo/northamerica	Tue Mar  1 21:29:16 2011	(r219152)
@@ -1,5 +1,5 @@
 # 
-# %W%
+# @(#)northamerica	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -346,6 +346,27 @@ Zone America/North_Dakota/New_Salem -6:4
 			-7:00	US	M%sT	2003 Oct 26 02:00
 			-6:00	US	C%sT
 
+# From Josh Findley (2011-01-21):
+# ...it appears that Mercer County, North Dakota, changed from the
+# mountain time zone to the central time zone at the last transition from
+# daylight-saving to standard time (on Nov. 7, 2010):
+# 
+# http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
+# 
+# 
+# http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html
+# 
+
+# From Andy Lipscomb (2011-01-24):
+# ...according to the Census Bureau, the largest city is Beulah (although
+# it's commonly referred to as Beulah-Hazen, with Hazen being the next
+# largest city in Mercer County).  Google Maps places Beulah's city hall
+# at 4715'51" north, 10146'40" west, which yields an offset of 6h47'07".
+
+Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53
+			-7:00	US	M%sT	2010 Nov  7 2:00
+			-6:00	US	C%sT
+
 # US mountain time, represented by Denver
 #
 # Colorado, far western Kansas, Montana, western

Modified: stable/6/share/zoneinfo/zone.tab
==============================================================================
--- stable/6/share/zoneinfo/zone.tab	Tue Mar  1 21:29:08 2011	(r219151)
+++ stable/6/share/zoneinfo/zone.tab	Tue Mar  1 21:29:16 2011	(r219152)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.38
+# @(#)zone.tab	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -211,8 +211,8 @@ HT	+1832-07220	America/Port-au-Prince
 HU	+4730+01905	Europe/Budapest
 ID	-0610+10648	Asia/Jakarta	Java & Sumatra
 ID	-0002+10920	Asia/Pontianak	west & central Borneo
-ID	-0507+11924	Asia/Makassar	east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
-ID	-0232+14042	Asia/Jayapura	Irian Jaya & the Moluccas
+ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
+ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
 IL	+3146+03514	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
@@ -404,6 +404,7 @@ US	+411745-0863730	America/Indiana/Knox	
 US	+450628-0873651	America/Menominee	Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
 US	+470659-1011757	America/North_Dakota/Center	Central Time - North Dakota - Oliver County
 US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota - Morton County (except Mandan area)
+US	+471551-1014640	America/North_Dakota/Beulah	Central Time - North Dakota - Mercer County
 US	+394421-1045903	America/Denver	Mountain Time
 US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
 US	+364708-1084111	America/Shiprock	Mountain Time - Navajo

From owner-svn-src-stable@FreeBSD.ORG  Tue Mar  1 21:51:32 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 84E4C106566C;
	Tue,  1 Mar 2011 21:51:32 +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 7209D8FC08;
	Tue,  1 Mar 2011 21:51:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21LpWQf063199;
	Tue, 1 Mar 2011 21:51:32 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LpWTq063194;
	Tue, 1 Mar 2011 21:51:32 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103012151.p21LpWTq063194@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Mar 2011 21:51:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219155 - in stable/8/sys: amd64/linux32
	compat/freebsd32
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:51:32 -0000

Author: kib
Date: Tue Mar  1 21:51:32 2011
New Revision: 219155
URL: http://svn.freebsd.org/changeset/base/219155

Log:
  MFC r210431:
  Remove the linux_exec_copyin_args(), freebsd32_exec_copyin_args() may
  serve as well. COMPAT_FREEBSD32 is a prerequisite for COMPAT_LINUX32.
  
  MFC r210451:
  Use forward declartion for enum uio_seg in imgact.h. This allows to remove
  inclusion of sys/uio.h from the header.
  
  MFC r210498:
  Revert r210451, and the similar part of the r210431. The forward-declaration
  for the enum tag when enum definition is not complete is not allowed by
  C99, and is gcc extension.
  
  MFC r210501:
  Remove unneeded includes.
  
  Requested by:	dchagin

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/amd64/linux32/syscalls.master
  stable/8/sys/compat/freebsd32/freebsd32_misc.c
  stable/8/sys/compat/freebsd32/freebsd32_util.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Tue Mar  1 21:48:22 2011	(r219154)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Tue Mar  1 21:51:32 2011	(r219155)
@@ -60,10 +60,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
-#include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -107,105 +106,6 @@ bsd_to_linux_sigaltstack(int bsa)
 	return (lsa);
 }
 
-/*
- * Custom version of exec_copyin_args() so that we can translate
- * the pointers.
- */
-static int
-linux_exec_copyin_args(struct image_args *args, char *fname,
-    enum uio_seg segflg, char **argv, char **envv)
-{
-	char *argp, *envp;
-	u_int32_t *p32, arg;
-	size_t length;
-	int error;
-
-	bzero(args, sizeof(*args));
-	if (argv == NULL)
-		return (EFAULT);
-
-	/*
-	 * Allocate temporary demand zeroed space for argument and
-	 *	environment strings
-	 */
-	args->buf = (char *)kmem_alloc_wait(exec_map,
-	    PATH_MAX + ARG_MAX + MAXSHELLCMDLEN);
-	if (args->buf == NULL)
-		return (ENOMEM);
-	args->begin_argv = args->buf;
-	args->endp = args->begin_argv;
-	args->stringspace = ARG_MAX;
-
-	args->fname = args->buf + ARG_MAX;
-
-	/*
-	 * Copy the file name.
-	 */
-	error = (segflg == UIO_SYSSPACE) ?
-	    copystr(fname, args->fname, PATH_MAX, &length) :
-	    copyinstr(fname, args->fname, PATH_MAX, &length);
-	if (error != 0)
-		goto err_exit;
-
-	/*
-	 * extract arguments first
-	 */
-	p32 = (u_int32_t *)argv;
-	for (;;) {
-		error = copyin(p32++, &arg, sizeof(arg));
-		if (error)
-			goto err_exit;
-		if (arg == 0)
-			break;
-		argp = PTRIN(arg);
-		error = copyinstr(argp, args->endp, args->stringspace, &length);
-		if (error) {
-			if (error == ENAMETOOLONG)
-				error = E2BIG;
-
-			goto err_exit;
-		}
-		args->stringspace -= length;
-		args->endp += length;
-		args->argc++;
-	}
-
-	args->begin_envv = args->endp;
-
-	/*
-	 * extract environment strings
-	 */
-	if (envv) {
-		p32 = (u_int32_t *)envv;
-		for (;;) {
-			error = copyin(p32++, &arg, sizeof(arg));
-			if (error)
-				goto err_exit;
-			if (arg == 0)
-				break;
-			envp = PTRIN(arg);
-			error = copyinstr(envp, args->endp, args->stringspace,
-			    &length);
-			if (error) {
-				if (error == ENAMETOOLONG)
-					error = E2BIG;
-				goto err_exit;
-			}
-			args->stringspace -= length;
-			args->endp += length;
-			args->envc++;
-		}
-	}
-
-	return (0);
-
-err_exit:
-	kmem_free_wakeup(exec_map, (vm_offset_t)args->buf,
-	    PATH_MAX + ARG_MAX + MAXSHELLCMDLEN);
-	args->buf = NULL;
-	return (error);
-}
-
 int
 linux_execve(struct thread *td, struct linux_execve_args *args)
 {
@@ -220,8 +120,8 @@ linux_execve(struct thread *td, struct l
 		printf(ARGS(execve, "%s"), path);
 #endif
 
-	error = linux_exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp,
-	    args->envp);
+	error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE,
+	    args->argp, args->envp);
 	free(path, M_TEMP);
 	if (error == 0)
 		error = kern_execve(td, &eargs, NULL);

Modified: stable/8/sys/amd64/linux32/syscalls.master
==============================================================================
--- stable/8/sys/amd64/linux32/syscalls.master	Tue Mar  1 21:48:22 2011	(r219154)
+++ stable/8/sys/amd64/linux32/syscalls.master	Tue Mar  1 21:51:32 2011	(r219155)
@@ -54,8 +54,8 @@
 				    l_int mode); }
 9	AUE_LINK	STD	{ int linux_link(char *path, char *to); }
 10	AUE_UNLINK	STD	{ int linux_unlink(char *path); }
-11	AUE_EXECVE	STD	{ int linux_execve(char *path, char **argp, \
-				    char **envp); }
+11	AUE_EXECVE	STD	{ int linux_execve(char *path, u_int32_t *argp, \
+				    u_int32_t *envp); }
 12	AUE_CHDIR	STD	{ int linux_chdir(char *path); }
 13	AUE_NULL	STD	{ int linux_time(l_time_t *tm); }
 14	AUE_MKNOD	STD	{ int linux_mknod(char *path, l_int mode, \

Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_misc.c	Tue Mar  1 21:48:22 2011	(r219154)
+++ stable/8/sys/compat/freebsd32/freebsd32_misc.c	Tue Mar  1 21:51:32 2011	(r219155)
@@ -265,7 +265,7 @@ freebsd32_sigaltstack(struct thread *td,
  * Custom version of exec_copyin_args() so that we can translate
  * the pointers.
  */
-static int
+int
 freebsd32_exec_copyin_args(struct image_args *args, char *fname,
     enum uio_seg segflg, u_int32_t *argv, u_int32_t *envv)
 {

Modified: stable/8/sys/compat/freebsd32/freebsd32_util.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_util.h	Tue Mar  1 21:48:22 2011	(r219154)
+++ stable/8/sys/compat/freebsd32/freebsd32_util.h	Tue Mar  1 21:51:32 2011	(r219155)
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -101,5 +102,8 @@ int	freebsd32_copyiniov(struct iovec32 *
 	    struct iovec **iov, int error);
 void	freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32);
 
+struct image_args;
+int freebsd32_exec_copyin_args(struct image_args *args, char *fname,
+	    enum uio_seg segflg, u_int32_t *argv, u_int32_t *envv);
 
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */

From owner-svn-src-stable@FreeBSD.ORG  Tue Mar  1 21:52:24 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 98421106564A;
	Tue,  1 Mar 2011 21:52:24 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6D1EE8FC17;
	Tue,  1 Mar 2011 21:52:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21LqOCb063302;
	Tue, 1 Mar 2011 21:52:24 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LqOmb063298;
	Tue, 1 Mar 2011 21:52:24 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103012152.p21LqOmb063298@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Mar 2011 21:52:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219156 - stable/8/sys/amd64/linux32
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:52:24 -0000

Author: kib
Date: Tue Mar  1 21:52:24 2011
New Revision: 219156
URL: http://svn.freebsd.org/changeset/base/219156

Log:
  Regen.

Modified:
  stable/8/sys/amd64/linux32/linux32_proto.h
  stable/8/sys/amd64/linux32/linux32_syscall.h
  stable/8/sys/amd64/linux32/linux32_sysent.c

Modified: stable/8/sys/amd64/linux32/linux32_proto.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_proto.h	Tue Mar  1 21:51:32 2011	(r219155)
+++ stable/8/sys/amd64/linux32/linux32_proto.h	Tue Mar  1 21:52:24 2011	(r219156)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 213685 2010-10-11 09:41:24Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -59,8 +59,8 @@ struct linux_unlink_args {
 };
 struct linux_execve_args {
 	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
-	char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)];
-	char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)];
+	char argp_l_[PADL_(u_int32_t *)]; u_int32_t * argp; char argp_r_[PADR_(u_int32_t *)];
+	char envp_l_[PADL_(u_int32_t *)]; u_int32_t * envp; char envp_r_[PADR_(u_int32_t *)];
 };
 struct linux_chdir_args {
 	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];

Modified: stable/8/sys/amd64/linux32/linux32_syscall.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_syscall.h	Tue Mar  1 21:51:32 2011	(r219155)
+++ stable/8/sys/amd64/linux32/linux32_syscall.h	Tue Mar  1 21:52:24 2011	(r219156)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 213685 2010-10-11 09:41:24Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/amd64/linux32/linux32_sysent.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysent.c	Tue Mar  1 21:51:32 2011	(r219155)
+++ stable/8/sys/amd64/linux32/linux32_sysent.c	Tue Mar  1 21:52:24 2011	(r219156)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 213685 2010-10-11 09:41:24Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
  */
 
 #include "opt_compat.h"

From owner-svn-src-stable@FreeBSD.ORG  Tue Mar  1 22:35:44 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 57CA51065677;
	Tue,  1 Mar 2011 22:35:44 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 01E998FC14;
	Tue,  1 Mar 2011 22:35:43 +0000 (UTC)
Received: from corbina.ru (mail.post.ru [195.14.50.16])
	by contrabass.post.ru (Postfix) with ESMTP id B2262CA940;
	Wed,  2 Mar 2011 01:07:22 +0300 (MSK)
X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9
Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru)
	by corbina.ru (CommuniGate Pro SMTP 5.1.14)
	with ESMTPS id 304889339; Wed, 02 Mar 2011 01:07:22 +0300
Received: from dchagin.static.corbina.ru (localhost [127.0.0.1])
	by dchagin.static.corbina.ru (8.14.4/8.14.4) with ESMTP id
	p21M7MWu021926; Wed, 2 Mar 2011 01:07:22 +0300 (MSK)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: (from dchagin@localhost)
	by dchagin.static.corbina.ru (8.14.4/8.14.4/Submit) id p21M7HLZ021925; 
	Wed, 2 Mar 2011 01:07:17 +0300 (MSK) (envelope-from dchagin)
Date: Wed, 2 Mar 2011 01:07:15 +0300
From: Chagin Dmitry 
To: Konstantin Belousov 
Message-ID: <20110301220715.GA21912@dchagin.static.corbina.ru>
References: <201103012151.p21LpWTq063194@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft"
Content-Disposition: inline
In-Reply-To: <201103012151.p21LpWTq063194@svn.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219155 - in stable/8/sys: amd64/linux32
 compat/freebsd32
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 22:35:44 -0000


--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 01, 2011 at 09:51:32PM +0000, Konstantin Belousov wrote:
> Author: kib
> Date: Tue Mar  1 21:51:32 2011
> New Revision: 219155
> URL: http://svn.freebsd.org/changeset/base/219155
>=20
> Log:
>   MFC r210431:
>   Remove the linux_exec_copyin_args(), freebsd32_exec_copyin_args() may
>   serve as well. COMPAT_FREEBSD32 is a prerequisite for COMPAT_LINUX32.
>  =20
>   MFC r210451:
>   Use forward declartion for enum uio_seg in imgact.h. This allows to rem=
ove
>   inclusion of sys/uio.h from the header.
>  =20
>   MFC r210498:
>   Revert r210451, and the similar part of the r210431. The forward-declar=
ation
>   for the enum tag when enum definition is not complete is not allowed by
>   C99, and is gcc extension.
>  =20
>   MFC r210501:
>   Remove unneeded includes.
>  =20
>   Requested by:	dchagin

thnx!!

--=20
Have fun!
chd

--/04w6evG8XlLl3ft
Content-Type: application/pgp-signature

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

iEYEARECAAYFAk1tbhAACgkQ0t2Tb3OO/O3cuQCbBEp16TDU6+LX/Y/LlGsmdAMe
yMUAoI78g1Z4pWE7qrxtTo6FGJInvs6T
=POop
-----END PGP SIGNATURE-----

--/04w6evG8XlLl3ft--

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 00:36:28 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A0BE7106566C;
	Wed,  2 Mar 2011 00:36:28 +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 85DCD8FC0A;
	Wed,  2 Mar 2011 00:36:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p220aSP4072103;
	Wed, 2 Mar 2011 00:36:28 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p220aSei072100;
	Wed, 2 Mar 2011 00:36:28 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103020036.p220aSei072100@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 2 Mar 2011 00:36:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219159 - stable/8/sys/kern
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 00:36:28 -0000

Author: kib
Date: Wed Mar  2 00:36:28 2011
New Revision: 219159
URL: http://svn.freebsd.org/changeset/base/219159

Log:
  MFC r218972:
  Move the  max_threads_per_proc and max_threads_hits variables to the
  file where they are used. Declare the kern.threads sysctl node at the
  same location. Since no external use for the variables exists, make them
  static.
  
  MFC r218976 (by pluknet):
  Clean up the now unused #include statement.

Modified:
  stable/8/sys/kern/kern_thr.c
  stable/8/sys/kern/kern_thread.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/kern_thr.c
==============================================================================
--- stable/8/sys/kern/kern_thr.c	Wed Mar  2 00:29:14 2011	(r219158)
+++ stable/8/sys/kern/kern_thr.c	Wed Mar  2 00:36:28 2011	(r219159)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -55,6 +56,16 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW, 0, "thread allocation");
+
+static int max_threads_per_proc = 1500;
+SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_per_proc, CTLFLAG_RW,
+	&max_threads_per_proc, 0, "Limit on threads per proc");
+
+static int max_threads_hits;
+SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD,
+	&max_threads_hits, 0, "");
+
 #ifdef COMPAT_FREEBSD32
 
 static inline int
@@ -73,9 +84,6 @@ suword_lwpid(void *addr, lwpid_t lwpid)
 #define suword_lwpid	suword
 #endif
 
-extern int max_threads_per_proc;
-extern int max_threads_hits;
-
 static int create_thread(struct thread *td, mcontext_t *ctx,
 			 void (*start_func)(void *), void *arg,
 			 char *stack_base, size_t stack_size,

Modified: stable/8/sys/kern/kern_thread.c
==============================================================================
--- stable/8/sys/kern/kern_thread.c	Wed Mar  2 00:29:14 2011	(r219158)
+++ stable/8/sys/kern/kern_thread.c	Wed Mar  2 00:36:28 2011	(r219159)
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -64,16 +63,6 @@ __FBSDID("$FreeBSD$");
  */
 static uma_zone_t thread_zone;
 
-SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW, 0, "thread allocation");
-
-int max_threads_per_proc = 1500;
-SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_per_proc, CTLFLAG_RW,
-	&max_threads_per_proc, 0, "Limit on threads per proc");
-
-int max_threads_hits;
-SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD,
-	&max_threads_hits, 0, "");
-
 TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads);
 static struct mtx zombie_lock;
 MTX_SYSINIT(zombie_lock, &zombie_lock, "zombie lock", MTX_SPIN);

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:01:49 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99552106564A;
	Wed,  2 Mar 2011 06:01:49 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B03E8FC0C;
	Wed,  2 Mar 2011 06:01:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2261nms082355;
	Wed, 2 Mar 2011 06:01:49 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2261nWi082353;
	Wed, 2 Mar 2011 06:01:49 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020601.p2261nWi082353@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:01:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219160 - stable/8/sys/amd64/linux32
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:01:50 -0000

Author: dchagin
Date: Wed Mar  2 06:01:49 2011
New Revision: 219160
URL: http://svn.freebsd.org/changeset/base/219160

Log:
  MFC r218028:
  To avoid excessive code duplication move struct rusage translation
  to a separate function.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 00:36:28 2011	(r219159)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:01:49 2011	(r219160)
@@ -106,6 +106,28 @@ bsd_to_linux_sigaltstack(int bsa)
 	return (lsa);
 }
 
+static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru)
+{
+	lru->ru_utime.tv_sec = ru->ru_utime.tv_sec;
+	lru->ru_utime.tv_usec = ru->ru_utime.tv_usec;
+	lru->ru_stime.tv_sec = ru->ru_stime.tv_sec;
+	lru->ru_stime.tv_usec = ru->ru_stime.tv_usec;
+	lru->ru_maxrss = ru->ru_maxrss;
+	lru->ru_ixrss = ru->ru_ixrss;
+	lru->ru_idrss = ru->ru_idrss;
+	lru->ru_isrss = ru->ru_isrss;
+	lru->ru_minflt = ru->ru_minflt;
+	lru->ru_majflt = ru->ru_majflt;
+	lru->ru_nswap = ru->ru_nswap;
+	lru->ru_inblock = ru->ru_inblock;
+	lru->ru_oublock = ru->ru_oublock;
+	lru->ru_msgsnd = ru->ru_msgsnd;
+	lru->ru_msgrcv = ru->ru_msgrcv;
+	lru->ru_nsignals = ru->ru_nsignals;
+	lru->ru_nvcsw = ru->ru_nvcsw;
+	lru->ru_nivcsw = ru->ru_nivcsw;
+}
+
 int
 linux_execve(struct thread *td, struct linux_execve_args *args)
 {
@@ -1124,24 +1146,7 @@ linux_getrusage(struct thread *td, struc
 	if (error != 0)
 		return (error);
 	if (uap->rusage != NULL) {
-		s32.ru_utime.tv_sec = s.ru_utime.tv_sec;
-		s32.ru_utime.tv_usec = s.ru_utime.tv_usec;
-		s32.ru_stime.tv_sec = s.ru_stime.tv_sec;
-		s32.ru_stime.tv_usec = s.ru_stime.tv_usec;
-		s32.ru_maxrss = s.ru_maxrss;
-		s32.ru_ixrss = s.ru_ixrss;
-		s32.ru_idrss = s.ru_idrss;
-		s32.ru_isrss = s.ru_isrss;
-		s32.ru_minflt = s.ru_minflt;
-		s32.ru_majflt = s.ru_majflt;
-		s32.ru_nswap = s.ru_nswap;
-		s32.ru_inblock = s.ru_inblock;
-		s32.ru_oublock = s.ru_oublock;
-		s32.ru_msgsnd = s.ru_msgsnd;
-		s32.ru_msgrcv = s.ru_msgrcv;
-		s32.ru_nsignals = s.ru_nsignals;
-		s32.ru_nvcsw = s.ru_nvcsw;
-		s32.ru_nivcsw = s.ru_nivcsw;
+		bsd_to_linux_rusage(&s, &s32);
 		error = copyout(&s32, uap->rusage, sizeof(s32));
 	}
 	return (error);

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:03:54 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4E371065673;
	Wed,  2 Mar 2011 06:03:54 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D11208FC15;
	Wed,  2 Mar 2011 06:03:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2263sTe082447;
	Wed, 2 Mar 2011 06:03:54 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2263sKa082442;
	Wed, 2 Mar 2011 06:03:54 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020603.p2263sKa082442@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:03:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219161 - in stable/8/sys: amd64/linux32 compat/linux
	i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:03:55 -0000

Author: dchagin
Date: Wed Mar  2 06:03:54 2011
New Revision: 219161
URL: http://svn.freebsd.org/changeset/base/219161

Log:
  MFC r218030:
  Implement a variation of the linux_common_wait() which should
  be used by linuxolator itself.
  
  Move linux_wait4() to MD path as it requires native struct
  rusage translation to struct l_rusage on linux32/amd64.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/compat/linux/linux_misc.c
  stable/8/sys/compat/linux/linux_misc.h
  stable/8/sys/i386/linux/linux_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:01:49 2011	(r219160)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:03:54 2011	(r219161)
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -66,6 +67,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1268,3 +1270,44 @@ linux_set_thread_area(struct thread *td,
 
 	return (0);
 }
+
+int
+linux_wait4(struct thread *td, struct linux_wait4_args *args)
+{
+	int error, options;
+	struct rusage ru, *rup;
+	struct l_rusage lru;
+	struct proc *p;
+
+#ifdef DEBUG
+	if (ldebug(wait4))
+		printf(ARGS(wait4, "%d, %p, %d, %p"),
+		    args->pid, (void *)args->status, args->options,
+		    (void *)args->rusage);
+#endif
+
+	options = (args->options & (WNOHANG | WUNTRACED));
+	/* WLINUXCLONE should be equal to __WCLONE, but we make sure */
+	if (args->options & __WCLONE)
+		options |= WLINUXCLONE;
+
+	if (args->rusage != NULL)
+		rup = &ru;
+	else
+		rup = NULL;
+	error = linux_common_wait(td, args->pid, args->status, options, rup);
+	if (error)
+		return (error);
+
+	p = td->td_proc;
+	PROC_LOCK(p);
+	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
+	PROC_UNLOCK(p);
+
+	if (args->rusage != NULL) {
+		bsd_to_linux_rusage(rup, &lru);
+		error = copyout(&lru, args->rusage, sizeof(lru));
+	}
+
+	return (error);
+}

Modified: stable/8/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:01:49 2011	(r219160)
+++ stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:03:54 2011	(r219161)
@@ -847,35 +847,17 @@ linux_futimesat(struct thread *td, struc
 }
 #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
-#define __WCLONE 0x80000000
-
 int
-linux_waitpid(struct thread *td, struct linux_waitpid_args *args)
+linux_common_wait(struct thread *td, int pid, int *status,
+    int options, struct rusage *ru)
 {
-	int error, options, tmpstat;
-
-#ifdef DEBUG
-	if (ldebug(waitpid))
-		printf(ARGS(waitpid, "%d, %p, %d"),
-		    args->pid, (void *)args->status, args->options);
-#endif
-	/*
-	 * this is necessary because the test in kern_wait doesn't work
-	 * because we mess with the options here
-	 */
-	if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE))
-		return (EINVAL);
+	int error, tmpstat;
 
-	options = (args->options & (WNOHANG | WUNTRACED));
-	/* WLINUXCLONE should be equal to __WCLONE, but we make sure */
-	if (args->options & __WCLONE)
-		options |= WLINUXCLONE;
-
-	error = kern_wait(td, args->pid, &tmpstat, options, NULL);
+	error = kern_wait(td, pid, &tmpstat, options, ru);
 	if (error)
-		return error;
+		return (error);
 
-	if (args->status) {
+	if (status) {
 		tmpstat &= 0xffff;
 		if (WIFSIGNALED(tmpstat))
 			tmpstat = (tmpstat & 0xffffff80) |
@@ -883,60 +865,38 @@ linux_waitpid(struct thread *td, struct 
 		else if (WIFSTOPPED(tmpstat))
 			tmpstat = (tmpstat & 0xffff00ff) |
 			    (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8);
-		return copyout(&tmpstat, args->status, sizeof(int));
+		error = copyout(&tmpstat, status, sizeof(int));
 	}
 
-	return (0);
+	return (error);
 }
 
 int
-linux_wait4(struct thread *td, struct linux_wait4_args *args)
+linux_waitpid(struct thread *td, struct linux_waitpid_args *args)
 {
-	int error, options, tmpstat;
-	struct rusage ru, *rup;
-	struct proc *p;
-
+	int options;
+ 
 #ifdef DEBUG
-	if (ldebug(wait4))
-		printf(ARGS(wait4, "%d, %p, %d, %p"),
-		    args->pid, (void *)args->status, args->options,
-		    (void *)args->rusage);
+	if (ldebug(waitpid))
+		printf(ARGS(waitpid, "%d, %p, %d"),
+		    args->pid, (void *)args->status, args->options);
 #endif
-
+	/*
+	 * this is necessary because the test in kern_wait doesn't work
+	 * because we mess with the options here
+	 */
+	if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE))
+		return (EINVAL);
+   
 	options = (args->options & (WNOHANG | WUNTRACED));
 	/* WLINUXCLONE should be equal to __WCLONE, but we make sure */
 	if (args->options & __WCLONE)
 		options |= WLINUXCLONE;
 
-	if (args->rusage != NULL)
-		rup = &ru;
-	else
-		rup = NULL;
-	error = kern_wait(td, args->pid, &tmpstat, options, rup);
-	if (error)
-		return error;
-
-	p = td->td_proc;
-	PROC_LOCK(p);
-	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
-	PROC_UNLOCK(p);
-
-	if (args->status) {
-		tmpstat &= 0xffff;
-		if (WIFSIGNALED(tmpstat))
-			tmpstat = (tmpstat & 0xffffff80) |
-			    BSD_TO_LINUX_SIGNAL(WTERMSIG(tmpstat));
-		else if (WIFSTOPPED(tmpstat))
-			tmpstat = (tmpstat & 0xffff00ff) |
-			    (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8);
-		error = copyout(&tmpstat, args->status, sizeof(int));
-	}
-	if (args->rusage != NULL && error == 0)
-		error = copyout(&ru, args->rusage, sizeof(ru));
-
-	return (error);
+	return (linux_common_wait(td, args->pid, args->status, options, NULL));
 }
 
+
 int
 linux_mknod(struct thread *td, struct linux_mknod_args *args)
 {

Modified: stable/8/sys/compat/linux/linux_misc.h
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.h	Wed Mar  2 06:01:49 2011	(r219160)
+++ stable/8/sys/compat/linux/linux_misc.h	Wed Mar  2 06:03:54 2011	(r219161)
@@ -67,4 +67,9 @@ extern const char *linux_platform;
 
 extern int stclohz;
 
+#define __WCLONE 0x80000000
+
+int linux_common_wait(struct thread *td, int pid, int *status,
+			int options, struct rusage *ru);
+
 #endif	/* _LINUX_MISC_H_ */

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 06:01:49 2011	(r219160)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 06:03:54 2011	(r219161)
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1312,3 +1313,40 @@ linux_mq_getsetattr(struct thread *td, s
 #endif
 }
 
+int
+linux_wait4(struct thread *td, struct linux_wait4_args *args)
+{
+	int error, options;
+	struct rusage ru, *rup;
+	struct proc *p;
+
+#ifdef DEBUG
+	if (ldebug(wait4))
+		printf(ARGS(wait4, "%d, %p, %d, %p"),
+		    args->pid, (void *)args->status, args->options,
+		    (void *)args->rusage);
+#endif
+
+	options = (args->options & (WNOHANG | WUNTRACED));
+	/* WLINUXCLONE should be equal to __WCLONE, but we make sure */
+	if (args->options & __WCLONE)
+		options |= WLINUXCLONE;
+
+	if (args->rusage != NULL)
+		rup = &ru;
+	else
+		rup = NULL;
+	error = linux_common_wait(td, args->pid, args->status, options, rup);
+	if (error)
+		return (error);
+
+	p = td->td_proc;
+	PROC_LOCK(p);
+	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
+	PROC_UNLOCK(p);
+
+	if (args->rusage != NULL)
+		error = copyout(&ru, args->rusage, sizeof(ru));
+
+	return (error);
+}

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:06:38 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C8061065672;
	Wed,  2 Mar 2011 06:06:38 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 49C298FC13;
	Wed,  2 Mar 2011 06:06:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2266cA3082552;
	Wed, 2 Mar 2011 06:06:38 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2266cTJ082550;
	Wed, 2 Mar 2011 06:06:38 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020606.p2266cTJ082550@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:06:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219162 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:06:38 -0000

Author: dchagin
Date: Wed Mar  2 06:06:38 2011
New Revision: 219162
URL: http://svn.freebsd.org/changeset/base/219162

Log:
  MFC r218031:
  Style(9) fixes.

Modified:
  stable/8/sys/compat/linux/linux_misc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:03:54 2011	(r219161)
+++ stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:06:38 2011	(r219162)
@@ -160,7 +160,7 @@ linux_sysinfo(struct thread *td, struct 
 	sysinfo.freebig = 0;
 	sysinfo.mem_unit = 1;
 
-	return copyout(&sysinfo, args->info, sizeof(sysinfo));
+	return (copyout(&sysinfo, args->info, sizeof(sysinfo)));
 }
 
 int
@@ -216,7 +216,7 @@ linux_brk(struct thread *td, struct linu
 	else
 		td->td_retval[0] = (long)old;
 
-	return 0;
+	return (0);
 }
 
 #if defined(__i386__)
@@ -468,7 +468,7 @@ cleanup:
 		vm_map_remove(kernel_map, (vm_offset_t)a_out,
 		    (vm_offset_t)a_out + PAGE_SIZE);
 
-	return error;
+	return (error);
 }
 
 #endif	/* __i386__ */
@@ -562,7 +562,7 @@ select_out:
 	if (ldebug(select))
 		printf(LMSG("select_out -> %d"), error);
 #endif
-	return error;
+	return (error);
 }
 
 int
@@ -602,7 +602,7 @@ linux_mremap(struct thread *td, struct l
 
 	if (args->new_len > args->old_len) {
 		td->td_retval[0] = 0;
-		return ENOMEM;
+		return (ENOMEM);
 	}
 
 	if (args->new_len < args->old_len) {
@@ -613,7 +613,7 @@ linux_mremap(struct thread *td, struct l
 	}
 
 	td->td_retval[0] = error ? 0 : (uintptr_t)args->addr;
-	return error;
+	return (error);
 }
 
 #define LINUX_MS_ASYNC       0x0001
@@ -629,7 +629,7 @@ linux_msync(struct thread *td, struct li
 	bsd_args.len = (uintptr_t)args->len;
 	bsd_args.flags = args->fl & ~LINUX_MS_SYNC;
 
-	return msync(td, &bsd_args);
+	return (msync(td, &bsd_args));
 }
 
 int
@@ -647,9 +647,9 @@ linux_time(struct thread *td, struct lin
 	microtime(&tv);
 	tm = tv.tv_sec;
 	if (args->tm && (error = copyout(&tm, args->tm, sizeof(tm))))
-		return error;
+		return (error);
 	td->td_retval[0] = tm;
-	return 0;
+	return (0);
 }
 
 struct l_times_argv {
@@ -702,12 +702,12 @@ linux_times(struct thread *td, struct li
 		tms.tms_cstime = CONVTCK(cstime);
 
 		if ((error = copyout(&tms, args->buf, sizeof(tms))))
-			return error;
+			return (error);
 	}
 
 	microuptime(&tv);
 	td->td_retval[0] = (int)CONVTCK(tv);
-	return 0;
+	return (0);
 }
 
 int
@@ -766,7 +766,7 @@ linux_utime(struct thread *td, struct li
 	if (args->times) {
 		if ((error = copyin(args->times, &lut, sizeof lut))) {
 			LFREEPATH(fname);
-			return error;
+			return (error);
 		}
 		tv[0].tv_sec = lut.l_actime;
 		tv[0].tv_usec = 0;
@@ -1003,11 +1003,11 @@ linux_personality(struct thread *td, str
 		printf(ARGS(personality, "%lu"), (unsigned long)args->per);
 #endif
 	if (args->per != 0)
-		return EINVAL;
+		return (EINVAL);
 
 	/* Yes Jim, it's still a Linux... */
 	td->td_retval[0] = 0;
-	return 0;
+	return (0);
 }
 
 struct l_itimerval {
@@ -1085,7 +1085,7 @@ linux_nice(struct thread *td, struct lin
 	bsd_args.which = PRIO_PROCESS;
 	bsd_args.who = 0;		/* current process */
 	bsd_args.prio = args->inc;
-	return setpriority(td, &bsd_args);
+	return (setpriority(td, &bsd_args));
 }
 
 int
@@ -1312,12 +1312,12 @@ linux_sched_setscheduler(struct thread *
 		bsd.policy = SCHED_RR;
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
 
 	bsd.pid = args->pid;
 	bsd.param = (struct sched_param *)args->param;
-	return sched_setscheduler(td, &bsd);
+	return (sched_setscheduler(td, &bsd));
 }
 
 int
@@ -1347,7 +1347,7 @@ linux_sched_getscheduler(struct thread *
 		break;
 	}
 
-	return error;
+	return (error);
 }
 
 int
@@ -1372,9 +1372,9 @@ linux_sched_get_priority_max(struct thre
 		bsd.policy = SCHED_RR;
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
-	return sched_get_priority_max(td, &bsd);
+	return (sched_get_priority_max(td, &bsd));
 }
 
 int
@@ -1399,9 +1399,9 @@ linux_sched_get_priority_min(struct thre
 		bsd.policy = SCHED_RR;
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
-	return sched_get_priority_min(td, &bsd);
+	return (sched_get_priority_min(td, &bsd));
 }
 
 #define REBOOT_CAD_ON	0x89abcdef
@@ -1426,7 +1426,7 @@ linux_reboot(struct thread *td, struct l
 #endif
 
 	if (args->magic1 != REBOOT_MAGIC1)
-		return EINVAL;
+		return (EINVAL);
 
 	switch (args->magic2) {
 	case REBOOT_MAGIC2:
@@ -1434,7 +1434,7 @@ linux_reboot(struct thread *td, struct l
 	case REBOOT_MAGIC2B:
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
 
 	switch (args->cmd) {
@@ -1452,9 +1452,9 @@ linux_reboot(struct thread *td, struct l
 		bsd_args.opt = RB_POWEROFF;
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
-	return reboot(td, &bsd_args);
+	return (reboot(td, &bsd_args));
 }
 
 
@@ -1592,7 +1592,7 @@ linux_getsid(struct thread *td, struct l
 #endif
 
 	bsd.pid = args->pid;
-	return getsid(td, &bsd);
+	return (getsid(td, &bsd));
 }
 
 int
@@ -1617,7 +1617,7 @@ linux_getpriority(struct thread *td, str
 	bsd_args.who = args->who;
 	error = getpriority(td, &bsd_args);
 	td->td_retval[0] = 20 - td->td_retval[0];
-	return error;
+	return (error);
 }
 
 int

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:08:42 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7DC531065670;
	Wed,  2 Mar 2011 06:08:42 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6BF6E8FC13;
	Wed,  2 Mar 2011 06:08:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2268g0h082638;
	Wed, 2 Mar 2011 06:08:42 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2268giO082636;
	Wed, 2 Mar 2011 06:08:42 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020608.p2268giO082636@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:08:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219163 - stable/8/sys/amd64/linux32
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:08:42 -0000

Author: dchagin
Date: Wed Mar  2 06:08:42 2011
New Revision: 219163
URL: http://svn.freebsd.org/changeset/base/219163

Log:
  MFC r218059:
  Fix my style(9) bg introduced in r218028.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:06:38 2011	(r219162)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:08:42 2011	(r219163)
@@ -108,8 +108,10 @@ bsd_to_linux_sigaltstack(int bsa)
 	return (lsa);
 }
 
-static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru)
+static void
+bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru)
 {
+
 	lru->ru_utime.tv_sec = ru->ru_utime.tv_sec;
 	lru->ru_utime.tv_usec = ru->ru_utime.tv_usec;
 	lru->ru_stime.tv_sec = ru->ru_stime.tv_sec;

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:09:52 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E8C3B1065674;
	Wed,  2 Mar 2011 06:09:52 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BCCDD8FC08;
	Wed,  2 Mar 2011 06:09:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2269q24082708;
	Wed, 2 Mar 2011 06:09:52 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2269q2Y082705;
	Wed, 2 Mar 2011 06:09:52 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020609.p2269q2Y082705@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:09:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219164 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:09:53 -0000

Author: dchagin
Date: Wed Mar  2 06:09:52 2011
New Revision: 219164
URL: http://svn.freebsd.org/changeset/base/219164

Log:
  MFC r218100:
  The kern_wait() code already removes the SIGCHLD signal for the waited
  process. Removing other SIGCHLD signals is not needed and may cause
  problems.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/i386/linux/linux_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:08:42 2011	(r219163)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:09:52 2011	(r219164)
@@ -1279,7 +1279,6 @@ linux_wait4(struct thread *td, struct li
 	int error, options;
 	struct rusage ru, *rup;
 	struct l_rusage lru;
-	struct proc *p;
 
 #ifdef DEBUG
 	if (ldebug(wait4))
@@ -1300,12 +1299,6 @@ linux_wait4(struct thread *td, struct li
 	error = linux_common_wait(td, args->pid, args->status, options, rup);
 	if (error)
 		return (error);
-
-	p = td->td_proc;
-	PROC_LOCK(p);
-	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
-	PROC_UNLOCK(p);
-
 	if (args->rusage != NULL) {
 		bsd_to_linux_rusage(rup, &lru);
 		error = copyout(&lru, args->rusage, sizeof(lru));

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 06:08:42 2011	(r219163)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 06:09:52 2011	(r219164)
@@ -1318,7 +1318,6 @@ linux_wait4(struct thread *td, struct li
 {
 	int error, options;
 	struct rusage ru, *rup;
-	struct proc *p;
 
 #ifdef DEBUG
 	if (ldebug(wait4))
@@ -1339,12 +1338,6 @@ linux_wait4(struct thread *td, struct li
 	error = linux_common_wait(td, args->pid, args->status, options, rup);
 	if (error)
 		return (error);
-
-	p = td->td_proc;
-	PROC_LOCK(p);
-	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
-	PROC_UNLOCK(p);
-
 	if (args->rusage != NULL)
 		error = copyout(&ru, args->rusage, sizeof(ru));
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:11:42 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 72C72106567A;
	Wed,  2 Mar 2011 06:11:42 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4712B8FC2E;
	Wed,  2 Mar 2011 06:11:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p226BgrH082813;
	Wed, 2 Mar 2011 06:11:42 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226Bg6B082810;
	Wed, 2 Mar 2011 06:11:42 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020611.p226Bg6B082810@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:11:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219165 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:11:42 -0000

Author: dchagin
Date: Wed Mar  2 06:11:41 2011
New Revision: 219165
URL: http://svn.freebsd.org/changeset/base/219165

Log:
  MFC r218101:
  Change linux futex syscall definition to match actual linux one.

Modified:
  stable/8/sys/amd64/linux32/syscalls.master
  stable/8/sys/i386/linux/syscalls.master
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/syscalls.master
==============================================================================
--- stable/8/sys/amd64/linux32/syscalls.master	Wed Mar  2 06:09:52 2011	(r219164)
+++ stable/8/sys/amd64/linux32/syscalls.master	Wed Mar  2 06:11:41 2011	(r219165)
@@ -405,8 +405,8 @@
 237	AUE_NULL	STD	{ int linux_fremovexattr(void); }
 238	AUE_NULL	STD	{ int linux_tkill(int tid, int sig); }
 239	AUE_SENDFILE	UNIMPL	linux_sendfile64
-240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, int val, \
-					struct l_timespec *timeout, void *uaddr2, int val3); }
+240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, uint32_t val, \
+					struct l_timespec *timeout, uint32_t *uaddr2, uint32_t val3); }
 241	AUE_NULL	STD	{ int linux_sched_setaffinity(l_pid_t pid, l_uint len, \
 					l_ulong *user_mask_ptr); }
 242	AUE_NULL	STD	{ int linux_sched_getaffinity(l_pid_t pid, l_uint len, \

Modified: stable/8/sys/i386/linux/syscalls.master
==============================================================================
--- stable/8/sys/i386/linux/syscalls.master	Wed Mar  2 06:09:52 2011	(r219164)
+++ stable/8/sys/i386/linux/syscalls.master	Wed Mar  2 06:11:41 2011	(r219165)
@@ -407,8 +407,8 @@
 237	AUE_NULL	STD	{ int linux_fremovexattr(void); }
 238	AUE_NULL	STD	{ int linux_tkill(int tid, int sig); }
 239	AUE_SENDFILE	UNIMPL	linux_sendfile64
-240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, int val, \
-					struct l_timespec *timeout, void *uaddr2, int val3); }
+240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, uint32_t val, \
+					struct l_timespec *timeout, uint32_t *uaddr2, uint32_t val3); }
 241	AUE_NULL	STD	{ int linux_sched_setaffinity(l_pid_t pid, l_uint len, \
 					l_ulong *user_mask_ptr); }
 242	AUE_NULL	STD	{ int linux_sched_getaffinity(l_pid_t pid, l_uint len, \

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:13:04 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 65CF2106564A;
	Wed,  2 Mar 2011 06:13:04 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 52EBA8FC0A;
	Wed,  2 Mar 2011 06:13:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p226D4rG082880;
	Wed, 2 Mar 2011 06:13:04 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226D419082873;
	Wed, 2 Mar 2011 06:13:04 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020613.p226D419082873@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:13:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219166 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:13:04 -0000

Author: dchagin
Date: Wed Mar  2 06:13:03 2011
New Revision: 219166
URL: http://svn.freebsd.org/changeset/base/219166

Log:
  Regen for r219165.

Modified:
  stable/8/sys/amd64/linux32/linux32_proto.h
  stable/8/sys/amd64/linux32/linux32_syscall.h
  stable/8/sys/amd64/linux32/linux32_sysent.c
  stable/8/sys/i386/linux/linux_proto.h
  stable/8/sys/i386/linux/linux_syscall.h
  stable/8/sys/i386/linux/linux_sysent.c

Modified: stable/8/sys/amd64/linux32/linux32_proto.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_proto.h	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/amd64/linux32/linux32_proto.h	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -734,10 +734,10 @@ struct linux_tkill_args {
 struct linux_sys_futex_args {
 	char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)];
 	char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
-	char val_l_[PADL_(int)]; int val; char val_r_[PADR_(int)];
+	char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)];
 	char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
-	char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)];
-	char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)];
+	char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)];
+	char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)];
 };
 struct linux_sched_setaffinity_args {
 	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];

Modified: stable/8/sys/amd64/linux32/linux32_syscall.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_syscall.h	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/amd64/linux32/linux32_syscall.h	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/amd64/linux32/linux32_sysent.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysent.c	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/amd64/linux32/linux32_sysent.c	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #include "opt_compat.h"

Modified: stable/8/sys/i386/linux/linux_proto.h
==============================================================================
--- stable/8/sys/i386/linux/linux_proto.h	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/i386/linux/linux_proto.h	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 184789 2008-11-09 10:45:13Z ed 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -731,10 +731,10 @@ struct linux_tkill_args {
 struct linux_sys_futex_args {
 	char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)];
 	char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
-	char val_l_[PADL_(int)]; int val; char val_r_[PADR_(int)];
+	char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)];
 	char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
-	char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)];
-	char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)];
+	char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)];
+	char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)];
 };
 struct linux_sched_setaffinity_args {
 	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
@@ -1277,6 +1277,13 @@ int	linux_vmsplice(struct thread *, stru
 
 #endif /* COMPAT_FREEBSD6 */
 
+
+#ifdef COMPAT_FREEBSD7
+
+#define	nosys	linux_nosys
+
+#endif /* COMPAT_FREEBSD7 */
+
 #define	LINUX_SYS_AUE_linux_fork	AUE_FORK
 #define	LINUX_SYS_AUE_linux_open	AUE_OPEN_RWTC
 #define	LINUX_SYS_AUE_linux_waitpid	AUE_WAIT4

Modified: stable/8/sys/i386/linux/linux_syscall.h
==============================================================================
--- stable/8/sys/i386/linux/linux_syscall.h	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/i386/linux/linux_syscall.h	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 184789 2008-11-09 10:45:13Z ed 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/i386/linux/linux_sysent.c
==============================================================================
--- stable/8/sys/i386/linux/linux_sysent.c	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/i386/linux/linux_sysent.c	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 184789 2008-11-09 10:45:13Z ed 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #include 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:18:22 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 72521106566B;
	Wed,  2 Mar 2011 06:18:22 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 280B88FC13;
	Wed,  2 Mar 2011 06:18:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p226IMLw083049;
	Wed, 2 Mar 2011 06:18:22 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226IMkA083046;
	Wed, 2 Mar 2011 06:18:22 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020618.p226IMkA083046@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:18:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219167 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:18:22 -0000

Author: dchagin
Date: Wed Mar  2 06:18:21 2011
New Revision: 219167
URL: http://svn.freebsd.org/changeset/base/219167

Log:
  MFC r218117:
  Implement a futex BITSET op.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
  stable/8/sys/compat/linux/linux_futex.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:13:03 2011	(r219166)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:18:21 2011	(r219167)
@@ -79,6 +79,7 @@ struct futex {
 	struct sx	f_lck;
 	uint32_t	*f_uaddr;
 	uint32_t	f_refcount;
+	uint32_t	f_bitset;
 	LIST_ENTRY(futex) f_list;
 	TAILQ_HEAD(lf_waiting_proc, waiting_proc) f_waiting_proc;
 };
@@ -264,15 +265,25 @@ futex_sleep(struct futex *f, struct wait
 }
 
 static int
-futex_wake(struct futex *f, int n)
+futex_wake(struct futex *f, int n, uint32_t bitset)
 {
 	struct waiting_proc *wp, *wpt;
 	int count = 0;
 
+	if (bitset == 0)
+		return (EINVAL);
+
 	FUTEX_ASSERT_LOCKED(f);
 	TAILQ_FOREACH_SAFE(wp, &f->f_waiting_proc, wp_list, wpt) {
 		LINUX_CTR3(sys_futex, "futex_wake uaddr %p wp %p ref %d",
 		    f->f_uaddr, wp, f->f_refcount);
+		/*
+		 * Unless we find a matching bit in
+		 * the bitset, continue searching.
+		 */
+		if (!(wp->wp_futex->f_bitset & bitset))
+			continue;
+
 		wp->wp_flags |= FUTEX_WP_REMOVED;
 		TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list);
 		wakeup_one(wp);
@@ -325,13 +336,18 @@ futex_requeue(struct futex *f, int n, st
 }
 
 static int
-futex_wait(struct futex *f, struct waiting_proc *wp, struct l_timespec *ts)
+futex_wait(struct futex *f, struct waiting_proc *wp, struct l_timespec *ts,
+    uint32_t bitset)
 {
 	struct l_timespec timeout = {0, 0};
 	struct timeval tv = {0, 0};
 	int timeout_hz;
 	int error;
 
+	if (bitset == 0)
+		return (EINVAL);
+	f->f_bitset = bitset;
+
 	if (ts != NULL) {
 		error = copyin(ts, &timeout, sizeof(timeout));
 		if (error)
@@ -457,13 +473,18 @@ linux_sys_futex(struct thread *td, struc
 
 	switch (args->op) {
 	case LINUX_FUTEX_WAIT:
+		args->val3 = FUTEX_BITSET_MATCH_ANY;
+		/* FALLTHROUGH */
+
+	case LINUX_FUTEX_WAIT_BITSET:
 
-		LINUX_CTR2(sys_futex, "WAIT val %d uaddr %p",
-		    args->val, args->uaddr);
+		LINUX_CTR3(sys_futex, "WAIT uaddr %p val %d val3 %d",
+		    args->uaddr, args->val, args->val3);
 #ifdef DEBUG
 		if (ldebug(sys_futex))
-			printf(ARGS(sys_futex, "futex_wait val %d uaddr %p"),
-			    args->val, args->uaddr);
+			printf(ARGS(sys_futex,
+			    "futex_wait uaddr %p val %d val3 %d"),
+			    args->uaddr, args->val, args->val3);
 #endif
 		error = futex_get(args->uaddr, &wp, &f, FUTEX_CREATE_WP);
 		if (error)
@@ -476,19 +497,24 @@ linux_sys_futex(struct thread *td, struc
 			return (error);
 		}
 		if (val != args->val) {
-			LINUX_CTR3(sys_futex, "WAIT uaddr %p val %d != uval %d",
-			    args->uaddr, args->val, val);
+			LINUX_CTR4(sys_futex,
+			    "WAIT uaddr %p val %d != uval %d val3 %d",
+			    args->uaddr, args->val, val, args->val3);
 			futex_put(f, wp);
 			return (EWOULDBLOCK);
 		}
 
-		error = futex_wait(f, wp, args->timeout);
+		error = futex_wait(f, wp, args->timeout, args->val3);
 		break;
 
 	case LINUX_FUTEX_WAKE:
+		args->val3 = FUTEX_BITSET_MATCH_ANY;
+		/* FALLTHROUGH */
+
+	case LINUX_FUTEX_WAKE_BITSET:
 
-		LINUX_CTR2(sys_futex, "WAKE val %d uaddr %p",
-		    args->val, args->uaddr);
+		LINUX_CTR3(sys_futex, "WAKE uaddr %p val % d val3 %d",
+		    args->uaddr, args->val, args->val3);
 
 		/*
 		 * XXX: Linux is able to cope with different addresses
@@ -497,8 +523,8 @@ linux_sys_futex(struct thread *td, struc
 		 */
 #ifdef DEBUG
 		if (ldebug(sys_futex))
-			printf(ARGS(sys_futex, "futex_wake val %d uaddr %p"),
-			    args->val, args->uaddr);
+			printf(ARGS(sys_futex, "futex_wake uaddr %p val %d val3 %d"),
+			    args->uaddr, args->val, args->val3);
 #endif
 		error = futex_get(args->uaddr, NULL, &f, FUTEX_DONTCREATE);
 		if (error)
@@ -507,7 +533,7 @@ linux_sys_futex(struct thread *td, struc
 			td->td_retval[0] = 0;
 			return (error);
 		}
-		td->td_retval[0] = futex_wake(f, args->val);
+		td->td_retval[0] = futex_wake(f, args->val, args->val3);
 		futex_put(f, NULL);
 		break;
 
@@ -615,16 +641,16 @@ linux_sys_futex(struct thread *td, struc
 			return (EFAULT);
 		}
 
-		ret = futex_wake(f, args->val);
+		ret = futex_wake(f, args->val, args->val3);
 
 		if (op_ret > 0) {
 			op_ret = 0;
 			nrwake = (int)(unsigned long)args->timeout;
 
 			if (f2 != NULL)
-				op_ret += futex_wake(f2, nrwake);
+				op_ret += futex_wake(f2, nrwake, args->val3);
 			else
-				op_ret += futex_wake(f, nrwake);
+				op_ret += futex_wake(f, nrwake, args->val3);
 			ret += op_ret;
 
 		}
@@ -672,13 +698,6 @@ linux_sys_futex(struct thread *td, struc
 		}
 		return (EINVAL);
 
-	case LINUX_FUTEX_WAIT_BITSET:
-		/* not yet implemented */
-		linux_msg(td,
-			  "linux_sys_futex: "
-			  "op FUTEX_WAIT_BITSET not implemented\n");
-		return (ENOSYS);
-
 	case LINUX_FUTEX_WAIT_REQUEUE_PI:
 		/* not yet implemented */
 		linux_msg(td,
@@ -787,7 +806,7 @@ retry:
 			if (error)
 				return (error);
 			if (f != NULL) {
-				futex_wake(f, 1);
+				futex_wake(f, 1, FUTEX_BITSET_MATCH_ANY);
 				futex_put(f, NULL);
 			}
 		}

Modified: stable/8/sys/compat/linux/linux_futex.h
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.h	Wed Mar  2 06:13:03 2011	(r219166)
+++ stable/8/sys/compat/linux/linux_futex.h	Wed Mar  2 06:18:21 2011	(r219167)
@@ -49,6 +49,7 @@ extern struct mtx futex_mtx;
 #define LINUX_FUTEX_UNLOCK_PI		 7
 #define LINUX_FUTEX_TRYLOCK_PI		 8
 #define LINUX_FUTEX_WAIT_BITSET		 9
+#define LINUX_FUTEX_WAKE_BITSET		10
 #define LINUX_FUTEX_WAIT_REQUEUE_PI	11
 
 #define LINUX_FUTEX_PRIVATE_FLAG	128
@@ -72,6 +73,7 @@ extern struct mtx futex_mtx;
 #define	FUTEX_WAITERS		0x80000000
 #define	FUTEX_OWNER_DIED	0x40000000
 #define	FUTEX_TID_MASK		0x3fffffff
+#define	FUTEX_BITSET_MATCH_ANY	0xffffffff
 
 void	release_futexes(struct proc *);
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:19:32 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 517861065675;
	Wed,  2 Mar 2011 06:19:32 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F6FB8FC23;
	Wed,  2 Mar 2011 06:19:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p226JW45083122;
	Wed, 2 Mar 2011 06:19:32 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226JWbK083119;
	Wed, 2 Mar 2011 06:19:32 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020619.p226JWbK083119@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:19:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219168 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:19:32 -0000

Author: dchagin
Date: Wed Mar  2 06:19:31 2011
New Revision: 219168
URL: http://svn.freebsd.org/changeset/base/219168

Log:
  MFC r218118:
  Yet another unimplemented futex operation, print out about it.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
  stable/8/sys/compat/linux/linux_futex.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:18:21 2011	(r219167)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:19:31 2011	(r219168)
@@ -705,6 +705,13 @@ linux_sys_futex(struct thread *td, struc
 			  "op FUTEX_WAIT_REQUEUE_PI not implemented\n");
 		return (ENOSYS);
 
+	case LINUX_FUTEX_CMP_REQUEUE_PI:
+		/* not yet implemented */
+		linux_msg(td,
+			    "linux_sys_futex: "
+			    "op LINUX_FUTEX_CMP_REQUEUE_PI not implemented\n");
+		return (ENOSYS);
+
 	default:
 		linux_msg(td,
 			  "linux_sys_futex: unknown op %d\n", args->op);

Modified: stable/8/sys/compat/linux/linux_futex.h
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.h	Wed Mar  2 06:18:21 2011	(r219167)
+++ stable/8/sys/compat/linux/linux_futex.h	Wed Mar  2 06:19:31 2011	(r219168)
@@ -51,6 +51,7 @@ extern struct mtx futex_mtx;
 #define LINUX_FUTEX_WAIT_BITSET		 9
 #define LINUX_FUTEX_WAKE_BITSET		10
 #define LINUX_FUTEX_WAIT_REQUEUE_PI	11
+#define LINUX_FUTEX_CMP_REQUEUE_PI	12
 
 #define LINUX_FUTEX_PRIVATE_FLAG	128
 #define LINUX_FUTEX_CLOCK_REALTIME	256

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:21:21 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8A26D106566C;
	Wed,  2 Mar 2011 06:21:21 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 780BB8FC12;
	Wed,  2 Mar 2011 06:21:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p226LLZu083220;
	Wed, 2 Mar 2011 06:21:21 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226LLar083218;
	Wed, 2 Mar 2011 06:21:21 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020621.p226LLar083218@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:21:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219169 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:21:21 -0000

Author: dchagin
Date: Wed Mar  2 06:21:21 2011
New Revision: 219169
URL: http://svn.freebsd.org/changeset/base/219169

Log:
  MFC r218646:
  The bitset field of freshly created futex should be initialized
  explicity. Otherwise, REQUEUE operations fails.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:19:31 2011	(r219168)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:21:21 2011	(r219169)
@@ -194,6 +194,7 @@ retry:
 		tmpf = malloc(sizeof(*tmpf), M_FUTEX, M_WAITOK | M_ZERO);
 		tmpf->f_uaddr = uaddr;
 		tmpf->f_refcount = 1;
+		tmpf->f_bitset = FUTEX_BITSET_MATCH_ANY;
 		FUTEX_INIT(tmpf);
 		TAILQ_INIT(&tmpf->f_waiting_proc);
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:22:18 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E77561065670;
	Wed,  2 Mar 2011 06:22:18 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D58918FC16;
	Wed,  2 Mar 2011 06:22:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p226MIEX083300;
	Wed, 2 Mar 2011 06:22:18 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226MIEg083298;
	Wed, 2 Mar 2011 06:22:18 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020622.p226MIEg083298@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:22:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219170 - stable/8/sys/sys
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:22:19 -0000

Author: dchagin
Date: Wed Mar  2 06:22:18 2011
New Revision: 219170
URL: http://svn.freebsd.org/changeset/base/219170

Log:
  MFC r218609:
  Remove unused since r134586 thr_exit1() declaration.

Modified:
  stable/8/sys/sys/proc.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/sys/proc.h
==============================================================================
--- stable/8/sys/sys/proc.h	Wed Mar  2 06:21:21 2011	(r219169)
+++ stable/8/sys/sys/proc.h	Wed Mar  2 06:22:18 2011	(r219170)
@@ -897,7 +897,6 @@ int	thread_unsuspend_one(struct thread *
 void	thread_unthread(struct thread *td);
 void	thread_wait(struct proc *p);
 struct thread	*thread_find(struct proc *p, lwpid_t tid);
-void	thr_exit1(void);
 
 #endif	/* _KERNEL */
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:23:20 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3B860106566B;
	Wed,  2 Mar 2011 06:23:20 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0FF648FC0A;
	Wed,  2 Mar 2011 06:23:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p226NJbB083368;
	Wed, 2 Mar 2011 06:23:19 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226NJ4G083365;
	Wed, 2 Mar 2011 06:23:19 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020623.p226NJ4G083365@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:23:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219171 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:23:20 -0000

Author: dchagin
Date: Wed Mar  2 06:23:19 2011
New Revision: 219171
URL: http://svn.freebsd.org/changeset/base/219171

Log:
  MFC r218610:
  The fourth argument of linux_clone is a pointer to the TLS.
  Change clone syscall definition to match actual linux one.

Modified:
  stable/8/sys/amd64/linux32/syscalls.master
  stable/8/sys/i386/linux/syscalls.master
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/syscalls.master
==============================================================================
--- stable/8/sys/amd64/linux32/syscalls.master	Wed Mar  2 06:22:18 2011	(r219170)
+++ stable/8/sys/amd64/linux32/syscalls.master	Wed Mar  2 06:23:19 2011	(r219171)
@@ -213,9 +213,8 @@
 118	AUE_FSYNC	NOPROTO	{ int fsync(int fd); }
 119	AUE_SIGRETURN	STD	{ int linux_sigreturn( \
 				    struct l_sigframe *sfp); }
-; linux uses some strange calling convention here so we have to use the dummy arg
 120	AUE_RFORK	STD	{ int linux_clone(l_int flags, void *stack, \
-				    void *parent_tidptr, int dummy, void * child_tidptr); }
+				    void *parent_tidptr, void *tls, void * child_tidptr); }
 121	AUE_SYSCTL	STD	{ int linux_setdomainname(char *name, \
 				    int len); }
 122	AUE_NULL	STD	{ int linux_newuname( \

Modified: stable/8/sys/i386/linux/syscalls.master
==============================================================================
--- stable/8/sys/i386/linux/syscalls.master	Wed Mar  2 06:22:18 2011	(r219170)
+++ stable/8/sys/i386/linux/syscalls.master	Wed Mar  2 06:23:19 2011	(r219171)
@@ -214,9 +214,8 @@
 118	AUE_FSYNC	NOPROTO	{ int fsync(int fd); }
 119	AUE_SIGRETURN	STD	{ int linux_sigreturn( \
 				    struct l_sigframe *sfp); }
-; linux uses some strange calling convention here so we have to use the dummy arg
 120	AUE_RFORK	STD	{ int linux_clone(l_int flags, void *stack, \
-				    void *parent_tidptr, int dummy, void * child_tidptr); }
+				    void *parent_tidptr, void *tls, void * child_tidptr); }
 121	AUE_SYSCTL	STD	{ int linux_setdomainname(char *name, \
 				    int len); }
 122	AUE_NULL	STD	{ int linux_newuname( \

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 06:24:46 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C3F0106566C;
	Wed,  2 Mar 2011 06:24:46 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 795B38FC1B;
	Wed,  2 Mar 2011 06:24:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p226OkgR083434;
	Wed, 2 Mar 2011 06:24:46 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226OkHs083427;
	Wed, 2 Mar 2011 06:24:46 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020624.p226OkHs083427@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:24:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219172 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:24:46 -0000

Author: dchagin
Date: Wed Mar  2 06:24:46 2011
New Revision: 219172
URL: http://svn.freebsd.org/changeset/base/219172

Log:
  Regen for r219171.

Modified:
  stable/8/sys/amd64/linux32/linux32_proto.h
  stable/8/sys/amd64/linux32/linux32_syscall.h
  stable/8/sys/amd64/linux32/linux32_sysent.c
  stable/8/sys/i386/linux/linux_proto.h
  stable/8/sys/i386/linux/linux_syscall.h
  stable/8/sys/i386/linux/linux_sysent.c

Modified: stable/8/sys/amd64/linux32/linux32_proto.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_proto.h	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/amd64/linux32/linux32_proto.h	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -375,7 +375,7 @@ struct linux_clone_args {
 	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
 	char stack_l_[PADL_(void *)]; void * stack; char stack_r_[PADR_(void *)];
 	char parent_tidptr_l_[PADL_(void *)]; void * parent_tidptr; char parent_tidptr_r_[PADR_(void *)];
-	char dummy_l_[PADL_(int)]; int dummy; char dummy_r_[PADR_(int)];
+	char tls_l_[PADL_(void *)]; void * tls; char tls_r_[PADR_(void *)];
 	char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)];
 };
 struct linux_setdomainname_args {

Modified: stable/8/sys/amd64/linux32/linux32_syscall.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_syscall.h	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/amd64/linux32/linux32_syscall.h	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/amd64/linux32/linux32_sysent.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysent.c	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/amd64/linux32/linux32_sysent.c	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #include "opt_compat.h"

Modified: stable/8/sys/i386/linux/linux_proto.h
==============================================================================
--- stable/8/sys/i386/linux/linux_proto.h	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/i386/linux/linux_proto.h	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -378,7 +378,7 @@ struct linux_clone_args {
 	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
 	char stack_l_[PADL_(void *)]; void * stack; char stack_r_[PADR_(void *)];
 	char parent_tidptr_l_[PADL_(void *)]; void * parent_tidptr; char parent_tidptr_r_[PADR_(void *)];
-	char dummy_l_[PADL_(int)]; int dummy; char dummy_r_[PADR_(int)];
+	char tls_l_[PADL_(void *)]; void * tls; char tls_r_[PADR_(void *)];
 	char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)];
 };
 struct linux_setdomainname_args {

Modified: stable/8/sys/i386/linux/linux_syscall.h
==============================================================================
--- stable/8/sys/i386/linux/linux_syscall.h	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/i386/linux/linux_syscall.h	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/i386/linux/linux_sysent.c
==============================================================================
--- stable/8/sys/i386/linux/linux_sysent.c	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/i386/linux/linux_sysent.c	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #include 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 09:53:13 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB21E106566B;
	Wed,  2 Mar 2011 09:53:13 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 986E18FC25;
	Wed,  2 Mar 2011 09:53:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p229rDfv090290;
	Wed, 2 Mar 2011 09:53:13 GMT (envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p229rD4L090286;
	Wed, 2 Mar 2011 09:53:13 GMT (envelope-from netchild@svn.freebsd.org)
Message-Id: <201103020953.p229rD4L090286@svn.freebsd.org>
From: Alexander Leidinger 
Date: Wed, 2 Mar 2011 09:53:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219173 - in stable/8/sys: compat/linux kern
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 09:53:13 -0000

Author: netchild
Date: Wed Mar  2 09:53:13 2011
New Revision: 219173
URL: http://svn.freebsd.org/changeset/base/219173

Log:
  MFC r215664:
    By using the 32-bit Linux version of Sun's Java Development Kit 1.6
    on FreeBSD (amd64), invocations of "javac" (or "java") eventually
    end with the output of "Killed" and exit code 137.
  
    This is caused by:
    1. After calling exec() in multithreaded linux program threads are not
       destroyed and continue running. They get killed after program being
       executed finishes.
  
    2. linux_exit_group doesn't return correct exit code when called not
       from group leader. Which happens regularly using sun jvm.
  
    The submitters fix this in a similar way to how NetBSD handles this.
  
    I took the PRs away from dchagin, who seems to be out of touch of
    this since a while (no response from him).
  
    The patches committed here are from [2], with some little modifications
    from me to the style.
  
    PR:                141439 [1], 144194 [2]
    Submitted by:        Stefan Schmidt , gk
    Reviewed by:        rdivacky (in april 2010)
  
  MFC r215675:
    Do not take the process lock. The assignment to u_short inside the
    properly aligned structure is atomic on all supported architectures, and
    the thread that should see side-effect of assignment is the same thread
    that does assignment.
  
    Use a more appropriate conditional to detect the linux ABI.
  
    Suggested by:        kib

Modified:
  stable/8/sys/compat/linux/linux_emul.c
  stable/8/sys/compat/linux/linux_emul.h
  stable/8/sys/compat/linux/linux_misc.c
  stable/8/sys/kern/kern_exit.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_emul.c
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 06:24:46 2011	(r219172)
+++ stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 09:53:13 2011	(r219173)
@@ -155,7 +155,7 @@ void
 linux_proc_exit(void *arg __unused, struct proc *p)
 {
 	struct linux_emuldata *em;
-	int error;
+	int error, shared_flags, shared_xstat;
 	struct thread *td = FIRST_THREAD_IN_PROC(p);
 	int *child_clear_tid;
 	struct proc *q, *nq;
@@ -187,6 +187,8 @@ linux_proc_exit(void *arg __unused, stru
 	}
 
 	EMUL_SHARED_WLOCK(&emul_shared_lock);
+	shared_flags = em->shared->flags;
+	shared_xstat = em->shared->xstat;
 	LIST_REMOVE(em, threads);
 
 	em->shared->refs--;
@@ -196,6 +198,9 @@ linux_proc_exit(void *arg __unused, stru
 	} else	
 		EMUL_SHARED_WUNLOCK(&emul_shared_lock);
 
+	if ((shared_flags & EMUL_SHARED_HASXSTAT) != 0)
+		p->p_xstat = shared_xstat;
+
 	if (child_clear_tid != NULL) {
 		struct linux_sys_futex_args cup;
 		int null = 0;
@@ -257,6 +262,10 @@ linux_proc_exec(void *arg __unused, stru
 	if (__predict_false(imgp->sysent == &elf_linux_sysvec
 	    && p->p_sysent != &elf_linux_sysvec))
 		linux_proc_init(FIRST_THREAD_IN_PROC(p), p->p_pid, 0);
+	if (__predict_false((p->p_sysent->sv_flags & SV_ABI_MASK) ==
+	    SV_ABI_LINUX))
+		/* Kill threads regardless of imgp->sysent value */
+		linux_kill_threads(FIRST_THREAD_IN_PROC(p), SIGKILL);
 	if (__predict_false(imgp->sysent != &elf_linux_sysvec
 	    && p->p_sysent == &elf_linux_sysvec)) {
 		struct linux_emuldata *em;
@@ -334,3 +343,29 @@ linux_set_tid_address(struct thread *td,
 	EMUL_UNLOCK(&emul_lock);
 	return 0;
 }
+
+void
+linux_kill_threads(struct thread *td, int sig)
+{
+	struct linux_emuldata *em, *td_em, *tmp_em;
+	struct proc *sp;
+
+	td_em = em_find(td->td_proc, EMUL_DONTLOCK);
+
+	KASSERT(td_em != NULL, ("linux_kill_threads: emuldata not found.\n"));
+
+	EMUL_SHARED_RLOCK(&emul_shared_lock);
+	LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) {
+		if (em->pid == td_em->pid)
+			continue;
+
+		sp = pfind(em->pid);
+		if ((sp->p_flag & P_WEXIT) == 0)
+			psignal(sp, sig);
+		PROC_UNLOCK(sp);
+#ifdef DEBUG
+		printf(LMSG("linux_kill_threads: kill PID %d\n"), em->pid);
+#endif
+	}
+	EMUL_SHARED_RUNLOCK(&emul_shared_lock);
+}

Modified: stable/8/sys/compat/linux/linux_emul.h
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.h	Wed Mar  2 06:24:46 2011	(r219172)
+++ stable/8/sys/compat/linux/linux_emul.h	Wed Mar  2 09:53:13 2011	(r219173)
@@ -31,8 +31,12 @@
 #ifndef _LINUX_EMUL_H_
 #define	_LINUX_EMUL_H_
 
+#define EMUL_SHARED_HASXSTAT	0x01
+
 struct linux_emuldata_shared {
 	int	refs;
+	int	flags;
+	int	xstat;
 	pid_t	group_pid;
 
 	LIST_HEAD(, linux_emuldata) threads; /* head of list of linux threads */
@@ -76,6 +80,7 @@ int	linux_proc_init(struct thread *, pid
 void	linux_proc_exit(void *, struct proc *);
 void	linux_schedtail(void *, struct proc *);
 void	linux_proc_exec(void *, struct proc *, struct image_params *);
+void	linux_kill_threads(struct thread *, int);
 
 extern struct sx	emul_shared_lock;
 extern struct mtx	emul_lock;

Modified: stable/8/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:24:46 2011	(r219172)
+++ stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 09:53:13 2011	(r219173)
@@ -1655,34 +1655,23 @@ linux_setdomainname(struct thread *td, s
 int
 linux_exit_group(struct thread *td, struct linux_exit_group_args *args)
 {
-	struct linux_emuldata *em, *td_em, *tmp_em;
-	struct proc *sp;
+	struct linux_emuldata *em;
 
 #ifdef DEBUG
 	if (ldebug(exit_group))
 		printf(ARGS(exit_group, "%i"), args->error_code);
 #endif
 
-	if (linux_use26(td)) {
-		td_em = em_find(td->td_proc, EMUL_DONTLOCK);
-
-		KASSERT(td_em != NULL, ("exit_group: emuldata not found.\n"));
-
-		EMUL_SHARED_RLOCK(&emul_shared_lock);
-		LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) {
-			if (em->pid == td_em->pid)
-				continue;
-
-			sp = pfind(em->pid);
-			psignal(sp, SIGKILL);
-			PROC_UNLOCK(sp);
-#ifdef DEBUG
-			printf(LMSG("linux_sys_exit_group: kill PID %d\n"), em->pid);
-#endif
-		}
-
-		EMUL_SHARED_RUNLOCK(&emul_shared_lock);
+	em = em_find(td->td_proc, EMUL_DONTLOCK);
+	if (em->shared->refs > 1) {
+		EMUL_SHARED_WLOCK(&emul_shared_lock);
+		em->shared->flags |= EMUL_SHARED_HASXSTAT;
+		em->shared->xstat = W_EXITCODE(args->error_code, 0);
+		EMUL_SHARED_WUNLOCK(&emul_shared_lock);
+		if (linux_use26(td))
+			linux_kill_threads(td, SIGKILL);
 	}
+
 	/*
 	 * XXX: we should send a signal to the parent if
 	 * SIGNAL_EXIT_GROUP is set. We ignore that (temporarily?)

Modified: stable/8/sys/kern/kern_exit.c
==============================================================================
--- stable/8/sys/kern/kern_exit.c	Wed Mar  2 06:24:46 2011	(r219172)
+++ stable/8/sys/kern/kern_exit.c	Wed Mar  2 09:53:13 2011	(r219173)
@@ -200,6 +200,7 @@ exit1(struct thread *td, int rv)
 	while (p->p_lock > 0)
 		msleep(&p->p_lock, &p->p_mtx, PWAIT, "exithold", 0);
 
+	p->p_xstat = rv;	/* Let event handler change exit status */
 	PROC_UNLOCK(p);
 	/* Drain the limit callout while we don't have the proc locked */
 	callout_drain(&p->p_limco);
@@ -242,6 +243,7 @@ exit1(struct thread *td, int rv)
 	 * P_PPWAIT is set; we will wakeup the parent below.
 	 */
 	PROC_LOCK(p);
+	rv = p->p_xstat;	/* Event handler could change exit status */
 	stopprofclock(p);
 	p->p_flag &= ~(P_TRACED | P_PPWAIT);
 
@@ -421,7 +423,6 @@ exit1(struct thread *td, int rv)
 
 	/* Save exit status. */
 	PROC_LOCK(p);
-	p->p_xstat = rv;
 	p->p_xthread = td;
 
 	/* Tell the prison that we are gone. */

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 13:06:48 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A03D3106564A;
	Wed,  2 Mar 2011 13:06:48 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E2C68FC13;
	Wed,  2 Mar 2011 13:06:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22D6mx8010471;
	Wed, 2 Mar 2011 13:06:48 GMT (envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22D6mmL010469;
	Wed, 2 Mar 2011 13:06:48 GMT (envelope-from netchild@svn.freebsd.org)
Message-Id: <201103021306.p22D6mmL010469@svn.freebsd.org>
From: Alexander Leidinger 
Date: Wed, 2 Mar 2011 13:06:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219176 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 13:06:48 -0000

Author: netchild
Date: Wed Mar  2 13:06:47 2011
New Revision: 219176
URL: http://svn.freebsd.org/changeset/base/219176

Log:
  Fix kernel build with MFC of r215706:
    Fix linux kernel module breakage introduced in r215675, by including
    .
  
  Pointyhat to:	netchild
  Noticed by:	kib

Modified:
  stable/8/sys/compat/linux/linux_emul.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_emul.c
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 11:09:34 2011	(r219175)
+++ stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 13:06:47 2011	(r219176)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 13:14:59 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D08A91065672;
	Wed,  2 Mar 2011 13:14:59 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200])
	by mx1.freebsd.org (Postfix) with ESMTP id 6CED28FC14;
	Wed,  2 Mar 2011 13:14:59 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p22CnMga052424
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 2 Mar 2011 14:49:22 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	p22CnMbd039545; Wed, 2 Mar 2011 14:49:22 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p22CnMdp039544; 
	Wed, 2 Mar 2011 14:49:22 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Wed, 2 Mar 2011 14:49:22 +0200
From: Kostik Belousov 
To: Alexander Leidinger 
Message-ID: <20110302124922.GZ78089@deviant.kiev.zoral.com.ua>
References: <201103020953.p229rD4L090286@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="QlWQyIlDgLScNVjS"
Content-Disposition: inline
In-Reply-To: <201103020953.p229rD4L090286@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Spam-Status: No, score=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219173 - in stable/8/sys: compat/linux kern
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 13:15:00 -0000


--QlWQyIlDgLScNVjS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 02, 2011 at 09:53:13AM +0000, Alexander Leidinger wrote:
> Author: netchild
> Date: Wed Mar  2 09:53:13 2011
> New Revision: 219173
> URL: http://svn.freebsd.org/changeset/base/219173
>=20
> Log:
>   MFC r215664:
>     By using the 32-bit Linux version of Sun's Java Development Kit 1.6
>     on FreeBSD (amd64), invocations of "javac" (or "java") eventually
>     end with the output of "Killed" and exit code 137.
>  =20
>     This is caused by:
>     1. After calling exec() in multithreaded linux program threads are not
>        destroyed and continue running. They get killed after program being
>        executed finishes.
>  =20
>     2. linux_exit_group doesn't return correct exit code when called not
>        from group leader. Which happens regularly using sun jvm.
>  =20
>     The submitters fix this in a similar way to how NetBSD handles this.
>  =20
>     I took the PRs away from dchagin, who seems to be out of touch of
>     this since a while (no response from him).
>  =20
>     The patches committed here are from [2], with some little modificatio=
ns
>     from me to the style.
>  =20
>     PR:                141439 [1], 144194 [2]
>     Submitted by:        Stefan Schmidt , gk
>     Reviewed by:        rdivacky (in april 2010)
>  =20
>   MFC r215675:
>     Do not take the process lock. The assignment to u_short inside the
>     properly aligned structure is atomic on all supported architectures, =
and
>     the thread that should see side-effect of assignment is the same thre=
ad
>     that does assignment.
>  =20
>     Use a more appropriate conditional to detect the linux ABI.
>  =20
>     Suggested by:        kib
See r215706, that was a followup to the commit. Without it, stable/8
is broken:

/usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c: In function=
 'linux_proc_exec':
/usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c:265: error: =
dereferencing pointer to incomplete type
/usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c:265: error: =
'SV_ABI_MASK' undeclared (first use in this function)

--QlWQyIlDgLScNVjS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk1uPNIACgkQC3+MBN1Mb4hUAwCgpOVoaKNH+jBLgKTTll2gG5wz
VR4AoK2hSX7D6mOpWQL7+G1cwU36i/Jc
=Kipt
-----END PGP SIGNATURE-----

--QlWQyIlDgLScNVjS--

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 13:23:15 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35028106564A;
	Wed,  2 Mar 2011 13:23:15 +0000 (UTC)
	(envelope-from netchild@freebsd.org)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id D9DB18FC13;
	Wed,  2 Mar 2011 13:23:14 +0000 (UTC)
Received: from outgoing.leidinger.net (p5B32E950.dip.t-dialin.net
	[91.50.233.80])
	by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 1BF94844015;
	Wed,  2 Mar 2011 14:07:50 +0100 (CET)
Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102])
	by outgoing.leidinger.net (Postfix) with ESMTP id 8434E22FF;
	Wed,  2 Mar 2011 14:07:41 +0100 (CET)
Received: (from www@localhost)
	by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p22D7Mwu066782;
	Wed, 2 Mar 2011 14:07:22 +0100 (CET)
	(envelope-from netchild@FreeBSD.org)
Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by
	webmail.leidinger.net (Horde Framework) with HTTP; Wed, 02 Mar 2011
	14:07:21 +0100
Message-ID: <20110302140721.10490r8jxq10xfk0@webmail.leidinger.net>
Date: Wed, 02 Mar 2011 14:07:21 +0100
From: Alexander Leidinger 
To: Kostik Belousov 
References: <201103020953.p229rD4L090286@svn.freebsd.org>
	<20110302124922.GZ78089@deviant.kiev.zoral.com.ua>
In-Reply-To: <20110302124922.GZ78089@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4)
X-EBL-MailScanner-Information: Please contact the ISP for more information
X-EBL-MailScanner-ID: 1BF94844015.A855D
X-EBL-MailScanner: Found to be clean
X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN,
	SpamAssassin (not cached, score=1.351, required 6,
	autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08)
X-EBL-MailScanner-SpamScore: s
X-EBL-MailScanner-From: netchild@freebsd.org
X-EBL-MailScanner-Watermark: 1299676070.61095@cGzmAy1CfdUTI4jU3yhgvg
X-EBL-Spam-Status: No
Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org
Subject: Re: svn commit: r219173 - in stable/8/sys: compat/linux kern
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 13:23:15 -0000

Quoting Kostik Belousov  (from Wed, 2 Mar 2011  
14:49:22 +0200):

> On Wed, Mar 02, 2011 at 09:53:13AM +0000, Alexander Leidinger wrote:
>> Author: netchild
>> Date: Wed Mar  2 09:53:13 2011
>> New Revision: 219173
>> URL: http://svn.freebsd.org/changeset/base/219173

> See r215706, that was a followup to the commit. Without it, stable/8
> is broken:
>
> /usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c: In  
> function 'linux_proc_exec':
> /usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c:265:  
> error: dereferencing pointer to incomplete type
> /usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c:265:  
> error: 'SV_ABI_MASK' undeclared (first use in this function)

Double pointyhat to me...

Commit in progress.

Thanks,
Alexander.

-- 
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137
Behind every great man, there is a woman -- urging him on.
		-- Harry Mudd, "I, Mudd", stardate 4513.3


From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 14:33:24 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 36AFF1065676;
	Wed,  2 Mar 2011 14:33:24 +0000 (UTC)
	(envelope-from ndenev@gmail.com)
Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com
	[209.85.215.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 8CC258FC25;
	Wed,  2 Mar 2011 14:33:22 +0000 (UTC)
Received: by ewy28 with SMTP id 28so2264399ewy.13
	for ; Wed, 02 Mar 2011 06:33:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:subject:mime-version:content-type:from
	:in-reply-to:date:cc:content-transfer-encoding:message-id:references
	:to:x-mailer; bh=pOFFf/8g/FCuQ0IdmO6O6HHM773H/4OmHcghQ2nCAro=;
	b=Tix2Z2qnMAuaE7KfeDU65R+g8Sbc3GM5po1BlAMAawZ8WB9ll0o1I/K6AtwdU9nG1K
	CxXt6lcGYHA23pMbXXwHz6OKrq25skZ8hKvQcccVxdn7EJ2rMRALE+U+qlOB0a5DZ8xz
	KiUxTgy77Zj/ppV3kF28bxX4igBbzF15K4Ug8=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=bS5cVK0XWNsqdmYjl4XU09UtV8DpxT49W0/sGw5OpAcL/7Pzfbwa0gKuKbaiOI+tEM
	t+tL3mSSaG/0+mMKRmVV66qpLBCMs6IAojlT+6VgC7Y+AfY1b+7Z8tLYMNJmb/DE2Sqo
	aDlSAyk4CvK7sN85b971hey3+9UbKjBxobi5Y=
Received: by 10.213.27.78 with SMTP id h14mr183932ebc.17.1299074608128;
	Wed, 02 Mar 2011 06:03:28 -0800 (PST)
Received: from mytaht-2.totalterror.net (93-152-151-19.ddns.onlinedirect.bg
	[93.152.151.19])
	by mx.google.com with ESMTPS id t5sm1538548eeh.20.2011.03.02.06.03.22
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 02 Mar 2011 06:03:22 -0800 (PST)
Mime-Version: 1.0 (Apple Message framework v1082)
Content-Type: text/plain; charset=us-ascii
From: Nikolay Denev 
In-Reply-To: <201102282328.p1SNSZZK059958@svn.freebsd.org>
Date: Wed, 2 Mar 2011 16:03:20 +0200
Content-Transfer-Encoding: 7bit
Message-Id: <8748736E-CD0A-4002-88C6-0D4090013C9C@gmail.com>
References: <201102282328.p1SNSZZK059958@svn.freebsd.org>
To: Robert Watson 
X-Mailer: Apple Mail (2.1082)
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219107 - in stable/8/sys: amd64/amd64
	amd64/include boot/common cddl/compat/opensolaris/kern
	cddl/compat/opensolaris/sys
	cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol...
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 14:33:24 -0000

On 1 Mar, 2011, at 01:28 , Robert Watson wrote:

> Author: rwatson
> Date: Mon Feb 28 23:28:35 2011
> New Revision: 219107
> URL: http://svn.freebsd.org/changeset/base/219107
> 
> Log:
>  Merge userspace DTrace support from head to stable/8:
> 

Hi,

It seems that the dtruss script in RELENG_8 has "/usr/bin/sh" as interpreter.
This appears to be fixed in head.

Regards,
Nikolay


From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:09:50 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 49E4C106566B;
	Wed,  2 Mar 2011 19:09:50 +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 365EF8FC17;
	Wed,  2 Mar 2011 19:09:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22J9oCg037564;
	Wed, 2 Mar 2011 19:09:50 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22J9nkg037551;
	Wed, 2 Mar 2011 19:09:49 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103021909.p22J9nkg037551@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 2 Mar 2011 19:09:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219187 - in stable/8/sys/amd64: amd64 ia32 include
	linux32
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:09:50 -0000

Author: jkim
Date: Wed Mar  2 19:09:49 2011
New Revision: 219187
URL: http://svn.freebsd.org/changeset/base/219187

Log:
  MFC:	r216634, r216673
  
  Improve PCB flags handling and make it more robust.  Add two new functions
  for manipulating pcb_flags.  These inline functions are very similar to
  atomic_set_int(9) and atomic_clear_int(9) but without unnecessary LOCK
  prefix for SMP.  Add comments about the rationale.  Use these functions
  wherever possible.  Although there are some places where it is not strictly
  necessary (e.g., a PCB is copied to create a new PCB), it is done across
  the board for sake of consistency.  Turn pcb_full_iret into a PCB flag as
  it is safe now.  Move rarely used fields before pcb_flags and reduce size
  of pcb_flags to four bytes.  Fix some style(9) nits in pcb.h while I am in
  the neighborhood.

Modified:
  stable/8/sys/amd64/amd64/cpu_switch.S
  stable/8/sys/amd64/amd64/exception.S
  stable/8/sys/amd64/amd64/fpu.c
  stable/8/sys/amd64/amd64/genassym.c
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/amd64/amd64/sys_machdep.c
  stable/8/sys/amd64/amd64/vm_machdep.c
  stable/8/sys/amd64/ia32/ia32_reg.c
  stable/8/sys/amd64/ia32/ia32_signal.c
  stable/8/sys/amd64/include/pcb.h
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/amd64/linux32/linux32_sysvec.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/cpu_switch.S
==============================================================================
--- stable/8/sys/amd64/amd64/cpu_switch.S	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/cpu_switch.S	Wed Mar  2 19:09:49 2011	(r219187)
@@ -94,7 +94,7 @@ END(cpu_throw)
 ENTRY(cpu_switch)
 	/* Switch to new thread.  First, save context. */
 	movq	TD_PCB(%rdi),%r8
-	movb	$1,PCB_FULL_IRET(%r8)
+	orl	$PCB_FULL_IRET,PCB_FLAGS(%r8)
 
 	movq	(%rsp),%rax			/* Hardware registers */
 	movq	%r15,PCB_R15(%r8)

Modified: stable/8/sys/amd64/amd64/exception.S
==============================================================================
--- stable/8/sys/amd64/amd64/exception.S	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/exception.S	Wed Mar  2 19:09:49 2011	(r219187)
@@ -170,7 +170,7 @@ alltraps:
 	jz	alltraps_testi		/* already running with kernel GS.base */
 	swapgs
 	movq	PCPU(CURPCB),%rdi
-	movb	$0,PCB_FULL_IRET(%rdi)
+	andl	$~PCB_FULL_IRET,PCB_FLAGS(%rdi)
 	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
@@ -243,7 +243,7 @@ alltraps_noen:
 	jz	1f	/* already running with kernel GS.base */
 	swapgs
 	movq	PCPU(CURPCB),%rdi
-	movb	$0,PCB_FULL_IRET(%rdi)
+	andl	$~PCB_FULL_IRET,PCB_FLAGS(%rdi)
 1:	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
@@ -294,7 +294,7 @@ IDTVEC(page)
 	jz	1f			/* already running with kernel GS.base */
 	swapgs
 	movq	PCPU(CURPCB),%rdi
-	movb	$0,PCB_FULL_IRET(%rdi)
+	andl	$~PCB_FULL_IRET,PCB_FLAGS(%rdi)
 1:	movq	%cr2,%rdi		/* preserve %cr2 before ..  */
 	movq	%rdi,TF_ADDR(%rsp)	/* enabling interrupts. */
 	movw	%fs,TF_FS(%rsp)
@@ -324,7 +324,7 @@ IDTVEC(prot)
 	jz	2f			/* already running with kernel GS.base */
 1:	swapgs
 2:	movq	PCPU(CURPCB),%rdi
-	movb	$1,PCB_FULL_IRET(%rdi)	/* always full iret from GPF */
+	orl	$PCB_FULL_IRET,PCB_FLAGS(%rdi)	/* always full iret from GPF */
 	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
@@ -356,7 +356,7 @@ IDTVEC(fast_syscall)
 	movw	%es,TF_ES(%rsp)
 	movw	%ds,TF_DS(%rsp)
 	movq	PCPU(CURPCB),%r11
-	movb	$0,PCB_FULL_IRET(%r11)
+	andl	$~PCB_FULL_IRET,PCB_FLAGS(%r11)
 	sti
 	movq	$KUDSEL,TF_SS(%rsp)
 	movq	$KUCSEL,TF_CS(%rsp)
@@ -661,8 +661,8 @@ doreti_exit:
 	 */
 	testb	$SEL_RPL_MASK,TF_CS(%rsp)
 	jz	ld_regs
-	cmpb	$0,PCB_FULL_IRET(%r8)
-	je	ld_regs
+	testl	$PCB_FULL_IRET,PCB_FLAGS(%r8)
+	jz	ld_regs
 	testl	$TF_HASSEGS,TF_FLAGS(%rsp)
 	je	set_segs
 

Modified: stable/8/sys/amd64/amd64/fpu.c
==============================================================================
--- stable/8/sys/amd64/amd64/fpu.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/fpu.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -426,9 +426,11 @@ fpudna(void)
 		fxrstor(&fpu_initialstate);
 		if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__)
 			fldcw(pcb->pcb_initial_fpucw);
-		pcb->pcb_flags |= PCB_FPUINITDONE;
 		if (PCB_USER_FPU(pcb))
-			pcb->pcb_flags |= PCB_USERFPUINITDONE;
+			set_pcb_flags(pcb,
+			    PCB_FPUINITDONE | PCB_USERFPUINITDONE);
+		else
+			set_pcb_flags(pcb, PCB_FPUINITDONE);
 	} else
 		fxrstor(pcb->pcb_save);
 	critical_exit();
@@ -443,7 +445,7 @@ fpudrop()
 	KASSERT(td == curthread, ("fpudrop: fpcurthread != curthread"));
 	CRITICAL_ASSERT(td);
 	PCPU_SET(fpcurthread, NULL);
-	td->td_pcb->pcb_flags &= ~PCB_FPUINITDONE;
+	clear_pcb_flags(td->td_pcb, PCB_FPUINITDONE);
 	start_emulating();
 }
 
@@ -483,8 +485,10 @@ fpuuserinited(struct thread *td)
 
 	pcb = td->td_pcb;
 	if (PCB_USER_FPU(pcb))
-		pcb->pcb_flags |= PCB_FPUINITDONE;
-	pcb->pcb_flags |= PCB_USERFPUINITDONE;
+		set_pcb_flags(pcb,
+		    PCB_FPUINITDONE | PCB_USERFPUINITDONE);
+	else
+		set_pcb_flags(pcb, PCB_FPUINITDONE);
 }
 
 /*
@@ -500,7 +504,7 @@ fpusetregs(struct thread *td, struct sav
 	if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) {
 		fxrstor(addr);
 		critical_exit();
-		pcb->pcb_flags |= PCB_FPUINITDONE | PCB_USERFPUINITDONE;
+		set_pcb_flags(pcb, PCB_FPUINITDONE | PCB_USERFPUINITDONE);
 	} else {
 		critical_exit();
 		bcopy(addr, &td->td_pcb->pcb_user_save, sizeof(*addr));
@@ -609,8 +613,8 @@ fpu_kern_enter(struct thread *td, struct
 	fpuexit(td);
 	ctx->prev = pcb->pcb_save;
 	pcb->pcb_save = &ctx->hwstate;
-	pcb->pcb_flags |= PCB_KERNFPU;
-	pcb->pcb_flags &= ~PCB_FPUINITDONE;
+	set_pcb_flags(pcb, PCB_KERNFPU);
+	clear_pcb_flags(pcb, PCB_FPUINITDONE);
 	return (0);
 }
 
@@ -626,16 +630,16 @@ fpu_kern_leave(struct thread *td, struct
 	critical_exit();
 	pcb->pcb_save = ctx->prev;
 	if (pcb->pcb_save == &pcb->pcb_user_save) {
-		if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0)
-			pcb->pcb_flags |= PCB_FPUINITDONE;
-		else
-			pcb->pcb_flags &= ~PCB_FPUINITDONE;
-		pcb->pcb_flags &= ~PCB_KERNFPU;
+		if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0) {
+			set_pcb_flags(pcb, PCB_FPUINITDONE);
+			clear_pcb_flags(pcb, PCB_KERNFPU);
+		} else
+			clear_pcb_flags(pcb, PCB_FPUINITDONE | PCB_KERNFPU);
 	} else {
 		if ((ctx->flags & FPU_KERN_CTX_FPUINITDONE) != 0)
-			pcb->pcb_flags |= PCB_FPUINITDONE;
+			set_pcb_flags(pcb, PCB_FPUINITDONE);
 		else
-			pcb->pcb_flags &= ~PCB_FPUINITDONE;
+			clear_pcb_flags(pcb, PCB_FPUINITDONE);
 		KASSERT(!PCB_USER_FPU(pcb), ("unpaired fpu_kern_leave"));
 	}
 	return (0);
@@ -652,7 +656,7 @@ fpu_kern_thread(u_int flags)
 	KASSERT(pcb->pcb_save == &pcb->pcb_user_save, ("mangled pcb_save"));
 	KASSERT(PCB_USER_FPU(pcb), ("recursive call"));
 
-	pcb->pcb_flags |= PCB_KERNFPU;
+	set_pcb_flags(pcb, PCB_KERNFPU);
 	return (0);
 }
 

Modified: stable/8/sys/amd64/amd64/genassym.c
==============================================================================
--- stable/8/sys/amd64/amd64/genassym.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/genassym.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -145,22 +145,22 @@ ASSYM(PCB_DR2, offsetof(struct pcb, pcb_
 ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3));
 ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6));
 ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7));
+ASSYM(PCB_GDT, offsetof(struct pcb, pcb_gdt));
+ASSYM(PCB_IDT, offsetof(struct pcb, pcb_idt));
+ASSYM(PCB_LDT, offsetof(struct pcb, pcb_ldt));
+ASSYM(PCB_TR, offsetof(struct pcb, pcb_tr));
 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
 ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
 ASSYM(PCB_GS32SD, offsetof(struct pcb, pcb_gs32sd));
 ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp));
 ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save));
 ASSYM(PCB_SAVEFPU_SIZE, sizeof(struct savefpu));
-ASSYM(PCB_FULL_IRET, offsetof(struct pcb, pcb_full_iret));
-ASSYM(PCB_GDT, offsetof(struct pcb, pcb_gdt));
-ASSYM(PCB_IDT, offsetof(struct pcb, pcb_idt));
-ASSYM(PCB_LDT, offsetof(struct pcb, pcb_ldt));
-ASSYM(PCB_TR, offsetof(struct pcb, pcb_tr));
 ASSYM(PCB_USERFPU, offsetof(struct pcb, pcb_user_save));
 ASSYM(PCB_SIZE, sizeof(struct pcb));
+ASSYM(PCB_FULL_IRET, PCB_FULL_IRET);
 ASSYM(PCB_DBREGS, PCB_DBREGS);
-ASSYM(PCB_32BIT, PCB_32BIT);
 ASSYM(PCB_GS32BIT, PCB_GS32BIT);
+ASSYM(PCB_32BIT, PCB_32BIT);
 
 ASSYM(COMMON_TSS_RSP0, offsetof(struct amd64tss, tss_rsp0));
 

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -300,6 +300,7 @@ void
 sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 {
 	struct sigframe sf, *sfp;
+	struct pcb *pcb;
 	struct proc *p;
 	struct thread *td;
 	struct sigacts *psp;
@@ -309,6 +310,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, 
 	int oonstack;
 
 	td = curthread;
+	pcb = td->td_pcb;
 	p = td->td_proc;
 	PROC_LOCK_ASSERT(p, MA_OWNED);
 	sig = ksi->ksi_signo;
@@ -328,8 +330,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, 
 	sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */
 	get_fpcontext(td, &sf.sf_uc.uc_mcontext);
 	fpstate_drop(td);
-	sf.sf_uc.uc_mcontext.mc_fsbase = td->td_pcb->pcb_fsbase;
-	sf.sf_uc.uc_mcontext.mc_gsbase = td->td_pcb->pcb_gsbase;
+	sf.sf_uc.uc_mcontext.mc_fsbase = pcb->pcb_fsbase;
+	sf.sf_uc.uc_mcontext.mc_gsbase = pcb->pcb_gsbase;
 	bzero(sf.sf_uc.uc_mcontext.mc_spare,
 	    sizeof(sf.sf_uc.uc_mcontext.mc_spare));
 	bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
@@ -393,7 +395,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, 
 	regs->tf_fs = _ufssel;
 	regs->tf_gs = _ugssel;
 	regs->tf_flags = TF_HASSEGS;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
 }
@@ -417,13 +419,17 @@ sigreturn(td, uap)
 	} */ *uap;
 {
 	ucontext_t uc;
-	struct proc *p = td->td_proc;
+	struct pcb *pcb;
+	struct proc *p;
 	struct trapframe *regs;
 	ucontext_t *ucp;
 	long rflags;
 	int cs, error, ret;
 	ksiginfo_t ksi;
 
+	pcb = td->td_pcb;
+	p = td->td_proc;
+
 	error = copyin(uap->sigcntxp, &uc, sizeof(uc));
 	if (error != 0) {
 		uprintf("pid %d (%s): sigreturn copyin failed\n",
@@ -482,8 +488,8 @@ sigreturn(td, uap)
 		return (ret);
 	}
 	bcopy(&ucp->uc_mcontext.mc_rdi, regs, sizeof(*regs));
-	td->td_pcb->pcb_fsbase = ucp->uc_mcontext.mc_fsbase;
-	td->td_pcb->pcb_gsbase = ucp->uc_mcontext.mc_gsbase;
+	pcb->pcb_fsbase = ucp->uc_mcontext.mc_fsbase;
+	pcb->pcb_gsbase = ucp->uc_mcontext.mc_gsbase;
 
 #if defined(COMPAT_43)
 	if (ucp->uc_mcontext.mc_onstack & 1)
@@ -493,7 +499,7 @@ sigreturn(td, uap)
 #endif
 
 	kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0);
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	return (EJUSTRETURN);
 }
 
@@ -862,9 +868,9 @@ exec_setregs(td, entry, stack, ps_string
 	
 	pcb->pcb_fsbase = 0;
 	pcb->pcb_gsbase = 0;
-	pcb->pcb_flags &= ~(PCB_32BIT | PCB_GS32BIT);
+	clear_pcb_flags(pcb, PCB_32BIT | PCB_GS32BIT);
 	pcb->pcb_initial_fpucw = __INITIAL_FPUCW__;
-	pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;
@@ -899,7 +905,7 @@ exec_setregs(td, entry, stack, ps_string
 			 */
 			reset_dbregs();
 		}
-		pcb->pcb_flags &= ~PCB_DBREGS;
+		clear_pcb_flags(pcb, PCB_DBREGS);
 	}
 
 	/*
@@ -1912,7 +1918,7 @@ set_regs(struct thread *td, struct reg *
 		tp->tf_fs = regs->r_fs;
 		tp->tf_gs = regs->r_gs;
 		tp->tf_flags = TF_HASSEGS;
-		td->td_pcb->pcb_full_iret = 1;
+		set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	}
 	return (0);
 }
@@ -2004,8 +2010,10 @@ set_fpregs(struct thread *td, struct fpr
 int
 get_mcontext(struct thread *td, mcontext_t *mcp, int flags)
 {
+	struct pcb *pcb;
 	struct trapframe *tp;
 
+	pcb = td->td_pcb;
 	tp = td->td_frame;
 	PROC_LOCK(curthread->td_proc);
 	mcp->mc_onstack = sigonstack(tp->tf_rsp);
@@ -2043,8 +2051,8 @@ get_mcontext(struct thread *td, mcontext
 	mcp->mc_flags = tp->tf_flags;
 	mcp->mc_len = sizeof(*mcp);
 	get_fpcontext(td, mcp);
-	mcp->mc_fsbase = td->td_pcb->pcb_fsbase;
-	mcp->mc_gsbase = td->td_pcb->pcb_gsbase;
+	mcp->mc_fsbase = pcb->pcb_fsbase;
+	mcp->mc_gsbase = pcb->pcb_gsbase;
 	bzero(mcp->mc_spare, sizeof(mcp->mc_spare));
 	return (0);
 }
@@ -2058,10 +2066,12 @@ get_mcontext(struct thread *td, mcontext
 int
 set_mcontext(struct thread *td, const mcontext_t *mcp)
 {
+	struct pcb *pcb;
 	struct trapframe *tp;
 	long rflags;
 	int ret;
 
+	pcb = td->td_pcb;
 	tp = td->td_frame;
 	if (mcp->mc_len != sizeof(*mcp) ||
 	    (mcp->mc_flags & ~_MC_FLAG_MASK) != 0)
@@ -2098,10 +2108,10 @@ set_mcontext(struct thread *td, const mc
 		tp->tf_gs = mcp->mc_gs;
 	}
 	if (mcp->mc_flags & _MC_HASBASES) {
-		td->td_pcb->pcb_fsbase = mcp->mc_fsbase;
-		td->td_pcb->pcb_gsbase = mcp->mc_gsbase;
+		pcb->pcb_fsbase = mcp->mc_fsbase;
+		pcb->pcb_gsbase = mcp->mc_gsbase;
 	}
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	return (0);
 }
 
@@ -2155,8 +2165,8 @@ fpstate_drop(struct thread *td)
 	 * sendsig() is the only caller of fpugetuserregs()... perhaps we just
 	 * have too many layers.
 	 */
-	curthread->td_pcb->pcb_flags &= ~(PCB_FPUINITDONE |
-	    PCB_USERFPUINITDONE);
+	clear_pcb_flags(curthread->td_pcb,
+	    PCB_FPUINITDONE | PCB_USERFPUINITDONE);
 	critical_exit();
 }
 
@@ -2270,7 +2280,7 @@ set_dbregs(struct thread *td, struct dbr
 		pcb->pcb_dr6 = dbregs->dr[6];
 		pcb->pcb_dr7 = dbregs->dr[7];
 
-		pcb->pcb_flags |= PCB_DBREGS;
+		set_pcb_flags(pcb, PCB_DBREGS);
 	}
 
 	return (0);

Modified: stable/8/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/sys_machdep.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/sys_machdep.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -119,7 +119,7 @@ sysarch_ldt(struct thread *td, struct sy
 		error = amd64_get_ldt(td, largs);
 		break;
 	case I386_SET_LDT:
-		td->td_pcb->pcb_full_iret = 1;
+		set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 		if (largs->descs != NULL) {
 			lp = malloc(largs->num * sizeof(struct
 			    user_segment_descriptor), M_TEMP, M_WAITOK);
@@ -143,7 +143,7 @@ update_gdt_gsbase(struct thread *td, uin
 
 	if (td != curthread)
 		return;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	critical_enter();
 	sd = PCPU_GET(gs32p);
 	sd->sd_lobase = base & 0xffffff;
@@ -158,7 +158,7 @@ update_gdt_fsbase(struct thread *td, uin
 
 	if (td != curthread)
 		return;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	critical_enter();
 	sd = PCPU_GET(fs32p);
 	sd->sd_lobase = base & 0xffffff;
@@ -214,7 +214,7 @@ sysarch(td, uap)
 		if (!error) {
 			pcb->pcb_fsbase = i386base;
 			td->td_frame->tf_fs = _ufssel;
-			pcb->pcb_full_iret = 1;
+			set_pcb_flags(pcb, PCB_FULL_IRET);
 			update_gdt_fsbase(td, i386base);
 		}
 		break;
@@ -226,7 +226,7 @@ sysarch(td, uap)
 		error = copyin(uap->parms, &i386base, sizeof(i386base));
 		if (!error) {
 			pcb->pcb_gsbase = i386base;
-			pcb->pcb_full_iret = 1;
+			set_pcb_flags(pcb, PCB_FULL_IRET);
 			td->td_frame->tf_gs = _ugssel;
 			update_gdt_gsbase(td, i386base);
 		}
@@ -240,7 +240,7 @@ sysarch(td, uap)
 		if (!error) {
 			if (a64base < VM_MAXUSER_ADDRESS) {
 				pcb->pcb_fsbase = a64base;
-				pcb->pcb_full_iret = 1;
+				set_pcb_flags(pcb, PCB_FULL_IRET);
 				td->td_frame->tf_fs = _ufssel;
 			} else
 				error = EINVAL;
@@ -256,7 +256,7 @@ sysarch(td, uap)
 		if (!error) {
 			if (a64base < VM_MAXUSER_ADDRESS) {
 				pcb->pcb_gsbase = a64base;
-				pcb->pcb_full_iret = 1;
+				set_pcb_flags(pcb, PCB_FULL_IRET);
 				td->td_frame->tf_gs = _ugssel;
 			} else
 				error = EINVAL;
@@ -543,7 +543,7 @@ amd64_set_ldt(td, uap, descs)
 	    uap->start, uap->num, (void *)uap->descs);
 #endif
 
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	p = td->td_proc;
 	if (descs == NULL) {
 		/* Free descriptors */

Modified: stable/8/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/vm_machdep.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/vm_machdep.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -190,7 +190,7 @@ cpu_fork(td1, p2, td2, flags)
 	pcb2->pcb_tssp = NULL;
 
 	/* New segment registers. */
-	pcb2->pcb_full_iret = 1;
+	set_pcb_flags(pcb2, PCB_FULL_IRET);
 
 	/* Copy the LDT, if necessary. */
 	mdp1 = &td1->td_proc->p_md;
@@ -275,7 +275,7 @@ cpu_thread_exit(struct thread *td)
 	/* Disable any hardware breakpoints. */
 	if (pcb->pcb_flags & PCB_DBREGS) {
 		reset_dbregs();
-		pcb->pcb_flags &= ~PCB_DBREGS;
+		clear_pcb_flags(pcb, PCB_DBREGS);
 	}
 }
 
@@ -385,9 +385,9 @@ cpu_set_upcall(struct thread *td, struct
 	 * values here.
 	 */
 	bcopy(td0->td_pcb, pcb2, sizeof(*pcb2));
-	pcb2->pcb_flags &= ~(PCB_FPUINITDONE | PCB_USERFPUINITDONE);
+	clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE);
 	pcb2->pcb_save = &pcb2->pcb_user_save;
-	pcb2->pcb_full_iret = 1;
+	set_pcb_flags(pcb2, PCB_FULL_IRET);
 
 	/*
 	 * Create a new fresh stack for the new thread.
@@ -491,18 +491,20 @@ cpu_set_upcall_kse(struct thread *td, vo
 int
 cpu_set_user_tls(struct thread *td, void *tls_base)
 {
+	struct pcb *pcb;
 
 	if ((u_int64_t)tls_base >= VM_MAXUSER_ADDRESS)
 		return (EINVAL);
 
+	pcb = td->td_pcb;
 #ifdef COMPAT_FREEBSD32
 	if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) {
-		td->td_pcb->pcb_gsbase = (register_t)tls_base;
+		pcb->pcb_gsbase = (register_t)tls_base;
 		return (0);
 	}
 #endif
-	td->td_pcb->pcb_fsbase = (register_t)tls_base;
-	td->td_pcb->pcb_full_iret = 1;
+	pcb->pcb_fsbase = (register_t)tls_base;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	return (0);
 }
 

Modified: stable/8/sys/amd64/ia32/ia32_reg.c
==============================================================================
--- stable/8/sys/amd64/ia32/ia32_reg.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/ia32/ia32_reg.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -125,7 +125,7 @@ set_regs32(struct thread *td, struct reg
 	tp->tf_fs = regs->r_fs;
 	tp->tf_es = regs->r_es;
 	tp->tf_ds = regs->r_ds;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	tp->tf_flags = TF_HASSEGS;
 	tp->tf_rdi = regs->r_edi;
 	tp->tf_rsi = regs->r_esi;

Modified: stable/8/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- stable/8/sys/amd64/ia32/ia32_signal.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/ia32/ia32_signal.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -129,8 +129,10 @@ ia32_set_fpcontext(struct thread *td, co
 static int
 ia32_get_mcontext(struct thread *td, struct ia32_mcontext *mcp, int flags)
 {
+	struct pcb *pcb;
 	struct trapframe *tp;
 
+	pcb = td->td_pcb;
 	tp = td->td_frame;
 
 	PROC_LOCK(curthread->td_proc);
@@ -162,11 +164,11 @@ ia32_get_mcontext(struct thread *td, str
 	mcp->mc_ss = tp->tf_ss;
 	mcp->mc_len = sizeof(*mcp);
 	ia32_get_fpcontext(td, mcp);
-	mcp->mc_fsbase = td->td_pcb->pcb_fsbase;
-	mcp->mc_gsbase = td->td_pcb->pcb_gsbase;
+	mcp->mc_fsbase = pcb->pcb_fsbase;
+	mcp->mc_gsbase = pcb->pcb_gsbase;
 	bzero(mcp->mc_spare1, sizeof(mcp->mc_spare1));
 	bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2));
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	return (0);
 }
 
@@ -208,7 +210,7 @@ ia32_set_mcontext(struct thread *td, con
 	tp->tf_rflags = rflags;
 	tp->tf_rsp = mcp->mc_esp;
 	tp->tf_ss = mcp->mc_ss;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	return (0);
 }
 
@@ -405,7 +407,7 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi
 	regs->tf_ss = _udatasel;
 	regs->tf_ds = _udatasel;
 	regs->tf_es = _udatasel;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	/* leave user %fs and %gs untouched */
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
@@ -528,7 +530,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *
 	regs->tf_ss = _udatasel;
 	regs->tf_ds = _udatasel;
 	regs->tf_es = _udatasel;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	/* XXXKIB leave user %fs and %gs untouched */
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
@@ -623,7 +625,7 @@ freebsd4_freebsd32_sigreturn(td, uap)
 	regs->tf_gs = ucp->uc_mcontext.mc_gs;
 
 	kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0);
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	return (EJUSTRETURN);
 }
 #endif	/* COMPAT_FREEBSD4 */
@@ -712,7 +714,7 @@ freebsd32_sigreturn(td, uap)
 	regs->tf_flags = TF_HASSEGS;
 
 	kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0);
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	return (EJUSTRETURN);
 }
 
@@ -755,8 +757,7 @@ ia32_setregs(td, entry, stack, ps_string
 	fpstate_drop(td);
 
 	/* Return via doreti so that we can change to a different %cs */
-	pcb->pcb_flags |= PCB_32BIT;
-	pcb->pcb_flags &= ~PCB_GS32BIT;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET);
+	clear_pcb_flags(pcb, PCB_GS32BIT);
 	td->td_retval[1] = 0;
 }

Modified: stable/8/sys/amd64/include/pcb.h
==============================================================================
--- stable/8/sys/amd64/include/pcb.h	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/include/pcb.h	Wed Mar  2 19:09:49 2011	(r219187)
@@ -66,7 +66,13 @@ struct pcb {
 	register_t	pcb_dr6;
 	register_t	pcb_dr7;
 
-	u_long		pcb_flags;
+	struct region_descriptor pcb_gdt;
+	struct region_descriptor pcb_idt;
+	struct region_descriptor pcb_ldt;
+	uint16_t	pcb_tr;
+
+	u_int		pcb_flags;
+#define	PCB_FULL_IRET	0x01	/* full iret is required */
 #define	PCB_DBREGS	0x02	/* process using debug registers */
 #define	PCB_KERNFPU	0x04	/* kernel uses fpu */
 #define	PCB_FPUINITDONE	0x08	/* fpu state is initialized */
@@ -76,26 +82,52 @@ struct pcb {
 
 	uint16_t	pcb_initial_fpucw;
 
-	caddr_t		pcb_onfault; /* copyin/out fault recovery */
+	/* copyin/out fault recovery */
+	caddr_t		pcb_onfault;
 
 	/* 32-bit segment descriptor */
 	struct user_segment_descriptor pcb_gs32sd;
+
 	/* local tss, with i/o bitmap; NULL for common */
 	struct amd64tss *pcb_tssp;
-	struct	savefpu	*pcb_save;
-	char		pcb_full_iret;
 
-	struct region_descriptor pcb_gdt;
-	struct region_descriptor pcb_idt;
-	struct region_descriptor pcb_ldt;
-	uint16_t	pcb_tr;
-
-	struct	savefpu pcb_user_save;
+	struct savefpu	*pcb_save;
+	struct savefpu	pcb_user_save;
 };
 
 #ifdef _KERNEL
 struct trapframe;
 
+/*
+ * The pcb_flags is only modified by current thread, or by other threads
+ * when current thread is stopped.  However, current thread may change it
+ * from the interrupt context in cpu_switch(), or in the trap handler.
+ * When we read-modify-write pcb_flags from C sources, compiler may generate
+ * code that is not atomic regarding the interrupt handler.  If a trap or
+ * interrupt happens and any flag is modified from the handler, it can be
+ * clobbered with the cached value later.  Therefore, we implement setting
+ * and clearing flags with single-instruction functions, which do not race
+ * with possible modification of the flags from the trap or interrupt context,
+ * because traps and interrupts are executed only on instruction boundary.
+ */
+static __inline void
+set_pcb_flags(struct pcb *pcb, const u_int flags)
+{
+
+	__asm __volatile("orl %1,%0"
+	    : "=m" (pcb->pcb_flags) : "ir" (flags), "m" (pcb->pcb_flags)
+	    : "cc");
+}
+
+static __inline void
+clear_pcb_flags(struct pcb *pcb, const u_int flags)
+{
+
+	__asm __volatile("andl %1,%0"
+	    : "=m" (pcb->pcb_flags) : "ir" (~flags), "m" (pcb->pcb_flags)
+	    : "cc");
+}
+
 void	makectx(struct trapframe *, struct pcb *);
 int	savectx(struct pcb *);
 #endif

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -616,6 +616,7 @@ linux_clone(struct thread *td, struct li
 	if (args->flags & LINUX_CLONE_SETTLS) {
 		struct user_segment_descriptor sd;
 		struct l_user_desc info;
+		struct pcb *pcb;
 		int a[2];
 
 		error = copyin((void *)td->td_frame->tf_rsi, &info,
@@ -645,10 +646,11 @@ linux_clone(struct thread *td, struct li
 				    sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx,
 				    sd.sd_long, sd.sd_def32, sd.sd_gran);
 #endif
-			td2->td_pcb->pcb_gsbase = (register_t)info.base_addr;
-/* XXXKIB		td2->td_pcb->pcb_gs32sd = sd; */
+			pcb = td2->td_pcb;
+			pcb->pcb_gsbase = (register_t)info.base_addr;
+/* XXXKIB		pcb->pcb_gs32sd = sd; */
 			td2->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
-			td2->td_pcb->pcb_flags |= PCB_GS32BIT | PCB_32BIT;
+			set_pcb_flags(pcb, PCB_GS32BIT | PCB_32BIT);
 		}
 	}
 
@@ -1178,6 +1180,7 @@ linux_set_thread_area(struct thread *td,
 {
 	struct l_user_desc info;
 	struct user_segment_descriptor sd;
+	struct pcb *pcb;
 	int a[2];
 	int error;
 
@@ -1266,8 +1269,9 @@ linux_set_thread_area(struct thread *td,
 		    sd.sd_gran);
 #endif
 
-	td->td_pcb->pcb_gsbase = (register_t)info.base_addr;
-	td->td_pcb->pcb_flags |= PCB_32BIT | PCB_GS32BIT;
+	pcb = td->td_pcb;
+	pcb->pcb_gsbase = (register_t)info.base_addr;
+	set_pcb_flags(pcb, PCB_32BIT | PCB_GS32BIT);
 	update_gdt_gsbase(td, info.base_addr);
 
 	return (0);

Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -422,7 +422,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo
 	regs->tf_fs = _ufssel;
 	regs->tf_gs = _ugssel;
 	regs->tf_flags = TF_HASSEGS;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
 }
@@ -545,7 +545,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t 
 	regs->tf_fs = _ufssel;
 	regs->tf_gs = _ugssel;
 	regs->tf_flags = TF_HASSEGS;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
 }
@@ -643,7 +643,7 @@ linux_sigreturn(struct thread *td, struc
 	regs->tf_rflags = eflags;
 	regs->tf_rsp    = frame.sf_sc.sc_esp_at_signal;
 	regs->tf_ss     = frame.sf_sc.sc_ss;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 
 	return (EJUSTRETURN);
 }
@@ -742,7 +742,7 @@ linux_rt_sigreturn(struct thread *td, st
 	regs->tf_rflags = eflags;
 	regs->tf_rsp    = context->sc_esp_at_signal;
 	regs->tf_ss     = context->sc_ss;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 
 	/*
 	 * call sigaltstack & ignore results..
@@ -879,9 +879,8 @@ exec_linux_setregs(td, entry, stack, ps_
 	fpstate_drop(td);
 
 	/* Do full restore on return so that we can change to a different %cs */
-	pcb->pcb_flags |= PCB_32BIT;
-	pcb->pcb_flags &= ~PCB_GS32BIT;
-	pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET);
+	clear_pcb_flags(pcb, PCB_GS32BIT);
 	td->td_retval[1] = 0;
 }
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:27:01 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9D0D6106564A;
	Wed,  2 Mar 2011 19:27:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 726668FC0C;
	Wed,  2 Mar 2011 19:27:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JR1SU040256;
	Wed, 2 Mar 2011 19:27:01 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JR1Sp040254;
	Wed, 2 Mar 2011 19:27:01 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103021927.p22JR1Sp040254@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 19:27:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219188 - stable/8/sys/net
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:27:01 -0000

Author: jhb
Date: Wed Mar  2 19:27:01 2011
New Revision: 219188
URL: http://svn.freebsd.org/changeset/base/219188

Log:
  MFC 217805:
  Fix a LOR by dropping the global ifnet locks while allocating a new ifnet
  table in if_grow().  The order of the SYSINIT's for ifnet state were swapped
  so that the various locks were initialized before being used.

Modified:
  stable/8/sys/net/if.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Wed Mar  2 19:09:49 2011	(r219187)
+++ stable/8/sys/net/if.c	Wed Mar  2 19:27:01 2011	(r219188)
@@ -275,6 +275,7 @@ ifindex_alloc_locked(u_short *idxp)
 
 	IFNET_WLOCK_ASSERT();
 
+retry:
 	/*
 	 * Try to find an empty slot below V_if_index.  If we fail, take the
 	 * next slot.
@@ -287,10 +288,12 @@ ifindex_alloc_locked(u_short *idxp)
 	/* Catch if_index overflow. */
 	if (idx < 1)
 		return (ENOSPC);
+	if (idx >= V_if_indexlim) {
+		if_grow();
+		goto retry;
+	}
 	if (idx > V_if_index)
 		V_if_index = idx;
-	if (V_if_index >= V_if_indexlim)
-		if_grow();
 	*idxp = idx;
 	return (0);
 }
@@ -360,10 +363,12 @@ vnet_if_init(const void *unused __unused
 
 	TAILQ_INIT(&V_ifnet);
 	TAILQ_INIT(&V_ifg_head);
+	IFNET_WLOCK();
 	if_grow();				/* create initial table */
+	IFNET_WUNLOCK();
 	vnet_if_clone_init();
 }
-VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_FIRST, vnet_if_init,
+VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_if_init,
     NULL);
 
 /* ARGSUSED*/
@@ -374,7 +379,7 @@ if_init(void *dummy __unused)
 	IFNET_LOCK_INIT();
 	if_clone_init();
 }
-SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_SECOND, if_init, NULL);
+SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_FIRST, if_init, NULL);
 
 
 #ifdef VIMAGE
@@ -394,16 +399,25 @@ VNET_SYSUNINIT(vnet_if_uninit, SI_SUB_IN
 static void
 if_grow(void)
 {
+	int oldlim;
 	u_int n;
 	struct ifindex_entry *e;
 
-	V_if_indexlim <<= 1;
-	n = V_if_indexlim * sizeof(*e);
+	IFNET_WLOCK_ASSERT();
+	oldlim = V_if_indexlim;
+	IFNET_WUNLOCK();
+	n = (oldlim << 1) * sizeof(*e);
 	e = malloc(n, M_IFNET, M_WAITOK | M_ZERO);
+	IFNET_WLOCK();
+	if (V_if_indexlim != oldlim) {
+		free(e, M_IFNET);
+		return;
+	}
 	if (V_ifindex_table != NULL) {
 		memcpy((caddr_t)e, (caddr_t)V_ifindex_table, n/2);
 		free((caddr_t)V_ifindex_table, M_IFNET);
 	}
+	V_if_indexlim <<= 1;
 	V_ifindex_table = e;
 }
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:29:25 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 128D6106566C;
	Wed,  2 Mar 2011 19:29:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F3D3A8FC08;
	Wed,  2 Mar 2011 19:29:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JTOtJ040589;
	Wed, 2 Mar 2011 19:29:24 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JTOXt040587;
	Wed, 2 Mar 2011 19:29:24 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103021929.p22JTOXt040587@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 19:29:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219189 - stable/8/contrib/csup
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:29:25 -0000

Author: jhb
Date: Wed Mar  2 19:29:24 2011
New Revision: 219189
URL: http://svn.freebsd.org/changeset/base/219189

Log:
  MFC 217858: Remove dead code.

Modified:
  stable/8/contrib/csup/updater.c
Directory Properties:
  stable/8/contrib/csup/   (props changed)

Modified: stable/8/contrib/csup/updater.c
==============================================================================
--- stable/8/contrib/csup/updater.c	Wed Mar  2 19:27:01 2011	(r219188)
+++ stable/8/contrib/csup/updater.c	Wed Mar  2 19:29:24 2011	(r219189)
@@ -770,7 +770,6 @@ updater_docoll(struct updater *up, struc
 			if (sr->sr_serverattr == NULL)
 				return (UPDATER_ERR_PROTO);
 
-			error = 0;
 			error = updater_rcsedit(up, fup, name, rcsopt);
 			if (error)
 				return (error);

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:29:36 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25583106566B;
	Wed,  2 Mar 2011 19:29:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 13DC88FC16;
	Wed,  2 Mar 2011 19:29:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JTZ1a040639;
	Wed, 2 Mar 2011 19:29:35 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JTZYC040637;
	Wed, 2 Mar 2011 19:29:35 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103021929.p22JTZYC040637@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 19:29:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219190 - stable/7/contrib/csup
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:29:36 -0000

Author: jhb
Date: Wed Mar  2 19:29:35 2011
New Revision: 219190
URL: http://svn.freebsd.org/changeset/base/219190

Log:
  MFC 217858: Remove dead code.

Modified:
  stable/7/contrib/csup/updater.c
Directory Properties:
  stable/7/contrib/csup/   (props changed)

Modified: stable/7/contrib/csup/updater.c
==============================================================================
--- stable/7/contrib/csup/updater.c	Wed Mar  2 19:29:24 2011	(r219189)
+++ stable/7/contrib/csup/updater.c	Wed Mar  2 19:29:35 2011	(r219190)
@@ -770,7 +770,6 @@ updater_docoll(struct updater *up, struc
 			if (sr->sr_serverattr == NULL)
 				return (UPDATER_ERR_PROTO);
 
-			error = 0;
 			error = updater_rcsedit(up, fup, name, rcsopt);
 			if (error)
 				return (error);

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:31:53 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CFC1B106566B;
	Wed,  2 Mar 2011 19:31:53 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BCEBF8FC16;
	Wed,  2 Mar 2011 19:31:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JVrwA040880;
	Wed, 2 Mar 2011 19:31:53 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JVrgf040876;
	Wed, 2 Mar 2011 19:31:53 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021931.p22JVrgf040876@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:31:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219191 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:31:53 -0000

Author: dchagin
Date: Wed Mar  2 19:31:53 2011
New Revision: 219191
URL: http://svn.freebsd.org/changeset/base/219191

Log:
  MFC r218612:
  In preparation for moving linux_clone () to a MI path
  move the TLS code in a separate function.
  
  Use function parameter instead of direct using register.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/i386/linux/linux_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:29:35 2011	(r219190)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:31:53 2011	(r219191)
@@ -496,6 +496,50 @@ linux_vfork(struct thread *td, struct li
 	return (0);
 }
 
+static int
+linux_set_cloned_tls(struct thread *td, void *desc)
+{
+	struct user_segment_descriptor sd;
+	struct l_user_desc info;
+	struct pcb *pcb;
+	int error;
+	int a[2];
+
+	error = copyin(desc, &info, sizeof(struct l_user_desc));
+	if (error) {
+		printf(LMSG("copyin failed!"));
+	} else {
+		/* We might copy out the entry_number as GUGS32_SEL. */
+		info.entry_number = GUGS32_SEL;
+		error = copyout(&info, desc, sizeof(struct l_user_desc));
+		if (error)
+			printf(LMSG("copyout failed!"));
+
+		a[0] = LINUX_LDT_entry_a(&info);
+		a[1] = LINUX_LDT_entry_b(&info);
+
+		memcpy(&sd, &a, sizeof(a));
+#ifdef DEBUG
+		if (ldebug(clone))
+			printf("Segment created in clone with "
+			    "CLONE_SETTLS: lobase: %x, hibase: %x, "
+			    "lolimit: %x, hilimit: %x, type: %i, "
+			    "dpl: %i, p: %i, xx: %i, long: %i, "
+			    "def32: %i, gran: %i\n", sd.sd_lobase,
+			    sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit,
+			    sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx,
+			    sd.sd_long, sd.sd_def32, sd.sd_gran);
+#endif
+		pcb = td->td_pcb;
+		pcb->pcb_gsbase = (register_t)info.base_addr;
+/* XXXKIB	pcb->pcb_gs32sd = sd; */
+		td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
+		set_pcb_flags(pcb, PCB_GS32BIT | PCB_32BIT);
+	}
+
+	return (error);
+}
+
 int
 linux_clone(struct thread *td, struct linux_clone_args *args)
 {
@@ -613,46 +657,8 @@ linux_clone(struct thread *td, struct li
 	if (args->stack)
 		td2->td_frame->tf_rsp = PTROUT(args->stack);
 
-	if (args->flags & LINUX_CLONE_SETTLS) {
-		struct user_segment_descriptor sd;
-		struct l_user_desc info;
-		struct pcb *pcb;
-		int a[2];
-
-		error = copyin((void *)td->td_frame->tf_rsi, &info,
-		    sizeof(struct l_user_desc));
-		if (error) {
-			printf(LMSG("copyin failed!"));
-		} else {
-			/* We might copy out the entry_number as GUGS32_SEL. */
-			info.entry_number = GUGS32_SEL;
-			error = copyout(&info, (void *)td->td_frame->tf_rsi,
-			    sizeof(struct l_user_desc));
-			if (error)
-				printf(LMSG("copyout failed!"));
-
-			a[0] = LINUX_LDT_entry_a(&info);
-			a[1] = LINUX_LDT_entry_b(&info);
-
-			memcpy(&sd, &a, sizeof(a));
-#ifdef DEBUG
-			if (ldebug(clone))
-				printf("Segment created in clone with "
-				    "CLONE_SETTLS: lobase: %x, hibase: %x, "
-				    "lolimit: %x, hilimit: %x, type: %i, "
-				    "dpl: %i, p: %i, xx: %i, long: %i, "
-				    "def32: %i, gran: %i\n", sd.sd_lobase,
-				    sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit,
-				    sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx,
-				    sd.sd_long, sd.sd_def32, sd.sd_gran);
-#endif
-			pcb = td2->td_pcb;
-			pcb->pcb_gsbase = (register_t)info.base_addr;
-/* XXXKIB		pcb->pcb_gs32sd = sd; */
-			td2->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
-			set_pcb_flags(pcb, PCB_GS32BIT | PCB_32BIT);
-		}
-	}
+	if (args->flags & LINUX_CLONE_SETTLS)
+		linux_set_cloned_tls(td2, args->tls);
 
 #ifdef DEBUG
 	if (ldebug(clone))

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:29:35 2011	(r219190)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:31:53 2011	(r219191)
@@ -387,6 +387,62 @@ linux_vfork(struct thread *td, struct li
 	return (0);
 }
 
+static int
+linux_set_cloned_tls(struct thread *td, void *desc)
+{
+	struct segment_descriptor sd;
+	struct l_user_desc info;
+	int idx, error;
+	int a[2];
+
+	error = copyin(desc, &info, sizeof(struct l_user_desc));
+	if (error) {
+		printf(LMSG("copyin failed!"));
+	} else {
+		idx = info.entry_number;
+
+		/* 
+		 * looks like we're getting the idx we returned
+		 * in the set_thread_area() syscall
+		 */
+		if (idx != 6 && idx != 3) {
+			printf(LMSG("resetting idx!"));
+			idx = 3;
+		}
+
+		/* this doesnt happen in practice */
+		if (idx == 6) {
+	   		/* we might copy out the entry_number as 3 */
+		   	info.entry_number = 3;
+			error = copyout(&info, desc, sizeof(struct l_user_desc));
+			if (error)
+				printf(LMSG("copyout failed!"));
+		}
+
+		a[0] = LINUX_LDT_entry_a(&info);
+		a[1] = LINUX_LDT_entry_b(&info);
+
+		memcpy(&sd, &a, sizeof(a));
+#ifdef DEBUG
+		if (ldebug(clone))
+			printf("Segment created in clone with "
+			"CLONE_SETTLS: lobase: %x, hibase: %x, "
+			"lolimit: %x, hilimit: %x, type: %i, "
+			"dpl: %i, p: %i, xx: %i, def32: %i, "
+			"gran: %i\n", sd.sd_lobase, sd.sd_hibase,
+			sd.sd_lolimit, sd.sd_hilimit, sd.sd_type,
+			sd.sd_dpl, sd.sd_p, sd.sd_xx,
+			sd.sd_def32, sd.sd_gran);
+#endif
+
+		/* set %gs */
+		td->td_pcb->pcb_gsd = sd;
+		td->td_pcb->pcb_gs = GSEL(GUGS_SEL, SEL_UPL);
+	}
+
+	return (error);
+}
+
 int
 linux_clone(struct thread *td, struct linux_clone_args *args)
 {
@@ -505,60 +561,8 @@ linux_clone(struct thread *td, struct li
 	if (args->stack)
    	   	td2->td_frame->tf_esp = (unsigned int)args->stack;
 
-	if (args->flags & LINUX_CLONE_SETTLS) {
-   	   	struct l_user_desc info;
-   	   	int idx;
-	   	int a[2];
-		struct segment_descriptor sd;
-
-	   	error = copyin((void *)td->td_frame->tf_esi, &info, sizeof(struct l_user_desc));
-		if (error) {
-			printf(LMSG("copyin failed!"));
-		} else {
-		
-			idx = info.entry_number;
-		
-			/* 
-			 * looks like we're getting the idx we returned
-			 * in the set_thread_area() syscall
-			 */
-			if (idx != 6 && idx != 3) {
-				printf(LMSG("resetting idx!"));
-				idx = 3;
-			}
-
-			/* this doesnt happen in practice */
-			if (idx == 6) {
-		   		/* we might copy out the entry_number as 3 */
-			   	info.entry_number = 3;
-				error = copyout(&info, (void *) td->td_frame->tf_esi, sizeof(struct l_user_desc));
-				if (error)
-					printf(LMSG("copyout failed!"));
-			}
-
-			a[0] = LINUX_LDT_entry_a(&info);
-			a[1] = LINUX_LDT_entry_b(&info);
-
-			memcpy(&sd, &a, sizeof(a));
-#ifdef DEBUG
-		if (ldebug(clone))
-		   	printf("Segment created in clone with CLONE_SETTLS: lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, type: %i, dpl: %i, p: %i, xx: %i, def32: %i, gran: %i\n", sd.sd_lobase,
-			sd.sd_hibase,
-			sd.sd_lolimit,
-			sd.sd_hilimit,
-			sd.sd_type,
-			sd.sd_dpl,
-			sd.sd_p,
-			sd.sd_xx,
-			sd.sd_def32,
-			sd.sd_gran);
-#endif
-
-			/* set %gs */
-			td2->td_pcb->pcb_gsd = sd;
-			td2->td_pcb->pcb_gs = GSEL(GUGS_SEL, SEL_UPL);
-		}
-	} 
+	if (args->flags & LINUX_CLONE_SETTLS)
+		linux_set_cloned_tls(td2, args->tls);
 
 #ifdef DEBUG
 	if (ldebug(clone))

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:33:47 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 47B46106566C;
	Wed,  2 Mar 2011 19:33:47 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 35BB18FC15;
	Wed,  2 Mar 2011 19:33:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JXl5N041090;
	Wed, 2 Mar 2011 19:33:47 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JXl6q041085;
	Wed, 2 Mar 2011 19:33:47 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021933.p22JXl6q041085@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:33:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219192 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:33:47 -0000

Author: dchagin
Date: Wed Mar  2 19:33:46 2011
New Revision: 219192
URL: http://svn.freebsd.org/changeset/base/219192

Log:
  MFC r218613:
  In preparation for moving linux_clone() to a MI path
  introduce linux_set_upcall_kse() which is used for MD works.

Modified:
  stable/8/sys/amd64/linux32/linux.h
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/i386/linux/linux.h
  stable/8/sys/i386/linux/linux_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 19:31:53 2011	(r219191)
+++ stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 19:33:46 2011	(r219192)
@@ -920,4 +920,6 @@ struct linux_robust_list_head {
 	l_uintptr_t			pending_list;
 };
 
+int linux_set_upcall_kse(struct thread *td, register_t stack);
+
 #endif /* !_AMD64_LINUX_H_ */

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:31:53 2011	(r219191)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:33:46 2011	(r219192)
@@ -655,7 +655,7 @@ linux_clone(struct thread *td, struct li
 	 * intact.
 	 */
 	if (args->stack)
-		td2->td_frame->tf_rsp = PTROUT(args->stack);
+		linux_set_upcall_kse(td2, PTROUT(args->stack));
 
 	if (args->flags & LINUX_CLONE_SETTLS)
 		linux_set_cloned_tls(td2, args->tls);
@@ -694,6 +694,15 @@ linux_clone(struct thread *td, struct li
 	return (0);
 }
 
+int
+linux_set_upcall_kse(struct thread *td, register_t stack)
+{
+
+	td->td_frame->tf_rsp = stack;
+
+	return (0);
+}
+
 #define STACK_SIZE  (2 * 1024 * 1024)
 #define GUARD_SIZE  (4 * PAGE_SIZE)
 

Modified: stable/8/sys/i386/linux/linux.h
==============================================================================
--- stable/8/sys/i386/linux/linux.h	Wed Mar  2 19:31:53 2011	(r219191)
+++ stable/8/sys/i386/linux/linux.h	Wed Mar  2 19:33:46 2011	(r219192)
@@ -880,4 +880,6 @@ struct linux_robust_list_head {
 	struct linux_robust_list	*pending_list;
 };
 
+int linux_set_upcall_kse(struct thread *td, register_t stack);
+
 #endif /* !_I386_LINUX_H_ */

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:31:53 2011	(r219191)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:33:46 2011	(r219192)
@@ -559,7 +559,7 @@ linux_clone(struct thread *td, struct li
 	 * this is what normal fork() does so we just keep the tf_esp arg intact
 	 */
 	if (args->stack)
-   	   	td2->td_frame->tf_esp = (unsigned int)args->stack;
+		linux_set_upcall_kse(td2, PTROUT(args->stack));
 
 	if (args->flags & LINUX_CLONE_SETTLS)
 		linux_set_cloned_tls(td2, args->tls);
@@ -597,6 +597,15 @@ linux_clone(struct thread *td, struct li
 	return (0);
 }
 
+int
+linux_set_upcall_kse(struct thread *td, register_t stack)
+{
+
+	td->td_frame->tf_esp = stack;
+
+	return (0);
+}
+
 #define STACK_SIZE  (2 * 1024 * 1024)
 #define GUARD_SIZE  (4 * PAGE_SIZE)
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:36:06 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 91277106566B;
	Wed,  2 Mar 2011 19:36:06 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7D5D28FC0C;
	Wed,  2 Mar 2011 19:36:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22Ja6mB041410;
	Wed, 2 Mar 2011 19:36:06 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Ja66I041400;
	Wed, 2 Mar 2011 19:36:06 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021936.p22Ja66I041400@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:36:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219193 - in stable/8/sys: amd64/linux32 compat/linux
	conf i386/linux modules/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:36:06 -0000

Author: dchagin
Date: Wed Mar  2 19:36:06 2011
New Revision: 219193
URL: http://svn.freebsd.org/changeset/base/219193

Log:
  MFC r218616:
  Move linux_clone(), linux_fork(), linux_vfork() to a MI path.

Added:
  stable/8/sys/compat/linux/linux_fork.c
     - copied unchanged from r218616, head/sys/compat/linux/linux_fork.c
Modified:
  stable/8/sys/amd64/linux32/linux.h
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/conf/files.amd64
  stable/8/sys/conf/files.i386
  stable/8/sys/conf/files.pc98
  stable/8/sys/i386/linux/linux.h
  stable/8/sys/i386/linux/linux_machdep.c
  stable/8/sys/modules/linux/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 19:36:06 2011	(r219193)
@@ -921,5 +921,6 @@ struct linux_robust_list_head {
 };
 
 int linux_set_upcall_kse(struct thread *td, register_t stack);
+int linux_set_cloned_tls(struct thread *td, void *desc);
 
 #endif /* !_AMD64_LINUX_H_ */

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:36:06 2011	(r219193)
@@ -409,94 +409,6 @@ linux_old_select(struct thread *td, stru
 }
 
 int
-linux_fork(struct thread *td, struct linux_fork_args *args)
-{
-	int error;
-	struct proc *p2;
-	struct thread *td2;
-
-#ifdef DEBUG
-	if (ldebug(fork))
-		printf(ARGS(fork, ""));
-#endif
-
-	if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0)
-		return (error);
-
-	if (error == 0) {
-		td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
-	error = linux_proc_init(td, td->td_retval[0], 0);
-	if (error)
-		return (error);
-
-	td2 = FIRST_THREAD_IN_PROC(p2);
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	return (0);
-}
-
-int
-linux_vfork(struct thread *td, struct linux_vfork_args *args)
-{
-	int error;
-	struct proc *p2;
-	struct thread *td2;
-
-#ifdef DEBUG
-	if (ldebug(vfork))
-		printf(ARGS(vfork, ""));
-#endif
-
-	/* Exclude RFPPWAIT */
-	if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 0)
-		return (error);
-	if (error == 0) {
-	   	td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-	/* Are we the child? */
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
-	error = linux_proc_init(td, td->td_retval[0], 0);
-	if (error)
-		return (error);
-
-	PROC_LOCK(p2);
-	p2->p_flag |= P_PPWAIT;
-	PROC_UNLOCK(p2);
-
-	td2 = FIRST_THREAD_IN_PROC(p2);
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	/* wait for the children to exit, ie. emulate vfork */
-	PROC_LOCK(p2);
-	while (p2->p_flag & P_PPWAIT)
-		cv_wait(&p2->p_pwait, &p2->p_mtx);
-	PROC_UNLOCK(p2);
-
-	return (0);
-}
-
-static int
 linux_set_cloned_tls(struct thread *td, void *desc)
 {
 	struct user_segment_descriptor sd;
@@ -541,160 +453,6 @@ linux_set_cloned_tls(struct thread *td, 
 }
 
 int
-linux_clone(struct thread *td, struct linux_clone_args *args)
-{
-	int error, ff = RFPROC | RFSTOPPED;
-	struct proc *p2;
-	struct thread *td2;
-	int exit_signal;
-	struct linux_emuldata *em;
-
-#ifdef DEBUG
-	if (ldebug(clone)) {
-		printf(ARGS(clone, "flags %x, stack %p, parent tid: %p, "
-		    "child tid: %p"), (unsigned)args->flags,
-		    args->stack, args->parent_tidptr, args->child_tidptr);
-	}
-#endif
-
-	exit_signal = args->flags & 0x000000ff;
-	if (LINUX_SIG_VALID(exit_signal)) {
-		if (exit_signal <= LINUX_SIGTBLSZ)
-			exit_signal =
-			    linux_to_bsd_signal[_SIG_IDX(exit_signal)];
-	} else if (exit_signal != 0)
-		return (EINVAL);
-
-	if (args->flags & LINUX_CLONE_VM)
-		ff |= RFMEM;
-	if (args->flags & LINUX_CLONE_SIGHAND)
-		ff |= RFSIGSHARE;
-	/*
-	 * XXX: In Linux, sharing of fs info (chroot/cwd/umask)
-	 * and open files is independant.  In FreeBSD, its in one
-	 * structure but in reality it does not cause any problems
-	 * because both of these flags are usually set together.
-	 */
-	if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
-		ff |= RFFDG;
-
-	/*
-	 * Attempt to detect when linux_clone(2) is used for creating
-	 * kernel threads. Unfortunately despite the existence of the
-	 * CLONE_THREAD flag, version of linuxthreads package used in
-	 * most popular distros as of beginning of 2005 doesn't make
-	 * any use of it. Therefore, this detection relies on
-	 * empirical observation that linuxthreads sets certain
-	 * combination of flags, so that we can make more or less
-	 * precise detection and notify the FreeBSD kernel that several
-	 * processes are in fact part of the same threading group, so
-	 * that special treatment is necessary for signal delivery
-	 * between those processes and fd locking.
-	 */
-	if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS)
-		ff |= RFTHREAD;
-
-	if (args->flags & LINUX_CLONE_PARENT_SETTID)
-		if (args->parent_tidptr == NULL)
-			return (EINVAL);
-
-	error = fork1(td, ff, 0, &p2);
-	if (error)
-		return (error);
-
-	if (args->flags & (LINUX_CLONE_PARENT | LINUX_CLONE_THREAD)) {
-	   	sx_xlock(&proctree_lock);
-		PROC_LOCK(p2);
-		proc_reparent(p2, td->td_proc->p_pptr);
-		PROC_UNLOCK(p2);
-		sx_xunlock(&proctree_lock);
-	}
-
-	/* create the emuldata */
-	error = linux_proc_init(td, p2->p_pid, args->flags);
-	/* reference it - no need to check this */
-	em = em_find(p2, EMUL_DOLOCK);
-	KASSERT(em != NULL, ("clone: emuldata not found.\n"));
-	/* and adjust it */
-
-	if (args->flags & LINUX_CLONE_THREAD) {
-#ifdef notyet
-	   	PROC_LOCK(p2);
-	   	p2->p_pgrp = td->td_proc->p_pgrp;
-	   	PROC_UNLOCK(p2);
-#endif
-		exit_signal = 0;
-	}
-
-	if (args->flags & LINUX_CLONE_CHILD_SETTID)
-		em->child_set_tid = args->child_tidptr;
-	else
-	   	em->child_set_tid = NULL;
-
-	if (args->flags & LINUX_CLONE_CHILD_CLEARTID)
-		em->child_clear_tid = args->child_tidptr;
-	else
-	   	em->child_clear_tid = NULL;
-
-	EMUL_UNLOCK(&emul_lock);
-
-	if (args->flags & LINUX_CLONE_PARENT_SETTID) {
-		error = copyout(&p2->p_pid, args->parent_tidptr,
-		    sizeof(p2->p_pid));
-		if (error)
-			printf(LMSG("copyout failed!"));
-	}
-
-	PROC_LOCK(p2);
-	p2->p_sigparent = exit_signal;
-	PROC_UNLOCK(p2);
-	td2 = FIRST_THREAD_IN_PROC(p2);
-	/*
-	 * In a case of stack = NULL, we are supposed to COW calling process
-	 * stack. This is what normal fork() does, so we just keep tf_rsp arg
-	 * intact.
-	 */
-	if (args->stack)
-		linux_set_upcall_kse(td2, PTROUT(args->stack));
-
-	if (args->flags & LINUX_CLONE_SETTLS)
-		linux_set_cloned_tls(td2, args->tls);
-
-#ifdef DEBUG
-	if (ldebug(clone))
-		printf(LMSG("clone: successful rfork to %d, "
-		    "stack %p sig = %d"), (int)p2->p_pid, args->stack,
-		    exit_signal);
-#endif
-	if (args->flags & LINUX_CLONE_VFORK) {
-	   	PROC_LOCK(p2);
-	   	p2->p_flag |= P_PPWAIT;
-	   	PROC_UNLOCK(p2);
-	}
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	td->td_retval[0] = p2->p_pid;
-	td->td_retval[1] = 0;
-
-	if (args->flags & LINUX_CLONE_VFORK) {
-		/* wait for the children to exit, ie. emulate vfork */
-		PROC_LOCK(p2);
-		while (p2->p_flag & P_PPWAIT)
-			cv_wait(&p2->p_pwait, &p2->p_mtx);
-		PROC_UNLOCK(p2);
-	}
-
-	return (0);
-}
-
-int
 linux_set_upcall_kse(struct thread *td, register_t stack)
 {
 

Copied: stable/8/sys/compat/linux/linux_fork.c (from r218616, head/sys/compat/linux/linux_fork.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:36:06 2011	(r219193, copy of r218616, head/sys/compat/linux/linux_fork.c)
@@ -0,0 +1,297 @@
+/*-
+ * Copyright (c) 2004 Tim J. Robbins
+ * Copyright (c) 2002 Doug Rabson
+ * Copyright (c) 2000 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_compat.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#ifdef COMPAT_LINUX32
+#include 
+#include 
+#else
+#include 
+#include 
+#endif
+#include 
+#include 
+
+
+int
+linux_fork(struct thread *td, struct linux_fork_args *args)
+{
+	int error;
+	struct proc *p2;
+	struct thread *td2;
+
+#ifdef DEBUG
+	if (ldebug(fork))
+		printf(ARGS(fork, ""));
+#endif
+
+	if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0)
+		return (error);
+
+	if (error == 0) {
+		td->td_retval[0] = p2->p_pid;
+		td->td_retval[1] = 0;
+	}
+
+	if (td->td_retval[1] == 1)
+		td->td_retval[0] = 0;
+	error = linux_proc_init(td, td->td_retval[0], 0);
+	if (error)
+		return (error);
+
+	td2 = FIRST_THREAD_IN_PROC(p2);
+
+	/*
+	 * Make this runnable after we are finished with it.
+	 */
+	thread_lock(td2);
+	TD_SET_CAN_RUN(td2);
+	sched_add(td2, SRQ_BORING);
+	thread_unlock(td2);
+
+	return (0);
+}
+
+int
+linux_vfork(struct thread *td, struct linux_vfork_args *args)
+{
+	int error;
+	struct proc *p2;
+	struct thread *td2;
+
+#ifdef DEBUG
+	if (ldebug(vfork))
+		printf(ARGS(vfork, ""));
+#endif
+
+	/* Exclude RFPPWAIT */
+	if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 0)
+		return (error);
+	if (error == 0) {
+	   	td->td_retval[0] = p2->p_pid;
+		td->td_retval[1] = 0;
+	}
+	/* Are we the child? */
+	if (td->td_retval[1] == 1)
+		td->td_retval[0] = 0;
+	error = linux_proc_init(td, td->td_retval[0], 0);
+	if (error)
+		return (error);
+
+	PROC_LOCK(p2);
+	p2->p_flag |= P_PPWAIT;
+	PROC_UNLOCK(p2);
+
+	td2 = FIRST_THREAD_IN_PROC(p2);
+
+	/*
+	 * Make this runnable after we are finished with it.
+	 */
+	thread_lock(td2);
+	TD_SET_CAN_RUN(td2);
+	sched_add(td2, SRQ_BORING);
+	thread_unlock(td2);
+
+	/* wait for the children to exit, ie. emulate vfork */
+	PROC_LOCK(p2);
+	while (p2->p_flag & P_PPWAIT)
+		cv_wait(&p2->p_pwait, &p2->p_mtx);
+	PROC_UNLOCK(p2);
+
+	return (0);
+}
+
+int
+linux_clone(struct thread *td, struct linux_clone_args *args)
+{
+	int error, ff = RFPROC | RFSTOPPED;
+	struct proc *p2;
+	struct thread *td2;
+	int exit_signal;
+	struct linux_emuldata *em;
+
+#ifdef DEBUG
+	if (ldebug(clone)) {
+		printf(ARGS(clone, "flags %x, stack %p, parent tid: %p, "
+		    "child tid: %p"), (unsigned)args->flags,
+		    args->stack, args->parent_tidptr, args->child_tidptr);
+	}
+#endif
+
+	exit_signal = args->flags & 0x000000ff;
+	if (LINUX_SIG_VALID(exit_signal)) {
+		if (exit_signal <= LINUX_SIGTBLSZ)
+			exit_signal =
+			    linux_to_bsd_signal[_SIG_IDX(exit_signal)];
+	} else if (exit_signal != 0)
+		return (EINVAL);
+
+	if (args->flags & LINUX_CLONE_VM)
+		ff |= RFMEM;
+	if (args->flags & LINUX_CLONE_SIGHAND)
+		ff |= RFSIGSHARE;
+	/*
+	 * XXX: In Linux, sharing of fs info (chroot/cwd/umask)
+	 * and open files is independant.  In FreeBSD, its in one
+	 * structure but in reality it does not cause any problems
+	 * because both of these flags are usually set together.
+	 */
+	if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
+		ff |= RFFDG;
+
+	/*
+	 * Attempt to detect when linux_clone(2) is used for creating
+	 * kernel threads. Unfortunately despite the existence of the
+	 * CLONE_THREAD flag, version of linuxthreads package used in
+	 * most popular distros as of beginning of 2005 doesn't make
+	 * any use of it. Therefore, this detection relies on
+	 * empirical observation that linuxthreads sets certain
+	 * combination of flags, so that we can make more or less
+	 * precise detection and notify the FreeBSD kernel that several
+	 * processes are in fact part of the same threading group, so
+	 * that special treatment is necessary for signal delivery
+	 * between those processes and fd locking.
+	 */
+	if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS)
+		ff |= RFTHREAD;
+
+	if (args->flags & LINUX_CLONE_PARENT_SETTID)
+		if (args->parent_tidptr == NULL)
+			return (EINVAL);
+
+	error = fork1(td, ff, 0, &p2);
+	if (error)
+		return (error);
+
+	if (args->flags & (LINUX_CLONE_PARENT | LINUX_CLONE_THREAD)) {
+	   	sx_xlock(&proctree_lock);
+		PROC_LOCK(p2);
+		proc_reparent(p2, td->td_proc->p_pptr);
+		PROC_UNLOCK(p2);
+		sx_xunlock(&proctree_lock);
+	}
+
+	/* create the emuldata */
+	error = linux_proc_init(td, p2->p_pid, args->flags);
+	/* reference it - no need to check this */
+	em = em_find(p2, EMUL_DOLOCK);
+	KASSERT(em != NULL, ("clone: emuldata not found."));
+	/* and adjust it */
+
+	if (args->flags & LINUX_CLONE_THREAD) {
+#ifdef notyet
+	   	PROC_LOCK(p2);
+	   	p2->p_pgrp = td->td_proc->p_pgrp;
+	   	PROC_UNLOCK(p2);
+#endif
+		exit_signal = 0;
+	}
+
+	if (args->flags & LINUX_CLONE_CHILD_SETTID)
+		em->child_set_tid = args->child_tidptr;
+	else
+	   	em->child_set_tid = NULL;
+
+	if (args->flags & LINUX_CLONE_CHILD_CLEARTID)
+		em->child_clear_tid = args->child_tidptr;
+	else
+	   	em->child_clear_tid = NULL;
+
+	EMUL_UNLOCK(&emul_lock);
+
+	if (args->flags & LINUX_CLONE_PARENT_SETTID) {
+		error = copyout(&p2->p_pid, args->parent_tidptr,
+		    sizeof(p2->p_pid));
+		if (error)
+			printf(LMSG("copyout failed!"));
+	}
+
+	PROC_LOCK(p2);
+	p2->p_sigparent = exit_signal;
+	PROC_UNLOCK(p2);
+	td2 = FIRST_THREAD_IN_PROC(p2);
+	/*
+	 * In a case of stack = NULL, we are supposed to COW calling process
+	 * stack. This is what normal fork() does, so we just keep tf_rsp arg
+	 * intact.
+	 */
+	if (args->stack)
+		linux_set_upcall_kse(td2, PTROUT(args->stack));
+
+	if (args->flags & LINUX_CLONE_SETTLS)
+		linux_set_cloned_tls(td2, args->tls);
+
+#ifdef DEBUG
+	if (ldebug(clone))
+		printf(LMSG("clone: successful rfork to %d, "
+		    "stack %p sig = %d"), (int)p2->p_pid, args->stack,
+		    exit_signal);
+#endif
+	if (args->flags & LINUX_CLONE_VFORK) {
+	   	PROC_LOCK(p2);
+	   	p2->p_flag |= P_PPWAIT;
+	   	PROC_UNLOCK(p2);
+	}
+
+	/*
+	 * Make this runnable after we are finished with it.
+	 */
+	thread_lock(td2);
+	TD_SET_CAN_RUN(td2);
+	sched_add(td2, SRQ_BORING);
+	thread_unlock(td2);
+
+	td->td_retval[0] = p2->p_pid;
+	td->td_retval[1] = 0;
+
+	if (args->flags & LINUX_CLONE_VFORK) {
+		/* wait for the children to exit, ie. emulate vfork */
+		PROC_LOCK(p2);
+		while (p2->p_flag & P_PPWAIT)
+			cv_wait(&p2->p_pwait, &p2->p_mtx);
+		PROC_UNLOCK(p2);
+	}
+
+	return (0);
+}

Modified: stable/8/sys/conf/files.amd64
==============================================================================
--- stable/8/sys/conf/files.amd64	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/conf/files.amd64	Wed Mar  2 19:36:06 2011	(r219193)
@@ -266,6 +266,7 @@ amd64/linux32/linux32_sysent.c	optional	
 amd64/linux32/linux32_sysvec.c	optional	compat_linux32
 compat/linux/linux_emul.c	optional	compat_linux32
 compat/linux/linux_file.c	optional	compat_linux32
+compat/linux/linux_fork.c	optional	compat_linux32
 compat/linux/linux_futex.c	optional	compat_linux32
 compat/linux/linux_getcwd.c	optional	compat_linux32
 compat/linux/linux_ioctl.c	optional	compat_linux32

Modified: stable/8/sys/conf/files.i386
==============================================================================
--- stable/8/sys/conf/files.i386	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/conf/files.i386	Wed Mar  2 19:36:06 2011	(r219193)
@@ -71,6 +71,7 @@ compat/linprocfs/linprocfs.c	optional li
 compat/linsysfs/linsysfs.c	optional linsysfs
 compat/linux/linux_emul.c	optional compat_linux
 compat/linux/linux_file.c	optional compat_linux
+compat/linux/linux_fork.c	optional compat_linux
 compat/linux/linux_futex.c	optional compat_linux
 compat/linux/linux_getcwd.c	optional compat_linux
 compat/linux/linux_ioctl.c	optional compat_linux

Modified: stable/8/sys/conf/files.pc98
==============================================================================
--- stable/8/sys/conf/files.pc98	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/conf/files.pc98	Wed Mar  2 19:36:06 2011	(r219193)
@@ -42,6 +42,7 @@ compat/linprocfs/linprocfs.c	optional li
 compat/linsysfs/linsysfs.c	optional linsysfs
 compat/linux/linux_emul.c	optional compat_linux
 compat/linux/linux_file.c	optional compat_linux
+compat/linux/linux_fork.c	optional compat_linux
 compat/linux/linux_futex.c	optional compat_linux
 compat/linux/linux_getcwd.c	optional compat_linux
 compat/linux/linux_ioctl.c	optional compat_linux

Modified: stable/8/sys/i386/linux/linux.h
==============================================================================
--- stable/8/sys/i386/linux/linux.h	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/i386/linux/linux.h	Wed Mar  2 19:36:06 2011	(r219193)
@@ -881,5 +881,6 @@ struct linux_robust_list_head {
 };
 
 int linux_set_upcall_kse(struct thread *td, register_t stack);
+int linux_set_cloned_tls(struct thread *td, void *desc);
 
 #endif /* !_I386_LINUX_H_ */

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:36:06 2011	(r219193)
@@ -300,94 +300,6 @@ linux_old_select(struct thread *td, stru
 }
 
 int
-linux_fork(struct thread *td, struct linux_fork_args *args)
-{
-	int error;
-	struct proc *p2;
-	struct thread *td2;
-
-#ifdef DEBUG
-	if (ldebug(fork))
-		printf(ARGS(fork, ""));
-#endif
-
-	if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0)
-		return (error);
-	
-	if (error == 0) {
-		td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
-	error = linux_proc_init(td, td->td_retval[0], 0);
-	if (error)
-		return (error);
-
-	td2 = FIRST_THREAD_IN_PROC(p2);
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	return (0);
-}
-
-int
-linux_vfork(struct thread *td, struct linux_vfork_args *args)
-{
-	int error;
-	struct proc *p2;
-	struct thread *td2;
-
-#ifdef DEBUG
-	if (ldebug(vfork))
-		printf(ARGS(vfork, ""));
-#endif
-
-	/* exclude RFPPWAIT */
-	if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 0)
-		return (error);
-	if (error == 0) {
-		td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-	/* Are we the child? */
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
-	error = linux_proc_init(td, td->td_retval[0], 0);
-	if (error)
-		return (error);
-
-	PROC_LOCK(p2);
-	p2->p_flag |= P_PPWAIT;
-	PROC_UNLOCK(p2);
-
-	td2 = FIRST_THREAD_IN_PROC(p2);
-	
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	/* wait for the children to exit, ie. emulate vfork */
-	PROC_LOCK(p2);
-	while (p2->p_flag & P_PPWAIT)
-		cv_wait(&p2->p_pwait, &p2->p_mtx);
-	PROC_UNLOCK(p2);
-
-	return (0);
-}
-
-static int
 linux_set_cloned_tls(struct thread *td, void *desc)
 {
 	struct segment_descriptor sd;
@@ -444,160 +356,6 @@ linux_set_cloned_tls(struct thread *td, 
 }
 
 int
-linux_clone(struct thread *td, struct linux_clone_args *args)
-{
-	int error, ff = RFPROC | RFSTOPPED;
-	struct proc *p2;
-	struct thread *td2;
-	int exit_signal;
-	struct linux_emuldata *em;
-
-#ifdef DEBUG
-	if (ldebug(clone)) {
-   	   	printf(ARGS(clone, "flags %x, stack %x, parent tid: %x, child tid: %x"),
-		    (unsigned int)args->flags, (unsigned int)args->stack, 
-		    (unsigned int)args->parent_tidptr, (unsigned int)args->child_tidptr);
-	}
-#endif
-
-	exit_signal = args->flags & 0x000000ff;
-	if (LINUX_SIG_VALID(exit_signal)) {
-		if (exit_signal <= LINUX_SIGTBLSZ)
-			exit_signal =
-			    linux_to_bsd_signal[_SIG_IDX(exit_signal)];
-	} else if (exit_signal != 0)
-		return (EINVAL);
-
-	if (args->flags & LINUX_CLONE_VM)
-		ff |= RFMEM;
-	if (args->flags & LINUX_CLONE_SIGHAND)
-		ff |= RFSIGSHARE;
-	/* 
-	 * XXX: in linux sharing of fs info (chroot/cwd/umask)
-	 * and open files is independant. in fbsd its in one
-	 * structure but in reality it doesn't cause any problems
-	 * because both of these flags are usually set together.
-	 */
-	if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
-		ff |= RFFDG;
-
-	/*
-	 * Attempt to detect when linux_clone(2) is used for creating
-	 * kernel threads. Unfortunately despite the existence of the
-	 * CLONE_THREAD flag, version of linuxthreads package used in
-	 * most popular distros as of beginning of 2005 doesn't make
-	 * any use of it. Therefore, this detection relies on
-	 * empirical observation that linuxthreads sets certain
-	 * combination of flags, so that we can make more or less
-	 * precise detection and notify the FreeBSD kernel that several
-	 * processes are in fact part of the same threading group, so
-	 * that special treatment is necessary for signal delivery
-	 * between those processes and fd locking.
-	 */
-	if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS)
-		ff |= RFTHREAD;
-
-	if (args->flags & LINUX_CLONE_PARENT_SETTID)
-		if (args->parent_tidptr == NULL)
-			return (EINVAL);
-
-	error = fork1(td, ff, 0, &p2);
-	if (error)
-		return (error);
-
-	if (args->flags & (LINUX_CLONE_PARENT | LINUX_CLONE_THREAD)) {
-	   	sx_xlock(&proctree_lock);
-		PROC_LOCK(p2);
-		proc_reparent(p2, td->td_proc->p_pptr);
-		PROC_UNLOCK(p2);
-		sx_xunlock(&proctree_lock);
-	}
-	
-	/* create the emuldata */
-	error = linux_proc_init(td, p2->p_pid, args->flags);
-	/* reference it - no need to check this */
-	em = em_find(p2, EMUL_DOLOCK);
-	KASSERT(em != NULL, ("clone: emuldata not found.\n"));
-	/* and adjust it */
-
-	if (args->flags & LINUX_CLONE_THREAD) {
-	   	/* XXX: linux mangles pgrp and pptr somehow
-		 * I think it might be this but I am not sure.
-		 */
-#ifdef notyet
-	   	PROC_LOCK(p2);
-	   	p2->p_pgrp = td->td_proc->p_pgrp;
-	   	PROC_UNLOCK(p2);
-#endif
-	 	exit_signal = 0;
-	}
-
-	if (args->flags & LINUX_CLONE_CHILD_SETTID)
-		em->child_set_tid = args->child_tidptr;
-	else
-	   	em->child_set_tid = NULL;
-
-	if (args->flags & LINUX_CLONE_CHILD_CLEARTID)
-		em->child_clear_tid = args->child_tidptr;
-	else
-	   	em->child_clear_tid = NULL;
-
-	EMUL_UNLOCK(&emul_lock);
-
-	if (args->flags & LINUX_CLONE_PARENT_SETTID) {
-		error = copyout(&p2->p_pid, args->parent_tidptr, sizeof(p2->p_pid));
-		if (error)
-			printf(LMSG("copyout failed!"));
-	}
-
-	PROC_LOCK(p2);
-	p2->p_sigparent = exit_signal;
-	PROC_UNLOCK(p2);
-	td2 = FIRST_THREAD_IN_PROC(p2);
-	/* 
-	 * in a case of stack = NULL we are supposed to COW calling process stack
-	 * this is what normal fork() does so we just keep the tf_esp arg intact
-	 */
-	if (args->stack)
-		linux_set_upcall_kse(td2, PTROUT(args->stack));
-
-	if (args->flags & LINUX_CLONE_SETTLS)
-		linux_set_cloned_tls(td2, args->tls);
-
-#ifdef DEBUG
-	if (ldebug(clone))
-		printf(LMSG("clone: successful rfork to %ld, stack %p sig = %d"),
-		    (long)p2->p_pid, args->stack, exit_signal);
-#endif
-	if (args->flags & LINUX_CLONE_VFORK) {
-	   	PROC_LOCK(p2);
-		p2->p_flag |= P_PPWAIT;
-	   	PROC_UNLOCK(p2);
-	}
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	td->td_retval[0] = p2->p_pid;
-	td->td_retval[1] = 0;
-
-	if (args->flags & LINUX_CLONE_VFORK) {
-   	   	/* wait for the children to exit, ie. emulate vfork */
-   	   	PROC_LOCK(p2);
-		while (p2->p_flag & P_PPWAIT)
-			cv_wait(&p2->p_pwait, &p2->p_mtx);
-		PROC_UNLOCK(p2);
-	}
-
-	return (0);
-}
-
-int
 linux_set_upcall_kse(struct thread *td, register_t stack)
 {
 

Modified: stable/8/sys/modules/linux/Makefile
==============================================================================
--- stable/8/sys/modules/linux/Makefile	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/modules/linux/Makefile	Wed Mar  2 19:36:06 2011	(r219193)
@@ -8,7 +8,7 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINU
 .PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX}
 
 KMOD=	linux
-SRCS=	linux${SFX}_dummy.c linux_emul.c linux_file.c \
+SRCS=	linux_fork.c linux${SFX}_dummy.c linux_emul.c linux_file.c \
 	linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
 	linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
 	linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:38:14 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2CC9D1065670;
	Wed,  2 Mar 2011 19:38:14 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B7408FC14;
	Wed,  2 Mar 2011 19:38:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JcEk7041811;
	Wed, 2 Mar 2011 19:38:14 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JcDnL041809;
	Wed, 2 Mar 2011 19:38:13 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021938.p22JcDnL041809@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:38:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219194 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:38:14 -0000

Author: dchagin
Date: Wed Mar  2 19:38:13 2011
New Revision: 219194
URL: http://svn.freebsd.org/changeset/base/219194

Log:
  MFC r218617:
  Remove bogus include 

Modified:
  stable/8/sys/compat/linux/linux_fork.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_fork.c
==============================================================================
--- stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:36:06 2011	(r219193)
+++ stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:38:13 2011	(r219194)
@@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 #ifdef COMPAT_LINUX32
 #include 
 #include 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:39:43 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1DDAC106564A;
	Wed,  2 Mar 2011 19:39:43 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0C5F88FC08;
	Wed,  2 Mar 2011 19:39:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JdgiW042123;
	Wed, 2 Mar 2011 19:39:42 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Jdg3T042121;
	Wed, 2 Mar 2011 19:39:42 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021939.p22Jdg3T042121@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:39:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219195 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:39:43 -0000

Author: dchagin
Date: Wed Mar  2 19:39:42 2011
New Revision: 219195
URL: http://svn.freebsd.org/changeset/base/219195

Log:
  MFC r218618:
  Slightly rewrite linux_fork:
  
  1) Remove bogus error checking.
  2) A new process exit from kernel through fork_trampoline(),
     so remove bogus check.

Modified:
  stable/8/sys/compat/linux/linux_fork.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_fork.c
==============================================================================
--- stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:38:13 2011	(r219194)
+++ stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:39:42 2011	(r219195)
@@ -67,13 +67,9 @@ linux_fork(struct thread *td, struct lin
 	if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0)
 		return (error);
 
-	if (error == 0) {
-		td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
+	td->td_retval[0] = p2->p_pid;
+	td->td_retval[1] = 0;
 
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
 	error = linux_proc_init(td, td->td_retval[0], 0);
 	if (error)
 		return (error);
@@ -106,13 +102,10 @@ linux_vfork(struct thread *td, struct li
 	/* Exclude RFPPWAIT */
 	if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 0)
 		return (error);
-	if (error == 0) {
-	   	td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-	/* Are we the child? */
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
+
+   	td->td_retval[0] = p2->p_pid;
+	td->td_retval[1] = 0;
+
 	error = linux_proc_init(td, td->td_retval[0], 0);
 	if (error)
 		return (error);

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:41:09 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7788106564A;
	Wed,  2 Mar 2011 19:41:09 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AC1518FC08;
	Wed,  2 Mar 2011 19:41:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22Jf9fR042392;
	Wed, 2 Mar 2011 19:41:09 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Jf9cW042388;
	Wed, 2 Mar 2011 19:41:09 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021941.p22Jf9cW042388@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:41:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219196 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:41:10 -0000

Author: dchagin
Date: Wed Mar  2 19:41:09 2011
New Revision: 219196
URL: http://svn.freebsd.org/changeset/base/219196

Log:
  MFC r218621:
  Rename used_requeue and use it as bitwise field to store more flags.
  Reimplement used_requeue logic with LINUX_XDEPR_REQUEUEOP flag.

Modified:
  stable/8/sys/compat/linux/linux_emul.c
  stable/8/sys/compat/linux/linux_emul.h
  stable/8/sys/compat/linux/linux_futex.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_emul.c
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 19:39:42 2011	(r219195)
+++ stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 19:41:09 2011	(r219196)
@@ -87,7 +87,7 @@ linux_proc_init(struct thread *td, pid_t
 		em = malloc(sizeof *em, M_LINUX, M_WAITOK | M_ZERO);
 		em->pid = child;
 		em->pdeath_signal = 0;
-		em->used_requeue = 0;
+		em->flags = 0;
 		em->robust_futexes = NULL;
 		if (flags & LINUX_CLONE_THREAD) {
 			/* handled later in the code */

Modified: stable/8/sys/compat/linux/linux_emul.h
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.h	Wed Mar  2 19:39:42 2011	(r219195)
+++ stable/8/sys/compat/linux/linux_emul.h	Wed Mar  2 19:41:09 2011	(r219196)
@@ -55,7 +55,7 @@ struct linux_emuldata {
 	struct linux_emuldata_shared *shared;
 
 	int	pdeath_signal;		/* parent death signal */
-	int	used_requeue;		/* uses deprecated futex op */
+	int	flags;			/* different emuldata flags */
 
 	struct	linux_robust_list_head	*robust_futexes;
 
@@ -76,6 +76,10 @@ struct linux_emuldata	*em_find(struct pr
 #define	EMUL_DOLOCK		1
 #define	EMUL_DONTLOCK		0
 
+/* emuldata flags */
+#define	LINUX_XDEPR_REQUEUEOP	0x00000001	/* uses deprecated
+						   futex REQUEUE op*/
+
 int	linux_proc_init(struct thread *, pid_t, int);
 void	linux_proc_exit(void *, struct proc *);
 void	linux_schedtail(void *, struct proc *);

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:39:42 2011	(r219195)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:41:09 2011	(r219196)
@@ -691,11 +691,11 @@ linux_sys_futex(struct thread *td, struc
 		 * FUTEX_REQUEUE returned EINVAL.
 		 */
 		em = em_find(td->td_proc, EMUL_DONTLOCK);
-		if (em->used_requeue == 0) {
+		if ((em->flags & LINUX_XDEPR_REQUEUEOP) == 0) {
 			linux_msg(td,
 				  "linux_sys_futex: "
 				  "unsupported futex_requeue op\n");
-			em->used_requeue = 1;
+			em->flags |= LINUX_XDEPR_REQUEUEOP;
 		}
 		return (EINVAL);
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:43:31 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A217B1065670;
	Wed,  2 Mar 2011 19:43:31 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 907DA8FC17;
	Wed,  2 Mar 2011 19:43:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JhV85042835;
	Wed, 2 Mar 2011 19:43:31 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JhVhb042833;
	Wed, 2 Mar 2011 19:43:31 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021943.p22JhVhb042833@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:43:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219197 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:43:31 -0000

Author: dchagin
Date: Wed Mar  2 19:43:31 2011
New Revision: 219197
URL: http://svn.freebsd.org/changeset/base/219197

Log:
  MFC r218654, r218655:
  Stop printing the LOR, as this is expected behavior.
  Remove comment about 'ftlk' LOR.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:41:09 2011	(r219196)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:43:31 2011	(r219197)
@@ -88,7 +88,7 @@ struct futex_list futex_list;
 
 #define FUTEX_LOCK(f)		sx_xlock(&(f)->f_lck)
 #define FUTEX_UNLOCK(f)		sx_xunlock(&(f)->f_lck)
-#define FUTEX_INIT(f)		sx_init_flags(&(f)->f_lck, "ftlk", 0)
+#define FUTEX_INIT(f)		sx_init_flags(&(f)->f_lck, "ftlk", SX_DUPOK)
 #define FUTEX_DESTROY(f)	sx_destroy(&(f)->f_lck)
 #define FUTEX_ASSERT_LOCKED(f)	sx_assert(&(f)->f_lck, SA_XLOCKED)
 
@@ -565,8 +565,7 @@ linux_sys_futex(struct thread *td, struc
 
 		/*
 		 * To avoid deadlocks return EINVAL if second futex
-		 * exists at this time. Otherwise create the new futex
-		 * and ignore false positive LOR which thus happens.
+		 * exists at this time.
 		 *
 		 * Glibc fall back to FUTEX_WAKE in case of any error
 		 * returned by FUTEX_CMP_REQUEUE.

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:45:50 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B87D5106564A;
	Wed,  2 Mar 2011 19:45:50 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8A1CB8FC13;
	Wed,  2 Mar 2011 19:45:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22Jjomb043336;
	Wed, 2 Mar 2011 19:45:50 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JjoAN043332;
	Wed, 2 Mar 2011 19:45:50 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021945.p22JjoAN043332@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:45:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219198 - in stable/8/sys: amd64/linux32 compat/linux
	i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:45:50 -0000

Author: dchagin
Date: Wed Mar  2 19:45:50 2011
New Revision: 219198
URL: http://svn.freebsd.org/changeset/base/219198

Log:
  MFC r218658, r218668:
  Sort include files in the alphabetical order.

Modified:
  stable/8/sys/amd64/linux32/linux32_sysvec.c
  stable/8/sys/compat/linux/linux_futex.c
  stable/8/sys/i386/linux/linux_sysvec.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Mar  2 19:43:31 2011	(r219197)
+++ stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Mar  2 19:45:50 2011	(r219198)
@@ -76,8 +76,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:43:31 2011	(r219197)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:45:50 2011	(r219198)
@@ -60,8 +60,8 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex.
 #include 
 #include 
 #endif
-#include 
 #include 
+#include 
 #include 
 
 MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes");

Modified: stable/8/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/8/sys/i386/linux/linux_sysvec.c	Wed Mar  2 19:43:31 2011	(r219197)
+++ stable/8/sys/i386/linux/linux_sysvec.c	Wed Mar  2 19:45:50 2011	(r219198)
@@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:46:45 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E42E6106564A;
	Wed,  2 Mar 2011 19:46:45 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2E5E8FC20;
	Wed,  2 Mar 2011 19:46:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22Jkj3F043525;
	Wed, 2 Mar 2011 19:46:45 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JkjP9043523;
	Wed, 2 Mar 2011 19:46:45 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021946.p22JkjP9043523@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:46:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219199 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:46:46 -0000

Author: dchagin
Date: Wed Mar  2 19:46:45 2011
New Revision: 219199
URL: http://svn.freebsd.org/changeset/base/219199

Log:
  MFC r218686:
  Style(9) fix. Do not initialize variables in the declarations.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:45:50 2011	(r219198)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:46:45 2011	(r219199)
@@ -448,8 +448,8 @@ linux_sys_futex(struct thread *td, struc
 	int clockrt, nrwake, op_ret, ret, val;
 	struct linux_emuldata *em;
 	struct waiting_proc *wp;
-	struct futex *f, *f2 = NULL;
-	int error = 0;
+	struct futex *f, *f2;
+	int error;
 
 	/*
 	 * Our implementation provides only privates futexes. Most of the apps
@@ -472,6 +472,9 @@ linux_sys_futex(struct thread *td, struc
 		args->op != LINUX_FUTEX_WAIT_REQUEUE_PI)
 		return (ENOSYS);
 
+	error = 0;
+	f = f2 = NULL;
+
 	switch (args->op) {
 	case LINUX_FUTEX_WAIT:
 		args->val3 = FUTEX_BITSET_MATCH_ANY;

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:48:19 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CFEB1106566C;
	Wed,  2 Mar 2011 19:48:19 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BE8928FC08;
	Wed,  2 Mar 2011 19:48:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JmJMc043850;
	Wed, 2 Mar 2011 19:48:19 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JmJod043847;
	Wed, 2 Mar 2011 19:48:19 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021948.p22JmJod043847@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:48:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219200 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:48:20 -0000

Author: dchagin
Date: Wed Mar  2 19:48:19 2011
New Revision: 219200
URL: http://svn.freebsd.org/changeset/base/219200

Log:
  MFC r218717:
  Put the macro declaration in the relevant include file for future use.

Modified:
  stable/8/sys/compat/linux/linux_misc.c
  stable/8/sys/compat/linux/linux_signal.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 19:46:45 2011	(r219199)
+++ stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 19:48:19 2011	(r219200)
@@ -92,9 +92,6 @@ __FBSDID("$FreeBSD$");
 
 int stclohz;				/* Statistics clock frequency */
 
-#define BSD_TO_LINUX_SIGNAL(sig)	\
-	(((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig)
-
 static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = {
 	RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK,
 	RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE,

Modified: stable/8/sys/compat/linux/linux_signal.h
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.h	Wed Mar  2 19:46:45 2011	(r219199)
+++ stable/8/sys/compat/linux/linux_signal.h	Wed Mar  2 19:48:19 2011	(r219200)
@@ -40,4 +40,7 @@ void ksiginfo_to_lsiginfo(ksiginfo_t *ks
 
 #define LINUX_SIG_VALID(sig)	((sig) <= LINUX_NSIG && (sig) > 0)
 
+#define BSD_TO_LINUX_SIGNAL(sig)				\
+	(((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig)
+
 #endif /* _LINUX_SIGNAL_H_ */

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 19:49:38 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5BFAD1065677;
	Wed,  2 Mar 2011 19:49:38 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 316328FC19;
	Wed,  2 Mar 2011 19:49:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22JncPm044100;
	Wed, 2 Mar 2011 19:49:38 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JncMd044098;
	Wed, 2 Mar 2011 19:49:38 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021949.p22JncMd044098@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:49:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219201 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:49:38 -0000

Author: dchagin
Date: Wed Mar  2 19:49:37 2011
New Revision: 219201
URL: http://svn.freebsd.org/changeset/base/219201

Log:
  MFC r218718:
  Style(9) fix. Wrap long lines in linux_rt_sigtimedwait().

Modified:
  stable/8/sys/compat/linux/linux_signal.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_signal.c
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 19:48:19 2011	(r219200)
+++ stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 19:49:37 2011	(r219201)
@@ -457,8 +457,9 @@ linux_rt_sigtimedwait(struct thread *td,
 			return (error);
 #ifdef DEBUG
 		if (ldebug(rt_sigtimedwait))
-			printf(LMSG("linux_rt_sigtimedwait: incoming timeout (%d/%d)\n"),
-				ltv.tv_sec, ltv.tv_usec);
+			printf(LMSG("linux_rt_sigtimedwait: "
+			    "incoming timeout (%d/%d)\n"),
+			    ltv.tv_sec, ltv.tv_usec);
 #endif
 		tv.tv_sec = (long)ltv.tv_sec;
 		tv.tv_usec = (suseconds_t)ltv.tv_usec;
@@ -477,8 +478,9 @@ linux_rt_sigtimedwait(struct thread *td,
 				timevalclear(&tv);
 #ifdef DEBUG
 			if (ldebug(rt_sigtimedwait))
-				printf(LMSG("linux_rt_sigtimedwait: converted timeout (%jd/%ld)\n"),
-					(intmax_t)tv.tv_sec, tv.tv_usec);
+				printf(LMSG("linux_rt_sigtimedwait: "
+				    "converted timeout (%jd/%ld)\n"),
+				    (intmax_t)tv.tv_sec, tv.tv_usec);
 #endif
 		}
 		TIMEVAL_TO_TIMESPEC(&tv, &ts);
@@ -487,7 +489,8 @@ linux_rt_sigtimedwait(struct thread *td,
 	error = kern_sigtimedwait(td, bset, &info, tsa);
 #ifdef DEBUG
 	if (ldebug(rt_sigtimedwait))
-		printf(LMSG("linux_rt_sigtimedwait: sigtimedwait returning (%d)\n"), error);
+		printf(LMSG("linux_rt_sigtimedwait: "
+		    "sigtimedwait returning (%d)\n"), error);
 #endif
 	if (error)
 		return (error);

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 20:01:24 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B6B95106566C;
	Wed,  2 Mar 2011 20:01:24 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8BB7A8FC1B;
	Wed,  2 Mar 2011 20:01:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22K1OVZ045514;
	Wed, 2 Mar 2011 20:01:24 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22K1OHx045512;
	Wed, 2 Mar 2011 20:01:24 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022001.p22K1OHx045512@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 20:01:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219202 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 20:01:24 -0000

Author: dchagin
Date: Wed Mar  2 20:01:24 2011
New Revision: 219202
URL: http://svn.freebsd.org/changeset/base/219202

Log:
  MFC r218719 (by hand, depends on r209592):
  Make a linux_rt_sigtimedwait() system call is actually working.
  
  1) Translate the native signal number in the appropriate Linux signal.
  2) Remove bogus code, which can lead to a panic as it calls
     kern_sigtimedwait with the same ksiginfo.
  3) Return the corresponding signal number.

Modified:
  stable/8/sys/compat/linux/linux_signal.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_signal.c
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 19:49:37 2011	(r219201)
+++ stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 20:01:24 2011	(r219202)
@@ -431,7 +431,7 @@ int
 linux_rt_sigtimedwait(struct thread *td,
 	struct linux_rt_sigtimedwait_args *args)
 {
-	int error;
+	int error, sig;
 	l_timeval ltv;
 	struct timeval tv;
 	struct timespec ts, *tsa;
@@ -495,19 +495,15 @@ linux_rt_sigtimedwait(struct thread *td,
 	if (error)
 		return (error);
 
+	sig = BSD_TO_LINUX_SIGNAL(info.ksi_signo);
+
 	if (args->ptr) {
 		memset(&linfo, 0, sizeof(linfo));
-		linfo.lsi_signo = info.ksi_signo;
+		ksiginfo_to_lsiginfo(&info, &linfo, sig);
 		error = copyout(&linfo, args->ptr, sizeof(linfo));
 	}
-
-	/* Repost if we got an error. */
-	if (error && info.ksi_signo) {
-		PROC_LOCK(td->td_proc);
-		tdsignal(td->td_proc, td, info.ksi_signo, &info);
-		PROC_UNLOCK(td->td_proc);
-	} else
-		td->td_retval[0] = info.ksi_signo; 
+	if (error == 0)
+		td->td_retval[0] = sig; 
 
 	return (error);
 }
@@ -590,7 +586,7 @@ linux_do_tkill(struct thread *td, l_int 
 	ksi.ksi_pid = proc->p_pid;
 	ksi.ksi_uid = proc->p_ucred->cr_ruid;
 
-	error = tdsignal(p, NULL, ksi.ksi_signo, &ksi);
+	error = pksignal(p, ksi.ksi_signo, &ksi);
 
 out:
 	PROC_UNLOCK(p);

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 20:02:52 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED3AB106564A;
	Wed,  2 Mar 2011 20:02:52 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C1E258FC14;
	Wed,  2 Mar 2011 20:02:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22K2q4a045637;
	Wed, 2 Mar 2011 20:02:52 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22K2q24045633;
	Wed, 2 Mar 2011 20:02:52 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022002.p22K2q24045633@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 20:02:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219203 - in stable/8/sys: amd64/linux32 compat/linux
	i386/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 20:02:53 -0000

Author: dchagin
Date: Wed Mar  2 20:02:52 2011
New Revision: 219203
URL: http://svn.freebsd.org/changeset/base/219203

Log:
  MFC r218720:
  For realtime signals fill the sigval value.

Modified:
  stable/8/sys/amd64/linux32/linux.h
  stable/8/sys/compat/linux/linux_signal.c
  stable/8/sys/i386/linux/linux.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 20:01:24 2011	(r219202)
+++ stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 20:02:52 2011	(r219203)
@@ -306,6 +306,7 @@ struct l_new_utsname {
 #define	LINUX_SIGPOLL		LINUX_SIGIO
 #define	LINUX_SIGPWR		30
 #define	LINUX_SIGSYS		31
+#define	LINUX_SIGRTMIN		32
 
 #define	LINUX_SIGTBLSZ		31
 #define	LINUX_NSIG_WORDS	2

Modified: stable/8/sys/compat/linux/linux_signal.c
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 20:01:24 2011	(r219202)
+++ stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 20:02:52 2011	(r219203)
@@ -649,4 +649,8 @@ ksiginfo_to_lsiginfo(ksiginfo_t *ksi, l_
 		lsi->lsi_uid = ksi->ksi_uid;
 		break;
 	}
+	if (sig >= LINUX_SIGRTMIN) {
+		lsi->lsi_int = ksi->ksi_info.si_value.sival_int;
+		lsi->lsi_ptr = PTROUT(ksi->ksi_info.si_value.sival_ptr);
+	}
 }

Modified: stable/8/sys/i386/linux/linux.h
==============================================================================
--- stable/8/sys/i386/linux/linux.h	Wed Mar  2 20:01:24 2011	(r219202)
+++ stable/8/sys/i386/linux/linux.h	Wed Mar  2 20:02:52 2011	(r219203)
@@ -281,6 +281,7 @@ struct l_new_utsname {
 #define	LINUX_SIGPOLL		LINUX_SIGIO
 #define	LINUX_SIGPWR		30
 #define	LINUX_SIGSYS		31
+#define	LINUX_SIGRTMIN		32
 
 #define	LINUX_SIGTBLSZ		31
 #define	LINUX_NSIG_WORDS	2

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 20:04:55 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1736A106564A;
	Wed,  2 Mar 2011 20:04:55 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 049F88FC08;
	Wed,  2 Mar 2011 20:04:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22K4sLF045909;
	Wed, 2 Mar 2011 20:04:54 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22K4sKI045902;
	Wed, 2 Mar 2011 20:04:54 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022004.p22K4sKI045902@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 20:04:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219204 - in stable/8/sys: amd64/amd64 amd64/include
	i386/i386 i386/include
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 20:04:55 -0000

Author: dchagin
Date: Wed Mar  2 20:04:54 2011
New Revision: 219204
URL: http://svn.freebsd.org/changeset/base/219204

Log:
  MFC r218744:
  To avoid excessive code duplication create wrapper for fill regs
  from stack frame. Change the trap() code to use newly created function
  instead of explicit regs assignment.

Modified:
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/amd64/amd64/trap.c
  stable/8/sys/amd64/include/reg.h
  stable/8/sys/i386/i386/machdep.c
  stable/8/sys/i386/i386/trap.c
  stable/8/sys/i386/include/reg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 20:04:54 2011	(r219204)
@@ -1848,6 +1848,12 @@ fill_regs(struct thread *td, struct reg 
 	struct trapframe *tp;
 
 	tp = td->td_frame;
+	return (fill_frame_regs(tp, regs));
+}
+
+int
+fill_frame_regs(struct trapframe *tp, struct reg *regs)
+{
 	regs->r_r15 = tp->tf_r15;
 	regs->r_r14 = tp->tf_r14;
 	regs->r_r13 = tp->tf_r13;

Modified: stable/8/sys/amd64/amd64/trap.c
==============================================================================
--- stable/8/sys/amd64/amd64/trap.c	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/amd64/amd64/trap.c	Wed Mar  2 20:04:54 2011	(r219204)
@@ -253,38 +253,8 @@ trap(struct trapframe *frame)
 	if (type == T_DTRACE_PROBE || type == T_DTRACE_RET ||
 	    type == T_BPTFLT) {
 		struct reg regs;
-
-		regs.r_r15 = frame->tf_r15;
-		regs.r_r14 = frame->tf_r14;
-		regs.r_r13 = frame->tf_r13;
-		regs.r_r12 = frame->tf_r12;
-		regs.r_r11 = frame->tf_r11;
-		regs.r_r10 = frame->tf_r10;
-		regs.r_r9  = frame->tf_r9;
-		regs.r_r8  = frame->tf_r8;
-		regs.r_rdi = frame->tf_rdi;
-		regs.r_rsi = frame->tf_rsi;
-		regs.r_rbp = frame->tf_rbp;
-		regs.r_rbx = frame->tf_rbx;
-		regs.r_rdx = frame->tf_rdx;
-		regs.r_rcx = frame->tf_rcx;
-		regs.r_rax = frame->tf_rax;
-		regs.r_rip = frame->tf_rip;
-		regs.r_cs = frame->tf_cs;
-		regs.r_rflags = frame->tf_rflags;
-		regs.r_rsp = frame->tf_rsp;
-		regs.r_ss = frame->tf_ss;
-		if (frame->tf_flags & TF_HASSEGS) {
-			regs.r_ds = frame->tf_ds;
-			regs.r_es = frame->tf_es;
-			regs.r_fs = frame->tf_fs;
-			regs.r_gs = frame->tf_gs;
-		} else {
-			regs.r_ds = 0;
-			regs.r_es = 0;
-			regs.r_fs = 0;
-			regs.r_gs = 0;
-		}
+		
+		fill_frame_regs(frame, ®s);
 		if (type == T_DTRACE_PROBE &&
 		    dtrace_fasttrap_probe_ptr != NULL &&
 		    dtrace_fasttrap_probe_ptr(®s) == 0)

Modified: stable/8/sys/amd64/include/reg.h
==============================================================================
--- stable/8/sys/amd64/include/reg.h	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/amd64/include/reg.h	Wed Mar  2 20:04:54 2011	(r219204)
@@ -130,6 +130,7 @@ struct dbreg {
  * XXX these interfaces are MI, so they should be declared in a MI place.
  */
 int	fill_regs(struct thread *, struct reg *);
+int	fill_frame_regs(struct trapframe *, struct reg *);
 int	set_regs(struct thread *, struct reg *);
 int	fill_fpregs(struct thread *, struct fpreg *);
 int	set_fpregs(struct thread *, struct fpreg *);

Modified: stable/8/sys/i386/i386/machdep.c
==============================================================================
--- stable/8/sys/i386/i386/machdep.c	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/i386/i386/machdep.c	Wed Mar  2 20:04:54 2011	(r219204)
@@ -3113,6 +3113,13 @@ fill_regs(struct thread *td, struct reg 
 
 	tp = td->td_frame;
 	pcb = td->td_pcb;
+	regs->r_gs = pcb->pcb_gs;
+	return (fill_frame_regs(tp, regs));
+}
+
+int
+fill_frame_regs(struct trapframe *tp, struct reg *regs)
+{
 	regs->r_fs = tp->tf_fs;
 	regs->r_es = tp->tf_es;
 	regs->r_ds = tp->tf_ds;
@@ -3128,7 +3135,6 @@ fill_regs(struct thread *td, struct reg 
 	regs->r_eflags = tp->tf_eflags;
 	regs->r_esp = tp->tf_esp;
 	regs->r_ss = tp->tf_ss;
-	regs->r_gs = pcb->pcb_gs;
 	return (0);
 }
 

Modified: stable/8/sys/i386/i386/trap.c
==============================================================================
--- stable/8/sys/i386/i386/trap.c	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/i386/i386/trap.c	Wed Mar  2 20:04:54 2011	(r219204)
@@ -275,21 +275,7 @@ trap(struct trapframe *frame)
 	    type == T_BPTFLT) {
 		struct reg regs;
 
-		regs.r_fs = frame->tf_fs;
-		regs.r_es = frame->tf_es;
-		regs.r_ds = frame->tf_ds;
-		regs.r_edi = frame->tf_edi;
-		regs.r_esi = frame->tf_esi;
-		regs.r_ebp = frame->tf_ebp;
-		regs.r_ebx = frame->tf_ebx;
-		regs.r_edx = frame->tf_edx;
-		regs.r_ecx = frame->tf_ecx;
-		regs.r_eax = frame->tf_eax;
-		regs.r_eip = frame->tf_eip;
-		regs.r_cs = frame->tf_cs;
-		regs.r_eflags = frame->tf_eflags;
-		regs.r_esp = frame->tf_esp;
-		regs.r_ss = frame->tf_ss;
+		fill_frame_regs(frame, ®s);
 		if (type == T_DTRACE_PROBE &&
 		    dtrace_fasttrap_probe_ptr != NULL &&
 		    dtrace_fasttrap_probe_ptr(®s) == 0)

Modified: stable/8/sys/i386/include/reg.h
==============================================================================
--- stable/8/sys/i386/include/reg.h	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/i386/include/reg.h	Wed Mar  2 20:04:54 2011	(r219204)
@@ -161,6 +161,7 @@ struct dbreg {
  * XXX these interfaces are MI, so they should be declared in a MI place.
  */
 int	fill_regs(struct thread *, struct reg *);
+int	fill_frame_regs(struct trapframe *, struct reg *);
 int	set_regs(struct thread *, struct reg *);
 int	fill_fpregs(struct thread *, struct fpreg *);
 int	set_fpregs(struct thread *, struct fpreg *);

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 20:08:52 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5C061065673;
	Wed,  2 Mar 2011 20:08:52 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A47438FC15;
	Wed,  2 Mar 2011 20:08:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22K8q0V046322;
	Wed, 2 Mar 2011 20:08:52 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22K8qZv046320;
	Wed, 2 Mar 2011 20:08:52 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022008.p22K8qZv046320@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 20:08:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219205 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 20:08:52 -0000

Author: dchagin
Date: Wed Mar  2 20:08:52 2011
New Revision: 219205
URL: http://svn.freebsd.org/changeset/base/219205

Log:
  MFC r218879:
  Do not clobber %rdx.
  Before calling vfork() syscall the linux user-space stores the current PID
  in the %rdx and restore it when the parent process leaves the kernel.

Modified:
  stable/8/sys/compat/linux/linux_fork.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_fork.c
==============================================================================
--- stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 20:04:54 2011	(r219204)
+++ stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 20:08:52 2011	(r219205)
@@ -104,7 +104,6 @@ linux_vfork(struct thread *td, struct li
 		return (error);
 
    	td->td_retval[0] = p2->p_pid;
-	td->td_retval[1] = 0;
 
 	error = linux_proc_init(td, td->td_retval[0], 0);
 	if (error)

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 21:51:00 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58AF41065678;
	Wed,  2 Mar 2011 21:51:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 370258FC13;
	Wed,  2 Mar 2011 21:51:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22Lp06F056450;
	Wed, 2 Mar 2011 21:51:00 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Lp0qJ056448;
	Wed, 2 Mar 2011 21:51:00 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103022151.p22Lp0qJ056448@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 21:51:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219207 - stable/8/sys/sys
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 21:51:00 -0000

Author: jhb
Date: Wed Mar  2 21:50:59 2011
New Revision: 219207
URL: http://svn.freebsd.org/changeset/base/219207

Log:
  MFC 217239:
  Add a nested include of  to make the sysctl(9) manpage
  accurate.   is one of the very few headers similar to
   for which nested includes is allowed.

Modified:
  stable/8/sys/sys/sysctl.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/sys/sysctl.h
==============================================================================
--- stable/8/sys/sys/sysctl.h	Wed Mar  2 21:39:08 2011	(r219206)
+++ stable/8/sys/sys/sysctl.h	Wed Mar  2 21:50:59 2011	(r219207)
@@ -114,6 +114,8 @@ struct ctlname {
 #define CTL_AUTO_START	0x100
 
 #ifdef _KERNEL
+#include 
+
 #define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \
 	struct sysctl_req *req
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 21:51:22 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C538F1065783;
	Wed,  2 Mar 2011 21:51:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B3E178FC12;
	Wed,  2 Mar 2011 21:51:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22LpM0o056512;
	Wed, 2 Mar 2011 21:51:22 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22LpMGt056510;
	Wed, 2 Mar 2011 21:51:22 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103022151.p22LpMGt056510@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 21:51:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219208 - stable/7/sys/sys
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 21:51:22 -0000

Author: jhb
Date: Wed Mar  2 21:51:22 2011
New Revision: 219208
URL: http://svn.freebsd.org/changeset/base/219208

Log:
  MFC 217239:
  Add a nested include of  to make the sysctl(9) manpage
  accurate.   is one of the very few headers similar to
   for which nested includes is allowed.

Modified:
  stable/7/sys/sys/sysctl.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sys/sysctl.h
==============================================================================
--- stable/7/sys/sys/sysctl.h	Wed Mar  2 21:50:59 2011	(r219207)
+++ stable/7/sys/sys/sysctl.h	Wed Mar  2 21:51:22 2011	(r219208)
@@ -113,6 +113,8 @@ struct ctlname {
 #define CTL_AUTO_START	0x100
 
 #ifdef _KERNEL
+#include 
+
 #define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \
 	struct sysctl_req *req
 

From owner-svn-src-stable@FreeBSD.ORG  Wed Mar  2 22:44:04 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82B581065677;
	Wed,  2 Mar 2011 22:44:04 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 706FF8FC19;
	Wed,  2 Mar 2011 22:44:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22Mi4s1062051;
	Wed, 2 Mar 2011 22:44:04 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Mi4pt062049;
	Wed, 2 Mar 2011 22:44:04 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022244.p22Mi4pt062049@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 22:44:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219211 - stable/8/sys/amd64/include
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 22:44:04 -0000

Author: dchagin
Date: Wed Mar  2 22:44:04 2011
New Revision: 219211
URL: http://svn.freebsd.org/changeset/base/219211

Log:
  Direct commit: fix cryptodev module build when COMPAT_FREEBSD32 option
  is enabled. To avoid header pollution put trapframe declaration here.
  
  Noticed by:	kib
  Pointyhat to:	me

Modified:
  stable/8/sys/amd64/include/reg.h

Modified: stable/8/sys/amd64/include/reg.h
==============================================================================
--- stable/8/sys/amd64/include/reg.h	Wed Mar  2 21:59:53 2011	(r219210)
+++ stable/8/sys/amd64/include/reg.h	Wed Mar  2 22:44:04 2011	(r219211)
@@ -129,6 +129,8 @@ struct dbreg {
 /*
  * XXX these interfaces are MI, so they should be declared in a MI place.
  */
+struct trapframe;
+
 int	fill_regs(struct thread *, struct reg *);
 int	fill_frame_regs(struct trapframe *, struct reg *);
 int	set_regs(struct thread *, struct reg *);

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 00:24:56 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D8B4106566C;
	Thu,  3 Mar 2011 00:24:56 +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 76EA18FC0A;
	Thu,  3 Mar 2011 00:24:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p230OuUK072482;
	Thu, 3 Mar 2011 00:24:56 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p230Ouur072454;
	Thu, 3 Mar 2011 00:24:56 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103030024.p230Ouur072454@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 3 Mar 2011 00:24:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219212 - in stable/8/sys: amd64/amd64 amd64/include
	arm/arm arm/include conf dev/mem i386/i386 i386/include
	ia64/ia64 ia64/include mips/include mips/mips modules/mem
	pc98/pc98 powerpc/...
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 00:24:56 -0000

Author: jkim
Date: Thu Mar  3 00:24:55 2011
New Revision: 219212
URL: http://svn.freebsd.org/changeset/base/219212

Log:
  MFC:	r217515, r217519, r217539
  
  Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set().
  Compile sys/dev/mem/memutil.c for all supported platforms and remove now
  unnecessary dev_mem_md_init().  Consistently define mem_range_softc from
  mem.c for all platforms.  Add missing #include guards for machine/memdev.h
  and sys/memrange.h.  Clean up some nearby style(9) nits.

Modified:
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/amd64/amd64/mem.c
  stable/8/sys/amd64/include/memdev.h
  stable/8/sys/arm/arm/mem.c
  stable/8/sys/arm/include/memdev.h
  stable/8/sys/conf/files
  stable/8/sys/conf/files.amd64
  stable/8/sys/conf/files.i386
  stable/8/sys/conf/files.pc98
  stable/8/sys/dev/mem/memdev.c
  stable/8/sys/dev/mem/memutil.c
  stable/8/sys/i386/i386/machdep.c
  stable/8/sys/i386/i386/mem.c
  stable/8/sys/i386/include/memdev.h
  stable/8/sys/ia64/ia64/mem.c
  stable/8/sys/ia64/include/memdev.h
  stable/8/sys/mips/include/memdev.h
  stable/8/sys/mips/mips/mem.c
  stable/8/sys/modules/mem/Makefile
  stable/8/sys/pc98/pc98/machdep.c
  stable/8/sys/powerpc/include/memdev.h
  stable/8/sys/powerpc/powerpc/mem.c
  stable/8/sys/sparc64/include/memdev.h
  stable/8/sys/sparc64/sparc64/mem.c
  stable/8/sys/sun4v/include/memdev.h
  stable/8/sys/sys/memrange.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/amd64/amd64/machdep.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -193,8 +192,6 @@ struct pcpu __pcpu[MAXCPU];
 
 struct mtx icu_lock;
 
-struct mem_range_softc mem_range_softc;
-
 struct mtx dt_lock;	/* lock for GDT and LDT */
 
 static void

Modified: stable/8/sys/amd64/amd64/mem.c
==============================================================================
--- stable/8/sys/amd64/amd64/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/amd64/amd64/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -72,6 +72,8 @@ __FBSDID("$FreeBSD$");
  */
 MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
 
+struct mem_range_softc mem_range_softc;
+
 /* ARGSUSED */
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)
@@ -214,10 +216,3 @@ memioctl(struct cdev *dev __unused, u_lo
 	}
 	return (error);
 }
-
-void
-dev_mem_md_init(void)
-{
-	if (mem_range_softc.mr_op != NULL)
-		mem_range_softc.mr_op->init(&mem_range_softc);
-}

Modified: stable/8/sys/amd64/include/memdev.h
==============================================================================
--- stable/8/sys/amd64/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/amd64/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 d_ioctl_t	memioctl;
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/arm/arm/mem.c
==============================================================================
--- stable/8/sys/arm/arm/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/arm/arm/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$");
  */
 MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
 
+struct mem_range_softc mem_range_softc;
+
 /* ARGSUSED */
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)
@@ -163,8 +165,3 @@ memmmap(struct cdev *dev, vm_offset_t of
 	/* else panic! */
 	return (0);
 }
-
-void
-dev_mem_md_init(void)
-{
-}

Modified: stable/8/sys/arm/include/memdev.h
==============================================================================
--- stable/8/sys/arm/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/arm/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 d_mmap_t	memmmap;
 #define		memioctl	(d_ioctl_t *)NULL
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/conf/files	Thu Mar  3 00:24:55 2011	(r219212)
@@ -1248,6 +1248,7 @@ dev/mcd/mcd.c			optional mcd isa nowerro
 dev/mcd/mcd_isa.c		optional mcd isa nowerror
 dev/md/md.c			optional md
 dev/mem/memdev.c		optional mem
+dev/mem/memutil.c		optional mem
 dev/mfi/mfi.c			optional mfi
 dev/mfi/mfi_debug.c		optional mfi
 dev/mfi/mfi_pci.c		optional mfi pci

Modified: stable/8/sys/conf/files.amd64
==============================================================================
--- stable/8/sys/conf/files.amd64	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/conf/files.amd64	Thu Mar  3 00:24:55 2011	(r219212)
@@ -212,7 +212,6 @@ dev/hwpmc/hwpmc_x86.c		optional	hwpmc
 dev/kbd/kbd.c			optional	atkbd | sc | ukbd
 dev/lindev/full.c		optional	lindev
 dev/lindev/lindev.c		optional	lindev
-dev/mem/memutil.c		optional	mem
 dev/nfe/if_nfe.c		optional	nfe pci
 dev/nve/if_nve.c		optional	nve pci
 dev/nvram/nvram.c		optional	nvram isa

Modified: stable/8/sys/conf/files.i386
==============================================================================
--- stable/8/sys/conf/files.i386	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/conf/files.i386	Thu Mar  3 00:24:55 2011	(r219212)
@@ -210,7 +210,6 @@ dev/kbd/kbd.c			optional atkbd | sc | uk
 dev/le/if_le_isa.c		optional le isa
 dev/lindev/full.c		optional lindev
 dev/lindev/lindev.c		optional lindev
-dev/mem/memutil.c		optional mem
 dev/mse/mse.c			optional mse
 dev/mse/mse_isa.c		optional mse isa
 dev/nfe/if_nfe.c		optional nfe pci

Modified: stable/8/sys/conf/files.pc98
==============================================================================
--- stable/8/sys/conf/files.pc98	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/conf/files.pc98	Thu Mar  3 00:24:55 2011	(r219212)
@@ -111,7 +111,6 @@ dev/kbd/kbd.c			optional pckbd | sc | uk
 dev/le/if_le_cbus.c		optional le isa
 dev/lindev/full.c		optional lindev
 dev/lindev/lindev.c		optional lindev
-dev/mem/memutil.c		optional mem
 dev/mse/mse.c			optional mse
 dev/mse/mse_cbus.c		optional mse isa
 dev/sbni/if_sbni.c		optional sbni

Modified: stable/8/sys/dev/mem/memdev.c
==============================================================================
--- stable/8/sys/dev/mem/memdev.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/dev/mem/memdev.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -80,7 +81,7 @@ mem_modevent(module_t mod __unused, int 
 	case MOD_LOAD:
 		if (bootverbose)
 			printf("mem: \n");
-		dev_mem_md_init(); /* Machine dependant bit */
+		mem_range_init();
 		memdev = make_dev(&mem_cdevsw, CDEV_MINOR_MEM,
 			UID_ROOT, GID_KMEM, 0640, "mem");
 		kmemdev = make_dev(&mem_cdevsw, CDEV_MINOR_KMEM,
@@ -88,6 +89,7 @@ mem_modevent(module_t mod __unused, int 
 		break;
 
 	case MOD_UNLOAD:
+		mem_range_destroy();
 		destroy_dev(memdev);
 		destroy_dev(kmemdev);
 		break;

Modified: stable/8/sys/dev/mem/memutil.c
==============================================================================
--- stable/8/sys/dev/mem/memutil.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/dev/mem/memutil.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -28,35 +28,64 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
+static struct rwlock	mr_lock;
+
 /*
  * Implementation-neutral, kernel-callable functions for manipulating
  * memory range attributes.
  */
+void
+mem_range_init(void)
+{
+
+	if (mem_range_softc.mr_op == NULL)
+		return;
+	rw_init(&mr_lock, "memrange");
+	mem_range_softc.mr_op->init(&mem_range_softc);
+}
+
+void
+mem_range_destroy(void)
+{
+
+	if (mem_range_softc.mr_op == NULL)
+		return;
+	rw_destroy(&mr_lock);
+}
+
 int
 mem_range_attr_get(struct mem_range_desc *mrd, int *arg)
 {
-	/* can we handle this? */
+	int nd;
+
 	if (mem_range_softc.mr_op == NULL)
 		return (EOPNOTSUPP);
-
-	if (*arg == 0)
+	nd = *arg;
+	rw_rlock(&mr_lock);
+	if (nd == 0)
 		*arg = mem_range_softc.mr_ndesc;
 	else
-		bcopy(mem_range_softc.mr_desc, mrd,
-			(*arg) * sizeof(struct mem_range_desc));
+		bcopy(mem_range_softc.mr_desc, mrd, nd * sizeof(*mrd));
+	rw_runlock(&mr_lock);
 	return (0);
 }
 
 int
 mem_range_attr_set(struct mem_range_desc *mrd, int *arg)
 {
-	/* can we handle this? */
+	int ret;
+
 	if (mem_range_softc.mr_op == NULL)
 		return (EOPNOTSUPP);
-
-	return (mem_range_softc.mr_op->set(&mem_range_softc, mrd, arg));
+	rw_wlock(&mr_lock);
+	ret = mem_range_softc.mr_op->set(&mem_range_softc, mrd, arg);
+	rw_wunlock(&mr_lock);
+	return (ret);
 }

Modified: stable/8/sys/i386/i386/machdep.c
==============================================================================
--- stable/8/sys/i386/i386/machdep.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/i386/i386/machdep.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -239,8 +238,6 @@ struct pcpu __pcpu[MAXCPU];
 
 struct mtx icu_lock;
 
-struct mem_range_softc mem_range_softc;
-
 static void
 cpu_startup(dummy)
 	void *dummy;

Modified: stable/8/sys/i386/i386/mem.c
==============================================================================
--- stable/8/sys/i386/i386/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/i386/i386/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -72,10 +72,11 @@ __FBSDID("$FreeBSD$");
  */
 MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
 
+struct mem_range_softc mem_range_softc;
+
 static struct sx memsxlock;
 SX_SYSINIT(memsxlockinit, &memsxlock, "/dev/mem lock");
 
-
 /* ARGSUSED */
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)
@@ -233,10 +234,3 @@ memioctl(struct cdev *dev __unused, u_lo
 	}
 	return (error);
 }
-
-void
-dev_mem_md_init(void)
-{
-	if (mem_range_softc.mr_op != NULL)
-		mem_range_softc.mr_op->init(&mem_range_softc);
-}

Modified: stable/8/sys/i386/include/memdev.h
==============================================================================
--- stable/8/sys/i386/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/i386/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 d_ioctl_t	memioctl;
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/ia64/ia64/mem.c
==============================================================================
--- stable/8/sys/ia64/ia64/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/ia64/ia64/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -167,8 +167,3 @@ memmmap(struct cdev *dev, vm_offset_t of
 	*paddr = IA64_PHYS_TO_RR7(offset);
 	return (0);
 }
-
-void
-dev_mem_md_init(void)
-{
-}

Modified: stable/8/sys/ia64/include/memdev.h
==============================================================================
--- stable/8/sys/ia64/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/ia64/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 #define		memioctl	(d_ioctl_t *)NULL
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/mips/include/memdev.h
==============================================================================
--- stable/8/sys/mips/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/mips/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -27,6 +27,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -35,4 +38,4 @@ d_read_t	memrw;
 #define		memioctl	(d_ioctl_t *)NULL
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/mips/mips/mem.c
==============================================================================
--- stable/8/sys/mips/mips/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/mips/mips/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -164,8 +164,3 @@ memmmap(struct cdev *dev, vm_offset_t of
 
 	return (0);
 }
-
-void
-dev_mem_md_init(void)
-{
-}

Modified: stable/8/sys/modules/mem/Makefile
==============================================================================
--- stable/8/sys/modules/mem/Makefile	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/modules/mem/Makefile	Thu Mar  3 00:24:55 2011	(r219212)
@@ -5,10 +5,7 @@
 .PATH: ${.CURDIR}/../../${MACHINE_ARCH}/${MACHINE_ARCH}
 
 KMOD=	mem
-SRCS=	memdev.c mem.c
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
-SRCS+=	memutil.c
-.endif
+SRCS=	memdev.c mem.c memutil.c
 .if ${MACHINE_ARCH} == "i386"
 SRCS+=	i686_mem.c k6_mem.c
 .endif

Modified: stable/8/sys/pc98/pc98/machdep.c
==============================================================================
--- stable/8/sys/pc98/pc98/machdep.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/pc98/pc98/machdep.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -207,8 +206,6 @@ struct pcpu __pcpu[MAXCPU];
 
 struct mtx icu_lock;
 
-struct mem_range_softc mem_range_softc;
-
 static void
 cpu_startup(dummy)
 	void *dummy;

Modified: stable/8/sys/powerpc/include/memdev.h
==============================================================================
--- stable/8/sys/powerpc/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/powerpc/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 #define	memioctl	(d_ioctl_t *)NULL
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/powerpc/powerpc/mem.c
==============================================================================
--- stable/8/sys/powerpc/powerpc/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/powerpc/powerpc/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -181,8 +181,3 @@ memmmap(struct cdev *dev, vm_offset_t of
 
 	return (0);
 }
-
-void
-dev_mem_md_init(void)
-{
-}

Modified: stable/8/sys/sparc64/include/memdev.h
==============================================================================
--- stable/8/sys/sparc64/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/sparc64/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 #define		memioctl	(d_ioctl_t *)NULL
 #define		memmmap		(d_mmap_t *)NULL
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/sparc64/sparc64/mem.c
==============================================================================
--- stable/8/sys/sparc64/sparc64/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/sparc64/sparc64/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -188,9 +188,3 @@ memrw(struct cdev *dev, struct uio *uio,
 		kmem_free_wakeup(kernel_map, ova, PAGE_SIZE * colors);
 	return (error);
 }
-
-void
-dev_mem_md_init(void)
-{
-
-}

Modified: stable/8/sys/sun4v/include/memdev.h
==============================================================================
--- stable/8/sys/sun4v/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/sun4v/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 #define		memioctl	(d_ioctl_t *)NULL
 #define		memmmap		(d_mmap_t *)NULL
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/sys/memrange.h
==============================================================================
--- stable/8/sys/sys/memrange.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/sys/memrange.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -4,6 +4,9 @@
  * $FreeBSD$
  */
 
+#ifndef _SYS_MEMRANGE_H_
+#define	_SYS_MEMRANGE_H_
+
 /* Memory range attributes */
 #define MDF_UNCACHEABLE		(1<<0)	/* region not cached */
 #define MDF_WRITECOMBINE	(1<<1)	/* region supports "write combine" action */
@@ -65,7 +68,12 @@ struct mem_range_softc 
 
 extern struct mem_range_softc mem_range_softc;
 
-extern int mem_range_attr_get(struct mem_range_desc *mrd, int *arg);
-extern int mem_range_attr_set(struct mem_range_desc *mrd, int *arg);
+extern void	mem_range_init(void);
+extern void	mem_range_destroy(void);
+
+extern int	mem_range_attr_get(struct mem_range_desc *mrd, int *arg);
+extern int	mem_range_attr_set(struct mem_range_desc *mrd, int *arg);
+
+#endif /* _KERNEL */
 
-#endif
+#endif /* _SYS_MEMRANGE_H_ */

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 00:43:36 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55731106564A;
	Thu,  3 Mar 2011 00:43:36 +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 293FC8FC12;
	Thu,  3 Mar 2011 00:43:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p230haDJ074950;
	Thu, 3 Mar 2011 00:43:36 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p230hakk074948;
	Thu, 3 Mar 2011 00:43:36 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103030043.p230hakk074948@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 3 Mar 2011 00:43:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219213 - stable/8/sys/dev/acpica
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 00:43:36 -0000

Author: jkim
Date: Thu Mar  3 00:43:35 2011
New Revision: 219213
URL: http://svn.freebsd.org/changeset/base/219213

Log:
  MFC:	r218685, r218687
  
  Copy just enough data for the resource type.

Modified:
  stable/8/sys/dev/acpica/acpi_resource.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi_resource.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_resource.c	Thu Mar  3 00:24:55 2011	(r219212)
+++ stable/8/sys/dev/acpica/acpi_resource.c	Thu Mar  3 00:43:35 2011	(r219213)
@@ -60,32 +60,35 @@ static ACPI_STATUS
 acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context)
 {
     struct lookup_irq_request *req;
+    size_t len;
     u_int irqnum, irq;
 
     switch (res->Type) {
     case ACPI_RESOURCE_TYPE_IRQ:
+	irqnum = res->Data.Irq.InterruptCount;
+	irq = res->Data.Irq.Interrupts[0];
+	len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ);
+	break;
     case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
-	if (res->Type == ACPI_RESOURCE_TYPE_IRQ) {
-	    irqnum = res->Data.Irq.InterruptCount;
-	    irq = res->Data.Irq.Interrupts[0];
-	} else {
-	    irqnum = res->Data.ExtendedIrq.InterruptCount;
-	    irq = res->Data.ExtendedIrq.Interrupts[0];
-	}
-	if (irqnum != 1)
-	    break;
-	req = (struct lookup_irq_request *)context;
-	if (req->counter != req->rid) {
-	    req->counter++;
-	    break;
-	}
-	req->found = 1;
-	KASSERT(irq == rman_get_start(req->res),
-	    ("IRQ resources do not match"));
-	bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE));
-	return (AE_CTRL_TERMINATE);
+	irqnum = res->Data.ExtendedIrq.InterruptCount;
+	irq = res->Data.ExtendedIrq.Interrupts[0];
+	len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ);
+	break;
+    default:
+	return (AE_OK);
+    }
+    if (irqnum != 1)
+	return (AE_OK);
+    req = (struct lookup_irq_request *)context;
+    if (req->counter != req->rid) {
+	req->counter++;
+	return (AE_OK);
     }
-    return (AE_OK);
+    req->found = 1;
+    KASSERT(irq == rman_get_start(req->res),
+	("IRQ resources do not match"));
+    bcopy(res, req->acpi_res, len);
+    return (AE_CTRL_TERMINATE);
 }
 
 ACPI_STATUS

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 05:56:29 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6BB0F106566C;
	Thu,  3 Mar 2011 05:56:29 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 58E028FC15;
	Thu,  3 Mar 2011 05:56:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p235uTgZ003480;
	Thu, 3 Mar 2011 05:56:29 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p235uTa0003478;
	Thu, 3 Mar 2011 05:56:29 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103030556.p235uTa0003478@svn.freebsd.org>
From: Dmitry Chagin 
Date: Thu, 3 Mar 2011 05:56:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219215 - stable/8/sys/compat/linux
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 05:56:29 -0000

Author: dchagin
Date: Thu Mar  3 05:56:29 2011
New Revision: 219215
URL: http://svn.freebsd.org/changeset/base/219215

Log:
  Unbreak the build. pksignal added by r209592.
  
  Pointyhat to:	dchagin

Modified:
  stable/8/sys/compat/linux/linux_signal.c

Modified: stable/8/sys/compat/linux/linux_signal.c
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.c	Thu Mar  3 03:02:06 2011	(r219214)
+++ stable/8/sys/compat/linux/linux_signal.c	Thu Mar  3 05:56:29 2011	(r219215)
@@ -586,7 +586,7 @@ linux_do_tkill(struct thread *td, l_int 
 	ksi.ksi_pid = proc->p_pid;
 	ksi.ksi_uid = proc->p_ucred->cr_ruid;
 
-	error = pksignal(p, ksi.ksi_signo, &ksi);
+	error = tdsignal(p, NULL, ksi.ksi_signo, &ksi);
 
 out:
 	PROC_UNLOCK(p);

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 09:44:30 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EA914106564A;
	Thu,  3 Mar 2011 09:44:30 +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 D6B4B8FC1E;
	Thu,  3 Mar 2011 09:44:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p239iUWF016712;
	Thu, 3 Mar 2011 09:44:30 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p239iUXe016705;
	Thu, 3 Mar 2011 09:44:30 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201103030944.p239iUXe016705@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 3 Mar 2011 09:44:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219219 - in stable/8/contrib/xz: . po src/common
	src/liblzma/api/lzma src/liblzma/common src/xz
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 09:44:31 -0000

Author: mm
Date: Thu Mar  3 09:44:30 2011
New Revision: 219219
URL: http://svn.freebsd.org/changeset/base/219219

Log:
  MFC r219001:
  Update xz to release 5.0.1

Modified:
  stable/8/contrib/xz/ChangeLog   (contents, props changed)
  stable/8/contrib/xz/FREEBSD-upgrade   (contents, props changed)
  stable/8/contrib/xz/THANKS   (contents, props changed)
  stable/8/contrib/xz/po/cs.po
  stable/8/contrib/xz/po/de.po
  stable/8/contrib/xz/po/it.po
  stable/8/contrib/xz/po/xz.pot
  stable/8/contrib/xz/src/common/sysdefs.h
  stable/8/contrib/xz/src/liblzma/api/lzma/lzma.h
  stable/8/contrib/xz/src/liblzma/api/lzma/version.h
  stable/8/contrib/xz/src/liblzma/common/common.h
  stable/8/contrib/xz/src/xz/file_io.c
  stable/8/contrib/xz/src/xz/suffix.c
  stable/8/contrib/xz/src/xz/util.h
Directory Properties:
  stable/8/contrib/xz/   (props changed)
  stable/8/contrib/xz/AUTHORS   (props changed)
  stable/8/contrib/xz/COPYING   (props changed)
  stable/8/contrib/xz/FREEBSD-Xlist   (props changed)
  stable/8/contrib/xz/README   (props changed)
  stable/8/contrib/xz/TODO   (props changed)
  stable/8/contrib/xz/po/   (props changed)
  stable/8/contrib/xz/src/   (props changed)

Modified: stable/8/contrib/xz/ChangeLog
==============================================================================
--- stable/8/contrib/xz/ChangeLog	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/ChangeLog	Thu Mar  3 09:44:30 2011	(r219219)
@@ -1,3 +1,125 @@
+commit 7232fcf96bf4bd5f9cd4fc6c93ca2912c665e004
+Author: Lasse Collin 
+Date:   Fri Jan 28 20:26:38 2011 +0200
+
+    Bump package version and liblzma soname to 5.0.1.
+
+commit 5fbce0b8d96dc96775aa0215e3581addc830e23d
+Author: Lasse Collin 
+Date:   Fri Jan 28 20:16:57 2011 +0200
+
+    Update NEWS for 5.0.1.
+
+commit 03ebd1bbb314f9f204940219a835c883bf442475
+Author: Lasse Collin 
+Date:   Wed Jan 26 12:19:08 2011 +0200
+
+    xz: Fix --force on setuid/setgid/sticky and multi-hardlink files.
+    
+    xz didn't compress setuid/setgid/sticky files and files
+    with multiple hard links even with --force. This bug was
+    introduced in 23ac2c44c3ac76994825adb7f9a8f719f78b5ee4.
+    
+    Thanks to Charles Wilson.
+
+commit 7bd0a5e7ccc354f7c2e95c8bc27569c820f6a136
+Author: Lasse Collin 
+Date:   Tue Jan 18 21:25:24 2011 +0200
+
+    Updated THANKS.
+
+commit f71c4e16e913f660977526f0ef8d2acdf458d7c9
+Author: Lasse Collin 
+Date:   Tue Jan 18 21:23:50 2011 +0200
+
+    Add alloc_size and malloc attributes to a few functions.
+    
+    Thanks to Cristian Rodríguez for the original patch.
+
+commit 316cbe24465143edde8f6ffb7532834b7b2ea93f
+Author: Lasse Collin 
+Date:   Mon Dec 13 16:36:33 2010 +0200
+
+    Scripts: Fix gzip and bzip2 support in xzdiff.
+
+commit 9311774c493c19deab51ded919dcd2e9c4aa2829
+Author: Lasse Collin 
+Date:   Sun Dec 12 21:23:55 2010 +0200
+
+    Build: Enable ASM on DJGPP by default.
+
+commit 4a42aaee282fc73b482581684d65110506d5efdd
+Author: Lasse Collin 
+Date:   Sun Dec 12 16:09:42 2010 +0200
+
+    Updated THANKS.
+
+commit ce56f63c41ee210e6308090eb6d49221fdf67d6c
+Author: Lasse Collin 
+Date:   Sun Dec 12 16:07:11 2010 +0200
+
+    Add missing PRIx32 and PRIx64 compatibility definitions.
+    
+    This fixes portability to systems that lack C99 inttypes.h.
+    
+    Thanks to Juan Manuel Guerrero.
+
+commit e6baedddcf54e7da049ebc49183565b99facd4c7
+Author: Lasse Collin 
+Date:   Sun Dec 12 14:50:04 2010 +0200
+
+    DOS-like: Treat \ and : as directory separators in addition to /.
+    
+    Juan Manuel Guerrero had fixed this in his XZ Utils port
+    to DOS/DJGPP. The bug affects also Windows and OS/2.
+
+commit b7afd3e22a8fac115b75c738d40d3eb1de7e286f
+Author: Lasse Collin 
+Date:   Tue Dec 7 18:52:04 2010 +0200
+
+    Translations: Fix Czech translation of "sparse file".
+    
+    Thanks to Petr Hubený and Marek Černocký.
+
+commit 3e564704bc6f463cb2db11e3f3f0dbd71d85992e
+Author: Lasse Collin 
+Date:   Mon Nov 15 14:28:26 2010 +0200
+
+    liblzma: Document the return value of lzma_lzma_preset().
+
+commit 2964d8d691ed92abdcf214888d79ad6d79774735
+Author: Jonathan Nieder 
+Date:   Fri Nov 12 15:22:13 2010 -0600
+
+    Simplify paths in generated API docs
+    
+    Currently the file list generated by Doxygen has src/ at the
+    beginning of each path.  Paths like common/sysdefs.h and
+    liblzma/api/lzma.h are easier to read without such a prefix.
+    
+    Builds from a separate build directory with
+    
+    	mkdir build
+    	cd build
+    	../configure
+    	doxygen Doxyfile
+    
+    include an even longer prefix /home/someone/src/xz/src; this
+    patch has the nice side-effect of eliminating that prefix, too.
+    
+    Fixes: http://bugs.debian.org/572273
+
+commit 37c25658efd25b034266daf87cd381d20d1df776
+Author: Lasse Collin 
+Date:   Tue Oct 26 15:48:48 2010 +0300
+
+    Build: Copy the example programs to $docdir/examples.
+    
+    The example programs by Daniel Mealha Cabrita were included
+    in the git repository, but I had forgot to add them to
+    Makefile.am. Thus, they didn't get included in the source
+    package at all by "make dist".
+
 commit e45929260cd902036efd40c5610a8d0a50d5712b
 Author: Lasse Collin 
 Date:   Sat Oct 23 17:25:52 2010 +0300

Modified: stable/8/contrib/xz/FREEBSD-upgrade
==============================================================================
--- stable/8/contrib/xz/FREEBSD-upgrade	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/FREEBSD-upgrade	Thu Mar  3 09:44:30 2011	(r219219)
@@ -4,7 +4,7 @@ xz
 
 The source code is pulled with git:
 
-	git clone git://ctrl.tukaani.org/xz.git xz
+	git clone http://git.tukaani.org/xz.git xz
 
 ChangeLog is generated with:
 	

Modified: stable/8/contrib/xz/THANKS
==============================================================================
--- stable/8/contrib/xz/THANKS	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/THANKS	Thu Mar  3 09:44:30 2011	(r219219)
@@ -22,6 +22,7 @@ has been important. :-) In alphabetical 
   - Gilles Espinasse
   - Denis Excoffier
   - Mike Frysinger
+  - Juan Manuel Guerrero
   - Joachim Henke
   - Peter Ivanov
   - Jouk Jansen
@@ -46,6 +47,7 @@ has been important. :-) In alphabetical 
   - Mikko Pouru
   - Robert Readman
   - Bernhard Reutner-Fischer
+  - Cristian Rodríguez
   - Christian von Roques
   - Jukka Salmi
   - Alexandre Sauvé

Modified: stable/8/contrib/xz/po/cs.po
==============================================================================
--- stable/8/contrib/xz/po/cs.po	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/po/cs.po	Thu Mar  3 09:44:30 2011	(r219219)
@@ -6,8 +6,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xz-utils\n"
 "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
-"POT-Creation-Date: 2010-10-23 17:48+0300\n"
-"PO-Revision-Date: 2010-09-17 18:54+0200\n"
+"POT-Creation-Date: 2010-12-03 11:25+0100\n"
+"PO-Revision-Date: 2010-12-03 11:32+0100\n"
 "Last-Translator: Marek Černocký \n"
 "Language-Team: Czech \n"
 "Language: cs\n"
@@ -30,7 +30,8 @@ msgstr "%s: Neznámý typ kontroly integ
 
 #: src/xz/args.c:382
 msgid "Only one file can be specified with `--files' or `--files0'."
-msgstr "Spolu s přepínači „--files“ nebo „--files0“ může být zadán pouze jeden soubor"
+msgstr ""
+"Spolu s přepínači „--files“ nebo „--files0“ může být zadán pouze jeden soubor"
 
 #: src/xz/args.c:445
 #, c-format
@@ -51,7 +52,8 @@ msgstr "Použití přednastavení v rež
 
 #: src/xz/coder.c:131
 msgid "The exact options of the presets may vary between software versions."
-msgstr "Přesné volby u přednastavení se mohou lišit mezi různými verzemi softwaru."
+msgstr ""
+"Přesné volby u přednastavení se mohou lišit mezi různými verzemi softwaru."
 
 #: src/xz/coder.c:157
 msgid "The .lzma format supports only the LZMA1 filter"
@@ -72,8 +74,12 @@ msgstr "Dekomprimace bude vyžadovat %s 
 
 #: src/xz/coder.c:247
 #, c-format
-msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
-msgstr "Přizpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo překročeno omezení použitelné paměti %s MiB"
+msgid ""
+"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the "
+"memory usage limit of %s MiB"
+msgstr ""
+"Přizpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo "
+"překročeno omezení použitelné paměti %s MiB"
 
 #. TRANSLATORS: When compression or decompression finishes,
 #. and xz is going to remove the source file, xz first checks
@@ -153,7 +159,8 @@ msgstr "%s: Selhalo zavření souboru: %
 #: src/xz/file_io.c:762 src/xz/file_io.c:946
 #, c-format
 msgid "%s: Seeking failed when trying to create a sparse file: %s"
-msgstr "%s: Selhalo nastavení pozice při pokusu o vytvoření záložního souboru: %s"
+msgstr ""
+"%s: Selhalo nastavení pozice při pokusu o vytvoření souboru řídké matice: %s"
 
 #: src/xz/file_io.c:821
 #, c-format
@@ -312,10 +319,12 @@ msgstr "  Zarovnání proudu:        %s\
 #: src/xz/list.c:693
 msgid ""
 "  Streams:\n"
-"    Stream    Blocks      CompOffset    UncompOffset        CompSize      UncompSize  Ratio  Check      Padding"
+"    Stream    Blocks      CompOffset    UncompOffset        CompSize      "
+"UncompSize  Ratio  Check      Padding"
 msgstr ""
 "  Proudy:\n"
-"     Proud     Bloky     KomprPozice   NekomprPozice   KomprVelikost NekomprVelikost  Poměr  Kontrola   Zarovnání"
+"     Proud     Bloky     KomprPozice   NekomprPozice   KomprVelikost "
+"NekomprVelikost  Poměr  Kontrola   Zarovnání"
 
 #. TRANSLATORS: The second line is column headings. All
 #. except Check are right aligned; Check is left aligned.
@@ -323,10 +332,12 @@ msgstr ""
 #, c-format
 msgid ""
 "  Blocks:\n"
-"    Stream     Block      CompOffset    UncompOffset       TotalSize      UncompSize  Ratio  Check"
+"    Stream     Block      CompOffset    UncompOffset       TotalSize      "
+"UncompSize  Ratio  Check"
 msgstr ""
 "  Bloky:\n"
-"     Proud      Blok     KomprPozice   NekomprPozice    CelkVelikost NekomprVelikost  Poměr  Kontrola"
+"     Proud      Blok     KomprPozice   NekomprPozice    CelkVelikost "
+"NekomprVelikost  Poměr  Kontrola"
 
 #. TRANSLATORS: These are additional column headings
 #. for the most verbose listing mode. CheckVal
@@ -397,16 +408,24 @@ msgstr "%s: Neočekávaný konec vstupu 
 
 #: src/xz/main.c:120
 #, c-format
-msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
-msgstr "%s: Byl nalezen nulový znak při čtení názvů souborů; nechtěli jste náhodou použít „--files0“ místo „--files“?"
+msgid ""
+"%s: Null character found when reading filenames; maybe you meant to use `--"
+"files0' instead of `--files'?"
+msgstr ""
+"%s: Byl nalezen nulový znak při čtení názvů souborů; nechtěli jste náhodou "
+"použít „--files0“ místo „--files“?"
 
 #: src/xz/main.c:174
 msgid "Compression and decompression with --robot are not supported yet."
 msgstr "Komprimace a dekomprimace s přepínačem --robot není zatím podporovaná."
 
 #: src/xz/main.c:231
-msgid "Cannot read data from standard input when reading filenames from standard input"
-msgstr "Ze standardního vstupu nelze číst data, když se ze standardního vstupu načítají názvy souborů"
+msgid ""
+"Cannot read data from standard input when reading filenames from standard "
+"input"
+msgstr ""
+"Ze standardního vstupu nelze číst data, když se ze standardního vstupu "
+"načítají názvy souborů"
 
 #: src/xz/message.c:792 src/xz/message.c:842
 msgid "Internal error (bug)"
@@ -422,7 +441,8 @@ msgstr "Žádná kontrola integrity; int
 
 #: src/xz/message.c:811
 msgid "Unsupported type of integrity check; not verifying file integrity"
-msgstr "Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat"
+msgstr ""
+"Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat"
 
 #: src/xz/message.c:818
 msgid "Memory usage limit reached"
@@ -471,8 +491,11 @@ msgstr ""
 "\n"
 
 #: src/xz/message.c:1091
-msgid "Mandatory arguments to long options are mandatory for short options too.\n"
-msgstr "Povinné argumenty pro dlouhé přepínače jsou povinné rovněž pro krátké přepínače.\n"
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Povinné argumenty pro dlouhé přepínače jsou povinné rovněž pro krátké "
+"přepínače.\n"
 
 #: src/xz/message.c:1095
 msgid " Operation mode:\n"
@@ -505,8 +528,10 @@ msgid ""
 "  -c, --stdout        write to standard output and don't delete input files"
 msgstr ""
 " -k, --keep            zachovat (nemazat) vstupní soubory\n"
-" -f, --force           vynutit přepis výstupního souboru a de/komprimovat odkazy\n"
-" -c, --stdout          zapisovat na standardní výstup a nemazat vstupní soubory"
+" -f, --force           vynutit přepis výstupního souboru a de/komprimovat "
+"odkazy\n"
+" -c, --stdout          zapisovat na standardní výstup a nemazat vstupní "
+"soubory"
 
 #: src/xz/message.c:1113
 msgid ""
@@ -514,15 +539,19 @@ msgid ""
 "  -S, --suffix=.SUF   use the suffix `.SUF' on compressed files\n"
 "      --files[=FILE]  read filenames to process from FILE; if FILE is\n"
 "                      omitted, filenames are read from the standard input;\n"
-"                      filenames must be terminated with the newline character\n"
+"                      filenames must be terminated with the newline "
+"character\n"
 "      --files0[=FILE] like --files but use the null character as terminator"
 msgstr ""
-"     --no-sparse       nevytvářet při dekomprimaci záložní soubory\n"
+"     --no-sparse       nevytvářet při dekomprimaci soubory řídkých matic\n"
 " -S, --suffix=.PRIP    použít u komprimovaných souborů příponu „.PRIP“\n"
-"     --files[=SOUBOR]  číst názvy souborů, které se mají zpracovat, ze SOUBORu;\n"
-"                       pokud není SOUBOR zadán, čte se ze standardního vstupu;\n"
+"     --files[=SOUBOR]  číst názvy souborů, které se mají zpracovat, ze "
+"SOUBORu;\n"
+"                       pokud není SOUBOR zadán, čte se ze standardního "
+"vstupu;\n"
 "                       názvy souborů musí být zakončeny znakem nového řádku\n"
-"     --files0[=SOUBOR] stejné jako --files, ale použít k zakončování nulový znak"
+"     --files0[=SOUBOR] stejné jako --files, ale použít k zakončování nulový "
+"znak"
 
 #: src/xz/message.c:1121
 msgid ""
@@ -541,20 +570,26 @@ msgid ""
 msgstr ""
 " -F, --format=FORMÁT   formát souboru k zakódování nebo dekódování; možné\n"
 "                       hodnoty jsou „auto“ (výchozí), „xz“, „lzma“ a „raw“\n"
-" -C, --check=KONTROLA  typ kontroly integrity: „none“ (používejte s rozmyslem),\n"
+" -C, --check=KONTROLA  typ kontroly integrity: „none“ (používejte s "
+"rozmyslem),\n"
 "                       „crc32“, „crc64“ (výchozí) nebo „sha256“"
 
 #: src/xz/message.c:1130
 msgid ""
-"  -0 ... -9           compression preset; default is 6; take compressor *and*\n"
-"                      decompressor memory usage into account before using 7-9!"
-msgstr ""
-" -0 .. -9              přednastavení komprimace; výchozí je 6; než použijete\n"
-"                       hodnoty 7 – 9, vezměte do úvahy množství použité paměti"
+"  -0 ... -9           compression preset; default is 6; take compressor "
+"*and*\n"
+"                      decompressor memory usage into account before using "
+"7-9!"
+msgstr ""
+" -0 .. -9              přednastavení komprimace; výchozí je 6; než "
+"použijete\n"
+"                       hodnoty 7 – 9, vezměte do úvahy množství použité "
+"paměti"
 
 #: src/xz/message.c:1134
 msgid ""
-"  -e, --extreme       try to improve compression ratio by using more CPU time;\n"
+"  -e, --extreme       try to improve compression ratio by using more CPU "
+"time;\n"
 "                      does not affect decompressor memory requirements"
 msgstr ""
 " -e, --extreme         zkusit zlepšit poměr komprimace využitím více času\n"
@@ -566,22 +601,27 @@ msgid ""
 "      --memlimit-compress=LIMIT\n"
 "      --memlimit-decompress=LIMIT\n"
 "  -M, --memlimit=LIMIT\n"
-"                      set memory usage limit for compression, decompression,\n"
+"                      set memory usage limit for compression, "
+"decompression,\n"
 "                      or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
 msgstr ""
 "     --memlimit-compress=LIMIT\n"
 "     --memlimit-decompress=LIMIT\n"
 " -M, --memlimit=LIMIT\n"
 "                       nastaví omezení použitelné paměti pro komprimaci,\n"
-"                       dekomprimaci nebo obojí; LIMIT je v bajtech, % z paměti\n"
+"                       dekomprimaci nebo obojí; LIMIT je v bajtech, % z "
+"paměti\n"
 "                       RAM nebo 0 pro výchozí"
 
 #: src/xz/message.c:1146
 msgid ""
-"      --no-adjust     if compression settings exceed the memory usage limit,\n"
-"                      give an error instead of adjusting the settings downwards"
+"      --no-adjust     if compression settings exceed the memory usage "
+"limit,\n"
+"                      give an error instead of adjusting the settings "
+"downwards"
 msgstr ""
-"     --no-adjust       pokud nastavení komprimace přesáhne omezení použitelné\n"
+"     --no-adjust       pokud nastavení komprimace přesáhne omezení "
+"použitelné\n"
 "                       paměti, předat chybu namísto snížení nastavení"
 
 #: src/xz/message.c:1152
@@ -590,13 +630,16 @@ msgid ""
 " Custom filter chain for compression (alternative for using presets):"
 msgstr ""
 "\n"
-"Vlastní omezující filtr pro komprimaci (alternativa k použití přednastavených):"
+"Vlastní omezující filtr pro komprimaci (alternativa k použití "
+"přednastavených):"
 
 #: src/xz/message.c:1161
 msgid ""
 "\n"
-"  --lzma1[=OPTS]      LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
-"  --lzma2[=OPTS]      more of the following options (valid values; default):\n"
+"  --lzma1[=OPTS]      LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
+"or\n"
+"  --lzma2[=OPTS]      more of the following options (valid values; "
+"default):\n"
 "                        preset=PRE reset options to a preset (0-9[e])\n"
 "                        dict=NUM   dictionary size (4KiB - 1536MiB; 8MiB)\n"
 "                        lc=NUM     number of literal context bits (0-4; 3)\n"
@@ -604,20 +647,29 @@ msgid ""
 "                        pb=NUM     number of position bits (0-4; 2)\n"
 "                        mode=MODE  compression mode (fast, normal; normal)\n"
 "                        nice=NUM   nice length of a match (2-273; 64)\n"
-"                        mf=NAME    match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
-"                        depth=NUM  maximum search depth; 0=automatic (default)"
-msgstr ""
-"\n"
-" --lzma1[=VOLBY]       LZMA1 nebo LZMA2; VOLBY je čárkou oddělovaný seznam žádné\n"
-" --lzma2[=VOLBY]       nebo více následujících voleb (platné hodnoty; výchozí):\n"
-"                         preset=PŘE změnit volby na PŘEdnastavené (0 – 9[e])\n"
-"                         dict=POČ   velikost slovníku (4 KiB – 1536 MiB; 8 MiB)\n"
-"                         lc=POČ     počet kontextových bitů literálu (0 – 4; 3)\n"
-"                         lp=POČ     počet pozičních bitů literálu (0 – 4; 0)\n"
+"                        mf=NAME    match finder (hc3, hc4, bt2, bt3, bt4; "
+"bt4)\n"
+"                        depth=NUM  maximum search depth; 0=automatic "
+"(default)"
+msgstr ""
+"\n"
+" --lzma1[=VOLBY]       LZMA1 nebo LZMA2; VOLBY je čárkou oddělovaný seznam "
+"žádné\n"
+" --lzma2[=VOLBY]       nebo více následujících voleb (platné hodnoty; "
+"výchozí):\n"
+"                         preset=PŘE změnit volby na PŘEdnastavené (0 – 9"
+"[e])\n"
+"                         dict=POČ   velikost slovníku (4 KiB – 1536 MiB; 8 "
+"MiB)\n"
+"                         lc=POČ     počet kontextových bitů literálu (0 – 4; "
+"3)\n"
+"                         lp=POČ     počet pozičních bitů literálu (0 – 4; "
+"0)\n"
 "                         pb=POČ     počet pozičních bitů (0 – 4; 2)\n"
 "                         mode=REŽIM režim komprimace (fast, normal; normal)\n"
 "                         nice=NUM   příznivá délka shody (2 – 273; 64)\n"
-"                         mf=NÁZEV   hledání shod (hc3, hc4, bt2, bt3, bt4; bt4)\n"
+"                         mf=NÁZEV   hledání shod (hc3, hc4, bt2, bt3, bt4; "
+"bt4)\n"
 "                         depth=POČ  maximální hloubka prohledávání;\n"
 "                                    0 = automaticky (výchozí)"
 
@@ -652,7 +704,8 @@ msgid ""
 msgstr ""
 "\n"
 " --delta[=VOLBY]       Filtr Delta; platné VOLBY (platné hodnoty; výchozí):\n"
-"                         dist=POČ   vzdálenost mezi bajty, které jsou odečítány\n"
+"                         dist=POČ   vzdálenost mezi bajty, které jsou "
+"odečítány\n"
 "                                    jeden od druhého (1 – 256; 1)"
 
 #: src/xz/message.c:1196
@@ -665,10 +718,12 @@ msgstr ""
 
 #: src/xz/message.c:1199
 msgid ""
-"  -q, --quiet         suppress warnings; specify twice to suppress errors too\n"
+"  -q, --quiet         suppress warnings; specify twice to suppress errors "
+"too\n"
 "  -v, --verbose       be verbose; specify twice for even more verbose"
 msgstr ""
-" -q, --quiet           potlačit varování; zadáním dvakrát, potlačíte i chyby\n"
+" -q, --quiet           potlačit varování; zadáním dvakrát, potlačíte i "
+"chyby\n"
 " -v, --verbose         podrobnější zprávy; zadáním dvakrát, budou ještě\n"
 "                       podrobnější"
 
@@ -677,17 +732,20 @@ msgid "  -Q, --no-warn       make warnin
 msgstr " -Q, --no-warn         způsobí, že varování neovlivní stav ukončení"
 
 #: src/xz/message.c:1206
-msgid "      --robot         use machine-parsable messages (useful for scripts)"
+msgid ""
+"      --robot         use machine-parsable messages (useful for scripts)"
 msgstr ""
 "     --robot           použít strojově analyzovatelné zprávy (užitečné pro\n"
 "                       skripty)"
 
 #: src/xz/message.c:1209
 msgid ""
-"      --info-memory   display the total amount of RAM and the currently active\n"
+"      --info-memory   display the total amount of RAM and the currently "
+"active\n"
 "                      memory usage limits, and exit"
 msgstr ""
-"     --info-memory     zobrazit celkové množství paměti RAM a současné aktivní\n"
+"     --info-memory     zobrazit celkové množství paměti RAM a současné "
+"aktivní\n"
 "                       omezení použitelné paměti a skončit"
 
 #: src/xz/message.c:1212
@@ -695,7 +753,8 @@ msgid ""
 "  -h, --help          display the short help (lists only the basic options)\n"
 "  -H, --long-help     display this long help and exit"
 msgstr ""
-" -h, --help            zobrazit krátkou nápovědu (vypíše jen základní přepínače)\n"
+" -h, --help            zobrazit krátkou nápovědu (vypíše jen základní "
+"přepínače)\n"
 " -H, --long-help       zobrazit tuto úplnou nápovědu a skončit"
 
 #: src/xz/message.c:1216
@@ -704,7 +763,8 @@ msgid ""
 "  -H, --long-help     display the long help (lists also the advanced options)"
 msgstr ""
 " -h, --help            zobrazit tuto zkrácenou nápovědu a skončit\n"
-" -H, --long-help       zobrazit úplnou nápovědu (vypíše i pokročilé přepínače)"
+" -H, --long-help       zobrazit úplnou nápovědu (vypíše i pokročilé "
+"přepínače)"
 
 #: src/xz/message.c:1221
 msgid "  -V, --version       display the version number and exit"
@@ -716,7 +776,8 @@ msgid ""
 "With no FILE, or when FILE is -, read standard input.\n"
 msgstr ""
 "\n"
-"Pokud SOUBOR není zadán nebo pokud je -, bude se číst ze standardního vstupu.\n"
+"Pokud SOUBOR není zadán nebo pokud je -, bude se číst ze standardního "
+"vstupu.\n"
 
 #. TRANSLATORS: This message indicates the bug reporting address
 #. for this package. Please add _another line_ saying
@@ -763,8 +824,11 @@ msgstr "Vybraný vyhledávač shod vyža
 
 #: src/xz/suffix.c:79 src/xz/suffix.c:164
 #, c-format
-msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
-msgstr "%s: S přepínačem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do standardního výstupu"
+msgid ""
+"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
+msgstr ""
+"%s: S přepínačem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do "
+"standardního výstupu"
 
 #: src/xz/suffix.c:99
 #, c-format
@@ -793,7 +857,9 @@ msgstr "%s: Neplatná jednotka s předpo
 
 #: src/xz/util.c:105
 msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
-msgstr "Platné jednotky s předponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a „GiB“ (2^30 B)."
+msgstr ""
+"Platné jednotky s předponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a "
+"„GiB“ (2^30 B)."
 
 #: src/xz/util.c:122
 #, c-format
@@ -827,37 +893,49 @@ msgstr "Neznámá chyba"
 #~ msgstr "%s MiB (%s bajtů)\n"
 
 #~ msgid ""
-#~ "  -e, --extreme       use more CPU time when encoding to increase compression\n"
+#~ "  -e, --extreme       use more CPU time when encoding to increase "
+#~ "compression\n"
 #~ "                      ratio without increasing memory usage of the decoder"
 #~ msgstr ""
-#~ " -e, --extreme         využít více procesorového času pro kódování, čímž se\n"
-#~ "                       zvýší kompresní poměr bez zvýšení paměti použité kodérem"
+#~ " -e, --extreme         využít více procesorového času pro kódování, čímž "
+#~ "se\n"
+#~ "                       zvýší kompresní poměr bez zvýšení paměti použité "
+#~ "kodérem"
 
 #~ msgid ""
-#~ "  -M, --memory=NUM    use roughly NUM bytes of memory at maximum; 0 indicates\n"
+#~ "  -M, --memory=NUM    use roughly NUM bytes of memory at maximum; 0 "
+#~ "indicates\n"
 #~ "                      the default setting, which is 40 % of total RAM"
 #~ msgstr ""
-#~ " -M, --memory=POČ      použít zhruba POČ bajtů paměti jako maximum; 0 znamená\n"
-#~ "                       výchozí nastavení, což je 40% celkového množství paměti"
+#~ " -M, --memory=POČ      použít zhruba POČ bajtů paměti jako maximum; 0 "
+#~ "znamená\n"
+#~ "                       výchozí nastavení, což je 40% celkového množství "
+#~ "paměti"
 
 #~ msgid ""
 #~ "\n"
-#~ "  --subblock[=OPTS]   Subblock filter; valid OPTS (valid values; default):\n"
+#~ "  --subblock[=OPTS]   Subblock filter; valid OPTS (valid values; "
+#~ "default):\n"
 #~ "                        size=NUM   number of bytes of data per subblock\n"
 #~ "                                   (1 - 256Mi; 4Ki)\n"
-#~ "                        rle=NUM    run-length encoder chunk size (0-256; 0)"
+#~ "                        rle=NUM    run-length encoder chunk size (0-256; "
+#~ "0)"
 #~ msgstr ""
 #~ "\n"
-#~ " --subblock[=VOLBY]    Subblokový filtr; platné VOLBY (platné hodnoty; výchozí):\n"
+#~ " --subblock[=VOLBY]    Subblokový filtr; platné VOLBY (platné hodnoty; "
+#~ "výchozí):\n"
 #~ "                         size=POČ   počet bajtů dat na subblok\n"
 #~ "                                    (1 - 256 Mi; 4 Ki)\n"
-#~ "                         rle=POČ    velikost dávky pro kodér run-length (0-256; 0)"
+#~ "                         rle=POČ    velikost dávky pro kodér run-length "
+#~ "(0-256; 0)"
 
 #~ msgid ""
-#~ "On this system and configuration, this program will use a maximum of roughly\n"
+#~ "On this system and configuration, this program will use a maximum of "
+#~ "roughly\n"
 #~ "%s MiB RAM and "
 #~ msgstr ""
-#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze zhruba\n"
+#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze "
+#~ "zhruba\n"
 #~ "%s MiB RAM a "
 
 #~ msgid ""

Modified: stable/8/contrib/xz/po/de.po
==============================================================================
--- stable/8/contrib/xz/po/de.po	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/po/de.po	Thu Mar  3 09:44:30 2011	(r219219)
@@ -6,11 +6,10 @@ msgid ""
 msgstr ""
 "Project-Id-Version: XZ Utils 4.999.9beta\n"
 "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
-"POT-Creation-Date: 2010-10-23 17:48+0300\n"
+"POT-Creation-Date: 2010-09-11 17:07+0200\n"
 "PO-Revision-Date: 2010-09-07 20:27+0200\n"
 "Last-Translator:  \n"
 "Language-Team: German\n"
-"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -28,7 +27,8 @@ msgstr "%s: Integritäts-Check Typ nicht
 
 #: src/xz/args.c:382
 msgid "Only one file can be specified with `--files' or `--files0'."
-msgstr "Nur ein file kann als Argument für --files oder --files0 angegeben werden."
+msgstr ""
+"Nur ein file kann als Argument für --files oder --files0 angegeben werden."
 
 #: src/xz/args.c:445
 #, c-format
@@ -41,7 +41,8 @@ msgstr "Maximal vier Filter möglich"
 
 #: src/xz/coder.c:108
 msgid "Memory usage limit is too low for the given filter setup."
-msgstr "Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration."
+msgstr ""
+"Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration."
 
 #: src/xz/coder.c:129
 msgid "Using a preset in raw mode is discouraged."
@@ -49,7 +50,9 @@ msgstr "Verwendung der Voreinstellung im
 
 #: src/xz/coder.c:131
 msgid "The exact options of the presets may vary between software versions."
-msgstr "Die genauen Optionen der Voreinstellung können zwischen Software Versionen variieren."
+msgstr ""
+"Die genauen Optionen der Voreinstellung können zwischen Software Versionen "
+"variieren."
 
 #: src/xz/coder.c:157
 msgid "The .lzma format supports only the LZMA1 filter"
@@ -70,8 +73,12 @@ msgstr "Dekompression wird %s MiB Speich
 
 #: src/xz/coder.c:247
 #, c-format
-msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
-msgstr "Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das Speicher Nutzungslimit von %s MiB zu übersteigen"
+msgid ""
+"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the "
+"memory usage limit of %s MiB"
+msgstr ""
+"Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das "
+"Speicher Nutzungslimit von %s MiB zu übersteigen"
 
 #. TRANSLATORS: When compression or decompression finishes,
 #. and xz is going to remove the source file, xz first checks
@@ -86,7 +93,8 @@ msgstr "Passte LZMA%c Wörterbuch Größ
 #: src/xz/file_io.c:137
 #, c-format
 msgid "%s: File seems to have been moved, not removing"
-msgstr "%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht"
+msgstr ""
+"%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht"
 
 #: src/xz/file_io.c:144 src/xz/file_io.c:590
 #, c-format
@@ -141,7 +149,8 @@ msgstr "%s: Eingabedatei hat mehr als ei
 #: src/xz/file_io.c:714
 #, c-format
 msgid "Error restoring the O_APPEND flag to standard output: %s"
-msgstr "Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s"
+msgstr ""
+"Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s"
 
 #: src/xz/file_io.c:726
 #, c-format
@@ -151,7 +160,8 @@ msgstr "%s: Fehler beim Schießen der Da
 #: src/xz/file_io.c:762 src/xz/file_io.c:946
 #, c-format
 msgid "%s: Seeking failed when trying to create a sparse file: %s"
-msgstr "%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s"
+msgstr ""
+"%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s"
 
 #: src/xz/file_io.c:821
 #, c-format
@@ -202,7 +212,7 @@ msgstr "Kein"
 #. but the Check ID is known (here 2). This and other "Unknown-N"
 #. strings are used in tables, so the width must not exceed ten
 #. columns with a fixed-width font. It's OK to omit the dash if
-#. you need space for one extra letter, but don't use spaces.
+#. you need space for one extra letter.
 #: src/xz/list.c:69
 msgid "Unknown-2"
 msgstr "Unbek.2"
@@ -310,10 +320,12 @@ msgstr "  Strom Auffüllung:    %s\n"
 #: src/xz/list.c:693
 msgid ""
 "  Streams:\n"
-"    Stream    Blocks      CompOffset    UncompOffset        CompSize      UncompSize  Ratio  Check      Padding"
+"    Stream    Blocks      CompOffset    UncompOffset        CompSize      "
+"UncompSize  Ratio  Check      Padding"
 msgstr ""
 "  Ströme:\n"
-"     Strom    Blöcke      KompOffset    UnkompOffset       KompGröße     UnkompGröße  Verh.  Check   Auffüllung"
+"     Strom    Blöcke      KompOffset    UnkompOffset       KompGröße     "
+"UnkompGröße  Verh.  Check   Auffüllung"
 
 #. TRANSLATORS: The second line is column headings. All
 #. except Check are right aligned; Check is left aligned.
@@ -321,10 +333,12 @@ msgstr ""
 #, c-format
 msgid ""
 "  Blocks:\n"
-"    Stream     Block      CompOffset    UncompOffset       TotalSize      UncompSize  Ratio  Check"
+"    Stream     Block      CompOffset    UncompOffset       TotalSize      "
+"UncompSize  Ratio  Check"
 msgstr ""
 "  Blöcke:\n"
-"     Strom     Block      KompOffset    UnkompOffset      TotalGröße     UnkompGröße  Verh.  Check"
+"     Strom     Block      KompOffset    UnkompOffset      TotalGröße     "
+"UnkompGröße  Verh.  Check"
 
 #. TRANSLATORS: These are additional column headings
 #. for the most verbose listing mode. CheckVal
@@ -376,7 +390,8 @@ msgstr "   Anzahl Dateien:     %s\n"
 
 #: src/xz/list.c:1072
 msgid "--list works only on .xz files (--format=xz or --format=auto)"
-msgstr "--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)"
+msgstr ""
+"--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)"
 
 #: src/xz/list.c:1078
 msgid "--list does not support reading from standard input"
@@ -394,69 +409,79 @@ msgstr "%s: Unerwartetes Ende beim Lesen
 
 #: src/xz/main.c:120
 #, c-format
-msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
-msgstr "%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--files0' statt `--files'?"
+msgid ""
+"%s: Null character found when reading filenames; maybe you meant to use `--"
+"files0' instead of `--files'?"
+msgstr ""
+"%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--"
+"files0' statt `--files'?"
 
 #: src/xz/main.c:174
 msgid "Compression and decompression with --robot are not supported yet."
 msgstr "Kompression und Dekompression mit --robot ist noch nicht unterstützt."
 
 #: src/xz/main.c:231
-msgid "Cannot read data from standard input when reading filenames from standard input"
-msgstr "Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von der Standardeingabe gelesen werden"
+msgid ""
+"Cannot read data from standard input when reading filenames from standard "
+"input"
+msgstr ""
+"Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von "
+"der Standardeingabe gelesen werden"
 
-#: src/xz/message.c:792 src/xz/message.c:842
+#: src/xz/message.c:800 src/xz/message.c:844
 msgid "Internal error (bug)"
 msgstr "Interner Fehler (Bug)"
 
-#: src/xz/message.c:799
+#: src/xz/message.c:807
 msgid "Cannot establish signal handlers"
 msgstr "Kann Signal Routine nicht setzen"
 
-#: src/xz/message.c:808
+#: src/xz/message.c:816
 msgid "No integrity check; not verifying file integrity"
 msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen"
 
-#: src/xz/message.c:811
+#: src/xz/message.c:819
 msgid "Unsupported type of integrity check; not verifying file integrity"
-msgstr "Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht überprüfen"
+msgstr ""
+"Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht "
+"überprüfen"
 
-#: src/xz/message.c:818
+#: src/xz/message.c:826
 msgid "Memory usage limit reached"
 msgstr "Speicher-Limit erreicht"
 
-#: src/xz/message.c:821
+#: src/xz/message.c:829
 msgid "File format not recognized"
 msgstr "Datei Format nicht erkannt"
 
-#: src/xz/message.c:824
+#: src/xz/message.c:832
 msgid "Unsupported options"
 msgstr "Optionen nicht unterstützt"
 
-#: src/xz/message.c:827
+#: src/xz/message.c:835
 msgid "Compressed data is corrupt"
 msgstr "Komprimierte Daten sind korrupt"
 
-#: src/xz/message.c:830
+#: src/xz/message.c:838
 msgid "Unexpected end of input"
 msgstr "Unerwartetes Eingabe Ende"
 
-#: src/xz/message.c:881
+#: src/xz/message.c:886
 #, c-format
 msgid "%s MiB of memory is required. The limit is %s."
 msgstr "%s MiB Speicher wird benötigt. Limit ist %s."
 
-#: src/xz/message.c:1048
+#: src/xz/message.c:1053
 #, c-format
 msgid "%s: Filter chain: %s\n"
 msgstr "%s: Filter Kette: %s\n"
 
-#: src/xz/message.c:1058
+#: src/xz/message.c:1063
 #, c-format
 msgid "Try `%s --help' for more information."
 msgstr "Versuchen Sie `%s --help' für mehr Informationen."
 
-#: src/xz/message.c:1084
+#: src/xz/message.c:1089
 #, c-format
 msgid ""
 "Usage: %s [OPTION]... [FILE]...\n"
@@ -467,17 +492,18 @@ msgstr ""
 "Komprimiert oder dekomprimiert .xz DATEI(EN).\n"
 "\n"
 
-#: src/xz/message.c:1091
-msgid "Mandatory arguments to long options are mandatory for short options too.\n"
+#: src/xz/message.c:1096
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
 msgstr ""
 "Obligatorische Argumente für lange Optionen sind auch für kurze Optionen\n"
 "zwingend.\n"
 
-#: src/xz/message.c:1095
+#: src/xz/message.c:1100
 msgid " Operation mode:\n"
 msgstr " Operationsmodus:\n"
 
-#: src/xz/message.c:1098
+#: src/xz/message.c:1103
 msgid ""
 "  -z, --compress      force compression\n"
 "  -d, --decompress    force decompression\n"
@@ -489,7 +515,7 @@ msgstr ""
 "  -t, --test            überprüfe Datei Integrität\n"
 "  -l, --list            liste Datei Informationen"
 
-#: src/xz/message.c:1104
+#: src/xz/message.c:1109
 msgid ""
 "\n"
 " Operation modifiers:\n"
@@ -497,7 +523,7 @@ msgstr ""
 "\n"
 " Operationsmodifikatoren:\n"
 
-#: src/xz/message.c:1107
+#: src/xz/message.c:1112
 msgid ""
 "  -k, --keep          keep (don't delete) input files\n"
 "  -f, --force         force overwrite of output file and (de)compress links\n"
@@ -509,13 +535,14 @@ msgstr ""
 "  -c, --stdout          schreibe nach Standard Output und lösche nicht die\n"
 "                        Eingabedateien"
 
-#: src/xz/message.c:1113
+#: src/xz/message.c:1118
 msgid ""
 "      --no-sparse     do not create sparse files when decompressing\n"
 "  -S, --suffix=.SUF   use the suffix `.SUF' on compressed files\n"
 "      --files[=FILE]  read filenames to process from FILE; if FILE is\n"
 "                      omitted, filenames are read from the standard input;\n"
-"                      filenames must be terminated with the newline character\n"
+"                      filenames must be terminated with the newline "
+"character\n"
 "      --files0[=FILE] like --files but use the null character as terminator"
 msgstr ""
 "      --no-sparse       erzeuge keine sparse Datei beim Dekomprimieren\n"
@@ -524,9 +551,10 @@ msgstr ""
 "                        DATEI nicht angegeben wurde, werden Dateinamen\n"
 "                        von Standard Input gelesen. Dateinamen müssen mit\n"
 "                        einem Zeilenumbruch voneinander getrennt werden\n"
-"      --files0=[DATEI]  wie --files, aber benutze den Null Charakter als Trenner"
+"      --files0=[DATEI]  wie --files, aber benutze den Null Charakter als "
+"Trenner"
 
-#: src/xz/message.c:1121
+#: src/xz/message.c:1126
 msgid ""
 "\n"
 " Basic file format and compression options:\n"
@@ -534,62 +562,76 @@ msgstr ""
 "\n"
 " Grundlegende Optionen für Dateiformat und Kompression:\n"
 
-#: src/xz/message.c:1123
+#: src/xz/message.c:1128
 msgid ""
 "  -F, --format=FMT    file format to encode or decode; possible values are\n"
 "                      `auto' (default), `xz', `lzma', and `raw'\n"
 "  -C, --check=CHECK   integrity check type: `none' (use with caution),\n"
 "                      `crc32', `crc64' (default), or `sha256'"
 msgstr ""
-"  -F, --format=FMT      Dateiformat zur Kodierung oder Dekodierung; mögliche\n"
-"                        Werte sind `auto' (Voreinstellung), `xz', `lzma' und\n"
+"  -F, --format=FMT      Dateiformat zur Kodierung oder Dekodierung; "
+"mögliche\n"
+"                        Werte sind `auto' (Voreinstellung), `xz', `lzma' "
+"und\n"
 "                        `raw'\n"
-"  -C, --check=CHECK     Typ des Integritätschecks: `none' (Vorsicht), `crc32',\n"
+"  -C, --check=CHECK     Typ des Integritätschecks: `none' (Vorsicht), "
+"`crc32',\n"
 "                        `crc64' (Voreinstellung), oder `sha256'"
 
-#: src/xz/message.c:1130
+#: src/xz/message.c:1135
 msgid ""
-"  -0 ... -9           compression preset; default is 6; take compressor *and*\n"
-"                      decompressor memory usage into account before using 7-9!"
-msgstr ""
-"  -0 .. -9              Kompressionseinstellung; Voreinstellung is 6. Beachten\n"
-"                        Sie den Speicherverbrauch des Komprimieres *und* des\n"
+"  -0 ... -9           compression preset; default is 6; take compressor "
+"*and*\n"
+"                      decompressor memory usage into account before using 7-"
+"9!"
+msgstr ""
+"  -0 .. -9              Kompressionseinstellung; Voreinstellung is 6. "
+"Beachten\n"
+"                        Sie den Speicherverbrauch des Komprimieres *und* "
+"des\n"
 "                        Dekomprimierers, wenn Sie 7-9 benutzen!"
 
-#: src/xz/message.c:1134
+#: src/xz/message.c:1139
 msgid ""
-"  -e, --extreme       try to improve compression ratio by using more CPU time;\n"
+"  -e, --extreme       try to improve compression ratio by using more CPU "
+"time;\n"
 "                      does not affect decompressor memory requirements"
 msgstr ""
-"  -e, --extreme         Versuche durch stärkere CPU Nutzung das Kompressions-\n"
+"  -e, --extreme         Versuche durch stärkere CPU Nutzung das "
+"Kompressions-\n"
 "                        verhältnis zu verbessern. Das beeinflusst nicht den\n"
 "                        Speicherbedarf des Dekomprimierers."
 
-#: src/xz/message.c:1139
+#: src/xz/message.c:1144
 #, no-c-format
 msgid ""

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

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 09:49:04 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 69C1D106566C;
	Thu,  3 Mar 2011 09:49:04 +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 3F2C28FC15;
	Thu,  3 Mar 2011 09:49:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p239n4r5016939;
	Thu, 3 Mar 2011 09:49:04 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p239n4St016938;
	Thu, 3 Mar 2011 09:49:04 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201103030949.p239n4St016938@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 3 Mar 2011 09:49:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219220 - stable/8/contrib/xz
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 09:49:04 -0000

Author: mm
Date: Thu Mar  3 09:49:03 2011
New Revision: 219220
URL: http://svn.freebsd.org/changeset/base/219220

Log:
  Delete wrong mergepoints.

Modified:
Directory Properties:
  stable/8/contrib/xz/AUTHORS   (props changed)
  stable/8/contrib/xz/COPYING   (props changed)
  stable/8/contrib/xz/FREEBSD-Xlist   (props changed)
  stable/8/contrib/xz/README   (props changed)
  stable/8/contrib/xz/TODO   (props changed)
  stable/8/contrib/xz/po/   (props changed)
  stable/8/contrib/xz/src/   (props changed)

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 11:52:08 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E5BA1065672;
	Thu,  3 Mar 2011 11:52:08 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C69B8FC2C;
	Thu,  3 Mar 2011 11:52:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23Bq8mB028412;
	Thu, 3 Mar 2011 11:52:08 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23Bq8O3028410;
	Thu, 3 Mar 2011 11:52:08 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <201103031152.p23Bq8O3028410@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 3 Mar 2011 11:52:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219226 - stable/8/sys/pc98/pc98
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 11:52:08 -0000

Author: nyan
Date: Thu Mar  3 11:52:07 2011
New Revision: 219226
URL: http://svn.freebsd.org/changeset/base/219226

Log:
  MFC: revision 218843
  
    To avoid excessive code duplication create wrapper for fill regs
    from stack frame.

Modified:
  stable/8/sys/pc98/pc98/machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/pc98/pc98/machdep.c
==============================================================================
--- stable/8/sys/pc98/pc98/machdep.c	Thu Mar  3 11:45:54 2011	(r219225)
+++ stable/8/sys/pc98/pc98/machdep.c	Thu Mar  3 11:52:07 2011	(r219226)
@@ -2432,6 +2432,13 @@ fill_regs(struct thread *td, struct reg 
 
 	tp = td->td_frame;
 	pcb = td->td_pcb;
+	regs->r_gs = pcb->pcb_gs;
+	return (fill_frame_regs(tp, regs));
+}
+
+int
+fill_frame_regs(struct trapframe *tp, struct reg *regs)
+{
 	regs->r_fs = tp->tf_fs;
 	regs->r_es = tp->tf_es;
 	regs->r_ds = tp->tf_ds;
@@ -2447,7 +2454,6 @@ fill_regs(struct thread *td, struct reg 
 	regs->r_eflags = tp->tf_eflags;
 	regs->r_esp = tp->tf_esp;
 	regs->r_ss = tp->tf_ss;
-	regs->r_gs = pcb->pcb_gs;
 	return (0);
 }
 

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 14:31:40 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E8EFD1065670;
	Thu,  3 Mar 2011 14:31:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D6EFF8FC0A;
	Thu,  3 Mar 2011 14:31:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23EVep1040666;
	Thu, 3 Mar 2011 14:31:40 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23EVeVu040664;
	Thu, 3 Mar 2011 14:31:40 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103031431.p23EVeVu040664@svn.freebsd.org>
From: Glen Barber 
Date: Thu, 3 Mar 2011 14:31:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219227 - stable/8/share/man/man4
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 14:31:41 -0000

Author: gjb (doc committer)
Date: Thu Mar  3 14:31:40 2011
New Revision: 219227
URL: http://svn.freebsd.org/changeset/base/219227

Log:
  MFC 216074[1], 219086:
  
  Fix device name in usb_quirk(4).
  
  PR:		155074
  Obtained from:	ru [1]

Modified:
  stable/8/share/man/man4/usb_quirk.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/usb_quirk.4
==============================================================================
--- stable/8/share/man/man4/usb_quirk.4	Thu Mar  3 11:52:07 2011	(r219226)
+++ stable/8/share/man/man4/usb_quirk.4	Thu Mar  3 14:31:40 2011	(r219227)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 9, 2010
+.Dd February 27, 2011
 .Dt USB_QUIRK 4
 .Os
 .Sh NAME
@@ -27,7 +27,7 @@ To compile this module into the kernel,
 place the following line in your
 kernel configuration file:
 .Bd -ragged -offset indent
-.Cd "device ucom"
+.Cd "device usb_quirk"
 .Ed
 .Pp
 Alternatively, to load the module at boot
@@ -183,7 +183,6 @@ device which appears as a USB device on
 usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT
 .Ed
 .Sh SEE ALSO
-.Xr usb_quirk 4 ,
 .Xr usbconfig 5
 .Sh HISTORY
 The

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 16:58:00 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D025106566B;
	Thu,  3 Mar 2011 16:58:00 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EF0508FC1C;
	Thu,  3 Mar 2011 16:57:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23Gvx8S053219;
	Thu, 3 Mar 2011 16:57:59 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23GvxJF053218;
	Thu, 3 Mar 2011 16:57:59 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <201103031657.p23GvxJF053218@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 3 Mar 2011 16:57:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219230 - stable/8/cddl/contrib/dtracetoolkit
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:58:00 -0000

Author: rwatson
Date: Thu Mar  3 16:57:59 2011
New Revision: 219230
URL: http://svn.freebsd.org/changeset/base/219230

Log:
  Merge r211786 from head to stable/8:
  
    Port dtruss to FreeBSD.
  
    Sponsored by:	The FreeBSD Foundation
  
  Reported by:	Nikolay Denev 
  Original commit by:	rpaulo

Modified:
  stable/8/cddl/contrib/dtracetoolkit/dtruss
Directory Properties:
  stable/8/cddl/contrib/dtracetoolkit/   (props changed)

Modified: stable/8/cddl/contrib/dtracetoolkit/dtruss
==============================================================================
--- stable/8/cddl/contrib/dtracetoolkit/dtruss	Thu Mar  3 16:16:49 2011	(r219229)
+++ stable/8/cddl/contrib/dtracetoolkit/dtruss	Thu Mar  3 16:57:59 2011	(r219230)
@@ -1,4 +1,4 @@
-#!/usr/bin/sh
+#!/bin/sh
 #
 # dtruss - print process system call time details.
 #          Written using DTrace (Solaris 10 3/05).
@@ -240,7 +240,7 @@ syscall:::entry
  */
 
 /* print 3 args, return as hex */
-syscall::lwp_sigmask:return
+syscall::sigprocmask:return
 /self->start/
 {
 	/* calculate elapsed time */
@@ -268,10 +268,11 @@ syscall::lwp_sigmask:return
 }
 
 /* print 3 args, arg0 as a string */
+syscall::access*:return,
 syscall::stat*:return, 
 syscall::lstat*:return, 
-syscall::open*:return,
-syscall::resolvepath:return
+syscall::readlink*:return,
+syscall::open*:return
 /self->start/
 {
 	/* calculate elapsed time */
@@ -329,7 +330,6 @@ syscall::*read*:return
 }
 
 /* print 0 arg output */
-syscall::gtime:return,
 syscall::*fork*:return
 /self->start/
 {
@@ -357,9 +357,6 @@ syscall::*fork*:return
 }
 
 /* print 1 arg output */
-syscall::brk:return,
-syscall::times:return,
-syscall::stime:return,
 syscall::close:return
 /self->start/
 {
@@ -387,7 +384,7 @@ syscall::close:return
 }
 
 /* print 2 arg output */
-syscall::utime:return,
+syscall::utimes:return,
 syscall::munmap:return
 /self->start/
 {

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 16:58:55 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D5951065687;
	Thu,  3 Mar 2011 16:58:55 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 667F68FC1A;
	Thu,  3 Mar 2011 16:58:55 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 0C5CE46B2D;
	Thu,  3 Mar 2011 11:58:55 -0500 (EST)
Date: Thu, 3 Mar 2011 16:58:54 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Nikolay Denev 
In-Reply-To: <8748736E-CD0A-4002-88C6-0D4090013C9C@gmail.com>
Message-ID: 
References: <201102282328.p1SNSZZK059958@svn.freebsd.org>
	<8748736E-CD0A-4002-88C6-0D4090013C9C@gmail.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219107 - in stable/8/sys: amd64/amd64 amd64/include
 boot/common cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys
 cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol...
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:58:55 -0000


On Wed, 2 Mar 2011, Nikolay Denev wrote:

> On 1 Mar, 2011, at 01:28 , Robert Watson wrote:
>
>> Author: rwatson Date: Mon Feb 28 23:28:35 2011 New Revision: 219107 URL: 
>> http://svn.freebsd.org/changeset/base/219107
>>
>> Log:
>>  Merge userspace DTrace support from head to stable/8:
>
> It seems that the dtruss script in RELENG_8 has "/usr/bin/sh" as 
> interpreter. This appears to be fixed in head.

Ni Nikolay:

Indeed, I was unaware of the userspace changes in cddl/contrib/dtracetoolkit, 
so I've now merged r211786 to stable/8 as 219230.  Could you give it a try and 
let me know how that works out for you?

Thanks,

Robert Watson
University of Cambridge
Computer Laboratory

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 16:58:59 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 703B0106568A;
	Thu,  3 Mar 2011 16:58:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 46CD88FC2D;
	Thu,  3 Mar 2011 16:58:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23GwxkG053311;
	Thu, 3 Mar 2011 16:58:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23GwxvJ053309;
	Thu, 3 Mar 2011 16:58:59 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031658.p23GwxvJ053309@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 16:58:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219231 - stable/8/sys/sys
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:58:59 -0000

Author: jhb
Date: Thu Mar  3 16:58:58 2011
New Revision: 219231
URL: http://svn.freebsd.org/changeset/base/219231

Log:
  MFC 218270:
  Use M_WAITOK rather than M_NOWAIT when creating taskqueues via the
  TASKQUEUE_DEFINE macros.  All the places that use these macros to create
  taskqueues assume that the operation succeeds.

Modified:
  stable/8/sys/sys/taskqueue.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/sys/taskqueue.h
==============================================================================
--- stable/8/sys/sys/taskqueue.h	Thu Mar  3 16:57:59 2011	(r219230)
+++ stable/8/sys/sys/taskqueue.h	Thu Mar  3 16:58:58 2011	(r219231)
@@ -94,7 +94,7 @@ static void								\
 taskqueue_define_##name(void *arg)					\
 {									\
 	taskqueue_##name =						\
-	    taskqueue_create(#name, M_NOWAIT, (enqueue), (context));	\
+	    taskqueue_create(#name, M_WAITOK, (enqueue), (context));	\
 	init;								\
 }									\
 									\
@@ -118,7 +118,7 @@ static void								\
 taskqueue_define_##name(void *arg)					\
 {									\
 	taskqueue_##name =						\
-	    taskqueue_create_fast(#name, M_NOWAIT, (enqueue),		\
+	    taskqueue_create_fast(#name, M_WAITOK, (enqueue),		\
 	    (context));							\
 	init;								\
 }									\

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 16:59:20 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FFE1106591C;
	Thu,  3 Mar 2011 16:59:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7EAA38FC18;
	Thu,  3 Mar 2011 16:59:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23GxK6x053368;
	Thu, 3 Mar 2011 16:59:20 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23GxKra053366;
	Thu, 3 Mar 2011 16:59:20 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031659.p23GxKra053366@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 16:59:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219232 - stable/7/sys/sys
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:59:20 -0000

Author: jhb
Date: Thu Mar  3 16:59:20 2011
New Revision: 219232
URL: http://svn.freebsd.org/changeset/base/219232

Log:
  MFC 218270:
  Use M_WAITOK rather than M_NOWAIT when creating taskqueues via the
  TASKQUEUE_DEFINE macros.  All the places that use these macros to create
  taskqueues assume that the operation succeeds.

Modified:
  stable/7/sys/sys/taskqueue.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sys/taskqueue.h
==============================================================================
--- stable/7/sys/sys/taskqueue.h	Thu Mar  3 16:58:58 2011	(r219231)
+++ stable/7/sys/sys/taskqueue.h	Thu Mar  3 16:59:20 2011	(r219232)
@@ -96,7 +96,7 @@ static void								\
 taskqueue_define_##name(void *arg)					\
 {									\
 	taskqueue_##name =						\
-	    taskqueue_create(#name, M_NOWAIT, (enqueue), (context));	\
+	    taskqueue_create(#name, M_WAITOK, (enqueue), (context));	\
 	init;								\
 }									\
 									\
@@ -120,7 +120,7 @@ static void								\
 taskqueue_define_##name(void *arg)					\
 {									\
 	taskqueue_##name =						\
-	    taskqueue_create_fast(#name, M_NOWAIT, (enqueue),		\
+	    taskqueue_create_fast(#name, M_WAITOK, (enqueue),		\
 	    (context));							\
 	init;								\
 }									\

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 17:04:45 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 974151065674;
	Thu,  3 Mar 2011 17:04:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 85ACC8FC0A;
	Thu,  3 Mar 2011 17:04:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23H4jsq053847;
	Thu, 3 Mar 2011 17:04:45 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23H4jcf053845;
	Thu, 3 Mar 2011 17:04:45 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031704.p23H4jcf053845@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 17:04:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219233 - stable/7/sys/kern
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:04:45 -0000

Author: jhb
Date: Thu Mar  3 17:04:45 2011
New Revision: 219233
URL: http://svn.freebsd.org/changeset/base/219233

Log:
  MFC 200761,218272:
  Always assert that the turnstile chain lock is held in turnstile_wait()
  and remove a duplicate hash lookup.

Modified:
  stable/7/sys/kern/subr_turnstile.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/subr_turnstile.c
==============================================================================
--- stable/7/sys/kern/subr_turnstile.c	Thu Mar  3 16:59:20 2011	(r219232)
+++ stable/7/sys/kern/subr_turnstile.c	Thu Mar  3 17:04:45 2011	(r219233)
@@ -687,8 +687,8 @@ turnstile_wait(struct turnstile *ts, str
 	 * turnstile already in use by this lock.
 	 */
 	tc = TC_LOOKUP(ts->ts_lockobj);
-	if (ts == td->td_turnstile) {
 	mtx_assert(&tc->tc_lock, MA_OWNED);
+	if (ts == td->td_turnstile) {
 #ifdef TURNSTILE_PROFILING
 		tc->tc_depth++;
 		if (tc->tc_depth > tc->tc_max_depth) {
@@ -697,7 +697,6 @@ turnstile_wait(struct turnstile *ts, str
 				turnstile_max_depth = tc->tc_max_depth;
 		}
 #endif
-		tc = TC_LOOKUP(ts->ts_lockobj);
 		LIST_INSERT_HEAD(&tc->tc_turnstiles, ts, ts_hash);
 		KASSERT(TAILQ_EMPTY(&ts->ts_pending),
 		    ("thread's turnstile has pending threads"));

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 17:04:58 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0BF78106575F;
	Thu,  3 Mar 2011 17:04:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A1F888FC14;
	Thu,  3 Mar 2011 17:04:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23H4vPO053910;
	Thu, 3 Mar 2011 17:04:57 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23H4vog053908;
	Thu, 3 Mar 2011 17:04:57 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031704.p23H4vog053908@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 17:04:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219234 - stable/8/sys/kern
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:04:58 -0000

Author: jhb
Date: Thu Mar  3 17:04:57 2011
New Revision: 219234
URL: http://svn.freebsd.org/changeset/base/219234

Log:
  MFC 200761,218272:
  Always assert that the turnstile chain lock is held in turnstile_wait()
  and remove a duplicate hash lookup.

Modified:
  stable/8/sys/kern/subr_turnstile.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/subr_turnstile.c
==============================================================================
--- stable/8/sys/kern/subr_turnstile.c	Thu Mar  3 17:04:45 2011	(r219233)
+++ stable/8/sys/kern/subr_turnstile.c	Thu Mar  3 17:04:57 2011	(r219234)
@@ -685,8 +685,8 @@ turnstile_wait(struct turnstile *ts, str
 	 * turnstile already in use by this lock.
 	 */
 	tc = TC_LOOKUP(ts->ts_lockobj);
-	if (ts == td->td_turnstile) {
 	mtx_assert(&tc->tc_lock, MA_OWNED);
+	if (ts == td->td_turnstile) {
 #ifdef TURNSTILE_PROFILING
 		tc->tc_depth++;
 		if (tc->tc_depth > tc->tc_max_depth) {
@@ -695,7 +695,6 @@ turnstile_wait(struct turnstile *ts, str
 				turnstile_max_depth = tc->tc_max_depth;
 		}
 #endif
-		tc = TC_LOOKUP(ts->ts_lockobj);
 		LIST_INSERT_HEAD(&tc->tc_turnstiles, ts, ts_hash);
 		KASSERT(TAILQ_EMPTY(&ts->ts_pending),
 		    ("thread's turnstile has pending threads"));

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 17:10:49 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 584B4106566B;
	Thu,  3 Mar 2011 17:10:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 46CFF8FC18;
	Thu,  3 Mar 2011 17:10:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23HAnDE054623;
	Thu, 3 Mar 2011 17:10:49 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23HAndv054621;
	Thu, 3 Mar 2011 17:10:49 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031710.p23HAndv054621@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 17:10:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219235 - stable/8/sys/conf
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:10:49 -0000

Author: jhb
Date: Thu Mar  3 17:10:48 2011
New Revision: 219235
URL: http://svn.freebsd.org/changeset/base/219235

Log:
  MFC 218290: Correct include path.

Modified:
  stable/8/sys/conf/files
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Thu Mar  3 17:04:57 2011	(r219234)
+++ stable/8/sys/conf/files	Thu Mar  3 17:10:48 2011	(r219235)
@@ -924,7 +924,7 @@ dev/e1000/e1000_82543.c		optional em | i
 dev/e1000/e1000_82571.c		optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82575.c		optional em | igb \
-	 compile-with "${NORMAL_C} -I$S/dev/igb"
+	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_ich8lan.c	optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_api.c		optional em | igb \

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 17:11:12 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0FECC1065679;
	Thu,  3 Mar 2011 17:11:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F2D3D8FC0C;
	Thu,  3 Mar 2011 17:11:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23HBBtg054711;
	Thu, 3 Mar 2011 17:11:11 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23HBBHL054709;
	Thu, 3 Mar 2011 17:11:11 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031711.p23HBBHL054709@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 17:11:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219236 - stable/7/sys/conf
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:11:12 -0000

Author: jhb
Date: Thu Mar  3 17:11:11 2011
New Revision: 219236
URL: http://svn.freebsd.org/changeset/base/219236

Log:
  MFC 218290: Correct include path.

Modified:
  stable/7/sys/conf/files
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/conf/files
==============================================================================
--- stable/7/sys/conf/files	Thu Mar  3 17:10:48 2011	(r219235)
+++ stable/7/sys/conf/files	Thu Mar  3 17:11:11 2011	(r219236)
@@ -799,7 +799,7 @@ dev/e1000/e1000_82543.c		optional em | i
 dev/e1000/e1000_82571.c		optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82575.c		optional em | igb \
-	 compile-with "${NORMAL_C} -I$S/dev/igb"
+	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_ich8lan.c	optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_api.c		optional em | igb \

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 17:12:24 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9F531065675;
	Thu,  3 Mar 2011 17:12:24 +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 982398FC1F;
	Thu,  3 Mar 2011 17:12:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23HCO6Z054841;
	Thu, 3 Mar 2011 17:12:24 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23HCO8H054839;
	Thu, 3 Mar 2011 17:12:24 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201103031712.p23HCO8H054839@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Thu, 3 Mar 2011 17:12:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219237 - stable/8/libexec/rtld-elf
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:12:24 -0000

Author: jh
Date: Thu Mar  3 17:12:24 2011
New Revision: 219237
URL: http://svn.freebsd.org/changeset/base/219237

Log:
  MFC r216489:
  
  If dlclose() is called recursively from a _fini() function, the inner
  dlclose() call may unload the object of the outer call prematurely
  because objects are unreferenced before _fini() calls.
  
  Fix this by unreferencing objects after calling objlist_call_fini() in
  dlclose(). Therefore objlist_call_fini() now calls the fini function if
  the reference count of an object is 1. In addition we must restart the
  list_fini traversal after every _fini() call because another dlclose()
  call might have modified the reference counts.
  
  Add an XXX comment to objlist_call_fini() about possible race with
  dlopen().
  
  PR:		133246, 149464

Modified:
  stable/8/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/8/libexec/rtld-elf/   (props changed)

Modified: stable/8/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/8/libexec/rtld-elf/rtld.c	Thu Mar  3 17:11:11 2011	(r219236)
+++ stable/8/libexec/rtld-elf/rtld.c	Thu Mar  3 17:12:24 2011	(r219237)
@@ -107,7 +107,7 @@ static int load_needed_objects(Obj_Entry
 static int load_preload_objects(void);
 static Obj_Entry *load_object(const char *, const Obj_Entry *, int);
 static Obj_Entry *obj_from_addr(const void *);
-static void objlist_call_fini(Objlist *, bool, int *);
+static void objlist_call_fini(Objlist *, Obj_Entry *, int *);
 static void objlist_call_init(Objlist *, int *);
 static void objlist_clear(Objlist *);
 static Objlist_Entry *objlist_find(Objlist *, const Obj_Entry *);
@@ -1616,36 +1616,56 @@ obj_from_addr(const void *addr)
 
 /*
  * Call the finalization functions for each of the objects in "list"
- * which are unreferenced.  All of the objects are expected to have
- * non-NULL fini functions.
+ * belonging to the DAG of "root" and referenced once. If NULL "root"
+ * is specified, every finalization function will be called regardless
+ * of the reference count and the list elements won't be freed. All of
+ * the objects are expected to have non-NULL fini functions.
  */
 static void
-objlist_call_fini(Objlist *list, bool force, int *lockstate)
+objlist_call_fini(Objlist *list, Obj_Entry *root, int *lockstate)
 {
-    Objlist_Entry *elm, *elm_tmp;
+    Objlist_Entry *elm;
     char *saved_msg;
 
+    assert(root == NULL || root->refcount == 1);
+
     /*
      * Preserve the current error message since a fini function might
      * call into the dynamic linker and overwrite it.
      */
     saved_msg = errmsg_save();
-    STAILQ_FOREACH_SAFE(elm, list, link, elm_tmp) {
-	if (elm->obj->refcount == 0 || force) {
+    do {
+	STAILQ_FOREACH(elm, list, link) {
+	    if (root != NULL && (elm->obj->refcount != 1 ||
+	      objlist_find(&root->dagmembers, elm->obj) == NULL))
+		continue;
 	    dbg("calling fini function for %s at %p", elm->obj->path,
 	        (void *)elm->obj->fini);
 	    LD_UTRACE(UTRACE_FINI_CALL, elm->obj, (void *)elm->obj->fini, 0, 0,
 		elm->obj->path);
 	    /* Remove object from fini list to prevent recursive invocation. */
 	    STAILQ_REMOVE(list, elm, Struct_Objlist_Entry, link);
+	    /*
+	     * XXX: If a dlopen() call references an object while the
+	     * fini function is in progress, we might end up trying to
+	     * unload the referenced object in dlclose() or the object
+	     * won't be unloaded although its fini function has been
+	     * called.
+	     */
 	    wlock_release(rtld_bind_lock, *lockstate);
 	    call_initfini_pointer(elm->obj, elm->obj->fini);
 	    *lockstate = wlock_acquire(rtld_bind_lock);
 	    /* No need to free anything if process is going down. */
-	    if (!force)
+	    if (root != NULL)
 	    	free(elm);
+	    /*
+	     * We must restart the list traversal after every fini call
+	     * because a dlclose() call from the fini function or from
+	     * another thread might have modified the reference counts.
+	     */
+	    break;
 	}
-    }
+    } while (elm != NULL);
     errmsg_restore(saved_msg);
 }
 
@@ -1833,7 +1853,7 @@ rtld_exit(void)
 
     lockstate = wlock_acquire(rtld_bind_lock);
     dbg("rtld_exit()");
-    objlist_call_fini(&list_fini, true, &lockstate);
+    objlist_call_fini(&list_fini, NULL, &lockstate);
     /* No need to remove the items from the list, since we are exiting. */
     if (!libmap_disable)
         lm_fini();
@@ -1946,20 +1966,22 @@ dlclose(void *handle)
     /* Unreference the object and its dependencies. */
     root->dl_refcount--;
 
-    unref_dag(root);
-
-    if (root->refcount == 0) {
+    if (root->refcount == 1) {
 	/*
-	 * The object is no longer referenced, so we must unload it.
+	 * The object will be no longer referenced, so we must unload it.
 	 * First, call the fini functions.
 	 */
-	objlist_call_fini(&list_fini, false, &lockstate);
+	objlist_call_fini(&list_fini, root, &lockstate);
+
+	unref_dag(root);
 
 	/* Finish cleaning up the newly-unreferenced objects. */
 	GDB_STATE(RT_DELETE,&root->linkmap);
 	unload_object(root);
 	GDB_STATE(RT_CONSISTENT,NULL);
-    }
+    } else
+	unref_dag(root);
+
     LD_UTRACE(UTRACE_DLCLOSE_STOP, handle, NULL, 0, 0, NULL);
     wlock_release(rtld_bind_lock, lockstate);
     return 0;

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 18:16:35 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB062106564A;
	Thu,  3 Mar 2011 18:16:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9FAC18FC08;
	Thu,  3 Mar 2011 18:16:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23IGZnh060564;
	Thu, 3 Mar 2011 18:16:35 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23IGZPM060561;
	Thu, 3 Mar 2011 18:16:35 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031816.p23IGZPM060561@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 18:16:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219239 - in stable/8/share/man: man5 man7
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:16:35 -0000

Author: jhb
Date: Thu Mar  3 18:16:35 2011
New Revision: 219239
URL: http://svn.freebsd.org/changeset/base/219239

Log:
  MFC 200597,200599:
  Docmuent NO_KERNEL{CLEAN,CONFIG,DEPEND,OBJ} as necessary.  Update
  documentation on KERNFAST meaning.

Modified:
  stable/8/share/man/man5/make.conf.5
  stable/8/share/man/man7/build.7
Directory Properties:
  stable/8/share/man/man5/   (props changed)
  stable/8/share/man/man7/   (props changed)

Modified: stable/8/share/man/man5/make.conf.5
==============================================================================
--- stable/8/share/man/man5/make.conf.5	Thu Mar  3 17:33:22 2011	(r219238)
+++ stable/8/share/man/man5/make.conf.5	Thu Mar  3 18:16:35 2011	(r219239)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 5, 2006
+.Dd December 15, 2009
 .Dt MAKE.CONF 5
 .Os
 .Sh NAME
@@ -369,6 +369,12 @@ It defaults to
 .It Va MODULES_OVERRIDE
 .Pq Vt str
 Set to a list of modules to build instead of all of them.
+.It Va NO_KERNELCLEAN
+.Pq Vt bool
+Set this to skip running
+.Dq Li "${MAKE} clean"
+during
+.Dq Li "${MAKE} buildkernel" .
 .It Va NO_KERNELCONFIG
 .Pq Vt bool
 Set this to skip running
@@ -381,6 +387,12 @@ Set this to skip running
 .Dq Li "${MAKE} depend"
 during
 .Dq Li "${MAKE} buildkernel" .
+.It Va NO_KERNELOBJ
+.Pq Vt bool
+Set this to skip running
+.Dq Li "${MAKE} obj"
+during
+.Dq Li "${MAKE} buildkernel" .
 .It Va NO_MODULES
 .Pq Vt bool
 Set to not build modules with the kernel.

Modified: stable/8/share/man/man7/build.7
==============================================================================
--- stable/8/share/man/man7/build.7	Thu Mar  3 17:33:22 2011	(r219238)
+++ stable/8/share/man/man7/build.7	Thu Mar  3 18:16:35 2011	(r219239)
@@ -359,9 +359,10 @@ If set, the build target
 .Cm buildkernel
 defaults to setting 
 .Va NO_KERNELCLEAN ,
-.Va NO_KERNELCONFIG
+.Va NO_KERNELCONFIG ,
+.Va NO_KERNELDEPEND 
 and
-.Va NO_KERNELDEPEND .
+.Va NO_KERNELOBJ .
 When set to a value other than
 .Cm 1
 then 
@@ -458,6 +459,12 @@ If set, the build process does not run
 as part of the
 .Cm buildkernel
 target.
+.It Va NO_KERNELOBJ
+If set, the build process does not run
+.Dq make obj
+as part of the
+.Cm buildkernel
+target.
 .It Va NO_DOCUPDATE
 If set, the update process does not update the source of the
 .Fx

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 18:49:47 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04F441065674;
	Thu,  3 Mar 2011 18:49:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E7B5A8FC08;
	Thu,  3 Mar 2011 18:49:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23Inka8062388;
	Thu, 3 Mar 2011 18:49:46 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23Inkxq062386;
	Thu, 3 Mar 2011 18:49:46 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031849.p23Inkxq062386@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 18:49:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219244 - stable/8/share/man/man7
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:49:47 -0000

Author: jhb
Date: Thu Mar  3 18:49:46 2011
New Revision: 219244
URL: http://svn.freebsd.org/changeset/base/219244

Log:
  MFC 217733: Properly document what the top-level `make tinderbox` does.

Modified:
  stable/8/share/man/man7/build.7
Directory Properties:
  stable/8/share/man/man7/   (props changed)

Modified: stable/8/share/man/man7/build.7
==============================================================================
--- stable/8/share/man/man7/build.7	Thu Mar  3 18:42:53 2011	(r219243)
+++ stable/8/share/man/man7/build.7	Thu Mar  3 18:49:46 2011	(r219244)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 31, 2010
+.Dd January 22, 2011
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -229,6 +229,11 @@ This command takes a long time.
 .It Cm update
 Get updated sources as configured in
 .Xr make.conf 5 .
+.It Cm tinderbox
+Execute the same targets as
+.Cm universe .
+In addition print a summary of all failed targets at the end and
+exit with an error if there were any.
 .El
 .Pp
 Kernel specific build targets in

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 18:52:13 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E36F1065670;
	Thu,  3 Mar 2011 18:52:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1BEBB8FC13;
	Thu,  3 Mar 2011 18:52:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23IqDHt062611;
	Thu, 3 Mar 2011 18:52:13 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23IqCUo062608;
	Thu, 3 Mar 2011 18:52:12 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031852.p23IqCUo062608@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 18:52:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219245 - in stable/8: . share/man/man7
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:52:13 -0000

Author: jhb
Date: Thu Mar  3 18:52:11 2011
New Revision: 219245
URL: http://svn.freebsd.org/changeset/base/219245

Log:
  MFC 216487,217754,218524:
  - Pass JFLAG as JFLAG from tinderbox to universe.
  - For `make tinderbox` there is no need to print the extra commands.
  - Add a new UNIVERSE_TARGET variable for 'make universe'.  If it is set,
    then that target is invoked for each architecture rather than the
    default action of building world and kernels for each architecture.
  - Add a 'make toolchains' wrapper which uses UNIVERSE_TARGET to build
    toolchains for all architectures.
  - Document JFLAG, MAKE_JUST_KERNELS, and MAKE_JUST_WORLDS variables for
    'make universe'.

Modified:
  stable/8/Makefile   (contents, props changed)
  stable/8/share/man/man7/build.7
Directory Properties:
  stable/8/share/man/man7/   (props changed)

Modified: stable/8/Makefile
==============================================================================
--- stable/8/Makefile	Thu Mar  3 18:49:46 2011	(r219244)
+++ stable/8/Makefile	Thu Mar  3 18:52:11 2011	(r219245)
@@ -25,6 +25,7 @@
 # delete-old-dirs     - Delete obsolete directories.
 # delete-old-files    - Delete obsolete files.
 # delete-old-libs     - Delete obsolete libraries.
+# toolchains          - Build a toolchain for all world and kernel targets.
 #
 # This makefile is simple by design. The FreeBSD make automatically reads
 # the /usr/share/mk/sys.mk unless the -m argument is specified on the
@@ -268,8 +269,10 @@ make: .PHONY
 		${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
 
 tinderbox:
-	cd ${.CURDIR} && \
-		DOING_TINDERBOX=YES ${MAKE} ${JFLAG} universe
+	@cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe
+
+toolchains:
+	@cd ${.CURDIR} && ${MAKE} UNIVERSE_TARGET=toolchain universe
 
 #
 # universe
@@ -281,6 +284,12 @@ tinderbox:
 .if make(universe) || make(universe_kernels) || make(tinderbox)
 TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v
 
+.if defined(UNIVERSE_TARGET)
+MAKE_JUST_WORLDS=	YES
+.else
+UNIVERSE_TARGET?=	buildworld
+.endif
+
 .if defined(DOING_TINDERBOX)
 FAILFILE=tinderbox.failed
 MAKEFAIL=tee -a ${FAILFILE}
@@ -294,21 +303,22 @@ universe_prologue:
 	@echo ">>> make universe started on ${STARTTIME}"
 	@echo "--------------------------------------------------------------"
 .if defined(DOING_TINDERBOX)
-	rm -f ${FAILFILE}
+	@rm -f ${FAILFILE}
 .endif
 .for target in ${TARGETS}
 universe: universe_${target}
 .ORDER: universe_prologue universe_${target} universe_epilogue
 universe_${target}:
-.if !defined(MAKE_JUST_KERNELS)
 	@echo ">> ${target} started on `LC_ALL=C date`"
+.if !defined(MAKE_JUST_KERNELS)
+	@echo ">> ${target} ${UNIVERSE_TARGET} started on `LC_ALL=C date`"
 	@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
-	    ${MAKE} ${JFLAG} buildworld \
+	    ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \
 	    TARGET=${target} \
-	    > _.${target}.buildworld 2>&1 || \
-	    (echo "${target} world failed," \
-	    "check _.${target}.buildworld for details" | ${MAKEFAIL}))
-	@echo ">> ${target} buildworld completed on `LC_ALL=C date`"
+	    > _.${target}.${UNIVERSE_TARGET} 2>&1 || \
+	    (echo "${target} ${UNIVERSE_TARGET} failed," \
+	    "check _.${target}.${UNIVERSE_TARGET} for details" | ${MAKEFAIL}))
+	@echo ">> ${target} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`"
 .endif
 .if !defined(MAKE_JUST_WORLDS)
 .if exists(${.CURDIR}/sys/${target}/conf/NOTES)

Modified: stable/8/share/man/man7/build.7
==============================================================================
--- stable/8/share/man/man7/build.7	Thu Mar  3 18:49:46 2011	(r219244)
+++ stable/8/share/man/man7/build.7	Thu Mar  3 18:52:11 2011	(r219245)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 22, 2011
+.Dd February 10, 2011
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -218,13 +218,14 @@ on how to make it start at boot time.
 Create the build toolchain needed to build the rest of the system.
 For cross-architecture builds, this step creates a cross-toolchain.
 .It Cm universe
-Execute a
+For each architecture,
+execute a
 .Cm buildworld
-and
+followed by a
 .Cm buildkernel
-for all kernels including
-.Pa LINT ,
-for each architecture supported by the build system.
+for all kernels for that architecture,
+including
+.Pa LINT .
 This command takes a long time.
 .It Cm update
 Get updated sources as configured in
@@ -234,6 +235,8 @@ Execute the same targets as
 .Cm universe .
 In addition print a summary of all failed targets at the end and
 exit with an error if there were any.
+.It Cm toolchains
+Create a build toolchain for each architecture supported by the build system.
 .El
 .Pp
 Kernel specific build targets in
@@ -493,6 +496,29 @@ If set, restricts the documentation buil
 specified as its content.
 The default action is to build documentation for all languages.
 .El
+.Pp
+Builds using the
+.Cm universe
+target are influenced by the following
+.Xr make 1
+variables:
+.Bl -tag -width ".Va MAKE_JUST_KERNELS"
+.It Va JFLAG
+Pass the value of this variable to each
+.Xr make 1
+invocation used to build worlds and kernels.
+This can be used to enable multiple jobs within a single architecture's build
+while still building each architecture serially.
+.It Va MAKE_JUST_KERNELS
+Only build kernels for each supported architecture.
+.It Va MAKE_JUST_WORLDS
+Only build worlds for each supported architecture.
+.It Va UNIVERSE_TARGET
+Execute the specified
+.Xr make 1
+target for each supported architecture instead of the default action of
+building a world and one or more kernels.
+.El
 .Sh FILES
 .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
 .It Pa /usr/doc/Makefile

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 19:55:16 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E2721065679;
	Thu,  3 Mar 2011 19:55:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2A3E48FC17;
	Thu,  3 Mar 2011 19:55:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23JtGPW067828;
	Thu, 3 Mar 2011 19:55:16 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23JtGqR067826;
	Thu, 3 Mar 2011 19:55:16 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031955.p23JtGqR067826@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 19:55:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219246 - stable/8/usr.bin/truss
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:55:16 -0000

Author: jhb
Date: Thu Mar  3 19:55:15 2011
New Revision: 219246
URL: http://svn.freebsd.org/changeset/base/219246

Log:
  MFC 218707: Properly check for errors from waitpid().

Modified:
  stable/8/usr.bin/truss/setup.c
Directory Properties:
  stable/8/usr.bin/truss/   (props changed)

Modified: stable/8/usr.bin/truss/setup.c
==============================================================================
--- stable/8/usr.bin/truss/setup.c	Thu Mar  3 18:52:11 2011	(r219245)
+++ stable/8/usr.bin/truss/setup.c	Thu Mar  3 19:55:15 2011	(r219246)
@@ -83,7 +83,7 @@ setup_and_wait(char *command[])
 	}
 	
 	/* Only in the parent here */
-	if (waitpid(pid, &waitval, 0) < -1) {
+	if (waitpid(pid, &waitval, 0) < 0) {
 		err(1, "unexpect stop in waitpid");
 		return 0;
 	}
@@ -114,7 +114,7 @@ start_tracing(int pid)
 		err(1, "can not attach to target process");
 
 	child_pid = pid;	
-	if (waitpid(pid, &waitval, 0) < -1) 
+	if (waitpid(pid, &waitval, 0) < 0) 
 		err(1, "Unexpect stop in waitpid");
 
 	return (0);
@@ -133,7 +133,7 @@ restore_proc(int signo __unused)
 
 	/* stop the child so that we can detach */	
 	kill(child_pid, SIGSTOP);
-	if (waitpid(child_pid, &waitval, 0) < -1)
+	if (waitpid(child_pid, &waitval, 0) < 0)
 		err(1, "Unexpected stop in waitpid");
 
 	if (ptrace(PT_DETACH, child_pid, (caddr_t)1, 0) < 0)
@@ -183,7 +183,7 @@ waitevent(struct trussinfo *info)
 	ptrace(PT_SYSCALL, info->pid, (caddr_t)1, pending_signal);
 	pending_signal = 0;
 
-	if (waitpid(info->pid, &waitval, 0) < -1) {
+	if (waitpid(info->pid, &waitval, 0) < 0) {
 		err(1, "Unexpected stop in waitpid");
 	}
 	

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 19:55:25 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8DD7C1065767;
	Thu,  3 Mar 2011 19:55:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 33DDD8FC19;
	Thu,  3 Mar 2011 19:55:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23JtNjB067896;
	Thu, 3 Mar 2011 19:55:23 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23JtNCW067894;
	Thu, 3 Mar 2011 19:55:23 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031955.p23JtNCW067894@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 19:55:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219247 - stable/7/usr.bin/truss
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:55:25 -0000

Author: jhb
Date: Thu Mar  3 19:55:22 2011
New Revision: 219247
URL: http://svn.freebsd.org/changeset/base/219247

Log:
  MFC 218707: Properly check for errors from waitpid().

Modified:
  stable/7/usr.bin/truss/setup.c
Directory Properties:
  stable/7/usr.bin/truss/   (props changed)

Modified: stable/7/usr.bin/truss/setup.c
==============================================================================
--- stable/7/usr.bin/truss/setup.c	Thu Mar  3 19:55:15 2011	(r219246)
+++ stable/7/usr.bin/truss/setup.c	Thu Mar  3 19:55:22 2011	(r219247)
@@ -83,7 +83,7 @@ setup_and_wait(char *command[])
 	}
 	
 	/* Only in the parent here */
-	if (waitpid(pid, &waitval, 0) < -1) {
+	if (waitpid(pid, &waitval, 0) < 0) {
 		err(1, "unexpect stop in waitpid");
 		return 0;
 	}
@@ -114,7 +114,7 @@ start_tracing(int pid)
 		err(1, "can not attach to target process");
 
 	child_pid = pid;	
-	if (waitpid(pid, &waitval, 0) < -1) 
+	if (waitpid(pid, &waitval, 0) < 0) 
 		err(1, "Unexpect stop in waitpid");
 
 	return (0);
@@ -133,7 +133,7 @@ restore_proc(int signo __unused)
 
 	/* stop the child so that we can detach */	
 	kill(child_pid, SIGSTOP);
-	if (waitpid(child_pid, &waitval, 0) < -1)
+	if (waitpid(child_pid, &waitval, 0) < 0)
 		err(1, "Unexpected stop in waitpid");
 
 	if (ptrace(PT_DETACH, child_pid, (caddr_t)1, 0) < 0)
@@ -183,7 +183,7 @@ waitevent(struct trussinfo *info)
 	ptrace(PT_SYSCALL, info->pid, (caddr_t)1, pending_signal);
 	pending_signal = 0;
 
-	if (waitpid(info->pid, &waitval, 0) < -1) {
+	if (waitpid(info->pid, &waitval, 0) < 0) {
 		err(1, "Unexpected stop in waitpid");
 	}
 	

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 19:57:39 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 235A1106564A;
	Thu,  3 Mar 2011 19:57:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EC9858FC14;
	Thu,  3 Mar 2011 19:57:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23Jvcfg068363;
	Thu, 3 Mar 2011 19:57:38 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23Jvct3068361;
	Thu, 3 Mar 2011 19:57:38 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031957.p23Jvct3068361@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 19:57:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219248 - stable/8/usr.sbin/nfsd
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:57:39 -0000

Author: jhb
Date: Thu Mar  3 19:57:38 2011
New Revision: 219248
URL: http://svn.freebsd.org/changeset/base/219248

Log:
  MFC 218777:
  Save a copy of errno before invoking syslog() if accept() or select() fail.
  syslog() can trash the errno value causing nfsd to exit for non-fatal
  errors like ECONNABORTED from accept().

Modified:
  stable/8/usr.sbin/nfsd/nfsd.c
Directory Properties:
  stable/8/usr.sbin/nfsd/   (props changed)

Modified: stable/8/usr.sbin/nfsd/nfsd.c
==============================================================================
--- stable/8/usr.sbin/nfsd/nfsd.c	Thu Mar  3 19:55:22 2011	(r219247)
+++ stable/8/usr.sbin/nfsd/nfsd.c	Thu Mar  3 19:57:38 2011	(r219248)
@@ -134,7 +134,7 @@ main(int argc, char **argv)
 	socklen_t len;
 	int on = 1, unregister, reregister, sock;
 	int tcp6sock, ip6flag, tcpflag, tcpsock;
-	int udpflag, ecode, s, srvcnt;
+	int udpflag, ecode, error, s, srvcnt;
 	int bindhostc, bindanyflag, rpcbreg, rpcbregcnt;
 	int stablefd, nfssvc_addsock;
 	char **bindhost = NULL;
@@ -738,8 +738,9 @@ main(int argc, char **argv)
 		if (connect_type_cnt > 1) {
 			if (select(maxsock + 1,
 			    &ready, NULL, NULL, NULL) < 1) {
+				error = errno;
 				syslog(LOG_ERR, "select failed: %m");
-				if (errno == EINTR)
+				if (error == EINTR)
 					continue;
 				nfsd_exit(1);
 			}
@@ -750,9 +751,10 @@ main(int argc, char **argv)
 					len = sizeof(inetpeer);
 					if ((msgsock = accept(tcpsock,
 					    (struct sockaddr *)&inetpeer, &len)) < 0) {
+						error = errno;
 						syslog(LOG_ERR, "accept failed: %m");
-						if (errno == ECONNABORTED ||
-						    errno == EINTR)
+						if (error == ECONNABORTED ||
+						    error == EINTR)
 							continue;
 						nfsd_exit(1);
 					}
@@ -772,10 +774,11 @@ main(int argc, char **argv)
 					if ((msgsock = accept(tcpsock,
 					    (struct sockaddr *)&inet6peer,
 					    &len)) < 0) {
+						error = errno;
 						syslog(LOG_ERR,
 						     "accept failed: %m");
-						if (errno == ECONNABORTED ||
-						    errno == EINTR)
+						if (error == ECONNABORTED ||
+						    error == EINTR)
 							continue;
 						nfsd_exit(1);
 					}

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 19:57:50 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 632AC1065781;
	Thu,  3 Mar 2011 19:57:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 381468FC18;
	Thu,  3 Mar 2011 19:57:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23Jvovm068425;
	Thu, 3 Mar 2011 19:57:50 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23JvonL068423;
	Thu, 3 Mar 2011 19:57:50 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031957.p23JvonL068423@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 19:57:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219249 - stable/7/usr.sbin/nfsd
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:57:50 -0000

Author: jhb
Date: Thu Mar  3 19:57:49 2011
New Revision: 219249
URL: http://svn.freebsd.org/changeset/base/219249

Log:
  MFC 218777:
  Save a copy of errno before invoking syslog() if accept() or select() fail.
  syslog() can trash the errno value causing nfsd to exit for non-fatal
  errors like ECONNABORTED from accept().

Modified:
  stable/7/usr.sbin/nfsd/nfsd.c
Directory Properties:
  stable/7/usr.sbin/nfsd/   (props changed)

Modified: stable/7/usr.sbin/nfsd/nfsd.c
==============================================================================
--- stable/7/usr.sbin/nfsd/nfsd.c	Thu Mar  3 19:57:38 2011	(r219248)
+++ stable/7/usr.sbin/nfsd/nfsd.c	Thu Mar  3 19:57:49 2011	(r219249)
@@ -128,7 +128,7 @@ main(int argc, char **argv)
 	socklen_t len;
 	int on = 1, unregister, reregister, sock;
 	int tcp6sock, ip6flag, tcpflag, tcpsock;
-	int udpflag, ecode, s, srvcnt;
+	int udpflag, ecode, error, s, srvcnt;
 	int bindhostc, bindanyflag, rpcbreg, rpcbregcnt;
 	char **bindhost = NULL;
 	pid_t pid;
@@ -652,8 +652,9 @@ main(int argc, char **argv)
 		if (connect_type_cnt > 1) {
 			if (select(maxsock + 1,
 			    &ready, NULL, NULL, NULL) < 1) {
+				error = errno;
 				syslog(LOG_ERR, "select failed: %m");
-				if (errno == EINTR)
+				if (error == EINTR)
 					continue;
 				nfsd_exit(1);
 			}
@@ -664,9 +665,10 @@ main(int argc, char **argv)
 					len = sizeof(inetpeer);
 					if ((msgsock = accept(tcpsock,
 					    (struct sockaddr *)&inetpeer, &len)) < 0) {
+						error = errno;
 						syslog(LOG_ERR, "accept failed: %m");
-						if (errno == ECONNABORTED ||
-						    errno == EINTR)
+						if (error == ECONNABORTED ||
+						    error == EINTR)
 							continue;
 						nfsd_exit(1);
 					}
@@ -686,10 +688,11 @@ main(int argc, char **argv)
 					if ((msgsock = accept(tcpsock,
 					    (struct sockaddr *)&inet6peer,
 					    &len)) < 0) {
+						error = errno;
 						syslog(LOG_ERR,
 						     "accept failed: %m");
-						if (errno == ECONNABORTED ||
-						    errno == EINTR)
+						if (error == ECONNABORTED ||
+						    error == EINTR)
 							continue;
 						nfsd_exit(1);
 					}

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 20:13:44 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B3C21065670;
	Thu,  3 Mar 2011 20:13:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 494EB8FC13;
	Thu,  3 Mar 2011 20:13:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23KDicH070277;
	Thu, 3 Mar 2011 20:13:44 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23KDiHU070275;
	Thu, 3 Mar 2011 20:13:44 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103032013.p23KDiHU070275@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 20:13:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219250 - stable/8/sys/dev/pci
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 20:13:44 -0000

Author: jhb
Date: Thu Mar  3 20:13:44 2011
New Revision: 219250
URL: http://svn.freebsd.org/changeset/base/219250

Log:
  MFC 218968:
  Properly handle BARs bigger than 4G.  The '1' was treated as an int
  causing the size calculation to be truncated to the size of an int
  (32-bits on all current architectures).

Modified:
  stable/8/sys/dev/pci/pci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/pci/pci.c
==============================================================================
--- stable/8/sys/dev/pci/pci.c	Thu Mar  3 19:57:49 2011	(r219249)
+++ stable/8/sys/dev/pci/pci.c	Thu Mar  3 20:13:44 2011	(r219250)
@@ -2499,13 +2499,13 @@ pci_add_map(device_t bus, device_t dev, 
 			return (barlen);
 	}
 
-	count = 1 << mapsize;
+	count = (pci_addr_t)1 << mapsize;
 	if (basezero || base == pci_mapbase(testval)) {
 		start = 0;	/* Let the parent decide. */
 		end = ~0ULL;
 	} else {
 		start = base;
-		end = base + (1 << mapsize) - 1;
+		end = base + count - 1;
 	}
 	resource_list_add(rl, type, reg, start, end, count);
 
@@ -3680,7 +3680,7 @@ pci_alloc_map(device_t dev, device_t chi
 	 * another driver, which won't work.
 	 */
 	mapsize = pci_mapsize(testval);
-	count = 1UL << mapsize;
+	count = (pci_addr_t)1 << mapsize;
 	if (RF_ALIGNMENT(flags) < mapsize)
 		flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
 	if (PCI_BAR_MEM(testval) && (testval & PCIM_BAR_MEM_PREFETCH))

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 20:14:00 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD62A10656D8;
	Thu,  3 Mar 2011 20:14:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A6F818FC12;
	Thu,  3 Mar 2011 20:14:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23KE0ui070339;
	Thu, 3 Mar 2011 20:14:00 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23KE0P7070337;
	Thu, 3 Mar 2011 20:14:00 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103032014.p23KE0P7070337@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 20:14:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219251 - stable/7/sys/dev/pci
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 20:14:00 -0000

Author: jhb
Date: Thu Mar  3 20:14:00 2011
New Revision: 219251
URL: http://svn.freebsd.org/changeset/base/219251

Log:
  MFC 218968:
  Properly handle BARs bigger than 4G.  The '1' was treated as an int
  causing the size calculation to be truncated to the size of an int
  (32-bits on all current architectures).

Modified:
  stable/7/sys/dev/pci/pci.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/pci/pci.c
==============================================================================
--- stable/7/sys/dev/pci/pci.c	Thu Mar  3 20:13:44 2011	(r219250)
+++ stable/7/sys/dev/pci/pci.c	Thu Mar  3 20:14:00 2011	(r219251)
@@ -2469,13 +2469,13 @@ pci_add_map(device_t bus, device_t dev, 
 			return (barlen);
 	}
 
-	count = 1 << mapsize;
+	count = (pci_addr_t)1 << mapsize;
 	if (basezero || base == pci_mapbase(testval)) {
 		start = 0;	/* Let the parent decide. */
 		end = ~0ULL;
 	} else {
 		start = base;
-		end = base + (1 << mapsize) - 1;
+		end = base + count - 1;
 	}
 	resource_list_add(rl, type, reg, start, end, count);
 
@@ -3524,7 +3524,7 @@ pci_alloc_map(device_t dev, device_t chi
 	 * another driver, which won't work.
 	 */
 	mapsize = pci_mapsize(testval);
-	count = 1UL << mapsize;
+	count = (pci_addr_t)1 << mapsize;
 	if (RF_ALIGNMENT(flags) < mapsize)
 		flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
 	if (PCI_BAR_MEM(testval) && (testval & PCIM_BAR_MEM_PREFETCH))

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 21:56:08 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 947161065672;
	Thu,  3 Mar 2011 21:56:08 +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 688308FC0C;
	Thu,  3 Mar 2011 21:56:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23Lu83L080938;
	Thu, 3 Mar 2011 21:56:08 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23Lu8WC080935;
	Thu, 3 Mar 2011 21:56:08 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201103032156.p23Lu8WC080935@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 3 Mar 2011 21:56:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219253 - in stable/8/cddl/contrib/opensolaris/cmd:
	zpool ztest
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 21:56:08 -0000

Author: mm
Date: Thu Mar  3 21:56:08 2011
New Revision: 219253
URL: http://svn.freebsd.org/changeset/base/219253

Log:
  MFC r212067, r214623
  
  MFC r212067 (pjd):
  Eliminate confusing while () loop. In the first version of the code it was
  there to avoid gotos, but in the current version it serves no purpose.
  
  MFC r214623 (pjd):
  Fix ztest when it is executed by just 'ztest' and not by full path
  '/usr/bin/ztest'.

Modified:
  stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==============================================================================
--- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Thu Mar  3 20:41:59 2011	(r219252)
+++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Thu Mar  3 21:56:08 2011	(r219253)
@@ -3347,20 +3347,19 @@ is_root_pool(zpool_handle_t *zhp)
 	static boolean_t stated = B_FALSE;
 	char *slash;
 
-	while (!stated) {
+	if (!stated) {
 		stated = B_TRUE;
 		if (statfs("/", &sfs) == -1) {
 			(void) fprintf(stderr,
 			    "Unable to stat root file system: %s.\n",
 			    strerror(errno));
-			break;
+			return (0);
 		}
 		if (strcmp(sfs.f_fstypename, "zfs") != 0)
-			break;
+			return (0);
 		poolname = sfs.f_mntfromname;
 		if ((slash = strchr(poolname, '/')) != NULL)
 			*slash = '\0';
-		break;
 	}
 	return (poolname != NULL && strcmp(poolname, zpool_get_name(zhp)) == 0);
 }

Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Thu Mar  3 20:41:59 2011	(r219252)
+++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Thu Mar  3 21:56:08 2011	(r219253)
@@ -3362,8 +3362,7 @@ ztest_verify_blocks(char *pool)
 	int isalen;
 	FILE *fp;
 
-	if (realpath(progname, zdb) == NULL)
-		assert(!"realpath() failed");
+	strlcpy(zdb, "/usr/bin/ztest", sizeof(zdb));
 
 	/* zdb lives in /usr/sbin, while ztest lives in /usr/bin */
 	bin = strstr(zdb, "/usr/bin/");

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 22:08:51 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C44D11065673;
	Thu,  3 Mar 2011 22:08:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A7DFC8FC16;
	Thu,  3 Mar 2011 22:08:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23M8puI082133;
	Thu, 3 Mar 2011 22:08:51 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23M8pxM082130;
	Thu, 3 Mar 2011 22:08:51 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103032208.p23M8pxM082130@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 22:08:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219254 - in stable/8/sys: kern sys
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 22:08:51 -0000

Author: jhb
Date: Thu Mar  3 22:08:51 2011
New Revision: 219254
URL: http://svn.freebsd.org/changeset/base/219254

Log:
  MFC 218969:
  Expose the umtx_key structure and API to the rest of the kernel.

Modified:
  stable/8/sys/kern/kern_umtx.c
  stable/8/sys/sys/umtx.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/kern_umtx.c
==============================================================================
--- stable/8/sys/kern/kern_umtx.c	Thu Mar  3 21:56:08 2011	(r219253)
+++ stable/8/sys/kern/kern_umtx.c	Thu Mar  3 22:08:51 2011	(r219254)
@@ -58,38 +58,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
-#define TYPE_SIMPLE_WAIT	0
-#define TYPE_CV			1
-#define TYPE_SIMPLE_LOCK	2
-#define TYPE_NORMAL_UMUTEX	3
-#define TYPE_PI_UMUTEX		4
-#define TYPE_PP_UMUTEX		5
-#define TYPE_RWLOCK		6
-
 #define _UMUTEX_TRY		1
 #define _UMUTEX_WAIT		2
 
-/* Key to represent a unique userland synchronous object */
-struct umtx_key {
-	int	hash;
-	int	type;
-	int	shared;
-	union {
-		struct {
-			vm_object_t	object;
-			uintptr_t	offset;
-		} shared;
-		struct {
-			struct vmspace	*vs;
-			uintptr_t	addr;
-		} private;
-		struct {
-			void		*a;
-			uintptr_t	b;
-		} both;
-	} info;
-};
-
 /* Priority inheritance mutex info. */
 struct umtx_pi {
 	/* Owner thread */
@@ -185,10 +156,6 @@ struct umtxq_chain {
 #define	UMTX_CHAINS		128
 #define	UMTX_SHIFTS		(__WORD_BIT - 7)
 
-#define THREAD_SHARE		0
-#define PROCESS_SHARE		1
-#define AUTO_SHARE		2
-
 #define	GET_SHARE(flags)	\
     (((flags) & USYNC_PROCESS_SHARED) == 0 ? THREAD_SHARE : PROCESS_SHARE)
 
@@ -214,10 +181,6 @@ static void umtxq_insert_queue(struct um
 static void umtxq_remove_queue(struct umtx_q *uq, int q);
 static int umtxq_sleep(struct umtx_q *uq, const char *wmesg, int timo);
 static int umtxq_count(struct umtx_key *key);
-static int umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2);
-static int umtx_key_get(void *addr, int type, int share,
-	struct umtx_key *key);
-static void umtx_key_release(struct umtx_key *key);
 static struct umtx_pi *umtx_pi_alloc(int);
 static void umtx_pi_free(struct umtx_pi *pi);
 static void umtx_pi_adjust_locked(struct thread *td, u_char oldpri);
@@ -280,14 +243,6 @@ umtxq_hash(struct umtx_key *key)
 	key->hash = ((n * GOLDEN_RATIO_PRIME) >> UMTX_SHIFTS) % UMTX_CHAINS;
 }
 
-static inline int
-umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
-{
-	return (k1->type == k2->type &&
-		k1->info.both.a == k2->info.both.a &&
-	        k1->info.both.b == k2->info.both.b);
-}
-
 static inline struct umtxq_chain *
 umtxq_getchain(struct umtx_key *key)
 {
@@ -500,7 +455,7 @@ umtxq_sleep(struct umtx_q *uq, const cha
 /*
  * Convert userspace address into unique logical address.
  */
-static int
+int
 umtx_key_get(void *addr, int type, int share, struct umtx_key *key)
 {
 	struct thread *td = curthread;
@@ -546,7 +501,7 @@ umtx_key_get(void *addr, int type, int s
 /*
  * Release key.
  */
-static inline void
+void
 umtx_key_release(struct umtx_key *key)
 {
 	if (key->shared)

Modified: stable/8/sys/sys/umtx.h
==============================================================================
--- stable/8/sys/sys/umtx.h	Thu Mar  3 21:56:08 2011	(r219253)
+++ stable/8/sys/sys/umtx.h	Thu Mar  3 22:08:51 2011	(r219254)
@@ -190,8 +190,58 @@ umtx_wake(u_long *p, int nr_wakeup)
 
 #else
 
+/*
+ * The umtx_key structure is used by both the Linux futex code and the
+ * umtx implementation to map userland addresses to unique keys.
+ */
+
+enum {
+	TYPE_SIMPLE_WAIT,
+	TYPE_CV,
+	TYPE_SIMPLE_LOCK,
+	TYPE_NORMAL_UMUTEX,
+	TYPE_PI_UMUTEX,
+	TYPE_PP_UMUTEX,
+	TYPE_RWLOCK,
+};
+
+/* Key to represent a unique userland synchronous object */
+struct umtx_key {
+	int	hash;
+	int	type;
+	int	shared;
+	union {
+		struct {
+			struct vm_object *object;
+			uintptr_t	offset;
+		} shared;
+		struct {
+			struct vmspace	*vs;
+			uintptr_t	addr;
+		} private;
+		struct {
+			void		*a;
+			uintptr_t	b;
+		} both;
+	} info;
+};
+
+#define THREAD_SHARE		0
+#define PROCESS_SHARE		1
+#define AUTO_SHARE		2
+
 struct thread;
 
+static inline int
+umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
+{
+	return (k1->type == k2->type &&
+		k1->info.both.a == k2->info.both.a &&
+	        k1->info.both.b == k2->info.both.b);
+}
+
+int umtx_key_get(void *, int, int, struct umtx_key *);
+void umtx_key_release(struct umtx_key *);
 struct umtx_q *umtxq_alloc(void);
 void umtxq_free(struct umtx_q *);
 int kern_umtx_wake(struct thread *, void *, int, int);

From owner-svn-src-stable@FreeBSD.ORG  Thu Mar  3 22:09:10 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81B771065694;
	Thu,  3 Mar 2011 22:09:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F4018FC1A;
	Thu,  3 Mar 2011 22:09:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23M9Abi082193;
	Thu, 3 Mar 2011 22:09:10 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23M9Amr082190;
	Thu, 3 Mar 2011 22:09:10 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103032209.p23M9Amr082190@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 22:09:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219255 - in stable/7/sys: kern sys
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 22:09:10 -0000

Author: jhb
Date: Thu Mar  3 22:09:10 2011
New Revision: 219255
URL: http://svn.freebsd.org/changeset/base/219255

Log:
  MFC 218969:
  Expose the umtx_key structure and API to the rest of the kernel.

Modified:
  stable/7/sys/kern/kern_umtx.c
  stable/7/sys/sys/umtx.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/kern_umtx.c
==============================================================================
--- stable/7/sys/kern/kern_umtx.c	Thu Mar  3 22:08:51 2011	(r219254)
+++ stable/7/sys/kern/kern_umtx.c	Thu Mar  3 22:09:10 2011	(r219255)
@@ -58,38 +58,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
-#define TYPE_SIMPLE_WAIT	0
-#define TYPE_CV			1
-#define TYPE_SIMPLE_LOCK	2
-#define TYPE_NORMAL_UMUTEX	3
-#define TYPE_PI_UMUTEX		4
-#define TYPE_PP_UMUTEX		5
-#define TYPE_RWLOCK		6
-
 #define _UMUTEX_TRY		1
 #define _UMUTEX_WAIT		2
 
-/* Key to represent a unique userland synchronous object */
-struct umtx_key {
-	int	hash;
-	int	type;
-	int	shared;
-	union {
-		struct {
-			vm_object_t	object;
-			uintptr_t	offset;
-		} shared;
-		struct {
-			struct vmspace	*vs;
-			uintptr_t	addr;
-		} private;
-		struct {
-			void		*a;
-			uintptr_t	b;
-		} both;
-	} info;
-};
-
 /* Priority inheritance mutex info. */
 struct umtx_pi {
 	/* Owner thread */
@@ -185,10 +156,6 @@ struct umtxq_chain {
 #define	UMTX_CHAINS		128
 #define	UMTX_SHIFTS		(__WORD_BIT - 7)
 
-#define THREAD_SHARE		0
-#define PROCESS_SHARE		1
-#define AUTO_SHARE		2
-
 #define	GET_SHARE(flags)	\
     (((flags) & USYNC_PROCESS_SHARED) == 0 ? THREAD_SHARE : PROCESS_SHARE)
 
@@ -214,10 +181,6 @@ static void umtxq_insert_queue(struct um
 static void umtxq_remove_queue(struct umtx_q *uq, int q);
 static int umtxq_sleep(struct umtx_q *uq, const char *wmesg, int timo);
 static int umtxq_count(struct umtx_key *key);
-static int umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2);
-static int umtx_key_get(void *addr, int type, int share,
-	struct umtx_key *key);
-static void umtx_key_release(struct umtx_key *key);
 static struct umtx_pi *umtx_pi_alloc(int);
 static void umtx_pi_free(struct umtx_pi *pi);
 static void umtx_pi_adjust_locked(struct thread *td, u_char oldpri);
@@ -280,14 +243,6 @@ umtxq_hash(struct umtx_key *key)
 	key->hash = ((n * GOLDEN_RATIO_PRIME) >> UMTX_SHIFTS) % UMTX_CHAINS;
 }
 
-static inline int
-umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
-{
-	return (k1->type == k2->type &&
-		k1->info.both.a == k2->info.both.a &&
-	        k1->info.both.b == k2->info.both.b);
-}
-
 static inline struct umtxq_chain *
 umtxq_getchain(struct umtx_key *key)
 {
@@ -500,7 +455,7 @@ umtxq_sleep(struct umtx_q *uq, const cha
 /*
  * Convert userspace address into unique logical address.
  */
-static int
+int
 umtx_key_get(void *addr, int type, int share, struct umtx_key *key)
 {
 	struct thread *td = curthread;
@@ -546,7 +501,7 @@ umtx_key_get(void *addr, int type, int s
 /*
  * Release key.
  */
-static inline void
+void
 umtx_key_release(struct umtx_key *key)
 {
 	if (key->shared)

Modified: stable/7/sys/sys/umtx.h
==============================================================================
--- stable/7/sys/sys/umtx.h	Thu Mar  3 22:08:51 2011	(r219254)
+++ stable/7/sys/sys/umtx.h	Thu Mar  3 22:09:10 2011	(r219255)
@@ -190,8 +190,58 @@ umtx_wake(u_long *p, int nr_wakeup)
 
 #else
 
+/*
+ * The umtx_key structure is used by both the Linux futex code and the
+ * umtx implementation to map userland addresses to unique keys.
+ */
+
+enum {
+	TYPE_SIMPLE_WAIT,
+	TYPE_CV,
+	TYPE_SIMPLE_LOCK,
+	TYPE_NORMAL_UMUTEX,
+	TYPE_PI_UMUTEX,
+	TYPE_PP_UMUTEX,
+	TYPE_RWLOCK,
+};
+
+/* Key to represent a unique userland synchronous object */
+struct umtx_key {
+	int	hash;
+	int	type;
+	int	shared;
+	union {
+		struct {
+			struct vm_object *object;
+			uintptr_t	offset;
+		} shared;
+		struct {
+			struct vmspace	*vs;
+			uintptr_t	addr;
+		} private;
+		struct {
+			void		*a;
+			uintptr_t	b;
+		} both;
+	} info;
+};
+
+#define THREAD_SHARE		0
+#define PROCESS_SHARE		1
+#define AUTO_SHARE		2
+
 struct thread;
 
+static inline int
+umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
+{
+	return (k1->type == k2->type &&
+		k1->info.both.a == k2->info.both.a &&
+	        k1->info.both.b == k2->info.both.b);
+}
+
+int umtx_key_get(void *, int, int, struct umtx_key *);
+void umtx_key_release(struct umtx_key *);
 struct umtx_q *umtxq_alloc(void);
 void umtxq_free(struct umtx_q *);
 int kern_umtx_wake(struct thread *, void *, int, int);

From owner-svn-src-stable@FreeBSD.ORG  Fri Mar  4 12:18:51 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3F73E1065676;
	Fri,  4 Mar 2011 12:18:51 +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 2DBE38FC20;
	Fri,  4 Mar 2011 12:18:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24CIpaJ031213;
	Fri, 4 Mar 2011 12:18:51 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24CIpJ3031212;
	Fri, 4 Mar 2011 12:18:51 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201103041218.p24CIpJ3031212@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Fri, 4 Mar 2011 12:18:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219263 - stable/8/usr.sbin/mfiutil
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 12:18:51 -0000

Author: pluknet
Date: Fri Mar  4 12:18:50 2011
New Revision: 219263
URL: http://svn.freebsd.org/changeset/base/219263

Log:
  MFC r219031:
  
   Fix division by zero, causing floating point exception in a drive progress
   command.
  
  Approved by:	avg (mentor), kib (mentor)

Modified:
  stable/8/usr.sbin/mfiutil/mfi_cmd.c
Directory Properties:
  stable/8/usr.sbin/mfiutil/   (props changed)

Modified: stable/8/usr.sbin/mfiutil/mfi_cmd.c
==============================================================================
--- stable/8/usr.sbin/mfiutil/mfi_cmd.c	Fri Mar  4 12:02:32 2011	(r219262)
+++ stable/8/usr.sbin/mfiutil/mfi_cmd.c	Fri Mar  4 12:18:50 2011	(r219263)
@@ -316,7 +316,7 @@ mfi_display_progress(const char *label, 
 
 	printf("%s: %.2f%% complete, after %ds", label,
 	    (float)prog->progress * 100 / 0xffff, prog->elapsed_seconds);
-	if (prog->elapsed_seconds > 10) {
+	if (prog->progress != 0 && prog->elapsed_seconds > 10) {
 		printf(" finished in ");
 		seconds = (0x10000 * (uint32_t)prog->elapsed_seconds) /
 		    prog->progress - prog->elapsed_seconds;

From owner-svn-src-stable@FreeBSD.ORG  Fri Mar  4 12:20:14 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A4BC106564A;
	Fri,  4 Mar 2011 12:20:14 +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 888508FC17;
	Fri,  4 Mar 2011 12:20:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24CKExW031303;
	Fri, 4 Mar 2011 12:20:14 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24CKEM6031301;
	Fri, 4 Mar 2011 12:20:14 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201103041220.p24CKEM6031301@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Fri, 4 Mar 2011 12:20:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219264 - stable/7/usr.sbin/mfiutil
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 12:20:14 -0000

Author: pluknet
Date: Fri Mar  4 12:20:14 2011
New Revision: 219264
URL: http://svn.freebsd.org/changeset/base/219264

Log:
  MFC r219031:
  
   Fix division by zero, causing floating point exception in a drive progress
   command.
  
  Approved by:	avg (mentor), kib (mentor)

Modified:
  stable/7/usr.sbin/mfiutil/mfi_cmd.c
Directory Properties:
  stable/7/usr.sbin/mfiutil/   (props changed)

Modified: stable/7/usr.sbin/mfiutil/mfi_cmd.c
==============================================================================
--- stable/7/usr.sbin/mfiutil/mfi_cmd.c	Fri Mar  4 12:18:50 2011	(r219263)
+++ stable/7/usr.sbin/mfiutil/mfi_cmd.c	Fri Mar  4 12:20:14 2011	(r219264)
@@ -316,7 +316,7 @@ mfi_display_progress(const char *label, 
 
 	printf("%s: %.2f%% complete, after %ds", label,
 	    (float)prog->progress * 100 / 0xffff, prog->elapsed_seconds);
-	if (prog->elapsed_seconds > 10) {
+	if (prog->progress != 0 && prog->elapsed_seconds > 10) {
 		printf(" finished in ");
 		seconds = (0x10000 * (uint32_t)prog->elapsed_seconds) /
 		    prog->progress - prog->elapsed_seconds;

From owner-svn-src-stable@FreeBSD.ORG  Fri Mar  4 20:26:35 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EECE71065672;
	Fri,  4 Mar 2011 20:26:35 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C35AC8FC17;
	Fri,  4 Mar 2011 20:26:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24KQZSN053076;
	Fri, 4 Mar 2011 20:26:35 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24KQZEL053073;
	Fri, 4 Mar 2011 20:26:35 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103042026.p24KQZEL053073@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 4 Mar 2011 20:26:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219273 - stable/8/sys/vm
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 20:26:36 -0000

Author: brucec
Date: Fri Mar  4 20:26:35 2011
New Revision: 219273
URL: http://svn.freebsd.org/changeset/base/219273

Log:
  MFC r218966, r219124:
  
  Change the return type of vmspace_swap_count to a long to match the other
  vmspace_*_count functions.
  
  While here, clean up some style(9) issues.
  
  PR:	kern/152200

Modified:
  stable/8/sys/vm/swap_pager.c
  stable/8/sys/vm/vm_map.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/vm/swap_pager.c
==============================================================================
--- stable/8/sys/vm/swap_pager.c	Fri Mar  4 19:53:07 2011	(r219272)
+++ stable/8/sys/vm/swap_pager.c	Fri Mar  4 20:26:35 2011	(r219273)
@@ -2408,23 +2408,24 @@ SYSCTL_NODE(_vm, OID_AUTO, swap_info, CT
  *	if the VM object has any swap use at all the associated map entries
  *	count for at least 1 swap page.
  */
-int
+long
 vmspace_swap_count(struct vmspace *vmspace)
 {
-	vm_map_t map = &vmspace->vm_map;
+	vm_map_t map;
 	vm_map_entry_t cur;
-	int count = 0;
+	vm_object_t object;
+	long count, n;
 
-	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
-		vm_object_t object;
+	map = &vmspace->vm_map;
+	count = 0;
 
+	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
 		if ((cur->eflags & MAP_ENTRY_IS_SUB_MAP) == 0 &&
 		    (object = cur->object.vm_object) != NULL) {
 			VM_OBJECT_LOCK(object);
 			if (object->type == OBJT_SWAP &&
 			    object->un_pager.swp.swp_bcount != 0) {
-				int n = (cur->end - cur->start) / PAGE_SIZE;
-
+				n = (cur->end - cur->start) / PAGE_SIZE;
 				count += object->un_pager.swp.swp_bcount *
 				    SWAP_META_PAGES * n / object->size + 1;
 			}

Modified: stable/8/sys/vm/vm_map.h
==============================================================================
--- stable/8/sys/vm/vm_map.h	Fri Mar  4 19:53:07 2011	(r219272)
+++ stable/8/sys/vm/vm_map.h	Fri Mar  4 20:26:35 2011	(r219273)
@@ -382,6 +382,6 @@ int vm_map_unwire(vm_map_t map, vm_offse
     int flags);
 int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end,
     int flags);
-int vmspace_swap_count (struct vmspace *vmspace);
+long vmspace_swap_count(struct vmspace *vmspace);
 #endif				/* _KERNEL */
 #endif				/* _VM_MAP_ */

From owner-svn-src-stable@FreeBSD.ORG  Fri Mar  4 20:30:18 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D05D7106566C;
	Fri,  4 Mar 2011 20:30:18 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A50928FC08;
	Fri,  4 Mar 2011 20:30:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24KUI5V053312;
	Fri, 4 Mar 2011 20:30:18 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24KUIrA053309;
	Fri, 4 Mar 2011 20:30:18 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103042030.p24KUIrA053309@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 4 Mar 2011 20:30:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219274 - stable/7/sys/vm
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 20:30:18 -0000

Author: brucec
Date: Fri Mar  4 20:30:18 2011
New Revision: 219274
URL: http://svn.freebsd.org/changeset/base/219274

Log:
  MFC r218966, r219124:
  
  Change the return type of vmspace_swap_count to a long to match the other
  vmspace_*_count functions.
  
  While here, clean up some style(9) issues.
  
  PR:   kern/152200

Modified:
  stable/7/sys/vm/swap_pager.c
  stable/7/sys/vm/vm_map.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/vm/swap_pager.c
==============================================================================
--- stable/7/sys/vm/swap_pager.c	Fri Mar  4 20:26:35 2011	(r219273)
+++ stable/7/sys/vm/swap_pager.c	Fri Mar  4 20:30:18 2011	(r219274)
@@ -2266,23 +2266,24 @@ SYSCTL_NODE(_vm, OID_AUTO, swap_info, CT
  *	if the VM object has any swap use at all the associated map entries
  *	count for at least 1 swap page.
  */
-int
+long
 vmspace_swap_count(struct vmspace *vmspace)
 {
-	vm_map_t map = &vmspace->vm_map;
+	vm_map_t map;
 	vm_map_entry_t cur;
-	int count = 0;
+	vm_object_t object;
+	long count, n;
 
-	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
-		vm_object_t object;
+	map = &vmspace->vm_map;
+	count = 0;
 
+	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
 		if ((cur->eflags & MAP_ENTRY_IS_SUB_MAP) == 0 &&
 		    (object = cur->object.vm_object) != NULL) {
 			VM_OBJECT_LOCK(object);
 			if (object->type == OBJT_SWAP &&
 			    object->un_pager.swp.swp_bcount != 0) {
-				int n = (cur->end - cur->start) / PAGE_SIZE;
-
+				n = (cur->end - cur->start) / PAGE_SIZE;
 				count += object->un_pager.swp.swp_bcount *
 				    SWAP_META_PAGES * n / object->size + 1;
 			}

Modified: stable/7/sys/vm/vm_map.h
==============================================================================
--- stable/7/sys/vm/vm_map.h	Fri Mar  4 20:26:35 2011	(r219273)
+++ stable/7/sys/vm/vm_map.h	Fri Mar  4 20:30:18 2011	(r219274)
@@ -376,6 +376,6 @@ int vm_map_unwire(vm_map_t map, vm_offse
     int flags);
 int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end,
     int flags);
-int vmspace_swap_count (struct vmspace *vmspace);
+long vmspace_swap_count(struct vmspace *vmspace);
 #endif				/* _KERNEL */
 #endif				/* _VM_MAP_ */

From owner-svn-src-stable@FreeBSD.ORG  Fri Mar  4 22:59:14 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 59F431065670;
	Fri,  4 Mar 2011 22:59:14 +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 4839D8FC0C;
	Fri,  4 Mar 2011 22:59:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24MxEnB067107;
	Fri, 4 Mar 2011 22:59:14 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24MxERW067105;
	Fri, 4 Mar 2011 22:59:14 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103042259.p24MxERW067105@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 4 Mar 2011 22:59:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219277 - stable/8/sys/x86/cpufreq
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 22:59:14 -0000

Author: jkim
Date: Fri Mar  4 22:59:14 2011
New Revision: 219277
URL: http://svn.freebsd.org/changeset/base/219277

Log:
  MFC:	r219046
  
  Set C1 "I/O then Halt" capability bit for Intel EIST.  Some broken BIOSes
  refuse to load external SSDTs if this bit is unset for _PDC.

Modified:
  stable/8/sys/x86/cpufreq/est.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/x86/cpufreq/est.c
==============================================================================
--- stable/8/sys/x86/cpufreq/est.c	Fri Mar  4 22:26:41 2011	(r219276)
+++ stable/8/sys/x86/cpufreq/est.c	Fri Mar  4 22:59:14 2011	(r219277)
@@ -945,8 +945,11 @@ static int
 est_features(driver_t *driver, u_int *features)
 {
 
-	/* Notify the ACPI CPU that we support direct access to MSRs */
-	*features = ACPI_CAP_PERF_MSRS;
+	/*
+	 * Notify the ACPI CPU that we support direct access to MSRs.
+	 * XXX C1 "I/O then Halt" seems necessary for some broken BIOS.
+	 */
+	*features = ACPI_CAP_PERF_MSRS | ACPI_CAP_C1_IO_HALT;
 	return (0);
 }
 

From owner-svn-src-stable@FreeBSD.ORG  Fri Mar  4 23:12:15 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 473C91065672;
	Fri,  4 Mar 2011 23:12:15 +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 1AB0C8FC17;
	Fri,  4 Mar 2011 23:12:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24NCFjX069058;
	Fri, 4 Mar 2011 23:12:15 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24NCEfE069056;
	Fri, 4 Mar 2011 23:12:14 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103042312.p24NCEfE069056@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 4 Mar 2011 23:12:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219278 - stable/7/sys/dev/acpica
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 23:12:15 -0000

Author: jkim
Date: Fri Mar  4 23:12:14 2011
New Revision: 219278
URL: http://svn.freebsd.org/changeset/base/219278

Log:
  MFC:	r218685, r218687
  
  Copy just enough data for the resource type.

Modified:
  stable/7/sys/dev/acpica/acpi_resource.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/acpica/acpi_resource.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_resource.c	Fri Mar  4 22:59:14 2011	(r219277)
+++ stable/7/sys/dev/acpica/acpi_resource.c	Fri Mar  4 23:12:14 2011	(r219278)
@@ -58,32 +58,35 @@ static ACPI_STATUS
 acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context)
 {
     struct lookup_irq_request *req;
+    size_t len;
     u_int irqnum, irq;
 
     switch (res->Type) {
     case ACPI_RESOURCE_TYPE_IRQ:
+	irqnum = res->Data.Irq.InterruptCount;
+	irq = res->Data.Irq.Interrupts[0];
+	len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ);
+	break;
     case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
-	if (res->Type == ACPI_RESOURCE_TYPE_IRQ) {
-	    irqnum = res->Data.Irq.InterruptCount;
-	    irq = res->Data.Irq.Interrupts[0];
-	} else {
-	    irqnum = res->Data.ExtendedIrq.InterruptCount;
-	    irq = res->Data.ExtendedIrq.Interrupts[0];
-	}
-	if (irqnum != 1)
-	    break;
-	req = (struct lookup_irq_request *)context;
-	if (req->counter != req->rid) {
-	    req->counter++;
-	    break;
-	}
-	req->found = 1;
-	KASSERT(irq == rman_get_start(req->res),
-	    ("IRQ resources do not match"));
-	bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE));
-	return (AE_CTRL_TERMINATE);
+	irqnum = res->Data.ExtendedIrq.InterruptCount;
+	irq = res->Data.ExtendedIrq.Interrupts[0];
+	len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ);
+	break;
+    default:
+	return (AE_OK);
+    }
+    if (irqnum != 1)
+	return (AE_OK);
+    req = (struct lookup_irq_request *)context;
+    if (req->counter != req->rid) {
+	req->counter++;
+	return (AE_OK);
     }
-    return (AE_OK);
+    req->found = 1;
+    KASSERT(irq == rman_get_start(req->res),
+	("IRQ resources do not match"));
+    bcopy(res, req->acpi_res, len);
+    return (AE_CTRL_TERMINATE);
 }
 
 ACPI_STATUS

From owner-svn-src-stable@FreeBSD.ORG  Fri Mar  4 23:43:10 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC1CC106566C;
	Fri,  4 Mar 2011 23:43:10 +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 9A9C48FC1D;
	Fri,  4 Mar 2011 23:43:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24NhAqg072573;
	Fri, 4 Mar 2011 23:43:10 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24NhAe9072571;
	Fri, 4 Mar 2011 23:43:10 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103042343.p24NhAe9072571@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 4 Mar 2011 23:43:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219279 - stable/7/sys/i386/cpufreq
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 23:43:10 -0000

Author: jkim
Date: Fri Mar  4 23:43:10 2011
New Revision: 219279
URL: http://svn.freebsd.org/changeset/base/219279

Log:
  MFC:	r219046
  
  Set C1 "I/O then Halt" capability bit for Intel EIST.  Some broken BIOSes
  refuse to load external SSDTs if this bit is unset for _PDC.

Modified:
  stable/7/sys/i386/cpufreq/est.c

Modified: stable/7/sys/i386/cpufreq/est.c
==============================================================================
--- stable/7/sys/i386/cpufreq/est.c	Fri Mar  4 23:12:14 2011	(r219278)
+++ stable/7/sys/i386/cpufreq/est.c	Fri Mar  4 23:43:10 2011	(r219279)
@@ -942,8 +942,11 @@ static int
 est_features(driver_t *driver, u_int *features)
 {
 
-	/* Notify the ACPI CPU that we support direct access to MSRs */
-	*features = ACPI_CAP_PERF_MSRS;
+	/*
+	 * Notify the ACPI CPU that we support direct access to MSRs.
+	 * XXX C1 "I/O then Halt" seems necessary for some broken BIOS.
+	 */
+	*features = ACPI_CAP_PERF_MSRS | ACPI_CAP_C1_IO_HALT;
 	return (0);
 }
 

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 02:11:23 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BED91106564A;
	Sat,  5 Mar 2011 02:11:23 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A41178FC0A;
	Sat,  5 Mar 2011 02:11:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p252BNGs089715;
	Sat, 5 Mar 2011 02:11:23 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p252BNFv089712;
	Sat, 5 Mar 2011 02:11:23 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103050211.p252BNFv089712@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 5 Mar 2011 02:11:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219283 - in stable/8/etc: periodic/daily rc.d
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 02:11:24 -0000

Author: dougb
Date: Sat Mar  5 02:11:23 2011
New Revision: 219283
URL: http://svn.freebsd.org/changeset/base/219283

Log:
  MFC r218961:
  
  Update how accounting log files are rotated, clean up the rc.d script
  a bit.
  
  MFC r218986:
  
  The new accounting file needs to be 644 so that unprivileged users
  can use lastcomm(1)

Modified:
  stable/8/etc/periodic/daily/310.accounting
  stable/8/etc/rc.d/accounting
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/periodic/daily/310.accounting
==============================================================================
--- stable/8/etc/periodic/daily/310.accounting	Sat Mar  5 00:59:34 2011	(r219282)
+++ stable/8/etc/periodic/daily/310.accounting	Sat Mar  5 02:11:23 2011	(r219283)
@@ -41,13 +41,16 @@ case "$daily_accounting_enable" in
 		m=$n
 		n=$(($n - 1))
 	    done
-	    cp -pf acct acct.0 || rc=3
-	    sa -s $daily_accounting_flags || rc=3
+
+	    /etc/rc.d/accounting rotate_log || rc=3
 
 	    case "$daily_accounting_compress" in
 		[Yy][Ee][Ss])
-		    gzip -f acct.0 || rc=3;;
+		    gzip --keep -f acct.0 || rc=3;;
 	    esac
+
+	    sa -s $daily_accounting_flags /var/account/acct.0 &&
+		unlink acct.0 || rc=3
 	fi;;
 
     *)  rc=0;;

Modified: stable/8/etc/rc.d/accounting
==============================================================================
--- stable/8/etc/rc.d/accounting	Sat Mar  5 00:59:34 2011	(r219282)
+++ stable/8/etc/rc.d/accounting	Sat Mar  5 02:11:23 2011	(r219283)
@@ -14,28 +14,31 @@ name="accounting"
 rcvar=`set_rcvar`
 accounting_command="/usr/sbin/accton"
 accounting_file="/var/account/acct"
+
+extra_commands="rotate_log"
+
 start_cmd="accounting_start"
 stop_cmd="accounting_stop"
+rotate_log_cmd="accounting_rotate_log"
 
 accounting_start()
 {
 	local _dir
 
-	_dir=`dirname "$accounting_file"`
-	if [ ! -d `dirname "$_dir"` ]; then
+	_dir="${accounting_file%/*}"
+	if [ ! -d "$_dir" ]; then
 		if ! mkdir -p "$_dir"; then
-			warn "Could not create $_dir."
-			return 1
+			err 1 "Could not create $_dir."
 		fi
 	fi
+
 	if [ ! -e "$accounting_file" ]; then
+		echo -n "Creating accounting file ${accounting_file}"
 		touch "$accounting_file"
+		echo '.'
 	fi
+	chmod 644 "$accounting_file"
 
-	if [ ! -f ${accounting_file} ]; then
-		echo "Creating accounting file ${accounting_file}"
-		( umask 022 ; > ${accounting_file} )
-	fi
 	echo "Turning on accounting."
 	${accounting_command} ${accounting_file}
 }
@@ -46,5 +49,27 @@ accounting_stop()
 	${accounting_command}
 }
 
+accounting_rotate_log()
+{
+	local _dir _file
+
+	_dir="${accounting_file%/*}"
+	cd $_dir
+
+	if checkyesno accounting_enable; then
+		_file=`mktemp newacct-XXXXX`
+		chmod 644 $_file
+		${accounting_command} ${_dir}/${_file}
+	fi
+
+	mv ${accounting_file} ${accounting_file}.0
+
+	if checkyesno accounting_enable; then
+		ln $_file ${accounting_file##*/}
+		${accounting_command} ${accounting_file}
+		unlink $_file
+	fi
+}
+
 load_rc_config $name
 run_rc_command "$1"

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 02:12:36 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B4141065673;
	Sat,  5 Mar 2011 02:12:36 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6062D8FC13;
	Sat,  5 Mar 2011 02:12:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p252CaPP089916;
	Sat, 5 Mar 2011 02:12:36 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p252CakQ089913;
	Sat, 5 Mar 2011 02:12:36 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103050212.p252CakQ089913@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 5 Mar 2011 02:12:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219284 - in stable/7/etc: periodic/daily rc.d
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 02:12:36 -0000

Author: dougb
Date: Sat Mar  5 02:12:36 2011
New Revision: 219284
URL: http://svn.freebsd.org/changeset/base/219284

Log:
  MFC r218961:
  
  Update how accounting log files are rotated, clean up the rc.d script
  a bit.
  
  MFC r218986:
  
  The new accounting file needs to be 644 so that unprivileged users
  can use lastcomm(1)

Modified:
  stable/7/etc/periodic/daily/310.accounting
  stable/7/etc/rc.d/accounting
Directory Properties:
  stable/7/etc/   (props changed)

Modified: stable/7/etc/periodic/daily/310.accounting
==============================================================================
--- stable/7/etc/periodic/daily/310.accounting	Sat Mar  5 02:11:23 2011	(r219283)
+++ stable/7/etc/periodic/daily/310.accounting	Sat Mar  5 02:12:36 2011	(r219284)
@@ -41,13 +41,16 @@ case "$daily_accounting_enable" in
 		m=$n
 		n=$(($n - 1))
 	    done
-	    cp -pf acct acct.0 || rc=3
-	    sa -s $daily_accounting_flags || rc=3
+
+	    /etc/rc.d/accounting rotate_log || rc=3
 
 	    case "$daily_accounting_compress" in
 		[Yy][Ee][Ss])
-		    gzip -f acct.0 || rc=3;;
+		    gzip --keep -f acct.0 || rc=3;;
 	    esac
+
+	    sa -s $daily_accounting_flags /var/account/acct.0 &&
+		unlink acct.0 || rc=3
 	fi;;
 
     *)  rc=0;;

Modified: stable/7/etc/rc.d/accounting
==============================================================================
--- stable/7/etc/rc.d/accounting	Sat Mar  5 02:11:23 2011	(r219283)
+++ stable/7/etc/rc.d/accounting	Sat Mar  5 02:12:36 2011	(r219284)
@@ -14,28 +14,31 @@ name="accounting"
 rcvar=`set_rcvar`
 accounting_command="/usr/sbin/accton"
 accounting_file="/var/account/acct"
+
+extra_commands="rotate_log"
+
 start_cmd="accounting_start"
 stop_cmd="accounting_stop"
+rotate_log_cmd="accounting_rotate_log"
 
 accounting_start()
 {
 	local _dir
 
-	_dir=`dirname "$accounting_file"`
-	if [ ! -d `dirname "$_dir"` ]; then
+	_dir="${accounting_file%/*}"
+	if [ ! -d "$_dir" ]; then
 		if ! mkdir -p "$_dir"; then
-			warn "Could not create $_dir."
-			return 1
+			err 1 "Could not create $_dir."
 		fi
 	fi
+
 	if [ ! -e "$accounting_file" ]; then
+		echo -n "Creating accounting file ${accounting_file}"
 		touch "$accounting_file"
+		echo '.'
 	fi
+	chmod 644 "$accounting_file"
 
-	if [ ! -f ${accounting_file} ]; then
-		echo "Creating accounting file ${accounting_file}"
-		( umask 022 ; > ${accounting_file} )
-	fi
 	echo "Turning on accounting."
 	${accounting_command} ${accounting_file}
 }
@@ -46,5 +49,27 @@ accounting_stop()
 	${accounting_command}
 }
 
+accounting_rotate_log()
+{
+	local _dir _file
+
+	_dir="${accounting_file%/*}"
+	cd $_dir
+
+	if checkyesno accounting_enable; then
+		_file=`mktemp newacct-XXXXX`
+		chmod 644 $_file
+		${accounting_command} ${_dir}/${_file}
+	fi
+
+	mv ${accounting_file} ${accounting_file}.0
+
+	if checkyesno accounting_enable; then
+		ln $_file ${accounting_file##*/}
+		${accounting_command} ${accounting_file}
+		unlink $_file
+	fi
+}
+
 load_rc_config $name
 run_rc_command "$1"

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 03:46:25 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 23E5C106566B;
	Sat,  5 Mar 2011 03:46:25 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 10C678FC0A;
	Sat,  5 Mar 2011 03:46:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p253kO3k002113;
	Sat, 5 Mar 2011 03:46:24 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p253kOtW002110;
	Sat, 5 Mar 2011 03:46:24 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050346.p253kOtW002110@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 03:46:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219291 - in stable/8: share/man/man7 usr.bin/checknr
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 03:46:25 -0000

Author: brucec
Date: Sat Mar  5 03:46:24 2011
New Revision: 219291
URL: http://svn.freebsd.org/changeset/base/219291

Log:
  MFC r219096, r219126:
  
  r177626 broke some sentences. Reword them to avoid the duplicate "in".
  
  PR:	121490

Modified:
  stable/8/share/man/man7/security.7
  stable/8/usr.bin/checknr/checknr.c
Directory Properties:
  stable/8/share/man/man7/   (props changed)
  stable/8/usr.bin/checknr/   (props changed)

Modified: stable/8/share/man/man7/security.7
==============================================================================
--- stable/8/share/man/man7/security.7	Sat Mar  5 03:42:03 2011	(r219290)
+++ stable/8/share/man/man7/security.7	Sat Mar  5 03:46:24 2011	(r219291)
@@ -138,7 +138,7 @@ This gives you a convenient way to detec
 Making
 it impossible for an attacker to install a backdoor may actually be detrimental
 to your security because it will not close off the hole the attacker used to
-break in the first place.
+break in originally.
 .Pp
 Security remedies should always be implemented with a multi-layered
 .Dq onion peel

Modified: stable/8/usr.bin/checknr/checknr.c
==============================================================================
--- stable/8/usr.bin/checknr/checknr.c	Sat Mar  5 03:42:03 2011	(r219290)
+++ stable/8/usr.bin/checknr/checknr.c	Sat Mar  5 03:46:24 2011	(r219291)
@@ -83,7 +83,7 @@ struct stkstr {
 	int opno;	/* number of opening bracket */
 	int pl;		/* '+', '-', ' ' for \s, 1 for \f, 0 for .ft */
 	int parm;	/* parm to size, font, etc */
-	int lno;	/* line number the thing came in */
+	int lno;	/* line number */
 } stk[MAXSTK];
 int stktop;
 

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 04:06:12 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89515106566C;
	Sat,  5 Mar 2011 04:06:12 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 769018FC0A;
	Sat,  5 Mar 2011 04:06:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2546CQ5003977;
	Sat, 5 Mar 2011 04:06:12 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2546CSr003975;
	Sat, 5 Mar 2011 04:06:12 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103050406.p2546CSr003975@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 5 Mar 2011 04:06:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219294 - stable/8/usr.bin/stat
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:06:12 -0000

Author: dougb
Date: Sat Mar  5 04:06:12 2011
New Revision: 219294
URL: http://svn.freebsd.org/changeset/base/219294

Log:
  MFC r218535:
  
  Synthesize the change from NetBSD's 1.33:
  
  "Do not crash if a date cannot be represented (localtime returning
  NULL), use the Epoch value instead."
  
  Obtained from:  njoly@NetBSD.org

Modified:
  stable/8/usr.bin/stat/stat.c
Directory Properties:
  stable/8/usr.bin/stat/   (props changed)

Modified: stable/8/usr.bin/stat/stat.c
==============================================================================
--- stable/8/usr.bin/stat/stat.c	Sat Mar  5 04:04:23 2011	(r219293)
+++ stable/8/usr.bin/stat/stat.c	Sat Mar  5 04:06:12 2011	(r219294)
@@ -30,7 +30,7 @@
 #include 
 #if 0
 #ifndef lint
-__RCSID("$NetBSD: stat.c,v 1.31 2010/12/16 05:30:16 dholland Exp $"
+__RCSID("$NetBSD: stat.c,v 1.33 2011/01/15 22:54:10 njoly Exp $"
 "$OpenBSD: stat.c,v 1.14 2009/06/24 09:44:25 sobrado Exp $");
 #endif
 #endif
@@ -731,6 +731,10 @@ format1(const struct stat *st,
 		small = (sizeof(ts.tv_sec) == 4);
 		data = ts.tv_sec;
 		tm = localtime(&ts.tv_sec);
+		if (tm == NULL) {
+			ts.tv_sec = 0;
+			tm = localtime(&ts.tv_sec);
+		}
 		(void)strftime(path, sizeof(path), timefmt, tm);
 		sdata = path;
 		formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX |

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 04:08:07 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 985991065670;
	Sat,  5 Mar 2011 04:08:07 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 859428FC16;
	Sat,  5 Mar 2011 04:08:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25487PD004161;
	Sat, 5 Mar 2011 04:08:07 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254875B004159;
	Sat, 5 Mar 2011 04:08:07 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103050408.p254875B004159@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 5 Mar 2011 04:08:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219295 - stable/7/usr.bin/stat
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:08:07 -0000

Author: dougb
Date: Sat Mar  5 04:08:07 2011
New Revision: 219295
URL: http://svn.freebsd.org/changeset/base/219295

Log:
  MFC r218535:
  
  Synthesize the change from NetBSD's 1.33:
  
  "Do not crash if a date cannot be represented (localtime returning
  NULL), use the Epoch value instead."
  
  Obtained from:  njoly@NetBSD.org

Modified:
  stable/7/usr.bin/stat/stat.c
Directory Properties:
  stable/7/usr.bin/stat/   (props changed)

Modified: stable/7/usr.bin/stat/stat.c
==============================================================================
--- stable/7/usr.bin/stat/stat.c	Sat Mar  5 04:06:12 2011	(r219294)
+++ stable/7/usr.bin/stat/stat.c	Sat Mar  5 04:08:07 2011	(r219295)
@@ -30,7 +30,7 @@
 #include 
 #if 0
 #ifndef lint
-__RCSID("$NetBSD: stat.c,v 1.31 2010/12/16 05:30:16 dholland Exp $"
+__RCSID("$NetBSD: stat.c,v 1.33 2011/01/15 22:54:10 njoly Exp $"
 "$OpenBSD: stat.c,v 1.14 2009/06/24 09:44:25 sobrado Exp $");
 #endif
 #endif
@@ -724,6 +724,10 @@ format1(const struct stat *st,
 		small = (sizeof(ts.tv_sec) == 4);
 		data = ts.tv_sec;
 		tm = localtime(&ts.tv_sec);
+		if (tm == NULL) {
+			ts.tv_sec = 0;
+			tm = localtime(&ts.tv_sec);
+		}
 		(void)strftime(path, sizeof(path), timefmt, tm);
 		sdata = path;
 		formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX |

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 04:11:07 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 27A01106566C;
	Sat,  5 Mar 2011 04:11:07 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 112CB8FC1A;
	Sat,  5 Mar 2011 04:11:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p254B6J1004527;
	Sat, 5 Mar 2011 04:11:06 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254B6FW004516;
	Sat, 5 Mar 2011 04:11:06 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050411.p254B6FW004516@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:11:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219296 - in stable/7: lib/libc/yp lib/libkse/thread
	libexec/talkd share/man/man7 sys/boot/i386/cdboot
	sys/boot/pc98/cdboot sys/dev/ti sys/i386/isa usr.bin/checknr
	usr.bin/xlint/lint1
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:11:07 -0000

Author: brucec
Date: Sat Mar  5 04:11:06 2011
New Revision: 219296
URL: http://svn.freebsd.org/changeset/base/219296

Log:
  MFC r177626, r219096, r219126:
  
  Fix some "in in" typos in comments.
  
  PR:		121490
  Submitted by:	Anatoly Borodin 

Modified:
  stable/7/lib/libc/yp/xdryp.c
  stable/7/lib/libkse/thread/thr_sig.c
  stable/7/libexec/talkd/announce.c
  stable/7/share/man/man7/security.7
  stable/7/sys/boot/i386/cdboot/cdboot.s
  stable/7/sys/boot/pc98/cdboot/cdboot.s
  stable/7/sys/dev/ti/if_ti.c
  stable/7/sys/i386/isa/vesa.c
  stable/7/usr.bin/checknr/checknr.c
  stable/7/usr.bin/xlint/lint1/lint1.h
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)
  stable/7/lib/libkse/   (props changed)
  stable/7/libexec/talkd/   (props changed)
  stable/7/share/man/man7/   (props changed)
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/usr.bin/checknr/   (props changed)
  stable/7/usr.bin/xlint/   (props changed)

Modified: stable/7/lib/libc/yp/xdryp.c
==============================================================================
--- stable/7/lib/libc/yp/xdryp.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/lib/libc/yp/xdryp.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -42,7 +42,7 @@ extern void *ypresp_data;
  * I'm leaving the xdr_datum() function in purely for backwards
  * compatibility. yplib.c doesn't actually use it, but it's listed
  * in yp_prot.h as being available, so it's probably a good idea to
- * leave it in in case somebody goes looking for it.
+ * leave it in case somebody goes looking for it.
  */
 typedef struct {
 	char *dptr;

Modified: stable/7/lib/libkse/thread/thr_sig.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_sig.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/lib/libkse/thread/thr_sig.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -663,7 +663,7 @@ thr_sig_find(struct kse *curkse, int sig
 	 * Enter a loop to look for threads that have the signal
 	 * unmasked.  POSIX specifies that a thread in a sigwait
 	 * will get the signal over any other threads.  Second
-	 * preference will be threads in in a sigsuspend.  Third
+	 * preference will be threads in a sigsuspend.  Third
 	 * preference will be the current thread.  If none of the
 	 * above, then the signal is delivered to the first thread
 	 * that is found.  Note that if a custom handler is not

Modified: stable/7/libexec/talkd/announce.c
==============================================================================
--- stable/7/libexec/talkd/announce.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/libexec/talkd/announce.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -91,7 +91,7 @@ announce(CTL_MSG *request, const char *r
  * Build a block of characters containing the message.
  * It is sent blank filled and in a single block to
  * try to keep the message in one piece if the recipient
- * in in vi at the time
+ * in vi at the time
  */
 int
 print_mesg(const char *tty, CTL_MSG *request,

Modified: stable/7/share/man/man7/security.7
==============================================================================
--- stable/7/share/man/man7/security.7	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/share/man/man7/security.7	Sat Mar  5 04:11:06 2011	(r219296)
@@ -138,7 +138,7 @@ This gives you a convenient way to detec
 Making
 it impossible for an attacker to install a backdoor may actually be detrimental
 to your security because it will not close off the hole the attacker used to
-break in in the first place.
+break in originally.
 .Pp
 Security remedies should always be implemented with a multi-layered
 .Dq onion peel

Modified: stable/7/sys/boot/i386/cdboot/cdboot.s
==============================================================================
--- stable/7/sys/boot/i386/cdboot/cdboot.s	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/sys/boot/i386/cdboot/cdboot.s	Sat Mar  5 04:11:06 2011	(r219296)
@@ -174,7 +174,7 @@ lookup_path:	push %si			# Save file name
 lookup_found:					# Found a loader file
 #
 # Load the binary into the buffer.  Due to real mode addressing limitations
-# we have to read it in in 64k chunks.
+# we have to read it in 64k chunks.
 #
 		mov DIR_SIZE(%bx),%eax		# Read file length
 		add $SECTOR_SIZE-1,%eax		# Convert length to sectors

Modified: stable/7/sys/boot/pc98/cdboot/cdboot.s
==============================================================================
--- stable/7/sys/boot/pc98/cdboot/cdboot.s	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/sys/boot/pc98/cdboot/cdboot.s	Sat Mar  5 04:11:06 2011	(r219296)
@@ -415,7 +415,7 @@ lookup_path:	push %si			# Save file name
 lookup_found:					# Found a loader file
 #
 # Load the binary into the buffer.  Due to real mode addressing limitations
-# we have to read it in in 64k chunks.
+# we have to read it in 64k chunks.
 #
 		mov %es:DIR_SIZE(%bx),%eax	# Read file length
 		add $SECTOR_SIZE-1,%eax		# Convert length to sectors

Modified: stable/7/sys/dev/ti/if_ti.c
==============================================================================
--- stable/7/sys/dev/ti/if_ti.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/sys/dev/ti/if_ti.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -3685,7 +3685,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, 
 		 * to the Tigon board you're interested in.  This seems
 		 * like a not-so-good way to do things, since unless you
 		 * subsequently specify the unit number of the device
-		 * you're interested in in every ioctl, you'll only be
+		 * you're interested in every ioctl, you'll only be
 		 * able to debug one board at a time.
 		 */
 		error = 0;

Modified: stable/7/sys/i386/isa/vesa.c
==============================================================================
--- stable/7/sys/i386/isa/vesa.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/sys/i386/isa/vesa.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -1392,7 +1392,7 @@ get_palette(video_adapter_t *adp, int ba
 	}
 	free(r, M_DEVBUF);
 
-	/* if error && bits != 6 at this point, we are in in trouble... XXX */
+	/* if error && bits != 6 at this point, we are in trouble... XXX */
 	return error;
 }
 

Modified: stable/7/usr.bin/checknr/checknr.c
==============================================================================
--- stable/7/usr.bin/checknr/checknr.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/usr.bin/checknr/checknr.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -83,7 +83,7 @@ struct stkstr {
 	int opno;	/* number of opening bracket */
 	int pl;		/* '+', '-', ' ' for \s, 1 for \f, 0 for .ft */
 	int parm;	/* parm to size, font, etc */
-	int lno;	/* line number the thing came in in */
+	int lno;	/* line number */
 } stk[MAXSTK];
 int stktop;
 

Modified: stable/7/usr.bin/xlint/lint1/lint1.h
==============================================================================
--- stable/7/usr.bin/xlint/lint1/lint1.h	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/usr.bin/xlint/lint1/lint1.h	Sat Mar  5 04:11:06 2011	(r219296)
@@ -325,7 +325,7 @@ typedef	struct dinfo {
 	u_int	d_mscl : 1;	/* multiple storage classes */
 	u_int	d_terr : 1;	/* invalid type combination */
 	u_int	d_nedecl : 1;	/* 1 if at least a tag is declared */
-	u_int	d_vararg : 1;	/* ... in in current function decl. */
+	u_int	d_vararg : 1;	/* ... in current function decl. */
 	u_int	d_proto : 1;	/* current funct. decl. is prototype */
 	u_int	d_notyp : 1;	/* set if no type specifier was present */
 	u_int	d_asm : 1;	/* set if d_ctx == AUTO and asm() present */

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 04:15:46 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B2667106566C;
	Sat,  5 Mar 2011 04:15:46 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9EC668FC0A;
	Sat,  5 Mar 2011 04:15:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p254FkBB005074;
	Sat, 5 Mar 2011 04:15:46 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254Fkei005072;
	Sat, 5 Mar 2011 04:15:46 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050415.p254Fkei005072@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:15:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219297 - stable/8/contrib/lukemftp/src
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:15:46 -0000

Author: brucec
Date: Sat Mar  5 04:15:46 2011
New Revision: 219297
URL: http://svn.freebsd.org/changeset/base/219297

Log:
  MFC r219081:
  
  Merge fix from r1.108 of NetBSD's usr.bin/ftp/main.c:
  
  Only attempt to el_parse() a command unknown by the default parser
  if editing is enabled.
  
  PR:           bin/100089

Modified:
  stable/8/contrib/lukemftp/src/main.c
Directory Properties:
  stable/8/contrib/lukemftp/   (props changed)

Modified: stable/8/contrib/lukemftp/src/main.c
==============================================================================
--- stable/8/contrib/lukemftp/src/main.c	Sat Mar  5 04:11:06 2011	(r219296)
+++ stable/8/contrib/lukemftp/src/main.c	Sat Mar  5 04:15:46 2011	(r219297)
@@ -707,6 +707,7 @@ cmdscanner(void)
 			 * such commands as invalid.
 			 */
 			if (strchr(margv[0], ':') != NULL ||
+			    !editing ||
 			    el_parse(el, margc, (const char **)margv) != 0)
 #endif /* !NO_EDITCOMPLETE */
 				fputs("?Invalid command.\n", ttyout);

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 04:18:29 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76508106564A;
	Sat,  5 Mar 2011 04:18:29 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 632018FC12;
	Sat,  5 Mar 2011 04:18:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p254ITTT005364;
	Sat, 5 Mar 2011 04:18:29 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254ITht005362;
	Sat, 5 Mar 2011 04:18:29 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050418.p254ITht005362@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:18:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219298 - stable/7/contrib/lukemftp/src
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:18:29 -0000

Author: brucec
Date: Sat Mar  5 04:18:29 2011
New Revision: 219298
URL: http://svn.freebsd.org/changeset/base/219298

Log:
  MFC r219081:
  
  Merge fix from r1.108 of NetBSD's usr.bin/ftp/main.c:
  
  Only attempt to el_parse() a command unknown by the default parser
  if editing is enabled.
  
  PR:           bin/100089

Modified:
  stable/7/contrib/lukemftp/src/main.c
Directory Properties:
  stable/7/contrib/lukemftp/   (props changed)

Modified: stable/7/contrib/lukemftp/src/main.c
==============================================================================
--- stable/7/contrib/lukemftp/src/main.c	Sat Mar  5 04:15:46 2011	(r219297)
+++ stable/7/contrib/lukemftp/src/main.c	Sat Mar  5 04:18:29 2011	(r219298)
@@ -707,6 +707,7 @@ cmdscanner(void)
 			 * such commands as invalid.
 			 */
 			if (strchr(margv[0], ':') != NULL ||
+			    !editing ||
 			    el_parse(el, margc, (const char **)margv) != 0)
 #endif /* !NO_EDITCOMPLETE */
 				fputs("?Invalid command.\n", ttyout);

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 04:27:02 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C6EE51065670;
	Sat,  5 Mar 2011 04:27:02 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B3ECB8FC0A;
	Sat,  5 Mar 2011 04:27:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p254R2Fb006449;
	Sat, 5 Mar 2011 04:27:02 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254R2en006446;
	Sat, 5 Mar 2011 04:27:02 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050427.p254R2en006446@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:27:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219300 - stable/8/lib/libc/rpc/PSD.doc
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:27:02 -0000

Author: brucec
Date: Sat Mar  5 04:27:02 2011
New Revision: 219300
URL: http://svn.freebsd.org/changeset/base/219300

Log:
  MFC r218965, 219055:
  
  Fix typos - remove duplicate "is".
  
  PR:		docs/154934

Modified:
  stable/8/lib/libc/rpc/PSD.doc/rpc.prog.ms
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/rpc/PSD.doc/rpc.prog.ms
==============================================================================
--- stable/8/lib/libc/rpc/PSD.doc/rpc.prog.ms	Sat Mar  5 04:19:38 2011	(r219299)
+++ stable/8/lib/libc/rpc/PSD.doc/rpc.prog.ms	Sat Mar  5 04:27:02 2011	(r219300)
@@ -71,7 +71,7 @@ manual page.
 .I "The Highest Layer:"
 .IX RPC "The Highest Layer"
 The highest layer is totally transparent to the operating system,
-machine and network upon which is is run.  It's probably best to
+machine and network upon which it is run.  It's probably best to
 think of this level as a way of
 .I using
 RPC, rather than as

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 04:33:42 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A6AFC106566B;
	Sat,  5 Mar 2011 04:33:42 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 921408FC12;
	Sat,  5 Mar 2011 04:33:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p254Xgvq007254;
	Sat, 5 Mar 2011 04:33:42 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254XgGx007248;
	Sat, 5 Mar 2011 04:33:42 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050433.p254XgGx007248@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:33:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219301 - in stable/7: lib/libc/rpc/PSD.doc sbin/growfs
	share/doc/papers/devfs sys/fs/nullfs usr.bin/tip/tip
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:33:42 -0000

Author: brucec
Date: Sat Mar  5 04:33:42 2011
New Revision: 219301
URL: http://svn.freebsd.org/changeset/base/219301

Log:
  MFC r218965, r219055:
  
  Fix typos - remove duplicate "is".
  
  PR:           docs/154934
  Submitted by: Eitan Adler 

Modified:
  stable/7/lib/libc/rpc/PSD.doc/rpc.prog.ms
  stable/7/sbin/growfs/growfs.c
  stable/7/share/doc/papers/devfs/paper.me
  stable/7/sys/fs/nullfs/null_vnops.c
  stable/7/usr.bin/tip/tip/tip.h
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)
  stable/7/sbin/growfs/   (props changed)
  stable/7/share/doc/papers/devfs/   (props changed)
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/usr.bin/tip/   (props changed)

Modified: stable/7/lib/libc/rpc/PSD.doc/rpc.prog.ms
==============================================================================
--- stable/7/lib/libc/rpc/PSD.doc/rpc.prog.ms	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/lib/libc/rpc/PSD.doc/rpc.prog.ms	Sat Mar  5 04:33:42 2011	(r219301)
@@ -71,7 +71,7 @@ manual page.
 .I "The Highest Layer:"
 .IX RPC "The Highest Layer"
 The highest layer is totally transparent to the operating system,
-machine and network upon which is is run.  It's probably best to
+machine and network upon which it is run.  It's probably best to
 think of this level as a way of
 .I using
 RPC, rather than as

Modified: stable/7/sbin/growfs/growfs.c
==============================================================================
--- stable/7/sbin/growfs/growfs.c	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/sbin/growfs/growfs.c	Sat Mar  5 04:33:42 2011	(r219301)
@@ -646,7 +646,7 @@ cond_bl_upd(ufs2_daddr_t *block, struct 
 		/*
 		 * Copy the block back immediately.
 		 *
-		 * XXX	If src is is from an indirect block we have
+		 * XXX	If src is from an indirect block we have
 		 *	to implement copy on write here in case of
 		 *	active snapshots.
 		 */

Modified: stable/7/share/doc/papers/devfs/paper.me
==============================================================================
--- stable/7/share/doc/papers/devfs/paper.me	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/share/doc/papers/devfs/paper.me	Sat Mar  5 04:33:42 2011	(r219301)
@@ -779,7 +779,7 @@ The entry points to the device driver ar
 structure, removing the need for the devsw[] array and allowing
 device drivers to use separate entrypoints for various minor numbers.
 .lp
-This is is very convenient for devices which have a ``control''
+This is very convenient for devices which have a ``control''
 device for management and tuning.  The control device, almost always
 have entirely separate open/close/ioctl implementations [MD.C].
 .lp

Modified: stable/7/sys/fs/nullfs/null_vnops.c
==============================================================================
--- stable/7/sys/fs/nullfs/null_vnops.c	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/sys/fs/nullfs/null_vnops.c	Sat Mar  5 04:33:42 2011	(r219301)
@@ -631,7 +631,7 @@ null_islocked(struct vop_islocked_args *
  * as soon as possible.
  *
  * Note, we can't release any resources nor remove vnode from hash before 
- * appropriate VXLOCK stuff is is done because other process can find this
+ * appropriate VXLOCK stuff is done because other process can find this
  * vnode in hash during inactivation and may be sitting in vget() and waiting
  * for null_inactive to unlock vnode. Thus we will do all those in VOP_RECLAIM.
  */

Modified: stable/7/usr.bin/tip/tip/tip.h
==============================================================================
--- stable/7/usr.bin/tip/tip/tip.h	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/usr.bin/tip/tip/tip.h	Sat Mar  5 04:33:42 2011	(r219301)
@@ -259,7 +259,7 @@ int	intflag;		/* recognized interrupt */
 int	stoprompt;		/* for interrupting a prompt session */
 int	timedout;		/* ~> transfer timedout */
 int	cumode;			/* simulating the "cu" program */
-int	bits8;			/* terminal is is 8-bit mode */
+int	bits8;			/* terminal is 8-bit mode */
 #define STRIP_PAR	(bits8 ? 0377 : 0177)
 
 char	fname[PATH_MAX];	/* file name buffer for ~< */

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 08:56:42 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6DA01065670;
	Sat,  5 Mar 2011 08:56:42 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C56BD8FC12;
	Sat,  5 Mar 2011 08:56:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p258uggX026599;
	Sat, 5 Mar 2011 08:56:42 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p258ugj2026597;
	Sat, 5 Mar 2011 08:56:42 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201103050856.p258ugj2026597@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Sat, 5 Mar 2011 08:56:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219302 - stable/8/sys/modules/usb
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 08:56:43 -0000

Author: glebius
Date: Sat Mar  5 08:56:42 2011
New Revision: 219302
URL: http://svn.freebsd.org/changeset/base/219302

Log:
  MFHead 219059:
    Connect uep.ko to build
  
    PR:           kern/155044
    Submitted by: Carl 

Modified:
  stable/8/sys/modules/usb/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/modules/usb/Makefile
==============================================================================
--- stable/8/sys/modules/usb/Makefile	Sat Mar  5 04:33:42 2011	(r219301)
+++ stable/8/sys/modules/usb/Makefile	Sat Mar  5 08:56:42 2011	(r219302)
@@ -28,7 +28,7 @@
 SUBDIR = usb
 SUBDIR += ehci musb ohci uhci xhci uss820dci ${_at91dci} ${_atmegadci}
 SUBDIR += rum run uath upgt ural zyd ${_urtw}
-SUBDIR += atp uhid ukbd ums udbp ufm
+SUBDIR += atp uhid ukbd ums udbp ufm uep
 SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \
 	  umct umodem umoscom uplcom uslcom uvisor uvscom
 SUBDIR += uether aue axe cdce cue kue rue udav uhso ipheth

From owner-svn-src-stable@FreeBSD.ORG  Sat Mar  5 09:42:01 2011
Return-Path: 
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5AE281065675;
	Sat,  5 Mar 2011 09:42: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 49A268FC0C;
	Sat,  5 Mar 2011 09:42:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p259g1Mr030940;
	Sat, 5 Mar 2011 09:42:01 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p259g1wW030937;
	Sat, 5 Mar 2011 09:42:01 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103050942.p259g1wW030937@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 5 Mar 2011 09:42:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219303 - stable/8/sys/crypto/aesni
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 09:42:01 -0000

Author: kib
Date: Sat Mar  5 09:42:00 2011
New Revision: 219303
URL: http://svn.freebsd.org/changeset/base/219303

Log:
  MFC r219178:
  Fix a bug in the result of manual assembly.
  
  PR:	kern/155118

Modified:
  stable/8/sys/crypto/aesni/aeskeys_amd64.S
  stable/8/sys/crypto/aesni/aeskeys_i386.S
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/crypto/aesni/aeskeys_amd64.S
==============================================================================
--- stable/8/sys/crypto/aesni/aeskeys_amd64.S	Sat Mar  5 08:56:42 2011	(r219302)
+++ stable/8/sys/crypto/aesni/aeskeys_amd64.S	Sat Mar  5 09:42:00 2011	(r219303)
@@ -162,7 +162,7 @@ ENTRY(aesni_set_enckey)
 	.byte	0x66,0x0f,0x3a,0xdf,0xc8,0x20
 	call	_key_expansion_256b
 //	aeskeygenassist $0x40,%xmm2,%xmm1	# round 7
-	.byte	0x66,0x0f,0x3a,0xdf,0xca,0x20
+	.byte	0x66,0x0f,0x3a,0xdf,0xca,0x40
 	call	_key_expansion_256a
 	retq
 .Lenc_key192:

Modified: stable/8/sys/crypto/aesni/aeskeys_i386.S
==============================================================================
--- stable/8/sys/crypto/aesni/aeskeys_i386.S	Sat Mar  5 08:56:42 2011	(r219302)
+++ stable/8/sys/crypto/aesni/aeskeys_i386.S	Sat Mar  5 09:42:00 2011	(r219303)
@@ -167,7 +167,7 @@ ENTRY(aesni_set_enckey)
 	.byte	0x66,0x0f,0x3a,0xdf,0xc8,0x20
 	call	_key_expansion_256b
 //	aeskeygenassist $0x40,%xmm2,%xmm1	# round 7
-	.byte	0x66,0x0f,0x3a,0xdf,0xca,0x20
+	.byte	0x66,0x0f,0x3a,0xdf,0xca,0x40
 	call	_key_expansion_256a
 	.cfi_adjust_cfa_offset -4
 	leave