From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 01:38:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22CF2106566C; Sun, 13 Mar 2011 01:38:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1052C8FC08; Sun, 13 Mar 2011 01:38: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 p2D1cOep035978; Sun, 13 Mar 2011 01:38:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D1cOLc035974; Sun, 13 Mar 2011 01:38:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103130138.p2D1cOLc035974@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Mar 2011 01:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219584 - in head/release: . amd64 i386 scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 01:38:25 -0000 Author: nwhitehorn Date: Sun Mar 13 01:38:24 2011 New Revision: 219584 URL: http://svn.freebsd.org/changeset/base/219584 Log: Add generation of memstick images to the bsdinstall release makefile for i386 and amd64. This involved moving the memstick generation script to the arch directories from scripts/, in analogy to mkisoimages.sh. This script was never called from /usr/src/release/Makefile, so that hasn't been updated. Added: head/release/amd64/make-memstick.sh - copied unchanged from r219487, head/release/scripts/make-memstick.sh head/release/i386/make-memstick.sh - copied unchanged from r219487, head/release/scripts/make-memstick.sh Deleted: head/release/scripts/make-memstick.sh Modified: head/release/Makefile.bsdinstall Modified: head/release/Makefile.bsdinstall ============================================================================== --- head/release/Makefile.bsdinstall Sat Mar 12 22:48:51 2011 (r219583) +++ head/release/Makefile.bsdinstall Sun Mar 13 01:38:24 2011 (r219584) @@ -41,6 +41,14 @@ EXTRA_PACKAGES+= src.txz EXTRA_PACKAGES+= reldoc .endif +RELEASE_TARGETS= ftp +.if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) +RELEASE_TARGETS+= cdrom +.endif +.if exists(${.CURDIR}/${TARGET}/make-memstick.sh) +RELEASE_TARGETS+= memstick +.endif + .include base.txz: @@ -70,9 +78,9 @@ reldoc: cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc -mkdir ${.OBJDIR}/reldoc .for i in hardware readme relnotes errata - ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/$i/article.txt \ + ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/${i}/article.txt \ ${.OBJDIR}/reldoc/${i:U}.TXT - ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/$i/article.html \ + ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/${i}/article.html \ ${.OBJDIR}/reldoc/${i:U}.HTM .endfor @cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/readme/docbook.css ${.OBJDIR}/reldoc @@ -99,18 +107,22 @@ system: packagesystem release.iso: system echo kernel_options=\"-C\" > ${.OBJDIR}/release/boot/loader.conf - sh /usr/src/release/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.OBJDIR}/release.iso ${.OBJDIR}/release + sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.OBJDIR}/release.iso ${.OBJDIR}/release rm ${.OBJDIR}/release/boot/loader.conf +memstick: system + sh ${.CURDIR}/${TARGET}/make-memstick.sh ${.OBJDIR}/release ${.OBJDIR}/memstick + packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} touch ${.OBJDIR}/${.TARGET} cdrom: release.iso ftp: packagesystem + rm -rf ${.OBJDIR}/ftp mkdir ${.OBJDIR}/ftp cp ${.OBJDIR}/*.txz ${.OBJDIR}/ftp -release: cdrom ftp +release: ${RELEASE_TARGETS} clean: chflags -R noschg ${.OBJDIR} @@ -119,5 +131,5 @@ clean: rm -f ${.OBJDIR}/*.txz rm -f system rm -rf ${.OBJDIR}/release - rm -f ${.OBJDIR}/release.iso + rm -f ${.OBJDIR}/release.iso ${.OBJDIR}/memstick Copied: head/release/amd64/make-memstick.sh (from r219487, head/release/scripts/make-memstick.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/amd64/make-memstick.sh Sun Mar 13 01:38:24 2011 (r219584, copy of r219487, head/release/scripts/make-memstick.sh) @@ -0,0 +1,83 @@ +#!/bin/sh +# +# This script generates a "memstick image" (image that can be copied to a +# USB memory stick) from a directory tree. Note that the script does not +# clean up after itself very well for error conditions on purpose so the +# problem can be diagnosed (full filesystem most likely but ...). +# +# Usage: make-memstick.sh +# +# $FreeBSD$ +# + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +export PATH + +BLOCKSIZE=10240 + +if [ $# -ne 2 ]; then + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 +fi + +tempfile="${2}.$$" + +if [ ! -d ${1} ]; then + echo "${1} must be a directory" + exit 1 +fi + +if [ -e ${2} ]; then + echo "won't overwrite ${2}" + exit 1 +fi + +rm -f ${tempfile} +makefs ${tempfile} ${1} +if [ $? -ne 0 ]; then + echo "makefs failed" + exit 1 +fi + +# +# Use $BLOCKSIZE for transfers to improve efficiency. When calculating +# how many blocks to transfer "+ 2" is to account for truncation in the +# division and to provide space for the label. +# + +filesize=`stat -f "%z" ${tempfile}` +blocks=$(($filesize / ${BLOCKSIZE} + 2)) +dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} +if [ $? -ne 0 ]; then + echo "creation of image file failed" + exit 1 +fi + +unit=`mdconfig -a -t vnode -f ${2}` +if [ $? -ne 0 ]; then + echo "mdconfig failed" + exit 1 +fi + +fdisk -BIq /dev/${unit} +if [ $? -ne 0 ]; then + echo "fdisk failed" + exit 1 +fi + +bsdlabel -B -w /dev/${unit} +if [ $? -ne 0 ]; then + echo "bsdlabel failed" + exit 1 +fi + +dd if=${tempfile} of=/dev/${unit}a bs=$BLOCKSIZE conv=sync +if [ $? -ne 0 ]; then + echo "copying filesystem into image file failed" + exit 1 +fi + +mdconfig -d -u ${unit} + +rm -f ${tempfile} + Copied: head/release/i386/make-memstick.sh (from r219487, head/release/scripts/make-memstick.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/i386/make-memstick.sh Sun Mar 13 01:38:24 2011 (r219584, copy of r219487, head/release/scripts/make-memstick.sh) @@ -0,0 +1,83 @@ +#!/bin/sh +# +# This script generates a "memstick image" (image that can be copied to a +# USB memory stick) from a directory tree. Note that the script does not +# clean up after itself very well for error conditions on purpose so the +# problem can be diagnosed (full filesystem most likely but ...). +# +# Usage: make-memstick.sh +# +# $FreeBSD$ +# + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +export PATH + +BLOCKSIZE=10240 + +if [ $# -ne 2 ]; then + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 +fi + +tempfile="${2}.$$" + +if [ ! -d ${1} ]; then + echo "${1} must be a directory" + exit 1 +fi + +if [ -e ${2} ]; then + echo "won't overwrite ${2}" + exit 1 +fi + +rm -f ${tempfile} +makefs ${tempfile} ${1} +if [ $? -ne 0 ]; then + echo "makefs failed" + exit 1 +fi + +# +# Use $BLOCKSIZE for transfers to improve efficiency. When calculating +# how many blocks to transfer "+ 2" is to account for truncation in the +# division and to provide space for the label. +# + +filesize=`stat -f "%z" ${tempfile}` +blocks=$(($filesize / ${BLOCKSIZE} + 2)) +dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} +if [ $? -ne 0 ]; then + echo "creation of image file failed" + exit 1 +fi + +unit=`mdconfig -a -t vnode -f ${2}` +if [ $? -ne 0 ]; then + echo "mdconfig failed" + exit 1 +fi + +fdisk -BIq /dev/${unit} +if [ $? -ne 0 ]; then + echo "fdisk failed" + exit 1 +fi + +bsdlabel -B -w /dev/${unit} +if [ $? -ne 0 ]; then + echo "bsdlabel failed" + exit 1 +fi + +dd if=${tempfile} of=/dev/${unit}a bs=$BLOCKSIZE conv=sync +if [ $? -ne 0 ]; then + echo "copying filesystem into image file failed" + exit 1 +fi + +mdconfig -d -u ${unit} + +rm -f ${tempfile} + From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 05:30:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 302CD106564A; Sun, 13 Mar 2011 05:30:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A6058FC13; Sun, 13 Mar 2011 05:30: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 p2D5UEZF041665; Sun, 13 Mar 2011 05:30:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D5UEfC041660; Sun, 13 Mar 2011 05:30:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103130530.p2D5UEfC041660@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Mar 2011 05:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219585 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 05:30:15 -0000 Author: adrian Date: Sun Mar 13 05:30:14 2011 New Revision: 219585 URL: http://svn.freebsd.org/changeset/base/219585 Log: * Add in some board settings debugging to log what's being written to the TX closed-loop power control registers. * Modify a couple of functions to take the register chain number, rather than the regChainOffset value. This allows for the register chain to be logged. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Mar 13 01:38:24 2011 (r219584) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Mar 13 05:30:14 2011 (r219585) @@ -249,13 +249,13 @@ extern void ar5416GetGainBoundariesAndPd uint16_t * pPdGainBoundaries, uint8_t * pPDADCValues, uint16_t numXpdGains); extern void ar5416SetGainBoundariesClosedLoop(struct ath_hal *ah, - int regChainOffset, uint16_t pdGainOverlap_t2, + int i, uint16_t pdGainOverlap_t2, uint16_t gainBoundaries[]); extern uint16_t ar5416GetXpdGainValues(struct ath_hal *ah, uint16_t xpdMask, uint16_t xpdGainValues[]); extern void ar5416WriteDetectorGainBiases(struct ath_hal *ah, uint16_t numXpdGain, uint16_t xpdGainValues[]); -extern void ar5416WritePdadcValues(struct ath_hal *ah, int regChainOffset, +extern void ar5416WritePdadcValues(struct ath_hal *ah, int i, uint8_t pdadcValues[]); extern HAL_BOOL ar5416SetPowerCalTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Mar 13 01:38:24 2011 (r219584) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Mar 13 05:30:14 2011 (r219585) @@ -1944,9 +1944,17 @@ ar5416GetTargetPowersLeg(struct ath_hal * target TX power. */ void -ar5416SetGainBoundariesClosedLoop(struct ath_hal *ah, int regChainOffset, +ar5416SetGainBoundariesClosedLoop(struct ath_hal *ah, int i, uint16_t pdGainOverlap_t2, uint16_t gainBoundaries[]) { + int regChainOffset; + + regChainOffset = ar5416GetRegChainOffset(ah, i); + + HALDEBUG(ah, HAL_DEBUG_EEPROM, "%s: chain %d: gainOverlap_t2: %d," + " gainBoundaries: %d, %d, %d, %d\n", __func__, i, pdGainOverlap_t2, + gainBoundaries[0], gainBoundaries[1], gainBoundaries[2], + gainBoundaries[3]); OS_REG_WRITE(ah, AR_PHY_TPCRG5 + regChainOffset, SM(pdGainOverlap_t2, AR_PHY_TPCRG5_PD_GAIN_OVERLAP) | SM(gainBoundaries[0], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1) | @@ -1998,6 +2006,10 @@ void ar5416WriteDetectorGainBiases(struct ath_hal *ah, uint16_t numXpdGain, uint16_t xpdGainValues[]) { + HALDEBUG(ah, HAL_DEBUG_EEPROM, "%s: numXpdGain: %d," + " xpdGainValues: %d, %d, %d\n", __func__, numXpdGain, + xpdGainValues[0], xpdGainValues[1], xpdGainValues[2]); + OS_REG_WRITE(ah, AR_PHY_TPCRG1, (OS_REG_READ(ah, AR_PHY_TPCRG1) & ~(AR_PHY_TPCRG1_NUM_PD_GAIN | AR_PHY_TPCRG1_PD_GAIN_1 | AR_PHY_TPCRG1_PD_GAIN_2 | AR_PHY_TPCRG1_PD_GAIN_3)) | @@ -2008,20 +2020,20 @@ ar5416WriteDetectorGainBiases(struct ath } /* - * Write the PDADC array to the given chain offset. + * Write the PDADC array to the given radio chain i. * * The 32 PDADC registers are written without any care about * their contents - so if various chips treat values as "special", * this routine will not care. */ void -ar5416WritePdadcValues(struct ath_hal *ah, int regChainOffset, - uint8_t pdadcValues[]) +ar5416WritePdadcValues(struct ath_hal *ah, int i, uint8_t pdadcValues[]) { - int regOffset; + int regOffset, regChainOffset; int j; int reg32; + regChainOffset = ar5416GetRegChainOffset(ah, i); regOffset = AR_PHY_BASE + (672 << 2) + regChainOffset; for (j = 0; j < 32; j++) { @@ -2030,16 +2042,14 @@ ar5416WritePdadcValues(struct ath_hal *a ((pdadcValues[4*j + 2] & 0xFF) << 16) | ((pdadcValues[4*j + 3] & 0xFF) << 24) ; OS_REG_WRITE(ah, regOffset, reg32); -#ifdef PDADC_DUMP - ath_hal_printf(ah, "PDADC: Chain %d | PDADC %3d Value %3d |" + HALDEBUG(ah, HAL_DEBUG_EEPROM, "PDADC: Chain %d |" " PDADC %3d Value %3d | PDADC %3d Value %3d | PDADC %3d" - " Value %3d |\n", + " Value %3d | PDADC %3d Value %3d |\n", i, 4*j, pdadcValues[4*j], 4*j+1, pdadcValues[4*j + 1], 4*j+2, pdadcValues[4*j + 2], 4*j+3, pdadcValues[4*j + 3]); -#endif regOffset += 4; } } @@ -2108,12 +2118,12 @@ ar5416SetPowerCalTable(struct ath_hal *a pdadcValues, numXpdGain); if ((i == 0) || AR_SREV_OWL_20_OR_LATER(ah)) { - ar5416SetGainBoundariesClosedLoop(ah, regChainOffset, - pdGainOverlap_t2, gainBoundaries); + ar5416SetGainBoundariesClosedLoop(ah, i, pdGainOverlap_t2, + gainBoundaries); } /* Write the power values into the baseband power table */ - ar5416WritePdadcValues(ah, regChainOffset, pdadcValues); + ar5416WritePdadcValues(ah, i, pdadcValues); } } *pTxPowerIndexOffset = 0; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Sun Mar 13 01:38:24 2011 (r219584) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Sun Mar 13 05:30:14 2011 (r219585) @@ -231,13 +231,20 @@ ar9280AdjustPDADCValues(struct ath_hal * * to the open-loop TX power control. */ static void -ar9280SetGainBoundariesOpenLoop(struct ath_hal *ah, int regChainOffset, +ar9280SetGainBoundariesOpenLoop(struct ath_hal *ah, int i, uint16_t pdGainOverlap_t2, uint16_t gainBoundaries[]) { + int regChainOffset; + + regChainOffset = ar5416GetRegChainOffset(ah, i); + /* These are unused for OLC */ (void) pdGainOverlap_t2; (void) gainBoundaries; + HALDEBUG(ah, HAL_DEBUG_EEPROM, "%s: chain %d: writing closed loop values\n", + __func__, i); + OS_REG_WRITE(ah, AR_PHY_TPCRG5 + regChainOffset, SM(0x6, AR_PHY_TPCRG5_PD_GAIN_OVERLAP) | SM(0x38, AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1) | @@ -366,11 +373,11 @@ ar9280SetPowerCalTable(struct ath_hal *a if (AR_SREV_MERLIN_20_OR_LATER(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) ar9280SetGainBoundariesOpenLoop(ah, - regChainOffset, pdGainOverlap_t2, + i, pdGainOverlap_t2, gainBoundaries); else ar5416SetGainBoundariesClosedLoop(ah, - regChainOffset, pdGainOverlap_t2, + i, pdGainOverlap_t2, gainBoundaries); } @@ -383,7 +390,7 @@ ar9280SetPowerCalTable(struct ath_hal *a ar9280AdjustPDADCValues(ah, pwr_table_offset, diff, pdadcValues); /* Write the power values into the baseband power table */ - ar5416WritePdadcValues(ah, regChainOffset, pdadcValues); + ar5416WritePdadcValues(ah, i, pdadcValues); } } *pTxPowerIndexOffset = 0; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Sun Mar 13 01:38:24 2011 (r219584) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Sun Mar 13 05:30:14 2011 (r219585) @@ -603,11 +603,11 @@ ar9285SetPowerCalTable(struct ath_hal *a * negative or greater than 0. Need to offset the power * values by the amount of minPower for griffin */ - ar5416SetGainBoundariesClosedLoop(ah, regChainOffset, pdGainOverlap_t2, gainBoundaries); + ar5416SetGainBoundariesClosedLoop(ah, i, pdGainOverlap_t2, gainBoundaries); } /* Write the power values into the baseband power table */ - ar5416WritePdadcValues(ah, regChainOffset, pdadcValues); + ar5416WritePdadcValues(ah, i, pdadcValues); } } *pTxPowerIndexOffset = 0; From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 05:54:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 494A8106566B; Sun, 13 Mar 2011 05:54:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36D708FC12; Sun, 13 Mar 2011 05:54: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 p2D5s6t2043946; Sun, 13 Mar 2011 05:54:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D5s6ll043939; Sun, 13 Mar 2011 05:54:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103130554.p2D5s6ll043939@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Mar 2011 05:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219586 - in head/sys/dev/ath/ath_hal: . ar5416 ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 05:54:06 -0000 Author: adrian Date: Sun Mar 13 05:54:05 2011 New Revision: 219586 URL: http://svn.freebsd.org/changeset/base/219586 Log: Move out some of the shared eeprom board value calculation routines into ah.c rather than duplicating them for the v14 (ar5416+) and v4k (ar9285) codebases. Further chipsets (eg the AR9287) have yet another EEPROM format which will use these routines to calculate things. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Sun Mar 13 05:30:14 2011 (r219585) +++ head/sys/dev/ath/ath_hal/ah.c Sun Mar 13 05:54:05 2011 (r219586) @@ -986,3 +986,115 @@ ath_hal_ini_bank_write(struct ath_hal *a } return regWr; } + +/* + * These are EEPROM board related routines which should likely live in + * a helper library of some sort. + */ + +/************************************************************** + * ath_ee_getLowerUppderIndex + * + * Return indices surrounding the value in sorted integer lists. + * Requirement: the input list must be monotonically increasing + * and populated up to the list size + * Returns: match is set if an index in the array matches exactly + * or a the target is before or after the range of the array. + */ +HAL_BOOL +ath_ee_getLowerUpperIndex(uint8_t target, uint8_t *pList, uint16_t listSize, + uint16_t *indexL, uint16_t *indexR) +{ + uint16_t i; + + /* + * Check first and last elements for beyond ordered array cases. + */ + if (target <= pList[0]) { + *indexL = *indexR = 0; + return AH_TRUE; + } + if (target >= pList[listSize-1]) { + *indexL = *indexR = (uint16_t)(listSize - 1); + return AH_TRUE; + } + + /* look for value being near or between 2 values in list */ + for (i = 0; i < listSize - 1; i++) { + /* + * If value is close to the current value of the list + * then target is not between values, it is one of the values + */ + if (pList[i] == target) { + *indexL = *indexR = i; + return AH_TRUE; + } + /* + * Look for value being between current value and next value + * if so return these 2 values + */ + if (target < pList[i + 1]) { + *indexL = i; + *indexR = (uint16_t)(i + 1); + return AH_FALSE; + } + } + HALASSERT(0); + *indexL = *indexR = 0; + return AH_FALSE; +} + +/************************************************************** + * ath_ee_FillVpdTable + * + * Fill the Vpdlist for indices Pmax-Pmin + * Note: pwrMin, pwrMax and Vpdlist are all in dBm * 4 + */ +HAL_BOOL +ath_ee_FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, uint8_t *pPwrList, + uint8_t *pVpdList, uint16_t numIntercepts, uint8_t *pRetVpdList) +{ + uint16_t i, k; + uint8_t currPwr = pwrMin; + uint16_t idxL, idxR; + + HALASSERT(pwrMax > pwrMin); + for (i = 0; i <= (pwrMax - pwrMin) / 2; i++) { + ath_ee_getLowerUpperIndex(currPwr, pPwrList, numIntercepts, + &(idxL), &(idxR)); + if (idxR < 1) + idxR = 1; /* extrapolate below */ + if (idxL == numIntercepts - 1) + idxL = (uint16_t)(numIntercepts - 2); /* extrapolate above */ + if (pPwrList[idxL] == pPwrList[idxR]) + k = pVpdList[idxL]; + else + k = (uint16_t)( ((currPwr - pPwrList[idxL]) * pVpdList[idxR] + (pPwrList[idxR] - currPwr) * pVpdList[idxL]) / + (pPwrList[idxR] - pPwrList[idxL]) ); + HALASSERT(k < 256); + pRetVpdList[i] = (uint8_t)k; + currPwr += 2; /* half dB steps */ + } + + return AH_TRUE; +} + +/************************************************************************** + * ath_ee_interpolate + * + * Returns signed interpolated or the scaled up interpolated value + */ +int16_t +ath_ee_interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight, + int16_t targetLeft, int16_t targetRight) +{ + int16_t rv; + + if (srcRight == srcLeft) { + rv = targetLeft; + } else { + rv = (int16_t)( ((target - srcLeft) * targetRight + + (srcRight - target) * targetLeft) / (srcRight - srcLeft) ); + } + return rv; +} Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sun Mar 13 05:30:14 2011 (r219585) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sun Mar 13 05:54:05 2011 (r219586) @@ -784,4 +784,14 @@ extern int ath_hal_ini_bank_write(struct #define TURBO_SYMBOL_TIME 4 #define WLAN_CTRL_FRAME_SIZE (2+2+6+4) /* ACK+FCS */ + +/* Generic EEPROM board value functions */ +extern HAL_BOOL ath_ee_getLowerUpperIndex(uint8_t target, uint8_t *pList, + uint16_t listSize, uint16_t *indexL, uint16_t *indexR); +extern HAL_BOOL ath_ee_FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, + uint8_t *pPwrList, uint8_t *pVpdList, uint16_t numIntercepts, + uint8_t *pRetVpdList); +extern int16_t ath_ee_interpolate(uint16_t target, uint16_t srcLeft, + uint16_t srcRight, int16_t targetLeft, int16_t targetRight); + #endif /* _ATH_AH_INTERAL_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Mar 13 05:30:14 2011 (r219585) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Mar 13 05:54:05 2011 (r219586) @@ -237,11 +237,6 @@ extern void ar5416InitChainMasks(struct extern void ar5416RestoreChainMask(struct ath_hal *ah); /* TX power setup related routines in ar5416_reset.c */ -extern HAL_BOOL getLowerUpperIndex(uint8_t target, uint8_t *pList, - uint16_t listSize, uint16_t *indexL, uint16_t *indexR); -extern HAL_BOOL ar5416FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, - uint8_t *pPwrList, uint8_t *pVpdList, uint16_t numIntercepts, - uint8_t *pRetVpdList); extern void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet, uint8_t * bChans, uint16_t availPiers, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Mar 13 05:30:14 2011 (r219585) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Mar 13 05:54:05 2011 (r219586) @@ -63,9 +63,6 @@ static HAL_BOOL ar5416SetPowerPerRateTab uint16_t powerLimit); static uint16_t ar5416GetMaxEdgePower(uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz); - -static int16_t interpolate(uint16_t target, uint16_t srcLeft, - uint16_t srcRight, int16_t targetLeft, int16_t targetRight); static void ar5416Set11nRegs(struct ath_hal *ah, const struct ieee80211_channel *chan); /* @@ -1864,7 +1861,7 @@ ar5416GetTargetPowers(struct ath_hal *ah chi = fbin2freq(powInfo[lowIndex + 1].bChannel, IEEE80211_IS_CHAN_2GHZ(chan)); for (i = 0; i < numRates; i++) { - pNewPower->tPow2x[i] = (uint8_t)interpolate(freq, clo, chi, + pNewPower->tPow2x[i] = (uint8_t)ath_ee_interpolate(freq, clo, chi, powInfo[lowIndex].tPow2x[i], powInfo[lowIndex + 1].tPow2x[i]); } } @@ -1924,7 +1921,7 @@ ar5416GetTargetPowersLeg(struct ath_hal chi = fbin2freq(powInfo[lowIndex + 1].bChannel, IEEE80211_IS_CHAN_2GHZ(chan)); for (i = 0; i < numRates; i++) { - pNewPower->tPow2x[i] = (uint8_t)interpolate(freq, clo, chi, + pNewPower->tPow2x[i] = (uint8_t)ath_ee_interpolate(freq, clo, chi, powInfo[lowIndex].tPow2x[i], powInfo[lowIndex + 1].tPow2x[i]); } } @@ -2179,15 +2176,15 @@ ar5416GetGainBoundariesAndPdadcs(struct } /* Find pier indexes around the current channel */ - match = getLowerUpperIndex((uint8_t)FREQ2FBIN(centers.synth_center, IEEE80211_IS_CHAN_2GHZ(chan)), - bChans, numPiers, &idxL, &idxR); + match = ath_ee_getLowerUpperIndex((uint8_t)FREQ2FBIN(centers.synth_center, + IEEE80211_IS_CHAN_2GHZ(chan)), bChans, numPiers, &idxL, &idxR); if (match) { /* Directly fill both vpd tables from the matching index */ for (i = 0; i < numXpdGains; i++) { minPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][0]; maxPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][4]; - ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pRawDataSet[idxL].pwrPdg[i], + ath_ee_FillVpdTable(minPwrT4[i], maxPwrT4[i], pRawDataSet[idxL].pwrPdg[i], pRawDataSet[idxL].vpdPdg[i], AR5416_PD_GAIN_ICEPTS, vpdTableI[i]); } } else { @@ -2205,12 +2202,13 @@ ar5416GetGainBoundariesAndPdadcs(struct HALASSERT(maxPwrT4[i] > minPwrT4[i]); /* Fill pier Vpds */ - ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrL, pVpdL, AR5416_PD_GAIN_ICEPTS, vpdTableL[i]); - ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrR, pVpdR, AR5416_PD_GAIN_ICEPTS, vpdTableR[i]); + ath_ee_FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrL, pVpdL, AR5416_PD_GAIN_ICEPTS, vpdTableL[i]); + ath_ee_FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrR, pVpdR, AR5416_PD_GAIN_ICEPTS, vpdTableR[i]); /* Interpolate the final vpd */ for (j = 0; j <= (maxPwrT4[i] - minPwrT4[i]) / 2; j++) { - vpdTableI[i][j] = (uint8_t)(interpolate((uint16_t)FREQ2FBIN(centers.synth_center, IEEE80211_IS_CHAN_2GHZ(chan)), + vpdTableI[i][j] = (uint8_t)(ath_ee_interpolate((uint16_t)FREQ2FBIN(centers.synth_center, + IEEE80211_IS_CHAN_2GHZ(chan)), bChans[idxL], bChans[idxR], vpdTableL[i][j], vpdTableR[i][j])); } } @@ -2299,113 +2297,6 @@ ar5416GetGainBoundariesAndPdadcs(struct return; } -/************************************************************** - * getLowerUppderIndex - * - * Return indices surrounding the value in sorted integer lists. - * Requirement: the input list must be monotonically increasing - * and populated up to the list size - * Returns: match is set if an index in the array matches exactly - * or a the target is before or after the range of the array. - */ -HAL_BOOL -getLowerUpperIndex(uint8_t target, uint8_t *pList, uint16_t listSize, - uint16_t *indexL, uint16_t *indexR) -{ - uint16_t i; - - /* - * Check first and last elements for beyond ordered array cases. - */ - if (target <= pList[0]) { - *indexL = *indexR = 0; - return AH_TRUE; - } - if (target >= pList[listSize-1]) { - *indexL = *indexR = (uint16_t)(listSize - 1); - return AH_TRUE; - } - - /* look for value being near or between 2 values in list */ - for (i = 0; i < listSize - 1; i++) { - /* - * If value is close to the current value of the list - * then target is not between values, it is one of the values - */ - if (pList[i] == target) { - *indexL = *indexR = i; - return AH_TRUE; - } - /* - * Look for value being between current value and next value - * if so return these 2 values - */ - if (target < pList[i + 1]) { - *indexL = i; - *indexR = (uint16_t)(i + 1); - return AH_FALSE; - } - } - HALASSERT(0); - *indexL = *indexR = 0; - return AH_FALSE; -} - -/************************************************************** - * ar5416FillVpdTable - * - * Fill the Vpdlist for indices Pmax-Pmin - * Note: pwrMin, pwrMax and Vpdlist are all in dBm * 4 - */ -HAL_BOOL -ar5416FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, uint8_t *pPwrList, - uint8_t *pVpdList, uint16_t numIntercepts, uint8_t *pRetVpdList) -{ - uint16_t i, k; - uint8_t currPwr = pwrMin; - uint16_t idxL, idxR; - - HALASSERT(pwrMax > pwrMin); - for (i = 0; i <= (pwrMax - pwrMin) / 2; i++) { - getLowerUpperIndex(currPwr, pPwrList, numIntercepts, - &(idxL), &(idxR)); - if (idxR < 1) - idxR = 1; /* extrapolate below */ - if (idxL == numIntercepts - 1) - idxL = (uint16_t)(numIntercepts - 2); /* extrapolate above */ - if (pPwrList[idxL] == pPwrList[idxR]) - k = pVpdList[idxL]; - else - k = (uint16_t)( ((currPwr - pPwrList[idxL]) * pVpdList[idxR] + (pPwrList[idxR] - currPwr) * pVpdList[idxL]) / - (pPwrList[idxR] - pPwrList[idxL]) ); - HALASSERT(k < 256); - pRetVpdList[i] = (uint8_t)k; - currPwr += 2; /* half dB steps */ - } - - return AH_TRUE; -} - -/************************************************************************** - * interpolate - * - * Returns signed interpolated or the scaled up interpolated value - */ -static int16_t -interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight, - int16_t targetLeft, int16_t targetRight) -{ - int16_t rv; - - if (srcRight == srcLeft) { - rv = targetLeft; - } else { - rv = (int16_t)( ((target - srcLeft) * targetRight + - (srcRight - target) * targetLeft) / (srcRight - srcLeft) ); - } - return rv; -} - /* * The linux ath9k driver and (from what I've been told) the reference * Atheros driver enables the 11n PHY by default whether or not it's Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Sun Mar 13 05:30:14 2011 (r219585) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Sun Mar 13 05:54:05 2011 (r219586) @@ -67,7 +67,7 @@ ar9280olcGetTxGainIndex(struct ath_hal * if (calChans[numPiers] == AR5416_BCHAN_UNUSED) break; - match = getLowerUpperIndex((uint8_t)FREQ2FBIN(centers.synth_center, + match = ath_ee_getLowerUpperIndex((uint8_t)FREQ2FBIN(centers.synth_center, IEEE80211_IS_CHAN_2GHZ(chan)), calChans, numPiers, &idxL, &idxR); if (match) { Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Sun Mar 13 05:30:14 2011 (r219585) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Sun Mar 13 05:54:05 2011 (r219586) @@ -57,8 +57,6 @@ static HAL_BOOL ar9285SetPowerCalTable(s struct ar5416eeprom_4k *pEepData, const struct ieee80211_channel *chan, int16_t *pTxPowerIndexOffset); -static int16_t interpolate(uint16_t target, uint16_t srcLeft, - uint16_t srcRight, int16_t targetLeft, int16_t targetRight); static void ar9285GetGainBoundariesAndPdadcs(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ_4K *pRawDataSet, uint8_t * bChans, uint16_t availPiers, @@ -657,15 +655,15 @@ ar9285GetGainBoundariesAndPdadcs(struct } /* Find pier indexes around the current channel */ - match = getLowerUpperIndex((uint8_t)FREQ2FBIN(centers.synth_center, IEEE80211_IS_CHAN_2GHZ(chan)), - bChans, numPiers, &idxL, &idxR); + match = ath_ee_getLowerUpperIndex((uint8_t)FREQ2FBIN(centers.synth_center, + IEEE80211_IS_CHAN_2GHZ(chan)), bChans, numPiers, &idxL, &idxR); if (match) { /* Directly fill both vpd tables from the matching index */ for (i = 0; i < numXpdGains; i++) { minPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][0]; maxPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][4]; - ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], + ath_ee_FillVpdTable(minPwrT4[i], maxPwrT4[i], pRawDataSet[idxL].pwrPdg[i], pRawDataSet[idxL].vpdPdg[i], AR5416_PD_GAIN_ICEPTS, vpdTableI[i]); @@ -685,14 +683,15 @@ ar9285GetGainBoundariesAndPdadcs(struct HALASSERT(maxPwrT4[i] > minPwrT4[i]); /* Fill pier Vpds */ - ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrL, pVpdL, + ath_ee_FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrL, pVpdL, AR5416_PD_GAIN_ICEPTS, vpdTableL[i]); - ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrR, pVpdR, + ath_ee_FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrR, pVpdR, AR5416_PD_GAIN_ICEPTS, vpdTableR[i]); /* Interpolate the final vpd */ for (j = 0; j <= (maxPwrT4[i] - minPwrT4[i]) / 2; j++) { - vpdTableI[i][j] = (uint8_t)(interpolate((uint16_t)FREQ2FBIN(centers.synth_center, IEEE80211_IS_CHAN_2GHZ(chan)), + vpdTableI[i][j] = (uint8_t)(ath_ee_interpolate((uint16_t)FREQ2FBIN(centers.synth_center, + IEEE80211_IS_CHAN_2GHZ(chan)), bChans[idxL], bChans[idxR], vpdTableL[i][j], vpdTableR[i][j])); } } @@ -780,18 +779,3 @@ ar9285GetGainBoundariesAndPdadcs(struct } return; } - -static int16_t -interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight, - int16_t targetLeft, int16_t targetRight) -{ - int16_t rv; - - if (srcRight == srcLeft) { - rv = targetLeft; - } else { - rv = (int16_t)( ((target - srcLeft) * targetRight + - (srcRight - target) * targetLeft) / (srcRight - srcLeft) ); - } - return rv; -} From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 06:35:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8273A106564A; Sun, 13 Mar 2011 06:35:22 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id DF16C8FC0C; Sun, 13 Mar 2011 06:35:21 +0000 (UTC) Received: by qwc9 with SMTP id 9so707673qwc.13 for ; Sat, 12 Mar 2011 22:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=k3PRQRVCsNGc4zdPsY3o5P3/iNvi5kGttLmOmyRXVB4=; b=BJ3ZPInqfwKVJxxJ/EJCYx0QUT0KCbrzgBocNIcnZ82gt9KVVsBZY9inQbQy804HOW UZ6oJqx6AC1ET81zMxG+voJwBcSYGpQYH0/fgPTCwaDKY8VLePboh2GjUHksKAgXuLf7 8EIS7QhK89Nsi8eXONYwT21z/28+WtfQse2TA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=fusd5LRUXq3FjgCbIn8OsNgiRngRPkSZN+gLc96VwdTulvyhcrDC0HoG/Aw4KJdLTC E+rOCpFC4eHCLSJZ4lQEPrsmYHwbujvvsVokFzeoBEvZRweA44vjYxgUurp4RyXs64ai RsGLsm11d/E51mbzqOtokWfqHDhjLTnO0f72A= MIME-Version: 1.0 Received: by 10.229.0.202 with SMTP id 10mr140331qcc.173.1299998121087; Sat, 12 Mar 2011 22:35:21 -0800 (PST) Sender: artemb@gmail.com Received: by 10.229.31.83 with HTTP; Sat, 12 Mar 2011 22:35:21 -0800 (PST) In-Reply-To: <20110312211423.00000f34@unknown> References: <201103120909.p2C99P2j010783@svn.freebsd.org> <20110312211423.00000f34@unknown> Date: Sat, 12 Mar 2011 22:35:21 -0800 X-Google-Sender-Auth: YdtpF39b_jbnWdSn02KTQ-d8Rcg Message-ID: From: Artem Belevich To: Alexander Leidinger Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r219561 - in head/sys: cddl/dev/systrace modules/dtrace modules/dtrace/dtraceall modules/dtrace/systrace_freebsd32 modules/dtrace/systrace_linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 06:35:22 -0000 On Sat, Mar 12, 2011 at 12:14 PM, Alexander Leidinger wrote: >> =A0 syscall::xxx:yyy - work on all system calls that match the >> specification syscall:freebsd:xxx:yyy - only native system calls >> =A0 syscall:linux32:xxx:yyy - linux32 compat system calls >> =A0 syscall:freebsd32:xxx:yyy - freebsd32 compat system calls on amd64 > > I am working on some SDT probes for the linuxulator. The way I handle it > there is to use "linuxulator" for the native size, and "linuxulator32" > for the current 32-bit linux emulation on amd64. When the amd64 arch > gets a native linux emulation (dchagin@ has patches) this would allow to > trace both in a sane way. > > Is it possible to have "linux" as the modname on i386? Is it easy to > have both linux syscall types (64 bit and 32 bit) on amd64 in case > native support arrives in this code? Sure. > >> Modified: head/sys/cddl/dev/systrace/systrace.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/cddl/dev/systrace/systrace.c =A0 =A0 Sat Mar 12 08:58:19 >> 2011 =A0(r219560) +++ >> head/sys/cddl/dev/systrace/systrace.c Sat Mar 12 09:09:25 >> 2011 =A0(r219561) @@ -59,17 +59,38 @@ #include >> >> =A0#ifdef LINUX_SYSTRACE >> -#include >> -#include >> -#include >> -#include >> -#include >> +#if defined(__amd64__) >> +#include >> +#include >> +#include >> +#include >> +#elif defined(__i386__) >> +#include >> +#include >> +#include >> +#include > > This looks like there is also support for linux syscalls on 386. It's there, it should work, but I didn't get to test it. >> +#else >> +#error Only i386 and amd64 are supported. >> +#endif >> =A0extern struct sysent linux_sysent[]; >> -#define =A0 =A0 =A0DEVNAME =A0 =A0 =A0 =A0 "dtrace/linsystrace" >> -#define =A0 =A0 =A0PROVNAME =A0 =A0 =A0 =A0"linsyscall" >> +#define =A0 =A0 =A0MODNAME =A0 =A0 =A0 =A0 "linux32" > > But this looks like it will be named linux32 in any case. In the short > term I would prefer: > ---snip--- > #if defined(__amd64__) > #define MODNAME "linux32" > #elif defined(__i386__) > #define MODNAME "linux" > #endif > ---snip--- Makes sense. It's what's done with freebsd syscalls -- 'freebsd' for native syscalls, freebsd32 for 32-bit compat. --Artem From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 06:47:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99AA31065670; Sun, 13 Mar 2011 06:47:12 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 08D4B8FC0A; Sun, 13 Mar 2011 06:47:11 +0000 (UTC) Received: by qwc9 with SMTP id 9so709951qwc.13 for ; Sat, 12 Mar 2011 22:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=DvsGSHRraHOrD1r6ezjPh7oEpCoYfHNoVfv4cV2NVYU=; b=Hgt5X2ucJbOl6BijjmLTw7yg40dkAJXo7Tf+QGMxCtSarLPted9wgiShrhrZY7VR0S yrPGBnmvWFnd/8BrNU0CfQNMkK3ckiOiH8CvCkpd3VMTgXslEM3Om94v3wy2TP/piHsM qmPmyIM/ZcUCoyJleeICQfm9AyB0z/UJgGUK0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=CgXsfsFPw5X9/AYMi6h7uGo+TM8FUvWZ9Dr4BaC0IX1/+hHGjV7H9QsX7WWMsmT1DI Q3V2TtUqedWRM5cLKIwLMBHd1rnybg9buFIlZXiD2enCXkyNumRixLYSRRXiqZ+qDFBK /3IYjNsz1arnbzV4dPKXh64tnRcv5HhoVH0vw= MIME-Version: 1.0 Received: by 10.229.0.202 with SMTP id 10mr136630qcc.173.1299997449607; Sat, 12 Mar 2011 22:24:09 -0800 (PST) Sender: artemb@gmail.com Received: by 10.229.31.83 with HTTP; Sat, 12 Mar 2011 22:24:09 -0800 (PST) In-Reply-To: <20110312205719.00004e67@unknown> References: <201103120851.p2C8phoN010341@svn.freebsd.org> <20110312205719.00004e67@unknown> Date: Sat, 12 Mar 2011 22:24:09 -0800 X-Google-Sender-Auth: BEU7Dt3oqfeYFWiioPw_9dHpv3I Message-ID: From: Artem Belevich To: Alexander Leidinger Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r219559 - in head/sys: amd64/linux32 compat/freebsd32 i386/linux kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 06:47:12 -0000 > I assume this also includes syscall provider support for linux syscalls > on i386. Some questions below. Yes. > >> Modified: head/sys/i386/linux/syscalls.master >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 l_hand= ler_t handler); } >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *= handler); } > > What's wrong with l_handler_t? I don't recall the details, but I believe that the way l_handler_t is defined resulted in compilation errors in generated glue code. Glue generation code relies on '*' before the argument name in order to tell scalars from pointers. l_handler_t was interpreted as a scalar and on i386 where l_handler_t is a pointer, it produced compilation warning. > >> @@ -148,7 +148,7 @@ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 stru= ct timeval *tp, \ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 stru= ct timezone *tzp); } >> =A079 =A0 AUE_SETTIMEOFDAY =A0 =A0 =A0 =A0NOPROTO { int >> settimeofday( \ >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct= timeval *tp, \ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct= timeval *tv, \ > > What's wrong with tp? settimeofday_args has the field named tv. With the argument named tp in the syscalls.master, the glue code generated for systrace provider would attempt to use settimeofday_args->tp and that does not compile. We rely on syscall argument names in syscall.master to match field names in appropriate _args. --Artem From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 07:11:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D16E1065670; Sun, 13 Mar 2011 07:11:05 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id AD4F28FC13; Sun, 13 Mar 2011 07:11:03 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA05123; Sun, 13 Mar 2011 09:10:54 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PyfS2-00007g-Fx; Sun, 13 Mar 2011 09:10:54 +0200 Message-ID: <4D7C6DFC.8020504@freebsd.org> Date: Sun, 13 Mar 2011 09:10:52 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Artem Belevich , Alexander Leidinger References: <201103120909.p2C99P2j010783@svn.freebsd.org> <20110312211423.00000f34@unknown> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219561 - in head/sys: cddl/dev/systrace modules/dtrace modules/dtrace/dtraceall modules/dtrace/systrace_freebsd32 modules/dtrace/systrace_linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 07:11:05 -0000 on 13/03/2011 08:35 Artem Belevich said the following: > On Sat, Mar 12, 2011 at 12:14 PM, Alexander Leidinger > wrote: >> But this looks like it will be named linux32 in any case. In the short >> term I would prefer: >> ---snip--- >> #if defined(__amd64__) >> #define MODNAME "linux32" >> #elif defined(__i386__) >> #define MODNAME "linux" >> #endif >> ---snip--- > > Makes sense. It's what's done with freebsd syscalls -- 'freebsd' for > native syscalls, freebsd32 for 32-bit compat. BTW, in my opinion, it might not make a lot of sense. That is, we can have native and compat FreeBSD system calls, but Linux system calls are always compat and never native, whether the emulation is for the same arch or not. Explicit suffix makes things clearer. But that's just my opinion. A public mailing list may be a better place to discuss this further. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 08:14:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 80126106564A; Sun, 13 Mar 2011 08:14:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from doug-optiplex.ka9q.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 2D78315421B; Sun, 13 Mar 2011 08:14:02 +0000 (UTC) Message-ID: <4D7C7CC9.7010901@FreeBSD.org> Date: Sun, 13 Mar 2011 00:14:01 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110304 Thunderbird/3.1.9 MIME-Version: 1.0 To: Jilles Tjoelker References: <201103122113.p2CLD8LO030205@svn.freebsd.org> <20110312230830.GA269@stack.nl> In-Reply-To: <20110312230830.GA269@stack.nl> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219578 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 08:14:02 -0000 On 03/12/2011 15:08, Jilles Tjoelker wrote: > On Sat, Mar 12, 2011 at 09:13:08PM +0000, Doug Barton wrote: >> Author: dougb >> Date: Sat Mar 12 21:13:08 2011 >> New Revision: 219578 >> URL: http://svn.freebsd.org/changeset/base/219578 > >> Log: >> Use the allexport option in load_rc_config() in order to avoid having >> to repeatedly read the conf files. Depending on what is enabled the >> files are being read anywhere from 15, 30, or more times currently. >> By loading the values in the environment this is reduced to 1, with >> perhaps a couple more, again depending on what is enabled. > > I wonder if it is a good idea to pollute the environment of many daemons > with this. Although sshd and cron clean it up, there is at least one > daemon that passes the environment on. One of those is devd. I think the argument could be made that this is bad behavior on their part, but if it turns out that it starts affecting things negatively we can take another look at it. > While that > saves four /etc/rc.conf reads on my minimalistic 9-current VM, it > implies that devd must be restarted to pick up changes to /etc/rc.conf. > That seems a POLA violation. I'm not sure what you mean by this. We've always required services to be restarted to pick up rc.conf changes. > With the old code, my VM reads rc.conf nine times at boot. One of them > is the initial load, four of them are via devd and the other four are > because rc.d scripts call each other via execve(2) instead of via the > run_rc_script function. The run_rc_script issue is one that should be looked at regardless, you're right. The four that come out of devd are likely instances of things being started via /etc/rc.d in devd.conf. > The latter four can be avoided but the other > five seem unavoidable. > > I found this by adding the following line to /etc/rc.conf: > echo "rc.conf is being read at $(date) by $(ps -p $$ -o pid= -o ppid= -o args=)">/dev/console Yeah, I put something similar in rc.subr, so I think our results are likely equivalent. > (The new code reads rc.conf once.) > >> The speed-up for boot and shutdown is negligible when rc.conf is >> on local disk, noticable when accessing files over NFS, and dramatic >> when pulling rc.conf values from a database. > >> This change also includes a minor optimization to the conditional >> for $_rc_conf_loaded. > > I don't know if we ever supported 'set -u' in rc.d scripts, Not TMK, but I have no plans to MFC this right away, so I'm happy to revisit it if it causes problems. Thanks! Doug > but this > definitely breaks it. To fix this, test "${_rc_conf_loaded-}" instead of > "$_rc_conf_loaded" > >> Modified: >> head/etc/rc.subr >> >> Modified: head/etc/rc.subr >> ============================================================================== >> --- head/etc/rc.subr Sat Mar 12 20:36:52 2011 (r219577) >> +++ head/etc/rc.subr Sat Mar 12 21:13:08 2011 (r219578) >> @@ -998,9 +998,8 @@ load_rc_config() >> err 3 'USAGE: load_rc_config name' >> fi >> >> - if ${_rc_conf_loaded:-false}; then >> - : >> - else >> + if [ -z "$_rc_conf_loaded" ]; then >> + set -o allexport >> if [ -r /etc/defaults/rc.conf ]; then >> debug "Sourcing /etc/defaults/rc.conf" >> . /etc/defaults/rc.conf >> @@ -1010,6 +1009,7 @@ load_rc_config() >> . /etc/rc.conf >> fi >> _rc_conf_loaded=true >> + set +o allexport >> fi >> if [ -f /etc/rc.conf.d/"$_name" ]; then >> debug "Sourcing /etc/rc.conf.d/${_name}" > -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 08:22:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C74E6106566B; Sun, 13 Mar 2011 08:22:46 +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 9B3248FC15; Sun, 13 Mar 2011 08:22: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 p2D8MkqM046831; Sun, 13 Mar 2011 08:22:46 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D8Mk4Z046830; Sun, 13 Mar 2011 08:22:46 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201103130822.p2D8Mk4Z046830@svn.freebsd.org> From: Doug Barton Date: Sun, 13 Mar 2011 08:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219587 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 08:22:46 -0000 Author: dougb Date: Sun Mar 13 08:22:46 2011 New Revision: 219587 URL: http://svn.freebsd.org/changeset/base/219587 Log: Remove the svn:executable property on Makefile Add it on hastd Modified: Directory Properties: head/etc/rc.d/Makefile (props changed) head/etc/rc.d/hastd (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 08:23:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA7501065672; Sun, 13 Mar 2011 08:23:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7A4E8FC1E; Sun, 13 Mar 2011 08:23: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 p2D8Nxsc046888; Sun, 13 Mar 2011 08:23:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D8Nxkh046886; Sun, 13 Mar 2011 08:23:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103130823.p2D8Nxkh046886@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Mar 2011 08:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219588 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 08:23:59 -0000 Author: adrian Date: Sun Mar 13 08:23:59 2011 New Revision: 219588 URL: http://svn.freebsd.org/changeset/base/219588 Log: The number of streams is not based on the interface stream count, but the number of streams needed for that MCS rate. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Sun Mar 13 08:22:46 2011 (r219587) +++ head/sys/dev/ath/if_ath_tx_ht.c Sun Mar 13 08:23:59 2011 (r219588) @@ -98,6 +98,7 @@ ath_rateseries_setup(struct ath_softc *s HAL_11N_RATE_SERIES *series, unsigned int pktlen, uint8_t *rix, uint8_t *try, int flags) { +#define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) struct ieee80211com *ic = ni->ni_ic; struct ath_hal *ah = sc->sc_ah; HAL_BOOL shortPreamble = AH_FALSE; @@ -151,14 +152,15 @@ ath_rateseries_setup(struct ath_softc *s series[i].PktDuration = ath_computedur_ht(pktlen , series[i].Rate - , ic->ic_txstream - , 0 /* disable 20/40 for now */ + , HT_RC_2_STREAMS(series[i].Rate) + , series[i].RateFlags & HAL_RATESERIES_2040 , series[i].RateFlags & HAL_RATESERIES_HALFGI); } else { series[i].PktDuration = ath_hal_computetxtime(ah, rt, pktlen, rix[i], shortPreamble); } } +#undef HT_RC_2_STREAMS } #if 0 From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 08:28:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82A13106564A; Sun, 13 Mar 2011 08:28:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5608B8FC0C; Sun, 13 Mar 2011 08:28: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 p2D8SLp5047009; Sun, 13 Mar 2011 08:28:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D8SLPc047007; Sun, 13 Mar 2011 08:28:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103130828.p2D8SLPc047007@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Mar 2011 08:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219589 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 08:28:21 -0000 Author: adrian Date: Sun Mar 13 08:28:21 2011 New Revision: 219589 URL: http://svn.freebsd.org/changeset/base/219589 Log: Commit FIFO configuration fixes from OpenWRT. This fixes performance issues with if_arge on the AR913x and AR724x. Reference: https://dev.openwrt.org/ticket/6754 Submitted by: Luiz Otavio O Souza Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Sun Mar 13 08:23:59 2011 (r219588) +++ head/sys/mips/atheros/if_arge.c Sun Mar 13 08:28:21 2011 (r219589) @@ -79,6 +79,7 @@ MODULE_DEPEND(arge, miibus, 1, 1, 1); #include #include +#include #include #undef ARGE_DEBUG @@ -400,8 +401,18 @@ arge_attach(device_t dev) ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG0, FIFO_CFG0_ALL << FIFO_CFG0_ENABLE_SHIFT); - ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG1, 0x0fff0000); - ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG2, 0x00001fff); + + switch (ar71xx_soc) { + case AR71XX_SOC_AR7240: + case AR71XX_SOC_AR7241: + case AR71XX_SOC_AR7242: + ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG1, 0x0010ffff); + ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG2, 0x015500aa); + break; + default: + ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG1, 0x0fff0000); + ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG2, 0x00001fff); + } ARGE_WRITE(sc, AR71XX_MAC_FIFO_RX_FILTMATCH, FIFO_RX_FILTMATCH_DEFAULT); @@ -663,6 +674,7 @@ static void arge_set_pll(struct arge_softc *sc, int media, int duplex) { uint32_t cfg, ifcontrol, rx_filtmask; + uint32_t fifo_tx; int if_speed; cfg = ARGE_READ(sc, AR71XX_MAC_CFG2); @@ -701,13 +713,25 @@ arge_set_pll(struct arge_softc *sc, int "Unknown media %d\n", media); } - ARGE_WRITE(sc, AR71XX_MAC_FIFO_TX_THRESHOLD, - 0x008001ff); + switch (ar71xx_soc) { + case AR71XX_SOC_AR7240: + case AR71XX_SOC_AR7241: + case AR71XX_SOC_AR7242: + fifo_tx = 0x01f00140; + break; + case AR71XX_SOC_AR9130: + case AR71XX_SOC_AR9132: + fifo_tx = 0x00780fff; + break; + default: + fifo_tx = 0x008001ff; + } ARGE_WRITE(sc, AR71XX_MAC_CFG2, cfg); ARGE_WRITE(sc, AR71XX_MAC_IFCONTROL, ifcontrol); ARGE_WRITE(sc, AR71XX_MAC_FIFO_RX_FILTMASK, rx_filtmask); + ARGE_WRITE(sc, AR71XX_MAC_FIFO_TX_THRESHOLD, fifo_tx); /* set PLL registers */ if (sc->arge_mac_unit == 0) From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 08:34:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40EF6106566C; Sun, 13 Mar 2011 08:34:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DFF58FC14; Sun, 13 Mar 2011 08:34: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 p2D8YF6K047171; Sun, 13 Mar 2011 08:34:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D8YFEU047168; Sun, 13 Mar 2011 08:34:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103130834.p2D8YFEU047168@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Mar 2011 08:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219590 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 08:34:15 -0000 Author: adrian Date: Sun Mar 13 08:34:14 2011 New Revision: 219590 URL: http://svn.freebsd.org/changeset/base/219590 Log: Fix the TX underrun status reset; remove a now unused variable. Submitted by: Luiz Otavio O Souza Modified: head/sys/mips/atheros/if_arge.c head/sys/mips/atheros/if_argevar.h Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Sun Mar 13 08:28:21 2011 (r219589) +++ head/sys/mips/atheros/if_arge.c Sun Mar 13 08:34:14 2011 (r219590) @@ -1424,7 +1424,6 @@ arge_tx_ring_init(struct arge_softc *sc) sc->arge_cdata.arge_tx_prod = 0; sc->arge_cdata.arge_tx_cons = 0; sc->arge_cdata.arge_tx_cnt = 0; - sc->arge_cdata.arge_tx_pkts = 0; rd = &sc->arge_rdata; bzero(rd->arge_tx_ring, sizeof(rd->arge_tx_ring)); @@ -1784,7 +1783,7 @@ arge_intr(void *arg) */ if (status & DMA_INTR_TX_UNDERRUN) { ARGE_WRITE(sc, AR71XX_DMA_TX_STATUS, DMA_TX_STATUS_UNDERRUN); - if (sc->arge_cdata.arge_tx_pkts > 0 ) { + if (sc->arge_cdata.arge_tx_cnt > 0 ) { ARGE_WRITE(sc, AR71XX_DMA_TX_CONTROL, DMA_TX_CONTROL_EN); } Modified: head/sys/mips/atheros/if_argevar.h ============================================================================== --- head/sys/mips/atheros/if_argevar.h Sun Mar 13 08:28:21 2011 (r219589) +++ head/sys/mips/atheros/if_argevar.h Sun Mar 13 08:34:14 2011 (r219590) @@ -110,7 +110,6 @@ struct arge_chain_data { bus_dmamap_t arge_tx_ring_map; bus_dmamap_t arge_rx_ring_map; bus_dmamap_t arge_rx_sparemap; - int arge_tx_pkts; int arge_tx_prod; int arge_tx_cons; int arge_tx_cnt; From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 08:36:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1E2E106566C; Sun, 13 Mar 2011 08:36:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEEF78FC17; Sun, 13 Mar 2011 08:36: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 p2D8avHG047265; Sun, 13 Mar 2011 08:36:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D8avPd047262; Sun, 13 Mar 2011 08:36:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103130836.p2D8avPd047262@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Mar 2011 08:36:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219591 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 08:36:57 -0000 Author: adrian Date: Sun Mar 13 08:36:57 2011 New Revision: 219591 URL: http://svn.freebsd.org/changeset/base/219591 Log: Add the missing AR724x DDR flush routines for if_arge0. Submitted by: Luiz Otavio O Souza Modified: head/sys/mips/atheros/ar724x_chip.c head/sys/mips/atheros/ar724xreg.h Modified: head/sys/mips/atheros/ar724x_chip.c ============================================================================== --- head/sys/mips/atheros/ar724x_chip.c Sun Mar 13 08:34:14 2011 (r219590) +++ head/sys/mips/atheros/ar724x_chip.c Sun Mar 13 08:36:57 2011 (r219591) @@ -136,11 +136,13 @@ ar724x_chip_set_pll_ge1(int speed) static void ar724x_chip_ddr_flush_ge0(void) { + ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_GE0); } static void ar724x_chip_ddr_flush_ge1(void) { + ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_GE1); } static uint32_t Modified: head/sys/mips/atheros/ar724xreg.h ============================================================================== --- head/sys/mips/atheros/ar724xreg.h Sun Mar 13 08:34:14 2011 (r219590) +++ head/sys/mips/atheros/ar724xreg.h Sun Mar 13 08:36:57 2011 (r219591) @@ -47,6 +47,9 @@ #define AR724X_BASE_FREQ 5000000 +#define AR724X_DDR_REG_FLUSH_GE0 (AR71XX_DDR_CONFIG + 0x7c) +#define AR724X_DDR_REG_FLUSH_GE1 (AR71XX_DDR_CONFIG + 0x80) + #define AR724X_RESET_REG_RESET_MODULE AR71XX_RST_BLOCK_BASE + 0x1c #define AR724X_RESET_MODULE_USB_OHCI_DLL (1 << 3) From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 08:46:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 574841065670; Sun, 13 Mar 2011 08:46:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43A468FC12; Sun, 13 Mar 2011 08:46: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 p2D8kwDa047494; Sun, 13 Mar 2011 08:46:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D8kwj4047492; Sun, 13 Mar 2011 08:46:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103130846.p2D8kwj4047492@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Mar 2011 08:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219592 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 08:46:58 -0000 Author: adrian Date: Sun Mar 13 08:46:58 2011 New Revision: 219592 URL: http://svn.freebsd.org/changeset/base/219592 Log: * Add wireless MAC reset, in prep for bringing over AR9130 support. * Whilst I'm here, reformat to fit inside 80 characters. Modified: head/sys/mips/atheros/ar91xx_chip.c Modified: head/sys/mips/atheros/ar91xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar91xx_chip.c Sun Mar 13 08:36:57 2011 (r219591) +++ head/sys/mips/atheros/ar91xx_chip.c Sun Mar 13 08:46:58 2011 (r219592) @@ -130,10 +130,12 @@ ar91xx_chip_set_pll_ge0(int speed) pll = AR91XX_PLL_VAL_1000; break; default: - printf("ar91xx_chip_set_pll_ge0: invalid speed %d\n", speed); + printf("ar91xx_chip_set_pll_ge0: invalid speed %d\n", + speed); return; } - ar71xx_write_pll(AR91XX_PLL_REG_ETH_CONFIG, AR91XX_PLL_REG_ETH0_INT_CLOCK, pll, AR91XX_ETH0_PLL_SHIFT); + ar71xx_write_pll(AR91XX_PLL_REG_ETH_CONFIG, + AR91XX_PLL_REG_ETH0_INT_CLOCK, pll, AR91XX_ETH0_PLL_SHIFT); } static void @@ -152,10 +154,12 @@ ar91xx_chip_set_pll_ge1(int speed) pll = AR91XX_PLL_VAL_1000; break; default: - printf("ar91xx_chip_set_pll_ge0: invalid speed %d\n", speed); + printf("ar91xx_chip_set_pll_ge0: invalid speed %d\n", + speed); return; } - ar71xx_write_pll(AR91XX_PLL_REG_ETH_CONFIG, AR91XX_PLL_REG_ETH1_INT_CLOCK, pll, AR91XX_ETH1_PLL_SHIFT); + ar71xx_write_pll(AR91XX_PLL_REG_ETH_CONFIG, + AR91XX_PLL_REG_ETH1_INT_CLOCK, pll, AR91XX_ETH1_PLL_SHIFT); } static void @@ -187,6 +191,13 @@ ar91xx_chip_init_usb_peripheral(void) ar71xx_device_start(RST_RESET_USB_PHY); DELAY(100); + + /* Wireless */ + ar71xx_device_stop(AR91XX_RST_RESET_MODULE_AMBA2WMAC); + DELAY(1000); + + ar71xx_device_start(AR91XX_RST_RESET_MODULE_AMBA2WMAC); + DELAY(1000); } struct ar71xx_cpu_def ar91xx_chip_def = { From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 09:36:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9203C1065670; Sun, 13 Mar 2011 09:36:52 +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 7EF268FC08; Sun, 13 Mar 2011 09:36: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 p2D9aq8n048596; Sun, 13 Mar 2011 09:36:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2D9aqKI048594; Sun, 13 Mar 2011 09:36:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201103130936.p2D9aqKI048594@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 13 Mar 2011 09:36: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: r219594 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 09:36:52 -0000 Author: kib Date: Sun Mar 13 09:36:52 2011 New Revision: 219594 URL: http://svn.freebsd.org/changeset/base/219594 Log: MFC r219352: The execution of the shebang script requires putting interpreter path, possible option and script path in the place of argv[0] supplied to execve(2). It is possible and valid for the substitution to be shorter then the argv[0]. Avoid signed underflow in this case. PR: kern/155321 Modified: stable/8/sys/kern/imgact_shell.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/imgact_shell.c ============================================================================== --- stable/8/sys/kern/imgact_shell.c Sun Mar 13 08:59:46 2011 (r219593) +++ stable/8/sys/kern/imgact_shell.c Sun Mar 13 09:36:52 2011 (r219594) @@ -191,7 +191,7 @@ exec_shell_imgact(imgp) length = (imgp->args->argc == 0) ? 0 : strlen(imgp->args->begin_argv) + 1; /* bytes to delete */ - if (offset - length > imgp->args->stringspace) { + if (offset > imgp->args->stringspace + length) { if (sname != NULL) sbuf_delete(sname); return (E2BIG); From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 09:47:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A649106564A; Sun, 13 Mar 2011 09:47:41 +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 D72E38FC17; Sun, 13 Mar 2011 09:47:40 +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 p2D9lbkB046172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Mar 2011 11:47:37 +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 p2D9lbQg049637; Sun, 13 Mar 2011 11:47:37 +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 p2D9lbNX049636; Sun, 13 Mar 2011 11:47:37 +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: Sun, 13 Mar 2011 11:47:37 +0200 From: Kostik Belousov To: Doug Barton Message-ID: <20110313094737.GD78089@deviant.kiev.zoral.com.ua> References: <201103122113.p2CLD8LO030205@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XXsWVrBycM1CuLu1" Content-Disposition: inline In-Reply-To: <201103122113.p2CLD8LO030205@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, 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-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219578 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 09:47:41 -0000 --XXsWVrBycM1CuLu1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 12, 2011 at 09:13:08PM +0000, Doug Barton wrote: > Author: dougb > Date: Sat Mar 12 21:13:08 2011 > New Revision: 219578 > URL: http://svn.freebsd.org/changeset/base/219578 >=20 > Log: > Use the allexport option in load_rc_config() in order to avoid having > to repeatedly read the conf files. Depending on what is enabled the > files are being read anywhere from 15, 30, or more times currently. > By loading the values in the environment this is reduced to 1, with > perhaps a couple more, again depending on what is enabled. > =20 > The speed-up for boot and shutdown is negligible when rc.conf is > on local disk, noticable when accessing files over NFS, and dramatic > when pulling rc.conf values from a database. > =20 > This change also includes a minor optimization to the conditional > for $_rc_conf_loaded. >=20 > Modified: > head/etc/rc.subr >=20 > Modified: head/etc/rc.subr > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/rc.subr Sat Mar 12 20:36:52 2011 (r219577) > +++ head/etc/rc.subr Sat Mar 12 21:13:08 2011 (r219578) > @@ -998,9 +998,8 @@ load_rc_config() > err 3 'USAGE: load_rc_config name' > fi > =20 > - if ${_rc_conf_loaded:-false}; then > - : > - else > + if [ -z "$_rc_conf_loaded" ]; then > + set -o allexport > if [ -r /etc/defaults/rc.conf ]; then > debug "Sourcing /etc/defaults/rc.conf" > . /etc/defaults/rc.conf > @@ -1010,6 +1009,7 @@ load_rc_config() > . /etc/rc.conf > fi > _rc_conf_loaded=3Dtrue > + set +o allexport > fi > if [ -f /etc/rc.conf.d/"$_name" ]; then > debug "Sourcing /etc/rc.conf.d/${_name}" As I read it, the change means that each process started by rc.d got approximately 32kB of non-shared garbage data in its environment ? --XXsWVrBycM1CuLu1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk18krgACgkQC3+MBN1Mb4i9zgCgqsp/UixH81Sek2nWAKqQSs7k dAsAn36JkA6VJ7BDrgBFaXKKE+9XVFi0 =sqcF -----END PGP SIGNATURE----- --XXsWVrBycM1CuLu1-- From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 10:08:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 668AF106564A; Sun, 13 Mar 2011 10:08:02 +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 53C318FC08; Sun, 13 Mar 2011 10:08: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 p2DA82Dx049262; Sun, 13 Mar 2011 10:08:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DA82xf049260; Sun, 13 Mar 2011 10:08:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201103131008.p2DA82xf049260@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 13 Mar 2011 10:08:02 +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: r219595 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 10:08:02 -0000 Author: kib Date: Sun Mar 13 10:08:02 2011 New Revision: 219595 URL: http://svn.freebsd.org/changeset/base/219595 Log: MFC r219352: The execution of the shebang script requires putting interpreter path, possible option and script path in the place of argv[0] supplied to execve(2). It is possible and valid for the substitution to be shorter then the argv[0]. Avoid signed underflow in this case. PR: kern/155321 Modified: stable/7/sys/kern/imgact_shell.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/imgact_shell.c ============================================================================== --- stable/7/sys/kern/imgact_shell.c Sun Mar 13 09:36:52 2011 (r219594) +++ stable/7/sys/kern/imgact_shell.c Sun Mar 13 10:08:02 2011 (r219595) @@ -179,7 +179,7 @@ exec_shell_imgact(imgp) length = (imgp->args->argc == 0) ? 0 : strlen(imgp->args->begin_argv) + 1; /* bytes to delete */ - if (offset - length > imgp->args->stringspace) + if (offset > imgp->args->stringspace + length) { return (E2BIG); bcopy(imgp->args->begin_argv + length, imgp->args->begin_argv + offset, From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 11:40:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18988106566C; Sun, 13 Mar 2011 11:40:19 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E180B8FC0C; Sun, 13 Mar 2011 11:40: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 p2DBeIsZ053441; Sun, 13 Mar 2011 11:40:18 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DBeI8v053438; Sun, 13 Mar 2011 11:40:18 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201103131140.p2DBeI8v053438@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 13 Mar 2011 11:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219596 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 11:40:19 -0000 Author: bschmidt Date: Sun Mar 13 11:40:18 2011 New Revision: 219596 URL: http://svn.freebsd.org/changeset/base/219596 Log: First step on removing the harcoded RX/TX stream and MCS0-15 assumptions. Initialize ic_rxstream/ic_txstream with 2, for compatibility reasons. Introduce 4 new HTC flags, which are used in addition to ic_rxstream and ic_txstream to compute the hc_mcsset content and also for initializing ni_htrates. The number of spatial streams is enough to determine support for MCS0-31 but not for MCS32-76 as well as some TX parameters in the hc_mcsset field. Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Mar 13 10:08:02 2011 (r219595) +++ head/sys/net80211/ieee80211.c Sun Mar 13 11:40:18 2011 (r219596) @@ -206,6 +206,15 @@ ieee80211_chan_init(struct ieee80211com DEFAULTRATES(IEEE80211_MODE_11NG, ieee80211_rateset_11g); /* + * Setup required information to fill the mcsset field, if driver did + * not. Assume a 2T2R setup for historic reasons. + */ + if (ic->ic_rxstream == 0) + ic->ic_rxstream = 2; + if (ic->ic_txstream == 0) + ic->ic_txstream = 2; + + /* * Set auto mode to reset active channel state and any desired channel. */ (void) ieee80211_setmode(ic, IEEE80211_MODE_AUTO); Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sun Mar 13 10:08:02 2011 (r219595) +++ head/sys/net80211/ieee80211_var.h Sun Mar 13 11:40:18 2011 (r219596) @@ -637,6 +637,10 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_HTC_HT 0x00040000 /* CAPABILITY: HT operation */ #define IEEE80211_HTC_SMPS 0x00080000 /* CAPABILITY: MIMO power save*/ #define IEEE80211_HTC_RIFS 0x00100000 /* CAPABILITY: RIFS support */ +#define IEEE80211_HTC_RXUNEQUAL 0x00200000 /* CAPABILITY: RX unequal MCS */ +#define IEEE80211_HTC_RXMCS32 0x00400000 /* CAPABILITY: MCS32 support */ +#define IEEE80211_HTC_TXUNEQUAL 0x00800000 /* CAPABILITY: TX unequal MCS */ +#define IEEE80211_HTC_TXMCS32 0x01000000 /* CAPABILITY: MCS32 suport */ #define IEEE80211_C_HTCAP_BITS \ "\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \ From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 11:44:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF8AB106566B; Sun, 13 Mar 2011 11:44:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E2E98FC0C; Sun, 13 Mar 2011 11:44: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 p2DBiGU7053563; Sun, 13 Mar 2011 11:44:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DBiGeg053561; Sun, 13 Mar 2011 11:44:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201103131144.p2DBiGeg053561@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Mar 2011 11:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219597 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 11:44:16 -0000 Author: bz Date: Sun Mar 13 11:44:16 2011 New Revision: 219597 URL: http://svn.freebsd.org/changeset/base/219597 Log: Cross-reference ip(4) rather than sysctl(8) for the global, shared MIB values to control the various port ranges. ip(4) describes these in detail. MFC after: 13 days Modified: head/share/man/man4/ip6.4 Modified: head/share/man/man4/ip6.4 ============================================================================== --- head/share/man/man4/ip6.4 Sun Mar 13 11:40:18 2011 (r219596) +++ head/share/man/man4/ip6.4 Sun Mar 13 11:44:16 2011 (r219597) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2008 +.Dd March 13, 2011 .Dt IP6 4 .Os .Sh NAME @@ -232,12 +232,13 @@ The following values are available: .Bl -tag -width IPV6_PORTRANGE_DEFAULT -compact .It Dv IPV6_PORTRANGE_DEFAULT Use the regular range of non-reserved ports (varies, see -.Xr sysctl 8 ) . +.Xr ip 4 ) . .It Dv IPV6_PORTRANGE_HIGH Use a high range (varies, see -.Xr sysctl 8 ) . +.Xr ip 4 ) . .It Dv IPV6_PORTRANGE_LOW -Use a low, reserved range (600\-1023). +Use a low, reserved range (600\-1023, see +.Xr ip 4 ) . .El .It Dv IPV6_PKTINFO Fa "int *" Get or set whether additional information about subsequent packets will @@ -655,6 +656,7 @@ An ancillary data object was improperly .Xr if_nametoindex 3 , .Xr bpf 4 , .Xr icmp6 4 , +.Xr ip 4 , .Xr inet6 4 , .Xr netintro 4 , .Xr tcp 4 , From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 11:45:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A19C106566B; Sun, 13 Mar 2011 11:45:59 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 179A48FC18; Sun, 13 Mar 2011 11:45: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 p2DBjw3m053630; Sun, 13 Mar 2011 11:45:58 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DBjwGo053628; Sun, 13 Mar 2011 11:45:58 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201103131145.p2DBjwGo053628@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 13 Mar 2011 11:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219598 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 11:45:59 -0000 Author: bschmidt Date: Sun Mar 13 11:45:58 2011 New Revision: 219598 URL: http://svn.freebsd.org/changeset/base/219598 Log: Change the way HT capatibilities are announced. Get rid of the assumption that every device is capable of 40MHz, SGI and 2 spartial streams. Instead of printing, in the worst case, 8 times 76 MCS rates, print logically connect ranges and the support RX/TX streams. A device without 40MHz and SGI support looks like: ath0: 2T2R ath0: 11na MCS 20Mhz ath0: MCS 0-7: 6.5Mbps - 65Mbps ath0: MCS 8-15: 13Mbps - 130Mbps ath0: 11ng MCS 20Mhz ath0: MCS 0-7: 6.5Mbps - 65Mbps ath0: MCS 8-15: 13Mbps - 130Mbps Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Mar 13 11:44:16 2011 (r219597) +++ head/sys/net80211/ieee80211_ht.c Sun Mar 13 11:45:58 2011 (r219598) @@ -308,68 +308,113 @@ ieee80211_ht_vdetach(struct ieee80211vap { } +static int +ht_getrate(struct ieee80211com *ic, int index, int mode, int ratetype) +{ + int mword, rate; + + mword = ieee80211_rate2media(ic, index | IEEE80211_RATE_MCS, mode); + if (IFM_SUBTYPE(mword) != IFM_IEEE80211_MCS) + return (0); + switch (ratetype) { + case 0: + rate = ieee80211_htrates[index].ht20_rate_800ns; + break; + case 1: + rate = ieee80211_htrates[index].ht20_rate_400ns; + break; + case 2: + rate = ieee80211_htrates[index].ht40_rate_800ns; + break; + default: + rate = ieee80211_htrates[index].ht40_rate_400ns; + break; + } + return (rate); +} + +static struct printranges { + int minmcs; + int maxmcs; + int txstream; + int ratetype; + int htcapflags; +} ranges[] = { + { 0, 7, 1, 0, 0 }, + { 8, 15, 2, 0, 0 }, + { 16, 23, 3, 0, 0 }, + { 24, 31, 4, 0, 0 }, + { 32, 0, 1, 2, IEEE80211_HTC_TXMCS32 }, + { 33, 38, 2, 0, IEEE80211_HTC_TXUNEQUAL }, + { 39, 52, 3, 0, IEEE80211_HTC_TXUNEQUAL }, + { 53, 76, 4, 0, IEEE80211_HTC_TXUNEQUAL }, + { 0, 0, 0, 0, 0 }, +}; + static void -ht_rateprint(struct ieee80211com *ic, int mode, - const struct ieee80211_htrateset *rs, int maxmcs, int ratetype) +ht_rateprint(struct ieee80211com *ic, int mode, int ratetype) { - int i, rate, mword; + struct ifnet *ifp = ic->ic_ifp; + int minrate, maxrate; + struct printranges *range; - for (i = 0; i < rs->rs_nrates && i < maxmcs; i++) { - mword = ieee80211_rate2media(ic, - rs->rs_rates[i] | IEEE80211_RATE_MCS, mode); - if (IFM_SUBTYPE(mword) != IFM_IEEE80211_MCS) + for (range = ranges; range->txstream != 0; range++) { + if (ic->ic_txstream < range->txstream) continue; - switch (ratetype) { - case 0: - rate = ieee80211_htrates[ - rs->rs_rates[i]].ht20_rate_800ns; - break; - case 1: - rate = ieee80211_htrates[ - rs->rs_rates[i]].ht20_rate_400ns; - break; - case 2: - rate = ieee80211_htrates[ - rs->rs_rates[i]].ht40_rate_800ns; - break; - default: - rate = ieee80211_htrates[ - rs->rs_rates[i]].ht40_rate_400ns; - break; + if (range->htcapflags && + (ic->ic_htcaps & range->htcapflags) == 0) + continue; + if (ratetype < range->ratetype) + continue; + minrate = ht_getrate(ic, range->minmcs, mode, ratetype); + maxrate = ht_getrate(ic, range->maxmcs, mode, ratetype); + if (range->maxmcs) { + if_printf(ifp, "MCS %d-%d: %d%sMbps - %d%sMbps\n", + range->minmcs, range->maxmcs, + minrate/2, ((minrate & 0x1) != 0 ? ".5" : ""), + maxrate/2, ((maxrate & 0x1) != 0 ? ".5" : "")); + } else { + if_printf(ifp, "MCS %d: %d%sMbps\n", range->minmcs, + minrate/2, ((minrate & 0x1) != 0 ? ".5" : "")); } - printf("%s%d%sMbps", (i != 0 ? " " : ""), - rate / 2, ((rate & 0x1) != 0 ? ".5" : "")); } - printf("\n"); } static void -ht_announce(struct ieee80211com *ic, int mode, - const struct ieee80211_htrateset *rs) +ht_announce(struct ieee80211com *ic, int mode) { struct ifnet *ifp = ic->ic_ifp; - int maxmcs = 2 * 8; const char *modestr = ieee80211_phymode_name[mode]; - - KASSERT(maxmcs <= 16, ("maxmcs > 16")); - if_printf(ifp, "%d MCS rates\n", maxmcs); - if_printf(ifp, "%s MCS 20Mhz: ", modestr); - ht_rateprint(ic, mode, rs, maxmcs, 0); - if_printf(ifp, "%s MCS 20Mhz SGI: ", modestr); - ht_rateprint(ic, mode, rs, maxmcs, 1); - if_printf(ifp, "%s MCS 40Mhz: ", modestr); - ht_rateprint(ic, mode, rs, maxmcs, 2); - if_printf(ifp, "%s MCS 40Mhz SGI: ", modestr); - ht_rateprint(ic, mode, rs, maxmcs, 3); + + if_printf(ifp, "%s MCS 20Mhz\n", modestr); + ht_rateprint(ic, mode, 0); + if (ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20) { + if_printf(ifp, "%s MCS 20Mhz SGI\n", modestr); + ht_rateprint(ic, mode, 1); + } + if (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) { + if_printf(ifp, "%s MCS 40Mhz:\n", modestr); + ht_rateprint(ic, mode, 2); + } + if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) && + (ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40)) { + if_printf(ifp, "%s MCS 40Mhz SGI:\n", modestr); + ht_rateprint(ic, mode, 3); + } } void ieee80211_ht_announce(struct ieee80211com *ic) { + struct ifnet *ifp = ic->ic_ifp; + + if (isset(ic->ic_modecaps, IEEE80211_MODE_11NA) || + isset(ic->ic_modecaps, IEEE80211_MODE_11NG)) + if_printf(ifp, "%dT%dR\n", ic->ic_txstream, ic->ic_rxstream); if (isset(ic->ic_modecaps, IEEE80211_MODE_11NA)) - ht_announce(ic, IEEE80211_MODE_11NA, &ieee80211_rateset_11n); + ht_announce(ic, IEEE80211_MODE_11NA); if (isset(ic->ic_modecaps, IEEE80211_MODE_11NG)) - ht_announce(ic, IEEE80211_MODE_11NG, &ieee80211_rateset_11n); + ht_announce(ic, IEEE80211_MODE_11NG); } const struct ieee80211_htrateset * From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 11:47:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13AC0106566C; Sun, 13 Mar 2011 11:47:44 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 024758FC16; Sun, 13 Mar 2011 11:47: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 p2DBlhUs053704; Sun, 13 Mar 2011 11:47:43 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DBlhe1053702; Sun, 13 Mar 2011 11:47:43 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201103131147.p2DBlhe1053702@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 13 Mar 2011 11:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219599 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 11:47:44 -0000 Author: bschmidt Date: Sun Mar 13 11:47:43 2011 New Revision: 219599 URL: http://svn.freebsd.org/changeset/base/219599 Log: While determining the maxrate for ieee80211_media_setup() honor the device capabilities. Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Mar 13 11:45:58 2011 (r219598) +++ head/sys/net80211/ieee80211.c Sun Mar 13 11:47:43 2011 (r219599) @@ -1076,10 +1076,18 @@ ieee80211_media_setup(struct ieee80211co isset(ic->ic_modecaps, IEEE80211_MODE_11NG)) { addmedia(media, caps, addsta, IEEE80211_MODE_AUTO, IFM_IEEE80211_MCS); - /* XXX could walk htrates */ - /* XXX known array size */ - if (ieee80211_htrates[15].ht40_rate_400ns > maxrate) - maxrate = ieee80211_htrates[15].ht40_rate_400ns; + i = ic->ic_txstream * 8 - 1; + if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) && + (ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40)) + rate = ieee80211_htrates[i].ht40_rate_400ns; + else if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40)) + rate = ieee80211_htrates[i].ht40_rate_800ns; + else if ((ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20)) + rate = ieee80211_htrates[i].ht20_rate_400ns; + else + rate = ieee80211_htrates[i].ht20_rate_800ns; + if (rate > maxrate) + maxrate = rate; } return maxrate; } From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 11:56:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28C7A1065761; Sun, 13 Mar 2011 11:56:34 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CD868FC12; Sun, 13 Mar 2011 11:56: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 p2DBuXhw053902; Sun, 13 Mar 2011 11:56:33 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DBuXa7053900; Sun, 13 Mar 2011 11:56:33 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201103131156.p2DBuXa7053900@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 13 Mar 2011 11:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219600 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 11:56:34 -0000 Author: bschmidt Date: Sun Mar 13 11:56:33 2011 New Revision: 219600 URL: http://svn.freebsd.org/changeset/base/219600 Log: Fill hc_mcsset completely. Contrary to the rateset information in legacy frames the MCS Set field also contains TX capability information in cases where the number of available TX and RX spartial streams differ. Because a rateset doesn't contain that information we have to pull the those directly from the hardware capabilities. Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Mar 13 11:47:43 2011 (r219599) +++ head/sys/net80211/ieee80211_ht.c Sun Mar 13 11:56:33 2011 (r219600) @@ -2422,21 +2422,49 @@ ht_send_action_ht_txchwidth(struct ieee8 #undef ADDSHORT /* - * Construct the MCS bit mask for inclusion - * in an HT information element. + * Construct the MCS bit mask for inclusion in an HT capabilities + * information element. */ -static void -ieee80211_set_htrates(uint8_t *frm, const struct ieee80211_htrateset *rs) +static void +ieee80211_set_mcsset(struct ieee80211com *ic, uint8_t *frm) { int i; + uint8_t txparams; - for (i = 0; i < rs->rs_nrates; i++) { - int r = rs->rs_rates[i] & IEEE80211_RATE_VAL; - if (r < IEEE80211_HTRATE_MAXSIZE) { /* XXX? */ - /* NB: this assumes a particular implementation */ - setbit(frm, r); + KASSERT((ic->ic_rxstream > 0 && ic->ic_rxstream <= 4), + ("ic_rxstream %d out of range", ic->ic_rxstream)); + KASSERT((ic->ic_txstream > 0 && ic->ic_txstream <= 4), + ("ic_txstream %d out of range", ic->ic_txstream)); + + for (i = 0; i < ic->ic_rxstream * 8; i++) + setbit(frm, i); + if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) && + (ic->ic_htcaps & IEEE80211_HTC_RXMCS32)) + setbit(frm, 32); + if (ic->ic_htcaps & IEEE80211_HTC_RXUNEQUAL) { + if (ic->ic_rxstream >= 2) { + for (i = 33; i <= 38; i++) + setbit(frm, i); + } + if (ic->ic_rxstream >= 3) { + for (i = 39; i <= 52; i++) + setbit(frm, i); + } + if (ic->ic_txstream >= 4) { + for (i = 53; i <= 76; i++) + setbit(frm, i); } } + + if (ic->ic_rxstream != ic->ic_txstream) { + txparams = 0x1; /* TX MCS set defined */ + txparams |= 0x2; /* TX RX MCS not equal */ + txparams |= (ic->ic_txstream - 1) << 2; /* num TX streams */ + if (ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) + txparams |= 0x16; /* TX unequal modulation sup */ + } else + txparams = 0; + frm[12] = txparams; } /* @@ -2502,12 +2530,12 @@ ieee80211_add_htcap_body(uint8_t *frm, s /* supported MCS set */ /* - * XXX it would better to get the rate set from ni_htrates - * so we can restrict it but for sta mode ni_htrates isn't - * setup when we're called to form an AssocReq frame so for - * now we're restricted to the default HT rate set. + * XXX: For sta mode the rate set should be restricted based + * on the AP's capabilities, but ni_htrates isn't setup when + * we're called to form an AssocReq frame so for now we're + * restricted to the device capabilities. */ - ieee80211_set_htrates(frm, &ieee80211_rateset_11n); + ieee80211_set_mcsset(ni->ni_ic, frm); frm += __offsetof(struct ieee80211_ie_htcap, hc_extcap) - __offsetof(struct ieee80211_ie_htcap, hc_mcsset); From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 11:58:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D2491065690; Sun, 13 Mar 2011 11:58:41 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1281D8FC12; Sun, 13 Mar 2011 11:58:41 +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 p2DBwe1h053974; Sun, 13 Mar 2011 11:58:40 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DBweGk053972; Sun, 13 Mar 2011 11:58:40 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201103131158.p2DBweGk053972@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 13 Mar 2011 11:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219601 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 11:58:41 -0000 Author: bschmidt Date: Sun Mar 13 11:58:40 2011 New Revision: 219601 URL: http://svn.freebsd.org/changeset/base/219601 Log: Fix rmax calculation during BSS selection. If multiple networks are available the max bandwidth is one condition used for selecting the "best" BSS. To achieve that we should consider all parameters which affect the max RX rate. This includes 20/40MHz, SGI and the of course the MCS set. If the TX MCS parameters are available we should use those, because an AP announcing support for receiving frames at 450Mbps might only be able to transmit at 150Mbps (1T3R). I haven't seen devices with support for transmitting at higher rates then receiving, so prefering TX over RX information should be safe. While here, remove the hardcoded assumption that MCS15 is the max possible MCS rate, use MCS31 instead which really is the highest rate (according to the 802.11n std). Also, fix a mismatch of an 40MHz/SGI check. Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Sun Mar 13 11:56:33 2011 (r219600) +++ head/sys/net80211/ieee80211_scan_sta.c Sun Mar 13 11:58:40 2011 (r219601) @@ -756,26 +756,38 @@ maxrate(const struct ieee80211_scan_entr { const struct ieee80211_ie_htcap *htcap = (const struct ieee80211_ie_htcap *) se->se_ies.htcap_ie; - int rmax, r, i; + int rmax, r, i, txstream; uint16_t caps; + uint8_t txparams; rmax = 0; if (htcap != NULL) { /* * HT station; inspect supported MCS and then adjust - * rate by channel width. Could also include short GI - * in this if we want to be extra accurate. + * rate by channel width. */ - /* XXX assumes MCS15 is max */ - for (i = 15; i >= 0 && isclr(htcap->hc_mcsset, i); i--) - ; + txparams = htcap->hc_mcsset[12]; + if (txparams & 0x3) { + /* + * TX MCS parameters defined and not equal to RX, + * extract the number of spartial streams and + * map it to the highest MCS rate. + */ + txstream = ((txparams & 0xc) >> 2) + 1; + i = txstream * 8 - 1; + } else + for (i = 31; i >= 0 && isclr(htcap->hc_mcsset, i); i--); if (i >= 0) { caps = LE_READ_2(&htcap->hc_cap); - /* XXX short/long GI */ - if (caps & IEEE80211_HTCAP_CHWIDTH40) + if ((caps & IEEE80211_HTCAP_CHWIDTH40) && + (caps & IEEE80211_HTCAP_SHORTGI40)) rmax = ieee80211_htrates[i].ht40_rate_400ns; - else + else if (caps & IEEE80211_HTCAP_CHWIDTH40) rmax = ieee80211_htrates[i].ht40_rate_800ns; + else if (caps & IEEE80211_HTCAP_SHORTGI20) + rmax = ieee80211_htrates[i].ht20_rate_400ns; + else + rmax = ieee80211_htrates[i].ht20_rate_800ns; } } for (i = 0; i < se->se_rates[1]; i++) { From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 12:16:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70996106566B; Sun, 13 Mar 2011 12:16:23 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2CC8FC13; Sun, 13 Mar 2011 12:16: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 p2DCGNeB054433; Sun, 13 Mar 2011 12:16:23 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DCGNEM054430; Sun, 13 Mar 2011 12:16:23 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201103131216.p2DCGNEM054430@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 13 Mar 2011 12:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219602 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 12:16:23 -0000 Author: bschmidt Date: Sun Mar 13 12:16:23 2011 New Revision: 219602 URL: http://svn.freebsd.org/changeset/base/219602 Log: Honor device capabilities while initializing ni_htrates. Instead of hardcoding MCS0-15 generate the table dynamically, also restrict the MCS rates to our own capabilities while parsing a htcap element. Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Mar 13 11:58:40 2011 (r219601) +++ head/sys/net80211/ieee80211_ht.c Sun Mar 13 12:16:23 2011 (r219602) @@ -134,12 +134,6 @@ const struct ieee80211_mcs_rates ieee802 { 429, 477, 891, 990 }, /* MCS 76 */ }; -static const struct ieee80211_htrateset ieee80211_rateset_11n = - { 16, { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15 } - }; - #ifdef IEEE80211_AMPDU_AGE static int ieee80211_ampdu_age = -1; /* threshold for ampdu reorder q (ms) */ SYSCTL_PROC(_net_wlan, OID_AUTO, ampdu_age, CTLTYPE_INT | CTLFLAG_RW, @@ -417,11 +411,40 @@ ieee80211_ht_announce(struct ieee80211co ht_announce(ic, IEEE80211_MODE_11NG); } +static struct ieee80211_htrateset htrateset; + const struct ieee80211_htrateset * ieee80211_get_suphtrates(struct ieee80211com *ic, - const struct ieee80211_channel *c) + const struct ieee80211_channel *c) { - return &ieee80211_rateset_11n; +#define ADDRATE(x) do { \ + htrateset.rs_rates[htrateset.rs_nrates] = x; \ + htrateset.rs_nrates++; \ +} while (0) + int i; + + memset(&htrateset, 0, sizeof(struct ieee80211_htrateset)); + for (i = 0; i < ic->ic_txstream * 8; i++) + ADDRATE(i); + if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) && + (ic->ic_htcaps & IEEE80211_HTC_TXMCS32)) + ADDRATE(i); + if (ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) { + if (ic->ic_txstream >= 2) { + for (i = 33; i <= 38; i++) + ADDRATE(i); + } + if (ic->ic_txstream >= 3) { + for (i = 39; i <= 52; i++) + ADDRATE(i); + } + if (ic->ic_txstream == 4) { + for (i = 53; i <= 76; i++) + ADDRATE(i); + } + } + return &htrateset; +#undef ADDRATE } /* @@ -1559,10 +1582,22 @@ ieee80211_ht_updatehtcap(struct ieee8021 int ieee80211_setup_htrates(struct ieee80211_node *ni, const uint8_t *ie, int flags) { + struct ieee80211com *ic = ni->ni_ic; struct ieee80211vap *vap = ni->ni_vap; const struct ieee80211_ie_htcap *htcap; struct ieee80211_htrateset *rs; - int i; + int i, maxequalmcs, maxunequalmcs; + + maxequalmcs = ic->ic_txstream * 8 - 1; + if (ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) { + if (ic->ic_txstream >= 2) + maxunequalmcs = 38; + if (ic->ic_txstream >= 3) + maxunequalmcs = 52; + if (ic->ic_txstream >= 4) + maxunequalmcs = 76; + } else + maxunequalmcs = 0; rs = &ni->ni_htrates; memset(rs, 0, sizeof(*rs)); @@ -1581,6 +1616,13 @@ ieee80211_setup_htrates(struct ieee80211 vap->iv_stats.is_rx_rstoobig++; break; } + if (i <= 31 && i > maxequalmcs) + continue; + if (i == 32 && + (ic->ic_htcaps & IEEE80211_HTC_TXMCS32) == 0) + continue; + if (i > 32 && i > maxunequalmcs) + continue; rs->rs_rates[rs->rs_nrates++] = i; } } Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sun Mar 13 11:58:40 2011 (r219601) +++ head/sys/net80211/ieee80211_node.c Sun Mar 13 12:16:23 2011 (r219602) @@ -285,10 +285,7 @@ ieee80211_node_set_chan(struct ieee80211 mode = ieee80211_chan2mode(chan); if (IEEE80211_IS_CHAN_HT(chan)) { /* - * XXX Gotta be careful here; the rate set returned by - * ieee80211_get_suprates is actually any HT rate - * set so blindly copying it will be bad. We must - * install the legacy rate est in ni_rates and the + * We must install the legacy rate est in ni_rates and the * HT rate set in ni_htrates. */ ni->ni_htrates = *ieee80211_get_suphtrates(ic, chan); From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 12:21:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37C8E106564A; Sun, 13 Mar 2011 12:21:05 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 268428FC0A; Sun, 13 Mar 2011 12:21:05 +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 p2DCL5a0054565; Sun, 13 Mar 2011 12:21:05 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DCL5t8054563; Sun, 13 Mar 2011 12:21:05 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201103131221.p2DCL5t8054563@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 13 Mar 2011 12:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219603 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 12:21:05 -0000 Author: bschmidt Date: Sun Mar 13 12:21:04 2011 New Revision: 219603 URL: http://svn.freebsd.org/changeset/base/219603 Log: Fix a cut&paste error while parsing htcap/htinfo elements. This one is reponsible for not filling ni_htrates if a pre-ht information element is present. Modified: head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Sun Mar 13 12:16:23 2011 (r219602) +++ head/sys/net80211/ieee80211_sta.c Sun Mar 13 12:21:04 2011 (r219603) @@ -1544,7 +1544,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, htcap = frm; } else if (ishtinfooui(frm)) { if (htinfo == NULL) - htcap = frm; + htinfo = frm; } } /* XXX Atheros OUI support */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 12:56:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1291065670; Sun, 13 Mar 2011 12:56:46 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CEF88FC0A; Sun, 13 Mar 2011 12:56: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 p2DCukqv055300; Sun, 13 Mar 2011 12:56:46 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DCukrp055298; Sun, 13 Mar 2011 12:56:46 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201103131256.p2DCukrp055298@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 13 Mar 2011 12:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219604 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 12:56:46 -0000 Author: bschmidt Date: Sun Mar 13 12:56:46 2011 New Revision: 219604 URL: http://svn.freebsd.org/changeset/base/219604 Log: When injecting frames a temporary node is faked, during this several uses of ic_curchan occur. Due to the nature of a scan, switching channels constantly and all this happening without any kind of locks held, it might happen that ic_curchan points to nowhere leading to panics. Fix this by not allowing frame injections while in SCAN state. Tested by: Paul B. Mahol Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Mar 13 12:21:04 2011 (r219603) +++ head/sys/net80211/ieee80211_output.c Sun Mar 13 12:56:46 2011 (r219604) @@ -419,7 +419,8 @@ ieee80211_output(struct ifnet *ifp, stru "block %s frame in CAC state\n", "raw data"); vap->iv_stats.is_tx_badstate++; senderr(EIO); /* XXX */ - } + } else if (vap->iv_state == IEEE80211_S_SCAN) + senderr(EIO); /* XXX bypass bridge, pfil, carp, etc. */ if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_ack)) From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 13:00:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6651C106564A; Sun, 13 Mar 2011 13:00:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1138FC1A; Sun, 13 Mar 2011 13:00: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 p2DD0jhJ055434; Sun, 13 Mar 2011 13:00:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DD0jB5055430; Sun, 13 Mar 2011 13:00:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103131300.p2DD0jB5055430@svn.freebsd.org> From: Adrian Chadd Date: Sun, 13 Mar 2011 13:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219605 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 13:00:45 -0000 Author: adrian Date: Sun Mar 13 13:00:45 2011 New Revision: 219605 URL: http://svn.freebsd.org/changeset/base/219605 Log: Fix the nfarray offsets for the ar2133/ar5133 radio - (AR5416, AR9160, etc.) The offsets didn't match the assumption that nfarray[] is ordered by the chainmask bits and programmed via the register order in ar5416_cca_regs[]. This repairs that damage and ensures that chain 1 is programmed correctly. (And extension channels will now be programmed correctly also.) This fixes some of the stuck beacons I've been seeing on my AR9160/AR5416 setups - because Chain 1 would be programmed -80 or -85 dBm, which is higher than the actual noise floor and thus convincing the radio that indeed it can't ever transmit. Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c head/sys/dev/ath/ath_hal/ar9002/ar9280.c head/sys/dev/ath/ath_hal/ar9002/ar9285.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar2133.c Sun Mar 13 12:56:46 2011 (r219604) +++ head/sys/dev/ath/ath_hal/ar5416/ar2133.c Sun Mar 13 13:00:45 2011 (r219605) @@ -386,12 +386,29 @@ ar2133GetChannelMaxMinPower(struct ath_h #endif } +/* + * The ordering of nfarray is thus: + * + * nfarray[0]: Chain 0 ctl + * nfarray[1]: Chain 1 ctl + * nfarray[2]: Chain 2 ctl + * nfarray[3]: Chain 0 ext + * nfarray[4]: Chain 1 ext + * nfarray[5]: Chain 2 ext + */ static void ar2133GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[]) { struct ath_hal_5416 *ahp = AH5416(ah); int16_t nf; + /* + * Blank nf array - some chips may only + * have one or two RX chainmasks enabled. + */ + nfarray[0] = nfarray[1] = nfarray[2] = 0; + nfarray[3] = nfarray[4] = nfarray[5] = 0; + switch (ahp->ah_rx_chainmask) { case 0x7: nf = MS(OS_REG_READ(ah, AR_PHY_CH2_CCA), AR_PHY_CH2_MINCCA_PWR); @@ -399,7 +416,7 @@ ar2133GetNoiseFloor(struct ath_hal *ah, nf = 0 - ((nf ^ 0x1ff) + 1); HALDEBUG(ah, HAL_DEBUG_NFCAL, "NF calibrated [ctl] [chain 2] is %d\n", nf); - nfarray[4] = nf; + nfarray[2] = nf; nf = MS(OS_REG_READ(ah, AR_PHY_CH2_EXT_CCA), AR_PHY_CH2_EXT_MINCCA_PWR); if (nf & 0x100) @@ -415,7 +432,7 @@ ar2133GetNoiseFloor(struct ath_hal *ah, nf = 0 - ((nf ^ 0x1ff) + 1); HALDEBUG(ah, HAL_DEBUG_NFCAL, "NF calibrated [ctl] [chain 1] is %d\n", nf); - nfarray[2] = nf; + nfarray[1] = nf; nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR_PHY_CH1_EXT_MINCCA_PWR); @@ -423,7 +440,7 @@ ar2133GetNoiseFloor(struct ath_hal *ah, nf = 0 - ((nf ^ 0x1ff) + 1); HALDEBUG(ah, HAL_DEBUG_NFCAL, "NF calibrated [ext] [chain 1] is %d\n", nf); - nfarray[3] = nf; + nfarray[4] = nf; /* fall thru... */ case 0x1: nf = MS(OS_REG_READ(ah, AR_PHY_CCA), AR_PHY_MINCCA_PWR); @@ -438,7 +455,7 @@ ar2133GetNoiseFloor(struct ath_hal *ah, nf = 0 - ((nf ^ 0x1ff) + 1); HALDEBUG(ah, HAL_DEBUG_NFCAL, "NF calibrated [ext] [chain 0] is %d\n", nf); - nfarray[1] = nf; + nfarray[3] = nf; break; } Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280.c Sun Mar 13 12:56:46 2011 (r219604) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280.c Sun Mar 13 13:00:45 2011 (r219605) @@ -265,6 +265,16 @@ ar9280GetChannelMaxMinPower(struct ath_h #endif } +/* + * The ordering of nfarray is thus: + * + * nfarray[0]: Chain 0 ctl + * nfarray[1]: Chain 1 ctl + * nfarray[2]: Chain 2 ctl + * nfarray[3]: Chain 0 ext + * nfarray[4]: Chain 1 ext + * nfarray[5]: Chain 2 ext + */ static void ar9280GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[]) { @@ -297,6 +307,11 @@ ar9280GetNoiseFloor(struct ath_hal *ah, HALDEBUG(ah, HAL_DEBUG_NFCAL, "NF calibrated [ext] [chain 1] is %d\n", nf); nfarray[4] = nf; + + /* Chain 2 - invalid */ + nfarray[2] = 0; + nfarray[5] = 0; + } /* Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285.c Sun Mar 13 12:56:46 2011 (r219604) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285.c Sun Mar 13 13:00:45 2011 (r219605) @@ -28,6 +28,16 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +/* + * The ordering of nfarray is thus: + * + * nfarray[0]: Chain 0 ctl + * nfarray[1]: Chain 1 ctl + * nfarray[2]: Chain 2 ctl + * nfarray[3]: Chain 0 ext + * nfarray[4]: Chain 1 ext + * nfarray[5]: Chain 2 ext + */ static void ar9285GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[]) { @@ -40,7 +50,6 @@ ar9285GetNoiseFloor(struct ath_hal *ah, "NF calibrated [ctl] [chain 0] is %d\n", nf); nfarray[0] = nf; - nfarray[1] = 0; nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR); if (nf & 0x100) @@ -49,7 +58,13 @@ ar9285GetNoiseFloor(struct ath_hal *ah, "NF calibrated [ext] [chain 0] is %d\n", nf); nfarray[3] = nf; + /* Chain 1 - invalid */ + nfarray[1] = 0; nfarray[4] = 0; + + /* Chain 2 - invalid */ + nfarray[2] = 0; + nfarray[5] = 0; } HAL_BOOL From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 13:05:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DB8B106564A; Sun, 13 Mar 2011 13:05:51 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9818FC1F; Sun, 13 Mar 2011 13:05: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 p2DD5p2S055555; Sun, 13 Mar 2011 13:05:51 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DD5owf055552; Sun, 13 Mar 2011 13:05:50 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201103131305.p2DD5owf055552@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 13 Mar 2011 13:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219606 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 13:05:51 -0000 Author: bschmidt Date: Sun Mar 13 13:05:50 2011 New Revision: 219606 URL: http://svn.freebsd.org/changeset/base/219606 Log: Constantly use MHz instead of Mhz. Pointed out by: N.J. Mann Modified: head/sys/net80211/_ieee80211.h head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Sun Mar 13 13:00:45 2011 (r219605) +++ head/sys/net80211/_ieee80211.h Sun Mar 13 13:05:50 2011 (r219606) @@ -133,7 +133,7 @@ enum ieee80211_roamingmode { */ struct ieee80211_channel { uint32_t ic_flags; /* see below */ - uint16_t ic_freq; /* setting in Mhz */ + uint16_t ic_freq; /* setting in MHz */ uint8_t ic_ieee; /* IEEE channel number */ int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */ int8_t ic_maxpower; /* maximum tx power in .5 dBm */ Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Mar 13 13:00:45 2011 (r219605) +++ head/sys/net80211/ieee80211_ht.c Sun Mar 13 13:05:50 2011 (r219606) @@ -380,19 +380,19 @@ ht_announce(struct ieee80211com *ic, int struct ifnet *ifp = ic->ic_ifp; const char *modestr = ieee80211_phymode_name[mode]; - if_printf(ifp, "%s MCS 20Mhz\n", modestr); + if_printf(ifp, "%s MCS 20MHz\n", modestr); ht_rateprint(ic, mode, 0); if (ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20) { - if_printf(ifp, "%s MCS 20Mhz SGI\n", modestr); + if_printf(ifp, "%s MCS 20MHz SGI\n", modestr); ht_rateprint(ic, mode, 1); } if (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) { - if_printf(ifp, "%s MCS 40Mhz:\n", modestr); + if_printf(ifp, "%s MCS 40MHz:\n", modestr); ht_rateprint(ic, mode, 2); } if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) && (ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40)) { - if_printf(ifp, "%s MCS 40Mhz SGI:\n", modestr); + if_printf(ifp, "%s MCS 40MHz SGI:\n", modestr); ht_rateprint(ic, mode, 3); } } @@ -1563,7 +1563,7 @@ ieee80211_ht_updatehtcap(struct ieee8021 htcap_update_shortgi(ni); /* NB: honor operating mode constraint */ - /* XXX 40 MHZ intolerant */ + /* XXX 40 MHz intolerant */ htflags = (vap->iv_flags_ht & IEEE80211_FHT_HT) ? IEEE80211_CHAN_HT20 : 0; if ((ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) && From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 13:15:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6A62106564A; Sun, 13 Mar 2011 13:15:35 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5318FC08; Sun, 13 Mar 2011 13:15:35 +0000 (UTC) Received: from outgoing.leidinger.net (p5B1539CA.dip.t-dialin.net [91.21.57.202]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 6589884400E; Sun, 13 Mar 2011 14:15:32 +0100 (CET) Received: from unknown (IO.Leidinger.net [192.168.2.110]) by outgoing.leidinger.net (Postfix) with ESMTP id 81D1C2AAA; Sun, 13 Mar 2011 14:15:29 +0100 (CET) Date: Sun, 13 Mar 2011 14:15:28 +0100 From: Alexander Leidinger To: Artem Belevich Message-ID: <20110313141528.000013b1@unknown> In-Reply-To: References: <201103120851.p2C8phoN010341@svn.freebsd.org> <20110312205719.00004e67@unknown> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 6589884400E.A25A9 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-0.923, required 6, autolearn=disabled, ALL_TRUSTED -1.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1300626932.99198@rVUjvoaHFZTQRNB+DsHHiA X-EBL-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r219559 - in head/sys: amd64/linux32 compat/freebsd32 i386/linux kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 13:15:36 -0000 On Sat, 12 Mar 2011 22:24:09 -0800 Artem Belevich wrote: > >> Modified: head/sys/i386/linux/syscalls.master > >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 l_ha= ndler_t handler); } > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void= *handler); } > > > > What's wrong with l_handler_t? >=20 > I don't recall the details, but I believe that the way l_handler_t is > defined resulted in compilation errors in generated glue code. Glue > generation code relies on '*' before the argument name in order to > tell scalars from pointers. l_handler_t was interpreted as a scalar > and on i386 where l_handler_t is a pointer, it produced compilation > warning. What about documenting it with a comment nearby? Bye, Alexander. From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 13:37:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95AD21065670; Sun, 13 Mar 2011 13:37:23 +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 841A48FC15; Sun, 13 Mar 2011 13:37: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 p2DDbNNe056167; Sun, 13 Mar 2011 13:37:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DDbN0e056165; Sun, 13 Mar 2011 13:37:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201103131337.p2DDbN0e056165@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 13 Mar 2011 13:37: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: r219607 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 13:37:23 -0000 Author: kib Date: Sun Mar 13 13:37:23 2011 New Revision: 219607 URL: http://svn.freebsd.org/changeset/base/219607 Log: Fix mismerge. Pointy hat to: kib Modified: stable/7/sys/kern/imgact_shell.c Modified: stable/7/sys/kern/imgact_shell.c ============================================================================== --- stable/7/sys/kern/imgact_shell.c Sun Mar 13 13:05:50 2011 (r219606) +++ stable/7/sys/kern/imgact_shell.c Sun Mar 13 13:37:23 2011 (r219607) @@ -179,7 +179,7 @@ exec_shell_imgact(imgp) length = (imgp->args->argc == 0) ? 0 : strlen(imgp->args->begin_argv) + 1; /* bytes to delete */ - if (offset > imgp->args->stringspace + length) { + if (offset > imgp->args->stringspace + length) return (E2BIG); bcopy(imgp->args->begin_argv + length, imgp->args->begin_argv + offset, From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 13:42:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E4111065670; Sun, 13 Mar 2011 13:42:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AF088FC14; Sun, 13 Mar 2011 13:42: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 p2DDghBQ056302; Sun, 13 Mar 2011 13:42:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DDghFa056292; Sun, 13 Mar 2011 13:42:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103131342.p2DDghFa056292@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Mar 2011 13:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219608 - in head/sys: sparc64/include sparc64/sparc64 sun4v/include sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 13:42:43 -0000 Author: marius Date: Sun Mar 13 13:42:43 2011 New Revision: 219608 URL: http://svn.freebsd.org/changeset/base/219608 Log: Remove the advertising clause from the UCB license according to the July 22, 1999 addendum. Modified: head/sys/sparc64/include/varargs.h head/sys/sparc64/include/vmparam.h head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/trap.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/sun4v/include/varargs.h head/sys/sun4v/include/vmparam.h head/sys/sun4v/sun4v/trap.c head/sys/sun4v/sun4v/vm_machdep.c Modified: head/sys/sparc64/include/varargs.h ============================================================================== --- head/sys/sparc64/include/varargs.h Sun Mar 13 13:37:23 2011 (r219607) +++ head/sys/sparc64/include/varargs.h Sun Mar 13 13:42:43 2011 (r219608) @@ -25,10 +25,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Sun Mar 13 13:37:23 2011 (r219607) +++ head/sys/sparc64/include/vmparam.h Sun Mar 13 13:42:43 2011 (r219608) @@ -15,10 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Sun Mar 13 13:37:23 2011 (r219607) +++ head/sys/sparc64/sparc64/pmap.c Sun Mar 13 13:42:43 2011 (r219608) @@ -18,10 +18,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Sun Mar 13 13:37:23 2011 (r219607) +++ head/sys/sparc64/sparc64/trap.c Sun Mar 13 13:42:43 2011 (r219608) @@ -15,10 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Sun Mar 13 13:37:23 2011 (r219607) +++ head/sys/sparc64/sparc64/vm_machdep.c Sun Mar 13 13:42:43 2011 (r219608) @@ -17,10 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sys/sun4v/include/varargs.h ============================================================================== --- head/sys/sun4v/include/varargs.h Sun Mar 13 13:37:23 2011 (r219607) +++ head/sys/sun4v/include/varargs.h Sun Mar 13 13:42:43 2011 (r219608) @@ -25,10 +25,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sys/sun4v/include/vmparam.h ============================================================================== --- head/sys/sun4v/include/vmparam.h Sun Mar 13 13:37:23 2011 (r219607) +++ head/sys/sun4v/include/vmparam.h Sun Mar 13 13:42:43 2011 (r219608) @@ -15,10 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sys/sun4v/sun4v/trap.c ============================================================================== --- head/sys/sun4v/sun4v/trap.c Sun Mar 13 13:37:23 2011 (r219607) +++ head/sys/sun4v/sun4v/trap.c Sun Mar 13 13:42:43 2011 (r219608) @@ -15,10 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sys/sun4v/sun4v/vm_machdep.c ============================================================================== --- head/sys/sun4v/sun4v/vm_machdep.c Sun Mar 13 13:37:23 2011 (r219607) +++ head/sys/sun4v/sun4v/vm_machdep.c Sun Mar 13 13:42:43 2011 (r219608) @@ -17,10 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 14:46:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF91A106566B; Sun, 13 Mar 2011 14:46:10 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 49DC78FC18; Sun, 13 Mar 2011 14:46:10 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id A46DA1DD65F; Sun, 13 Mar 2011 15:46:09 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 97F89173AA; Sun, 13 Mar 2011 15:46:09 +0100 (CET) Date: Sun, 13 Mar 2011 15:46:09 +0100 From: Jilles Tjoelker To: Doug Barton Message-ID: <20110313144609.GA11779@stack.nl> References: <201103122113.p2CLD8LO030205@svn.freebsd.org> <20110312230830.GA269@stack.nl> <4D7C7CC9.7010901@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D7C7CC9.7010901@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219578 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 14:46:10 -0000 On Sun, Mar 13, 2011 at 12:14:01AM -0800, Doug Barton wrote: > On 03/12/2011 15:08, Jilles Tjoelker wrote: > > I wonder if it is a good idea to pollute the environment of many daemons > > with this. Although sshd and cron clean it up, there is at least one > > daemon that passes the environment on. One of those is devd. > I think the argument could be made that this is bad behavior on their > part, but if it turns out that it starts affecting things negatively we > can take another look at it. Cleaning the environment requires special care to preserve environment variables that may still be needed. This is a problem particularly for code intended to be portable. Perhaps someone wants to apply a hack using LD_PRELOAD or other LD_* variables, or an environment variable is needed to force standards-compliant behaviour that the program depends on. The service(8) utility should clear the environment so it matches the boot environment as much as possible. If someone wants to set special environment variables, they should configure that in such a way that it also works at boot or call the rc.d script directly. > > While that > > saves four /etc/rc.conf reads on my minimalistic 9-current VM, it > > implies that devd must be restarted to pick up changes to /etc/rc.conf. > > That seems a POLA violation. > I'm not sure what you mean by this. We've always required services to be > restarted to pick up rc.conf changes. For options for devd itself, yes. However, as configured in the default /etc/devd.conf, devd may invoke commands like /etc/pccard_ether $subsystem start or /etc/rc.d/dhclient quietstart $subsystem The natural expectation is that these reread /etc/rc.conf every time, so that it is possible to set up network settings for a network interface and then plug it in, without restarting devd. And so it worked before r219578. Also, consider the case where settings are changed in /etc/rc.conf and then applied by manual running of rc.d scripts. With the new code, unplugging and replugging the device, triggering devd, reverts the settings to their boot-time values. Another unexpected result may occur if /etc/rc.conf.d/devd modifies a variable defined in /etc/defaults/rc.conf or /etc/rc.conf. The change will now apply to everything started by devd as well, different from former behaviour. This is not that likely for devd as it has few defined variables, but may affect other daemons and also affects running an rc.d script from another via run_rc_script. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 14:58:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C65A106567C; Sun, 13 Mar 2011 14:58:02 +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 6A28D8FC1C; Sun, 13 Mar 2011 14:58: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 p2DEw2tO057953; Sun, 13 Mar 2011 14:58:02 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DEw2xG057948; Sun, 13 Mar 2011 14:58:02 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103131458.p2DEw2xG057948@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 13 Mar 2011 14:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219609 - in head/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 14:58:02 -0000 Author: dchagin Date: Sun Mar 13 14:58:02 2011 New Revision: 219609 URL: http://svn.freebsd.org/changeset/base/219609 Log: Enable shared page use for amd64/linux32 and i386/linux binaries. Move signal trampoline code from the top of the stack to the shared page. MFC after: 2 Weeks Modified: head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux.h head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Sun Mar 13 13:42:43 2011 (r219608) +++ head/sys/amd64/linux32/linux.h Sun Mar 13 14:58:02 2011 (r219609) @@ -47,7 +47,10 @@ extern u_char linux_debug_map[]; MALLOC_DECLARE(M_LINUX); #endif -#define LINUX32_USRSTACK ((1ul << 32) - PAGE_SIZE) +#define LINUX32_MAXUSER ((1ul << 32) - PAGE_SIZE) +#define LINUX32_SHAREDPAGE (LINUX32_MAXUSER - PAGE_SIZE) +#define LINUX32_USRSTACK LINUX32_SHAREDPAGE + /* XXX 16 = sizeof(linux32_ps_strings) */ #define LINUX32_PS_STRINGS (LINUX32_USRSTACK - 16) #define LINUX32_MAXDSIZ (512 * 1024 * 1024) /* 512MB */ Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sun Mar 13 13:42:43 2011 (r219608) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun Mar 13 14:58:02 2011 (r219609) @@ -411,8 +411,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo * Build context to run handler in. */ regs->tf_rsp = PTROUT(fp); - regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode) + - linux_sznonrtsigcode; + regs->tf_rip = p->p_sysent->sv_sigcode_base + linux_sznonrtsigcode; regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; @@ -535,7 +534,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t * Build context to run handler in. */ regs->tf_rsp = PTROUT(fp); - regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_rip = p->p_sysent->sv_sigcode_base; regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; @@ -890,21 +889,15 @@ linux_copyout_strings(struct image_param * Also deal with signal trampoline code for this exec type. */ arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS; - destp = (caddr_t)arginfo - linux_szsigcode - SPARE_USRSPACE - - linux_szplatform - roundup((ARG_MAX - imgp->args->stringspace), + destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform - + roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); /* - * install sigcode - */ - copyout(imgp->proc->p_sysent->sv_sigcode, - ((caddr_t)arginfo - linux_szsigcode), linux_szsigcode); - - /* * Install LINUX_PLATFORM */ - copyout(linux_platform, ((caddr_t)arginfo - linux_szsigcode - - linux_szplatform), linux_szplatform); + copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform), + linux_szplatform); /* * If we have a valid auxargs ptr, prepare some room @@ -1050,7 +1043,7 @@ struct sysentvec elf_linux_sysvec = { .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, - .sv_maxuser = LINUX32_USRSTACK, + .sv_maxuser = LINUX32_MAXUSER, .sv_usrstack = LINUX32_USRSTACK, .sv_psstrings = LINUX32_PS_STRINGS, .sv_stackprot = VM_PROT_ALL, @@ -1058,12 +1051,15 @@ struct sysentvec elf_linux_sysvec = { .sv_setregs = exec_linux_setregs, .sv_fixlimit = linux32_fixlimit, .sv_maxssiz = &linux32_maxssiz, - .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32, + .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32 | SV_SHP, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux32_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_shared_page_base = LINUX32_SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, }; +INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec); static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Sun Mar 13 13:42:43 2011 (r219608) +++ head/sys/i386/linux/linux.h Sun Mar 13 14:58:02 2011 (r219609) @@ -47,6 +47,9 @@ extern u_char linux_debug_map[]; MALLOC_DECLARE(M_LINUX); #endif +#define LINUX_SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) +#define LINUX_USRSTACK LINUX_SHAREDPAGE + #define PTRIN(v) (void *)(v) #define PTROUT(v) (l_uintptr_t)(v) Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sun Mar 13 13:42:43 2011 (r219608) +++ head/sys/i386/linux/linux_sysvec.c Sun Mar 13 14:58:02 2011 (r219609) @@ -90,6 +90,8 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux m #define LINUX_SYS_linux_rt_sendsig 0 #define LINUX_SYS_linux_sendsig 0 +#define LINUX_PS_STRINGS (LINUX_USRSTACK - sizeof(struct ps_strings)) + extern char linux_sigcode[]; extern int linux_szsigcode; @@ -308,21 +310,14 @@ linux_copyout_strings(struct image_param */ p = imgp->proc; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; - destp = (caddr_t)arginfo - linux_szsigcode - SPARE_USRSPACE - - linux_szplatform - roundup((ARG_MAX - imgp->args->stringspace), - sizeof(char *)); - - /* - * install sigcode - */ - copyout(p->p_sysent->sv_sigcode, ((caddr_t)arginfo - - linux_szsigcode), linux_szsigcode); + destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform - + roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); /* * install LINUX_PLATFORM */ - copyout(linux_platform, ((caddr_t)arginfo - linux_szsigcode - - linux_szplatform), linux_szplatform); + copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform), + linux_szplatform); /* * If we have a valid auxargs ptr, prepare some room @@ -520,8 +515,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo * Build context to run handler in. */ regs->tf_esp = (int)fp; - regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode) + - linux_sznonrtsigcode; + regs->tf_eip = p->p_sysent->sv_sigcode_base + linux_sznonrtsigcode; regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -640,7 +634,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t * Build context to run handler in. */ regs->tf_esp = (int)fp; - regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_eip = p->p_sysent->sv_sigcode_base; regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -986,7 +980,7 @@ struct sysentvec linux_sysvec = { .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, - .sv_usrstack = USRSTACK, + .sv_usrstack = LINUX_USRSTACK, .sv_psstrings = PS_STRINGS, .sv_stackprot = VM_PROT_ALL, .sv_copyout_strings = exec_copyout_strings, @@ -997,8 +991,11 @@ struct sysentvec linux_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_shared_page_base = LINUX_SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, }; +INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, @@ -1021,19 +1018,22 @@ struct sysentvec elf_linux_sysvec = { .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, - .sv_usrstack = USRSTACK, - .sv_psstrings = PS_STRINGS, + .sv_usrstack = LINUX_USRSTACK, + .sv_psstrings = LINUX_PS_STRINGS, .sv_stackprot = VM_PROT_ALL, .sv_copyout_strings = linux_copyout_strings, .sv_setregs = exec_linux_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_LINUX | SV_IA32 | SV_ILP32, + .sv_flags = SV_ABI_LINUX | SV_IA32 | SV_ILP32 | SV_SHP, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_shared_page_base = LINUX_SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, }; +INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec); static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 15:08:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8EE6106564A; Sun, 13 Mar 2011 15:08:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6BCC8FC13; Sun, 13 Mar 2011 15:08: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 p2DF86Nj058216; Sun, 13 Mar 2011 15:08:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DF86TX058213; Sun, 13 Mar 2011 15:08:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103131508.p2DF86TX058213@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Mar 2011 15:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219610 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 15:08:06 -0000 Author: nwhitehorn Date: Sun Mar 13 15:08:06 2011 New Revision: 219610 URL: http://svn.freebsd.org/changeset/base/219610 Log: Connect the full doc build (Handbook, etc.) to the build. This is not built if no doc checkout is found. Modified: head/release/Makefile.bsdinstall head/release/generate-release.sh Modified: head/release/Makefile.bsdinstall ============================================================================== --- head/release/Makefile.bsdinstall Sun Mar 13 14:58:02 2011 (r219609) +++ head/release/Makefile.bsdinstall Sun Mar 13 15:08:06 2011 (r219610) @@ -11,6 +11,7 @@ # WORLDDIR: location of src tree -- must have built world and default kernel # (by default, the directory above this one) # PORTSDIR: location of ports tree to distribute (default: /usr/ports) +# DOCDIR: location of doc tree (default: /usr/doc) # NOPORTS: if set, do not distribute ports tree # NOSRC: if set, do not distribute source tree # NODOC: if set, do not generate release documentation @@ -19,6 +20,7 @@ WORLDDIR?= ${.CURDIR}/.. PORTSDIR?= /usr/ports +DOCDIR?= /usr/doc RELNOTES_LANG?= en_US.ISO8859-1 TARGET_ARCH?= ${MACHINE_ARCH} @@ -30,6 +32,13 @@ TARGET?= ${TARGET_ARCH} IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= ${.OBJDIR}/dist +.if !exists(${DOCDIR}) +NODOC= true +.endif +.if !exists(${PORTSDIR}) +NOPORTS= true +.endif + EXTRA_PACKAGES= .if !defined(NOPORTS) EXTRA_PACKAGES+= ports.txz @@ -55,7 +64,14 @@ base.txz: -mkdir ${DISTDIR} cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${DISTDIR} # Set up mergemaster root database - sh ${.CURDIR}/scripts/mm-mtree.sh -F "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${DISTDIR}/base" + sh ${.CURDIR}/scripts/mm-mtree.sh -F \ + "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${DISTDIR}/base" +# Merge handbook, etc. from doc tree into src tree doc distribution +.if !defined(NODOC) + cd ${DOCDIR} && ${IMAKE} all install \ + DOCDIR=${DISTDIR}/doc/usr/share/doc 'FORMATS=html html-split txt' \ + INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES +.endif cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${DISTDIR} mv ${DISTDIR}/*.txz ${.OBJDIR} @@ -67,15 +83,19 @@ kernel.txz: src.txz: -mkdir -p ${DISTDIR}/usr ln -fs ${WORLDDIR} ${DISTDIR}/usr/src - cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude CVS usr/src + cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn \ + --exclude CVS usr/src ports.txz: -mkdir -p ${DISTDIR}/usr ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports - cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz --exclude usr/ports/distfiles --exclude usr/ports/packages --exclude 'usr/ports/INDEX*' --exclude work usr/ports + cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \ + --exclude usr/ports/distfiles --exclude usr/ports/packages \ + --exclude 'usr/ports/INDEX*' --exclude work usr/ports reldoc: - cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc + cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' \ + INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc -mkdir ${.OBJDIR}/reldoc .for i in hardware readme relnotes errata ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/${i}/article.txt \ @@ -83,7 +103,7 @@ reldoc: ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/${i}/article.html \ ${.OBJDIR}/reldoc/${i:U}.HTM .endfor - @cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/readme/docbook.css ${.OBJDIR}/reldoc + cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/readme/docbook.css ${.OBJDIR}/reldoc system: packagesystem # Install system Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Sun Mar 13 14:58:02 2011 (r219609) +++ head/release/generate-release.sh Sun Mar 13 15:08:06 2011 (r219610) @@ -1,14 +1,14 @@ #!/bin/sh # generate-release.sh: check out source trees, and build release components with -# totally clean, fresh trees +# totally clean, fresh trees. # # Usage: generate-release.sh svn-branch scratch-dir # # Environment variables: -# CVSUP_HOST: Host of a cvsup server to obtain the ports tree. Must be set -# to include ports. -# CVSUP_TAG: CVS tag for ports (HEAD by default) +# CVSUP_HOST: Host of a cvsup server to obtain the ports and documentation +# trees. Must be set to include ports and documentation. +# CVSUP_TAG: CVS tag for ports and documentation (HEAD by default) # MAKE_FLAGS: optional flags to pass to make (e.g. -j) # # Note: Since this requires a chroot, release cross-builds will not work! @@ -19,7 +19,7 @@ mkdir -p $2/usr/src svn co svn://svn.freebsd.org/base/$1 $2/usr/src || exit 1 if [ ! -z $CVSUP_HOST ]; then - cat > $2/ports-supfile << EOF + cat > $2/docports-supfile << EOF *default host=$CVSUP_HOST *default base=/var/db *default prefix=/usr @@ -27,9 +27,10 @@ if [ ! -z $CVSUP_HOST ]; then *default delete use-rel-suffix *default compress ports-all + doc-all EOF else - RELEASE_FLAGS=-DNOPORTS + RELEASE_FLAGS="-DNOPORTS -DNODOC" fi cd $2/usr/src @@ -39,8 +40,15 @@ mount -t devfs devfs $2/dev if [ ! -z $CVSUP_HOST ]; then cp /etc/resolv.conf $2/etc/resolv.conf - chroot $2 /usr/bin/csup /ports-supfile || exit 1 + + # Checkout ports and doc trees + #chroot $2 /usr/bin/csup /docports-supfile || exit 1 + + # Build ports to build the docs, then build the docs + chroot $2 /bin/sh -c 'pkg_add -r docproj || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' || exit 1 + chroot $2 /bin/sh -c "cd /usr/doc && make $MAKE_FLAGS 'FORMATS=html html-split txt' URLS_ABSOLUTE=YES" || exit 1 fi + chroot $2 /bin/sh -c "cd /usr/src && make $MAKE_FLAGS buildworld buildkernel" || exit 1 mkdir $2/R chroot $2 /bin/sh -c "cd /usr/src/release && MAKEOBJDIR=/R make -f Makefile.bsdinstall release $RELEASE_FLAGS" || exit 1 From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 16:20:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E03510656B7; Sun, 13 Mar 2011 16:20:39 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C6628FC23; Sun, 13 Mar 2011 16:20:39 +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 p2DGKdNu059601; Sun, 13 Mar 2011 16:20:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DGKddK059598; Sun, 13 Mar 2011 16:20:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103131620.p2DGKddK059598@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Mar 2011 16:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219611 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 16:20:39 -0000 Author: jilles Date: Sun Mar 13 16:20:38 2011 New Revision: 219611 URL: http://svn.freebsd.org/changeset/base/219611 Log: sh: Add some tests for ${#parameter}. Added: head/tools/regression/bin/sh/expansion/length1.0 (contents, props changed) head/tools/regression/bin/sh/expansion/length2.0 (contents, props changed) head/tools/regression/bin/sh/expansion/length3.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/length1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/length1.0 Sun Mar 13 16:20:38 2011 (r219611) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +v=abcd +[ "${#v}" = 4 ] || echo '${#v} wrong' +v=$$ +[ "${#$}" = "${#v}" ] || echo '${#$} wrong' +[ "${#!}" = 0 ] || echo '${#!} wrong' +set -- 01 2 3 4 5 6 7 8 9 10 11 12 0013 +[ "${#1}" = 2 ] || echo '${#1} wrong' +[ "${#13}" = 4 ] || echo '${#13} wrong' +v=$0 +[ "${#0}" = "${#v}" ] || echo '${#0} wrong' Added: head/tools/regression/bin/sh/expansion/length2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/length2.0 Sun Mar 13 16:20:38 2011 (r219611) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +v=$- +[ "${#-}" = "${#v}" ] || echo '${#-} wrong' Added: head/tools/regression/bin/sh/expansion/length3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/length3.0 Sun Mar 13 16:20:38 2011 (r219611) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +set -- 1 2 3 4 5 6 7 8 9 10 11 12 13 +[ "$#" = 13 ] || echo '$# wrong' +[ "${#}" = 13 ] || echo '${#} wrong' +[ "${##}" = 2 ] || echo '${##} wrong' +set -- +[ "$#" = 0 ] || echo '$# wrong' +[ "${#}" = 0 ] || echo '${#} wrong' +[ "${##}" = 1 ] || echo '${##} wrong' From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 16:27:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66175106564A; Sun, 13 Mar 2011 16:27: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 5521B8FC19; Sun, 13 Mar 2011 16:27: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 p2DGRaaF059806; Sun, 13 Mar 2011 16:27:36 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DGRaI6059804; Sun, 13 Mar 2011 16:27:36 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201103131627.p2DGRaI6059804@svn.freebsd.org> From: Doug Barton Date: Sun, 13 Mar 2011 16:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219612 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 16:27:36 -0000 Author: dougb Date: Sun Mar 13 16:27:36 2011 New Revision: 219612 URL: http://svn.freebsd.org/changeset/base/219612 Log: Revert r219578 Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Mar 13 16:20:38 2011 (r219611) +++ head/etc/rc.subr Sun Mar 13 16:27:36 2011 (r219612) @@ -998,8 +998,9 @@ load_rc_config() err 3 'USAGE: load_rc_config name' fi - if [ -z "$_rc_conf_loaded" ]; then - set -o allexport + if ${_rc_conf_loaded:-false}; then + : + else if [ -r /etc/defaults/rc.conf ]; then debug "Sourcing /etc/defaults/rc.conf" . /etc/defaults/rc.conf @@ -1009,7 +1010,6 @@ load_rc_config() . /etc/rc.conf fi _rc_conf_loaded=true - set +o allexport fi if [ -f /etc/rc.conf.d/"$_name" ]; then debug "Sourcing /etc/rc.conf.d/${_name}" From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 16:47:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EDA8106564A; Sun, 13 Mar 2011 16:47:22 +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 F1C218FC0C; Sun, 13 Mar 2011 16:47: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 p2DGlLEV060233; Sun, 13 Mar 2011 16:47:21 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DGlLCP060231; Sun, 13 Mar 2011 16:47:21 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201103131647.p2DGlLCP060231@svn.freebsd.org> From: Bruce Cran Date: Sun, 13 Mar 2011 16:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219613 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 16:47:22 -0000 Author: brucec Date: Sun Mar 13 16:47:21 2011 New Revision: 219613 URL: http://svn.freebsd.org/changeset/base/219613 Log: Fix typo. Modified: head/usr.bin/netstat/sctp.c Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Sun Mar 13 16:27:36 2011 (r219612) +++ head/usr.bin/netstat/sctp.c Sun Mar 13 16:47:21 2011 (r219613) @@ -563,7 +563,7 @@ sctp_stats(u_long off, const char *name, p(sctps_sendfastretrans, "\t\t%ju fast retransmitted DATA chunk%s\n"); p(sctps_sendmultfastretrans, "\t\t%ju FR'%s that happened more " "than once to same chunk\n"); - p(sctps_sendheartbeat, "\t\t%ju intput HB chunk%s\n"); + p(sctps_sendheartbeat, "\t\t%ju output HB chunk%s\n"); p(sctps_sendecne, "\t\t%ju output ECNE chunk%s\n"); p(sctps_sendauth, "\t\t%ju output AUTH chunk%s\n"); p1a(sctps_senderrors, "\t\t%ju ip_output error counter\n"); From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 17:03:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B8A106567C; Sun, 13 Mar 2011 17:03:20 +0000 (UTC) (envelope-from pawel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FAC78FC15; Sun, 13 Mar 2011 17:03: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 p2DH3KZQ060664; Sun, 13 Mar 2011 17:03:20 GMT (envelope-from pawel@svn.freebsd.org) Received: (from pawel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DH3KKw060662; Sun, 13 Mar 2011 17:03:20 GMT (envelope-from pawel@svn.freebsd.org) Message-Id: <201103131703.p2DH3KKw060662@svn.freebsd.org> From: Pawel Pekala Date: Sun, 13 Mar 2011 17:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219614 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 17:03:20 -0000 Author: pawel (ports committer) Date: Sun Mar 13 17:03:19 2011 New Revision: 219614 URL: http://svn.freebsd.org/changeset/base/219614 Log: add myself Approved by: miwi (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Mar 13 16:47:21 2011 (r219613) +++ head/share/misc/committers-ports.dot Sun Mar 13 17:03:19 2011 (r219614) @@ -144,6 +144,7 @@ mharo [label="Michael Haro\nmharo@FreeBS osa [label="Sergey A. Osokin\nosa@FreeBSD.org\n2003/06/04"] pat [label="Patrick Li\npat@FreeBSD.org\n2001/11/14"] pav [label="Pav Lucistnik\npav@FreeBSD.org\n2003/11/12"] +pawel [label="Pawel Pekala\npawel@FreeBSD.org\n2011/03/11"] pgj [label="Gabor Pali\npgj@FreeBSD.org\n2009/04/12"] philip [label="Philip Paeps\nphilip@FreeBSD.org\n2005/10/19"] pgollucci [label="Philip M. Gollucci\npgollucci@FreeBSD.org\n2008/07/21"] @@ -330,6 +331,7 @@ miwi -> makc miwi -> mandree miwi -> mva miwi -> nox +miwi -> pawel miwi -> sylvio miwi -> tabthorpe miwi -> trasz @@ -403,6 +405,7 @@ tmclaugh -> itetcu tmclaugh -> xride wen -> culot +wen -> pawel will -> lioux From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 17:15:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2854F1065673; Sun, 13 Mar 2011 17:15:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1545A8FC0C; Sun, 13 Mar 2011 17:15: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 p2DHFVvM060947; Sun, 13 Mar 2011 17:15:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DHFVcV060941; Sun, 13 Mar 2011 17:15:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103131715.p2DHFVcV060941@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Mar 2011 17:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219615 - in head: release release/scripts usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 17:15:32 -0000 Author: nwhitehorn Date: Sun Mar 13 17:15:31 2011 New Revision: 219615 URL: http://svn.freebsd.org/changeset/base/219615 Log: Add generation of an installation manifest containing SHA256 checksums as well as package descriptions and add code in the installer to check the checksums. Added: head/release/scripts/make-manifest.sh (contents, props changed) head/usr.sbin/bsdinstall/scripts/checksum (contents, props changed) Modified: head/release/Makefile.bsdinstall head/usr.sbin/bsdinstall/scripts/Makefile head/usr.sbin/bsdinstall/scripts/auto Modified: head/release/Makefile.bsdinstall ============================================================================== --- head/release/Makefile.bsdinstall Sun Mar 13 17:03:19 2011 (r219614) +++ head/release/Makefile.bsdinstall Sun Mar 13 17:15:31 2011 (r219615) @@ -112,7 +112,8 @@ system: packagesystem -rm ${.OBJDIR}/release/boot/kernel/*.symbols # Copy distfiles mkdir ${.OBJDIR}/release/usr/freebsd-dist - cp ${.OBJDIR}/*.txz ${.OBJDIR}/release/usr/freebsd-dist + cp ${.OBJDIR}/*.txz ${.OBJDIR}/MANIFEST \ + ${.OBJDIR}/release/usr/freebsd-dist # Copy documentation, if generated .if !defined(NODOC) cp ${.OBJDIR}/reldoc/* ${.OBJDIR}/release @@ -134,13 +135,14 @@ memstick: system sh ${.CURDIR}/${TARGET}/make-memstick.sh ${.OBJDIR}/release ${.OBJDIR}/memstick packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} + sh ${.CURDIR}/${TARGET}/make-manifest.sh ${DISTDIR}/*.txz > ${.OBJDIR}/MANIFEST touch ${.OBJDIR}/${.TARGET} cdrom: release.iso ftp: packagesystem rm -rf ${.OBJDIR}/ftp mkdir ${.OBJDIR}/ftp - cp ${.OBJDIR}/*.txz ${.OBJDIR}/ftp + cp ${.OBJDIR}/*.txz ${.OBJDIR}/MANIFEST ${.OBJDIR}/ftp release: ${RELEASE_TARGETS} @@ -148,7 +150,7 @@ clean: chflags -R noschg ${.OBJDIR} rm -rf ${.OBJDIR}/dist ${.OBJDIR}/ftp rm -f packagesystem - rm -f ${.OBJDIR}/*.txz + rm -f ${.OBJDIR}/*.txz ${.OBJDIR}/MANIFEST rm -f system rm -rf ${.OBJDIR}/release rm -f ${.OBJDIR}/release.iso ${.OBJDIR}/memstick Added: head/release/scripts/make-manifest.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/scripts/make-manifest.sh Sun Mar 13 17:15:31 2011 (r219615) @@ -0,0 +1,25 @@ +#!/bin/sh + +# make-manifest.sh: create checksums and package descriptions for the installer +# +# Usage: make-manifest.sh foo1.txz foo2.txz ... +# +# The output file looks like this (tab-delimited): +# foo1.txz SHA256-checksu Number-of-files foo1 Description Install-by-default +# +# $FreeBSD$ + +desc_base="Base system (MANDATORY)" +desc_kernel="Kernel (MANDATORY)" +desc_doc="Additional documentation" +doc_default=off +desc_games="Games (fortune, etc.)" +desc_lib32="32-bit compatibility libraries" +desc_ports="Ports tree" +desc_src="System source code" +src_default=off + +for i in $*; do + echo "`basename $i` `sha256 -q $i` `tar tvf $i | wc -l | tr -d ' '` `basename $i .txz` \"`eval echo \\\$desc_$(basename $i .txz)`\" `eval echo \\\${$(basename $i .txz)_default:-on}`" +done + Modified: head/usr.sbin/bsdinstall/scripts/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/scripts/Makefile Sun Mar 13 17:03:19 2011 (r219614) +++ head/usr.sbin/bsdinstall/scripts/Makefile Sun Mar 13 17:15:31 2011 (r219615) @@ -1,7 +1,7 @@ # $FreeBSD$ -SCRIPTS= auto adduser config hostname jail keymap mount netconfig rootpass \ - services time umount wlanconfig +SCRIPTS= auto adduser checksum config hostname jail keymap mount netconfig \ + rootpass services time umount wlanconfig BINDIR= /usr/libexec/bsdinstall NO_MAN= true Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Sun Mar 13 17:03:19 2011 (r219614) +++ head/usr.sbin/bsdinstall/scripts/auto Sun Mar 13 17:15:31 2011 (r219615) @@ -50,26 +50,21 @@ bsdinstall keymap trap error SIGINT # Catch cntrl-C here bsdinstall hostname || error -LIB32="" -[ `uname -p` = amd64 -o `uname -p` = powerpc64 ] && \ - LIB32="lib32 \"32-bit compatibility\" on" - -DISTMENU="doc \"Additional documentation\" on \ - games \"Games (fortune, etc.)\" on \ - $LIB32 \ - ports \"Ports tree\" on \ - src \"System source code\" off" - -exec 3>&1 -EXTRA_DISTS=$(echo $DISTMENU | xargs dialog --backtitle "FreeBSD Installer" \ - --title "Distribution Select" --nocancel --separate-output \ - --checklist "Choose optional system components to install:" \ - 0 0 0 \ -2>&1 1>&3) export DISTRIBUTIONS="base.txz kernel.txz" -for dist in $EXTRA_DISTS; do - export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" -done +if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then + DISTMENU=`cut -f 4,5,6 $BSDINSTALL_DISTDIR/MANIFEST | grep -v -e ^kernel -e ^base` + + exec 3>&1 + EXTRA_DISTS=$(echo $DISTMENU | xargs dialog \ + --backtitle "FreeBSD Installer" \ + --title "Distribution Select" --nocancel --separate-output \ + --checklist "Choose optional system components to install:" \ + 0 0 0 \ + 2>&1 1>&3) + for dist in $EXTRA_DISTS; do + export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" + done +fi FETCH_DISTRIBUTIONS="" for dist in $DISTRIBUTIONS; do @@ -131,6 +126,7 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then export DISTRIBUTIONS="$ALL_DISTRIBUTIONS" fi +bsdinstall checksum || error bsdinstall distextract || error bsdinstall rootpass || error Added: head/usr.sbin/bsdinstall/scripts/checksum ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/scripts/checksum Sun Mar 13 17:15:31 2011 (r219615) @@ -0,0 +1,65 @@ +#!/bin/sh +#- +# Copyright (c) 2011 Nathan Whitehorn +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +test -f $BSDINSTALL_DISTDIR/MANIFEST || exit 0 + +percentage=0 +for dist in $DISTRIBUTIONS; do + distname=$(basename $dist .txz) + eval "status_$distname=7" + + items="" + for i in $DISTRIBUTIONS; do + items="$items $i `eval echo \\\${status_$(basename $i .txz):-Pending}`" + done + dialog --backtitle "FreeBSD Installer" --title "Checksum Verification" \ + --mixedgauge "Verifying checksums of selected distributions." \ + 0 0 $percentage $items + + CK=`sha256 -q $BSDINSTALL_DISTDIR/$dist` + awk -v checksum=$CK -v dist=$dist '{ + if (dist == $1) { + if (checksum == $2) + exit(0) + else + exit(1) + } + }' $BSDINSTALL_DISTDIR/MANIFEST + + if [ $? -eq 0 ]; then + eval "status_$distname=2" + percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc -w` | bc) + else + eval "status_$distname=1" + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 + exit 1 + fi +done + +exit 0 From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 18:02:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84041106564A; Sun, 13 Mar 2011 18:02:28 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 591098FC15; Sun, 13 Mar 2011 18:02: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 p2DI2StP061928; Sun, 13 Mar 2011 18:02:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DI2SMu061925; Sun, 13 Mar 2011 18:02:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103131802.p2DI2SMu061925@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Mar 2011 18:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219616 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 18:02:28 -0000 Author: nwhitehorn Date: Sun Mar 13 18:02:28 2011 New Revision: 219616 URL: http://svn.freebsd.org/changeset/base/219616 Log: Fix some typos due to unremoved commented-out lines. A great big pointy hat goes to me for this one. Modified: head/release/Makefile.bsdinstall head/release/generate-release.sh Modified: head/release/Makefile.bsdinstall ============================================================================== --- head/release/Makefile.bsdinstall Sun Mar 13 17:15:31 2011 (r219615) +++ head/release/Makefile.bsdinstall Sun Mar 13 18:02:28 2011 (r219616) @@ -135,7 +135,7 @@ memstick: system sh ${.CURDIR}/${TARGET}/make-memstick.sh ${.OBJDIR}/release ${.OBJDIR}/memstick packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} - sh ${.CURDIR}/${TARGET}/make-manifest.sh ${DISTDIR}/*.txz > ${.OBJDIR}/MANIFEST + sh ${.CURDIR}/scripts/make-manifest.sh ${.OBJDIR}/*.txz > ${.OBJDIR}/MANIFEST touch ${.OBJDIR}/${.TARGET} cdrom: release.iso Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Sun Mar 13 17:15:31 2011 (r219615) +++ head/release/generate-release.sh Sun Mar 13 18:02:28 2011 (r219616) @@ -42,7 +42,7 @@ if [ ! -z $CVSUP_HOST ]; then cp /etc/resolv.conf $2/etc/resolv.conf # Checkout ports and doc trees - #chroot $2 /usr/bin/csup /docports-supfile || exit 1 + chroot $2 /usr/bin/csup /docports-supfile || exit 1 # Build ports to build the docs, then build the docs chroot $2 /bin/sh -c 'pkg_add -r docproj || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' || exit 1 @@ -50,6 +50,7 @@ if [ ! -z $CVSUP_HOST ]; then fi chroot $2 /bin/sh -c "cd /usr/src && make $MAKE_FLAGS buildworld buildkernel" || exit 1 +chroot $2 /bin/sh -c "cd /usr/src/release && make -f Makefile.bsdinstall obj release $RELEASE_FLAGS" || exit 1 mkdir $2/R -chroot $2 /bin/sh -c "cd /usr/src/release && MAKEOBJDIR=/R make -f Makefile.bsdinstall release $RELEASE_FLAGS" || exit 1 +cp -pRP $2/usr/obj/usr/src/release/release.iso $2/usr/obj/usr/src/release/memstick $2/usr/obj/usr/src/release/ftp $2/R From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 18:23:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1C151065670; Sun, 13 Mar 2011 18:23:47 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFB018FC0C; Sun, 13 Mar 2011 18:23: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 p2DINlRm062375; Sun, 13 Mar 2011 18:23:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DINlRZ062373; Sun, 13 Mar 2011 18:23:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103131823.p2DINlRZ062373@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Mar 2011 18:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219617 - head/usr.sbin/bsdinstall/distextract X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 18:23:48 -0000 Author: nwhitehorn Date: Sun Mar 13 18:23:47 2011 New Revision: 219617 URL: http://svn.freebsd.org/changeset/base/219617 Log: Use the manifest file count, if available, to determine the number of files in the archive instead of spinning through it to get a file count for the progress bar. This speeds up installation a lot on systems with slow CD drives. Modified: head/usr.sbin/bsdinstall/distextract/distextract.c Modified: head/usr.sbin/bsdinstall/distextract/distextract.c ============================================================================== --- head/usr.sbin/bsdinstall/distextract/distextract.c Sun Mar 13 18:02:28 2011 (r219616) +++ head/usr.sbin/bsdinstall/distextract/distextract.c Sun Mar 13 18:23:47 2011 (r219617) @@ -26,6 +26,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -78,6 +79,63 @@ main(void) } static int +count_files(const char *file) +{ + struct archive *archive; + struct archive_entry *entry; + static FILE *manifest = NULL; + char path[MAXPATHLEN]; + char errormsg[512]; + int file_count, err; + + if (manifest == NULL) { + sprintf(path, "%s/MANIFEST", getenv("BSDINSTALL_DISTDIR")); + manifest = fopen(path, "r"); + } + + if (manifest != NULL) { + char line[512]; + char *tok1, *tok2; + while (fgets(line, sizeof(line), manifest) != NULL) { + tok2 = line; + tok1 = strsep(&tok2, "\t"); + if (tok1 == NULL || strcmp(tok1, file) != 0) + continue; + + /* + * We're at the right manifest line. The file count is + * in the third element + */ + tok1 = strsep(&tok2, "\t"); + tok1 = strsep(&tok2, "\t"); + if (tok1 != NULL) + return atoi(tok1); + } + } + + /* Either we didn't have a manifest, or this archive wasn't there */ + archive = archive_read_new(); + archive_read_support_format_all(archive); + archive_read_support_compression_all(archive); + sprintf(path, "%s/%s", getenv("BSDINSTALL_DISTDIR"), file); + err = archive_read_open_filename(archive, path, 4096); + if (err != ARCHIVE_OK) { + snprintf(errormsg, sizeof(errormsg), + "Error while extracting %s: %s\n", file, + archive_error_string(archive)); + dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); + return (-1); + } + + file_count = 0; + while (archive_read_next_header(archive, &entry) == ARCHIVE_OK) + file_count++; + archive_read_free(archive); + + return (file_count); +} + +static int extract_files(int nfiles, const char **files) { const char *items[nfiles*2]; @@ -106,28 +164,13 @@ extract_files(int nfiles, const char **f dialog_msgbox("", "Checking distribution archives.\nPlease wait...", 0, 0, FALSE); - /* Open all the archives */ + /* Count all the files */ total_files = 0; for (i = 0; i < nfiles; i++) { - archive = archive_read_new(); - archive_read_support_format_all(archive); - archive_read_support_compression_all(archive); - sprintf(path, "%s/%s", getenv("BSDINSTALL_DISTDIR"), files[i]); - err = archive_read_open_filename(archive, path, 4096); - if (err != ARCHIVE_OK) { - snprintf(errormsg, sizeof(errormsg), - "Error while extracting %s: %s\n", items[i*2], - archive_error_string(archive)); - items[i*2 + 1] = "Failed"; - dialog_msgbox("Extract Error", errormsg, 0, 0, - TRUE); - return (err); - } - archive_files[i] = 0; - while (archive_read_next_header(archive, &entry) == ARCHIVE_OK) - archive_files[i]++; + archive_files[i] = count_files(files[i]); + if (archive_files[i] < 0) + return (-1); total_files += archive_files[i]; - archive_read_free(archive); } current_files = 0; From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 18:26:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C252106564A; Sun, 13 Mar 2011 18:26:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A5618FC1A; Sun, 13 Mar 2011 18:26:17 +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 p2DIQGbq062475; Sun, 13 Mar 2011 18:26:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DIQGks062473; Sun, 13 Mar 2011 18:26:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103131826.p2DIQGks062473@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Mar 2011 18:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219618 - head/usr.sbin/bsdinstall/distextract X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 18:26:17 -0000 Author: nwhitehorn Date: Sun Mar 13 18:26:16 2011 New Revision: 219618 URL: http://svn.freebsd.org/changeset/base/219618 Log: Rewind manifest file in case distributions are in a different order there. Modified: head/usr.sbin/bsdinstall/distextract/distextract.c Modified: head/usr.sbin/bsdinstall/distextract/distextract.c ============================================================================== --- head/usr.sbin/bsdinstall/distextract/distextract.c Sun Mar 13 18:23:47 2011 (r219617) +++ head/usr.sbin/bsdinstall/distextract/distextract.c Sun Mar 13 18:26:16 2011 (r219618) @@ -96,6 +96,8 @@ count_files(const char *file) if (manifest != NULL) { char line[512]; char *tok1, *tok2; + + rewind(manifest); while (fgets(line, sizeof(line), manifest) != NULL) { tok2 = line; tok1 = strsep(&tok2, "\t"); From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 19:17:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01C0310656B6; Sun, 13 Mar 2011 19:17:01 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6FB678FC16; Sun, 13 Mar 2011 19:17:00 +0000 (UTC) Received: by qwc9 with SMTP id 9so917633qwc.13 for ; Sun, 13 Mar 2011 12:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=WkTPEMjZy6bG46f1qppkHJFt8dcynklCe8tr9JjfUaU=; b=a7BhPqAFugp4Pg6/QfzeB5o9XEM1c/B5feWopf1ACUvIAyV/APD++5QugBpg5fgiDK LRhx5nkkmg+XfFT+l7vJHNiv/pT1Dc6ABOc1rxUGEgdkyijRd/kjbbwxnIAmmrU8e7vy vW+U2dP0r0VdTue/ABMWN9fb3WDawLuO1+oYQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=FPYyszL6H7GOkvDi4IbWSCpCc0XnQSeJLbWQG01TwXRpiRUGvir//y1Azo0HGdgLhi jWwA7KDsUeFbn0/ESexHrK7p/gICRX08Ztjjr9BUVMdHXEQjdN6lcXXSk0mNbKrreEZC cfdCwtIb0IxLl6sV6qbYc6B5wtuTz+vxnb9Kg= MIME-Version: 1.0 Received: by 10.229.98.195 with SMTP id r3mr9128383qcn.287.1300043819706; Sun, 13 Mar 2011 12:16:59 -0700 (PDT) Sender: artemb@gmail.com Received: by 10.229.31.83 with HTTP; Sun, 13 Mar 2011 12:16:59 -0700 (PDT) In-Reply-To: <20110313141528.000013b1@unknown> References: <201103120851.p2C8phoN010341@svn.freebsd.org> <20110312205719.00004e67@unknown> <20110313141528.000013b1@unknown> Date: Sun, 13 Mar 2011 12:16:59 -0700 X-Google-Sender-Auth: 8djVdcP9_zezgtzDq-w2D7y0WsY Message-ID: From: Artem Belevich To: Alexander Leidinger Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r219559 - in head/sys: amd64/linux32 compat/freebsd32 i386/linux kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 19:17:01 -0000 On Sun, Mar 13, 2011 at 6:15 AM, Alexander Leidinger wrote: > On Sat, 12 Mar 2011 22:24:09 -0800 Artem Belevich > wrote: > >> >> Modified: head/sys/i386/linux/syscalls.master >> >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 l_h= andler_t handler); } >> >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 voi= d *handler); } >> > >> > What's wrong with l_handler_t? >> >> I don't recall the details, but I believe that the way l_handler_t is >> defined resulted in compilation errors in generated glue code. Glue >> generation code relies on '*' before the argument name in order to >> tell scalars from pointers. l_handler_t was interpreted as a scalar >> and on i386 where l_handler_t is a pointer, it produced compilation >> warning. > > What about documenting it with a comment nearby? How about this: handle is l_handle_t, but the makesyscalls.sh relies on '*' to tell pointers from scalars when it generates DTrace glue code, so void* had to be used. I don't have commit bit, though. --Artem From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 19:23:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 393711065689; Sun, 13 Mar 2011 19:23:33 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E0E78FC14; Sun, 13 Mar 2011 19:23:33 +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 p2DJNWK0063749; Sun, 13 Mar 2011 19:23:32 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DJNWhw063746; Sun, 13 Mar 2011 19:23:32 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201103131923.p2DJNWhw063746@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 13 Mar 2011 19:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219620 - head/sbin/hastctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 19:23:33 -0000 Author: trociny Date: Sun Mar 13 19:23:32 2011 New Revision: 219620 URL: http://svn.freebsd.org/changeset/base/219620 Log: In command line options allow size to be specified using k/M/G/T suffixes. Approved by: pjd (mentor) MFC after: 1 week Modified: head/sbin/hastctl/hastctl.8 head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.8 ============================================================================== --- head/sbin/hastctl/hastctl.8 Sun Mar 13 19:07:58 2011 (r219619) +++ head/sbin/hastctl/hastctl.8 Sun Mar 13 19:23:32 2011 (r219620) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 1, 2010 +.Dd March 13, 2011 .Dt HASTCTL 8 .Os .Sh NAME @@ -113,6 +113,9 @@ Size of the smaller provider used as bac This option can be omitted if node providers have the same size on both sides. .El +.Pp +If size is suffixed with a k, M, G or T, it is taken as a kilobyte, +megabyte, gigabyte or terabyte measurement respectively. .It Cm role Change role of the given resource. The role can be one of: Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Sun Mar 13 19:07:58 2011 (r219619) +++ head/sbin/hastctl/hastctl.c Sun Mar 13 19:23:32 2011 (r219620) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -342,30 +342,11 @@ control_status(struct nv *nv) return (ret); } -static int -numfromstr(const char *str, intmax_t *nump) -{ - intmax_t num; - char *suffix; - int rerrno; - - rerrno = errno; - errno = 0; - num = strtoimax(str, &suffix, 0); - if (errno == 0 && *suffix != '\0') - errno = EINVAL; - if (errno != 0) - return (-1); - *nump = num; - errno = rerrno; - return (0); -} - int main(int argc, char *argv[]) { struct nv *nv; - intmax_t mediasize, extentsize, keepdirty; + int64_t mediasize, extentsize, keepdirty; int cmd, debug, error, ii; const char *optstr; @@ -407,15 +388,15 @@ main(int argc, char *argv[]) debug++; break; case 'e': - if (numfromstr(optarg, &extentsize) < 0) + if (expand_number(optarg, &extentsize) < 0) err(1, "Invalid extentsize"); break; case 'k': - if (numfromstr(optarg, &keepdirty) < 0) + if (expand_number(optarg, &keepdirty) < 0) err(1, "Invalid keepdirty"); break; case 'm': - if (numfromstr(optarg, &mediasize) < 0) + if (expand_number(optarg, &mediasize) < 0) err(1, "Invalid mediasize"); break; case 'h': From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 19:35:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B504106564A; Sun, 13 Mar 2011 19:35:14 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE27C8FC13; Sun, 13 Mar 2011 19:35: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 p2DJZDt8064057; Sun, 13 Mar 2011 19:35:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DJZDSX064055; Sun, 13 Mar 2011 19:35:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103131935.p2DJZDSX064055@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 13 Mar 2011 19:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219621 - head/tools/regression/pjdfstest/tests/open X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 19:35:14 -0000 Author: pjd Date: Sun Mar 13 19:35:13 2011 New Revision: 219621 URL: http://svn.freebsd.org/changeset/base/219621 Log: POSIX accepts only ELOOP if O_NOFOLLOW is specified and target is a symlink. Modified: head/tools/regression/pjdfstest/tests/open/16.t Modified: head/tools/regression/pjdfstest/tests/open/16.t ============================================================================== --- head/tools/regression/pjdfstest/tests/open/16.t Sun Mar 13 19:23:32 2011 (r219620) +++ head/tools/regression/pjdfstest/tests/open/16.t Sun Mar 13 19:35:13 2011 (r219621) @@ -1,7 +1,7 @@ #!/bin/sh # $FreeBSD$ -desc="open returns EMLINK/ELOOP when O_NOFOLLOW was specified and the target is a symbolic link" +desc="open returns ELOOP when O_NOFOLLOW was specified and the target is a symbolic link" dir=`dirname $0` . ${dir}/../misc.sh @@ -12,8 +12,8 @@ n0=`namegen` n1=`namegen` expect 0 symlink ${n0} ${n1} -expect "EMLINK|ELOOP" open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 -expect "EMLINK|ELOOP" open ${n1} O_RDONLY,O_NOFOLLOW -expect "EMLINK|ELOOP" open ${n1} O_WRONLY,O_NOFOLLOW -expect "EMLINK|ELOOP" open ${n1} O_RDWR,O_NOFOLLOW +expect ELOOP open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 +expect ELOOP open ${n1} O_RDONLY,O_NOFOLLOW +expect ELOOP open ${n1} O_WRONLY,O_NOFOLLOW +expect ELOOP open ${n1} O_RDWR,O_NOFOLLOW expect 0 unlink ${n1} From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 20:02:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54436106566B; Sun, 13 Mar 2011 20:02:40 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4260F8FC17; Sun, 13 Mar 2011 20:02: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 p2DK2ebg064693; Sun, 13 Mar 2011 20:02:40 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DK2ejD064689; Sun, 13 Mar 2011 20:02:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103132002.p2DK2ejD064689@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Mar 2011 20:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219623 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 20:02:40 -0000 Author: jilles Date: Sun Mar 13 20:02:39 2011 New Revision: 219623 URL: http://svn.freebsd.org/changeset/base/219623 Log: sh: Fix some parameter expansion variants ${#...}. These already worked: $# ${#} ${##} ${#-} ${#?} These now work as well: ${#+word} ${#-word} ${##word} ${#%word} There is an ambiguity in the standard with ${#?}: it could be the length of $? or it could be $# giving an error in the (impossible) case that it is not set. We continue to use the former interpretation as it seems more useful. Added: head/tools/regression/bin/sh/expansion/plus-minus8.0 (contents, props changed) head/tools/regression/bin/sh/expansion/trim7.0 (contents, props changed) Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Mar 13 20:01:00 2011 (r219622) +++ head/bin/sh/parser.c Sun Mar 13 20:02:39 2011 (r219623) @@ -1447,6 +1447,7 @@ parsesub: { int bracketed_name = 0; /* used to handle ${[0-9]*} variables */ int linno; int length; + int c1; c = pgetc(); if (c != '(' && c != '{' && (is_eof(c) || !is_name(c)) && @@ -1473,15 +1474,9 @@ parsesub: { if (c == '{') { bracketed_name = 1; c = pgetc(); - if (c == '#') { - if ((c = pgetc()) == '}') - c = '#'; - else - subtype = VSLENGTH; - } - else - subtype = 0; + subtype = 0; } +varname: if (!is_eof(c) && is_name(c)) { length = 0; do { @@ -1511,19 +1506,35 @@ parsesub: { STPUTC(c, out); c = pgetc(); } - } else { - if (! is_special(c)) { - subtype = VSERROR; - if (c == '}') - pungetc(); - else if (c == '\n' || c == PEOF) - synerror("Unexpected end of line in substitution"); - else - USTPUTC(c, out); - } else { - USTPUTC(c, out); + } else if (is_special(c)) { + c1 = c; + c = pgetc(); + if (subtype == 0 && c1 == '#') { + subtype = VSLENGTH; + if (strchr(types, c) == NULL && c != ':' && + c != '#' && c != '%') + goto varname; + c1 = c; c = pgetc(); + if (c1 != '}' && c == '}') { + pungetc(); + c = c1; + goto varname; + } + pungetc(); + c = c1; + c1 = '#'; + subtype = 0; } + USTPUTC(c1, out); + } else { + subtype = VSERROR; + if (c == '}') + pungetc(); + else if (c == '\n' || c == PEOF) + synerror("Unexpected end of line in substitution"); + else + USTPUTC(c, out); } if (subtype == 0) { switch (c) { Added: head/tools/regression/bin/sh/expansion/plus-minus8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/plus-minus8.0 Sun Mar 13 20:02:39 2011 (r219623) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +set -- 1 2 3 4 5 6 7 8 9 10 11 12 13 +[ "${#+hi}" = hi ] || echo '${#+hi} wrong' +[ "${#-hi}" = 13 ] || echo '${#-hi} wrong' Added: head/tools/regression/bin/sh/expansion/trim7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/trim7.0 Sun Mar 13 20:02:39 2011 (r219623) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +set -- 1 2 3 4 5 6 7 8 9 10 11 12 13 +[ "${##1}" = 3 ] || echo '${##1} wrong' +[ "${###1}" = 3 ] || echo '${###1} wrong' +[ "${###}" = 13 ] || echo '${###} wrong' +[ "${#%3}" = 1 ] || echo '${#%3} wrong' +[ "${#%%3}" = 1 ] || echo '${#%%3} wrong' +[ "${#%%}" = 13 ] || echo '${#%%} wrong' +set -- +[ "${##0}" = "" ] || echo '${##0} wrong' +[ "${###0}" = "" ] || echo '${###0} wrong' +[ "${###}" = 0 ] || echo '${###} wrong' +[ "${#%0}" = "" ] || echo '${#%0} wrong' +[ "${#%%0}" = "" ] || echo '${#%%0} wrong' +[ "${#%%}" = 0 ] || echo '${#%%} wrong' From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 21:23:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 505AB1065675; Sun, 13 Mar 2011 21:23:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EF8F8FC18; Sun, 13 Mar 2011 21:23:26 +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 p2DLNQnn066364; Sun, 13 Mar 2011 21:23:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2DLNQmp066362; Sun, 13 Mar 2011 21:23:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103132123.p2DLNQmp066362@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Mar 2011 21:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219624 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 21:23:26 -0000 Author: nwhitehorn Date: Sun Mar 13 21:23:25 2011 New Revision: 219624 URL: http://svn.freebsd.org/changeset/base/219624 Log: Don't sleep while setting the clock. This can cause panics when periodic_resettodr() calls CLOCK_SETTIME() and smu tries to sleep while running from a callout. Reported by: Torfinn Ingolfsen Modified: head/sys/powerpc/powermac/smu.c Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Sun Mar 13 20:02:39 2011 (r219623) +++ head/sys/powerpc/powermac/smu.c Sun Mar 13 21:23:25 2011 (r219624) @@ -1177,7 +1177,7 @@ smu_gettime(device_t dev, struct timespe static int smu_settime(device_t dev, struct timespec *ts) { - struct smu_cmd cmd; + static struct smu_cmd cmd; struct clocktime ct; cmd.cmd = SMU_RTC; @@ -1194,7 +1194,7 @@ smu_settime(device_t dev, struct timespe cmd.data[6] = bin2bcd(ct.mon); cmd.data[7] = bin2bcd(ct.year - 2000); - return (smu_run_cmd(dev, &cmd, 1)); + return (smu_run_cmd(dev, &cmd, 0)); } /* SMU I2C Interface */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 00:42:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98827106564A; Mon, 14 Mar 2011 00:42:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 866618FC13; Mon, 14 Mar 2011 00:42: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 p2E0gmiP071791; Mon, 14 Mar 2011 00:42:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2E0gmbA071789; Mon, 14 Mar 2011 00:42:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103140042.p2E0gmbA071789@svn.freebsd.org> From: Adrian Chadd Date: Mon, 14 Mar 2011 00:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219627 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 00:42:48 -0000 Author: adrian Date: Mon Mar 14 00:42:48 2011 New Revision: 219627 URL: http://svn.freebsd.org/changeset/base/219627 Log: Bring over the AR9285 board update code from ath9k. This does a few things in particular: * Abstracts out the gain control settings into a separate function; * Configure antenna diversity, LNA and antenna gain parameters; * Configure ob/db entries - the later v4k EEPROM modal revisions have multiple OB/DB parameters which are used for some form of calibration. Although the radio does have defaults for each, the EEPROM can override them. This resolves the AR2427 related issues I've been seeing and makes it stable at all 11g rates for both TX and RX. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Sun Mar 13 22:04:19 2011 (r219626) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Mon Mar 14 00:42:48 2011 (r219627) @@ -36,6 +36,8 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +#include "ar9002/ar9285phy.h" + /* Eeprom versioning macros. Returns true if the version is equal or newer than the ver specified */ #define EEP_MINOR(_ah) \ (AH_PRIVATE(_ah)->ah_eeversion & AR5416_EEP_VER_MINOR_MASK) @@ -236,67 +238,198 @@ ar9285SetTransmitPower(struct ath_hal *a #undef N } +static void +ath9285SetBoardGain(struct ath_hal *ah, const MODAL_EEP4K_HEADER *pModal, + const struct ar5416eeprom_4k *eep, uint8_t txRxAttenLocal) +{ + OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, + pModal->antCtrlChain[0]); + + OS_REG_WRITE(ah, AR_PHY_TIMING_CTRL4_CHAIN(0), + (OS_REG_READ(ah, AR_PHY_TIMING_CTRL4_CHAIN(0)) & + ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | + AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | + SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | + SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); + + if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= + AR5416_EEP_MINOR_VER_3) { + txRxAttenLocal = pModal->txRxAttenCh[0]; + + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, + AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, pModal->bswMargin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, + AR_PHY_GAIN_2GHZ_XATTEN1_DB, pModal->bswAtten[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, + AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, pModal->xatten2Margin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, + AR_PHY_GAIN_2GHZ_XATTEN2_DB, pModal->xatten2Db[0]); + + /* Set the block 1 value to block 0 value */ + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, + pModal->bswMargin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN1_DB, pModal->bswAtten[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, + pModal->xatten2Margin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN2_DB, pModal->xatten2Db[0]); + } + + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN, + AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN, + AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); + + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, + AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, + AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); +} + +/* + * Read EEPROM header info and program the device for correct operation + * given the channel value. + */ HAL_BOOL ar9285SetBoardValues(struct ath_hal *ah, const struct ieee80211_channel *chan) { - const HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; - const struct ar5416eeprom_4k *eep = &ee->ee_base; - const MODAL_EEP4K_HEADER *pModal; - uint8_t txRxAttenLocal = 23; + const HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + const struct ar5416eeprom_4k *eep = &ee->ee_base; + const MODAL_EEP4K_HEADER *pModal; + uint8_t txRxAttenLocal; + uint8_t ob[5], db1[5], db2[5]; + uint8_t ant_div_control1, ant_div_control2; + uint32_t regVal; + + pModal = &eep->modalHeader; + txRxAttenLocal = 23; + + OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon); + + /* Single chain for 4K EEPROM*/ + ar9285SetBoardGain(ah, pModal, eep, txRxAttenLocal); + + /* Initialize Ant Diversity settings from EEPROM */ + if (pModal->version >= 3) { + ant_div_control1 = pModal->antdiv_ctl1; + ant_div_control2 = pModal->antdiv_ctl2; + + regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); + regVal &= (~(AR_PHY_9285_ANT_DIV_CTL_ALL)); + + regVal |= SM(ant_div_control1, + AR_PHY_9285_ANT_DIV_CTL); + regVal |= SM(ant_div_control2, + AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM((ant_div_control2 >> 2), + AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM((ant_div_control1 >> 1), + AR_PHY_9285_ANT_DIV_ALT_GAINTB); + regVal |= SM((ant_div_control1 >> 2), + AR_PHY_9285_ANT_DIV_MAIN_GAINTB); + + OS_REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regVal); + regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); + regVal = OS_REG_READ(ah, AR_PHY_CCK_DETECT); + regVal &= (~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); + regVal |= SM((ant_div_control1 >> 3), + AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); - HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); - pModal = &eep->modalHeader; - - OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon); - OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, pModal->antCtrlChain[0]); - OS_REG_WRITE(ah, AR_PHY_TIMING_CTRL4, - (OS_REG_READ(ah, AR_PHY_TIMING_CTRL4) & - ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | - SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | - SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); + OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, regVal); + regVal = OS_REG_READ(ah, AR_PHY_CCK_DETECT); + } - if (IS_EEP_MINOR_V3(ah)) { - if (IEEE80211_IS_CHAN_HT40(chan)) { - /* Overwrite switch settling with HT40 value */ - OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, - pModal->swSettleHt40); + if (pModal->version >= 2) { + ob[0] = pModal->ob_0; + ob[1] = pModal->ob_1; + ob[2] = pModal->ob_2; + ob[3] = pModal->ob_3; + ob[4] = pModal->ob_4; + + db1[0] = pModal->db1_0; + db1[1] = pModal->db1_1; + db1[2] = pModal->db1_2; + db1[3] = pModal->db1_3; + db1[4] = pModal->db1_4; + + db2[0] = pModal->db2_0; + db2[1] = pModal->db2_1; + db2[2] = pModal->db2_2; + db2[3] = pModal->db2_3; + db2[4] = pModal->db2_4; + } else if (pModal->version == 1) { + ob[0] = pModal->ob_0; + ob[1] = ob[2] = ob[3] = ob[4] = pModal->ob_1; + db1[0] = pModal->db1_0; + db1[1] = db1[2] = db1[3] = db1[4] = pModal->db1_1; + db2[0] = pModal->db2_0; + db2[1] = db2[2] = db2[3] = db2[4] = pModal->db2_1; + } else { + int i; + + for (i = 0; i < 5; i++) { + ob[i] = pModal->ob_0; + db1[i] = pModal->db1_0; + db2[i] = pModal->db1_0; + } } - txRxAttenLocal = pModal->txRxAttenCh[0]; - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, - pModal->bswMargin[0]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN1_DB, - pModal->bswAtten[0]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, - pModal->xatten2Margin[0]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN2_DB, - pModal->xatten2Db[0]); - - /* block 1 has the same values as block 0 */ - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, - AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, pModal->bswMargin[0]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, - AR_PHY_GAIN_2GHZ_XATTEN1_DB, pModal->bswAtten[0]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, - AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, pModal->xatten2Margin[0]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, - AR_PHY_GAIN_2GHZ_XATTEN2_DB, pModal->xatten2Db[0]); - - } - OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN, - AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); - OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN, - AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); - - OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, - AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); - OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, - AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_OB_0, ob[0]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_OB_1, ob[1]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_OB_2, ob[2]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_OB_3, ob[3]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_OB_4, ob[4]); + + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_DB1_0, db1[0]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_DB1_1, db1[1]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_DB1_2, db1[2]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G4, AR9285_AN_RF2G4_DB1_3, db1[3]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G4, AR9285_AN_RF2G4_DB1_4, db1[4]); + + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G4, AR9285_AN_RF2G4_DB2_0, db2[0]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G4, AR9285_AN_RF2G4_DB2_1, db2[1]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G4, AR9285_AN_RF2G4_DB2_2, db2[2]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G4, AR9285_AN_RF2G4_DB2_3, db2[3]); + OS_A_REG_RMW_FIELD(ah, AR9285_AN_RF2G4, AR9285_AN_RF2G4_DB2_4, db2[4]); + + OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, + pModal->switchSettling); + OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC, + pModal->adcDesiredSize); + + OS_REG_WRITE(ah, AR_PHY_RF_CTL4, + SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAA_OFF) | + SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAB_OFF) | + SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAA_ON) | + SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAB_ON)); + + OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON, + pModal->txEndToRxOn); + + OS_REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62, + pModal->thresh62); + OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, AR_PHY_EXT_CCA0_THRESH62, + pModal->thresh62); + + if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= + AR5416_EEP_MINOR_VER_2) { + OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_DATA_START, + pModal->txFrameToDataStart); + OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_PA_ON, + pModal->txFrameToPaOn); + } - if (AR_SREV_KITE_11(ah)) - OS_REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14)); + if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= + AR5416_EEP_MINOR_VER_3) { + if (IEEE80211_IS_CHAN_HT40(chan)) + OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, + AR_PHY_SETTLING_SWITCH, pModal->swSettleHt40); + } - return AH_TRUE; + return AH_TRUE; } /* From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 02:32:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E682106564A; Mon, 14 Mar 2011 02:32:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E3C38FC08; Mon, 14 Mar 2011 02:32: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 p2E2WAFv074205; Mon, 14 Mar 2011 02:32:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2E2WA3S074203; Mon, 14 Mar 2011 02:32:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103140232.p2E2WA3S074203@svn.freebsd.org> From: Adrian Chadd Date: Mon, 14 Mar 2011 02:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219628 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 02:32:10 -0000 Author: adrian Date: Mon Mar 14 02:32:10 2011 New Revision: 219628 URL: http://svn.freebsd.org/changeset/base/219628 Log: Fix typo that snuck in. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Mon Mar 14 00:42:48 2011 (r219627) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Mon Mar 14 02:32:10 2011 (r219628) @@ -239,7 +239,7 @@ ar9285SetTransmitPower(struct ath_hal *a } static void -ath9285SetBoardGain(struct ath_hal *ah, const MODAL_EEP4K_HEADER *pModal, +ar9285SetBoardGain(struct ath_hal *ah, const MODAL_EEP4K_HEADER *pModal, const struct ar5416eeprom_4k *eep, uint8_t txRxAttenLocal) { OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 09:50:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF3BF106566B; Mon, 14 Mar 2011 09:50:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B96128FC24; Mon, 14 Mar 2011 09:50: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 p2E9oE0a084191; Mon, 14 Mar 2011 09:50:14 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2E9oEm4084178; Mon, 14 Mar 2011 09:50:14 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201103140950.p2E9oEm4084178@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 14 Mar 2011 09:50: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: r219633 - in stable/8: share/man/man4 sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/modules sys/modules/cxgbe usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 09:50:14 -0000 Author: np Date: Mon Mar 14 09:50:14 2011 New Revision: 219633 URL: http://svn.freebsd.org/changeset/base/219633 Log: MFC cxgbe(4) and fixes. r218792: cxgbe(4) - NIC driver for Chelsio T4 (Terminator 4) based 10Gb/1Gb adapters. r219285: Fix incorrect assertion. r219286: Resume tx immediately in response to an SGE egress update from the hardware. r219287: Upgrade the firmware on the card automatically if a better version is available. Downgrade only for a major version mismatch. r219288: A txpkts work request should have a valid FID. r219289: Store the ifnet rather than the port_info in each txq and rxq struct. r219290: Tweaks for rx: - everything related to LRO should be in #ifdef INET blocks - reorder sge_iq's fields so that the most frequently used are all together - pull all rx code into t4_intr_data directly - let go of the ingress queue lock when passing up data - refill the freelist only if it is short of at least 32 buffers r219292: Calculate how many descriptors can be reclaimed before calling reclaim_tx_descs r219293: There is no need to hold an ingress queue's lock while processing its descriptors r219299: Be sure to stay within the bounds of the mod_str array when displaying the transceiver type. r219392: cxgbe shouldn't directly know of the UMA zones where network buffers come from. r219436: Display holdoff timers and packet counts as a list of numbers. Added: stable/8/share/man/man4/cxgbe.4 - copied unchanged from r218792, head/share/man/man4/cxgbe.4 stable/8/sys/dev/cxgbe/ - copied from r218792, head/sys/dev/cxgbe/ stable/8/sys/modules/cxgbe/ - copied from r218792, head/sys/modules/cxgbe/ Modified: stable/8/share/man/man4/Makefile stable/8/share/man/man4/altq.4 stable/8/share/man/man4/vlan.4 stable/8/sys/conf/NOTES stable/8/sys/conf/files stable/8/sys/conf/kern.pre.mk stable/8/sys/dev/cxgbe/adapter.h stable/8/sys/dev/cxgbe/common/common.h stable/8/sys/dev/cxgbe/t4_main.c stable/8/sys/dev/cxgbe/t4_sge.c stable/8/sys/modules/Makefile stable/8/usr.sbin/sysinstall/devices.c Directory Properties: stable/8/share/man/man4/ (props changed) 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) stable/8/usr.sbin/sysinstall/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Mon Mar 14 05:29:45 2011 (r219632) +++ stable/8/share/man/man4/Makefile Mon Mar 14 09:50:14 2011 (r219633) @@ -81,6 +81,7 @@ MAN= aac.4 \ crypto.4 \ cue.4 \ cxgb.4 \ + cxgbe.4 \ cy.4 \ da.4 \ dc.4 \ Modified: stable/8/share/man/man4/altq.4 ============================================================================== --- stable/8/share/man/man4/altq.4 Mon Mar 14 05:29:45 2011 (r219632) +++ stable/8/share/man/man4/altq.4 Mon Mar 14 09:50:14 2011 (r219633) @@ -127,6 +127,7 @@ They have been applied to the following .Xr bfe 4 , .Xr bge 4 , .Xr cas 4 , +.Xr cxgbe 4 , .Xr dc 4 , .Xr de 4 , .Xr ed 4 , Copied: stable/8/share/man/man4/cxgbe.4 (from r218792, head/share/man/man4/cxgbe.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/cxgbe.4 Mon Mar 14 09:50:14 2011 (r219633, copy of r218792, head/share/man/man4/cxgbe.4) @@ -0,0 +1,167 @@ +.\" Copyright (c) 2011, Chelsio Inc +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright notice, +.\" this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" 3. Neither the name of the Chelsio Inc nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" * Other names and brands may be claimed as the property of others. +.\" +.\" $FreeBSD$ +.\" +.Dd February 14, 2011 +.Dt CXGBE 4 +.Os +.Sh NAME +.Nm cxgbe +.Nd "Chelsio T4 10Gb and 1Gb Ethernet adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device cxgbe" +.Ed +.Pp +To load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_cxgbe_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for PCI Express Ethernet adapters based on +the Chelsio Terminator 4 (T4) ASIC. +The driver supprts Jumbo Frames, Transmit/Receive checksum offload, +TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN +tag insertion/extraction, VLAN checksum offload, VLAN TSO, and +Receive Side Steering (RSS). + +For further hardware information and questions related to hardware +requirements, see +.Pa http://www.chelsio.com/ . +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports 10Gb and 1Gb Ethernet adapters based on the T4 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T420-CR +.It +Chelsio T422-CR +.It +Chelsio T440-CR +.It +Chelsio T420-BCH +.It +Chelsio T440-BCH +.It +Chelsio T440-CH +.It +Chelsio T420-SO +.It +Chelsio T420-CX +.It +Chelsio T420-BT +.It +Chelsio T404-BT +.El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va hw.cxgbe.max_ntxq_10G_port +The maximum number of tx queues to use for a 10Gb port. +The default value is 8. +.It Va hw.cxgbe.max_nrxq_10G_port +The maximum number of rx queues to use for a 10Gb port. +The default value is 8. +.It Va hw.cxgbe.max_ntxq_1G_port +The maximum number of tx queues to use for a 1Gb port. +The default value is 2. +.It Va hw.cxgbe.max_nrxq_1G_port +The maximum number of rx queues to use for a 1Gb port. +The default value is 2. +.It Va hw.cxgbe.holdoff_timer_idx_10G +.It Va hw.cxgbe.holdoff_timer_idx_1G +The timer index value to use to delay interrupts. +The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 +by default (all values are in microseconds) and the index selects a +value from this list. +The default value is 1 for both 10Gb and 1Gb ports, which means the +timer value is 5us. +.It Va hw.cxgbe.holdoff_pktc_idx_10G +.It Va hw.cxgbe.holdoff_pktc_idx_1G +The packet-count index value to use to delay interrupts. +The packet-count list has the values 1, 8, 16, and 32 by default +and the index selects a value from this list. +The default value is 2 for both 10Gb and 1Gb ports, which means 16 +packets (or the holdoff timer going off) before an interrupt is +generated. +.It Va hw.cxgbe.qsize_txq +The size, in number of entries, of the descriptor ring used for a tx +queue. +A buf_ring of the same size is also allocated for additional +software queuing. See +.Xr ifnet 9 . +The default value is 1024. +.It Va hw.cxgbe.qsize_rxq +The size, in number of entries, of the descriptor ring used for an +rx queue. +The default value is 1024. +.Sh SUPPORT +For general information and support, +go to the Chelsio support website at: +.Pa http://www.chelsio.com/ . +.Pp +If an issue is identified with this driver with a supported adapter, +email all the specific information related to the issue to +.Aq support@chelsio.com . +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr cxgb 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.0 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Navdeep Parhar Aq np@FreeBSD.org . Modified: stable/8/share/man/man4/vlan.4 ============================================================================== --- stable/8/share/man/man4/vlan.4 Mon Mar 14 05:29:45 2011 (r219632) +++ stable/8/share/man/man4/vlan.4 Mon Mar 14 09:50:14 2011 (r219633) @@ -128,6 +128,7 @@ in the hardware is limited to the follow .Xr bce 4 , .Xr bge 4 , .Xr cxgb 4 , +.Xr cxgbe 4 , .Xr em 4 , .Xr igb 4 , .Xr ixgb 4 , Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Mon Mar 14 05:29:45 2011 (r219632) +++ stable/8/sys/conf/NOTES Mon Mar 14 09:50:14 2011 (r219633) @@ -1877,6 +1877,8 @@ device xmphy # XaQti XMAC II # cas: Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. +# cxgbe: Support for PCI express 10Gb/1Gb adapters based on the Chelsio T4 +# (Terminator 4) ASIC. # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 # and various workalikes including: # the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics @@ -2048,6 +2050,7 @@ device xl # 3Com 3c90x (``Boomerang'', # PCI Ethernet NICs. device bwi # Broadcom BCM430* BCM431* +device cxgbe # Chelsio T4 10GbE PCIe adapter device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Mar 14 05:29:45 2011 (r219632) +++ stable/8/sys/conf/files Mon Mar 14 09:50:14 2011 (r219633) @@ -822,6 +822,12 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb p compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ compile-with "${NORMAL_C} -I$S/dev/cxgb" +dev/cxgbe/t4_main.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/t4_sge.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/common/t4_hw.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci Modified: stable/8/sys/conf/kern.pre.mk ============================================================================== --- stable/8/sys/conf/kern.pre.mk Mon Mar 14 05:29:45 2011 (r219632) +++ stable/8/sys/conf/kern.pre.mk Mon Mar 14 09:50:14 2011 (r219633) @@ -79,8 +79,8 @@ INCLUDES+= -I$S/dev/twa # ... and XFS INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs -# ... and the same for cxgb -INCLUDES+= -I$S/dev/cxgb +# ... and the same for cxgb and cxgbe +INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe .endif Modified: stable/8/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Feb 18 08:00:26 2011 (r218792) +++ stable/8/sys/dev/cxgbe/adapter.h Mon Mar 14 09:50:14 2011 (r219633) @@ -70,8 +70,8 @@ static __inline uint64_t t4_bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t offset) { - KASSERT(tag == X86_BUS_SPACE_IO, - ("64-bit reads from I/O space not possible.")); + KASSERT(tag == AMD64_BUS_SPACE_MEM, + ("%s: can only handle mem space", __func__)); return (*(volatile uint64_t *)(handle + offset)); } @@ -80,8 +80,9 @@ static __inline void t4_bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, uint64_t value) { - KASSERT(tag == X86_BUS_SPACE_IO, - ("64-bit writes to I/O space not possible.")); + KASSERT(tag == AMD64_BUS_SPACE_MEM, + ("%s: can only handle mem space", __func__)); + *(volatile uint64_t *)(bsh + offset) = value; } #else @@ -114,7 +115,11 @@ enum { RX_FL_ESIZE = 64, /* 8 64bit addresses */ - FL_BUF_SIZES = 4, +#if MJUMPAGESIZE != MCLBYTES + FL_BUF_SIZES = 4, /* cluster, jumbop, jumbo9k, jumbo16k */ +#else + FL_BUF_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ +#endif TX_EQ_QSIZE = 1024, TX_EQ_ESIZE = 64, @@ -176,6 +181,7 @@ struct port_info { struct link_config link_cfg; struct port_stats stats; + struct taskqueue *tq; struct callout tick; struct sysctl_ctx_list ctx; /* lives from ifconfig up to down */ struct sysctl_oid *oid_rxq; @@ -222,24 +228,25 @@ enum { struct sge_iq { bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; - struct mtx iq_lock; + bus_addr_t ba; /* bus address of descriptor ring */ char lockname[16]; - unsigned int flags; - struct adapter *adapter; + uint32_t flags; + uint16_t abs_id; /* absolute SGE id for the iq */ + int8_t intr_pktc_idx; /* packet count threshold index */ + int8_t pad0; + iq_intr_handler_t *handler; + __be64 *desc; /* KVA of descriptor ring */ - __be64 *desc; /* KVA of descriptor ring */ - bus_addr_t ba; /* bus address of descriptor ring */ + struct mtx iq_lock; + struct adapter *adapter; const __be64 *cdesc; /* current descriptor */ uint8_t gen; /* generation bit */ uint8_t intr_params; /* interrupt holdoff parameters */ - int8_t intr_pktc_idx; /* packet count threshold index */ uint8_t intr_next; /* holdoff for next interrupt */ uint8_t esize; /* size (bytes) of each entry in the queue */ uint16_t qsize; /* size (# of entries) of the queue */ uint16_t cidx; /* consumer index */ uint16_t cntxt_id; /* SGE context id for the iq */ - uint16_t abs_id; /* absolute SGE id for the iq */ - iq_intr_handler_t *handler; }; enum { @@ -274,6 +281,7 @@ struct sge_eq { uint16_t cidx; /* consumer idx (desc idx) */ uint16_t pidx; /* producer idx (desc idx) */ uint16_t pending; /* # of descriptors used since last doorbell */ + uint16_t iqid; /* iq that gets egr_update for the eq */ uint32_t cntxt_id; /* SGE context id for the eq */ /* DMA maps used for tx */ @@ -309,6 +317,9 @@ struct sge_fl { struct sge_txq { struct sge_eq eq; /* MUST be first */ struct mbuf *m; /* held up due to temporary resource shortage */ + struct task resume_tx; + + struct ifnet *ifp; /* the interface this txq belongs to */ /* stats for common events first */ @@ -336,9 +347,11 @@ struct sge_rxq { struct sge_iq iq; /* MUST be first */ struct sge_fl fl; + struct ifnet *ifp; /* the interface this rxq belongs to */ unsigned int flags; - struct port_info *port; /* the port this rxq belongs to */ +#ifdef INET struct lro_ctrl lro; /* LRO state */ +#endif /* stats for common events first */ @@ -544,13 +557,16 @@ static inline bool is_10G_port(const str return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); } +/* t4_main.c */ +void cxgbe_txq_start(void *, int); int t4_os_find_pci_capability(struct adapter *, int); int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); - void t4_os_portmod_changed(const struct adapter *, int); void t4_os_link_changed(struct adapter *, int, int); +/* t4_sge.c */ +void t4_sge_modload(void); void t4_sge_init(struct adapter *); int t4_create_dma_tag(struct adapter *); int t4_destroy_dma_tag(struct adapter *); Modified: stable/8/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Fri Feb 18 08:00:26 2011 (r218792) +++ stable/8/sys/dev/cxgbe/common/common.h Mon Mar 14 09:50:14 2011 (r219633) @@ -53,8 +53,8 @@ enum { }; #define FW_VERSION_MAJOR 1 -#define FW_VERSION_MINOR 2 -#define FW_VERSION_MICRO 65 +#define FW_VERSION_MINOR 3 +#define FW_VERSION_MICRO 0 struct port_stats { u64 tx_octets; /* total # of octets in good frames */ Modified: stable/8/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Feb 18 08:00:26 2011 (r218792) +++ stable/8/sys/dev/cxgbe/t4_main.c Mon Mar 14 09:50:14 2011 (r219633) @@ -36,11 +36,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include #include #include +#include #include #include #include @@ -269,12 +273,14 @@ static void t4_get_regs(struct adapter * static void cxgbe_tick(void *); static int t4_sysctls(struct adapter *); static int cxgbe_sysctls(struct port_info *); +static int sysctl_int_array(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); - +static inline void txq_start(struct ifnet *, struct sge_txq *); +static int t4_mod_event(module_t, int, void *); struct t4_pciids { uint16_t device; @@ -692,6 +698,15 @@ cxgbe_attach(device_t dev) ifp->if_softc = pi; callout_init(&pi->tick, CALLOUT_MPSAFE); + pi->tq = taskqueue_create("cxgbe_taskq", M_NOWAIT, + taskqueue_thread_enqueue, &pi->tq); + if (pi->tq == NULL) { + device_printf(dev, "failed to allocate port task queue\n"); + if_free(pi->ifp); + return (ENOMEM); + } + taskqueue_start_threads(&pi->tq, 1, PI_NET, "%s taskq", + device_get_nameunit(dev)); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -746,6 +761,8 @@ cxgbe_detach(device_t dev) if (rc != 0) device_printf(dev, "port uninit failed: %d.\n", rc); + taskqueue_free(pi->tq); + ifmedia_removeall(&pi->media); ether_ifdetach(pi->ifp); if_free(pi->ifp); @@ -951,13 +968,7 @@ cxgbe_start(struct ifnet *ifp) for_each_txq(pi, i, txq) { if (TXQ_TRYLOCK(txq)) { - struct buf_ring *br = txq->eq.br; - struct mbuf *m; - - m = txq->m ? txq->m : drbr_dequeue(ifp, br); - if (m) - t4_eth_tx(ifp, txq, m); - + txq_start(ifp, txq); TXQ_UNLOCK(txq); } } @@ -1247,28 +1258,69 @@ prep_firmware(struct adapter *sc) /* Check firmware version and install a different one if necessary */ rc = t4_check_fw_version(sc); if (rc != 0 || force_firmware_install) { + uint32_t v = 0; fw = firmware_get(T4_FWNAME); - if (fw == NULL) { - device_printf(sc->dev, - "Could not find firmware image %s\n", T4_FWNAME); - return (ENOENT); + if (fw != NULL) { + const struct fw_hdr *hdr = (const void *)fw->data; + + v = ntohl(hdr->fw_ver); + + /* + * The firmware module will not be used if it isn't the + * same major version as what the driver was compiled + * with. This check trumps force_firmware_install. + */ + if (G_FW_HDR_FW_VER_MAJOR(v) != FW_VERSION_MAJOR) { + device_printf(sc->dev, + "Found firmware image but version %d " + "can not be used with this driver (%d)\n", + G_FW_HDR_FW_VER_MAJOR(v), FW_VERSION_MAJOR); + + firmware_put(fw, FIRMWARE_UNLOAD); + fw = NULL; + } } - device_printf(sc->dev, - "installing firmware %d.%d.%d on card.\n", - FW_VERSION_MAJOR, FW_VERSION_MINOR, FW_VERSION_MICRO); - rc = -t4_load_fw(sc, fw->data, fw->datasize); - if (rc != 0) { + if (fw == NULL && (rc < 0 || force_firmware_install)) { + device_printf(sc->dev, "No usable firmware. " + "card has %d.%d.%d, driver compiled with %d.%d.%d, " + "force_firmware_install%s set", + G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers), + FW_VERSION_MAJOR, FW_VERSION_MINOR, + FW_VERSION_MICRO, + force_firmware_install ? "" : " not"); + return (EAGAIN); + } + + /* + * Always upgrade, even for minor/micro/build mismatches. + * Downgrade only for a major version mismatch or if + * force_firmware_install was specified. + */ + if (fw != NULL && (rc < 0 || force_firmware_install || + v > sc->params.fw_vers)) { device_printf(sc->dev, - "failed to install firmware: %d\n", rc); - return (rc); - } else { - t4_get_fw_version(sc, &sc->params.fw_vers); - t4_get_tp_version(sc, &sc->params.tp_vers); + "installing firmware %d.%d.%d.%d on card.\n", + G_FW_HDR_FW_VER_MAJOR(v), G_FW_HDR_FW_VER_MINOR(v), + G_FW_HDR_FW_VER_MICRO(v), G_FW_HDR_FW_VER_BUILD(v)); + + rc = -t4_load_fw(sc, fw->data, fw->datasize); + if (rc != 0) { + device_printf(sc->dev, + "failed to install firmware: %d\n", rc); + firmware_put(fw, FIRMWARE_UNLOAD); + return (rc); + } else { + /* refresh */ + (void) t4_check_fw_version(sc); + } } - firmware_put(fw, FIRMWARE_UNLOAD); + if (fw != NULL) + firmware_put(fw, FIRMWARE_UNLOAD); } /* Contact firmware, request master */ @@ -2244,15 +2296,13 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, &sc->params.vpd.cclk, 0, "core clock frequency (in KHz)"); - /* XXX: this doesn't seem to show up */ - SYSCTL_ADD_OPAQUE(ctx, children, OID_AUTO, "holdoff_tmr", - CTLFLAG_RD, &intr_timer, sizeof(intr_timer), "IU", - "interrupt holdoff timer values (us)"); - - /* XXX: this doesn't seem to show up */ - SYSCTL_ADD_OPAQUE(ctx, children, OID_AUTO, "holdoff_pktc", - CTLFLAG_RD, &intr_pktcount, sizeof(intr_pktcount), "IU", - "interrupt holdoff packet counter values"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers", + CTLTYPE_STRING | CTLFLAG_RD, &intr_timer, sizeof(intr_timer), + sysctl_int_array, "A", "interrupt holdoff timer values (us)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts", + CTLTYPE_STRING | CTLFLAG_RD, &intr_pktcount, sizeof(intr_pktcount), + sysctl_int_array, "A", "interrupt holdoff packet counter values"); return (0); } @@ -2304,7 +2354,7 @@ cxgbe_sysctls(struct port_info *pi) #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ - CTLTYPE_U64 | CTLFLAG_RD, pi->adapter, reg, \ + CTLTYPE_QUAD | CTLFLAG_RD, pi->adapter, reg, \ sysctl_handle_t4_reg64, "QU", desc) SYSCTL_ADD_T4_REG64(pi, "tx_octets", "# of octets in good frames", @@ -2428,7 +2478,7 @@ cxgbe_sysctls(struct port_info *pi) #undef SYSCTL_ADD_T4_REG64 #define SYSCTL_ADD_T4_PORTSTAT(name, desc) \ - SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, #name, CTLFLAG_RD, \ + SYSCTL_ADD_QUAD(ctx, children, OID_AUTO, #name, CTLFLAG_RD, \ &pi->stats.name, desc) /* We get these from port_stats and they may be stale by upto 1s */ @@ -2455,6 +2505,22 @@ cxgbe_sysctls(struct port_info *pi) } static int +sysctl_int_array(SYSCTL_HANDLER_ARGS) +{ + int rc, *i; + struct sbuf sb; + + sbuf_new(&sb, NULL, 32, SBUF_AUTOEXTEND); + for (i = arg1; arg2; arg2 -= sizeof(int), i++) + sbuf_printf(&sb, "%d ", *i); + sbuf_trim(&sb); + sbuf_finish(&sb); + rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); + sbuf_delete(&sb); + return (rc); +} + +static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS) { struct port_info *pi = arg1; @@ -2578,7 +2644,31 @@ sysctl_handle_t4_reg64(SYSCTL_HANDLER_AR val = t4_read_reg64(sc, reg); - return (sysctl_handle_64(oidp, &val, 0, req)); + return (sysctl_handle_quad(oidp, &val, 0, req)); +} + +static inline void +txq_start(struct ifnet *ifp, struct sge_txq *txq) +{ + struct buf_ring *br; + struct mbuf *m; + + TXQ_LOCK_ASSERT_OWNED(txq); + + br = txq->eq.br; + m = txq->m ? txq->m : drbr_dequeue(ifp, br); + if (m) + t4_eth_tx(ifp, txq, m); +} + +void +cxgbe_txq_start(void *arg, int count) +{ + struct sge_txq *txq = arg; + + TXQ_LOCK(txq); + txq_start(txq->ifp, txq); + TXQ_UNLOCK(txq); } int @@ -2646,6 +2736,7 @@ t4_os_pci_restore_state(struct adapter * pci_cfg_restore(dev, dinfo); return (0); } + void t4_os_portmod_changed(const struct adapter *sc, int idx) { @@ -2656,10 +2747,13 @@ t4_os_portmod_changed(const struct adapt if (pi->mod_type == FW_PORT_MOD_TYPE_NONE) if_printf(pi->ifp, "transceiver unplugged.\n"); - else + else if (pi->mod_type > 0 && pi->mod_type < ARRAY_SIZE(mod_str)) { if_printf(pi->ifp, "%s transceiver inserted.\n", mod_str[pi->mod_type]); - + } else { + if_printf(pi->ifp, "transceiver (type %d) inserted.\n", + pi->mod_type); + } } void @@ -2737,10 +2831,20 @@ t4_ioctl(struct cdev *dev, unsigned long return (rc); } +static int +t4_mod_event(module_t mod, int cmd, void *arg) +{ + + if (cmd == MOD_LOAD) + t4_sge_modload(); + + return (0); +} + static devclass_t t4_devclass; static devclass_t cxgbe_devclass; -DRIVER_MODULE(t4nex, pci, t4_driver, t4_devclass, 0, 0); +DRIVER_MODULE(t4nex, pci, t4_driver, t4_devclass, t4_mod_event, 0); MODULE_VERSION(t4nex, 1); DRIVER_MODULE(cxgbe, t4nex, cxgbe_driver, cxgbe_devclass, 0, 0); Modified: stable/8/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Feb 18 08:00:26 2011 (r218792) +++ stable/8/sys/dev/cxgbe/t4_sge.c Mon Mar 14 09:50:14 2011 (r219633) @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include @@ -55,13 +58,9 @@ struct fl_buf_info { uma_zone_t zone; }; -/* t4_sge_init will fill up the zone */ -static struct fl_buf_info fl_buf_info[FL_BUF_SIZES] = { - { MCLBYTES, EXT_CLUSTER, NULL}, - { MJUMPAGESIZE, EXT_JUMBOP, NULL}, - { MJUM9BYTES, EXT_JUMBO9, NULL}, - { MJUM16BYTES, EXT_JUMBO16, NULL} -}; +/* Filled up by t4_sge_modload */ +static struct fl_buf_info fl_buf_info[FL_BUF_SIZES]; + #define FL_BUF_SIZE(x) (fl_buf_info[x].size) #define FL_BUF_TYPE(x) (fl_buf_info[x].type) #define FL_BUF_ZONE(x) (fl_buf_info[x].zone) @@ -118,7 +117,6 @@ static int alloc_fl_sdesc(struct sge_fl static void free_fl_sdesc(struct sge_fl *); static int alloc_eq_maps(struct sge_eq *); static void free_eq_maps(struct sge_eq *); -static struct mbuf *get_fl_sdesc_data(struct sge_fl *, int, int); static void set_fl_tag_idx(struct sge_fl *, int); static int get_pkt_sgl(struct sge_txq *, struct mbuf **, struct sgl *, int); @@ -133,9 +131,35 @@ static inline void write_ulp_cpl_sgl(str static int write_sgl_to_txd(struct sge_eq *, struct sgl *, caddr_t *); static inline void copy_to_txd(struct sge_eq *, caddr_t, caddr_t *, int); static inline void ring_tx_db(struct adapter *, struct sge_eq *); +static inline int reclaimable(struct sge_eq *); static int reclaim_tx_descs(struct sge_eq *, int, int); static void write_eqflush_wr(struct sge_eq *); static __be64 get_flit(bus_dma_segment_t *, int, int); +static int handle_sge_egr_update(struct adapter *, + const struct cpl_sge_egr_update *); + +/* + * Called on MOD_LOAD and fills up fl_buf_info[]. + */ +void +t4_sge_modload(void) +{ + int i; + int bufsize[FL_BUF_SIZES] = { + MCLBYTES, +#if MJUMPAGESIZE != MCLBYTES + MJUMPAGESIZE, +#endif + MJUM9BYTES, + MJUM16BYTES + }; + + for (i = 0; i < FL_BUF_SIZES; i++) { + FL_BUF_SIZE(i) = bufsize[i]; + FL_BUF_TYPE(i) = m_gettype(bufsize[i]); + FL_BUF_ZONE(i) = m_getzone(bufsize[i]); + } +} /** * t4_sge_init - initialize SGE @@ -151,11 +175,6 @@ t4_sge_init(struct adapter *sc) struct sge *s = &sc->sge; int i; - FL_BUF_ZONE(0) = zone_clust; - FL_BUF_ZONE(1) = zone_jumbop; - FL_BUF_ZONE(2) = zone_jumbo9; - FL_BUF_ZONE(3) = zone_jumbo16; - t4_set_reg_field(sc, A_SGE_CONTROL, V_PKTSHIFT(M_PKTSHIFT) | V_INGPADBOUNDARY(M_INGPADBOUNDARY) | F_EGRSTATUSPAGESIZE, @@ -409,7 +428,6 @@ t4_intr_fwd(void *arg) int ndesc_pending = 0, ndesc_total = 0; int qid; - IQ_LOCK(iq); while (is_new_response(iq, &ctrl)) { rmb(); @@ -436,7 +454,6 @@ t4_intr_fwd(void *arg) iq_next(iq); } - IQ_UNLOCK(iq); if (ndesc_total > 0) { t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), @@ -469,7 +486,6 @@ t4_intr_evt(void *arg) KASSERT(iq == &sc->sge.fwq, ("%s: unexpected ingress queue", __func__)); - IQ_LOCK(iq); while (is_new_response(iq, &ctrl)) { rmb(); @@ -492,21 +508,9 @@ t4_intr_evt(void *arg) break; } - case CPL_SGE_EGR_UPDATE: { - const struct cpl_sge_egr_update *cpl; - unsigned int qid; - struct sge *s = &sc->sge; - struct sge_txq *txq; - - cpl = (const void *)(rss + 1); - qid = G_EGR_QID(ntohl(cpl->opcode_qid)); - txq = (void *)s->eqmap[qid - s->eq_start]; - txq->egr_update++; - - /* XXX: wake up stalled tx */ - + case CPL_SGE_EGR_UPDATE: + handle_sge_egr_update(sc, (const void *)(rss + 1)); break; - } default: device_printf(sc->dev, @@ -524,7 +528,6 @@ t4_intr_evt(void *arg) } iq_next(iq); } - IQ_UNLOCK(iq); if (ndesc_total > 0) { t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), @@ -538,63 +541,73 @@ t4_intr_data(void *arg) { struct sge_rxq *rxq = arg; struct sge_iq *iq = arg; + struct adapter *sc = iq->adapter; struct rsp_ctrl *ctrl; + struct ifnet *ifp = rxq->ifp; struct sge_fl *fl = &rxq->fl; - struct port_info *pi = rxq->port; - struct ifnet *ifp = pi->ifp; - struct adapter *sc = pi->adapter; + struct fl_sdesc *sd = &fl->sdesc[fl->cidx], *sd_next; const struct rss_header *rss; const struct cpl_rx_pkt *cpl; - int ndescs = 0, rsp_type; uint32_t len; + int ndescs = 0, i; struct mbuf *m0, *m; #ifdef INET struct lro_ctrl *lro = &rxq->lro; struct lro_entry *l; #endif - IQ_LOCK(iq); + prefetch(sd->m); + prefetch(sd->cl); + iq->intr_next = iq->intr_params; while (is_new_response(iq, &ctrl)) { rmb(); rss = (const void *)iq->cdesc; - cpl = (const void *)(rss + 1); + i = G_RSPD_TYPE(ctrl->u.type_gen); - rsp_type = G_RSPD_TYPE(ctrl->u.type_gen); + if (__predict_false(i == X_RSPD_TYPE_CPL)) { - if (__predict_false(rsp_type == X_RSPD_TYPE_CPL)) { - const struct cpl_sge_egr_update *p = (const void *)cpl; - unsigned int qid = G_EGR_QID(ntohl(p->opcode_qid)); + /* Can't be anything except an egress update */ + KASSERT(rss->opcode == CPL_SGE_EGR_UPDATE, + ("%s: unexpected CPL %x", __func__, rss->opcode)); - KASSERT(cpl->opcode == CPL_SGE_EGR_UPDATE, - ("unexpected opcode on data ingress queue: %x", - cpl->opcode)); - - /* XXX: noone's waiting to be woken up... */ - wakeup(sc->sge.eqmap[qid - sc->sge.eq_start]); + handle_sge_egr_update(sc, (const void *)(rss + 1)); + goto nextdesc; + } + KASSERT(i == X_RSPD_TYPE_FLBUF && rss->opcode == CPL_RX_PKT, + ("%s: unexpected CPL %x rsp %d", __func__, rss->opcode, i)); - ndescs++; - iq_next(iq); + sd_next = sd + 1; + if (__predict_false(fl->cidx + 1 == fl->cap)) + sd_next = fl->sdesc; + prefetch(sd_next->m); + prefetch(sd_next->cl); - continue; - } + cpl = (const void *)(rss + 1); - KASSERT(G_RSPD_TYPE(ctrl->u.type_gen) == X_RSPD_TYPE_FLBUF, - ("unexpected event on data ingress queue: %x", - G_RSPD_TYPE(ctrl->u.type_gen))); + m0 = sd->m; + sd->m = NULL; /* consumed */ len = be32toh(ctrl->pldbuflen_qid); + if (__predict_false((len & F_RSPD_NEWBUF) == 0)) + panic("%s: cannot handle packed frames", __func__); + len = G_RSPD_LEN(len); - KASSERT(len & F_RSPD_NEWBUF, - ("%s: T4 misconfigured to pack buffers.", __func__)); + bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, + BUS_DMASYNC_POSTREAD); - len = G_RSPD_LEN(len); - m0 = get_fl_sdesc_data(fl, len, M_PKTHDR); - if (m0 == NULL) { - iq->intr_next = V_QINTR_TIMER_IDX(SGE_NTIMERS - 1); - break; + m_init(m0, NULL, 0, M_NOWAIT, MT_DATA, M_PKTHDR); + if (len < MINCLSIZE) { + /* copy data to mbuf, buffer will be recycled */ + bcopy(sd->cl, mtod(m0, caddr_t), len); + m0->m_len = len; + } else { + bus_dmamap_unload(fl->tag[sd->tag_idx], sd->map); + m_cljset(m0, sd->cl, FL_BUF_TYPE(sd->tag_idx)); + sd->cl = NULL; /* consumed */ + m0->m_len = min(len, FL_BUF_SIZE(sd->tag_idx)); } len -= FL_PKTSHIFT; @@ -623,16 +636,49 @@ t4_intr_data(void *arg) rxq->vlan_extraction++; } + i = 1; /* # of fl sdesc used */ + sd = sd_next; + if (__predict_false(++fl->cidx == fl->cap)) + fl->cidx = 0; + len -= m0->m_len; m = m0; while (len) { - m->m_next = get_fl_sdesc_data(fl, len, 0); - if (m->m_next == NULL) - CXGBE_UNIMPLEMENTED("mbuf recovery"); + i++; + sd_next = sd + 1; + if (__predict_false(fl->cidx + 1 == fl->cap)) + sd_next = fl->sdesc; + prefetch(sd_next->m); + prefetch(sd_next->cl); + + m->m_next = sd->m; + sd->m = NULL; /* consumed */ m = m->m_next; + + bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, + BUS_DMASYNC_POSTREAD); + + m_init(m, NULL, 0, M_NOWAIT, MT_DATA, 0); + if (len <= MLEN) { + bcopy(sd->cl, mtod(m, caddr_t), len); + m->m_len = len; + } else { + bus_dmamap_unload(fl->tag[sd->tag_idx], + sd->map); + m_cljset(m, sd->cl, FL_BUF_TYPE(sd->tag_idx)); + sd->cl = NULL; /* consumed */ + m->m_len = min(len, FL_BUF_SIZE(sd->tag_idx)); + } + + i++; + sd = sd_next; + if (__predict_false(++fl->cidx == fl->cap)) + fl->cidx = 0; + len -= m->m_len; } + #ifdef INET if (cpl->l2info & htobe32(F_RXF_LRO) && rxq->flags & RXQ_LRO_ENABLED && @@ -640,17 +686,17 @@ t4_intr_data(void *arg) /* queued for LRO */ } else #endif - (*ifp->if_input)(ifp, m0); + ifp->if_input(ifp, m0); FL_LOCK(fl); - if (fl->needed >= 32) { + fl->needed += i; + if (fl->needed >= 32) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 11:07:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20BCC106566C; Mon, 14 Mar 2011 11:07:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA4818FC1F; Mon, 14 Mar 2011 11:07: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 p2EB7C7q091681; Mon, 14 Mar 2011 11:07:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EB7C2W091679; Mon, 14 Mar 2011 11:07:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103141107.p2EB7C2W091679@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Mar 2011 11:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219636 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 11:07:13 -0000 Author: pjd Date: Mon Mar 14 11:07:12 2011 New Revision: 219636 URL: http://svn.freebsd.org/changeset/base/219636 Log: Fix potential panic in dbuf_sync_list() relate to spill blocks handling. Obtained from: IllumOS MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Mar 14 10:51:24 2011 (r219635) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Mar 14 11:07:12 2011 (r219636) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ #include @@ -1300,13 +1301,17 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ * it, since one of the current holders may be in the * middle of an update. Note that users of dbuf_undirty() * should not place a hold on the dbuf before the call. + * Also note: we can get here with a spill block, so + * test for that similar to how dbuf_dirty does. */ if (refcount_count(&db->db_holds) > db->db_dirtycnt) { mutex_exit(&db->db_mtx); /* Make sure we don't toss this buffer at sync phase */ - mutex_enter(&dn->dn_mtx); - dnode_clear_range(dn, db->db_blkid, 1, tx); - mutex_exit(&dn->dn_mtx); + if (db->db_blkid != DMU_SPILL_BLKID) { + mutex_enter(&dn->dn_mtx); + dnode_clear_range(dn, db->db_blkid, 1, tx); + mutex_exit(&dn->dn_mtx); + } DB_DNODE_EXIT(db); return (0); } @@ -1319,11 +1324,18 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ *drp = dr->dr_next; + /* + * Note that there are three places in dbuf_dirty() + * where this dirty record may be put on a list. + * Make sure to do a list_remove corresponding to + * every one of those list_insert calls. + */ if (dr->dr_parent) { mutex_enter(&dr->dr_parent->dt.di.dr_mtx); list_remove(&dr->dr_parent->dt.di.dr_children, dr); mutex_exit(&dr->dr_parent->dt.di.dr_mtx); - } else if (db->db_level+1 == dn->dn_nlevels) { + } else if (db->db_blkid == DMU_SPILL_BLKID || + db->db_level+1 == dn->dn_nlevels) { ASSERT(db->db_blkptr == NULL || db->db_parent == dn->dn_dbuf); mutex_enter(&dn->dn_mtx); list_remove(&dn->dn_dirty_records[txg & TXG_MASK], dr); From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 11:20:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C38C1065687; Mon, 14 Mar 2011 11:20:27 +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 EEEFA8FC12; Mon, 14 Mar 2011 11:20:26 +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 p2EBKQ5W091986; Mon, 14 Mar 2011 11:20:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EBKQeQ091983; Mon, 14 Mar 2011 11:20:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201103141120.p2EBKQeQ091983@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Mar 2011 11:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219637 - stable/8/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 11:20:27 -0000 Author: kib Date: Mon Mar 14 11:20:26 2011 New Revision: 219637 URL: http://svn.freebsd.org/changeset/base/219637 Log: MFC r219388: Simplify uses of the web of pointers. Modified: stable/8/sys/ufs/ufs/ufs_dirhash.c stable/8/sys/ufs/ufs/ufs_quota.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/ufs/ufs/ufs_dirhash.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_dirhash.c Mon Mar 14 11:07:12 2011 (r219636) +++ stable/8/sys/ufs/ufs/ufs_dirhash.c Mon Mar 14 11:20:26 2011 (r219637) @@ -428,7 +428,7 @@ ufsdirhash_build(struct inode *ip) } for (i = 0; i < dirblocks; i++) dh->dh_blkfree[i] = DIRBLKSIZ / DIRALIGN; - bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; + bmask = vp->v_mount->mnt_stat.f_iosize - 1; pos = 0; while (pos < ip->i_size) { /* If necessary, get the next directory block. */ @@ -589,7 +589,7 @@ ufsdirhash_lookup(struct inode *ip, char DIRHASHLIST_UNLOCK(); vp = ip->i_vnode; - bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; + bmask = vp->v_mount->mnt_stat.f_iosize - 1; blkoff = -1; bp = NULL; restart: Modified: stable/8/sys/ufs/ufs/ufs_quota.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_quota.c Mon Mar 14 11:07:12 2011 (r219636) +++ stable/8/sys/ufs/ufs/ufs_quota.c Mon Mar 14 11:20:26 2011 (r219637) @@ -220,8 +220,7 @@ chkdq(struct inode *ip, ufs2_daddr_t cha /* Reset timer when crossing soft limit */ if (dq->dq_curblocks + change >= dq->dq_bsoftlimit && dq->dq_curblocks < dq->dq_bsoftlimit) - dq->dq_btime = time_second + - VFSTOUFS(ITOV(ip)->v_mount)->um_btime[i]; + dq->dq_btime = time_second + ip->i_ump->um_btime[i]; dq->dq_curblocks += change; dq->dq_flags |= DQ_MOD; DQI_UNLOCK(dq); @@ -266,8 +265,7 @@ chkdqchg(struct inode *ip, ufs2_daddr_t */ if (ncurblocks >= dq->dq_bsoftlimit && dq->dq_bsoftlimit) { if (dq->dq_curblocks < dq->dq_bsoftlimit) { - dq->dq_btime = time_second + - VFSTOUFS(ITOV(ip)->v_mount)->um_btime[type]; + dq->dq_btime = time_second + ip->i_ump->um_btime[type]; if (ip->i_uid == cred->cr_uid) *warn = 1; return (0); @@ -366,8 +364,7 @@ chkiq(struct inode *ip, int change, stru /* Reset timer when crossing soft limit */ if (dq->dq_curinodes + change >= dq->dq_isoftlimit && dq->dq_curinodes < dq->dq_isoftlimit) - dq->dq_itime = time_second + - VFSTOUFS(ITOV(ip)->v_mount)->um_itime[i]; + dq->dq_itime = time_second + ip->i_ump->um_itime[i]; dq->dq_curinodes += change; dq->dq_flags |= DQ_MOD; DQI_UNLOCK(dq); @@ -411,8 +408,7 @@ chkiqchg(struct inode *ip, int change, s */ if (ncurinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit) { if (dq->dq_curinodes < dq->dq_isoftlimit) { - dq->dq_itime = time_second + - VFSTOUFS(ITOV(ip)->v_mount)->um_itime[type]; + dq->dq_itime = time_second + ip->i_ump->um_itime[type]; if (ip->i_uid == cred->cr_uid) *warn = 1; return (0); @@ -443,7 +439,7 @@ chkiqchg(struct inode *ip, int change, s static void chkdquot(struct inode *ip) { - struct ufsmount *ump = VFSTOUFS(ITOV(ip)->v_mount); + struct ufsmount *ump = ip->i_ump; struct vnode *vp = ITOV(ip); int i; From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 12:59:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0199E106564A; Mon, 14 Mar 2011 12:59:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C79168FC1E; Mon, 14 Mar 2011 12:59:30 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 63D0246B0C; Mon, 14 Mar 2011 08:59:30 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E8F378A01B; Mon, 14 Mar 2011 08:59:29 -0400 (EDT) From: John Baldwin To: Andriy Gapon Date: Mon, 14 Mar 2011 08:04:17 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201103120909.p2C99P2j010783@svn.freebsd.org> <4D7C6DFC.8020504@freebsd.org> In-Reply-To: <4D7C6DFC.8020504@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103140804.17800.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 14 Mar 2011 08:59:30 -0400 (EDT) Cc: svn-src-head@freebsd.org, Alexander Leidinger , svn-src-all@freebsd.org, src-committers@freebsd.org, Artem Belevich Subject: Re: svn commit: r219561 - in head/sys: cddl/dev/systrace modules/dtrace modules/dtrace/dtraceall modules/dtrace/systrace_freebsd32 modules/dtrace/systrace_linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 12:59:31 -0000 On Sunday, March 13, 2011 3:10:52 am Andriy Gapon wrote: > on 13/03/2011 08:35 Artem Belevich said the following: > > On Sat, Mar 12, 2011 at 12:14 PM, Alexander Leidinger > > wrote: > >> But this looks like it will be named linux32 in any case. In the short > >> term I would prefer: > >> ---snip--- > >> #if defined(__amd64__) > >> #define MODNAME "linux32" > >> #elif defined(__i386__) > >> #define MODNAME "linux" > >> #endif > >> ---snip--- > > > > Makes sense. It's what's done with freebsd syscalls -- 'freebsd' for > > native syscalls, freebsd32 for 32-bit compat. > > BTW, in my opinion, it might not make a lot of sense. > That is, we can have native and compat FreeBSD system calls, but Linux system > calls are always compat and never native, whether the emulation is for the same > arch or not. Explicit suffix makes things clearer. But that's just my opinion. However, if we were to go that route, you would need to have 'linux-i386', 'linux-x86-64', 'linux-alpha', etc. Recall that our Alpha port had Linux compat as well, so for it 'linux.ko' was a 64-bit ABI. I think it makes sense to assume that 'linux' maps to Linux compat for whatever the native platform of the running kernel is and to then use suffixes for other platform modes (such as 32-bit compat mode in amd64). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 12:59:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E28E51065672; Mon, 14 Mar 2011 12:59:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B87528FC16; Mon, 14 Mar 2011 12:59:31 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6CA7A46B17; Mon, 14 Mar 2011 08:59:31 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 063398A027; Mon, 14 Mar 2011 08:59:31 -0400 (EDT) From: John Baldwin To: Jilles Tjoelker Date: Mon, 14 Mar 2011 08:08:14 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201103122113.p2CLD8LO030205@svn.freebsd.org> <4D7C7CC9.7010901@FreeBSD.org> <20110313144609.GA11779@stack.nl> In-Reply-To: <20110313144609.GA11779@stack.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103140808.15076.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 14 Mar 2011 08:59:31 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r219578 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 12:59:32 -0000 On Sunday, March 13, 2011 10:46:09 am Jilles Tjoelker wrote: > On Sun, Mar 13, 2011 at 12:14:01AM -0800, Doug Barton wrote: > > On 03/12/2011 15:08, Jilles Tjoelker wrote: > > > I wonder if it is a good idea to pollute the environment of many daemons > > > with this. Although sshd and cron clean it up, there is at least one > > > daemon that passes the environment on. One of those is devd. > > > I think the argument could be made that this is bad behavior on their > > part, but if it turns out that it starts affecting things negatively we > > can take another look at it. > > Cleaning the environment requires special care to preserve environment > variables that may still be needed. This is a problem particularly for > code intended to be portable. Perhaps someone wants to apply a hack > using LD_PRELOAD or other LD_* variables, or an environment variable is > needed to force standards-compliant behaviour that the program depends > on. > > The service(8) utility should clear the environment so it matches the > boot environment as much as possible. If someone wants to set special > environment variables, they should configure that in such a way that it > also works at boot or call the rc.d script directly. > > > > While that > > > saves four /etc/rc.conf reads on my minimalistic 9-current VM, it > > > implies that devd must be restarted to pick up changes to /etc/rc.conf. > > > That seems a POLA violation. > > > I'm not sure what you mean by this. We've always required services to be > > restarted to pick up rc.conf changes. > > For options for devd itself, yes. However, as configured in the default > /etc/devd.conf, devd may invoke commands like > /etc/pccard_ether $subsystem start > or > /etc/rc.d/dhclient quietstart $subsystem > > The natural expectation is that these reread /etc/rc.conf every time, so > that it is possible to set up network settings for a network interface > and then plug it in, without restarting devd. And so it worked before > r219578. I agree that this is the behavior that I certainly expect. I also agree that it is hard to safely purge environment variables in all of the system daemons. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 13:02:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00C89106566B; Mon, 14 Mar 2011 13:02:13 +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 E42518FC1A; Mon, 14 Mar 2011 13:02: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 p2ED2CVm094331; Mon, 14 Mar 2011 13:02:12 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2ED2CYV094329; Mon, 14 Mar 2011 13:02:12 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103141302.p2ED2CYV094329@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 14 Mar 2011 13:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219638 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 13:02:13 -0000 Author: dchagin Date: Mon Mar 14 13:02:12 2011 New Revision: 219638 URL: http://svn.freebsd.org/changeset/base/219638 Log: Add my birthday to the freebsd calendar. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Mar 14 11:20:26 2011 (r219637) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Mar 14 13:02:12 2011 (r219638) @@ -46,6 +46,7 @@ 02/02 Diomidis D. Spinellis born in Athens, Greece, 1967 02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 02/02 Yoichi Nakayama born in Tsu, Mie, Japan, 1976 +02/02 Dmitry Chagin born in Stalingrad, USSR, 1976 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 02/10 David Greenman born in Portland, Oregon, United States, 1968 02/10 Paul Richards born in Ammanford, Carmarthenshire, United Kingdom, 1968 From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 13:31:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1125A106564A; Mon, 14 Mar 2011 13:31:35 +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 F2BEE8FC0C; Mon, 14 Mar 2011 13:31: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 p2EDVYfl095140; Mon, 14 Mar 2011 13:31:34 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EDVYX6095131; Mon, 14 Mar 2011 13:31:34 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201103141331.p2EDVYX6095131@svn.freebsd.org> From: Martin Matuska Date: Mon, 14 Mar 2011 13:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219639 - in head/contrib/gcc: . config/i386 doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 13:31:35 -0000 Author: mm Date: Mon Mar 14 13:31:34 2011 New Revision: 219639 URL: http://svn.freebsd.org/changeset/base/219639 Log: Backport SSSE3 instruction set support to base gcc. Enabled by default for -march=core2 Obtained from: gcc 4.3 (rev. 117958, 121687, 121726, 123639; GPLv2) MFC after: 2 weeks Added: head/contrib/gcc/config/i386/tmmintrin.h (contents, props changed) Modified: head/contrib/gcc/config.gcc head/contrib/gcc/config/i386/i386.c head/contrib/gcc/config/i386/i386.h head/contrib/gcc/config/i386/i386.md head/contrib/gcc/config/i386/i386.opt head/contrib/gcc/config/i386/sse.md head/contrib/gcc/config/i386/xmmintrin.h head/contrib/gcc/doc/extend.texi head/contrib/gcc/doc/gcc.1 head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/config.gcc ============================================================================== --- head/contrib/gcc/config.gcc Mon Mar 14 13:02:12 2011 (r219638) +++ head/contrib/gcc/config.gcc Mon Mar 14 13:31:34 2011 (r219639) @@ -268,11 +268,13 @@ xscale-*-*) ;; i[34567]86-*-*) cpu_type=i386 - extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h pmmintrin.h" + extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h + pmmintrin.h tmmintrin.h" ;; x86_64-*-*) cpu_type=i386 - extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h pmmintrin.h" + extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h + pmmintrin.h tmmintrin.h" need_64bit_hwint=yes ;; ia64-*-*) Modified: head/contrib/gcc/config/i386/i386.c ============================================================================== --- head/contrib/gcc/config/i386/i386.c Mon Mar 14 13:02:12 2011 (r219638) +++ head/contrib/gcc/config/i386/i386.c Mon Mar 14 13:31:34 2011 (r219639) @@ -1511,16 +1511,24 @@ ix86_handle_option (size_t code, const c case OPT_msse: if (!value) { - target_flags &= ~(MASK_SSE2 | MASK_SSE3); - target_flags_explicit |= MASK_SSE2 | MASK_SSE3; + target_flags &= ~(MASK_SSE2 | MASK_SSE3 | MASK_SSSE3); + target_flags_explicit |= MASK_SSE2 | MASK_SSE3 | MASK_SSSE3; } return true; case OPT_msse2: if (!value) { - target_flags &= ~MASK_SSE3; - target_flags_explicit |= MASK_SSE3; + target_flags &= ~(MASK_SSE3 | MASK_SSSE3); + target_flags_explicit |= MASK_SSE3 | MASK_SSSE3; + } + return true; + + case OPT_msse3: + if (!value) + { + target_flags &= ~MASK_SSSE3; + target_flags_explicit |= MASK_SSSE3; } return true; @@ -1589,7 +1597,8 @@ override_options (void) PTA_PREFETCH_SSE = 16, PTA_3DNOW = 32, PTA_3DNOW_A = 64, - PTA_64BIT = 128 + PTA_64BIT = 128, + PTA_SSSE3 = 256 } flags; } const processor_alias_table[] = @@ -1617,7 +1626,7 @@ override_options (void) | PTA_MMX | PTA_PREFETCH_SSE}, {"nocona", PROCESSOR_NOCONA, PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_64BIT | PTA_MMX | PTA_PREFETCH_SSE}, - {"core2", PROCESSOR_CORE2, PTA_SSE | PTA_SSE2 | PTA_SSE3 + {"core2", PROCESSOR_CORE2, PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_SSSE3 | PTA_64BIT | PTA_MMX | PTA_PREFETCH_SSE}, {"geode", PROCESSOR_GEODE, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW @@ -1811,6 +1820,9 @@ override_options (void) if (processor_alias_table[i].flags & PTA_SSE3 && !(target_flags_explicit & MASK_SSE3)) target_flags |= MASK_SSE3; + if (processor_alias_table[i].flags & PTA_SSSE3 + && !(target_flags_explicit & MASK_SSSE3)) + target_flags |= MASK_SSSE3; if (processor_alias_table[i].flags & PTA_PREFETCH_SSE) x86_prefetch_sse = true; if (TARGET_64BIT && !(processor_alias_table[i].flags & PTA_64BIT)) @@ -1987,6 +1999,10 @@ override_options (void) if (!TARGET_80387) target_flags |= MASK_NO_FANCY_MATH_387; + /* Turn on SSE3 builtins for -mssse3. */ + if (TARGET_SSSE3) + target_flags |= MASK_SSE3; + /* Turn on SSE2 builtins for -msse3. */ if (TARGET_SSE3) target_flags |= MASK_SSE2; @@ -14693,6 +14709,41 @@ enum ix86_builtins IX86_BUILTIN_MONITOR, IX86_BUILTIN_MWAIT, + /* SSSE3. */ + IX86_BUILTIN_PHADDW, + IX86_BUILTIN_PHADDD, + IX86_BUILTIN_PHADDSW, + IX86_BUILTIN_PHSUBW, + IX86_BUILTIN_PHSUBD, + IX86_BUILTIN_PHSUBSW, + IX86_BUILTIN_PMADDUBSW, + IX86_BUILTIN_PMULHRSW, + IX86_BUILTIN_PSHUFB, + IX86_BUILTIN_PSIGNB, + IX86_BUILTIN_PSIGNW, + IX86_BUILTIN_PSIGND, + IX86_BUILTIN_PALIGNR, + IX86_BUILTIN_PABSB, + IX86_BUILTIN_PABSW, + IX86_BUILTIN_PABSD, + + IX86_BUILTIN_PHADDW128, + IX86_BUILTIN_PHADDD128, + IX86_BUILTIN_PHADDSW128, + IX86_BUILTIN_PHSUBW128, + IX86_BUILTIN_PHSUBD128, + IX86_BUILTIN_PHSUBSW128, + IX86_BUILTIN_PMADDUBSW128, + IX86_BUILTIN_PMULHRSW128, + IX86_BUILTIN_PSHUFB128, + IX86_BUILTIN_PSIGNB128, + IX86_BUILTIN_PSIGNW128, + IX86_BUILTIN_PSIGND128, + IX86_BUILTIN_PALIGNR128, + IX86_BUILTIN_PABSB128, + IX86_BUILTIN_PABSW128, + IX86_BUILTIN_PABSD128, + IX86_BUILTIN_VEC_INIT_V2SI, IX86_BUILTIN_VEC_INIT_V4HI, IX86_BUILTIN_VEC_INIT_V8QI, @@ -15034,7 +15085,33 @@ static const struct builtin_description { MASK_SSE3, CODE_FOR_sse3_haddv4sf3, "__builtin_ia32_haddps", IX86_BUILTIN_HADDPS, 0, 0 }, { MASK_SSE3, CODE_FOR_sse3_haddv2df3, "__builtin_ia32_haddpd", IX86_BUILTIN_HADDPD, 0, 0 }, { MASK_SSE3, CODE_FOR_sse3_hsubv4sf3, "__builtin_ia32_hsubps", IX86_BUILTIN_HSUBPS, 0, 0 }, - { MASK_SSE3, CODE_FOR_sse3_hsubv2df3, "__builtin_ia32_hsubpd", IX86_BUILTIN_HSUBPD, 0, 0 } + { MASK_SSE3, CODE_FOR_sse3_hsubv2df3, "__builtin_ia32_hsubpd", IX86_BUILTIN_HSUBPD, 0, 0 }, + + /* SSSE3 */ + { MASK_SSSE3, CODE_FOR_ssse3_phaddwv8hi3, "__builtin_ia32_phaddw128", IX86_BUILTIN_PHADDW128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phaddwv4hi3, "__builtin_ia32_phaddw", IX86_BUILTIN_PHADDW, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phadddv4si3, "__builtin_ia32_phaddd128", IX86_BUILTIN_PHADDD128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phadddv2si3, "__builtin_ia32_phaddd", IX86_BUILTIN_PHADDD, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phaddswv8hi3, "__builtin_ia32_phaddsw128", IX86_BUILTIN_PHADDSW128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phaddswv4hi3, "__builtin_ia32_phaddsw", IX86_BUILTIN_PHADDSW, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phsubwv8hi3, "__builtin_ia32_phsubw128", IX86_BUILTIN_PHSUBW128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phsubwv4hi3, "__builtin_ia32_phsubw", IX86_BUILTIN_PHSUBW, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phsubdv4si3, "__builtin_ia32_phsubd128", IX86_BUILTIN_PHSUBD128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phsubdv2si3, "__builtin_ia32_phsubd", IX86_BUILTIN_PHSUBD, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phsubswv8hi3, "__builtin_ia32_phsubsw128", IX86_BUILTIN_PHSUBSW128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_phsubswv4hi3, "__builtin_ia32_phsubsw", IX86_BUILTIN_PHSUBSW, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_pmaddubswv8hi3, "__builtin_ia32_pmaddubsw128", IX86_BUILTIN_PMADDUBSW128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_pmaddubswv4hi3, "__builtin_ia32_pmaddubsw", IX86_BUILTIN_PMADDUBSW, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_pmulhrswv8hi3, "__builtin_ia32_pmulhrsw128", IX86_BUILTIN_PMULHRSW128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_pmulhrswv4hi3, "__builtin_ia32_pmulhrsw", IX86_BUILTIN_PMULHRSW, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_pshufbv16qi3, "__builtin_ia32_pshufb128", IX86_BUILTIN_PSHUFB128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_pshufbv8qi3, "__builtin_ia32_pshufb", IX86_BUILTIN_PSHUFB, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_psignv16qi3, "__builtin_ia32_psignb128", IX86_BUILTIN_PSIGNB128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_psignv8qi3, "__builtin_ia32_psignb", IX86_BUILTIN_PSIGNB, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_psignv8hi3, "__builtin_ia32_psignw128", IX86_BUILTIN_PSIGNW128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_psignv4hi3, "__builtin_ia32_psignw", IX86_BUILTIN_PSIGNW, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_psignv4si3, "__builtin_ia32_psignd128", IX86_BUILTIN_PSIGND128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_ssse3_psignv2si3, "__builtin_ia32_psignd", IX86_BUILTIN_PSIGND, 0, 0 } }; static const struct builtin_description bdesc_1arg[] = @@ -15081,6 +15158,14 @@ static const struct builtin_description /* SSE3 */ { MASK_SSE3, CODE_FOR_sse3_movshdup, 0, IX86_BUILTIN_MOVSHDUP, 0, 0 }, { MASK_SSE3, CODE_FOR_sse3_movsldup, 0, IX86_BUILTIN_MOVSLDUP, 0, 0 }, + + /* SSSE3 */ + { MASK_SSSE3, CODE_FOR_absv16qi2, "__builtin_ia32_pabsb128", IX86_BUILTIN_PABSB128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_absv8qi2, "__builtin_ia32_pabsb", IX86_BUILTIN_PABSB, 0, 0 }, + { MASK_SSSE3, CODE_FOR_absv8hi2, "__builtin_ia32_pabsw128", IX86_BUILTIN_PABSW128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_absv4hi2, "__builtin_ia32_pabsw", IX86_BUILTIN_PABSW, 0, 0 }, + { MASK_SSSE3, CODE_FOR_absv4si2, "__builtin_ia32_pabsd128", IX86_BUILTIN_PABSD128, 0, 0 }, + { MASK_SSSE3, CODE_FOR_absv2si2, "__builtin_ia32_pabsd", IX86_BUILTIN_PABSD, 0, 0 }, }; static void @@ -15215,6 +15300,16 @@ ix86_init_mmx_sse_builtins (void) /* Normal vector unops. */ tree v4sf_ftype_v4sf = build_function_type_list (V4SF_type_node, V4SF_type_node, NULL_TREE); + tree v16qi_ftype_v16qi + = build_function_type_list (V16QI_type_node, V16QI_type_node, NULL_TREE); + tree v8hi_ftype_v8hi + = build_function_type_list (V8HI_type_node, V8HI_type_node, NULL_TREE); + tree v4si_ftype_v4si + = build_function_type_list (V4SI_type_node, V4SI_type_node, NULL_TREE); + tree v8qi_ftype_v8qi + = build_function_type_list (V8QI_type_node, V8QI_type_node, NULL_TREE); + tree v4hi_ftype_v4hi + = build_function_type_list (V4HI_type_node, V4HI_type_node, NULL_TREE); /* Normal vector binops. */ tree v4sf_ftype_v4sf_v4sf @@ -15234,6 +15329,12 @@ ix86_init_mmx_sse_builtins (void) long_long_unsigned_type_node, long_long_unsigned_type_node, NULL_TREE); + tree di_ftype_di_di_int + = build_function_type_list (long_long_unsigned_type_node, + long_long_unsigned_type_node, + long_long_unsigned_type_node, + integer_type_node, NULL_TREE); + tree v2si_ftype_v2sf = build_function_type_list (V2SI_type_node, V2SF_type_node, NULL_TREE); tree v2sf_ftype_v2si @@ -15335,6 +15436,9 @@ ix86_init_mmx_sse_builtins (void) tree v2di_ftype_v2di_int = build_function_type_list (V2DI_type_node, V2DI_type_node, integer_type_node, NULL_TREE); + tree v2di_ftype_v2di_v2di_int + = build_function_type_list (V2DI_type_node, V2DI_type_node, + V2DI_type_node, integer_type_node, NULL_TREE); tree v4si_ftype_v4si_int = build_function_type_list (V4SI_type_node, V4SI_type_node, integer_type_node, NULL_TREE); @@ -15451,6 +15555,50 @@ ix86_init_mmx_sse_builtins (void) def_builtin (d->mask, d->name, type, d->code); } + /* Add all builtins that are more or less simple operations on 1 operand. */ + for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++) + { + enum machine_mode mode; + tree type; + + if (d->name == 0) + continue; + mode = insn_data[d->icode].operand[1].mode; + + switch (mode) + { + case V16QImode: + type = v16qi_ftype_v16qi; + break; + case V8HImode: + type = v8hi_ftype_v8hi; + break; + case V4SImode: + type = v4si_ftype_v4si; + break; + case V2DFmode: + type = v2df_ftype_v2df; + break; + case V4SFmode: + type = v4sf_ftype_v4sf; + break; + case V8QImode: + type = v8qi_ftype_v8qi; + break; + case V4HImode: + type = v4hi_ftype_v4hi; + break; + case V2SImode: + type = v2si_ftype_v2si; + break; + + default: + abort (); + } + + def_builtin (d->mask, d->name, type, d->code); + } + /* Add the remaining MMX insns with somewhat more complicated types. */ def_builtin (MASK_MMX, "__builtin_ia32_emms", void_ftype_void, IX86_BUILTIN_EMMS); def_builtin (MASK_MMX, "__builtin_ia32_psllw", v4hi_ftype_v4hi_di, IX86_BUILTIN_PSLLW); @@ -15650,6 +15798,12 @@ ix86_init_mmx_sse_builtins (void) def_builtin (MASK_SSE3, "__builtin_ia32_lddqu", v16qi_ftype_pcchar, IX86_BUILTIN_LDDQU); + /* SSSE3. */ + def_builtin (MASK_SSSE3, "__builtin_ia32_palignr128", + v2di_ftype_v2di_v2di_int, IX86_BUILTIN_PALIGNR128); + def_builtin (MASK_SSSE3, "__builtin_ia32_palignr", di_ftype_di_di_int, + IX86_BUILTIN_PALIGNR); + /* Access to the vec_init patterns. */ ftype = build_function_type_list (V2SI_type_node, integer_type_node, integer_type_node, NULL_TREE); @@ -16148,7 +16302,7 @@ ix86_expand_builtin (tree exp, rtx targe tree arglist = TREE_OPERAND (exp, 1); tree arg0, arg1, arg2; rtx op0, op1, op2, pat; - enum machine_mode tmode, mode0, mode1, mode2; + enum machine_mode tmode, mode0, mode1, mode2, mode3; unsigned int fcode = DECL_FUNCTION_CODE (fndecl); switch (fcode) @@ -16618,6 +16772,52 @@ ix86_expand_builtin (tree exp, rtx targe return ix86_expand_unop_builtin (CODE_FOR_sse3_lddqu, arglist, target, 1); + case IX86_BUILTIN_PALIGNR: + case IX86_BUILTIN_PALIGNR128: + if (fcode == IX86_BUILTIN_PALIGNR) + { + icode = CODE_FOR_ssse3_palignrdi; + mode = DImode; + } + else + { + icode = CODE_FOR_ssse3_palignrti; + mode = V2DImode; + } + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + tmode = insn_data[icode].operand[0].mode; + mode1 = insn_data[icode].operand[1].mode; + mode2 = insn_data[icode].operand[2].mode; + mode3 = insn_data[icode].operand[3].mode; + + if (! (*insn_data[icode].operand[1].predicate) (op0, mode1)) + { + op0 = copy_to_reg (op0); + op0 = simplify_gen_subreg (mode1, op0, GET_MODE (op0), 0); + } + if (! (*insn_data[icode].operand[2].predicate) (op1, mode2)) + { + op1 = copy_to_reg (op1); + op1 = simplify_gen_subreg (mode2, op1, GET_MODE (op1), 0); + } + if (! (*insn_data[icode].operand[3].predicate) (op2, mode3)) + { + error ("shift must be an immediate"); + return const0_rtx; + } + target = gen_reg_rtx (mode); + pat = GEN_FCN (icode) (simplify_gen_subreg (tmode, target, mode, 0), + op0, op1, op2); + if (! pat) + return 0; + emit_insn (pat); + return target; + case IX86_BUILTIN_VEC_INIT_V2SI: case IX86_BUILTIN_VEC_INIT_V4HI: case IX86_BUILTIN_VEC_INIT_V8QI: Modified: head/contrib/gcc/config/i386/i386.h ============================================================================== --- head/contrib/gcc/config/i386/i386.h Mon Mar 14 13:02:12 2011 (r219638) +++ head/contrib/gcc/config/i386/i386.h Mon Mar 14 13:31:34 2011 (r219639) @@ -418,6 +418,8 @@ extern const char *host_detect_local_cpu builtin_define ("__SSE2__"); \ if (TARGET_SSE3) \ builtin_define ("__SSE3__"); \ + if (TARGET_SSSE3) \ + builtin_define ("__SSSE3__"); \ if (TARGET_SSE_MATH && TARGET_SSE) \ builtin_define ("__SSE_MATH__"); \ if (TARGET_SSE_MATH && TARGET_SSE2) \ Modified: head/contrib/gcc/config/i386/i386.md ============================================================================== --- head/contrib/gcc/config/i386/i386.md Mon Mar 14 13:02:12 2011 (r219638) +++ head/contrib/gcc/config/i386/i386.md Mon Mar 14 13:31:34 2011 (r219639) @@ -148,6 +148,11 @@ (UNSPEC_SP_TEST 101) (UNSPEC_SP_TLS_SET 102) (UNSPEC_SP_TLS_TEST 103) + + ; SSSE3 + (UNSPEC_PSHUFB 120) + (UNSPEC_PSIGN 121) + (UNSPEC_PALIGNR 122) ]) (define_constants @@ -20948,6 +20953,6 @@ } [(set_attr "type" "multi")]) -(include "sse.md") (include "mmx.md") +(include "sse.md") (include "sync.md") Modified: head/contrib/gcc/config/i386/i386.opt ============================================================================== --- head/contrib/gcc/config/i386/i386.opt Mon Mar 14 13:02:12 2011 (r219638) +++ head/contrib/gcc/config/i386/i386.opt Mon Mar 14 13:31:34 2011 (r219639) @@ -197,6 +197,10 @@ msse3 Target Report Mask(SSE3) Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation +mssse3 +Target Report Mask(SSSE3) +Support MMX, SSE, SSE2, SSE3 and SSSE3 built-in functions and code generation + msseregparm Target RejectNegative Mask(SSEREGPARM) Use SSE register passing conventions for SF and DF mode Modified: head/contrib/gcc/config/i386/sse.md ============================================================================== --- head/contrib/gcc/config/i386/sse.md Mon Mar 14 13:02:12 2011 (r219638) +++ head/contrib/gcc/config/i386/sse.md Mon Mar 14 13:31:34 2011 (r219639) @@ -3949,3 +3949,578 @@ ;; zero extended to 64bit, we only need to set up 32bit registers. "monitor" [(set_attr "length" "3")]) + +;; SSSE3 +(define_insn "ssse3_phaddwv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_concat:V8HI + (vec_concat:V4HI + (vec_concat:V2HI + (plus:HI + (vec_select:HI + (match_operand:V8HI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))) + (plus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (plus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 4)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 5)]))) + (plus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 6)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 7)]))))) + (vec_concat:V4HI + (vec_concat:V2HI + (plus:HI + (vec_select:HI + (match_operand:V8HI 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))) + (plus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (plus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 4)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 5)]))) + (plus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 6)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 7)])))))))] + "TARGET_SSSE3" + "phaddw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_phaddwv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_concat:V4HI + (vec_concat:V2HI + (plus:HI + (vec_select:HI + (match_operand:V4HI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))) + (plus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (plus:HI + (vec_select:HI + (match_operand:V4HI 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))) + (plus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 3)]))))))] + "TARGET_SSSE3" + "phaddw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_phadddv4si3" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (vec_concat:V4SI + (vec_concat:V2SI + (plus:SI + (vec_select:SI + (match_operand:V4SI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:SI (match_dup 1) (parallel [(const_int 1)]))) + (plus:SI + (vec_select:SI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:SI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2SI + (plus:SI + (vec_select:SI + (match_operand:V4SI 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:SI (match_dup 2) (parallel [(const_int 1)]))) + (plus:SI + (vec_select:SI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:SI (match_dup 2) (parallel [(const_int 3)]))))))] + "TARGET_SSSE3" + "phaddd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_phadddv2si3" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (vec_concat:V2SI + (plus:SI + (vec_select:SI + (match_operand:V2SI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:SI (match_dup 1) (parallel [(const_int 1)]))) + (plus:SI + (vec_select:SI + (match_operand:V2SI 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0)])) + (vec_select:SI (match_dup 2) (parallel [(const_int 1)])))))] + "TARGET_SSSE3" + "phaddd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_phaddswv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_concat:V8HI + (vec_concat:V4HI + (vec_concat:V2HI + (ss_plus:HI + (vec_select:HI + (match_operand:V8HI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))) + (ss_plus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (ss_plus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 4)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 5)]))) + (ss_plus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 6)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 7)]))))) + (vec_concat:V4HI + (vec_concat:V2HI + (ss_plus:HI + (vec_select:HI + (match_operand:V8HI 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))) + (ss_plus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (ss_plus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 4)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 5)]))) + (ss_plus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 6)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 7)])))))))] + "TARGET_SSSE3" + "phaddsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_phaddswv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_concat:V4HI + (vec_concat:V2HI + (ss_plus:HI + (vec_select:HI + (match_operand:V4HI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))) + (ss_plus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (ss_plus:HI + (vec_select:HI + (match_operand:V4HI 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))) + (ss_plus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 3)]))))))] + "TARGET_SSSE3" + "phaddsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_phsubwv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_concat:V8HI + (vec_concat:V4HI + (vec_concat:V2HI + (minus:HI + (vec_select:HI + (match_operand:V8HI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))) + (minus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (minus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 4)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 5)]))) + (minus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 6)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 7)]))))) + (vec_concat:V4HI + (vec_concat:V2HI + (minus:HI + (vec_select:HI + (match_operand:V8HI 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))) + (minus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (minus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 4)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 5)]))) + (minus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 6)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 7)])))))))] + "TARGET_SSSE3" + "phsubw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_phsubwv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_concat:V4HI + (vec_concat:V2HI + (minus:HI + (vec_select:HI + (match_operand:V4HI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))) + (minus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (minus:HI + (vec_select:HI + (match_operand:V4HI 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))) + (minus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 3)]))))))] + "TARGET_SSSE3" + "phsubw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_phsubdv4si3" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (vec_concat:V4SI + (vec_concat:V2SI + (minus:SI + (vec_select:SI + (match_operand:V4SI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:SI (match_dup 1) (parallel [(const_int 1)]))) + (minus:SI + (vec_select:SI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:SI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2SI + (minus:SI + (vec_select:SI + (match_operand:V4SI 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:SI (match_dup 2) (parallel [(const_int 1)]))) + (minus:SI + (vec_select:SI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:SI (match_dup 2) (parallel [(const_int 3)]))))))] + "TARGET_SSSE3" + "phsubd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_phsubdv2si3" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (vec_concat:V2SI + (minus:SI + (vec_select:SI + (match_operand:V2SI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:SI (match_dup 1) (parallel [(const_int 1)]))) + (minus:SI + (vec_select:SI + (match_operand:V2SI 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0)])) + (vec_select:SI (match_dup 2) (parallel [(const_int 1)])))))] + "TARGET_SSSE3" + "phsubd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_phsubswv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_concat:V8HI + (vec_concat:V4HI + (vec_concat:V2HI + (ss_minus:HI + (vec_select:HI + (match_operand:V8HI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))) + (ss_minus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (ss_minus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 4)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 5)]))) + (ss_minus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 6)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 7)]))))) + (vec_concat:V4HI + (vec_concat:V2HI + (ss_minus:HI + (vec_select:HI + (match_operand:V8HI 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))) + (ss_minus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (ss_minus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 4)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 5)]))) + (ss_minus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 6)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 7)])))))))] + "TARGET_SSSE3" + "phsubsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_phsubswv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_concat:V4HI + (vec_concat:V2HI + (ss_minus:HI + (vec_select:HI + (match_operand:V4HI 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 1)]))) + (ss_minus:HI + (vec_select:HI (match_dup 1) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2HI + (ss_minus:HI + (vec_select:HI + (match_operand:V4HI 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 1)]))) + (ss_minus:HI + (vec_select:HI (match_dup 2) (parallel [(const_int 2)])) + (vec_select:HI (match_dup 2) (parallel [(const_int 3)]))))))] + "TARGET_SSSE3" + "phsubsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_pmaddubswv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (ss_plus:V8HI + (mult:V8HI + (zero_extend:V8HI + (vec_select:V4QI + (match_operand:V16QI 1 "nonimmediate_operand" "%0") + (parallel [(const_int 0) + (const_int 2) + (const_int 4) + (const_int 6) + (const_int 8) + (const_int 10) + (const_int 12) + (const_int 14)]))) + (sign_extend:V8HI + (vec_select:V8QI + (match_operand:V16QI 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0) + (const_int 2) + (const_int 4) + (const_int 6) + (const_int 8) + (const_int 10) + (const_int 12) + (const_int 14)])))) + (mult:V8HI + (zero_extend:V8HI + (vec_select:V16QI (match_dup 1) + (parallel [(const_int 1) + (const_int 3) + (const_int 5) + (const_int 7) + (const_int 9) + (const_int 11) + (const_int 13) + (const_int 15)]))) + (sign_extend:V8HI + (vec_select:V16QI (match_dup 2) + (parallel [(const_int 1) + (const_int 3) + (const_int 5) + (const_int 7) + (const_int 9) + (const_int 11) + (const_int 13) + (const_int 15)]))))))] + "TARGET_SSSE3" + "pmaddubsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_pmaddubswv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (ss_plus:V4HI + (mult:V4HI + (zero_extend:V4HI + (vec_select:V4QI + (match_operand:V8QI 1 "nonimmediate_operand" "%0") + (parallel [(const_int 0) + (const_int 2) + (const_int 4) + (const_int 6)]))) + (sign_extend:V4HI + (vec_select:V4QI + (match_operand:V8QI 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0) + (const_int 2) + (const_int 4) + (const_int 6)])))) + (mult:V4HI + (zero_extend:V4HI + (vec_select:V8QI (match_dup 1) + (parallel [(const_int 1) + (const_int 3) + (const_int 5) + (const_int 7)]))) + (sign_extend:V4HI + (vec_select:V8QI (match_dup 2) + (parallel [(const_int 1) + (const_int 3) + (const_int 5) + (const_int 7)]))))))] + "TARGET_SSSE3" + "pmaddubsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_pmulhrswv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (truncate:V8HI + (lshiftrt:V8SI + (plus:V8SI + (lshiftrt:V8SI + (mult:V8SI + (sign_extend:V8SI + (match_operand:V8HI 1 "nonimmediate_operand" "%0")) + (sign_extend:V8SI + (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) + (const_int 14)) + (const_vector:V8HI [(const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1)])) + (const_int 1))))] + "TARGET_SSSE3 && ix86_binary_operator_ok (MULT, V8HImode, operands)" + "pmulhrsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseimul") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_pmulhrswv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (truncate:V4HI + (lshiftrt:V4SI + (plus:V4SI + (lshiftrt:V4SI + (mult:V4SI + (sign_extend:V4SI + (match_operand:V4HI 1 "nonimmediate_operand" "%0")) + (sign_extend:V4SI + (match_operand:V4HI 2 "nonimmediate_operand" "ym"))) + (const_int 14)) + (const_vector:V4HI [(const_int 1) (const_int 1) + (const_int 1) (const_int 1)])) + (const_int 1))))] + "TARGET_SSSE3 && ix86_binary_operator_ok (MULT, V4HImode, operands)" + "pmulhrsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseimul") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_pshufbv16qi3" + [(set (match_operand:V16QI 0 "register_operand" "=x") + (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "0") + (match_operand:V16QI 2 "nonimmediate_operand" "xm")] + UNSPEC_PSHUFB))] + "TARGET_SSSE3" + "pshufb\t{%2, %0|%0, %2}"; + [(set_attr "type" "sselog1") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_pshufbv8qi3" + [(set (match_operand:V8QI 0 "register_operand" "=y") + (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "0") + (match_operand:V8QI 2 "nonimmediate_operand" "ym")] + UNSPEC_PSHUFB))] + "TARGET_SSSE3" + "pshufb\t{%2, %0|%0, %2}"; + [(set_attr "type" "sselog1") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_psign3" + [(set (match_operand:SSEMODE124 0 "register_operand" "=x") + (unspec:SSEMODE124 [(match_operand:SSEMODE124 1 "register_operand" "0") + (match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")] + UNSPEC_PSIGN))] + "TARGET_SSSE3" + "psign\t{%2, %0|%0, %2}"; + [(set_attr "type" "sselog1") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_psign3" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (unspec:MMXMODEI [(match_operand:MMXMODEI 1 "register_operand" "0") + (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")] + UNSPEC_PSIGN))] + "TARGET_SSSE3" + "psign\t{%2, %0|%0, %2}"; + [(set_attr "type" "sselog1") + (set_attr "mode" "DI")]) + +(define_insn "ssse3_palignrti" + [(set (match_operand:TI 0 "register_operand" "=x") + (unspec:TI [(match_operand:TI 1 "register_operand" "0") + (match_operand:TI 2 "nonimmediate_operand" "xm") + (match_operand:SI 3 "const_0_to_255_mul_8_operand" "n")] + UNSPEC_PALIGNR))] + "TARGET_SSSE3" +{ + operands[3] = GEN_INT (INTVAL (operands[3]) / 8); + return "palignr\t{%3, %2, %0|%0, %2, %3}"; +} + [(set_attr "type" "sseishft") + (set_attr "mode" "TI")]) + +(define_insn "ssse3_palignrdi" + [(set (match_operand:DI 0 "register_operand" "=y") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:DI 2 "nonimmediate_operand" "ym") + (match_operand:SI 3 "const_0_to_255_mul_8_operand" "n")] + UNSPEC_PALIGNR))] + "TARGET_SSSE3" +{ + operands[3] = GEN_INT (INTVAL (operands[3]) / 8); + return "palignr\t{%3, %2, %0|%0, %2, %3}"; +} + [(set_attr "type" "sseishft") + (set_attr "mode" "DI")]) + +(define_insn "abs2" + [(set (match_operand:SSEMODE124 0 "register_operand" "=x") + (abs:SSEMODE124 (match_operand:SSEMODE124 1 "nonimmediate_operand" "xm")))] + "TARGET_SSSE3" + "pabs\t{%1, %0|%0, %1}"; + [(set_attr "type" "sselog1") + (set_attr "mode" "TI")]) + +(define_insn "abs2" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (abs:MMXMODEI (match_operand:MMXMODEI 1 "nonimmediate_operand" "ym")))] + "TARGET_SSSE3" + "pabs\t{%1, %0|%0, %1}"; + [(set_attr "type" "sselog1") + (set_attr "mode" "DI")]) Added: head/contrib/gcc/config/i386/tmmintrin.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/config/i386/tmmintrin.h Mon Mar 14 13:31:34 2011 (r219639) @@ -0,0 +1,448 @@ +/* Copyright (C) 2006 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 13:36:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C28F106566C; Mon, 14 Mar 2011 13:36:52 +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 3BF9B8FC13; Mon, 14 Mar 2011 13:36: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 p2EDaqYG095300; Mon, 14 Mar 2011 13:36:52 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EDaqt7095298; Mon, 14 Mar 2011 13:36:52 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201103141336.p2EDaqt7095298@svn.freebsd.org> From: Martin Matuska Date: Mon, 14 Mar 2011 13:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219640 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 13:36:52 -0000 Author: mm Date: Mon Mar 14 13:36:51 2011 New Revision: 219640 URL: http://svn.freebsd.org/changeset/base/219640 Log: Add ssse3 capability for CPUTYPE=core2 to MACHINE_CPU in bsd.cpu.mk MFC after: 2 weeks Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Mar 14 13:31:34 2011 (r219639) +++ head/share/mk/bsd.cpu.mk Mon Mar 14 13:36:51 2011 (r219640) @@ -29,7 +29,7 @@ MACHINE_CPU = mips . if ${MACHINE_CPUARCH} == "i386" . if ${CPUTYPE} == "nocona" CPUTYPE = prescott -. elif ${CPUTYPE} == "core" || ${CPUTYPE} == "core2" +. elif ${CPUTYPE} == "core" CPUTYPE = prescott . elif ${CPUTYPE} == "p4" CPUTYPE = pentium4 @@ -86,6 +86,8 @@ CPUTYPE = ultrasparc3 _CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0 . elif ${CPUTYPE} == "k5" _CPUCFLAGS = -march=pentium +. elif ${CPUTYPE} == "core2" +_CPUCFLAGS = -march=prescott . else _CPUCFLAGS = -march=${CPUTYPE} . endif # GCC on 'i386' @@ -182,6 +184,8 @@ MACHINE_CPU = 3dnow mmx i586 i486 i386 MACHINE_CPU = sse mmx i586 i486 i386 . elif ${CPUTYPE} == "c7" MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386 +. elif ${CPUTYPE} == "core2" +MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 . elif ${CPUTYPE} == "prescott" MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386 . elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m" @@ -206,7 +210,9 @@ MACHINE_CPU = i386 MACHINE_CPU = k8 3dnow sse3 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow -. elif ${CPUTYPE} == "nocona" || ${CPUTYPE} == "core2" +. elif ${CPUTYPE} == "core2" +MACHINE_CPU = ssse3 sse3 +. elif ${CPUTYPE} == "nocona" MACHINE_CPU = sse3 . endif MACHINE_CPU += amd64 sse2 sse mmx From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 13:47:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19DAF106566C; Mon, 14 Mar 2011 13:47:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071EA8FC12; Mon, 14 Mar 2011 13:47: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 p2EDlI7E095543; Mon, 14 Mar 2011 13:47:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EDlHHT095540; Mon, 14 Mar 2011 13:47:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103141347.p2EDlHHT095540@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 14 Mar 2011 13:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219641 - in head: etc release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 13:47:18 -0000 Author: nwhitehorn Date: Mon Mar 14 13:47:17 2011 New Revision: 219641 URL: http://svn.freebsd.org/changeset/base/219641 Log: Thanks to sysinstall for its 15 years of service. And now to sleep, perchance to dream... Added: head/release/Makefile.sysinstall - copied, changed from r219583, head/release/Makefile Deleted: head/release/Makefile.bsdinstall Modified: head/etc/motd head/release/Makefile head/release/generate-release.sh Modified: head/etc/motd ============================================================================== --- head/etc/motd Mon Mar 14 13:36:51 2011 (r219640) +++ head/etc/motd Mon Mar 14 13:47:17 2011 (r219641) @@ -19,6 +19,5 @@ as a question to the questions@FreeBSD.o unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. -You may also use sysinstall(8) to re-enter the installation and -configuration utility. Edit /etc/motd to change this login announcement. +Edit /etc/motd to change this login announcement. Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Mar 14 13:36:51 2011 (r219640) +++ head/release/Makefile Mon Mar 14 13:47:17 2011 (r219641) @@ -1,1442 +1,157 @@ # $FreeBSD$ # -# make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \ -# [RELEASETAG=tag] [SVNROOT=svn://svn.freebsd.org/base] \ -# [SVNBRANCH=some/branch] +# Makefile for building releases and release media. +# +# User-driven targets: +# cdrom: Builds release CD-ROM media (release.iso) +# ftp: Sets up FTP distribution area (ftp) +# release: Build all media and FTP distribution area +# +# Variables affecting the build process: +# WORLDDIR: location of src tree -- must have built world and default kernel +# (by default, the directory above this one) +# PORTSDIR: location of ports tree to distribute (default: /usr/ports) +# DOCDIR: location of doc tree (default: /usr/doc) +# NOPORTS: if set, do not distribute ports tree +# NOSRC: if set, do not distribute source tree +# NODOC: if set, do not generate release documentation +# TARGET/TARGET_ARCH: architecture of built release # -# Where "/some/dir" is the pathname of a directory on a some filesystem with -# at least 1000MB of free space, "somename" is what you want the release to -# call itself, "/cvs/dir" is where our source repo resides and, optionally, -# which CVS "tag" name should be used when checking out the sources to build -# the release (default is HEAD). -# -# Please note the support for building from SVN is preliminary and there -# are still questions about things like how to handle updates of -# /usr/src on production systems (csup(1) replacement). It is a work -# in progress and may change as the other issues get worked out. -# -# Please note: the md(4) driver must be present in the kernel -# (either by being compiled in or available as a kld(4) module), -# otherwise the target 'release.8' and possibly others will fail. -# -# Note: If you add options to this file, please keep release(7) updated! -# -# Set these, release builder! -# -# Fixed version: -#BUILDNAME=9.0-CURRENT -# -# Automatic SNAP versioning: -DATE != date +%Y%m%d -BASE = 9.0 -BUILDNAME?=${BASE}-${DATE}-SNAP -# -#CHROOTDIR=/junk/release -# If this is a -stable snapshot, then set -#RELEASETAG=RELENG_8 -# -# To test a release with a source tree containing patches and -# other work. This tree will get copied instead of getting the -# src/ tree from a CVS checkout. For "rerelease", this will NOT -# be copied; cvs update will be used instead. -#EXTSRCDIR=/usr/src -# -# To use a checked-out ports collection directory instead of -# checking out from a local CVS repository, set this option. -#EXTPORTSDIR=/usr/ports -# -# To use a checked-out doc/ directory instead of -# checking out from a local CVS repository, set this option. -#EXTDOCDIR=/usr/doc -# -# To add other options to the CVS subcommands (co,up), set -#CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'" -# -# To add other options to the CVS command, set -#CVSARGS="-lfq" -# -# To prefix the CVS command -#CVSPREFIX="/usr/bin/time" -# -# Where the CVS repository is -#CVSROOT="/home/ncvs" -# -# To add other options to the Subversion subcommands (co,up), set -#SVNCMDARGS="-r '{ 01/01/2002 00:00:00 UTC }'" -# -# To prefix the Subversion command -#SVNPREFIX="/usr/bin/time" -# -# Where the Subversion repository is -#SVNROOT=svn://svn.freebsd.org/base -# -# Subversion branch to build for src. If this is not set then it is -# automatically computed from RELEASETAG. -#SVNBRANCH=stable/8 -# -# Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we -# are building an official release. Otherwise, we are building for -# a branch. -.if defined(RELEASETAG) -ISRELEASE!= expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true -.if ${ISRELEASE} != 0 -# Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees. -AUXRELEASETAG!= echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//' -DOCRELEASETAG?= ${AUXRELEASETAG} -PORTSRELEASETAG?= ${AUXRELEASETAG} -.endif -.endif -# Determine the Subversion source branch that corresponds to the requested -# RELEASETAG. -.if !defined(SVNBRANCH) -.if defined(RELEASETAG) -SVNBRANCH!= echo "${RELEASETAG}" | awk -f ${.CURDIR}/svnbranch.awk -.else -SVNBRANCH= head -.endif -.endif - -# If you want to pass flags to the world build such as -j X, use -# WORLD_FLAGS. Similarly, you can specify make flags for kernel -# builds via KERNEL_FLAGS. -#WORLD_FLAGS=-j4 -#KERNEL_FLAGS=-j4 +WORLDDIR?= ${.CURDIR}/.. +PORTSDIR?= /usr/ports +DOCDIR?= /usr/doc +RELNOTES_LANG?= en_US.ISO8859-1 TARGET_ARCH?= ${MACHINE_ARCH} .if ${TARGET_ARCH} == ${MACHINE_ARCH} -TARGET?= ${MACHINE} -TARGET_CPUARCH?= ${MACHINE_CPUARCH} -.else -TARGET?= ${TARGET_ARCH} -TARGET_CPUARCH?= ${TARGET_ARCH} -.endif -CROSSENV= TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} -CROSSMAKE= ${MAKE} ${CROSSENV} -NATIVEMAKE= ${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE} - -# If you are using a local CVS repository with components stored in -# non-standard modules, override these on the make commandline or -# in the environment. -RELEASESRCMODULE?= src -RELEASEDOCMODULE?= doc -RELEASEPORTSMODULE?= ports - -# Uncomment this to disable the doc.1 target. Docs normally require -# the ports tree, so NOPORTS can be set together with NODOC in order -# to have neither ports or docs. If only NOPORTS is set to YES, but -# docs are still desired, the DOMINIMALDOCPORTS logic below will only -# install the ports that are minimally required for the release note documentation. This is -# intended as a compromise, less disk space is required than for using -# the entire ports collection (and much less time due to the huge number -# of directories it would create), but still quite a bit as well as some -# CPU cycles (some of the programs are C++, and things like ghostscript -# belong to the required ports nevertheless). -# -#NODOC= YES -#NOPORTS= YES - -# When retrieving ports using the pkg_add -r method, set your proxies to these. -# src/release/${arch}/mkisoimages.sh can use these. -#HTTP_PROXY?= www.example.com -#FTP_PROXY?= ftp.example.com - -# When creating ISO images, point ${CD_PACKAGE_TREE} to a directory containing -# the package split by an earlier invocation of the 'package-split' target. -#CD_PACKAGE_TREE= /path/to/pkg - -# Extra source tarballs; each argument is a pair of source dir and -# distribution name. The dist name should not exceed 7 characters -# (another "s" for "source" will be prepended). -#EXTRA_SRC= games/fortune fortune - -# Modify this definition if you want the release notes -# and other release documentation in a language other than English. -RELNOTES_LANG?= en_US.ISO8859-1 - -# As an alternative to installing the entire ports collection (which -# can take a huge amount of time, in particular on slower disks), -# setting ${MINIMALDOCPORTS} allows to install and build just those -# ports that are really required for getting the docs up & running. -.if defined(NOPORTS) && !defined(NODOC) -DOMINIMALDOCPORTS= YES -.include "Makefile.inc.docports" -RELEASEPORTSMODULE= ${MINIMALDOCPORTS} ports/sysutils/cdrtools -.endif - -# Helper variable -.if defined(NOPORTS) -.if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES" -NOPORTSATALL= YES -.endif -.endif - -# -# Doing 'make index' in /usr/ports requires Perl. -MAKEINDEXPORTS= lang/perl5.10 -DOCPORTS= textproc/docproj -# Set this to wherever the distfiles required by release procedures. -.if defined(DOCDISTFILES) -# Respect DOCDISTFILES which is used before. -RELEASEDISTFILES?= ${DOCDISTFILES} -.else -RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles -.endif -# Set this to 1 if you want -P to be used for automatic keyboard detection -# on the boot floppy. WARNING: Breaks on some Athlon (K7) motherboards. -AUTO_KEYBOARD_DETECT?= 0 - -.if !defined(NODOC) -DIST_DOCS_ARCH_INDEP= hardware readme relnotes errata -DIST_DOCS_ARCH_DEP= -.endif - -# Things which without too much trouble can be considered variables -# BASE_DISTS are special in that they get full /etc installation sets. -# -OTHER_DISTS?= catpages manpages proflibs dict info -BASE_DISTS?= base doc games ${ARCH_DISTS} -.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" -ARCH_DISTS?= lib32 -.endif -DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS} - -# -# Build and package both GENERIC and SMP kernels if the target -# has both configuration files. Otherwise only GENERIC is done. -# -.if ${TARGET_ARCH} == "powerpc64" -KERN_GENERIC?= GENERIC64 -.else -KERN_GENERIC?= GENERIC -.endif - -.if exists(${.CURDIR}/../sys/${TARGET}/conf/SMP) -KERNELS_BASE?= ${KERN_GENERIC} SMP -.else -KERNELS_BASE?= ${KERN_GENERIC} -.endif - -# mountpoint for filesystems. -MNT= /mnt - -# Various floppy image parameters. -# - -.undef MAKE_FLOPPIES -.if ${TARGET_ARCH} == "i386" -MAKE_DVD= -SEPARATE_LIVEFS= -SPLIT_MFSROOT= -.if ${TARGET} == "pc98" -MAKE_FLOPPIES= true -SMALLFLOPPYSIZE= 1200 -SMALLFLOPPYSPLITSIZE= 1152 -SMALLFLOPPYLABEL= fd1200 -SPLIT_MFSROOT= -.endif -FLOPPYSIZE= 1440 -FLOPPYSPLITSIZE= 1392 -FLOPPYINODE= 40000 -FLOPPYLABEL= fd1440 -BOOTINODE= 80000 -MFSSIZE= 4320 -MFSINODE= 8000 -MFSLABEL= minimum3 -.elif ${TARGET_ARCH} == "sparc64" -DISKLABEL= sunlabel -MAKE_DVD= -MFSSIZE= 4096 -MFSINODE= 8192 -MFSLABEL= auto -MINIROOT= -SEPARATE_LIVEFS= -.elif ${TARGET_ARCH} == "ia64" -DISKLABEL= "" -MAKE_DVD= -MFSSIZE= 8192 -MFSINODE= 8192 -MFSLABEL= auto -SEPARATE_LIVEFS= -.elif ${TARGET_ARCH} == "amd64" -MAKE_DVD= -FLOPPYSIZE= 1440 -FLOPPYSPLITSIZE= 1392 -FLOPPYINODE= 40000 -FLOPPYLABEL= fd1440 -BOOTINODE= 80000 -MFSSIZE= 4096 -MFSINODE= 8192 -MFSLABEL= auto -SEPARATE_LIVEFS= -SPLIT_MFSROOT= -.elif ${TARGET_ARCH} == "powerpc" -DISKLABEL= "" -MFSSIZE= 4096 -MFSINODE= 8192 -MFSLABEL= auto -SEPARATE_LIVEFS= -.elif ${TARGET_ARCH} == "powerpc64" -DISKLABEL= "" -MFSSIZE= 8192 -MFSINODE= 8192 -MFSLABEL= auto -SEPARATE_LIVEFS= -.endif -.if defined(NO_FLOPPIES) -.undef MAKE_FLOPPIES -.endif - -.if exists(/sbin/bsdlabel) -DISKLABEL?= bsdlabel -.else -DISKLABEL?= disklabel -.endif - -ZIPPER= gzip -9 --no-name -ZIPNSPLIT= ${ZIPPER} -c | split -b 1392k - - -# Things which may get you into trouble if you change them -MTREEFILES= ${.CURDIR}/../etc/mtree -_R?= /R -RD= ${_R}/stage -RND= ${RD}/release.doc -FD= ${_R}/ftp -CD= ${_R}/cdrom -CD_BOOT= ${CD}/bootonly -CD_DISC1= ${CD}/disc1 -CD_DISC2= ${CD}/disc2 -.if defined(MAKE_DVD) -CD_DVD1= ${CD}/dvd1 -.endif -.if !defined(NODOC) -CD_DOCS= ${CD}/docs -.endif -.if defined(SEPARATE_LIVEFS) -CD_LIVEFS= ${CD}/livefs -.else -CD_LIVEFS= ${CD_DISC1} -.endif -_MK?= ${CHROOTDIR}/mk - -# Where the bootstrap ports (see DOCPORTS) get installed. -LOCALDIR= /usr/local/bin - -.if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel" -DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET} -.else -DOFS_SH= ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} "" -.endif - -CRUNCH_TARGETS= boot -.if ${TARGET_ARCH} == "i386" -CRUNCH_TARGETS+=fixit -.if ${TARGET} == "pc98" -CRUNCH_TARGETS+=fixit-small -.endif -.endif - -.if defined(MAKE_FLOPPIES) -EXTRAS= floppies.1 -.if ${TARGET_ARCH} == "i386" -EXTRAS+= floppies.2 -.endif -EXTRAS+= floppies.3 -.endif -EXTRAS+= ftp.1 -.if !defined(NOCDROM) -EXTRAS+= cdrom.1 cdrom.2 cdrom.3 -.if defined(MAKE_ISOS) -EXTRAS+= iso.1 -.endif -.if ${TARGET} == "pc98" -BOOTABLE="-G" +TARGET?= ${MACHINE} .else -BOOTABLE="-b" -.endif +TARGET?= ${TARGET_ARCH} .endif +IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} +DISTDIR= ${.OBJDIR}/dist -.if !defined(NODOC) -DOCREL= doc.1 doc.2 -.endif - -.if !make(release) && !make(rerelease) && !make(package-split) -BINMAKE!= cd ${.CURDIR}/..; ${MAKE} -V BINMAKE -WMAKEENV!= cd ${.CURDIR}/..; \ - ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV -WMAKE= ${WMAKEENV} ${BINMAKE} -.endif - -CVS_SRCARGS= -P -.if defined(RELEASETAG) -CVS_SRCARGS+= -r ${RELEASETAG} -.endif - -CVS_DOCARGS= -P -.if defined(DOCRELEASETAG) -CVS_DOCARGS+= -r ${DOCRELEASETAG} -.endif - -CVS_PORTSARGS= -P -.if defined(PORTSRELEASETAG) -CVS_PORTSARGS+= -r ${PORTSRELEASETAG} -.endif - -WORLDDIR?= ${.CURDIR}/.. - -release rerelease: -.if !defined(CHROOTDIR) || !defined(BUILDNAME) - @echo "To make a release you must set CHROOTDIR and BUILDNAME" && false -.endif -.if !defined(NOPORTSATALL) && !defined(EXTPORTSDIR) && !defined(CVSROOT) - @echo "Building ports requires CVSROOT or EXTPORTSDIR" && false +.if !exists(${DOCDIR}) +NODOC= true .endif -.if !defined(NODOC) && !defined(EXTDOCDIR) && !defined(CVSROOT) - @echo "Building docs requires CVSROOT or EXTDOCDIR" && false -.endif -.if !defined(EXTSRCDIR) && !defined(CVSROOT) && !defined(SVNROOT) - @echo "The source tree requires SVNROOT, CVSROOT, or EXTSRCDIR" && false -.endif -.if defined(NOPORTSATALL) && !defined(NODOC) - @echo "Ports are required for building the release docs. Either set NODOC or" - @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!" - @exit 1 -.endif -.if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES) -.for p in ${LOCAL_PATCHES} -.if !exists(${p}) - @echo "The patch file ${p} does not exist!" - @exit 1 -.endif -.endfor -.endif -.if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT}) - @echo "The local script ${LOCAL_SCRIPT} does not exist!" - @exit 1 -.endif -.if make(release) -.if exists(${CHROOTDIR}) -# The first command will fail on a handful of files that have their schg -# flags set. But it greatly speeds up the next two commands. - # NB: clear any vestigial devfs mount, just in case - -umount ${CHROOTDIR}/dev > /dev/null 2>&1 - -rm -rf ${CHROOTDIR} 2>/dev/null - -chflags -R 0 ${CHROOTDIR}/. - -rm -rf ${CHROOTDIR} -.endif - mkdir -p ${CHROOTDIR} - @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`" - cd ${WORLDDIR} && ${NATIVEMAKE} -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_LIB32 \ - -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE installworld DESTDIR=${CHROOTDIR} - cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR} - if [ -f /etc/resolv.conf ]; then \ - cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \ - fi -.if defined(EXTLOCALDIR) - rm -rf ${CHROOTDIR}/usr/local - cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local -.endif - rm -rf ${CHROOTDIR}/usr/src -.if defined(EXTSRCDIR) - cd ${CHROOTDIR}/usr && \ - cp -R -H ${EXTSRCDIR} src -.elif defined(SVNROOT) - cd ${CHROOTDIR}/usr && \ - ${SVNPREFIX} svn co ${SVNCMDARGS} ${SVNROOT}/${SVNBRANCH} \ - ${RELEASESRCMODULE} -.else - cd ${CHROOTDIR}/usr && \ - ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ - co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE} -.endif -.if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES) -.for p in ${LOCAL_PATCHES} - patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p} -.endfor -.endif -.if defined(LOCAL_SCRIPT) - cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \ - RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT} -.endif - rm -rf ${CHROOTDIR}/usr/ports -.if !defined(NOPORTSATALL) -.if defined(EXTPORTSDIR) - cd ${CHROOTDIR}/usr && cp -R -H ${EXTPORTSDIR} ports - # If there are distfiles downloaded removing them - rm -rf ports/distfiles/* -.else - cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ - co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE} -.endif -.endif -.if !defined(NODOC) - rm -rf ${CHROOTDIR}/usr/doc -.if defined(EXTDOCDIR) - cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc -.else - cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ - co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE} -.endif - if [ -d ${RELEASEDISTFILES}/ ]; then \ - cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \ - else \ - mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \ - fi -.if !defined(NO_PREFETCHDISTFILES) - @cd ${.CURDIR} && ${MAKE} fetch-distfiles -.endif -.endif -.endif -.if make(rerelease) -.if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR) -.if defined(SVNROOT) - cd ${CHROOTDIR}/usr/src && ${SVNPREFIX} svn switch ${SVNCMDARGS} \ - ${SVNROOT}/${SVNBRANCH} -.elif !defined(RELEASETAG) - cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ - update ${CVSCMDARGS} -P -d -A -.else - cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ - update ${CVSCMDARGS} -P -d -r ${RELEASETAG} -.endif - rm -f ${CHROOTDIR}/tmp/.world_done -.if !defined(NOPORTS) && !defined(EXTPORTSDIR) - cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ - update ${CVSCMDARGS} -P -d - rm -f ${CHROOTDIR}/tmp/.skip_ports_index -.endif -.if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES" - for i in ${MINIMALDOCPORTS}; do \ - ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ - update ${CVSCMDARGS} -P -d ) ; \ - done -.endif -.if !defined(NODOC) - cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ - update ${CVSCMDARGS} -P -d -.endif -.endif -.endif - # Add version information to those things that need it. - if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \ - cd ${CHROOTDIR}/usr/src/sys/conf && \ - mv newvers.sh foo && \ - sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \ - rm foo; \ - fi - -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release - echo "#!/bin/sh" > ${_MK} - echo "set -ex" >> ${_MK} - echo "trap 'umount /dev || true' 0" >> ${_MK} - echo "_RELTARGET=\$${1:-doRELEASE}" >> ${_MK} -.for var in \ - AUTO_KEYBOARD_DETECT \ - BUILDNAME \ - CD_PACKAGE_TREE \ - DISTRIBUTIONS \ - DOMINIMALDOCPORTS \ - EXTRA_SRC \ - FTP_PASSIVE_MODE \ - FTP_PROXY \ - HTTP_PROXY \ - KERNELS \ - KERNELS_BASE \ - KERNEL_FLAGS \ - MAKE_DVD \ - MAKE_FLOPPIES \ - MAKE_ISOS \ - NOCDROM \ - NODOC \ - NOPORTS \ - NO_SHARED \ - NOSRC \ - NO_CPU_CFLAGS \ - NO_CPU_COPTFLAGS \ - NO_FLOPPIES \ - RELEASETAG \ - RELNOTES_LANG \ - SEPARATE_LIVEFS \ - TARGET \ - TARGET_ARCH \ - TARGET_CPUARCH \ - WORLD_FLAGS -.if defined(${var}) - echo "export ${var}=\"${${var}}\"" >> ${_MK} -.endif -.endfor - # Don't remove this, or the build will fall over! - echo "export RELEASEDIR=${_R}" >> ${_MK} - echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${_MK} - echo "export MANBUILDCAT=YES" >> ${_MK} - # NB: these may fail if the host is running w/o devfs - echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK} - echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" >> ${_MK} - echo "if [ ! -c /dev/null ]; then" >> ${_MK} - echo " echo /dev/null is not a device!" >> ${_MK} - echo " exit 1" >> ${_MK} - echo "fi" >> ${_MK} - echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK} - echo " /etc/rc.d/ldconfig start" >> ${_MK} - echo "else" >> ${_MK} - echo " ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK} - echo "fi" >> ${_MK} - echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK} - echo " cd /usr/src" >> ${_MK} - echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK} - echo " touch /tmp/.world_done || exit 1" >> ${_MK} - echo "fi" >> ${_MK} - echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK} - echo " echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} - echo " for i in ${MAKEINDEXPORTS}" >> ${_MK} - echo " do" >> ${_MK} - echo " cd /usr/ports/\$${i}" >> ${_MK} - echo " env -i HTTP_PROXY=$${HTTP_PROXY} FTP_PROXY=$${FTP_PROXY} FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK} - echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK} - echo " done" >> ${_MK} - echo " cd /usr/ports" >> ${_MK} - echo " rm -f INDEX*" >> ${_MK} - echo " make index -DINDEX_PRISTINE" >> ${_MK} - echo " rm -f INDEX*.tmp" >> ${_MK} - echo " touch /tmp/.skip_ports_index" >> ${_MK} - echo " echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} - echo "fi" >> ${_MK} - echo "cd /usr/src/release" >> ${_MK} - echo "make obj" >> ${_MK} - echo "make \$${_RELTARGET}" >> ${_MK} - echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} - chmod 755 ${_MK} -.if defined(NOPORTS) - touch ${CHROOTDIR}/tmp/.skip_ports_index +.if !exists(${PORTSDIR}) +NOPORTS= true .endif - # Ensure md.ko is loaded if md(4) is not statically compiled into - # the kernel - -mdconfig 2>/dev/null - env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}` -clean: - rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS} - -fetch-distfiles: - @for i in ${MAKEINDEXPORTS}; do \ - cd ${CHROOTDIR}/usr/ports/$$i && \ - make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \ - checksum-recursive ; \ - done - @for i in ${DOCPORTS}; do \ - cd ${CHROOTDIR}/usr/ports/$$i && \ - make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \ - WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \ - checksum-recursive ; \ - done - -# Clean out ${_R} and make the directory structure. -release.1: - mkdir -p ${_R} - -rm -rf ${_R}/* 2> /dev/null - -chflags -R noschg ${_R}/. - rm -rf ${_R}/* - mkdir ${RD} -.if defined(MAKE_FLOPPIES) - mkdir ${RD}/floppies -.endif - mkdir ${RD}/trees - for i in ${DISTRIBUTIONS}; do \ - mkdir ${RD}/trees/$$i && \ - mtree -deU -f ${MTREEFILES}/BSD.root.dist \ - -p ${RD}/trees/$$i > /dev/null && \ - mtree -deU -f ${MTREEFILES}/BSD.usr.dist \ - -p ${RD}/trees/$$i/usr > /dev/null && \ - mtree -deU -f ${MTREEFILES}/BSD.include.dist \ - -p ${RD}/trees/$$i/usr/include > /dev/null; \ - done - mkdir ${RD}/kernels - for i in ${KERNELS_BASE} ${KERNELS}; do \ - mkdir -p ${RD}/kernels/$${i}; \ - done - touch ${.TARGET} - -# Install the system into the various distributions. -release.2: - cd ${.CURDIR}/.. && ${CROSSMAKE} distrib-dirs DESTDIR=${RD}/trees/base - cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \ - DISTDIR=${RD}/trees - sh ${.CURDIR}/scripts/mm-mtree.sh -F "${CROSSENV}" -D "${RD}/trees/base" - touch ${.TARGET} - -# Make and install the generic kernel(s). -release.3: -.for kernel in ${KERNELS_BASE} ${KERNELS} - cd ${.CURDIR}/..; \ - ${CROSSMAKE} ${KERNEL_FLAGS} \ - KERNCONF=${kernel} kernel \ - DESTDIR=${RD}/kernels KODIR=/${kernel} -.endfor - touch ${.TARGET} - -# Make and install the three crunched binaries which live on the floppies. -# You are not supposed to like this :-) -release.4: - rm -rf ${RD}/crunch - mkdir -p ${RD}/crunch -.for j in ${CRUNCH_TARGETS} -.if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf) - rm -rf ${j}_crunch - mkdir ${j}_crunch - cd ${j}_crunch; ${WMAKEENV} MAKEFLAGS="-m ${.CURDIR}/../share/mk" \ - NO_WERROR= crunchgen -o \ - ${.CURDIR}/${TARGET}/${j}_crunch.conf - cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean - cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools - cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \ - -DNO_CPU_CFLAGS all - ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch - mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j} -.endif -.endfor - touch ${.TARGET} - -# -# --==## Fix up the distributions. ##==-- -# -release.5: - # Create any "synthetic dists" now. - @for i in ${DISTRIBUTIONS}; do \ - if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \ - echo -n "Running $$i dist creation script... "; \ - env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ - echo "Done."; \ - fi \ - done \ - - # Remove all the directories we don't need. - -cd ${RD}/trees && \ - (find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \ - find ${OTHER_DISTS} -depth -type d -empty -delete) - touch ${.TARGET} - -# -# --==## Package up the tarballs from assembled trees ##==-- -# -release.6: - rm -rf ${RD}/dists - mkdir -p ${RD}/dists - @for i in ${DISTRIBUTIONS} ; \ - do \ - if [ -d ${RD}/trees/$${i} ] ; then \ - cd ${.CURDIR} && $(MAKE) doTARBALL \ - SD=${RD}/trees/$${i} \ - TN=$$i TD=$$i ARG="." && \ - echo "$${i} distribution is finished."; \ - fi ; \ - done - @for i in ${KERNELS_BASE} ${KERNELS} ; \ - do \ - if [ -d ${RD}/kernels/$${i} ] ; then \ - cd ${.CURDIR} && $(MAKE) doTARBALL \ - SD=${RD}/kernels \ - TN=$$i TD=kernels ARG="$$i" && \ - echo "$${i} distribution is finished."; \ - fi ; \ - done +EXTRA_PACKAGES= .if !defined(NOPORTS) - # XXX: Inline stripped version of doTARBALL - @rm -rf ${RD}/dists/ports/ports* - @mkdir -p ${RD}/dists/ports - @echo rolling ports/ports tarball - @tar --exclude CVS --exclude .svn --exclude 'ports/distfiles/*' \ - -czf ${RD}/dists/ports/ports.tgz -C /usr ports - @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh - @(cd ${RD}/dists/ports; \ - rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \ - md5 * > .CHECKSUM.MD5; \ - sha256 * > .CHECKSUM.SHA256; \ - mv .CHECKSUM.MD5 CHECKSUM.MD5; \ - mv .CHECKSUM.SHA256 CHECKSUM.SHA256) - @echo "ports distribution is finished." +EXTRA_PACKAGES+= ports.txz .endif - touch ${.TARGET} - - -# -# --==## Make source dists ##==-- -# -release.7: .if !defined(NOSRC) - @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ - TD=src TN=sbase ARG="[A-Z]*" - @for i in `cd /usr/src && echo [a-z]*` ; do \ - if [ -d /usr/src/$$i ] ; then \ - cd ${.CURDIR} && $(MAKE) doTARBALL \ - TN=`echo s$$i | tr -d '.' | \ - sed -e 's/usr/u/' \ - -e 's/kerberos5/krb5/'` \ - SD=/usr/src TD=src ARG="$$i" ; \ - fi ; \ - done -.if defined(EXTRA_SRC) - @set ${EXTRA_SRC} && \ - while [ $$# -ge 2 ] ; do \ - if [ -d /usr/src/$$1 ] ; then \ - cd ${.CURDIR} && $(MAKE) doTARBALL \ - SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ - fi && shift && shift ; \ - done -.endif - (cd ${RD}/dists/src; \ - rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \ - md5 * > .CHECKSUM.MD5; \ - sha256 * > .CHECKSUM.SHA256; \ - mv .CHECKSUM.MD5 CHECKSUM.MD5; \ - mv .CHECKSUM.SHA256 CHECKSUM.SHA256) - @echo "src distribution is finished." +EXTRA_PACKAGES+= src.txz .endif - touch ${.TARGET} - -# Build the memory root filesystem. -release.8: - cp ${RD}/trees/base/etc/disktab /etc - rm -rf ${RD}/mfsfd - mkdir ${RD}/mfsfd - cd ${RD}/mfsfd && \ - mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help \ - var/empty - @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ - DIR=${RD}/mfsfd/stand ZIP=false - ( cd ${RD}/mfsfd && \ - for dir in bin sbin ; do \ - ln -sf /stand $$dir; \ - done ) - cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand - cp ${.CURDIR}/../etc/master.passwd ${RD}/mfsfd/etc/master.passwd - cp ${RD}/trees/base/etc/*pwd.db ${RD}/mfsfd/etc/ - ( for F in defaults/rc.conf netconfig protocols ; do \ - sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ - ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \ - done ) - grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \ - ${RD}/trees/base/etc/services | \ - sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \ - > ${RD}/mfsfd/stand/etc/services - grep 'operator' ${RD}/trees/base/etc/group \ - > ${RD}/mfsfd/stand/etc/group - ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services - ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group - ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig - cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp .if !defined(NODOC) - @for i in ${DIST_DOCS_ARCH_INDEP}; do \ - cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \ - ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ - done - @for i in ${DIST_DOCS_ARCH_DEP}; do \ - cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \ - ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ - done -.endif - -test -f ${.CURDIR}/install.cfg \ - && cp ${.CURDIR}/install.cfg ${RD}/mfsfd - @mkdir -p ${RD}/mfsfd/boot -.if ${TARGET_ARCH} != "ia64" && ${TARGET_CPUARCH} != "powerpc" - @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot +EXTRA_PACKAGES+= reldoc .endif -.if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64" - @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot -.endif - @tar --exclude CVS --exclude .svn -cf - \ - -C ${.CURDIR}/../usr.sbin/sysinstall help | \ - tar xf - -C ${RD}/mfsfd/stand - @mkdir -p ${RD}/mfsroot - sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \ - ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL} - @${ZIPPER} -fv ${RD}/mfsroot/mfsroot - touch ${.TARGET} -KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz -.if defined(SMALLFLOPPYSIZE) -SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz -.endif -.if defined(SPLIT_MFSROOT) -MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz -.if defined(SMALLFLOPPYSIZE) -SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz +RELEASE_TARGETS= ftp +.if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) +RELEASE_TARGETS+= cdrom .endif +.if exists(${.CURDIR}/${TARGET}/make-memstick.sh) +RELEASE_TARGETS+= memstick .endif -# Build boot and install floppies. -floppies.1: - @${ZIPPER} -c ${RD}/kernels/${KERN_GENERIC}/kernel > ${RD}/kernels/kernel.gz - @echo "Making the kernel boot floppies..." - @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \ - FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz -.if defined(SMALLFLOPPYSIZE) - @echo "Making the small kernel boot floppies..." - @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \ - FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \ - FDSIZE="SMALL" -.endif -.if defined(SPLIT_MFSROOT) - @echo "Making the mfsroot boot floppies..." - @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \ - FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz -.if defined(SMALLFLOPPYSIZE) - @echo "Making the small mfsroot boot floppies..." - @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \ - FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \ - FDSIZE="SMALL" -.endif - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ - KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ - MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot" -.if defined(SMALLFLOPPYSIZE) - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ - KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ - MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \ - FDSIZE="SMALL" -.endif -.else # !SPLIT_MFSROOT - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ - KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ - MFSROOTFILE=${RD}/mfsroot/mfsroot.gz -.if defined(SMALLFLOPPYSIZE) - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ - KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ - MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \ - FDSIZE="SMALL" -.endif -.endif # SPLIT_MFSROOT - touch ${.TARGET} - -# Build fixit floppy. -floppies.2: - @echo "Making fixit floppy." - @rm -rf ${RD}/fixitfd - @mkdir ${RD}/fixitfd - @cd ${RD}/fixitfd && \ - mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \ - usr/share/misc - @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \ - ${RD}/fixitfd/etc - @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \ - > ${RD}/fixitfd/etc/protocols - @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \ - > ${RD}/fixitfd/usr/share/misc/scsi_modes - @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile - @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services - @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar - @chmod 555 ${RD}/fixitfd/stand/tar -.if defined(SMALLFLOPPYSIZE) - @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \ - DIR=${RD}/fixitfd/stand ZIP=false - @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \ - ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL} - @rm -rf ${RD}/fixitfd/stand - @mkdir ${RD}/fixitfd/stand -.endif - @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \ - DIR=${RD}/fixitfd/stand ZIP=false - @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \ - ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL} - touch ${.TARGET} - -# Do our last minute floppies directory setup -floppies.3: - @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5) - @(cd ${RD}/floppies; sha256 *.flp > CHECKSUM.SHA256) - touch ${.TARGET} - -# -# --==## Setup a suitable ftp-area ##==-- -# -ftp.1: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 14:04:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38AF21065680; Mon, 14 Mar 2011 14:04:28 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C93628FC26; Mon, 14 Mar 2011 14:04:27 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id D9C7245E9D; Mon, 14 Mar 2011 15:04:25 +0100 (CET) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 019D345683; Mon, 14 Mar 2011 15:04:20 +0100 (CET) Date: Mon, 14 Mar 2011 15:04:16 +0100 From: Pawel Jakub Dawidek To: Nathan Whitehorn Message-ID: <20110314140416.GE1720@garage.freebsd.pl> References: <201103141347.p2EDlHHT095540@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8S1fMsFYqgBC+BN/" Content-Disposition: inline In-Reply-To: <201103141347.p2EDlHHT095540@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219641 - in head: etc release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 14:04:29 -0000 --8S1fMsFYqgBC+BN/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 14, 2011 at 01:47:17PM +0000, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Mon Mar 14 13:47:17 2011 > New Revision: 219641 > URL: http://svn.freebsd.org/changeset/base/219641 >=20 > Log: > Thanks to sysinstall for its 15 years of service. And now to sleep, > perchance to dream... And yes, I just heard, it is snowing in hell. This is for you, Nathan: http://www.youtube.com/watch?v=3D4m8ltkjO7Pg --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --8S1fMsFYqgBC+BN/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk1+IGAACgkQForvXbEpPzRQIACgi5WO/mvDXeTVj6HnViFD0eEf qQ0AoN9cRiXwxXElMqisBX+AFe+bwHE4 =NLn3 -----END PGP SIGNATURE----- --8S1fMsFYqgBC+BN/-- From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 17:08:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83387106567B; Mon, 14 Mar 2011 17:08:30 +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 6E5178FC13; Mon, 14 Mar 2011 17:08: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 p2EH8UP2000789; Mon, 14 Mar 2011 17:08:30 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EH8Ut5000784; Mon, 14 Mar 2011 17:08:30 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201103141708.p2EH8Ut5000784@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 14 Mar 2011 17:08: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: r219642 - in stable/8: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 17:08:30 -0000 Author: jh Date: Mon Mar 14 17:08:30 2011 New Revision: 219642 URL: http://svn.freebsd.org/changeset/base/219642 Log: MFC r209710: Extend the kernel unit number allocator for allocating specific unit numbers. This change adds a new function alloc_unr_specific() which returns the requested unit number if it is free. If the number is already allocated or out of the range, -1 is returned. Update alloc_unr(9) manual page accordingly and add a MLINK for alloc_unr_specific(9). Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/alloc_unr.9 stable/8/sys/kern/subr_unit.c stable/8/sys/sys/systm.h Directory Properties: stable/8/share/man/man9/ (props changed) 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/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Mar 14 13:47:17 2011 (r219641) +++ stable/8/share/man/man9/Makefile Mon Mar 14 17:08:30 2011 (r219642) @@ -374,6 +374,7 @@ MAN= accept_filter.9 \ zone.9 MLINKS= alloc_unr.9 alloc_unrl.9 \ + alloc_unr.9 alloc_unr_specific.9 \ alloc_unr.9 delete_unrhdr.9 \ alloc_unr.9 free_unr.9 \ alloc_unr.9 new_unrhdr.9 Modified: stable/8/share/man/man9/alloc_unr.9 ============================================================================== --- stable/8/share/man/man9/alloc_unr.9 Mon Mar 14 13:47:17 2011 (r219641) +++ stable/8/share/man/man9/alloc_unr.9 Mon Mar 14 17:08:30 2011 (r219642) @@ -24,13 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2010 +.Dd July 5, 2010 .Dt ALLOC_UNR 9 .Os .Sh NAME .Nm new_unrhdr , .Nm delete_unrhdr , .Nm alloc_unr , +.Nm alloc_unr_specific , .Nm free_unr .Nd "kernel unit number allocator" .Sh SYNOPSIS @@ -43,6 +44,8 @@ .Fn alloc_unr "struct unrhdr *uh" .Ft int .Fn alloc_unrl "struct unrhdr *uh" +.Ft int +.Fn alloc_unr_specific "struct unrhdr *uh" "u_int item" .Ft void .Fn free_unr "struct unrhdr *uh" "u_int item" .Sh DESCRIPTION @@ -81,6 +84,13 @@ is returned. Same as .Fn alloc_unr except that mutex is assumed to be already locked and thus is not used. +.It Fn alloc_unr_specific uh item +Allocate a specific unit number. +This function allocates memory and thus may sleep. +The allocated unit number is returned on success. +If the specified number is already allocated or out of the range, +.Li \-1 +is returned. .It Fn free_unr uh item Free a previously allocated unit number. This function may require allocating memory, and thus it can sleep. Modified: stable/8/sys/kern/subr_unit.c ============================================================================== --- stable/8/sys/kern/subr_unit.c Mon Mar 14 13:47:17 2011 (r219641) +++ stable/8/sys/kern/subr_unit.c Mon Mar 14 17:08:30 2011 (r219642) @@ -628,6 +628,132 @@ alloc_unr(struct unrhdr *uh) return (i); } +static int +alloc_unr_specificl(struct unrhdr *uh, u_int item, void **p1, void **p2) +{ + struct unr *up, *upn; + struct unrb *ub; + u_int i, last, tl; + + mtx_assert(uh->mtx, MA_OWNED); + + if (item < uh->low + uh->first || item > uh->high) + return (-1); + + up = TAILQ_FIRST(&uh->head); + /* Ideal split. */ + if (up == NULL && item - uh->low == uh->first) { + uh->first++; + uh->last--; + uh->busy++; + check_unrhdr(uh, __LINE__); + return (item); + } + + i = item - uh->low - uh->first; + + if (up == NULL) { + up = new_unr(uh, p1, p2); + up->ptr = NULL; + up->len = i; + TAILQ_INSERT_TAIL(&uh->head, up, list); + up = new_unr(uh, p1, p2); + up->ptr = uh; + up->len = 1; + TAILQ_INSERT_TAIL(&uh->head, up, list); + uh->last = uh->high - uh->low - i; + uh->busy++; + check_unrhdr(uh, __LINE__); + return (item); + } else { + /* Find the item which contains the unit we want to allocate. */ + TAILQ_FOREACH(up, &uh->head, list) { + if (up->len > i) + break; + i -= up->len; + } + } + + if (up == NULL) { + if (i > 0) { + up = new_unr(uh, p1, p2); + up->ptr = NULL; + up->len = i; + TAILQ_INSERT_TAIL(&uh->head, up, list); + } + up = new_unr(uh, p1, p2); + up->ptr = uh; + up->len = 1; + TAILQ_INSERT_TAIL(&uh->head, up, list); + goto done; + } + + if (is_bitmap(uh, up)) { + ub = up->ptr; + if (bit_test(ub->map, i) == 0) { + bit_set(ub->map, i); + ub->busy++; + goto done; + } else + return (-1); + } else if (up->ptr == uh) + return (-1); + + KASSERT(up->ptr == NULL, + ("alloc_unr_specificl: up->ptr != NULL (up=%p)", up)); + + /* Split off the tail end, if any. */ + tl = up->len - (1 + i); + if (tl > 0) { + upn = new_unr(uh, p1, p2); + upn->ptr = NULL; + upn->len = tl; + TAILQ_INSERT_AFTER(&uh->head, up, upn, list); + } + + /* Split off head end, if any */ + if (i > 0) { + upn = new_unr(uh, p1, p2); + upn->len = i; + upn->ptr = NULL; + TAILQ_INSERT_BEFORE(up, upn, list); + } + up->len = 1; + up->ptr = uh; + +done: + last = uh->high - uh->low - (item - uh->low); + if (uh->last > last) + uh->last = last; + uh->busy++; + collapse_unr(uh, up); + check_unrhdr(uh, __LINE__); + return (item); +} + +int +alloc_unr_specific(struct unrhdr *uh, u_int item) +{ + void *p1, *p2; + int i; + + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "alloc_unr_specific"); + + p1 = Malloc(sizeof(struct unr)); + p2 = Malloc(sizeof(struct unr)); + + mtx_lock(uh->mtx); + i = alloc_unr_specificl(uh, item, &p1, &p2); + mtx_unlock(uh->mtx); + + if (p1 != NULL) + Free(p1); + if (p2 != NULL) + Free(p2); + + return (i); +} + /* * Free a unr. * @@ -810,6 +936,42 @@ print_unrhdr(struct unrhdr *uh) } } +static void +test_alloc_unr(struct unrhdr *uh, u_int i, char a[]) +{ + int j; + + if (a[i]) { + printf("F %u\n", i); + free_unr(uh, i); + a[i] = 0; + } else { + no_alloc = 1; + j = alloc_unr(uh); + if (j != -1) { + a[j] = 1; + printf("A %d\n", j); + } + no_alloc = 0; + } +} + +static void +test_alloc_unr_specific(struct unrhdr *uh, u_int i, char a[]) +{ + int j; + + j = alloc_unr_specific(uh, i); + if (j == -1) { + printf("F %u\n", i); + a[i] = 0; + free_unr(uh, i); + } else { + a[i] = 1; + printf("A %d\n", j); + } +} + /* Number of unrs to test */ #define NN 10000 @@ -825,6 +987,7 @@ main(int argc __unused, const char **arg print_unrhdr(uh); memset(a, 0, sizeof a); + srandomdev(); fprintf(stderr, "sizeof(struct unr) %zu\n", sizeof(struct unr)); fprintf(stderr, "sizeof(struct unrb) %zu\n", sizeof(struct unrb)); @@ -838,19 +1001,11 @@ main(int argc __unused, const char **arg if (a[i] && (j & 1)) continue; #endif - if (a[i]) { - printf("F %u\n", i); - free_unr(uh, i); - a[i] = 0; - } else { - no_alloc = 1; - i = alloc_unr(uh); - if (i != -1) { - a[i] = 1; - printf("A %u\n", i); - } - no_alloc = 0; - } + if ((random() & 1) != 0) + test_alloc_unr(uh, i, a); + else + test_alloc_unr_specific(uh, i, a); + if (1) /* XXX: change this for detailed debug printout */ print_unrhdr(uh); check_unrhdr(uh, __LINE__); Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Mon Mar 14 13:47:17 2011 (r219641) +++ stable/8/sys/sys/systm.h Mon Mar 14 17:08:30 2011 (r219642) @@ -360,6 +360,7 @@ void delete_unrhdr(struct unrhdr *uh); void clean_unrhdr(struct unrhdr *uh); void clean_unrhdrl(struct unrhdr *uh); int alloc_unr(struct unrhdr *uh); +int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 18:34:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD751065756; Mon, 14 Mar 2011 18:34:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0B18E8FC18; Mon, 14 Mar 2011 18:34:16 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 99E8746B8F; Mon, 14 Mar 2011 14:34:15 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 37BD18A01B; Mon, 14 Mar 2011 14:34:15 -0400 (EDT) From: John Baldwin To: Pawel Jakub Dawidek Date: Mon, 14 Mar 2011 14:29:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102271941.p1RJfePI000348@svn.freebsd.org> In-Reply-To: <201102271941.p1RJfePI000348@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201103141429.23954.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 14 Mar 2011 14:34:15 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219089 - in head: cddl/compat/opensolaris/include cddl/compat/opensolaris/misc cddl/contrib/opensolaris/cmd/stat cddl/contrib/opensolaris/cmd/stat/common cddl/contrib/opensolaris/cmd/z... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 18:34:16 -0000 On Sunday, February 27, 2011 2:41:40 pm Pawel Jakub Dawidek wrote: > Author: pjd > Date: Sun Feb 27 19:41:40 2011 > New Revision: 219089 > URL: http://svn.freebsd.org/changeset/base/219089 > > Log: > Finally... Import the latest open-source ZFS version - (SPA) 28. > > Few new things available from now on: > > - Data deduplication. > - Triple parity RAIDZ (RAIDZ3). > - zfs diff. > - zpool split. > - Snapshot holds. > - zpool import -F. Allows to rewind corrupted pool to earlier > transaction group. > - Possibility to import pool in read-only mode. > > MFC after: 1 month Did you test non-GPT booting? You updated BOOT2SIZE in its Makefile but ignored the comment: # We currently allow 32768 bytes for zfsboot - in practice it could be # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. # BOOT2SIZE= 65536 If you want to use a larger size, you have to change zfsldr.S as it has a hardcoded sector count that it loads off of disk: .set NSECT,0x40 ... main.5: mov %dx,MEM_ARG # Save args movb $NSECT,%dh # Sector count movl $1024,%eax # Offset to boot2 callw nread.1 # Read disk Since 0x40 * 512 = 32k, zfsldr.S is only going to load the first 32k of zfsboot into RAM. If you need to bump this size up, you need to update the comment and NSECT in zfsldr.S. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 19:38:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDA80106566B; Mon, 14 Mar 2011 19:38:24 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id DBF1F8FC0C; Mon, 14 Mar 2011 19:38:23 +0000 (UTC) Received: by wyf23 with SMTP id 23so5617729wyf.13 for ; Mon, 14 Mar 2011 12:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oAOGTfgRxJEHz6k7Z453DDdApBf0Arh++mWtav/G3Kk=; b=rhvt1EIq5zjwbAQjLTZ6aRHLlmHePDvGMuc3sR503lJMAo+NVGzOY4NiMhGPPqekJT hjvbXQ8PISLEBYtUP35/EnOPNNvLIyZP9cMBNw8/mmKU4B/7h7TlZxMdxYj/qsWnWSCk cMGBt7bRUlto3wfVQzoxlWQhkIBC0INHyJWxY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=m7ymhgeCVrd8hCYOZk1bSruw/SGcOpbKkFJtkyCxEFryav+uvO1FTcEYkJ8MIwfJG1 jRS/muLA+LvuIMSYWbou4PdlT+U0etaOfskMbUatV/R9FL9Pu7KetrrcdIDVBHtw2sdi yomT+twsBFelb4TGooJLVLLSTNZtYI/8u1tdw= MIME-Version: 1.0 Received: by 10.216.191.208 with SMTP id g58mr5328924wen.85.1300131502642; Mon, 14 Mar 2011 12:38:22 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.173.142 with HTTP; Mon, 14 Mar 2011 12:38:22 -0700 (PDT) In-Reply-To: <201101191704.p0JH47ZS082977@svn.freebsd.org> References: <201101191704.p0JH47ZS082977@svn.freebsd.org> Date: Mon, 14 Mar 2011 12:38:22 -0700 X-Google-Sender-Auth: wyi5vXghf1THEKxiy_WNbLjxtRI Message-ID: From: Garrett Cooper To: Matthew D Fleming Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217586 - in head: sbin/sysctl share/man/man9 sys/cam/scsi sys/dev/cxgb sys/dev/wi sys/net sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 19:38:24 -0000 On Wed, Jan 19, 2011 at 9:04 AM, Matthew D Fleming wrote: > Author: mdf > Date: Wed Jan 19 17:04:07 2011 > New Revision: 217586 > URL: http://svn.freebsd.org/changeset/base/217586 > > Log: > =A0sysctl(8) should use the CTLTYPE to determine the type of data when > =A0reading. =A0(This was already done for writing to a sysctl). =A0This > =A0requires all SYSCTL setups to specify a type. =A0Most of them are now > =A0checked at compile-time. > > =A0Remove SYSCTL_*X* sysctl additions as the print being in hex should be > =A0controlled by the -x flag to sysctl(8). I appreciate the work, but this really should have been followed up by a __FreeBSD_version__ bump, as this unfortunately broke some ports like emulators/*qemu*. I just filed a PR for it as I noticed it when doing portmaster -af for the recent X.org upgrade. FWIW, this can be properly tested with: __FreeBSD_version__ < 900031; kib bumped the version a week after this commit. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 22:05:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE092106566B; Mon, 14 Mar 2011 22:05:59 +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 AD2408FC12; Mon, 14 Mar 2011 22:05: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 p2EM5xet012666; Mon, 14 Mar 2011 22:05:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EM5x6E012664; Mon, 14 Mar 2011 22:05:59 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103142205.p2EM5x6E012664@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Mar 2011 22:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219646 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 22:05:59 -0000 Author: jkim Date: Mon Mar 14 22:05:59 2011 New Revision: 219646 URL: http://svn.freebsd.org/changeset/base/219646 Log: When TSC is unavailable, broken or disabled and the current timecounter has better quality than i8254 timer, use it for DELAY(9). Modified: head/sys/x86/isa/clock.c Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Mon Mar 14 19:31:43 2011 (r219645) +++ head/sys/x86/isa/clock.c Mon Mar 14 22:05:59 2011 (r219646) @@ -245,6 +245,42 @@ getit(void) return ((high << 8) | low); } +static __inline void +delay_tsc(int n) +{ + uint64_t start, end, now; + + sched_pin(); + start = rdtsc(); + end = start + (tsc_freq * n) / 1000000; + do { + cpu_spinwait(); + now = rdtsc(); + } while (now < end || (now > start && end < start)); + sched_unpin(); +} + +static __inline void +delay_timecounter(struct timecounter *tc, int n) +{ + uint64_t end, now; + u_int last, mask, u; + + mask = tc->tc_counter_mask; + last = tc->tc_get_timecount(tc) & mask; + end = tc->tc_frequency * n / 1000000; + now = 0; + do { + cpu_spinwait(); + u = tc->tc_get_timecount(tc) & mask; + if (u < last) + now += mask - last + u + 1; + else + now += u - last; + last = u; + } while (now < end); +} + /* * Wait "n" microseconds. * Relies on timer 1 counting down from (i8254_freq / hz) @@ -253,6 +289,7 @@ getit(void) void DELAY(int n) { + struct timecounter *tc; int delta, prev_tick, tick, ticks_left; #ifdef DELAYDEBUG @@ -262,16 +299,12 @@ DELAY(int n) #endif if (tsc_freq != 0) { - uint64_t start, end, now; - - sched_pin(); - start = rdtsc(); - end = start + (tsc_freq * n) / 1000000; - do { - cpu_spinwait(); - now = rdtsc(); - } while (now < end || (now > start && end < start)); - sched_unpin(); + delay_tsc(n); + return; + } + tc = timecounter; + if (tc->tc_quality > 0) { + delay_timecounter(tc, n); return; } #ifdef DELAYDEBUG From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 22:42:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDF55106564A; Mon, 14 Mar 2011 22:42:41 +0000 (UTC) (envelope-from davidch@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA4C08FC14; Mon, 14 Mar 2011 22:42:41 +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 p2EMgfm4013665; Mon, 14 Mar 2011 22:42:41 GMT (envelope-from davidch@svn.freebsd.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EMgfri013655; Mon, 14 Mar 2011 22:42:41 GMT (envelope-from davidch@svn.freebsd.org) Message-Id: <201103142242.p2EMgfri013655@svn.freebsd.org> From: David Christensen Date: Mon, 14 Mar 2011 22:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219647 - in head: . sys/amd64/conf sys/boot/forth sys/conf sys/dev/bxe sys/i386/conf sys/modules/bxe usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 22:42:42 -0000 Author: davidch Date: Mon Mar 14 22:42:41 2011 New Revision: 219647 URL: http://svn.freebsd.org/changeset/base/219647 Log: - Initial release of bxe(4) to support Broadcom NetXtreme II 10GbE. (BCM57710, BCM57711, BCM57711E) MFC after: One month Added: head/sys/dev/bxe/ head/sys/dev/bxe/bxe_debug.h (contents, props changed) head/sys/dev/bxe/bxe_fw_defs.h (contents, props changed) head/sys/dev/bxe/bxe_hsi.h (contents, props changed) head/sys/dev/bxe/bxe_include.h (contents, props changed) head/sys/dev/bxe/bxe_init.h (contents, props changed) head/sys/dev/bxe/bxe_init_values_e1.h (contents, props changed) head/sys/dev/bxe/bxe_init_values_e1h.h (contents, props changed) head/sys/dev/bxe/bxe_link.c (contents, props changed) head/sys/dev/bxe/bxe_link.h (contents, props changed) head/sys/dev/bxe/bxe_reg.h (contents, props changed) head/sys/dev/bxe/bxe_self_test.h (contents, props changed) head/sys/dev/bxe/dump_e1.h (contents, props changed) head/sys/dev/bxe/dump_e1h.h (contents, props changed) head/sys/dev/bxe/hw_dump_reg_st.h (contents, props changed) head/sys/dev/bxe/if_bxe.c (contents, props changed) head/sys/dev/bxe/if_bxe.h (contents, props changed) head/sys/modules/bxe/ head/sys/modules/bxe/Makefile (contents, props changed) Modified: head/MAINTAINERS head/sys/amd64/conf/GENERIC head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/i386/conf/GENERIC head/usr.sbin/sysinstall/devices.c Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Mar 14 22:05:59 2011 (r219646) +++ head/MAINTAINERS Mon Mar 14 22:42:41 2011 (r219647) @@ -47,6 +47,7 @@ cd(4) ken Pre-commit review requested. pass(4) ken Pre-commit review requested. ch(4) ken Pre-commit review requested. em(4) jfv Pre-commit review requested. +bxe(4) davidch Pre-commit review requested. tdfx(4) cokane Just keep me informed of changes, try not to break it. sendmail gshapiro Pre-commit review requested. etc/mail gshapiro Pre-commit review requested. Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Mar 14 22:05:59 2011 (r219646) +++ head/sys/amd64/conf/GENERIC Mon Mar 14 22:42:41 2011 (r219647) @@ -193,6 +193,7 @@ device ppi # Parallel port interface d #device puc # PCI Ethernet NICs. +device bxe # Broadcom BCM57710/BCM57711/BCM57711E 10Gb Ethernet device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel PRO/1000 Gigabit Ethernet Family device igb # Intel PRO/1000 PCIE Server Gigabit Family Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Mon Mar 14 22:05:59 2011 (r219646) +++ head/sys/boot/forth/loader.conf Mon Mar 14 22:42:41 2011 (r219647) @@ -268,6 +268,7 @@ if_bge_load="NO" # Broadcom BCM570x PCI if_bridge_load="NO" # if_bridge(4) devices if_bwi_load="NO" # Broadcom BCM53xx IEEE 802.11b/g wireness NICs if_bwn_load="NO" # Broadcom BCM43xx IEEE 802.11 wireless NICs +if_bxe_load="NO" # Broadcom NetXtreme II 10Gb Ethernet if_carp_load="NO" # carp(4) devices if_cas_load="NO" # Sun Cassini/Cassini+ and NS DP83065 Saturn if_cm_load="NO" # SMC (90c26, 90c56, 90c66) Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Mar 14 22:05:59 2011 (r219646) +++ head/sys/conf/NOTES Mon Mar 14 22:42:41 2011 (r219647) @@ -1900,6 +1900,8 @@ device xmphy # XaQti XMAC II # BCM570x family of controllers, including the 3Com 3c996-T, # the Netgear GA302T, the SysKonnect SK-9D21 and SK-9D41, and # the embedded gigE NICs on Dell PowerEdge 2550 servers. +# bxe: Broadcom NetXtreme II (BCM57710/57711/57711E) PCIe 10b Ethernet +# adapters. # bwi: Broadcom BCM430* and BCM431* family of wireless adapters. # bwn: Broadcom BCM43xx family of wireless adapters. # cas: Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn @@ -2078,6 +2080,7 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. +device bxe # Broadcom BCM57710/BCM57711/BCM57711E 10Gb Ethernet device cxgbe # Chelsio T4 10GbE PCIe adapter device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Mar 14 22:05:59 2011 (r219646) +++ head/sys/conf/files Mon Mar 14 22:42:41 2011 (r219647) @@ -819,6 +819,8 @@ dev/bwi/bwirf.c optional bwi dev/bwi/if_bwi.c optional bwi dev/bwi/if_bwi_pci.c optional bwi pci dev/bwn/if_bwn.c optional bwn siba_bwn +dev/bxe/if_bxe.c optional bxe +dev/bxe/bxe_link.c optional bxe dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Mar 14 22:05:59 2011 (r219646) +++ head/sys/conf/options Mon Mar 14 22:42:41 2011 (r219647) @@ -702,8 +702,13 @@ ED_SIC opt_ed.h BCE_DEBUG opt_bce.h BCE_NVRAM_WRITE_SUPPORT opt_bce.h +# bxe driver +BXE_DEBUG opt_bxe.h +BXE_NVRAM_WRITE_SUPPORT opt_bxe.h + SOCKBUF_DEBUG opt_global.h + # options for ubsec driver UBSEC_DEBUG opt_ubsec.h UBSEC_RNDTEST opt_ubsec.h Added: head/sys/dev/bxe/bxe_debug.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bxe/bxe_debug.h Mon Mar 14 22:42:41 2011 (r219647) @@ -0,0 +1,357 @@ +/*- + * Copyright (c) 2007-2011 Broadcom Corporation. All rights reserved. + * + * Gary Zambrano + * David Christensen + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Broadcom Corporation nor the name of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written consent. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + + /*$FreeBSD$*/ + +#ifndef _BXE_DEBUG_H +#define _BXE_DEBUG_H + +extern uint32_t bxe_debug; + +/* + * Debugging macros and definitions. + */ + +#define BXE_CP_LOAD 0x00000001 +#define BXE_CP_SEND 0x00000002 +#define BXE_CP_RECV 0x00000004 +#define BXE_CP_INTR 0x00000008 +#define BXE_CP_UNLOAD 0x00000010 +#define BXE_CP_RESET 0x00000020 +#define BXE_CP_IOCTL 0x00000040 +#define BXE_CP_STATS 0x00000080 +#define BXE_CP_MISC 0x00000100 +#define BXE_CP_PHY 0x00000200 +#define BXE_CP_RAMROD 0x00000400 +#define BXE_CP_NVRAM 0x00000800 +#define BXE_CP_REGS 0x00001000 +#define BXE_CP_ALL 0x00FFFFFF +#define BXE_CP_MASK 0x00FFFFFF + +#define BXE_LEVEL_FATAL 0x00000000 +#define BXE_LEVEL_WARN 0x01000000 +#define BXE_LEVEL_INFO 0x02000000 +#define BXE_LEVEL_VERBOSE 0x03000000 +#define BXE_LEVEL_EXTREME 0x04000000 +#define BXE_LEVEL_INSANE 0x05000000 + +#define BXE_LEVEL_MASK 0xFF000000 + +#define BXE_WARN_LOAD (BXE_CP_LOAD | BXE_LEVEL_WARN) +#define BXE_INFO_LOAD (BXE_CP_LOAD | BXE_LEVEL_INFO) +#define BXE_VERBOSE_LOAD (BXE_CP_LOAD | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_LOAD (BXE_CP_LOAD | BXE_LEVEL_EXTREME) +#define BXE_INSANE_LOAD (BXE_CP_LOAD | BXE_LEVEL_INSANE) + +#define BXE_WARN_SEND (BXE_CP_SEND | BXE_LEVEL_WARN) +#define BXE_INFO_SEND (BXE_CP_SEND | BXE_LEVEL_INFO) +#define BXE_VERBOSE_SEND (BXE_CP_SEND | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_SEND (BXE_CP_SEND | BXE_LEVEL_EXTREME) +#define BXE_INSANE_SEND (BXE_CP_SEND | BXE_LEVEL_INSANE) + +#define BXE_WARN_RECV (BXE_CP_RECV | BXE_LEVEL_WARN) +#define BXE_INFO_RECV (BXE_CP_RECV | BXE_LEVEL_INFO) +#define BXE_VERBOSE_RECV (BXE_CP_RECV | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_RECV (BXE_CP_RECV | BXE_LEVEL_EXTREME) +#define BXE_INSANE_RECV (BXE_CP_RECV | BXE_LEVEL_INSANE) + +#define BXE_WARN_INTR (BXE_CP_INTR | BXE_LEVEL_WARN) +#define BXE_INFO_INTR (BXE_CP_INTR | BXE_LEVEL_INFO) +#define BXE_VERBOSE_INTR (BXE_CP_INTR | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_INTR (BXE_CP_INTR | BXE_LEVEL_EXTREME) +#define BXE_INSANE_INTR (BXE_CP_INTR | BXE_LEVEL_INSANE) + +#define BXE_WARN_UNLOAD (BXE_CP_UNLOAD | BXE_LEVEL_WARN) +#define BXE_INFO_UNLOAD (BXE_CP_UNLOAD | BXE_LEVEL_INFO) +#define BXE_VERBOSE_UNLOAD (BXE_CP_UNLOAD | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_UNLOAD (BXE_CP_UNLOAD | BXE_LEVEL_EXTREME) +#define BXE_INSANE_UNLOAD (BXE_CP_UNLOAD | BXE_LEVEL_INSANE) + +#define BXE_WARN_RESET (BXE_CP_RESET | BXE_LEVEL_WARN) +#define BXE_INFO_RESET (BXE_CP_RESET | BXE_LEVEL_INFO) +#define BXE_VERBOSE_RESET (BXE_CP_RESET | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_RESET (BXE_CP_RESET | BXE_LEVEL_EXTREME) +#define BXE_INSANE_RESET (BXE_CP_RESET | BXE_LEVEL_INSANE) + +#define BXE_WARN_IOCTL (BXE_CP_IOCTL | BXE_LEVEL_WARN) +#define BXE_INFO_IOCTL (BXE_CP_IOCTL | BXE_LEVEL_INFO) +#define BXE_VERBOSE_IOCTL (BXE_CP_IOCTL | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_IOCTL (BXE_CP_IOCTL | BXE_LEVEL_EXTREME) +#define BXE_INSANE_IOCTL (BXE_CP_IOCTL | BXE_LEVEL_INSANE) + +#define BXE_WARN_STATS (BXE_CP_STATS | BXE_LEVEL_WARN) +#define BXE_INFO_STATS (BXE_CP_STATS | BXE_LEVEL_INFO) +#define BXE_VERBOSE_STATS (BXE_CP_STATS | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_STATS (BXE_CP_STATS | BXE_LEVEL_EXTREME) +#define BXE_INSANE_STATS (BXE_CP_STATS | BXE_LEVEL_INSANE) + +#define BXE_WARN_MISC (BXE_CP_MISC | BXE_LEVEL_WARN) +#define BXE_INFO_MISC (BXE_CP_MISC | BXE_LEVEL_INFO) +#define BXE_VERBOSE_MISC (BXE_CP_MISC | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_MISC (BXE_CP_MISC | BXE_LEVEL_EXTREME) +#define BXE_INSANE_MISC (BXE_CP_MISC | BXE_LEVEL_INSANE) + +#define BXE_WARN_PHY (BXE_CP_PHY | BXE_LEVEL_WARN) +#define BXE_INFO_PHY (BXE_CP_PHY | BXE_LEVEL_INFO) +#define BXE_VERBOSE_PHY (BXE_CP_PHY | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_PHY (BXE_CP_PHY | BXE_LEVEL_EXTREME) +#define BXE_INSANE_PHY (BXE_CP_PHY | BXE_LEVEL_INSANE) + +#define BXE_WARN_RAMROD (BXE_CP_RAMROD | BXE_LEVEL_WARN) +#define BXE_INFO_RAMROD (BXE_CP_RAMROD | BXE_LEVEL_INFO) +#define BXE_VERBOSE_RAMROD (BXE_CP_RAMROD | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_RAMROD (BXE_CP_RAMROD | BXE_LEVEL_EXTREME) +#define BXE_INSANE_RAMROD (BXE_CP_RAMROD | BXE_LEVEL_INSANE) + +#define BXE_WARN_NVRAM (BXE_CP_NVRAM | BXE_LEVEL_WARN) +#define BXE_INFO_NVRAM (BXE_CP_NVRAM | BXE_LEVEL_INFO) +#define BXE_VERBOSE_NVRAM (BXE_CP_NVRAM | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_NVRAM (BXE_CP_NVRAM | BXE_LEVEL_EXTREME) +#define BXE_INSANE_NVRAM (BXE_CP_NVRAM | BXE_LEVEL_INSANE) + +#define BXE_WARN_REGS (BXE_CP_REGS | BXE_LEVEL_WARN) +#define BXE_INFO_REGS (BXE_CP_REGS | BXE_LEVEL_INFO) +#define BXE_VERBOSE_REGS (BXE_CP_REGS | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME_REGS (BXE_CP_REGS | BXE_LEVEL_EXTREME) +#define BXE_INSANE_REGS (BXE_CP_REGS | BXE_LEVEL_INSANE) + +#define BXE_FATAL (BXE_CP_ALL | BXE_LEVEL_FATAL) +#define BXE_WARN (BXE_CP_ALL | BXE_LEVEL_WARN) +#define BXE_INFO (BXE_CP_ALL | BXE_LEVEL_INFO) +#define BXE_VERBOSE (BXE_CP_ALL | BXE_LEVEL_VERBOSE) +#define BXE_EXTREME (BXE_CP_ALL | BXE_LEVEL_EXTREME) +#define BXE_INSANE (BXE_CP_ALL | BXE_LEVEL_INSANE) + +#define BXE_CODE_PATH(cp) ((cp & BXE_CP_MASK) & bxe_debug) +#define BXE_MSG_LEVEL(lv) ((lv & BXE_LEVEL_MASK) <= (bxe_debug & BXE_LEVEL_MASK)) +#define BXE_LOG_MSG(m) (BXE_CODE_PATH(m) && BXE_MSG_LEVEL(m)) + + +#ifdef BXE_DEBUG + +/* Print a message based on the logging level and code path. */ +#define DBPRINT(sc, level, format, args...) \ + do { \ + if (BXE_LOG_MSG(level)) { \ + device_printf(sc->bxe_dev, format, ## args); \ + } \ + } while (0) + +/* Runs a particular command when debugging is enabled. */ +#define DBRUN(args...) \ + do { \ + args; \ + } while (0) + +/* Runs a particular command based on the logging level. */ +#define DBRUNLV(level, args...) \ + if (BXE_MSG_LEVEL(level)) { \ + args; \ + } + +/* Runs a particular command based on the code path. */ +#define DBRUNCP(cp, args...) \ + if (BXE_CODE_PATH(cp)) { \ + args; \ + } + +/* Runs a particular command based on a condition. */ +#define DBRUNIF(cond, args...) \ + if (cond) { \ + args; \ + } + +/* Runs a particular command based on the logging level and code path. */ +#define DBRUNMSG(msg, args...) \ + if (BXE_LOG_MSG(msg)) { \ + args; \ + } + +/* Announces function entry. */ +#define DBENTER(cond) \ + DBPRINT(sc, (cond), "%s(enter:%d)\n", __FUNCTION__, curcpu) \ + +/* Announces function exit. */ +#define DBEXIT(cond) \ + DBPRINT(sc, (cond), "%s(exit:%d)\n", __FUNCTION__, curcpu) \ + +/* Needed for random() function which is only used in debugging. */ +#include + +/* Returns FALSE in "defects" per 2^31 - 1 calls, otherwise returns TRUE. */ +#define DB_RANDOMFALSE(defects) (random() > defects) +#define DB_OR_RANDOMFALSE(defects) || (random() > defects) +#define DB_AND_RANDOMFALSE(defects) && (random() > ddfects) + +/* Returns TRUE in "defects" per 2^31 - 1 calls, otherwise returns FALSE. */ +#define DB_RANDOMTRUE(defects) (random() < defects) +#define DB_OR_RANDOMTRUE(defects) || (random() < defects) +#define DB_AND_RANDOMTRUE(defects) && (random() < defects) + +#else + +#define DBPRINT(...) +#define DBRUN(...) +#define DBRUNLV(...) +#define DBRUNCP(...) +#define DBRUNIF(...) +#define DBRUNMSG(...) +#define DBENTER(...) +#define DBENTER_UNLOCKED(...) +#define DBEXIT(...) +#define DBEXIT_UNLOCKED(...) +#define DB_RANDOMFALSE(...) +#define DB_OR_RANDOMFALSE(...) +#define DB_AND_RANDOMFALSE(...) +#define DB_RANDOMTRUE(...) +#define DB_OR_RANDOMTRUE(...) +#define DB_AND_RANDOMTRUE(...) + +#endif /* BXE_DEBUG */ + +/* Generic bit decoding for printf("%b"). */ +#define BXE_DWORD_PRINTFB \ + "\020" \ + "\40b31" \ + "\37b30" \ + "\36b29" \ + "\35b28" \ + "\34b27" \ + "\33b26" \ + "\32b25" \ + "\31b24" \ + "\30b23" \ + "\27b22" \ + "\26b21" \ + "\25b20" \ + "\24b19" \ + "\23b18" \ + "\22b17" \ + "\21b16" \ + "\20b15" \ + "\17b14" \ + "\16b13" \ + "\15b12" \ + "\14b11" \ + "\13b10" \ + "\12b9" \ + "\11b8" \ + "\10b7" \ + "\07b6" \ + "\06b5" \ + "\05b4" \ + "\04b3" \ + "\03b2" \ + "\02b1" \ + "\01b0" + +/* Supported link settings bit decoding for printf("%b"). */ +#define BXE_SUPPORTED_PRINTFB \ + "\020" \ + "\040b31" \ + "\037b30" \ + "\036b29" \ + "\035b28" \ + "\034b27" \ + "\033b26" \ + "\032b25" \ + "\031b24" \ + "\030b23" \ + "\027b22" \ + "\026b21" \ + "\025b20" \ + "\024b19" \ + "\023b18" \ + "\022b17" \ + "\02110000BaseT-Full" \ + "\0202500BaseX-Full" \ + "\017b14" \ + "\016b13" \ + "\015b12" \ + "\014Pause" \ + "\013Asym-Pause" \ + "\012Autoneg" \ + "\011Fiber" \ + "\010TP" \ + "\0071000BaseT-Full" \ + "\0061000BaseT-Half" \ + "\005100BaseTX-Full" \ + "\004100BaseTX-Half" \ + "\00310BaseT-Full" \ + "\00210BaseT-Half" \ + "\001b0" + +/* Transmit BD TCP flags bit decoding for printf("%b"). */ +#define BXE_ETH_TX_PARSE_BD_TCP_FLAGS_PRINTFB \ + "\020" \ + "\10CWR" \ + "\07ECE" \ + "\06URG" \ + "\05ACK" \ + "\04PSH" \ + "\03RST" \ + "\02SYN" \ + "\01FIN" + +/* Parsing BD global data bit decoding for printf("%b"). */ +#define BXE_ETH_TX_PARSE_BD_GLOBAL_DATA_PRINTFB \ + "\020" \ + "\10NS" \ + "\07LLC_SNAP" \ + "\06PSEUDO_CS_WO_LEN" \ + "\05CS_ANY" + +/* Transmit BD flags bit decoding for printf("%b"). */ +#define BXE_ETH_TX_BD_FLAGS_PRINTFB \ + "\020" \ + "\10IPv6" \ + "\07LSO" \ + "\06HDR_POOL" \ + "\05START" \ + "\04END" \ + "\03TCP_CSUM" \ + "\02IP_CSUM" \ + "\01VLAN" + +/* Receive CQE error flags bit decoding for printf("%b"). */ +#define BXE_ETH_FAST_PATH_RX_CQE_ERROR_FLAGS_PRINTFB \ + "\020" \ + "\10RSRVD" \ + "\07RSRVD" \ + "\06END_FLAG" \ + "\05START_FLAG" \ + "\04L4_BAD_XSUM" \ + "\03IP_BAD_XSUM" \ + "\02PHY_DECODE_ERR" \ + "\01SP" + +#endif /* _BXE_DEBUG_H */ Added: head/sys/dev/bxe/bxe_fw_defs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bxe/bxe_fw_defs.h Mon Mar 14 22:42:41 2011 (r219647) @@ -0,0 +1,624 @@ +/*- + * Copyright (c) 2007-2011 Broadcom Corporation. All rights reserved. + * + * Gary Zambrano + * David Christensen + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Broadcom Corporation nor the name of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written consent. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + + /*$FreeBSD$*/ + +#ifndef _BXE_FW_DEFS_H +#define _BXE_FW_DEFS_H + +#define CSTORM_ASSERT_LIST_INDEX_OFFSET \ + (IS_E1H_OFFSET ? 0x7000 : 0x1000) +#define CSTORM_ASSERT_LIST_OFFSET(idx) \ + (IS_E1H_OFFSET ? (0x7020 + (idx * 0x10)) : (0x1020 + (idx * 0x10))) +#define CSTORM_DEF_SB_HC_DISABLE_C_OFFSET(function, index) \ + (IS_E1H_OFFSET ? (0x8622 + ((function>>1) * 0x40) + \ + ((function&1) * 0x100) + (index * 0x4)) : (0x3562 + (function * \ + 0x40) + (index * 0x4))) +#define CSTORM_DEF_SB_HC_DISABLE_U_OFFSET(function, index) \ + (IS_E1H_OFFSET ? (0x8822 + ((function>>1) * 0x80) + \ + ((function&1) * 0x200) + (index * 0x4)) : (0x35e2 + (function * \ + 0x80) + (index * 0x4))) +#define CSTORM_DEF_SB_HOST_SB_ADDR_C_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8600 + ((function>>1) * 0x40) + \ + ((function&1) * 0x100)) : (0x3540 + (function * 0x40))) +#define CSTORM_DEF_SB_HOST_SB_ADDR_U_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8800 + ((function>>1) * 0x80) + \ + ((function&1) * 0x200)) : (0x35c0 + (function * 0x80))) +#define CSTORM_DEF_SB_HOST_STATUS_BLOCK_C_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8608 + ((function>>1) * 0x40) + \ + ((function&1) * 0x100)) : (0x3548 + (function * 0x40))) +#define CSTORM_DEF_SB_HOST_STATUS_BLOCK_U_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8808 + ((function>>1) * 0x80) + \ + ((function&1) * 0x200)) : (0x35c8 + (function * 0x80))) +#define CSTORM_FUNCTION_MODE_OFFSET \ + (IS_E1H_OFFSET ? 0x11e8 : 0xffffffff) +#define CSTORM_HC_BTR_C_OFFSET(port) \ + (IS_E1H_OFFSET ? (0x8c04 + (port * 0xf0)) : (0x36c4 + (port * 0xc0))) +#define CSTORM_HC_BTR_U_OFFSET(port) \ + (IS_E1H_OFFSET ? (0x8de4 + (port * 0xf0)) : (0x3844 + (port * 0xc0))) +#define CSTORM_ISCSI_CQ_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6680 + (function * 0x8)) : (0x25a0 + \ + (function * 0x8))) +#define CSTORM_ISCSI_CQ_SQN_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x66c0 + (function * 0x8)) : (0x25b0 + \ + (function * 0x8))) +#define CSTORM_ISCSI_EQ_CONS_OFFSET(function, eqIdx) \ + (IS_E1H_OFFSET ? (0x6040 + (function * 0xc0) + (eqIdx * 0x18)) : \ + (0x2410 + (function * 0xc0) + (eqIdx * 0x18))) +#define CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(function, eqIdx) \ + (IS_E1H_OFFSET ? (0x6044 + (function * 0xc0) + (eqIdx * 0x18)) : \ + (0x2414 + (function * 0xc0) + (eqIdx * 0x18))) +#define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(function, eqIdx) \ + (IS_E1H_OFFSET ? (0x604c + (function * 0xc0) + (eqIdx * 0x18)) : \ + (0x241c + (function * 0xc0) + (eqIdx * 0x18))) +#define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_VALID_OFFSET(function, eqIdx) \ + (IS_E1H_OFFSET ? (0x6057 + (function * 0xc0) + (eqIdx * 0x18)) : \ + (0x2427 + (function * 0xc0) + (eqIdx * 0x18))) +#define CSTORM_ISCSI_EQ_PROD_OFFSET(function, eqIdx) \ + (IS_E1H_OFFSET ? (0x6042 + (function * 0xc0) + (eqIdx * 0x18)) : \ + (0x2412 + (function * 0xc0) + (eqIdx * 0x18))) +#define CSTORM_ISCSI_EQ_SB_INDEX_OFFSET(function, eqIdx) \ + (IS_E1H_OFFSET ? (0x6056 + (function * 0xc0) + (eqIdx * 0x18)) : \ + (0x2426 + (function * 0xc0) + (eqIdx * 0x18))) +#define CSTORM_ISCSI_EQ_SB_NUM_OFFSET(function, eqIdx) \ + (IS_E1H_OFFSET ? (0x6054 + (function * 0xc0) + (eqIdx * 0x18)) : \ + (0x2424 + (function * 0xc0) + (eqIdx * 0x18))) +#define CSTORM_ISCSI_HQ_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6640 + (function * 0x8)) : (0x2590 + \ + (function * 0x8))) +#define CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6004 + (function * 0x8)) : (0x2404 + \ + (function * 0x8))) +#define CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6002 + (function * 0x8)) : (0x2402 + \ + (function * 0x8))) +#define CSTORM_ISCSI_PAGE_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6000 + (function * 0x8)) : (0x2400 + \ + (function * 0x8))) +#define CSTORM_SB_HC_DISABLE_C_OFFSET(port, cpu_id, index) \ + (IS_E1H_OFFSET ? (0x811a + (port * 0x280) + (cpu_id * 0x28) + \ + (index * 0x4)) : (0x305a + (port * 0x280) + (cpu_id * 0x28) + \ + (index * 0x4))) +#define CSTORM_SB_HC_DISABLE_U_OFFSET(port, cpu_id, index) \ + (IS_E1H_OFFSET ? (0xb01a + (port * 0x800) + (cpu_id * 0x80) + \ + (index * 0x4)) : (0x401a + (port * 0x800) + (cpu_id * 0x80) + \ + (index * 0x4))) +#define CSTORM_SB_HC_TIMEOUT_C_OFFSET(port, cpu_id, index) \ + (IS_E1H_OFFSET ? (0x8118 + (port * 0x280) + (cpu_id * 0x28) + \ + (index * 0x4)) : (0x3058 + (port * 0x280) + (cpu_id * 0x28) + \ + (index * 0x4))) +#define CSTORM_SB_HC_TIMEOUT_U_OFFSET(port, cpu_id, index) \ + (IS_E1H_OFFSET ? (0xb018 + (port * 0x800) + (cpu_id * 0x80) + \ + (index * 0x4)) : (0x4018 + (port * 0x800) + (cpu_id * 0x80) + \ + (index * 0x4))) +#define CSTORM_SB_HOST_SB_ADDR_C_OFFSET(port, cpu_id) \ + (IS_E1H_OFFSET ? (0x8100 + (port * 0x280) + (cpu_id * 0x28)) : \ + (0x3040 + (port * 0x280) + (cpu_id * 0x28))) +#define CSTORM_SB_HOST_SB_ADDR_U_OFFSET(port, cpu_id) \ + (IS_E1H_OFFSET ? (0xb000 + (port * 0x800) + (cpu_id * 0x80)) : \ + (0x4000 + (port * 0x800) + (cpu_id * 0x80))) +#define CSTORM_SB_HOST_STATUS_BLOCK_C_OFFSET(port, cpu_id) \ + (IS_E1H_OFFSET ? (0x8108 + (port * 0x280) + (cpu_id * 0x28)) : \ + (0x3048 + (port * 0x280) + (cpu_id * 0x28))) +#define CSTORM_SB_HOST_STATUS_BLOCK_U_OFFSET(port, cpu_id) \ + (IS_E1H_OFFSET ? (0xb008 + (port * 0x800) + (cpu_id * 0x80)) : \ + (0x4008 + (port * 0x800) + (cpu_id * 0x80))) +#define CSTORM_SB_STATUS_BLOCK_C_SIZE 0x10 +#define CSTORM_SB_STATUS_BLOCK_U_SIZE 0x60 +#define CSTORM_STATS_FLAGS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x1108 + (function * 0x8)) : (0x5108 + \ + (function * 0x8))) +#define TSTORM_APPROXIMATE_MATCH_MULTICAST_FILTERING_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x3200 + (function * 0x20)) : 0xffffffff) +#define TSTORM_ASSERT_LIST_INDEX_OFFSET \ + (IS_E1H_OFFSET ? 0xa000 : 0x1000) +#define TSTORM_ASSERT_LIST_OFFSET(idx) \ + (IS_E1H_OFFSET ? (0xa020 + (idx * 0x10)) : (0x1020 + (idx * 0x10))) +#define TSTORM_CLIENT_CONFIG_OFFSET(port, client_id) \ + (IS_E1H_OFFSET ? (0x33a0 + (port * 0x1a0) + (client_id * 0x10)) \ + : (0x9c0 + (port * 0x120) + (client_id * 0x10))) +#define TSTORM_COMMON_SAFC_WORKAROUND_ENABLE_OFFSET \ + (IS_E1H_OFFSET ? 0x1ed8 : 0xffffffff) +#define TSTORM_COMMON_SAFC_WORKAROUND_TIMEOUT_10USEC_OFFSET \ + (IS_E1H_OFFSET ? 0x1eda : 0xffffffff) +#define TSTORM_DEF_SB_HC_DISABLE_OFFSET(function, index) \ + (IS_E1H_OFFSET ? (0xb01a + ((function>>1) * 0x28) + \ + ((function&1) * 0xa0) + (index * 0x4)) : (0x141a + (function * \ + 0x28) + (index * 0x4))) +#define TSTORM_DEF_SB_HOST_SB_ADDR_OFFSET(function) \ + (IS_E1H_OFFSET ? (0xb000 + ((function>>1) * 0x28) + \ + ((function&1) * 0xa0)) : (0x1400 + (function * 0x28))) +#define TSTORM_DEF_SB_HOST_STATUS_BLOCK_OFFSET(function) \ + (IS_E1H_OFFSET ? (0xb008 + ((function>>1) * 0x28) + \ + ((function&1) * 0xa0)) : (0x1408 + (function * 0x28))) +#define TSTORM_ETH_STATS_QUERY_ADDR_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x2940 + (function * 0x8)) : (0x4928 + \ + (function * 0x8))) +#define TSTORM_FUNCTION_COMMON_CONFIG_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x3000 + (function * 0x40)) : (0x1500 + \ + (function * 0x40))) +#define TSTORM_FUNCTION_MODE_OFFSET \ + (IS_E1H_OFFSET ? 0x1ed0 : 0xffffffff) +#define TSTORM_HC_BTR_OFFSET(port) \ + (IS_E1H_OFFSET ? (0xb144 + (port * 0x30)) : (0x1454 + (port * 0x18))) +#define TSTORM_INDIRECTION_TABLE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x12c8 + (function * 0x80)) : (0x22c8 + \ + (function * 0x80))) +#define TSTORM_INDIRECTION_TABLE_SIZE 0x80 +#define TSTORM_ISCSI_CONN_BUF_PBL_OFFSET(function, pblEntry) \ + (IS_E1H_OFFSET ? (0x60c0 + (function * 0x40) + (pblEntry * 0x8)) \ + : (0x4c30 + (function * 0x40) + (pblEntry * 0x8))) +#define TSTORM_ISCSI_ERROR_BITMAP_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6340 + (function * 0x8)) : (0x4cd0 + \ + (function * 0x8))) +#define TSTORM_ISCSI_NUM_OF_TASKS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6004 + (function * 0x8)) : (0x4c04 + \ + (function * 0x8))) +#define TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6002 + (function * 0x8)) : (0x4c02 + \ + (function * 0x8))) +#define TSTORM_ISCSI_PAGE_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6000 + (function * 0x8)) : (0x4c00 + \ + (function * 0x8))) +#define TSTORM_ISCSI_RQ_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6080 + (function * 0x8)) : (0x4c20 + \ + (function * 0x8))) +#define TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6040 + (function * 0x8)) : (0x4c10 + \ + (function * 0x8))) +#define TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6042 + (function * 0x8)) : (0x4c12 + \ + (function * 0x8))) +#define TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x6044 + (function * 0x8)) : (0x4c14 + \ + (function * 0x8))) +#define TSTORM_MAC_FILTER_CONFIG_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x3008 + (function * 0x40)) : (0x1508 + \ + (function * 0x40))) +#define TSTORM_PER_COUNTER_ID_STATS_OFFSET(port, stats_counter_id) \ + (IS_E1H_OFFSET ? (0x2010 + (port * 0x490) + (stats_counter_id * \ + 0x40)) : (0x4010 + (port * 0x490) + (stats_counter_id * 0x40))) +#define TSTORM_STATS_FLAGS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x29c0 + (function * 0x8)) : (0x4948 + \ + (function * 0x8))) +#define TSTORM_TCP_MAX_CWND_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x4004 + (function * 0x8)) : (0x1fb4 + \ + (function * 0x8))) +#define USTORM_AGG_DATA_OFFSET (IS_E1H_OFFSET ? 0xa000 : 0x3000) +#define USTORM_AGG_DATA_SIZE (IS_E1H_OFFSET ? 0x2000 : 0x1000) +#define USTORM_ASSERT_LIST_INDEX_OFFSET \ + (IS_E1H_OFFSET ? 0x8000 : 0x1000) +#define USTORM_ASSERT_LIST_OFFSET(idx) \ + (IS_E1H_OFFSET ? (0x8020 + (idx * 0x10)) : (0x1020 + (idx * 0x10))) +#define USTORM_CQE_PAGE_BASE_OFFSET(port, clientId) \ + (IS_E1H_OFFSET ? (0x1010 + (port * 0x680) + (clientId * 0x40)) : \ + (0x4010 + (port * 0x360) + (clientId * 0x30))) + +#define USTORM_CQE_PAGE_NEXT_OFFSET(port, clientId) \ + (IS_E1H_OFFSET ? (0x1028 + (port * 0x680) + (clientId * 0x40)) : \ + (0x4028 + (port * 0x360) + (clientId * 0x30))) + +#define USTORM_ETH_PAUSE_ENABLED_OFFSET(port) \ + (IS_E1H_OFFSET ? (0x2ad4 + (port * 0x8)) : 0xffffffff) +#define USTORM_ETH_RING_PAUSE_DATA_OFFSET(port, clientId) \ + (IS_E1H_OFFSET ? (0x1030 + (port * 0x680) + (clientId * 0x40)) : \ + 0xffffffff) +#define USTORM_ETH_STATS_QUERY_ADDR_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x2a50 + (function * 0x8)) : (0x1dd0 + \ + (function * 0x8))) +#define USTORM_FUNCTION_MODE_OFFSET \ + (IS_E1H_OFFSET ? 0x2448 : 0xffffffff) +#define USTORM_ISCSI_CQ_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7044 + (function * 0x8)) : (0x2414 + \ + (function * 0x8))) +#define USTORM_ISCSI_CQ_SQN_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7046 + (function * 0x8)) : (0x2416 + \ + (function * 0x8))) +#define USTORM_ISCSI_ERROR_BITMAP_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7688 + (function * 0x8)) : (0x29c8 + \ + (function * 0x8))) +#define USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7648 + (function * 0x8)) : (0x29b8 + \ + (function * 0x8))) +#define USTORM_ISCSI_NUM_OF_TASKS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7004 + (function * 0x8)) : (0x2404 + \ + (function * 0x8))) +#define USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7002 + (function * 0x8)) : (0x2402 + \ + (function * 0x8))) +#define USTORM_ISCSI_PAGE_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7000 + (function * 0x8)) : (0x2400 + \ + (function * 0x8))) +#define USTORM_ISCSI_R2TQ_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7040 + (function * 0x8)) : (0x2410 + \ + (function * 0x8))) +#define USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7080 + (function * 0x8)) : (0x2420 + \ + (function * 0x8))) +#define USTORM_ISCSI_RQ_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x7084 + (function * 0x8)) : (0x2424 + \ + (function * 0x8))) +#define USTORM_MAX_AGG_SIZE_OFFSET(port, clientId) \ + (IS_E1H_OFFSET ? (0x1018 + (port * 0x680) + (clientId * 0x40)) : \ + (0x4018 + (port * 0x360) + (clientId * 0x30))) +#define USTORM_MEM_WORKAROUND_ADDRESS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x2408 + (function * 0x8)) : (0x1da8 + \ + (function * 0x8))) +#define USTORM_PER_COUNTER_ID_STATS_OFFSET(port, stats_counter_id) \ + (IS_E1H_OFFSET ? (0x2450 + (port * 0x2d0) + (stats_counter_id * \ + 0x28)) : (0x1500 + (port * 0x2d0) + (stats_counter_id * 0x28))) +#define USTORM_RX_PRODS_OFFSET(port, client_id) \ + (IS_E1H_OFFSET ? (0x1000 + (port * 0x680) + (client_id * 0x40)) \ + : (0x4000 + (port * 0x360) + (client_id * 0x30))) +#define USTORM_STATS_FLAGS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x29f0 + (function * 0x8)) : (0x1db8 + \ + (function * 0x8))) +#define USTORM_TPA_BTR_OFFSET (IS_E1H_OFFSET ? 0x3da5 : 0x5095) +#define USTORM_TPA_BTR_SIZE 0x1 +#define XSTORM_ASSERT_LIST_INDEX_OFFSET \ + (IS_E1H_OFFSET ? 0x9000 : 0x1000) +#define XSTORM_ASSERT_LIST_OFFSET(idx) \ + (IS_E1H_OFFSET ? (0x9020 + (idx * 0x10)) : (0x1020 + (idx * 0x10))) +#define XSTORM_CMNG_PER_PORT_VARS_OFFSET(port) \ + (IS_E1H_OFFSET ? (0x24a8 + (port * 0x50)) : (0x3a80 + (port * 0x50))) +#define XSTORM_DEF_SB_HC_DISABLE_OFFSET(function, index) \ + (IS_E1H_OFFSET ? (0xa01a + ((function>>1) * 0x28) + \ + ((function&1) * 0xa0) + (index * 0x4)) : (0x141a + (function * \ + 0x28) + (index * 0x4))) +#define XSTORM_DEF_SB_HOST_SB_ADDR_OFFSET(function) \ + (IS_E1H_OFFSET ? (0xa000 + ((function>>1) * 0x28) + \ + ((function&1) * 0xa0)) : (0x1400 + (function * 0x28))) +#define XSTORM_DEF_SB_HOST_STATUS_BLOCK_OFFSET(function) \ + (IS_E1H_OFFSET ? (0xa008 + ((function>>1) * 0x28) + \ + ((function&1) * 0xa0)) : (0x1408 + (function * 0x28))) +#define XSTORM_E1HOV_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x2c10 + (function * 0x8)) : 0xffffffff) +#define XSTORM_ETH_STATS_QUERY_ADDR_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x2418 + (function * 0x8)) : (0x3a50 + \ + (function * 0x8))) +#define XSTORM_FAIRNESS_PER_VN_VARS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x2588 + (function * 0x90)) : (0x3b60 + \ + (function * 0x90))) +#define XSTORM_FUNCTION_MODE_OFFSET \ + (IS_E1H_OFFSET ? 0x2c50 : 0xffffffff) +#define XSTORM_HC_BTR_OFFSET(port) \ + (IS_E1H_OFFSET ? (0xa144 + (port * 0x30)) : (0x1454 + (port * 0x18))) +#define XSTORM_ISCSI_HQ_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x80c0 + (function * 0x8)) : (0x1c30 + \ + (function * 0x8))) +#define XSTORM_ISCSI_LOCAL_MAC_ADDR0_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8080 + (function * 0x8)) : (0x1c20 + \ + (function * 0x8))) +#define XSTORM_ISCSI_LOCAL_MAC_ADDR1_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8081 + (function * 0x8)) : (0x1c21 + \ + (function * 0x8))) +#define XSTORM_ISCSI_LOCAL_MAC_ADDR2_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8082 + (function * 0x8)) : (0x1c22 + \ + (function * 0x8))) +#define XSTORM_ISCSI_LOCAL_MAC_ADDR3_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8083 + (function * 0x8)) : (0x1c23 + \ + (function * 0x8))) +#define XSTORM_ISCSI_LOCAL_MAC_ADDR4_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8084 + (function * 0x8)) : (0x1c24 + \ + (function * 0x8))) +#define XSTORM_ISCSI_LOCAL_MAC_ADDR5_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8085 + (function * 0x8)) : (0x1c25 + \ + (function * 0x8))) +#define XSTORM_ISCSI_LOCAL_VLAN_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8086 + (function * 0x8)) : (0x1c26 + \ + (function * 0x8))) +#define XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8004 + (function * 0x8)) : (0x1c04 + \ + (function * 0x8))) +#define XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8002 + (function * 0x8)) : (0x1c02 + \ + (function * 0x8))) +#define XSTORM_ISCSI_PAGE_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8000 + (function * 0x8)) : (0x1c00 + \ + (function * 0x8))) +#define XSTORM_ISCSI_R2TQ_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x80c4 + (function * 0x8)) : (0x1c34 + \ + (function * 0x8))) +#define XSTORM_ISCSI_SQ_SIZE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x80c2 + (function * 0x8)) : (0x1c32 + \ + (function * 0x8))) +#define XSTORM_ISCSI_TCP_VARS_ADV_WND_SCL_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8043 + (function * 0x8)) : (0x1c13 + \ + (function * 0x8))) +#define XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8042 + (function * 0x8)) : (0x1c12 + \ + (function * 0x8))) +#define XSTORM_ISCSI_TCP_VARS_TOS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8041 + (function * 0x8)) : (0x1c11 + \ + (function * 0x8))) +#define XSTORM_ISCSI_TCP_VARS_TTL_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x8040 + (function * 0x8)) : (0x1c10 + \ + (function * 0x8))) +#define XSTORM_PER_COUNTER_ID_STATS_OFFSET(port, stats_counter_id) \ + (IS_E1H_OFFSET ? (0xc000 + (port * 0x360) + (stats_counter_id * \ + 0x30)) : (0x3378 + (port * 0x360) + (stats_counter_id * 0x30))) +#define XSTORM_RATE_SHAPING_PER_VN_VARS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x2548 + (function * 0x90)) : (0x3b20 + \ + (function * 0x90))) +#define XSTORM_SPQ_PAGE_BASE_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x2000 + (function * 0x10)) : (0x3328 + \ + (function * 0x10))) +#define XSTORM_SPQ_PROD_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x2008 + (function * 0x10)) : (0x3330 + \ + (function * 0x10))) +#define XSTORM_STATS_FLAGS_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x23d8 + (function * 0x8)) : (0x3a40 + \ + (function * 0x8))) +#define XSTORM_TCP_GLOBAL_DEL_ACK_COUNTER_ENABLED_OFFSET(port) \ + (IS_E1H_OFFSET ? (0x4000 + (port * 0x8)) : (0x1960 + (port * 0x8))) +#define XSTORM_TCP_GLOBAL_DEL_ACK_COUNTER_MAX_COUNT_OFFSET(port) \ + (IS_E1H_OFFSET ? (0x4001 + (port * 0x8)) : (0x1961 + (port * 0x8))) +#define XSTORM_TCP_TX_SWS_TIMER_VAL_OFFSET(function) \ + (IS_E1H_OFFSET ? (0x4060 + ((function>>1) * 0x8) + ((function&1) \ + * 0x4)) : (0x1978 + (function * 0x4))) +#define COMMON_ASM_INVALID_ASSERT_OPCODE 0x0 + +/** +* This file defines HSI constants for the ETH flow +*/ +#ifdef _EVEREST_MICROCODE +#include "microcode_constants.h" +#include "eth_rx_bd.h" +#include "eth_tx_bd.h" +#include "eth_rx_cqe.h" +#include "eth_rx_sge.h" +#include "eth_rx_cqe_next_page.h" +#endif + +/* RSS hash types */ +#define DEFAULT_HASH_TYPE 0 +#define IPV4_HASH_TYPE 1 +#define TCP_IPV4_HASH_TYPE 2 +#define IPV6_HASH_TYPE 3 +#define TCP_IPV6_HASH_TYPE 4 +#define VLAN_PRI_HASH_TYPE 5 +#define E1HOV_PRI_HASH_TYPE 6 +#define DSCP_HASH_TYPE 7 + + +/* Ethernet Ring parameters */ +#define X_ETH_LOCAL_RING_SIZE 13 +#define FIRST_BD_IN_PKT 0 +#define PARSE_BD_INDEX 1 +#define NUM_OF_ETH_BDS_IN_PAGE ((PAGE_SIZE)/(STRUCT_SIZE(eth_tx_bd)/8)) +#define U_ETH_NUM_OF_SGES_TO_FETCH 8 +#define U_ETH_MAX_SGES_FOR_PACKET 3 + +/* Rx ring params */ +#define U_ETH_LOCAL_BD_RING_SIZE 8 +#define U_ETH_LOCAL_SGE_RING_SIZE 10 +#define U_ETH_SGL_SIZE 8 + + +#define U_ETH_SGES_PER_PAGE_INVERSE_MASK \ + (0xFFFF - ((PAGE_SIZE/((STRUCT_SIZE(eth_rx_sge))/8))-1)) + +#define TU_ETH_CQES_PER_PAGE (PAGE_SIZE/(STRUCT_SIZE(eth_rx_cqe)/8)) +#define U_ETH_BDS_PER_PAGE (PAGE_SIZE/(STRUCT_SIZE(eth_rx_bd)/8)) +#define U_ETH_SGES_PER_PAGE (PAGE_SIZE/(STRUCT_SIZE(eth_rx_sge)/8)) + +#define U_ETH_BDS_PER_PAGE_MASK (U_ETH_BDS_PER_PAGE-1) +#define U_ETH_CQE_PER_PAGE_MASK (TU_ETH_CQES_PER_PAGE-1) +#define U_ETH_SGES_PER_PAGE_MASK (U_ETH_SGES_PER_PAGE-1) + +#define U_ETH_UNDEFINED_Q 0xFF + +/* values of command IDs in the ramrod message */ +#define RAMROD_CMD_ID_ETH_PORT_SETUP 80 +#define RAMROD_CMD_ID_ETH_CLIENT_SETUP 85 +#define RAMROD_CMD_ID_ETH_STAT_QUERY 90 +#define RAMROD_CMD_ID_ETH_UPDATE 100 +#define RAMROD_CMD_ID_ETH_HALT 105 +#define RAMROD_CMD_ID_ETH_SET_MAC 110 +#define RAMROD_CMD_ID_ETH_CFC_DEL 115 +#define RAMROD_CMD_ID_ETH_PORT_DEL 120 +#define RAMROD_CMD_ID_ETH_FORWARD_SETUP 125 + + +/* command values for set mac command */ +#define T_ETH_MAC_COMMAND_SET 0 +#define T_ETH_MAC_COMMAND_INVALIDATE 1 + +#define T_ETH_INDIRECTION_TABLE_SIZE 128 + +/*The CRC32 seed, that is used for the hash(reduction) multicast address */ +#define T_ETH_CRC32_HASH_SEED 0x00000000 + +/* Maximal L2 clients supported */ +#define ETH_MAX_RX_CLIENTS_E1 18 +#define ETH_MAX_RX_CLIENTS_E1H 26 + +/* Maximal aggregation queues supported */ +#define ETH_MAX_AGGREGATION_QUEUES_E1 32 +#define ETH_MAX_AGGREGATION_QUEUES_E1H 64 + +/* ETH RSS modes */ +#define ETH_RSS_MODE_DISABLED 0 +#define ETH_RSS_MODE_REGULAR 1 +#define ETH_RSS_MODE_VLAN_PRI 2 +#define ETH_RSS_MODE_E1HOV_PRI 3 +#define ETH_RSS_MODE_IP_DSCP 4 + + +/** +* This file defines HSI constants common to all microcode flows +*/ + +/* Connection types */ +#define ETH_CONNECTION_TYPE 0 +#define TOE_CONNECTION_TYPE 1 +#define RDMA_CONNECTION_TYPE 2 +#define ISCSI_CONNECTION_TYPE 3 +#define FCOE_CONNECTION_TYPE 4 +#define RESERVED_CONNECTION_TYPE_0 5 +#define RESERVED_CONNECTION_TYPE_1 6 +#define RESERVED_CONNECTION_TYPE_2 7 + + +#define PROTOCOL_STATE_BIT_OFFSET 6 + +#define ETH_STATE (ETH_CONNECTION_TYPE << PROTOCOL_STATE_BIT_OFFSET) +#define TOE_STATE (TOE_CONNECTION_TYPE << PROTOCOL_STATE_BIT_OFFSET) +#define RDMA_STATE (RDMA_CONNECTION_TYPE << PROTOCOL_STATE_BIT_OFFSET) + +/* microcode fixed page page size 4K (chains and ring segments) */ +#define MC_PAGE_SIZE 4096 + + +/* Host coalescing constants */ +#define HC_IGU_BC_MODE 0 +#define HC_IGU_NBC_MODE 1 + +#define HC_REGULAR_SEGMENT 0 +#define HC_DEFAULT_SEGMENT 1 + +/* index numbers */ +#define HC_USTORM_DEF_SB_NUM_INDICES 8 +#define HC_CSTORM_DEF_SB_NUM_INDICES 8 +#define HC_XSTORM_DEF_SB_NUM_INDICES 4 +#define HC_TSTORM_DEF_SB_NUM_INDICES 4 +#define HC_USTORM_SB_NUM_INDICES 4 +#define HC_CSTORM_SB_NUM_INDICES 4 + +/* index values - which counter to update */ + +#define HC_INDEX_U_TOE_RX_CQ_CONS 0 +#define HC_INDEX_U_ETH_RX_CQ_CONS 1 +#define HC_INDEX_U_ETH_RX_BD_CONS 2 +#define HC_INDEX_U_FCOE_EQ_CONS 3 + +#define HC_INDEX_C_TOE_TX_CQ_CONS 0 +#define HC_INDEX_C_ETH_TX_CQ_CONS 1 +#define HC_INDEX_C_ISCSI_EQ_CONS 2 + +#define HC_INDEX_DEF_X_SPQ_CONS 0 + +#define HC_INDEX_DEF_C_RDMA_EQ_CONS 0 +#define HC_INDEX_DEF_C_RDMA_NAL_PROD 1 +#define HC_INDEX_DEF_C_ETH_FW_TX_CQ_CONS 2 +#define HC_INDEX_DEF_C_ETH_SLOW_PATH 3 +#define HC_INDEX_DEF_C_ETH_RDMA_CQ_CONS 4 +#define HC_INDEX_DEF_C_ETH_ISCSI_CQ_CONS 5 +#define HC_INDEX_DEF_C_ETH_FCOE_CQ_CONS 6 + +#define HC_INDEX_DEF_U_ETH_RDMA_RX_CQ_CONS 0 +#define HC_INDEX_DEF_U_ETH_ISCSI_RX_CQ_CONS 1 +#define HC_INDEX_DEF_U_ETH_RDMA_RX_BD_CONS 2 +#define HC_INDEX_DEF_U_ETH_ISCSI_RX_BD_CONS 3 +#define HC_INDEX_DEF_U_ETH_FCOE_RX_CQ_CONS 4 +#define HC_INDEX_DEF_U_ETH_FCOE_RX_BD_CONS 5 + +/* used by the driver to get the SB offset */ +#define USTORM_ID 0 +#define CSTORM_ID 1 +#define XSTORM_ID 2 +#define TSTORM_ID 3 +#define ATTENTION_ID 4 + +/* max number of slow path commands per port */ +#define MAX_RAMRODS_PER_PORT 8 + +/* values for RX ETH CQE type field */ +#define RX_ETH_CQE_TYPE_ETH_FASTPATH 0 +#define RX_ETH_CQE_TYPE_ETH_RAMROD 1 + + +/**** DEFINES FOR TIMERS/CLOCKS RESOLUTIONS ****/ +#define EMULATION_FREQUENCY_FACTOR 1600 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 22:51:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAC12106567C; Mon, 14 Mar 2011 22:51:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8F898FC21; Mon, 14 Mar 2011 22:51: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 p2EMpp4T013911; Mon, 14 Mar 2011 22:51:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EMppwN013908; Mon, 14 Mar 2011 22:51:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201103142251.p2EMppwN013908@svn.freebsd.org> From: Dimitry Andric Date: Mon, 14 Mar 2011 22:51: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: r219648 - in stable/8/gnu/usr.bin: binutils/ld cc/cc_tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 22:51:51 -0000 Author: dim Date: Mon Mar 14 22:51:51 2011 New Revision: 219648 URL: http://svn.freebsd.org/changeset/base/219648 Log: Partially MFC r209867 and r215439, to provide rudimentary support for linking i386 (32 bit) executables on amd64, using gcc's -m32 option. r209867 introduces the needed multilib options to gcc's multilib.h, but was originally intended just for powerpc64. r215439 teaches the linker to search in /usr/lib32 for elf_i386_fbsd output, and amends r209867 to apply to amd64 too. NOTE: this MFC does NOT provide full support for compiling and linking all existing 32 bit programs on amd64, since /usr/include/machine still contains amd64-specific headers. Though simple "Hello World" type programs work, anything relying on machine-specific types might fail in various interesting ways. You have been warned. :) MFC r209867: Teach our toolchain how to generate 64-bit PowerPC binaries. This fixes a variety of bugs in binutils related to handling of 64-bit PPC ELF, provides a GCC configuration for 64-bit PowerPC on FreeBSD, and associated build systems tweaks. Obtained from: projects/ppc64 MFC r215439: Let gcc and ld know where to find 32 bit libraries on amd64. Reviewed by: arch@ Approved by: kib (mentor) Modified: stable/8/gnu/usr.bin/binutils/ld/Makefile.amd64 stable/8/gnu/usr.bin/cc/cc_tools/Makefile Directory Properties: stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) Modified: stable/8/gnu/usr.bin/binutils/ld/Makefile.amd64 ============================================================================== --- stable/8/gnu/usr.bin/binutils/ld/Makefile.amd64 Mon Mar 14 22:42:41 2011 (r219647) +++ stable/8/gnu/usr.bin/binutils/ld/Makefile.amd64 Mon Mar 14 22:51:51 2011 (r219648) @@ -12,7 +12,7 @@ e${NATIVE_EMULATION}.c: emulparams/${NAT ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} X86_EMULATION= elf_i386_fbsd -_i386_path= \"${TOOLS_PREFIX}/usr/lib/i386\" +_i386_path= \"${TOOLS_PREFIX}/usr/lib32\" EMS+= ${X86_EMULATION} .for ext in ${ELF_SCR_EXT} LDSCRIPTS+= ${X86_EMULATION}.${ext} Modified: stable/8/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- stable/8/gnu/usr.bin/cc/cc_tools/Makefile Mon Mar 14 22:42:41 2011 (r219647) +++ stable/8/gnu/usr.bin/cc/cc_tools/Makefile Mon Mar 14 22:51:51 2011 (r219648) @@ -303,12 +303,22 @@ GENSRCS+= gcov-iov.h # Multilib config file multilib.h: +.if ${TARGET_ARCH} == "amd64" + echo 'static const char *const multilib_raw[] = { \ + ". !m64 !m32;", \ + "64:../lib m64 !m32;", \ + "32:../lib32 !m64 m32;", NULL };' > ${.TARGET} + echo 'static const char *const multilib_matches_raw[] = { \ + "m64 m64;", "m32 m32;", NULL };' >> ${.TARGET} + echo 'static const char *multilib_options = "m64/m32";' >> ${.TARGET} +.else echo 'static const char *const multilib_raw[] = { \ ". ;", NULL };' > ${.TARGET} echo 'static const char *const multilib_matches_raw[] = { \ NULL };' >> ${.TARGET} - echo 'static const char *multilib_extra = "";' >> ${.TARGET} echo 'static const char *multilib_options = "";' >> ${.TARGET} +.endif + echo 'static const char *multilib_extra = "";' >> ${.TARGET} echo 'static const char *const multilib_exclusions_raw[] = { \ NULL };' >> ${.TARGET} From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 23:30:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C310A106564A; Mon, 14 Mar 2011 23:30: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 B2B4B8FC0A; Mon, 14 Mar 2011 23:30: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 p2ENUEZh014906; Mon, 14 Mar 2011 23:30:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2ENUEL8014903; Mon, 14 Mar 2011 23:30:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103142330.p2ENUEL8014903@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Mar 2011 23:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219653 - in head/sys: arm/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 23:30:14 -0000 Author: jkim Date: Mon Mar 14 23:30:14 2011 New Revision: 219653 URL: http://svn.freebsd.org/changeset/base/219653 Log: Make get_cyclecount(9) little bit more useful where binuptime(9) is used. Modified: head/sys/arm/include/cpu.h head/sys/i386/include/cpu.h Modified: head/sys/arm/include/cpu.h ============================================================================== --- head/sys/arm/include/cpu.h Mon Mar 14 23:19:04 2011 (r219652) +++ head/sys/arm/include/cpu.h Mon Mar 14 23:30:14 2011 (r219653) @@ -16,7 +16,7 @@ get_cyclecount(void) struct bintime bt; binuptime(&bt); - return (bt.frac ^ bt.sec); + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); } #endif Modified: head/sys/i386/include/cpu.h ============================================================================== --- head/sys/i386/include/cpu.h Mon Mar 14 23:19:04 2011 (r219652) +++ head/sys/i386/include/cpu.h Mon Mar 14 23:30:14 2011 (r219653) @@ -67,7 +67,7 @@ void swi_vm(void *); * Return contents of in-cpu fast counter as a sort of "bogo-time" * for random-harvesting purposes. */ -static __inline u_int64_t +static __inline uint64_t get_cyclecount(void) { #if defined(I486_CPU) || defined(KLD_MODULE) @@ -75,7 +75,7 @@ get_cyclecount(void) if (!tsc_present) { binuptime(&bt); - return (bt.frac ^ bt.sec); + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); } #endif return (rdtsc()); From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 01:06:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D34E6106564A; Tue, 15 Mar 2011 01:06:27 +0000 (UTC) (envelope-from davidch@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A94A38FC12; Tue, 15 Mar 2011 01:06: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 p2F16RLV017041; Tue, 15 Mar 2011 01:06:27 GMT (envelope-from davidch@svn.freebsd.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2F16RFJ017039; Tue, 15 Mar 2011 01:06:27 GMT (envelope-from davidch@svn.freebsd.org) Message-Id: <201103150106.p2F16RFJ017039@svn.freebsd.org> From: David Christensen Date: Tue, 15 Mar 2011 01:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219656 - in head/sys: dev/bxe modules/bxe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 01:06:27 -0000 Author: davidch Date: Tue Mar 15 01:06:27 2011 New Revision: 219656 URL: http://svn.freebsd.org/changeset/base/219656 Log: - Inadvertently committed files with +x attribute, fixed. - Minor change to info output string. Modified: head/sys/dev/bxe/if_bxe.c (contents, props changed) Directory Properties: head/sys/dev/bxe/bxe_debug.h (props changed) head/sys/dev/bxe/bxe_fw_defs.h (props changed) head/sys/dev/bxe/bxe_hsi.h (props changed) head/sys/dev/bxe/bxe_include.h (props changed) head/sys/dev/bxe/bxe_init.h (props changed) head/sys/dev/bxe/bxe_init_values_e1.h (props changed) head/sys/dev/bxe/bxe_init_values_e1h.h (props changed) head/sys/dev/bxe/bxe_link.c (props changed) head/sys/dev/bxe/bxe_link.h (props changed) head/sys/dev/bxe/bxe_reg.h (props changed) head/sys/dev/bxe/bxe_self_test.h (props changed) head/sys/dev/bxe/dump_e1.h (props changed) head/sys/dev/bxe/dump_e1h.h (props changed) head/sys/dev/bxe/hw_dump_reg_st.h (props changed) head/sys/dev/bxe/if_bxe.h (props changed) head/sys/modules/bxe/Makefile (props changed) Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Mon Mar 14 23:54:19 2011 (r219655) +++ head/sys/dev/bxe/if_bxe.c Tue Mar 15 01:06:27 2011 (r219656) @@ -986,6 +986,7 @@ bxe_probe(device_t dev) static void bxe_print_adapter_info(struct bxe_softc *sc) { + int i = 0; DBENTER(BXE_EXTREME_LOAD); @@ -1008,17 +1009,26 @@ bxe_print_adapter_info(struct bxe_softc } /* Device features. */ - printf("); Flags ( "); + printf("); Flags ("); /* Miscellaneous flags. */ if (sc->bxe_flags & BXE_USING_MSI_FLAG) - printf("MSI "); - if (sc->bxe_flags & BXE_USING_MSIX_FLAG) - printf("MSI-X "); - if (sc->bxe_flags & BXE_SAFC_TX_FLAG) - printf("SAFC "); - if (TPA_ENABLED(sc)) - printf("TPA "); + printf("MSI"); + + if (sc->bxe_flags & BXE_USING_MSIX_FLAG) { + if (i > 0) printf("|"); + printf("MSI-X"); i++; + } + + if (sc->bxe_flags & BXE_SAFC_TX_FLAG) { + if (i > 0) printf("|"); + printf("SAFC"); i++; + } + + if (TPA_ENABLED(sc)) { + if (i > 0) printf("|"); + printf("TPA"); i++; + } printf(") Queues ("); switch (sc->multi_mode) { @@ -1032,8 +1042,9 @@ bxe_print_adapter_info(struct bxe_softc printf("Unknown"); break; } + /* Firmware versions and device features. */ - BXE_PRINTF("Firmware (%d.%d.%d); Bootcode (%d.%d.%d)\n", + printf("); Firmware (%d.%d.%d); Bootcode (%d.%d.%d)\n", BCM_5710_FW_MAJOR_VERSION, BCM_5710_FW_MINOR_VERSION, BCM_5710_FW_REVISION_VERSION, From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 02:31:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1D44106564A; Tue, 15 Mar 2011 02:31:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 7DAD48FC0C; Tue, 15 Mar 2011 02:31:25 +0000 (UTC) Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au (c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p2F2VKDg018114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Mar 2011 13:31:22 +1100 Date: Tue, 15 Mar 2011 13:31:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201103142205.p2EM5x6E012664@svn.freebsd.org> Message-ID: <20110315123819.X920@besplex.bde.org> References: <201103142205.p2EM5x6E012664@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219646 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 02:31:26 -0000 On Mon, 14 Mar 2011, Jung-uk Kim wrote: > Log: > When TSC is unavailable, broken or disabled and the current timecounter has > better quality than i8254 timer, use it for DELAY(9). You cannot use a random timecounter for DELAY(). DELAY() is carefully written to not use any locks, so that it doesn't deadlock when called in the "any" context from a bad console driver like syscons when syscons is called from ddb. (Bad console drivers may have their own locks which deadlock in ddb, but that is another problem.) Even the i8254 timer, which is the only timer that should be used by DELAY(), normally use locks that used to cause deadlock, but DELAY() was unbroken to bypass the locks when it is called from ddb. Cpufreq and other calibration code should use a normal timecounter via nanouptime() in all cases and never go near low level timecounters or DELAY(). There are (hopefully minor) problems getting the nanotime() initialized before it used. The dummy timecounter is just what you don't want to use. Even in this patch, it isn't clear that the low level timecounters are initialized before they are used. > Modified: head/sys/x86/isa/clock.c > ============================================================================== > --- head/sys/x86/isa/clock.c Mon Mar 14 19:31:43 2011 (r219645) > +++ head/sys/x86/isa/clock.c Mon Mar 14 22:05:59 2011 (r219646) > @@ -245,6 +245,42 @@ getit(void) > return ((high << 8) | low); > } > > +static __inline void > +delay_tsc(int n) > +{ > + uint64_t start, end, now; > + > + sched_pin(); > + start = rdtsc(); > + end = start + (tsc_freq * n) / 1000000; > + do { > + cpu_spinwait(); > + now = rdtsc(); > + } while (now < end || (now > start && end < start)); > + sched_unpin(); > +} You cannot call random scheduling code from DELAY(), since the scheduling code is not designed to be called in the "any" context. As it happens, sched_pin() and sched_unpin() are safe, and were already used in the TSC case. > + > +static __inline void > +delay_timecounter(struct timecounter *tc, int n) > +{ > + uint64_t end, now; > + u_int last, mask, u; > + > + mask = tc->tc_counter_mask; > + last = tc->tc_get_timecount(tc) & mask; > + end = tc->tc_frequency * n / 1000000; This depends on the delicate timecounter locking to be safe. I think it it is safe except possibly in tc_get_timecount(), for the same reasons that nanouptime() can run safely with no visible locking. tc must be the current timecounter/timehands, which is guaranteed to not be in an in-between state or become so while we are using it, despite there being no visible locking. Actually there are some minor races: - in nanouptime(), the timecounter generation is checked to avoid using a new generation if necessary, but updates of the generation count and the fileds that it protects are not properly atomic. - here, the check of the generation is missing. So this works without races when called from ddb (since ddb stops other CPUs), but has minor races in general. > + now = 0; > + do { > + cpu_spinwait(); > + u = tc->tc_get_timecount(tc) & mask; > + if (u < last) > + now += mask - last + u + 1; > + else > + now += u - last; > + last = u; > + } while (now < end); > +} > + > /* > * Wait "n" microseconds. > * Relies on timer 1 counting down from (i8254_freq / hz) > @@ -253,6 +289,7 @@ getit(void) > void > DELAY(int n) > { > + struct timecounter *tc; > int delta, prev_tick, tick, ticks_left; > > #ifdef DELAYDEBUG > @@ -262,16 +299,12 @@ DELAY(int n) > #endif > > if (tsc_freq != 0) { > - uint64_t start, end, now; > - > - sched_pin(); > - start = rdtsc(); > - end = start + (tsc_freq * n) / 1000000; > - do { > - cpu_spinwait(); > - now = rdtsc(); > - } while (now < end || (now > start && end < start)); > - sched_unpin(); > + delay_tsc(n); > + return; > + } > + tc = timecounter; > + if (tc->tc_quality > 0) { > + delay_timecounter(tc, n); > return; > } Optimizing DELAY() was bogus. Now the loop for this is duplicatied. > #ifdef DELAYDEBUG > Stuff keeps accumulating or mutating above the code for testing it. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 06:38:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39292106566C; Tue, 15 Mar 2011 06:38:18 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id E81288FC13; Tue, 15 Mar 2011 06:38:17 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 2D69417031; Tue, 15 Mar 2011 09:19:58 +0300 (MSK) Date: Tue, 15 Mar 2011 09:19:58 +0300 From: Maxim Dounin To: Jung-uk Kim Message-ID: <20110315061957.GD99496@mdounin.ru> References: <201103142330.p2ENUEL8014903@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201103142330.p2ENUEL8014903@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219653 - in head/sys: arm/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 06:38:18 -0000 Hello! On Mon, Mar 14, 2011 at 11:30:14PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Mon Mar 14 23:30:14 2011 > New Revision: 219653 > URL: http://svn.freebsd.org/changeset/base/219653 > > Log: > Make get_cyclecount(9) little bit more useful where binuptime(9) is used. get_cyclecount(9) is for random harvesting, and dropping half of it's entropy in binuptime() case may not be a good idea. It's probably better to fix manpage instead, to clarify it's intended usage. Maxim Dounin > > Modified: > head/sys/arm/include/cpu.h > head/sys/i386/include/cpu.h > > Modified: head/sys/arm/include/cpu.h > ============================================================================== > --- head/sys/arm/include/cpu.h Mon Mar 14 23:19:04 2011 (r219652) > +++ head/sys/arm/include/cpu.h Mon Mar 14 23:30:14 2011 (r219653) > @@ -16,7 +16,7 @@ get_cyclecount(void) > struct bintime bt; > > binuptime(&bt); > - return (bt.frac ^ bt.sec); > + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); > > } > #endif > > Modified: head/sys/i386/include/cpu.h > ============================================================================== > --- head/sys/i386/include/cpu.h Mon Mar 14 23:19:04 2011 (r219652) > +++ head/sys/i386/include/cpu.h Mon Mar 14 23:30:14 2011 (r219653) > @@ -67,7 +67,7 @@ void swi_vm(void *); > * Return contents of in-cpu fast counter as a sort of "bogo-time" > * for random-harvesting purposes. > */ > -static __inline u_int64_t > +static __inline uint64_t > get_cyclecount(void) > { > #if defined(I486_CPU) || defined(KLD_MODULE) > @@ -75,7 +75,7 @@ get_cyclecount(void) > > if (!tsc_present) { > binuptime(&bt); > - return (bt.frac ^ bt.sec); > + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); > } > #endif > return (rdtsc()); > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 06:43:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA3F21065676; Tue, 15 Mar 2011 06:43:40 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.corbina.net (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 2B9498FC14; Tue, 15 Mar 2011 06:43:39 +0000 (UTC) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.corbina.net (Postfix) with ESMTP id 96F34CB386; Tue, 15 Mar 2011 09:43:36 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.22.99] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 308500732; Tue, 15 Mar 2011 09:43:36 +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 p2F6haPo004026; Tue, 15 Mar 2011 09:43:36 +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 p2F6hVj6004025; Tue, 15 Mar 2011 09:43:31 +0300 (MSK) (envelope-from dchagin) Date: Tue, 15 Mar 2011 09:43:30 +0300 From: Chagin Dmitry To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20110315064330.GA4015@dchagin.static.corbina.ru> References: <201103131458.p2DEw2xG057948@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline In-Reply-To: <201103131458.p2DEw2xG057948@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r219609 - in head/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 06:43:41 -0000 --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 13, 2011 at 02:58:02PM +0000, Dmitry Chagin wrote: > Author: dchagin > Date: Sun Mar 13 14:58:02 2011 > New Revision: 219609 > URL: http://svn.freebsd.org/changeset/base/219609 >=20 > Log: > Enable shared page use for amd64/linux32 and i386/linux binaries. > Move signal trampoline code from the top of the stack to the shared pag= e. > =20 > MFC after: 2 Weeks Describe the reasons for this change in more detail: Instead of installing the signal trampoline at every exec() time copy it only once when the module loads. Requested by: netchild@ >=20 > Modified: > head/sys/amd64/linux32/linux.h > head/sys/amd64/linux32/linux32_sysvec.c > head/sys/i386/linux/linux.h > head/sys/i386/linux/linux_sysvec.c >=20 > Modified: head/sys/amd64/linux32/linux.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/amd64/linux32/linux.h Sun Mar 13 13:42:43 2011 (r219608) > +++ head/sys/amd64/linux32/linux.h Sun Mar 13 14:58:02 2011 (r219609) > @@ -47,7 +47,10 @@ extern u_char linux_debug_map[]; > MALLOC_DECLARE(M_LINUX); > #endif > =20 > -#define LINUX32_USRSTACK ((1ul << 32) - PAGE_SIZE) > +#define LINUX32_MAXUSER ((1ul << 32) - PAGE_SIZE) > +#define LINUX32_SHAREDPAGE (LINUX32_MAXUSER - PAGE_SIZE) > +#define LINUX32_USRSTACK LINUX32_SHAREDPAGE > + > /* XXX 16 =3D sizeof(linux32_ps_strings) */ > #define LINUX32_PS_STRINGS (LINUX32_USRSTACK - 16) > #define LINUX32_MAXDSIZ (512 * 1024 * 1024) /* 512MB */ >=20 > Modified: head/sys/amd64/linux32/linux32_sysvec.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/amd64/linux32/linux32_sysvec.c Sun Mar 13 13:42:43 2011 (r21= 9608) > +++ head/sys/amd64/linux32/linux32_sysvec.c Sun Mar 13 14:58:02 2011 (r21= 9609) > @@ -411,8 +411,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo > * Build context to run handler in. > */ > regs->tf_rsp =3D PTROUT(fp); > - regs->tf_rip =3D LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode) + > - linux_sznonrtsigcode; > + regs->tf_rip =3D p->p_sysent->sv_sigcode_base + linux_sznonrtsigcode; > regs->tf_rflags &=3D ~(PSL_T | PSL_D); > regs->tf_cs =3D _ucode32sel; > regs->tf_ss =3D _udatasel; > @@ -535,7 +534,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t=20 > * Build context to run handler in. > */ > regs->tf_rsp =3D PTROUT(fp); > - regs->tf_rip =3D LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode); > + regs->tf_rip =3D p->p_sysent->sv_sigcode_base; > regs->tf_rflags &=3D ~(PSL_T | PSL_D); > regs->tf_cs =3D _ucode32sel; > regs->tf_ss =3D _udatasel; > @@ -890,21 +889,15 @@ linux_copyout_strings(struct image_param > * Also deal with signal trampoline code for this exec type. > */ > arginfo =3D (struct linux32_ps_strings *)LINUX32_PS_STRINGS; > - destp =3D (caddr_t)arginfo - linux_szsigcode - SPARE_USRSPACE - > - linux_szplatform - roundup((ARG_MAX - imgp->args->stringspace), > + destp =3D (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform - > + roundup((ARG_MAX - imgp->args->stringspace), > sizeof(char *)); > =20 > /* > - * install sigcode > - */ > - copyout(imgp->proc->p_sysent->sv_sigcode, > - ((caddr_t)arginfo - linux_szsigcode), linux_szsigcode); > - > - /* > * Install LINUX_PLATFORM > */ > - copyout(linux_platform, ((caddr_t)arginfo - linux_szsigcode - > - linux_szplatform), linux_szplatform); > + copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform), > + linux_szplatform); > =20 > /* > * If we have a valid auxargs ptr, prepare some room > @@ -1050,7 +1043,7 @@ struct sysentvec elf_linux_sysvec =3D { > .sv_minsigstksz =3D LINUX_MINSIGSTKSZ, > .sv_pagesize =3D PAGE_SIZE, > .sv_minuser =3D VM_MIN_ADDRESS, > - .sv_maxuser =3D LINUX32_USRSTACK, > + .sv_maxuser =3D LINUX32_MAXUSER, > .sv_usrstack =3D LINUX32_USRSTACK, > .sv_psstrings =3D LINUX32_PS_STRINGS, > .sv_stackprot =3D VM_PROT_ALL, > @@ -1058,12 +1051,15 @@ struct sysentvec elf_linux_sysvec =3D { > .sv_setregs =3D exec_linux_setregs, > .sv_fixlimit =3D linux32_fixlimit, > .sv_maxssiz =3D &linux32_maxssiz, > - .sv_flags =3D SV_ABI_LINUX | SV_ILP32 | SV_IA32, > + .sv_flags =3D SV_ABI_LINUX | SV_ILP32 | SV_IA32 | SV_SHP, > .sv_set_syscall_retval =3D cpu_set_syscall_retval, > .sv_fetch_syscall_args =3D linux32_fetch_syscall_args, > .sv_syscallnames =3D NULL, > + .sv_shared_page_base =3D LINUX32_SHAREDPAGE, > + .sv_shared_page_len =3D PAGE_SIZE, > .sv_schedtail =3D linux_schedtail, > }; > +INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec); > =20 > static char GNU_ABI_VENDOR[] =3D "GNU"; > static int GNULINUX_ABI_DESC =3D 0; >=20 > Modified: head/sys/i386/linux/linux.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/i386/linux/linux.h Sun Mar 13 13:42:43 2011 (r219608) > +++ head/sys/i386/linux/linux.h Sun Mar 13 14:58:02 2011 (r219609) > @@ -47,6 +47,9 @@ extern u_char linux_debug_map[]; > MALLOC_DECLARE(M_LINUX); > #endif > =20 > +#define LINUX_SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) > +#define LINUX_USRSTACK LINUX_SHAREDPAGE > + > #define PTRIN(v) (void *)(v) > #define PTROUT(v) (l_uintptr_t)(v) > =20 >=20 > Modified: head/sys/i386/linux/linux_sysvec.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/i386/linux/linux_sysvec.c Sun Mar 13 13:42:43 2011 (r219608) > +++ head/sys/i386/linux/linux_sysvec.c Sun Mar 13 14:58:02 2011 (r219609) > @@ -90,6 +90,8 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux m > #define LINUX_SYS_linux_rt_sendsig 0 > #define LINUX_SYS_linux_sendsig 0 > =20 > +#define LINUX_PS_STRINGS (LINUX_USRSTACK - sizeof(struct ps_strings)) > + > extern char linux_sigcode[]; > extern int linux_szsigcode; > =20 > @@ -308,21 +310,14 @@ linux_copyout_strings(struct image_param > */ > p =3D imgp->proc; > arginfo =3D (struct ps_strings *)p->p_sysent->sv_psstrings; > - destp =3D (caddr_t)arginfo - linux_szsigcode - SPARE_USRSPACE - > - linux_szplatform - roundup((ARG_MAX - imgp->args->stringspace), > - sizeof(char *)); > - > - /* > - * install sigcode > - */ > - copyout(p->p_sysent->sv_sigcode, ((caddr_t)arginfo - > - linux_szsigcode), linux_szsigcode); > + destp =3D (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform - > + roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); > =20 > /* > * install LINUX_PLATFORM > */ > - copyout(linux_platform, ((caddr_t)arginfo - linux_szsigcode - > - linux_szplatform), linux_szplatform); > + copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform), > + linux_szplatform); > =20 > /* > * If we have a valid auxargs ptr, prepare some room > @@ -520,8 +515,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo > * Build context to run handler in. > */ > regs->tf_esp =3D (int)fp; > - regs->tf_eip =3D PS_STRINGS - *(p->p_sysent->sv_szsigcode) + > - linux_sznonrtsigcode; > + regs->tf_eip =3D p->p_sysent->sv_sigcode_base + linux_sznonrtsigcode; > regs->tf_eflags &=3D ~(PSL_T | PSL_VM | PSL_D); > regs->tf_cs =3D _ucodesel; > regs->tf_ds =3D _udatasel; > @@ -640,7 +634,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t=20 > * Build context to run handler in. > */ > regs->tf_esp =3D (int)fp; > - regs->tf_eip =3D PS_STRINGS - *(p->p_sysent->sv_szsigcode); > + regs->tf_eip =3D p->p_sysent->sv_sigcode_base; > regs->tf_eflags &=3D ~(PSL_T | PSL_VM | PSL_D); > regs->tf_cs =3D _ucodesel; > regs->tf_ds =3D _udatasel; > @@ -986,7 +980,7 @@ struct sysentvec linux_sysvec =3D { > .sv_pagesize =3D PAGE_SIZE, > .sv_minuser =3D VM_MIN_ADDRESS, > .sv_maxuser =3D VM_MAXUSER_ADDRESS, > - .sv_usrstack =3D USRSTACK, > + .sv_usrstack =3D LINUX_USRSTACK, > .sv_psstrings =3D PS_STRINGS, > .sv_stackprot =3D VM_PROT_ALL, > .sv_copyout_strings =3D exec_copyout_strings, > @@ -997,8 +991,11 @@ struct sysentvec linux_sysvec =3D { > .sv_set_syscall_retval =3D cpu_set_syscall_retval, > .sv_fetch_syscall_args =3D linux_fetch_syscall_args, > .sv_syscallnames =3D NULL, > + .sv_shared_page_base =3D LINUX_SHAREDPAGE, > + .sv_shared_page_len =3D PAGE_SIZE, > .sv_schedtail =3D linux_schedtail, > }; > +INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); > =20 > struct sysentvec elf_linux_sysvec =3D { > .sv_size =3D LINUX_SYS_MAXSYSCALL, > @@ -1021,19 +1018,22 @@ struct sysentvec elf_linux_sysvec =3D { > .sv_pagesize =3D PAGE_SIZE, > .sv_minuser =3D VM_MIN_ADDRESS, > .sv_maxuser =3D VM_MAXUSER_ADDRESS, > - .sv_usrstack =3D USRSTACK, > - .sv_psstrings =3D PS_STRINGS, > + .sv_usrstack =3D LINUX_USRSTACK, > + .sv_psstrings =3D LINUX_PS_STRINGS, > .sv_stackprot =3D VM_PROT_ALL, > .sv_copyout_strings =3D linux_copyout_strings, > .sv_setregs =3D exec_linux_setregs, > .sv_fixlimit =3D NULL, > .sv_maxssiz =3D NULL, > - .sv_flags =3D SV_ABI_LINUX | SV_IA32 | SV_ILP32, > + .sv_flags =3D SV_ABI_LINUX | SV_IA32 | SV_ILP32 | SV_SHP, > .sv_set_syscall_retval =3D cpu_set_syscall_retval, > .sv_fetch_syscall_args =3D linux_fetch_syscall_args, > .sv_syscallnames =3D NULL, > + .sv_shared_page_base =3D LINUX_SHAREDPAGE, > + .sv_shared_page_len =3D PAGE_SIZE, > .sv_schedtail =3D linux_schedtail, > }; > +INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec); > =20 > static char GNU_ABI_VENDOR[] =3D "GNU"; > static int GNULINUX_ABI_DESC =3D 0; --=20 Have fun! chd --7AUc2qLy4jB3hD7Z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAk1/CpIACgkQ0t2Tb3OO/O3aJgCg0YdMSfo95tx7kJvvnZF1YvdL AzIAnRo6WmMmCu4RdNKV9f5K1NxA4/DJ =lCPG -----END PGP SIGNATURE----- --7AUc2qLy4jB3hD7Z-- From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 07:15:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCD86106566B; Tue, 15 Mar 2011 07:15:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 986138FC16; Tue, 15 Mar 2011 07:15: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 p2F7F4rQ025032; Tue, 15 Mar 2011 07:15:04 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2F7F4Ot025028; Tue, 15 Mar 2011 07:15:04 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201103150715.p2F7F4Ot025028@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 15 Mar 2011 07:15: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: r219660 - in stable/8: share/man/man4 sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 07:15:05 -0000 Author: ae Date: Tue Mar 15 07:15:04 2011 New Revision: 219660 URL: http://svn.freebsd.org/changeset/base/219660 Log: MFC r219127: Add XMIT_FAILOVER transmit algorithm to ng_one2many node. Packets are delivered out the first active "many" hook. PR: kern/137775 Submitted by: Maxim Ignatenko Modified: stable/8/share/man/man4/ng_one2many.4 stable/8/sys/netgraph/ng_one2many.c stable/8/sys/netgraph/ng_one2many.h Directory Properties: stable/8/share/man/man4/ (props changed) 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/share/man/man4/ng_one2many.4 ============================================================================== --- stable/8/share/man/man4/ng_one2many.4 Tue Mar 15 06:53:33 2011 (r219659) +++ stable/8/share/man/man4/ng_one2many.4 Tue Mar 15 07:15:04 2011 (r219660) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2006 +.Dd March 1, 2011 .Dt NG_ONE2MANY 4 .Os .Sh NAME @@ -96,6 +96,10 @@ hooks. Each packet goes out each .Dv many hook. +.It Dv NG_ONE2MANY_XMIT_FAILOVER +Packets are delivered out the first active +.Dv many +hook. .El .Pp In the future other algorithms may be added as well. Modified: stable/8/sys/netgraph/ng_one2many.c ============================================================================== --- stable/8/sys/netgraph/ng_one2many.c Tue Mar 15 06:53:33 2011 (r219659) +++ stable/8/sys/netgraph/ng_one2many.c Tue Mar 15 07:15:04 2011 (r219660) @@ -278,6 +278,7 @@ ng_one2many_rcvmsg(node_p node, item_p i switch (conf->xmitAlg) { case NG_ONE2MANY_XMIT_ROUNDROBIN: case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; default: error = EINVAL; @@ -473,6 +474,9 @@ ng_one2many_rcvdata(hook_p hook, item_p NG_SEND_DATA_ONLY(error, mdst->hook, m2); } break; + case NG_ONE2MANY_XMIT_FAILOVER: + dst = &priv->many[priv->activeMany[0]]; + break; #ifdef INVARIANTS default: panic("%s: invalid xmitAlg", __func__); @@ -583,6 +587,7 @@ ng_one2many_update_many(priv_p priv) priv->nextMany %= priv->numActiveMany; break; case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; #ifdef INVARIANTS default: Modified: stable/8/sys/netgraph/ng_one2many.h ============================================================================== --- stable/8/sys/netgraph/ng_one2many.h Tue Mar 15 06:53:33 2011 (r219659) +++ stable/8/sys/netgraph/ng_one2many.h Tue Mar 15 07:15:04 2011 (r219660) @@ -61,6 +61,7 @@ /* Algorithms for outgoing packet distribution (XXX only one so far) */ #define NG_ONE2MANY_XMIT_ROUNDROBIN 1 /* round-robin delivery */ #define NG_ONE2MANY_XMIT_ALL 2 /* send packets to all many hooks */ +#define NG_ONE2MANY_XMIT_FAILOVER 3 /* send packets to first active "many" */ /* Algorithms for detecting link failure (XXX only one so far) */ #define NG_ONE2MANY_FAIL_MANUAL 1 /* use enabledLinks[] array */ From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 07:15:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 630011065677; Tue, 15 Mar 2011 07:15:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4853F8FC08; Tue, 15 Mar 2011 07:15: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 p2F7FkxD025083; Tue, 15 Mar 2011 07:15:46 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2F7FkX7025079; Tue, 15 Mar 2011 07:15:46 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201103150715.p2F7FkX7025079@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 15 Mar 2011 07:15: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: r219661 - in stable/7: share/man/man4 sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 07:15:47 -0000 Author: ae Date: Tue Mar 15 07:15:46 2011 New Revision: 219661 URL: http://svn.freebsd.org/changeset/base/219661 Log: MFC r219127: Add XMIT_FAILOVER transmit algorithm to ng_one2many node. Packets are delivered out the first active "many" hook. PR: kern/137775 Submitted by: Maxim Ignatenko Modified: stable/7/share/man/man4/ng_one2many.4 stable/7/sys/netgraph/ng_one2many.c stable/7/sys/netgraph/ng_one2many.h Directory Properties: stable/7/share/man/man4/ (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) Modified: stable/7/share/man/man4/ng_one2many.4 ============================================================================== --- stable/7/share/man/man4/ng_one2many.4 Tue Mar 15 07:15:04 2011 (r219660) +++ stable/7/share/man/man4/ng_one2many.4 Tue Mar 15 07:15:46 2011 (r219661) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2006 +.Dd March 1, 2011 .Dt NG_ONE2MANY 4 .Os .Sh NAME @@ -96,6 +96,10 @@ hooks. Each packet goes out each .Dv many hook. +.It Dv NG_ONE2MANY_XMIT_FAILOVER +Packets are delivered out the first active +.Dv many +hook. .El .Pp In the future other algorithms may be added as well. Modified: stable/7/sys/netgraph/ng_one2many.c ============================================================================== --- stable/7/sys/netgraph/ng_one2many.c Tue Mar 15 07:15:04 2011 (r219660) +++ stable/7/sys/netgraph/ng_one2many.c Tue Mar 15 07:15:46 2011 (r219661) @@ -278,6 +278,7 @@ ng_one2many_rcvmsg(node_p node, item_p i switch (conf->xmitAlg) { case NG_ONE2MANY_XMIT_ROUNDROBIN: case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; default: error = EINVAL; @@ -473,6 +474,9 @@ ng_one2many_rcvdata(hook_p hook, item_p NG_SEND_DATA_ONLY(error, mdst->hook, m2); } break; + case NG_ONE2MANY_XMIT_FAILOVER: + dst = &priv->many[priv->activeMany[0]]; + break; #ifdef INVARIANTS default: panic("%s: invalid xmitAlg", __func__); @@ -583,6 +587,7 @@ ng_one2many_update_many(priv_p priv) priv->nextMany %= priv->numActiveMany; break; case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; #ifdef INVARIANTS default: Modified: stable/7/sys/netgraph/ng_one2many.h ============================================================================== --- stable/7/sys/netgraph/ng_one2many.h Tue Mar 15 07:15:04 2011 (r219660) +++ stable/7/sys/netgraph/ng_one2many.h Tue Mar 15 07:15:46 2011 (r219661) @@ -61,6 +61,7 @@ /* Algorithms for outgoing packet distribution (XXX only one so far) */ #define NG_ONE2MANY_XMIT_ROUNDROBIN 1 /* round-robin delivery */ #define NG_ONE2MANY_XMIT_ALL 2 /* send packets to all many hooks */ +#define NG_ONE2MANY_XMIT_FAILOVER 3 /* send packets to first active "many" */ /* Algorithms for detecting link failure (XXX only one so far) */ #define NG_ONE2MANY_FAIL_MANUAL 1 /* use enabledLinks[] array */ From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 08:21:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86C031065673; Tue, 15 Mar 2011 08:21:00 +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 72EA58FC17; Tue, 15 Mar 2011 08:21: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 p2F8L0Mc026390; Tue, 15 Mar 2011 08:21:00 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2F8Kxex026359; Tue, 15 Mar 2011 08:20:59 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201103150820.p2F8Kxex026359@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 15 Mar 2011 08:20: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: r219662 - in stable/8/sys: amd64/amd64 arm/at91 arm/mv arm/sa11x0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa boot/common boot/forth i386/i386 i386/xen ia64/ia6... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 08:21:00 -0000 Author: pluknet Date: Tue Mar 15 08:20:59 2011 New Revision: 219662 URL: http://svn.freebsd.org/changeset/base/219662 Log: MFC kern.msgbufsize: r217688-217689,r217709,r218666-218667,r218913. Note, that arm/{s3c2xx0,econa} exist only in head, thus not merged. r217688: Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize. r217689: Add kern.msgbufsize default setting to /boot/defaults/loader.conf. r217709,218666-218667,218913 by marcel, cognet: Fix up for various arm subtargets: call init_param1() before we use msgbufsize, now that the size of the message buffer is a tunable. Reviewed by: marcel Approved by: avg (mentor) Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/arm/at91/at91_machdep.c stable/8/sys/arm/mv/mv_machdep.c stable/8/sys/arm/sa11x0/assabet_machdep.c stable/8/sys/arm/xscale/i80321/ep80219_machdep.c stable/8/sys/arm/xscale/i80321/iq31244_machdep.c stable/8/sys/arm/xscale/i8134x/crb_machdep.c stable/8/sys/arm/xscale/ixp425/avila_machdep.c stable/8/sys/arm/xscale/pxa/pxa_machdep.c stable/8/sys/boot/common/loader.8 stable/8/sys/boot/forth/loader.conf stable/8/sys/i386/i386/machdep.c stable/8/sys/i386/i386/pmap.c stable/8/sys/i386/xen/pmap.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/kern/subr_param.c stable/8/sys/mips/mips/machdep.c stable/8/sys/mips/mips/pmap.c stable/8/sys/pc98/pc98/machdep.c stable/8/sys/powerpc/aim/machdep.c stable/8/sys/powerpc/aim/mmu_oea.c stable/8/sys/powerpc/aim/mmu_oea64.c stable/8/sys/powerpc/booke/machdep.c stable/8/sys/powerpc/booke/pmap.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/pmap.c stable/8/sys/sun4v/sun4v/machdep.c stable/8/sys/sun4v/sun4v/pmap.c stable/8/sys/sys/msgbuf.h stable/8/sys/vm/vm_page.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/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/amd64/amd64/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" -#include "opt_msgbuf.h" #include "opt_perfmon.h" #include "opt_sched.h" #include "opt_kdtrace.h" @@ -1511,7 +1510,7 @@ do_next: * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) >= phys_avail[pa_indx]) { + round_page(msgbufsize) >= phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -1520,7 +1519,7 @@ do_next: Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]); @@ -1721,7 +1720,7 @@ hammer_time(u_int64_t modulep, u_int64_t /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); fpuinit(); /* transfer to user mode */ Modified: stable/8/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/8/sys/arm/at91/at91_machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/arm/at91/at91_machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -43,8 +43,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -230,6 +228,9 @@ initarm(void *arg, void *arg2) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + /* Do basic tuning, hz etc */ + init_param1(); + freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ @@ -274,7 +275,7 @@ initarm(void *arg, void *arg2) valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -319,7 +320,7 @@ initarm(void *arg, void *arg2) pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); pmap_map_chunk(l1pagetable, msgbufpv.pv_va, msgbufpv.pv_pa, - MSGBUF_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + msgbufsize, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va, @@ -396,7 +397,7 @@ initarm(void *arg, void *arg2) KERNVIRTADDR + 3 * memsize, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; @@ -408,8 +409,6 @@ initarm(void *arg, void *arg2) phys_avail[i++] = PHYSADDR + memsize; phys_avail[i++] = 0; phys_avail[i++] = 0; - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: stable/8/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/8/sys/arm/mv/mv_machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/arm/mv/mv_machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -35,7 +35,6 @@ * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 */ -#include "opt_msgbuf.h" #include "opt_ddb.h" #include @@ -491,7 +490,10 @@ initarm(void *mdp, void *unused __unused valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + + init_param1(); + + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -620,7 +622,7 @@ initarm(void *mdp, void *unused __unused pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); /* @@ -631,7 +633,6 @@ initarm(void *mdp, void *unused __unused physmap_init((mdp != NULL) ? 0 : 1); /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: stable/8/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- stable/8/sys/arm/sa11x0/assabet_machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/arm/sa11x0/assabet_machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -227,6 +227,9 @@ initarm(void *arg, void *arg2) pcpu_init(pc, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + /* Do basic tuning, hz etc */ + init_param1(); + physical_start = (vm_offset_t) KERNBASE; physical_end = lastaddr; physical_freestart = (((vm_offset_t)physical_end) + PAGE_MASK) & ~PAGE_MASK; @@ -409,8 +412,6 @@ initarm(void *arg, void *arg2) mutex_init(); pmap_bootstrap(freemempos, 0xd0000000, &kernel_l1pt); - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: stable/8/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- stable/8/sys/arm/xscale/i80321/ep80219_machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/arm/xscale/i80321/ep80219_machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -212,6 +210,9 @@ initarm(void *arg, void *arg2) (var) = freemempos; \ memset((char *)(var), 0, ((np) * PAGE_SIZE)); + /* Do basic tuning, hz etc */ + init_param1(); + while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) freemempos -= PAGE_SIZE; valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); @@ -247,7 +248,7 @@ initarm(void *arg, void *arg2) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -397,7 +398,7 @@ initarm(void *arg, void *arg2) pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; @@ -413,8 +414,6 @@ initarm(void *arg, void *arg2) phys_avail[i++] = 0; phys_avail[i] = 0; - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: stable/8/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- stable/8/sys/arm/xscale/i80321/iq31244_machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/arm/xscale/i80321/iq31244_machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -202,6 +200,9 @@ initarm(void *arg, void *arg2) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + /* Do basic tuning, hz etc */ + init_param1(); + freemempos = 0xa0200000; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ @@ -247,7 +248,7 @@ initarm(void *arg, void *arg2) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -403,7 +404,7 @@ initarm(void *arg, void *arg2) pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; @@ -419,8 +420,6 @@ initarm(void *arg, void *arg2) phys_avail[i++] = 0; phys_avail[i] = 0; - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: stable/8/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- stable/8/sys/arm/xscale/i8134x/crb_machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/arm/xscale/i8134x/crb_machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -242,7 +240,7 @@ initarm(void *arg, void *arg2) valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -375,7 +373,7 @@ initarm(void *arg, void *arg2) pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; Modified: stable/8/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- stable/8/sys/arm/xscale/ixp425/avila_machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/arm/xscale/ixp425/avila_machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD$"); @@ -247,6 +245,9 @@ initarm(void *arg, void *arg2) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + /* Do basic tuning, hz etc */ + init_param1(); + /* * We allocate memory downwards from where we were loaded * by RedBoot; first the L1 page table, then NUM_KERNEL_PTS @@ -314,7 +315,7 @@ initarm(void *arg, void *arg2) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -460,7 +461,7 @@ initarm(void *arg, void *arg2) pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; @@ -476,8 +477,6 @@ initarm(void *arg, void *arg2) phys_avail[i++] = 0; phys_avail[i] = 0; - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); Modified: stable/8/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- stable/8/sys/arm/xscale/pxa/pxa_machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/arm/xscale/pxa/pxa_machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -45,7 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" #include "opt_ddb.h" #include @@ -183,6 +182,9 @@ initarm(void *arg, void *arg2) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + /* Do basic tuning, hz etc */ + init_param1(); + freemempos = 0xa0200000; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ @@ -229,7 +231,7 @@ initarm(void *arg, void *arg2) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -393,7 +395,7 @@ initarm(void *arg, void *arg2) dump_avail[i] = 0; pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; @@ -425,8 +427,6 @@ initarm(void *arg, void *arg2) phys_avail[0] = round_page(virtual_avail - KERNBASE + phys_avail[0]); #endif - /* Do basic tuning, hz etc */ - init_param1(); init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: stable/8/sys/boot/common/loader.8 ============================================================================== --- stable/8/sys/boot/common/loader.8 Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/boot/common/loader.8 Tue Mar 15 08:20:59 2011 (r219662) @@ -615,6 +615,14 @@ Note that the NBUF parameter will override this limit. Modifies .Dv VM_BCACHE_SIZE_MAX . +.It Va kern.msgbufsize +Sets the size of the kernel message buffer. +The default limit of 64KB is usually sufficient unless +large amounts of trace data need to be collected +between opportunities to examine the buffer or +dump it to a file. +Overrides kernel option +.Dv MSGBUF_SIZE . .It Va machdep.disable_mtrrs Disable the use of i686 MTRRs (x86 only). .It Va net.inet.tcp.tcbhashsize Modified: stable/8/sys/boot/forth/loader.conf ============================================================================== --- stable/8/sys/boot/forth/loader.conf Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/boot/forth/loader.conf Tue Mar 15 08:20:59 2011 (r219662) @@ -99,6 +99,7 @@ module_path="/boot/modules" # Set the mo #kern.maxswzone="" # Set the max swmeta KVA storage #kern.maxtsiz="" # Set the max text size #kern.maxusers="32" # Set size of various static tables +#kern.msgbufsize="65536" # Set size of kernel message buffer #kern.nbuf="" # Set the number of buffer headers #kern.ncallout="" # Set the maximum # of timer events #kern.ngroups="1023" # Set the maximum # of supplemental groups Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/i386/i386/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" -#include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" #include "opt_xbox.h" @@ -2116,7 +2115,7 @@ getmemsize(int first) physmem = Maxmem; basemem = 0; physmap[0] = init_first << PAGE_SHIFT; - physmap[1] = ptoa(Maxmem) - round_page(MSGBUF_SIZE); + physmap[1] = ptoa(Maxmem) - round_page(msgbufsize); physmap_idx = 0; #else #ifdef XBOX @@ -2467,7 +2466,7 @@ do_next: * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) >= phys_avail[pa_indx]) { + round_page(msgbufsize) >= phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -2476,10 +2475,10 @@ do_next: Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) + for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); @@ -2690,7 +2689,7 @@ init386(first) /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* transfer to user mode */ _ucodesel = GSEL(GUCODE_SEL, SEL_UPL); @@ -2951,7 +2950,7 @@ init386(first) /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* make a call gate to reenter kernel with */ gdp = &ldt[LSYS5CALLS_SEL].gd; Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/i386/i386/pmap.c Tue Mar 15 08:20:59 2011 (r219662) @@ -105,7 +105,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_pmap.h" -#include "opt_msgbuf.h" #include "opt_smp.h" #include "opt_xbox.h" @@ -452,7 +451,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * msgbufp is used to map the system message buffer. */ - SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(MSGBUF_SIZE))) + SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(msgbufsize))) /* * KPTmap is used by pmap_kextract(). Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/i386/xen/pmap.c Tue Mar 15 08:20:59 2011 (r219662) @@ -107,7 +107,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_pmap.h" -#include "opt_msgbuf.h" #include "opt_smp.h" #include "opt_xbox.h" @@ -470,7 +469,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * msgbufp is used to map the system message buffer. */ - SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(MSGBUF_SIZE))) + SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(msgbufsize))) /* * ptemap is used for pmap_pte_quick Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/ia64/ia64/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_sched.h" #include @@ -888,8 +887,8 @@ ia64_init(void) /* * Initialize error message buffer (at end of core). */ - msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufp = (struct msgbuf *)pmap_steal_memory(msgbufsize); + msgbufinit(msgbufp, msgbufsize); proc_linkup0(&proc0, &thread0); /* Modified: stable/8/sys/kern/subr_param.c ============================================================================== --- stable/8/sys/kern/subr_param.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/kern/subr_param.c Tue Mar 15 08:20:59 2011 (r219662) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_param.h" +#include "opt_msgbuf.h" #include "opt_maxusers.h" #include @@ -45,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -83,6 +85,7 @@ int maxproc; /* maximum # of processes int maxprocperuid; /* max # of procs per user */ int maxfiles; /* sys. wide open files limit */ int maxfilesperproc; /* per-proc open files limit */ +int msgbufsize; /* size of kernel message buffer */ int ncallout; /* maximum # of timer events */ int nbuf; int ngroups_max; /* max # groups per process */ @@ -106,6 +109,8 @@ SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLA "Number of buffers in the buffer cache"); SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0, "Number of swap buffers"); +SYSCTL_INT(_kern, OID_AUTO, msgbufsize, CTLFLAG_RDTUN, &msgbufsize, 0, + "Size of the kernel message buffer"); SYSCTL_LONG(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0, "Maximum memory for swap metadata"); SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0, @@ -218,6 +223,8 @@ init_param1(void) maxbcache = VM_BCACHE_SIZE_MAX; #endif TUNABLE_LONG_FETCH("kern.maxbcache", &maxbcache); + msgbufsize = MSGBUF_SIZE; + TUNABLE_INT_FETCH("kern.msgbufsize", &msgbufsize); maxtsiz = MAXTSIZ; TUNABLE_ULONG_FETCH("kern.maxtsiz", &maxtsiz); Modified: stable/8/sys/mips/mips/machdep.c ============================================================================== --- stable/8/sys/mips/mips/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/mips/mips/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cputype.h" #include "opt_ddb.h" #include "opt_md.h" -#include "opt_msgbuf.h" #include #include Modified: stable/8/sys/mips/mips/pmap.c ============================================================================== --- stable/8/sys/mips/mips/pmap.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/mips/mips/pmap.c Tue Mar 15 08:20:59 2011 (r219662) @@ -68,7 +68,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_msgbuf.h" #include "opt_ddb.h" #include @@ -553,8 +552,8 @@ again: /* * Steal the message buffer from the beginning of memory. */ - msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufp = (struct msgbuf *)pmap_steal_memory(msgbufsize); + msgbufinit(msgbufp, msgbufsize); /* * Steal thread0 kstack. Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/pc98/pc98/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" -#include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" @@ -2055,7 +2054,7 @@ do_next: * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) >= phys_avail[pa_indx]) { + round_page(msgbufsize) >= phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -2064,10 +2063,10 @@ do_next: Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) + for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); } @@ -2282,7 +2281,7 @@ init386(first) /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* make a call gate to reenter kernel with */ gdp = &ldt[LSYS5CALLS_SEL].gd; Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/powerpc/aim/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -516,7 +515,7 @@ powerpc_init(u_int startkernel, u_int en pc->pc_curpcb = thread0.td_pcb; /* Initialise the message buffer. */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); #ifdef KDB if (boothowto & RB_KDB) Modified: stable/8/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/powerpc/aim/mmu_oea.c Tue Mar 15 08:20:59 2011 (r219662) @@ -961,10 +961,10 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k /* * Allocate virtual address space for the message buffer. */ - pa = msgbuf_phys = moea_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE); + pa = msgbuf_phys = moea_bootstrap_alloc(msgbufsize, PAGE_SIZE); msgbufp = (struct msgbuf *)virtual_avail; va = virtual_avail; - virtual_avail += round_page(MSGBUF_SIZE); + virtual_avail += round_page(msgbufsize); while (va < virtual_avail) { moea_kenter(mmup, va, pa); pa += PAGE_SIZE; Modified: stable/8/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea64.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/powerpc/aim/mmu_oea64.c Tue Mar 15 08:20:59 2011 (r219662) @@ -1018,10 +1018,10 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o /* * Allocate virtual address space for the message buffer. */ - pa = msgbuf_phys = moea64_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE); + pa = msgbuf_phys = moea64_bootstrap_alloc(msgbufsize, PAGE_SIZE); msgbufp = (struct msgbuf *)virtual_avail; va = virtual_avail; - virtual_avail += round_page(MSGBUF_SIZE); + virtual_avail += round_page(msgbufsize); while (va < virtual_avail) { moea64_kenter(mmup, va, pa); pa += PAGE_SIZE; Modified: stable/8/sys/powerpc/booke/machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/powerpc/booke/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -450,7 +449,7 @@ e500_init(u_int32_t startkernel, u_int32 pc->pc_curpcb = thread0.td_pcb; /* Initialise the message buffer. */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* Enable Machine Check interrupt. */ mtmsr(mfmsr() | PSL_ME); Modified: stable/8/sys/powerpc/booke/pmap.c ============================================================================== --- stable/8/sys/powerpc/booke/pmap.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/powerpc/booke/pmap.c Tue Mar 15 08:20:59 2011 (r219662) @@ -984,7 +984,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Allocate space for the message buffer. */ msgbufp = (struct msgbuf *)data_end; - data_end += MSGBUF_SIZE; + data_end += msgbufsize; debugf(" msgbufp at 0x%08x end = 0x%08x\n", (uint32_t)msgbufp, data_end); Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/sparc64/sparc64/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -581,7 +580,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * buffer (after setting the trap table). */ dpcpu_init(dpcpu0, 0); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* * Initialize mutexes. Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/sparc64/sparc64/pmap.c Tue Mar 15 08:20:59 2011 (r219662) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); */ #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_pmap.h" #include @@ -399,7 +398,7 @@ pmap_bootstrap(u_int cpu_impl) /* * Allocate and map the message buffer. */ - pa = pmap_bootstrap_alloc(MSGBUF_SIZE, colors); + pa = pmap_bootstrap_alloc(msgbufsize, colors); msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(pa); /* Modified: stable/8/sys/sun4v/sun4v/machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/sun4v/sun4v/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -503,7 +502,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l */ BVPRINTF("initialize msgbuf\n"); dpcpu_init(dpcpu0, 0); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); BVPRINTF("initialize mutexes\n"); mutex_init(); Modified: stable/8/sys/sun4v/sun4v/pmap.c ============================================================================== --- stable/8/sys/sun4v/sun4v/pmap.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/sun4v/sun4v/pmap.c Tue Mar 15 08:20:59 2011 (r219662) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_pmap.h" #include "opt_trap_trace.h" @@ -779,7 +778,7 @@ skipshuffle: /* * Allocate and map the message buffer. */ - msgbuf_phys = pmap_bootstrap_alloc(MSGBUF_SIZE); + msgbuf_phys = pmap_bootstrap_alloc(msgbufsize); msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(msgbuf_phys); /* Modified: stable/8/sys/sys/msgbuf.h ============================================================================== --- stable/8/sys/sys/msgbuf.h Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/sys/msgbuf.h Tue Mar 15 08:20:59 2011 (r219662) @@ -52,6 +52,7 @@ struct msgbuf { #define MSGBUF_SEQSUB(mbp, seq1, seq2) (MSGBUF_SEQNORM((mbp), (seq1) - (seq2))) #ifdef _KERNEL +extern int msgbufsize; extern int msgbuftrigger; extern struct msgbuf *msgbufp; Modified: stable/8/sys/vm/vm_page.c ============================================================================== --- stable/8/sys/vm/vm_page.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/vm/vm_page.c Tue Mar 15 08:20:59 2011 (r219662) @@ -100,7 +100,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_msgbuf.h" #include "opt_vm.h" #include @@ -322,7 +321,7 @@ vm_page_startup(vm_offset_t vaddr) * through the direct map, they are not automatically included. */ pa = DMAP_TO_PHYS((vm_offset_t)msgbufp->msg_ptr); - last_pa = pa + round_page(MSGBUF_SIZE); + last_pa = pa + round_page(msgbufsize); while (pa < last_pa) { dump_add_page(pa); pa += PAGE_SIZE; From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 10:13:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6EEC106564A; Tue, 15 Mar 2011 10:13:35 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B82868FC08; Tue, 15 Mar 2011 10:13: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 p2FADZIx039717; Tue, 15 Mar 2011 10:13:35 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FADZt0039715; Tue, 15 Mar 2011 10:13:35 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201103151013.p2FADZt0039715@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 15 Mar 2011 10:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219663 - head/etc/pam.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 10:13:35 -0000 Author: des Date: Tue Mar 15 10:13:35 2011 New Revision: 219663 URL: http://svn.freebsd.org/changeset/base/219663 Log: Forgot to commit this change along with r219563: pam_group(8) now issues a warning if neither luser nor ruser is specified. The correct option for su(1) is ruser. MFC after: 1 month Modified: head/etc/pam.d/su Modified: head/etc/pam.d/su ============================================================================== --- head/etc/pam.d/su Tue Mar 15 08:20:59 2011 (r219662) +++ head/etc/pam.d/su Tue Mar 15 10:13:35 2011 (r219663) @@ -7,7 +7,7 @@ # auth auth sufficient pam_rootok.so no_warn auth sufficient pam_self.so no_warn -auth requisite pam_group.so no_warn group=wheel root_only fail_safe +auth requisite pam_group.so no_warn group=wheel root_only fail_safe ruser auth include system # account From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 10:17:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F6AD106566B; Tue, 15 Mar 2011 10:17:18 +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 4FBDA8FC14; Tue, 15 Mar 2011 10:17: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 p2FAHIeI039823; Tue, 15 Mar 2011 10:17:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FAHIpQ039821; Tue, 15 Mar 2011 10:17:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201103151017.p2FAHIpQ039821@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Mar 2011 10:17: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: r219664 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 10:17:18 -0000 Author: kib Date: Tue Mar 15 10:17:18 2011 New Revision: 219664 URL: http://svn.freebsd.org/changeset/base/219664 Log: MFC r219396: Do not assert buffer lock in VFS_STRATEGY() when kernel already paniced. Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/kern/vfs_subr.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/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Tue Mar 15 10:13:35 2011 (r219663) +++ stable/8/sys/kern/vfs_subr.c Tue Mar 15 10:17:18 2011 (r219664) @@ -3863,7 +3863,7 @@ vop_strategy_pre(void *ap) if ((bp->b_flags & B_CLUSTER) != 0) return; - if (!BUF_ISLOCKED(bp)) { + if (panicstr == NULL && !BUF_ISLOCKED(bp)) { if (vfs_badlock_print) printf( "VOP_STRATEGY: bp is not locked but should be\n"); From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 13:19:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA461065672; Tue, 15 Mar 2011 13:19:27 +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 E142A8FC13; Tue, 15 Mar 2011 13:19:26 +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 p2FDJQrF044062; Tue, 15 Mar 2011 13:19:26 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FDJQos044060; Tue, 15 Mar 2011 13:19:26 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201103151319.p2FDJQos044060@svn.freebsd.org> From: Alexander Leidinger Date: Tue, 15 Mar 2011 13:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219666 - stable/8/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 13:19:27 -0000 Author: netchild Date: Tue Mar 15 13:19:26 2011 New Revision: 219666 URL: http://svn.freebsd.org/changeset/base/219666 Log: MFC r218497: Linux' shm_open() fails because it wants to find some funky shmfs to construct the full pathname. It starts to search at the default mountpoint which is /dev/shm. If this fails it runs through fstab and searches for shmfs and tmpfs. Whatever it finds will be statfs()'ed to be checked for Linux' fs magic for shmfs (0x01021994). Ideally our tmpfs should deliver this fs magic to Linux processes, but as our tmpfs is considered to be an experimental feature we can not assume that there is always a tmpfs available. To make shared memory work in the Linuxulator, force the fs type of /dev/shm (which can be a symlink) to match what Linux expects. The user is responsible (info has to be added to the linux base ports and the docs) to setup a suitable link for /dev/shm. Noticed by: Andre Albsmeier Submitted by: Andre Albsmeier Modified: stable/8/sys/compat/linux/linux_stats.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_stats.c ============================================================================== --- stable/8/sys/compat/linux/linux_stats.c Tue Mar 15 12:24:40 2011 (r219665) +++ stable/8/sys/compat/linux/linux_stats.c Tue Mar 15 13:19:26 2011 (r219666) @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); #include +#define LINUX_SHMFS_MAGIC 0x01021994 + static void translate_vnhook_major_minor(struct vnode *vp, struct stat *sb) { @@ -390,7 +392,7 @@ linux_statfs(struct thread *td, struct l struct l_statfs linux_statfs; struct statfs bsd_statfs; char *path; - int error; + int error, dev_shm; LCONVPATHEXIST(td, args->path, &path); @@ -398,11 +400,17 @@ linux_statfs(struct thread *td, struct l if (ldebug(statfs)) printf(ARGS(statfs, "%s, *"), path); #endif + dev_shm = 0; error = kern_statfs(td, path, UIO_SYSSPACE, &bsd_statfs); + if (strncmp(path, "/dev/shm", sizeof("/dev/shm") - 1) == 0) + dev_shm = (path[8] == '\0' + || (path[8] == '/' && path[9] == '\0')); LFREEPATH(path); if (error) return (error); bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + if (dev_shm) + linux_statfs.f_type = LINUX_SHMFS_MAGIC; return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 13:27:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D601106566C; Tue, 15 Mar 2011 13:27:35 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38D508FC0C; Tue, 15 Mar 2011 13:27: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 p2FDRZXO044317; Tue, 15 Mar 2011 13:27:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FDRZPK044315; Tue, 15 Mar 2011 13:27:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103151327.p2FDRZPK044315@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 15 Mar 2011 13:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 13:27:35 -0000 Author: nwhitehorn Date: Tue Mar 15 13:27:34 2011 New Revision: 219667 URL: http://svn.freebsd.org/changeset/base/219667 Log: Turn on softupdates by default. We need a UI to set filesystem parameters. Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Tue Mar 15 13:19:26 2011 (r219666) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Tue Mar 15 13:27:34 2011 (r219667) @@ -496,7 +496,7 @@ set_default_part_metadata(const char *na if (strcmp(type, "freebsd-ufs") == 0) { md->newfs = malloc(255); - sprintf(md->newfs, "newfs /dev/%s", name); + sprintf(md->newfs, "newfs -U /dev/%s", name); } } From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 13:40:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9693D106564A; Tue, 15 Mar 2011 13:40:47 +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 68AF88FC08; Tue, 15 Mar 2011 13:40: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 p2FDelbV044617; Tue, 15 Mar 2011 13:40:47 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FDelBq044614; Tue, 15 Mar 2011 13:40:47 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201103151340.p2FDelBq044614@svn.freebsd.org> From: Alexander Leidinger Date: Tue, 15 Mar 2011 13:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219668 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 13:40:47 -0000 Author: netchild Date: Tue Mar 15 13:40:47 2011 New Revision: 219668 URL: http://svn.freebsd.org/changeset/base/219668 Log: Staticize functions which are not used somewhere else, move the corresponding prototypes from the header to the code file. Modified: head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_mib.h Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Tue Mar 15 13:27:34 2011 (r219667) +++ head/sys/compat/linux/linux_mib.c Tue Mar 15 13:40:47 2011 (r219668) @@ -69,6 +69,10 @@ static unsigned linux_osd_jail_slot; SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, "Linux mode"); +static int linux_set_osname(struct thread *td, char *osname); +static int linux_set_osrelease(struct thread *td, char *osrelease); +static int linux_set_oss_version(struct thread *td, int oss_version); + static int linux_sysctl_osname(SYSCTL_HANDLER_ARGS) { @@ -469,7 +473,7 @@ linux_get_osname(struct thread *td, char mtx_unlock(&pr->pr_mtx); } -int +static int linux_set_osname(struct thread *td, char *osname) { struct prison *pr; @@ -505,7 +509,7 @@ linux_kernver(struct thread *td) return (osrel); } -int +static int linux_set_osrelease(struct thread *td, char *osrelease) { struct prison *pr; @@ -533,7 +537,7 @@ linux_get_oss_version(struct thread *td) return (version); } -int +static int linux_set_oss_version(struct thread *td, int oss_version) { struct prison *pr; Modified: head/sys/compat/linux/linux_mib.h ============================================================================== --- head/sys/compat/linux/linux_mib.h Tue Mar 15 13:27:34 2011 (r219667) +++ head/sys/compat/linux/linux_mib.h Tue Mar 15 13:40:47 2011 (r219668) @@ -35,13 +35,10 @@ void linux_osd_jail_register(void); void linux_osd_jail_deregister(void); void linux_get_osname(struct thread *td, char *dst); -int linux_set_osname(struct thread *td, char *osname); void linux_get_osrelease(struct thread *td, char *dst); -int linux_set_osrelease(struct thread *td, char *osrelease); int linux_get_oss_version(struct thread *td); -int linux_set_oss_version(struct thread *td, int oss_version); int linux_kernver(struct thread *td); From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 13:53:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37514106566B; Tue, 15 Mar 2011 13:53:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22C728FC08; Tue, 15 Mar 2011 13:53: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 p2FDreMv044906; Tue, 15 Mar 2011 13:53:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FDre4B044904; Tue, 15 Mar 2011 13:53:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103151353.p2FDre4B044904@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 15 Mar 2011 13:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219669 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 13:53:40 -0000 Author: pjd Date: Tue Mar 15 13:53:39 2011 New Revision: 219669 URL: http://svn.freebsd.org/changeset/base/219669 Log: Remove #include needed for debugging. MFC after: 1 week Modified: head/sbin/hastd/proto_common.c Modified: head/sbin/hastd/proto_common.c ============================================================================== --- head/sbin/hastd/proto_common.c Tue Mar 15 13:40:47 2011 (r219668) +++ head/sbin/hastd/proto_common.c Tue Mar 15 13:53:39 2011 (r219669) @@ -104,7 +104,6 @@ proto_common_send(int sock, const unsign return (proto_descriptor_send(sock, fd)); } -#include static int proto_descriptor_recv(int sock, int *fdp) { From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 15:29:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 6E449106564A; Tue, 15 Mar 2011 15:29:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Maxim Dounin Date: Tue, 15 Mar 2011 11:29:31 -0400 User-Agent: KMail/1.6.2 References: <201103142330.p2ENUEL8014903@svn.freebsd.org> <20110315061957.GD99496@mdounin.ru> In-Reply-To: <20110315061957.GD99496@mdounin.ru> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103151129.34552.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219653 - in head/sys: arm/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 15:29:43 -0000 On Tuesday 15 March 2011 02:19 am, Maxim Dounin wrote: > Hello! > > On Mon, Mar 14, 2011 at 11:30:14PM +0000, Jung-uk Kim wrote: > > Author: jkim > > Date: Mon Mar 14 23:30:14 2011 > > New Revision: 219653 > > URL: http://svn.freebsd.org/changeset/base/219653 > > > > Log: > > Make get_cyclecount(9) little bit more useful where > > binuptime(9) is used. > > get_cyclecount(9) is for random harvesting, and dropping half of > it's entropy in binuptime() case may not be a good idea. I know it is used for random harvesting but we are not dropping much entropy here (if any). Because it is mostly used boot time, bt.sec is often times trivial. In other words, it only affects few lower bits (trivially) and other bits are just flipped. Basically, I am trying to preserve as much entropy as possible without losing historical get_cyclecount() semantics. > It's probably better to fix manpage instead, to clarify it's > intended usage. It had to be done long ago. :-( Jung-uk Kim > Maxim Dounin > > > Modified: > > head/sys/arm/include/cpu.h > > head/sys/i386/include/cpu.h > > > > Modified: head/sys/arm/include/cpu.h > > ================================================================= > >============= --- head/sys/arm/include/cpu.h Mon Mar 14 23:19:04 > > 2011 (r219652) +++ head/sys/arm/include/cpu.h Mon Mar 14 23:30:14 > > 2011 (r219653) @@ -16,7 +16,7 @@ get_cyclecount(void) > > struct bintime bt; > > > > binuptime(&bt); > > - return (bt.frac ^ bt.sec); > > + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); > > > > } > > #endif > > > > Modified: head/sys/i386/include/cpu.h > > ================================================================= > >============= --- head/sys/i386/include/cpu.h Mon Mar 14 23:19:04 > > 2011 (r219652) +++ head/sys/i386/include/cpu.h Mon Mar 14 > > 23:30:14 2011 (r219653) @@ -67,7 +67,7 @@ void swi_vm(void *); > > * Return contents of in-cpu fast counter as a sort of > > "bogo-time" * for random-harvesting purposes. > > */ > > -static __inline u_int64_t > > +static __inline uint64_t > > get_cyclecount(void) > > { > > #if defined(I486_CPU) || defined(KLD_MODULE) > > @@ -75,7 +75,7 @@ get_cyclecount(void) > > > > if (!tsc_present) { > > binuptime(&bt); > > - return (bt.frac ^ bt.sec); > > + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); > > } > > #endif > > return (rdtsc()); > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to > > "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 16:32:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 66527106564A; Tue, 15 Mar 2011 16:32:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Bruce Evans Date: Tue, 15 Mar 2011 12:32:34 -0400 User-Agent: KMail/1.6.2 References: <201103142205.p2EM5x6E012664@svn.freebsd.org> <20110315123819.X920@besplex.bde.org> In-Reply-To: <20110315123819.X920@besplex.bde.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103151232.35904.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219646 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 16:32:57 -0000 On Monday 14 March 2011 10:31 pm, Bruce Evans wrote: > On Mon, 14 Mar 2011, Jung-uk Kim wrote: > > Log: > > When TSC is unavailable, broken or disabled and the current > > timecounter has better quality than i8254 timer, use it for > > DELAY(9). > > You cannot use a random timecounter for DELAY(). DELAY() is > carefully written to not use any locks, so that it doesn't deadlock > when called in the "any" context from a bad console driver like > syscons when syscons is called from ddb. (Bad console drivers may > have their own locks which deadlock in ddb, but that is another > problem.) Even the i8254 timer, which is the only timer that > should be used by DELAY(), normally use locks that used to cause > deadlock, but DELAY() was unbroken to bypass the locks when it is > called from ddb. I disagree. I think we should keep away from i8254 as much as possible. Actually, i8254 is the only timer that requires locking in the first place because of its braindead design. All other x86 timers do not require any locking at all. We even sacrificed upper 32 bits of HPET in favor of i386. :-( > Cpufreq and other calibration code should use a normal timecounter > via nanouptime() in all cases and never go near low level > timecounters or DELAY(). There are (hopefully minor) problems > getting the nanotime() initialized before it used. The dummy > timecounter is just what you don't want to use. That's exactly the problem. > Even in this patch, it isn't clear that the low level timecounters > are initialized before they are used. The timecounter is always initialized first, then set. > > Modified: head/sys/x86/isa/clock.c > > ================================================================= > >============= --- head/sys/x86/isa/clock.c Mon Mar 14 19:31:43 > > 2011 (r219645) +++ head/sys/x86/isa/clock.c Mon Mar 14 22:05:59 > > 2011 (r219646) @@ -245,6 +245,42 @@ getit(void) > > return ((high << 8) | low); > > } > > > > +static __inline void > > +delay_tsc(int n) > > +{ > > + uint64_t start, end, now; > > + > > + sched_pin(); > > + start = rdtsc(); > > + end = start + (tsc_freq * n) / 1000000; > > + do { > > + cpu_spinwait(); > > + now = rdtsc(); > > + } while (now < end || (now > start && end < start)); > > + sched_unpin(); > > +} > > You cannot call random scheduling code from DELAY(), since the > scheduling code is not designed to be called in the "any" context. > As it happens, sched_pin() and sched_unpin() are safe, and were > already used in the TSC case. Actually, I really like to get rid of this code. It isn't safe for many reasons, e.g., its frequency may change while in the loop and end result is unpredictable if TSC is not invariant. We may limit its use for invariant case, though. > > + > > +static __inline void > > +delay_timecounter(struct timecounter *tc, int n) > > +{ > > + uint64_t end, now; > > + u_int last, mask, u; > > + > > + mask = tc->tc_counter_mask; > > + last = tc->tc_get_timecount(tc) & mask; > > + end = tc->tc_frequency * n / 1000000; > > This depends on the delicate timecounter locking to be safe. I > think it it is safe except possibly in tc_get_timecount(), for the > same reasons that nanouptime() can run safely with no visible > locking. tc must be the current timecounter/timehands, which is > guaranteed to not be in an in-between state or become so while we > are using it, despite there being no visible locking. Actually > there are some minor races: > - in nanouptime(), the timecounter generation is checked to avoid > using a new generation if necessary, but updates of the generation > count and the fileds that it protects are not properly atomic. > - here, the check of the generation is missing. So this works > without races when called from ddb (since ddb stops other CPUs), > but has minor races in general. Window of the races is very narrow here and it only happens on i386 where reading uint64_t is not atomic if my understanding is correct. It cannot be any worse than tsc_freq anyway. ;-) > > + now = 0; > > + do { > > + cpu_spinwait(); > > + u = tc->tc_get_timecount(tc) & mask; > > + if (u < last) > > + now += mask - last + u + 1; > > + else > > + now += u - last; > > + last = u; > > + } while (now < end); > > +} > > + > > /* > > * Wait "n" microseconds. > > * Relies on timer 1 counting down from (i8254_freq / hz) > > @@ -253,6 +289,7 @@ getit(void) > > void > > DELAY(int n) > > { > > + struct timecounter *tc; > > int delta, prev_tick, tick, ticks_left; > > > > #ifdef DELAYDEBUG > > @@ -262,16 +299,12 @@ DELAY(int n) > > #endif > > > > if (tsc_freq != 0) { > > - uint64_t start, end, now; > > - > > - sched_pin(); > > - start = rdtsc(); > > - end = start + (tsc_freq * n) / 1000000; > > - do { > > - cpu_spinwait(); > > - now = rdtsc(); > > - } while (now < end || (now > start && end < start)); > > - sched_unpin(); > > + delay_tsc(n); > > + return; > > + } > > + tc = timecounter; > > + if (tc->tc_quality > 0) { > > + delay_timecounter(tc, n); > > return; > > } > > Optimizing DELAY() was bogus. Now the loop for this is > duplicatied. "Bogus" optimization is not exactly duplicated here if you meant "(now < end || (now > start && end < start))" is bogus. Its bogusness comes from the fact that TSC is 64-bit. However, timecounter is effectively 32-bit because of its mask. Now overflow is carefully accounted for and it is (almost) correct. > > #ifdef DELAYDEBUG > > Stuff keeps accumulating or mutating above the code for testing it. Yeah, one more reason to get rid of delay_tsc(). ;-) Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 16:36:12 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAA471065676; Tue, 15 Mar 2011 16:36:12 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from ixe-mta-27.emailfiltering.com (ixe-mta-27-tx.emailfiltering.com [194.116.199.158]) by mx1.freebsd.org (Postfix) with ESMTP id B13EE8FC18; Tue, 15 Mar 2011 16:36:11 +0000 (UTC) Received: from mail-gw14.york.ac.uk ([144.32.129.164]) by ixe-mta-27.emailfiltering.com with emfmta (version 4.8.0.437) by TLS id 987278498 for nwhitehorn@FreeBSD.org; 1269a6b26751b43b; Tue, 15 Mar 2011 14:19:34 +0000 Received: from buffy-128.york.ac.uk ([144.32.128.160]:64149 helo=buffy.york.ac.uk) by mail-gw14.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PzV5x-0000e9-SS; Tue, 15 Mar 2011 14:19:33 +0000 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.4/8.14.4) with ESMTP id p2FEJXVx088892; Tue, 15 Mar 2011 14:19:33 GMT (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.4/8.14.4/Submit) id p2FEJXkg088891; Tue, 15 Mar 2011 14:19:33 GMT (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Nathan Whitehorn In-Reply-To: <201103151327.p2FDRZPK044315@svn.freebsd.org> References: <201103151327.p2FDRZPK044315@svn.freebsd.org> Content-Type: text/plain; charset="ASCII" Content-Transfer-Encoding: quoted-printable Date: Tue, 15 Mar 2011 14:19:33 +0000 Message-ID: <1300198773.87705.25.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 16:36:12 -0000 On Tue, 2011-03-15 at 13:27 +0000, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Tue Mar 15 13:27:34 2011 > New Revision: 219667 > URL: http://svn.freebsd.org/changeset/base/219667 >=20 > Log: > Turn on softupdates by default. We need a UI to set filesystem > parameters. >=20 > Modified: > head/usr.sbin/bsdinstall/partedit/gpart_ops.c=20 This would appear to still be a change from the previous behaviour, where softupdates were enabled by default for any filesystem except for the root filesystem. I wonder if it is time to start enabling SU+J on non-root filesystems now? Gavin --=20 Gavin Atkinson FreeBSD committer and bugmeister GPG: A093262B (313A A79F 697D 3A5C 216A EDF5 935D EF44 A093 262B) From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 17:14:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FF4B106566B; Tue, 15 Mar 2011 17:14:27 +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 0D1FE8FC14; Tue, 15 Mar 2011 17:14: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 p2FHEQP2049459; Tue, 15 Mar 2011 17:14:26 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FHEQdF049456; Tue, 15 Mar 2011 17:14:26 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103151714.p2FHEQdF049456@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Mar 2011 17:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219672 - in head: share/man/man9 sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 17:14:27 -0000 Author: jkim Date: Tue Mar 15 17:14:26 2011 New Revision: 219672 URL: http://svn.freebsd.org/changeset/base/219672 Log: Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this function is almost exclusively used for random harvesting, there is no need for micro-optimization. Adjust the manual page accordingly. Modified: head/share/man/man9/get_cyclecount.9 head/sys/i386/include/cpu.h Modified: head/share/man/man9/get_cyclecount.9 ============================================================================== --- head/share/man/man9/get_cyclecount.9 Tue Mar 15 16:50:17 2011 (r219671) +++ head/share/man/man9/get_cyclecount.9 Tue Mar 15 17:14:26 2011 (r219672) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2009 +.Dd March 15, 2011 .Dt GET_CYCLECOUNT 9 .Os .Sh NAME @@ -65,14 +65,14 @@ do not have such a register, so .Fn get_cyclecount on these platforms -returns a (non-monotonic) combination of numbers +returns a (monotonic) combination of numbers represented by the structure returned by .Xr binuptime 9 . .Pp The -.Tn Pentium -processors all use the +.Tn AMD64 and Intel 64 +processors use the .Li TSC register. .Pp Modified: head/sys/i386/include/cpu.h ============================================================================== --- head/sys/i386/include/cpu.h Tue Mar 15 16:50:17 2011 (r219671) +++ head/sys/i386/include/cpu.h Tue Mar 15 17:14:26 2011 (r219672) @@ -70,15 +70,10 @@ void swi_vm(void *); static __inline uint64_t get_cyclecount(void) { -#if defined(I486_CPU) || defined(KLD_MODULE) struct bintime bt; - if (!tsc_present) { - binuptime(&bt); - return ((uint64_t)bt.sec << 56 | bt.frac >> 8); - } -#endif - return (rdtsc()); + binuptime(&bt); + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); } #endif From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 17:19:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28E7D106566B; Tue, 15 Mar 2011 17:19:53 +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 158738FC08; Tue, 15 Mar 2011 17:19: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 p2FHJqL5049919; Tue, 15 Mar 2011 17:19:52 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FHJqVC049913; Tue, 15 Mar 2011 17:19:52 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103151719.p2FHJqVC049913@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Mar 2011 17:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219673 - in head/sys: amd64/include contrib/altq/altq i386/i386 pc98/pc98 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 17:19:53 -0000 Author: jkim Date: Tue Mar 15 17:19:52 2011 New Revision: 219673 URL: http://svn.freebsd.org/changeset/base/219673 Log: Deprecate tsc_present as the last of its real consumers finally disappeared. Modified: head/sys/amd64/include/cpu.h head/sys/contrib/altq/altq/altq_subr.c head/sys/i386/i386/machdep.c head/sys/pc98/pc98/machdep.c head/sys/x86/x86/tsc.c Modified: head/sys/amd64/include/cpu.h ============================================================================== --- head/sys/amd64/include/cpu.h Tue Mar 15 17:14:26 2011 (r219672) +++ head/sys/amd64/include/cpu.h Tue Mar 15 17:19:52 2011 (r219673) @@ -56,7 +56,6 @@ #ifdef _KERNEL extern char btext[]; extern char etext[]; -extern int tsc_present; void cpu_halt(void); void cpu_reset(void); Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Tue Mar 15 17:14:26 2011 (r219672) +++ head/sys/contrib/altq/altq/altq_subr.c Tue Mar 15 17:19:52 2011 (r219673) @@ -78,10 +78,12 @@ #include #endif #if defined(__amd64__) || defined(__i386__) -#include /* for cpu_feature or tsc_present */ #include /* for pentium tsc */ -#if defined(__NetBSD__) || defined(__OpenBSD__) #include /* for CPUID_TSC */ +#ifdef __FreeBSD__ +#include /* for cpu_feature */ +#elif defined(__NetBSD__) || defined(__OpenBSD__) +#include /* for cpu_feature */ #endif #endif /* __amd64 || __i386__ */ @@ -927,7 +929,7 @@ init_machclk_setup(void) #if defined(__amd64__) || defined(__i386__) /* check if TSC is available */ #ifdef __FreeBSD__ - if (!tsc_present || tsc_freq == 0) + if ((cpu_feature & CPUID_TSC) == 0 || tsc_freq == 0) #else if ((cpu_feature & CPUID_TSC) == 0) #endif Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Mar 15 17:14:26 2011 (r219672) +++ head/sys/i386/i386/machdep.c Tue Mar 15 17:19:52 2011 (r219673) @@ -1141,7 +1141,7 @@ cpu_est_clockrate(int cpu_id, uint64_t * if (pcpu_find(cpu_id) == NULL || rate == NULL) return (EINVAL); - if (!tsc_present) + if ((cpu_feature & CPUID_TSC) == 0) return (EOPNOTSUPP); /* If TSC is P-state invariant, DELAY(9) based logic fails. */ Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Tue Mar 15 17:14:26 2011 (r219672) +++ head/sys/pc98/pc98/machdep.c Tue Mar 15 17:19:52 2011 (r219673) @@ -1076,7 +1076,7 @@ cpu_est_clockrate(int cpu_id, uint64_t * if (pcpu_find(cpu_id) == NULL || rate == NULL) return (EINVAL); - if (!tsc_present) + if ((cpu_feature & CPUID_TSC) == 0) return (EOPNOTSUPP); /* If we're booting, trust the rate calibrated moments ago. */ Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Tue Mar 15 17:14:26 2011 (r219672) +++ head/sys/x86/x86/tsc.c Tue Mar 15 17:19:52 2011 (r219673) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); uint64_t tsc_freq; int tsc_is_invariant; -int tsc_present; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, @@ -89,11 +88,7 @@ init_TSC(void) { u_int64_t tscval[2]; - if ((cpu_feature & CPUID_TSC) == 0) - return; - tsc_present = 1; - - if (tsc_disabled) + if ((cpu_feature & CPUID_TSC) == 0 || tsc_disabled) return; if (bootverbose) @@ -155,7 +150,7 @@ void init_TSC_tc(void) { - if (!tsc_present || tsc_disabled) + if ((cpu_feature & CPUID_TSC) == 0 || tsc_disabled) return; /* From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 17:26:42 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9A8D1065676; Tue, 15 Mar 2011 17:26:42 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 981038FC15; Tue, 15 Mar 2011 17:26:42 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LI400D0C0GHXC00@smtpauth3.wiscmail.wisc.edu>; Tue, 15 Mar 2011 12:26:41 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.65.155]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LI40072L0GCGD40@smtpauth3.wiscmail.wisc.edu>; Tue, 15 Mar 2011 12:26:38 -0500 (CDT) Date: Tue, 15 Mar 2011 12:26:36 -0500 From: Nathan Whitehorn In-reply-to: <1300198773.87705.25.camel@buffy.york.ac.uk> To: Gavin Atkinson Message-id: <4D7FA14C.8040205@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.65.155 X-Spam-PmxInfo: Server=avs-12, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.3.15.171516, SenderIP=76.210.65.155 References: <201103151327.p2FDRZPK044315@svn.freebsd.org> <1300198773.87705.25.camel@buffy.york.ac.uk> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110305 Thunderbird/3.1.9 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 17:26:42 -0000 On 03/15/11 09:19, Gavin Atkinson wrote: > On Tue, 2011-03-15 at 13:27 +0000, Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Tue Mar 15 13:27:34 2011 >> New Revision: 219667 >> URL: http://svn.freebsd.org/changeset/base/219667 >> >> Log: >> Turn on softupdates by default. We need a UI to set filesystem >> parameters. >> >> Modified: >> head/usr.sbin/bsdinstall/partedit/gpart_ops.c > This would appear to still be a change from the previous behaviour, > where softupdates were enabled by default for any filesystem except for > the root filesystem. It is -- and this needs to become settable. Bear in mind, however, that the default partition layout is also different. If you select the auto option, only one file system is made, so there are no non-root file systems. > I wonder if it is time to start enabling SU+J on non-root filesystems > now? That's certainly something to think about, although I'll defer whether that is wise to others. It's a little bit of a pain on the implementation side, since you can't turn it on from newfs, but that isn't a serious obstacle. -Natha From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 17:45:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C69261065677; Tue, 15 Mar 2011 17:45:09 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id AF5FD8FC26; Tue, 15 Mar 2011 17:45:00 +0000 (UTC) Received: by gwb15 with SMTP id 15so375321gwb.13 for ; Tue, 15 Mar 2011 10:45:00 -0700 (PDT) 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=6EQW7Iw/PkU5J2oNT4UZqHNtPXWvLp1RSEXq6zIB59U=; b=mr+bHY3IHKbzYDsrJKdqcqTpkVqCnjrvPb1Z45ypd6E4r2lf164Ne6HH5OOsXmVcEk 6orMejw9YaqIojeiarqwh9jNha9wJjNLfsroZPnQLNxOt5/otaUyvdmvUmPcxAYhU6i3 FkuM6W2xbKrFeyfPpITli4hCJMsUJStsohUbk= 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=Yu4FsoOC2OHM4O8onxkdzS/x2iNZ7E774YQW9Wn+cWG25cY5+vNulSD+vhULdqD+ud XvHtUwSckw3167Ud9VvJbVYr+Juzn8BGLBb189PEz4I6C94KbnGji55j4XPeBjmjpLT9 ZhADXFLtmcA5NAZmsKx74JYmbx37hdaFHntHw= MIME-Version: 1.0 Received: by 10.236.6.175 with SMTP id 35mr7905791yhn.94.1300211099792; Tue, 15 Mar 2011 10:44:59 -0700 (PDT) Received: by 10.147.98.13 with HTTP; Tue, 15 Mar 2011 10:44:59 -0700 (PDT) In-Reply-To: <4D7FA14C.8040205@freebsd.org> References: <201103151327.p2FDRZPK044315@svn.freebsd.org> <1300198773.87705.25.camel@buffy.york.ac.uk> <4D7FA14C.8040205@freebsd.org> Date: Tue, 15 Mar 2011 13:44:59 -0400 Message-ID: From: Ben Kaduk To: Nathan Whitehorn Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , src-committers@freebsd.org Subject: Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 17:45:10 -0000 On Tue, Mar 15, 2011 at 1:26 PM, Nathan Whitehorn wrote: > On 03/15/11 09:19, Gavin Atkinson wrote: >> >> I wonder if it is time to start enabling SU+J on non-root filesystems >> now? > > That's certainly something to think about, although I'll defer whether that > is wise to others. It's a little bit of a pain on the implementation side, > since you can't turn it on from newfs, but that isn't a serious obstacle. I suspect the consensus of people like -arch and -fs will be that the burn-in time before it is considered sufficiently stable is be measured in years. -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 17:50:35 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84FFF1065670; Tue, 15 Mar 2011 17:50:35 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from ixe-mta-27.emailfiltering.com (ixe-mta-27-tx.emailfiltering.com [194.116.199.158]) by mx1.freebsd.org (Postfix) with ESMTP id 6A71D8FC13; Tue, 15 Mar 2011 17:50:34 +0000 (UTC) Received: from mail-gw13.york.ac.uk ([144.32.129.163]) by ixe-mta-27.emailfiltering.com with emfmta (version 4.8.0.437) by TLS id 987880058 for nwhitehorn@FreeBSD.org; c8d71e058b16fe01; Tue, 15 Mar 2011 17:50:33 +0000 Received: from buffy-128.york.ac.uk ([144.32.128.160]:53695 helo=buffy.york.ac.uk) by mail-gw13.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PzYO8-0005qJ-DQ; Tue, 15 Mar 2011 17:50:32 +0000 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.4/8.14.4) with ESMTP id p2FHoVwM089539; Tue, 15 Mar 2011 17:50:32 GMT (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.4/8.14.4/Submit) id p2FHoV3E089538; Tue, 15 Mar 2011 17:50:31 GMT (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Nathan Whitehorn In-Reply-To: <4D7FA14C.8040205@freebsd.org> References: <201103151327.p2FDRZPK044315@svn.freebsd.org> <1300198773.87705.25.camel@buffy.york.ac.uk> <4D7FA14C.8040205@freebsd.org> Content-Type: text/plain; charset="ASCII" Content-Transfer-Encoding: quoted-printable Date: Tue, 15 Mar 2011 17:50:30 +0000 Message-ID: <1300211430.87705.34.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 17:50:35 -0000 On Tue, 2011-03-15 at 12:26 -0500, Nathan Whitehorn wrote: > On 03/15/11 09:19, Gavin Atkinson wrote: > > On Tue, 2011-03-15 at 13:27 +0000, Nathan Whitehorn wrote: > >> Author: nwhitehorn > >> Date: Tue Mar 15 13:27:34 2011 > >> New Revision: 219667 > >> URL: http://svn.freebsd.org/changeset/base/219667 > >> > >> Log: > >> Turn on softupdates by default. We need a UI to set filesystem > >> parameters. > >> > >> Modified: > >> head/usr.sbin/bsdinstall/partedit/gpart_ops.c > > This would appear to still be a change from the previous behaviour, > > where softupdates were enabled by default for any filesystem except for > > the root filesystem. >=20 > It is -- and this needs to become settable. Bear in mind, however, that= =20 > the default partition layout is also different. If you select the auto= =20 > option, only one file system is made, so there are no non-root file syste= ms. Hrm, I hadn't realised this was the case. If this change is intentional and planned to remain, I guess the various bits of documentation that say "several partitions good, one bad" should be updated... > > I wonder if it is time to start enabling SU+J on non-root filesystems > > now? >=20 > That's certainly something to think about, although I'll defer whether= =20 > that is wise to others. It's a little bit of a pain on the=20 > implementation side, since you can't turn it on from newfs, but that=20 > isn't a serious obstacle. As of r218726, you can now set this from newfs. (-j) Thanks, Gavin From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 17:59:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 422401065675; Tue, 15 Mar 2011 17:59:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F2FD8FC0A; Tue, 15 Mar 2011 17:59: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 p2FHxVcT053349; Tue, 15 Mar 2011 17:59:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FHxVNx053347; Tue, 15 Mar 2011 17:59:31 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103151759.p2FHxVNx053347@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Mar 2011 17:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219674 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 17:59:31 -0000 Author: jkim Date: Tue Mar 15 17:59:30 2011 New Revision: 219674 URL: http://svn.freebsd.org/changeset/base/219674 Log: Fix a typo in the previous commit. AMD64 and Intel 64 are two brand names. Modified: head/share/man/man9/get_cyclecount.9 Modified: head/share/man/man9/get_cyclecount.9 ============================================================================== --- head/share/man/man9/get_cyclecount.9 Tue Mar 15 17:19:52 2011 (r219673) +++ head/share/man/man9/get_cyclecount.9 Tue Mar 15 17:59:30 2011 (r219674) @@ -71,7 +71,9 @@ structure returned by .Xr binuptime 9 . .Pp The -.Tn AMD64 and Intel 64 +.Tn AMD64 +and +.Tn Intel 64 processors use the .Li TSC register. From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 18:09:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18EF0106564A; Tue, 15 Mar 2011 18:09:30 +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 E03C38FC08; Tue, 15 Mar 2011 18:09: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 p2FI9Tww054240; Tue, 15 Mar 2011 18:09:29 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FI9Tlc054238; Tue, 15 Mar 2011 18:09:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103151809.p2FI9Tlc054238@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Mar 2011 18:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219675 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 18:09:30 -0000 Author: jkim Date: Tue Mar 15 18:09:29 2011 New Revision: 219675 URL: http://svn.freebsd.org/changeset/base/219675 Log: Remove tsc_present from this file, really. Modified: head/sys/i386/include/cpu.h Modified: head/sys/i386/include/cpu.h ============================================================================== --- head/sys/i386/include/cpu.h Tue Mar 15 17:59:30 2011 (r219674) +++ head/sys/i386/include/cpu.h Tue Mar 15 18:09:29 2011 (r219675) @@ -56,7 +56,6 @@ #ifdef _KERNEL extern char btext[]; extern char etext[]; -extern int tsc_present; void cpu_halt(void); void cpu_reset(void); From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 18:13:59 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 524AF106566B; Tue, 15 Mar 2011 18:13:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id CA6408FC19; Tue, 15 Mar 2011 18:13:58 +0000 (UTC) Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au (c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p2FIDtqH012382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Mar 2011 05:13:56 +1100 Date: Wed, 16 Mar 2011 05:13:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201103151232.35904.jkim@FreeBSD.org> Message-ID: <20110316035308.A2598@besplex.bde.org> References: <201103142205.p2EM5x6E012664@svn.freebsd.org> <20110315123819.X920@besplex.bde.org> <201103151232.35904.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r219646 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 18:13:59 -0000 On Tue, 15 Mar 2011, Jung-uk Kim wrote: > On Monday 14 March 2011 10:31 pm, Bruce Evans wrote: >> On Mon, 14 Mar 2011, Jung-uk Kim wrote: >>> Log: >>> When TSC is unavailable, broken or disabled and the current >>> timecounter has better quality than i8254 timer, use it for >>> DELAY(9). >> >> You cannot use a random timecounter for DELAY(). DELAY() is >> carefully written to not use any locks, so that it doesn't deadlock >> when called in the "any" context from a bad console driver like >> syscons when syscons is called from ddb. (Bad console drivers may >> have their own locks which deadlock in ddb, but that is another >> problem.) Even the i8254 timer, which is the only timer that >> should be used by DELAY(), normally use locks that used to cause >> deadlock, but DELAY() was unbroken to bypass the locks when it is >> called from ddb. > > I disagree. I think we should keep away from i8254 as much as > possible. It is adequate for DELAY(), and is the only timer that is available on all x86. You need large complications in DELAY() to make it work as well as the old code using the i8254, for no gain until there is an x86 without an i8254. > Actually, i8254 is the only timer that requires locking in > the first place because of its braindead design. All other x86 > timers do not require any locking at all. We even sacrificed upper > 32 bits of HPET in favor of i386. :-( Did we? Timecounters use only 32 bits as an optimization. Scaling of 64-bit values is slow even on 64-bit machines since it needs 128-bit intermediate values for the multiplication/shift method to work. >> Cpufreq and other calibration code should use a normal timecounter >> via nanouptime() in all cases and never go near low level >> timecounters or DELAY(). There are (hopefully minor) problems >> getting the nanotime() initialized before it used. The dummy >> timecounter is just what you don't want to use. > > That's exactly the problem. Your fix won't make much difference then. DELAY() will start with a dummy timecounter and probably also a zero tsc_freq, so it will use the i8254 for various things, probably including initial calibration of the TSC/cpufreq. Later it may see a better timecounter and use that to get a better calibration of the TSC/cpufreq. But its caller can just as easily check for a better timecounter and not use DELAY() if it can use a timecounter, without messing with DELAY()'s internals and having to guard against reentrancy from ddb. delay_timecounter() already has all the code for this, except the check for a better timecounter is external. >> Even in this patch, it isn't clear that the low level timecounters >> are initialized before they are used. > > The timecounter is always initialized first, then set. It is still unclear whether they are initialized enough before they are used since their setting is neither locked nor atomic. Consider the TSC initialization. This is init_TSC() from startrtclock() and init_TSC_tc() from cpu_initclocks(). The first should make the low- level timecounter useable, but this is unclear. The second attaches the low-level timecounter to the high-level timecounter data structures. There is no locking for this except possibly Giant. tsc_freq is initialized early, so the tests of it will succeed long before the TSC can become the high-level timecounter. It is probably usable at a low level, but this is unclear. tsc_freq is 64 bits, and the accesses to it are non-atomic, so especially on 32-bit machines there are races accessing it. In fact, I can now see a reproducible bug in DELAY(): - find an x86 that can run at 4GHz - run it in 386 mode - start it so that tsc_freq is 0x10000000ULL - use the machdep.tsc_freq sysctl to tune tsc_freq to 0xFFFFFFFF - trace through this sysctl using gdb, and using a low quality console driver like syscons which calls DELAY(). - the 2 words in tsc_freq will normally be written from the low word up. It will be seen to have value 0x1FFFFFFFFULL after only the first word is written. Not too bad -- just of by a factor of 2. - I can't quite see how to make it have a really broken value. At first I tried and example with it starting with a value if 0xFFFFFFFF and changing it to 0x100000000ULL. Then after changing only its low word, it is 0 so DELAY() will not use the TSC. Related non-reproducible bugs are also easy to see: - on one CPU, spin calling the sysctl to toggly tsc_freq between 4G-1 and 4G - on another CPU, spin doing something that calls DELAY(). Since there is no locking or atomic accesses for the writes to tsc_freq in the sysctl or for the reads of it in DELAY(), not to mention elsewhwere, tsc_freq can read as zero when it is being changed between 2 nonzero values. Not too bad if it reads as zero -- then it won't be used. But uses of it following it being read as nonzero may find it with changed values that are very bad, for example zero. These bugs are in the old code in DELAY() that uses the TSC, and perhaps in all code of the form "if (tsc_freq != 0) use()". Fixes for them should probably use a generation count. init_TSC_tc() finishes with tc_init(&tsc_timecounter) which does most of the work for attaching to the higher-level timecounter structures. tc_init() has no locking or atomic operations, which I think gives it races in some contexts, but not in ones involving single stepping it using ddb, since then there are no other CPUs to race with. The races are the potentially-unordered writes of all the variables set by tc_init(). >>> Modified: head/sys/x86/isa/clock.c >>> ================================================================= >>> ============= --- head/sys/x86/isa/clock.c Mon Mar 14 19:31:43 >>> 2011 (r219645) +++ head/sys/x86/isa/clock.c Mon Mar 14 22:05:59 >>> 2011 (r219646) @@ -245,6 +245,42 @@ getit(void) >>> return ((high << 8) | low); >>> } >>> >>> +static __inline void >>> +delay_tsc(int n) >>> +{ >>> + uint64_t start, end, now; >>> + >>> + sched_pin(); >>> + start = rdtsc(); >>> + end = start + (tsc_freq * n) / 1000000; >>> + do { >>> + cpu_spinwait(); >>> + now = rdtsc(); >>> + } while (now < end || (now > start && end < start)); >>> + sched_unpin(); >>> +} >> >> You cannot call random scheduling code from DELAY(), since the >> scheduling code is not designed to be called in the "any" context. >> As it happens, sched_pin() and sched_unpin() are safe, and were >> already used in the TSC case. > > Actually, I really like to get rid of this code. It isn't safe for > many reasons, e.g., its frequency may change while in the loop and > end result is unpredictable if TSC is not invariant. We may limit > its use for invariant case, though. Me too. It can also be used of the TSC is the timecounter, since it it is good enough for a timecounter than it is good enough for this. But it is a lot of work for no benefit to make all cases work. >>> +static __inline void >>> +delay_timecounter(struct timecounter *tc, int n) >>> +{ >>> + uint64_t end, now; >>> + u_int last, mask, u; >>> + >>> + mask = tc->tc_counter_mask; >>> + last = tc->tc_get_timecount(tc) & mask; >>> + end = tc->tc_frequency * n / 1000000; >> >> This depends on the delicate timecounter locking to be safe. I >> think it it is safe except possibly in tc_get_timecount(), for the >> same reasons that nanouptime() can run safely with no visible >> locking. tc must be the current timecounter/timehands, which is >> guaranteed to not be in an in-between state or become so while we >> are using it, despite there being no visible locking. Actually >> there are some minor races: >> - in nanouptime(), the timecounter generation is checked to avoid >> using a new generation if necessary, but updates of the generation >> count and the fileds that it protects are not properly atomic. >> - here, the check of the generation is missing. So this works >> without races when called from ddb (since ddb stops other CPUs), >> but has minor races in general. > > Window of the races is very narrow here and it only happens on i386 > where reading uint64_t is not atomic if my understanding is correct. I can easily make race windows very wide by single stepping them, and usually do for testing code like this :-). > It cannot be any worse than tsc_freq anyway. ;-) Yes, but it extends old mistakes. >> Optimizing DELAY() was bogus. Now the loop for this is >> duplicatied. > > "Bogus" optimization is not exactly duplicated here if you meant "(now > < end || (now > start && end < start))" is bogus. Its bogusness > comes from the fact that TSC is 64-bit. However, timecounter is > effectively 32-bit because of its mask. Now overflow is carefully > accounted for and it is (almost) correct. I meant not using the i8254. Even DELAY()'s API limits it to 1 uS resolution. Who cares if the hardware read extends this to 5 uS? Duplication can be avoided by replacing the rdstc() by conditional code like (using_tsc ? rdtsc() : (tc->tc_get_timecount(tc) & mask) in the loop. We have a 1 uS resolution and a pause in the loop, so we don't care that the loop takes a little longer due to the conditional in it. My userland code for this does a full sysctl to read an emulated timecounter for this. Its loop is: % binuptime(&start_bt); % start_tsc = rdtsc(); % do { % binuptime(&sample_bt); % tsc = rdtsc(); % binuptime(&bt); % bintime_sub(&bt, &sample_bt); % if (bintimecmp(&bt, &best_bt, <)) { % best_bt = bt; % best_sample_bt = sample_bt; % best_tsc = tsc; % } % bt = sample_bt; % bintime_sub(&bt, &start_bt); % } while (++nsamples < min_nsamples || % bintimecmp(&best_bt, min_error_btp, >)); binuptime() is emulated so that it has the same API as the kernel. It is actually clock_gettime(CLOCK_MONOTONIC, &ts) followed by error handling and conversion to bintime. The loop is missing the equivalent of sched_pin(). I don't know exactly how to do that in userland. Is there a single syscall that does it? I used cpuset(1). Bruce From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 18:38:37 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25411106567A; Tue, 15 Mar 2011 18:38:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id B3B148FC16; Tue, 15 Mar 2011 18:38:36 +0000 (UTC) Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au (c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p2FIcWW2014358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Mar 2011 05:38:35 +1100 Date: Wed, 16 Mar 2011 05:38:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201103151714.p2FHEQdF049456@svn.freebsd.org> Message-ID: <20110316051750.M2847@besplex.bde.org> References: <201103151714.p2FHEQdF049456@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 18:38:37 -0000 On Tue, 15 Mar 2011, Jung-uk Kim wrote: > Log: > Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this > function is almost exclusively used for random harvesting, there is no need > for micro-optimization. Adjust the manual page accordingly. That's what I said when it was being committed, but it isn't clear that there is _no_ need for micro-optimization in random harvesting. IIRC, random harvesting originally was too active so it benefited more from micro-optimizations. The timecounter is fast enough if the timecounter hardware is the TSC, since TSC reads used to take 12 cycles on Athlons and now take 40+, and timecounter software overhead only adds about 30 cycles to this. But now the timecounter harware is even more rarely the TSC, and most timecounter hardware is very slow -- about 3000 cycles for APCI-"fast" and 9000 for ACPI and 15000 for i8254 at 3 GHz. > Modified: head/sys/i386/include/cpu.h > ============================================================================== > --- head/sys/i386/include/cpu.h Tue Mar 15 16:50:17 2011 (r219671) > +++ head/sys/i386/include/cpu.h Tue Mar 15 17:14:26 2011 (r219672) > @@ -70,15 +70,10 @@ void swi_vm(void *); > static __inline uint64_t > get_cyclecount(void) > { > -#if defined(I486_CPU) || defined(KLD_MODULE) > struct bintime bt; > > - if (!tsc_present) { > - binuptime(&bt); > - return ((uint64_t)bt.sec << 56 | bt.frac >> 8); > - } > -#endif > - return (rdtsc()); > + binuptime(&bt); > + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); > } You should pessimize all arches to use binuptime() to get enough test coverage to see if anyone notices. Then get_cyclecount() can be removed. The correct function to use for fast and possibly-wrong times is clock_binuptime(CLOCK_FASTEST, tsp), where CLOCK_FASTEST maps to CLOCK_TSC on x86 if there is a TSC and nothing faster. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 19:26:31 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id D3C951065679; Tue, 15 Mar 2011 19:26:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Bruce Evans Date: Tue, 15 Mar 2011 15:26:11 -0400 User-Agent: KMail/1.6.2 References: <201103142205.p2EM5x6E012664@svn.freebsd.org> <201103151232.35904.jkim@FreeBSD.org> <20110316035308.A2598@besplex.bde.org> In-Reply-To: <20110316035308.A2598@besplex.bde.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103151526.14264.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r219646 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 19:26:31 -0000 On Tuesday 15 March 2011 02:13 pm, Bruce Evans wrote: > On Tue, 15 Mar 2011, Jung-uk Kim wrote: > > On Monday 14 March 2011 10:31 pm, Bruce Evans wrote: > >> On Mon, 14 Mar 2011, Jung-uk Kim wrote: > >>> Log: > >>> When TSC is unavailable, broken or disabled and the current > >>> timecounter has better quality than i8254 timer, use it for > >>> DELAY(9). > >> > >> You cannot use a random timecounter for DELAY(). DELAY() is > >> carefully written to not use any locks, so that it doesn't > >> deadlock when called in the "any" context from a bad console > >> driver like syscons when syscons is called from ddb. (Bad > >> console drivers may have their own locks which deadlock in ddb, > >> but that is another problem.) Even the i8254 timer, which is > >> the only timer that should be used by DELAY(), normally use > >> locks that used to cause deadlock, but DELAY() was unbroken to > >> bypass the locks when it is called from ddb. > > > > I disagree. I think we should keep away from i8254 as much as > > possible. > > It is adequate for DELAY(), and is the only timer that is available > on all x86. You need large complications in DELAY() to make it > work as well as the old code using the i8254, for no gain until > there is an x86 without an i8254. Intel started killing off i8254 (and other "legacy" ISA devices), starting from "Mobile Internet Device" platforms. Even for other so-called "legacy-free" platforms, it isn't adequate any more because of unpredictable SMI# interference. > > Actually, i8254 is the only timer that requires locking in > > the first place because of its braindead design. All other x86 > > timers do not require any locking at all. We even sacrificed > > upper 32 bits of HPET in favor of i386. :-( > > Did we? Timecounters use only 32 bits as an optimization. Scaling > of 64-bit values is slow even on 64-bit machines since it needs > 128-bit intermediate values for the multiplication/shift method to > work. No, I am talking about reading raw value of HPET. For amd64, it can be used as a good alternative to TSC if we detect it earlier for legacy-free platforms. Unfortunately, it is only useful for timecounter ATM. > >> Cpufreq and other calibration code should use a normal > >> timecounter via nanouptime() in all cases and never go near low > >> level timecounters or DELAY(). There are (hopefully minor) > >> problems getting the nanotime() initialized before it used. The > >> dummy timecounter is just what you don't want to use. > > > > That's exactly the problem. > > Your fix won't make much difference then. DELAY() will start with > a dummy timecounter and probably also a zero tsc_freq, so it will > use the i8254 for various things, probably including initial > calibration of the TSC/cpufreq. Later it may see a better > timecounter and use that to get a better calibration of the > TSC/cpufreq. But its caller can just as easily check for a better > timecounter and not use DELAY() if it can use a timecounter, > without messing with DELAY()'s internals and having to guard > against reentrancy from ddb. delay_timecounter() already has all > the code for this, except the check for a better timecounter is > external. Yes, it doesn't make much difference for that ATM. However, it DOES make differences when DELAY() is used for device drivers. What I really want is DELAY() does the right thing, e.g., holding no spin lock, not pinned on a CPU, no tsc_freq hackery, and no side-effect of any kind. > >> Even in this patch, it isn't clear that the low level > >> timecounters are initialized before they are used. > > > > The timecounter is always initialized first, then set. > > It is still unclear whether they are initialized enough before they > are used since their setting is neither locked nor atomic. > Consider the TSC initialization. This is init_TSC() from > startrtclock() and init_TSC_tc() from cpu_initclocks(). The first > should make the low- level timecounter useable, but this is > unclear. The second attaches the low-level timecounter to the > high-level timecounter data structures. There is no locking for > this except possibly Giant. tsc_freq is initialized early, so the > tests of it will succeed long before the TSC can become the > high-level timecounter. It is probably usable at a low level, but > this is unclear. tsc_freq is 64 bits, and the accesses to it are > non-atomic, so especially on 32-bit machines there are races > accessing it. In fact, I can now see a reproducible bug in > DELAY(): - find an x86 that can run at 4GHz > - run it in 386 mode > - start it so that tsc_freq is 0x10000000ULL > - use the machdep.tsc_freq sysctl to tune tsc_freq to 0xFFFFFFFF machdep.tsc_freq should never have modified tsc_freq in the first place. I am going to remove that soon. > - trace through this sysctl using gdb, and using a low quality > console driver like syscons which calls DELAY(). > - the 2 words in tsc_freq will normally be written from the low > word up. It will be seen to have value 0x1FFFFFFFFULL after only > the first word is written. Not too bad -- just of by a factor of > 2. - I can't quite see how to make it have a really broken value. > At first I tried and example with it starting with a value if > 0xFFFFFFFF and changing it to 0x100000000ULL. Then after changing > only its low word, it is 0 so DELAY() will not use the TSC. > Related non-reproducible bugs are also easy to see: > - on one CPU, spin calling the sysctl to toggly tsc_freq between > 4G-1 and 4G > - on another CPU, spin doing something that calls DELAY(). Since > there is no locking or atomic accesses for the writes to tsc_freq > in the sysctl or for the reads of it in DELAY(), not to mention > elsewhwere, tsc_freq can read as zero when it is being changed > between 2 nonzero values. Not too bad if it reads as zero -- then > it won't be used. But uses of it following it being read as > nonzero may find it with changed values that are very bad, for > example zero. > These bugs are in the old code in DELAY() that uses the TSC, and > perhaps in all code of the form "if (tsc_freq != 0) use()". > Fixes for them should probably use a generation count. > > init_TSC_tc() finishes with tc_init(&tsc_timecounter) which does > most of the work for attaching to the higher-level timecounter > structures. tc_init() has no locking or atomic operations, which I > think gives it races in some contexts, but not in ones involving > single stepping it using ddb, since then there are no other CPUs to > race with. The races are the potentially-unordered writes of all > the variables set by tc_init(). Now don't you think we should really kill delay by TSC? ;-) > >>> Modified: head/sys/x86/isa/clock.c > >>> =============================================================== > >>>== ============= --- head/sys/x86/isa/clock.c Mon Mar 14 > >>> 19:31:43 2011 (r219645) +++ head/sys/x86/isa/clock.c Mon Mar 14 > >>> 22:05:59 2011 (r219646) @@ -245,6 +245,42 @@ getit(void) > >>> return ((high << 8) | low); > >>> } > >>> > >>> +static __inline void > >>> +delay_tsc(int n) > >>> +{ > >>> + uint64_t start, end, now; > >>> + > >>> + sched_pin(); > >>> + start = rdtsc(); > >>> + end = start + (tsc_freq * n) / 1000000; > >>> + do { > >>> + cpu_spinwait(); > >>> + now = rdtsc(); > >>> + } while (now < end || (now > start && end < start)); > >>> + sched_unpin(); > >>> +} > >> > >> You cannot call random scheduling code from DELAY(), since the > >> scheduling code is not designed to be called in the "any" > >> context. As it happens, sched_pin() and sched_unpin() are safe, > >> and were already used in the TSC case. > > > > Actually, I really like to get rid of this code. It isn't safe > > for many reasons, e.g., its frequency may change while in the > > loop and end result is unpredictable if TSC is not invariant. We > > may limit its use for invariant case, though. > > Me too. It can also be used of the TSC is the timecounter, since > it it is good enough for a timecounter than it is good enough for > this. But it is a lot of work for no benefit to make all cases > work. > > >>> +static __inline void > >>> +delay_timecounter(struct timecounter *tc, int n) > >>> +{ > >>> + uint64_t end, now; > >>> + u_int last, mask, u; > >>> + > >>> + mask = tc->tc_counter_mask; > >>> + last = tc->tc_get_timecount(tc) & mask; > >>> + end = tc->tc_frequency * n / 1000000; > >> > >> This depends on the delicate timecounter locking to be safe. I > >> think it it is safe except possibly in tc_get_timecount(), for > >> the same reasons that nanouptime() can run safely with no > >> visible locking. tc must be the current timecounter/timehands, > >> which is guaranteed to not be in an in-between state or become > >> so while we are using it, despite there being no visible > >> locking. Actually there are some minor races: > >> - in nanouptime(), the timecounter generation is checked to > >> avoid using a new generation if necessary, but updates of the > >> generation count and the fileds that it protects are not > >> properly atomic. - here, the check of the generation is missing. > >> So this works without races when called from ddb (since ddb > >> stops other CPUs), but has minor races in general. > > > > Window of the races is very narrow here and it only happens on > > i386 where reading uint64_t is not atomic if my understanding is > > correct. > > I can easily make race windows very wide by single stepping them, > and usually do for testing code like this :-). > > > It cannot be any worse than tsc_freq anyway. ;-) > > Yes, but it extends old mistakes. > > >> Optimizing DELAY() was bogus. Now the loop for this is > >> duplicatied. > > > > "Bogus" optimization is not exactly duplicated here if you meant > > "(now < end || (now > start && end < start))" is bogus. Its > > bogusness comes from the fact that TSC is 64-bit. However, > > timecounter is effectively 32-bit because of its mask. Now > > overflow is carefully accounted for and it is (almost) correct. > > I meant not using the i8254. Even DELAY()'s API limits it to 1 uS > resolution. Who cares if the hardware read extends this to 5 uS? Ah, I see. > Duplication can be avoided by replacing the rdstc() by conditional > code like (using_tsc ? rdtsc() : (tc->tc_get_timecount(tc) & mask) > in the loop. We have a 1 uS resolution and a pause in the loop, > so we don't care that the loop takes a little longer due to the > conditional in it. Agreed. > My userland code for this does a full sysctl to read an emulated > timecounter for this. Its loop is: > > % binuptime(&start_bt); > % start_tsc = rdtsc(); > % do { > % binuptime(&sample_bt); > % tsc = rdtsc(); > % binuptime(&bt); > % bintime_sub(&bt, &sample_bt); > % if (bintimecmp(&bt, &best_bt, <)) { > % best_bt = bt; > % best_sample_bt = sample_bt; > % best_tsc = tsc; > % } > % bt = sample_bt; > % bintime_sub(&bt, &start_bt); > % } while (++nsamples < min_nsamples || > % bintimecmp(&best_bt, min_error_btp, >)); > > binuptime() is emulated so that it has the same API as the kernel. > It is actually clock_gettime(CLOCK_MONOTONIC, &ts) followed by > error handling and conversion to bintime. The loop is missing the > equivalent of sched_pin(). I don't know exactly how to do that in > userland. Is there a single syscall that does it? I used > cpuset(1). Not that I know of. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 19:33:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B5DA106564A; Tue, 15 Mar 2011 19:33:09 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id BB3418FC2C; Tue, 15 Mar 2011 19:33:08 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 1608417011; Tue, 15 Mar 2011 22:33:06 +0300 (MSK) Date: Tue, 15 Mar 2011 22:33:06 +0300 From: Maxim Dounin To: Jung-uk Kim Message-ID: <20110315193306.GK99496@mdounin.ru> References: <201103151714.p2FHEQdF049456@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201103151714.p2FHEQdF049456@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 19:33:09 -0000 Hello! On Tue, Mar 15, 2011 at 05:14:26PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Tue Mar 15 17:14:26 2011 > New Revision: 219672 > URL: http://svn.freebsd.org/changeset/base/219672 > > Log: > Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this > function is almost exclusively used for random harvesting, there is no need > for micro-optimization. Adjust the manual page accordingly. Note that on early boot only dummy timecounter available, and binuptime() has no entropy. As a result of this change random(9) won't have entropy on early boot on i386, and arc4random(9) as well. While there are no known major security problems associated with it - it at least makes stack protector easily bypasseable as it now (again after r198295) uses well-known stack guard instead of random one. And there may be other issues as well. Hope you thought well before moving i386 to a set of platforms which have no early boot randomness at all. And you have good reason for doing it. Maxim Dounin > > Modified: > head/share/man/man9/get_cyclecount.9 > head/sys/i386/include/cpu.h > > Modified: head/share/man/man9/get_cyclecount.9 > ============================================================================== > --- head/share/man/man9/get_cyclecount.9 Tue Mar 15 16:50:17 2011 (r219671) > +++ head/share/man/man9/get_cyclecount.9 Tue Mar 15 17:14:26 2011 (r219672) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 24, 2009 > +.Dd March 15, 2011 > .Dt GET_CYCLECOUNT 9 > .Os > .Sh NAME > @@ -65,14 +65,14 @@ do not have such a register, > so > .Fn get_cyclecount > on these platforms > -returns a (non-monotonic) combination of numbers > +returns a (monotonic) combination of numbers > represented by the > structure returned by > .Xr binuptime 9 . > .Pp > The > -.Tn Pentium > -processors all use the > +.Tn AMD64 and Intel 64 > +processors use the > .Li TSC > register. > .Pp > > Modified: head/sys/i386/include/cpu.h > ============================================================================== > --- head/sys/i386/include/cpu.h Tue Mar 15 16:50:17 2011 (r219671) > +++ head/sys/i386/include/cpu.h Tue Mar 15 17:14:26 2011 (r219672) > @@ -70,15 +70,10 @@ void swi_vm(void *); > static __inline uint64_t > get_cyclecount(void) > { > -#if defined(I486_CPU) || defined(KLD_MODULE) > struct bintime bt; > > - if (!tsc_present) { > - binuptime(&bt); > - return ((uint64_t)bt.sec << 56 | bt.frac >> 8); > - } > -#endif > - return (rdtsc()); > + binuptime(&bt); > + return ((uint64_t)bt.sec << 56 | bt.frac >> 8); > } > > #endif > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 19:47:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68CDA106566B; Tue, 15 Mar 2011 19:47:20 +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 581678FC08; Tue, 15 Mar 2011 19:47: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 p2FJlKBQ057575; Tue, 15 Mar 2011 19:47:20 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FJlK3L057573; Tue, 15 Mar 2011 19:47:20 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103151947.p2FJlK3L057573@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Mar 2011 19:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219676 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 19:47:20 -0000 Author: jkim Date: Tue Mar 15 19:47:20 2011 New Revision: 219676 URL: http://svn.freebsd.org/changeset/base/219676 Log: Do not let machdep.tsc_freq modify tsc_freq itself. It is bad for i386 as it does not operate atomically. Actually, it serves no purpose. Noticed by: bde Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Tue Mar 15 18:09:29 2011 (r219675) +++ head/sys/x86/x86/tsc.c Tue Mar 15 19:47:20 2011 (r219676) @@ -263,12 +263,10 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_A if (tsc_timecounter.tc_frequency == 0) return (EOPNOTSUPP); - freq = tsc_freq; + freq = tsc_timecounter.tc_frequency; error = sysctl_handle_64(oidp, &freq, 0, req); - if (error == 0 && req->newptr != NULL) { - tsc_freq = freq; - tsc_timecounter.tc_frequency = tsc_freq; - } + if (error == 0 && req->newptr != NULL) + tsc_timecounter.tc_frequency = freq; return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 19:56:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 48E2D106566C; Tue, 15 Mar 2011 19:56:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Maxim Dounin Date: Tue, 15 Mar 2011 15:55:43 -0400 User-Agent: KMail/1.6.2 References: <201103151714.p2FHEQdF049456@svn.freebsd.org> <20110315193306.GK99496@mdounin.ru> In-Reply-To: <20110315193306.GK99496@mdounin.ru> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103151555.45816.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 19:56:05 -0000 On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote: > Hello! > > On Tue, Mar 15, 2011 at 05:14:26PM +0000, Jung-uk Kim wrote: > > Author: jkim > > Date: Tue Mar 15 17:14:26 2011 > > New Revision: 219672 > > URL: http://svn.freebsd.org/changeset/base/219672 > > > > Log: > > Unconditionally use binuptime(9) for get_cyclecount(9) on i386. > > Since this function is almost exclusively used for random > > harvesting, there is no need for micro-optimization. Adjust the > > manual page accordingly. > > Note that on early boot only dummy timecounter available, and > binuptime() has no entropy. > > As a result of this change random(9) won't have entropy on early > boot on i386, and arc4random(9) as well. While there are no known > major security problems associated with it - it at least makes > stack protector easily bypasseable as it now (again after r198295) > uses well-known stack guard instead of random one. And there may > be other issues as well. > > Hope you thought well before moving i386 to a set of platforms > which have no early boot randomness at all. And you have good > reason for doing it. Hmm... Is bintime(9) good enough for you then? Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 20:24:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C0E9106564A; Tue, 15 Mar 2011 20:24:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8668FC13; Tue, 15 Mar 2011 20:24: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 p2FKOLCD058400; Tue, 15 Mar 2011 20:24:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FKOLmK058398; Tue, 15 Mar 2011 20:24:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103152024.p2FKOLmK058398@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Mar 2011 20:24: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: r219677 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 20:24:21 -0000 Author: jilles Date: Tue Mar 15 20:24:21 2011 New Revision: 219677 URL: http://svn.freebsd.org/changeset/base/219677 Log: MFC r218019: Do not trip a KASSERT if /dev/null cannot be opened for a setuid program. The fdcheckstd() function makes sure fds 0, 1 and 2 are open by opening /dev/null. If this fails (e.g. missing devfs or wrong permissions), fdcheckstd() will return failure and the process will exit as if it received SIGABRT. The KASSERT is only to check that kern_open() returns the expected fd, given that it succeeded. Tripping the KASSERT is most likely if fd 0 is open but fd 1 or 2 are not. Modified: stable/8/sys/kern/kern_descrip.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_descrip.c ============================================================================== --- stable/8/sys/kern/kern_descrip.c Tue Mar 15 19:47:20 2011 (r219676) +++ stable/8/sys/kern/kern_descrip.c Tue Mar 15 20:24:21 2011 (r219677) @@ -2024,10 +2024,10 @@ fdcheckstd(struct thread *td) error = kern_open(td, "/dev/null", UIO_SYSSPACE, O_RDWR, 0); devnull = td->td_retval[0]; - KASSERT(devnull == i, ("oof, we didn't get our fd")); td->td_retval[0] = save; if (error) break; + KASSERT(devnull == i, ("oof, we didn't get our fd")); } else { error = do_dup(td, DUP_FIXED, devnull, i, &retval); if (error != 0) From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 20:31:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 8C4E9106564A; Tue, 15 Mar 2011 20:31:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Maxim Dounin Date: Tue, 15 Mar 2011 16:31:31 -0400 User-Agent: KMail/1.6.2 References: <201103151714.p2FHEQdF049456@svn.freebsd.org> <20110315193306.GK99496@mdounin.ru> <201103151555.45816.jkim@FreeBSD.org> In-Reply-To: <201103151555.45816.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103151631.34418.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 20:31:49 -0000 On Tuesday 15 March 2011 03:55 pm, Jung-uk Kim wrote: > On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote: > > Hello! > > > > On Tue, Mar 15, 2011 at 05:14:26PM +0000, Jung-uk Kim wrote: > > > Author: jkim > > > Date: Tue Mar 15 17:14:26 2011 > > > New Revision: 219672 > > > URL: http://svn.freebsd.org/changeset/base/219672 > > > > > > Log: > > > Unconditionally use binuptime(9) for get_cyclecount(9) on > > > i386. Since this function is almost exclusively used for random > > > harvesting, there is no need for micro-optimization. Adjust > > > the manual page accordingly. > > > > Note that on early boot only dummy timecounter available, and > > binuptime() has no entropy. > > > > As a result of this change random(9) won't have entropy on early > > boot on i386, and arc4random(9) as well. While there are no > > known major security problems associated with it - it at least > > makes stack protector easily bypasseable as it now (again after > > r198295) uses well-known stack guard instead of random one. And > > there may be other issues as well. > > > > Hope you thought well before moving i386 to a set of platforms > > which have no early boot randomness at all. And you have good > > reason for doing it. > > Hmm... Is bintime(9) good enough for you then? I guess it won't work cause boottimebin is set pretty late. Arg... If I can't come up with something sensible, I'll revert this commit. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 21:01:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 674F3106564A; Tue, 15 Mar 2011 21:01:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3A81E8FC0A; Tue, 15 Mar 2011 21:01:13 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id C613F46B8E; Tue, 15 Mar 2011 17:01:12 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 516258A01B; Tue, 15 Mar 2011 17:01:12 -0400 (EDT) From: John Baldwin To: "Jung-uk Kim" Date: Tue, 15 Mar 2011 15:51:53 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201103142205.p2EM5x6E012664@svn.freebsd.org> <20110316035308.A2598@besplex.bde.org> <201103151526.14264.jkim@FreeBSD.org> In-Reply-To: <201103151526.14264.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103151551.54196.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 15 Mar 2011 17:01:12 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r219646 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 21:01:13 -0000 On Tuesday, March 15, 2011 3:26:11 pm Jung-uk Kim wrote: > Now don't you think we should really kill delay by TSC? ;-) Delay by TSC fixed known deadlocks with the i8254 based DELAY() due to the use of locks. Be careful that you don't re-introduce old bugs. Also, you can use a TSC for DELAY() in cases when it is not safe to use it for the timecounter (if it is not in sync across cores, but is used in a machine with invariant TSCs or where the user knows they won't ever throttle it). Modern Intel CPUs all have invariant TSCs that are more or less in sync across cores, and we should certainly still use the TSC for DELAY() in that case. Even if they aren't in sync (so we can't use it for the timecounter) we should still use the TSC if they are invariant as it is far cheaper than anything else. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 21:01:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C0BA106566B; Tue, 15 Mar 2011 21:01:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D68568FC18; Tue, 15 Mar 2011 21:01:14 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8348D46B90; Tue, 15 Mar 2011 17:01:14 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 616008A02A; Tue, 15 Mar 2011 17:01:13 -0400 (EDT) From: John Baldwin To: "Jung-uk Kim" Date: Tue, 15 Mar 2011 17:01:11 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201103151947.p2FJlK3L057573@svn.freebsd.org> In-Reply-To: <201103151947.p2FJlK3L057573@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201103151701.11708.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 15 Mar 2011 17:01:14 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219676 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 21:01:15 -0000 On Tuesday, March 15, 2011 3:47:20 pm Jung-uk Kim wrote: > Author: jkim > Date: Tue Mar 15 19:47:20 2011 > New Revision: 219676 > URL: http://svn.freebsd.org/changeset/base/219676 > > Log: > Do not let machdep.tsc_freq modify tsc_freq itself. It is bad for i386 as > it does not operate atomically. Actually, it serves no purpose. > > Noticed by: bde Ouch, please revert! We have depended on this for testing to workaround BIOS issues (e.g. the USB SMI# handler firing at a bad time during boot causing the TSC frequency to be calculated incorrectly). I agree it's a hack that this works, but it has actually proven useful in the past. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 21:14:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 9122B106566C; Tue, 15 Mar 2011 21:14:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Tue, 15 Mar 2011 17:14:14 -0400 User-Agent: KMail/1.6.2 References: <201103151947.p2FJlK3L057573@svn.freebsd.org> <201103151701.11708.jhb@freebsd.org> In-Reply-To: <201103151701.11708.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103151714.15829.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219676 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 21:14:26 -0000 On Tuesday 15 March 2011 05:01 pm, John Baldwin wrote: > On Tuesday, March 15, 2011 3:47:20 pm Jung-uk Kim wrote: > > Author: jkim > > Date: Tue Mar 15 19:47:20 2011 > > New Revision: 219676 > > URL: http://svn.freebsd.org/changeset/base/219676 > > > > Log: > > Do not let machdep.tsc_freq modify tsc_freq itself. It is bad > > for i386 as it does not operate atomically. Actually, it serves > > no purpose. > > > > Noticed by: bde > > Ouch, please revert! We have depended on this for testing to > workaround BIOS issues (e.g. the USB SMI# handler firing at a bad > time during boot causing the TSC frequency to be calculated > incorrectly). I agree it's a hack that this works, but it has > actually proven useful in the past. You can still change timecounter frequency. Can you please explain why you need to change tsc_freq directly? Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 21:21:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id CE5EB106566C; Tue, 15 Mar 2011 21:21:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Tue, 15 Mar 2011 17:21:34 -0400 User-Agent: KMail/1.6.2 References: <201103142205.p2EM5x6E012664@svn.freebsd.org> <201103151526.14264.jkim@FreeBSD.org> <201103151551.54196.jhb@freebsd.org> In-Reply-To: <201103151551.54196.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103151721.42664.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r219646 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 21:21:52 -0000 On Tuesday 15 March 2011 03:51 pm, John Baldwin wrote: > On Tuesday, March 15, 2011 3:26:11 pm Jung-uk Kim wrote: > > Now don't you think we should really kill delay by TSC? ;-) > > Delay by TSC fixed known deadlocks with the i8254 based DELAY() due > to the use of locks. Be careful that you don't re-introduce old > bugs. Yeah, that's perfectly understood. > Also, you can use a TSC for DELAY() in cases when it is not safe to > use it for the timecounter (if it is not in sync across cores, but > is used in a machine with invariant TSCs or where the user knows > they won't ever throttle it). Modern Intel CPUs all have invariant > TSCs that are more or less in sync across cores, and we should > certainly still use the TSC for DELAY() in that case. Even if they > aren't in sync (so we can't use it for the timecounter) we should > still use the TSC if they are invariant as it is far cheaper than > anything else. That, too, is well understood. You know I added tsc_is_invariant myself. :-) However, why do we need cheaper DELAY() when we trying to "delay" something with it? Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 21:31:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 383A6106566B; Tue, 15 Mar 2011 21:31:16 +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 A0F908FC16; Tue, 15 Mar 2011 21:31:15 +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 p2FLVAsK012284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Mar 2011 23:31:11 +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 p2FLVAtZ056769; Tue, 15 Mar 2011 23:31:10 +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 p2FLVAqE056768; Tue, 15 Mar 2011 23:31:10 +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: Tue, 15 Mar 2011 23:31:10 +0200 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20110315213110.GM78089@deviant.kiev.zoral.com.ua> References: <201103142205.p2EM5x6E012664@svn.freebsd.org> <201103151526.14264.jkim@FreeBSD.org> <201103151551.54196.jhb@freebsd.org> <201103151721.42664.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VBPz+4ZpWFKX9Cmp" Content-Disposition: inline In-Reply-To: <201103151721.42664.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, 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-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , John Baldwin Subject: Re: svn commit: r219646 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 21:31:16 -0000 --VBPz+4ZpWFKX9Cmp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 15, 2011 at 05:21:34PM -0400, Jung-uk Kim wrote: > However, why do we need cheaper DELAY() when we trying to "delay"=20 > something with it? Busy-loop performing repeated access to the south bridge eats the bus capacity, that could be useful for other bus agent and other cores. I think this is the case with HPET, while TSC is core-local. --VBPz+4ZpWFKX9Cmp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1/2p4ACgkQC3+MBN1Mb4is3QCgmBXPYx4yA89Z/yWWBj3r37xE YOcAoIx7l8tJVRDFgnehaTa/ukDAm6Lj =Qmcu -----END PGP SIGNATURE----- --VBPz+4ZpWFKX9Cmp-- From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 21:34:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681A3106566C; Tue, 15 Mar 2011 21:34:11 +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 561D18FC17; Tue, 15 Mar 2011 21:34: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 p2FLYBWq059999; Tue, 15 Mar 2011 21:34:11 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FLYB66059995; Tue, 15 Mar 2011 21:34:11 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201103152134.p2FLYB66059995@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 15 Mar 2011 21:34:11 +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: r219678 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 21:34:11 -0000 Author: ken Date: Tue Mar 15 21:34:10 2011 New Revision: 219678 URL: http://svn.freebsd.org/changeset/base/219678 Log: MFC: 212624, 212669, 213535 Merge the mps(4) man page. r212624 | ken | 2010-09-14 15:40:29 -0600 (Tue, 14 Sep 2010) | 7 lines MFp4 (//depot/projects/mps/...) Add a man page for the mps(4) driver, and reference it in the mpt(4) driver man page. Sponsored by: Spectra Logic Corporation r212669 | ken | 2010-09-15 10:05:51 -0600 (Wed, 15 Sep 2010) | 6 lines MFp4 (//depot/projects/mps/...) Fix a typo. Submitted by: pluknet at gmail dot com r213535 | ken | 2010-10-07 15:56:10 -0600 (Thu, 07 Oct 2010) | 36 lines Turn on serialization of task management commands going down to the controller, but make it optional. After a problem report from Andrew Boyer, it looks like the LSI chip may have issues (the watchdog timer fired) if too many aborts are sent down to the chip at the same time. We know that task management commands are serialized, and although the manual doesn't say it, it may be a good idea to just send one at a time. But, since I'm not certain that this is necessary, add a tunable and sysctl variable (hw.mps.%d.allow_multiple_tm_cmds) to control the driver's behavior. mps.c: Add support for the sysctl and tunable, and add a comment about the possible return values to mps_map_command(). mps_sas.c: Run all task management commands through two new routines, mpssas_issue_tm_request() and mpssas_complete_tm_request(). This allows us to optionally serialize task management commands. Also, change things so that the response to a task management command always comes back through the callback. (Before it could come via the callback or the return value.) mpsvar.h: Add softc variables for the list of active task management commands, the number of active commands, and whether we should allow multiple active task management commands. Add an active command flag. mps.4: Describe the new sysctl/loader tunable variable. Sponsored by: Spectra Logic Corporation Reminded by: Hubert Tournier Added: stable/8/share/man/man4/mps.4 - copied, changed from r212624, head/share/man/man4/mps.4 Modified: stable/8/share/man/man4/Makefile stable/8/share/man/man4/mpt.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Tue Mar 15 20:24:21 2011 (r219677) +++ stable/8/share/man/man4/Makefile Tue Mar 15 21:34:10 2011 (r219678) @@ -218,6 +218,7 @@ MAN= aac.4 \ mmcsd.4 \ mn.4 \ mouse.4 \ + mps.4 \ mpt.4 \ msk.4 \ mtio.4 \ Copied and modified: stable/8/share/man/man4/mps.4 (from r212624, head/share/man/man4/mps.4) ============================================================================== --- head/share/man/man4/mps.4 Tue Sep 14 21:40:29 2010 (r212624, copy source) +++ stable/8/share/man/man4/mps.4 Tue Mar 15 21:34:10 2011 (r219678) @@ -31,7 +31,7 @@ .\" .\" Author: Ken Merry .\" -.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#1 $ +.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#4 $ .\" $FreeBSD$ .\" .Dd September 13, 2010 @@ -51,7 +51,7 @@ place the following lines in your kernel Or, to load the driver as a module at boot, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -mpt_load="YES" +mps_load="YES" .Ed .Sh DESCRIPTION The @@ -97,6 +97,20 @@ driver instances, set the following tuna .Bd -literal -offset indent hw.mps.disable_msix=1 .Ed +.Pp +To allow the driver to send multiple task management commands (like abort, +LUN reset, etc.), set the following variable: +.Bd -literal -offset indent +hw.mps.X.allow_multiple_tm_cmds=1 +.Ed +.Pp +via +.Xr loader.conf 5 +or +.Xr sysctl 8 , +where X is the adapter number. +By default the driver only sends one task management command at a time, to +avoid causing a potential controller lock-up. .Sh DEBUGGING To enable debugging prints from the .Nm Modified: stable/8/share/man/man4/mpt.4 ============================================================================== --- stable/8/share/man/man4/mpt.4 Tue Mar 15 20:24:21 2011 (r219677) +++ stable/8/share/man/man4/mpt.4 Tue Mar 15 21:34:10 2011 (r219678) @@ -152,6 +152,7 @@ can take on - no separate compilation is .Xr cd 4 , .Xr ch 4 , .Xr da 4 , +.Xr mps 4 , .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 21:45:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D2CC106566B; Tue, 15 Mar 2011 21:45: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 4C4BC8FC14; Tue, 15 Mar 2011 21:45: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 p2FLjAWB060258; Tue, 15 Mar 2011 21:45:10 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FLjAlt060256; Tue, 15 Mar 2011 21:45:10 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103152145.p2FLjAlt060256@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Mar 2011 21:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219679 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 21:45:10 -0000 Author: jkim Date: Tue Mar 15 21:45:10 2011 New Revision: 219679 URL: http://svn.freebsd.org/changeset/base/219679 Log: Partially revert r219672. After r198295, kernel need to seed randomness as soon as possible for stack protector. However, dummy timecounter does not have enough entropy and we don't need to sacrifice Pentium class and later. Pointed out by: Maxim Dounin (mdounin at mdounin dot ru) Modified: head/sys/i386/include/cpu.h Modified: head/sys/i386/include/cpu.h ============================================================================== --- head/sys/i386/include/cpu.h Tue Mar 15 21:34:10 2011 (r219678) +++ head/sys/i386/include/cpu.h Tue Mar 15 21:45:10 2011 (r219679) @@ -69,10 +69,14 @@ void swi_vm(void *); static __inline uint64_t get_cyclecount(void) { +#if defined(I486_CPU) || defined(KLD_MODULE) struct bintime bt; binuptime(&bt); return ((uint64_t)bt.sec << 56 | bt.frac >> 8); +#else + return (rdtsc()); +#endif } #endif From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 22:22:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D0F3106566B; Tue, 15 Mar 2011 22:22:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2AF8FC0A; Tue, 15 Mar 2011 22:22: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 p2FMMCGF061158; Tue, 15 Mar 2011 22:22:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FMMB8O061154; Tue, 15 Mar 2011 22:22:11 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103152222.p2FMMB8O061154@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Mar 2011 22:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219680 - in head/bin: ln rm test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 22:22:12 -0000 Author: jilles Date: Tue Mar 15 22:22:11 2011 New Revision: 219680 URL: http://svn.freebsd.org/changeset/base/219680 Log: bin: Prefer strrchr() to rindex(). This removes the last index/rindex usage from /bin. Modified: head/bin/ln/ln.c head/bin/rm/rm.c head/bin/test/test.c Modified: head/bin/ln/ln.c ============================================================================== --- head/bin/ln/ln.c Tue Mar 15 21:45:10 2011 (r219679) +++ head/bin/ln/ln.c Tue Mar 15 22:22:11 2011 (r219680) @@ -80,7 +80,7 @@ main(int argc, char *argv[]) * "link", for which the functionality provided is greatly * simplified. */ - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Tue Mar 15 21:45:10 2011 (r219679) +++ head/bin/rm/rm.c Tue Mar 15 22:22:11 2011 (r219680) @@ -90,7 +90,7 @@ main(int argc, char *argv[]) * "unlink", for which the functionality provided is greatly * simplified. */ - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Tue Mar 15 21:45:10 2011 (r219679) +++ head/bin/test/test.c Tue Mar 15 22:22:11 2011 (r219680) @@ -194,7 +194,7 @@ main(int argc, char **argv) int res; char *p; - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else p++; From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 23:51:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 575D61065670; Tue, 15 Mar 2011 23:51:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 455F58FC1B; Tue, 15 Mar 2011 23:51: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 p2FNplwq063194; Tue, 15 Mar 2011 23:51:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2FNplUK063192; Tue, 15 Mar 2011 23:51:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103152351.p2FNplUK063192@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Mar 2011 23:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219682 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 23:51:47 -0000 Author: jilles Date: Tue Mar 15 23:51:47 2011 New Revision: 219682 URL: http://svn.freebsd.org/changeset/base/219682 Log: rfork(2): Discourage rfork_thread-like approaches. Calling rfork_thread(3) does not interoperate with pthreads and global state is not properly protected. Remove the BUGS section suggesting LinuxThreads entirely. With the current pthread library libthr, all threads are kernel-level entities so there seems little reason to use LinuxThreads. Modified: head/lib/libc/sys/rfork.2 Modified: head/lib/libc/sys/rfork.2 ============================================================================== --- head/lib/libc/sys/rfork.2 Tue Mar 15 23:28:15 2011 (r219681) +++ head/lib/libc/sys/rfork.2 Tue Mar 15 23:51:47 2011 (r219682) @@ -5,7 +5,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 14, 2007 +.Dd March 15, 2011 .Dt RFORK 2 .Os .Sh NAME @@ -80,6 +80,7 @@ the new process to run on the provided s See .Xr rfork_thread 3 for information. +Note that a lot of code will not run correctly in such an environment. .It Dv RFSIGSHARE If set, the kernel will force sharing the sigacts structure between the child and the parent. @@ -171,24 +172,9 @@ There is insufficient swap space for the .Xr intro 2 , .Xr minherit 2 , .Xr vfork 2 , +.Xr pthread_create 3 , .Xr rfork_thread 3 .Sh HISTORY The .Fn rfork function first appeared in Plan9. -.Sh BUGS -.Fx -does not yet implement a native -.Fn clone -library call, and the current pthreads implementation does not use -.Fn rfork -with RFMEM. -A native port of the linux threads library, -.Pa /usr/ports/devel/linuxthreads , -contains a working -.Fn clone -call that utilizes RFMEM. -The -.Xr rfork_thread 3 -function can often be used instead of -.Fn clone . From owner-svn-src-all@FreeBSD.ORG Tue Mar 15 23:54:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id C4B64106566C; Tue, 15 Mar 2011 23:54:19 +0000 (UTC) Date: Tue, 15 Mar 2011 23:54:19 +0000 From: Alexander Best To: Jilles Tjoelker Message-ID: <20110315235419.GA45188@freebsd.org> References: <201103152222.p2FMMB8O061154@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201103152222.p2FMMB8O061154@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219680 - in head/bin: ln rm test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 23:54:19 -0000 On Tue Mar 15 11, Jilles Tjoelker wrote: > Author: jilles > Date: Tue Mar 15 22:22:11 2011 > New Revision: 219680 > URL: http://svn.freebsd.org/changeset/base/219680 > > Log: > bin: Prefer strrchr() to rindex(). shouldn't the rindex(3) manual contain a note regarding it's depricated nature and the fact that strchr(3) is preferred? cheers. alex > > This removes the last index/rindex usage from /bin. > > Modified: > head/bin/ln/ln.c > head/bin/rm/rm.c > head/bin/test/test.c > > Modified: head/bin/ln/ln.c > ============================================================================== > --- head/bin/ln/ln.c Tue Mar 15 21:45:10 2011 (r219679) > +++ head/bin/ln/ln.c Tue Mar 15 22:22:11 2011 (r219680) > @@ -80,7 +80,7 @@ main(int argc, char *argv[]) > * "link", for which the functionality provided is greatly > * simplified. > */ > - if ((p = rindex(argv[0], '/')) == NULL) > + if ((p = strrchr(argv[0], '/')) == NULL) > p = argv[0]; > else > ++p; > > Modified: head/bin/rm/rm.c > ============================================================================== > --- head/bin/rm/rm.c Tue Mar 15 21:45:10 2011 (r219679) > +++ head/bin/rm/rm.c Tue Mar 15 22:22:11 2011 (r219680) > @@ -90,7 +90,7 @@ main(int argc, char *argv[]) > * "unlink", for which the functionality provided is greatly > * simplified. > */ > - if ((p = rindex(argv[0], '/')) == NULL) > + if ((p = strrchr(argv[0], '/')) == NULL) > p = argv[0]; > else > ++p; > > Modified: head/bin/test/test.c > ============================================================================== > --- head/bin/test/test.c Tue Mar 15 21:45:10 2011 (r219679) > +++ head/bin/test/test.c Tue Mar 15 22:22:11 2011 (r219680) > @@ -194,7 +194,7 @@ main(int argc, char **argv) > int res; > char *p; > > - if ((p = rindex(argv[0], '/')) == NULL) > + if ((p = strrchr(argv[0], '/')) == NULL) > p = argv[0]; > else > p++; -- a13x From owner-svn-src-all@FreeBSD.ORG Wed Mar 16 00:08:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A926106566B; Wed, 16 Mar 2011 00:08:10 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59B358FC18; Wed, 16 Mar 2011 00:08: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 p2G08A7K063585; Wed, 16 Mar 2011 00:08:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G08A8H063583; Wed, 16 Mar 2011 00:08:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201103160008.p2G08A8H063583@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 16 Mar 2011 00:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219683 - head/sys/boot/efi/libefi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2011 00:08:10 -0000 Author: marcel Date: Wed Mar 16 00:08:10 2011 New Revision: 219683 URL: http://svn.freebsd.org/changeset/base/219683 Log: Revert previous commit: EFI_STATUS is a 64-bit integral on ia64. Fix the compile warning on i386 (where EFI_STATUS is a 32-bit integral) by casting the status argument to u_long instead. Pointy hat: brucec MFC after: 3 days Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Tue Mar 15 23:51:47 2011 (r219682) +++ head/sys/boot/efi/libefi/efipart.c Wed Mar 16 00:08:10 2011 (r219683) @@ -204,7 +204,7 @@ efipart_readwrite(EFI_BLOCK_IO *blkio, i } if (EFI_ERROR(status)) - printf("%s: rw=%d, status=%u\n", __func__, rw, status); + printf("%s: rw=%d, status=%lu\n", __func__, rw, (u_long)status); return (efi_status_to_errno(status)); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 16 00:42:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CDBB1065672; Wed, 16 Mar 2011 00:42:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F15BA8FC16; Wed, 16 Mar 2011 00:42: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 p2G0gFU7064347; Wed, 16 Mar 2011 00:42:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G0gFFH064345; Wed, 16 Mar 2011 00:42:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201103160042.p2G0gFFH064345@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 16 Mar 2011 00:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219684 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2011 00:42:16 -0000 Author: marcel Date: Wed Mar 16 00:42:15 2011 New Revision: 219684 URL: http://svn.freebsd.org/changeset/base/219684 Log: Fix mv_gpio_in() for pin numbers that occupy bits 8-31 in GPIO registers. The compiler will truncate the 32-bit return value of mv_gpio_value_get() to match the 8-bit return value of mv_gpio_in(). A conditional expression is used to have mv_gpio_in() always return 0 or 1 instead. Modified: head/sys/arm/mv/gpio.c Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Wed Mar 16 00:08:10 2011 (r219683) +++ head/sys/arm/mv/gpio.c Wed Mar 16 00:42:15 2011 (r219684) @@ -344,7 +344,7 @@ uint8_t mv_gpio_in(uint32_t pin) { - return (mv_gpio_value_get(pin)); + return (mv_gpio_value_get(pin) ? 1 : 0); } static uint32_t From owner-svn-src-all@FreeBSD.ORG Wed Mar 16 00:45:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EB6D106566B; Wed, 16 Mar 2011 00:45:06 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id D80D08FC20; Wed, 16 Mar 2011 00:45:05 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 42E4817024; Wed, 16 Mar 2011 03:45:04 +0300 (MSK) Date: Wed, 16 Mar 2011 03:45:04 +0300 From: Maxim Dounin To: Jung-uk Kim Message-ID: <20110316004503.GM99496@mdounin.ru> References: <201103152145.p2FLjAlt060256@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201103152145.p2FLjAlt060256@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219679 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2011 00:45:06 -0000 Hello! On Tue, Mar 15, 2011 at 09:45:10PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Tue Mar 15 21:45:10 2011 > New Revision: 219679 > URL: http://svn.freebsd.org/changeset/base/219679 > > Log: > Partially revert r219672. After r198295, kernel need to seed randomness as > soon as possible for stack protector. However, dummy timecounter does not Not after, long before and not only for stack protector. The r198295 somewhat fixes things to actually make some randomness available early. > have enough entropy and we don't need to sacrifice Pentium class and later. > > Pointed out by: Maxim Dounin (mdounin at mdounin dot ru) > > Modified: > head/sys/i386/include/cpu.h > > Modified: head/sys/i386/include/cpu.h > ============================================================================== > --- head/sys/i386/include/cpu.h Tue Mar 15 21:34:10 2011 (r219678) > +++ head/sys/i386/include/cpu.h Tue Mar 15 21:45:10 2011 (r219679) > @@ -69,10 +69,14 @@ void swi_vm(void *); > static __inline uint64_t > get_cyclecount(void) > { > +#if defined(I486_CPU) || defined(KLD_MODULE) > struct bintime bt; > > binuptime(&bt); > return ((uint64_t)bt.sec << 56 | bt.frac >> 8); > +#else > + return (rdtsc()); > +#endif This isn't really different as long as GENERIC kernel used, as GENERIC defines I486_CPU. Maxim Dounin > } > > #endif > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Wed Mar 16 03:07:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61B9E106566B; Wed, 16 Mar 2011 03:07: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 51CE58FC08; Wed, 16 Mar 2011 03:07: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 p2G379lL067341; Wed, 16 Mar 2011 03:07:09 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G379Ea067336; Wed, 16 Mar 2011 03:07:09 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201103160307.p2G379Ea067336@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 16 Mar 2011 03:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219685 - vendor/tzdata/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2011 03:07:09 -0000 Author: edwin Date: Wed Mar 16 03:07:08 2011 New Revision: 219685 URL: http://svn.freebsd.org/changeset/base/219685 Log: Vendor import of tzdata2011d: - Pacific/Apia will have DST on 2 April instead of 3 April in 2011. - Turkye will go to DST on 28 April instead of 27 April in 2011. - Cuba will go to DST on 20 April in 2011. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/australasia vendor/tzdata/dist/etcetera vendor/tzdata/dist/europe vendor/tzdata/dist/northamerica Modified: vendor/tzdata/dist/australasia ============================================================================== --- vendor/tzdata/dist/australasia Wed Mar 16 00:42:15 2011 (r219684) +++ vendor/tzdata/dist/australasia Wed Mar 16 03:07:08 2011 (r219685) @@ -1,5 +1,5 @@ #
-# @(#)australasia	8.22
+# @(#)australasia	8.23
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
 # backwards from 1:00am to 12:00am"
 
+# From Raymond Hughes (2011-03-07)
+# I believe this will be posted shortly on the website
+# 
+# www.mcil.gov.ws
+# 
+#
+# PUBLIC NOTICE ON DAYLIGHT SAVING TIME
+#
+# Pursuant to the Daylight Saving Act 2009 and Cabinets decision,
+# businesses and the general public are hereby advised that daylight
+# saving time is on the first Saturday of April 2011 (02/04/11).
+#
+# The public is therefore advised that when the standard time strikes
+# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011,
+# then all instruments used to measure standard time are to be
+# adjusted/changed to three oclock (3:00am or 0300Hrs).
+#
+# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE,
+# INDUSTRY AND LABOUR 28th February 2011
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
 			-11:00	-	WST	2010 Sep 26
-			-11:00	1:00	WSDT	2011 Apr 3 1:00
+			-11:00	1:00	WSDT	2011 Apr 2 4:00
 			-11:00	-	WST
 
 # Solomon Is

Modified: vendor/tzdata/dist/etcetera
==============================================================================
--- vendor/tzdata/dist/etcetera	Wed Mar 16 00:42:15 2011	(r219684)
+++ vendor/tzdata/dist/etcetera	Wed Mar 16 03:07:08 2011	(r219685)
@@ -1,5 +1,5 @@
 # 
-# @(#)etcetera	8.2
+# @(#)etcetera	8.3
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -36,8 +36,7 @@ Link	Etc/GMT				Etc/GMT0
 # (i.e. west of Greenwich) even though many people would expect it to
 # mean 4 hours ahead of UTC (i.e. east of Greenwich).
 #
-# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation
-# (which is not yet supported by the tz code) allows for
+# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
 # TZ='+4'; if you want time zone abbreviations conforming to
 # ISO 8601 you can use TZ='<-0400>+4'.  Thus the commonly-expected
 # offset is kept within the angle bracket (and is used for display)

Modified: vendor/tzdata/dist/europe
==============================================================================
--- vendor/tzdata/dist/europe	Wed Mar 16 00:42:15 2011	(r219684)
+++ vendor/tzdata/dist/europe	Wed Mar 16 03:07:08 2011	(r219685)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.27
+# @(#)europe	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2483,25 +2483,18 @@ Zone	Europe/Zurich	0:34:08 -	LMT	1848 Se
 # (on a non-government server though) describing dates between 2002 and 2006:
 # http://www.alomaliye.com/bkk_2002_3769.htm
 
-# From Sue Williams (2008-08-11):
-# I spotted this news article about a potential change in Turkey.
-#
-# 
-# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
+# From Gökdeniz Karadağ (2011-03-10):
+# 
+# According to the articles linked below, Turkey will change into summer
+# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
+# This change is due to a nationwide exam on 27th.
+# 
+# 
+# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
 # 
-
-# From Sue Williams (2008-08-20):
-# This article says that around the end of March 2011, Turkey wants to
-# adjust the clocks forward by 1/2 hour and stay that way permanently.
-# The article indicates that this is a change in timezone offset in addition
-# to stopping observance of DST.
-# This proposal has not yet been approved.
-#
-# Read more here...
-#
-# Turkey to abandon daylight saving time in 2011
-# 
-# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
+# Turkish:
+# 
+# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
 # 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -2569,6 +2562,8 @@ Zone	Europe/Istanbul	1:55:52 -	LMT	1880
 			2:00	Turkey	EE%sT	1978 Oct 15
 			3:00	Turkey	TR%sT	1985 Apr 20 # Turkey Time
 			2:00	Turkey	EE%sT	2007
+			2:00	EU	EE%sT	2011 Mar 27 1:00u
+			2:00	-	EET	2011 Mar 28 1:00u
 			2:00	EU	EE%sT
 Link	Europe/Istanbul	Asia/Istanbul	# Istanbul is in both continents.
 

Modified: vendor/tzdata/dist/northamerica
==============================================================================
--- vendor/tzdata/dist/northamerica	Wed Mar 16 00:42:15 2011	(r219684)
+++ vendor/tzdata/dist/northamerica	Wed Mar 16 03:07:08 2011	(r219685)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.41
+# @(#)northamerica	8.42
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2606,6 +2606,21 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # the time was announced as "diez cinco"--the same time as here, indicating
 # that has indeed switched to DST. Assume second Sunday from 2009 forward.
 
+# From Steffen Thorsen (2011-03-08):
+# Granma announced that Cuba is going to start DST on 2011-03-20 00:00:00
+# this year. Nothing about the end date known so far (if that has
+# changed at all).
+#
+# Source:
+# 
+# http://granma.co.cu/2011/03/08/nacional/artic01.html
+# 
+#
+# Our info:
+# 
+# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
 Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
@@ -2639,7 +2654,9 @@ Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1
 Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
-Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 03:23:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0C7ED106566C;
	Wed, 16 Mar 2011 03:23:47 +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 D76318FC0A;
	Wed, 16 Mar 2011 03:23: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 p2G3NkMI067849;
	Wed, 16 Mar 2011 03:23:46 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G3Nk35067848;
	Wed, 16 Mar 2011 03:23:46 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103160323.p2G3Nk35067848@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 16 Mar 2011 03:23:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219686 - vendor/tzdata/tzdata2011d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 03:23:47 -0000

Author: edwin
Date: Wed Mar 16 03:23:46 2011
New Revision: 219686
URL: http://svn.freebsd.org/changeset/base/219686

Log:
  Tag of tzdat2011d data.

Added:
  vendor/tzdata/tzdata2011d/
     - copied from r219685, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 03:28:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4209F106564A;
	Wed, 16 Mar 2011 03:28:43 +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 318A78FC16;
	Wed, 16 Mar 2011 03:28: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 p2G3SheQ067996;
	Wed, 16 Mar 2011 03:28:43 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G3ShgY067991;
	Wed, 16 Mar 2011 03:28:43 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103160328.p2G3ShgY067991@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 16 Mar 2011 03:28:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219687 - head/contrib/tzdata
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 03:28:43 -0000

Author: edwin
Date: Wed Mar 16 03:28:42 2011
New Revision: 219687
URL: http://svn.freebsd.org/changeset/base/219687

Log:
  MFV of r219685, tzdata2011d
  
  - Pacific/Apia will have DST on 2 April instead of 3 April in 2011.
  - Turkye will go to DST on 28 April instead of 27 April in 2011.
  - Cuba will go to DST on 20 April in 2011.
  
  Obtained from:  ftp://elsie.nci.nih.gov/pub/

Modified:
  head/contrib/tzdata/australasia
  head/contrib/tzdata/etcetera
  head/contrib/tzdata/europe
  head/contrib/tzdata/northamerica
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/australasia
==============================================================================
--- head/contrib/tzdata/australasia	Wed Mar 16 03:23:46 2011	(r219686)
+++ head/contrib/tzdata/australasia	Wed Mar 16 03:28:42 2011	(r219687)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.22
+# @(#)australasia	8.23
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
 # backwards from 1:00am to 12:00am"
 
+# From Raymond Hughes (2011-03-07)
+# I believe this will be posted shortly on the website
+# 
+# www.mcil.gov.ws
+# 
+#
+# PUBLIC NOTICE ON DAYLIGHT SAVING TIME
+#
+# Pursuant to the Daylight Saving Act 2009 and Cabinets decision,
+# businesses and the general public are hereby advised that daylight
+# saving time is on the first Saturday of April 2011 (02/04/11).
+#
+# The public is therefore advised that when the standard time strikes
+# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011,
+# then all instruments used to measure standard time are to be
+# adjusted/changed to three oclock (3:00am or 0300Hrs).
+#
+# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE,
+# INDUSTRY AND LABOUR 28th February 2011
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
 			-11:00	-	WST	2010 Sep 26
-			-11:00	1:00	WSDT	2011 Apr 3 1:00
+			-11:00	1:00	WSDT	2011 Apr 2 4:00
 			-11:00	-	WST
 
 # Solomon Is

Modified: head/contrib/tzdata/etcetera
==============================================================================
--- head/contrib/tzdata/etcetera	Wed Mar 16 03:23:46 2011	(r219686)
+++ head/contrib/tzdata/etcetera	Wed Mar 16 03:28:42 2011	(r219687)
@@ -1,5 +1,5 @@
 # 
-# @(#)etcetera	8.2
+# @(#)etcetera	8.3
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -36,8 +36,7 @@ Link	Etc/GMT				Etc/GMT0
 # (i.e. west of Greenwich) even though many people would expect it to
 # mean 4 hours ahead of UTC (i.e. east of Greenwich).
 #
-# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation
-# (which is not yet supported by the tz code) allows for
+# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
 # TZ='+4'; if you want time zone abbreviations conforming to
 # ISO 8601 you can use TZ='<-0400>+4'.  Thus the commonly-expected
 # offset is kept within the angle bracket (and is used for display)

Modified: head/contrib/tzdata/europe
==============================================================================
--- head/contrib/tzdata/europe	Wed Mar 16 03:23:46 2011	(r219686)
+++ head/contrib/tzdata/europe	Wed Mar 16 03:28:42 2011	(r219687)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.27
+# @(#)europe	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2483,25 +2483,18 @@ Zone	Europe/Zurich	0:34:08 -	LMT	1848 Se
 # (on a non-government server though) describing dates between 2002 and 2006:
 # http://www.alomaliye.com/bkk_2002_3769.htm
 
-# From Sue Williams (2008-08-11):
-# I spotted this news article about a potential change in Turkey.
-#
-# 
-# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
+# From Gökdeniz Karadağ (2011-03-10):
+# 
+# According to the articles linked below, Turkey will change into summer
+# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
+# This change is due to a nationwide exam on 27th.
+# 
+# 
+# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
 # 
-
-# From Sue Williams (2008-08-20):
-# This article says that around the end of March 2011, Turkey wants to
-# adjust the clocks forward by 1/2 hour and stay that way permanently.
-# The article indicates that this is a change in timezone offset in addition
-# to stopping observance of DST.
-# This proposal has not yet been approved.
-#
-# Read more here...
-#
-# Turkey to abandon daylight saving time in 2011
-# 
-# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
+# Turkish:
+# 
+# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
 # 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -2569,6 +2562,8 @@ Zone	Europe/Istanbul	1:55:52 -	LMT	1880
 			2:00	Turkey	EE%sT	1978 Oct 15
 			3:00	Turkey	TR%sT	1985 Apr 20 # Turkey Time
 			2:00	Turkey	EE%sT	2007
+			2:00	EU	EE%sT	2011 Mar 27 1:00u
+			2:00	-	EET	2011 Mar 28 1:00u
 			2:00	EU	EE%sT
 Link	Europe/Istanbul	Asia/Istanbul	# Istanbul is in both continents.
 

Modified: head/contrib/tzdata/northamerica
==============================================================================
--- head/contrib/tzdata/northamerica	Wed Mar 16 03:23:46 2011	(r219686)
+++ head/contrib/tzdata/northamerica	Wed Mar 16 03:28:42 2011	(r219687)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.41
+# @(#)northamerica	8.42
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2606,6 +2606,21 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # the time was announced as "diez cinco"--the same time as here, indicating
 # that has indeed switched to DST. Assume second Sunday from 2009 forward.
 
+# From Steffen Thorsen (2011-03-08):
+# Granma announced that Cuba is going to start DST on 2011-03-20 00:00:00
+# this year. Nothing about the end date known so far (if that has
+# changed at all).
+#
+# Source:
+# 
+# http://granma.co.cu/2011/03/08/nacional/artic01.html
+# 
+#
+# Our info:
+# 
+# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
 Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
@@ -2639,7 +2654,9 @@ Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1
 Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
-Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 03:34:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD90A106564A;
	Wed, 16 Mar 2011 03:34:12 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9C3618FC14;
	Wed, 16 Mar 2011 03:34: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 p2G3YCcZ068157;
	Wed, 16 Mar 2011 03:34:12 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G3YCYE068152;
	Wed, 16 Mar 2011 03:34:12 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103160334.p2G3YCYE068152@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 16 Mar 2011 03:34: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: r219688 - stable/8/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 03:34:12 -0000

Author: edwin
Date: Wed Mar 16 03:34:12 2011
New Revision: 219688
URL: http://svn.freebsd.org/changeset/base/219688

Log:
  MFC of 219687, tzdata2011d:
  
  - Pacific/Apia will have DST on 2 April instead of 3 April in 2011.
  - Turkye will go to DST on 28 April instead of 27 April in 2011.
  - Cuba will go to DST on 20 April in 2011.
  
  Obtained from:  ftp://elsie.nci.nih.gov/pub/

Modified:
  stable/8/share/zoneinfo/australasia
  stable/8/share/zoneinfo/etcetera
  stable/8/share/zoneinfo/europe
  stable/8/share/zoneinfo/northamerica
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/australasia
==============================================================================
--- stable/8/share/zoneinfo/australasia	Wed Mar 16 03:28:42 2011	(r219687)
+++ stable/8/share/zoneinfo/australasia	Wed Mar 16 03:34:12 2011	(r219688)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.22
+# @(#)australasia	8.23
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
 # backwards from 1:00am to 12:00am"
 
+# From Raymond Hughes (2011-03-07)
+# I believe this will be posted shortly on the website
+# 
+# www.mcil.gov.ws
+# 
+#
+# PUBLIC NOTICE ON DAYLIGHT SAVING TIME
+#
+# Pursuant to the Daylight Saving Act 2009 and Cabinets decision,
+# businesses and the general public are hereby advised that daylight
+# saving time is on the first Saturday of April 2011 (02/04/11).
+#
+# The public is therefore advised that when the standard time strikes
+# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011,
+# then all instruments used to measure standard time are to be
+# adjusted/changed to three oclock (3:00am or 0300Hrs).
+#
+# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE,
+# INDUSTRY AND LABOUR 28th February 2011
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
 			-11:00	-	WST	2010 Sep 26
-			-11:00	1:00	WSDT	2011 Apr 3 1:00
+			-11:00	1:00	WSDT	2011 Apr 2 4:00
 			-11:00	-	WST
 
 # Solomon Is

Modified: stable/8/share/zoneinfo/etcetera
==============================================================================
--- stable/8/share/zoneinfo/etcetera	Wed Mar 16 03:28:42 2011	(r219687)
+++ stable/8/share/zoneinfo/etcetera	Wed Mar 16 03:34:12 2011	(r219688)
@@ -1,5 +1,5 @@
 # 
-# @(#)etcetera	8.2
+# @(#)etcetera	8.3
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -36,8 +36,7 @@ Link	Etc/GMT				Etc/GMT0
 # (i.e. west of Greenwich) even though many people would expect it to
 # mean 4 hours ahead of UTC (i.e. east of Greenwich).
 #
-# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation
-# (which is not yet supported by the tz code) allows for
+# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
 # TZ='+4'; if you want time zone abbreviations conforming to
 # ISO 8601 you can use TZ='<-0400>+4'.  Thus the commonly-expected
 # offset is kept within the angle bracket (and is used for display)

Modified: stable/8/share/zoneinfo/europe
==============================================================================
--- stable/8/share/zoneinfo/europe	Wed Mar 16 03:28:42 2011	(r219687)
+++ stable/8/share/zoneinfo/europe	Wed Mar 16 03:34:12 2011	(r219688)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.27
+# @(#)europe	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2483,25 +2483,18 @@ Zone	Europe/Zurich	0:34:08 -	LMT	1848 Se
 # (on a non-government server though) describing dates between 2002 and 2006:
 # http://www.alomaliye.com/bkk_2002_3769.htm
 
-# From Sue Williams (2008-08-11):
-# I spotted this news article about a potential change in Turkey.
-#
-# 
-# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
+# From Gökdeniz Karadağ (2011-03-10):
+# 
+# According to the articles linked below, Turkey will change into summer
+# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
+# This change is due to a nationwide exam on 27th.
+# 
+# 
+# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
 # 
-
-# From Sue Williams (2008-08-20):
-# This article says that around the end of March 2011, Turkey wants to
-# adjust the clocks forward by 1/2 hour and stay that way permanently.
-# The article indicates that this is a change in timezone offset in addition
-# to stopping observance of DST.
-# This proposal has not yet been approved.
-#
-# Read more here...
-#
-# Turkey to abandon daylight saving time in 2011
-# 
-# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
+# Turkish:
+# 
+# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
 # 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -2569,6 +2562,8 @@ Zone	Europe/Istanbul	1:55:52 -	LMT	1880
 			2:00	Turkey	EE%sT	1978 Oct 15
 			3:00	Turkey	TR%sT	1985 Apr 20 # Turkey Time
 			2:00	Turkey	EE%sT	2007
+			2:00	EU	EE%sT	2011 Mar 27 1:00u
+			2:00	-	EET	2011 Mar 28 1:00u
 			2:00	EU	EE%sT
 Link	Europe/Istanbul	Asia/Istanbul	# Istanbul is in both continents.
 

Modified: stable/8/share/zoneinfo/northamerica
==============================================================================
--- stable/8/share/zoneinfo/northamerica	Wed Mar 16 03:28:42 2011	(r219687)
+++ stable/8/share/zoneinfo/northamerica	Wed Mar 16 03:34:12 2011	(r219688)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.41
+# @(#)northamerica	8.42
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2606,6 +2606,21 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # the time was announced as "diez cinco"--the same time as here, indicating
 # that has indeed switched to DST. Assume second Sunday from 2009 forward.
 
+# From Steffen Thorsen (2011-03-08):
+# Granma announced that Cuba is going to start DST on 2011-03-20 00:00:00
+# this year. Nothing about the end date known so far (if that has
+# changed at all).
+#
+# Source:
+# 
+# http://granma.co.cu/2011/03/08/nacional/artic01.html
+# 
+#
+# Our info:
+# 
+# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
 Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
@@ -2639,7 +2654,9 @@ Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1
 Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
-Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 03:34:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 08DB21065679;
	Wed, 16 Mar 2011 03:34:42 +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 EC0188FC2B;
	Wed, 16 Mar 2011 03:34:41 +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 p2G3Yf7N068214;
	Wed, 16 Mar 2011 03:34:41 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G3YfKC068209;
	Wed, 16 Mar 2011 03:34:41 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103160334.p2G3YfKC068209@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 16 Mar 2011 03:34:41 +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: r219689 - stable/7/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 03:34:42 -0000

Author: edwin
Date: Wed Mar 16 03:34:41 2011
New Revision: 219689
URL: http://svn.freebsd.org/changeset/base/219689

Log:
  MFC of 219687, tzdata2011d:
  
  - Pacific/Apia will have DST on 2 April instead of 3 April in 2011.
  - Turkye will go to DST on 28 April instead of 27 April in 2011.
  - Cuba will go to DST on 20 April in 2011.
  
  Obtained from:  ftp://elsie.nci.nih.gov/pub/

Modified:
  stable/7/share/zoneinfo/australasia
  stable/7/share/zoneinfo/etcetera
  stable/7/share/zoneinfo/europe
  stable/7/share/zoneinfo/northamerica
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/australasia
==============================================================================
--- stable/7/share/zoneinfo/australasia	Wed Mar 16 03:34:12 2011	(r219688)
+++ stable/7/share/zoneinfo/australasia	Wed Mar 16 03:34:41 2011	(r219689)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.22
+# @(#)australasia	8.23
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
 # backwards from 1:00am to 12:00am"
 
+# From Raymond Hughes (2011-03-07)
+# I believe this will be posted shortly on the website
+# 
+# www.mcil.gov.ws
+# 
+#
+# PUBLIC NOTICE ON DAYLIGHT SAVING TIME
+#
+# Pursuant to the Daylight Saving Act 2009 and Cabinets decision,
+# businesses and the general public are hereby advised that daylight
+# saving time is on the first Saturday of April 2011 (02/04/11).
+#
+# The public is therefore advised that when the standard time strikes
+# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011,
+# then all instruments used to measure standard time are to be
+# adjusted/changed to three oclock (3:00am or 0300Hrs).
+#
+# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE,
+# INDUSTRY AND LABOUR 28th February 2011
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
 			-11:00	-	WST	2010 Sep 26
-			-11:00	1:00	WSDT	2011 Apr 3 1:00
+			-11:00	1:00	WSDT	2011 Apr 2 4:00
 			-11:00	-	WST
 
 # Solomon Is

Modified: stable/7/share/zoneinfo/etcetera
==============================================================================
--- stable/7/share/zoneinfo/etcetera	Wed Mar 16 03:34:12 2011	(r219688)
+++ stable/7/share/zoneinfo/etcetera	Wed Mar 16 03:34:41 2011	(r219689)
@@ -1,5 +1,5 @@
 # 
-# @(#)etcetera	8.2
+# @(#)etcetera	8.3
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -36,8 +36,7 @@ Link	Etc/GMT				Etc/GMT0
 # (i.e. west of Greenwich) even though many people would expect it to
 # mean 4 hours ahead of UTC (i.e. east of Greenwich).
 #
-# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation
-# (which is not yet supported by the tz code) allows for
+# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
 # TZ='+4'; if you want time zone abbreviations conforming to
 # ISO 8601 you can use TZ='<-0400>+4'.  Thus the commonly-expected
 # offset is kept within the angle bracket (and is used for display)

Modified: stable/7/share/zoneinfo/europe
==============================================================================
--- stable/7/share/zoneinfo/europe	Wed Mar 16 03:34:12 2011	(r219688)
+++ stable/7/share/zoneinfo/europe	Wed Mar 16 03:34:41 2011	(r219689)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.27
+# @(#)europe	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2483,25 +2483,18 @@ Zone	Europe/Zurich	0:34:08 -	LMT	1848 Se
 # (on a non-government server though) describing dates between 2002 and 2006:
 # http://www.alomaliye.com/bkk_2002_3769.htm
 
-# From Sue Williams (2008-08-11):
-# I spotted this news article about a potential change in Turkey.
-#
-# 
-# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
+# From Gökdeniz Karadağ (2011-03-10):
+# 
+# According to the articles linked below, Turkey will change into summer
+# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
+# This change is due to a nationwide exam on 27th.
+# 
+# 
+# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
 # 
-
-# From Sue Williams (2008-08-20):
-# This article says that around the end of March 2011, Turkey wants to
-# adjust the clocks forward by 1/2 hour and stay that way permanently.
-# The article indicates that this is a change in timezone offset in addition
-# to stopping observance of DST.
-# This proposal has not yet been approved.
-#
-# Read more here...
-#
-# Turkey to abandon daylight saving time in 2011
-# 
-# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
+# Turkish:
+# 
+# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
 # 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -2569,6 +2562,8 @@ Zone	Europe/Istanbul	1:55:52 -	LMT	1880
 			2:00	Turkey	EE%sT	1978 Oct 15
 			3:00	Turkey	TR%sT	1985 Apr 20 # Turkey Time
 			2:00	Turkey	EE%sT	2007
+			2:00	EU	EE%sT	2011 Mar 27 1:00u
+			2:00	-	EET	2011 Mar 28 1:00u
 			2:00	EU	EE%sT
 Link	Europe/Istanbul	Asia/Istanbul	# Istanbul is in both continents.
 

Modified: stable/7/share/zoneinfo/northamerica
==============================================================================
--- stable/7/share/zoneinfo/northamerica	Wed Mar 16 03:34:12 2011	(r219688)
+++ stable/7/share/zoneinfo/northamerica	Wed Mar 16 03:34:41 2011	(r219689)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.41
+# @(#)northamerica	8.42
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2606,6 +2606,21 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # the time was announced as "diez cinco"--the same time as here, indicating
 # that has indeed switched to DST. Assume second Sunday from 2009 forward.
 
+# From Steffen Thorsen (2011-03-08):
+# Granma announced that Cuba is going to start DST on 2011-03-20 00:00:00
+# this year. Nothing about the end date known so far (if that has
+# changed at all).
+#
+# Source:
+# 
+# http://granma.co.cu/2011/03/08/nacional/artic01.html
+# 
+#
+# Our info:
+# 
+# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
 Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
@@ -2639,7 +2654,9 @@ Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1
 Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
-Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 03:35:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 680C41065670;
	Wed, 16 Mar 2011 03:35:13 +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 56F028FC14;
	Wed, 16 Mar 2011 03:35: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 p2G3ZD34068279;
	Wed, 16 Mar 2011 03:35:13 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G3ZD4L068274;
	Wed, 16 Mar 2011 03:35:13 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103160335.p2G3ZD4L068274@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 16 Mar 2011 03:35:13 +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: r219690 - stable/6/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 03:35:13 -0000

Author: edwin
Date: Wed Mar 16 03:35:12 2011
New Revision: 219690
URL: http://svn.freebsd.org/changeset/base/219690

Log:
  MFC of 219687, tzdata2011d:
  
  - Pacific/Apia will have DST on 2 April instead of 3 April in 2011.
  - Turkye will go to DST on 28 April instead of 27 April in 2011.
  - Cuba will go to DST on 20 April in 2011.
  
  Obtained from:  ftp://elsie.nci.nih.gov/pub/

Modified:
  stable/6/share/zoneinfo/australasia
  stable/6/share/zoneinfo/etcetera
  stable/6/share/zoneinfo/europe
  stable/6/share/zoneinfo/northamerica
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/australasia
==============================================================================
--- stable/6/share/zoneinfo/australasia	Wed Mar 16 03:34:41 2011	(r219689)
+++ stable/6/share/zoneinfo/australasia	Wed Mar 16 03:35:12 2011	(r219690)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.22
+# @(#)australasia	8.23
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
 # backwards from 1:00am to 12:00am"
 
+# From Raymond Hughes (2011-03-07)
+# I believe this will be posted shortly on the website
+# 
+# www.mcil.gov.ws
+# 
+#
+# PUBLIC NOTICE ON DAYLIGHT SAVING TIME
+#
+# Pursuant to the Daylight Saving Act 2009 and Cabinets decision,
+# businesses and the general public are hereby advised that daylight
+# saving time is on the first Saturday of April 2011 (02/04/11).
+#
+# The public is therefore advised that when the standard time strikes
+# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011,
+# then all instruments used to measure standard time are to be
+# adjusted/changed to three oclock (3:00am or 0300Hrs).
+#
+# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE,
+# INDUSTRY AND LABOUR 28th February 2011
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
 			-11:00	-	WST	2010 Sep 26
-			-11:00	1:00	WSDT	2011 Apr 3 1:00
+			-11:00	1:00	WSDT	2011 Apr 2 4:00
 			-11:00	-	WST
 
 # Solomon Is

Modified: stable/6/share/zoneinfo/etcetera
==============================================================================
--- stable/6/share/zoneinfo/etcetera	Wed Mar 16 03:34:41 2011	(r219689)
+++ stable/6/share/zoneinfo/etcetera	Wed Mar 16 03:35:12 2011	(r219690)
@@ -1,5 +1,5 @@
 # 
-# @(#)etcetera	8.2
+# @(#)etcetera	8.3
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -36,8 +36,7 @@ Link	Etc/GMT				Etc/GMT0
 # (i.e. west of Greenwich) even though many people would expect it to
 # mean 4 hours ahead of UTC (i.e. east of Greenwich).
 #
-# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation
-# (which is not yet supported by the tz code) allows for
+# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
 # TZ='+4'; if you want time zone abbreviations conforming to
 # ISO 8601 you can use TZ='<-0400>+4'.  Thus the commonly-expected
 # offset is kept within the angle bracket (and is used for display)

Modified: stable/6/share/zoneinfo/europe
==============================================================================
--- stable/6/share/zoneinfo/europe	Wed Mar 16 03:34:41 2011	(r219689)
+++ stable/6/share/zoneinfo/europe	Wed Mar 16 03:35:12 2011	(r219690)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.27
+# @(#)europe	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2483,25 +2483,18 @@ Zone	Europe/Zurich	0:34:08 -	LMT	1848 Se
 # (on a non-government server though) describing dates between 2002 and 2006:
 # http://www.alomaliye.com/bkk_2002_3769.htm
 
-# From Sue Williams (2008-08-11):
-# I spotted this news article about a potential change in Turkey.
-#
-# 
-# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
+# From Gökdeniz Karadağ (2011-03-10):
+# 
+# According to the articles linked below, Turkey will change into summer
+# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
+# This change is due to a nationwide exam on 27th.
+# 
+# 
+# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
 # 
-
-# From Sue Williams (2008-08-20):
-# This article says that around the end of March 2011, Turkey wants to
-# adjust the clocks forward by 1/2 hour and stay that way permanently.
-# The article indicates that this is a change in timezone offset in addition
-# to stopping observance of DST.
-# This proposal has not yet been approved.
-#
-# Read more here...
-#
-# Turkey to abandon daylight saving time in 2011
-# 
-# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
+# Turkish:
+# 
+# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
 # 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -2569,6 +2562,8 @@ Zone	Europe/Istanbul	1:55:52 -	LMT	1880
 			2:00	Turkey	EE%sT	1978 Oct 15
 			3:00	Turkey	TR%sT	1985 Apr 20 # Turkey Time
 			2:00	Turkey	EE%sT	2007
+			2:00	EU	EE%sT	2011 Mar 27 1:00u
+			2:00	-	EET	2011 Mar 28 1:00u
 			2:00	EU	EE%sT
 Link	Europe/Istanbul	Asia/Istanbul	# Istanbul is in both continents.
 

Modified: stable/6/share/zoneinfo/northamerica
==============================================================================
--- stable/6/share/zoneinfo/northamerica	Wed Mar 16 03:34:41 2011	(r219689)
+++ stable/6/share/zoneinfo/northamerica	Wed Mar 16 03:35:12 2011	(r219690)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.41
+# @(#)northamerica	8.42
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2606,6 +2606,21 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # the time was announced as "diez cinco"--the same time as here, indicating
 # that has indeed switched to DST. Assume second Sunday from 2009 forward.
 
+# From Steffen Thorsen (2011-03-08):
+# Granma announced that Cuba is going to start DST on 2011-03-20 00:00:00
+# this year. Nothing about the end date known so far (if that has
+# changed at all).
+#
+# Source:
+# 
+# http://granma.co.cu/2011/03/08/nacional/artic01.html
+# 
+#
+# Our info:
+# 
+# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
 Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
@@ -2639,7 +2654,9 @@ Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1
 Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
-Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 03:53:18 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AFFC8106564A;
	Wed, 16 Mar 2011 03:53:18 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D42F8FC0C;
	Wed, 16 Mar 2011 03:53: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 p2G3rINP068667;
	Wed, 16 Mar 2011 03:53:18 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G3rILV068651;
	Wed, 16 Mar 2011 03:53:18 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201103160353.p2G3rILV068651@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 16 Mar 2011 03:53:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219691 - in head/sys: boot/common boot/efi/libefi
	boot/ia64/common boot/ia64/efi boot/ia64/ski ia64/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 03:53:18 -0000

Author: marcel
Date: Wed Mar 16 03:53:18 2011
New Revision: 219691
URL: http://svn.freebsd.org/changeset/base/219691

Log:
  MFaltix:
  Add support for Pre-Boot Virtual Memory (PBVM) to the loader.
  
  PBVM allows us to link the kernel at a fixed virtual address without
  having to make any assumptions about the physical memory layout. On
  the SGI Altix 350 for example, there's no usuable physical memory
  below 192GB. Also, the PBVM allows us to control better where we're
  going to physically load the kernel and its modules so that we can
  make sure we load the kernel in memory that's close to the BSP.
  
  The PBVM is managed by a simple page table. The minimum size of the
  page table is 4KB (EFI page size) and the maximum is currently set
  to 1MB. A page in the PBVM is 64KB, as that's the maximum alignment
  one can specify in a linker script. The bottom line is that PBVM is
  between 64KB and 8GB in size.
  
  The loader maps the PBVM page table at a fixed virtual address and
  using a single translations. The PBVM itself is also mapped using a
  single translation for a maximum of 32MB.
  
  While here, increase the heap in the EFI loader from 512KB to 2MB
  and set the stage for supporting relocatable modules.

Modified:
  head/sys/boot/common/Makefile.inc
  head/sys/boot/efi/libefi/libefi.c
  head/sys/boot/ia64/common/bootinfo.c
  head/sys/boot/ia64/common/copy.c
  head/sys/boot/ia64/common/exec.c
  head/sys/boot/ia64/common/libia64.h
  head/sys/boot/ia64/efi/conf.c
  head/sys/boot/ia64/efi/efimd.c
  head/sys/boot/ia64/efi/version
  head/sys/boot/ia64/ski/conf.c
  head/sys/boot/ia64/ski/libski.h
  head/sys/boot/ia64/ski/skimd.c
  head/sys/boot/ia64/ski/version
  head/sys/ia64/include/bootinfo.h
  head/sys/ia64/include/vmparam.h
Directory Properties:
  head/sys/boot/   (props changed)
  head/sys/boot/ia64/efi/   (props changed)
  head/sys/boot/ia64/ski/   (props changed)
  head/sys/boot/powerpc/boot1.chrp/   (props changed)
  head/sys/boot/powerpc/ofw/   (props changed)

Modified: head/sys/boot/common/Makefile.inc
==============================================================================
--- head/sys/boot/common/Makefile.inc	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/common/Makefile.inc	Wed Mar 16 03:53:18 2011	(r219691)
@@ -7,6 +7,8 @@ SRCS+=	module.c panic.c
 .if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64"
 SRCS+=	load_elf32.c load_elf32_obj.c reloc_elf32.c
 SRCS+=	load_elf64.c load_elf64_obj.c reloc_elf64.c
+.elif ${MACHINE_CPUARCH} == "ia64"
+SRCS+=	load_elf64.c load_elf64_obj.c reloc_elf64.c
 .elif ${MACHINE} == "pc98"
 SRCS+=	load_elf32.c load_elf32_obj.c reloc_elf32.c
 .elif ${MACHINE_CPUARCH} == "arm"
@@ -14,7 +16,7 @@ SRCS+=	load_elf32.c reloc_elf32.c
 .elif ${MACHINE_CPUARCH} == "powerpc"
 SRCS+=	load_elf32.c reloc_elf32.c
 SRCS+=	load_elf64.c reloc_elf64.c
-.elif ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "ia64"
+.elif ${MACHINE_CPUARCH} == "sparc64"
 SRCS+=	load_elf64.c reloc_elf64.c
 .endif
 

Modified: head/sys/boot/efi/libefi/libefi.c
==============================================================================
--- head/sys/boot/efi/libefi/libefi.c	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/efi/libefi/libefi.c	Wed Mar 16 03:53:18 2011	(r219691)
@@ -92,7 +92,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SY
 	BS = ST->BootServices;
 	RS = ST->RuntimeServices;
 
-	heapsize = 512*1024;
+	heapsize = 2 * 1024 * 1024;
 	status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
 	    EFI_SIZE_TO_PAGES(heapsize), &heap);
 	if (status != EFI_SUCCESS)

Modified: head/sys/boot/ia64/common/bootinfo.c
==============================================================================
--- head/sys/boot/ia64/common/bootinfo.c	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/common/bootinfo.c	Wed Mar 16 03:53:18 2011	(r219691)
@@ -226,7 +226,7 @@ bi_copymodules(vm_offset_t addr)
  * - Module metadata are formatted and placed in kernel space.
  */
 int
-bi_load(struct preloaded_file *fp, uint64_t *bi_addr)
+ia64_bootinfo(struct preloaded_file *fp, struct bootinfo **res)
 {
 	struct bootinfo bi;
 	struct preloaded_file *xp;
@@ -234,7 +234,9 @@ bi_load(struct preloaded_file *fp, uint6
 	struct devdesc *rootdev;
 	char *rootdevname;
 	vm_offset_t addr, ssym, esym;
+	int error;
 
+	*res = NULL;
 	bzero(&bi, sizeof(struct bootinfo));
 	bi.bi_magic = BOOTINFO_MAGIC;
 	bi.bi_version = 1;
@@ -289,8 +291,28 @@ bi_load(struct preloaded_file *fp, uint6
 		bi.bi_envp = 0;
 	}
 
-	addr = (addr + PAGE_MASK) & ~PAGE_MASK;
+	addr = (addr + 15) & ~15;
 	bi.bi_kernend = addr;
 
-	return (ldr_bootinfo(&bi, bi_addr));
+	error = ia64_platform_bootinfo(&bi, res);
+	if (error)
+		return (error);
+
+	if (IS_LEGACY_KERNEL()) {
+		if (*res == NULL)
+			return (EDOOFUS);
+
+		bcopy(&bi, *res, sizeof(bi));
+		return (0);
+	}
+
+	bi.bi_pbvm_pgtbl = (uintptr_t)ia64_pgtbl;
+	bi.bi_pbvm_pgtblsz = ia64_pgtblsz;
+	ia64_copyin((void *)bi.bi_memmap, addr, bi.bi_memmap_size);
+	bi.bi_memmap = addr;
+	addr = (addr + bi.bi_memmap_size + 15) & ~15;
+	bi.bi_kernend = addr + sizeof(bi);	
+	ia64_copyin(&bi, addr, sizeof(bi));
+	*res = (void *)addr;
+	return (0);
 }

Modified: head/sys/boot/ia64/common/copy.c
==============================================================================
--- head/sys/boot/ia64/common/copy.c	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/common/copy.c	Wed Mar 16 03:53:18 2011	(r219691)
@@ -32,17 +32,98 @@ __FBSDID("$FreeBSD$");
 
 #include "libia64.h"
 
+uint64_t *ia64_pgtbl;
+uint32_t ia64_pgtblsz;
+
+static int
+pgtbl_extend(u_int idx)
+{
+	uint64_t *pgtbl;
+	uint32_t pgtblsz;
+	u_int pot;
+
+	pgtblsz = (idx + 1) << 3;
+
+	/* The minimum size is 4KB. */
+	if (pgtblsz < 4096)
+		pgtblsz = 4096;
+
+	/* Find the next higher power of 2. */
+	pgtblsz--;
+	for (pot = 1; pot < 32; pot <<= 1)
+		pgtblsz = pgtblsz | (pgtblsz >> pot);
+	pgtblsz++;
+
+	/* The maximum size is 1MB. */
+	if (pgtblsz > 1048576)
+		return (ENOMEM);
+
+	/* Make sure the size is a valid (mappable) page size. */
+	if (pgtblsz == 32*1024 || pgtblsz == 128*1024 || pgtblsz == 512*1024)
+		pgtblsz <<= 1;
+
+	/* Allocate naturally aligned memory. */
+	pgtbl = (void *)ia64_platform_alloc(0, pgtblsz);
+	if (pgtbl == NULL)
+		return (ENOMEM);
+
+	/* Initialize new page table. */
+	if (ia64_pgtbl != NULL && ia64_pgtbl != pgtbl)
+		bcopy(ia64_pgtbl, pgtbl, ia64_pgtblsz);
+	bzero(pgtbl + (ia64_pgtblsz >> 3), pgtblsz - ia64_pgtblsz);
+
+	if (ia64_pgtbl != NULL && ia64_pgtbl != pgtbl)
+		ia64_platform_free(0, (uintptr_t)ia64_pgtbl, ia64_pgtblsz);
+
+	ia64_pgtbl = pgtbl;
+	ia64_pgtblsz = pgtblsz;
+	return (0);
+}
+
 static void *
 va2pa(vm_offset_t va, size_t *len)
 {
 	uint64_t pa;
+	u_int idx, ofs;
+	int error;
 
+	/* Backward compatibility. */
 	if (va >= IA64_RR_BASE(7)) {
 		pa = IA64_RR_MASK(va);
 		return ((void *)pa);
 	}
 
-	printf("\n%s: va=%lx, *len=%lx\n", __func__, va, *len);
+	if (va < IA64_PBVM_BASE) {
+		error = EINVAL;
+		goto fail;
+	}
+
+	idx = (va - IA64_PBVM_BASE) >> IA64_PBVM_PAGE_SHIFT;
+	if (idx >= (ia64_pgtblsz >> 3)) {
+		error = pgtbl_extend(idx);
+		if (error)
+			goto fail;
+	}
+
+	ofs = va & IA64_PBVM_PAGE_MASK;
+	pa = ia64_pgtbl[idx];
+	if (pa == 0) {
+		pa = ia64_platform_alloc(va - ofs, IA64_PBVM_PAGE_SIZE);
+		if (pa == 0) {
+			error = ENOMEM;
+			goto fail;
+		}
+		ia64_pgtbl[idx] = pa;
+	}
+	pa += ofs;
+
+	/* We can not cross page boundaries (in general). */
+	if (*len + ofs > IA64_PBVM_PAGE_SIZE)
+		*len = IA64_PBVM_PAGE_SIZE - ofs;
+
+	return ((void *)pa);
+
+ fail:
 	*len = 0;
 	return (NULL);
 }

Modified: head/sys/boot/ia64/common/exec.c
==============================================================================
--- head/sys/boot/ia64/common/exec.c	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/common/exec.c	Wed Mar 16 03:53:18 2011	(r219691)
@@ -36,25 +36,36 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
 
 #include 
 #include 
 
-#include "bootstrap.h"
+#include "libia64.h"
 
-#define _KERNEL
+static int elf64_exec(struct preloaded_file *amp);
+static int elf64_obj_exec(struct preloaded_file *amp);
 
-static int	elf64_exec(struct preloaded_file *amp);
-
-struct file_format ia64_elf = { elf64_loadfile, elf64_exec };
+static struct file_format ia64_elf = {
+	elf64_loadfile,
+	elf64_exec
+};
+static struct file_format ia64_elf_obj = {
+	elf64_obj_loadfile,
+	elf64_obj_exec
+};
+
+struct file_format *file_formats[] = {
+	&ia64_elf,
+	&ia64_elf_obj,
+	NULL
+};
 
 /*
  * Entered with psr.ic and psr.i both zero.
  */
-void
-enter_kernel(uint64_t start, uint64_t bi)
+static void
+enter_kernel(uint64_t start, struct bootinfo *bi)
 {
 
 	__asm __volatile("srlz.i;;");
@@ -73,53 +84,130 @@ enter_kernel(uint64_t start, uint64_t bi
 	/* NOTREACHED */
 }
 
-static int
-elf64_exec(struct preloaded_file *fp)
+static void
+mmu_wire(vm_offset_t va, vm_paddr_t pa, vm_size_t sz, u_int acc)
 {
-	struct file_metadata	*md;
-	Elf_Ehdr		*hdr;
-	pt_entry_t		pte;
-	uint64_t		bi_addr;
+	static u_int iidx = 0, didx = 0;
+	pt_entry_t pte;
+	u_int shft;
+
+	/* Round up to the smallest possible page size. */
+	if (sz < 4096)
+		sz = 4096;
+	/* Determine the exponent (base 2). */
+	shft = 0;
+	while (sz > 1) {
+		shft++;
+		sz >>= 1;
+	}
+	/* Truncate to the largest possible page size (256MB). */
+	if (shft > 28)
+		shft = 28;
+	/* Round down to a valid (mappable) page size. */
+	if (shft > 14 && (shft & 1) != 0)
+		shft--;
 
-	md = file_findmetadata(fp, MODINFOMD_ELFHDR);
-	if (md == NULL)
-		return (EINVAL);
-	hdr = (Elf_Ehdr *)&(md->md_data);
-
-	bi_load(fp, &bi_addr);
-
-	printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
+	pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
+	    PTE_PL_KERN | (acc & PTE_AR_MASK) | (pa & PTE_PPN_MASK);
 
-	ldr_enter(fp->f_name);
+	__asm __volatile("mov cr.ifa=%0" :: "r"(va));
+	__asm __volatile("mov cr.itir=%0" :: "r"(shft << 2));
+	__asm __volatile("srlz.d;;");
+
+	__asm __volatile("ptr.d %0,%1" :: "r"(va), "r"(shft << 2));
+	__asm __volatile("srlz.d;;");
+	__asm __volatile("itr.d dtr[%0]=%1" :: "r"(didx), "r"(pte));
+	__asm __volatile("srlz.d;;");
+	didx++;
+
+	if (acc == PTE_AR_RWX) {
+		__asm __volatile("ptr.i %0,%1;;" :: "r"(va), "r"(shft << 2));
+		__asm __volatile("srlz.i;;");
+		__asm __volatile("itr.i itr[%0]=%1;;" :: "r"(iidx), "r"(pte));
+		__asm __volatile("srlz.i;;");
+		iidx++;
+	}
+}
 
-	__asm __volatile("rsm psr.ic|psr.i;;");
-	__asm __volatile("srlz.i;;");
+static void
+mmu_setup_legacy(uint64_t entry)
+{
 
 	/*
 	 * Region 6 is direct mapped UC and region 7 is direct mapped
 	 * WC. The details of this is controlled by the Alt {I,D}TLB
-	 * handlers. Here we just make sure that they have the largest 
+	 * handlers. Here we just make sure that they have the largest
 	 * possible page size to minimise TLB usage.
 	 */
 	ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (28 << 2));
 	ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (28 << 2));
+	__asm __volatile("srlz.i;;");
 
-	pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
-	    PTE_PL_KERN | PTE_AR_RWX | PTE_ED;
-	pte |= IA64_RR_MASK(hdr->e_entry) & PTE_PPN_MASK;
+	mmu_wire(entry, IA64_RR_MASK(entry), 1UL << 28, PTE_AR_RWX);
+}
 
-	__asm __volatile("mov cr.ifa=%0" :: "r"(hdr->e_entry));
-	__asm __volatile("mov cr.itir=%0" :: "r"(28 << 2));
-	__asm __volatile("ptr.i %0,%1" :: "r"(hdr->e_entry), "r"(28<<2));
-	__asm __volatile("ptr.d %0,%1" :: "r"(hdr->e_entry), "r"(28<<2));
-	__asm __volatile("srlz.i;;");
-	__asm __volatile("itr.i itr[%0]=%1;;" :: "r"(0), "r"(pte));
+static void
+mmu_setup_paged(vm_offset_t pbvm_top)
+{
+	vm_size_t sz;
+
+	ia64_set_rr(IA64_RR_BASE(IA64_PBVM_RR),
+	    (IA64_PBVM_RR << 8) | (IA64_PBVM_PAGE_SHIFT << 2));
 	__asm __volatile("srlz.i;;");
-	__asm __volatile("itr.d dtr[%0]=%1;;" :: "r"(0), "r"(pte));
+
+	/* Wire the PBVM page table. */
+	mmu_wire(IA64_PBVM_PGTBL, (uintptr_t)ia64_pgtbl, ia64_pgtblsz,
+	    PTE_AR_RW);
+
+	/* Wire as much of the PBVM we can. This must be a power of 2. */
+	sz = pbvm_top - IA64_PBVM_BASE;
+	sz = (sz + IA64_PBVM_PAGE_MASK) & ~IA64_PBVM_PAGE_MASK;
+	while (sz & (sz - 1))
+		sz -= IA64_PBVM_PAGE_SIZE;
+	mmu_wire(IA64_PBVM_BASE, ia64_pgtbl[0], sz, PTE_AR_RWX);
+}
+
+static int
+elf64_exec(struct preloaded_file *fp)
+{
+	struct bootinfo *bi;
+	struct file_metadata *md;
+	Elf_Ehdr *hdr;
+	int error;
+
+	md = file_findmetadata(fp, MODINFOMD_ELFHDR);
+	if (md == NULL)
+		return (EINVAL);
+
+	error = ia64_bootinfo(fp, &bi);
+	if (error)
+		return (error);
+
+	hdr = (Elf_Ehdr *)&(md->md_data);
+	printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
+
+	error = ia64_platform_enter(fp->f_name);
+	if (error)
+		return (error);
+
+	__asm __volatile("rsm psr.ic|psr.i;;");
 	__asm __volatile("srlz.i;;");
 
-	enter_kernel(hdr->e_entry, bi_addr);
+	if (IS_LEGACY_KERNEL())
+		mmu_setup_legacy(hdr->e_entry);
+	else
+		mmu_setup_paged((uintptr_t)(bi + 1));
 
+	enter_kernel(hdr->e_entry, bi);
 	/* NOTREACHED */
-	return (0);
+	return (EDOOFUS);
+}
+
+static int
+elf64_obj_exec(struct preloaded_file *fp)
+{
+
+	printf("%s called for preloaded file %p (=%s):\n", __func__, fp,
+	    fp->f_name);
+	return (ENOSYS);
 }

Modified: head/sys/boot/ia64/common/libia64.h
==============================================================================
--- head/sys/boot/ia64/common/libia64.h	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/common/libia64.h	Wed Mar 16 03:53:18 2011	(r219691)
@@ -31,28 +31,35 @@
 
 #include 
 #include 
+#include 
+
+#define	IS_LEGACY_KERNEL()	(ia64_pgtbl == NULL || ia64_pgtblsz == 0)
 
 /*
  * Portability functions provided by the loader
  * implementation specific to the platform.
  */
-extern uint64_t ldr_alloc(vm_offset_t);
-extern int ldr_bootinfo(struct bootinfo *, uint64_t *);
-extern int ldr_enter(const char *);
+vm_paddr_t ia64_platform_alloc(vm_offset_t, vm_size_t);
+void ia64_platform_free(vm_offset_t, vm_paddr_t, vm_size_t);
+int ia64_platform_bootinfo(struct bootinfo *, struct bootinfo **);
+int ia64_platform_enter(const char *);
 
 /*
  * Functions and variables provided by the ia64 common code
  * and shared by all loader implementations.
  */
+extern uint64_t *ia64_pgtbl;
+extern uint32_t ia64_pgtblsz;
 
-extern int ia64_autoload(void);
+int ia64_autoload(void);
+int ia64_bootinfo(struct preloaded_file *, struct bootinfo **);
 
-extern ssize_t ia64_copyin(const void *, vm_offset_t, size_t);
-extern ssize_t ia64_copyout(vm_offset_t, void *, size_t);
-extern ssize_t ia64_readin(int, vm_offset_t, size_t);
-
-extern char *ia64_fmtdev(struct devdesc *);
-extern int ia64_getdev(void **, const char *, const char **);
-extern int ia64_setcurrdev(struct env_var *, int, const void *);
+ssize_t ia64_copyin(const void *, vm_offset_t, size_t);
+ssize_t ia64_copyout(vm_offset_t, void *, size_t);
+ssize_t ia64_readin(int, vm_offset_t, size_t);
+
+char *ia64_fmtdev(struct devdesc *);
+int ia64_getdev(void **, const char *, const char **);
+int ia64_setcurrdev(struct env_var *, int, const void *);
 
 #endif /* !_LIBIA64_H_ */

Modified: head/sys/boot/ia64/efi/conf.c
==============================================================================
--- head/sys/boot/ia64/efi/conf.c	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/efi/conf.c	Wed Mar 16 03:53:18 2011	(r219691)
@@ -69,17 +69,6 @@ struct netif_driver *netif_drivers[] = {
 };
 
 /* 
- * Sort formats so that those that can detect based on arguments
- * rather than reading the file go first.
- */
-extern struct file_format ia64_elf;
-
-struct file_format *file_formats[] = {
-	&ia64_elf,
-	NULL
-};
-
-/* 
  * Consoles 
  *
  * We don't prototype these in efiboot.h because they require

Modified: head/sys/boot/ia64/efi/efimd.c
==============================================================================
--- head/sys/boot/ia64/efi/efimd.c	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/efi/efimd.c	Wed Mar 16 03:53:18 2011	(r219691)
@@ -45,26 +45,147 @@ static EFI_GUID fpswa_guid = EFI_INTEL_F
 
 static EFI_GUID hcdp_guid = HCDP_TABLE_GUID;
 
+static EFI_MEMORY_DESCRIPTOR *memmap;
+static UINTN memmapsz;
 static UINTN mapkey;
+static UINTN descsz;
+static UINT32 descver;
 
-uint64_t
-ldr_alloc(vm_offset_t va)
+#define	IA64_EFI_CHUNK_SIZE	(32 * 1048576)
+static vm_paddr_t ia64_efi_chunk;
+
+#define	IA64_EFI_PGTBLSZ_MAX	1048576
+static vm_paddr_t ia64_efi_pgtbl;
+static vm_size_t ia64_efi_pgtblsz;
+
+/* Don't allocate memory below the boundary */
+#define	IA64_EFI_ALLOC_BOUNDARY	1048576
+
+static int
+ia64_efi_memmap_update(void)
+{
+	EFI_STATUS status;
+
+	if (memmap != NULL) {
+		free(memmap);
+		memmap = NULL;
+	}
+
+	memmapsz = 0;
+	BS->GetMemoryMap(&memmapsz, NULL, &mapkey, &descsz, &descver);
+	if (memmapsz == 0)
+		return (FALSE);
+	memmap = malloc(memmapsz);
+	if (memmap == NULL)
+		return (FALSE);
+
+	status = BS->GetMemoryMap(&memmapsz, memmap, &mapkey, &descsz,
+	    &descver);
+	if (EFI_ERROR(status)) {
+		free(memmap);
+		memmap = NULL;
+		return (FALSE);
+	}
+
+	return (TRUE);
+}
+
+static vm_paddr_t
+ia64_efi_alloc(vm_size_t sz)
 {
+	EFI_PHYSICAL_ADDRESS pa;
+	EFI_MEMORY_DESCRIPTOR *mm;
+	uint8_t *mmiter, *mmiterend;
+	vm_size_t memsz;
+	UINTN npgs;
+	EFI_STATUS status;
+
+	/* We can't allocate less than a page */
+	if (sz < EFI_PAGE_SIZE)
+		return (0);
+
+	/* The size must be a power of 2. */
+	if (sz & (sz - 1))
+		return (0);
+
+	if (!ia64_efi_memmap_update())
+		return (0);
+
+	mmiter = (void *)memmap;
+	mmiterend = mmiter + memmapsz;
+	for (; mmiter < mmiterend; mmiter += descsz) {
+		mm = (void *)mmiter;
+		if (mm->Type != EfiConventionalMemory)
+			continue;
+		memsz = mm->NumberOfPages * EFI_PAGE_SIZE;
+		if (mm->PhysicalStart + memsz <= IA64_EFI_ALLOC_BOUNDARY)
+			continue;
+		/*
+		 * XXX We really should make sure the memory is local to the
+		 * BSP.
+		 */
+		pa = (mm->PhysicalStart < IA64_EFI_ALLOC_BOUNDARY) ?
+		    IA64_EFI_ALLOC_BOUNDARY : mm->PhysicalStart;
+		pa  = (pa + sz - 1) & ~(sz - 1);
+		if (pa + sz > mm->PhysicalStart + memsz)
+			continue;
+
+		npgs = EFI_SIZE_TO_PAGES(sz);
+		status = BS->AllocatePages(AllocateAddress, EfiLoaderData,
+		    npgs, &pa);
+		if (!EFI_ERROR(status))
+			return (pa);
+	}
 
+	printf("%s: unable to allocate %lx bytes\n", __func__, sz);
 	return (0);
 }
 
+vm_paddr_t
+ia64_platform_alloc(vm_offset_t va, vm_size_t sz)
+{
+
+	if (va == 0) {
+		/* Page table itself. */
+		if (sz > IA64_EFI_PGTBLSZ_MAX)
+			return (0);
+		if (ia64_efi_pgtbl == 0)
+			ia64_efi_pgtbl = ia64_efi_alloc(IA64_EFI_PGTBLSZ_MAX);
+		if (ia64_efi_pgtbl != 0)
+			ia64_efi_pgtblsz = sz;
+		return (ia64_efi_pgtbl);
+	} else if (va < IA64_PBVM_BASE) {
+		/* Should not happen. */
+		return (0);
+	}
+
+	/* Loader virtual memory page. */
+	va -= IA64_PBVM_BASE;
+
+	/* Allocate a big chunk that can be wired with a single PTE. */
+	if (ia64_efi_chunk == 0)
+		ia64_efi_chunk = ia64_efi_alloc(IA64_EFI_CHUNK_SIZE);
+	if (va < IA64_EFI_CHUNK_SIZE)
+		return (ia64_efi_chunk + va);
+
+	/* Allocate a page at a time when we go beyond the chunk. */
+	return (ia64_efi_alloc(sz));
+}
+
+void
+ia64_platform_free(vm_offset_t va, vm_paddr_t pa, vm_size_t sz)
+{
+
+	BS->FreePages(pa, sz >> EFI_PAGE_SHIFT);
+}
+
 int
-ldr_bootinfo(struct bootinfo *bi, uint64_t *bi_addr)
+ia64_platform_bootinfo(struct bootinfo *bi, struct bootinfo **res)
 {
 	VOID *fpswa;
-	EFI_MEMORY_DESCRIPTOR *mm;
-	EFI_PHYSICAL_ADDRESS addr;
 	EFI_HANDLE handle;
 	EFI_STATUS status;
-	size_t bisz;
-	UINTN mmsz, pages, sz;
-	UINT32 mmver;
+	UINTN sz;
 
 	bi->bi_systab = (uint64_t)ST;
 	bi->bi_hcdp = (uint64_t)efi_get_table(&hcdp_guid);
@@ -75,55 +196,22 @@ ldr_bootinfo(struct bootinfo *bi, uint64
 		status = BS->HandleProtocol(handle, &fpswa_guid, &fpswa);
 	bi->bi_fpswa = (status == 0) ? (uint64_t)fpswa : 0;
 
-	bisz = (sizeof(struct bootinfo) + 0x0f) & ~0x0f;
-
-	/*
-	 * Allocate enough pages to hold the bootinfo block and the memory
-	 * map EFI will return to us. The memory map has an unknown size,
-	 * so we have to determine that first. Note that the AllocatePages
-	 * call can itself modify the memory map, so we have to take that
-	 * into account as well. The changes to the memory map are caused
-	 * by splitting a range of free memory into two (AFAICT), so that
-	 * one is marked as being loader data.
-	 */
-	sz = 0;
-	BS->GetMemoryMap(&sz, NULL, &mapkey, &mmsz, &mmver);
-	sz += mmsz;
-	sz = (sz + 15) & ~15;
-	pages = EFI_SIZE_TO_PAGES(sz + bisz);
-	status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, pages,
-	    &addr);
-	if (EFI_ERROR(status)) {
-		printf("%s: AllocatePages() returned 0x%lx\n", __func__,
-		    (long)status);
+	if (!ia64_efi_memmap_update())
 		return (ENOMEM);
-	}
 
-	/*
-	 * Read the memory map and stash it after bootinfo. Align the
-	 * memory map on a 16-byte boundary (the bootinfo block is page
-	 * aligned).
-	 */
-	*bi_addr = addr;
-	mm = (void *)(addr + bisz);
-	sz = (EFI_PAGE_SIZE * pages) - bisz;
-	status = BS->GetMemoryMap(&sz, mm, &mapkey, &mmsz, &mmver);
-	if (EFI_ERROR(status)) {
-		printf("%s: GetMemoryMap() returned 0x%lx\n", __func__,
-		    (long)status);
-		return (EINVAL);
-	}
-	bi->bi_memmap = (uint64_t)mm;
-	bi->bi_memmap_size = sz;
-	bi->bi_memdesc_size = mmsz;
-	bi->bi_memdesc_version = mmver;
+	bi->bi_memmap = (uint64_t)memmap;
+	bi->bi_memmap_size = memmapsz;
+	bi->bi_memdesc_size = descsz;
+	bi->bi_memdesc_version = descver;
+
+	if (IS_LEGACY_KERNEL())
+		*res = malloc(sizeof(**res));
 
-	bcopy(bi, (void *)(*bi_addr), sizeof(*bi));
 	return (0);
 }
 
 int
-ldr_enter(const char *kernel)
+ia64_platform_enter(const char *kernel)
 {
 	EFI_STATUS status;
 

Modified: head/sys/boot/ia64/efi/version
==============================================================================
--- head/sys/boot/ia64/efi/version	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/efi/version	Wed Mar 16 03:53:18 2011	(r219691)
@@ -3,6 +3,7 @@ $FreeBSD$
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important.  Make sure the current version number is on line 6.
 
+3.0:	Add support for PBVM.
 2.2:	Create direct mapping based on start address instead of mapping
 	first 256M.
 2.1:	Add support for "-dev " argument parsing.

Modified: head/sys/boot/ia64/ski/conf.c
==============================================================================
--- head/sys/boot/ia64/ski/conf.c	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/ski/conf.c	Wed Mar 16 03:53:18 2011	(r219691)
@@ -60,18 +60,6 @@ struct fs_ops *file_system[] = {
 	NULL
 };
 
-/* Exported for ia64 only */
-/* 
- * Sort formats so that those that can detect based on arguments
- * rather than reading the file go first.
- */
-extern struct file_format ia64_elf;
-
-struct file_format *file_formats[] = {
-	&ia64_elf,
-	NULL
-};
-
 /* 
  * Consoles 
  *

Modified: head/sys/boot/ia64/ski/libski.h
==============================================================================
--- head/sys/boot/ia64/ski/libski.h	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/ski/libski.h	Wed Mar 16 03:53:18 2011	(r219691)
@@ -46,7 +46,6 @@ extern int		ski_boot(void);
 
 struct bootinfo;
 struct preloaded_file;
-extern int		bi_load(struct bootinfo *, struct preloaded_file *);
 
 #define SSC_CONSOLE_INIT		20
 #define SSC_GETCHAR			21

Modified: head/sys/boot/ia64/ski/skimd.c
==============================================================================
--- head/sys/boot/ia64/ski/skimd.c	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/ski/skimd.c	Wed Mar 16 03:53:18 2011	(r219691)
@@ -33,24 +33,31 @@ __FBSDID("$FreeBSD$");
 
 #include "libski.h"
 
-#define	PHYS_START	(4L*1024*1024*1024)
-#define	PHYS_SIZE	(64L*1024*1024 - 4L*1024)
-
 extern void acpi_stub_init(void);
 extern void efi_stub_init(struct bootinfo *);
 extern void sal_stub_init(void);
 
-uint64_t
-ldr_alloc(vm_offset_t va)
+vm_paddr_t
+ia64_platform_alloc(vm_offset_t va, vm_size_t sz __unused)
 {
+	vm_paddr_t pa;
+
+	if (va == 0)
+		pa = 1024 * 1024;
+	else
+		pa = (va - IA64_PBVM_BASE) + (64 * 1024 * 1024);
 
-	if (va >= PHYS_SIZE)
-		return (0);
-	return (va + PHYS_START);
+	return (pa);
+}
+
+void
+ia64_platform_free(vm_offset_t va __unused, vm_paddr_t pa __unused,
+    vm_size_t sz __unused)
+{
 }
 
 int
-ldr_bootinfo(struct bootinfo *bi, uint64_t *bi_addr)
+ia64_platform_bootinfo(struct bootinfo *bi, struct bootinfo **res)
 {
 	static struct bootinfo bootinfo;
 
@@ -58,17 +65,16 @@ ldr_bootinfo(struct bootinfo *bi, uint64
 	sal_stub_init();
 	acpi_stub_init();
 
-	*bi_addr = (uint64_t)(&bootinfo);
-	bootinfo = *bi;
+	*res = &bootinfo;
 	return (0);
 }
 
 int
-ldr_enter(const char *kernel)
+ia64_platform_enter(const char *kernel)
 {
 
 	while (*kernel == '/')
 		kernel++;
-        ssc(0, (uint64_t)kernel, 0, 0, SSC_LOAD_SYMBOLS);
+	ssc(0, (uint64_t)kernel, 0, 0, SSC_LOAD_SYMBOLS);
 	return (0);
 }

Modified: head/sys/boot/ia64/ski/version
==============================================================================
--- head/sys/boot/ia64/ski/version	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/boot/ia64/ski/version	Wed Mar 16 03:53:18 2011	(r219691)
@@ -3,6 +3,7 @@ $FreeBSD$
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important.  Make sure the current version number is on line 6.
 
+2.0:    Add support for PBVM.
 1.2:    Restructured. Has some user visible differences. Due to code
 	sharing, has been given the same version number as the EFI
 	loader.

Modified: head/sys/ia64/include/bootinfo.h
==============================================================================
--- head/sys/ia64/include/bootinfo.h	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/ia64/include/bootinfo.h	Wed Mar 16 03:53:18 2011	(r219691)
@@ -30,7 +30,8 @@ struct bootinfo {
 	uint64_t	bi_magic;		/* BOOTINFO_MAGIC */
 #define	BOOTINFO_MAGIC		0xdeadbeeffeedface
 	uint64_t	bi_version;		/* version 1 */
-	uint64_t	bi_spare[6];		/* was: name of booted kernel */
+	uint64_t	bi_spare[5];		/* was: name of booted kernel */
+	uint64_t	bi_pbvm_pgtbl;		/* PA of PBVM page table. */
 	uint64_t	bi_hcdp;		/* DIG64 HCDP table */
 	uint64_t	bi_fpswa;		/* FPSWA interface */
 	uint64_t	bi_boothowto;		/* value for boothowto */
@@ -39,7 +40,7 @@ struct bootinfo {
 	uint64_t	bi_memmap_size;		/* size of EFI memory map */
 	uint64_t	bi_memdesc_size;	/* sizeof EFI memory desc */
 	uint32_t	bi_memdesc_version;	/* EFI memory desc version */
-	uint32_t	bi_spare2;
+	uint32_t	bi_pbvm_pgtblsz;	/* PBVM page table size. */
 	uint64_t	bi_symtab;		/* start of kernel sym table */
 	uint64_t	bi_esymtab;		/* end of kernel sym table */
 	uint64_t	bi_kernend;		/* end of kernel space */

Modified: head/sys/ia64/include/vmparam.h
==============================================================================
--- head/sys/ia64/include/vmparam.h	Wed Mar 16 03:35:12 2011	(r219690)
+++ head/sys/ia64/include/vmparam.h	Wed Mar 16 03:53:18 2011	(r219691)
@@ -131,6 +131,16 @@
 #define IA64_PHYS_TO_RR7(x)     ((x) | IA64_RR_BASE(7))
 
 /*
+ * The Itanium architecture defines that all implementations support at
+ * least 51 virtual address bits (i.e. IMPL_VA_MSB=50). The unimplemented
+ * bits are sign-extended from VA{IMPL_VA_MSB}. As such, there's a gap in
+ * the virtual address range, which extends at most from 0x0004000000000000
+ * to 0x1ffbffffffffffff. We define the top half of a region in terms of
+ * this worst-case gap.
+ */
+#define	IA64_REGION_TOP_HALF	0x1ffc000000000000
+
+/*
  * Page size of the identity mappings in region 7.
  */
 #ifndef LOG2_ID_PAGE_SIZE
@@ -144,6 +154,42 @@
 #define	IA64_BACKINGSTORE	IA64_RR_BASE(4)
 
 /*
+ * Parameters for Pre-Boot Virtual Memory (PBVM).
+ * The kernel, its modules and metadata are loaded in the PBVM by the loader.
+ * The PBVM consists of pages for which the mapping is maintained in a page
+ * table. The page table is at least 1 EFI page large (i.e. 4KB), but can be
+ * larger to accommodate more PBVM. The maximum page table size is 1MB. With
+ * 8 bytes per page table entry, this means that the PBVM has at least 512
+ * pages and at most 128K pages.
+ * The GNU toolchain (in particular GNU ld) does not support an alignment
+ * larger than 64K. This means that we cannot guarantee page alignment for
+ * a page size that's larger than 64K. We do want to have text and data in
+ * different pages, which means that the maximum usable page size is 64KB.
+ * Consequently:
+ * The maximum total PBVM size is 8GB -- enough for a DVD image. A page table
+ * of a single EFI page (4KB) allows for 32MB of PBVM.
+ *
+ * The kernel is given the PA and size of the page table that provides the
+ * mapping of the PBVM. The page table itself is assumed to be mapped at a
+ * known virtual address and using a single translation wired into the CPU.
+ * As such, the page table is assumed to be a power of 2 and naturally aligned.
+ * The kernel also assumes that a good portion of the kernel text is mapped
+ * and wired into the CPU, but does not assume that the mapping covers the
+ * whole of PBVM.
+ */
+#define	IA64_PBVM_RR		4
+#define	IA64_PBVM_BASE		\
+		(IA64_RR_BASE(IA64_PBVM_RR) + IA64_REGION_TOP_HALF)
+
+#define	IA64_PBVM_PGTBL_MAXSZ	1048576
+#define	IA64_PBVM_PGTBL		\
+		(IA64_RR_BASE(IA64_PBVM_RR + 1) - IA64_PBVM_PGTBL_MAXSZ)
+
+#define	IA64_PBVM_PAGE_SHIFT	16	/* 64KB */
+#define	IA64_PBVM_PAGE_SIZE	(1 << IA64_PBVM_PAGE_SHIFT)
+#define	IA64_PBVM_PAGE_MASK	(IA64_PBVM_PAGE_SIZE - 1)
+
+/*
  * Mach derived constants
  */
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 05:34:16 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89294106566C;
	Wed, 16 Mar 2011 05:34:16 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au
	[211.29.132.189])
	by mx1.freebsd.org (Postfix) with ESMTP id 20F948FC21;
	Wed, 16 Mar 2011 05:34:15 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2G5YAh1004981
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 16 Mar 2011 16:34:12 +1100
Date: Wed, 16 Mar 2011 16:34:10 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jung-uk Kim 
In-Reply-To: <201103151714.15829.jkim@FreeBSD.org>
Message-ID: <20110316155820.D4010@besplex.bde.org>
References: <201103151947.p2FJlK3L057573@svn.freebsd.org>
	<201103151701.11708.jhb@freebsd.org>
	<201103151714.15829.jkim@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, John Baldwin 
Subject: Re: svn commit: r219676 - head/sys/x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 05:34:16 -0000

On Tue, 15 Mar 2011, Jung-uk Kim wrote:

> On Tuesday 15 March 2011 05:01 pm, John Baldwin wrote:
>> On Tuesday, March 15, 2011 3:47:20 pm Jung-uk Kim wrote:
>>> Author: jkim
>>> Date: Tue Mar 15 19:47:20 2011
>>> New Revision: 219676
>>> URL: http://svn.freebsd.org/changeset/base/219676
>>>
>>> Log:
>>>   Do not let machdep.tsc_freq modify tsc_freq itself.  It is bad
>>> for i386 as it does not operate atomically.  Actually, it serves
>>> no purpose.
>>>
>>>   Noticed by:	bde
>>
>> Ouch,  please revert!   We have depended on this for testing to
>> workaround BIOS issues (e.g. the USB SMI# handler firing at a bad
>> time during boot causing the TSC frequency to be calculated
>> incorrectly).  I agree it's a hack that this works, but it has
>> actually proven useful in the past.

Please revert.  I use this for setting timecounters from userland.  The
sysctl is not a hack, but the primary user interface for managing the
TSC frequency.  The kern.timecounter.tc.TSC.frequency sysctl is
secondary, and is readonly anyway, so it cannot be used to manage the
TSC frequency or even the timecounter frequency.

> You can still change timecounter frequency.  Can you please explain
> why you need to change tsc_freq directly?

1. All my scripts change tsc_freq directly.  They are portable to systems
    that don't have kern.timecounter.tc.TSC.frequency or even timecounters.
    Even for systems that have kern.timecounter.tc.TSC.frequency, the scripts
    would need messes to use this sysctl to read the TSC frequency and the
    old sysctl to write the timecounter frequency, since the tsc_freq
    variable can no longer be changed using its own sysctl and the TSC's
    TSC's timecounter current frequency can no longer be seen using the
    TSC's sysctl.
2. tsc_freq is used by other subsystems and it doesn't hurt for it to be
    as accurate as possible:
    - cputicker
    - high resolution kernel profiling
    These are relatively unimportant since you errors of 1 part per million
    don't really matter and high resolution kernel profiling is broken.

The change doesn't even fix races accessing frequency variables.  They
are still there when the local variable is copied to the timecounter
frequency.  Timecounter code divides by tc_frequency, so this race is
more serious than in most places (other places tend not to use the TSC
when tsc_freq is transiently 0 due to the races).  The divisions are in:
- tc_init
- tc_windup.  This is called from a fast interrupt handler with nothing
   but time-domain locking which doesn't help here.
- pps_event.  This can also be called from a fast interrupt handler.
Locking of ntptime's variables is also broken by calling tc_windup and
pps_event from fast interrupt handlers.  kern_ntptime.c still says
that all its routines must run at splclock or higher.  But splclock
has decayed to null.  Some of ntptimes routines are locked by Giant.
This is impossible starting in a fast interrupt handler, so tc_windup
and pps_event just call up to ntptime (ntp_update_second() and hardpps())
with no locking whatsoever.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 05:44:46 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB9CD106566B;
	Wed, 16 Mar 2011 05:44:46 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au
	[211.29.132.189])
	by mx1.freebsd.org (Postfix) with ESMTP id 504348FC14;
	Wed, 16 Mar 2011 05:44:45 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2G5iZtq022301
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 16 Mar 2011 16:44:42 +1100
Date: Wed, 16 Mar 2011 16:44:35 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jung-uk Kim 
In-Reply-To: <201103151631.34418.jkim@FreeBSD.org>
Message-ID: <20110316163507.F4107@besplex.bde.org>
References: <201103151714.p2FHEQdF049456@svn.freebsd.org>
	<20110315193306.GK99496@mdounin.ru>
	<201103151555.45816.jkim@FreeBSD.org>
	<201103151631.34418.jkim@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Maxim Dounin 
Subject: Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 05:44:46 -0000

On Tue, 15 Mar 2011, Jung-uk Kim wrote:

> On Tuesday 15 March 2011 03:55 pm, Jung-uk Kim wrote:
>> On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote:
>>> Hello!
>>>
>>> On Tue, Mar 15, 2011 at 05:14:26PM +0000, Jung-uk Kim wrote:
>>>> Author: jkim
>>>> Date: Tue Mar 15 17:14:26 2011
>>>> New Revision: 219672
>>>> URL: http://svn.freebsd.org/changeset/base/219672
>>>>
>>>> Log:
>>>>   Unconditionally use binuptime(9) for get_cyclecount(9) on
>>>> i386. Since this function is almost exclusively used for random
>>>> harvesting, there is no need for micro-optimization.  Adjust
>>>> the manual page accordingly.
>>>
>>> Note that on early boot only dummy timecounter available, and
>>> binuptime() has no entropy.

>>> As a result of this change random(9) won't have entropy on early
>>> boot on i386, and arc4random(9) as well.  While there are no
>>> known major security problems associated with it - it at least
>>> makes stack protector easily bypasseable as it now (again after
>>> r198295) uses well-known stack guard instead of random one.  And
>>> there may be other issues as well.

Is dummy timecounter used for long enough to matter?  I think completion
of clock initialization is still bogusly late for histrotical reasons,
but there is still a second or two between completion of timecounter
initialization and user mode.  The earlier stages of booting might
take 20 seconds but should be faster, so they might not provided much
more entropy from clocks.

I have entropy stuff mostly turned off and often don't even have enough
entropy to run ed on /etc/fstab early.  Don't know if I have clock entropy
turned off.

>>> Hope you thought well before moving i386 to a set of platforms
>>> which have no early boot randomness at all.  And you have good
>>> reason for doing it.

I asked for moving all platforms to binuptime() so that the bugs could
be seen by everyone :-).  Didn't know about this bug.

>> Hmm...  Is bintime(9) good enough for you then?
>
> I guess it won't work cause boottimebin is set pretty late.  Arg...
> If I can't come up with something sensible, I'll revert this commit.

boottimebin would make no difference since it just provides provides a
few non-random bits.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 05:57:58 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 337871065670;
	Wed, 16 Mar 2011 05:57:58 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au
	[211.29.132.188])
	by mx1.freebsd.org (Postfix) with ESMTP id C03978FC08;
	Wed, 16 Mar 2011 05:57:57 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2G5vrvZ027103
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 16 Mar 2011 16:57:54 +1100
Date: Wed, 16 Mar 2011 16:57:53 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Maxim Dounin 
In-Reply-To: <20110316004503.GM99496@mdounin.ru>
Message-ID: <20110316164727.Y4107@besplex.bde.org>
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<20110316004503.GM99496@mdounin.ru>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Jung-uk Kim 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 05:57:58 -0000

On Wed, 16 Mar 2011, Maxim Dounin wrote:

> On Tue, Mar 15, 2011 at 09:45:10PM +0000, Jung-uk Kim wrote:
>
>> Author: jkim
>> Date: Tue Mar 15 21:45:10 2011
>> New Revision: 219679
>> URL: http://svn.freebsd.org/changeset/base/219679
>>
>> Log:
>>   Partially revert r219672.  After r198295, kernel need to seed randomness as
>> ...
>> Modified: head/sys/i386/include/cpu.h
>> ==============================================================================
>> --- head/sys/i386/include/cpu.h	Tue Mar 15 21:34:10 2011	(r219678)
>> +++ head/sys/i386/include/cpu.h	Tue Mar 15 21:45:10 2011	(r219679)
>> @@ -69,10 +69,14 @@ void	swi_vm(void *);
>>  static __inline uint64_t
>>  get_cyclecount(void)
>>  {
>> +#if defined(I486_CPU) || defined(KLD_MODULE)
>>  	struct bintime bt;
>>
>>  	binuptime(&bt);
>>  	return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
>> +#else
>> +	return (rdtsc());
>> +#endif
>
> This isn't really different as long as GENERIC kernel used, as
> GENERIC defines I486_CPU.

Also, the KLD_MODULE case is broken.

This restores the ifdefs but not the tsc_present check in the old version.
The ifdefs are not sort of necessary, but they seem to have been bogus
in the old version.  Just checking a runtime variable like tsc_present
would have worked provided the variable existed.  tsc.c is standard so
the variable existed even if I486_CPU or KLD_MODULE was defined.  I
think TSC support was standard even when get_cyclecount() was first
committed and had an I386_CPU ifdef, so the ifdef was always bogus.  The
ifdef gave a micro-optimization in some cases, but it was a very tiny
one (avoid a perfectly predictable branch).

Bruce

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 06:25:20 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 74702106564A;
	Wed, 16 Mar 2011 06:25:20 +0000 (UTC)
	(envelope-from doconnor@gsoft.com.au)
Received: from cain.gsoft.com.au (unknown
	[IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16])
	by mx1.freebsd.org (Postfix) with ESMTP id D6B4F8FC13;
	Wed, 16 Mar 2011 06:25:19 +0000 (UTC)
Received: from ur.gsoft.com.au (Ur.gsoft.com.au [203.31.81.44])
	(authenticated bits=0)
	by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p2G6PH6W062325
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
	Wed, 16 Mar 2011 16:55:17 +1030 (CST)
	(envelope-from doconnor@gsoft.com.au)
Mime-Version: 1.0 (Apple Message framework v1082)
Content-Type: text/plain; charset=us-ascii
From: "Daniel O'Connor" 
In-Reply-To: 
Date: Wed, 16 Mar 2011 16:55:16 +1030
Content-Transfer-Encoding: 7bit
Message-Id: 
References: <201103151327.p2FDRZPK044315@svn.freebsd.org>
	<1300198773.87705.25.camel@buffy.york.ac.uk>
	<4D7FA14C.8040205@freebsd.org>
	
To: Ben Kaduk 
X-Mailer: Apple Mail (2.1082)
X-Spam-Score: -2.51 () ALL_TRUSTED,BAYES_00,T_RP_MATCHES_RCVD
X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Gavin Atkinson , src-committers@freebsd.org,
	Nathan Whitehorn 
Subject: Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 06:25:20 -0000


On 16/03/2011, at 4:14, Ben Kaduk wrote:
>> is wise to others. It's a little bit of a pain on the implementation side,
>> since you can't turn it on from newfs, but that isn't a serious obstacle.
> 
> I suspect the consensus of people like -arch and -fs will be that the
> burn-in time before it is considered sufficiently stable is be
> measured in years.

Which is a good reason to have a UI to set it :)

Or maybe when you say "auto" it asks if you want it on or not.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C







From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 07:04:14 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55A07106564A;
	Wed, 16 Mar 2011 07:04:14 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au
	[211.29.132.185])
	by mx1.freebsd.org (Postfix) with ESMTP id DEA998FC18;
	Wed, 16 Mar 2011 07:04:13 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2G74AQZ016359
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 16 Mar 2011 18:04:11 +1100
Date: Wed, 16 Mar 2011 18:04:10 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jung-uk Kim 
In-Reply-To: <201103151721.42664.jkim@FreeBSD.org>
Message-ID: <20110316174342.I4277@besplex.bde.org>
References: <201103142205.p2EM5x6E012664@svn.freebsd.org>
	<201103151526.14264.jkim@FreeBSD.org>
	<201103151551.54196.jhb@freebsd.org>
	<201103151721.42664.jkim@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Bruce Evans ,
	John Baldwin 
Subject: Re: svn commit: r219646 - head/sys/x86/isa
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 07:04:14 -0000

On Tue, 15 Mar 2011, Jung-uk Kim wrote:

> On Tuesday 15 March 2011 03:51 pm, John Baldwin wrote:
>> On Tuesday, March 15, 2011 3:26:11 pm Jung-uk Kim wrote:
>>> Now don't you think we should really kill delay by TSC? ;-)
>>
>> Delay by TSC fixed known deadlocks with the i8254 based DELAY() due
>> to the use of locks.  Be careful that you don't re-introduce old
>> bugs.
>
> Yeah, that's perfectly understood.

I don't understand it.  I don't know of any deadlocks except the ones
in ddb that I fixed, and there were deadlocks, they can't have been
fixed by using the TSC, since the TSC is not always available.  It
is not even always available on systems that have a P-state invariant
TSC synchronized across all CPUs, since it is not initialized early,
so the old deadlock avoidance is still needed.  In fact, I found the
deadlock using ddb to debug TSC initialization which used the i8254
(not via DELAY()) for calibrating the TSC frequency.

>> Also, you can use a TSC for DELAY() in cases when it is not safe to
>> use it for the timecounter (if it is not in sync across cores, but
>> is used in a machine with invariant TSCs or where the user knows
>> they won't ever throttle it). Modern Intel CPUs all have invariant
>> TSCs that are more or less in sync across cores, and we should
>> certainly still use the TSC for DELAY() in that case. Even if they
>> aren't in sync (so we can't use it for the timecounter) we should
>> still use the TSC if they are invariant as it is far cheaper than
>> anything else.
>
> That, too, is well understood.  You know I added tsc_is_invariant
> myself. :-)

"1: [pause;] decl %eax; jne 1b" in a loop works just as well as rdtsc
in a loop if the TSC is _not_ P-state invariant.  Both break similarly
if the TSC frequency changes.  You have to change the loop count if
the frequency changes, but it is hard to tell if this is necessary.
Telling if it is necessary requires reading a real hardware timer to
recalibrate occasionally from within the loop and without, and the
timer read from within the loop gives the same locking complications
that you are trying to avoid.

> However, why do we need cheaper DELAY() when we trying to "delay"
> something with it?

kib mentioned bus activity.  "1: decl %eax; jne 1b" doesn't have that.
I wonder if rdtsc has it.  Phenom has much slower rdtsc than Athlon
to help make it P-state invariant.  Does this involve bus activity?
What does "pause" do in a loop that is only accessing registers?

Bruce

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 07:44:45 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 421AB106564A;
	Wed, 16 Mar 2011 07:44:45 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au
	[211.29.132.190])
	by mx1.freebsd.org (Postfix) with ESMTP id CDBCF8FC08;
	Wed, 16 Mar 2011 07:44:44 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2G7ife8012655
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 16 Mar 2011 18:44:42 +1100
Date: Wed, 16 Mar 2011 18:44:41 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jung-uk Kim 
In-Reply-To: <201103151526.14264.jkim@FreeBSD.org>
Message-ID: <20110316180422.O4277@besplex.bde.org>
References: <201103142205.p2EM5x6E012664@svn.freebsd.org>
	<201103151232.35904.jkim@FreeBSD.org>
	<20110316035308.A2598@besplex.bde.org>
	<201103151526.14264.jkim@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Bruce Evans 
Subject: Re: svn commit: r219646 - head/sys/x86/isa
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 07:44:45 -0000

On Tue, 15 Mar 2011, Jung-uk Kim wrote:

> On Tuesday 15 March 2011 02:13 pm, Bruce Evans wrote:
>> On Tue, 15 Mar 2011, Jung-uk Kim wrote:
>>> ...
>>> I disagree.  I think we should keep away from i8254 as much as
>>> possible.
>>
>> It is adequate for DELAY(), and is the only timer that is available
>> on all x86.  You need large complications in DELAY() to make it
>> work as well as the old code using the i8254, for no gain until
>> there is an x86 without an i8254.
>
> Intel started killing off i8254 (and other "legacy" ISA devices),
> starting from "Mobile Internet Device" platforms.  Even for other
> so-called "legacy-free" platforms, it isn't adequate any more because
> of unpredictable SMI# interference.

I thought of getting a SandyBridge system and decided not to since it
it kills too much of my hardware.

Lengthening the delay due to SMI# interference doesn't matter in DELAY(),
since normal interrupts also lengthen it.  SMI# would have to corrupt
the i8254 state to cause larger problems.  (This is too easy to do
since the i8254 cannot be used without clobbering its current state
by more than advancing its countdown.)

>>>> Even in this patch, it isn't clear that the low level
>>>> timecounters are initialized before they are used.
>>>
>>> The timecounter is always initialized first, then set.
>>
>> It is still unclear whether they are initialized enough before they
>> are used since their setting is neither locked nor atomic.
>> ...
>> accessing it.  In fact, I can now see a reproducible bug in
>> DELAY(): - find an x86 that can run at 4GHz
>> - run it in 386 mode
>> - start it so that tsc_freq is 0x10000000ULL
>> - use the machdep.tsc_freq sysctl to tune tsc_freq to 0xFFFFFFFF
>
> machdep.tsc_freq should never have modified tsc_freq in the first
> place.  I am going to remove that soon.

No, changing tsc_freq is what machdep.tsc_freq is for.  Breaking this
would be backed out :-).  You can fix it using a generation count or
something.

>> [More examples of races.]
>
> Now don't you think we should really kill delay by TSC? ;-)

I always said that it should never have existed.  This leaves similar
bugs in timecounter intiialization, but there is some protection from
generation counts and time-domain locking there.

The sysctl is hackish in writing directly to the timecounter freqquency
variable instead of calling a tc function like tc_setclock().  I forget
why it does that.  (I said tc_init() before.  tc_init() is only for
initial initialization and tc_setclock() is intended only for adjustments
to the time.)

Bruce

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 08:22:29 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7254A106566B;
	Wed, 16 Mar 2011 08:22:29 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5EC298FC19;
	Wed, 16 Mar 2011 08:22: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 p2G8MThM074349;
	Wed, 16 Mar 2011 08:22:29 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G8MTxO074346;
	Wed, 16 Mar 2011 08:22:29 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201103160822.p2G8MTxO074346@svn.freebsd.org>
From: Juli Mallett 
Date: Wed, 16 Mar 2011 08:22:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219693 - in head/sys/mips: include mips
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 08:22:29 -0000

Author: jmallett
Date: Wed Mar 16 08:22:29 2011
New Revision: 219693
URL: http://svn.freebsd.org/changeset/base/219693

Log:
  o) Properly size caches and TLB on Octeon.
  o) Make COP0_SYNC do nothing on Octeon, which is fully interlocked.
  
  Submitted by:	Bhanu Prakash (with modifications)

Modified:
  head/sys/mips/include/cpuregs.h
  head/sys/mips/mips/cpu.c

Modified: head/sys/mips/include/cpuregs.h
==============================================================================
--- head/sys/mips/include/cpuregs.h	Wed Mar 16 04:03:13 2011	(r219692)
+++ head/sys/mips/include/cpuregs.h	Wed Mar 16 08:22:29 2011	(r219693)
@@ -198,12 +198,10 @@
 #endif
 
 /* CPU dependent mtc0 hazard hook */
-#ifdef CPU_CNMIPS
-#define	COP0_SYNC  nop; nop; nop; nop; nop;
+#if defined(CPU_CNMIPS) || defined(CPU_RMI)
+#define	COP0_SYNC
 #elif defined(CPU_SB1)
 #define COP0_SYNC  ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop
-#elif defined(CPU_RMI)
-#define COP0_SYNC
 #else
 /*
  * Pick a reasonable default based on the "typical" spacing described in the
@@ -571,6 +569,7 @@
  * 16/1	MIPS_COP_0_CONFIG1	..33 Configuration register 1.
  * 16/2	MIPS_COP_0_CONFIG2	..33 Configuration register 2.
  * 16/3	MIPS_COP_0_CONFIG3	..33 Configuration register 3.
+ * 16/4 MIPS_COP_0_CONFIG4	..33 Configuration register 4.
  * 17	MIPS_COP_0_LLADDR	.336 Load Linked Address.
  * 18	MIPS_COP_0_WATCH_LO	.336 WatchLo register.
  * 19	MIPS_COP_0_WATCH_HI	.333 WatchHi register.
@@ -656,7 +655,7 @@
 
 #define MIPS_CONFIG1_TLBSZ_MASK		0x7E000000	/* bits 30..25 # tlb entries minus one */
 #define MIPS_CONFIG1_TLBSZ_SHIFT	25
-#define	MIPS_MAX_TLB_ENTRIES		64
+#define	MIPS_MAX_TLB_ENTRIES		128
 
 #define MIPS_CONFIG1_IS_MASK		0x01C00000	/* bits 24..22 icache sets per way */
 #define MIPS_CONFIG1_IS_SHIFT		22
@@ -679,6 +678,10 @@
 #define MIPS_CONFIG1_EP			0x00000002	/* EJTAG implemented */
 #define MIPS_CONFIG1_FP			0x00000001	/* FPU implemented */
 
+#define MIPS_CONFIG4_MMUSIZEEXT		0x000000FF	/* bits 7.. 0 MMU Size Extension */
+#define MIPS_CONFIG4_MMUEXTDEF		0x0000C000	/* bits 15.14 MMU Extension Definition */
+#define MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT	0x00004000 /* This values denotes CONFIG4 bits  */
+
 /*
  * Values for the code field in a break instruction.
  */

Modified: head/sys/mips/mips/cpu.c
==============================================================================
--- head/sys/mips/mips/cpu.c	Wed Mar 16 04:03:13 2011	(r219692)
+++ head/sys/mips/mips/cpu.c	Wed Mar 16 08:22:29 2011	(r219693)
@@ -52,6 +52,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if defined(CPU_CNMIPS)
+#include 
+#include 
+#endif
+
 static void cpu_identify(void);
 
 struct mips_cpuinfo cpuinfo;
@@ -70,6 +75,9 @@ mips_get_identity(struct mips_cpuinfo *c
 	u_int32_t prid;
 	u_int32_t cfg0;
 	u_int32_t cfg1;
+#if defined(CPU_CNMIPS)
+	u_int32_t cfg4;
+#endif
 	u_int32_t tmp;
 
 	memset(cpuinfo, 0, sizeof(struct mips_cpuinfo));
@@ -96,6 +104,13 @@ mips_get_identity(struct mips_cpuinfo *c
 	cpuinfo->tlb_nentries = 
 	    ((cfg1 & MIPS_CONFIG1_TLBSZ_MASK) >> MIPS_CONFIG1_TLBSZ_SHIFT) + 1;
 
+	/* Add extended TLB size information from config4.  */
+#if defined(CPU_CNMIPS)
+	cfg4 = mips_rd_config4();
+	if ((cfg4 & MIPS_CONFIG4_MMUEXTDEF) == MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT)
+		cpuinfo->tlb_nentries += (cfg4 & MIPS_CONFIG4_MMUSIZEEXT) * 0x40;
+#endif
+
 	/* L1 instruction cache. */
 	tmp = (cfg1 & MIPS_CONFIG1_IL_MASK) >> MIPS_CONFIG1_IL_SHIFT;
 	if (tmp != 0) {
@@ -103,10 +118,9 @@ mips_get_identity(struct mips_cpuinfo *c
 		cpuinfo->l1.ic_nways = (((cfg1 & MIPS_CONFIG1_IA_MASK) >> MIPS_CONFIG1_IA_SHIFT)) + 1;
 		cpuinfo->l1.ic_nsets = 
 	    		1 << (((cfg1 & MIPS_CONFIG1_IS_MASK) >> MIPS_CONFIG1_IS_SHIFT) + 6);
-		cpuinfo->l1.ic_size = 
-		    cpuinfo->l1.ic_linesize * cpuinfo->l1.ic_nsets * cpuinfo->l1.ic_nways;
 	}
 
+#ifndef CPU_CNMIPS
 	/* L1 data cache. */
 	tmp = (cfg1 & MIPS_CONFIG1_DL_MASK) >> MIPS_CONFIG1_DL_SHIFT;
 	if (tmp != 0) {
@@ -116,15 +130,36 @@ mips_get_identity(struct mips_cpuinfo *c
 		cpuinfo->l1.dc_nsets = 
 		    1 << (((cfg1 & MIPS_CONFIG1_DS_MASK) >> MIPS_CONFIG1_DS_SHIFT) + 6);
 	}
-#ifdef CPU_CNMIPS
+#else
 	/*
-	 * Octeon does 128 byte line-size. But Config-Sel1 doesn't show
-	 * 128 line-size, 1 Set, 64 ways.
+	 * Some Octeon cache configuration parameters are by model family, not
+	 * config1.
 	 */
+	if (OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
+		/* Octeon and Octeon XL.  */
+		cpuinfo->l1.dc_nsets = 1;
+		cpuinfo->l1.dc_nways = 64;
+	} else if (OCTEON_IS_MODEL(OCTEON_CN5XXX)) {
+		/* Octeon Plus.  */
+		cpuinfo->l1.dc_nsets = 2;
+		cpuinfo->l1.dc_nways = 64;
+	} else if (OCTEON_IS_MODEL(OCTEON_CN6XXX)) {
+		/* Octeon II.  */
+		cpuinfo->l1.dc_nsets = 8;
+		cpuinfo->l1.dc_nways = 32;
+
+		cpuinfo->l1.ic_nsets = 8;
+		cpuinfo->l1.ic_nways = 37;
+	} else {
+		panic("%s: unsupported Cavium Networks CPU.", __func__);
+	}
+
+	/* All Octeon models use 128 byte line size.  */
 	cpuinfo->l1.dc_linesize = 128;
-	cpuinfo->l1.dc_nsets = 1;
-	cpuinfo->l1.dc_nways = 64;
 #endif
+
+	cpuinfo->l1.ic_size = cpuinfo->l1.ic_linesize
+	    * cpuinfo->l1.ic_nsets * cpuinfo->l1.ic_nways;
 	cpuinfo->l1.dc_size = cpuinfo->l1.dc_linesize 
 	    * cpuinfo->l1.dc_nsets * cpuinfo->l1.dc_nways;
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 08:51:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C6235106566C;
	Wed, 16 Mar 2011 08:51:36 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B2F6B8FC1A;
	Wed, 16 Mar 2011 08:51: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 p2G8paZt075058;
	Wed, 16 Mar 2011 08:51:36 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G8paIJ075054;
	Wed, 16 Mar 2011 08:51:36 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201103160851.p2G8paIJ075054@svn.freebsd.org>
From: Juli Mallett 
Date: Wed, 16 Mar 2011 08:51:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219694 - in head/sys: contrib/octeon-sdk
	mips/cavium/octe
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 08:51:36 -0000

Author: jmallett
Date: Wed Mar 16 08:51:36 2011
New Revision: 219694
URL: http://svn.freebsd.org/changeset/base/219694

Log:
  o) Clean up FPA pools on module unload.
  o) Allocate output buffer pool based on available output queues.
  
  Submitted by:	Bhanu Prakash (with modifications)

Modified:
  head/sys/contrib/octeon-sdk/cvmx-fpa.h
  head/sys/mips/cavium/octe/ethernet.c
  head/sys/mips/cavium/octe/wrapper-cvmx-includes.h

Modified: head/sys/contrib/octeon-sdk/cvmx-fpa.h
==============================================================================
--- head/sys/contrib/octeon-sdk/cvmx-fpa.h	Wed Mar 16 08:22:29 2011	(r219693)
+++ head/sys/contrib/octeon-sdk/cvmx-fpa.h	Wed Mar 16 08:51:36 2011	(r219694)
@@ -154,6 +154,19 @@ static inline void cvmx_fpa_enable(void)
 }
 
 /**
+ * Reset FPA to disable. Make sure buffers from all FPA pools are freed
+ * before disabling FPA.
+ */
+static inline void cvmx_fpa_disable(void)
+{
+    cvmx_fpa_ctl_status_t status;
+    
+    status.u64 = cvmx_read_csr(CVMX_FPA_CTL_STATUS);
+    status.s.reset = 1;
+    cvmx_write_csr(CVMX_FPA_CTL_STATUS, status.u64);
+}
+
+/**
  * Get a new block from the FPA
  *
  * @param pool   Pool to get the block from

Modified: head/sys/mips/cavium/octe/ethernet.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet.c	Wed Mar 16 08:22:29 2011	(r219693)
+++ head/sys/mips/cavium/octe/ethernet.c	Wed Mar 16 08:51:36 2011	(r219694)
@@ -98,6 +98,11 @@ struct ifnet *cvm_oct_device[TOTAL_NUMBE
  */
 static struct taskqueue *cvm_oct_link_taskq;
 
+/*
+ * Number of buffers in output buffer pool.
+ */
+static int cvm_oct_num_output_buffers;
+
 /**
  * Function to update link status.
  */
@@ -185,13 +190,13 @@ static void cvm_do_timer(void *arg)
 	}
 }
 
-
 /**
  * Configure common hardware for all interfaces
  */
 static void cvm_oct_configure_common_hw(device_t bus)
 {
 	struct octebus_softc *sc;
+	int pko_queues;
 	int error;
 	int rid;
 
@@ -199,13 +204,34 @@ static void cvm_oct_configure_common_hw(
 
 	/* Setup the FPA */
 	cvmx_fpa_enable();
-	cvm_oct_mem_fill_fpa(CVMX_FPA_PACKET_POOL, CVMX_FPA_PACKET_POOL_SIZE, num_packet_buffers);
-	cvm_oct_mem_fill_fpa(CVMX_FPA_WQE_POOL, CVMX_FPA_WQE_POOL_SIZE, num_packet_buffers);
-	if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL)
-		cvm_oct_mem_fill_fpa(CVMX_FPA_OUTPUT_BUFFER_POOL, CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE, 128);
+	cvm_oct_mem_fill_fpa(CVMX_FPA_PACKET_POOL, CVMX_FPA_PACKET_POOL_SIZE,
+			     num_packet_buffers);
+	cvm_oct_mem_fill_fpa(CVMX_FPA_WQE_POOL, CVMX_FPA_WQE_POOL_SIZE,
+			     num_packet_buffers);
+	if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL) {
+		/*
+		 * If the FPA uses different pools for output buffers and
+		 * packets, size the output buffer pool based on the number
+		 * of PKO queues.
+		 */
+		if (OCTEON_IS_MODEL(OCTEON_CN38XX))
+			pko_queues = 128;
+		else if (OCTEON_IS_MODEL(OCTEON_CN3XXX))
+			pko_queues = 32;
+		else if (OCTEON_IS_MODEL(OCTEON_CN50XX))
+			pko_queues = 32;
+		else
+			pko_queues = 256;
+
+		cvm_oct_num_output_buffers = 4 * pko_queues;
+		cvm_oct_mem_fill_fpa(CVMX_FPA_OUTPUT_BUFFER_POOL,
+				     CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE,
+				     cvm_oct_num_output_buffers);
+	}
 
 	if (USE_RED)
-		cvmx_helper_setup_red(num_packet_buffers/4, num_packet_buffers/8);
+		cvmx_helper_setup_red(num_packet_buffers/4,
+				      num_packet_buffers/8);
 
 	/* Enable the MII interface */
 	if (!octeon_is_simulation())
@@ -303,11 +329,13 @@ int cvm_oct_init_module(device_t bus)
 		int num_ports = cvmx_helper_ports_on_interface(interface);
 		int port;
 
-		for (port = cvmx_helper_get_ipd_port(interface, 0); port < cvmx_helper_get_ipd_port(interface, num_ports); port++) {
+		for (port = 0; port < num_ports; port++) {
 			cvmx_pip_prt_tagx_t pip_prt_tagx;
-			pip_prt_tagx.u64 = cvmx_read_csr(CVMX_PIP_PRT_TAGX(port));
+			int pkind = cvmx_helper_get_ipd_port(interface, port);
+
+			pip_prt_tagx.u64 = cvmx_read_csr(CVMX_PIP_PRT_TAGX(pkind));
 			pip_prt_tagx.s.grp = pow_receive_group;
-			cvmx_write_csr(CVMX_PIP_PRT_TAGX(port), pip_prt_tagx.u64);
+			cvmx_write_csr(CVMX_PIP_PRT_TAGX(pkind), pip_prt_tagx.u64);
 		}
 	}
 
@@ -475,4 +503,13 @@ void cvm_oct_cleanup_module(void)
 			cvm_oct_device[port] = NULL;
 		}
 	}
+	/* Free the HW pools */
+	cvm_oct_mem_empty_fpa(CVMX_FPA_PACKET_POOL, CVMX_FPA_PACKET_POOL_SIZE, num_packet_buffers);
+	cvm_oct_mem_empty_fpa(CVMX_FPA_WQE_POOL, CVMX_FPA_WQE_POOL_SIZE, num_packet_buffers);
+
+	if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL)
+		cvm_oct_mem_empty_fpa(CVMX_FPA_OUTPUT_BUFFER_POOL, CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE, cvm_oct_num_output_buffers);
+
+	/* Disable FPA, all buffers are free, not done by helper shutdown. */
+	cvmx_fpa_disable();
 }

Modified: head/sys/mips/cavium/octe/wrapper-cvmx-includes.h
==============================================================================
--- head/sys/mips/cavium/octe/wrapper-cvmx-includes.h	Wed Mar 16 08:22:29 2011	(r219693)
+++ head/sys/mips/cavium/octe/wrapper-cvmx-includes.h	Wed Mar 16 08:51:36 2011	(r219694)
@@ -45,5 +45,6 @@ AND WITH ALL FAULTS AND CAVIUM  NETWORKS
 #include 
 #include 
 #include 
+#include 
 
 #endif

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 08:56:23 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 16C32106564A;
	Wed, 16 Mar 2011 08:56:23 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EDAD18FC12;
	Wed, 16 Mar 2011 08:56: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 p2G8uM5U075208;
	Wed, 16 Mar 2011 08:56:22 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G8uM6Z075203;
	Wed, 16 Mar 2011 08:56:22 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201103160856.p2G8uM6Z075203@svn.freebsd.org>
From: Juli Mallett 
Date: Wed, 16 Mar 2011 08:56:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219695 - head/sys/mips/cavium/octe
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 08:56:23 -0000

Author: jmallett
Date: Wed Mar 16 08:56:22 2011
New Revision: 219695
URL: http://svn.freebsd.org/changeset/base/219695

Log:
  o) Tear down receive interrupt on detach.
  
  Submitted by:	Bhanu Prakash

Modified:
  head/sys/mips/cavium/octe/ethernet-common.h
  head/sys/mips/cavium/octe/ethernet.c
  head/sys/mips/cavium/octe/octebus.c
  head/sys/mips/cavium/octe/octebusvar.h

Modified: head/sys/mips/cavium/octe/ethernet-common.h
==============================================================================
--- head/sys/mips/cavium/octe/ethernet-common.h	Wed Mar 16 08:51:36 2011	(r219694)
+++ head/sys/mips/cavium/octe/ethernet-common.h	Wed Mar 16 08:56:22 2011	(r219695)
@@ -39,7 +39,7 @@ void cvm_oct_common_set_multicast_list(s
 void cvm_oct_common_set_mac_address(struct ifnet *ifp, const void *);
 
 int cvm_oct_init_module(device_t);
-void cvm_oct_cleanup_module(void);
+void cvm_oct_cleanup_module(device_t);
 
 /*
  * XXX/juli

Modified: head/sys/mips/cavium/octe/ethernet.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet.c	Wed Mar 16 08:51:36 2011	(r219694)
+++ head/sys/mips/cavium/octe/ethernet.c	Wed Mar 16 08:56:22 2011	(r219695)
@@ -250,7 +250,7 @@ static void cvm_oct_configure_common_hw(
 
         error = bus_setup_intr(bus, sc->sc_rx_irq, INTR_TYPE_NET | INTR_MPSAFE,
 			       cvm_oct_do_interrupt, NULL, cvm_oct_device,
-			       NULL);
+			       &sc->sc_rx_intr_cookie);
         if (error != 0) {
                 device_printf(bus, "could not setup workq irq");
 		return;
@@ -473,17 +473,16 @@ int cvm_oct_init_module(device_t bus)
  *
  * @return Zero on success
  */
-void cvm_oct_cleanup_module(void)
+void cvm_oct_cleanup_module(device_t bus)
 {
 	int port;
+	struct octebus_softc *sc = device_get_softc(bus);
 
 	/* Disable POW interrupt */
 	cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0);
 
-#if 0
 	/* Free the interrupt handler */
-	free_irq(8 + pow_receive_group, cvm_oct_device);
-#endif
+	bus_teardown_intr(bus, sc->sc_rx_irq, sc->sc_rx_intr_cookie);
 
 	callout_stop(&cvm_oct_poll_timer);
 	cvm_oct_rx_shutdown();

Modified: head/sys/mips/cavium/octe/octebus.c
==============================================================================
--- head/sys/mips/cavium/octe/octebus.c	Wed Mar 16 08:51:36 2011	(r219694)
+++ head/sys/mips/cavium/octe/octebus.c	Wed Mar 16 08:56:22 2011	(r219695)
@@ -112,7 +112,7 @@ octebus_attach(device_t dev)
 static int
 octebus_detach(device_t dev)
 {
-	cvm_oct_cleanup_module();
+	cvm_oct_cleanup_module(dev);
 	return (0);
 }
 

Modified: head/sys/mips/cavium/octe/octebusvar.h
==============================================================================
--- head/sys/mips/cavium/octe/octebusvar.h	Wed Mar 16 08:51:36 2011	(r219694)
+++ head/sys/mips/cavium/octe/octebusvar.h	Wed Mar 16 08:56:22 2011	(r219695)
@@ -33,6 +33,7 @@ struct octebus_softc {
 	device_t sc_dev;
 
 	struct resource *sc_rx_irq;
+	void *sc_rx_intr_cookie;
 
 	struct resource *sc_rgmii_irq;
 	struct resource *sc_spi_irq;

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 08:58:09 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7A614106566B;
	Wed, 16 Mar 2011 08:58:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 68F738FC0C;
	Wed, 16 Mar 2011 08:58: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 p2G8w9Gk075279;
	Wed, 16 Mar 2011 08:58:09 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2G8w9nR075276;
	Wed, 16 Mar 2011 08:58:09 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103160858.p2G8w9nR075276@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Wed, 16 Mar 2011 08:58:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219696 - head/lib/libc/gen
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 08:58:09 -0000

Author: pjd
Date: Wed Mar 16 08:58:09 2011
New Revision: 219696
URL: http://svn.freebsd.org/changeset/base/219696

Log:
  From fts.c comment:
  
  The "FTS_NOSTAT" option can avoid a lot of calls to stat(2) if it knows that a
  directory could not possibly have subdirectories. This is decided by looking at
  the link count: a subdirectory would increment its parent's link count by
  virtue of its own ".." entry.  This assumption only holds for UFS-like
  filesystems that implement links and directories this way, so we must punt for
  others.
  
  It looks like ZFS is a UFS-like file system, as the above also holds for ZFS.
  Add ZFS to the list of file systems that allow for such optimization.
  
  MFC after:	1 month

Modified:
  head/lib/libc/gen/fts-compat.c
  head/lib/libc/gen/fts.c

Modified: head/lib/libc/gen/fts-compat.c
==============================================================================
--- head/lib/libc/gen/fts-compat.c	Wed Mar 16 08:56:22 2011	(r219695)
+++ head/lib/libc/gen/fts-compat.c	Wed Mar 16 08:58:09 2011	(r219696)
@@ -110,6 +110,7 @@ struct _fts_private {
 
 static const char *ufslike_filesystems[] = {
 	"ufs",
+	"zfs",
 	"nfs",
 	"nfs4",
 	"ext2fs",

Modified: head/lib/libc/gen/fts.c
==============================================================================
--- head/lib/libc/gen/fts.c	Wed Mar 16 08:56:22 2011	(r219695)
+++ head/lib/libc/gen/fts.c	Wed Mar 16 08:58:09 2011	(r219696)
@@ -100,6 +100,7 @@ struct _fts_private {
 
 static const char *ufslike_filesystems[] = {
 	"ufs",
+	"zfs",
 	"nfs",
 	"nfs4",
 	"ext2fs",

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 09:07:30 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E7A27106566C;
	Wed, 16 Mar 2011 09:07:30 +0000 (UTC)
	(envelope-from pluknet@gmail.com)
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 529C78FC12;
	Wed, 16 Mar 2011 09:07:29 +0000 (UTC)
Received: by qyk27 with SMTP id 27so1234596qyk.13
	for ; Wed, 16 Mar 2011 02:07:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=pN5NFJcBzdR/I8sfGHw/xIPoamS0RcQ5HtmtQBJOsh4=;
	b=lebuw6h6Tua5DEdAEBgDvY7ZQIF6jrItI5LH84/jARdr8JbDj9ZInU//E3gpydxvVg
	q+LRsQ5VdGYAx0POpxloVmSe6GP/Ftehcsb0vgAY+/J77DvD69xobkj/G5UAL8CabPoz
	1UAEiGnN1vrBQCKxZlCS74GB9zSi+cGA1GzVE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=e8JQJtJgz/GGmnKMIRsvhHnLW/sZAzB+cJjAVaGuNpwAsZzFI6NK+obZ971FD35MKW
	JrXZudrKwdvgoBjKYqtJCwcGHitlcLJLdjtOtugmg0lCd0R8rXuNkCDPggQrTl/m7w1/
	Y/6DXpXuU+sSmihs9KpkXG8ftqEwEyUftHv/0=
MIME-Version: 1.0
Received: by 10.229.37.137 with SMTP id x9mr363838qcd.151.1300266449338; Wed,
	16 Mar 2011 02:07:29 -0700 (PDT)
Sender: pluknet@gmail.com
Received: by 10.229.232.146 with HTTP; Wed, 16 Mar 2011 02:07:29 -0700 (PDT)
In-Reply-To: <20110315235419.GA45188@freebsd.org>
References: <201103152222.p2FMMB8O061154@svn.freebsd.org>
	<20110315235419.GA45188@freebsd.org>
Date: Wed, 16 Mar 2011 12:07:29 +0300
X-Google-Sender-Auth: NkvecmhGTExZlwRmhiilF3-36UI
Message-ID: 
From: Sergey Kandaurov 
To: Alexander Best 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: Jilles Tjoelker , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r219680 - in head/bin: ln rm test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 09:07:31 -0000

On 16 March 2011 02:54, Alexander Best  wrote:
> On Tue Mar 15 11, Jilles Tjoelker wrote:
>> Author: jilles
>> Date: Tue Mar 15 22:22:11 2011
>> New Revision: 219680
>> URL: http://svn.freebsd.org/changeset/base/219680
>>
>> Log:
>> =A0 bin: Prefer strrchr() to rindex().
>
> shouldn't the rindex(3) manual contain a note regarding it's depricated n=
ature
> and the fact that strchr(3) is preferred?
>

Indeed, both index(3) and rindex(3) are marked legacy in POSIX -2004,
and are cut from -2008 edition.

--=20
wbr,
pluknet

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 12:40:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89FAA1065672;
	Wed, 16 Mar 2011 12:40:58 +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 5D5BF8FC14;
	Wed, 16 Mar 2011 12:40: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 p2GCewEJ086785;
	Wed, 16 Mar 2011 12:40:58 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GCewjA086783;
	Wed, 16 Mar 2011 12:40:58 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201103161240.p2GCewjA086783@svn.freebsd.org>
From: Martin Matuska 
Date: Wed, 16 Mar 2011 12:40:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219697 - head/contrib/gcc/config/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 12:40:58 -0000

Author: mm
Date: Wed Mar 16 12:40:58 2011
New Revision: 219697
URL: http://svn.freebsd.org/changeset/base/219697

Log:
  Fix -march/-mtune=native autodetection for Intel Core 2 CPUs
  
  Obtained from:	gcc 4.3 (partial rev. 119454; GPLv2)
  MFC after:	2 weeks

Modified:
  head/contrib/gcc/config/i386/driver-i386.c

Modified: head/contrib/gcc/config/i386/driver-i386.c
==============================================================================
--- head/contrib/gcc/config/i386/driver-i386.c	Wed Mar 16 08:58:09 2011	(r219696)
+++ head/contrib/gcc/config/i386/driver-i386.c	Wed Mar 16 12:40:58 2011	(r219697)
@@ -39,6 +39,7 @@ const char *host_detect_local_cpu (int a
 #define bit_SSE2 (1 << 26)
 
 #define bit_SSE3 (1 << 0)
+#define bit_SSSE3 (1 << 9)
 #define bit_CMPXCHG16B (1 << 13)
 
 #define bit_3DNOW (1 << 31)
@@ -66,7 +67,7 @@ const char *host_detect_local_cpu (int a
   unsigned int vendor;
   unsigned int ext_level;
   unsigned char has_mmx = 0, has_3dnow = 0, has_3dnowp = 0, has_sse = 0;
-  unsigned char has_sse2 = 0, has_sse3 = 0, has_cmov = 0;
+  unsigned char has_sse2 = 0, has_sse3 = 0, has_ssse3 = 0, has_cmov = 0;
   unsigned char has_longmode = 0, has_cmpxchg8b = 0;
   unsigned char is_amd = 0;
   unsigned int family = 0;
@@ -107,6 +108,7 @@ const char *host_detect_local_cpu (int a
   has_sse = !!(edx & bit_SSE);
   has_sse2 = !!(edx & bit_SSE2);
   has_sse3 = !!(ecx & bit_SSE3);
+  has_ssse3 = !!(ecx & bit_SSSE3);
   /* We don't care for extended family.  */
   family = (eax >> 8) & ~(1 << 4);
 
@@ -148,7 +150,9 @@ const char *host_detect_local_cpu (int a
 	  /* We have no idea.  Use something reasonable.  */
 	  if (arch)
 	    {
-	      if (has_sse3)
+	      if (has_ssse3)
+		cpu = "core2";
+	      else if (has_sse3)
 		{
 		  if (has_longmode)
 		    cpu = "nocona";
@@ -230,6 +234,9 @@ const char *host_detect_local_cpu (int a
 	  cpu = "generic";
 	}
       break;
+    case PROCESSOR_GEODE:
+      cpu = "geode";
+      break;
     case PROCESSOR_K6:
       if (has_3dnow)
         cpu = "k6-3";

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 14:00:45 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4ACE4106566B;
	Wed, 16 Mar 2011 14:00:45 +0000 (UTC)
	(envelope-from mdounin@mdounin.ru)
Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81])
	by mx1.freebsd.org (Postfix) with ESMTP id BBA4C8FC1B;
	Wed, 16 Mar 2011 14:00:44 +0000 (UTC)
Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81])
	by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 00F8917024;
	Wed, 16 Mar 2011 17:00:42 +0300 (MSK)
Date: Wed, 16 Mar 2011 17:00:42 +0300
From: Maxim Dounin 
To: Bruce Evans 
Message-ID: <20110316140042.GN99496@mdounin.ru>
References: <201103151714.p2FHEQdF049456@svn.freebsd.org>
	<20110315193306.GK99496@mdounin.ru>
	<201103151555.45816.jkim@FreeBSD.org>
	<201103151631.34418.jkim@FreeBSD.org>
	<20110316163507.F4107@besplex.bde.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20110316163507.F4107@besplex.bde.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Jung-uk Kim 
Subject: Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 14:00:45 -0000

Hello!

On Wed, Mar 16, 2011 at 04:44:35PM +1100, Bruce Evans wrote:

> On Tue, 15 Mar 2011, Jung-uk Kim wrote:
> 
> >On Tuesday 15 March 2011 03:55 pm, Jung-uk Kim wrote:
> >>On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote:
> >>>Hello!
> >>>
> >>>On Tue, Mar 15, 2011 at 05:14:26PM +0000, Jung-uk Kim wrote:
> >>>>Author: jkim
> >>>>Date: Tue Mar 15 17:14:26 2011
> >>>>New Revision: 219672
> >>>>URL: http://svn.freebsd.org/changeset/base/219672
> >>>>
> >>>>Log:
> >>>>  Unconditionally use binuptime(9) for get_cyclecount(9) on
> >>>>i386. Since this function is almost exclusively used for random
> >>>>harvesting, there is no need for micro-optimization.  Adjust
> >>>>the manual page accordingly.
> >>>
> >>>Note that on early boot only dummy timecounter available, and
> >>>binuptime() has no entropy.
> 
> >>>As a result of this change random(9) won't have entropy on early
> >>>boot on i386, and arc4random(9) as well.  While there are no
> >>>known major security problems associated with it - it at least
> >>>makes stack protector easily bypasseable as it now (again after
> >>>r198295) uses well-known stack guard instead of random one.  And
> >>>there may be other issues as well.
> 
> Is dummy timecounter used for long enough to matter?  I think completion
> of clock initialization is still bogusly late for histrotical reasons,
> but there is still a second or two between completion of timecounter
> initialization and user mode.  The earlier stages of booting might
> take 20 seconds but should be faster, so they might not provided much
> more entropy from clocks.

The problem is initial random number generator initialization 
(random(9) and acr4random(9)) and various early boot things which 
use random.  Most notably it's stack protector (which has to be 
initialized as early as possible, and requires special handling of 
code which is run before it's initialized), but there are also other 
things to care about - AFAIR booting from nfs uses the same ports 
without entropy and so on.

Right now the only entropy used at early boot are from 
get_cyclecount() call, which has at least some entropy on most 
platforms (notable exceptions are arm and i386 with i486 cpus). 
With dummy timecounter there are no entropy at early boot.

After boot everything is eventually reseeded (random(9) at 
proc0_post(), arc4random(9) and /dev/random at userland startup 
scripts) and becomes safe.

> I have entropy stuff mostly turned off and often don't even have enough
> entropy to run ed on /etc/fstab early.  Don't know if I have clock entropy
> turned off.
> 
> >>>Hope you thought well before moving i386 to a set of platforms
> >>>which have no early boot randomness at all.  And you have good
> >>>reason for doing it.
> 
> I asked for moving all platforms to binuptime() so that the bugs could
> be seen by everyone :-).  Didn't know about this bug.

If you want to change get_cyclecount() to be alias to binuptime() 
- we may consider adding another machdep call to extract early 
entropy.

I still not quite understand the reasons though.  I consider 
binuptime() to be some (bad one) fallback for get_cyclecount() on 
platforms which has no hardware counter available.  Moving all 
platforms to bad fallback looks strange.

Maxim Dounin

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 14:03:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C3DDC106564A;
	Wed, 16 Mar 2011 14:03:48 +0000 (UTC) (envelope-from bob@immure.com)
Received: from maul.immure.com (adsl-66-136-206-1.dsl.austtx.swbell.net
	[66.136.206.1])
	by mx1.freebsd.org (Postfix) with ESMTP id 461E38FC12;
	Wed, 16 Mar 2011 14:03:48 +0000 (UTC)
Received: from rancor.immure.com (rancor.immure.com [10.1.132.9])
	by maul.immure.com (8.14.4/8.14.4) with ESMTP id p2GDpMUC002059;
	Wed, 16 Mar 2011 08:51:22 -0500 (CDT) (envelope-from bob@immure.com)
Received: (from bob@localhost)
	by rancor.immure.com (8.14.4/8.14.4/Submit) id p2GDpMfO012793;
	Wed, 16 Mar 2011 08:51:22 -0500 (CDT) (envelope-from bob)
Date: Wed, 16 Mar 2011 08:51:22 -0500
From: Bob Willcox 
To: Alexander Motin 
Message-ID: <20110316135122.GB7185@rancor.immure.com>
References: <201102052134.p15LYRmw041695@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh"
Content-Disposition: inline
In-Reply-To: <201102052134.p15LYRmw041695@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-immure-MailScanner-Information: Please contact the ISP for more information
X-immure-MailScanner-ID: p2GDpMUC002059
X-immure-MailScanner: Found to be clean
X-immure-MailScanner-From: bob@immure.com
X-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: r218347 - stable/8/sys/dev/ata/chipsets
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Bob Willcox 
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 14:03:48 -0000


--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

This change has broken SATA disk support on my Intel Atom D525 ITX system. By
reverting this change 8.2-STABLE works again on this system.

My 'uname -a' output is:

FreeBSD maul.immure.com 8.2-STABLE FreeBSD 8.2-STABLE #6: Wed Mar 16 08:15:43 CDT 2011     bob@maul.immure.com:/usr/obj/usr/src/sys/MAUL  amd64

When booting the system I get tons of these messages:

Mar 16 07:38:19 maul kernel: ad4: WARNING - SETFEATURES ENABLE RCACHE requeued due to channel reset
Mar 16 07:38:19 maul kernel: ad4: interrupt on idle channel ignored

repeated over and over, and then lots of these:

Mar 16 07:38:21 maul kernel: ad4: WARNING - READ_DMA48 requeued due to channel reset LBA=617964479
Mar 16 07:38:21 maul kernel: ata2: FAILURE - already active DMA on this device
Mar 16 07:38:21 maul kernel: ata2: setting up DMA failed

for different LBA values.

As one might expect, I then start seeing I/O errors on the disk and programs
failing

I've attached the 'pciconf -lv' output.

Bob

On Sat, Feb 05, 2011 at 09:34:27PM +0000, Alexander Motin wrote:
> Author: mav
> Date: Sat Feb  5 21:34:26 2011
> New Revision: 218347
> URL: http://svn.freebsd.org/changeset/base/218347
> 
> Log:
>   MFC r217774:
>   ICH7 SATA controller in legacy mode can provide access to SATA registers
>   via AHCI-like memory resource at BAR(5). Use it if BIOS was so kind to
>   allocate memory for that BAR. This allows hot-plug support and connection
>   speed reporting.
> 
> Modified:
>   stable/8/sys/dev/ata/chipsets/ata-intel.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/ata/chipsets/ata-intel.c
> ==============================================================================
> --- stable/8/sys/dev/ata/chipsets/ata-intel.c	Sat Feb  5 21:24:37 2011	(r218346)
> +++ stable/8/sys/dev/ata/chipsets/ata-intel.c	Sat Feb  5 21:34:26 2011	(r218347)
> @@ -60,10 +60,14 @@ static int ata_intel_new_setmode(device_
>  static int ata_intel_sch_setmode(device_t dev, int target, int mode);
>  static int ata_intel_sata_getrev(device_t dev, int target);
>  static int ata_intel_sata_status(device_t dev);
> +static int ata_intel_sata_ahci_read(device_t dev, int port,
> +    int reg, u_int32_t *result);
>  static int ata_intel_sata_cscr_read(device_t dev, int port,
>      int reg, u_int32_t *result);
>  static int ata_intel_sata_sidpr_read(device_t dev, int port,
>      int reg, u_int32_t *result);
> +static int ata_intel_sata_ahci_write(device_t dev, int port,
> +    int reg, u_int32_t result);
>  static int ata_intel_sata_cscr_write(device_t dev, int port,
>      int reg, u_int32_t result);
>  static int ata_intel_sata_sidpr_write(device_t dev, int port,
> @@ -79,6 +83,7 @@ static void ata_intel_31244_reset(device
>  #define INTEL_ICH5	2
>  #define INTEL_6CH	4
>  #define INTEL_6CH2	8
> +#define INTEL_ICH7	16
>  
>  /*
>   * Intel chipset support functions
> @@ -113,11 +118,11 @@ ata_intel_probe(device_t dev)
>       { ATA_I82801FB_R1,  0, INTEL_AHCI, 0, ATA_SA150, "ICH6" },
>       { ATA_I82801FBM,    0, INTEL_AHCI, 0, ATA_SA150, "ICH6M" },
>       { ATA_I82801GB,     0,          0, 1, ATA_UDMA5, "ICH7" },
> -     { ATA_I82801GB_S1,  0,          0, 0, ATA_SA300, "ICH7" },
> -     { ATA_I82801GB_R1,  0,          0, 0, ATA_SA300, "ICH7" },
> +     { ATA_I82801GB_S1,  0, INTEL_ICH7, 0, ATA_SA300, "ICH7" },
> +     { ATA_I82801GB_R1,  0, INTEL_AHCI, 0, ATA_SA300, "ICH7" },
>       { ATA_I82801GB_AH,  0, INTEL_AHCI, 0, ATA_SA300, "ICH7" },
> -     { ATA_I82801GBM_S1, 0,          0, 0, ATA_SA150, "ICH7M" },
> -     { ATA_I82801GBM_R1, 0,          0, 0, ATA_SA150, "ICH7M" },
> +     { ATA_I82801GBM_S1, 0, INTEL_ICH7, 0, ATA_SA150, "ICH7M" },
> +     { ATA_I82801GBM_R1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" },
>       { ATA_I82801GBM_AH, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" },
>       { ATA_I63XXESB2,    0,          0, 1, ATA_UDMA5, "63XXESB2" },
>       { ATA_I63XXESB2_S1, 0,          0, 0, ATA_SA300, "63XXESB2" },
> @@ -250,14 +255,30 @@ ata_intel_chipinit(device_t dev)
>  	    (pci_read_config(dev, 0x90, 1) & 0xc0) &&
>  	    (ata_ahci_chipinit(dev) != ENXIO))
>  	    return 0;
> -	
> -	/* if BAR(5) is IO it should point to SATA interface registers */
> -	ctlr->r_type2 = SYS_RES_IOPORT;
> -	ctlr->r_rid2 = PCIR_BAR(5);
> -	if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
> -						   &ctlr->r_rid2, RF_ACTIVE))
> -	    || (ctlr->chip->cfg1 & INTEL_ICH5))
> -	    ctlr->getrev = ata_intel_sata_getrev;
> +
> +	/* BAR(5) may point to SATA interface registers */
> +	if ((ctlr->chip->cfg1 & INTEL_ICH7)) {
> +		ctlr->r_type2 = SYS_RES_MEMORY;
> +		ctlr->r_rid2 = PCIR_BAR(5);
> +		ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
> +		    &ctlr->r_rid2, RF_ACTIVE);
> +		if (ctlr->r_res2 != NULL) {
> +			/* Set SCRAE bit to enable registers access. */
> +			pci_write_config(dev, 0x94,
> +			    pci_read_config(dev, 0x94, 4) | (1 << 9), 4);
> +			/* Set Ports Implemented register bits. */
> +			ATA_OUTL(ctlr->r_res2, 0x0C,
> +			    ATA_INL(ctlr->r_res2, 0x0C) | 0xf);
> +		}
> +	} else {
> +		ctlr->r_type2 = SYS_RES_IOPORT;
> +		ctlr->r_rid2 = PCIR_BAR(5);
> +		ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
> +		    &ctlr->r_rid2, RF_ACTIVE);
> +	}
> +	if (ctlr->r_res2 != NULL ||
> +	    (ctlr->chip->cfg1 & INTEL_ICH5))
> +		ctlr->getrev = ata_intel_sata_getrev;
>  	ctlr->setmode = ata_sata_setmode;
>      }
>      return 0;
> @@ -336,8 +357,13 @@ ata_intel_ch_attach(device_t dev)
>  			} else if (ctlr->r_res2) {
>  				ch->flags |= ATA_PERIODIC_POLL;
>  				ch->hw.status = ata_intel_sata_status;
> -				ch->hw.pm_read = ata_intel_sata_sidpr_read;
> -				ch->hw.pm_write = ata_intel_sata_sidpr_write;
> +				if ((ctlr->chip->cfg1 & INTEL_ICH7)) {
> +					ch->hw.pm_read = ata_intel_sata_ahci_read;
> +					ch->hw.pm_write = ata_intel_sata_ahci_write;
> +				} else {
> +					ch->hw.pm_read = ata_intel_sata_sidpr_read;
> +					ch->hw.pm_write = ata_intel_sata_sidpr_write;
> +				};
>  			}
>  			if (ch->hw.pm_write != NULL) {
>  				ata_sata_scr_write(ch, 0,
> @@ -537,6 +563,38 @@ ata_intel_sata_status(device_t dev)
>  }
>  
>  static int
> +ata_intel_sata_ahci_read(device_t dev, int port, int reg, u_int32_t *result)
> +{
> +	struct ata_pci_controller *ctlr;
> +	struct ata_channel *ch;
> +	device_t parent;
> +	u_char *smap;
> +	int offset;
> +
> +	parent = device_get_parent(dev);
> +	ctlr = device_get_softc(parent);
> +	ch = device_get_softc(dev);
> +	port = (port == 1) ? 1 : 0;
> +	smap = (u_char *)&ctlr->chipset_data + ch->unit * 2;
> +	offset = 0x100 + smap[port] * 0x80;
> +	switch (reg) {
> +	case ATA_SSTATUS:
> +	    reg = 0x28;
> +	    break;
> +	case ATA_SCONTROL:
> +	    reg = 0x2c;
> +	    break;
> +	case ATA_SERROR:
> +	    reg = 0x30;
> +	    break;
> +	default:
> +	    return (EINVAL);
> +	}
> +	*result = ATA_INL(ctlr->r_res2, offset + reg);
> +	return (0);
> +}
> +
> +static int
>  ata_intel_sata_cscr_read(device_t dev, int port, int reg, u_int32_t *result)
>  {
>  	struct ata_pci_controller *ctlr;
> @@ -598,6 +656,38 @@ ata_intel_sata_sidpr_read(device_t dev, 
>  }
>  
>  static int
> +ata_intel_sata_ahci_write(device_t dev, int port, int reg, u_int32_t value)
> +{
> +	struct ata_pci_controller *ctlr;
> +	struct ata_channel *ch;
> +	device_t parent;
> +	u_char *smap;
> +	int offset;
> +
> +	parent = device_get_parent(dev);
> +	ctlr = device_get_softc(parent);
> +	ch = device_get_softc(dev);
> +	port = (port == 1) ? 1 : 0;
> +	smap = (u_char *)&ctlr->chipset_data + ch->unit * 2;
> +	offset = 0x100 + smap[port] * 0x80;
> +	switch (reg) {
> +	case ATA_SSTATUS:
> +	    reg = 0x28;
> +	    break;
> +	case ATA_SCONTROL:
> +	    reg = 0x2c;
> +	    break;
> +	case ATA_SERROR:
> +	    reg = 0x30;
> +	    break;
> +	default:
> +	    return (EINVAL);
> +	}
> +	ATA_OUTL(ctlr->r_res2, offset + reg, value);
> +	return (0);
> +}
> +
> +static int
>  ata_intel_sata_cscr_write(device_t dev, int port, int reg, u_int32_t value)
>  {
>  	struct ata_pci_controller *ctlr;
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"

-- 
Bob Willcox              Trying to explain things to people who already know
bob@immure.com           everything is like trying to teach a bear to dance;
Austin, TX               it's useless, and it annoys the bear.

--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pciconf.out"

hostb0@pci0:0:0:0:	class=0x060000 card=0x574d8086 chip=0xa0008086 rev=0x02 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:2:0:	class=0x030000 card=0x574d8086 chip=0xa0018086 rev=0x02 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = display
    subclass   = VGA
none0@pci0:0:27:0:	class=0x040300 card=0xd6258086 chip=0x27d88086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'IDT High Definition Audio Driver  (BA101897)'
    class      = multimedia
    subclass   = HDA
pcib1@pci0:0:28:0:	class=0x060400 card=0x574d8086 chip=0x27d08086 rev=0x01 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:28:1:	class=0x060400 card=0x574d8086 chip=0x27d28086 rev=0x01 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib3@pci0:0:28:2:	class=0x060400 card=0x574d8086 chip=0x27d48086 rev=0x01 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib4@pci0:0:28:3:	class=0x060400 card=0x574d8086 chip=0x27d68086 rev=0x01 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
uhci0@pci0:0:29:0:	class=0x0c0300 card=0x574d8086 chip=0x27c88086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci1@pci0:0:29:1:	class=0x0c0300 card=0x574d8086 chip=0x27c98086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci2@pci0:0:29:2:	class=0x0c0300 card=0x574d8086 chip=0x27ca8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci3@pci0:0:29:3:	class=0x0c0300 card=0x574d8086 chip=0x27cb8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
ehci0@pci0:0:29:7:	class=0x0c0320 card=0x574d8086 chip=0x27cc8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB 2.0 Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
pcib5@pci0:0:30:0:	class=0x060401 card=0x574d8086 chip=0x24488086 rev=0xe1 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801 Family (ICH2/3/4/5/6/7/8/9-M) Hub Interface to PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
isab0@pci0:0:31:0:	class=0x060100 card=0x574d8086 chip=0x27bc8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = PCI-ISA
atapci0@pci0:0:31:2:	class=0x01018f card=0x574d8086 chip=0x27c08086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controller'
    class      = mass storage
    subclass   = ATA
none1@pci0:0:31:3:	class=0x0c0500 card=0x574d8086 chip=0x27da8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Intel[R] 82801G (ICH7 Family) C- 27DA (82801G)'
    class      = serial bus
    subclass   = SMBus
re0@pci0:1:0:0:	class=0x020000 card=0xd6258086 chip=0x816810ec rev=0x06 hdr=0x00
    vendor     = 'Realtek Semiconductor'
    device     = 'Gigabit Ethernet NIC(NDIS 6.0) (RTL8168/8111/8111c)'
    class      = network
    subclass   = ethernet
em0@pci0:5:0:0:	class=0x020000 card=0x13768086 chip=0x107c8086 rev=0x05 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Gigabit Ethernet Controller (Copper) rev 5 (82541PI)'
    class      = network
    subclass   = ethernet

--NzB8fVQJ5HfG6fxh--

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 14:26:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0E047106566C;
	Wed, 16 Mar 2011 14:26:31 +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 90EDE8FC0C;
	Wed, 16 Mar 2011 14:26:30 +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 p2GEQQdT091578
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 16 Mar 2011 16:26:26 +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
	p2GEQQd3062492; Wed, 16 Mar 2011 16:26:26 +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 p2GEQQRj062491; 
	Wed, 16 Mar 2011 16:26:26 +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, 16 Mar 2011 16:26:26 +0200
From: Kostik Belousov 
To: Maxim Dounin 
Message-ID: <20110316142626.GP78089@deviant.kiev.zoral.com.ua>
References: <201103151714.p2FHEQdF049456@svn.freebsd.org>
	<20110315193306.GK99496@mdounin.ru>
	<201103151555.45816.jkim@FreeBSD.org>
	<201103151631.34418.jkim@FreeBSD.org>
	<20110316163507.F4107@besplex.bde.org>
	<20110316140042.GN99496@mdounin.ru>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="gqBxMmDy+0ucIclE"
Content-Disposition: inline
In-Reply-To: <20110316140042.GN99496@mdounin.ru>
User-Agent: Mutt/1.4.2.3i
X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	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-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jung-uk Kim ,
	Bruce Evans 
Subject: Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 14:26:31 -0000


--gqBxMmDy+0ucIclE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 16, 2011 at 05:00:42PM +0300, Maxim Dounin wrote:
> Hello!
>=20
> On Wed, Mar 16, 2011 at 04:44:35PM +1100, Bruce Evans wrote:
>=20
> > On Tue, 15 Mar 2011, Jung-uk Kim wrote:
> >=20
> > >On Tuesday 15 March 2011 03:55 pm, Jung-uk Kim wrote:
> > >>On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote:
> > >>>Hello!
> > >>>
> > >>>On Tue, Mar 15, 2011 at 05:14:26PM +0000, Jung-uk Kim wrote:
> > >>>>Author: jkim
> > >>>>Date: Tue Mar 15 17:14:26 2011
> > >>>>New Revision: 219672
> > >>>>URL: http://svn.freebsd.org/changeset/base/219672
> > >>>>
> > >>>>Log:
> > >>>>  Unconditionally use binuptime(9) for get_cyclecount(9) on
> > >>>>i386. Since this function is almost exclusively used for random
> > >>>>harvesting, there is no need for micro-optimization.  Adjust
> > >>>>the manual page accordingly.
> > >>>
> > >>>Note that on early boot only dummy timecounter available, and
> > >>>binuptime() has no entropy.
> >=20
> > >>>As a result of this change random(9) won't have entropy on early
> > >>>boot on i386, and arc4random(9) as well.  While there are no
> > >>>known major security problems associated with it - it at least
> > >>>makes stack protector easily bypasseable as it now (again after
> > >>>r198295) uses well-known stack guard instead of random one.  And
> > >>>there may be other issues as well.
> >=20
> > Is dummy timecounter used for long enough to matter?  I think completion
> > of clock initialization is still bogusly late for histrotical reasons,
> > but there is still a second or two between completion of timecounter
> > initialization and user mode.  The earlier stages of booting might
> > take 20 seconds but should be faster, so they might not provided much
> > more entropy from clocks.
>=20
> The problem is initial random number generator initialization=20
> (random(9) and acr4random(9)) and various early boot things which=20
> use random.  Most notably it's stack protector (which has to be=20
> initialized as early as possible, and requires special handling of=20
> code which is run before it's initialized), but there are also other=20
> things to care about - AFAIR booting from nfs uses the same ports=20
> without entropy and so on.
>=20
> Right now the only entropy used at early boot are from=20
> get_cyclecount() call, which has at least some entropy on most=20
> platforms (notable exceptions are arm and i386 with i486 cpus).=20
> With dummy timecounter there are no entropy at early boot.
>=20
> After boot everything is eventually reseeded (random(9) at=20
> proc0_post(), arc4random(9) and /dev/random at userland startup=20
> scripts) and becomes safe.
proc0_post() is not called after the boot, it is executed during the boot.
Why is the randomness for the stack protector critical at that stage ?
Most kernel threads are started after INTRINSIC_POST, at least this is
what I see from looking at kernel.h.=20

Might be, the ssp initialization should be moved after SI_SUB_INTRINSIC_POS=
T ?

This is definitely irrelevant for usermode ssp, since the first thread
enters usermode long after the INTRINSIC_POST is done.

>=20
> > I have entropy stuff mostly turned off and often don't even have enough
> > entropy to run ed on /etc/fstab early.  Don't know if I have clock entr=
opy
> > turned off.
> >=20
> > >>>Hope you thought well before moving i386 to a set of platforms
> > >>>which have no early boot randomness at all.  And you have good
> > >>>reason for doing it.
> >=20
> > I asked for moving all platforms to binuptime() so that the bugs could
> > be seen by everyone :-).  Didn't know about this bug.
>=20
> If you want to change get_cyclecount() to be alias to binuptime()=20
> - we may consider adding another machdep call to extract early=20
> entropy.
>=20
> I still not quite understand the reasons though.  I consider=20
> binuptime() to be some (bad one) fallback for get_cyclecount() on=20
> platforms which has no hardware counter available.  Moving all=20
> platforms to bad fallback looks strange.
>=20
> Maxim Dounin

--gqBxMmDy+0ucIclE
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iEYEARECAAYFAk2AyJAACgkQC3+MBN1Mb4gmggCgjc8o4PlBd4Ar4ujsL952psJR
z/8AoKUSN7DcRtF6B9rcNC9HjI//iXLf
=Oa5C
-----END PGP SIGNATURE-----

--gqBxMmDy+0ucIclE--

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 15:32:20 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0B550106564A;
	Wed, 16 Mar 2011 15:32:20 +0000 (UTC)
	(envelope-from mdounin@mdounin.ru)
Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A6A88FC12;
	Wed, 16 Mar 2011 15:32:19 +0000 (UTC)
Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81])
	by mdounin.cust.ramtel.ru (Postfix) with ESMTP id AF9CB17024;
	Wed, 16 Mar 2011 18:32:17 +0300 (MSK)
Date: Wed, 16 Mar 2011 18:32:17 +0300
From: Maxim Dounin 
To: Kostik Belousov 
Message-ID: <20110316153217.GP99496@mdounin.ru>
References: <201103151714.p2FHEQdF049456@svn.freebsd.org>
	<20110315193306.GK99496@mdounin.ru>
	<201103151555.45816.jkim@FreeBSD.org>
	<201103151631.34418.jkim@FreeBSD.org>
	<20110316163507.F4107@besplex.bde.org>
	<20110316140042.GN99496@mdounin.ru>
	<20110316142626.GP78089@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20110316142626.GP78089@deviant.kiev.zoral.com.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jung-uk Kim ,
	Bruce Evans 
Subject: Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 15:32:20 -0000

Hello!

On Wed, Mar 16, 2011 at 04:26:26PM +0200, Kostik Belousov wrote:

> On Wed, Mar 16, 2011 at 05:00:42PM +0300, Maxim Dounin wrote:
> > Hello!
> > 
> > On Wed, Mar 16, 2011 at 04:44:35PM +1100, Bruce Evans wrote:
> > 
> > > On Tue, 15 Mar 2011, Jung-uk Kim wrote:
> > > 
> > > >On Tuesday 15 March 2011 03:55 pm, Jung-uk Kim wrote:
> > > >>On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote:
> > > >>>Hello!
> > > >>>
> > > >>>On Tue, Mar 15, 2011 at 05:14:26PM +0000, Jung-uk Kim wrote:
> > > >>>>Author: jkim
> > > >>>>Date: Tue Mar 15 17:14:26 2011
> > > >>>>New Revision: 219672
> > > >>>>URL: http://svn.freebsd.org/changeset/base/219672
> > > >>>>
> > > >>>>Log:
> > > >>>>  Unconditionally use binuptime(9) for get_cyclecount(9) on
> > > >>>>i386. Since this function is almost exclusively used for random
> > > >>>>harvesting, there is no need for micro-optimization.  Adjust
> > > >>>>the manual page accordingly.
> > > >>>
> > > >>>Note that on early boot only dummy timecounter available, and
> > > >>>binuptime() has no entropy.
> > > 
> > > >>>As a result of this change random(9) won't have entropy on early
> > > >>>boot on i386, and arc4random(9) as well.  While there are no
> > > >>>known major security problems associated with it - it at least
> > > >>>makes stack protector easily bypasseable as it now (again after
> > > >>>r198295) uses well-known stack guard instead of random one.  And
> > > >>>there may be other issues as well.
> > > 
> > > Is dummy timecounter used for long enough to matter?  I think completion
> > > of clock initialization is still bogusly late for histrotical reasons,
> > > but there is still a second or two between completion of timecounter
> > > initialization and user mode.  The earlier stages of booting might
> > > take 20 seconds but should be faster, so they might not provided much
> > > more entropy from clocks.
> > 
> > The problem is initial random number generator initialization 
> > (random(9) and acr4random(9)) and various early boot things which 
> > use random.  Most notably it's stack protector (which has to be 
> > initialized as early as possible, and requires special handling of 
> > code which is run before it's initialized), but there are also other 
> > things to care about - AFAIR booting from nfs uses the same ports 
> > without entropy and so on.
> > 
> > Right now the only entropy used at early boot are from 
> > get_cyclecount() call, which has at least some entropy on most 
> > platforms (notable exceptions are arm and i386 with i486 cpus). 
> > With dummy timecounter there are no entropy at early boot.
> > 
> > After boot everything is eventually reseeded (random(9) at 
> > proc0_post(), arc4random(9) and /dev/random at userland startup 
> > scripts) and becomes safe.
> proc0_post() is not called after the boot, it is executed during the boot.

s/after boot/later in boot process/

> Why is the randomness for the stack protector critical at that stage ?
> Most kernel threads are started after INTRINSIC_POST, at least this is
> what I see from looking at kernel.h. 
> 
> Might be, the ssp initialization should be moved after SI_SUB_INTRINSIC_POST ?

Random initialization used to be done at SI_SUB_INTRINSIC_POST.  
It was proven to be error-prone: there are at least several places 
in kernel which tried to use random(9) and/or arc4random(9) before 
SI_SUB_INTRINSIC_POST.

That's why SI_SUB_RANDOM was explicitly introduced at a earliest 
point where we have some randomness (and stack protector 
initialization was moved to be after this point).

While stack protector initialization may be moved later (though I 
doubt INSTRINSIC_POST would do - I believe we already have 
interrupts enabled at this point), cleanup of other places will be 
required, too.  And I bet other similar problems will be 
introduced as time passes.

Maxim Dounin

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 16:09:08 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 93329106564A;
	Wed, 16 Mar 2011 16:09:08 +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 81A568FC12;
	Wed, 16 Mar 2011 16:09: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 p2GG98uu097331;
	Wed, 16 Mar 2011 16:09:08 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GG98q6097329;
	Wed, 16 Mar 2011 16:09:08 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103161609.p2GG98q6097329@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 16 Mar 2011 16:09:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219698 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 16:09:08 -0000

Author: jkim
Date: Wed Mar 16 16:09:08 2011
New Revision: 219698
URL: http://svn.freebsd.org/changeset/base/219698

Log:
  Rework r219679.  Always check CPU class at run-time to make it predictable.
  Unfortunately, it pulls in  but it is small enough and
  namespace pollution is minimal, I hope.
  
  Pointed out by:	bde
  Pointy hat:	jkim

Modified:
  head/sys/i386/include/cpu.h

Modified: head/sys/i386/include/cpu.h
==============================================================================
--- head/sys/i386/include/cpu.h	Wed Mar 16 12:40:58 2011	(r219697)
+++ head/sys/i386/include/cpu.h	Wed Mar 16 16:09:08 2011	(r219698)
@@ -39,6 +39,7 @@
 /*
  * Definitions unique to i386 cpu support.
  */
+#include 
 #include 
 #include 
 #include 
@@ -69,14 +70,13 @@ void	swi_vm(void *);
 static __inline uint64_t
 get_cyclecount(void)
 {
-#if defined(I486_CPU) || defined(KLD_MODULE)
 	struct bintime bt;
 
-	binuptime(&bt);
-	return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
-#else
+	if (cpu_class == CPUCLASS_486) {
+		binuptime(&bt);
+		return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
+	}
 	return (rdtsc());
-#endif
 }
 
 #endif

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 16:22:59 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6F902106566B;
	Wed, 16 Mar 2011 16:22:59 +0000 (UTC)
	(envelope-from ivoras@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5E6258FC0A;
	Wed, 16 Mar 2011 16:22: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 p2GGMxrq097644;
	Wed, 16 Mar 2011 16:22:59 GMT (envelope-from ivoras@svn.freebsd.org)
Received: (from ivoras@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GGMxNp097642;
	Wed, 16 Mar 2011 16:22:59 GMT (envelope-from ivoras@svn.freebsd.org)
Message-Id: <201103161622.p2GGMxNp097642@svn.freebsd.org>
From: Ivan Voras 
Date: Wed, 16 Mar 2011 16:22:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219699 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 16:22:59 -0000

Author: ivoras
Date: Wed Mar 16 16:22:59 2011
New Revision: 219699
URL: http://svn.freebsd.org/changeset/base/219699

Log:
  The hardware has caught up; improvements are now observed even at 128,
  but stay conservative and bump read_max to "only" 64 (it will probably be
  a good idea to increase this to 128 after the next major release).

Modified:
  head/sys/kern/vfs_cluster.c

Modified: head/sys/kern/vfs_cluster.c
==============================================================================
--- head/sys/kern/vfs_cluster.c	Wed Mar 16 16:09:08 2011	(r219698)
+++ head/sys/kern/vfs_cluster.c	Wed Mar 16 16:22:59 2011	(r219699)
@@ -71,7 +71,7 @@ static int write_behind = 1;
 SYSCTL_INT(_vfs, OID_AUTO, write_behind, CTLFLAG_RW, &write_behind, 0,
     "Cluster write-behind; 0: disable, 1: enable, 2: backed off");
 
-static int read_max = 32;
+static int read_max = 64;
 SYSCTL_INT(_vfs, OID_AUTO, read_max, CTLFLAG_RW, &read_max, 0,
     "Cluster read-ahead max block count");
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 16:33:26 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id EC0011065678;
	Wed, 16 Mar 2011 16:33:25 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Maxim Dounin 
Date: Wed, 16 Mar 2011 12:32:56 -0400
User-Agent: KMail/1.6.2
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<20110316004503.GM99496@mdounin.ru>
In-Reply-To: <20110316004503.GM99496@mdounin.ru>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201103161233.16347.jkim@FreeBSD.org>
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 16:33:26 -0000

On Tuesday 15 March 2011 08:45 pm, Maxim Dounin wrote:
> This isn't really different as long as GENERIC kernel used, as
> GENERIC defines I486_CPU.

Fixed in r219698, sorry.

Actually, I think we should remove i486 from GENERIC at some point.  
It has too many limitations.  For example, I really love to implement 
atomic 64-bit mem read/write using cmpxchg8b (no 0xf00f joke, please) 
but I cannot do that cleanly without removing I486 support or 
checking cpu_class at run-time. :-(

Jung-uk Kim

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 16:44:08 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D6F01065675;
	Wed, 16 Mar 2011 16:44:08 +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 515D28FC17;
	Wed, 16 Mar 2011 16:44: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 p2GGi8PE098285;
	Wed, 16 Mar 2011 16:44:08 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GGi8ug098283;
	Wed, 16 Mar 2011 16:44:08 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103161644.p2GGi8ug098283@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 16 Mar 2011 16:44:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219700 - head/sys/x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 16:44:08 -0000

Author: jkim
Date: Wed Mar 16 16:44:08 2011
New Revision: 219700
URL: http://svn.freebsd.org/changeset/base/219700

Log:
  Revert r219676.
  
  Requested by:	jhb, bde

Modified:
  head/sys/x86/x86/tsc.c

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c	Wed Mar 16 16:22:59 2011	(r219699)
+++ head/sys/x86/x86/tsc.c	Wed Mar 16 16:44:08 2011	(r219700)
@@ -263,10 +263,12 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_A
 
 	if (tsc_timecounter.tc_frequency == 0)
 		return (EOPNOTSUPP);
-	freq = tsc_timecounter.tc_frequency;
+	freq = tsc_freq;
 	error = sysctl_handle_64(oidp, &freq, 0, req);
-	if (error == 0 && req->newptr != NULL)
-		tsc_timecounter.tc_frequency = freq;
+	if (error == 0 && req->newptr != NULL) {
+		tsc_freq = freq;
+		tsc_timecounter.tc_frequency = tsc_freq;
+	}
 	return (error);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 17:09:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E73011065675;
	Wed, 16 Mar 2011 17:09: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 BB96B8FC1E;
	Wed, 16 Mar 2011 17:09: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 p2GH9p3s098867;
	Wed, 16 Mar 2011 17:09:51 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GH9pti098865;
	Wed, 16 Mar 2011 17:09:51 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201103161709.p2GH9pti098865@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 16 Mar 2011 17:09:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219701 - head/sys/dev/dc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 17:09:52 -0000

Author: yongari
Date: Wed Mar 16 17:09:51 2011
New Revision: 219701
URL: http://svn.freebsd.org/changeset/base/219701

Log:
  Remove too expensive bus_dmamap_sync(9) call in dc_rx_resync().
  With this change, driver may not notice updated descriptor status
  change when bounce buffers are active. However, rxeof() in next run
  will handle the synchronization.
  
  Change dc_rxeof() a bit to return the number of processed frames in
  RX descriptor ring. Previously it returned the number of frames
  that were successfully passed to upper stack which in turn means it
  ignored frames that were discarded due to errors. The number of
  processed frames in RX descriptor ring is used to detect whether
  driver is out of sync with controller's current descriptor pointer.
  Returning number of processed frames reduces unnecessary (probably
  wrong) re-synchronization.
  
  Reviewed by:	marius

Modified:
  head/sys/dev/dc/if_dc.c

Modified: head/sys/dev/dc/if_dc.c
==============================================================================
--- head/sys/dev/dc/if_dc.c	Wed Mar 16 16:44:08 2011	(r219700)
+++ head/sys/dev/dc/if_dc.c	Wed Mar 16 17:09:51 2011	(r219701)
@@ -2790,8 +2790,6 @@ dc_rx_resync(struct dc_softc *sc)
 	pos = sc->dc_cdata.dc_rx_prod;
 
 	for (i = 0; i < DC_RX_LIST_CNT; i++) {
-		bus_dmamap_sync(sc->dc_rx_ltag, sc->dc_rx_lmap,
-		    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 		cur_rx = &sc->dc_ldata.dc_rx_list[pos];
 		if (!(le32toh(cur_rx->dc_status) & DC_RXSTAT_OWN))
 			break;
@@ -2862,6 +2860,7 @@ dc_rxeof(struct dc_softc *sc)
 		bus_dmamap_sync(sc->dc_rx_mtag, sc->dc_cdata.dc_rx_map[i],
 		    BUS_DMASYNC_POSTREAD);
 		total_len = DC_RXBYTES(rxstat);
+		rx_npkts++;
 
 		if (sc->dc_flags & DC_PNIC_RX_BUG_WAR) {
 			if ((rxstat & DC_WHOLEFRAME) != DC_WHOLEFRAME) {
@@ -2939,7 +2938,6 @@ dc_rxeof(struct dc_softc *sc)
 		DC_UNLOCK(sc);
 		(*ifp->if_input)(ifp, m);
 		DC_LOCK(sc);
-		rx_npkts++;
 	}
 
 	sc->dc_cdata.dc_rx_prod = i;
@@ -3263,7 +3261,7 @@ dc_intr(void *arg)
 	struct dc_softc *sc;
 	struct ifnet *ifp;
 	uint32_t r, status;
-	int curpkts, n;
+	int n;
 
 	sc = arg;
 
@@ -3293,9 +3291,7 @@ dc_intr(void *arg)
 		CSR_WRITE_4(sc, DC_ISR, status);
 
 		if (status & DC_ISR_RX_OK) {
-			curpkts = ifp->if_ipackets;
-			dc_rxeof(sc);
-			if (curpkts == ifp->if_ipackets) {
+			if (dc_rxeof(sc) == 0) {
 				while (dc_rx_resync(sc))
 					dc_rxeof(sc);
 			}
@@ -3319,9 +3315,7 @@ dc_intr(void *arg)
 		    || (status & DC_ISR_RX_NOBUF)) {
 			r = CSR_READ_4(sc, DC_FRAMESDISCARDED);
 			ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff);
-			curpkts = ifp->if_ipackets;
-			dc_rxeof(sc);
-			if (curpkts == ifp->if_ipackets) {
+			if (dc_rxeof(sc) == 0) {
 				while (dc_rx_resync(sc))
 					dc_rxeof(sc);
 			}

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 17:45:57 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 552A9106564A;
	Wed, 16 Mar 2011 17:45:57 +0000 (UTC)
	(envelope-from rdivacky@vlk.vlakno.cz)
Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190])
	by mx1.freebsd.org (Postfix) with ESMTP id 05FE78FC0C;
	Wed, 16 Mar 2011 17:45:56 +0000 (UTC)
Received: from lev.vlakno.cz (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id E234D9CB125;
	Wed, 16 Mar 2011 18:45:54 +0100 (CET)
X-Virus-Scanned: amavisd-new at vlakno.cz
Received: from vlakno.cz ([127.0.0.1])
	by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Zc-hCLUNgAPk; Wed, 16 Mar 2011 18:45:54 +0100 (CET)
Received: from vlk.vlakno.cz (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id EF61F9CB1B7;
	Wed, 16 Mar 2011 18:45:53 +0100 (CET)
Received: (from rdivacky@localhost)
	by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p2GHjrvH006913;
	Wed, 16 Mar 2011 18:45:53 +0100 (CET) (envelope-from rdivacky)
Date: Wed, 16 Mar 2011 18:45:53 +0100
From: Roman Divacky 
To: Jung-uk Kim 
Message-ID: <20110316174553.GA6367@freebsd.org>
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<20110316004503.GM99496@mdounin.ru>
	<201103161233.16347.jkim@FreeBSD.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201103161233.16347.jkim@FreeBSD.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 17:45:57 -0000

On Wed, Mar 16, 2011 at 12:32:56PM -0400, Jung-uk Kim wrote:
> On Tuesday 15 March 2011 08:45 pm, Maxim Dounin wrote:
> > This isn't really different as long as GENERIC kernel used, as
> > GENERIC defines I486_CPU.
> 
> Fixed in r219698, sorry.
> 
> Actually, I think we should remove i486 from GENERIC at some point.  
> It has too many limitations.  For example, I really love to implement 
> atomic 64-bit mem read/write using cmpxchg8b (no 0xf00f joke, please) 
> but I cannot do that cleanly without removing I486 support or 
> checking cpu_class at run-time. :-(

if we drop i486 I think it makes sense to require something that has
at least SSE2, thus we can have the same expectations as on amd64.

and we can use sse2 unconditionally (str*, mem* etc.)

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 17:47:04 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD3CD1065670;
	Wed, 16 Mar 2011 17:47:04 +0000 (UTC)
	(envelope-from rdivacky@vlk.vlakno.cz)
Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190])
	by mx1.freebsd.org (Postfix) with ESMTP id 91F788FC08;
	Wed, 16 Mar 2011 17:47:04 +0000 (UTC)
Received: from lev.vlakno.cz (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id BCE169CB14C;
	Wed, 16 Mar 2011 18:47:03 +0100 (CET)
X-Virus-Scanned: amavisd-new at vlakno.cz
Received: from vlakno.cz ([127.0.0.1])
	by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id qIHx67EndfcH; Wed, 16 Mar 2011 18:47:03 +0100 (CET)
Received: from vlk.vlakno.cz (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id 03E6C9CB24E;
	Wed, 16 Mar 2011 18:47:03 +0100 (CET)
Received: (from rdivacky@localhost)
	by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p2GHkgxm007013;
	Wed, 16 Mar 2011 18:46:42 +0100 (CET) (envelope-from rdivacky)
Date: Wed, 16 Mar 2011 18:46:42 +0100
From: Roman Divacky 
To: Ivan Voras 
Message-ID: <20110316174642.GB6367@freebsd.org>
References: <201103161622.p2GGMxNp097642@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201103161622.p2GGMxNp097642@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219699 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 17:47:05 -0000

On Wed, Mar 16, 2011 at 04:22:59PM +0000, Ivan Voras wrote:
> Author: ivoras
> Date: Wed Mar 16 16:22:59 2011
> New Revision: 219699
> URL: http://svn.freebsd.org/changeset/base/219699
> 
> Log:
>   The hardware has caught up; improvements are now observed even at 128,
>   but stay conservative and bump read_max to "only" 64 (it will probably be
>   a good idea to increase this to 128 after the next major release).

how did you measure this?

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 19:51:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E3E1106564A;
	Wed, 16 Mar 2011 19:51:58 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 345F88FC13;
	Wed, 16 Mar 2011 19:51:57 +0000 (UTC)
Received: by qwc9 with SMTP id 9so1740740qwc.13
	for ; Wed, 16 Mar 2011 12:51:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:from
	:date:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	bh=zJOyyy7pig2SS7eI8c53RwhjsMl+buCfYzTFQn7aAUY=;
	b=NSiCGka4Ulef2+/gPZQRD5GlVsU0F1PN2jvBf4bVmNiYvDL9Lxlu0e74vu707qzWm4
	KIuNATkp7bTf9N/pVcIeXKoHw1oYmMnq/rqLbu92ehI/VS4kfw5pAlrfJBTWwMKhlcH/
	0chkCaeBr4YnpeEbWQzkI1o9FUfki7grf6SXc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:from:date
	:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	b=P4s9QlpuSWKEGdEd3ckWHdca+kOtVN5zqZw2TYxESv4SDPQdFPRgcBmxyHOj/Ze6Cw
	/627JRVfvLMv6jptLOHZyn6LnQ0tpULpDCEayryeWju5HtbyfpSuA801Y4wsqQxqxx44
	dG16rsIhriNFY+nv18dIEvAd7GH7d5EI1vmOU=
Received: by 10.229.107.15 with SMTP id z15mr408398qco.99.1300305117301; Wed,
	16 Mar 2011 12:51:57 -0700 (PDT)
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.229.78.193 with HTTP; Wed, 16 Mar 2011 12:51:17 -0700 (PDT)
In-Reply-To: <20110316174642.GB6367@freebsd.org>
References: <201103161622.p2GGMxNp097642@svn.freebsd.org>
	<20110316174642.GB6367@freebsd.org>
From: Ivan Voras 
Date: Wed, 16 Mar 2011 20:51:17 +0100
X-Google-Sender-Auth: DeBmTJyNxMyy_sFlF1ZUyUc576I
Message-ID: 
To: Roman Divacky 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219699 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 19:51:58 -0000

On 16 March 2011 18:46, Roman Divacky  wrote:
>
> On Wed, Mar 16, 2011 at 04:22:59PM +0000, Ivan Voras wrote:
> > Author: ivoras
> > Date: Wed Mar 16 16:22:59 2011
> > New Revision: 219699
> > URL: http://svn.freebsd.org/changeset/base/219699
> >
> > Log:
> > =C2=A0 The hardware has caught up; improvements are now observed even a=
t 128,
> > =C2=A0 but stay conservative and bump read_max to "only" 64 (it will pr=
obably be
> > =C2=A0 a good idea to increase this to 128 after the next major release=
).
>
> how did you measure this?

Specifically for this commit: my desktop 2xSATA 7200 RPM drives,
gmirror, single read "dd" stream, bs=3D1m. (Are there any ready read
multi-stream read tests which are not trivial i.e. they start from
different positions in the file?)

results:

read_max=3D32  -> 78 MB/s
read_max=3D64  -> 136 MB/s
read_max=3D128 -> 141 MB/s

I'm the one who previously bumped read_max from 8 to 32 about a year
ago, based on tests under an (otherwise idle, naturally) VMWare
cluster on a FC SAN, and a similar point of saturation was at
read_max=3D64. Now it is at 128 with raw hardware.

Maybe it should be tuned at 2^(major_freebsd_version-2)  :)

(as for safety & stability, I've put 2-3 new web servers in production
this year with read_max=3D128 irregardless of this commit. It's stable).

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 19:57:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6A3091065676;
	Wed, 16 Mar 2011 19:57:13 +0000 (UTC)
	(envelope-from bruce@cran.org.uk)
Received: from muon.cran.org.uk (muon.cran.org.uk
	[IPv6:2a01:348:0:15:5d59:5c40:0:1])
	by mx1.freebsd.org (Postfix) with ESMTP id EFC2D8FC1C;
	Wed, 16 Mar 2011 19:57:12 +0000 (UTC)
Received: from muon.cran.org.uk (localhost [127.0.0.1])
	by muon.cran.org.uk (Postfix) with ESMTP id D44C1E88A1;
	Wed, 16 Mar 2011 19:57:11 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from
	:to:cc:subject:message-id:in-reply-to:references:mime-version
	:content-type:content-transfer-encoding; s=mail; bh=kaFq2dbC1j7C
	YhvPOmBUYH953Og=; b=L3kkYN0MFPaGzgtFmhpnz9W+DIU6aG7lFIBgWeQZg0TS
	FDhaqxwAgkKcY/mVzam6C1nqTh1b7jZldOqgwZopQK1Fh2047lNoqrMO13tegz2Z
	eLTWhiHumyBrXyTFm6LikdLBXdhxsnfu3LpsfO2RNI+wErr6288EFeIJpd1tBio=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to
	:cc:subject:message-id:in-reply-to:references:mime-version
	:content-type:content-transfer-encoding; q=dns; s=mail; b=IR4m+/
	hI2Zt+FSV/T/wicAhvIhC/0YOyp7VF3Zs2/EgmkwwbdNH6GJNAp/wrftqPWsp/0I
	ByCiqCXYYX1bhV4GRNIerQk/ZkW4LcVGw2PjwPygHBSXYd6DytgelBA7Jdlj/JMf
	F0pPye4TfTx3yk91NNd8YYTYebqyBgi/x+hk8=
Received: from unknown (client-86-31-236-253.oxfd.adsl.virginmedia.com
	[86.31.236.253])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by muon.cran.org.uk (Postfix) with ESMTPSA id 4F6D2E88A0;
	Wed, 16 Mar 2011 19:57:11 +0000 (GMT)
Date: Wed, 16 Mar 2011 19:56:28 +0000
From: Bruce Cran 
To: Ivan Voras 
Message-ID: <20110316195628.000015c3@unknown>
In-Reply-To: 
References: <201103161622.p2GGMxNp097642@svn.freebsd.org>
	<20110316174642.GB6367@freebsd.org>
	
X-Mailer: Claws Mail 3.7.8cvs9 (GTK+ 2.16.6; i586-pc-mingw32msvc)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, Roman Divacky ,
	src-committers@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r219699 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 19:57:13 -0000

On Wed, 16 Mar 2011 20:51:17 +0100
Ivan Voras  wrote:

> (Are there any ready read
> multi-stream read tests which are not trivial i.e. they start from
> different positions in the file?)

I think sysutils/fio can do that.

-- 
Bruce Cran

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 19:59:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3265A106566C;
	Wed, 16 Mar 2011 19:59:49 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 1810C8FC1B;
	Wed, 16 Mar 2011 19:59:47 +0000 (UTC)
Received: by wwc33 with SMTP id 33so2625572wwc.31
	for ; Wed, 16 Mar 2011 12:59:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=3uVumxORSchnB98ztIyVwgda59Gt/mlXw/0P9k4QCVc=;
	b=qt0eqhrFSeJjhizFTQMIQCAPMAHM4W72LlrlxSZpDvwzDcDmmchMWD62DHX2dXWQAl
	XuJl2qtf8O5Hbeacn+TsQmLuZuLaIBuuyTgTi7wB4tRjvHzwviUaVGVL6Q3xJapUNEZK
	GYjfMbmj/35MBH24qGRmpascGK70qouo7W1R4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=B1fv4mYP+RdH8jNLAQaEWJRHCHkNpeuZp6G1Z7QKgj/JtDRJ6UM+/KjMtV/rjmN+Hl
	GfSl0x2Gfy0OV/9gcBwhUDlOPenAzy/hqs8Zcg8HvSAssFC7OKtl04LXm/QSLz/NICiL
	jNtstpVw9gIr9m5oeeircfxg+LxPn6wD77i1k=
MIME-Version: 1.0
Received: by 10.216.191.208 with SMTP id g58mr362281wen.85.1300305586542; Wed,
	16 Mar 2011 12:59:46 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.173.142 with HTTP; Wed, 16 Mar 2011 12:59:46 -0700 (PDT)
In-Reply-To: 
References: <201103161622.p2GGMxNp097642@svn.freebsd.org>
	<20110316174642.GB6367@freebsd.org>
	
Date: Wed, 16 Mar 2011 12:59:46 -0700
X-Google-Sender-Auth: vrCDoAlhkBo1kTZWSTMA_YBN9qo
Message-ID: 
From: Garrett Cooper 
To: Ivan Voras 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, Roman Divacky ,
	src-committers@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r219699 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 19:59:49 -0000

On Wed, Mar 16, 2011 at 12:51 PM, Ivan Voras  wrote:
> On 16 March 2011 18:46, Roman Divacky  wrote:
>>
>> On Wed, Mar 16, 2011 at 04:22:59PM +0000, Ivan Voras wrote:
>> > Author: ivoras
>> > Date: Wed Mar 16 16:22:59 2011
>> > New Revision: 219699
>> > URL: http://svn.freebsd.org/changeset/base/219699
>> >
>> > Log:
>> > =A0 The hardware has caught up; improvements are now observed even at =
128,
>> > =A0 but stay conservative and bump read_max to "only" 64 (it will prob=
ably be
>> > =A0 a good idea to increase this to 128 after the next major release).
>>
>> how did you measure this?
>
> Specifically for this commit: my desktop 2xSATA 7200 RPM drives,
> gmirror, single read "dd" stream, bs=3D1m. (Are there any ready read
> multi-stream read tests which are not trivial i.e. they start from
> different positions in the file?)

Would be interesting to see how well things work with the new
geom_raid bits and with other drives (SAS, SCSI).
Thanks,
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:04:56 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D70A1106564A;
	Wed, 16 Mar 2011 20:04:56 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CA1478FC14;
	Wed, 16 Mar 2011 20:04: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 p2GK4uID003070;
	Wed, 16 Mar 2011 20:04:56 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GK4u5X003068;
	Wed, 16 Mar 2011 20:04:56 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201103162004.p2GK4u5X003068@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Wed, 16 Mar 2011 20:04:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219702 - head/sys/boot/i386/common
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:04:56 -0000

Author: ae
Date: Wed Mar 16 20:04:56 2011
New Revision: 219702
URL: http://svn.freebsd.org/changeset/base/219702

Log:
  Set control flags in putc(). This should fix zfsboot hangs in drvread().
  
  PR:		kern/153552
  Reviewed by:	jhb
  MFC after:	1 week

Modified:
  head/sys/boot/i386/common/cons.c

Modified: head/sys/boot/i386/common/cons.c
==============================================================================
--- head/sys/boot/i386/common/cons.c	Wed Mar 16 17:09:51 2011	(r219701)
+++ head/sys/boot/i386/common/cons.c	Wed Mar 16 20:04:56 2011	(r219702)
@@ -37,6 +37,7 @@ void
 putc(int c)
 {
 
+	v86.ctl = V86_FLAGS;
 	v86.addr = 0x10;
 	v86.eax = 0xe00 | (c & 0xff);
 	v86.ebx = 0x7;

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:19:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C2531065673;
	Wed, 16 Mar 2011 20:19:48 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E4E28FC0A;
	Wed, 16 Mar 2011 20:19: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 p2GKJmOC003397;
	Wed, 16 Mar 2011 20:19:48 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GKJmUU003394;
	Wed, 16 Mar 2011 20:19:48 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201103162019.p2GKJmUU003394@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Wed, 16 Mar 2011 20:19:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219703 - head/sys/boot/i386/zfsboot
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:19:48 -0000

Author: ae
Date: Wed Mar 16 20:19:48 2011
New Revision: 219703
URL: http://svn.freebsd.org/changeset/base/219703

Log:
  The size of zfsboot2 grown up to 64 Kbytes in r219089.
  Increase NSECT up to 128 sectors too.
  
  Reviewed by:	jhb, pjd

Modified:
  head/sys/boot/i386/zfsboot/Makefile
  head/sys/boot/i386/zfsboot/zfsldr.S

Modified: head/sys/boot/i386/zfsboot/Makefile
==============================================================================
--- head/sys/boot/i386/zfsboot/Makefile	Wed Mar 16 20:04:56 2011	(r219702)
+++ head/sys/boot/i386/zfsboot/Makefile	Wed Mar 16 20:19:48 2011	(r219703)
@@ -66,7 +66,7 @@ zfsldr.out: zfsldr.o
 CLEANFILES+=	zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \
 		zfsboot.o zfsboot.s zfsboot.s.tmp xreadorg.h sio.o
 
-# We currently allow 32768 bytes for zfsboot - in practice it could be
+# We currently allow 65536 bytes for zfsboot - in practice it could be
 # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr.
 # 
 BOOT2SIZE=	65536

Modified: head/sys/boot/i386/zfsboot/zfsldr.S
==============================================================================
--- head/sys/boot/i386/zfsboot/zfsldr.S	Wed Mar 16 20:04:56 2011	(r219702)
+++ head/sys/boot/i386/zfsboot/zfsldr.S	Wed Mar 16 20:19:48 2011	(r219703)
@@ -37,7 +37,7 @@
 		.set SIZ_PAG,0x1000		# Page size
 		.set SIZ_SEC,0x200		# Sector size
 
-		.set NSECT,0x40
+		.set NSECT,0x80
 		.globl start
 		.globl xread
 		.code16

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:25:50 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 1DC6F1065675; Wed, 16 Mar 2011 20:25:50 +0000 (UTC)
Date: Wed, 16 Mar 2011 20:25:49 +0000
From: Alexander Best 
To: "Andrey V. Elsukov" 
Message-ID: <20110316202549.GA7239@freebsd.org>
References: <201103162004.p2GK4u5X003068@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201103162004.p2GK4u5X003068@svn.freebsd.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219702 - head/sys/boot/i386/common
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:25:50 -0000

On Wed Mar 16 11, Andrey V. Elsukov wrote:
> Author: ae
> Date: Wed Mar 16 20:04:56 2011
> New Revision: 219702
> URL: http://svn.freebsd.org/changeset/base/219702
> 
> Log:
>   Set control flags in putc(). This should fix zfsboot hangs in drvread().

i was looking at xputc() and putchar() and was wondering why these are two
seperate functions? their funcionality can very easily be merged into a single
one.

cheers.
alex

>   
>   PR:		kern/153552
>   Reviewed by:	jhb
>   MFC after:	1 week
> 
> Modified:
>   head/sys/boot/i386/common/cons.c
> 
> Modified: head/sys/boot/i386/common/cons.c
> ==============================================================================
> --- head/sys/boot/i386/common/cons.c	Wed Mar 16 17:09:51 2011	(r219701)
> +++ head/sys/boot/i386/common/cons.c	Wed Mar 16 20:04:56 2011	(r219702)
> @@ -37,6 +37,7 @@ void
>  putc(int c)
>  {
>  
> +	v86.ctl = V86_FLAGS;
>  	v86.addr = 0x10;
>  	v86.eax = 0xe00 | (c & 0xff);
>  	v86.ebx = 0x7;

-- 
a13x

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:31:20 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2FA671065672
	for ; Wed, 16 Mar 2011 20:31:20 +0000 (UTC)
	(envelope-from erikt@midgard.homeip.net)
Received: from ch-smtp03.sth.basefarm.net (ch-smtp03.sth.basefarm.net
	[80.76.149.214])
	by mx1.freebsd.org (Postfix) with ESMTP id E00A28FC1C
	for ; Wed, 16 Mar 2011 20:31:19 +0000 (UTC)
Received: from c83-255-51-20.bredband.comhem.se ([83.255.51.20]:41606
	helo=falcon.midgard.homeip.net)
	by ch-smtp03.sth.basefarm.net with esmtp (Exim 4.73)
	(envelope-from ) id 1PzxMR-0006qe-CU
	for svn-src-all@FreeBSD.org; Wed, 16 Mar 2011 21:30:30 +0100
Received: (qmail 23149 invoked from network); 16 Mar 2011 21:03:46 +0100
Received: from owl.midgard.homeip.net (10.1.5.7)
	by falcon.midgard.homeip.net with ESMTP; 16 Mar 2011 21:03:46 +0100
Received: (qmail 36506 invoked by uid 1001); 16 Mar 2011 21:03:46 +0100
Date: Wed, 16 Mar 2011 21:03:46 +0100
From: Erik Trulsson 
To: Roman Divacky 
Message-ID: <20110316200346.GA36431@owl.midgard.homeip.net>
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<20110316004503.GM99496@mdounin.ru>
	<201103161233.16347.jkim@FreeBSD.org>
	<20110316174553.GA6367@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20110316174553.GA6367@freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Originating-IP: 83.255.51.20
X-Scan-Result: No virus found in message 1PzxMR-0006qe-CU.
X-Scan-Signature: ch-smtp03.sth.basefarm.net 1PzxMR-0006qe-CU
	549d45bbb95709ff682448a77349321c
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Jung-uk Kim ,
	Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:31:20 -0000

On Wed, Mar 16, 2011 at 06:45:53PM +0100, Roman Divacky wrote:
> On Wed, Mar 16, 2011 at 12:32:56PM -0400, Jung-uk Kim wrote:
> > On Tuesday 15 March 2011 08:45 pm, Maxim Dounin wrote:
> > > This isn't really different as long as GENERIC kernel used, as
> > > GENERIC defines I486_CPU.
> > 
> > Fixed in r219698, sorry.
> > 
> > Actually, I think we should remove i486 from GENERIC at some point.  
> > It has too many limitations.  For example, I really love to implement 
> > atomic 64-bit mem read/write using cmpxchg8b (no 0xf00f joke, please) 
> > but I cannot do that cleanly without removing I486 support or 
> > checking cpu_class at run-time. :-(
> 
> if we drop i486 I think it makes sense to require something that has
> at least SSE2, thus we can have the same expectations as on amd64.

No, that would remove support from far too many machines that people
actually use to run FreeBSD.
There are probably only a handful of people (if that) who actually run
FreeBSD on an actual 486-class machine, but requiring SSE2 would mean
dropping support for Pentium-III and Athlon-XP equipped machines and
I believe there are a large number of such machines still in use, and
they are still perfectly suitable for a large number of tasks.




-- 

Erik Trulsson
ertr1013@student.uu.se

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:34:23 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 73134106566B;
	Wed, 16 Mar 2011 20:34:20 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Roman Divacky ,
 Bruce Evans 
Date: Wed, 16 Mar 2011 16:34:04 -0400
User-Agent: KMail/1.6.2
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<201103161233.16347.jkim@FreeBSD.org>
	<20110316174553.GA6367@freebsd.org>
In-Reply-To: <20110316174553.GA6367@freebsd.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201103161634.08104.jkim@FreeBSD.org>
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:34:23 -0000

On Wednesday 16 March 2011 01:45 pm, Roman Divacky wrote:
> On Wed, Mar 16, 2011 at 12:32:56PM -0400, Jung-uk Kim wrote:
> > On Tuesday 15 March 2011 08:45 pm, Maxim Dounin wrote:
> > > This isn't really different as long as GENERIC kernel used, as
> > > GENERIC defines I486_CPU.
> >
> > Fixed in r219698, sorry.
> >
> > Actually, I think we should remove i486 from GENERIC at some
> > point. It has too many limitations.  For example, I really love
> > to implement atomic 64-bit mem read/write using cmpxchg8b (no
> > 0xf00f joke, please) but I cannot do that cleanly without
> > removing I486 support or checking cpu_class at run-time. :-(
>
> if we drop i486 I think it makes sense to require something that
> has at least SSE2, thus we can have the same expectations as on
> amd64.
>
> and we can use sse2 unconditionally (str*, mem* etc.)

This is a proof-of-concept patch for sys/x86/isa/clock.c:

http://people.freebsd.org/~jkim/clock.diff

You see the complexity, just because I wanted to load 64-bit value 
atomically... :-(

Jung-uk Kim

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:37:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 90B111065670;
	Wed, 16 Mar 2011 20:37:51 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by mx1.freebsd.org (Postfix) with ESMTP id F20378FC16;
	Wed, 16 Mar 2011 20:37:50 +0000 (UTC)
Received: by qyk35 with SMTP id 35so3526985qyk.13
	for ; Wed, 16 Mar 2011 13:37:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:from
	:date:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	bh=2gBirjjSGErUHGlpukR/FQmROnVbQnKgNLKerCo5G6k=;
	b=dVWqwXlIhhf5H5/AJxElQ0JZ5gon5HWbNwNUorYLu2FvVAsj9xH1etLKgm6MfTnDwy
	p9v2t25YtQBai+tMEzkQ3qlC49mbEZQIlzq147cKnnMlvVLO//EZ0EBQMBgtCsXpDLQB
	EWQLXa0+Aearv6lIfKOVpqvLgQ2KVWZXtowYc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:from:date
	:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	b=tsIqCS4f9b1A2Zj754PDhsAhJ8+LvnTZq4cmYVyICb7PDt6xzvOSEXwGs9h2kPnzW7
	0DQjm/DQ7OfASHh8eU5a/aK+Fuca1vimOiLnYVGLQ1WM7g1yPMvqYhhi2sWwO3jXOhM0
	l4PjeA7PNQuxLHAaCSxXyvPQlyJV+2CaxporU=
Received: by 10.229.111.225 with SMTP id t33mr473181qcp.61.1300307870084; Wed,
	16 Mar 2011 13:37:50 -0700 (PDT)
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.229.78.193 with HTTP; Wed, 16 Mar 2011 13:37:10 -0700 (PDT)
In-Reply-To: 
References: <201103161622.p2GGMxNp097642@svn.freebsd.org>
	<20110316174642.GB6367@freebsd.org>
	
	
From: Ivan Voras 
Date: Wed, 16 Mar 2011 21:37:10 +0100
X-Google-Sender-Auth: xVTzh_smmyqSVA7MawtfieKLSuk
Message-ID: 
To: Garrett Cooper 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, Roman Divacky ,
	src-committers@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r219699 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:37:51 -0000

On 16 March 2011 20:59, Garrett Cooper  wrote:
> On Wed, Mar 16, 2011 at 12:51 PM, Ivan Voras  wrote:
>> On 16 March 2011 18:46, Roman Divacky  wrote:
>>>
>>> On Wed, Mar 16, 2011 at 04:22:59PM +0000, Ivan Voras wrote:
>>> > Author: ivoras
>>> > Date: Wed Mar 16 16:22:59 2011
>>> > New Revision: 219699
>>> > URL: http://svn.freebsd.org/changeset/base/219699
>>> >
>>> > Log:
>>> > =C2=A0 The hardware has caught up; improvements are now observed even=
 at 128,
>>> > =C2=A0 but stay conservative and bump read_max to "only" 64 (it will =
probably be
>>> > =C2=A0 a good idea to increase this to 128 after the next major relea=
se).
>>>
>>> how did you measure this?
>>
>> Specifically for this commit: my desktop 2xSATA 7200 RPM drives,
>> gmirror, single read "dd" stream, bs=3D1m. (Are there any ready read
>> multi-stream read tests which are not trivial i.e. they start from
>> different positions in the file?)
>
> Would be interesting to see how well things work with the new
> geom_raid bits and with other drives (SAS, SCSI).

Yes, I'd be interested in that; I'll try it when I get the chance to
test new hardware.

For now, there's a report (which actually inspired me to retest and
commit this) from someone who tried this on 2x 15k RPM SAS drives,
with much better results using read_max=3D128 (thread "gmirror
performance" on freebsd-fs@). I estimate that because his drives were
15kRPM from the start, the improvement isn't as drastic going from 8
to 128 as on these SATA drives I tested on (faster seeks). He went
from ~~ 195 MB/s to ~~ 258 MB/s while I go from ~~ 50 MB/s to ~~ 140
MB/s.

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:44:28 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A1876106564A;
	Wed, 16 Mar 2011 20:44:28 +0000 (UTC)
	(envelope-from bruce@cran.org.uk)
Received: from muon.cran.org.uk (muon.cran.org.uk
	[IPv6:2a01:348:0:15:5d59:5c40:0:1])
	by mx1.freebsd.org (Postfix) with ESMTP id 55AE08FC0C;
	Wed, 16 Mar 2011 20:44:28 +0000 (UTC)
Received: from muon.cran.org.uk (localhost [127.0.0.1])
	by muon.cran.org.uk (Postfix) with ESMTP id 64CBFE88A1;
	Wed, 16 Mar 2011 20:44:27 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from
	:to:cc:subject:message-id:in-reply-to:references:mime-version
	:content-type:content-transfer-encoding; s=mail; bh=c29hPVaEP8j+
	HIKpue56jLSW/uE=; b=AEDvuC2Cd/J0EmQFWeigKLx17+dKWSZd4sUCrhUNl5ZG
	WPgu6lSt4ldJx7FElCzaqxGjiQrJib98+fXchF5YdCo2llmnbK7CH0vYTy/UnCWm
	FUYZTJwZiM8KiGIik1D/Ot684t0K/7igyFvYuN6nc8eXJj/ZhPw0iKrnmm6poYo=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to
	:cc:subject:message-id:in-reply-to:references:mime-version
	:content-type:content-transfer-encoding; q=dns; s=mail; b=GaMVsh
	98N/OVsHYTjvB7MsCU7TaOtO4MszdtUcMxw+Y0H7m1+b3497QBBwRF0ZpMVl+a3K
	qWf1GLNA9VWplwry7HDlqCiakl+5AvGf/sJp1+0FpVlNoVUm2CQnNvh6t6c175LE
	as5vPRU9aamBawLDtevXGMMdGVjxxG7a5v+Ww=
Received: from unknown (client-86-31-236-253.oxfd.adsl.virginmedia.com
	[86.31.236.253])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by muon.cran.org.uk (Postfix) with ESMTPSA id A63F6E889F;
	Wed, 16 Mar 2011 20:44:26 +0000 (GMT)
Date: Wed, 16 Mar 2011 20:43:44 +0000
From: Bruce Cran 
To: Erik Trulsson 
Message-ID: <20110316204344.000017b7@unknown>
In-Reply-To: <20110316200346.GA36431@owl.midgard.homeip.net>
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<20110316004503.GM99496@mdounin.ru>
	<201103161233.16347.jkim@FreeBSD.org>
	<20110316174553.GA6367@freebsd.org>
	<20110316200346.GA36431@owl.midgard.homeip.net>
X-Mailer: Claws Mail 3.7.8cvs9 (GTK+ 2.16.6; i586-pc-mingw32msvc)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: src-committers@FreeBSD.org, Roman Divacky ,
	svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	Jung-uk Kim , Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:44:28 -0000

On Wed, 16 Mar 2011 21:03:46 +0100
Erik Trulsson  wrote:

> There are probably only a handful of people (if that) who actually run
> FreeBSD on an actual 486-class machine, but requiring SSE2 would mean
> dropping support for Pentium-III and Athlon-XP equipped machines and
> I believe there are a large number of such machines still in use, and
> they are still perfectly suitable for a large number of tasks.

Some low power x86 CPUs don't have SSE2 either.

-- 
Bruce Cran

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:48:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A1A7F106566B;
	Wed, 16 Mar 2011 20:48:54 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 15E1D8FC0C;
	Wed, 16 Mar 2011 20:48:53 +0000 (UTC)
Received: by qyk27 with SMTP id 27so1812927qyk.13
	for ; Wed, 16 Mar 2011 13:48:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:from
	:date:x-google-sender-auth:message-id:subject:to:cc:content-type;
	bh=c3DUdnuJV3ZTwjJbZu3TrrsfThFU9uIw+vcWKGp4DVk=;
	b=dzczo2t4WObftzGypVSgh6XLbtZHbT7bRU3ZTBOC+MTLZhZNOwgHQGWfUcc07MoZo9
	+0ifgYEy0OdpJ5QMrjsCluryZwoYWhCIjRyikikzeCwx8nMty57IPMffjhCQg3qeGDsY
	+ctTj+dnBbCO0VK5QhWZgS3VoJCi6C9t+ynnU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:from:date
	:x-google-sender-auth:message-id:subject:to:cc:content-type;
	b=MM8E+7YNpLm1qbg5QNftyT4jKphRKW3UfNXw9HHSu9y0J3H7g9ZxN0Fus1K3gBNpNO
	8NBz7WZH4bqjUSAU4O39Gkz4ggJY+QLgaB+xmp4jGXHeACkf10Od+fuzVMBhOAm3oTCo
	MQb8ROBQfkhhcZZgW4ZD89oVb/JmVHIhyXqfk=
Received: by 10.229.111.225 with SMTP id t33mr481903qcp.61.1300308533108; Wed,
	16 Mar 2011 13:48:53 -0700 (PDT)
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.229.78.193 with HTTP; Wed, 16 Mar 2011 13:48:13 -0700 (PDT)
In-Reply-To: 
References: <201103161622.p2GGMxNp097642@svn.freebsd.org>
	<20110316174642.GB6367@freebsd.org>
	
	
	
From: Ivan Voras 
Date: Wed, 16 Mar 2011 21:48:13 +0100
X-Google-Sender-Auth: QrR0IoUAl_BqxtwREzg-rjD-SNo
Message-ID: 
To: Garrett Cooper 
Content-Type: text/plain; charset=UTF-8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219699 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:48:54 -0000

On 16 March 2011 21:37, Ivan Voras  wrote:

> For now, there's a report (which actually inspired me to retest and
> commit this) from someone who tried this on 2x 15k RPM SAS drives,
> with much better results using read_max=128 (thread "gmirror
> performance" on freebsd-fs@). I estimate that because his drives were
> 15kRPM from the start, the improvement isn't as drastic going from 8
> to 128 as on these SATA drives I tested on (faster seeks). He went
> from ~~ 195 MB/s to ~~ 258 MB/s while I go from ~~ 50 MB/s to ~~ 140
> MB/s.

Btw I also tested that random IO isn't affected by this: it isn't. The
read-ahead heuristics is working.

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:53:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58264106564A;
	Wed, 16 Mar 2011 20:53:42 +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 47C728FC15;
	Wed, 16 Mar 2011 20:53: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 p2GKrgFK004155;
	Wed, 16 Mar 2011 20:53:42 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GKrgLP004136;
	Wed, 16 Mar 2011 20:53:42 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103162053.p2GKrgLP004136@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 16 Mar 2011 20:53:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor-sys
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219704 - in vendor-sys/acpica/dist: . common compiler
	events include tools/acpiexec tools/acpixtract
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:53:42 -0000

Author: jkim
Date: Wed Mar 16 20:53:41 2011
New Revision: 219704
URL: http://svn.freebsd.org/changeset/base/219704

Log:
  Import ACPICA 20110316.

Modified:
  vendor-sys/acpica/dist/changes.txt
  vendor-sys/acpica/dist/common/dmtable.c
  vendor-sys/acpica/dist/common/dmtbdump.c
  vendor-sys/acpica/dist/common/dmtbinfo.c
  vendor-sys/acpica/dist/compiler/Makefile
  vendor-sys/acpica/dist/compiler/aslcompiler.y
  vendor-sys/acpica/dist/compiler/dtcompiler.h
  vendor-sys/acpica/dist/compiler/dtio.c
  vendor-sys/acpica/dist/compiler/dttable.c
  vendor-sys/acpica/dist/compiler/dttemplate.h
  vendor-sys/acpica/dist/compiler/dtutils.c
  vendor-sys/acpica/dist/events/evmisc.c
  vendor-sys/acpica/dist/events/evxfgpe.c
  vendor-sys/acpica/dist/include/acdisasm.h
  vendor-sys/acpica/dist/include/acglobal.h
  vendor-sys/acpica/dist/include/acpixf.h
  vendor-sys/acpica/dist/include/actbl2.h
  vendor-sys/acpica/dist/tools/acpiexec/aehandlers.c
  vendor-sys/acpica/dist/tools/acpixtract/acpixtract.c

Modified: vendor-sys/acpica/dist/changes.txt
==============================================================================
--- vendor-sys/acpica/dist/changes.txt	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/changes.txt	Wed Mar 16 20:53:41 2011	(r219704)
@@ -1,7 +1,49 @@
 ----------------------------------------
-11 February 2011. Summary of changes for version 20110211:
+16 March 2011. Summary of changes for version 20110316:
+
+x
+1) ACPI CA Core Subsystem:
+
+Fixed a problem caused by a _PRW method appearing at the namespace root scope 
+during the setup of wake GPEs. A fault could occur if a _PRW directly under the 
+root object was passed to the AcpiSetupGpeForWake interface. Lin Ming.
+
+Implemented support for "spurious" Global Lock interrupts. On some systems, a 
+global lock interrupt can occur without the pending flag being set. Upon a GL 
+interrupt, we now ensure that a thread is actually waiting for the lock before 
+signaling GL availability. Rafael Wysocki, Bob Moore.
+
+Example Code and Data Size: These are the sizes for the OS-independent acpica.lib 
+produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of 
+the code includes the debug output trace mechanism and has a much larger code and 
+data size.
+
+  Previous Release (VC 9.0):
+    Non-Debug Version:  89.7K Code, 23.7K Data, 113.4K Total
+    Debug Version:     163.9K Code, 67.5K Data, 231.4K Total
+  Current Release (VC 9.0):
+    Non-Debug Version:  89.8K Code, 23.8K Data, 113.6K Total
+    Debug Version:     164.2K Code, 67.9K Data, 232.1K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+Implemented full support for the "SLIC" ACPI table. Includes support in the 
+header files, disassembler, table compiler, and template generator. Bob Moore, 
+Lin Ming.
 
-This release is available at www.acpica.org/downloads
+AcpiXtract: Correctly handle embedded comments and messages from AcpiDump. 
+Apparently some or all versions of acpidump will occasionally emit a comment like 
+"Wrong checksum", etc., into the dump file. This was causing problems for 
+AcpiXtract. ACPICA BZ 905.
+
+iASL: Fix the Linux makefile by removing an inadvertent double file inclusion. 
+ACPICA BZ 913.
+
+AcpiExec: Update installation of operation region handlers. Install one handler 
+for a user-defined address space. This is used by the ASL test suite (ASLTS).
+
+----------------------------------------
+11 February 2011. Summary of changes for version 20110211:
 
 1) ACPI CA Core Subsystem:
 

Modified: vendor-sys/acpica/dist/common/dmtable.c
==============================================================================
--- vendor-sys/acpica/dist/common/dmtable.c	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/common/dmtable.c	Wed Mar 16 20:53:41 2011	(r219704)
@@ -192,6 +192,13 @@ static const char           *AcpiDmMadtS
     "Unknown SubTable Type"         /* Reserved */
 };
 
+static const char           *AcpiDmSlicSubnames[] =
+{
+    "Public Key Structure",
+    "Windows Marker Structure",
+    "Unknown SubTable Type"         /* Reserved */
+};
+
 static const char           *AcpiDmSratSubnames[] =
 {
     "Processor Local APIC/SAPIC Affinity",
@@ -270,7 +277,7 @@ ACPI_DMTABLE_DATA    AcpiDmTableData[] =
     {ACPI_SIG_MSCT, NULL,                   AcpiDmDumpMsct, DtCompileMsct,  TemplateMsct,   "Maximum System Characteristics Table"},
     {ACPI_SIG_RSDT, NULL,                   AcpiDmDumpRsdt, DtCompileRsdt,  TemplateRsdt,   "Root System Description Table"},
     {ACPI_SIG_SBST, AcpiDmTableInfoSbst,    NULL,           NULL,           TemplateSbst,   "Smart Battery Specification Table"},
-    {ACPI_SIG_SLIC, AcpiDmTableInfoSlic,    NULL,           NULL,           NULL,           "Software Licensing Description Table"},
+    {ACPI_SIG_SLIC, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateSlic,   "Software Licensing Description Table"},
     {ACPI_SIG_SLIT, NULL,                   AcpiDmDumpSlit, DtCompileSlit,  TemplateSlit,   "System Locality Information Table"},
     {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr,    NULL,           NULL,           TemplateSpcr,   "Serial Port Console Redirection table"},
     {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi,    NULL,           NULL,           TemplateSpmi,   "Server Platform Management Interface table"},
@@ -475,30 +482,34 @@ AcpiDmLineHeader (
     char                    *Name)
 {
 
+    /* Allow a null name for fields that span multiple lines (large buffers) */
+
+    if (!Name)
+    {
+        Name = "";
+    }
+
     if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
     {
         if (ByteLength)
         {
-            AcpiOsPrintf ("[%.3d] %34s : ",
-                ByteLength, Name);
+            AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);
         }
         else
         {
-            AcpiOsPrintf ("%40s : ",
-                Name);
+            AcpiOsPrintf ("%41s : ", Name);
         }
     }
     else /* Normal disassembler or verbose template */
     {
         if (ByteLength)
         {
-            AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ",
+            AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ",
                 Offset, Offset, ByteLength, Name);
         }
         else
         {
-            AcpiOsPrintf ("%43s : ",
-                Name);
+            AcpiOsPrintf ("%44s : ", Name);
         }
     }
 }
@@ -635,6 +646,7 @@ AcpiDmDumpTable (
         case ACPI_DMT_UINT32:
         case ACPI_DMT_NAME4:
         case ACPI_DMT_SIG:
+        case ACPI_DMT_SLIC:
             ByteLength = 4;
             break;
         case ACPI_DMT_NAME6:
@@ -652,6 +664,9 @@ AcpiDmDumpTable (
         case ACPI_DMT_UUID:
             ByteLength = 16;
             break;
+        case ACPI_DMT_BUF128:
+            ByteLength = 128;
+            break;
         case ACPI_DMT_STRING:
             ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
             break;
@@ -754,17 +769,26 @@ AcpiDmDumpTable (
 
         case ACPI_DMT_BUF7:
         case ACPI_DMT_BUF16:
+        case ACPI_DMT_BUF128:
 
             /*
              * Buffer: Size depends on the opcode and was set above.
              * Each hex byte is separated with a space.
              */
-            for (Temp8 = 0; Temp8 < ByteLength; Temp8++)
+            for (Temp16 = 0; Temp16 < ByteLength; Temp16++)
             {
-                AcpiOsPrintf ("%2.2X", Target[Temp8]);
-                if ((UINT32) (Temp8 + 1) < ByteLength)
+                AcpiOsPrintf ("%2.2X", Target[Temp16]);
+                if ((UINT32) (Temp16 + 1) < ByteLength)
                 {
-                    AcpiOsPrintf (" ");
+                    if ((Temp16 > 0) && (!((Temp16+1) % 16)))
+                    {
+                        AcpiOsPrintf ("\n");
+                        AcpiDmLineHeader (0, 0, NULL);
+                    }
+                    else
+                    {
+                        AcpiOsPrintf (" ");
+                    }
                 }
             }
             AcpiOsPrintf ("\n");
@@ -991,6 +1015,19 @@ AcpiDmDumpTable (
             AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmMadtSubnames[Temp8]);
             break;
 
+        case ACPI_DMT_SLIC:
+
+            /* SLIC subtable types */
+
+            Temp8 = *Target;
+            if (Temp8 > ACPI_SLIC_TYPE_RESERVED)
+            {
+                Temp8 = ACPI_SLIC_TYPE_RESERVED;
+            }
+
+            AcpiOsPrintf ("%8.8X <%s>\n", *Target, AcpiDmSlicSubnames[Temp8]);
+            break;
+
         case ACPI_DMT_SRAT:
 
             /* SRAT subtable types */

Modified: vendor-sys/acpica/dist/common/dmtbdump.c
==============================================================================
--- vendor-sys/acpica/dist/common/dmtbdump.c	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/common/dmtbdump.c	Wed Mar 16 20:53:41 2011	(r219704)
@@ -1275,6 +1275,81 @@ AcpiDmDumpMsct (
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiDmDumpSlic
+ *
+ * PARAMETERS:  Table               - A SLIC table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a SLIC
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpSlic (
+    ACPI_TABLE_HEADER       *Table)
+{
+    ACPI_STATUS             Status;
+    UINT32                  Offset = sizeof (ACPI_TABLE_SLIC);
+    ACPI_SLIC_HEADER        *SubTable;
+    ACPI_DMTABLE_INFO       *InfoTable;
+
+
+    /* There is no main SLIC table, only subtables */
+
+    SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
+    while (Offset < Table->Length)
+    {
+        /* Common sub-table header */
+
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+                    SubTable->Length, AcpiDmTableInfoSlicHdr);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        switch (SubTable->Type)
+        {
+        case ACPI_SLIC_TYPE_PUBLIC_KEY:
+            InfoTable = AcpiDmTableInfoSlic0;
+            break;
+        case ACPI_SLIC_TYPE_WINDOWS_MARKER:
+            InfoTable = AcpiDmTableInfoSlic1;
+            break;
+        default:
+            AcpiOsPrintf ("\n**** Unknown SLIC sub-table type 0x%X\n", SubTable->Type);
+
+            /* Attempt to continue */
+
+            if (!SubTable->Length)
+            {
+                AcpiOsPrintf ("Invalid zero length subtable\n");
+                return;
+            }
+            goto NextSubTable;
+        }
+
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+                    SubTable->Length, InfoTable);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+NextSubTable:
+        /* Point to next sub-table */
+
+        Offset += SubTable->Length;
+        SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
+    }
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiDmDumpSlit
  *
  * PARAMETERS:  Table               - An SLIT

Modified: vendor-sys/acpica/dist/common/dmtbinfo.c
==============================================================================
--- vendor-sys/acpica/dist/common/dmtbinfo.c	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/common/dmtbinfo.c	Wed Mar 16 20:53:41 2011	(r219704)
@@ -51,6 +51,31 @@
         ACPI_MODULE_NAME    ("dmtbinfo")
 
 /*
+ * How to add a new table:
+ *
+ * - Add the C table definition to the actbl1.h or actbl2.h header.
+ * - Add ACPI_xxxx_OFFSET macro(s) for the table (and subtables) to list below.
+ * - Define the table in this file (for the disassembler). If any
+ *   new data types are required (ACPI_DMT_*), see below.
+ * - Add an external declaration for the new table definition (AcpiDmTableInfo*)
+ *     in acdisam.h
+ * - Add new table definition to the dispatch table in dmtable.c (AcpiDmTableData)
+ *     If a simple table (with no subtables), no disassembly code is needed.
+ *     Otherwise, create the AcpiDmDump* function for to disassemble the table
+ *     and add it to the dmtbdump.c file.
+ * - Add an external declaration for the new AcpiDmDump* function in acdisasm.h
+ * - Add the new AcpiDmDump* function to the dispatch table in dmtable.c
+ * - Create a template for the new table
+ * - Add data table compiler support
+ *
+ * How to add a new data type (ACPI_DMT_*):
+ *
+ * - Add new type at the end of the ACPI_DMT list in acdisasm.h
+ * - Add length and implementation cases in dmtable.c  (disassembler)
+ * - Add type and length cases in dtutils.c (DT compiler)
+ */
+
+/*
  * Macros used to generate offsets to specific table fields
  */
 #define ACPI_FACS_OFFSET(f)             (UINT8) ACPI_OFFSET (ACPI_TABLE_FACS,f)
@@ -131,6 +156,9 @@
 #define ACPI_MADTH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
 #define ACPI_MCFG0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
 #define ACPI_MSCT0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
+#define ACPI_SLICH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SLIC_HEADER,f)
+#define ACPI_SLIC0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SLIC_KEY,f)
+#define ACPI_SLIC1_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SLIC_MARKER,f)
 #define ACPI_SRATH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
 #define ACPI_SRAT0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
 #define ACPI_SRAT1_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
@@ -1256,13 +1284,42 @@ ACPI_DMTABLE_INFO           AcpiDmTableI
 
 /*******************************************************************************
  *
- * SLIC - Software Licensing Description Table. NOT FULLY IMPLEMENTED, do not
- * have the table definition.
+ * SLIC - Software Licensing Description Table. There is no common table, just
+ * the standard ACPI header and then subtables.
  *
  ******************************************************************************/
 
-ACPI_DMTABLE_INFO           AcpiDmTableInfoSlic[] =
+/* Common Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoSlicHdr[] =
+{
+    {ACPI_DMT_SLIC,     ACPI_SLICH_OFFSET (Type),                   "Subtable Type", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLICH_OFFSET (Length),                 "Length", DT_LENGTH},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoSlic0[] =
+{
+    {ACPI_DMT_UINT8,    ACPI_SLIC0_OFFSET (KeyType),                "Key Type", 0},
+    {ACPI_DMT_UINT8,    ACPI_SLIC0_OFFSET (Version),                "Version", 0},
+    {ACPI_DMT_UINT16,   ACPI_SLIC0_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC0_OFFSET (Algorithm),              "Algorithm", 0},
+    {ACPI_DMT_NAME4,    ACPI_SLIC0_OFFSET (Magic),                  "Magic", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC0_OFFSET (BitLength),              "BitLength", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC0_OFFSET (Exponent),               "Exponent", 0},
+    {ACPI_DMT_BUF128,   ACPI_SLIC0_OFFSET (Modulus[0]),             "Modulus", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoSlic1[] =
 {
+    {ACPI_DMT_UINT32,   ACPI_SLIC1_OFFSET (Version),                "Version", 0},
+    {ACPI_DMT_NAME6,    ACPI_SLIC1_OFFSET (OemId[0]),               "Oem ID", 0},
+    {ACPI_DMT_NAME8,    ACPI_SLIC1_OFFSET (OemTableId[0]),          "Oem Table ID", 0},
+    {ACPI_DMT_NAME8,    ACPI_SLIC1_OFFSET (WindowsFlag[0]),         "Windows Flag", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC1_OFFSET (SlicVersion),            "SLIC Version", 0},
+    {ACPI_DMT_BUF16,    ACPI_SLIC1_OFFSET (Reserved[0]),            "Reserved", 0},
+    {ACPI_DMT_BUF128,   ACPI_SLIC1_OFFSET (Signature[0]),           "Signature", 0},
     ACPI_DMT_TERMINATOR
 };
 

Modified: vendor-sys/acpica/dist/compiler/Makefile
==============================================================================
--- vendor-sys/acpica/dist/compiler/Makefile	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/compiler/Makefile	Wed Mar 16 20:53:41 2011	(r219704)
@@ -32,7 +32,6 @@ OBJS = \
 	adfile.o \
 	adisasm.o \
 	adwalk.o \
-	aslbtypes.o \
 	aslanalyze.o \
 	aslbtypes.o \
 	aslcodegen.o \

Modified: vendor-sys/acpica/dist/compiler/aslcompiler.y
==============================================================================
--- vendor-sys/acpica/dist/compiler/aslcompiler.y	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/compiler/aslcompiler.y	Wed Mar 16 20:53:41 2011	(r219704)
@@ -728,6 +728,21 @@ ASLCode
     | error                         {YYABORT; $$ = NULL;}
     ;
 
+/*
+ * Note concerning support for "module-level code".
+ *
+ * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control
+ * methods (the so-called module-level code.) This support was explicitly
+ * removed in ACPI 2.0, but this type of code continues to be created by
+ * BIOS vendors. In order to support the disassembly and recompilation of
+ * such code (and the porting of ASL code to iASL), iASL supports this
+ * code in violation of the current ACPI specification.
+ *
+ * The grammar change to support module-level code is to revert the
+ * {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the
+ * original use of {TermList} instead (see below.) This allows the use
+ * of Type1 and Type2 opcodes at module level.
+ */
 DefinitionBlockTerm
     : PARSEOP_DEFINITIONBLOCK '('	{$$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);}
         String ','

Modified: vendor-sys/acpica/dist/compiler/dtcompiler.h
==============================================================================
--- vendor-sys/acpica/dist/compiler/dtcompiler.h	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/compiler/dtcompiler.h	Wed Mar 16 20:53:41 2011	(r219704)
@@ -394,6 +394,10 @@ DtCompileRsdt (
     void                    **PFieldList);
 
 ACPI_STATUS
+DtCompileSlic (
+    void                    **PFieldList);
+
+ACPI_STATUS
 DtCompileSlit (
     void                    **PFieldList);
 

Modified: vendor-sys/acpica/dist/compiler/dtio.c
==============================================================================
--- vendor-sys/acpica/dist/compiler/dtio.c	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/compiler/dtio.c	Wed Mar 16 20:53:41 2011	(r219704)
@@ -60,6 +60,10 @@ static void
 DtLinkField (
     DT_FIELD                *Field);
 
+static void
+DtMergeField (
+    char                    *Value);
+
 static ACPI_STATUS
 DtParseLine (
     char                    *LineBuffer,
@@ -222,6 +226,56 @@ DtLinkField (
 
 /******************************************************************************
  *
+ * FUNCTION:    DtMergeField
+ *
+ * PARAMETERS:  Value               - Merge this line into previous one
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Merge a field value to the previous one,
+ *              probably for a multi-line buffer definition.
+ *
+ *****************************************************************************/
+
+static void
+DtMergeField (
+    char                    *Value)
+{
+    DT_FIELD                *Prev;
+    DT_FIELD                *Next;
+    char                    *NewValue;
+    UINT32                  PrevLength;
+    UINT32                  ThisLength;
+
+
+    Prev = Next = Gbl_FieldList;
+
+    while (Next)
+    {
+        Prev = Next;
+        Next = Next->Next;
+    }
+
+    if (Prev)
+    {
+        PrevLength = ACPI_STRLEN (Prev->Value);
+        ThisLength = ACPI_STRLEN (Value);
+
+        /* Add two for: separator + NULL terminator */
+
+        NewValue = UtLocalCalloc (PrevLength + ThisLength + 2);
+        ACPI_STRNCPY (NewValue, Prev->Value, PrevLength);
+        NewValue[PrevLength] = ' ';
+
+        ACPI_STRNCPY ((NewValue + PrevLength + 1), Value, ThisLength);
+        ACPI_FREE (Prev->Value);
+        Prev->Value = NewValue;
+    }
+}
+
+
+/******************************************************************************
+ *
  * FUNCTION:    DtParseLine
  *
  * PARAMETERS:  LineBuffer          - Current source code line
@@ -354,11 +408,12 @@ DtParseLine (
 
     Length = ACPI_PTR_DIFF (End, Start);
     TmpValue = UtLocalCalloc (Length + 1);
+
     ACPI_STRNCPY (TmpValue, Start, Length);
     Value = DtTrim (TmpValue);
     ACPI_FREE (TmpValue);
 
-    if (Name && Value)
+    if (ACPI_STRLEN (Name) && Value)
     {
         Field = UtLocalCalloc (sizeof (DT_FIELD));
         Field->Name = Name;
@@ -370,6 +425,17 @@ DtParseLine (
 
         DtLinkField (Field);
     }
+    else if (!ACPI_STRLEN (Name))
+    {
+        /* Handle multi-line buffers (length > 16) */
+
+        DtMergeField (Value);
+    }
+    else
+    {
+        ACPI_FREE (Name);
+        ACPI_FREE (Value);
+    }
 
     return (AE_OK);
 }

Modified: vendor-sys/acpica/dist/compiler/dttable.c
==============================================================================
--- vendor-sys/acpica/dist/compiler/dttable.c	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/compiler/dttable.c	Wed Mar 16 20:53:41 2011	(r219704)
@@ -1134,6 +1134,75 @@ DtCompileRsdt (
 
 /******************************************************************************
  *
+ * FUNCTION:    DtCompileSlic
+ *
+ * PARAMETERS:  List                - Current field list pointer
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Compile SLIC.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileSlic (
+    void                    **List)
+{
+    ACPI_STATUS             Status;
+    DT_SUBTABLE             *Subtable;
+    DT_SUBTABLE             *ParentTable;
+    DT_FIELD                **PFieldList = (DT_FIELD **) List;
+    DT_FIELD                *SubtableStart;
+    ACPI_SLIC_HEADER        *SlicHeader;
+    ACPI_DMTABLE_INFO       *InfoTable;
+
+
+    while (*PFieldList)
+    {
+        SubtableStart = *PFieldList;
+        Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlicHdr,
+                    &Subtable, TRUE);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Status);
+        }
+
+        ParentTable = DtPeekSubtable ();
+        DtInsertSubtable (ParentTable, Subtable);
+        DtPushSubtable (Subtable);
+
+        SlicHeader = ACPI_CAST_PTR (ACPI_SLIC_HEADER, Subtable->Buffer);
+
+        switch (SlicHeader->Type)
+        {
+        case ACPI_SLIC_TYPE_PUBLIC_KEY:
+            InfoTable = AcpiDmTableInfoSlic0;
+            break;
+        case ACPI_SLIC_TYPE_WINDOWS_MARKER:
+            InfoTable = AcpiDmTableInfoSlic1;
+            break;
+        default:
+            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SLIC");
+            return (AE_ERROR);
+        }
+
+        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Status);
+        }
+
+        ParentTable = DtPeekSubtable ();
+        DtInsertSubtable (ParentTable, Subtable);
+        DtPopSubtable ();
+    }
+
+    return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
  * FUNCTION:    DtCompileSlit
  *
  * PARAMETERS:  List                - Current field list pointer

Modified: vendor-sys/acpica/dist/compiler/dttemplate.h
==============================================================================
--- vendor-sys/acpica/dist/compiler/dttemplate.h	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/compiler/dttemplate.h	Wed Mar 16 20:53:41 2011	(r219704)
@@ -534,6 +534,57 @@ const unsigned char TemplateSbst[] =
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00   /* 00000028    "........" */
 };
 
+const unsigned char TemplateSlic[] =
+{
+    0x53,0x4C,0x49,0x43,0x76,0x01,0x00,0x00,  /* 00000000    "SLICv..." */
+    0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
+    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
+    0x11,0x02,0x11,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "... ...." */
+    0x9C,0x00,0x00,0x00,0x06,0x02,0x00,0x00,  /* 00000028    "........" */
+    0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x31,  /* 00000030    ".$..RSA1" */
+    0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000048    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000050    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000060    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000068    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000070    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000078    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000080    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000088    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000090    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000098    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000A0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000A8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000B0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000B8    "........" */
+    0x01,0x00,0x00,0x00,0xB6,0x00,0x00,0x00,  /* 000000C0    "........" */
+    0x00,0x00,0x02,0x00,0x49,0x4E,0x54,0x45,  /* 000000C8    "....INTE" */
+    0x4C,0x20,0x54,0x45,0x4D,0x50,0x4C,0x41,  /* 000000D0    "L TEMPLA" */
+    0x54,0x45,0x57,0x49,0x4E,0x44,0x4F,0x57,  /* 000000D8    "TEWINDOW" */
+    0x53,0x20,0x01,0x00,0x02,0x00,0x00,0x00,  /* 000000E0    "S ......" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000100    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000108    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000110    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000118    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000120    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000128    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000130    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000138    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000140    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000148    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000150    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000158    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000160    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000168    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00             /* 00000170    "......"   */
+};
+
 const unsigned char TemplateSlit[] =
 {
     0x53,0x4C,0x49,0x54,0x3C,0x00,0x00,0x00,  /* 00000000    "SLIT<..." */

Modified: vendor-sys/acpica/dist/compiler/dtutils.c
==============================================================================
--- vendor-sys/acpica/dist/compiler/dtutils.c	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/compiler/dtutils.c	Wed Mar 16 20:53:41 2011	(r219704)
@@ -401,6 +401,7 @@ DtGetFieldType (
     case ACPI_DMT_BUFFER:
     case ACPI_DMT_BUF7:
     case ACPI_DMT_BUF16:
+    case ACPI_DMT_BUF128:
     case ACPI_DMT_PCI_PATH:
         Type = DT_FIELD_TYPE_BUFFER;
         break;
@@ -546,6 +547,7 @@ DtGetFieldLength (
 
     case ACPI_DMT_UINT32:
     case ACPI_DMT_NAME4:
+    case ACPI_DMT_SLIC:
     case ACPI_DMT_SIG:
         ByteLength = 4;
         break;
@@ -605,6 +607,10 @@ DtGetFieldLength (
         ByteLength = 16;
         break;
 
+    case ACPI_DMT_BUF128:
+        ByteLength = 128;
+        break;
+
     case ACPI_DMT_UNICODE:
         Value = DtGetFieldValue (Field, Info->Name);
 

Modified: vendor-sys/acpica/dist/events/evmisc.c
==============================================================================
--- vendor-sys/acpica/dist/events/evmisc.c	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/events/evmisc.c	Wed Mar 16 20:53:41 2011	(r219704)
@@ -309,12 +309,8 @@ AcpiEvNotifyDispatch (
  * RETURN:      ACPI_INTERRUPT_HANDLED
  *
  * DESCRIPTION: Invoked directly from the SCI handler when a global lock
- *              release interrupt occurs. Attempt to acquire the global lock,
- *              if successful, signal the thread waiting for the lock.
- *
- * NOTE: Assumes that the semaphore can be signaled from interrupt level. If
- * this is not possible for some reason, a separate thread will have to be
- * scheduled to do this.
+ *              release interrupt occurs. If there is actually a pending
+ *              request for the lock, signal the waiting thread.
  *
  ******************************************************************************/
 
@@ -322,32 +318,38 @@ static UINT32
 AcpiEvGlobalLockHandler (
     void                    *Context)
 {
-    BOOLEAN                 Acquired = FALSE;
     ACPI_STATUS             Status;
+    ACPI_CPU_FLAGS          Flags;
+
 
+    Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
 
     /*
-     * Attempt to get the lock.
-     *
-     * If we don't get it now, it will be marked pending and we will
-     * take another interrupt when it becomes free.
+     * If a request for the global lock is not actually pending,
+     * we are done. This handles "spurious" global lock interrupts
+     * which are possible (and have been seen) with bad BIOSs.
      */
-    ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
-    if (Acquired)
+    if (!AcpiGbl_GlobalLockPending)
     {
-        /* Got the lock, now wake the thread waiting for it */
+        goto CleanupAndExit;
+    }
 
-        AcpiGbl_GlobalLockAcquired = TRUE;
+    /*
+     * Send a unit to the global lock semaphore. The actual acquisition
+     * of the global lock will be performed by the waiting thread.
+     */
+    Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
+    if (ACPI_FAILURE (Status))
+    {
+        ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
+    }
 
-        /* Send a unit to the semaphore */
+    AcpiGbl_GlobalLockPending = FALSE;
 
-        Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
-        if (ACPI_FAILURE (Status))
-        {
-            ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
-        }
-    }
 
+CleanupAndExit:
+
+    AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
     return (ACPI_INTERRUPT_HANDLED);
 }
 
@@ -385,15 +387,22 @@ AcpiEvInitGlobalLockHandler (
      * Map to AE_OK, but mark global lock as not present. Any attempt to
      * actually use the global lock will be flagged with an error.
      */
+    AcpiGbl_GlobalLockPresent = FALSE;
     if (Status == AE_NO_HARDWARE_RESPONSE)
     {
         ACPI_ERROR ((AE_INFO,
             "No response from Global Lock hardware, disabling lock"));
 
-        AcpiGbl_GlobalLockPresent = FALSE;
         return_ACPI_STATUS (AE_OK);
     }
 
+    Status = AcpiOsCreateLock (&AcpiGbl_GlobalLockPendingLock);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
+
+    AcpiGbl_GlobalLockPending = FALSE;
     AcpiGbl_GlobalLockPresent = TRUE;
     return_ACPI_STATUS (Status);
 }
@@ -454,7 +463,8 @@ ACPI_STATUS
 AcpiEvAcquireGlobalLock (
     UINT16                  Timeout)
 {
-    ACPI_STATUS             Status = AE_OK;
+    ACPI_CPU_FLAGS          Flags;
+    ACPI_STATUS             Status;
     BOOLEAN                 Acquired = FALSE;
 
 
@@ -487,8 +497,8 @@ AcpiEvAcquireGlobalLock (
     }
 
     /*
-     * Make sure that a global lock actually exists. If not, just treat the
-     * lock as a standard mutex.
+     * Make sure that a global lock actually exists. If not, just
+     * treat the lock as a standard mutex.
      */
     if (!AcpiGbl_GlobalLockPresent)
     {
@@ -496,31 +506,45 @@ AcpiEvAcquireGlobalLock (
         return_ACPI_STATUS (AE_OK);
     }
 
-    /* Attempt to acquire the actual hardware lock */
+    Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
 
-    ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
-    if (Acquired)
+    do
     {
-       /* We got the lock */
+        /* Attempt to acquire the actual hardware lock */
 
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Acquired hardware Global Lock\n"));
+        ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
+        if (Acquired)
+        {
+            AcpiGbl_GlobalLockAcquired = TRUE;
+            ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+                "Acquired hardware Global Lock\n"));
+            break;
+        }
 
-        AcpiGbl_GlobalLockAcquired = TRUE;
-        return_ACPI_STATUS (AE_OK);
-    }
+        /*
+         * Did not get the lock. The pending bit was set above, and
+         * we must now wait until we receive the global lock
+         * released interrupt.
+         */
+        AcpiGbl_GlobalLockPending = TRUE;
+        AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
 
-    /*
-     * Did not get the lock. The pending bit was set above, and we must now
-     * wait until we get the global lock released interrupt.
-     */
-    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Waiting for hardware Global Lock\n"));
+        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+            "Waiting for hardware Global Lock\n"));
 
-    /*
-     * Wait for handshake with the global lock interrupt handler.
-     * This interface releases the interpreter if we must wait.
-     */
-    Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
-                ACPI_WAIT_FOREVER);
+        /*
+         * Wait for handshake with the global lock interrupt handler.
+         * This interface releases the interpreter if we must wait.
+         */
+        Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
+                    ACPI_WAIT_FOREVER);
+
+        Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
+
+    } while (ACPI_SUCCESS (Status));
+
+    AcpiGbl_GlobalLockPending = FALSE;
+    AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
 
     return_ACPI_STATUS (Status);
 }

Modified: vendor-sys/acpica/dist/events/evxfgpe.c
==============================================================================
--- vendor-sys/acpica/dist/events/evxfgpe.c	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/events/evxfgpe.c	Wed Mar 16 20:53:41 2011	(r219704)
@@ -314,9 +314,19 @@ AcpiSetupGpeForWake (
         return_ACPI_STATUS (AE_BAD_PARAMETER);
     }
 
+    /* Handle root object case */
+
+    if (WakeDevice == ACPI_ROOT_OBJECT)
+    {
+        DeviceNode = AcpiGbl_RootNode;
+    }
+    else
+    {
+        DeviceNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, WakeDevice);
+    }
+
     /* Validate WakeDevice is of type Device */
 
-    DeviceNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, WakeDevice);
     if (DeviceNode->Type != ACPI_TYPE_DEVICE)
     {
         return_ACPI_STATUS (AE_BAD_PARAMETER);

Modified: vendor-sys/acpica/dist/include/acdisasm.h
==============================================================================
--- vendor-sys/acpica/dist/include/acdisasm.h	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/include/acdisasm.h	Wed Mar 16 20:53:41 2011	(r219704)
@@ -129,7 +129,8 @@ typedef const struct acpi_dmtable_info
 #define ACPI_DMT_DEVICE_PATH            44
 #define ACPI_DMT_LABEL                  45
 #define ACPI_DMT_BUF7                   46
-
+#define ACPI_DMT_BUF128                 47
+#define ACPI_DMT_SLIC                   48
 
 typedef
 void (*ACPI_DMTABLE_HANDLER) (
@@ -262,7 +263,9 @@ extern ACPI_DMTABLE_INFO        AcpiDmTa
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSbst[];
-extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlic[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlicHdr[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlic0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlic1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlit[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSpcr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSpmi[];
@@ -379,6 +382,10 @@ AcpiDmDumpRsdt (
     ACPI_TABLE_HEADER       *Table);
 
 void
+AcpiDmDumpSlic (
+    ACPI_TABLE_HEADER       *Table);
+
+void
 AcpiDmDumpSlit (
     ACPI_TABLE_HEADER       *Table);
 

Modified: vendor-sys/acpica/dist/include/acglobal.h
==============================================================================
--- vendor-sys/acpica/dist/include/acglobal.h	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/include/acglobal.h	Wed Mar 16 20:53:41 2011	(r219704)
@@ -190,13 +190,16 @@ ACPI_EXTERN ACPI_MUTEX_INFO             
 
 /*
  * Global lock mutex is an actual AML mutex object
- * Global lock semaphore works in conjunction with the HW global lock
+ * Global lock semaphore works in conjunction with the actual global lock
+ * Global lock spinlock is used for "pending" handshake
  */
 ACPI_EXTERN ACPI_OPERAND_OBJECT        *AcpiGbl_GlobalLockMutex;
 ACPI_EXTERN ACPI_SEMAPHORE              AcpiGbl_GlobalLockSemaphore;
+ACPI_EXTERN ACPI_SPINLOCK               AcpiGbl_GlobalLockPendingLock;
 ACPI_EXTERN UINT16                      AcpiGbl_GlobalLockHandle;
 ACPI_EXTERN BOOLEAN                     AcpiGbl_GlobalLockAcquired;
 ACPI_EXTERN BOOLEAN                     AcpiGbl_GlobalLockPresent;
+ACPI_EXTERN BOOLEAN                     AcpiGbl_GlobalLockPending;
 
 /*
  * Spinlocks are used for interfaces that can be possibly called at

Modified: vendor-sys/acpica/dist/include/acpixf.h
==============================================================================
--- vendor-sys/acpica/dist/include/acpixf.h	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/include/acpixf.h	Wed Mar 16 20:53:41 2011	(r219704)
@@ -48,7 +48,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20110211
+#define ACPI_CA_VERSION                 0x20110316
 
 #include "actypes.h"
 #include "actbl.h"

Modified: vendor-sys/acpica/dist/include/actbl2.h
==============================================================================
--- vendor-sys/acpica/dist/include/actbl2.h	Wed Mar 16 20:19:48 2011	(r219703)
+++ vendor-sys/acpica/dist/include/actbl2.h	Wed Mar 16 20:53:41 2011	(r219704)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Name: actbl2.h - ACPI Specification Revision 2.0 Tables
+ * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
  *
  *****************************************************************************/
 
@@ -831,6 +831,81 @@ typedef struct acpi_table_mchi
 
 /*******************************************************************************
  *
+ * SLIC - Software Licensing Description Table
+ *        Version 1
+ *
+ * Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
+ * Copyright 2006
+ *
+ ******************************************************************************/
+
+/* Basic SLIC table is only the common ACPI header */
+
+typedef struct acpi_table_slic
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+
+} ACPI_TABLE_SLIC;
+
+
+/* Common SLIC subtable header */
+
+typedef struct acpi_slic_header
+{
+    UINT32                  Type;
+    UINT32                  Length;
+
+} ACPI_SLIC_HEADER;
+
+/* Values for Type field above */
+
+enum AcpiSlicType
+{
+    ACPI_SLIC_TYPE_PUBLIC_KEY           = 0,
+    ACPI_SLIC_TYPE_WINDOWS_MARKER       = 1,
+    ACPI_SLIC_TYPE_RESERVED             = 2    /* 2 and greater are reserved */
+};
+
+

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

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 20:54:59 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 75043106566C;
	Wed, 16 Mar 2011 20:54:59 +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 4D9C38FC19;
	Wed, 16 Mar 2011 20:54: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 p2GKsxGJ004233;
	Wed, 16 Mar 2011 20:54:59 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GKsxO9004232;
	Wed, 16 Mar 2011 20:54:59 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103162054.p2GKsxO9004232@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 16 Mar 2011 20:54:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor-sys
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219705 - vendor-sys/acpica/20110316
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 20:54:59 -0000

Author: jkim
Date: Wed Mar 16 20:54:58 2011
New Revision: 219705
URL: http://svn.freebsd.org/changeset/base/219705

Log:
  Tag ACPICA 20110316.

Added:
  vendor-sys/acpica/20110316/
     - copied from r219704, vendor-sys/acpica/dist/

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 21:17:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A46771065678;
	Wed, 16 Mar 2011 21:17:06 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 032CD8FC12;
	Wed, 16 Mar 2011 21:17:05 +0000 (UTC)
Received: by qwc9 with SMTP id 9so1798877qwc.13
	for ; Wed, 16 Mar 2011 14:17:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:from
	:date:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	bh=8ObtEB/tJC+jVpUZBRfgCFGfIkSkCfKm7Dm9Nspa7pY=;
	b=ExgSRI6he3NzRZZjjqGsoa1WG63Dk8QHlrffao1cpxxffV7EGbDXQvOdbKmVcXil8P
	Pk83H+3r9073Ur9ZW9c2hqREr6dDsI0mdjuV2uQV9sRqCekbuWUEmu2vBhZMOe/iQ4pW
	mJS5ALKOxiRwEn41DonAS9emFBqaeMo7vao8c=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:from:date
	:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	b=N/vVnySoa956McimbOro+/N31DXg8xLPD+jriz3PSduAaeqntyjWup1GUDeEKAldFQ
	WBXQxzIk4WlTCet+u1JAbzmT96lfvXgwCPMZsCHmmo+ZC+Dtu0w67ngnl6Z82+vhAaBz
	NQY3tSLKgVxmYOn2kwJkwqOpwP0NpLObtci/0=
Received: by 10.229.111.225 with SMTP id t33mr502355qcp.61.1300310225198; Wed,
	16 Mar 2011 14:17:05 -0700 (PDT)
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.229.78.193 with HTTP; Wed, 16 Mar 2011 14:16:25 -0700 (PDT)
In-Reply-To: <20110316200346.GA36431@owl.midgard.homeip.net>
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<20110316004503.GM99496@mdounin.ru>
	<201103161233.16347.jkim@FreeBSD.org>
	<20110316174553.GA6367@freebsd.org>
	<20110316200346.GA36431@owl.midgard.homeip.net>
From: Ivan Voras 
Date: Wed, 16 Mar 2011 22:16:25 +0100
X-Google-Sender-Auth: 0wGzA8if-fNMdJzKlngu8gqs2CQ
Message-ID: 
To: Erik Trulsson 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, Roman Divacky ,
	src-committers@freebsd.org, svn-src-all@freebsd.org,
	Jung-uk Kim 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 21:17:06 -0000

On 16 March 2011 21:03, Erik Trulsson  wrote:
> On Wed, Mar 16, 2011 at 06:45:53PM +0100, Roman Divacky wrote:
>> On Wed, Mar 16, 2011 at 12:32:56PM -0400, Jung-uk Kim wrote:
>> > On Tuesday 15 March 2011 08:45 pm, Maxim Dounin wrote:
>> > > This isn't really different as long as GENERIC kernel used, as
>> > > GENERIC defines I486_CPU.
>> >
>> > Fixed in r219698, sorry.
>> >
>> > Actually, I think we should remove i486 from GENERIC at some point.
>> > It has too many limitations. =C2=A0For example, I really love to imple=
ment
>> > atomic 64-bit mem read/write using cmpxchg8b (no 0xf00f joke, please)
>> > but I cannot do that cleanly without removing I486 support or
>> > checking cpu_class at run-time. :-(
>>
>> if we drop i486 I think it makes sense to require something that has
>> at least SSE2, thus we can have the same expectations as on amd64.
>
> No, that would remove support from far too many machines that people
> actually use to run FreeBSD.

> There are probably only a handful of people (if that) who actually run
> FreeBSD on an actual 486-class machine, but requiring SSE2 would mean
> dropping support for Pentium-III and Athlon-XP equipped machines and
> I believe there are a large number of such machines still in use, and
> they are still perfectly suitable for a large number of tasks.

This is understandable but I also think it deserves a poll at stable@
and current@. It might be worth keeping i486 for all of 9-stable but
removing it before 10-stable. Judging from previous releases, 9.x
would be supported until at least 2016. I don't follow the embedded
world that much, but from what I saw, most (incl. Soekris) are moving
to Atom designs which support SSE2.

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 22:51:35 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 37898106564A;
	Wed, 16 Mar 2011 22:51:35 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2825D8FC17;
	Wed, 16 Mar 2011 22:51: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 p2GMpZv5006742;
	Wed, 16 Mar 2011 22:51:35 GMT
	(envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2GMpZWY006737;
	Wed, 16 Mar 2011 22:51:35 GMT
	(envelope-from jmallett@svn.freebsd.org)
Message-Id: <201103162251.p2GMpZWY006737@svn.freebsd.org>
From: Juli Mallett 
Date: Wed, 16 Mar 2011 22:51:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219706 - in head/sys/mips/cavium: . octe
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 22:51:35 -0000

Author: jmallett
Date: Wed Mar 16 22:51:34 2011
New Revision: 219706
URL: http://svn.freebsd.org/changeset/base/219706

Log:
  o) Set MAC addresses starting at the MAC base for all management ports, not
     just the MR-730.
  o) Start MAC addresses for the non-management ports after the management ports.
  
  Submitted by:	Bhanu Prakash (with modifications)

Modified:
  head/sys/mips/cavium/if_octm.c
  head/sys/mips/cavium/octe/ethernet-common.c
  head/sys/mips/cavium/octe/ethernet-common.h
  head/sys/mips/cavium/octe/ethernet.c

Modified: head/sys/mips/cavium/if_octm.c
==============================================================================
--- head/sys/mips/cavium/if_octm.c	Wed Mar 16 20:54:58 2011	(r219705)
+++ head/sys/mips/cavium/if_octm.c	Wed Mar 16 22:51:34 2011	(r219706)
@@ -175,28 +175,13 @@ octm_attach(device_t dev)
 		return (ENXIO);
 	}
 
-	switch (cvmx_sysinfo_get()->board_type) {
-#if defined(OCTEON_VENDOR_LANNER)
-	case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
-		/*
-		 * The MR-730 uses its first two MACs for the management
-		 * ports.
-		 */
-		mac = 0;
-		memcpy((u_int8_t *)&mac + 2, octeon_bootinfo->mac_addr_base,
-		       6);
-		mac += sc->sc_port;
-		cvmx_mgmt_port_set_mac(sc->sc_port, mac);
-		break;
-#endif
-	default:
-		mac = cvmx_mgmt_port_get_mac(sc->sc_port);
-		if (mac == CVMX_MGMT_PORT_GET_MAC_ERROR) {
-			device_printf(dev, "unable to read MAC.\n");
-			return (ENXIO);
-		}
-		break;
-	}
+	/*
+	 * Set MAC address for this management port.
+	 */
+	mac = 0;
+	memcpy((u_int8_t *)&mac + 2, octeon_bootinfo->mac_addr_base, 6);
+	mac += sc->sc_port;
+	cvmx_mgmt_port_set_mac(sc->sc_port, mac);
 
 	/* No watermark for input ring.  */
 	mixx_irhwm.u64 = 0;

Modified: head/sys/mips/cavium/octe/ethernet-common.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet-common.c	Wed Mar 16 20:54:58 2011	(r219705)
+++ head/sys/mips/cavium/octe/ethernet-common.c	Wed Mar 16 22:51:34 2011	(r219706)
@@ -269,34 +269,19 @@ void cvm_oct_common_poll(struct ifnet *i
  */
 int cvm_oct_common_init(struct ifnet *ifp)
 {
-	static int count;
 	char mac[6] = {
 		octeon_bootinfo->mac_addr_base[0],
 		octeon_bootinfo->mac_addr_base[1],
 		octeon_bootinfo->mac_addr_base[2],
 		octeon_bootinfo->mac_addr_base[3],
 		octeon_bootinfo->mac_addr_base[4],
-		octeon_bootinfo->mac_addr_base[5] + count};
+		octeon_bootinfo->mac_addr_base[5] };
 	cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
 
-	switch (cvmx_sysinfo_get()->board_type) {
-#if defined(OCTEON_VENDOR_LANNER)
-	case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
-		/*
-		 * The MR-730 uses its first two MACs for the management
-		 * ports.
-		 */
-		mac[5] += 2;
-		break;
-#endif
-	default:
-		break;
-	}
+	mac[5] += cvm_oct_mac_addr_offset++;
 
 	ifp->if_mtu = ETHERMTU;
 
-	count++;
-
 	cvm_oct_mdio_setup_device(ifp);
 
 	cvm_oct_common_set_mac_address(ifp, mac);

Modified: head/sys/mips/cavium/octe/ethernet-common.h
==============================================================================
--- head/sys/mips/cavium/octe/ethernet-common.h	Wed Mar 16 20:54:58 2011	(r219705)
+++ head/sys/mips/cavium/octe/ethernet-common.h	Wed Mar 16 22:51:34 2011	(r219706)
@@ -51,3 +51,5 @@ int cvm_oct_sgmii_init(struct ifnet *ifp
 int cvm_oct_spi_init(struct ifnet *ifp);
 void cvm_oct_spi_uninit(struct ifnet *ifp);
 int cvm_oct_xaui_init(struct ifnet *ifp);
+
+extern unsigned int cvm_oct_mac_addr_offset;

Modified: head/sys/mips/cavium/octe/ethernet.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet.c	Wed Mar 16 20:54:58 2011	(r219705)
+++ head/sys/mips/cavium/octe/ethernet.c	Wed Mar 16 22:51:34 2011	(r219706)
@@ -103,6 +103,15 @@ static struct taskqueue *cvm_oct_link_ta
  */
 static int cvm_oct_num_output_buffers;
 
+/*
+ * The offset from mac_addr_base that should be used for the next port
+ * that is configured.  By convention, if any mgmt ports exist on the
+ * chip, they get the first mac addresses.  The ports controlled by
+ * this driver are numbered sequencially following any mgmt addresses
+ * that may exist.
+ */
+unsigned int cvm_oct_mac_addr_offset;
+
 /**
  * Function to update link status.
  */
@@ -318,6 +327,20 @@ int cvm_oct_init_module(device_t bus)
 
 	printf("cavium-ethernet: %s\n", OCTEON_SDK_VERSION_STRING);
 
+	/*
+	 * MAC addresses for this driver start after the management
+	 * ports.
+	 *
+	 * XXX Would be nice if __cvmx_mgmt_port_num_ports() were
+	 *     not static to cvmx-mgmt-port.c.
+	 */
+	if (OCTEON_IS_MODEL(OCTEON_CN56XX))
+		cvm_oct_mac_addr_offset = 1;
+	else if (OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN63XX))
+		cvm_oct_mac_addr_offset = 2;
+	else
+		cvm_oct_mac_addr_offset = 0;
+
 	cvm_oct_rx_initialize();
 	cvm_oct_configure_common_hw(bus);
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 23:41:46 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 36CBE106564A;
	Wed, 16 Mar 2011 23:41:46 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com
	[209.85.161.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 425ED8FC16;
	Wed, 16 Mar 2011 23:41:44 +0000 (UTC)
Received: by fxm11 with SMTP id 11so2540669fxm.13
	for ; Wed, 16 Mar 2011 16:41:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:sender:message-id:date:from:user-agent
	:mime-version:to:cc:subject:references:in-reply-to:content-type
	:content-transfer-encoding;
	bh=RxxZ/xQMU/uXNAH660EalUox7NIWDc/wtiGYkYrO7J4=;
	b=wuhqt1WmWLWF0Jh2/sYlKr6BjigZC7LSLqPKAjRGksLWjyXPubmMw6n0uqW5LzecUF
	UuUN4qpzYceD6aVToJljfKx7vvsv4UTcrFQ/y4VhU4ehfoLY0590ezIsfv31fbkjCRlv
	xmJtyWLFHF9OYLpCYGESsegay9eJFhmwHPdpA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	b=r8qItLS6Fss+aD0ZVmrTcqSNZw9qRUNhqsc621FQYml6qMhCF3p6qMowcZZLqdtnk0
	E51iYtLrBt/3GPlejHIFr9U6tafeoiw38mTscIXiqbuH01Ggi/uiqZVrtLrp8utdhXVT
	03Ni0s56CG7eucNS6eFxm13wY4qWEY9tIgs8o=
Received: by 10.223.14.207 with SMTP id h15mr677933faa.50.1300318903975;
	Wed, 16 Mar 2011 16:41:43 -0700 (PDT)
Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226])
	by mx.google.com with ESMTPS id 21sm675571fav.17.2011.03.16.16.41.42
	(version=SSLv3 cipher=OTHER); Wed, 16 Mar 2011 16:41:43 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4D814AAA.3070801@FreeBSD.org>
Date: Thu, 17 Mar 2011 01:41:30 +0200
From: Alexander Motin 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9
MIME-Version: 1.0
To: Bob Willcox 
References: <201102052134.p15LYRmw041695@svn.freebsd.org>
	<20110316135122.GB7185@rancor.immure.com>
In-Reply-To: <20110316135122.GB7185@rancor.immure.com>
Content-Type: text/plain; charset=KOI8-R; format=flowed
Content-Transfer-Encoding: 7bit
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: r218347 - stable/8/sys/dev/ata/chipsets
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 23:41:46 -0000

On 16.03.2011 15:51, Bob Willcox wrote:
> This change has broken SATA disk support on my Intel Atom D525 ITX system. By
> reverting this change 8.2-STABLE works again on this system.
>
> My 'uname -a' output is:
>
> FreeBSD maul.immure.com 8.2-STABLE FreeBSD 8.2-STABLE #6: Wed Mar 16 08:15:43 CDT 2011     bob@maul.immure.com:/usr/obj/usr/src/sys/MAUL  amd64
>
> When booting the system I get tons of these messages:
>
> Mar 16 07:38:19 maul kernel: ad4: WARNING - SETFEATURES ENABLE RCACHE requeued due to channel reset
> Mar 16 07:38:19 maul kernel: ad4: interrupt on idle channel ignored

As I can see, it means that channel has some active request, but it is 
in IDLE state. It is strange, but I won't be surprised much if it is the 
result of some locking problem in ata(4) in non-CAM mode.

> repeated over and over, and then lots of these:
>
> Mar 16 07:38:21 maul kernel: ad4: WARNING - READ_DMA48 requeued due to channel reset LBA=617964479
> Mar 16 07:38:21 maul kernel: ata2: FAILURE - already active DMA on this device
> Mar 16 07:38:21 maul kernel: ata2: setting up DMA failed
>
> for different LBA values.
>
> As one might expect, I then start seeing I/O errors on the disk and programs
> failing
>
> I've attached the 'pciconf -lv' output.

Send me please full verbose log, if you can save it. I am especially 
interested in place around first errors.

You may try to build kernel with `options ATA_CAM` to see if it helps. 
I've mostly tested this patch in that mode.

> On Sat, Feb 05, 2011 at 09:34:27PM +0000, Alexander Motin wrote:
>> Author: mav
>> Date: Sat Feb  5 21:34:26 2011
>> New Revision: 218347
>> URL: http://svn.freebsd.org/changeset/base/218347
>>
>> Log:
>>    MFC r217774:
>>    ICH7 SATA controller in legacy mode can provide access to SATA registers
>>    via AHCI-like memory resource at BAR(5). Use it if BIOS was so kind to
>>    allocate memory for that BAR. This allows hot-plug support and connection
>>    speed reporting.

-- 
Alexander Motin

From owner-svn-src-all@FreeBSD.ORG  Wed Mar 16 23:49:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E0A67106564A;
	Wed, 16 Mar 2011 23:49:52 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com
	[209.85.161.54])
	by mx1.freebsd.org (Postfix) with ESMTP id F017D8FC12;
	Wed, 16 Mar 2011 23:49:51 +0000 (UTC)
Received: by fxm11 with SMTP id 11so2545894fxm.13
	for ; Wed, 16 Mar 2011 16:49:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:sender:message-id:date:from:user-agent
	:mime-version:to:cc:subject:references:in-reply-to:content-type
	:content-transfer-encoding;
	bh=nOyUqGcmKmiyr+2hGiGjyIUU3ab0/HfJxdSgGcg/ZHY=;
	b=JvHYGvV8XeEUvFpi3JgsrF+oB1f44chjKtOW/H8Ei4Z8wIxsqjyC97pe2cNIwNXwJ5
	w72C+rb4/iYwUUmET+r0sbkU8V2XznCoaZT1vB4iKpJlt6MyRb4IbV+UVFhrIRlSz8ek
	p0sw6Xm6Dxq9Gpc8hS5OJ6zeTvezRIeYySpeQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	b=jKDnVqIzF6DINvgCoBMSXFrAxk9ZcsNTltjuhYwcrYAVFi+TKkfc0gmlWdCVDqqX2M
	lmnappH+8HK5pWwhguDgnG4VoFY/xi+nNJfgwSnv8CNNTQ4xX4nVSc/UBuJgjdAqYI7/
	9Vb5e/+zjWjpYhkiELt0gfmomizcOmyASaDIM=
Received: by 10.223.27.129 with SMTP id i1mr380443fac.24.1300319389949;
	Wed, 16 Mar 2011 16:49:49 -0700 (PDT)
Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226])
	by mx.google.com with ESMTPS id l2sm81548fam.5.2011.03.16.16.49.48
	(version=SSLv3 cipher=OTHER); Wed, 16 Mar 2011 16:49:49 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4D814C90.5090304@FreeBSD.org>
Date: Thu, 17 Mar 2011 01:49:36 +0200
From: Alexander Motin 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9
MIME-Version: 1.0
To: Bob Willcox 
References: <201102052134.p15LYRmw041695@svn.freebsd.org>
	<20110316135122.GB7185@rancor.immure.com>
	<4D814AAA.3070801@FreeBSD.org>
In-Reply-To: <4D814AAA.3070801@FreeBSD.org>
Content-Type: text/plain; charset=KOI8-R; format=flowed
Content-Transfer-Encoding: 7bit
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: r218347 - stable/8/sys/dev/ata/chipsets
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 16 Mar 2011 23:49:53 -0000

On 17.03.2011 01:41, Alexander Motin wrote:
> On 16.03.2011 15:51, Bob Willcox wrote:
>> This change has broken SATA disk support on my Intel Atom D525 ITX
>> system. By
>> reverting this change 8.2-STABLE works again on this system.
>>
>> My 'uname -a' output is:
>>
>> FreeBSD maul.immure.com 8.2-STABLE FreeBSD 8.2-STABLE #6: Wed Mar 16
>> 08:15:43 CDT 2011 bob@maul.immure.com:/usr/obj/usr/src/sys/MAUL amd64
>>
>> When booting the system I get tons of these messages:
>>
>> Mar 16 07:38:19 maul kernel: ad4: WARNING - SETFEATURES ENABLE RCACHE
>> requeued due to channel reset
>> Mar 16 07:38:19 maul kernel: ad4: interrupt on idle channel ignored
>
> As I can see, it means that channel has some active request, but it is
> in IDLE state. It is strange, but I won't be surprised much if it is the
> result of some locking problem in ata(4) in non-CAM mode.
>
>> repeated over and over, and then lots of these:
>>
>> Mar 16 07:38:21 maul kernel: ad4: WARNING - READ_DMA48 requeued due to
>> channel reset LBA=617964479
>> Mar 16 07:38:21 maul kernel: ata2: FAILURE - already active DMA on
>> this device
>> Mar 16 07:38:21 maul kernel: ata2: setting up DMA failed
>>
>> for different LBA values.
>>
>> As one might expect, I then start seeing I/O errors on the disk and
>> programs
>> failing
>>
>> I've attached the 'pciconf -lv' output.
>
> Send me please full verbose log, if you can save it. I am especially
> interested in place around first errors.
>
> You may try to build kernel with `options ATA_CAM` to see if it helps.
> I've mostly tested this patch in that mode.

PS: I think commenting "ch->flags |= ATA_PERIODIC_POLL;" lines in 
ata-intel.c should effectively neutralize this change and probably hide 
the problem back. As last resort.

>> On Sat, Feb 05, 2011 at 09:34:27PM +0000, Alexander Motin wrote:
>>> Author: mav
>>> Date: Sat Feb 5 21:34:26 2011
>>> New Revision: 218347
>>> URL: http://svn.freebsd.org/changeset/base/218347
>>>
>>> Log:
>>> MFC r217774:
>>> ICH7 SATA controller in legacy mode can provide access to SATA registers
>>> via AHCI-like memory resource at BAR(5). Use it if BIOS was so kind to
>>> allocate memory for that BAR. This allows hot-plug support and
>>> connection
>>> speed reporting.

-- 
Alexander Motin

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 00:29:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 864211065673;
	Thu, 17 Mar 2011 00:29:53 +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 744898FC13;
	Thu, 17 Mar 2011 00:29: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 p2H0TrXO008755;
	Thu, 17 Mar 2011 00:29:53 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2H0TrHr008738;
	Thu, 17 Mar 2011 00:29:53 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103170029.p2H0TrHr008738@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 17 Mar 2011 00:29:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219707 - in head/sys/contrib/dev/acpica: . common
	compiler events include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 00:29:53 -0000

Author: jkim
Date: Thu Mar 17 00:29:53 2011
New Revision: 219707
URL: http://svn.freebsd.org/changeset/base/219707

Log:
  Merge ACPICA 20110316.

Modified:
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/dmtable.c
  head/sys/contrib/dev/acpica/common/dmtbdump.c
  head/sys/contrib/dev/acpica/common/dmtbinfo.c
  head/sys/contrib/dev/acpica/compiler/aslcompiler.y
  head/sys/contrib/dev/acpica/compiler/dtcompiler.h
  head/sys/contrib/dev/acpica/compiler/dtio.c
  head/sys/contrib/dev/acpica/compiler/dttable.c
  head/sys/contrib/dev/acpica/compiler/dttemplate.h
  head/sys/contrib/dev/acpica/compiler/dtutils.c
  head/sys/contrib/dev/acpica/events/evmisc.c
  head/sys/contrib/dev/acpica/events/evxfgpe.c
  head/sys/contrib/dev/acpica/include/acdisasm.h
  head/sys/contrib/dev/acpica/include/acglobal.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/actbl2.h
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/contrib/dev/acpica/changes.txt
==============================================================================
--- head/sys/contrib/dev/acpica/changes.txt	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/changes.txt	Thu Mar 17 00:29:53 2011	(r219707)
@@ -1,7 +1,49 @@
 ----------------------------------------
-11 February 2011. Summary of changes for version 20110211:
+16 March 2011. Summary of changes for version 20110316:
+
+x
+1) ACPI CA Core Subsystem:
+
+Fixed a problem caused by a _PRW method appearing at the namespace root scope 
+during the setup of wake GPEs. A fault could occur if a _PRW directly under the 
+root object was passed to the AcpiSetupGpeForWake interface. Lin Ming.
+
+Implemented support for "spurious" Global Lock interrupts. On some systems, a 
+global lock interrupt can occur without the pending flag being set. Upon a GL 
+interrupt, we now ensure that a thread is actually waiting for the lock before 
+signaling GL availability. Rafael Wysocki, Bob Moore.
+
+Example Code and Data Size: These are the sizes for the OS-independent acpica.lib 
+produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of 
+the code includes the debug output trace mechanism and has a much larger code and 
+data size.
+
+  Previous Release (VC 9.0):
+    Non-Debug Version:  89.7K Code, 23.7K Data, 113.4K Total
+    Debug Version:     163.9K Code, 67.5K Data, 231.4K Total
+  Current Release (VC 9.0):
+    Non-Debug Version:  89.8K Code, 23.8K Data, 113.6K Total
+    Debug Version:     164.2K Code, 67.9K Data, 232.1K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+Implemented full support for the "SLIC" ACPI table. Includes support in the 
+header files, disassembler, table compiler, and template generator. Bob Moore, 
+Lin Ming.
 
-This release is available at www.acpica.org/downloads
+AcpiXtract: Correctly handle embedded comments and messages from AcpiDump. 
+Apparently some or all versions of acpidump will occasionally emit a comment like 
+"Wrong checksum", etc., into the dump file. This was causing problems for 
+AcpiXtract. ACPICA BZ 905.
+
+iASL: Fix the Linux makefile by removing an inadvertent double file inclusion. 
+ACPICA BZ 913.
+
+AcpiExec: Update installation of operation region handlers. Install one handler 
+for a user-defined address space. This is used by the ASL test suite (ASLTS).
+
+----------------------------------------
+11 February 2011. Summary of changes for version 20110211:
 
 1) ACPI CA Core Subsystem:
 

Modified: head/sys/contrib/dev/acpica/common/dmtable.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmtable.c	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/common/dmtable.c	Thu Mar 17 00:29:53 2011	(r219707)
@@ -192,6 +192,13 @@ static const char           *AcpiDmMadtS
     "Unknown SubTable Type"         /* Reserved */
 };
 
+static const char           *AcpiDmSlicSubnames[] =
+{
+    "Public Key Structure",
+    "Windows Marker Structure",
+    "Unknown SubTable Type"         /* Reserved */
+};
+
 static const char           *AcpiDmSratSubnames[] =
 {
     "Processor Local APIC/SAPIC Affinity",
@@ -270,7 +277,7 @@ ACPI_DMTABLE_DATA    AcpiDmTableData[] =
     {ACPI_SIG_MSCT, NULL,                   AcpiDmDumpMsct, DtCompileMsct,  TemplateMsct,   "Maximum System Characteristics Table"},
     {ACPI_SIG_RSDT, NULL,                   AcpiDmDumpRsdt, DtCompileRsdt,  TemplateRsdt,   "Root System Description Table"},
     {ACPI_SIG_SBST, AcpiDmTableInfoSbst,    NULL,           NULL,           TemplateSbst,   "Smart Battery Specification Table"},
-    {ACPI_SIG_SLIC, AcpiDmTableInfoSlic,    NULL,           NULL,           NULL,           "Software Licensing Description Table"},
+    {ACPI_SIG_SLIC, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateSlic,   "Software Licensing Description Table"},
     {ACPI_SIG_SLIT, NULL,                   AcpiDmDumpSlit, DtCompileSlit,  TemplateSlit,   "System Locality Information Table"},
     {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr,    NULL,           NULL,           TemplateSpcr,   "Serial Port Console Redirection table"},
     {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi,    NULL,           NULL,           TemplateSpmi,   "Server Platform Management Interface table"},
@@ -475,30 +482,34 @@ AcpiDmLineHeader (
     char                    *Name)
 {
 
+    /* Allow a null name for fields that span multiple lines (large buffers) */
+
+    if (!Name)
+    {
+        Name = "";
+    }
+
     if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
     {
         if (ByteLength)
         {
-            AcpiOsPrintf ("[%.3d] %34s : ",
-                ByteLength, Name);
+            AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);
         }
         else
         {
-            AcpiOsPrintf ("%40s : ",
-                Name);
+            AcpiOsPrintf ("%41s : ", Name);
         }
     }
     else /* Normal disassembler or verbose template */
     {
         if (ByteLength)
         {
-            AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ",
+            AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ",
                 Offset, Offset, ByteLength, Name);
         }
         else
         {
-            AcpiOsPrintf ("%43s : ",
-                Name);
+            AcpiOsPrintf ("%44s : ", Name);
         }
     }
 }
@@ -635,6 +646,7 @@ AcpiDmDumpTable (
         case ACPI_DMT_UINT32:
         case ACPI_DMT_NAME4:
         case ACPI_DMT_SIG:
+        case ACPI_DMT_SLIC:
             ByteLength = 4;
             break;
         case ACPI_DMT_NAME6:
@@ -652,6 +664,9 @@ AcpiDmDumpTable (
         case ACPI_DMT_UUID:
             ByteLength = 16;
             break;
+        case ACPI_DMT_BUF128:
+            ByteLength = 128;
+            break;
         case ACPI_DMT_STRING:
             ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
             break;
@@ -754,17 +769,26 @@ AcpiDmDumpTable (
 
         case ACPI_DMT_BUF7:
         case ACPI_DMT_BUF16:
+        case ACPI_DMT_BUF128:
 
             /*
              * Buffer: Size depends on the opcode and was set above.
              * Each hex byte is separated with a space.
              */
-            for (Temp8 = 0; Temp8 < ByteLength; Temp8++)
+            for (Temp16 = 0; Temp16 < ByteLength; Temp16++)
             {
-                AcpiOsPrintf ("%2.2X", Target[Temp8]);
-                if ((UINT32) (Temp8 + 1) < ByteLength)
+                AcpiOsPrintf ("%2.2X", Target[Temp16]);
+                if ((UINT32) (Temp16 + 1) < ByteLength)
                 {
-                    AcpiOsPrintf (" ");
+                    if ((Temp16 > 0) && (!((Temp16+1) % 16)))
+                    {
+                        AcpiOsPrintf ("\n");
+                        AcpiDmLineHeader (0, 0, NULL);
+                    }
+                    else
+                    {
+                        AcpiOsPrintf (" ");
+                    }
                 }
             }
             AcpiOsPrintf ("\n");
@@ -991,6 +1015,19 @@ AcpiDmDumpTable (
             AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmMadtSubnames[Temp8]);
             break;
 
+        case ACPI_DMT_SLIC:
+
+            /* SLIC subtable types */
+
+            Temp8 = *Target;
+            if (Temp8 > ACPI_SLIC_TYPE_RESERVED)
+            {
+                Temp8 = ACPI_SLIC_TYPE_RESERVED;
+            }
+
+            AcpiOsPrintf ("%8.8X <%s>\n", *Target, AcpiDmSlicSubnames[Temp8]);
+            break;
+
         case ACPI_DMT_SRAT:
 
             /* SRAT subtable types */

Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmtbdump.c	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/common/dmtbdump.c	Thu Mar 17 00:29:53 2011	(r219707)
@@ -1275,6 +1275,81 @@ AcpiDmDumpMsct (
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiDmDumpSlic
+ *
+ * PARAMETERS:  Table               - A SLIC table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a SLIC
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpSlic (
+    ACPI_TABLE_HEADER       *Table)
+{
+    ACPI_STATUS             Status;
+    UINT32                  Offset = sizeof (ACPI_TABLE_SLIC);
+    ACPI_SLIC_HEADER        *SubTable;
+    ACPI_DMTABLE_INFO       *InfoTable;
+
+
+    /* There is no main SLIC table, only subtables */
+
+    SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
+    while (Offset < Table->Length)
+    {
+        /* Common sub-table header */
+
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+                    SubTable->Length, AcpiDmTableInfoSlicHdr);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        switch (SubTable->Type)
+        {
+        case ACPI_SLIC_TYPE_PUBLIC_KEY:
+            InfoTable = AcpiDmTableInfoSlic0;
+            break;
+        case ACPI_SLIC_TYPE_WINDOWS_MARKER:
+            InfoTable = AcpiDmTableInfoSlic1;
+            break;
+        default:
+            AcpiOsPrintf ("\n**** Unknown SLIC sub-table type 0x%X\n", SubTable->Type);
+
+            /* Attempt to continue */
+
+            if (!SubTable->Length)
+            {
+                AcpiOsPrintf ("Invalid zero length subtable\n");
+                return;
+            }
+            goto NextSubTable;
+        }
+
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+                    SubTable->Length, InfoTable);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+NextSubTable:
+        /* Point to next sub-table */
+
+        Offset += SubTable->Length;
+        SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
+    }
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiDmDumpSlit
  *
  * PARAMETERS:  Table               - An SLIT

Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmtbinfo.c	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/common/dmtbinfo.c	Thu Mar 17 00:29:53 2011	(r219707)
@@ -51,6 +51,31 @@
         ACPI_MODULE_NAME    ("dmtbinfo")
 
 /*
+ * How to add a new table:
+ *
+ * - Add the C table definition to the actbl1.h or actbl2.h header.
+ * - Add ACPI_xxxx_OFFSET macro(s) for the table (and subtables) to list below.
+ * - Define the table in this file (for the disassembler). If any
+ *   new data types are required (ACPI_DMT_*), see below.
+ * - Add an external declaration for the new table definition (AcpiDmTableInfo*)
+ *     in acdisam.h
+ * - Add new table definition to the dispatch table in dmtable.c (AcpiDmTableData)
+ *     If a simple table (with no subtables), no disassembly code is needed.
+ *     Otherwise, create the AcpiDmDump* function for to disassemble the table
+ *     and add it to the dmtbdump.c file.
+ * - Add an external declaration for the new AcpiDmDump* function in acdisasm.h
+ * - Add the new AcpiDmDump* function to the dispatch table in dmtable.c
+ * - Create a template for the new table
+ * - Add data table compiler support
+ *
+ * How to add a new data type (ACPI_DMT_*):
+ *
+ * - Add new type at the end of the ACPI_DMT list in acdisasm.h
+ * - Add length and implementation cases in dmtable.c  (disassembler)
+ * - Add type and length cases in dtutils.c (DT compiler)
+ */
+
+/*
  * Macros used to generate offsets to specific table fields
  */
 #define ACPI_FACS_OFFSET(f)             (UINT8) ACPI_OFFSET (ACPI_TABLE_FACS,f)
@@ -131,6 +156,9 @@
 #define ACPI_MADTH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
 #define ACPI_MCFG0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
 #define ACPI_MSCT0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
+#define ACPI_SLICH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SLIC_HEADER,f)
+#define ACPI_SLIC0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SLIC_KEY,f)
+#define ACPI_SLIC1_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SLIC_MARKER,f)
 #define ACPI_SRATH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
 #define ACPI_SRAT0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
 #define ACPI_SRAT1_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
@@ -1256,13 +1284,42 @@ ACPI_DMTABLE_INFO           AcpiDmTableI
 
 /*******************************************************************************
  *
- * SLIC - Software Licensing Description Table. NOT FULLY IMPLEMENTED, do not
- * have the table definition.
+ * SLIC - Software Licensing Description Table. There is no common table, just
+ * the standard ACPI header and then subtables.
  *
  ******************************************************************************/
 
-ACPI_DMTABLE_INFO           AcpiDmTableInfoSlic[] =
+/* Common Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoSlicHdr[] =
+{
+    {ACPI_DMT_SLIC,     ACPI_SLICH_OFFSET (Type),                   "Subtable Type", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLICH_OFFSET (Length),                 "Length", DT_LENGTH},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoSlic0[] =
+{
+    {ACPI_DMT_UINT8,    ACPI_SLIC0_OFFSET (KeyType),                "Key Type", 0},
+    {ACPI_DMT_UINT8,    ACPI_SLIC0_OFFSET (Version),                "Version", 0},
+    {ACPI_DMT_UINT16,   ACPI_SLIC0_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC0_OFFSET (Algorithm),              "Algorithm", 0},
+    {ACPI_DMT_NAME4,    ACPI_SLIC0_OFFSET (Magic),                  "Magic", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC0_OFFSET (BitLength),              "BitLength", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC0_OFFSET (Exponent),               "Exponent", 0},
+    {ACPI_DMT_BUF128,   ACPI_SLIC0_OFFSET (Modulus[0]),             "Modulus", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoSlic1[] =
 {
+    {ACPI_DMT_UINT32,   ACPI_SLIC1_OFFSET (Version),                "Version", 0},
+    {ACPI_DMT_NAME6,    ACPI_SLIC1_OFFSET (OemId[0]),               "Oem ID", 0},
+    {ACPI_DMT_NAME8,    ACPI_SLIC1_OFFSET (OemTableId[0]),          "Oem Table ID", 0},
+    {ACPI_DMT_NAME8,    ACPI_SLIC1_OFFSET (WindowsFlag[0]),         "Windows Flag", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC1_OFFSET (SlicVersion),            "SLIC Version", 0},
+    {ACPI_DMT_BUF16,    ACPI_SLIC1_OFFSET (Reserved[0]),            "Reserved", 0},
+    {ACPI_DMT_BUF128,   ACPI_SLIC1_OFFSET (Signature[0]),           "Signature", 0},
     ACPI_DMT_TERMINATOR
 };
 

Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.y
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslcompiler.y	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/compiler/aslcompiler.y	Thu Mar 17 00:29:53 2011	(r219707)
@@ -728,6 +728,21 @@ ASLCode
     | error                         {YYABORT; $$ = NULL;}
     ;
 
+/*
+ * Note concerning support for "module-level code".
+ *
+ * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control
+ * methods (the so-called module-level code.) This support was explicitly
+ * removed in ACPI 2.0, but this type of code continues to be created by
+ * BIOS vendors. In order to support the disassembly and recompilation of
+ * such code (and the porting of ASL code to iASL), iASL supports this
+ * code in violation of the current ACPI specification.
+ *
+ * The grammar change to support module-level code is to revert the
+ * {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the
+ * original use of {TermList} instead (see below.) This allows the use
+ * of Type1 and Type2 opcodes at module level.
+ */
 DefinitionBlockTerm
     : PARSEOP_DEFINITIONBLOCK '('	{$$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);}
         String ','

Modified: head/sys/contrib/dev/acpica/compiler/dtcompiler.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/dtcompiler.h	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/compiler/dtcompiler.h	Thu Mar 17 00:29:53 2011	(r219707)
@@ -394,6 +394,10 @@ DtCompileRsdt (
     void                    **PFieldList);
 
 ACPI_STATUS
+DtCompileSlic (
+    void                    **PFieldList);
+
+ACPI_STATUS
 DtCompileSlit (
     void                    **PFieldList);
 

Modified: head/sys/contrib/dev/acpica/compiler/dtio.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/dtio.c	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/compiler/dtio.c	Thu Mar 17 00:29:53 2011	(r219707)
@@ -60,6 +60,10 @@ static void
 DtLinkField (
     DT_FIELD                *Field);
 
+static void
+DtMergeField (
+    char                    *Value);
+
 static ACPI_STATUS
 DtParseLine (
     char                    *LineBuffer,
@@ -222,6 +226,56 @@ DtLinkField (
 
 /******************************************************************************
  *
+ * FUNCTION:    DtMergeField
+ *
+ * PARAMETERS:  Value               - Merge this line into previous one
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Merge a field value to the previous one,
+ *              probably for a multi-line buffer definition.
+ *
+ *****************************************************************************/
+
+static void
+DtMergeField (
+    char                    *Value)
+{
+    DT_FIELD                *Prev;
+    DT_FIELD                *Next;
+    char                    *NewValue;
+    UINT32                  PrevLength;
+    UINT32                  ThisLength;
+
+
+    Prev = Next = Gbl_FieldList;
+
+    while (Next)
+    {
+        Prev = Next;
+        Next = Next->Next;
+    }
+
+    if (Prev)
+    {
+        PrevLength = ACPI_STRLEN (Prev->Value);
+        ThisLength = ACPI_STRLEN (Value);
+
+        /* Add two for: separator + NULL terminator */
+
+        NewValue = UtLocalCalloc (PrevLength + ThisLength + 2);
+        ACPI_STRNCPY (NewValue, Prev->Value, PrevLength);
+        NewValue[PrevLength] = ' ';
+
+        ACPI_STRNCPY ((NewValue + PrevLength + 1), Value, ThisLength);
+        ACPI_FREE (Prev->Value);
+        Prev->Value = NewValue;
+    }
+}
+
+
+/******************************************************************************
+ *
  * FUNCTION:    DtParseLine
  *
  * PARAMETERS:  LineBuffer          - Current source code line
@@ -354,11 +408,12 @@ DtParseLine (
 
     Length = ACPI_PTR_DIFF (End, Start);
     TmpValue = UtLocalCalloc (Length + 1);
+
     ACPI_STRNCPY (TmpValue, Start, Length);
     Value = DtTrim (TmpValue);
     ACPI_FREE (TmpValue);
 
-    if (Name && Value)
+    if (ACPI_STRLEN (Name) && Value)
     {
         Field = UtLocalCalloc (sizeof (DT_FIELD));
         Field->Name = Name;
@@ -370,6 +425,17 @@ DtParseLine (
 
         DtLinkField (Field);
     }
+    else if (!ACPI_STRLEN (Name))
+    {
+        /* Handle multi-line buffers (length > 16) */
+
+        DtMergeField (Value);
+    }
+    else
+    {
+        ACPI_FREE (Name);
+        ACPI_FREE (Value);
+    }
 
     return (AE_OK);
 }

Modified: head/sys/contrib/dev/acpica/compiler/dttable.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/dttable.c	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/compiler/dttable.c	Thu Mar 17 00:29:53 2011	(r219707)
@@ -1134,6 +1134,75 @@ DtCompileRsdt (
 
 /******************************************************************************
  *
+ * FUNCTION:    DtCompileSlic
+ *
+ * PARAMETERS:  List                - Current field list pointer
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Compile SLIC.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileSlic (
+    void                    **List)
+{
+    ACPI_STATUS             Status;
+    DT_SUBTABLE             *Subtable;
+    DT_SUBTABLE             *ParentTable;
+    DT_FIELD                **PFieldList = (DT_FIELD **) List;
+    DT_FIELD                *SubtableStart;
+    ACPI_SLIC_HEADER        *SlicHeader;
+    ACPI_DMTABLE_INFO       *InfoTable;
+
+
+    while (*PFieldList)
+    {
+        SubtableStart = *PFieldList;
+        Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlicHdr,
+                    &Subtable, TRUE);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Status);
+        }
+
+        ParentTable = DtPeekSubtable ();
+        DtInsertSubtable (ParentTable, Subtable);
+        DtPushSubtable (Subtable);
+
+        SlicHeader = ACPI_CAST_PTR (ACPI_SLIC_HEADER, Subtable->Buffer);
+
+        switch (SlicHeader->Type)
+        {
+        case ACPI_SLIC_TYPE_PUBLIC_KEY:
+            InfoTable = AcpiDmTableInfoSlic0;
+            break;
+        case ACPI_SLIC_TYPE_WINDOWS_MARKER:
+            InfoTable = AcpiDmTableInfoSlic1;
+            break;
+        default:
+            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SLIC");
+            return (AE_ERROR);
+        }
+
+        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Status);
+        }
+
+        ParentTable = DtPeekSubtable ();
+        DtInsertSubtable (ParentTable, Subtable);
+        DtPopSubtable ();
+    }
+
+    return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
  * FUNCTION:    DtCompileSlit
  *
  * PARAMETERS:  List                - Current field list pointer

Modified: head/sys/contrib/dev/acpica/compiler/dttemplate.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/dttemplate.h	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/compiler/dttemplate.h	Thu Mar 17 00:29:53 2011	(r219707)
@@ -534,6 +534,57 @@ const unsigned char TemplateSbst[] =
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00   /* 00000028    "........" */
 };
 
+const unsigned char TemplateSlic[] =
+{
+    0x53,0x4C,0x49,0x43,0x76,0x01,0x00,0x00,  /* 00000000    "SLICv..." */
+    0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
+    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
+    0x11,0x02,0x11,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "... ...." */
+    0x9C,0x00,0x00,0x00,0x06,0x02,0x00,0x00,  /* 00000028    "........" */
+    0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x31,  /* 00000030    ".$..RSA1" */
+    0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000048    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000050    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000060    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000068    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000070    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000078    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000080    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000088    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000090    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000098    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000A0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000A8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000B0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000B8    "........" */
+    0x01,0x00,0x00,0x00,0xB6,0x00,0x00,0x00,  /* 000000C0    "........" */
+    0x00,0x00,0x02,0x00,0x49,0x4E,0x54,0x45,  /* 000000C8    "....INTE" */
+    0x4C,0x20,0x54,0x45,0x4D,0x50,0x4C,0x41,  /* 000000D0    "L TEMPLA" */
+    0x54,0x45,0x57,0x49,0x4E,0x44,0x4F,0x57,  /* 000000D8    "TEWINDOW" */
+    0x53,0x20,0x01,0x00,0x02,0x00,0x00,0x00,  /* 000000E0    "S ......" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000100    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000108    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000110    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000118    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000120    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000128    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000130    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000138    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000140    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000148    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000150    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000158    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000160    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000168    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00             /* 00000170    "......"   */
+};
+
 const unsigned char TemplateSlit[] =
 {
     0x53,0x4C,0x49,0x54,0x3C,0x00,0x00,0x00,  /* 00000000    "SLIT<..." */

Modified: head/sys/contrib/dev/acpica/compiler/dtutils.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/dtutils.c	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/compiler/dtutils.c	Thu Mar 17 00:29:53 2011	(r219707)
@@ -401,6 +401,7 @@ DtGetFieldType (
     case ACPI_DMT_BUFFER:
     case ACPI_DMT_BUF7:
     case ACPI_DMT_BUF16:
+    case ACPI_DMT_BUF128:
     case ACPI_DMT_PCI_PATH:
         Type = DT_FIELD_TYPE_BUFFER;
         break;
@@ -546,6 +547,7 @@ DtGetFieldLength (
 
     case ACPI_DMT_UINT32:
     case ACPI_DMT_NAME4:
+    case ACPI_DMT_SLIC:
     case ACPI_DMT_SIG:
         ByteLength = 4;
         break;
@@ -605,6 +607,10 @@ DtGetFieldLength (
         ByteLength = 16;
         break;
 
+    case ACPI_DMT_BUF128:
+        ByteLength = 128;
+        break;
+
     case ACPI_DMT_UNICODE:
         Value = DtGetFieldValue (Field, Info->Name);
 

Modified: head/sys/contrib/dev/acpica/events/evmisc.c
==============================================================================
--- head/sys/contrib/dev/acpica/events/evmisc.c	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/events/evmisc.c	Thu Mar 17 00:29:53 2011	(r219707)
@@ -309,12 +309,8 @@ AcpiEvNotifyDispatch (
  * RETURN:      ACPI_INTERRUPT_HANDLED
  *
  * DESCRIPTION: Invoked directly from the SCI handler when a global lock
- *              release interrupt occurs. Attempt to acquire the global lock,
- *              if successful, signal the thread waiting for the lock.
- *
- * NOTE: Assumes that the semaphore can be signaled from interrupt level. If
- * this is not possible for some reason, a separate thread will have to be
- * scheduled to do this.
+ *              release interrupt occurs. If there is actually a pending
+ *              request for the lock, signal the waiting thread.
  *
  ******************************************************************************/
 
@@ -322,32 +318,38 @@ static UINT32
 AcpiEvGlobalLockHandler (
     void                    *Context)
 {
-    BOOLEAN                 Acquired = FALSE;
     ACPI_STATUS             Status;
+    ACPI_CPU_FLAGS          Flags;
+
 
+    Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
 
     /*
-     * Attempt to get the lock.
-     *
-     * If we don't get it now, it will be marked pending and we will
-     * take another interrupt when it becomes free.
+     * If a request for the global lock is not actually pending,
+     * we are done. This handles "spurious" global lock interrupts
+     * which are possible (and have been seen) with bad BIOSs.
      */
-    ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
-    if (Acquired)
+    if (!AcpiGbl_GlobalLockPending)
     {
-        /* Got the lock, now wake the thread waiting for it */
+        goto CleanupAndExit;
+    }
 
-        AcpiGbl_GlobalLockAcquired = TRUE;
+    /*
+     * Send a unit to the global lock semaphore. The actual acquisition
+     * of the global lock will be performed by the waiting thread.
+     */
+    Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
+    if (ACPI_FAILURE (Status))
+    {
+        ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
+    }
 
-        /* Send a unit to the semaphore */
+    AcpiGbl_GlobalLockPending = FALSE;
 
-        Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
-        if (ACPI_FAILURE (Status))
-        {
-            ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
-        }
-    }
 
+CleanupAndExit:
+
+    AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
     return (ACPI_INTERRUPT_HANDLED);
 }
 
@@ -385,15 +387,22 @@ AcpiEvInitGlobalLockHandler (
      * Map to AE_OK, but mark global lock as not present. Any attempt to
      * actually use the global lock will be flagged with an error.
      */
+    AcpiGbl_GlobalLockPresent = FALSE;
     if (Status == AE_NO_HARDWARE_RESPONSE)
     {
         ACPI_ERROR ((AE_INFO,
             "No response from Global Lock hardware, disabling lock"));
 
-        AcpiGbl_GlobalLockPresent = FALSE;
         return_ACPI_STATUS (AE_OK);
     }
 
+    Status = AcpiOsCreateLock (&AcpiGbl_GlobalLockPendingLock);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
+
+    AcpiGbl_GlobalLockPending = FALSE;
     AcpiGbl_GlobalLockPresent = TRUE;
     return_ACPI_STATUS (Status);
 }
@@ -454,7 +463,8 @@ ACPI_STATUS
 AcpiEvAcquireGlobalLock (
     UINT16                  Timeout)
 {
-    ACPI_STATUS             Status = AE_OK;
+    ACPI_CPU_FLAGS          Flags;
+    ACPI_STATUS             Status;
     BOOLEAN                 Acquired = FALSE;
 
 
@@ -487,8 +497,8 @@ AcpiEvAcquireGlobalLock (
     }
 
     /*
-     * Make sure that a global lock actually exists. If not, just treat the
-     * lock as a standard mutex.
+     * Make sure that a global lock actually exists. If not, just
+     * treat the lock as a standard mutex.
      */
     if (!AcpiGbl_GlobalLockPresent)
     {
@@ -496,31 +506,45 @@ AcpiEvAcquireGlobalLock (
         return_ACPI_STATUS (AE_OK);
     }
 
-    /* Attempt to acquire the actual hardware lock */
+    Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
 
-    ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
-    if (Acquired)
+    do
     {
-       /* We got the lock */
+        /* Attempt to acquire the actual hardware lock */
 
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Acquired hardware Global Lock\n"));
+        ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
+        if (Acquired)
+        {
+            AcpiGbl_GlobalLockAcquired = TRUE;
+            ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+                "Acquired hardware Global Lock\n"));
+            break;
+        }
 
-        AcpiGbl_GlobalLockAcquired = TRUE;
-        return_ACPI_STATUS (AE_OK);
-    }
+        /*
+         * Did not get the lock. The pending bit was set above, and
+         * we must now wait until we receive the global lock
+         * released interrupt.
+         */
+        AcpiGbl_GlobalLockPending = TRUE;
+        AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
 
-    /*
-     * Did not get the lock. The pending bit was set above, and we must now
-     * wait until we get the global lock released interrupt.
-     */
-    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Waiting for hardware Global Lock\n"));
+        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+            "Waiting for hardware Global Lock\n"));
 
-    /*
-     * Wait for handshake with the global lock interrupt handler.
-     * This interface releases the interpreter if we must wait.
-     */
-    Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
-                ACPI_WAIT_FOREVER);
+        /*
+         * Wait for handshake with the global lock interrupt handler.
+         * This interface releases the interpreter if we must wait.
+         */
+        Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
+                    ACPI_WAIT_FOREVER);
+
+        Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
+
+    } while (ACPI_SUCCESS (Status));
+
+    AcpiGbl_GlobalLockPending = FALSE;
+    AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
 
     return_ACPI_STATUS (Status);
 }

Modified: head/sys/contrib/dev/acpica/events/evxfgpe.c
==============================================================================
--- head/sys/contrib/dev/acpica/events/evxfgpe.c	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/events/evxfgpe.c	Thu Mar 17 00:29:53 2011	(r219707)
@@ -314,9 +314,19 @@ AcpiSetupGpeForWake (
         return_ACPI_STATUS (AE_BAD_PARAMETER);
     }
 
+    /* Handle root object case */
+
+    if (WakeDevice == ACPI_ROOT_OBJECT)
+    {
+        DeviceNode = AcpiGbl_RootNode;
+    }
+    else
+    {
+        DeviceNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, WakeDevice);
+    }
+
     /* Validate WakeDevice is of type Device */
 
-    DeviceNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, WakeDevice);
     if (DeviceNode->Type != ACPI_TYPE_DEVICE)
     {
         return_ACPI_STATUS (AE_BAD_PARAMETER);

Modified: head/sys/contrib/dev/acpica/include/acdisasm.h
==============================================================================
--- head/sys/contrib/dev/acpica/include/acdisasm.h	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/include/acdisasm.h	Thu Mar 17 00:29:53 2011	(r219707)
@@ -129,7 +129,8 @@ typedef const struct acpi_dmtable_info
 #define ACPI_DMT_DEVICE_PATH            44
 #define ACPI_DMT_LABEL                  45
 #define ACPI_DMT_BUF7                   46
-
+#define ACPI_DMT_BUF128                 47
+#define ACPI_DMT_SLIC                   48
 
 typedef
 void (*ACPI_DMTABLE_HANDLER) (
@@ -262,7 +263,9 @@ extern ACPI_DMTABLE_INFO        AcpiDmTa
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSbst[];
-extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlic[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlicHdr[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlic0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlic1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlit[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSpcr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSpmi[];
@@ -379,6 +382,10 @@ AcpiDmDumpRsdt (
     ACPI_TABLE_HEADER       *Table);
 
 void
+AcpiDmDumpSlic (
+    ACPI_TABLE_HEADER       *Table);
+
+void
 AcpiDmDumpSlit (
     ACPI_TABLE_HEADER       *Table);
 

Modified: head/sys/contrib/dev/acpica/include/acglobal.h
==============================================================================
--- head/sys/contrib/dev/acpica/include/acglobal.h	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/include/acglobal.h	Thu Mar 17 00:29:53 2011	(r219707)
@@ -190,13 +190,16 @@ ACPI_EXTERN ACPI_MUTEX_INFO             
 
 /*
  * Global lock mutex is an actual AML mutex object
- * Global lock semaphore works in conjunction with the HW global lock
+ * Global lock semaphore works in conjunction with the actual global lock
+ * Global lock spinlock is used for "pending" handshake
  */
 ACPI_EXTERN ACPI_OPERAND_OBJECT        *AcpiGbl_GlobalLockMutex;
 ACPI_EXTERN ACPI_SEMAPHORE              AcpiGbl_GlobalLockSemaphore;
+ACPI_EXTERN ACPI_SPINLOCK               AcpiGbl_GlobalLockPendingLock;
 ACPI_EXTERN UINT16                      AcpiGbl_GlobalLockHandle;
 ACPI_EXTERN BOOLEAN                     AcpiGbl_GlobalLockAcquired;
 ACPI_EXTERN BOOLEAN                     AcpiGbl_GlobalLockPresent;
+ACPI_EXTERN BOOLEAN                     AcpiGbl_GlobalLockPending;
 
 /*
  * Spinlocks are used for interfaces that can be possibly called at

Modified: head/sys/contrib/dev/acpica/include/acpixf.h
==============================================================================
--- head/sys/contrib/dev/acpica/include/acpixf.h	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/include/acpixf.h	Thu Mar 17 00:29:53 2011	(r219707)
@@ -48,7 +48,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20110211
+#define ACPI_CA_VERSION                 0x20110316
 
 #include 
 #include 

Modified: head/sys/contrib/dev/acpica/include/actbl2.h
==============================================================================
--- head/sys/contrib/dev/acpica/include/actbl2.h	Wed Mar 16 22:51:34 2011	(r219706)
+++ head/sys/contrib/dev/acpica/include/actbl2.h	Thu Mar 17 00:29:53 2011	(r219707)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Name: actbl2.h - ACPI Specification Revision 2.0 Tables
+ * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
  *
  *****************************************************************************/
 
@@ -831,6 +831,81 @@ typedef struct acpi_table_mchi
 
 /*******************************************************************************
  *
+ * SLIC - Software Licensing Description Table
+ *        Version 1
+ *
+ * Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
+ * Copyright 2006
+ *
+ ******************************************************************************/
+
+/* Basic SLIC table is only the common ACPI header */
+
+typedef struct acpi_table_slic
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+
+} ACPI_TABLE_SLIC;
+
+
+/* Common SLIC subtable header */
+
+typedef struct acpi_slic_header
+{
+    UINT32                  Type;
+    UINT32                  Length;
+
+} ACPI_SLIC_HEADER;
+
+/* Values for Type field above */
+
+enum AcpiSlicType
+{
+    ACPI_SLIC_TYPE_PUBLIC_KEY           = 0,
+    ACPI_SLIC_TYPE_WINDOWS_MARKER       = 1,
+    ACPI_SLIC_TYPE_RESERVED             = 2    /* 2 and greater are reserved */
+};
+
+
+/*
+ * SLIC Sub-tables, correspond to Type in ACPI_SLIC_HEADER
+ */
+
+/* 0: Public Key Structure */
+
+typedef struct acpi_slic_key
+{
+    ACPI_SLIC_HEADER        Header;
+    UINT8                   KeyType;

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

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 01:05:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C888F1065672;
	Thu, 17 Mar 2011 01:05:54 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B7F458FC12;
	Thu, 17 Mar 2011 01:05: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 p2H15sWY009568;
	Thu, 17 Mar 2011 01:05:54 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2H15suE009566;
	Thu, 17 Mar 2011 01:05:54 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201103170105.p2H15suE009566@svn.freebsd.org>
From: Ed Maste 
Date: Thu, 17 Mar 2011 01:05:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219708 - head/usr.bin/vmstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 01:05:54 -0000

Author: emaste
Date: Thu Mar 17 01:05:54 2011
New Revision: 219708
URL: http://svn.freebsd.org/changeset/base/219708

Log:
  Remove uptime validity check that hasn't been necessary since r151417
  switched to clock_gettime.  vmstat will now not exit with an error
  if run on a system with 10 years of uptime.

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

Modified: head/usr.bin/vmstat/vmstat.c
==============================================================================
--- head/usr.bin/vmstat/vmstat.c	Thu Mar 17 00:29:53 2011	(r219707)
+++ head/usr.bin/vmstat/vmstat.c	Thu Mar 17 01:05:54 2011	(r219708)
@@ -409,14 +409,10 @@ static long
 getuptime(void)
 {
 	struct timespec sp;
-	time_t uptime;
 
 	(void)clock_gettime(CLOCK_MONOTONIC, &sp);
-	uptime = sp.tv_sec;
-	if (uptime <= 0 || uptime > 60*60*24*365*10)
-		errx(1, "time makes no sense; namelist must be wrong");
 
-	return(uptime);
+	return(sp.tv_sec);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 01:42:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 92FE1106564A;
	Thu, 17 Mar 2011 01:42:22 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B7598FC08;
	Thu, 17 Mar 2011 01:42:21 +0000 (UTC)
Received: by qwc9 with SMTP id 9so1932689qwc.13
	for ; Wed, 16 Mar 2011 18:42:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:from
	:date:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	bh=T1TaxMDdk6RkJwvaSbAbKhl3qVnXSZk1L0GK6GELbrY=;
	b=aRGZi+M2Ma7Ca6H5azvVvM3NTPsbxeeNWvBa1Oo92MAWzJKHTn8z5D3+7Mgo9q4FSF
	QGNIXh2zpO/gjhPGz+O48CfmV6ln91WjnE5Xc1qcGdQwd0bGwasgQ+q9MYh4Ui2whsKp
	FGig+95xraBsiObLxaTmo2StKR6vu7iIlnZwM=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:from:date
	:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	b=x/2/NwNtawH24OOQo2qP56RzGDPyWcE7BVlmplh4clQr1bhU1XDqLUkB2E/iSaLsmA
	uWqBeFXLWCWIrsOW3xN4NHZ7blAaYe8LL4EqIstrai0KuRD56oHDtWFnohCFlSbpc3NK
	zTmVogKZ2KTDUfJcM6yp7w+tcDTkUguaZgyc8=
Received: by 10.229.105.71 with SMTP id s7mr651843qco.23.1300325842087; Wed,
	16 Mar 2011 18:37:22 -0700 (PDT)
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.229.78.193 with HTTP; Wed, 16 Mar 2011 18:36:42 -0700 (PDT)
In-Reply-To: <201103170105.p2H15suE009566@svn.freebsd.org>
References: <201103170105.p2H15suE009566@svn.freebsd.org>
From: Ivan Voras 
Date: Thu, 17 Mar 2011 02:36:42 +0100
X-Google-Sender-Auth: YHy115Rol6O-N67wVd4h2u9DqEc
Message-ID: 
To: Ed Maste 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219708 - head/usr.bin/vmstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 01:42:22 -0000

On 17 March 2011 02:05, Ed Maste  wrote:
> Author: emaste
> Date: Thu Mar 17 01:05:54 2011
> New Revision: 219708
> URL: http://svn.freebsd.org/changeset/base/219708
>
> Log:
> =C2=A0Remove uptime validity check that hasn't been necessary since r1514=
17
> =C2=A0switched to clock_gettime. =C2=A0vmstat will now not exit with an e=
rror
> =C2=A0if run on a system with 10 years of uptime.

I hope you have a system to test this on :)

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 04:30:44 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4200A106564A;
	Thu, 17 Mar 2011 04:30:44 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 322CB8FC14;
	Thu, 17 Mar 2011 04:30: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 p2H4UiPk014148;
	Thu, 17 Mar 2011 04:30:44 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2H4Uil5014146;
	Thu, 17 Mar 2011 04:30:44 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201103170430.p2H4Uil5014146@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Thu, 17 Mar 2011 04:30:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219709 - head/lib/libc/stdlib
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 04:30:44 -0000

Author: marcel
Date: Thu Mar 17 04:30:43 2011
New Revision: 219709
URL: http://svn.freebsd.org/changeset/base/219709

Log:
  Don't add sigwait.c to MISRCS here when sigwait.c lives under ../sys and
  it's already added to SRCS there.

Modified:
  head/lib/libc/stdlib/Makefile.inc

Modified: head/lib/libc/stdlib/Makefile.inc
==============================================================================
--- head/lib/libc/stdlib/Makefile.inc	Thu Mar 17 01:05:54 2011	(r219708)
+++ head/lib/libc/stdlib/Makefile.inc	Thu Mar 17 04:30:43 2011	(r219709)
@@ -9,7 +9,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate
 	getsubopt.c hcreate.c heapsort.c imaxabs.c imaxdiv.c \
 	insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c malloc.c \
 	merge.c ptsname.c qsort.c qsort_r.c radixsort.c rand.c random.c \
-	reallocf.c realpath.c remque.c sigwait.c strfmon.c strtoimax.c \
+	reallocf.c realpath.c remque.c strfmon.c strtoimax.c \
 	strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
         strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 04:40:38 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4577D1065670;
	Thu, 17 Mar 2011 04:40:38 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 35CC98FC1B;
	Thu, 17 Mar 2011 04:40: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 p2H4ecLe014427;
	Thu, 17 Mar 2011 04:40:38 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2H4ecQF014425;
	Thu, 17 Mar 2011 04:40:38 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201103170440.p2H4ecQF014425@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Thu, 17 Mar 2011 04:40:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219710 - head/lib/libc/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 04:40:38 -0000

Author: marcel
Date: Thu Mar 17 04:40:37 2011
New Revision: 219710
URL: http://svn.freebsd.org/changeset/base/219710

Log:
  When building libc with the syscall compatibility, don't also generate the
  syscall assembly files. This results in conflicting dependencies and can
  cause unexpected results for parallel builds. This is because the .c file
  and the .S file both generate the same .o file.
  
  Submitted by:	Simon Gerraty 
  Sponsored by:	Juniper Networks

Modified:
  head/lib/libc/sys/Makefile.inc

Modified: head/lib/libc/sys/Makefile.inc
==============================================================================
--- head/lib/libc/sys/Makefile.inc	Thu Mar 17 04:30:43 2011	(r219709)
+++ head/lib/libc/sys/Makefile.inc	Thu Mar 17 04:40:37 2011	(r219710)
@@ -18,7 +18,10 @@
 # Sources common to both syscall interfaces:
 SRCS+=	stack_protector.c stack_protector_compat.c __error.c
 .if !defined(WITHOUT_SYSCALL_COMPAT)
-SRCS+=	fcntl.c ftruncate.c lseek.c mmap.c pread.c pwrite.c truncate.c
+SYSCALL_COMPAT_SRCS=	fcntl.c ftruncate.c lseek.c mmap.c pread.c \
+	pwrite.c truncate.c
+SRCS+=	${SYSCALL_COMPAT_SRCS}
+NOASM+=	${SYSCALL_COMPAT_SRCS:S/.c/.o/}
 PSEUDO+= _fcntl.o
 .endif
 SRCS+= sigwait.c

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 05:00:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C90A1065688;
	Thu, 17 Mar 2011 05:00:33 +0000 (UTC)
	(envelope-from julian@freebsd.org)
Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16])
	by mx1.freebsd.org (Postfix) with ESMTP id 26E868FC2F;
	Thu, 17 Mar 2011 05:00:32 +0000 (UTC)
Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137])
	(authenticated bits=0)
	by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p2H4eMWW095598
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Wed, 16 Mar 2011 21:40:23 -0700 (PDT)
	(envelope-from julian@freebsd.org)
Message-ID: <4D8190C1.4090004@freebsd.org>
Date: Wed, 16 Mar 2011 21:40:33 -0700
From: Julian Elischer 
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US;
	rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version: 1.0
To: Ivan Voras 
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<20110316004503.GM99496@mdounin.ru>
	<201103161233.16347.jkim@FreeBSD.org>
	<20110316174553.GA6367@freebsd.org>
	<20110316200346.GA36431@owl.midgard.homeip.net>
	
In-Reply-To: 
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Erik Trulsson , src-committers@freebsd.org,
	Roman Divacky , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, Jung-uk Kim 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 05:00:33 -0000

On 3/16/11 2:16 PM, Ivan Voras wrote:
> On 16 March 2011 21:03, Erik Trulsson  wrote:
>> On Wed, Mar 16, 2011 at 06:45:53PM +0100, Roman Divacky wrote:
>>> On Wed, Mar 16, 2011 at 12:32:56PM -0400, Jung-uk Kim wrote:
>>>> On Tuesday 15 March 2011 08:45 pm, Maxim Dounin wrote:
>>>>> This isn't really different as long as GENERIC kernel used, as
>>>>> GENERIC defines I486_CPU.
>>>> Fixed in r219698, sorry.
>>>>
>>>> Actually, I think we should remove i486 from GENERIC at some point.
>>>> It has too many limitations.  For example, I really love to implement
>>>> atomic 64-bit mem read/write using cmpxchg8b (no 0xf00f joke, please)
>>>> but I cannot do that cleanly without removing I486 support or
>>>> checking cpu_class at run-time. :-(
>>> if we drop i486 I think it makes sense to require something that has
>>> at least SSE2, thus we can have the same expectations as on amd64.
>> No, that would remove support from far too many machines that people
>> actually use to run FreeBSD.
>> There are probably only a handful of people (if that) who actually run
>> FreeBSD on an actual 486-class machine, but requiring SSE2 would mean
>> dropping support for Pentium-III and Athlon-XP equipped machines and
>> I believe there are a large number of such machines still in use, and
>> they are still perfectly suitable for a large number of tasks.
> This is understandable but I also think it deserves a poll at stable@
> and current@. It might be worth keeping i486 for all of 9-stable but
> removing it before 10-stable. Judging from previous releases, 9.x
> would be supported until at least 2016. I don't follow the embedded
> world that much, but from what I saw, most (incl. Soekris) are moving
> to Atom designs which support SSE2.

not sure what is in the Soekris and other embedded machines but do 
keep them in mind.

many are now 586 class I guess but there may still be some 486 ones 
around.
I believe you can now get a 486 core in some arrays.

>


From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 09:10:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04DA6106564A;
	Thu, 17 Mar 2011 09:10:47 +0000 (UTC)
	(envelope-from bzeeb-lists@lists.zabbadoz.net)
Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90])
	by mx1.freebsd.org (Postfix) with ESMTP id 8D84D8FC18;
	Thu, 17 Mar 2011 09:10:46 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id C9FAA25D3888;
	Thu, 17 Mar 2011 08:53:47 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id A7380159AF28;
	Thu, 17 Mar 2011 08:53:46 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id 7AKPDErKsSki; Thu, 17 Mar 2011 08:53:45 +0000 (UTC)
Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id 167E7159AFAB;
	Thu, 17 Mar 2011 08:53:44 +0000 (UTC)
Date: Thu, 17 Mar 2011 08:53:43 +0000 (UTC)
From: "Bjoern A. Zeeb" 
To: src-committers@freebsd.org
In-Reply-To: <4D8190C1.4090004@freebsd.org>
Message-ID: 
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<20110316004503.GM99496@mdounin.ru>
	<201103161233.16347.jkim@FreeBSD.org>
	<20110316174553.GA6367@freebsd.org>
	<20110316200346.GA36431@owl.midgard.homeip.net>
	
	<4D8190C1.4090004@freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 09:10:47 -0000

On Wed, 16 Mar 2011, Julian Elischer wrote:

> On 3/16/11 2:16 PM, Ivan Voras wrote:
>> On 16 March 2011 21:03, Erik Trulsson  wrote:
>>> On Wed, Mar 16, 2011 at 06:45:53PM +0100, Roman Divacky wrote:
>>>> On Wed, Mar 16, 2011 at 12:32:56PM -0400, Jung-uk Kim wrote:
>>>>> On Tuesday 15 March 2011 08:45 pm, Maxim Dounin wrote:
>>>>>> This isn't really different as long as GENERIC kernel used, as
>>>>>> GENERIC defines I486_CPU.
>>>>> Fixed in r219698, sorry.
>>>>> 
>>>>> Actually, I think we should remove i486 from GENERIC at some point.
>>>>> It has too many limitations.  For example, I really love to implement
>>>>> atomic 64-bit mem read/write using cmpxchg8b (no 0xf00f joke, please)
>>>>> but I cannot do that cleanly without removing I486 support or
>>>>> checking cpu_class at run-time. :-(
>>>> if we drop i486 I think it makes sense to require something that has
>>>> at least SSE2, thus we can have the same expectations as on amd64.
>>> No, that would remove support from far too many machines that people
>>> actually use to run FreeBSD.
>>> There are probably only a handful of people (if that) who actually run
>>> FreeBSD on an actual 486-class machine, but requiring SSE2 would mean
>>> dropping support for Pentium-III and Athlon-XP equipped machines and
>>> I believe there are a large number of such machines still in use, and
>>> they are still perfectly suitable for a large number of tasks.
>> This is understandable but I also think it deserves a poll at stable@
>> and current@. It might be worth keeping i486 for all of 9-stable but
>> removing it before 10-stable. Judging from previous releases, 9.x
>> would be supported until at least 2016. I don't follow the embedded
>> world that much, but from what I saw, most (incl. Soekris) are moving
>> to Atom designs which support SSE2.
>
> not sure what is in the Soekris and other embedded machines but do keep them 
> in mind.
>
> many are now 586 class I guess but there may still be some 486 ones around.
> I believe you can now get a 486 core in some arrays.

You mean something like this .. though it's not a fully classic?  It's
one of the soekris boxes I boot/run as long as I manage to get a
kernel and a world in an mdimage booted from tftp... yes you can still
get down to that tiny size though there's a lot of ignorance for that
in our tree these days.

CPU: AMD Enhanced Am486DX4/Am5x86 Write-Back (486-class CPU)
   Origin = "AuthenticAMD"  Id = 0x494  Stepping = 4
   Features=0x1
real memory  = 33554432 (32 MB)

/bz

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 09:44:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A0ECD1065675;
	Thu, 17 Mar 2011 09:44:33 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 91ADD8FC14;
	Thu, 17 Mar 2011 09:44:33 +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 p2H9iXJb020846;
	Thu, 17 Mar 2011 09:44:33 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2H9iXOT020844;
	Thu, 17 Mar 2011 09:44:33 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201103170944.p2H9iXOT020844@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 17 Mar 2011 09:44:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219711 - head/contrib/gcc/config/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 09:44:33 -0000

Author: mm
Date: Thu Mar 17 09:44:33 2011
New Revision: 219711
URL: http://svn.freebsd.org/changeset/base/219711

Log:
  Backport missing tunings for -march=core2:
  - enable extra 80387 mathematical constants (ext_80387_constants) [1]
  - enable compare and exchange 16 bytes (cmpxchg16b) [2]
  
  Verified against llvm-gcc (and apple gcc)
  
  Obtained from:	gcc-4.3 (ref. svn revs. 119260 [1], 121140 [2]; GPLv2)
  MFC after:	2 weeks

Modified:
  head/contrib/gcc/config/i386/i386.c

Modified: head/contrib/gcc/config/i386/i386.c
==============================================================================
--- head/contrib/gcc/config/i386/i386.c	Thu Mar 17 04:40:37 2011	(r219710)
+++ head/contrib/gcc/config/i386/i386.c	Thu Mar 17 09:44:33 2011	(r219711)
@@ -926,7 +926,7 @@ const int x86_use_incdec = ~(m_PENT4 | m
    integer data in xmm registers.  Which results in pretty abysmal code.  */
 const int x86_inter_unit_moves = 0 /* ~(m_ATHLON_K8) */;
 
-const int x86_ext_80387_constants = m_K6_GEODE | m_ATHLON | m_PENT4 | m_NOCONA | m_PPRO | m_GENERIC32;
+const int x86_ext_80387_constants = m_K6_GEODE | m_ATHLON | m_PENT4 | m_NOCONA | m_CORE2 | m_PPRO | m_GENERIC32;
 /* Some CPU cores are not able to predict more than 4 branch instructions in
    the 16 byte window.  */
 const int x86_four_jump_limit = m_PPRO | m_ATHLON_K8 | m_PENT4 | m_NOCONA | m_CORE2 | m_GENERIC;
@@ -937,7 +937,7 @@ const int x86_cmpxchg = ~m_386;
 /* Compare and exchange 8 bytes was added for pentium.  */
 const int x86_cmpxchg8b = ~(m_386 | m_486);
 /* Compare and exchange 16 bytes was added for nocona.  */
-const int x86_cmpxchg16b = m_NOCONA;
+const int x86_cmpxchg16b = m_NOCONA | m_CORE2;
 /* Exchange and add was added for 80486.  */
 const int x86_xadd = ~m_386;
 const int x86_pad_returns = m_ATHLON_K8 | m_CORE2 | m_GENERIC;

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 10:30:01 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FC5F106566B;
	Thu, 17 Mar 2011 10:30:01 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au
	[211.29.132.185])
	by mx1.freebsd.org (Postfix) with ESMTP id 0EE418FC18;
	Thu, 17 Mar 2011 10:30:00 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2HATvPv002064
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 17 Mar 2011 21:29:58 +1100
Date: Thu, 17 Mar 2011 21:29:57 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jung-uk Kim 
In-Reply-To: <201103161644.p2GGi8ug098283@svn.freebsd.org>
Message-ID: <20110317212945.W1102@besplex.bde.org>
References: <201103161644.p2GGi8ug098283@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219700 - head/sys/x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 10:30:01 -0000

On Wed, 16 Mar 2011, Jung-uk Kim wrote:

> Log:
>  Revert r219676.
>
>  Requested by:	jhb, bde

Thanks.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 11:23:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11F69106564A;
	Thu, 17 Mar 2011 11:23:13 +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 0171B8FC0A;
	Thu, 17 Mar 2011 11:23: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 p2HBNC6n025822;
	Thu, 17 Mar 2011 11:23:12 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HBNCGh025820;
	Thu, 17 Mar 2011 11:23:12 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103171123.p2HBNCGh025820@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 17 Mar 2011 11:23:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219712 - head/sys/ufs/ufs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 11:23:13 -0000

Author: kib
Date: Thu Mar 17 11:23:12 2011
New Revision: 219712
URL: http://svn.freebsd.org/changeset/base/219712

Log:
  Remove the #if defined(FFS) || defined(IFS) braces around the calls to
  ffs_snapgone(). ufs.ko module is not build with FFS define, causing
  snapshot inode number slots in superblock never be freed, as well as a
  reference on the snapshot vnode.
  
  IFS was removed several years ago, and UFS/FFS separation was not
  maintained for real.
  
  Reported, analyzed and tested by:	Yamagi Burmeister 
  MFC after:	3 days

Modified:
  head/sys/ufs/ufs/ufs_lookup.c

Modified: head/sys/ufs/ufs/ufs_lookup.c
==============================================================================
--- head/sys/ufs/ufs/ufs_lookup.c	Thu Mar 17 09:44:33 2011	(r219711)
+++ head/sys/ufs/ufs/ufs_lookup.c	Thu Mar 17 11:23:12 2011	(r219712)
@@ -1252,10 +1252,8 @@ out:
 	 * drop its snapshot reference so that it will be reclaimed
 	 * when last open reference goes away.
 	 */
-#if defined(FFS) || defined(IFS)
 	if (ip != 0 && (ip->i_flags & SF_SNAPSHOT) != 0 && ip->i_effnlink == 0)
 		ffs_snapgone(ip);
-#endif
 	return (error);
 }
 
@@ -1317,10 +1315,8 @@ ufs_dirrewrite(dp, oip, newinum, newtype
 	 * drop its snapshot reference so that it will be reclaimed
 	 * when last open reference goes away.
 	 */
-#if defined(FFS) || defined(IFS)
 	if ((oip->i_flags & SF_SNAPSHOT) != 0 && oip->i_effnlink == 0)
 		ffs_snapgone(oip);
-#endif
 	return (error);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 11:25:32 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC74D1065675;
	Thu, 17 Mar 2011 11:25: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 AB6878FC0A;
	Thu, 17 Mar 2011 11:25: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 p2HBPWRl025906;
	Thu, 17 Mar 2011 11:25:32 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HBPWB8025901;
	Thu, 17 Mar 2011 11:25:32 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103171125.p2HBPWB8025901@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 17 Mar 2011 11:25:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219713 - head/bin/ps
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 11:25:32 -0000

Author: kib
Date: Thu Mar 17 11:25:32 2011
New Revision: 219713
URL: http://svn.freebsd.org/changeset/base/219713

Log:
  Implement the usertime and systime keywords for ps, printing the
  corresponding times reported by getrusage().
  
  Submitted by:	Dan Nelson 
  MFC after:	1 week

Modified:
  head/bin/ps/extern.h
  head/bin/ps/keyword.c
  head/bin/ps/print.c
  head/bin/ps/ps.1

Modified: head/bin/ps/extern.h
==============================================================================
--- head/bin/ps/extern.h	Thu Mar 17 11:23:12 2011	(r219712)
+++ head/bin/ps/extern.h	Thu Mar 17 11:25:32 2011	(r219713)
@@ -81,12 +81,14 @@ int	 s_uname(KINFO *);
 void	 showkey(void);
 void	 started(KINFO *, VARENT *);
 void	 state(KINFO *, VARENT *);
+void	 systime(KINFO *, VARENT *);
 void	 tdev(KINFO *, VARENT *);
 void	 tdnam(KINFO *, VARENT *);
 void	 tname(KINFO *, VARENT *);
 void	 ucomm(KINFO *, VARENT *);
 void	 uname(KINFO *, VARENT *);
 void	 upr(KINFO *, VARENT *);
+void	 usertime(KINFO *, VARENT *);
 void	 vsize(KINFO *, VARENT *);
 void	 wchan(KINFO *, VARENT *);
 __END_DECLS

Modified: head/bin/ps/keyword.c
==============================================================================
--- head/bin/ps/keyword.c	Thu Mar 17 11:23:12 2011	(r219712)
+++ head/bin/ps/keyword.c	Thu Mar 17 11:25:32 2011	(r219713)
@@ -189,6 +189,7 @@ static VAR var[] = {
 		UINT, UIDFMT, 0},
 	{"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid),
 		UINT, UIDFMT, 0},
+	{"systime", "SYSTIME", NULL, USER, systime, NULL, 9, 0, CHAR, NULL, 0},
 	{"tdaddr", "TDADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2,
 		KOFF(ki_tdaddr), KPTR, "lx", 0},
 	{"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0},
@@ -210,6 +211,8 @@ static VAR var[] = {
 		KOFF(ki_paddr), KPTR, "lx", 0},
 	{"user", "USER", NULL, LJUST|DSIZ, uname, s_uname, USERLEN, 0, CHAR,
 		NULL, 0},
+	{"usertime", "USERTIME", NULL, USER, usertime, NULL, 9, 0, CHAR, NULL,
+		0},
 	{"usrpri", "", "upr", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
 	{"vsize", "", "vsz", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
 	{"vsz", "VSZ", NULL, 0, vsize, NULL, 6, 0, CHAR, NULL, 0},

Modified: head/bin/ps/print.c
==============================================================================
--- head/bin/ps/print.c	Thu Mar 17 11:23:12 2011	(r219712)
+++ head/bin/ps/print.c	Thu Mar 17 11:25:32 2011	(r219713)
@@ -550,12 +550,11 @@ vsize(KINFO *k, VARENT *ve)
 	(void)printf("%*lu", v->width, (u_long)(k->ki_p->ki_size / 1024));
 }
 
-void
-cputime(KINFO *k, VARENT *ve)
+static void
+printtime(KINFO *k, VARENT *ve, long secs, long psecs)
+/* psecs is "parts" of a second. first micro, then centi */
 {
 	VAR *v;
-	long secs;
-	long psecs;	/* "parts" of a second. first micro, then centi */
 	char obuff[128];
 	static char decimal_point;
 
@@ -566,20 +565,7 @@ cputime(KINFO *k, VARENT *ve)
 		secs = 0;
 		psecs = 0;
 	} else {
-		/*
-		 * This counts time spent handling interrupts.  We could
-		 * fix this, but it is not 100% trivial (and interrupt
-		 * time fractions only work on the sparc anyway).	XXX
-		 */
-		secs = k->ki_p->ki_runtime / 1000000;
-		psecs = k->ki_p->ki_runtime % 1000000;
-		if (sumrusage) {
-			secs += k->ki_p->ki_childtime.tv_sec;
-			psecs += k->ki_p->ki_childtime.tv_usec;
-		}
-		/*
-		 * round and scale to 100's
-		 */
+		/* round and scale to 100's */
 		psecs = (psecs + 5000) / 10000;
 		secs += psecs / 100;
 		psecs = psecs % 100;
@@ -590,6 +576,53 @@ cputime(KINFO *k, VARENT *ve)
 }
 
 void
+cputime(KINFO *k, VARENT *ve)
+{
+	long secs, psecs;
+
+	/*
+	 * This counts time spent handling interrupts.  We could
+	 * fix this, but it is not 100% trivial (and interrupt
+	 * time fractions only work on the sparc anyway).	XXX
+	 */
+	secs = k->ki_p->ki_runtime / 1000000;
+	psecs = k->ki_p->ki_runtime % 1000000;
+	if (sumrusage) {
+		secs += k->ki_p->ki_childtime.tv_sec;
+		psecs += k->ki_p->ki_childtime.tv_usec;
+	}
+	printtime(k, ve, secs, psecs);
+}
+
+void
+systime(KINFO *k, VARENT *ve)
+{
+	long secs, psecs;
+
+	secs = k->ki_p->ki_rusage.ru_stime.tv_sec;
+	psecs = k->ki_p->ki_rusage.ru_stime.tv_usec;
+	if (sumrusage) {
+		secs += k->ki_p->ki_childstime.tv_sec;
+		psecs += k->ki_p->ki_childstime.tv_usec;
+	}
+	printtime(k, ve, secs, psecs);
+}
+
+void
+usertime(KINFO *k, VARENT *ve)
+{
+	long secs, psecs;
+
+	secs = k->ki_p->ki_rusage.ru_utime.tv_sec;
+	psecs = k->ki_p->ki_rusage.ru_utime.tv_usec;
+	if (sumrusage) {
+		secs += k->ki_p->ki_childutime.tv_sec;
+		psecs += k->ki_p->ki_childutime.tv_usec;
+	}
+	printtime(k, ve, secs, psecs);
+}
+
+void
 elapsed(KINFO *k, VARENT *ve)
 {
 	VAR *v;

Modified: head/bin/ps/ps.1
==============================================================================
--- head/bin/ps/ps.1	Thu Mar 17 11:23:12 2011	(r219712)
+++ head/bin/ps/ps.1	Thu Mar 17 11:25:32 2011	(r219713)
@@ -29,7 +29,7 @@
 .\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd March 5, 2011
+.Dd March 16, 2011
 .Dt PS 1
 .Os
 .Sh NAME
@@ -205,8 +205,8 @@ Display information about processes whic
 Sort by current CPU usage, instead of the combination of controlling
 terminal and process ID.
 .It Fl S
-Change the way the process time is calculated by summing all exited
-children to their parent process.
+Change the way the process times, namely cputime, systime, and usertime,
+are calculated by summing all exited children to their parent process.
 .It Fl T
 Display information about processes attached to the device associated
 with the standard input.
@@ -596,6 +596,8 @@ symbolic process state (alias
 saved gid from a setgid executable
 .It Cm svuid
 saved UID from a setuid executable
+.It Cm systime
+accumulated system CPU time
 .It Cm tdaddr
 thread address
 .It Cm tdev
@@ -626,6 +628,8 @@ scheduling priority on return from syste
 .Cm usrpri )
 .It Cm user
 user name (from UID)
+.It Cm usertime
+accumulated user CPU time
 .It Cm vsz
 virtual size in Kbytes (alias
 .Cm vsize )

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 12:42:30 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1E9EC106566C;
	Thu, 17 Mar 2011 12:42:30 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au
	[211.29.132.184])
	by mx1.freebsd.org (Postfix) with ESMTP id 961AB8FC0C;
	Thu, 17 Mar 2011 12:42:29 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2HCgMKL009784
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 17 Mar 2011 23:42:24 +1100
Date: Thu, 17 Mar 2011 23:42:22 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jung-uk Kim 
In-Reply-To: <201103161634.08104.jkim@FreeBSD.org>
Message-ID: <20110317213445.U1128@besplex.bde.org>
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<201103161233.16347.jkim@FreeBSD.org>
	<20110316174553.GA6367@freebsd.org>
	<201103161634.08104.jkim@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: src-committers@FreeBSD.org, Roman Divacky ,
	Bruce Evans , svn-src-head@FreeBSD.org,
	svn-src-all@FreeBSD.org, Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 12:42:30 -0000

On Wed, 16 Mar 2011, Jung-uk Kim wrote:

> On Wednesday 16 March 2011 01:45 pm, Roman Divacky wrote:
>> On Wed, Mar 16, 2011 at 12:32:56PM -0400, Jung-uk Kim wrote:
>>> On Tuesday 15 March 2011 08:45 pm, Maxim Dounin wrote:
>>>> This isn't really different as long as GENERIC kernel used, as
>>>> GENERIC defines I486_CPU.
>>>
>>> Fixed in r219698, sorry.
>>>
>>> Actually, I think we should remove i486 from GENERIC at some
>>> point. It has too many limitations.  For example, I really love
>>> to implement atomic 64-bit mem read/write using cmpxchg8b (no
>>> 0xf00f joke, please) but I cannot do that cleanly without
>>> removing I486 support or checking cpu_class at run-time. :-(

I'm not sure how f00f applies to cmpxchg8b, but we still maintain
the f00f workaround (perhaps not well enough to keep it actually
working) though there might be more i486's still running FreeBSD
than there are i586's with the f00f bug, since i486's might be
reimplemented into embedded systems but i586's with the f00f bug
might have been replaced and reimplementations of i586's wouldn't
implement the f00f bug.

>> if we drop i486 I think it makes sense to require something that
>> has at least SSE2, thus we can have the same expectations as on
>> amd64.
>>
>> and we can use sse2 unconditionally (str*, mem* etc.)
>
> This is a proof-of-concept patch for sys/x86/isa/clock.c:
>
> http://people.freebsd.org/~jkim/clock.diff

Please include patches in mail.  It is hard to refer to lines in urls.

> You see the complexity, just because I wanted to load 64-bit value
> atomically... :-(

I still think it should use a generation count.  (It can't use a mutex
due to deadlock and other problems.)

% Index: sys/x86/isa/clock.c
% ===================================================================
% --- sys/x86/isa/clock.c	(revision 219697)
% +++ sys/x86/isa/clock.c	(working copy)
% @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
% 
%  #include 
%  #include 
% +#include 
%  #include 
%  #include 
%  #include 
% @@ -245,40 +246,85 @@ getit(void)
%  	return ((high << 8) | low);
%  }
% 
% -static __inline void
% -delay_tsc(int n)
% +#ifdef __i386__
% +static __inline uint64_t
% +atomic_fetch_quad_i386(uint64_t *p)
%  {
% -	uint64_t start, end, now;
% +	uint64_t v;
% 
% -	sched_pin();
% -	start = rdtsc();
% -	end = start + (tsc_freq * n) / 1000000;

This reminds me to point out that DELAY() still has the old i386 code
to manually optimize the division corresponding to this, for the i8254
case with n < 256.  Plain i386 is no longer supported, and even i486's
aren't so slow, and newer CPUs have much faster divisions, and anyway,
gcc has been doing similar optimizations automatically for more than
15 (?) years -- it will turn 32-bit division into a multiplication and
shift if possible.  It only does this if this if it is possible to do
exactly, while the manual code doesn't need to be very precise so may
be able to do it when gcc can't.

However, the general case is a 64 by 32 bit division, and gcc still
generates very slow code for this (a __udivdi3 call).  This takes about
65 cycles on an Athlon64.  Since this is below the resolution of DELAY()
on an Athlon64 (even underclocked to not less than 33 MHz), it doesn't
matter.  It might be just enough to worry about on an i486.  But the
optimization belongs in gcc and __udivdi3.  The i8254 code uses the
general case for n >= 256 since even i386/16's can execute __udivdi3
in 256 uS.

% -	do {
% -		cpu_spinwait();
% -		now = rdtsc();
% -	} while (now < end || (now > start && end < start));
% -	sched_unpin();
% +	/* i486 does not support SMP. */
% +	__asm __volatile(
% +	"	pushfl ;			"
% +	"	cli ;				"
% +	"	movl (%1), %%eax ;		"
% +	"	movl 4(%1), %%edx ;		"
% +	"	popfl"
% +	: "=&A" (v) : "r" (p));
% +	return (v);
%  }

Asms in *.c are style bugs.  intr_disable() and intr_restore() exist as
asms in cpufunc.h so that no asm in *.c is needed for cli/sti.

% 
% -static __inline void
% -delay_timecounter(struct timecounter *tc, int n)
% +static __inline uint64_t
% +atomic_fetch_quad_i586(uint64_t *p)
%  {
% -	uint64_t end, now;
% +	uint64_t v;
% +
% +	__asm __volatile(
% +	"	movl %%ebx,%%eax ;		"
% +	"	movl %%ecx,%%edx ;		"
% +	"	" MPLOCKED " cmpxchg8b (%1)"
% +	: "=&A" (v) : "r" (p) : "cc");
% +	return (v);
% +}

This should be in atomic.h, with the runtime feature test there.  atomic.h
still has the compile-time feature test CPU_DISABLE_CMPXCHG which gives
a version of cmpset32 using cli/sti, though it no longer has the i386
ifdef for this.

% +
% +static __inline uint64_t
% +_fetch_frequency(uint64_t *p)
% +{
% +
% +	if (cpu_class == CPUCLASS_486)
% +		return (atomic_fetch_quad_i386(p));
% +	return (atomic_fetch_quad_i586(p));
% +}

cpu_class should never be used.  This should test the cpu feature for
cmpxchg8b.  Athlon64 docs say that cmpxchg8b can give "Invalid opcode",
if its bit is not set in cpu feature, so it is not clear if cmpxchg8b
is available even on all Athlon64's.  You have a problem if any CPU
that supports SMP doesn't support cmpxchg8b.

% +#else
% +#define	_fetch_frequency(p)	(*(p))
% +#endif
% +
% +static __inline int
% +_delay(int n)
% +{
% +	struct timecounter *tc;
% +	uint64_t end, freq, now;
%  	u_int last, mask, u;
% +	int use_tsc;
% 
% -	mask = tc->tc_counter_mask;
% -	last = tc->tc_get_timecount(tc) & mask;
% -	end = tc->tc_frequency * n / 1000000;
% +	tc = timecounter;
% +	freq = _fetch_frequency(&tsc_freq);
% +	use_tsc = tsc_is_invariant && freq != 0;
% +	if (use_tsc) {
% +		mask = ~0u;
% +		sched_pin();
% +		last = rdtsc();
% +	} else {
% +		if (tc->tc_quality <= 0)
% +			return (0);
% +		freq = _fetch_frequency(&tc->tc_frequency);
% +		mask = tc->tc_counter_mask;
% +		last = tc->tc_get_timecount(tc);
% +	}
% +	last &= mask;
% +	end = freq * n / 1000000;
%  	now = 0;
%  	do {
%  		cpu_spinwait();
% -		u = tc->tc_get_timecount(tc) & mask;
% +		u = (use_tsc ? rdtsc() : tc->tc_get_timecount(tc)) & mask;
%  		if (u < last)
%  			now += mask - last + u + 1;
%  		else
%  			now += u - last;
%  		last = u;
%  	} while (now < end);
% +	if (use_tsc)
% +		sched_unpin();
% +	return (1);
%  }
% 
%  /*

This does seem simpler than a generation count, since it doesn't require
modifying places that set the code, but I don't see how it can work
without modifying other places.  There seems to be nothing to prevent
atomic_fetch_quad_i586 reading 2 identical half-initialized values.
Apart from minor races involving the modification running slow than
the cmpxchg8b can see any changes, the modification may be preempted
while half done, giving a very large race window.  When the kernel
was not preemptable, the race was limited to interrupt handlers.  Now
it extends to all threads that don't block on the lock being used by
the sysctl.

But!, when the kernel was not preemptable, there was no CPU running
faster than 4GHz, and tsc_freq was only 32 bits, so there was no
problem with updating it atomically enough (we don't care about using
stale values).  There is probably still no 386 running faster than 4GHz,
and only a few overclocked newer ones running fast than 4HGz.  Thus
the race is mostly in the future, and we don't need these complications
yet for the non-i486 case or probably ever for the i486 case.

The problem can be pushed to much higher than 4 GHz by scaling tsc_freq
a little; make tsc_freq the actual frequency divided by 4, and use
rdtsc() / 4 instead of rdtsc() to reach 16 GHz with a 32-bit tsc_freq.
Only urandom would notice the lost 2 bits, and it wouldn't divide by 4.

% @@ -289,7 +335,6 @@ getit(void)
%  void
%  DELAY(int n)
%  {
% -	struct timecounter *tc;
%  	int delta, prev_tick, tick, ticks_left;
% 
%  #ifdef DELAYDEBUG
% @@ -298,15 +343,8 @@ DELAY(int n)
%  	static int state = 0;
%  #endif
% 
% -	if (tsc_freq != 0) {
% -		delay_tsc(n);
% +	if (_delay(n))
%  		return;
% -	}
% -	tc = timecounter;
% -	if (tc->tc_quality > 0) {
% -		delay_timecounter(tc, n);
% -		return;
% -	}
%  #ifdef DELAYDEBUG
%  	if (state == 0) {
%  		state = 1;

Still have the delay before code to debug it.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 12:55:35 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 897C0106566B;
	Thu, 17 Mar 2011 12:55:35 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au
	[211.29.132.183])
	by mx1.freebsd.org (Postfix) with ESMTP id 2522D8FC0A;
	Thu, 17 Mar 2011 12:55:34 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2HCtVGe003922
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 17 Mar 2011 23:55:32 +1100
Date: Thu, 17 Mar 2011 23:55:31 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jung-uk Kim 
In-Reply-To: <201103161609.p2GG98q6097329@svn.freebsd.org>
Message-ID: <20110317234320.E1128@besplex.bde.org>
References: <201103161609.p2GG98q6097329@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219698 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 12:55:35 -0000

On Wed, 16 Mar 2011, Jung-uk Kim wrote:

> Log:
>  Rework r219679.  Always check CPU class at run-time to make it predictable.
>  Unfortunately, it pulls in  but it is small enough and
>  namespace pollution is minimal, I hope.
>
>  Pointed out by:	bde

Well, I don't like the namespace pollution, and the old code carefully
avoided it by using the tsc_present global.

> Modified: head/sys/i386/include/cpu.h
> ==============================================================================
> --- head/sys/i386/include/cpu.h	Wed Mar 16 12:40:58 2011	(r219697)
> +++ head/sys/i386/include/cpu.h	Wed Mar 16 16:09:08 2011	(r219698)
> @@ -39,6 +39,7 @@
> /*
>  * Definitions unique to i386 cpu support.
>  */
> +#include 
> #include 
> #include 
> #include 
> @@ -69,14 +70,13 @@ void	swi_vm(void *);
> static __inline uint64_t
> get_cyclecount(void)
> {
> -#if defined(I486_CPU) || defined(KLD_MODULE)
> 	struct bintime bt;
>
> -	binuptime(&bt);
> -	return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
> -#else
> +	if (cpu_class == CPUCLASS_486) {
> +		binuptime(&bt);
> +		return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
> +	}
> 	return (rdtsc());
> -#endif
> }
>
> #endif

cpu_class shouldn't be used for anything, and might not be able to
correctly classify whether the CPU has a TSC.  The cpu feature for
this should be used.  Using it directly with the correct includes
would give considerably more namespace pollution (md_var.h for cpu_feature
and specialreg.h for CPUID_TSC).

Although I said that tsc_present should go, it seems to be the best
thing to use here.  Rename it __cpu_feature_TSC to reflect that it is
exactly (cpu_feature & CPUID_TSC) and put underscores in its name so
as to start being even more careful about namespace pollution in cpu.h.
Or redeclare cpu_feature and CPUID_TSC.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 13:09:35 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DEDF9106566C;
	Thu, 17 Mar 2011 13:09:34 +0000 (UTC) (envelope-from bob@immure.com)
Received: from maul.immure.com (adsl-66-136-206-1.dsl.austtx.swbell.net
	[66.136.206.1])
	by mx1.freebsd.org (Postfix) with ESMTP id 57CB08FC0A;
	Thu, 17 Mar 2011 13:09:34 +0000 (UTC)
Received: from rancor.immure.com (rancor.immure.com [10.1.132.9])
	by maul.immure.com (8.14.4/8.14.4) with ESMTP id p2HD9LuM002013;
	Thu, 17 Mar 2011 08:09:21 -0500 (CDT) (envelope-from bob@immure.com)
Received: (from bob@localhost)
	by rancor.immure.com (8.14.4/8.14.4/Submit) id p2HD9LAc017606;
	Thu, 17 Mar 2011 08:09:21 -0500 (CDT) (envelope-from bob)
Date: Thu, 17 Mar 2011 08:09:21 -0500
From: Bob Willcox 
To: Alexander Motin 
Message-ID: <20110317130921.GB14927@rancor.immure.com>
References: <201102052134.p15LYRmw041695@svn.freebsd.org>
	<20110316135122.GB7185@rancor.immure.com>
	<4D814AAA.3070801@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4D814AAA.3070801@FreeBSD.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-immure-MailScanner-Information: Please contact the ISP for more information
X-immure-MailScanner-ID: p2HD9LuM002013
X-immure-MailScanner: Found to be clean
X-immure-MailScanner-From: bob@immure.com
X-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: r218347 - stable/8/sys/dev/ata/chipsets
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Bob Willcox 
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 13:09:35 -0000

On Thu, Mar 17, 2011 at 01:41:30AM +0200, Alexander Motin wrote:
> On 16.03.2011 15:51, Bob Willcox wrote:
> > This change has broken SATA disk support on my Intel Atom D525 ITX system. By
> > reverting this change 8.2-STABLE works again on this system.
> >
> > My 'uname -a' output is:
> >
> > FreeBSD maul.immure.com 8.2-STABLE FreeBSD 8.2-STABLE #6: Wed Mar 16 08:15:43 CDT 2011     bob@maul.immure.com:/usr/obj/usr/src/sys/MAUL  amd64
> >
> > When booting the system I get tons of these messages:
> >
> > Mar 16 07:38:19 maul kernel: ad4: WARNING - SETFEATURES ENABLE RCACHE requeued due to channel reset
> > Mar 16 07:38:19 maul kernel: ad4: interrupt on idle channel ignored
> 
> As I can see, it means that channel has some active request, but it is 
> in IDLE state. It is strange, but I won't be surprised much if it is the 
> result of some locking problem in ata(4) in non-CAM mode.
> 
> > repeated over and over, and then lots of these:
> >
> > Mar 16 07:38:21 maul kernel: ad4: WARNING - READ_DMA48 requeued due to channel reset LBA=617964479
> > Mar 16 07:38:21 maul kernel: ata2: FAILURE - already active DMA on this device
> > Mar 16 07:38:21 maul kernel: ata2: setting up DMA failed
> >
> > for different LBA values.
> >
> > As one might expect, I then start seeing I/O errors on the disk and programs
> > failing
> >
> > I've attached the 'pciconf -lv' output.
> 
> Send me please full verbose log, if you can save it. I am especially 
> interested in place around first errors.

Hi Alexander,

I was unable to get the full verbose log as requested. When booting with
verbose the system just continued to spew errors to the console (at a rate too
fast to read) for the 15 minutes that I let it run. Since it never got up,
nothing was written to /var/log/message or /var/run/dmesg.boot and I don't
have a serial console on this system so I don't have the log to send you.

> 
> You may try to build kernel with `options ATA_CAM` to see if it helps. 
> I've mostly tested this patch in that mode.

I plan to try the 'options ATA_CAM' tonight. I have to be careful with this
system as it is my gateway machine and if I hose it up I'll be in a painful
recovery mode.

Bob

> 
> > On Sat, Feb 05, 2011 at 09:34:27PM +0000, Alexander Motin wrote:
> >> Author: mav
> >> Date: Sat Feb  5 21:34:26 2011
> >> New Revision: 218347
> >> URL: http://svn.freebsd.org/changeset/base/218347
> >>
> >> Log:
> >>    MFC r217774:
> >>    ICH7 SATA controller in legacy mode can provide access to SATA registers
> >>    via AHCI-like memory resource at BAR(5). Use it if BIOS was so kind to
> >>    allocate memory for that BAR. This allows hot-plug support and connection
> >>    speed reporting.
> 
> -- 
> Alexander Motin

-- 
Bob Willcox              Trying to explain things to people who already know
bob@immure.com           everything is like trying to teach a bear to dance;
Austin, TX               it's useless, and it annoys the bear.

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 13:09:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17C521065670;
	Thu, 17 Mar 2011 13:09:43 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au
	[211.29.132.183])
	by mx1.freebsd.org (Postfix) with ESMTP id A14068FC1C;
	Thu, 17 Mar 2011 13:09:42 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2HD9cq4012654
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 18 Mar 2011 00:09:40 +1100
Date: Fri, 18 Mar 2011 00:09:38 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Maxim Dounin 
In-Reply-To: <20110316140042.GN99496@mdounin.ru>
Message-ID: <20110317235541.E1128@besplex.bde.org>
References: <201103151714.p2FHEQdF049456@svn.freebsd.org>
	<20110315193306.GK99496@mdounin.ru>
	<201103151555.45816.jkim@FreeBSD.org>
	<201103151631.34418.jkim@FreeBSD.org>
	<20110316163507.F4107@besplex.bde.org>
	<20110316140042.GN99496@mdounin.ru>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jung-uk Kim ,
	Bruce Evans 
Subject: Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 13:09:43 -0000

On Wed, 16 Mar 2011, Maxim Dounin wrote:

> On Wed, Mar 16, 2011 at 04:44:35PM +1100, Bruce Evans wrote:
>
>> On Tue, 15 Mar 2011, Jung-uk Kim wrote:
>>>> On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote:
>>>>> Note that on early boot only dummy timecounter available, and
>>>>> binuptime() has no entropy.
>> ...
>> Is dummy timecounter used for long enough to matter?  I think completion
>> of clock initialization is still bogusly late for histrotical reasons,
>> but there is still a second or two between completion of timecounter
>> initialization and user mode.  The earlier stages of booting might
>> take 20 seconds but should be faster, so they might not provided much
>> more entropy from clocks.
> ...
> Right now the only entropy used at early boot are from
> get_cyclecount() call, which has at least some entropy on most
> platforms (notable exceptions are arm and i386 with i486 cpus).
> With dummy timecounter there are no entropy at early boot.

I see.  I thought that counters were almost useless for entropy.  But
the TSC normally has a very high frequency, so there is some entropy
in its low bits.  I think timecounters preserve all the bits of the
low-level counter in some form (this is possible since bintimes have
even more bits than the TSC).  So binuptime() should give about the
same entropy as rdtsc() when the timecounter is the TSC.  But the
timecounter usually isn't the TSC.  Its low-level timer usually
has a relatively low frequency (14 MHz for ACPI-fast), so it doesn't
have much entropy in its low bits, and binuptime() doesn't work well
for gathering entropy even if the timecounter is not the dummy one.

I think it is bogus that get_cyclecount(9) even mentions monotonicity.
It emphasizes monotonicy and doesn't mention entropy (except indirectly
by saying that SMP may have CPUs with independent monotonic sequences).

> If you want to change get_cyclecount() to be alias to binuptime()
> - we may consider adding another machdep call to extract early
> entropy.

Much better to name it extract_early_entropy() than
get_monotonic_cyclecount().

> I still not quite understand the reasons though.  I consider
> binuptime() to be some (bad one) fallback for get_cyclecount() on
> platforms which has no hardware counter available.  Moving all
> platforms to bad fallback looks strange.

Maybe the dummy timecounter was not the main problem since other
counters take over soon enough, but other counters don't give enough
entropy unless they are high frequency which is rare.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 13:37:44 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F1E971065676;
	Thu, 17 Mar 2011 13:37:44 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au
	[211.29.132.185])
	by mx1.freebsd.org (Postfix) with ESMTP id 73F8A8FC18;
	Thu, 17 Mar 2011 13:37:44 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2HDbf91011746
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 18 Mar 2011 00:37:42 +1100
Date: Fri, 18 Mar 2011 00:37:41 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Konstantin Belousov 
In-Reply-To: <201103171123.p2HBNCGh025820@svn.freebsd.org>
Message-ID: <20110318001402.H1537@besplex.bde.org>
References: <201103171123.p2HBNCGh025820@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219712 - head/sys/ufs/ufs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 13:37:45 -0000

On Thu, 17 Mar 2011, Konstantin Belousov wrote:

> Log:
>  Remove the #if defined(FFS) || defined(IFS) braces around the calls to
>  ffs_snapgone(). ufs.ko module is not build with FFS define, causing
>  snapshot inode number slots in superblock never be freed, as well as a
>  reference on the snapshot vnode.
>
>  IFS was removed several years ago, and UFS/FFS separation was not
>  maintained for real.
>
>  Reported, analyzed and tested by:	Yamagi Burmeister 
>  MFC after:	3 days

This seems to leave FFS correctly unused.  Most options for file systems
are put in opt_dontuse.h to inhibit bugs like this (but I never figured
out a way to generate a compile time error if an option in there is
used).  The FFS option is special.  It should not be special.  It was
moved from opt_dontuse.h to opt_ffs_broken_fixme.h in 2001 to avoid a
collateral bug: the FFS/UFS split doesn't work, but was used by ext2fs,
and it is a layering violation for UFS to call ffs_snapgone() in FFS,
and this broke the configuration with EXT2FS (and UFS) but not FFS;
this was hacked around by the ifdefs.  ext2fs was decoupled from UFS
in 2002, so the ifdefs became unnecessary, but they remained to break
the module.  opt_ffs_broken_fixme.h also became unnecessary in 2002,
but remains to generate history lessons :-).

The ifdef on IFS was even more bogus, since IFS doesn't exist and has
no vestiges in conf/*.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 16:24:06 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 7A955106566B;
	Thu, 17 Mar 2011 16:24:04 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Bruce Evans 
Date: Thu, 17 Mar 2011 12:23:47 -0400
User-Agent: KMail/1.6.2
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<201103161634.08104.jkim@FreeBSD.org>
	<20110317213445.U1128@besplex.bde.org>
In-Reply-To: <20110317213445.U1128@besplex.bde.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201103171223.52315.jkim@FreeBSD.org>
Cc: svn-src-head@FreeBSD.org, Roman Divacky ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 16:24:06 -0000

On Thursday 17 March 2011 08:42 am, Bruce Evans wrote:
> On Wed, 16 Mar 2011, Jung-uk Kim wrote:
> > On Wednesday 16 March 2011 01:45 pm, Roman Divacky wrote:
> >> On Wed, Mar 16, 2011 at 12:32:56PM -0400, Jung-uk Kim wrote:
> >>> On Tuesday 15 March 2011 08:45 pm, Maxim Dounin wrote:
> >>>> This isn't really different as long as GENERIC kernel used, as
> >>>> GENERIC defines I486_CPU.
> >>>
> >>> Fixed in r219698, sorry.
> >>>
> >>> Actually, I think we should remove i486 from GENERIC at some
> >>> point. It has too many limitations.  For example, I really love
> >>> to implement atomic 64-bit mem read/write using cmpxchg8b (no
> >>> 0xf00f joke, please) but I cannot do that cleanly without
> >>> removing I486 support or checking cpu_class at run-time. :-(
>
> I'm not sure how f00f applies to cmpxchg8b, but we still maintain
> the f00f workaround (perhaps not well enough to keep it actually
> working) though there might be more i486's still running FreeBSD
> than there are i586's with the f00f bug, since i486's might be
> reimplemented into embedded systems but i586's with the f00f bug
> might have been replaced and reimplementations of i586's wouldn't
> implement the f00f bug.

http://en.wikipedia.org/wiki/Pentium_F00F_bug

It was a bug in cmpxchg8b implementation.  When I think of cmpxchg8b, 
0xf00f just pops up in my mind.  I guess I won't forget the (illegal) 
opcode forever. :-(

> >> if we drop i486 I think it makes sense to require something that
> >> has at least SSE2, thus we can have the same expectations as on
> >> amd64.
> >>
> >> and we can use sse2 unconditionally (str*, mem* etc.)
> >
> > This is a proof-of-concept patch for sys/x86/isa/clock.c:
> >
> > http://people.freebsd.org/~jkim/clock.diff
>
> Please include patches in mail.  It is hard to refer to lines in
> urls.

(Bunch of comment was here.)

I didn't want it to be reviewed.  At least, I have no intention to 
commit it without properlly moving the asm to atomic.h.  I just 
mentioned it to show you the complexity of atomic 64-bit mem 
read/write *with* i486 support.  That's all.

Jung-uk Kim

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 17:02:37 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id BCD6E106566C;
	Thu, 17 Mar 2011 17:02:31 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Bruce Evans 
Date: Thu, 17 Mar 2011 13:02:14 -0400
User-Agent: KMail/1.6.2
References: <201103161609.p2GG98q6097329@svn.freebsd.org>
	<20110317234320.E1128@besplex.bde.org>
In-Reply-To: <20110317234320.E1128@besplex.bde.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201103171302.16038.jkim@FreeBSD.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219698 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 17:02:37 -0000

On Thursday 17 March 2011 08:55 am, Bruce Evans wrote:
> On Wed, 16 Mar 2011, Jung-uk Kim wrote:
> > Log:
> >  Rework r219679.  Always check CPU class at run-time to make it
> > predictable. Unfortunately, it pulls in  but
> > it is small enough and namespace pollution is minimal, I hope.
> >
> >  Pointed out by:	bde
>
> Well, I don't like the namespace pollution, and the old code
> carefully avoided it by using the tsc_present global.
>
> > Modified: head/sys/i386/include/cpu.h
> > =================================================================
> >============= --- head/sys/i386/include/cpu.h	Wed Mar 16 12:40:58
> > 2011	(r219697) +++ head/sys/i386/include/cpu.h	Wed Mar 16
> > 16:09:08 2011	(r219698) @@ -39,6 +39,7 @@
> > /*
> >  * Definitions unique to i386 cpu support.
> >  */
> > +#include 
> > #include 
> > #include 
> > #include 
> > @@ -69,14 +70,13 @@ void	swi_vm(void *);
> > static __inline uint64_t
> > get_cyclecount(void)
> > {
> > -#if defined(I486_CPU) || defined(KLD_MODULE)
> > 	struct bintime bt;
> >
> > -	binuptime(&bt);
> > -	return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
> > -#else
> > +	if (cpu_class == CPUCLASS_486) {
> > +		binuptime(&bt);
> > +		return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
> > +	}
> > 	return (rdtsc());
> > -#endif
> > }
> >
> > #endif
>
> cpu_class shouldn't be used for anything, and might not be able to
> correctly classify whether the CPU has a TSC.  The cpu feature for
> this should be used.  Using it directly with the correct includes
> would give considerably more namespace pollution (md_var.h for
> cpu_feature and specialreg.h for CPUID_TSC).
>
> Although I said that tsc_present should go, it seems to be the best
> thing to use here.  Rename it __cpu_feature_TSC to reflect that it
> is exactly (cpu_feature & CPUID_TSC) and put underscores in its
> name so as to start being even more careful about namespace
> pollution in cpu.h. Or redeclare cpu_feature and CPUID_TSC.

Actually, I think this function must be move to machdep.c as a real 
function unless there is any serious objection.  There is no reason 
to pollute this file for awful things like this.  I know it was done 
because of performance reason in the past (such as CPU ticker, 
performance measurement, I guess.) but it is rarely used now and it 
does only one serious thing, i.e., early entropy seeding.  There is a 
minor usage in SCTP for debugging but moving it to machdep.c won't 
hurt much, I think.  What do you think?

Jung-uk Kim

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 17:10:07 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 8ECC6106564A;
	Thu, 17 Mar 2011 17:09:56 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Bruce Evans 
Date: Thu, 17 Mar 2011 13:09:38 -0400
User-Agent: KMail/1.6.2
References: <201103161609.p2GG98q6097329@svn.freebsd.org>
	<20110317234320.E1128@besplex.bde.org>
	<201103171302.16038.jkim@FreeBSD.org>
In-Reply-To: <201103171302.16038.jkim@FreeBSD.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201103171309.42283.jkim@FreeBSD.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219698 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 17:10:07 -0000

On Thursday 17 March 2011 01:02 pm, Jung-uk Kim wrote:
> On Thursday 17 March 2011 08:55 am, Bruce Evans wrote:
> > On Wed, 16 Mar 2011, Jung-uk Kim wrote:
> > > Log:
> > >  Rework r219679.  Always check CPU class at run-time to make it
> > > predictable. Unfortunately, it pulls in 
> > > but it is small enough and namespace pollution is minimal, I
> > > hope.
> > >
> > >  Pointed out by:	bde
> >
> > Well, I don't like the namespace pollution, and the old code
> > carefully avoided it by using the tsc_present global.
> >
> > > Modified: head/sys/i386/include/cpu.h
> > > ===============================================================
> > >== ============= --- head/sys/i386/include/cpu.h	Wed Mar 16
> > > 12:40:58 2011	(r219697) +++ head/sys/i386/include/cpu.h	Wed Mar
> > > 16 16:09:08 2011	(r219698) @@ -39,6 +39,7 @@
> > > /*
> > >  * Definitions unique to i386 cpu support.
> > >  */
> > > +#include 
> > > #include 
> > > #include 
> > > #include 
> > > @@ -69,14 +70,13 @@ void	swi_vm(void *);
> > > static __inline uint64_t
> > > get_cyclecount(void)
> > > {
> > > -#if defined(I486_CPU) || defined(KLD_MODULE)
> > > 	struct bintime bt;
> > >
> > > -	binuptime(&bt);
> > > -	return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
> > > -#else
> > > +	if (cpu_class == CPUCLASS_486) {
> > > +		binuptime(&bt);
> > > +		return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
> > > +	}
> > > 	return (rdtsc());
> > > -#endif
> > > }
> > >
> > > #endif
> >
> > cpu_class shouldn't be used for anything, and might not be able
> > to correctly classify whether the CPU has a TSC.  The cpu feature
> > for this should be used.  Using it directly with the correct
> > includes would give considerably more namespace pollution
> > (md_var.h for cpu_feature and specialreg.h for CPUID_TSC).
> >
> > Although I said that tsc_present should go, it seems to be the
> > best thing to use here.  Rename it __cpu_feature_TSC to reflect
> > that it is exactly (cpu_feature & CPUID_TSC) and put underscores
> > in its name so as to start being even more careful about
> > namespace pollution in cpu.h. Or redeclare cpu_feature and
> > CPUID_TSC.
>
> Actually, I think this function must be move to machdep.c as a real
> function unless there is any serious objection.  There is no reason
> to pollute this file for awful things like this.  I know it was
> done because of performance reason in the past (such as CPU ticker,
> performance measurement, I guess.) but it is rarely used now and it
> does only one serious thing, i.e., early entropy seeding.  There is
> a minor usage in SCTP for debugging but moving it to machdep.c
> won't hurt much, I think.  What do you think?

Why can't we just use srandom(cpu_ticks()) in the first place?  I 
wonder...

Jung-uk Kim

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 17:29:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 368E5106564A;
	Thu, 17 Mar 2011 17:29: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 28E678FC15;
	Thu, 17 Mar 2011 17:29: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 p2HHTlYu034217;
	Thu, 17 Mar 2011 17:29:47 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HHTlSq034215;
	Thu, 17 Mar 2011 17:29:47 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103171729.p2HHTlSq034215@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 17 Mar 2011 17:29:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219717 - head/usr.sbin/mfiutil
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 17:29:47 -0000

Author: jhb
Date: Thu Mar 17 17:29:46 2011
New Revision: 219717
URL: http://svn.freebsd.org/changeset/base/219717

Log:
  Add more details to the 'show battery' command including more raw
  capacity values, charge cycle count, temperature, and more detailed
  status.
  
  Reviewed by:	bz, emaste (older version)
  MFC after:	1 week

Modified:
  head/usr.sbin/mfiutil/mfi_show.c

Modified: head/usr.sbin/mfiutil/mfi_show.c
==============================================================================
--- head/usr.sbin/mfiutil/mfi_show.c	Thu Mar 17 16:35:37 2011	(r219716)
+++ head/usr.sbin/mfiutil/mfi_show.c	Thu Mar 17 17:29:46 2011	(r219717)
@@ -138,8 +138,9 @@ show_battery(int ac, char **av)
 {
 	struct mfi_bbu_capacity_info cap;
 	struct mfi_bbu_design_info design;
+	struct mfi_bbu_status stat;
 	uint8_t status;
-	int error, fd;
+	int comma, error, fd;
 
 	if (ac != 1) {
 		warnx("show battery: extra arguments");
@@ -171,16 +172,57 @@ show_battery(int ac, char **av)
 		return (error);
 	}
 
+	if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_STATUS, &stat, sizeof(stat),
+	    NULL, 0, NULL) < 0) {
+		warn("Failed to get status");
+		return (errno);
+	}
+
 	printf("mfi%d: Battery State:\n", mfi_unit);
-	printf(" Manufacture Date: %d/%d/%d\n", design.mfg_date >> 5 & 0x0f,
+	printf("     Manufacture Date: %d/%d/%d\n", design.mfg_date >> 5 & 0x0f,
 	    design.mfg_date & 0x1f, design.mfg_date >> 9 & 0xffff);
-	printf("    Serial Number: %d\n", design.serial_number);
-	printf("     Manufacturer: %s\n", design.mfg_name);
-	printf("            Model: %s\n", design.device_name);
-	printf("        Chemistry: %s\n", design.device_chemistry);
-	printf("  Design Capacity: %d mAh\n", design.design_capacity);
-	printf("   Design Voltage: %d mV\n", design.design_voltage);
-	printf("   Current Charge: %d%%\n", cap.relative_charge);
+	printf("        Serial Number: %d\n", design.serial_number);
+	printf("         Manufacturer: %s\n", design.mfg_name);
+	printf("                Model: %s\n", design.device_name);
+	printf("            Chemistry: %s\n", design.device_chemistry);
+	printf("      Design Capacity: %d mAh\n", design.design_capacity);
+	printf(" Full Charge Capacity: %d mAh\n", cap.full_charge_capacity);
+	printf("     Current Capacity: %d mAh\n", cap.remaining_capacity);
+	printf("        Charge Cycles: %d\n", cap.cycle_count);
+	printf("       Current Charge: %d%%\n", cap.relative_charge);
+	printf("       Design Voltage: %d mV\n", design.design_voltage);
+	printf("      Current Voltage: %d mV\n", stat.voltage);
+	printf("          Temperature: %d C\n", stat.temperature);
+	printf("               Status:");
+	comma = 0;
+	if (stat.fw_status & MFI_BBU_STATE_PACK_MISSING) {
+		printf(" PACK_MISSING");
+		comma = 1;
+	}
+	if (stat.fw_status & MFI_BBU_STATE_VOLTAGE_LOW) {
+		printf("%s VOLTAGE_LOW", comma ? "," : "");
+		comma = 1;
+	}
+	if (stat.fw_status & MFI_BBU_STATE_TEMPERATURE_HIGH) {
+		printf("%s TEMPERATURE_HIGH", comma ? "," : "");
+		comma = 1;
+	}
+	if (stat.fw_status & MFI_BBU_STATE_CHARGE_ACTIVE) {
+		printf("%s CHARGING", comma ? "," : "");
+		comma = 1;
+	}
+	if (stat.fw_status & MFI_BBU_STATE_DISCHARGE_ACTIVE) {
+		printf("%s DISCHARGING", comma ? "," : "");
+	}
+	if (!comma)
+		printf(" normal");
+	printf("\n");
+	switch (stat.battery_type) {
+	case MFI_BBU_TYPE_BBU:
+		printf("      State of Health: %s\n",
+		    stat.detail.bbu.is_SOH_good ? "good" : "bad");
+		break;
+	}
 
 	close(fd);
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 19:19:40 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD855106564A;
	Thu, 17 Mar 2011 19:19:40 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 57E438FC12;
	Thu, 17 Mar 2011 19:19:40 +0000 (UTC)
Received: from [127.0.0.1] (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p2HJB06h025295;
	Thu, 17 Mar 2011 13:11:03 -0600 (MDT) (envelope-from imp@bsdimp.com)
Message-ID: <4D825CC2.1020305@bsdimp.com>
Date: Thu, 17 Mar 2011 13:10:58 -0600
From: Warner Losh 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7
MIME-Version: 1.0
To: Jilles Tjoelker 
References: <201103122113.p2CLD8LO030205@svn.freebsd.org>
	<20110312230830.GA269@stack.nl>
In-Reply-To: <20110312230830.GA269@stack.nl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	Doug Barton , src-committers@FreeBSD.org
Subject: Re: svn commit: r219578 - head/etc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 19:19:40 -0000

On 03/12/2011 16:08, Jilles Tjoelker wrote:
> On Sat, Mar 12, 2011 at 09:13:08PM +0000, Doug Barton wrote:
>> Author: dougb
>> Date: Sat Mar 12 21:13:08 2011
>> New Revision: 219578
>> URL: http://svn.freebsd.org/changeset/base/219578
>> Log:
>>    Use the allexport option in load_rc_config() in order to avoid having
>>    to repeatedly read the conf files. Depending on what is enabled the
>>    files are being read anywhere from 15, 30, or more times currently.
>>    By loading the values in the environment this is reduced to 1, with
>>    perhaps a couple more, again depending on what is enabled.
> I wonder if it is a good idea to pollute the environment of many daemons
> with this. Although sshd and cron clean it up, there is at least one
> daemon that passes the environment on. One of those is devd. While that
> saves four /etc/rc.conf reads on my minimalistic 9-current VM, it
> implies that devd must be restarted to pick up changes to /etc/rc.conf.
> That seems a POLA violation.

devd shouldn't be passing this to its children.  imho, devd should be 
fixed to be more robust.

Warner


From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 19:44:01 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1E899106564A;
	Thu, 17 Mar 2011 19:44:01 +0000 (UTC)
	(envelope-from andreast@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 105438FC15;
	Thu, 17 Mar 2011 19:44: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 p2HJi0sg037118;
	Thu, 17 Mar 2011 19:44:00 GMT
	(envelope-from andreast@svn.freebsd.org)
Received: (from andreast@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HJi04u037115;
	Thu, 17 Mar 2011 19:44:00 GMT
	(envelope-from andreast@svn.freebsd.org)
Message-Id: <201103171944.p2HJi04u037115@svn.freebsd.org>
From: Andreas Tobler 
Date: Thu, 17 Mar 2011 19:44:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219718 - head/sys/powerpc/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 19:44:01 -0000

Author: andreast
Date: Thu Mar 17 19:44:00 2011
New Revision: 219718
URL: http://svn.freebsd.org/changeset/base/219718

Log:
  Remove duplicate definition of FIRSTARG.
  
  Approved by:	nwhitehorn (mentor)

Modified:
  head/sys/powerpc/include/frame.h

Modified: head/sys/powerpc/include/frame.h
==============================================================================
--- head/sys/powerpc/include/frame.h	Thu Mar 17 17:29:46 2011	(r219717)
+++ head/sys/powerpc/include/frame.h	Thu Mar 17 19:44:00 2011	(r219718)
@@ -107,9 +107,6 @@ struct callframe {
 
 /* Definitions for syscalls */
 #define	FIRSTARG	3				/* first arg in reg 3 */
-
-/* Definitions for syscalls */
-#define	FIRSTARG	3				/* first arg in reg 3 */
 #define	NARGREG		8				/* 8 args in regs */
 #define	MOREARGS(sp)	((caddr_t)((uintptr_t)(sp) + \
     sizeof(struct callframe) - 3*sizeof(register_t))) /* more args go here */

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 19:47:30 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4906B106564A;
	Thu, 17 Mar 2011 19:47:30 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3875B8FC18;
	Thu, 17 Mar 2011 19:47: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 p2HJlUlP037303;
	Thu, 17 Mar 2011 19:47:30 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HJlTYg037228;
	Thu, 17 Mar 2011 19:47:29 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201103171947.p2HJlTYg037228@svn.freebsd.org>
From: Ed Schouten 
Date: Thu, 17 Mar 2011 19:47:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219719 - in vendor/compiler-rt/dist: . lib lib/arm
	lib/i386 lib/ppc lib/x86_64 make make/platform test/Unit www
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 19:47:30 -0000

Author: ed
Date: Thu Mar 17 19:47:28 2011
New Revision: 219719
URL: http://svn.freebsd.org/changeset/base/219719

Log:
  Import compiler-rt r127823.
  
  Changes:
  
  - License change; now it's also dual licensed under the MIT licence.
  - Addition of divmodsi4 and udivmodsi4.

Added:
  vendor/compiler-rt/dist/lib/arm/softfloat-alias.list
  vendor/compiler-rt/dist/lib/divmodsi4.c
  vendor/compiler-rt/dist/lib/udivmodsi4.c
  vendor/compiler-rt/dist/test/Unit/divmodsi4_test.c
  vendor/compiler-rt/dist/test/Unit/udivmodsi4_test.c
Modified:
  vendor/compiler-rt/dist/CREDITS.TXT
  vendor/compiler-rt/dist/LICENSE.TXT
  vendor/compiler-rt/dist/README.txt
  vendor/compiler-rt/dist/lib/absvdi2.c
  vendor/compiler-rt/dist/lib/absvsi2.c
  vendor/compiler-rt/dist/lib/absvti2.c
  vendor/compiler-rt/dist/lib/adddf3.c
  vendor/compiler-rt/dist/lib/addsf3.c
  vendor/compiler-rt/dist/lib/addvdi3.c
  vendor/compiler-rt/dist/lib/addvsi3.c
  vendor/compiler-rt/dist/lib/addvti3.c
  vendor/compiler-rt/dist/lib/apple_versioning.c
  vendor/compiler-rt/dist/lib/arm/adddf3vfp.S
  vendor/compiler-rt/dist/lib/arm/addsf3vfp.S
  vendor/compiler-rt/dist/lib/arm/bswapdi2.S
  vendor/compiler-rt/dist/lib/arm/bswapsi2.S
  vendor/compiler-rt/dist/lib/arm/comparesf2.S
  vendor/compiler-rt/dist/lib/arm/divdf3vfp.S
  vendor/compiler-rt/dist/lib/arm/divsf3vfp.S
  vendor/compiler-rt/dist/lib/arm/eqdf2vfp.S
  vendor/compiler-rt/dist/lib/arm/eqsf2vfp.S
  vendor/compiler-rt/dist/lib/arm/extendsfdf2vfp.S
  vendor/compiler-rt/dist/lib/arm/fixdfsivfp.S
  vendor/compiler-rt/dist/lib/arm/fixsfsivfp.S
  vendor/compiler-rt/dist/lib/arm/fixunsdfsivfp.S
  vendor/compiler-rt/dist/lib/arm/fixunssfsivfp.S
  vendor/compiler-rt/dist/lib/arm/floatsidfvfp.S
  vendor/compiler-rt/dist/lib/arm/floatsisfvfp.S
  vendor/compiler-rt/dist/lib/arm/floatunssidfvfp.S
  vendor/compiler-rt/dist/lib/arm/floatunssisfvfp.S
  vendor/compiler-rt/dist/lib/arm/gedf2vfp.S
  vendor/compiler-rt/dist/lib/arm/gesf2vfp.S
  vendor/compiler-rt/dist/lib/arm/gtdf2vfp.S
  vendor/compiler-rt/dist/lib/arm/gtsf2vfp.S
  vendor/compiler-rt/dist/lib/arm/ledf2vfp.S
  vendor/compiler-rt/dist/lib/arm/lesf2vfp.S
  vendor/compiler-rt/dist/lib/arm/ltdf2vfp.S
  vendor/compiler-rt/dist/lib/arm/ltsf2vfp.S
  vendor/compiler-rt/dist/lib/arm/modsi3.S
  vendor/compiler-rt/dist/lib/arm/muldf3vfp.S
  vendor/compiler-rt/dist/lib/arm/mulsf3vfp.S
  vendor/compiler-rt/dist/lib/arm/nedf2vfp.S
  vendor/compiler-rt/dist/lib/arm/negdf2vfp.S
  vendor/compiler-rt/dist/lib/arm/negsf2vfp.S
  vendor/compiler-rt/dist/lib/arm/nesf2vfp.S
  vendor/compiler-rt/dist/lib/arm/restore_vfp_d8_d15_regs.S
  vendor/compiler-rt/dist/lib/arm/save_vfp_d8_d15_regs.S
  vendor/compiler-rt/dist/lib/arm/subdf3vfp.S
  vendor/compiler-rt/dist/lib/arm/subsf3vfp.S
  vendor/compiler-rt/dist/lib/arm/switch16.S
  vendor/compiler-rt/dist/lib/arm/switch32.S
  vendor/compiler-rt/dist/lib/arm/switch8.S
  vendor/compiler-rt/dist/lib/arm/switchu8.S
  vendor/compiler-rt/dist/lib/arm/sync_synchronize.S
  vendor/compiler-rt/dist/lib/arm/truncdfsf2vfp.S
  vendor/compiler-rt/dist/lib/arm/unorddf2vfp.S
  vendor/compiler-rt/dist/lib/arm/unordsf2vfp.S
  vendor/compiler-rt/dist/lib/ashldi3.c
  vendor/compiler-rt/dist/lib/ashlti3.c
  vendor/compiler-rt/dist/lib/ashrdi3.c
  vendor/compiler-rt/dist/lib/ashrti3.c
  vendor/compiler-rt/dist/lib/assembly.h
  vendor/compiler-rt/dist/lib/clear_cache.c
  vendor/compiler-rt/dist/lib/clzdi2.c
  vendor/compiler-rt/dist/lib/clzsi2.c
  vendor/compiler-rt/dist/lib/clzti2.c
  vendor/compiler-rt/dist/lib/cmpdi2.c
  vendor/compiler-rt/dist/lib/cmpti2.c
  vendor/compiler-rt/dist/lib/comparedf2.c
  vendor/compiler-rt/dist/lib/comparesf2.c
  vendor/compiler-rt/dist/lib/ctzdi2.c
  vendor/compiler-rt/dist/lib/ctzsi2.c
  vendor/compiler-rt/dist/lib/ctzti2.c
  vendor/compiler-rt/dist/lib/divdc3.c
  vendor/compiler-rt/dist/lib/divdf3.c
  vendor/compiler-rt/dist/lib/divdi3.c
  vendor/compiler-rt/dist/lib/divsc3.c
  vendor/compiler-rt/dist/lib/divsf3.c
  vendor/compiler-rt/dist/lib/divsi3.c
  vendor/compiler-rt/dist/lib/divti3.c
  vendor/compiler-rt/dist/lib/divxc3.c
  vendor/compiler-rt/dist/lib/enable_execute_stack.c
  vendor/compiler-rt/dist/lib/endianness.h
  vendor/compiler-rt/dist/lib/eprintf.c
  vendor/compiler-rt/dist/lib/extendsfdf2.c
  vendor/compiler-rt/dist/lib/ffsdi2.c
  vendor/compiler-rt/dist/lib/ffsti2.c
  vendor/compiler-rt/dist/lib/fixdfdi.c
  vendor/compiler-rt/dist/lib/fixdfsi.c
  vendor/compiler-rt/dist/lib/fixdfti.c
  vendor/compiler-rt/dist/lib/fixsfdi.c
  vendor/compiler-rt/dist/lib/fixsfsi.c
  vendor/compiler-rt/dist/lib/fixsfti.c
  vendor/compiler-rt/dist/lib/fixunsdfdi.c
  vendor/compiler-rt/dist/lib/fixunsdfsi.c
  vendor/compiler-rt/dist/lib/fixunsdfti.c
  vendor/compiler-rt/dist/lib/fixunssfdi.c
  vendor/compiler-rt/dist/lib/fixunssfsi.c
  vendor/compiler-rt/dist/lib/fixunssfti.c
  vendor/compiler-rt/dist/lib/fixunsxfdi.c
  vendor/compiler-rt/dist/lib/fixunsxfsi.c
  vendor/compiler-rt/dist/lib/fixunsxfti.c
  vendor/compiler-rt/dist/lib/fixxfdi.c
  vendor/compiler-rt/dist/lib/fixxfti.c
  vendor/compiler-rt/dist/lib/floatdidf.c
  vendor/compiler-rt/dist/lib/floatdisf.c
  vendor/compiler-rt/dist/lib/floatdixf.c
  vendor/compiler-rt/dist/lib/floatsidf.c
  vendor/compiler-rt/dist/lib/floatsisf.c
  vendor/compiler-rt/dist/lib/floattidf.c
  vendor/compiler-rt/dist/lib/floattisf.c
  vendor/compiler-rt/dist/lib/floattixf.c
  vendor/compiler-rt/dist/lib/floatundidf.c
  vendor/compiler-rt/dist/lib/floatundisf.c
  vendor/compiler-rt/dist/lib/floatundixf.c
  vendor/compiler-rt/dist/lib/floatunsidf.c
  vendor/compiler-rt/dist/lib/floatunsisf.c
  vendor/compiler-rt/dist/lib/floatuntidf.c
  vendor/compiler-rt/dist/lib/floatuntisf.c
  vendor/compiler-rt/dist/lib/floatuntixf.c
  vendor/compiler-rt/dist/lib/fp_lib.h
  vendor/compiler-rt/dist/lib/gcc_personality_v0.c
  vendor/compiler-rt/dist/lib/i386/ashldi3.S
  vendor/compiler-rt/dist/lib/i386/ashrdi3.S
  vendor/compiler-rt/dist/lib/i386/divdi3.S
  vendor/compiler-rt/dist/lib/i386/floatdidf.S
  vendor/compiler-rt/dist/lib/i386/floatdisf.S
  vendor/compiler-rt/dist/lib/i386/floatdixf.S
  vendor/compiler-rt/dist/lib/i386/floatundidf.S
  vendor/compiler-rt/dist/lib/i386/floatundisf.S
  vendor/compiler-rt/dist/lib/i386/floatundixf.S
  vendor/compiler-rt/dist/lib/i386/lshrdi3.S
  vendor/compiler-rt/dist/lib/i386/moddi3.S
  vendor/compiler-rt/dist/lib/i386/muldi3.S
  vendor/compiler-rt/dist/lib/i386/udivdi3.S
  vendor/compiler-rt/dist/lib/i386/umoddi3.S
  vendor/compiler-rt/dist/lib/int_lib.h
  vendor/compiler-rt/dist/lib/lshrdi3.c
  vendor/compiler-rt/dist/lib/lshrti3.c
  vendor/compiler-rt/dist/lib/moddi3.c
  vendor/compiler-rt/dist/lib/modsi3.c
  vendor/compiler-rt/dist/lib/modti3.c
  vendor/compiler-rt/dist/lib/muldc3.c
  vendor/compiler-rt/dist/lib/muldf3.c
  vendor/compiler-rt/dist/lib/muldi3.c
  vendor/compiler-rt/dist/lib/mulsc3.c
  vendor/compiler-rt/dist/lib/mulsf3.c
  vendor/compiler-rt/dist/lib/multi3.c
  vendor/compiler-rt/dist/lib/mulvdi3.c
  vendor/compiler-rt/dist/lib/mulvsi3.c
  vendor/compiler-rt/dist/lib/mulvti3.c
  vendor/compiler-rt/dist/lib/mulxc3.c
  vendor/compiler-rt/dist/lib/negdf2.c
  vendor/compiler-rt/dist/lib/negdi2.c
  vendor/compiler-rt/dist/lib/negsf2.c
  vendor/compiler-rt/dist/lib/negti2.c
  vendor/compiler-rt/dist/lib/negvdi2.c
  vendor/compiler-rt/dist/lib/negvsi2.c
  vendor/compiler-rt/dist/lib/negvti2.c
  vendor/compiler-rt/dist/lib/paritydi2.c
  vendor/compiler-rt/dist/lib/paritysi2.c
  vendor/compiler-rt/dist/lib/parityti2.c
  vendor/compiler-rt/dist/lib/popcountdi2.c
  vendor/compiler-rt/dist/lib/popcountsi2.c
  vendor/compiler-rt/dist/lib/popcountti2.c
  vendor/compiler-rt/dist/lib/powidf2.c
  vendor/compiler-rt/dist/lib/powisf2.c
  vendor/compiler-rt/dist/lib/powitf2.c
  vendor/compiler-rt/dist/lib/powixf2.c
  vendor/compiler-rt/dist/lib/ppc/restFP.S
  vendor/compiler-rt/dist/lib/ppc/saveFP.S
  vendor/compiler-rt/dist/lib/subvdi3.c
  vendor/compiler-rt/dist/lib/subvsi3.c
  vendor/compiler-rt/dist/lib/subvti3.c
  vendor/compiler-rt/dist/lib/trampoline_setup.c
  vendor/compiler-rt/dist/lib/truncdfsf2.c
  vendor/compiler-rt/dist/lib/ucmpdi2.c
  vendor/compiler-rt/dist/lib/ucmpti2.c
  vendor/compiler-rt/dist/lib/udivdi3.c
  vendor/compiler-rt/dist/lib/udivmoddi4.c
  vendor/compiler-rt/dist/lib/udivmodti4.c
  vendor/compiler-rt/dist/lib/udivsi3.c
  vendor/compiler-rt/dist/lib/udivti3.c
  vendor/compiler-rt/dist/lib/umoddi3.c
  vendor/compiler-rt/dist/lib/umodsi3.c
  vendor/compiler-rt/dist/lib/umodti3.c
  vendor/compiler-rt/dist/lib/x86_64/floatundidf.S
  vendor/compiler-rt/dist/lib/x86_64/floatundisf.S
  vendor/compiler-rt/dist/lib/x86_64/floatundixf.S
  vendor/compiler-rt/dist/make/AppleBI.mk
  vendor/compiler-rt/dist/make/platform/clang_darwin.mk
  vendor/compiler-rt/dist/make/platform/darwin_bni.mk
  vendor/compiler-rt/dist/test/Unit/absvdi2_test.c
  vendor/compiler-rt/dist/test/Unit/absvsi2_test.c
  vendor/compiler-rt/dist/test/Unit/absvti2_test.c
  vendor/compiler-rt/dist/test/Unit/adddf3vfp_test.c
  vendor/compiler-rt/dist/test/Unit/addsf3vfp_test.c
  vendor/compiler-rt/dist/test/Unit/addvdi3_test.c
  vendor/compiler-rt/dist/test/Unit/addvsi3_test.c
  vendor/compiler-rt/dist/test/Unit/addvti3_test.c
  vendor/compiler-rt/dist/test/Unit/ashldi3_test.c
  vendor/compiler-rt/dist/test/Unit/ashlti3_test.c
  vendor/compiler-rt/dist/test/Unit/ashrdi3_test.c
  vendor/compiler-rt/dist/test/Unit/ashrti3_test.c
  vendor/compiler-rt/dist/test/Unit/bswapdi2_test.c
  vendor/compiler-rt/dist/test/Unit/bswapsi2_test.c
  vendor/compiler-rt/dist/test/Unit/clear_cache_test.c
  vendor/compiler-rt/dist/test/Unit/clzdi2_test.c
  vendor/compiler-rt/dist/test/Unit/clzsi2_test.c
  vendor/compiler-rt/dist/test/Unit/clzti2_test.c
  vendor/compiler-rt/dist/test/Unit/cmpdi2_test.c
  vendor/compiler-rt/dist/test/Unit/cmpti2_test.c
  vendor/compiler-rt/dist/test/Unit/comparedf2_test.c
  vendor/compiler-rt/dist/test/Unit/comparesf2_test.c
  vendor/compiler-rt/dist/test/Unit/ctzdi2_test.c
  vendor/compiler-rt/dist/test/Unit/ctzsi2_test.c
  vendor/compiler-rt/dist/test/Unit/ctzti2_test.c
  vendor/compiler-rt/dist/test/Unit/divdc3_test.c
  vendor/compiler-rt/dist/test/Unit/divdf3vfp_test.c
  vendor/compiler-rt/dist/test/Unit/divdi3_test.c
  vendor/compiler-rt/dist/test/Unit/divsc3_test.c
  vendor/compiler-rt/dist/test/Unit/divsf3vfp_test.c
  vendor/compiler-rt/dist/test/Unit/divsi3_test.c
  vendor/compiler-rt/dist/test/Unit/divtc3_test.c
  vendor/compiler-rt/dist/test/Unit/divti3_test.c
  vendor/compiler-rt/dist/test/Unit/divxc3_test.c
  vendor/compiler-rt/dist/test/Unit/enable_execute_stack_test.c
  vendor/compiler-rt/dist/test/Unit/endianness.h
  vendor/compiler-rt/dist/test/Unit/eqdf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/eqsf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/extebdsfdf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/ffsdi2_test.c
  vendor/compiler-rt/dist/test/Unit/ffsti2_test.c
  vendor/compiler-rt/dist/test/Unit/fixdfdi_test.c
  vendor/compiler-rt/dist/test/Unit/fixdfsivfp_test.c
  vendor/compiler-rt/dist/test/Unit/fixdfti_test.c
  vendor/compiler-rt/dist/test/Unit/fixsfdi_test.c
  vendor/compiler-rt/dist/test/Unit/fixsfsivfp_test.c
  vendor/compiler-rt/dist/test/Unit/fixsfti_test.c
  vendor/compiler-rt/dist/test/Unit/fixunsdfdi_test.c
  vendor/compiler-rt/dist/test/Unit/fixunsdfsi_test.c
  vendor/compiler-rt/dist/test/Unit/fixunsdfsivfp_test.c
  vendor/compiler-rt/dist/test/Unit/fixunsdfti_test.c
  vendor/compiler-rt/dist/test/Unit/fixunssfdi_test.c
  vendor/compiler-rt/dist/test/Unit/fixunssfsi_test.c
  vendor/compiler-rt/dist/test/Unit/fixunssfsivfp_test.c
  vendor/compiler-rt/dist/test/Unit/fixunssfti_test.c
  vendor/compiler-rt/dist/test/Unit/fixunstfdi_test.c
  vendor/compiler-rt/dist/test/Unit/fixunsxfdi_test.c
  vendor/compiler-rt/dist/test/Unit/fixunsxfsi_test.c
  vendor/compiler-rt/dist/test/Unit/fixunsxfti_test.c
  vendor/compiler-rt/dist/test/Unit/fixxfdi_test.c
  vendor/compiler-rt/dist/test/Unit/fixxfti_test.c
  vendor/compiler-rt/dist/test/Unit/floatdidf_test.c
  vendor/compiler-rt/dist/test/Unit/floatdisf_test.c
  vendor/compiler-rt/dist/test/Unit/floatdixf_test.c
  vendor/compiler-rt/dist/test/Unit/floatsidfvfp_test.c
  vendor/compiler-rt/dist/test/Unit/floatsisfvfp_test.c
  vendor/compiler-rt/dist/test/Unit/floattidf_test.c
  vendor/compiler-rt/dist/test/Unit/floattisf_test.c
  vendor/compiler-rt/dist/test/Unit/floattixf_test.c
  vendor/compiler-rt/dist/test/Unit/floatundidf_test.c
  vendor/compiler-rt/dist/test/Unit/floatundisf_test.c
  vendor/compiler-rt/dist/test/Unit/floatundixf_test.c
  vendor/compiler-rt/dist/test/Unit/floatunssidfvfp_test.c
  vendor/compiler-rt/dist/test/Unit/floatunssisfvfp_test.c
  vendor/compiler-rt/dist/test/Unit/floatuntidf_test.c
  vendor/compiler-rt/dist/test/Unit/floatuntisf_test.c
  vendor/compiler-rt/dist/test/Unit/floatuntixf_test.c
  vendor/compiler-rt/dist/test/Unit/gcc_personality_test.c
  vendor/compiler-rt/dist/test/Unit/gcc_personality_test_helper.cxx
  vendor/compiler-rt/dist/test/Unit/gedf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/gesf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/gtdf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/gtsf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/ledf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/lesf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/lshrdi3_test.c
  vendor/compiler-rt/dist/test/Unit/lshrti3_test.c
  vendor/compiler-rt/dist/test/Unit/ltdf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/ltsf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/moddi3_test.c
  vendor/compiler-rt/dist/test/Unit/modsi3_test.c
  vendor/compiler-rt/dist/test/Unit/modti3_test.c
  vendor/compiler-rt/dist/test/Unit/muldc3_test.c
  vendor/compiler-rt/dist/test/Unit/muldf3vfp_test.c
  vendor/compiler-rt/dist/test/Unit/muldi3_test.c
  vendor/compiler-rt/dist/test/Unit/mulsc3_test.c
  vendor/compiler-rt/dist/test/Unit/mulsf3vfp_test.c
  vendor/compiler-rt/dist/test/Unit/multc3_test.c
  vendor/compiler-rt/dist/test/Unit/multi3_test.c
  vendor/compiler-rt/dist/test/Unit/mulvdi3_test.c
  vendor/compiler-rt/dist/test/Unit/mulvsi3_test.c
  vendor/compiler-rt/dist/test/Unit/mulvti3_test.c
  vendor/compiler-rt/dist/test/Unit/mulxc3_test.c
  vendor/compiler-rt/dist/test/Unit/nedf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/negdf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/negdi2_test.c
  vendor/compiler-rt/dist/test/Unit/negsf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/negti2_test.c
  vendor/compiler-rt/dist/test/Unit/negvdi2_test.c
  vendor/compiler-rt/dist/test/Unit/negvsi2_test.c
  vendor/compiler-rt/dist/test/Unit/negvti2_test.c
  vendor/compiler-rt/dist/test/Unit/nesf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/paritydi2_test.c
  vendor/compiler-rt/dist/test/Unit/paritysi2_test.c
  vendor/compiler-rt/dist/test/Unit/parityti2_test.c
  vendor/compiler-rt/dist/test/Unit/popcountdi2_test.c
  vendor/compiler-rt/dist/test/Unit/popcountsi2_test.c
  vendor/compiler-rt/dist/test/Unit/popcountti2_test.c
  vendor/compiler-rt/dist/test/Unit/powidf2_test.c
  vendor/compiler-rt/dist/test/Unit/powisf2_test.c
  vendor/compiler-rt/dist/test/Unit/powitf2_test.c
  vendor/compiler-rt/dist/test/Unit/powixf2_test.c
  vendor/compiler-rt/dist/test/Unit/subdf3vfp_test.c
  vendor/compiler-rt/dist/test/Unit/subsf3vfp_test.c
  vendor/compiler-rt/dist/test/Unit/subvdi3_test.c
  vendor/compiler-rt/dist/test/Unit/subvsi3_test.c
  vendor/compiler-rt/dist/test/Unit/subvti3_test.c
  vendor/compiler-rt/dist/test/Unit/trampoline_setup_test.c
  vendor/compiler-rt/dist/test/Unit/truncdfsf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/ucmpdi2_test.c
  vendor/compiler-rt/dist/test/Unit/ucmpti2_test.c
  vendor/compiler-rt/dist/test/Unit/udivdi3_test.c
  vendor/compiler-rt/dist/test/Unit/udivmoddi4_test.c
  vendor/compiler-rt/dist/test/Unit/udivmodti4_test.c
  vendor/compiler-rt/dist/test/Unit/udivsi3_test.c
  vendor/compiler-rt/dist/test/Unit/udivti3_test.c
  vendor/compiler-rt/dist/test/Unit/umoddi3_test.c
  vendor/compiler-rt/dist/test/Unit/umodsi3_test.c
  vendor/compiler-rt/dist/test/Unit/umodti3_test.c
  vendor/compiler-rt/dist/test/Unit/unorddf2vfp_test.c
  vendor/compiler-rt/dist/test/Unit/unordsf2vfp_test.c
  vendor/compiler-rt/dist/www/index.html

Modified: vendor/compiler-rt/dist/CREDITS.TXT
==============================================================================
--- vendor/compiler-rt/dist/CREDITS.TXT	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/CREDITS.TXT	Thu Mar 17 19:47:28 2011	(r219719)
@@ -19,3 +19,6 @@ W: http://www.auroraux.org
 D: CMake'ify Compiler-RT build system
 D: Maintain Solaris & AuroraUX ports of Compiler-RT
 
+N: Howard Hinnant
+E: hhinnant@apple.com
+D: Architect and primary author of compiler-rt

Modified: vendor/compiler-rt/dist/LICENSE.TXT
==============================================================================
--- vendor/compiler-rt/dist/LICENSE.TXT	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/LICENSE.TXT	Thu Mar 17 19:47:28 2011	(r219719)
@@ -1,10 +1,21 @@
 ==============================================================================
-LLVM Release License
+compiler_rt License
 ==============================================================================
+
+The compiler_rt library is dual licensed under both the University of Illinois
+"BSD-Like" license and the MIT license.  As a user of this code you may choose
+to use it under either license.  As a contributor, you agree to allow your code
+to be used under both.
+
+Full text of the relevant licenses is included below.
+
+==============================================================================
+
 University of Illinois/NCSA
 Open Source License
 
-Copyright (c) 2003-2009 University of Illinois at Urbana-Champaign.
+Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
+
 All rights reserved.
 
 Developed by:
@@ -43,21 +54,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWAR
 SOFTWARE.
 
 ==============================================================================
-Copyrights and Licenses for Third Party Software Distributed with LLVM:
-==============================================================================
-The LLVM software contains code written by third parties.  Such software will
-have its own individual LICENSE.TXT file in the directory in which it appears.
-This file will describe the copyrights, license, and restrictions which apply
-to that code.
-
-The disclaimer of warranty in the University of Illinois Open Source License
-applies to all code in the LLVM Distribution, and nothing in any of the
-other licenses gives permission to use the names of the LLVM Team or the
-University of Illinois to endorse or promote products derived from this
-Software.
 
-The following pieces of software have additional or alternate copyrights,
-licenses, and/or restrictions:
+Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
 
-Program             Directory
--------             ---------
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

Modified: vendor/compiler-rt/dist/README.txt
==============================================================================
--- vendor/compiler-rt/dist/README.txt	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/README.txt	Thu Mar 17 19:47:28 2011	(r219719)
@@ -77,8 +77,12 @@ ti_int __modti3    (ti_int a, ti_int b);
 su_int __umodsi3   (su_int a, su_int b);               // a % b   unsigned
 du_int __umoddi3   (du_int a, du_int b);               // a % b   unsigned
 tu_int __umodti3   (tu_int a, tu_int b);               // a % b   unsigned
-du_int __udivmoddi4(du_int a, du_int b, du_int* rem);  // a / b, *rem = a % b
-tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);  // a / b, *rem = a % b
+du_int __udivmoddi4(du_int a, du_int b, du_int* rem);  // a / b, *rem = a % b  unsigned
+tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);  // a / b, *rem = a % b  unsigned
+su_int __udivmodsi4(su_int a, su_int b, su_int* rem);  // a / b, *rem = a % b  unsigned
+si_int __divmodsi4(si_int a, si_int b, si_int* rem);   // a / b, *rem = a % b  signed
+
+
 
 //  Integral arithmetic with trapping overflow
 

Modified: vendor/compiler-rt/dist/lib/absvdi2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/absvdi2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/absvdi2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  *===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/absvsi2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/absvsi2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/absvsi2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/absvti2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/absvti2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/absvti2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/adddf3.c
==============================================================================
--- vendor/compiler-rt/dist/lib/adddf3.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/adddf3.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //

Modified: vendor/compiler-rt/dist/lib/addsf3.c
==============================================================================
--- vendor/compiler-rt/dist/lib/addsf3.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/addsf3.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //

Modified: vendor/compiler-rt/dist/lib/addvdi3.c
==============================================================================
--- vendor/compiler-rt/dist/lib/addvdi3.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/addvdi3.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/addvsi3.c
==============================================================================
--- vendor/compiler-rt/dist/lib/addvsi3.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/addvsi3.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                    The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/addvti3.c
==============================================================================
--- vendor/compiler-rt/dist/lib/addvti3.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/addvti3.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/apple_versioning.c
==============================================================================
--- vendor/compiler-rt/dist/lib/apple_versioning.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/apple_versioning.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  */

Modified: vendor/compiler-rt/dist/lib/arm/adddf3vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/adddf3vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/adddf3vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/addsf3vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/addsf3vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/addsf3vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/bswapdi2.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/bswapdi2.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/bswapdi2.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/bswapsi2.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/bswapsi2.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/bswapsi2.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/comparesf2.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/comparesf2.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/comparesf2.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //

Modified: vendor/compiler-rt/dist/lib/arm/divdf3vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/divdf3vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/divdf3vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/divsf3vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/divsf3vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/divsf3vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/eqdf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/eqdf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/eqdf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/eqsf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/eqsf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/eqsf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/extendsfdf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/extendsfdf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/extendsfdf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/fixdfsivfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/fixdfsivfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/fixdfsivfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/fixsfsivfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/fixsfsivfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/fixsfsivfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/fixunsdfsivfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/fixunsdfsivfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/fixunsdfsivfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/fixunssfsivfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/fixunssfsivfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/fixunssfsivfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/floatsidfvfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/floatsidfvfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/floatsidfvfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/floatsisfvfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/floatsisfvfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/floatsisfvfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/floatunssidfvfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/floatunssidfvfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/floatunssidfvfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/floatunssisfvfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/floatunssisfvfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/floatunssisfvfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/gedf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/gedf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/gedf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/gesf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/gesf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/gesf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/gtdf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/gtdf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/gtdf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/gtsf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/gtsf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/gtsf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/ledf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/ledf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/ledf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/lesf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/lesf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/lesf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/ltdf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/ltdf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/ltdf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/ltsf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/ltsf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/ltsf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/modsi3.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/modsi3.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/modsi3.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/muldf3vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/muldf3vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/muldf3vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/mulsf3vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/mulsf3vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/mulsf3vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/nedf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/nedf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/nedf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/negdf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/negdf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/negdf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/negsf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/negsf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/negsf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/nesf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/nesf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/nesf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/restore_vfp_d8_d15_regs.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/restore_vfp_d8_d15_regs.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/restore_vfp_d8_d15_regs.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/save_vfp_d8_d15_regs.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/save_vfp_d8_d15_regs.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/save_vfp_d8_d15_regs.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Added: vendor/compiler-rt/dist/lib/arm/softfloat-alias.list
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/lib/arm/softfloat-alias.list	Thu Mar 17 19:47:28 2011	(r219719)
@@ -0,0 +1,21 @@
+#
+# These are soft float functions which can be 
+# aliased to the *vfp functions on arm processors
+# that support floating point instructions.
+#
+___adddf3vfp		___adddf3
+___addsf3vfp		___addsf3
+___divdf3vfp		___divdf3
+___divsf3vfp		___divsf3
+___extendsfdf2vfp	___extendsfdf2
+___fixdfsivfp		___fixdfsi
+___fixsfsivfp		___fixsfsi
+___floatsidfvfp		___floatsidf
+___floatsisfvfp		___floatsisf
+___muldf3vfp		___muldf3
+___mulsf3vfp		___mulsf3
+___subdf3vfp		___subdf3
+___subsf3vfp		___subsf3
+___truncdfsf2vfp	___truncdfsf2
+___floatunssidfvfp	___floatunsidf
+___floatunssisfvfp	___floatunsisf

Modified: vendor/compiler-rt/dist/lib/arm/subdf3vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/subdf3vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/subdf3vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/subsf3vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/subsf3vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/subsf3vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/switch16.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/switch16.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/switch16.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/switch32.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/switch32.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/switch32.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/switch8.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/switch8.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/switch8.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/switchu8.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/switchu8.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/switchu8.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/sync_synchronize.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/sync_synchronize.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/sync_synchronize.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/truncdfsf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/truncdfsf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/truncdfsf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/unorddf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/unorddf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/unorddf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/arm/unordsf2vfp.S
==============================================================================
--- vendor/compiler-rt/dist/lib/arm/unordsf2vfp.S	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/arm/unordsf2vfp.S	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 

Modified: vendor/compiler-rt/dist/lib/ashldi3.c
==============================================================================
--- vendor/compiler-rt/dist/lib/ashldi3.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/ashldi3.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/ashlti3.c
==============================================================================
--- vendor/compiler-rt/dist/lib/ashlti3.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/ashlti3.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/ashrdi3.c
==============================================================================
--- vendor/compiler-rt/dist/lib/ashrdi3.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/ashrdi3.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/ashrti3.c
==============================================================================
--- vendor/compiler-rt/dist/lib/ashrti3.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/ashrti3.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/assembly.h
==============================================================================
--- vendor/compiler-rt/dist/lib/assembly.h	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/assembly.h	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/clear_cache.c
==============================================================================
--- vendor/compiler-rt/dist/lib/clear_cache.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/clear_cache.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  */

Modified: vendor/compiler-rt/dist/lib/clzdi2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/clzdi2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/clzdi2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *      	       The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/clzsi2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/clzsi2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/clzsi2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *      	       The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/clzti2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/clzti2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/clzti2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *      	       The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/cmpdi2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/cmpdi2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/cmpdi2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  * 

Modified: vendor/compiler-rt/dist/lib/cmpti2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/cmpti2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/cmpti2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

Modified: vendor/compiler-rt/dist/lib/comparedf2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/comparedf2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/comparedf2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //

Modified: vendor/compiler-rt/dist/lib/comparesf2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/comparesf2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/comparesf2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //

Modified: vendor/compiler-rt/dist/lib/ctzdi2.c
==============================================================================
--- vendor/compiler-rt/dist/lib/ctzdi2.c	Thu Mar 17 19:44:00 2011	(r219718)
+++ vendor/compiler-rt/dist/lib/ctzdi2.c	Thu Mar 17 19:47:28 2011	(r219719)
@@ -2,8 +2,8 @@
  *
  *                     The LLVM Compiler Infrastructure
  *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
  *

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

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 19:48:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EC423106566C;
	Thu, 17 Mar 2011 19:48:31 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C53218FC14;
	Thu, 17 Mar 2011 19:48: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 p2HJmV4A037364;
	Thu, 17 Mar 2011 19:48:31 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HJmVcc037363;
	Thu, 17 Mar 2011 19:48:31 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201103171948.p2HJmVcc037363@svn.freebsd.org>
From: Ed Schouten 
Date: Thu, 17 Mar 2011 19:48:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219720 - vendor/compiler-rt/compiler-rt-r127823
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 19:48:32 -0000

Author: ed
Date: Thu Mar 17 19:48:31 2011
New Revision: 219720
URL: http://svn.freebsd.org/changeset/base/219720

Log:
  Tag compiler-rt r127823.

Added:
  vendor/compiler-rt/compiler-rt-r127823/
     - copied from r219719, vendor/compiler-rt/dist/

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 20:33:32 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5A92F106564A;
	Thu, 17 Mar 2011 20:33:32 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from fallbackmx09.syd.optusnet.com.au
	(fallbackmx09.syd.optusnet.com.au [211.29.132.242])
	by mx1.freebsd.org (Postfix) with ESMTP id DA5548FC16;
	Thu, 17 Mar 2011 20:33:31 +0000 (UTC)
Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au
	[211.29.132.194])
	by fallbackmx09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2HJvbOW020767; Fri, 18 Mar 2011 06:57:37 +1100
Received: from server.vk2pj.dyndns.org
	(c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103])
	by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2HJvVH8009828
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 18 Mar 2011 06:57:32 +1100
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p2HJvVV2066002;
	Fri, 18 Mar 2011 06:57:31 +1100 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p2HJvTJk066001;
	Fri, 18 Mar 2011 06:57:29 +1100 (EST) (envelope-from peter)
Date: Fri, 18 Mar 2011 06:57:29 +1100
From: Peter Jeremy 
To: Jung-uk Kim 
Message-ID: <20110317195729.GA65858@server.vk2pj.dyndns.org>
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<201103161233.16347.jkim@FreeBSD.org>
	<20110316174553.GA6367@freebsd.org>
	<201103161634.08104.jkim@FreeBSD.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR"
Content-Disposition: inline
In-Reply-To: <201103161634.08104.jkim@FreeBSD.org>
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: src-committers@FreeBSD.org, Roman Divacky ,
	Bruce Evans , svn-src-head@FreeBSD.org,
	svn-src-all@FreeBSD.org, Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 20:33:32 -0000


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

On 2011-Mar-16 16:34:04 -0400, Jung-uk Kim  wrote:
>On Wednesday 16 March 2011 01:45 pm, Roman Divacky wrote:
>> if we drop i486 I think it makes sense to require something that
>> has at least SSE2, thus we can have the same expectations as on
>> amd64.

I think it's stil a bit early for that - especially the SSE2 requirement.

>This is a proof-of-concept patch for sys/x86/isa/clock.c:
>
>http://people.freebsd.org/~jkim/clock.diff
>
>You see the complexity, just because I wanted to load 64-bit value=20
>atomically... :-(

An alternative approach is to have _fetch_frequency() be
  uint64_t (*_fetch_frequency)(uint64_t *);
if i386 and I486 are defined (otherwise it's just the #define (*(p)))
then initialise it to either atomic_fetch_quad_i386 or
atomic_fetch_quad_i586 as part of the CPU detection process.  This is
the way bcopy() is/was handled on Pentium.

Another approach would be to always have cmpxchg8b instructions
(followed by a suitably large NOP) always inlined in the code and if
it traps, patch the code to call a function that emulates it.

--=20
Peter Jeremy

--T4sUOijqQbZv57TR
Content-Type: application/pgp-signature

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

iEYEARECAAYFAk2CZ6kACgkQ/opHv/APuIf4HgCglRSBF80GZRoaO3asSrakTbct
VKoAoI9R8PNjJjwCUnvVIyuvNqobcboa
=7WMx
-----END PGP SIGNATURE-----

--T4sUOijqQbZv57TR--

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 20:38:09 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6F8101065670;
	Thu, 17 Mar 2011 20:38:09 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from fallbackmx07.syd.optusnet.com.au
	(fallbackmx07.syd.optusnet.com.au [211.29.132.9])
	by mx1.freebsd.org (Postfix) with ESMTP id DA5528FC13;
	Thu, 17 Mar 2011 20:38:08 +0000 (UTC)
Received: from mail34.syd.optusnet.com.au (mail34.syd.optusnet.com.au
	[211.29.133.218])
	by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2HK1x5R029874; Fri, 18 Mar 2011 07:01:59 +1100
Received: from server.vk2pj.dyndns.org
	(c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103])
	by mail34.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2HK1uTE010377
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 18 Mar 2011 07:01:57 +1100
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p2HK1uKQ066041;
	Fri, 18 Mar 2011 07:01:56 +1100 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p2HK1u4j066040;
	Fri, 18 Mar 2011 07:01:56 +1100 (EST) (envelope-from peter)
Date: Fri, 18 Mar 2011 07:01:56 +1100
From: Peter Jeremy 
To: Jung-uk Kim 
Message-ID: <20110317200156.GB65858@server.vk2pj.dyndns.org>
References: <201103161644.p2GGi8ug098283@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="JYK4vJDZwFMowpUq"
Content-Disposition: inline
In-Reply-To: <201103161644.p2GGi8ug098283@svn.freebsd.org>
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219700 - head/sys/x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 20:38:09 -0000


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

On 2011-Mar-16 16:44:08 +0000, Jung-uk Kim  wrote:
>Log:
>  Revert r219676.

Thanks also.  For extra kudos, how about adding a similar function to
allow the HPET frequency to be over-ridden.  That is currently the
only timecounter that does not allow the user to compensate for
incorrect hardware frequencies.

--=20
Peter Jeremy

--JYK4vJDZwFMowpUq
Content-Type: application/pgp-signature

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

iEYEARECAAYFAk2CaLQACgkQ/opHv/APuIdzKACfbFHE1ASNvxCfT6zwY8OZD+3N
vl0Anj2+tcj89ypuwBh9IOe0XjU/d7Hb
=MmQ5
-----END PGP SIGNATURE-----

--JYK4vJDZwFMowpUq--

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 21:02:11 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 7D4A4106564A;
	Thu, 17 Mar 2011 21:02:10 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Peter Jeremy 
Date: Thu, 17 Mar 2011 17:01:55 -0400
User-Agent: KMail/1.6.2
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<201103161634.08104.jkim@FreeBSD.org>
	<20110317195729.GA65858@server.vk2pj.dyndns.org>
In-Reply-To: <20110317195729.GA65858@server.vk2pj.dyndns.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201103171701.57546.jkim@FreeBSD.org>
Cc: src-committers@freebsd.org, Roman Divacky ,
	Bruce Evans , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 21:02:11 -0000

On Thursday 17 March 2011 03:57 pm, Peter Jeremy wrote:
> On 2011-Mar-16 16:34:04 -0400, Jung-uk Kim  wrote:
> >On Wednesday 16 March 2011 01:45 pm, Roman Divacky wrote:
> >> if we drop i486 I think it makes sense to require something that
> >> has at least SSE2, thus we can have the same expectations as on
> >> amd64.
>
> I think it's stil a bit early for that - especially the SSE2
> requirement.
>
> >This is a proof-of-concept patch for sys/x86/isa/clock.c:
> >
> >http://people.freebsd.org/~jkim/clock.diff
> >
> >You see the complexity, just because I wanted to load 64-bit value
> >atomically... :-(
>
> An alternative approach is to have _fetch_frequency() be
>   uint64_t (*_fetch_frequency)(uint64_t *);
> if i386 and I486 are defined (otherwise it's just the #define
> (*(p))) then initialise it to either atomic_fetch_quad_i386 or
> atomic_fetch_quad_i586 as part of the CPU detection process.  This
> is the way bcopy() is/was handled on Pentium.
>
> Another approach would be to always have cmpxchg8b instructions
> (followed by a suitably large NOP) always inlined in the code and
> if it traps, patch the code to call a function that emulates it.

I think the former makes more sense for atomic read/write because we 
don't need complete cmpxchg8b support but kind of movq support, 
actually.

Thanks for the suggestion.

Jung-uk Kim

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 21:02:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E95BF106566C;
	Thu, 17 Mar 2011 21:02:14 +0000 (UTC)
	(envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D01758FC1A;
	Thu, 17 Mar 2011 21:02: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 p2HL2EUb039052;
	Thu, 17 Mar 2011 21:02:14 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HL2EMT039048;
	Thu, 17 Mar 2011 21:02:14 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201103172102.p2HL2EMT039048@svn.freebsd.org>
From: Mikolaj Golub 
Date: Thu, 17 Mar 2011 21:02:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219721 - head/sbin/hastd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 21:02:15 -0000

Author: trociny
Date: Thu Mar 17 21:02:14 2011
New Revision: 219721
URL: http://svn.freebsd.org/changeset/base/219721

Log:
  For secondary, set 2 * HAST_KEEPALIVE seconds timeout for incoming
  connection so the worker will exit if it does not receive packets from
  the primary during this interval.
  
  Reported by:	Christian Vogt 
  Tested by:	Christian Vogt 
  Approved by:	pjd (mentor)
  MFC after:	1 week

Modified:
  head/sbin/hastd/hast.h
  head/sbin/hastd/primary.c
  head/sbin/hastd/secondary.c

Modified: head/sbin/hastd/hast.h
==============================================================================
--- head/sbin/hastd/hast.h	Thu Mar 17 19:48:31 2011	(r219720)
+++ head/sbin/hastd/hast.h	Thu Mar 17 21:02:14 2011	(r219721)
@@ -98,6 +98,9 @@
 #define	HAST_ADDRSIZE	1024
 #define	HAST_TOKEN_SIZE	16
 
+/* Number of seconds to sleep between reconnect retries or keepalive packets. */
+#define	HAST_KEEPALIVE	10
+
 struct hastd_config {
 	/* Address to communicate with hastctl(8). */
 	char	 hc_controladdr[HAST_ADDRSIZE];

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c	Thu Mar 17 19:48:31 2011	(r219720)
+++ head/sbin/hastd/primary.c	Thu Mar 17 21:02:14 2011	(r219721)
@@ -150,10 +150,6 @@ static pthread_mutex_t metadata_lock;
  * and remote components.
  */
 #define	HAST_NCOMPONENTS	2
-/*
- * Number of seconds to sleep between reconnect retries or keepalive packets.
- */
-#define	RETRY_SLEEP		10
 
 #define	ISCONNECTED(res, no)	\
 	((res)->hr_remotein != NULL && (res)->hr_remoteout != NULL)
@@ -1318,10 +1314,10 @@ remote_send_thread(void *arg)
 
 	for (;;) {
 		pjdlog_debug(2, "remote_send: Taking request.");
-		QUEUE_TAKE1(hio, send, ncomp, RETRY_SLEEP);
+		QUEUE_TAKE1(hio, send, ncomp, HAST_KEEPALIVE);
 		if (hio == NULL) {
 			now = time(NULL);
-			if (lastcheck + RETRY_SLEEP <= now) {
+			if (lastcheck + HAST_KEEPALIVE <= now) {
 				keepalive_send(res, ncomp);
 				lastcheck = now;
 			}
@@ -2098,7 +2094,7 @@ guard_thread(void *arg)
 	PJDLOG_VERIFY(sigaddset(&mask, SIGINT) == 0);
 	PJDLOG_VERIFY(sigaddset(&mask, SIGTERM) == 0);
 
-	timeout.tv_sec = RETRY_SLEEP;
+	timeout.tv_sec = HAST_KEEPALIVE;
 	timeout.tv_nsec = 0;
 	signo = -1;
 
@@ -2116,7 +2112,7 @@ guard_thread(void *arg)
 
 		pjdlog_debug(2, "remote_guard: Checking connections.");
 		now = time(NULL);
-		if (lastcheck + RETRY_SLEEP <= now) {
+		if (lastcheck + HAST_KEEPALIVE <= now) {
 			for (ii = 0; ii < ncomps; ii++)
 				guard_one(res, ii);
 			lastcheck = now;

Modified: head/sbin/hastd/secondary.c
==============================================================================
--- head/sbin/hastd/secondary.c	Thu Mar 17 19:48:31 2011	(r219720)
+++ head/sbin/hastd/secondary.c	Thu Mar 17 21:02:14 2011	(r219721)
@@ -418,7 +418,7 @@ hastd_secondary(struct hast_resource *re
 	PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0);
 
 	/* Error in setting timeout is not critical, but why should it fail? */
-	if (proto_timeout(res->hr_remotein, 0) < 0)
+	if (proto_timeout(res->hr_remotein, 2 * HAST_KEEPALIVE) < 0)
 		pjdlog_errno(LOG_WARNING, "Unable to set connection timeout");
 	if (proto_timeout(res->hr_remoteout, res->hr_timeout) < 0)
 		pjdlog_errno(LOG_WARNING, "Unable to set connection timeout");

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 21:06:20 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 4A2581065675;
	Thu, 17 Mar 2011 21:06:20 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Peter Jeremy 
Date: Thu, 17 Mar 2011 17:06:09 -0400
User-Agent: KMail/1.6.2
References: <201103161644.p2GGi8ug098283@svn.freebsd.org>
	<20110317200156.GB65858@server.vk2pj.dyndns.org>
In-Reply-To: <20110317200156.GB65858@server.vk2pj.dyndns.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201103171706.12993.jkim@FreeBSD.org>
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219700 - head/sys/x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 21:06:20 -0000

On Thursday 17 March 2011 04:01 pm, Peter Jeremy wrote:
> On 2011-Mar-16 16:44:08 +0000, Jung-uk Kim  wrote:
> >Log:
> >  Revert r219676.
>
> Thanks also.  For extra kudos, how about adding a similar function
> to allow the HPET frequency to be over-ridden.  That is currently
> the only timecounter that does not allow the user to compensate for
> incorrect hardware frequencies.

I really hate the idea of adjusting timecounter frequency from 
userland.  I guess "use ntpd(8)" is not a good answer for some 
people. :-(

Jung-uk Kim

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 21:24:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 36A191065676;
	Thu, 17 Mar 2011 21:24:33 +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 283288FC24;
	Thu, 17 Mar 2011 21:24:33 +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 p2HLOXcl039528;
	Thu, 17 Mar 2011 21:24:33 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HLOX2S039526;
	Thu, 17 Mar 2011 21:24:33 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103172124.p2HLOX2S039526@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 17 Mar 2011 21:24:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219722 - head/usr.sbin/mfiutil
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 21:24:33 -0000

Author: jhb
Date: Thu Mar 17 21:24:32 2011
New Revision: 219722
URL: http://svn.freebsd.org/changeset/base/219722

Log:
  Preserve errno in an error case.
  
  Submitted by:	gcooper

Modified:
  head/usr.sbin/mfiutil/mfi_show.c

Modified: head/usr.sbin/mfiutil/mfi_show.c
==============================================================================
--- head/usr.sbin/mfiutil/mfi_show.c	Thu Mar 17 21:02:14 2011	(r219721)
+++ head/usr.sbin/mfiutil/mfi_show.c	Thu Mar 17 21:24:32 2011	(r219722)
@@ -174,8 +174,9 @@ show_battery(int ac, char **av)
 
 	if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_STATUS, &stat, sizeof(stat),
 	    NULL, 0, NULL) < 0) {
+		error = errno;
 		warn("Failed to get status");
-		return (errno);
+		return (error);
 	}
 
 	printf("mfi%d: Battery State:\n", mfi_unit);

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 22:17:57 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04974106564A;
	Thu, 17 Mar 2011 22:17:57 +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 E9BA78FC14;
	Thu, 17 Mar 2011 22:17: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 p2HMHu6m040641;
	Thu, 17 Mar 2011 22:17:56 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HMHuG0040639;
	Thu, 17 Mar 2011 22:17:56 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103172217.p2HMHuG0040639@svn.freebsd.org>
From: Glen Barber 
Date: Thu, 17 Mar 2011 22:17:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219723 - head/usr.sbin/moused
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 22:17:57 -0000

Author: gjb (doc committer)
Date: Thu Mar 17 22:17:56 2011
New Revision: 219723
URL: http://svn.freebsd.org/changeset/base/219723

Log:
  Formatting fix.
  
  Submitted by:	arundel (via doc@)
  MFC after:	3 days

Modified:
  head/usr.sbin/moused/moused.8

Modified: head/usr.sbin/moused/moused.8
==============================================================================
--- head/usr.sbin/moused/moused.8	Thu Mar 17 21:24:32 2011	(r219722)
+++ head/usr.sbin/moused/moused.8	Thu Mar 17 22:17:56 2011	(r219723)
@@ -450,9 +450,9 @@ X10 MouseRemote.
 Genius Kidspad and Easypad protocol.
 .It Ar versapad
 Interlink VersaPad protocol.
-.El
 .It Ar gtco_digipad
 GTCO Digipad protocol.
+.El
 .Pp
 For the bus and InPort mouse:
 .Bl -tag -compact -width mousesystemsxxx

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 22:35:29 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 94F2F106566C;
	Thu, 17 Mar 2011 22:35:29 +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 8566A8FC1C;
	Thu, 17 Mar 2011 22:35: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 p2HMZTi4041153;
	Thu, 17 Mar 2011 22:35:29 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HMZTx1041151;
	Thu, 17 Mar 2011 22:35:29 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103172235.p2HMZTx1041151@svn.freebsd.org>
From: Glen Barber 
Date: Thu, 17 Mar 2011 22:35: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: r219724 - stable/8/usr.bin/find
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 22:35:29 -0000

Author: gjb (doc committer)
Date: Thu Mar 17 22:35:29 2011
New Revision: 219724
URL: http://svn.freebsd.org/changeset/base/219724

Log:
  MFC 219455:
  - Move the explanation of using arguments for the PRIMARIES above
    the list of PRIMARIES.
  
  PR:		151812

Modified:
  stable/8/usr.bin/find/find.1
Directory Properties:
  stable/8/usr.bin/find/   (props changed)

Modified: stable/8/usr.bin/find/find.1
==============================================================================
--- stable/8/usr.bin/find/find.1	Thu Mar 17 22:17:56 2011	(r219723)
+++ stable/8/usr.bin/find/find.1	Thu Mar 17 22:35:29 2011	(r219724)
@@ -181,6 +181,18 @@ This option is equivalent to the depreca
 primary.
 .El
 .Sh PRIMARIES
+.Pp
+All primaries which take a numeric argument allow the number to be
+preceded by a plus sign
+.Pq Dq Li +
+or a minus sign
+.Pq Dq Li - .
+A preceding plus sign means
+.Dq more than n ,
+a preceding minus sign means
+.Dq less than n
+and neither means
+.Dq exactly n .
 .Bl -tag -width indent
 .It Ic -Bmin Ar n
 True if the difference between the time of a file's inode creation
@@ -822,18 +834,6 @@ The same thing as 
 .Ic -path ,
 for GNU find compatibility.
 .El
-.Pp
-All primaries which take a numeric argument allow the number to be
-preceded by a plus sign
-.Pq Dq Li +
-or a minus sign
-.Pq Dq Li - .
-A preceding plus sign means
-.Dq more than n ,
-a preceding minus sign means
-.Dq less than n
-and neither means
-.Dq exactly n .
 .Sh OPERATORS
 The primaries may be combined using the following operators.
 The operators are listed in order of decreasing precedence.

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 22:36:21 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9BF5C106566C;
	Thu, 17 Mar 2011 22:36:21 +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 8C6728FC0C;
	Thu, 17 Mar 2011 22:36: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 p2HMaLr7041216;
	Thu, 17 Mar 2011 22:36:21 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HMaL5l041214;
	Thu, 17 Mar 2011 22:36:21 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103172236.p2HMaL5l041214@svn.freebsd.org>
From: Glen Barber 
Date: Thu, 17 Mar 2011 22:36:21 +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: r219725 - stable/7/usr.bin/find
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 22:36:21 -0000

Author: gjb (doc committer)
Date: Thu Mar 17 22:36:21 2011
New Revision: 219725
URL: http://svn.freebsd.org/changeset/base/219725

Log:
  MFC 219455:
  - Move the explanation of using arguments for the PRIMARIES above
    the list of PRIMARIES.
  
  PR:		151812

Modified:
  stable/7/usr.bin/find/find.1
Directory Properties:
  stable/7/usr.bin/find/   (props changed)

Modified: stable/7/usr.bin/find/find.1
==============================================================================
--- stable/7/usr.bin/find/find.1	Thu Mar 17 22:35:29 2011	(r219724)
+++ stable/7/usr.bin/find/find.1	Thu Mar 17 22:36:21 2011	(r219725)
@@ -181,6 +181,18 @@ This option is equivalent to the depreca
 primary.
 .El
 .Sh PRIMARIES
+.Pp
+All primaries which take a numeric argument allow the number to be
+preceded by a plus sign
+.Pq Dq Li +
+or a minus sign
+.Pq Dq Li - .
+A preceding plus sign means
+.Dq more than n ,
+a preceding minus sign means
+.Dq less than n
+and neither means
+.Dq exactly n .
 .Bl -tag -width indent
 .It Ic -Bmin Ar n
 True if the difference between the time of a file's inode creation
@@ -749,18 +761,6 @@ is numeric and there is no such user nam
 .Ar uname
 is treated as a user ID.
 .El
-.Pp
-All primaries which take a numeric argument allow the number to be
-preceded by a plus sign
-.Pq Dq Li +
-or a minus sign
-.Pq Dq Li - .
-A preceding plus sign means
-.Dq more than n ,
-a preceding minus sign means
-.Dq less than n
-and neither means
-.Dq exactly n .
 .Sh OPERATORS
 The primaries may be combined using the following operators.
 The operators are listed in order of decreasing precedence.

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 17 22:47:52 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9687D1065670;
	Thu, 17 Mar 2011 22:47:52 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 872458FC17;
	Thu, 17 Mar 2011 22:47: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 p2HMlqna041544;
	Thu, 17 Mar 2011 22:47:52 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2HMlqam041542;
	Thu, 17 Mar 2011 22:47:52 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201103172247.p2HMlqam041542@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Thu, 17 Mar 2011 22:47: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: r219726 - stable/8/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 17 Mar 2011 22:47:52 -0000

Author: jilles
Date: Thu Mar 17 22:47:52 2011
New Revision: 219726
URL: http://svn.freebsd.org/changeset/base/219726

Log:
  MFC r219256: Fix some _POSIX minimum/maximum values in limits.h:
  * Some values changed in POSIX.1-2001; provide the former value if a program
    requests compliance to an earlier version of POSIX. [1]
  * Add missing _POSIX_CLOCKRES_MIN constant. This is a maximum value but
    otherwise works the same as the minimum values.
  
  PR:		standards/104743
  Submitted by:	bde [1] (not exact #ifdefs, but the values)

Modified:
  stable/8/include/limits.h
Directory Properties:
  stable/8/include/   (props changed)

Modified: stable/8/include/limits.h
==============================================================================
--- stable/8/include/limits.h	Thu Mar 17 22:36:21 2011	(r219725)
+++ stable/8/include/limits.h	Thu Mar 17 22:47:52 2011	(r219726)
@@ -41,18 +41,27 @@
 
 #if __POSIX_VISIBLE
 #define	_POSIX_ARG_MAX		4096
-#define	_POSIX_CHILD_MAX	25
 #define	_POSIX_LINK_MAX		8
 #define	_POSIX_MAX_CANON	255
 #define	_POSIX_MAX_INPUT	255
 #define	_POSIX_NAME_MAX		14
-#define	_POSIX_NGROUPS_MAX	8
-#define	_POSIX_OPEN_MAX		20
-#define	_POSIX_PATH_MAX		256
 #define	_POSIX_PIPE_BUF		512
 #define	_POSIX_SSIZE_MAX	32767
 #define	_POSIX_STREAM_MAX	8
+
+#if __POSIX_VISIBLE >= 200112
+#define	_POSIX_CHILD_MAX	25
+#define	_POSIX_NGROUPS_MAX	8
+#define	_POSIX_OPEN_MAX		20
+#define	_POSIX_PATH_MAX		256
 #define	_POSIX_TZNAME_MAX	6
+#else
+#define	_POSIX_CHILD_MAX	6
+#define	_POSIX_NGROUPS_MAX	0
+#define	_POSIX_OPEN_MAX		16
+#define	_POSIX_PATH_MAX		255
+#define	_POSIX_TZNAME_MAX	3
+#endif
 
 #define	BC_BASE_MAX		   99	/* max ibase/obase values in bc(1) */
 #define	BC_DIM_MAX		 2048	/* max array elements in bc(1) */
@@ -84,6 +93,8 @@
 #define	_POSIX_SEM_VALUE_MAX	32767
 #define	_POSIX_SIGQUEUE_MAX	32
 #define	_POSIX_TIMER_MAX	32
+
+#define	_POSIX_CLOCKRES_MIN	20000000
 #endif
 
 #if __POSIX_VISIBLE >= 199506

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 05:19:41 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D4BFC106566C;
	Fri, 18 Mar 2011 05:19:41 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au
	[211.29.132.187])
	by mx1.freebsd.org (Postfix) with ESMTP id 6A1FE8FC13;
	Fri, 18 Mar 2011 05:19:41 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2I5JW93031519
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 18 Mar 2011 16:19:33 +1100
Date: Fri, 18 Mar 2011 16:19:32 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jung-uk Kim 
In-Reply-To: <201103171701.57546.jkim@FreeBSD.org>
Message-ID: <20110318161019.M984@besplex.bde.org>
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<201103161634.08104.jkim@FreeBSD.org>
	<20110317195729.GA65858@server.vk2pj.dyndns.org>
	<201103171701.57546.jkim@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: src-committers@FreeBSD.org, Peter Jeremy ,
	Roman Divacky ,
	Bruce Evans , svn-src-head@FreeBSD.org,
	svn-src-all@FreeBSD.org, Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 05:19:41 -0000

On Thu, 17 Mar 2011, Jung-uk Kim wrote:

> On Thursday 17 March 2011 03:57 pm, Peter Jeremy wrote:
>> On 2011-Mar-16 16:34:04 -0400, Jung-uk Kim  wrote:
>>> On Wednesday 16 March 2011 01:45 pm, Roman Divacky wrote:
>>>> if we drop i486 I think it makes sense to require something that
>>>> has at least SSE2, thus we can have the same expectations as on
>>>> amd64.
>>
>> I think it's stil a bit early for that - especially the SSE2
>> requirement.
>>
>>> This is a proof-of-concept patch for sys/x86/isa/clock.c:
>>>
>>> http://people.freebsd.org/~jkim/clock.diff
>>>
>>> You see the complexity, just because I wanted to load 64-bit value
>>> atomically... :-(
>>
>> An alternative approach is to have _fetch_frequency() be
>>   uint64_t (*_fetch_frequency)(uint64_t *);
>> if i386 and I486 are defined (otherwise it's just the #define
>> (*(p))) then initialise it to either atomic_fetch_quad_i386 or
>> atomic_fetch_quad_i586 as part of the CPU detection process.  This
>> is the way bcopy() is/was handled on Pentium.
>>
>> Another approach would be to always have cmpxchg8b instructions
>> (followed by a suitably large NOP) always inlined in the code and
>> if it traps, patch the code to call a function that emulates it.
>
> I think the former makes more sense for atomic read/write because we
> don't need complete cmpxchg8b support but kind of movq support,
> actually.

Both require a function call.  With a function call, patching becomes
much easier since there is only 1 place to patch, so patching is almost
as easy as changing a function pointer (might need an instruction
queue flush and/or prevention of the function being called before or
while it is being patched).

Patching the code also makes it easier to null out the lock prefix
in the !SMP case when it is presumably not needed.  The function call
to a function without a lock prefix will then be faster than inline
code with a lock prefix.  With a function pointer, you start getting
combinatorial explosion in the number of separate functions needed (1
without cmpxchg8b or a lock prefix (for i486), 1 with cmpxchg8b without
a lock prefix (for !SMP i586+), and 1 with both (for SMP i586+).

Bruce

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 06:47:24 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 238FC106564A;
	Fri, 18 Mar 2011 06:47:24 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1106F8FC16;
	Fri, 18 Mar 2011 06:47: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 p2I6lNdM051747;
	Fri, 18 Mar 2011 06:47:23 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2I6lNCB051745;
	Fri, 18 Mar 2011 06:47:23 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103180647.p2I6lNCB051745@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 18 Mar 2011 06:47:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219727 - head/sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 06:47:24 -0000

Author: trasz
Date: Fri Mar 18 06:47:23 2011
New Revision: 219727
URL: http://svn.freebsd.org/changeset/base/219727

Log:
  In vm_daemon(), when iterating over all processes in the system, skip those
  which are not yet fully initialized (i.e. ones with p_state == PRS_NEW).
  Without it, we could panic in _thread_lock_flags().
  
  Note that there may be other instances of FOREACH_PROC_IN_SYSTEM() that
  require similar fix.
  
  Reported by:	pho, keramida
  Discussed with:	kib

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==============================================================================
--- head/sys/vm/vm_pageout.c	Thu Mar 17 22:47:52 2011	(r219726)
+++ head/sys/vm/vm_pageout.c	Fri Mar 18 06:47:23 2011	(r219727)
@@ -1281,6 +1281,8 @@ vm_pageout_oom(int shortage)
 	FOREACH_PROC_IN_SYSTEM(p) {
 		int breakout;
 
+		if (p->p_state != PRS_NORMAL)
+			continue;
 		if (PROC_TRYLOCK(p) == 0)
 			continue;
 		/*
@@ -1649,6 +1651,8 @@ vm_daemon()
 		FOREACH_PROC_IN_SYSTEM(p) {
 			vm_pindex_t limit, size;
 
+			if (p->p_state != PRS_NORMAL)
+				continue;
 			/*
 			 * if this is a system process or if we have already
 			 * looked at this process, skip it.

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 07:20:38 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 31DBF106566C;
	Fri, 18 Mar 2011 07:20:38 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au
	[211.29.132.185])
	by mx1.freebsd.org (Postfix) with ESMTP id C03FF8FC16;
	Fri, 18 Mar 2011 07:20:37 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2I7KTEx019208
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 18 Mar 2011 18:20:31 +1100
Date: Fri, 18 Mar 2011 18:20:29 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jung-uk Kim 
In-Reply-To: <201103171706.12993.jkim@FreeBSD.org>
Message-ID: <20110318172852.L1182@besplex.bde.org>
References: <201103161644.p2GGi8ug098283@svn.freebsd.org>
	<20110317200156.GB65858@server.vk2pj.dyndns.org>
	<201103171706.12993.jkim@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Peter Jeremy 
Subject: Re: svn commit: r219700 - head/sys/x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 07:20:38 -0000

On Thu, 17 Mar 2011, Jung-uk Kim wrote:

> On Thursday 17 March 2011 04:01 pm, Peter Jeremy wrote:
>> On 2011-Mar-16 16:44:08 +0000, Jung-uk Kim  wrote:
>>> Log:
>>>  Revert r219676.
>>
>> Thanks also.  For extra kudos, how about adding a similar function
>> to allow the HPET frequency to be over-ridden.  That is currently
>> the only timecounter that does not allow the user to compensate for
>> incorrect hardware frequencies.
>
> I really hate the idea of adjusting timecounter frequency from
> userland.  I guess "use ntpd(8)" is not a good answer for some
> people. :-(

I use ntpd, and also adjust the timecounter frequency so that:
- when the timecounter is the TSC, ntpd has less work to do.  It
   syncs faster and its adjustments are smaller, giving less jitter.
- there is only 1 place to change when the TSC frequency changes.
   Instead of changing the driftfile and restarting ntpd to resync
   after every frequency change, I set the TSC as accurately as possible
   (normally to within 1 ppm for the current frequency setting), so that
   ntpd can resync automatically just as easily as it can handle small
   termperature-related drifts.  If you use a sloppy DELAY()-based
   calibration or a nominal frequency, then you can easily have an error
   of 50 ppm or more.  ntpd will take hours to resync with that.  By
   resync, I mean that the error is usually less than a millisecond and
   has low variance.
- the TSC it is as accurate as possible for other purposes, irrespective
   of whether it is used for the timecounter.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 08:40:23 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E04C106566B;
	Fri, 18 Mar 2011 08:40:23 +0000 (UTC)
	(envelope-from julian@freebsd.org)
Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16])
	by mx1.freebsd.org (Postfix) with ESMTP id 2E9048FC16;
	Fri, 18 Mar 2011 08:40:22 +0000 (UTC)
Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137])
	(authenticated bits=0)
	by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p2I8eLBi002659
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Fri, 18 Mar 2011 01:40:22 -0700 (PDT)
	(envelope-from julian@freebsd.org)
Message-ID: <4D831A82.7070308@freebsd.org>
Date: Fri, 18 Mar 2011 01:40:34 -0700
From: Julian Elischer 
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US;
	rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version: 1.0
To: Edward Tomasz Napierala 
References: <201103180647.p2I6lNCB051745@svn.freebsd.org>
In-Reply-To: <201103180647.p2I6lNCB051745@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219727 - head/sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 08:40:23 -0000

On 3/17/11 11:47 PM, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Fri Mar 18 06:47:23 2011
> New Revision: 219727
> URL: http://svn.freebsd.org/changeset/base/219727
>
> Log:
>    In vm_daemon(), when iterating over all processes in the system, skip those
>    which are not yet fully initialized (i.e. ones with p_state == PRS_NEW).
>    Without it, we could panic in _thread_lock_flags().
>
>    Note that there may be other instances of FOREACH_PROC_IN_SYSTEM() that
>    require similar fix.

In the past each process was only put on the process list after it was 
fully set up.
Did someone change that recently?  that would be "A Bad Thing" (TM).

>
>    Reported by:	pho, keramida
>    Discussed with:	kib
>
> Modified:
>    head/sys/vm/vm_pageout.c
>
> Modified: head/sys/vm/vm_pageout.c
> ==============================================================================
> --- head/sys/vm/vm_pageout.c	Thu Mar 17 22:47:52 2011	(r219726)
> +++ head/sys/vm/vm_pageout.c	Fri Mar 18 06:47:23 2011	(r219727)
> @@ -1281,6 +1281,8 @@ vm_pageout_oom(int shortage)
>   	FOREACH_PROC_IN_SYSTEM(p) {
>   		int breakout;
>
> +		if (p->p_state != PRS_NORMAL)
> +			continue;
>   		if (PROC_TRYLOCK(p) == 0)
>   			continue;
>   		/*
> @@ -1649,6 +1651,8 @@ vm_daemon()
>   		FOREACH_PROC_IN_SYSTEM(p) {
>   			vm_pindex_t limit, size;
>
> +			if (p->p_state != PRS_NORMAL)
> +				continue;
>   			/*
>   			 * if this is a system process or if we have already
>   			 * looked at this process, skip it.
>
>


From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 08:48:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 982701065670;
	Fri, 18 Mar 2011 08:48:06 +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 6CAF18FC14;
	Fri, 18 Mar 2011 08:48: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 p2I8m6g2054218;
	Fri, 18 Mar 2011 08:48:06 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2I8m6hc054216;
	Fri, 18 Mar 2011 08:48:06 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201103180848.p2I8m6hc054216@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Fri, 18 Mar 2011 08:48: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: r219728 - stable/8/sys/dev/md
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 08:48:06 -0000

Author: jh
Date: Fri Mar 18 08:48:06 2011
New Revision: 219728
URL: http://svn.freebsd.org/changeset/base/219728

Log:
  MFC r210371:
  
  Convert md(4) to use alloc_unr(9) and alloc_unr_specific(9) for unit
  number allocation. The old approach had some problems such as it allowed
  an overflow to occur in the unit number calculation.
  
  PR:		kern/122288

Modified:
  stable/8/sys/dev/md/md.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/md/md.c
==============================================================================
--- stable/8/sys/dev/md/md.c	Fri Mar 18 06:47:23 2011	(r219727)
+++ stable/8/sys/dev/md/md.c	Fri Mar 18 08:48:06 2011	(r219728)
@@ -132,6 +132,7 @@ static void g_md_dumpconf(struct sbuf *s
 static int	mdunits;
 static struct cdev *status_dev = 0;
 static struct sx md_sx;
+static struct unrhdr *md_uh;
 
 static d_ioctl_t mdctlioctl;
 
@@ -757,20 +758,20 @@ mdfind(int unit)
 static struct md_s *
 mdnew(int unit, int *errp, enum md_types type)
 {
-	struct md_s *sc, *sc2;
-	int error, max = -1;
+	struct md_s *sc;
+	int error;
 
 	*errp = 0;
-	LIST_FOREACH(sc2, &md_softc_list, list) {
-		if (unit == sc2->unit) {
-			*errp = EBUSY;
-			return (NULL);
-		}
-		if (unit == -1 && sc2->unit > max) 
-			max = sc2->unit;
-	}
 	if (unit == -1)
-		unit = max + 1;
+		unit = alloc_unr(md_uh);
+	else
+		unit = alloc_unr_specific(md_uh, unit);
+
+	if (unit == -1) {
+		*errp = EBUSY;
+		return (NULL);
+	}
+
 	sc = (struct md_s *)malloc(sizeof *sc, M_MD, M_WAITOK | M_ZERO);
 	sc->type = type;
 	bioq_init(&sc->bio_queue);
@@ -783,6 +784,7 @@ mdnew(int unit, int *errp, enum md_types
 		return (sc);
 	LIST_REMOVE(sc, list);
 	mtx_destroy(&sc->queue_mtx);
+	free_unr(md_uh, sc->unit);
 	free(sc, M_MD);
 	*errp = error;
 	return (NULL);
@@ -1022,6 +1024,7 @@ mddestroy(struct md_s *sc, struct thread
 		uma_zdestroy(sc->uma);
 
 	LIST_REMOVE(sc, list);
+	free_unr(md_uh, sc->unit);
 	free(sc, M_MD);
 	return (0);
 }
@@ -1107,8 +1110,11 @@ xmdctlioctl(struct cdev *dev, u_long cmd
 		}
 		if (mdio->md_options & MD_AUTOUNIT)
 			sc = mdnew(-1, &error, mdio->md_type);
-		else
+		else {
+			if (mdio->md_unit > INT_MAX)
+				return (EINVAL);
 			sc = mdnew(mdio->md_unit, &error, mdio->md_type);
+		}
 		if (sc == NULL)
 			return (error);
 		if (mdio->md_options & MD_AUTOUNIT)
@@ -1236,6 +1242,7 @@ g_md_init(struct g_class *mp __unused)
 	mod = NULL;
 	sx_init(&md_sx, "MD config lock");
 	g_topology_unlock();
+	md_uh = new_unrhdr(0, INT_MAX, NULL);
 #ifdef MD_ROOT_SIZE
 	sx_xlock(&md_sx);
 	md_preloaded(mfs_root.start, sizeof(mfs_root.start));
@@ -1332,4 +1339,5 @@ g_md_fini(struct g_class *mp __unused)
 	sx_destroy(&md_sx);
 	if (status_dev != NULL)
 		destroy_dev(status_dev);
+	delete_unrhdr(md_uh);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 08:52:26 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FEFA1065670;
	Fri, 18 Mar 2011 08:52:26 +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 64AF58FC0C;
	Fri, 18 Mar 2011 08:52:26 +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 p2I8qQSP054354;
	Fri, 18 Mar 2011 08:52:26 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2I8qQWe054352;
	Fri, 18 Mar 2011 08:52:26 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201103180852.p2I8qQWe054352@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Fri, 18 Mar 2011 08:52:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219729 - stable/8/sys/dev/md
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 08:52:26 -0000

Author: jh
Date: Fri Mar 18 08:52:26 2011
New Revision: 219729
URL: http://svn.freebsd.org/changeset/base/219729

Log:
  MFC r210496:
  
  - Remove some extra white space.
  - Wrap g_md_dumpconf() prototype to 80 columns.

Modified:
  stable/8/sys/dev/md/md.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/md/md.c
==============================================================================
--- stable/8/sys/dev/md/md.c	Fri Mar 18 08:48:06 2011	(r219728)
+++ stable/8/sys/dev/md/md.c	Fri Mar 18 08:52:26 2011	(r219729)
@@ -126,10 +126,10 @@ static g_init_t g_md_init;
 static g_fini_t g_md_fini;
 static g_start_t g_md_start;
 static g_access_t g_md_access;
-static void g_md_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, 
-    struct g_consumer *cp __unused, struct g_provider *pp);
+static void g_md_dumpconf(struct sbuf *sb, const char *indent,
+    struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp);
 
-static int	mdunits;
+static int mdunits;
 static struct cdev *status_dev = 0;
 static struct sx md_sx;
 static struct unrhdr *md_uh;
@@ -683,7 +683,7 @@ mdstart_swap(struct md_s *sc, struct bio
 #if 0
 if (bootverbose || bp->bio_offset / PAGE_SIZE < 17)
 printf("wire_count %d busy %d flags %x hold_count %d act_count %d queue %d valid %d dirty %d @ %d\n",
-    m->wire_count, m->busy, 
+    m->wire_count, m->busy,
     m->flags, m->hold_count, m->act_count, m->queue, m->valid, m->dirty, i);
 #endif
 	}
@@ -793,7 +793,6 @@ mdnew(int unit, int *errp, enum md_types
 static void
 mdinit(struct md_s *sc)
 {
-
 	struct g_geom *gp;
 	struct g_provider *pp;
 
@@ -941,7 +940,7 @@ mdcreate_vnode(struct md_s *sc, struct m
 	if (nd.ni_vp->v_type != VREG) {
 		error = EINVAL;
 		goto bad;
-	}	
+	}
 	error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred);
 	if (error != 0)
 		goto bad;
@@ -1196,7 +1195,7 @@ xmdctlioctl(struct cdev *dev, u_long cmd
 static int
 mdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
 {
-	int error; 
+	int error;
 
 	sx_xlock(&md_sx);
 	error = xmdctlioctl(dev, cmd, addr, flags, td);
@@ -1228,7 +1227,6 @@ md_preloaded(u_char *image, size_t lengt
 static void
 g_md_init(struct g_class *mp __unused)
 {
-
 	caddr_t mod;
 	caddr_t c;
 	u_char *ptr, *name, *type;
@@ -1274,7 +1272,7 @@ g_md_init(struct g_class *mp __unused)
 }
 
 static void
-g_md_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, 
+g_md_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
     struct g_consumer *cp __unused, struct g_provider *pp)
 {
 	struct md_s *mp;

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 09:03:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4F9461065672;
	Fri, 18 Mar 2011 09:03:15 +0000 (UTC) (envelope-from sbz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F8098FC08;
	Fri, 18 Mar 2011 09:03: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 p2I93FeZ054606;
	Fri, 18 Mar 2011 09:03:15 GMT (envelope-from sbz@svn.freebsd.org)
Received: (from sbz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2I93FSi054604;
	Fri, 18 Mar 2011 09:03:15 GMT (envelope-from sbz@svn.freebsd.org)
Message-Id: <201103180903.p2I93FSi054604@svn.freebsd.org>
From: Sofian Brabez 
Date: Fri, 18 Mar 2011 09:03:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219730 - head/share/misc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 09:03:15 -0000

Author: sbz (ports committer)
Date: Fri Mar 18 09:03:14 2011
New Revision: 219730
URL: http://svn.freebsd.org/changeset/base/219730

Log:
  Add an entry for myself to committers-ports.dot.
  
  Approved by:	miwi@ (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==============================================================================
--- head/share/misc/committers-ports.dot	Fri Mar 18 08:52:26 2011	(r219729)
+++ head/share/misc/committers-ports.dot	Fri Mar 18 09:03:14 2011	(r219730)
@@ -154,6 +154,7 @@ rnoland [label="Robert Noland\nrnoland@F
 romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"]
 sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"]
 sat [label="Andrew Pantyukhin\nsat@FreeBSD.org\n2006/05/06"]
+sbz [label="Sofian Brabez\nsbz@FreeBSD.org\n2011/03/14"]
 sem [label="Sergey Matveychuk\nsem@FreeBSD.org\n2004/07/07"]
 sergei [label="Sergei Kolobov\nsergei@FreeBSD.org\n2003/10/21"]
 shaun [label="Shaun Amott\nshaun@FreeBSD.org\n2006/06/19"]
@@ -276,6 +277,7 @@ itetcu -> sylvio
 
 jadawin -> bapt
 jadawin -> flo
+jadawin -> sbz
 jadawin -> wen
 
 joerg -> netchild
@@ -332,6 +334,7 @@ miwi -> mandree
 miwi -> mva
 miwi -> nox
 miwi -> pawel
+miwi -> sbz
 miwi -> sylvio
 miwi -> tabthorpe
 miwi -> trasz

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 09:06:07 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 05B3F106566B;
	Fri, 18 Mar 2011 09:06:07 +0000 (UTC) (envelope-from sbz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E98E18FC0A;
	Fri, 18 Mar 2011 09:06: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 p2I966iD054715;
	Fri, 18 Mar 2011 09:06:06 GMT (envelope-from sbz@svn.freebsd.org)
Received: (from sbz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2I966Uv054713;
	Fri, 18 Mar 2011 09:06:06 GMT (envelope-from sbz@svn.freebsd.org)
Message-Id: <201103180906.p2I966Uv054713@svn.freebsd.org>
From: Sofian Brabez 
Date: Fri, 18 Mar 2011 09:06:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219731 - head/usr.bin/calendar/calendars
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 09:06:07 -0000

Author: sbz (ports committer)
Date: Fri Mar 18 09:06:06 2011
New Revision: 219731
URL: http://svn.freebsd.org/changeset/base/219731

Log:
  Add myself to calendar.freebsd.
  
  Approved by:	miwi@ (mentor)

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==============================================================================
--- head/usr.bin/calendar/calendars/calendar.freebsd	Fri Mar 18 09:03:14 2011	(r219730)
+++ head/usr.bin/calendar/calendars/calendar.freebsd	Fri Mar 18 09:06:06 2011	(r219731)
@@ -68,6 +68,7 @@
 02/24	Johan Karlsson  born in Mariannelund, Sweden, 1974
 02/24	Colin Percival  born in Burnaby, Canada, 1981
 02/26	Pietro Cerutti  born in Faido, Switzerland, 1984
+05/19	Sofian Brabez  born in Toulouse, France, 1984
 02/28	Daichi GOTO  born in Shimizu Suntou, Shizuoka, Japan, 1980
 03/01	Hye-Shik Chang  born in Daejeon, Republic of Korea, 1980
 03/02	Cy Schubert  born in Edmonton, Alberta, Canada, 1956

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 10:35:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 736F21065677;
	Fri, 18 Mar 2011 10:35:54 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 618E18FC17;
	Fri, 18 Mar 2011 10:35: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 p2IAZsBM056690;
	Fri, 18 Mar 2011 10:35:54 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IAZs3g056681;
	Fri, 18 Mar 2011 10:35:54 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201103181035.p2IAZs3g056681@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Fri, 18 Mar 2011 10:35:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219732 - in vendor/openresolv: . dist
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 10:35:54 -0000

Author: ume
Date: Fri Mar 18 10:35:54 2011
New Revision: 219732
URL: http://svn.freebsd.org/changeset/base/219732

Log:
  Import openresolv-3.4.1.

Added:
  vendor/openresolv/
  vendor/openresolv/dist/
  vendor/openresolv/dist/Makefile   (contents, props changed)
  vendor/openresolv/dist/README
  vendor/openresolv/dist/configure
  vendor/openresolv/dist/dnsmasq.in   (contents, props changed)
  vendor/openresolv/dist/libc.in   (contents, props changed)
  vendor/openresolv/dist/named.in   (contents, props changed)
  vendor/openresolv/dist/pdnsd.in   (contents, props changed)
  vendor/openresolv/dist/resolvconf.8.in   (contents, props changed)
  vendor/openresolv/dist/resolvconf.conf   (contents, props changed)
  vendor/openresolv/dist/resolvconf.conf.5.in   (contents, props changed)
  vendor/openresolv/dist/resolvconf.in   (contents, props changed)
  vendor/openresolv/dist/unbound.in   (contents, props changed)

Added: vendor/openresolv/dist/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/openresolv/dist/Makefile	Fri Mar 18 10:35:54 2011	(r219732)
@@ -0,0 +1,66 @@
+include config.mk
+
+NAME=		openresolv
+VERSION=	3.4.1
+PKG=		${NAME}-${VERSION}
+
+INSTALL?=	install
+SED?=		sed
+
+BINMODE?=	0755
+DOCMODE?=	0644
+MANMODE?=	0444
+
+RESOLVCONF=	resolvconf resolvconf.8 resolvconf.conf.5
+SUBSCRIBERS=	libc dnsmasq named pdnsd unbound
+TARGET=		${RESOLVCONF} ${SUBSCRIBERS}
+SRCS=		${TARGET:C,$,.in,} # pmake
+SRCS:=		${TARGET:=.in} # gmake
+
+SED_PREFIX=		-e 's:@PREFIX@:${PREFIX}:g'
+SED_SYSCONFDIR=		-e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
+SED_LIBEXECDIR=		-e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
+SED_VARDIR=		-e 's:@VARDIR@:${VARDIR}:g'
+SED_RCDIR=		-e 's:@RCDIR@:${RCDIR}:g'
+SED_RESTARTCMD=		-e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g'
+
+.SUFFIXES: .in
+
+all: ${TARGET}
+
+.in:
+	${SED}	${SED_PREFIX} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \
+		${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \
+		$< > $@
+
+clean:
+	rm -f ${TARGET} openresolv-${VERSION}.tar.bz2
+
+distclean: clean
+	rm -f config.mk
+
+installdirs:
+
+install: ${TARGET}
+	${INSTALL} -d ${DESTDIR}${SBINDIR}
+	${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR}
+	${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
+	test -e ${DESTDIR}${SYSCONFDIR}/resolvconf.conf || \
+	${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR}
+	${INSTALL} -d ${DESTDIR}${LIBEXECDIR}
+	${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR}
+	${INSTALL} -d ${DESTDIR}${MANDIR}/man8
+	${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8
+	${INSTALL} -d ${DESTDIR}${MANDIR}/man5
+	${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5
+
+import:
+	rm -rf /tmp/${PKG}
+	${INSTALL} -d /tmp/${PKG}
+	cp README ${SRCS} /tmp/${PKG}
+
+dist: import
+	cp configure Makefile resolvconf.conf /tmp/${PKG}
+	tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} 
+	rm -rf /tmp/${PKG} 
+	ls -l ${PKG}.tar.bz2

Added: vendor/openresolv/dist/README
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/openresolv/dist/README	Fri Mar 18 10:35:54 2011	(r219732)
@@ -0,0 +1,11 @@
+openresolv is a resolvconf implementation which manages resolv.conf
+You can find the latest version at http://roy.marples.name/projects/openresolv
+It is written and maintained by Roy Marples 
+
+This resolvconf implementation, along with its subscribers, work with a
+POSIX compliant shell and userland utilities. It is designed to work without
+tools such as sed as it *has* to work without /usr being available.
+
+On systems where resolvconf is expected to be used before /var/run is available
+for writing, you can configure openresolv to write somewhere else, like say a
+ramdisk.

Added: vendor/openresolv/dist/configure
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/openresolv/dist/configure	Fri Mar 18 10:35:54 2011	(r219732)
@@ -0,0 +1,186 @@
+#!/bin/sh
+# Try and be like autotools configure, but without autotools
+
+# Ensure that we do not inherit these from env
+OS=
+BUILD=
+HOST=
+TARGET=
+RESTARTCMD=
+RCDIR=
+
+for x; do
+	opt=${x%%=*}
+	var=${x#*=}
+	case "$opt" in
+	--os|OS) OS=$var;;
+	--with-cc|CC) CC=$var;;
+	--debug) DEBUG=$var;;
+	--disable-debug) DEBUG=no;;
+	--enable-debug) DEBUG=yes;;
+	--prefix) prefix=$var;;
+	--sysconfdir) SYSCONFDIR=$var;;
+	--bindir|--sbindir) SBINDIR=$var;;
+	--libexecdir) LIBEXECDIR=$var;;
+	--statedir|--localstatedir) STATEDIR=$var;;
+	--dbdir) DBDIR=$var;;
+	--rundir) RUNDIR=$var;;
+	--mandir) MANDIR=$var;;
+	--with-ccopts|CFLAGS) CFLAGS=$var;;
+	CPPFLAGS) CPPFLAGS=$var;;
+	--build) BUILD=$var;;
+	--host) HOST=$var;;
+	--target) TARGET=$var;;
+	--libdir) LIBDIR=$var;;
+	--restartcmd) RESTARTCMD=$var;;
+	--includedir) eval INCLUDEDIR="$INCLUDEDIR${INCLUDEDIR:+ }$var";;
+	--datadir|--infodir) ;; # ignore autotools
+	--disable-maintainer-mode|--disable-dependency-tracking) ;;
+	--help) echo "See the README file for available options"; exit 0;;
+	*) echo "$0: WARNING: unknown option $opt" >&2;;
+	esac
+done
+
+: ${SED:=sed}
+
+: ${PREFIX:=$prefix}
+: ${SYSCONFDIR:=$PREFIX/etc}
+: ${SBINDIR:=$PREFIX/sbin}
+: ${LIBEXECDIR:=$PREFIX/libexec}
+: ${STATEDIR:=/var}
+: ${RUNDIR:=$STATEDIR/run}
+: ${MANDIR:=${PREFIX:-/usr}/share/man}
+
+eval SYSCONFDIR="$SYSCONFDIR"
+eval SBINDIR="$SBINDIR"
+eval LIBEXECDIR="$LIBEXECDIR/resolvconf"
+eval VARDIR="$RUNDIR/resolvconf"
+eval MANDIR="$MANDIR"
+
+CONFIG_MK=config.mk
+
+if [ -z "$BUILD" ]; then
+	BUILD=`uname -m`-`uname -s | tr '[:upper:]' '[:lower:]'`
+fi
+if [ -z "$HOST" ]; then
+	[ -z "$TARGET" ] && TARGET=$BUILD
+	HOST=$TARGET
+fi
+if [ -z "$TARGET" ]; then
+	[ -z "$HOST" ] && HOST=$BUILD
+	TARGET=$HOST
+fi
+
+# Debian and Slackware have linux in different places when dealing with
+# autoconf, so we deal with that here.
+if [ -z "$OS" ]; then
+	case "$TARGET" in
+	*-linux-*|linux-*|*-linux|linux) OS=linux;;
+	esac
+fi
+
+if [ -z "$OS" ]; then
+	# Derive OS from cpu-manufacturer-os-kernel
+	CPU=${TARGET%%-*}
+	REST=${TARGET#*-}
+	if [ "$CPU" != "$REST" ]; then
+		MANU=${REST%%-*}
+		REST=${REST#*-}
+		if [ "$MANU" != "$REST" ]; then
+			OS=${REST%%-*}
+			REST=${REST#*-}
+			if [ "$OS" != "$REST" ]; then
+				KERNEL=${REST%%-*}
+			else
+				# 3 tupple
+				KERNEL=$OS
+				OS=$MANU
+				MANU=
+			fi
+		else
+			# 2 tupple
+			OS=$MANU
+			MANU=
+		fi
+	fi
+fi
+
+echo "Configuring openresolv for ... $OS"
+rm -rf $CONFIG_MK
+echo "# $OS" >$CONFIG_MK
+
+for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR; do
+	eval v=\$$x
+	# Make files look nice for import
+	l=$((10 - ${#x}))
+	unset t
+	[ $l -gt 3 ] && t="	"
+	echo "$x=$t	$v" >>$CONFIG_MK
+done
+
+if [ -e /etc/arch-release -a -d /etc/rc.d ]; then
+	echo "Overriding service status check for Arch Linux"
+	RCDIR=/etc/rc.d
+	RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart"
+	echo "yes"
+fi
+
+if [ -z "$RESTARTCMD" ]; then
+	printf "Checking for OpenRC ... "
+	if [ -x /sbin/rc-service ]; then
+		RESTARTCMD="/sbin/rc-service -e \1 \&\& /sbin/rc-service \1 -- -Ds restart"
+		echo "yes"
+	else
+		echo "no"
+	fi
+fi
+if [ -z "$RESTARTCMD" ]; then
+	printf "Checking for invoke-rc.d ... "
+	if [ -x /usr/sbin/invoke-rc.d ]; then
+		RCDIR=/etc/init.d
+		RESTARTCMD="/usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1 \&\& /usr/sbin/invoke-rc.d \1 restart"
+		echo "yes"
+	else
+		echo "no"
+	fi
+fi
+if [ -z "$RESTARTCMD" ]; then
+	printf "Checking for service ... "
+	if [ -x /sbin/service ]; then
+		RCDIR=/etc/init.d
+		RESTARTCMD="/sbin/service \1 \&\& /sbin/service \1 restart"
+		echo "yes"
+	else
+		echo "no"
+	fi
+fi
+if [ -z "$RESTARTCMD" ]; then
+	for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do
+		printf "Checking for $x ... "
+		if [ -d $x ]; then
+			RCDIR=$x
+			RESTARTCMD="$x/\1 status >/dev/null 2>\&1 \&\& $x/\1 restart"
+			echo "yes"
+			break
+		else
+			echo "no"
+		fi
+	done
+fi
+
+if [ -z "$RESTARTCMD" ]; then
+	echo "WARNING! No means of interacting with system services detected!"
+	exit 1
+fi
+
+echo "RCDIR=		$RCDIR" >>$CONFIG_MK
+# Work around bug in the dash shell as "echo 'foo \1'" does bad things
+printf "%s\n" "RESTARTCMD=	$RESTARTCMD" >>$CONFIG_MK
+
+echo
+echo "   SYSCONFDIR =		$SYSCONFDIR"
+echo "   SBINDIR =		$SBINDIR"
+echo "   LIBEXECDIR =		$LIBEXECDIR"
+echo "   VARDIR =		$RUNDIR"
+echo "   MANDIR =		$MANDIR"
+echo

Added: vendor/openresolv/dist/dnsmasq.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/openresolv/dist/dnsmasq.in	Fri Mar 18 10:35:54 2011	(r219732)
@@ -0,0 +1,125 @@
+#!/bin/sh
+# Copyright (c) 2007-2009 Roy Marples
+# All rights reserved
+
+# dnsmasq subscriber for resolvconf
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+[ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0
+. "@SYSCONFDIR@/resolvconf.conf" || exit 1
+[ -z "$dnsmasq_conf" -a -z "$dnsmasq_resolv" ] && exit 0
+[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)"
+
+: ${dnsmasq_pid:=/var/run/dnsmasq.pid}
+[ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid
+: ${dnsmasq_service:=dnsmasq}
+: ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@}
+newconf="# Generated by resolvconf\n"
+newresolv="$newconf"
+
+# Using dbus means that we never have to restart the daemon
+# This is important as it means we should not drop DNS queries
+# whilst changing DNS options around. However, dbus support is optional
+# so we need to validate a few things first.
+# Check for DBus support in the binary
+dbus=false
+: ${dbus_pid:=/var/run/dbus/dbus.pid}
+[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus.pid
+[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus/pid
+if [ -s "$dbus_pid" -a -s "$dnsmasq_pid" ]; then
+	if dnsmasq --version 2>/dev/null | \
+		grep -q "^Compile time options.*[[:space:]]DBus[[:space:]]"
+	then
+		# Sanity - check that dnsmasq and dbus are running
+		if kill -0 $(cat "$dbus_pid") 2>/dev/null && \
+			kill -0 $(cat "$dnsmasq_pid") 2>/dev/null
+		then
+			dbus=true
+			newconf="$newconf\n# Domain specific servers will"
+			newconf="$newconf be sent over dbus\nenable-dbus\n"
+		fi
+	fi
+fi
+
+for n in $NAMESERVERS; do
+	newresolv="${newresolv}nameserver $n\n"
+done
+
+dbusdest=
+for d in $DOMAINS; do
+	dn="${d%%:*}"
+	ns="${d#*:}"
+	while [ -n "$ns" ]; do
+		if $dbus; then
+			SIFS=${IFS-y} OIFS=$IFS
+			IFS=.
+			set -- ${ns%%,*}
+			num="0x$(printf "%02x" $1 $2 $3 $4)"
+			if [ "$SIFS" = yi ]; then
+				unset IFS
+			else
+				IFS=$OIFS
+			fi
+			dbusdest="$dbusdest uint32:$(printf "%u" $num)"
+			dbusdest="$dbusdest string:$dn"
+		else
+			newconf="${newconf}server=/$dn/${ns%%,*}\n"
+		fi
+		[ "$ns" = "${ns#*,}" ] && break
+		ns="${ns#*,}"
+	done
+done
+
+changed=false
+if [ -n "$dnsmasq_conf" ]; then
+	if [ ! -f "$dnsmasq_conf" ] || \
+		[ "$(cat "$dnsmasq_conf")" != "$(printf "$newconf")" ]
+	then
+		changed=true
+		printf "$newconf" >"$dnsmasq_conf"
+	fi
+fi
+if [ -n "$dnsmasq_resolv" ]; then
+	if [ -f "$dnsmasq_resolv" ]; then
+		if [ "$(cat "$dnsmasq_resolv")" != "$(printf "$newresolv")" ]
+		then
+			changed=true
+			printf "$newresolv" >"$dnsmasq_resolv"
+		fi
+	else
+		# dnsmasq polls this file so no need to set changed=true
+		printf "$newresolv" >"$dnsmasq_resolv"
+	fi
+fi
+
+if $changed; then
+	eval $dnsmasq_restart
+fi
+if $dbus; then
+	$changed || kill -HUP $(cat "$dnsmasq_pid")
+	# Send even if empty so old servers are cleared
+	dbus-send --system --dest=uk.org.thekelleys.dnsmasq \
+ 		/uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers \
+  		$dbusdest
+fi

Added: vendor/openresolv/dist/libc.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/openresolv/dist/libc.in	Fri Mar 18 10:35:54 2011	(r219732)
@@ -0,0 +1,168 @@
+#!/bin/sh
+# Copyright (c) 2007-2009 Roy Marples
+# All rights reserved
+
+# libc subscriber for resolvconf
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+SYSCONFDIR=@SYSCONFDIR@
+LIBEXECDIR=@LIBEXECDIR@
+VARDIR=@VARDIR@
+IFACEDIR="$VARDIR/interfaces"
+
+# sed may not be available, and this is faster on small files
+key_get_value()
+{
+	local key="$1" value= x= line=
+
+	shift
+	if [ $# -eq 0 ]; then
+		while read line; do
+			case "$line" in
+			"$key"*) echo "${line##$key}";;
+			esac
+		done
+	else
+		for x; do
+			while read line; do
+				case "$line" in
+				"$key"*) echo "${line##$key}";;
+				esac
+			done < "$x"
+		done
+	fi
+}
+
+# Support original resolvconf configuration layout
+# as well as the openresolv config file
+if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then
+	. "$SYSCONFDIR"/resolvconf.conf
+elif [ -d "$SYSCONFDIR"/resolvconf ]; then
+	SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d"
+	base="$SYSCONFDIR/resolv.conf.d/base"
+	if [ -f "$base" ]; then
+		name_servers="$(key_get_value "nameserver " "$base")"
+		search_domains="$(key_get_value "search " "$base")"
+		if [ -z "$search_domains" ]; then
+			search_domains="$(key_get_value "domain " "$base")"
+		fi
+		resolv_conf_options="$(key_get_value "options " "$base")"
+	fi
+	if [ -f "$SYSCONFDIR"/resolv.conf.d/head ]; then
+		resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.d/head)"
+	fi
+	if [ -f "$SYSCONFDIR"/resolv.conf.d/tail ]; then
+		resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.d/tail)"
+	fi
+fi
+: ${resolv_conf:=/etc/resolv.conf}
+: ${libc_service:=nscd}
+: ${libc_restart:=@RESTARTCMD ${libc_service}@}
+: ${list_resolv:=@PREFIX@/sbin/resolvconf -l}
+if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then
+	resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)"
+fi
+if [ "${resolv_conf_tail-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.tail ]; then
+	resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.tail)"
+fi
+
+uniqify()
+{
+	local result=
+	while [ -n "$1" ]; do
+		case " $result " in
+		*" $1 "*);;
+		*) result="$result $1";;
+		esac
+		shift
+	done
+	echo "${result# *}"
+}
+
+case "${resolv_conf_passthrough:-NO}" in
+[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+	newest=
+	for conf in "$IFACEDIR"/*; do
+		if [ -z "$newest" -o "$conf" -nt "$newest" ]; then
+			newest="$conf"
+		fi
+	done
+	[ -z "$newest" ] && exit 0
+	newconf="$(cat "$newest")\n"
+	;;
+*)
+	[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)"
+	newsearch="$(uniqify $search_domains $SEARCH $search_domains_append)"
+	NS="$LOCALNAMESERVERS $NAMESERVERS"
+	newns="$(uniqify $name_servers $NS $name_servers_append)"
+
+	# Hold our new resolv.conf in a variable to save on temporary files
+	newconf="# Generated by resolvconf\n"
+	if [ -n "$resolv_conf_head" ]; then
+		newconf="$newconf$resolv_conf_head\n"
+	fi
+	[ -n "$newsearch" ] && newconf="${newconf}search $newsearch\n"
+	for n in $newns; do
+		newconf="${newconf}nameserver $n\n"
+	done
+
+	# Now get any configured options
+	opts="$resolv_conf_options${resolv_conf_options:+ }"
+	opts="$opts$($list_resolv | key_get_value "options ")"
+	if [ -n "$opts" ]; then
+		newconf="${newconf}options"
+		for opt in $(uniqify $opts); do
+			newconf="${newconf} $opt"
+		done
+		newconf="$newconf\n"
+	fi
+
+	if [ -n "$resolv_conf_tail" ]; then
+		newconf="$newconf$resolv_conf_tail\n"
+	fi
+	;;
+esac
+
+# Check if the file has actually changed or not
+if [ -e "$resolv_conf" ]; then
+	[ "$(cat "$resolv_conf")" = "$(printf "$newconf")" ] && exit 0
+fi
+
+# Create our resolv.conf now
+(umask 022; printf "$newconf" >"$resolv_conf")
+eval $libc_restart
+
+retval=0
+# Notify users of the resolver
+for script in "$LIBEXECDIR"/libc.d/*; do
+	if [ -f "$script" ]; then
+		if [ -x "$script" ]; then
+			"$script" "$@"
+		else
+			(. "$script" "$@")
+		fi
+		retval=$(($retval + $?))
+	fi
+done
+exit $retval

Added: vendor/openresolv/dist/named.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/openresolv/dist/named.in	Fri Mar 18 10:35:54 2011	(r219732)
@@ -0,0 +1,94 @@
+#!/bin/sh
+# Copyright (c) 2007-2009 Roy Marples
+# All rights reserved
+
+# named subscriber for resolvconf
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+[ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0
+. "@SYSCONFDIR@/resolvconf.conf" || exit 1
+[ -z "$named_zones" -a -z "$named_options" ] && exit 0
+[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)"
+
+# Platform specific kludges
+if [ -z "$named_service" -a -z "$named_restart" -a \
+	-d "@RCDIR@" -a ! -x "@RCDIR@"/named ]
+then
+	if [ -x "@RCDIR@"/bind9 ]; then
+		# Debian and derivatives
+		named_service=bind9
+	fi
+fi
+: ${named_service:=named}
+: ${named_restart:=@RESTARTCMD ${named_service}@}
+newoptions="# Generated by resolvconf\n"
+newzones="$newoptions"
+
+forward=
+for n in $NAMESERVERS; do
+	case "$forward" in
+	*"\n\t$n;"*);;
+	*) forward="$forward\n\t$n;";;
+	esac
+done
+if [ -n "$forward" ]; then
+	newoptions="${newoptions}forward first;\nforwarders {$forward\n};\n"
+fi
+
+for d in $DOMAINS; do
+	newzones="${newzones}zone \"${d%%:*}\" {\n"
+	newzones="$newzones\ttype forward;\n"
+	newzones="$newzones\tforward first;\n\tforwarders {\n"
+	ns="${d#*:}"
+	while [ -n "$ns" ]; do
+		newzones="$newzones\t\t${ns%%,*};\n"
+		[ "$ns" = "${ns#*,}" ] && break
+		ns="${ns#*,}"
+	done
+	newzones="$newzones\t};\n};\n"
+done
+
+# No point in changing files or reloading bind if the end result has not
+# changed
+changed=false
+if [ -n "$named_options" ]; then
+	if [ ! -f "$named_options" ] || \
+		[ "$(cat "$named_options")" != "$(printf "$newoptions")" ]
+	then
+		printf "$newoptions" >"$named_options"
+		changed=true
+	fi
+fi
+if [ -n "$named_zones" ]; then
+	if [ ! -f "$named_zones" ] || \
+		[ "$(cat "$named_zones")" != "$(printf "$newzones")" ]
+	then
+		printf "$newzones" >"$named_zones"
+		changed=true
+	fi
+fi
+
+if $changed; then
+	eval $named_restart
+fi

Added: vendor/openresolv/dist/pdnsd.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/openresolv/dist/pdnsd.in	Fri Mar 18 10:35:54 2011	(r219732)
@@ -0,0 +1,153 @@
+#!/bin/sh
+# Copyright (c) 2010 Roy Marples
+# All rights reserved
+
+# pdnsd subscriber for resolvconf
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+[ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0
+. "@SYSCONFDIR@/resolvconf.conf" || exit 1
+[ -z "$pdnsd_conf" -a -z "$pdnsd_resolv" ] && exit 0
+[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)"
+
+: ${pdnsd_restart:=pdnsd-ctl config $pdnsd_conf}
+signature="# Generated by resolvconf"
+signature_end="# End of resolvconf"
+
+# We normally use sed to remove markers from a configuration file
+# but sed may not always be available at the time.
+remove_markers()
+{
+	local m1="$1" m2="$2" x= line= in_marker=0
+
+	shift; shift
+	if type sed >/dev/null 2>&1; then
+		sed "/^$m1/,/^$m2/d" $@
+	else
+		for x; do
+			while read line; do
+				case "$line" in
+				"$m1"*) in_marker=1;;
+				"$m2"*) in_marker=0;;
+				*) [ $in_marker = 0 ] && echo "$line";;
+				esac
+			done < "$x"
+		done
+	fi
+}
+
+# Compare two files
+# If different, replace first with second otherwise remove second
+change_file()
+{
+	if [ -e "$1" ]; then
+		if type cmp >/dev/null 2>&1; then
+			cmp -s "$1" "$2"
+		elif type diff >/dev/null 2>&1; then
+			diff -q "$1" "$2" >/dev/null
+		else
+			# Hopefully we're only working on small text files ...
+			[ "$(cat "$1")" = "$(cat "$2")" ]
+		fi
+		if [ $? -eq 0 ]; then
+			rm -f "$2"
+			return 1
+		fi
+	fi
+	cat "$2" > "$1"
+	rm -f "$2"
+	return 0
+}
+
+newresolv="# Generated by resolvconf\n"
+changed=false
+
+if [ -n "$pdnsd_resolv" ]; then
+	for n in $NAMESERVERS; do
+		newresolv="${newresolv}nameserver $n\n"
+	done
+fi
+
+if [ -n "$pdnsd_conf" ]; then
+	cf="$pdnsd_conf.new"
+	newconf=
+
+	if [ -z "$pdnsd_resolv" ]; then
+		newconf="${newconf}server {\n"
+		newconf="${newconf}\tlabel=resolvconf;\n"
+		if [ -n "$NAMESERVERS" ]; then
+			newconf="${newconf}\tip="
+			first=true
+			for n in $NAMESERVERS; do
+				if $first; then
+					first=false
+				else
+					newconf="${newconf},"
+				fi
+				newconf="$newconf$n"
+			done
+			newconf="${newconf};\n"
+		fi
+		newconf="${newconf}}\n"
+	fi
+
+	for d in $DOMAINS; do
+		newconf="${newconf}server {\n"
+		newconf="${newconf}\tinclude=.${d%%:*}.;\n"
+		newconf="${newconf}\tpolicy=excluded;\n"
+		newconf="${newconf}\tip="
+		ns="${d#*:}"
+		while [ -n "$ns" ]; do
+			newconf="${newconf}${ns%%,*}"
+			[ "$ns" = "${ns#*,}" ] && break
+			ns="${ns#*,}"
+			newconf="${newconf},"
+		done
+		newconf="${newconf};\n}\n"
+	done
+
+	rm -f "$cf"
+	remove_markers "$signature" "$signature_end" "$pdnsd_conf" > "$cf"
+	if [ -n "$newconf" ]; then
+		echo "$signature" >> "$cf"
+		printf "$newconf" >> "$cf"
+		echo "$signature_end" >> "$cf"
+	fi
+	if change_file "$pdnsd_conf" "$cf"; then
+		changed=true
+	fi	
+fi
+
+if [ -n "$pdnsd_resolv" ]; then
+	if [ ! -f "$pdnsd_resolv" ] || \
+		[ "$(cat "$pdnsd_resolv")" != "$(printf "$newresolv")" ]
+	then
+		changed=true
+		printf "$newresolv" >"$pdnsd_resolv"
+	fi
+fi
+
+if $changed; then
+	eval $pdnsd_restart
+fi

Added: vendor/openresolv/dist/resolvconf.8.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/openresolv/dist/resolvconf.8.in	Fri Mar 18 10:35:54 2011	(r219732)
@@ -0,0 +1,240 @@
+.\" Copyright (c) 2007-2009 Roy Marples
+.\" All rights reserved
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd December 3, 2009
+.Dt RESOLVCONF 8 SMM
+.Os
+.Sh NAME
+.Nm resolvconf
+.Nd a framework for managing multiple DNS configurations
+.Sh SYNOPSIS
+.Nm
+.Fl I
+.Nm
+.Op Fl m Ar metric
+.Op Fl p
+.Fl a Ar interface No < Ns Pa file
+.Nm
+.Op Fl f
+.Fl d Ar interface
+.Nm
+.Fl il Ar pattern
+.Nm
+.Fl u
+.Sh DESCRIPTION
+.Nm
+manages
+.Xr resolv.conf 5
+files from multiple sources, such as DHCP and VPN clients.
+Traditionally, the host runs just one client and that updates
+.Pa /etc/resolv.conf .
+More modern systems frequently have wired and wireless interfaces and there is
+no guarantee both are on the same network.
+With the advent of VPN and other
+types of networking daemons, many things now contend for the contents of
+.Pa /etc/resolv.conf .
+.Pp
+.Nm
+solves this by letting the daemon send their
+.Xr resolv.conf 5
+file to
+.Nm
+via
+.Xr stdin 3
+with the argument
+.Fl a Ar interface
+instead of the filesystem.
+.Nm
+then updates
+.Pa /etc/resolv.conf
+as it thinks best.
+When a local resolver other than libc is installed, such as
+.Xr dnsmasq 8
+or
+.Xr named 8 ,
+then
+.Nm
+will supply files that the resolver should be configured to include.
+.Pp
+.Nm
+can mark an interfaces
+.Pa resolv.conf
+as private.
+This means that the name servers listed in that
+.Pa resolv.conf
+are only used for queries against the domain/search listed in the same file.
+This only works when a local resolver other than libc is installed. 
+See
+.Xr resolvconf.conf 5
+for how to configure
+.Nm
+to use a local name server.
+.Pp
+When an interface goes down, it should then call
+.Nm
+with
+.Fl d Ar interface
+arguments to delete the
+.Pa resolv.conf
+file for the
+.Ar interface .
+.Pp
+Here are some more options that
+.Nm
+has:-
+.Bl -tag -width indent
+.It Fl I
+Initialise the state directory
+.Pa @VARDIR@ .
+This only needs to be called if the initial system boot sequence does not
+automatically clean it out; for example the state directory is moved
+somewhere other than
+.Pa /var/run .
+If used, it should only be called once as early in the system boot sequence
+as possible and before
+.Nm
+is used to add interfaces.
+.It Fl f
+Ignore non existant interfaces.
+Only really useful for deleting interfaces.
+.It Fl i Ar pattern
+List the interfaces, optionally matching
+.Ar pattern ,
+we have
+.Pa resolv.conf
+files for.
+.It Fl l Ar pattern
+List the
+.Pa resolv.conf
+files we have.
+If
+.Ar pattern
+is specified then we list the files for the interfaces that match it.
+.It Fl m Ar metric
+Set the metric of the interface when adding it, default of 0.
+Lower metrics take precedence.
+This affects the default order of interfaces when listed.
+.It Fl p
+Marks the interface
+.Pa resolv.conf
+as private.
+.It Fl u
+Force
+.Nm
+to update all it's subscribers.
+.Nm
+does not update the subscribers when adding a resolv.conf that matches
+what it already has for that interface.
+.El
+.Pp
+.Nm
+also has some options designed to be used by it's subscribers:-
+.Bl -tag -width indent
+.It Fl v
+Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can
+configure the resolver easily.
+.El
+.Sh INTERFACE ORDERING
+For
+.Nm
+to work effectively, it has to process the resolv.confs for the interfaces
+in the correct order.
+.Nm
+first processes interfaces from the
+.Sy interface_order
+list, then interfaces without a metic and that match the
+.Sy dynamic_order
+list, then interfaces with a metric in order and finally the rest in
+the operating systems lexical order.
+See
+.Xr resolvconf.conf 5
+for details on these lists.
+.Sh IMPLEMENTATION NOTES

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

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 10:39:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6637E1065670;
	Fri, 18 Mar 2011 10:39:53 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3BDD88FC17;
	Fri, 18 Mar 2011 10:39: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 p2IAdrDx056797;
	Fri, 18 Mar 2011 10:39:53 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IAdr2u056796;
	Fri, 18 Mar 2011 10:39:53 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201103181039.p2IAdr2u056796@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Fri, 18 Mar 2011 10:39:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219733 - vendor/openresolv/3.4.1
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 10:39:53 -0000

Author: ume
Date: Fri Mar 18 10:39:52 2011
New Revision: 219733
URL: http://svn.freebsd.org/changeset/base/219733

Log:
  Tag openresolv-3.4.1.

Added:
  vendor/openresolv/3.4.1/
     - copied from r219732, vendor/openresolv/dist/

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 10:52:24 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F2DB31065677;
	Fri, 18 Mar 2011 10:52:23 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C8B4E8FC14;
	Fri, 18 Mar 2011 10:52: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 p2IAqNml064277;
	Fri, 18 Mar 2011 10:52:23 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IAqNx1064275;
	Fri, 18 Mar 2011 10:52:23 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201103181052.p2IAqNx1064275@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Fri, 18 Mar 2011 10:52:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219734 - head/contrib/openresolv
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 10:52:24 -0000

Author: ume
Date: Fri Mar 18 10:52:23 2011
New Revision: 219734
URL: http://svn.freebsd.org/changeset/base/219734

Log:
  Import openresolv from vendor branch.

Added:
Directory Properties:
  head/contrib/openresolv/   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 11:29:52 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D689A1065672;
	Fri, 18 Mar 2011 11:29:51 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90])
	by mx1.freebsd.org (Postfix) with ESMTP id 8BD758FC14;
	Fri, 18 Mar 2011 11:29:51 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id 538A825D3868;
	Fri, 18 Mar 2011 11:29:20 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id 76433159B0C5;
	Fri, 18 Mar 2011 11:29:19 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id Z-snMZuUUUbY; Fri, 18 Mar 2011 11:29:18 +0000 (UTC)
Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id A9611159B0E2;
	Fri, 18 Mar 2011 11:29:18 +0000 (UTC)
Date: Fri, 18 Mar 2011 11:29:18 +0000 (UTC)
From: "Bjoern A. Zeeb" 
To: Hajimu UMEMOTO 
In-Reply-To: <201103181052.p2IAqNx1064275@svn.freebsd.org>
Message-ID: 
References: <201103181052.p2IAqNx1064275@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219734 - head/contrib/openresolv
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 11:29:52 -0000

On Fri, 18 Mar 2011, Hajimu UMEMOTO wrote:

> Author: ume
> Date: Fri Mar 18 10:52:23 2011
> New Revision: 219734
> URL: http://svn.freebsd.org/changeset/base/219734
>
> Log:
>  Import openresolv from vendor branch.
>
> Added:
> Directory Properties:
>  head/contrib/openresolv/   (props changed)

Thanks a lot!

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 12:07:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA284106567F;
	Fri, 18 Mar 2011 12:07:53 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AFF998FC1A;
	Fri, 18 Mar 2011 12:07: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 p2IC7rkF066038;
	Fri, 18 Mar 2011 12:07:53 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IC7r8P066037;
	Fri, 18 Mar 2011 12:07:53 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201103181207.p2IC7r8P066037@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Fri, 18 Mar 2011 12:07:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219735 - head/contrib/openresolv
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 12:07:53 -0000

Author: ume
Date: Fri Mar 18 12:07:53 2011
New Revision: 219735
URL: http://svn.freebsd.org/changeset/base/219735

Log:
  Remove contrib/openresolv.
  
  Helped by:	jhb

Deleted:
  head/contrib/openresolv/

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 12:09:27 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B92C1106566C;
	Fri, 18 Mar 2011 12:09:27 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8EEF68FC0A;
	Fri, 18 Mar 2011 12:09: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 p2IC9RSP066104;
	Fri, 18 Mar 2011 12:09:27 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IC9RI4066103;
	Fri, 18 Mar 2011 12:09:27 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201103181209.p2IC9RI4066103@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Fri, 18 Mar 2011 12:09:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219736 - head/contrib/openresolv
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 12:09:27 -0000

Author: ume
Date: Fri Mar 18 12:09:27 2011
New Revision: 219736
URL: http://svn.freebsd.org/changeset/base/219736

Log:
  Import openresolv from vendor branch, actually.
  
  Helped by:	jhb

Added:
  head/contrib/openresolv/
     - copied from r219735, vendor/openresolv/dist/

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 12:13:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D9B061065676;
	Fri, 18 Mar 2011 12:13:04 +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 C93408FC1F;
	Fri, 18 Mar 2011 12: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 p2ICD4AR066259;
	Fri, 18 Mar 2011 12:13:04 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2ICD4Vr066256;
	Fri, 18 Mar 2011 12:13:04 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103181213.p2ICD4Vr066256@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 18 Mar 2011 12:13:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219737 - head/sys/dev/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 12:13:04 -0000

Author: jhb
Date: Fri Mar 18 12:13:04 2011
New Revision: 219737
URL: http://svn.freebsd.org/changeset/base/219737

Log:
  Fix a few issues with HyperTransport devices and MSI interrupts:
  - Always enable the HyperTransport MSI mapping window for HyperTransport
    to PCI bridges (these show up as HyperTransport slave devices).
    The mapping windows in PCI-PCI bridges are enabled by existing code
    in the PCI-PCI bridge driver as MSI requests propagate up the device
    tree, but Host-PCI bridges don't really show up in that tree.
  - If the PCI device at domain 0 bus 0 slot 0 function 0 is not a
    HyperTransport device, then blacklist MSI on any other HT devices in
    the system.  Linux has a similar quirk.
  
  PR:		kern/155442
  Tested by:	Zack Dannar  zdannar of gmail
  MFC after:	1 week

Modified:
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pcivar.h

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Fri Mar 18 12:09:27 2011	(r219736)
+++ head/sys/dev/pci/pci.c	Fri Mar 18 12:13:04 2011	(r219737)
@@ -236,7 +236,7 @@ struct pci_quirk pci_quirks[] = {
 struct devlist pci_devq;
 uint32_t pci_generation;
 uint32_t pci_numdevs = 0;
-static int pcie_chipset, pcix_chipset;
+static int ht_chipset, pcie_chipset, pcix_chipset;
 
 /* sysctl vars */
 SYSCTL_NODE(_hw, OID_AUTO, pci, CTLFLAG_RD, 0, "PCI bus tuning parameters");
@@ -612,10 +612,24 @@ pci_read_extcap(device_t pcib, pcicfgreg
 					cfg->pp.pp_data = ptr + PCIR_POWER_DATA;
 			}
 			break;
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
 		case PCIY_HT:		/* HyperTransport */
 			/* Determine HT-specific capability type. */
 			val = REG(ptr + PCIR_HT_COMMAND, 2);
+
+			if ((val & 0xe000) == PCIM_HTCAP_SLAVE) {
+				cfg->ht.ht_slave = ptr;
+
+				/*
+				 * If device 0:0:0:0 is an HT slave,
+				 * then this is an HT chipset and MSI
+				 * should be enabled for HT devices.
+				 */
+				if (cfg->domain == 0 && cfg->bus == 0 &&
+				    cfg->slot == 0 && cfg->func == 0)
+					ht_chipset = 1;
+			}
+
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
 			switch (val & PCIM_HTCMD_CAP_MASK) {
 			case PCIM_HTCAP_MSI_MAPPING:
 				if (!(val & PCIM_HTCMD_MSI_FIXED)) {
@@ -627,7 +641,7 @@ pci_read_extcap(device_t pcib, pcicfgreg
 					    4);
 					if (addr != MSI_INTEL_ADDR_BASE)
 						device_printf(pcib,
-	    "HT Bridge at pci%d:%d:%d:%d has non-default MSI window 0x%llx\n",
+	    "HT device at pci%d:%d:%d:%d has non-default MSI window 0x%llx\n",
 						    cfg->domain, cfg->bus,
 						    cfg->slot, cfg->func,
 						    (long long)addr);
@@ -639,8 +653,8 @@ pci_read_extcap(device_t pcib, pcicfgreg
 				cfg->ht.ht_msiaddr = addr;
 				break;
 			}
-			break;
 #endif
+			break;
 		case PCIY_MSI:		/* PCI MSI */
 			cfg->msi.msi_location = ptr;
 			cfg->msi.msi_ctrl = REG(ptr + PCIR_MSI_CTRL, 2);
@@ -696,6 +710,24 @@ pci_read_extcap(device_t pcib, pcicfgreg
 			break;
 		}
 	}
+
+	
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
+	/*
+	 * Enable the MSI mapping window for all HyperTransport
+	 * slaves.  PCI-PCI bridges have their windows enabled via
+	 * PCIB_MAP_MSI().
+	 */
+	if (cfg->ht.ht_slave != 0 && cfg->ht.ht_msimap != 0 &&
+	    !(cfg->ht.ht_msictrl & PCIM_HTCMD_MSI_ENABLE)) {
+		device_printf(pcib,
+	    "Enabling MSI window for HyperTransport slave at pci%d:%d:%d:%d\n",
+		    cfg->domain, cfg->bus, cfg->slot, cfg->func);
+		 cfg->ht.ht_msictrl |= PCIM_HTCMD_MSI_ENABLE;
+		 WREG(cfg->ht.ht_msimap + PCIR_HT_COMMAND, cfg->ht.ht_msictrl,
+		     2);
+	}
+#endif
 /* REG and WREG use carry through to next functions */
 }
 
@@ -1837,6 +1869,13 @@ pci_msi_device_blacklisted(device_t dev)
 		    q->type == PCI_QUIRK_DISABLE_MSI)
 			return (1);
 	}
+
+	/*
+	 * Blacklist HyperTransport devices if the device at 0:0:0:0
+	 * is not a HyperTransport slave.
+	 */
+	if (!ht_chipset && pci_find_extcap(dev, PCIY_HT, NULL) == 0)
+		return (1);
 	return (0);
 }
 

Modified: head/sys/dev/pci/pcivar.h
==============================================================================
--- head/sys/dev/pci/pcivar.h	Fri Mar 18 12:09:27 2011	(r219736)
+++ head/sys/dev/pci/pcivar.h	Fri Mar 18 12:13:04 2011	(r219737)
@@ -110,6 +110,7 @@ struct pcicfg_msix {
 
 /* Interesting values for HyperTransport */
 struct pcicfg_ht {
+    uint8_t	ht_slave;	/* Non-zero if device is an HT slave. */
     uint8_t	ht_msimap;	/* Offset of MSI mapping cap registers. */
     uint16_t	ht_msictrl;	/* MSI mapping control */
     uint64_t	ht_msiaddr;	/* MSI mapping base address */

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 12:18:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A0991065670;
	Fri, 18 Mar 2011 12:18:53 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E35938FC12;
	Fri, 18 Mar 2011 12:18: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 p2ICIqpj066424;
	Fri, 18 Mar 2011 12:18:52 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2ICIqWW066420;
	Fri, 18 Mar 2011 12:18:52 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201103181218.p2ICIqWW066420@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Fri, 18 Mar 2011 12:18:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219738 - in head: etc/mtree sbin sbin/resolvconf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 12:18:53 -0000

Author: ume
Date: Fri Mar 18 12:18:52 2011
New Revision: 219738
URL: http://svn.freebsd.org/changeset/base/219738

Log:
  Add resolvconf(8) which manages resolv.conf.

Added:
  head/sbin/resolvconf/
  head/sbin/resolvconf/Makefile   (contents, props changed)
Modified:
  head/etc/mtree/BSD.root.dist
  head/sbin/Makefile

Modified: head/etc/mtree/BSD.root.dist
==============================================================================
--- head/etc/mtree/BSD.root.dist	Fri Mar 18 12:13:04 2011	(r219737)
+++ head/etc/mtree/BSD.root.dist	Fri Mar 18 12:18:52 2011	(r219738)
@@ -72,6 +72,8 @@
         ..
     ..
     libexec
+        resolvconf
+        ..
     ..
     media
     ..

Modified: head/sbin/Makefile
==============================================================================
--- head/sbin/Makefile	Fri Mar 18 12:13:04 2011	(r219737)
+++ head/sbin/Makefile	Fri Mar 18 12:18:52 2011	(r219738)
@@ -62,6 +62,7 @@ SUBDIR=adjkerntz \
 	rcorder \
 	reboot \
 	recoverdisk \
+	resolvconf \
 	restore \
 	route \
 	savecore \

Added: head/sbin/resolvconf/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sbin/resolvconf/Makefile	Fri Mar 18 12:18:52 2011	(r219738)
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+DIST=		${.CURDIR}/../../contrib/openresolv
+.PATH:		${DIST}
+
+SCRIPTS=	resolvconf
+
+FILES=		libc dnsmasq named pdnsd unbound
+FILESDIR=	/libexec/resolvconf
+
+MAN=		resolvconf.conf.5 resolvconf.8
+
+CLEANFILES=	${SCRIPTS} ${FILES} ${MAN}
+
+SYSCONFDIR=	/etc
+RCDIR=		${SYSCONFDIR}/rc.d
+VARDIR=		/var/run/resolvconf
+
+# We don't assume to restart the services in /sbin.  So, though
+# our service(8) is in /usr/sbin, we can use it, here.
+CMD1=		\1 onestatus >/dev/null 2>\&1
+CMD2=		\1 restart
+RESTARTCMD=	/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}
+
+.for f in ${SCRIPTS} ${FILES} ${MAN}
+${f}:	${f}.in
+	sed -e 's:@PREFIX@::g' \
+		-e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \
+		-e 's:@LIBEXECDIR@:${FILESDIR}:g' \
+		-e 's:@VARDIR@:${VARDIR}:g' \
+		-e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' \
+		-e 's:@RCDIR@:${RCDIR}:g' \
+		-e 's: vpn : ng[0-9]*&:g' \
+		${DIST}/$@.in > $@
+.endfor
+
+.include 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 12:23:21 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0415B106566B;
	Fri, 18 Mar 2011 12:23:21 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DC7478FC12;
	Fri, 18 Mar 2011 12: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 p2ICNKJp066579;
	Fri, 18 Mar 2011 12:23:20 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2ICNKkd066577;
	Fri, 18 Mar 2011 12:23:20 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201103181223.p2ICNKkd066577@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Fri, 18 Mar 2011 12:23:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219739 - head/sbin/dhclient
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 12:23:21 -0000

Author: ume
Date: Fri Mar 18 12:23:20 2011
New Revision: 219739
URL: http://svn.freebsd.org/changeset/base/219739

Log:
  Use resolvconf(8) to update /etc/resolv.conf.
  If you don't want to use resolvconf(8) to update /etc/resolv.conf,
  you can put resolvconf_enable="NO" into /etc/dhclient-enter-hooks.

Modified:
  head/sbin/dhclient/dhclient-script

Modified: head/sbin/dhclient/dhclient-script
==============================================================================
--- head/sbin/dhclient/dhclient-script	Fri Mar 18 12:18:52 2011	(r219738)
+++ head/sbin/dhclient/dhclient-script	Fri Mar 18 12:23:20 2011	(r219739)
@@ -216,29 +216,40 @@ add_new_resolv_conf() {
 			cat /etc/resolv.conf.tail >>$tmpres
 		fi
 
-		# When resolv.conf is not changed actually, we don't
-		# need to update it.
-		# If /usr is not mounted yet, we cannot use cmp, then
-		# the following test fails.  In such case, we simply
-		# ignore an error and do update resolv.conf.
-		if cmp -s $tmpres /etc/resolv.conf; then
-			rm -f $tmpres
-			return 0
-		fi 2>/dev/null
-
-		# In case (e.g. during OpenBSD installs) /etc/resolv.conf
-		# is a symbolic link, take care to preserve the link and write
-		# the new data in the correct location.
+		case $resolvconf_enable in
+		# "no", "false", "off", or "0"
+		[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
+			# When resolv.conf is not changed actually, we don't
+			# need to update it.
+			# If /usr is not mounted yet, we cannot use cmp, then
+			# the following test fails.  In such case, we simply
+			# ignore an error and do update resolv.conf.
+			if cmp -s $tmpres /etc/resolv.conf; then
+				rm -f $tmpres
+				return 0
+			fi 2>/dev/null
+
+			# In case (e.g. during OpenBSD installs)
+			# /etc/resolv.conf is a symbolic link, take
+			# care to preserve the link and write the new
+			# data in the correct location.
 
-		if [ -f /etc/resolv.conf ]; then
-			cat /etc/resolv.conf > /etc/resolv.conf.save
-		fi
-		cat $tmpres > /etc/resolv.conf
-		rm -f $tmpres
+			if [ -f /etc/resolv.conf ]; then
+				cat /etc/resolv.conf > /etc/resolv.conf.save
+			fi
+			cat $tmpres > /etc/resolv.conf
+
+			# Try to ensure correct ownership and permissions.
+			chown -RL root:wheel /etc/resolv.conf
+			chmod -RL 644 /etc/resolv.conf
+			;;
 
-		# Try to ensure correct ownership and permissions.
-		chown -RL root:wheel /etc/resolv.conf
-		chmod -RL 644 /etc/resolv.conf
+		*)
+			/sbin/resolvconf -a ${interface} < $tmpres
+			;;
+		esac
+
+		rm -f $tmpres
 
 		return 0
 	fi
@@ -296,6 +307,8 @@ if [ -f /etc/dhclient-enter-hooks ]; the
 	fi
 fi
 
+: ${resolvconf_enable="YES"}
+
 case $reason in
 MEDIUM)
 	eval "$IFCONFIG $interface $medium"
@@ -349,9 +362,17 @@ EXPIRE|FAIL)
 	# XXX Why add alias we just deleted above?
 	add_new_alias
 	if is_default_interface; then
-		if [ -f /etc/resolv.conf.save ]; then
-			cat /etc/resolv.conf.save > /etc/resolv.conf
-		fi
+		case $resolvconf_enable in
+		# "no", "false", "off", or "0"
+		[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
+			if [ -f /etc/resolv.conf.save ]; then
+				cat /etc/resolv.conf.save > /etc/resolv.conf
+			fi
+			;;
+		*)
+			/sbin/resolvconf -d ${interface}
+			;;
+		esac
 	fi
 	;;
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 13:16:35 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E863D106564A;
	Fri, 18 Mar 2011 13:16:35 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119])
	by mx1.freebsd.org (Postfix) with ESMTP id BEAD18FC14;
	Fri, 18 Mar 2011 13:16:35 +0000 (UTC)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mail.icecube.wisc.edu (Postfix) with ESMTP id E2B125811E;
	Fri, 18 Mar 2011 07:48:29 -0500 (CDT)
X-Virus-Scanned: amavisd-new at icecube.wisc.edu
Received: from mail.icecube.wisc.edu ([127.0.0.1])
	by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new,
	port 10030)
	with ESMTP id EJ5h8dW04wow; Fri, 18 Mar 2011 07:48:29 -0500 (CDT)
Received: from wanderer.tachypleus.net (unknown [76.210.65.155])
	by mail.icecube.wisc.edu (Postfix) with ESMTP id 40AFE5811D;
	Fri, 18 Mar 2011 07:48:29 -0500 (CDT)
Message-ID: <4D83549C.5010703@freebsd.org>
Date: Fri, 18 Mar 2011 07:48:28 -0500
From: Nathan Whitehorn 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.15) Gecko/20110317 Thunderbird/3.1.9
MIME-Version: 1.0
To: John Baldwin 
References: <201103181213.p2ICD4Vr066256@svn.freebsd.org>
In-Reply-To: <201103181213.p2ICD4Vr066256@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219737 - head/sys/dev/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 13:16:36 -0000

On 03/18/11 07:13, John Baldwin wrote:
> Author: jhb
> Date: Fri Mar 18 12:13:04 2011
> New Revision: 219737
> URL: http://svn.freebsd.org/changeset/base/219737
>
> Log:
>    Fix a few issues with HyperTransport devices and MSI interrupts:
>    - Always enable the HyperTransport MSI mapping window for HyperTransport
>      to PCI bridges (these show up as HyperTransport slave devices).
>      The mapping windows in PCI-PCI bridges are enabled by existing code
>      in the PCI-PCI bridge driver as MSI requests propagate up the device
>      tree, but Host-PCI bridges don't really show up in that tree.
>    - If the PCI device at domain 0 bus 0 slot 0 function 0 is not a
>      HyperTransport device, then blacklist MSI on any other HT devices in
>      the system.  Linux has a similar quirk.
>

I think this last change only works on x86 systems. My powerpc desktop 
has hypertransport and MSI, but PCI bus 0 (the PCI-E bus with the 
graphics card in it) is not connected over hypertransport and has 
nothing to do with it. Also, the root host->HT bridge doesn't show up in 
PCI space at all.
-Nathan

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 14:02:38 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4A25D106564A;
	Fri, 18 Mar 2011 14:02:38 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 226248FC0C;
	Fri, 18 Mar 2011 14:02:38 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id AE0F246B5C;
	Fri, 18 Mar 2011 10:02:37 -0400 (EDT)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4B3D18A01B;
	Fri, 18 Mar 2011 10:02:37 -0400 (EDT)
From: John Baldwin 
To: Nathan Whitehorn 
Date: Fri, 18 Mar 2011 10:02:29 -0400
User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; )
References: <201103181213.p2ICD4Vr066256@svn.freebsd.org>
	<4D83549C.5010703@freebsd.org>
In-Reply-To: <4D83549C.5010703@freebsd.org>
MIME-Version: 1.0
Message-Id: <201103181002.29638.jhb@freebsd.org>
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Fri, 18 Mar 2011 10:02:37 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219737 - head/sys/dev/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 14:02:38 -0000

On Friday, March 18, 2011 8:48:28 am Nathan Whitehorn wrote:
> On 03/18/11 07:13, John Baldwin wrote:
> > Author: jhb
> > Date: Fri Mar 18 12:13:04 2011
> > New Revision: 219737
> > URL: http://svn.freebsd.org/changeset/base/219737
> >
> > Log:
> >    Fix a few issues with HyperTransport devices and MSI interrupts:
> >    - Always enable the HyperTransport MSI mapping window for HyperTransport
> >      to PCI bridges (these show up as HyperTransport slave devices).
> >      The mapping windows in PCI-PCI bridges are enabled by existing code
> >      in the PCI-PCI bridge driver as MSI requests propagate up the device
> >      tree, but Host-PCI bridges don't really show up in that tree.
> >    - If the PCI device at domain 0 bus 0 slot 0 function 0 is not a
> >      HyperTransport device, then blacklist MSI on any other HT devices in
> >      the system.  Linux has a similar quirk.
> >
> 
> I think this last change only works on x86 systems. My powerpc desktop 
> has hypertransport and MSI, but PCI bus 0 (the PCI-E bus with the 
> graphics card in it) is not connected over hypertransport and has 
> nothing to do with it. Also, the root host->HT bridge doesn't show up in 
> PCI space at all.

Hmm, that is likely true.  Rereading the Linux code, this last quirk only
applies to Nvidia chipsets.  Bah, I also botched it, so I'll remove that part
for now.  Only the first fix was needed for the PR.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 14:06:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0F5511065675;
	Fri, 18 Mar 2011 14:06: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 006B18FC1B;
	Fri, 18 Mar 2011 14:06: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 p2IE6C39068770;
	Fri, 18 Mar 2011 14:06:12 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IE6C0N068768;
	Fri, 18 Mar 2011 14:06:12 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103181406.p2IE6C0N068768@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 18 Mar 2011 14:06:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219740 - head/sys/dev/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 14:06:13 -0000

Author: jhb
Date: Fri Mar 18 14:06:12 2011
New Revision: 219740
URL: http://svn.freebsd.org/changeset/base/219740

Log:
  Partially revert previous change.  Drop the quirk to disable MSI for HT
  chipsets that do not have an HT slave at 0:0:0:0.  The Linux quirk is
  actually specific to Nvidia chipsets and the check I had added was in
  the wrong place.
  
  Prodded by:	nathanw

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

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Fri Mar 18 12:23:20 2011	(r219739)
+++ head/sys/dev/pci/pci.c	Fri Mar 18 14:06:12 2011	(r219740)
@@ -236,7 +236,7 @@ struct pci_quirk pci_quirks[] = {
 struct devlist pci_devq;
 uint32_t pci_generation;
 uint32_t pci_numdevs = 0;
-static int ht_chipset, pcie_chipset, pcix_chipset;
+static int pcie_chipset, pcix_chipset;
 
 /* sysctl vars */
 SYSCTL_NODE(_hw, OID_AUTO, pci, CTLFLAG_RD, 0, "PCI bus tuning parameters");
@@ -616,19 +616,9 @@ pci_read_extcap(device_t pcib, pcicfgreg
 			/* Determine HT-specific capability type. */
 			val = REG(ptr + PCIR_HT_COMMAND, 2);
 
-			if ((val & 0xe000) == PCIM_HTCAP_SLAVE) {
+			if ((val & 0xe000) == PCIM_HTCAP_SLAVE)
 				cfg->ht.ht_slave = ptr;
 
-				/*
-				 * If device 0:0:0:0 is an HT slave,
-				 * then this is an HT chipset and MSI
-				 * should be enabled for HT devices.
-				 */
-				if (cfg->domain == 0 && cfg->bus == 0 &&
-				    cfg->slot == 0 && cfg->func == 0)
-					ht_chipset = 1;
-			}
-
 #if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
 			switch (val & PCIM_HTCMD_CAP_MASK) {
 			case PCIM_HTCAP_MSI_MAPPING:
@@ -1869,13 +1859,6 @@ pci_msi_device_blacklisted(device_t dev)
 		    q->type == PCI_QUIRK_DISABLE_MSI)
 			return (1);
 	}
-
-	/*
-	 * Blacklist HyperTransport devices if the device at 0:0:0:0
-	 * is not a HyperTransport slave.
-	 */
-	if (!ht_chipset && pci_find_extcap(dev, PCIY_HT, NULL) == 0)
-		return (1);
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 14:28:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C126F1065675;
	Fri, 18 Mar 2011 14:28:49 +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 0C41D8FC1F;
	Fri, 18 Mar 2011 14:28:48 +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 p2IESiSV040090
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 18 Mar 2011 16:28:44 +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
	p2IESi6v077372; Fri, 18 Mar 2011 16:28:44 +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 p2IESi2n077371; 
	Fri, 18 Mar 2011 16:28:44 +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: Fri, 18 Mar 2011 16:28:44 +0200
From: Kostik Belousov 
To: Bruce Evans 
Message-ID: <20110318142844.GB78089@deviant.kiev.zoral.com.ua>
References: <201103171123.p2HBNCGh025820@svn.freebsd.org>
	<20110318001402.H1537@besplex.bde.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="7/SBNUKqFhVQCjUu"
Content-Disposition: inline
In-Reply-To: <20110318001402.H1537@besplex.bde.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	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-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219712 - head/sys/ufs/ufs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 14:28:49 -0000


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

On Fri, Mar 18, 2011 at 12:37:41AM +1100, Bruce Evans wrote:
> On Thu, 17 Mar 2011, Konstantin Belousov wrote:
>=20
> >Log:
> > Remove the #if defined(FFS) || defined(IFS) braces around the calls to
> > ffs_snapgone(). ufs.ko module is not build with FFS define, causing
> > snapshot inode number slots in superblock never be freed, as well as a
> > reference on the snapshot vnode.
> >
> > IFS was removed several years ago, and UFS/FFS separation was not
> > maintained for real.
> >
> > Reported, analyzed and tested by:	Yamagi Burmeister 
> > MFC after:	3 days
>=20
> This seems to leave FFS correctly unused.  Most options for file systems
> are put in opt_dontuse.h to inhibit bugs like this (but I never figured
> out a way to generate a compile time error if an option in there is
> used).  The FFS option is special.  It should not be special.  It was
> moved from opt_dontuse.h to opt_ffs_broken_fixme.h in 2001 to avoid a
> collateral bug: the FFS/UFS split doesn't work, but was used by ext2fs,
> and it is a layering violation for UFS to call ffs_snapgone() in FFS,
> and this broke the configuration with EXT2FS (and UFS) but not FFS;
> this was hacked around by the ifdefs.  ext2fs was decoupled from UFS
> in 2002, so the ifdefs became unnecessary, but they remained to break
> the module.  opt_ffs_broken_fixme.h also became unnecessary in 2002,
> but remains to generate history lessons :-).
>=20
> The ifdef on IFS was even more bogus, since IFS doesn't exist and has
> no vestiges in conf/*.

I went ahead and implemented UFS_SNAPONE() and removal of
opt_ffs_broken_fixme.h.

diff --git a/sys/conf/options b/sys/conf/options
index 7f92258..8207800 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -200,6 +200,7 @@ CD9660		opt_dontuse.h
 CODA		opt_dontuse.h
 EXT2FS		opt_dontuse.h
 FDESCFS		opt_dontuse.h
+FFS		opt_dontuse.h
 HPFS		opt_dontuse.h
 MSDOSFS		opt_dontuse.h
 NTFS		opt_dontuse.h
@@ -217,9 +218,6 @@ UNIONFS		opt_dontuse.h
 # Pseudofs debugging
 PSEUDOFS_TRACE	opt_pseudofs.h
=20
-# Broken - ffs_snapshot() dependency from ufs_lookup() :-(
-FFS		opt_ffs_broken_fixme.h
-
 # In-kernel GSS-API
 KGSSAPI		opt_kgssapi.h
 KGSSAPI_DEBUG	opt_kgssapi.h
diff --git a/sys/modules/ufs/Makefile b/sys/modules/ufs/Makefile
index 0fe7b4c..652856c 100644
--- a/sys/modules/ufs/Makefile
+++ b/sys/modules/ufs/Makefile
@@ -3,8 +3,7 @@
 .PATH:	${.CURDIR}/../../ufs/ufs ${.CURDIR}/../../ufs/ffs
=20
 KMOD=3D	ufs
-SRCS=3D	opt_ddb.h opt_directio.h opt_ffs.h opt_ffs_broken_fixme.h \
-	opt_quota.h opt_suiddir.h opt_ufs.h \
+SRCS=3D	opt_ddb.h opt_directio.h opt_ffs.h opt_quota.h opt_suiddir.h opt_u=
fs.h \
 	vnode_if.h ufs_acl.c ufs_bmap.c ufs_dirhash.c ufs_extattr.c \
 	ufs_gjournal.c ufs_inode.c ufs_lookup.c ufs_quota.c ufs_vfsops.c \
 	ufs_vnops.c ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_snapshot.c \
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index f578382..573c364 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -797,6 +797,7 @@ ffs_mountfs(devvp, mp, td)
 	ump->um_vfree =3D ffs_vfree;
 	ump->um_ifree =3D ffs_ifree;
 	ump->um_rdonly =3D ffs_rdonly;
+	ump->um_snapgone =3D ffs_snapgone;
 	mtx_init(UFS_MTX(ump), "FFS", "FFS Lock", MTX_DEF);
 	bcopy(bp->b_data, ump->um_fs, (u_int)fs->fs_sbsize);
 	if (fs->fs_sbsize < SBLOCKSIZE)
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index d819f69..45ebea1 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -37,7 +37,6 @@
 #include 
 __FBSDID("$FreeBSD$");
=20
-#include "opt_ffs_broken_fixme.h"
 #include "opt_ufs.h"
 #include "opt_quota.h"
=20
@@ -1253,7 +1252,7 @@ out:
 	 * when last open reference goes away.
 	 */
 	if (ip !=3D 0 && (ip->i_flags & SF_SNAPSHOT) !=3D 0 && ip->i_effnlink =3D=
=3D 0)
-		ffs_snapgone(ip);
+		UFS_SNAPGONE(ip);
 	return (error);
 }
=20
@@ -1316,7 +1315,7 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir)
 	 * when last open reference goes away.
 	 */
 	if ((oip->i_flags & SF_SNAPSHOT) !=3D 0 && oip->i_effnlink =3D=3D 0)
-		ffs_snapgone(oip);
+		UFS_SNAPGONE(oip);
 	return (error);
 }
=20
diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h
index b13db40..c2cfcfb 100644
--- a/sys/ufs/ufs/ufsmount.h
+++ b/sys/ufs/ufs/ufsmount.h
@@ -104,6 +104,7 @@ struct ufsmount {
 	int	(*um_vfree)(struct vnode *, ino_t, int);
 	void	(*um_ifree)(struct ufsmount *, struct inode *);
 	int	(*um_rdonly)(struct inode *);
+	void	(*um_snapgone)(struct inode *);
 };
=20
 #define UFS_BALLOC(aa, bb, cc, dd, ee, ff) VFSTOUFS((aa)->v_mount)->um_bal=
loc(aa, bb, cc, dd, ee, ff)
@@ -114,6 +115,7 @@ struct ufsmount {
 #define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc)
 #define UFS_IFREE(aa, bb) ((aa)->um_ifree(aa, bb))
 #define	UFS_RDONLY(aa) ((aa)->i_ump->um_rdonly(aa))
+#define	UFS_SNAPGONE(aa) ((aa)->i_ump->um_snapgone(aa))
=20
 #define	UFS_LOCK(aa)	mtx_lock(&(aa)->um_lock)
 #define	UFS_UNLOCK(aa)	mtx_unlock(&(aa)->um_lock)

--7/SBNUKqFhVQCjUu
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iEYEARECAAYFAk2DbBwACgkQC3+MBN1Mb4j4JQCfQc+9ytDaqrH22pRBOYIgYq19
EWAAn1J2gfvx6dtPRWNt9UcUuaR4GRsr
=+VDp
-----END PGP SIGNATURE-----

--7/SBNUKqFhVQCjUu--

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 15:36:29 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 074D2106566C;
	Fri, 18 Mar 2011 15:36:29 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ED0868FC08;
	Fri, 18 Mar 2011 15: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 p2IFaSJW070707;
	Fri, 18 Mar 2011 15:36:28 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IFaS3U070700;
	Fri, 18 Mar 2011 15:36:28 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201103181536.p2IFaS3U070700@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 18 Mar 2011 15:36:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219741 - in head/sys/ia64: ia64 include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 15:36:29 -0000

Author: marcel
Date: Fri Mar 18 15:36:28 2011
New Revision: 219741
URL: http://svn.freebsd.org/changeset/base/219741

Log:
  Use VM_MAXUSER_ADDRESS rather than VM_MAX_ADDRESS when we talk about
  the bounds of user space. Redefine VM_MAX_ADDRESS as ~0UL, even though
  it's not used anywhere in the source tree.

Modified:
  head/sys/ia64/ia64/genassym.c
  head/sys/ia64/ia64/machdep.c
  head/sys/ia64/ia64/support.S
  head/sys/ia64/ia64/trap.c
  head/sys/ia64/ia64/unaligned.c
  head/sys/ia64/include/vmparam.h

Modified: head/sys/ia64/ia64/genassym.c
==============================================================================
--- head/sys/ia64/ia64/genassym.c	Fri Mar 18 14:06:12 2011	(r219740)
+++ head/sys/ia64/ia64/genassym.c	Fri Mar 18 15:36:28 2011	(r219741)
@@ -116,4 +116,4 @@ ASSYM(TDF_NEEDRESCHED,	TDF_NEEDRESCHED);
 
 ASSYM(UC_MCONTEXT,	offsetof(ucontext_t, uc_mcontext));
 
-ASSYM(VM_MAX_ADDRESS,	VM_MAX_ADDRESS);
+ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS);

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Fri Mar 18 14:06:12 2011	(r219740)
+++ head/sys/ia64/ia64/machdep.c	Fri Mar 18 15:36:28 2011	(r219741)
@@ -601,12 +601,12 @@ map_gateway_page(void)
 	pte |= (uint64_t)ia64_gateway_page & PTE_PPN_MASK;
 
 	__asm __volatile("ptr.d %0,%1; ptr.i %0,%1" ::
-	    "r"(VM_MAX_ADDRESS), "r"(PAGE_SHIFT << 2));
+	    "r"(VM_MAXUSER_ADDRESS), "r"(PAGE_SHIFT << 2));
 
 	__asm __volatile("mov	%0=psr" : "=r"(psr));
 	__asm __volatile("rsm	psr.ic|psr.i");
 	ia64_srlz_i();
-	ia64_set_ifa(VM_MAX_ADDRESS);
+	ia64_set_ifa(VM_MAXUSER_ADDRESS);
 	ia64_set_itir(PAGE_SHIFT << 2);
 	ia64_srlz_d();
 	__asm __volatile("itr.d	dtr[%0]=%1" :: "r"(3), "r"(pte));
@@ -616,7 +616,7 @@ map_gateway_page(void)
 	ia64_srlz_i();
 
 	/* Expose the mapping to userland in ar.k5 */
-	ia64_set_k5(VM_MAX_ADDRESS);
+	ia64_set_k5(VM_MAXUSER_ADDRESS);
 }
 
 static u_int

Modified: head/sys/ia64/ia64/support.S
==============================================================================
--- head/sys/ia64/ia64/support.S	Fri Mar 18 14:06:12 2011	(r219740)
+++ head/sys/ia64/ia64/support.S	Fri Mar 18 15:36:28 2011	(r219741)
@@ -199,7 +199,7 @@ END(fusufault)
 ENTRY(casuword, 3)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -249,7 +249,7 @@ END(casuword)
 ENTRY(casuword32, 3)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -303,7 +303,7 @@ END(casuword32)
 ENTRY(subyte, 2)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -349,7 +349,7 @@ END(subyte)
 ENTRY(suword16, 2)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -395,7 +395,7 @@ END(suword16)
 ENTRY(suword32, 2)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -442,7 +442,7 @@ ENTRY(suword64, 2)
 XENTRY(suword)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -496,7 +496,7 @@ END(suword64)
 ENTRY(fubyte, 1)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -542,7 +542,7 @@ END(fubyte)
 ENTRY(fuword16, 2)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -588,7 +588,7 @@ END(fuword16)
 ENTRY(fuword32, 2)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -635,7 +635,7 @@ ENTRY(fuword64, 2)
 XENTRY(fuword)
 {	.mlx
 	add		r15=PC_CURTHREAD,r13
-	movl		r14=VM_MAX_ADDRESS
+	movl		r14=VM_MAXUSER_ADDRESS
 	;;
 }
 {	.mib
@@ -750,7 +750,7 @@ ENTRY(copyinstr, 4)
 	mov	loc1=rp
 	.body
 
-	movl	loc2=VM_MAX_ADDRESS		// make sure that src addr
+	movl	loc2=VM_MAXUSER_ADDRESS		// make sure that src addr
 	;; 
 	cmp.geu	p6,p0=in0,loc2			// is in user space.
 	;; 
@@ -863,7 +863,7 @@ ENTRY(copyin, 3)
 	mov	loc1=rp
 	.body
 
-	movl	loc2=VM_MAX_ADDRESS		// make sure that src addr
+	movl	loc2=VM_MAXUSER_ADDRESS		// make sure that src addr
 	;; 
 	cmp.geu	p6,p0=in0,loc2			// is in user space.
 	;; 
@@ -901,7 +901,7 @@ ENTRY(copyout, 3)
 	mov	loc1=rp
 	.body
 
-	movl	loc2=VM_MAX_ADDRESS		// make sure that dest addr
+	movl	loc2=VM_MAXUSER_ADDRESS		// make sure that dest addr
 	;; 
 	cmp.geu	p6,p0=in1,loc2			// is in user space.
 	;; 

Modified: head/sys/ia64/ia64/trap.c
==============================================================================
--- head/sys/ia64/ia64/trap.c	Fri Mar 18 14:06:12 2011	(r219740)
+++ head/sys/ia64/ia64/trap.c	Fri Mar 18 15:36:28 2011	(r219741)
@@ -532,7 +532,7 @@ trap(int vector, struct trapframe *tf)
 		rv = 0;
 		va = trunc_page(tf->tf_special.ifa);
 
-		if (va >= VM_MAX_ADDRESS) {
+		if (va >= VM_MAXUSER_ADDRESS) {
 			/*
 			 * Don't allow user-mode faults for kernel virtual
 			 * addresses, including the gateway page.
@@ -809,7 +809,7 @@ trap(int vector, struct trapframe *tf)
 		 * iip and enable single stepping only when it's an user
 		 * address.
 		 */
-		if (tf->tf_special.iip >= VM_MAX_ADDRESS)
+		if (tf->tf_special.iip >= VM_MAXUSER_ADDRESS)
 			return;
 		tf->tf_special.psr &= ~IA64_PSR_TB;
 		tf->tf_special.psr |= IA64_PSR_SS;

Modified: head/sys/ia64/ia64/unaligned.c
==============================================================================
--- head/sys/ia64/ia64/unaligned.c	Fri Mar 18 14:06:12 2011	(r219740)
+++ head/sys/ia64/ia64/unaligned.c	Fri Mar 18 15:36:28 2011	(r219741)
@@ -109,7 +109,7 @@ greg_ptr(mcontext_t *mc, int gr)
 static uint64_t
 rdreg(uint64_t *addr)
 {
-	if ((uintptr_t)addr < VM_MAX_ADDRESS)
+	if ((uintptr_t)addr < VM_MAXUSER_ADDRESS)
 		return (fuword(addr));
 	return (*addr);
 }
@@ -117,7 +117,7 @@ rdreg(uint64_t *addr)
 static void
 wrreg(uint64_t *addr, uint64_t val)
 {
-	if ((uintptr_t)addr < VM_MAX_ADDRESS)
+	if ((uintptr_t)addr < VM_MAXUSER_ADDRESS)
 		suword(addr, val);
 	else
 		*addr = val;

Modified: head/sys/ia64/include/vmparam.h
==============================================================================
--- head/sys/ia64/include/vmparam.h	Fri Mar 18 14:06:12 2011	(r219740)
+++ head/sys/ia64/include/vmparam.h	Fri Mar 18 15:36:28 2011	(r219741)
@@ -45,7 +45,7 @@
  * USRSTACK is the top (end) of the user stack.  Immediately above the user
  * stack resides the syscall gateway page.
  */
-#define	USRSTACK	VM_MAX_ADDRESS
+#define	USRSTACK	VM_MAXUSER_ADDRESS
 
 /*
  * Virtual memory related constants, all in bytes
@@ -195,13 +195,13 @@
 
 /* user/kernel map constants */
 #define VM_MIN_ADDRESS		0
-#define	VM_MAX_ADDRESS		IA64_RR_BASE(5)
+#define	VM_MAXUSER_ADDRESS	IA64_RR_BASE(5)
 #define	VM_GATEWAY_SIZE		PAGE_SIZE
-#define	VM_MAXUSER_ADDRESS	(VM_MAX_ADDRESS + VM_GATEWAY_SIZE)
-#define	VM_MIN_KERNEL_ADDRESS	VM_MAXUSER_ADDRESS
+#define	VM_MIN_KERNEL_ADDRESS	(VM_MAXUSER_ADDRESS + VM_GATEWAY_SIZE)
 #define VM_MAX_KERNEL_ADDRESS	(IA64_RR_BASE(6) - 1)
+#define	VM_MAX_ADDRESS		~0UL
 
-#define	KERNBASE		VM_MAX_ADDRESS
+#define	KERNBASE		VM_MAXUSER_ADDRESS
 
 /* virtual sizes (bytes) for various kernel submaps */
 #ifndef VM_KMEM_SIZE

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 16:51:31 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C185A106564A;
	Fri, 18 Mar 2011 16:51:31 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au
	[211.29.132.187])
	by mx1.freebsd.org (Postfix) with ESMTP id 60A508FC1F;
	Fri, 18 Mar 2011 16:51:30 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2IGpS67013549
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 19 Mar 2011 03:51:29 +1100
Date: Sat, 19 Mar 2011 03:51:28 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Kostik Belousov 
In-Reply-To: <20110318142844.GB78089@deviant.kiev.zoral.com.ua>
Message-ID: <20110319032048.H3038@besplex.bde.org>
References: <201103171123.p2HBNCGh025820@svn.freebsd.org>
	<20110318001402.H1537@besplex.bde.org>
	<20110318142844.GB78089@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Bruce Evans 
Subject: Re: svn commit: r219712 - head/sys/ufs/ufs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 16:51:31 -0000

On Fri, 18 Mar 2011, Kostik Belousov wrote:

> On Fri, Mar 18, 2011 at 12:37:41AM +1100, Bruce Evans wrote:
>> On Thu, 17 Mar 2011, Konstantin Belousov wrote:
>>
>>> Log:
>>> Remove the #if defined(FFS) || defined(IFS) braces around the calls to
>>> ffs_snapgone(). ufs.ko module is not build with FFS define, causing
>>> snapshot inode number slots in superblock never be freed, as well as a
>>> reference on the snapshot vnode.
>>>
>>> IFS was removed several years ago, and UFS/FFS separation was not
>>> maintained for real.
>>>
>>> Reported, analyzed and tested by:	Yamagi Burmeister 
>>> MFC after:	3 days
>>
>> This seems to leave FFS correctly unused.  Most options for file systems
>> are put in opt_dontuse.h to inhibit bugs like this (but I never figured
>> ...
>> the module.  opt_ffs_broken_fixme.h also became unnecessary in 2002,
>> but remains to generate history lessons :-).
>
> I went ahead and implemented UFS_SNAPONE() and removal of
> opt_ffs_broken_fixme.h.

Thanks.  At first I thought that UFS_SNAPGONE() was pointless, since there
are lots of other layering violations and the macros don't make the spit
really work.  But ffs_snapgone() was the only function named ffs_*() called
from ufs.  There are just 2 other references to ffs_*() in ufs.  Both are
in comments in ufs_inode.c.  But there are many other layering violations
which are not so obvious because the ffs functions are not spelled ffs_*().
Many are spelled softdep_*().  Soft updates are only implemented for ffs
and even their stubs were only implemented for ffs, so ufs without ffs
cannot compile.

The ufs files are actually selected by the ffs option in conf/files,
so ufs without ffs is almost impossible anyway.  The ffs module is
misnamed ufs, and it links all the ffs and ufs files, so if there were
a ext2fs, ifs, lfs or otherfs using ufs, especially if these were in
modules there would probably be multiple instances ifs ufs.  This may
even be the best way -- "fork" ufs by creating separate objects from
common sources with a few ifdefs, so that you don't have lots of
runtime tests and function pointers and extra source code to initialize
the function pointers...

Bruce

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 17:15:10 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 797941065677;
	Fri, 18 Mar 2011 17:15: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 6B5228FC22;
	Fri, 18 Mar 2011 17:15: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 p2IHFAeZ074878;
	Fri, 18 Mar 2011 17:15:10 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IHFATc074875;
	Fri, 18 Mar 2011 17:15:10 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103181715.p2IHFATc074875@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 18 Mar 2011 17:15:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219744 - stable/8/sys/ufs/ufs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 17:15:10 -0000

Author: jhb
Date: Fri Mar 18 17:15:10 2011
New Revision: 219744
URL: http://svn.freebsd.org/changeset/base/219744

Log:
  MFC 219384:
  The UFS dirhash code was attempting to update shared state in the dirhash
  from multiple threads while holding a shared lock during a lookup operation.
  This could result in incorrect ENOENT failures which could then be
  permanently stored in the name cache.
  
  Specifically, the dirhash code optimizes the case that a single thread is
  walking a directory sequentially opening (or stat'ing) each file.  It uses
  state in the dirhash structure to determine if a given lookup is using the
  optimization.  If the optimization fails, it disables it and restarts the
  lookup.  The problem arises when two threads both attempt the optimization
  and fail.  The first thread will restart the loop, but the second thread
  will incorrectly think that it did not try the optimization and will only
  examine a subset of the directory entires in its hash chain.  As a result,
  it may fail to find its directory entry and incorrectly fail with ENOENT.
  
  To make this safe for use with shared locks, simplify the state stored in
  the dirhash and move some of the state (the part that determines if the
  current thread is trying the optimization) into a local variable.  One
  result is that we will now try the optimization more often.  We still
  update the value under the shared lock, but it is a single atomic store
  similar to i_diroff that is stored in UFS directory i-nodes for the
  non-dirhash lookup.

Modified:
  stable/8/sys/ufs/ufs/dirhash.h
  stable/8/sys/ufs/ufs/ufs_dirhash.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/ufs/ufs/dirhash.h
==============================================================================
--- stable/8/sys/ufs/ufs/dirhash.h	Fri Mar 18 16:13:08 2011	(r219743)
+++ stable/8/sys/ufs/ufs/dirhash.h	Fri Mar 18 17:15:10 2011	(r219744)
@@ -98,7 +98,6 @@ struct dirhash {
 	int	dh_dirblks;	/* number of DIRBLKSIZ blocks in dir */
 	int	dh_firstfree[DH_NFSTATS + 1]; /* first blk with N words free */
 
-	int	dh_seqopt;	/* sequential access optimisation enabled */
 	doff_t	dh_seqoff;	/* sequential access optimisation offset */
 
 	int	dh_score;	/* access count for this dirhash */

Modified: stable/8/sys/ufs/ufs/ufs_dirhash.c
==============================================================================
--- stable/8/sys/ufs/ufs/ufs_dirhash.c	Fri Mar 18 16:13:08 2011	(r219743)
+++ stable/8/sys/ufs/ufs/ufs_dirhash.c	Fri Mar 18 17:15:10 2011	(r219744)
@@ -403,8 +403,7 @@ ufsdirhash_build(struct inode *ip)
 		dh->dh_firstfree[i] = -1;
 	dh->dh_firstfree[DH_NFSTATS] = 0;
 	dh->dh_hused = 0;
-	dh->dh_seqopt = 0;
-	dh->dh_seqoff = 0;
+	dh->dh_seqoff = -1;
 	dh->dh_score = DH_SCOREINIT;
 	dh->dh_lastused = time_second;
 
@@ -552,7 +551,7 @@ ufsdirhash_lookup(struct inode *ip, char
 	struct direct *dp;
 	struct vnode *vp;
 	struct buf *bp;
-	doff_t blkoff, bmask, offset, prevoff;
+	doff_t blkoff, bmask, offset, prevoff, seqoff;
 	int i, slot;
 	int error;
 
@@ -592,29 +591,30 @@ ufsdirhash_lookup(struct inode *ip, char
 	bmask = vp->v_mount->mnt_stat.f_iosize - 1;
 	blkoff = -1;
 	bp = NULL;
+	seqoff = dh->dh_seqoff;
 restart:
 	slot = ufsdirhash_hash(dh, name, namelen);
 
-	if (dh->dh_seqopt) {
+	if (seqoff != -1) {
 		/*
-		 * Sequential access optimisation. dh_seqoff contains the
+		 * Sequential access optimisation. seqoff contains the
 		 * offset of the directory entry immediately following
 		 * the last entry that was looked up. Check if this offset
 		 * appears in the hash chain for the name we are looking for.
 		 */
 		for (i = slot; (offset = DH_ENTRY(dh, i)) != DIRHASH_EMPTY;
 		    i = WRAPINCR(i, dh->dh_hlen))
-			if (offset == dh->dh_seqoff)
+			if (offset == seqoff)
 				break;
-		if (offset == dh->dh_seqoff) {
+		if (offset == seqoff) {
 			/*
 			 * We found an entry with the expected offset. This
 			 * is probably the entry we want, but if not, the
-			 * code below will turn off seqopt and retry.
+			 * code below will retry.
 			 */ 
 			slot = i;
-		} else 
-			dh->dh_seqopt = 0;
+		} else
+			seqoff = -1;
 	}
 
 	for (; (offset = DH_ENTRY(dh, slot)) != DIRHASH_EMPTY;
@@ -655,9 +655,7 @@ restart:
 				*prevoffp = prevoff;
 			}
 
-			/* Check for sequential access, and update offset. */
-			if (dh->dh_seqopt == 0 && dh->dh_seqoff == offset)
-				dh->dh_seqopt = 1;
+			/* Update offset. */
 			dh->dh_seqoff = offset + DIRSIZ(0, dp);
 			*bpp = bp;
 			*offp = offset;
@@ -666,11 +664,11 @@ restart:
 		}
 
 		/*
-		 * When the name doesn't match in the seqopt case, go back
-		 * and search normally.
+		 * When the name doesn't match in the sequential
+		 * optimization case, go back and search normally.
 		 */
-		if (dh->dh_seqopt) {
-			dh->dh_seqopt = 0;
+		if (seqoff != -1) {
+			seqoff = -1;
 			goto restart;
 		}
 	}

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 17:15:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3EC1F106566B;
	Fri, 18 Mar 2011 17:15: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 30A018FC16;
	Fri, 18 Mar 2011 17:15: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 p2IHFlCV074923;
	Fri, 18 Mar 2011 17:15:47 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IHFlaZ074920;
	Fri, 18 Mar 2011 17:15:47 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103181715.p2IHFlaZ074920@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 18 Mar 2011 17:15:47 +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: r219745 - stable/7/sys/ufs/ufs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 17:15:47 -0000

Author: jhb
Date: Fri Mar 18 17:15:46 2011
New Revision: 219745
URL: http://svn.freebsd.org/changeset/base/219745

Log:
  MFC 219384:
  The UFS dirhash code was attempting to update shared state in the dirhash
  from multiple threads while holding a shared lock during a lookup operation.
  This could result in incorrect ENOENT failures which could then be
  permanently stored in the name cache.
  
  Specifically, the dirhash code optimizes the case that a single thread is
  walking a directory sequentially opening (or stat'ing) each file.  It uses
  state in the dirhash structure to determine if a given lookup is using the
  optimization.  If the optimization fails, it disables it and restarts the
  lookup.  The problem arises when two threads both attempt the optimization
  and fail.  The first thread will restart the loop, but the second thread
  will incorrectly think that it did not try the optimization and will only
  examine a subset of the directory entires in its hash chain.  As a result,
  it may fail to find its directory entry and incorrectly fail with ENOENT.
  
  To make this safe for use with shared locks, simplify the state stored in
  the dirhash and move some of the state (the part that determines if the
  current thread is trying the optimization) into a local variable.  One
  result is that we will now try the optimization more often.  We still
  update the value under the shared lock, but it is a single atomic store
  similar to i_diroff that is stored in UFS directory i-nodes for the
  non-dirhash lookup.

Modified:
  stable/7/sys/ufs/ufs/dirhash.h
  stable/7/sys/ufs/ufs/ufs_dirhash.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/ufs/ufs/dirhash.h
==============================================================================
--- stable/7/sys/ufs/ufs/dirhash.h	Fri Mar 18 17:15:10 2011	(r219744)
+++ stable/7/sys/ufs/ufs/dirhash.h	Fri Mar 18 17:15:46 2011	(r219745)
@@ -98,7 +98,6 @@ struct dirhash {
 	int	dh_dirblks;	/* number of DIRBLKSIZ blocks in dir */
 	int	dh_firstfree[DH_NFSTATS + 1]; /* first blk with N words free */
 
-	int	dh_seqopt;	/* sequential access optimisation enabled */
 	doff_t	dh_seqoff;	/* sequential access optimisation offset */
 
 	int	dh_score;	/* access count for this dirhash */

Modified: stable/7/sys/ufs/ufs/ufs_dirhash.c
==============================================================================
--- stable/7/sys/ufs/ufs/ufs_dirhash.c	Fri Mar 18 17:15:10 2011	(r219744)
+++ stable/7/sys/ufs/ufs/ufs_dirhash.c	Fri Mar 18 17:15:46 2011	(r219745)
@@ -394,8 +394,7 @@ ufsdirhash_build(struct inode *ip)
 		dh->dh_firstfree[i] = -1;
 	dh->dh_firstfree[DH_NFSTATS] = 0;
 	dh->dh_hused = 0;
-	dh->dh_seqopt = 0;
-	dh->dh_seqoff = 0;
+	dh->dh_seqoff = -1;
 	dh->dh_score = DH_SCOREINIT;
 	dh->dh_lastused = time_second;
 
@@ -543,7 +542,7 @@ ufsdirhash_lookup(struct inode *ip, char
 	struct direct *dp;
 	struct vnode *vp;
 	struct buf *bp;
-	doff_t blkoff, bmask, offset, prevoff;
+	doff_t blkoff, bmask, offset, prevoff, seqoff;
 	int i, slot;
 	int error;
 
@@ -583,29 +582,30 @@ ufsdirhash_lookup(struct inode *ip, char
 	bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1;
 	blkoff = -1;
 	bp = NULL;
+	seqoff = dh->dh_seqoff;
 restart:
 	slot = ufsdirhash_hash(dh, name, namelen);
 
-	if (dh->dh_seqopt) {
+	if (seqoff != -1) {
 		/*
-		 * Sequential access optimisation. dh_seqoff contains the
+		 * Sequential access optimisation. seqoff contains the
 		 * offset of the directory entry immediately following
 		 * the last entry that was looked up. Check if this offset
 		 * appears in the hash chain for the name we are looking for.
 		 */
 		for (i = slot; (offset = DH_ENTRY(dh, i)) != DIRHASH_EMPTY;
 		    i = WRAPINCR(i, dh->dh_hlen))
-			if (offset == dh->dh_seqoff)
+			if (offset == seqoff)
 				break;
-		if (offset == dh->dh_seqoff) {
+		if (offset == seqoff) {
 			/*
 			 * We found an entry with the expected offset. This
 			 * is probably the entry we want, but if not, the
-			 * code below will turn off seqopt and retry.
+			 * code below will retry.
 			 */ 
 			slot = i;
-		} else 
-			dh->dh_seqopt = 0;
+		} else
+			seqoff = -1;
 	}
 
 	for (; (offset = DH_ENTRY(dh, slot)) != DIRHASH_EMPTY;
@@ -646,9 +646,7 @@ restart:
 				*prevoffp = prevoff;
 			}
 
-			/* Check for sequential access, and update offset. */
-			if (dh->dh_seqopt == 0 && dh->dh_seqoff == offset)
-				dh->dh_seqopt = 1;
+			/* Update offset. */
 			dh->dh_seqoff = offset + DIRSIZ(0, dp);
 			*bpp = bp;
 			*offp = offset;
@@ -657,11 +655,11 @@ restart:
 		}
 
 		/*
-		 * When the name doesn't match in the seqopt case, go back
-		 * and search normally.
+		 * When the name doesn't match in the sequential
+		 * optimization case, go back and search normally.
 		 */
-		if (dh->dh_seqopt) {
-			dh->dh_seqopt = 0;
+		if (seqoff != -1) {
+			seqoff = -1;
 			goto restart;
 		}
 	}

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 17:18:10 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 51188106564A;
	Fri, 18 Mar 2011 17:18: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 292878FC0C;
	Fri, 18 Mar 2011 17:18: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 p2IHIAS1075076;
	Fri, 18 Mar 2011 17:18:10 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IHIAER075074;
	Fri, 18 Mar 2011 17:18:10 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103181718.p2IHIAER075074@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 18 Mar 2011 17:18:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219747 - stable/8/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 17:18:10 -0000

Author: jhb
Date: Fri Mar 18 17:18:09 2011
New Revision: 219747
URL: http://svn.freebsd.org/changeset/base/219747

Log:
  MFC 219399:
  When constructing a new cpuset, apply the parent cpuset's mask to the new
  set's mask rather than the root mask.  This was causing the root mask to
  be modified incorrectly.

Modified:
  stable/8/sys/kern/kern_cpuset.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_cpuset.c
==============================================================================
--- stable/8/sys/kern/kern_cpuset.c	Fri Mar 18 17:15:59 2011	(r219746)
+++ stable/8/sys/kern/kern_cpuset.c	Fri Mar 18 17:18:09 2011	(r219747)
@@ -245,7 +245,7 @@ cpuset_lookup(cpusetid_t setid, struct t
  * will have no valid cpu based on restrictions from the parent.
  */
 static int
-_cpuset_create(struct cpuset *set, struct cpuset *parent, cpuset_t *mask,
+_cpuset_create(struct cpuset *set, struct cpuset *parent, const cpuset_t *mask,
     cpusetid_t id)
 {
 
@@ -256,7 +256,7 @@ _cpuset_create(struct cpuset *set, struc
 	refcount_init(&set->cs_ref, 1);
 	set->cs_flags = 0;
 	mtx_lock_spin(&cpuset_lock);
-	CPU_AND(mask, &parent->cs_mask);
+	CPU_AND(&set->cs_mask, &parent->cs_mask);
 	set->cs_id = id;
 	set->cs_parent = cpuset_ref(parent);
 	LIST_INSERT_HEAD(&parent->cs_children, set, cs_siblings);
@@ -273,7 +273,7 @@ _cpuset_create(struct cpuset *set, struc
  * allocated.
  */
 static int
-cpuset_create(struct cpuset **setp, struct cpuset *parent, cpuset_t *mask)
+cpuset_create(struct cpuset **setp, struct cpuset *parent, const cpuset_t *mask)
 {
 	struct cpuset *set;
 	cpusetid_t id;
@@ -480,7 +480,7 @@ cpuset_which(cpuwhich_t which, id_t id, 
  * the new set is a child of 'set'.
  */
 static int
-cpuset_shadow(struct cpuset *set, struct cpuset *fset, cpuset_t *mask)
+cpuset_shadow(struct cpuset *set, struct cpuset *fset, const cpuset_t *mask)
 {
 	struct cpuset *parent;
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 17:18:25 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CA06106566B;
	Fri, 18 Mar 2011 17:18: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 1484B8FC12;
	Fri, 18 Mar 2011 17:18: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 p2IHIO2X075116;
	Fri, 18 Mar 2011 17:18:24 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IHIOaq075114;
	Fri, 18 Mar 2011 17:18:24 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103181718.p2IHIOaq075114@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 18 Mar 2011 17:18:24 +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: r219748 - stable/7/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 17:18:25 -0000

Author: jhb
Date: Fri Mar 18 17:18:24 2011
New Revision: 219748
URL: http://svn.freebsd.org/changeset/base/219748

Log:
  MFC 219399:
  When constructing a new cpuset, apply the parent cpuset's mask to the new
  set's mask rather than the root mask.  This was causing the root mask to
  be modified incorrectly.

Modified:
  stable/7/sys/kern/kern_cpuset.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/kern_cpuset.c
==============================================================================
--- stable/7/sys/kern/kern_cpuset.c	Fri Mar 18 17:18:09 2011	(r219747)
+++ stable/7/sys/kern/kern_cpuset.c	Fri Mar 18 17:18:24 2011	(r219748)
@@ -253,7 +253,7 @@ cpuset_lookup(cpusetid_t setid, struct t
  * will have no valid cpu based on restrictions from the parent.
  */
 static int
-_cpuset_create(struct cpuset *set, struct cpuset *parent, cpuset_t *mask,
+_cpuset_create(struct cpuset *set, struct cpuset *parent, const cpuset_t *mask,
     cpusetid_t id)
 {
 
@@ -264,7 +264,7 @@ _cpuset_create(struct cpuset *set, struc
 	refcount_init(&set->cs_ref, 1);
 	set->cs_flags = 0;
 	mtx_lock_spin(&cpuset_lock);
-	CPU_AND(mask, &parent->cs_mask);
+	CPU_AND(&set->cs_mask, &parent->cs_mask);
 	set->cs_id = id;
 	set->cs_parent = cpuset_ref(parent);
 	LIST_INSERT_HEAD(&parent->cs_children, set, cs_siblings);
@@ -281,7 +281,7 @@ _cpuset_create(struct cpuset *set, struc
  * allocated.
  */
 static int
-cpuset_create(struct cpuset **setp, struct cpuset *parent, cpuset_t *mask)
+cpuset_create(struct cpuset **setp, struct cpuset *parent, const cpuset_t *mask)
 {
 	struct cpuset *set;
 	cpusetid_t id;
@@ -501,7 +501,7 @@ cpuset_which(cpuwhich_t which, id_t id, 
  * the new set is a child of 'set'.
  */
 static int
-cpuset_shadow(struct cpuset *set, struct cpuset *fset, cpuset_t *mask)
+cpuset_shadow(struct cpuset *set, struct cpuset *fset, const cpuset_t *mask)
 {
 	struct cpuset *parent;
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 17:20:32 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 997DE1065686;
	Fri, 18 Mar 2011 17:20:32 +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 8BC758FC16;
	Fri, 18 Mar 2011 17:20: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 p2IHKWxk075217;
	Fri, 18 Mar 2011 17:20:32 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IHKWH9075215;
	Fri, 18 Mar 2011 17:20:32 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103181720.p2IHKWH9075215@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 18 Mar 2011 17:20: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: r219749 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 17:20:32 -0000

Author: jhb
Date: Fri Mar 18 17:20:32 2011
New Revision: 219749
URL: http://svn.freebsd.org/changeset/base/219749

Log:
  MFC 219460: Remove now-obsolete comment.

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	Fri Mar 18 17:18:24 2011	(r219748)
+++ stable/8/sys/compat/linux/linux_futex.c	Fri Mar 18 17:20:32 2011	(r219749)
@@ -412,7 +412,7 @@ futex_atomic_op(struct thread *td, int e
 		       "cmparg = %x, uaddr = %p\n",
 		       op, cmp, oparg, cmparg, uaddr);
 #endif
-	/* XXX: linux verifies access here and returns EFAULT */
+	/* XXX: Linux verifies access here and returns EFAULT */
 
 	switch (op) {
 	case FUTEX_OP_SET:
@@ -533,11 +533,6 @@ linux_sys_futex(struct thread *td, struc
 		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
-		 * corresponding to the same mapped memory in the sleeping
-		 * and waker process(es).
-		 */
 #ifdef DEBUG
 		if (ldebug(sys_futex))
 			printf(ARGS(sys_futex, "futex_wake uaddr %p val %d val3 %d"),

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 17:20:45 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D3751065680;
	Fri, 18 Mar 2011 17:20: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 6F6838FC08;
	Fri, 18 Mar 2011 17:20: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 p2IHKj6m075259;
	Fri, 18 Mar 2011 17:20:45 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IHKjZQ075257;
	Fri, 18 Mar 2011 17:20:45 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103181720.p2IHKjZQ075257@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 18 Mar 2011 17:20: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: r219750 - stable/7/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 17:20:45 -0000

Author: jhb
Date: Fri Mar 18 17:20:45 2011
New Revision: 219750
URL: http://svn.freebsd.org/changeset/base/219750

Log:
  MFC 219460: Remove now-obsolete comment.

Modified:
  stable/7/sys/compat/linux/linux_futex.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/compat/linux/linux_futex.c
==============================================================================
--- stable/7/sys/compat/linux/linux_futex.c	Fri Mar 18 17:20:32 2011	(r219749)
+++ stable/7/sys/compat/linux/linux_futex.c	Fri Mar 18 17:20:45 2011	(r219750)
@@ -395,7 +395,7 @@ futex_atomic_op(struct thread *td, int e
 		       "cmparg = %x, uaddr = %p\n",
 		       op, cmp, oparg, cmparg, uaddr);
 #endif
-	/* XXX: linux verifies access here and returns EFAULT */
+	/* XXX: Linux verifies access here and returns EFAULT */
 
 	switch (op) {
 	case FUTEX_OP_SET:
@@ -491,11 +491,6 @@ linux_sys_futex(struct thread *td, struc
 		LINUX_CTR2(sys_futex, "WAKE val %d uaddr %p",
 		    args->val, args->uaddr);
 
-		/*
-		 * XXX: Linux is able to cope with different addresses
-		 * corresponding to the same mapped memory in the sleeping
-		 * and waker process(es).
-		 */
 #ifdef DEBUG
 		if (ldebug(sys_futex))
 			printf(ARGS(sys_futex, "futex_wake val %d uaddr %p"),

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 17:23:24 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 20D6D1065676;
	Fri, 18 Mar 2011 17:23:24 +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 12FC28FC13;
	Fri, 18 Mar 2011 17:23: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 p2IHNN9L075368;
	Fri, 18 Mar 2011 17:23:23 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IHNNjb075366;
	Fri, 18 Mar 2011 17:23:23 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103181723.p2IHNNjb075366@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 18 Mar 2011 17:23: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: r219751 - stable/8/sys/boot/i386/gptboot
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 17:23:24 -0000

Author: jhb
Date: Fri Mar 18 17:23:23 2011
New Revision: 219751
URL: http://svn.freebsd.org/changeset/base/219751

Log:
  MFC 219483: Remove all object files during 'make clean'.

Modified:
  stable/8/sys/boot/i386/gptboot/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/boot/i386/gptboot/Makefile
==============================================================================
--- stable/8/sys/boot/i386/gptboot/Makefile	Fri Mar 18 17:20:45 2011	(r219750)
+++ stable/8/sys/boot/i386/gptboot/Makefile	Fri Mar 18 17:23:23 2011	(r219751)
@@ -60,7 +60,8 @@ gptldr.bin: gptldr.out
 gptldr.out: gptldr.o
 	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
 
-CLEANFILES+=	gptboot.bin gptboot.out gptboot.o sio.o ufsread.o
+CLEANFILES+=	gptboot.bin gptboot.out gptboot.o sio.o gpt.o crc32.o drv.o \
+		cons.o util.o
 
 gptboot.bin: gptboot.out
 	objcopy -S -O binary gptboot.out ${.TARGET}

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 18:40:00 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 91EEA1065677;
	Fri, 18 Mar 2011 18:39:59 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Bruce Evans 
Date: Fri, 18 Mar 2011 14:39:47 -0400
User-Agent: KMail/1.6.2
References: <201103152145.p2FLjAlt060256@svn.freebsd.org>
	<201103171701.57546.jkim@FreeBSD.org>
	<20110318161019.M984@besplex.bde.org>
In-Reply-To: <20110318161019.M984@besplex.bde.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: Multipart/Mixed;
  boundary="Boundary-00=_2b6gNBLeoXmpoSF"
Message-Id: <201103181439.50194.jkim@FreeBSD.org>
Cc: src-committers@FreeBSD.org, Peter Jeremy ,
	Roman Divacky , svn-src-head@FreeBSD.org,
	svn-src-all@FreeBSD.org, Maxim Dounin 
Subject: Re: svn commit: r219679 - head/sys/i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 18:40:00 -0000


--Boundary-00=_2b6gNBLeoXmpoSF
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Friday 18 March 2011 01:19 am, Bruce Evans wrote:
> On Thu, 17 Mar 2011, Jung-uk Kim wrote:
> > On Thursday 17 March 2011 03:57 pm, Peter Jeremy wrote:
> >> On 2011-Mar-16 16:34:04 -0400, Jung-uk Kim  
wrote:
> >>> On Wednesday 16 March 2011 01:45 pm, Roman Divacky wrote:
> >>>> if we drop i486 I think it makes sense to require something
> >>>> that has at least SSE2, thus we can have the same expectations
> >>>> as on amd64.
> >>
> >> I think it's stil a bit early for that - especially the SSE2
> >> requirement.
> >>
> >>> This is a proof-of-concept patch for sys/x86/isa/clock.c:
> >>>
> >>> http://people.freebsd.org/~jkim/clock.diff
> >>>
> >>> You see the complexity, just because I wanted to load 64-bit
> >>> value atomically... :-(
> >>
> >> An alternative approach is to have _fetch_frequency() be
> >>   uint64_t (*_fetch_frequency)(uint64_t *);
> >> if i386 and I486 are defined (otherwise it's just the #define
> >> (*(p))) then initialise it to either atomic_fetch_quad_i386 or
> >> atomic_fetch_quad_i586 as part of the CPU detection process. 
> >> This is the way bcopy() is/was handled on Pentium.
> >>
> >> Another approach would be to always have cmpxchg8b instructions
> >> (followed by a suitably large NOP) always inlined in the code
> >> and if it traps, patch the code to call a function that emulates
> >> it.
> >
> > I think the former makes more sense for atomic read/write because
> > we don't need complete cmpxchg8b support but kind of movq
> > support, actually.
>
> Both require a function call.  With a function call, patching
> becomes much easier since there is only 1 place to patch, so
> patching is almost as easy as changing a function pointer (might
> need an instruction queue flush and/or prevention of the function
> being called before or while it is being patched).
>
> Patching the code also makes it easier to null out the lock prefix
> in the !SMP case when it is presumably not needed.  The function
> call to a function without a lock prefix will then be faster than
> inline code with a lock prefix.  With a function pointer, you start
> getting combinatorial explosion in the number of separate functions
> needed (1 without cmpxchg8b or a lock prefix (for i486), 1 with
> cmpxchg8b without a lock prefix (for !SMP i586+), and 1 with both
> (for SMP i586+).

I already implemented the function pointer thing last night.  You can 
see the current work-in-progress patch here:

http://people.freebsd.org/~jkim/tsc_cleanup.diff

Also, it's attached here as well.  I didn't notice any problem so far 
but I am sure you will find some. ;-)

Please note the patch includes get_cyclecount() to cpu_ticks() 
conversion to give you a complete picture.

Jung-uk Kim

--Boundary-00=_2b6gNBLeoXmpoSF
Content-Type: text/plain;
  charset="iso-8859-1";
  name="tsc_cleanup.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="tsc_cleanup.diff"

Index: sys/kern/kern_ktr.c
===================================================================
--- sys/kern/kern_ktr.c	(revision 219741)
+++ sys/kern/kern_ktr.c	(working copy)
@@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$");
 #endif
 
 #ifndef KTR_TIME
-#define	KTR_TIME	get_cyclecount()
+#define	KTR_TIME	cpu_ticks()
 #endif
 
 #ifndef KTR_CPU
Index: sys/kern/init_main.c
===================================================================
--- sys/kern/init_main.c	(revision 219741)
+++ sys/kern/init_main.c	(working copy)
@@ -560,7 +560,7 @@ SYSINIT(p0init, SI_SUB_INTRINSIC, SI_ORDER_FIRST,
 static void
 proc0_post(void *dummy __unused)
 {
-	struct timespec ts;
+	struct bintime bt;
 	struct proc *p;
 	struct rusage ru;
 	struct thread *td;
@@ -590,8 +590,8 @@ proc0_post(void *dummy __unused)
 	/*
 	 * Give the ``random'' number generator a thump.
 	 */
-	nanotime(&ts);
-	srandom(ts.tv_sec ^ ts.tv_nsec);
+	bintime(&bt);
+	srandom(bt.sec ^ bt.frac);
 }
 SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL);
 
@@ -601,10 +601,10 @@ random_init(void *dummy __unused)
 
 	/*
 	 * After CPU has been started we have some randomness on most
-	 * platforms via get_cyclecount().  For platforms that don't
-	 * we will reseed random(9) in proc0_post() as well.
+	 * platforms via cpu_ticks().  For platforms that don't we will
+	 * reseed random(9) in proc0_post() as well.
 	 */
-	srandom(get_cyclecount());
+	srandom(cpu_ticks());
 }
 SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_FIRST, random_init, NULL);
 
Index: sys/netinet/sctp_os_bsd.h
===================================================================
--- sys/netinet/sctp_os_bsd.h	(revision 219741)
+++ sys/netinet/sctp_os_bsd.h	(working copy)
@@ -129,7 +129,7 @@ MALLOC_DECLARE(SCTP_M_MCORE);
 
 #if defined(SCTP_LOCAL_TRACE_BUF)
 
-#define SCTP_GET_CYCLECOUNT get_cyclecount()
+#define SCTP_GET_CYCLECOUNT cpu_ticks()
 #define SCTP_CTR6 sctp_log_trace
 
 #else
Index: sys/dev/acpica/acpi_cpu.c
===================================================================
--- sys/dev/acpica/acpi_cpu.c	(revision 219741)
+++ sys/dev/acpica/acpi_cpu.c	(working copy)
@@ -516,7 +516,7 @@ acpi_cpu_read_ivar(device_t dev, device_t child, i
 #if defined(__amd64__) || defined(__i386__)
     case CPU_IVAR_NOMINAL_MHZ:
 	if (tsc_is_invariant) {
-	    *result = (uintptr_t)(tsc_freq / 1000000);
+	    *result = (uintptr_t)(GET_TSC_FREQ() / 1000000);
 	    break;
 	}
 	/* FALLTHROUGH */
Index: sys/dev/de/if_devar.h
===================================================================
--- sys/dev/de/if_devar.h	(revision 219741)
+++ sys/dev/de/if_devar.h	(working copy)
@@ -903,7 +903,7 @@ typedef u_long tulip_cycle_t;
 static __inline tulip_cycle_t
 TULIP_PERFREAD(void)
 {
-	return (get_cyclecount());
+	return (cpu_ticks());
 }
 
 #define	TULIP_PERFDIFF(s, f)	((f) - (s))
Index: sys/dev/random/randomdev_soft.c
===================================================================
--- sys/dev/random/randomdev_soft.c	(revision 219741)
+++ sys/dev/random/randomdev_soft.c	(working copy)
@@ -353,8 +353,8 @@ random_yarrow_write(void *buf, int count)
 		chunk = HARVESTSIZE;
 		if (i + chunk >= count)
 			chunk = (u_int)(count - i);
-		random_harvest_internal(get_cyclecount(), (char *)buf + i,
-		    chunk, 0, 0, RANDOM_WRITE);
+		random_harvest_internal(cpu_ticks(), (char *)buf + i, chunk,
+		    0, 0, RANDOM_WRITE);
 	}
 }
 
Index: sys/dev/random/harvest.c
===================================================================
--- sys/dev/random/harvest.c	(revision 219741)
+++ sys/dev/random/harvest.c	(working copy)
@@ -78,17 +78,16 @@ random_yarrow_deinit_harvester(void)
  * Implemented as in indirect call to allow non-inclusion of
  * the entropy device.
  *
- * XXXRW: get_cyclecount() is cheap on most modern hardware, where cycle
- * counters are built in, but on older hardware it will do a real time clock
- * read which can be quite expensive.
+ * XXXRW: cpu_ticks() is cheap on most modern hardware, where cycle counters
+ * are built in, but on older hardware it will do a real time clock read
+ * which can be quite expensive.
  */
 void
 random_harvest(void *entropy, u_int count, u_int bits, u_int frac,
     enum esource origin)
 {
 	if (reap_func)
-		(*reap_func)(get_cyclecount(), entropy, count, bits, frac,
-		    origin);
+		(*reap_func)(cpu_ticks(), entropy, count, bits, frac, origin);
 }
 
 /* Userland-visible version of read_random */
Index: sys/compat/linprocfs/linprocfs.c
===================================================================
--- sys/compat/linprocfs/linprocfs.c	(revision 219741)
+++ sys/compat/linprocfs/linprocfs.c	(working copy)
@@ -221,6 +221,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
 {
 	int hw_model[2];
 	char model[128];
+	uint64_t freq;
 	size_t size;
 	int class, fqmhz, fqkhz;
 	int i;
@@ -303,9 +304,10 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
 		if (cpu_feature & (1 << i))
 			sbuf_printf(sb, " %s", flags[i]);
 	sbuf_cat(sb, "\n");
-	if (class >= 5) {
-		fqmhz = (tsc_freq + 4999) / 1000000;
-		fqkhz = ((tsc_freq + 4999) / 10000) % 100;
+	freq = GET_TSC_FREQ();
+	if (class >=5 && freq != 0) {
+		fqmhz = (freq + 4999) / 1000000;
+		fqkhz = ((freq + 4999) / 10000) % 100;
 		sbuf_printf(sb,
 		    "cpu MHz\t\t: %d.%02d\n"
 		    "bogomips\t: %d.%02d\n",
Index: sys/pc98/pc98/machdep.c
===================================================================
--- sys/pc98/pc98/machdep.c	(revision 219741)
+++ sys/pc98/pc98/machdep.c	(working copy)
@@ -1072,16 +1072,17 @@ int
 cpu_est_clockrate(int cpu_id, uint64_t *rate)
 {
 	register_t reg;
-	uint64_t tsc1, tsc2;
+	uint64_t freq, tsc1, tsc2;
 
 	if (pcpu_find(cpu_id) == NULL || rate == NULL)
 		return (EINVAL);
 	if ((cpu_feature & CPUID_TSC) == 0)
 		return (EOPNOTSUPP);
+	freq = GET_TSC_FREQ();
 
 	/* If we're booting, trust the rate calibrated moments ago. */
-	if (cold && tsc_freq != 0) {
-		*rate = tsc_freq;
+	if (cold && freq != 0) {
+		*rate = freq;
 		return (0);
 	}
 
@@ -1109,17 +1110,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate)
 	}
 #endif
 
-	tsc2 -= tsc1;
-	if (tsc_freq != 0) {
-		*rate = tsc2 * 1000;
-		return (0);
-	}
-
-	/*
-	 * Subtract 0.5% of the total.  Empirical testing has shown that
-	 * overhead in DELAY() works out to approximately this value.
-	 */
-	*rate = tsc2 * 1000 - tsc2 * 5;
+	*rate = (tsc2 - tsc1) * 1000;
 	return (0);
 }
 
Index: sys/x86/cpufreq/est.c
===================================================================
--- sys/x86/cpufreq/est.c	(revision 219741)
+++ sys/x86/cpufreq/est.c	(working copy)
@@ -1215,7 +1215,7 @@ est_msr_info(device_t dev, uint64_t msr, freq_info
 		return (EOPNOTSUPP);
 
 	/* Figure out the bus clock. */
-	freq = tsc_freq / 1000000;
+	freq = GET_TSC_FREQ() / 1000000;
 	id = msr >> 32;
 	bus = freq / (id >> 8);
 	device_printf(dev, "Guessed bus clock (high) of %d MHz\n", bus);
Index: sys/x86/x86/tsc.c
===================================================================
--- sys/x86/x86/tsc.c	(revision 219741)
+++ sys/x86/x86/tsc.c	(working copy)
@@ -245,14 +245,16 @@ tsc_freq_changing(void *arg, const struct cf_level
 static void
 tsc_freq_changed(void *arg, const struct cf_level *level, int status)
 {
+	uint64_t freq;
 
 	/* If there was an error during the transition, don't do anything. */
 	if (tsc_disabled || status != 0)
 		return;
 
 	/* Total setting for this level gives the new frequency in MHz. */
-	tsc_freq = (uint64_t)level->total_set.freq * 1000000;
-	tsc_timecounter.tc_frequency = tsc_freq;
+	freq = (uint64_t)level->total_set.freq * 1000000;
+	SET_TSC_FREQ(freq);
+	atomic_store_64(&tsc_timecounter.tc_frequency, freq);
 }
 
 static int
@@ -261,13 +263,13 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_ARGS)
 	int error;
 	uint64_t freq;
 
-	if (tsc_timecounter.tc_frequency == 0)
+	freq = GET_TSC_FREQ();
+	if (freq == 0)
 		return (EOPNOTSUPP);
-	freq = tsc_freq;
 	error = sysctl_handle_64(oidp, &freq, 0, req);
 	if (error == 0 && req->newptr != NULL) {
-		tsc_freq = freq;
-		tsc_timecounter.tc_frequency = tsc_freq;
+		SET_TSC_FREQ(freq);
+		atomic_store_64(&tsc_timecounter.tc_frequency, freq);
 	}
 	return (error);
 }
Index: sys/x86/isa/clock.c
===================================================================
--- sys/x86/isa/clock.c	(revision 219741)
+++ sys/x86/isa/clock.c	(working copy)
@@ -245,40 +245,43 @@ getit(void)
 	return ((high << 8) | low);
 }
 
-static __inline void
-delay_tsc(int n)
+static __inline int
+_delay(int n)
 {
-	uint64_t start, end, now;
-
-	sched_pin();
-	start = rdtsc();
-	end = start + (tsc_freq * n) / 1000000;
-	do {
-		cpu_spinwait();
-		now = rdtsc();
-	} while (now < end || (now > start && end < start));
-	sched_unpin();
-}
-
-static __inline void
-delay_timecounter(struct timecounter *tc, int n)
-{
-	uint64_t end, now;
+	struct timecounter *tc;
+	uint64_t end, freq, now;
 	u_int last, mask, u;
+	int use_tsc;
 
-	mask = tc->tc_counter_mask;
-	last = tc->tc_get_timecount(tc) & mask;
-	end = tc->tc_frequency * n / 1000000;
+	tc = timecounter;
+	freq = GET_TSC_FREQ();
+	use_tsc = tsc_is_invariant && freq != 0;
+	if (use_tsc) {
+		mask = ~0u;
+		sched_pin();
+		last = rdtsc();
+	} else {
+		if (tc->tc_quality <= 0)
+			return (0);
+		freq = atomic_load_64(&tc->tc_frequency);
+		mask = tc->tc_counter_mask;
+		last = tc->tc_get_timecount(tc);
+	}
+	last &= mask;
+	end = freq * n / 1000000;
 	now = 0;
 	do {
 		cpu_spinwait();
-		u = tc->tc_get_timecount(tc) & mask;
+		u = (use_tsc ? rdtsc() : tc->tc_get_timecount(tc)) & mask;
 		if (u < last)
 			now += mask - last + u + 1;
 		else
 			now += u - last;
 		last = u;
 	} while (now < end);
+	if (use_tsc)
+		sched_unpin();
+	return (1);
 }
 
 /*
@@ -289,7 +292,6 @@ getit(void)
 void
 DELAY(int n)
 {
-	struct timecounter *tc;
 	int delta, prev_tick, tick, ticks_left;
 
 #ifdef DELAYDEBUG
@@ -298,15 +300,8 @@ DELAY(int n)
 	static int state = 0;
 #endif
 
-	if (tsc_freq != 0) {
-		delay_tsc(n);
+	if (_delay(n))
 		return;
-	}
-	tc = timecounter;
-	if (tc->tc_quality > 0) {
-		delay_timecounter(tc, n);
-		return;
-	}
 #ifdef DELAYDEBUG
 	if (state == 0) {
 		state = 1;
Index: sys/i386/include/clock.h
===================================================================
--- sys/i386/include/clock.h	(revision 219741)
+++ sys/i386/include/clock.h	(working copy)
@@ -20,6 +20,9 @@ extern int	i8254_max_count;
 extern uint64_t	tsc_freq;
 extern int	tsc_is_invariant;
 
+#define	GET_TSC_FREQ()	atomic_load_64(&tsc_freq)
+#define	SET_TSC_FREQ(f)	atomic_store_64(&tsc_freq, (f))
+
 void	i8254_init(void);
 
 /*
Index: sys/i386/include/atomic.h
===================================================================
--- sys/i386/include/atomic.h	(revision 219741)
+++ sys/i386/include/atomic.h	(working copy)
@@ -120,6 +120,76 @@ atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p,
 }							\
 struct __hack
 
+#if defined(_KERNEL) && !defined(WANT_FUNCTIONS)
+
+/* I486 does not support SMP or CMPXCHG8B. */
+static __inline uint64_t
+atomic_load_64_i386(uint64_t *p)
+{
+	uint64_t v;
+
+	__asm __volatile(
+	"	pushfl ;		"
+	"	cli ;			"
+	"	movl (%1),%%eax ;	"
+	"	movl 4(%1),%%edx ;	"
+	"	popfl"
+	: "=A" (v)			/* 0 */
+	: "c" (p));			/* 1 */
+	return (v);
+}
+
+static __inline void
+atomic_store_64_i386(uint64_t *p, uint64_t v)
+{
+
+	__asm __volatile(
+	"	pushfl ;		"
+	"	cli ;			"
+	"	movl %%eax,(%0) ;	"
+	"	movl %%edx,4(%0) ;	"
+	"	popfl"
+	:
+	: "r" (p),			/* 0 */
+	  "A" (v)			/* 1 */
+	: "memory");
+}
+
+/* For Pentium and above, use CMPXCHG8B to emulate MOVQ. */
+static __inline uint64_t
+atomic_load_64_i586(uint64_t *p)
+{
+	uint64_t v;
+
+	__asm __volatile(
+	"	movl %%ebx,%%eax ;	"
+	"	movl %%ecx,%%edx ;	"
+	"	" MPLOCKED "		"
+	"	cmpxchg8b (%1)"
+	: "=A" (v)			/* 0 */
+	: "c" (p)			/* 1 */
+	: "cc");
+	return (v);
+}
+
+static __inline void
+atomic_store_64_i586(uint64_t *p, uint64_t v)
+{
+
+	__asm __volatile(
+	"	movl %%eax,%%ebx ;	"
+	"	movl %%edx,%%ecx ;	"
+	"1:				"
+	"	cmpxchg8b (%0) ;	"
+	"	jne 1b"
+	:
+	: "r" (p),			/* 0 */
+	  "A" (v)			/* 1 */
+	: "ebx", "ecx", "memory", "cc");
+}
+
+#endif /* _KERNEL && !WANT_FUNCTIONS */
+
 /*
  * Atomic compare and set, used by the mutex functions
  *
@@ -292,6 +362,11 @@ ATOMIC_STORE_LOAD(long,	"cmpxchgl %0,%1",  "xchgl
 
 #ifndef WANT_FUNCTIONS
 
+#ifdef _KERNEL
+extern uint64_t (*atomic_load_64)(uint64_t *);
+extern void (*atomic_store_64)(uint64_t *, uint64_t);
+#endif
+
 static __inline int
 atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src)
 {
Index: sys/i386/include/cpu.h
===================================================================
--- sys/i386/include/cpu.h	(revision 219741)
+++ sys/i386/include/cpu.h	(working copy)
@@ -39,7 +39,6 @@
 /*
  * Definitions unique to i386 cpu support.
  */
-#include 
 #include 
 #include 
 #include 
@@ -70,13 +69,8 @@ void	swi_vm(void *);
 static __inline uint64_t
 get_cyclecount(void)
 {
-	struct bintime bt;
 
-	if (cpu_class == CPUCLASS_486) {
-		binuptime(&bt);
-		return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
-	}
-	return (rdtsc());
+	return (cpu_ticks());
 }
 
 #endif
Index: sys/i386/i386/legacy.c
===================================================================
--- sys/i386/i386/legacy.c	(revision 219741)
+++ sys/i386/i386/legacy.c	(working copy)
@@ -342,7 +342,7 @@ cpu_read_ivar(device_t dev, device_t child, int in
 		break;
 	case CPU_IVAR_NOMINAL_MHZ:
 		if (tsc_is_invariant) {
-			*result = (uintptr_t)(tsc_freq / 1000000);
+			*result = (uintptr_t)(GET_TSC_FREQ() / 1000000);
 			break;
 		}
 		/* FALLTHROUGH */
Index: sys/i386/i386/perfmon.c
===================================================================
--- sys/i386/i386/perfmon.c	(revision 219741)
+++ sys/i386/i386/perfmon.c	(working copy)
@@ -336,6 +336,7 @@ perfmon_ioctl(struct cdev *dev, u_long cmd, caddr_
 	struct pmc *pmc;
 	struct pmc_data *pmcd;
 	struct pmc_tstamp *pmct;
+	uint64_t freq;
 	int *ip;
 	int rv;
 
@@ -386,13 +387,14 @@ perfmon_ioctl(struct cdev *dev, u_long cmd, caddr_
 		break;
 
 	case PMIOTSTAMP:
-		if (!tsc_freq) {
+		freq = GET_TSC_FREQ();
+		if (freq == 0) {
 			rv = ENOTTY;
 			break;
 		}
 		pmct = (struct pmc_tstamp *)param;
 		/* XXX interface loses precision. */
-		pmct->pmct_rate = tsc_freq / 1000000;
+		pmct->pmct_rate = freq / 1000000;
 		pmct->pmct_value = rdtsc();
 		rv = 0;
 		break;
Index: sys/i386/i386/machdep.c
===================================================================
--- sys/i386/i386/machdep.c	(revision 219741)
+++ sys/i386/i386/machdep.c	(working copy)
@@ -1137,20 +1137,21 @@ int
 cpu_est_clockrate(int cpu_id, uint64_t *rate)
 {
 	register_t reg;
-	uint64_t tsc1, tsc2;
+	uint64_t freq, tsc1, tsc2;
 
 	if (pcpu_find(cpu_id) == NULL || rate == NULL)
 		return (EINVAL);
 	if ((cpu_feature & CPUID_TSC) == 0)
 		return (EOPNOTSUPP);
+	freq = GET_TSC_FREQ();
 
 	/* If TSC is P-state invariant, DELAY(9) based logic fails. */
-	if (tsc_is_invariant && tsc_freq != 0)
+	if (tsc_is_invariant && freq != 0)
 		return (EOPNOTSUPP);
 
 	/* If we're booting, trust the rate calibrated moments ago. */
-	if (cold && tsc_freq != 0) {
-		*rate = tsc_freq;
+	if (cold && freq != 0) {
+		*rate = freq;
 		return (0);
 	}
 
@@ -1178,17 +1179,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate)
 	}
 #endif
 
-	tsc2 -= tsc1;
-	if (tsc_freq != 0) {
-		*rate = tsc2 * 1000;
-		return (0);
-	}
-
-	/*
-	 * Subtract 0.5% of the total.  Empirical testing has shown that
-	 * overhead in DELAY() works out to approximately this value.
-	 */
-	*rate = tsc2 * 1000 - tsc2 * 5;
+	*rate = (tsc2 - tsc1) * 1000;
 	return (0);
 }
 
@@ -1419,6 +1410,19 @@ cpu_idle_wakeup(int cpu)
 	return (1);
 }
 
+uint64_t (*atomic_load_64)(uint64_t *) = atomic_load_64_i386;
+void (*atomic_store_64)(uint64_t *, uint64_t) = atomic_store_64_i386;
+
+static void
+cpu_probe_cx8(void)
+{
+
+	if ((cpu_feature & CPUID_CX8) != 0) {
+		atomic_load_64 = atomic_load_64_i586;
+		atomic_store_64 = atomic_store_64_i586;
+	}
+}
+
 /*
  * Ordered by speed/power consumption.
  */
@@ -2730,6 +2734,7 @@ init386(first)
 	thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1];
 
 	cpu_probe_amdc1e();
+	cpu_probe_cx8();
 }
 
 #else
@@ -3006,6 +3011,7 @@ init386(first)
 	thread0.td_frame = &proc0_tf;
 
 	cpu_probe_amdc1e();
+	cpu_probe_cx8();
 }
 #endif
 
Index: sys/contrib/altq/altq/altq_subr.c
===================================================================
--- sys/contrib/altq/altq/altq_subr.c	(revision 219741)
+++ sys/contrib/altq/altq/altq_subr.c	(working copy)
@@ -929,7 +929,7 @@ init_machclk_setup(void)
 #if defined(__amd64__) || defined(__i386__)
 	/* check if TSC is available */
 #ifdef __FreeBSD__
-	if ((cpu_feature & CPUID_TSC) == 0 || tsc_freq == 0)
+	if ((cpu_feature & CPUID_TSC) == 0 || GET_TSC_FREQ() == 0)
 #else
 	if ((cpu_feature & CPUID_TSC) == 0)
 #endif
@@ -964,7 +964,7 @@ init_machclk(void)
 	 */
 #if defined(__amd64__) || defined(__i386__)
 #ifdef __FreeBSD__
-	machclk_freq = tsc_freq;
+	machclk_freq = GET_TSC_FREQ();
 #elif defined(__NetBSD__)
 	machclk_freq = (u_int32_t)cpu_tsc_freq;
 #elif defined(__OpenBSD__) && (defined(I586_CPU) || defined(I686_CPU))
Index: sys/cddl/dev/dtrace/i386/dtrace_subr.c
===================================================================
--- sys/cddl/dev/dtrace/i386/dtrace_subr.c	(revision 219741)
+++ sys/cddl/dev/dtrace/i386/dtrace_subr.c	(working copy)
@@ -403,7 +403,7 @@ dtrace_gethrtime_init(void *arg)
 	 * Otherwise tick->time conversion will be inaccurate, but
 	 * will preserve monotonic property of TSC.
 	 */
-	tsc_f = tsc_freq;
+	tsc_f = GET_TSC_FREQ();
 
 	/*
 	 * The following line checks that nsec_scale calculated below
Index: sys/cddl/dev/dtrace/amd64/dtrace_subr.c
===================================================================
--- sys/cddl/dev/dtrace/amd64/dtrace_subr.c	(revision 219741)
+++ sys/cddl/dev/dtrace/amd64/dtrace_subr.c	(working copy)
@@ -403,7 +403,7 @@ dtrace_gethrtime_init(void *arg)
 	 * Otherwise tick->time conversion will be inaccurate, but
 	 * will preserve monotonic property of TSC.
 	 */
-	tsc_f = tsc_freq;
+	tsc_f = GET_TSC_FREQ();
 
 	/*
 	 * The following line checks that nsec_scale calculated below
Index: sys/amd64/include/clock.h
===================================================================
--- sys/amd64/include/clock.h	(revision 219741)
+++ sys/amd64/include/clock.h	(working copy)
@@ -20,6 +20,9 @@ extern int	i8254_max_count;
 extern uint64_t	tsc_freq;
 extern int	tsc_is_invariant;
 
+#define	GET_TSC_FREQ()	atomic_load_64(&tsc_freq)
+#define	SET_TSC_FREQ(f)	atomic_store_64(&tsc_freq, (f))
+
 void	i8254_init(void);
 
 /*
Index: sys/amd64/include/atomic.h
===================================================================
--- sys/amd64/include/atomic.h	(revision 219741)
+++ sys/amd64/include/atomic.h	(working copy)
@@ -303,6 +303,11 @@ ATOMIC_STORE_LOAD(long,	"cmpxchgq %0,%1",  "xchgq
 
 #ifndef WANT_FUNCTIONS
 
+#ifdef _KERNEL
+#define	atomic_load_64(p)	(*(p))
+#define	atomic_store_64(p, v)	do { *(p) = (v); } while (0)
+#endif
+
 /* Read the current value and store a zero in the destination. */
 #ifdef __GNUCLIKE_ASM
 
Index: sys/amd64/amd64/legacy.c
===================================================================
--- sys/amd64/amd64/legacy.c	(revision 219741)
+++ sys/amd64/amd64/legacy.c	(working copy)
@@ -321,7 +321,7 @@ cpu_read_ivar(device_t dev, device_t child, int in
 		break;
 	case CPU_IVAR_NOMINAL_MHZ:
 		if (tsc_is_invariant) {
-			*result = (uintptr_t)(tsc_freq / 1000000);
+			*result = (uintptr_t)(GET_TSC_FREQ() / 1000000);
 			break;
 		}
 		/* FALLTHROUGH */
Index: sys/amd64/amd64/machdep.c
===================================================================
--- sys/amd64/amd64/machdep.c	(revision 219741)
+++ sys/amd64/amd64/machdep.c	(working copy)
@@ -541,18 +541,19 @@ int
 cpu_est_clockrate(int cpu_id, uint64_t *rate)
 {
 	register_t reg;
-	uint64_t tsc1, tsc2;
+	uint64_t freq, tsc1, tsc2;
 
 	if (pcpu_find(cpu_id) == NULL || rate == NULL)
 		return (EINVAL);
+	freq = GET_TSC_FREQ();
 
 	/* If TSC is P-state invariant, DELAY(9) based logic fails. */
-	if (tsc_is_invariant && tsc_freq != 0)
+	if (tsc_is_invariant && freq != 0)
 		return (EOPNOTSUPP);
 
 	/* If we're booting, trust the rate calibrated moments ago. */
-	if (cold && tsc_freq != 0) {
-		*rate = tsc_freq;
+	if (cold && freq != 0) {
+		*rate = freq;
 		return (0);
 	}
 
@@ -580,17 +581,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate)
 	}
 #endif
 
-	tsc2 -= tsc1;
-	if (tsc_freq != 0) {
-		*rate = tsc2 * 1000;
-		return (0);
-	}
-
-	/*
-	 * Subtract 0.5% of the total.  Empirical testing has shown that
-	 * overhead in DELAY() works out to approximately this value.
-	 */
-	*rate = tsc2 * 1000 - tsc2 * 5;
+	*rate = (tsc2 - tsc1) * 1000;
 	return (0);
 }
 

--Boundary-00=_2b6gNBLeoXmpoSF--

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 18:54:01 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 236431065675;
	Fri, 18 Mar 2011 18:54:01 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1566E8FC26;
	Fri, 18 Mar 2011 18:54: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 p2IIs1jl077323;
	Fri, 18 Mar 2011 18:54:01 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IIs0G1077313;
	Fri, 18 Mar 2011 18:54:00 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201103181854.p2IIs0G1077313@svn.freebsd.org>
From: Jack F Vogel 
Date: Fri, 18 Mar 2011 18:54:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219753 - head/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 18:54:01 -0000

Author: jfv
Date: Fri Mar 18 18:54:00 2011
New Revision: 219753
URL: http://svn.freebsd.org/changeset/base/219753

Log:
  This delta updates the em driver to version 7.2.2 which has
  been undergoing test for some weeks. This improves the RX
  mbuf handling to avoid system hang due to depletion. Thanks
  to all those who have been testing the code, and to Beezar
  Liu for the design changes.
  
  Next the igb driver is updated for similar RX changes, but
  also to add new features support for our upcoming i350 family
  of adapters.
  
  MFC after a week

Modified:
  head/sys/dev/e1000/e1000_82575.c
  head/sys/dev/e1000/e1000_82575.h
  head/sys/dev/e1000/e1000_defines.h
  head/sys/dev/e1000/e1000_phy.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_igb.h
  head/sys/dev/e1000/if_lem.h

Modified: head/sys/dev/e1000/e1000_82575.c
==============================================================================
--- head/sys/dev/e1000/e1000_82575.c	Fri Mar 18 17:49:11 2011	(r219752)
+++ head/sys/dev/e1000/e1000_82575.c	Fri Mar 18 18:54:00 2011	(r219753)
@@ -36,7 +36,6 @@
  * 82575EB Gigabit Network Connection
  * 82575EB Gigabit Backplane Connection
  * 82575GB Gigabit Network Connection
- * 82575GB Gigabit Network Connection
  * 82576 Gigabit Network Connection
  * 82576 Quad Port Gigabit Mezzanine Adapter
  */
@@ -44,7 +43,6 @@
 #include "e1000_api.h"
 
 static s32  e1000_init_phy_params_82575(struct e1000_hw *hw);
-static s32  e1000_init_nvm_params_82575(struct e1000_hw *hw);
 static s32  e1000_init_mac_params_82575(struct e1000_hw *hw);
 static s32  e1000_acquire_phy_82575(struct e1000_hw *hw);
 static void e1000_release_phy_82575(struct e1000_hw *hw);
@@ -197,12 +195,14 @@ static s32 e1000_init_phy_params_82575(s
 	switch (phy->id) {
 	case I347AT4_E_PHY_ID:
 	case M88E1112_E_PHY_ID:
+	case M88E1340M_E_PHY_ID:
 	case M88E1111_I_PHY_ID:
 		phy->type                   = e1000_phy_m88;
 		phy->ops.check_polarity     = e1000_check_polarity_m88;
 		phy->ops.get_info           = e1000_get_phy_info_m88;
 		if (phy->id == I347AT4_E_PHY_ID ||
-		    phy->id == M88E1112_E_PHY_ID)
+		    phy->id == M88E1112_E_PHY_ID ||
+		    phy->id == M88E1340M_E_PHY_ID)
 			phy->ops.get_cable_length = e1000_get_cable_length_m88_gen2;
 		else
 			phy->ops.get_cable_length = e1000_get_cable_length_m88;
@@ -241,7 +241,7 @@ out:
  *  e1000_init_nvm_params_82575 - Init NVM func ptrs.
  *  @hw: pointer to the HW structure
  **/
-static s32 e1000_init_nvm_params_82575(struct e1000_hw *hw)
+s32 e1000_init_nvm_params_82575(struct e1000_hw *hw)
 {
 	struct e1000_nvm_info *nvm = &hw->nvm;
 	u32 eecd = E1000_READ_REG(hw, E1000_EECD);
@@ -258,7 +258,6 @@ static s32 e1000_init_nvm_params_82575(s
 	size += NVM_WORD_SIZE_BASE_SHIFT;
 
 	nvm->word_size = 1 << size;
-
 	nvm->opcode_bits        = 8;
 	nvm->delay_usec         = 1;
 	switch (nvm->override) {
@@ -278,20 +277,23 @@ static s32 e1000_init_nvm_params_82575(s
 
 	nvm->type = e1000_nvm_eeprom_spi;
 
-	if (nvm->word_size == (1 << 15)) {
+	if (nvm->word_size == (1 << 15))
 		nvm->page_size = 128;
-	}
-
 
 	/* Function Pointers */
-	nvm->ops.acquire = e1000_acquire_nvm_82575;
-	if (nvm->word_size < (1 << 15)) {
-		nvm->ops.read = e1000_read_nvm_eerd;
-	} else {
-		nvm->ops.read = e1000_read_nvm_spi;
-	}
-	nvm->ops.release = e1000_release_nvm_82575;
-	nvm->ops.valid_led_default = e1000_valid_led_default_82575;
+	nvm->ops.acquire    = e1000_acquire_nvm_82575;
+	nvm->ops.release    = e1000_release_nvm_82575;
+	if (nvm->word_size < (1 << 15))
+		nvm->ops.read    = e1000_read_nvm_eerd;
+	else
+		nvm->ops.read    = e1000_read_nvm_spi;
+
+	nvm->ops.write              = e1000_write_nvm_spi;
+	nvm->ops.validate           = e1000_validate_nvm_checksum_generic;
+	nvm->ops.update             = e1000_update_nvm_checksum_generic;
+	nvm->ops.valid_led_default  = e1000_valid_led_default_82575;
+
+	/* override genric family function pointers for specific descendants */
 	switch (hw->mac.type) {
 	case e1000_82580:
 		nvm->ops.validate = e1000_validate_nvm_checksum_82580;
@@ -302,10 +304,8 @@ static s32 e1000_init_nvm_params_82575(s
 		nvm->ops.update = e1000_update_nvm_checksum_i350;
 		break;
 	default:
-		nvm->ops.validate = e1000_validate_nvm_checksum_generic;
-		nvm->ops.update = e1000_update_nvm_checksum_generic;
+		break;
 	}
-	nvm->ops.write = e1000_write_nvm_spi;
 
 	return E1000_SUCCESS;
 }
@@ -889,9 +889,7 @@ static s32 e1000_acquire_nvm_82575(struc
 	ret_val = e1000_acquire_swfw_sync_82575(hw, E1000_SWFW_EEP_SM);
 	if (ret_val)
 		goto out;
-
 	ret_val = e1000_acquire_nvm_generic(hw);
-
 	if (ret_val)
 		e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM);
 
@@ -910,7 +908,6 @@ static void e1000_release_nvm_82575(stru
 {
 	DEBUGFUNC("e1000_release_nvm_82575");
 
-	e1000_release_nvm_generic(hw);
 	e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM);
 }
 
@@ -1365,7 +1362,8 @@ static s32 e1000_setup_copper_link_82575
 	switch (hw->phy.type) {
 	case e1000_phy_m88:
 		if (hw->phy.id == I347AT4_E_PHY_ID ||
-		    hw->phy.id == M88E1112_E_PHY_ID)
+		    hw->phy.id == M88E1112_E_PHY_ID ||
+		    hw->phy.id == M88E1340M_E_PHY_ID)
 			ret_val = e1000_copper_link_setup_m88_gen2(hw);
 		else
 			ret_val = e1000_copper_link_setup_m88(hw);
@@ -1840,7 +1838,6 @@ out:
 	return ret_val;
 }
 
-
 /**
  *  e1000_vmdq_set_anti_spoofing_pf - enable or disable anti-spoofing
  *  @hw: pointer to the hardware struct
@@ -1986,7 +1983,7 @@ out:
  *  e1000_reset_mdicnfg_82580 - Reset MDICNFG destination and com_mdio bits
  *  @hw: pointer to the HW structure
  *
- *  This resets the MDICNFG.Destination and MDICNFG.Com_MDIO bits based on
+ *  This resets the the MDICNFG.Destination and MDICNFG.Com_MDIO bits based on
  *  the values found in the EEPROM.  This addresses an issue in which these
  *  bits are not restored from EEPROM after reset.
  **/

Modified: head/sys/dev/e1000/e1000_82575.h
==============================================================================
--- head/sys/dev/e1000/e1000_82575.h	Fri Mar 18 17:49:11 2011	(r219752)
+++ head/sys/dev/e1000/e1000_82575.h	Fri Mar 18 18:54:00 2011	(r219753)
@@ -469,6 +469,8 @@ struct e1000_adv_tx_context_desc {
 void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable);
 void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf);
 void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable);
+s32 e1000_init_nvm_params_82575(struct e1000_hw *hw);
+
 enum e1000_promisc_type {
 	e1000_promisc_disabled = 0,   /* all promisc modes disabled */
 	e1000_promisc_unicast = 1,    /* unicast promiscuous enabled */

Modified: head/sys/dev/e1000/e1000_defines.h
==============================================================================
--- head/sys/dev/e1000/e1000_defines.h	Fri Mar 18 17:49:11 2011	(r219752)
+++ head/sys/dev/e1000/e1000_defines.h	Fri Mar 18 18:54:00 2011	(r219753)
@@ -76,8 +76,8 @@
 #define E1000_WUFC_FLX3 0x00080000 /* Flexible Filter 3 Enable */
 #define E1000_WUFC_FLX4 0x00100000 /* Flexible Filter 4 Enable */
 #define E1000_WUFC_FLX5 0x00200000 /* Flexible Filter 5 Enable */
-#define E1000_WUFC_FLX6  0x00400000 /* Flexible Filter 6 Enable */
-#define E1000_WUFC_FLX7  0x00800000 /* Flexible Filter 7 Enable */
+#define E1000_WUFC_FLX6 0x00400000 /* Flexible Filter 6 Enable */
+#define E1000_WUFC_FLX7 0x00800000 /* Flexible Filter 7 Enable */
 #define E1000_WUFC_FW_RST 0x80000000 /* Wake on FW Reset Enable */
 #define E1000_WUFC_ALL_FILTERS_PHY_4 0x0000F0FF /*Mask for all wakeup filters*/
 #define E1000_WUFC_FLX_OFFSET_PHY 12 /* Offset to the Flexible Filters bits */
@@ -249,6 +249,7 @@
 #define E1000_RXD_SPC_CFI_MASK  0x1000  /* CFI is bit 12 */
 #define E1000_RXD_SPC_CFI_SHIFT 12
 
+#define E1000_RXDEXT_STATERR_LB    0x00040000
 #define E1000_RXDEXT_STATERR_CE    0x01000000
 #define E1000_RXDEXT_STATERR_SE    0x02000000
 #define E1000_RXDEXT_STATERR_SEQ   0x04000000
@@ -1478,7 +1479,8 @@
 #define M88E1011_I_REV_4     0x04
 #define M88E1111_I_PHY_ID    0x01410CC0
 #define M88E1112_E_PHY_ID    0x01410C90
-#define I347AT4_E_PHY_ID    0x01410DC0
+#define I347AT4_E_PHY_ID     0x01410DC0
+#define M88E1340M_E_PHY_ID   0x01410DF0
 #define GG82563_E_PHY_ID     0x01410CA0
 #define IGP03E1000_E_PHY_ID  0x02A80390
 #define IFE_E_PHY_ID         0x02A80330
@@ -1764,11 +1766,10 @@
 #define E1000_RTTBCNRC_RF_INT_MASK	\
 	(E1000_RTTBCNRC_RF_DEC_MASK << E1000_RTTBCNRC_RF_INT_SHIFT)
 
-
 /* DMA Coalescing register fields */
 #define E1000_DMACR_DMACWT_MASK         0x00003FFF /* DMA Coalescing
                                                     * Watchdog Timer */
-#define E1000_DMACR_DMACTHR_MASK        0x00FF0000 /* DMA Coalescing Receive
+#define E1000_DMACR_DMACTHR_MASK        0x00FF0000 /* DMA Coalescing Rx
                                                     * Threshold */
 #define E1000_DMACR_DMACTHR_SHIFT       16
 #define E1000_DMACR_DMAC_LX_MASK        0x30000000 /* Lx when no PCIe
@@ -1781,15 +1782,15 @@
 
 #define E1000_DMCTLX_TTLX_MASK          0x00000FFF /* Time to LX request */
 
-#define E1000_DMCRTRH_UTRESH_MASK       0x0007FFFF /* Receive Traffic Rate
+#define E1000_DMCRTRH_UTRESH_MASK       0x0007FFFF /* Rx Traffic Rate
                                                     * Threshold */
-#define E1000_DMCRTRH_LRPRCW            0x80000000 /* Rcv packet rate in
+#define E1000_DMCRTRH_LRPRCW            0x80000000 /* Rx packet rate in
                                                     * current window */
 
-#define E1000_DMCCNT_CCOUNT_MASK        0x01FFFFFF /* DMA Coal Rcv Traffic
+#define E1000_DMCCNT_CCOUNT_MASK        0x01FFFFFF /* DMA Coal Rx Traffic
                                                     * Current Cnt */
 
-#define E1000_FCRTC_RTH_COAL_MASK       0x0003FFF0 /* Flow ctrl Rcv Threshold
+#define E1000_FCRTC_RTH_COAL_MASK       0x0003FFF0 /* Flow ctrl Rx Threshold
                                                     * High val */
 #define E1000_FCRTC_RTH_COAL_SHIFT      4
 #define E1000_PCIEMISC_LX_DECISION      0x00000080 /* Lx power decision based

Modified: head/sys/dev/e1000/e1000_phy.c
==============================================================================
--- head/sys/dev/e1000/e1000_phy.c	Fri Mar 18 17:49:11 2011	(r219752)
+++ head/sys/dev/e1000/e1000_phy.c	Fri Mar 18 18:54:00 2011	(r219753)
@@ -255,10 +255,6 @@ s32 e1000_read_phy_reg_mdic(struct e1000
 
 	E1000_WRITE_REG(hw, E1000_MDIC, mdic);
 
-	/* Workaround for Si errata */
-	if ((hw->phy.type == e1000_phy_82577) && (hw->revision_id <= 2))
-		msec_delay(10);
-
 	/*
 	 * Poll the ready bit to see if the MDI read completed
 	 * Increasing the time out as testing showed failures with
@@ -326,10 +322,6 @@ s32 e1000_write_phy_reg_mdic(struct e100
 
 	E1000_WRITE_REG(hw, E1000_MDIC, mdic);
 
-	/* Workaround for Si errata */
-	if ((hw->phy.type == e1000_phy_82577) && (hw->revision_id <= 2))
-		msec_delay(10);
-
 	/*
 	 * Poll the ready bit to see if the MDI read completed
 	 * Increasing the time out as testing showed failures with
@@ -1656,6 +1648,7 @@ s32 e1000_phy_force_speed_duplex_m88(str
 		if (!link) {
 			if (hw->phy.type != e1000_phy_m88 ||
 			    hw->phy.id == I347AT4_E_PHY_ID ||
+			    hw->phy.id == M88E1340M_E_PHY_ID ||
 			    hw->phy.id == M88E1112_E_PHY_ID) {
 				DEBUGOUT("Link taking longer than expected.\n");
 			} else {
@@ -1683,6 +1676,7 @@ s32 e1000_phy_force_speed_duplex_m88(str
 
 	if (hw->phy.type != e1000_phy_m88 ||
 	    hw->phy.id == I347AT4_E_PHY_ID ||
+	    hw->phy.id == M88E1340M_E_PHY_ID ||
 	    hw->phy.id == M88E1112_E_PHY_ID)
 		goto out;
 
@@ -2233,6 +2227,7 @@ s32 e1000_get_cable_length_m88_gen2(stru
 	DEBUGFUNC("e1000_get_cable_length_m88_gen2");
 
 	switch (hw->phy.id) {
+	case M88E1340M_E_PHY_ID:
 	case I347AT4_E_PHY_ID:
 		/* Remember the original page select and set it to 7 */
 		ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT,
@@ -2787,6 +2782,7 @@ enum e1000_phy_type e1000_get_phy_type_f
 	case M88E1011_I_PHY_ID:
 	case I347AT4_E_PHY_ID:
 	case M88E1112_E_PHY_ID:
+	case M88E1340M_E_PHY_ID:
 		phy_type = e1000_phy_m88;
 		break;
 	case IGP01E1000_I_PHY_ID: /* IGP 1 & 2 share this */

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Fri Mar 18 17:49:11 2011	(r219752)
+++ head/sys/dev/e1000/if_em.c	Fri Mar 18 18:54:00 2011	(r219753)
@@ -93,7 +93,7 @@ int	em_display_debug_stats = 0;
 /*********************************************************************
  *  Driver version:
  *********************************************************************/
-char em_driver_version[] = "7.1.9";
+char em_driver_version[] = "7.2.2";
 
 /*********************************************************************
  *  PCI Device ID Table
@@ -284,9 +284,7 @@ static void	em_handle_tx(void *context, 
 static void	em_handle_rx(void *context, int pending);
 static void	em_handle_link(void *context, int pending);
 
-static void	em_add_rx_process_limit(struct adapter *, const char *,
-		    const char *, int *, int);
-static void	em_set_flow_cntrl(struct adapter *, const char *,
+static void	em_set_sysctl_value(struct adapter *, const char *,
 		    const char *, int *, int);
 
 static __inline void em_rx_discard(struct rx_ring *, int);
@@ -365,6 +363,10 @@ TUNABLE_INT("hw.em.rx_process_limit", &e
 static int em_fc_setting = e1000_fc_full;
 TUNABLE_INT("hw.em.fc_setting", &em_fc_setting);
 
+/* Energy efficient ethernet - default to OFF */
+static int eee_setting = 0;
+TUNABLE_INT("hw.em.eee_setting", &eee_setting);
+
 /* Global used in WOL setup with multiport cards */
 static int global_quad_port_a = 0;
 
@@ -433,12 +435,14 @@ static int
 em_attach(device_t dev)
 {
 	struct adapter	*adapter;
+	struct e1000_hw	*hw;
 	int		error = 0;
 
 	INIT_DEBUGOUT("em_attach: begin");
 
 	adapter = device_get_softc(dev);
 	adapter->dev = adapter->osdep.dev = dev;
+	hw = &adapter->hw;
 	EM_CORE_LOCK_INIT(adapter, device_get_nameunit(dev));
 
 	/* SYSCTL stuff */
@@ -470,11 +474,11 @@ em_attach(device_t dev)
 	** must happen after the MAC is 
 	** identified
 	*/
-	if ((adapter->hw.mac.type == e1000_ich8lan) ||
-	    (adapter->hw.mac.type == e1000_ich9lan) ||
-	    (adapter->hw.mac.type == e1000_ich10lan) ||
-	    (adapter->hw.mac.type == e1000_pchlan) ||
-	    (adapter->hw.mac.type == e1000_pch2lan)) {
+	if ((hw->mac.type == e1000_ich8lan) ||
+	    (hw->mac.type == e1000_ich9lan) ||
+	    (hw->mac.type == e1000_ich10lan) ||
+	    (hw->mac.type == e1000_pchlan) ||
+	    (hw->mac.type == e1000_pch2lan)) {
 		int rid = EM_BAR_TYPE_FLASH;
 		adapter->flash = bus_alloc_resource_any(dev,
 		    SYS_RES_MEMORY, &rid, RF_ACTIVE);
@@ -484,7 +488,7 @@ em_attach(device_t dev)
 			goto err_pci;
 		}
 		/* This is used in the shared code */
-		adapter->hw.flash_address = (u8 *)adapter->flash;
+		hw->flash_address = (u8 *)adapter->flash;
 		adapter->osdep.flash_bus_space_tag =
 		    rman_get_bustag(adapter->flash);
 		adapter->osdep.flash_bus_space_handle =
@@ -492,39 +496,39 @@ em_attach(device_t dev)
 	}
 
 	/* Do Shared Code initialization */
-	if (e1000_setup_init_funcs(&adapter->hw, TRUE)) {
+	if (e1000_setup_init_funcs(hw, TRUE)) {
 		device_printf(dev, "Setup of Shared code failed\n");
 		error = ENXIO;
 		goto err_pci;
 	}
 
-	e1000_get_bus_info(&adapter->hw);
+	e1000_get_bus_info(hw);
 
 	/* Set up some sysctls for the tunable interrupt delays */
 	em_add_int_delay_sysctl(adapter, "rx_int_delay",
 	    "receive interrupt delay in usecs", &adapter->rx_int_delay,
-	    E1000_REGISTER(&adapter->hw, E1000_RDTR), em_rx_int_delay_dflt);
+	    E1000_REGISTER(hw, E1000_RDTR), em_rx_int_delay_dflt);
 	em_add_int_delay_sysctl(adapter, "tx_int_delay",
 	    "transmit interrupt delay in usecs", &adapter->tx_int_delay,
-	    E1000_REGISTER(&adapter->hw, E1000_TIDV), em_tx_int_delay_dflt);
+	    E1000_REGISTER(hw, E1000_TIDV), em_tx_int_delay_dflt);
 	em_add_int_delay_sysctl(adapter, "rx_abs_int_delay",
 	    "receive interrupt delay limit in usecs",
 	    &adapter->rx_abs_int_delay,
-	    E1000_REGISTER(&adapter->hw, E1000_RADV),
+	    E1000_REGISTER(hw, E1000_RADV),
 	    em_rx_abs_int_delay_dflt);
 	em_add_int_delay_sysctl(adapter, "tx_abs_int_delay",
 	    "transmit interrupt delay limit in usecs",
 	    &adapter->tx_abs_int_delay,
-	    E1000_REGISTER(&adapter->hw, E1000_TADV),
+	    E1000_REGISTER(hw, E1000_TADV),
 	    em_tx_abs_int_delay_dflt);
 
 	/* Sysctl for limiting the amount of work done in the taskqueue */
-	em_add_rx_process_limit(adapter, "rx_processing_limit",
+	em_set_sysctl_value(adapter, "rx_processing_limit",
 	    "max number of rx packets to process", &adapter->rx_process_limit,
 	    em_rx_process_limit);
 
 	/* Sysctl for setting the interface flow control */
-	em_set_flow_cntrl(adapter, "flow_control",
+	em_set_sysctl_value(adapter, "flow_control",
 	    "configure flow control",
 	    &adapter->fc_setting, em_fc_setting);
 
@@ -549,15 +553,15 @@ em_attach(device_t dev)
 	} else
 		adapter->num_rx_desc = em_rxd;
 
-	adapter->hw.mac.autoneg = DO_AUTO_NEG;
-	adapter->hw.phy.autoneg_wait_to_complete = FALSE;
-	adapter->hw.phy.autoneg_advertised = AUTONEG_ADV_DEFAULT;
+	hw->mac.autoneg = DO_AUTO_NEG;
+	hw->phy.autoneg_wait_to_complete = FALSE;
+	hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT;
 
 	/* Copper options */
-	if (adapter->hw.phy.media_type == e1000_media_type_copper) {
-		adapter->hw.phy.mdix = AUTO_ALL_MODES;
-		adapter->hw.phy.disable_polarity_correction = FALSE;
-		adapter->hw.phy.ms_type = EM_MASTER_SLAVE;
+	if (hw->phy.media_type == e1000_media_type_copper) {
+		hw->phy.mdix = AUTO_ALL_MODES;
+		hw->phy.disable_polarity_correction = FALSE;
+		hw->phy.ms_type = EM_MASTER_SLAVE;
 	}
 
 	/*
@@ -571,7 +575,7 @@ em_attach(device_t dev)
 	 * This controls when hardware reports transmit completion
 	 * status.
 	 */
-	adapter->hw.mac.report_tx_early = 1;
+	hw->mac.report_tx_early = 1;
 
 	/* 
 	** Get queue/ring memory
@@ -591,25 +595,31 @@ em_attach(device_t dev)
 	}
 
 	/* Check SOL/IDER usage */
-	if (e1000_check_reset_block(&adapter->hw))
+	if (e1000_check_reset_block(hw))
 		device_printf(dev, "PHY reset is blocked"
 		    " due to SOL/IDER session.\n");
 
+	/* Sysctl for setting Energy Efficient Ethernet */
+	em_set_sysctl_value(adapter, "eee_control",
+	    "enable Energy Efficient Ethernet",
+	    &hw->dev_spec.ich8lan.eee_disable, eee_setting);
+
 	/*
 	** Start from a known state, this is
 	** important in reading the nvm and
 	** mac from that.
 	*/
-	e1000_reset_hw(&adapter->hw);
+	e1000_reset_hw(hw);
+
 
 	/* Make sure we have a good EEPROM before we read from it */
-	if (e1000_validate_nvm_checksum(&adapter->hw) < 0) {
+	if (e1000_validate_nvm_checksum(hw) < 0) {
 		/*
 		** Some PCI-E parts fail the first check due to
 		** the link being in sleep state, call it again,
 		** if it fails a second time its a real issue.
 		*/
-		if (e1000_validate_nvm_checksum(&adapter->hw) < 0) {
+		if (e1000_validate_nvm_checksum(hw) < 0) {
 			device_printf(dev,
 			    "The EEPROM Checksum Is Not Valid\n");
 			error = EIO;
@@ -618,14 +628,14 @@ em_attach(device_t dev)
 	}
 
 	/* Copy the permanent MAC address out of the EEPROM */
-	if (e1000_read_mac_addr(&adapter->hw) < 0) {
+	if (e1000_read_mac_addr(hw) < 0) {
 		device_printf(dev, "EEPROM read error while reading MAC"
 		    " address\n");
 		error = EIO;
 		goto err_late;
 	}
 
-	if (!em_is_valid_ether_addr(adapter->hw.mac.addr)) {
+	if (!em_is_valid_ether_addr(hw->mac.addr)) {
 		device_printf(dev, "Invalid MAC address\n");
 		error = EIO;
 		goto err_late;
@@ -655,7 +665,7 @@ em_attach(device_t dev)
 	/* Initialize statistics */
 	em_update_stats_counters(adapter);
 
-	adapter->hw.mac.get_link_status = 1;
+	hw->mac.get_link_status = 1;
 	em_update_link_status(adapter);
 
 	/* Register for VLAN events */
@@ -927,11 +937,10 @@ em_start_locked(struct ifnet *ifp, struc
 	if (!adapter->link_active)
 		return;
 
-        /* Call cleanup if number of TX descriptors low */
-	if (txr->tx_avail <= EM_TX_CLEANUP_THRESHOLD)
-		em_txeof(txr);
-
 	while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
+        	/* Call cleanup if number of TX descriptors low */
+		if (txr->tx_avail <= EM_TX_CLEANUP_THRESHOLD)
+			em_txeof(txr);
 		if (txr->tx_avail < EM_MAX_SCATTER) {
 			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 			break;
@@ -1411,8 +1420,7 @@ em_poll(struct ifnet *ifp, enum poll_cmd
 	if (!drbr_empty(ifp, txr->br))
 		em_mq_start_locked(ifp, txr, NULL);
 #else
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-		em_start_locked(ifp, txr);
+	em_start_locked(ifp, txr);
 #endif
 	EM_TX_UNLOCK(txr);
 
@@ -1475,24 +1483,20 @@ em_handle_que(void *context, int pending
 	struct ifnet	*ifp = adapter->ifp;
 	struct tx_ring	*txr = adapter->tx_rings;
 	struct rx_ring	*rxr = adapter->rx_rings;
-	bool		more;
 
 
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-		more = em_rxeof(rxr, adapter->rx_process_limit, NULL);
-
+		bool more = em_rxeof(rxr, adapter->rx_process_limit, NULL);
 		EM_TX_LOCK(txr);
 		em_txeof(txr);
 #ifdef EM_MULTIQUEUE
 		if (!drbr_empty(ifp, txr->br))
 			em_mq_start_locked(ifp, txr, NULL);
 #else
-		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-			em_start_locked(ifp, txr);
+		em_start_locked(ifp, txr);
 #endif
-		em_txeof(txr);
 		EM_TX_UNLOCK(txr);
-		if (more) {
+		if (more || (ifp->if_drv_flags & IFF_DRV_OACTIVE)) {
 			taskqueue_enqueue(adapter->tq, &adapter->que_task);
 			return;
 		}
@@ -1601,10 +1605,8 @@ em_handle_tx(void *context, int pending)
 	if (!drbr_empty(ifp, txr->br))
 		em_mq_start_locked(ifp, txr, NULL);
 #else
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-		em_start_locked(ifp, txr);
+	em_start_locked(ifp, txr);
 #endif
-	em_txeof(txr);
 	E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims);
 	EM_TX_UNLOCK(txr);
 }
@@ -2179,6 +2181,7 @@ em_local_timer(void *arg)
 	struct adapter	*adapter = arg;
 	struct ifnet	*ifp = adapter->ifp;
 	struct tx_ring	*txr = adapter->tx_rings;
+	struct rx_ring	*rxr = adapter->rx_rings;
 
 	EM_CORE_LOCK_ASSERT(adapter);
 
@@ -2190,6 +2193,13 @@ em_local_timer(void *arg)
 	    e1000_get_laa_state_82571(&adapter->hw))
 		e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
 
+	/* trigger tq to refill rx ring queue if it is empty */
+	for (int i = 0; i < adapter->num_queues; i++, rxr++) {
+		if (rxr->next_to_check == rxr->next_to_refresh) {
+			taskqueue_enqueue(rxr->tq, &rxr->rx_task);
+		}
+	}
+
 	/* 
 	** Don't do TX watchdog check if we've been paused
 	*/
@@ -3730,17 +3740,17 @@ em_txeof(struct tx_ring *txr)
 		txr->queue_status = EM_QUEUE_HUNG;
 
         /*
-         * If we have enough room, clear IFF_DRV_OACTIVE
+         * If we have a minimum free, clear IFF_DRV_OACTIVE
          * to tell the stack that it is OK to send packets.
          */
-        if (txr->tx_avail > EM_TX_CLEANUP_THRESHOLD) {                
+        if (txr->tx_avail > EM_MAX_SCATTER)
                 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-		/* Disable watchdog if all clean */
-                if (txr->tx_avail == adapter->num_tx_desc) {
-			txr->queue_status = EM_QUEUE_IDLE;
-			return (FALSE);
-		} 
-        }
+
+	/* Disable watchdog if all clean */
+	if (txr->tx_avail == adapter->num_tx_desc) {
+		txr->queue_status = EM_QUEUE_IDLE;
+		return (FALSE);
+	} 
 
 	return (TRUE);
 }
@@ -3758,11 +3768,19 @@ em_refresh_mbufs(struct rx_ring *rxr, in
 	struct mbuf		*m;
 	bus_dma_segment_t	segs[1];
 	struct em_buffer	*rxbuf;
-	int			i, error, nsegs, cleaned;
+	int			i, j, error, nsegs;
+	bool			cleaned = FALSE;
+
+	i = j = rxr->next_to_refresh;
+	/*
+	** Get one descriptor beyond
+	** our work mark to control
+	** the loop.
+	*/
+	if (++j == adapter->num_rx_desc)
+		j = 0;
 
-	i = rxr->next_to_refresh;
-	cleaned = -1;
-	while (i != limit) {
+	while (j != limit) {
 		rxbuf = &rxr->rx_buffers[i];
 		if (rxbuf->m_head == NULL) {
 			m = m_getjcl(M_DONTWAIT, MT_DATA,
@@ -3796,21 +3814,22 @@ em_refresh_mbufs(struct rx_ring *rxr, in
 		bus_dmamap_sync(rxr->rxtag,
 		    rxbuf->map, BUS_DMASYNC_PREREAD);
 		rxr->rx_base[i].buffer_addr = htole64(segs[0].ds_addr);
+		cleaned = TRUE;
 
-		cleaned = i;
-		/* Calculate next index */
-		if (++i == adapter->num_rx_desc)
-			i = 0;
+		i = j; /* Next is precalulated for us */
 		rxr->next_to_refresh = i;
+		/* Calculate next controlling index */
+		if (++j == adapter->num_rx_desc)
+			j = 0;
 	}
 update:
 	/*
 	** Update the tail pointer only if,
 	** and as far as we have refreshed.
 	*/
-	if (cleaned != -1) /* Update tail index */
+	if (cleaned)
 		E1000_WRITE_REG(&adapter->hw,
-		    E1000_RDT(rxr->me), cleaned);
+		    E1000_RDT(rxr->me), rxr->next_to_refresh);
 
 	return;
 }
@@ -3888,36 +3907,32 @@ em_setup_receive_ring(struct rx_ring *rx
 	struct	adapter 	*adapter = rxr->adapter;
 	struct em_buffer	*rxbuf;
 	bus_dma_segment_t	seg[1];
-	int			rsize, nsegs, error;
+	int			i, j, nsegs, error;
 
 
 	/* Clear the ring contents */
 	EM_RX_LOCK(rxr);
-	rsize = roundup2(adapter->num_rx_desc *
-	    sizeof(struct e1000_rx_desc), EM_DBA_ALIGN);
-	bzero((void *)rxr->rx_base, rsize);
 
-	/*
-	** Free current RX buffer structs and their mbufs
-	*/
-	for (int i = 0; i < adapter->num_rx_desc; i++) {
-		rxbuf = &rxr->rx_buffers[i];
-		if (rxbuf->m_head != NULL) {
-			bus_dmamap_sync(rxr->rxtag, rxbuf->map,
-			    BUS_DMASYNC_POSTREAD);
-			bus_dmamap_unload(rxr->rxtag, rxbuf->map);
-			m_freem(rxbuf->m_head);
-		}
+	/* Invalidate all descriptors */
+	for (i = 0; i < adapter->num_rx_desc; i++) {
+		struct e1000_rx_desc* cur;
+		cur = &rxr->rx_base[i];
+		cur->status = 0;
 	}
 
 	/* Now replenish the mbufs */
-	for (int j = 0; j != adapter->num_rx_desc; ++j) {
+	i = j = rxr->next_to_refresh;
+	if (++j == adapter->num_rx_desc)
+		j = 0;
 
-		rxbuf = &rxr->rx_buffers[j];
+	while(j != rxr->next_to_check) {
+		rxbuf = &rxr->rx_buffers[i];
 		rxbuf->m_head = m_getjcl(M_DONTWAIT, MT_DATA,
 		    M_PKTHDR, adapter->rx_mbuf_sz);
-		if (rxbuf->m_head == NULL)
-			return (ENOBUFS);
+		if (rxbuf->m_head == NULL) {
+			error = ENOBUFS;
+			goto fail;
+		}
 		rxbuf->m_head->m_len = adapter->rx_mbuf_sz;
 		rxbuf->m_head->m_flags &= ~M_HASFCS; /* we strip it */
 		rxbuf->m_head->m_pkthdr.len = adapter->rx_mbuf_sz;
@@ -3929,25 +3944,24 @@ em_setup_receive_ring(struct rx_ring *rx
 		if (error != 0) {
 			m_freem(rxbuf->m_head);
 			rxbuf->m_head = NULL;
-			return (error);
+			goto fail;
 		}
 		bus_dmamap_sync(rxr->rxtag,
 		    rxbuf->map, BUS_DMASYNC_PREREAD);
 
 		/* Update descriptor */
-		rxr->rx_base[j].buffer_addr = htole64(seg[0].ds_addr);
+		rxr->rx_base[i].buffer_addr = htole64(seg[0].ds_addr);
+		i = j;
+		if (++j == adapter->num_rx_desc)
+			j = 0;
 	}
 
-
-	/* Setup our descriptor indices */
-	rxr->next_to_check = 0;
-	rxr->next_to_refresh = 0;
-
+fail:
+	rxr->next_to_refresh = i;
 	bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,
 	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
-
 	EM_RX_UNLOCK(rxr);
-	return (0);
+	return (error);
 }
 
 /*********************************************************************
@@ -3959,9 +3973,9 @@ static int
 em_setup_receive_structures(struct adapter *adapter)
 {
 	struct rx_ring *rxr = adapter->rx_rings;
-	int j;
+	int q;
 
-	for (j = 0; j < adapter->num_queues; j++, rxr++)
+	for (q = 0; q < adapter->num_queues; q++, rxr++)
 		if (em_setup_receive_ring(rxr))
 			goto fail;
 
@@ -3970,11 +3984,12 @@ fail:
 	/*
 	 * Free RX buffers allocated so far, we will only handle
 	 * the rings that completed, the failing case will have
-	 * cleaned up for itself. 'j' failed, so its the terminus.
+	 * cleaned up for itself. 'q' failed, so its the terminus.
 	 */
-	for (int i = 0; i < j; ++i) {
+	for (int i = 0, n = 0; i < q; ++i) {
 		rxr = &adapter->rx_rings[i];
-		for (int n = 0; n < adapter->num_rx_desc; n++) {
+		n = rxr->next_to_check;
+		while(n != rxr->next_to_refresh) {
 			struct em_buffer *rxbuf;
 			rxbuf = &rxr->rx_buffers[n];
 			if (rxbuf->m_head != NULL) {
@@ -3984,7 +3999,11 @@ fail:
 				m_freem(rxbuf->m_head);
 				rxbuf->m_head = NULL;
 			}
+			if (++n == adapter->num_rx_desc)
+				n = 0;
 		}
+		rxr->next_to_check = 0;
+		rxr->next_to_refresh = 0;
 	}
 
 	return (ENOBUFS);
@@ -4025,7 +4044,8 @@ em_free_receive_buffers(struct rx_ring *
 	INIT_DEBUGOUT("free_receive_buffers: begin");
 
 	if (rxr->rx_buffers != NULL) {
-		for (int i = 0; i < adapter->num_rx_desc; i++) {
+		int i = rxr->next_to_check;
+		while(i != rxr->next_to_refresh) {
 			rxbuf = &rxr->rx_buffers[i];
 			if (rxbuf->map != NULL) {
 				bus_dmamap_sync(rxr->rxtag, rxbuf->map,
@@ -4037,9 +4057,13 @@ em_free_receive_buffers(struct rx_ring *
 				m_freem(rxbuf->m_head);
 				rxbuf->m_head = NULL;
 			}
+			if (++i == adapter->num_rx_desc)
+				i = 0;
 		}
 		free(rxr->rx_buffers, M_DEVBUF);
 		rxr->rx_buffers = NULL;
+		rxr->next_to_check = 0;
+		rxr->next_to_refresh = 0;
 	}
 
 	if (rxr->rxtag != NULL) {
@@ -4122,8 +4146,8 @@ em_initialize_receive_unit(struct adapte
 		E1000_WRITE_REG(hw, E1000_RDBAH(i), (u32)(bus_addr >> 32));
 		E1000_WRITE_REG(hw, E1000_RDBAL(i), (u32)bus_addr);
 		/* Setup the Head and Tail Descriptor Pointers */
-		E1000_WRITE_REG(hw, E1000_RDH(i), 0);
-		E1000_WRITE_REG(hw, E1000_RDT(i), adapter->num_rx_desc - 1);
+		E1000_WRITE_REG(hw, E1000_RDH(i), rxr->next_to_check);
+		E1000_WRITE_REG(hw, E1000_RDT(i), rxr->next_to_refresh);
 	}
 
 	/* Set early receive threshold on appropriate hw */
@@ -4303,7 +4327,8 @@ next_desc:
 	}
 
 	/* Catch any remaining refresh work */
-	em_refresh_mbufs(rxr, i);
+	if (processed != 0 || i == rxr->next_to_refresh)
+		em_refresh_mbufs(rxr, i);
 
 	rxr->next_to_check = i;
 	if (done != NULL)
@@ -4743,10 +4768,8 @@ em_enable_wakeup(device_t dev)
 	if ((adapter->hw.mac.type == e1000_ich8lan) ||
 	    (adapter->hw.mac.type == e1000_pchlan) ||
 	    (adapter->hw.mac.type == e1000_ich9lan) ||
-	    (adapter->hw.mac.type == e1000_ich10lan)) {
+	    (adapter->hw.mac.type == e1000_ich10lan))
 		e1000_disable_gig_wol_ich8lan(&adapter->hw);
-		e1000_hv_phy_powerdown_workaround_ich8lan(&adapter->hw);
-	}
 
 	/* Keep the laser running on Fiber adapters */
 	if (adapter->hw.phy.media_type == e1000_media_type_fiber ||
@@ -5442,17 +5465,7 @@ em_add_int_delay_sysctl(struct adapter *
 }
 
 static void
-em_add_rx_process_limit(struct adapter *adapter, const char *name,
-	const char *description, int *limit, int value)
-{
-	*limit = value;
-	SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev),
-	    SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)),
-	    OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description);
-}
-
-static void
-em_set_flow_cntrl(struct adapter *adapter, const char *name,
+em_set_sysctl_value(struct adapter *adapter, const char *name,
 	const char *description, int *limit, int value)
 {
 	*limit = value;

Modified: head/sys/dev/e1000/if_em.h
==============================================================================
--- head/sys/dev/e1000/if_em.h	Fri Mar 18 17:49:11 2011	(r219752)
+++ head/sys/dev/e1000/if_em.h	Fri Mar 18 18:54:00 2011	(r219753)
@@ -212,6 +212,10 @@
 #define EM_BAR_MEM_TYPE_64BIT	0x00000004
 #define EM_MSIX_BAR		3	/* On 82575 */
 
+#if !defined(SYSTCL_ADD_UQUAD)
+#define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD
+#endif
+
 /* Defines for printing debug information */
 #define DEBUG_INIT  0
 #define DEBUG_IOCTL 0

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Fri Mar 18 17:49:11 2011	(r219752)
+++ head/sys/dev/e1000/if_igb.c	Fri Mar 18 18:54:00 2011	(r219753)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2011, Intel Corporation 
+  Copyright (c) 2001-2010, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -99,7 +99,7 @@ int	igb_display_debug_stats = 0;
 /*********************************************************************
  *  Driver version:
  *********************************************************************/
-char igb_driver_version[] = "version - 2.1.4";
+char igb_driver_version[] = "version - 2.1.7";
 
 
 /*********************************************************************
@@ -255,14 +255,13 @@ static void     igb_enable_wakeup(device
 static void     igb_led_func(void *, int);
 
 static int	igb_irq_fast(void *);
-static void	igb_add_rx_process_limit(struct adapter *, const char *,
-		    const char *, int *, int);
+static void	igb_msix_que(void *);
+static void	igb_msix_link(void *);
 static void	igb_handle_que(void *context, int pending);
 static void	igb_handle_link(void *context, int pending);
 
-/* These are MSIX only irq handlers */
-static void	igb_msix_que(void *);
-static void	igb_msix_link(void *);
+static void	igb_set_sysctl_value(struct adapter *, const char *,
+		    const char *, int *, int);
 
 #ifdef DEVICE_POLLING
 static poll_handler_t igb_poll;
@@ -350,6 +349,17 @@ TUNABLE_INT("hw.igb.rx_process_limit", &
 static int igb_fc_setting = e1000_fc_full;
 TUNABLE_INT("hw.igb.fc_setting", &igb_fc_setting);
 
+/* Energy Efficient Ethernet - default to off */
+static int igb_eee_setting = FALSE;
+TUNABLE_INT("hw.igb.ee_setting", &igb_eee_setting);
+
+/*
+** DMA Coalescing, only for i350 - default to off,
+** this feature is for power savings
+*/
+static int igb_dma_coalesce = FALSE;
+TUNABLE_INT("hw.igb.dma_coalesce", &igb_dma_coalesce);
+
 /*********************************************************************
  *  Device identification routine
  *
@@ -430,11 +440,6 @@ igb_attach(device_t dev)
 	    OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0,
 	    igb_sysctl_nvm_info, "I", "NVM Information");
 
-	SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev),
-	    SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)),
-	    OID_AUTO, "flow_control", CTLTYPE_INT|CTLFLAG_RW,
-	    &igb_fc_setting, 0, "Flow Control");
-
 	SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
 	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
 	    OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW,
@@ -461,11 +466,16 @@ igb_attach(device_t dev)
 
 	e1000_get_bus_info(&adapter->hw);
 
-	/* Sysctls for limiting the amount of work done in the taskqueue */
-	igb_add_rx_process_limit(adapter, "rx_processing_limit",
+	/* Sysctl for limiting the amount of work done in the taskqueue */
+	igb_set_sysctl_value(adapter, "rx_processing_limit",
 	    "max number of rx packets to process", &adapter->rx_process_limit,
 	    igb_rx_process_limit);
 
+       /* Sysctl for setting the interface flow control */
+	igb_set_sysctl_value(adapter, "flow_control",
+	    "configure flow control",
+	    &adapter->fc_setting, igb_fc_setting);
+
 	/*
 	 * Validate number of transmit and receive descriptors. It
 	 * must not exceed hardware maximum, and must be multiple
@@ -537,6 +547,18 @@ igb_attach(device_t dev)
 		goto err_late;
 	}
 
+	/* Some adapter-specific advanced features */
+	if (adapter->hw.mac.type >= e1000_i350) {
+		igb_set_sysctl_value(adapter, "dma_coalesce",
+		    "configure dma coalesce",
+		    &adapter->dma_coalesce, igb_dma_coalesce);
+		igb_set_sysctl_value(adapter, "eee_control",
+		    "enable Energy Efficient Ethernet",
+		    &adapter->hw.dev_spec._82575.eee_disable,
+		    igb_eee_setting);
+		e1000_set_eee_i350(&adapter->hw);
+	}
+
 	/*
 	** Start from a known state, this is
 	** important in reading the nvm and
@@ -1436,6 +1458,10 @@ igb_msix_que(void *arg)
 	more_tx = igb_txeof(txr);
 	IGB_TX_UNLOCK(txr);
 
+	/* If RX ring is depleted do refresh first */
+	if (rxr->next_to_check == rxr->next_to_refresh)
+		igb_refresh_mbufs(rxr, rxr->next_to_check);
+
 	more_rx = igb_rxeof(que, adapter->rx_process_limit, NULL);
 
 	if (igb_enable_aim == FALSE)
@@ -1938,7 +1964,7 @@ igb_local_timer(void *arg)
 out:
 	callout_reset(&adapter->timer, hz, igb_local_timer, adapter);
 #ifndef DEVICE_POLLING
-	/* Fire off all queue interrupts - deadlock protection */
+	/* Schedule all queue interrupts - deadlock protection */
 	E1000_WRITE_REG(&adapter->hw, E1000_EICS, adapter->que_mask);
 #endif
 	return;
@@ -1963,7 +1989,9 @@ igb_update_link_status(struct adapter *a
 	struct ifnet *ifp = adapter->ifp;
 	device_t dev = adapter->dev;

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

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 19:16:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 086CB106566C;
	Fri, 18 Mar 2011 19:16:12 +0000 (UTC)
	(envelope-from juli@clockworksquid.com)
Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com
	[209.85.213.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B1D18FC18;
	Fri, 18 Mar 2011 19:16:11 +0000 (UTC)
Received: by yxl31 with SMTP id 31so1951685yxl.13
	for ; Fri, 18 Mar 2011 12:16:10 -0700 (PDT)
Received: by 10.151.117.5 with SMTP id u5mr1580167ybm.135.1300475770089; Fri,
	18 Mar 2011 12:16:10 -0700 (PDT)
MIME-Version: 1.0
Sender: juli@clockworksquid.com
Received: by 10.150.197.12 with HTTP; Fri, 18 Mar 2011 12:15:50 -0700 (PDT)
In-Reply-To: <201103181854.p2IIs0G1077313@svn.freebsd.org>
References: <201103181854.p2IIs0G1077313@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 18 Mar 2011 12:15:50 -0700
X-Google-Sender-Auth: a6BPr7jzak-RDO_Hvgk6E5tbKPc
Message-ID: 
To: Jack F Vogel 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219753 - head/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 19:16:12 -0000

On Fri, Mar 18, 2011 at 11:54, Jack F Vogel  wrote:
> Author: jfv
> Date: Fri Mar 18 18:54:00 2011
> New Revision: 219753
> URL: http://svn.freebsd.org/changeset/base/219753
>
> Log:
> =A0This delta updates the em driver to version 7.2.2 which has
> =A0been undergoing test for some weeks. This improves the RX
> =A0mbuf handling to avoid system hang due to depletion. Thanks
> =A0to all those who have been testing the code, and to Beezar
> =A0Liu for the design changes.

I understand that the fundamental unit coming out of Intel is an
atomic driver version, but it really, really, really would be nice to
not fix functional and stylistic changes at such a fundamental level
and with such a widely-used driver as these.  I understand that you
have enough work already, but if it's at all possible to do these
updates in a couple of passes, I would really appreciate it, and I
know there are other people who have to mine the significant deltas
from these updates who would appreciate it, too.  You could start with
stylistic changes and then do a couple of functional changes and then
update the driver version to reflect the Intel finished product, say.

It's good that it's been undergoing a long period of test, but it
would have been nice if the commit message had included more details
on the functional changes.

Some specific comments:

It seems like the update to e1000_82575 (and other chip-specific bits)
is totally independent of the other style changes and the depletion
fix and that it would have been easy to do that separately.

> - =A0 =A0 =A0 if (nvm->word_size =3D=3D (1 << 15)) {
> + =A0 =A0 =A0 if (nvm->word_size =3D=3D (1 << 15))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nvm->page_size =3D 128;
> - =A0 =A0 =A0 }
> -

Great that this is moving towards KNF.  Might be good to take a few
minutes and fix all such statements now rather than doing them in
pieces later in time.

> -#define E1000_DMACR_DMACTHR_MASK =A0 =A0 =A0 =A00x00FF0000 /* DMA Coales=
cing Receive
> +#define E1000_DMACR_DMACTHR_MASK =A0 =A0 =A0 =A00x00FF0000 /* DMA Coales=
cing Rx
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * Threshold */

All of these changes could have easily been done separately since they
are entirely stylistic.

> +/* Energy efficient ethernet - default to OFF */
> +static int eee_setting =3D 0;
> +TUNABLE_INT("hw.em.eee_setting", &eee_setting);

Would have been useful to see some mention of this in the commit message.

> + =A0 =A0 =A0 struct e1000_hw *hw;
> =A0 =A0 =A0 =A0int =A0 =A0 =A0 =A0 =A0 =A0 error =3D 0;
>
> =A0 =A0 =A0 =A0INIT_DEBUGOUT("em_attach: begin");
>
> =A0 =A0 =A0 =A0adapter =3D device_get_softc(dev);
> =A0 =A0 =A0 =A0adapter->dev =3D adapter->osdep.dev =3D dev;
> + =A0 =A0 =A0 hw =3D &adapter->hw;

[...]

> - =A0 =A0 =A0 if ((adapter->hw.mac.type =3D=3D e1000_ich8lan) ||
> - =A0 =A0 =A0 =A0 =A0 (adapter->hw.mac.type =3D=3D e1000_ich9lan) ||
> - =A0 =A0 =A0 =A0 =A0 (adapter->hw.mac.type =3D=3D e1000_ich10lan) ||
> - =A0 =A0 =A0 =A0 =A0 (adapter->hw.mac.type =3D=3D e1000_pchlan) ||
> - =A0 =A0 =A0 =A0 =A0 (adapter->hw.mac.type =3D=3D e1000_pch2lan)) {
> + =A0 =A0 =A0 if ((hw->mac.type =3D=3D e1000_ich8lan) ||
> + =A0 =A0 =A0 =A0 =A0 (hw->mac.type =3D=3D e1000_ich9lan) ||
> + =A0 =A0 =A0 =A0 =A0 (hw->mac.type =3D=3D e1000_ich10lan) ||
> + =A0 =A0 =A0 =A0 =A0 (hw->mac.type =3D=3D e1000_pchlan) ||
> + =A0 =A0 =A0 =A0 =A0 (hw->mac.type =3D=3D e1000_pch2lan)) {

Like the brace changes elsewhere, this is not the first time this
stylistic improvement has been made in the e1000 code base.  Perhaps
it would be good to replace all uses of adapter->hw. with hw-> and add
the appropriate hw variables now.  It seems insignificant, but I
assure you it is a source of conflicts for those of us who have to
maintain local changes to e1000.  That's alright as a one time cost,
and it would seem worthwhile to fix this universally since that's the
direction this driver and the Linux driver seem to be going in.

> - =A0 =A0 =A0 bool =A0 =A0 =A0 =A0 =A0 =A0more;
>
>
> =A0 =A0 =A0 =A0if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 more =3D em_rxeof(rxr, adapter->rx_process_=
limit, NULL);
> -
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bool more =3D em_rxeof(rxr, adapter->rx_pro=
cess_limit, NULL);

This seems like a style regression, at least by FreeBSD standards.

> - =A0 =A0 =A0 for (int i =3D 0; i < j; ++i) {
> + =A0 =A0 =A0 for (int i =3D 0, n =3D 0; i < q; ++i) {

Why is n being initialized to 0 when it will be set immediately below?
 Even if it were necessary, putting it in the for statement is only an
obfuscatory eye-sore, doubly so since it has nothing to do with the
loop construct as far as I can tell.

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rxr =3D &adapter->rx_rings[i];
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 for (int n =3D 0; n < adapter->num_rx_desc;=
 n++) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 n =3D rxr->next_to_check;

^^^ Here n is set.

> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 while(n !=3D rxr->next_to_refresh) {

^^^ Here n is used in a while missing a very small amount of whitespace.

> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 while(i !=3D rxr->next_to_refresh) {

^^^ Similar.


> - =A0Copyright (c) 2001-2011, Intel Corporation
> + =A0Copyright (c) 2001-2010, Intel Corporation

This seems like a step backwards.  Through time.

> +/*
> +** DMA Coalescing, only for i350 - default to off,
> +** this feature is for power savings
> +*/
> +static int igb_dma_coalesce =3D FALSE;
> +TUNABLE_INT("hw.igb.dma_coalesce", &igb_dma_coalesce);

Again, would've loved some mention of this in the commit message!

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

Another compelling reason to split up stylistic and functional changes.

Thanks,
Juli.

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 19:37:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A0EA106566B;
	Fri, 18 Mar 2011 19:37:48 +0000 (UTC)
	(envelope-from jfvogel@gmail.com)
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 455388FC13;
	Fri, 18 Mar 2011 19:37:47 +0000 (UTC)
Received: by vws18 with SMTP id 18so4465177vws.13
	for ; Fri, 18 Mar 2011 12:37:46 -0700 (PDT)
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=FU3yx/eApMC3d5nmIERVw4Abtfx9aEDnCVmaUufEvo8=;
	b=KfrX29nSaUpJ1f6TvxKSBpHgdSB1JLIx8e1lVsyw+t1eAVxhBx9T4xAh/VncPmt0X5
	euU35n/IFDuvQE6OUyg7GOqngunZ5b8EYRMjbZAHNr6fbqMbsOxTSFlyP/iQFugGs1EB
	d+6l4BFy5VAVj8P42aogSO6S4GpjmZ+vkxiic=
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=niHPbtZkY5t/GYhIgZ9SUHq782ZHHzivsCXyrZe342yL1KKSMkpVLGXNpHF6C7PReT
	VX0EBsvOcUQuAGj/cZnDOaQ9CAl1XMZoPyy20tcpG3lJZMQQxvNgQ1QTLp5ozrEtKHRl
	dTueoRZ2uGScm1kBQTSZiyXdbaNTaeaTcsdnQ=
MIME-Version: 1.0
Received: by 10.52.88.136 with SMTP id bg8mr2094499vdb.78.1300477066612; Fri,
	18 Mar 2011 12:37:46 -0700 (PDT)
Received: by 10.52.159.165 with HTTP; Fri, 18 Mar 2011 12:37:46 -0700 (PDT)
In-Reply-To: 
References: <201103181854.p2IIs0G1077313@svn.freebsd.org>
	
Date: Fri, 18 Mar 2011 12:37:46 -0700
Message-ID: 
From: Jack Vogel 
To: Juli Mallett 
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.5
Cc: Jack F Vogel , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r219753 - head/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 19:37:48 -0000

The problem is that the shared code is delivered to me as a component. I
generally do try to filter it a little, but if I start diverging from the
internal
component files, then I just introduce a never-ending task for myself to do
that. It also is tested in house as a complete component, so every time I
would change something that introduces risks.

To both you and Yongari... its nice to compare how things are done with
Linux, but what you need to understand is that there are, oh, about 20
engineers with varying tasks that handle Linux. For FreeBSD there is
just me, so the only way I can accomplish as much is to creatively
leverage the work of others, or to consolidate tasks in some ways.

I know there are plenty of things to criticize, I apologize when I don't
get it quite the way you'd like, or I make work for others, I'll try to take
the feedback into account, I'm trying to do my best though.

Regards,

Jack


On Fri, Mar 18, 2011 at 12:15 PM, Juli Mallett  wrote:

> On Fri, Mar 18, 2011 at 11:54, Jack F Vogel  wrote:
> > Author: jfv
> > Date: Fri Mar 18 18:54:00 2011
> > New Revision: 219753
> > URL: http://svn.freebsd.org/changeset/base/219753
> >
> > Log:
> >  This delta updates the em driver to version 7.2.2 which has
> >  been undergoing test for some weeks. This improves the RX
> >  mbuf handling to avoid system hang due to depletion. Thanks
> >  to all those who have been testing the code, and to Beezar
> >  Liu for the design changes.
>
> I understand that the fundamental unit coming out of Intel is an
> atomic driver version, but it really, really, really would be nice to
> not fix functional and stylistic changes at such a fundamental level
> and with such a widely-used driver as these.  I understand that you
> have enough work already, but if it's at all possible to do these
> updates in a couple of passes, I would really appreciate it, and I
> know there are other people who have to mine the significant deltas
> from these updates who would appreciate it, too.  You could start with
> stylistic changes and then do a couple of functional changes and then
> update the driver version to reflect the Intel finished product, say.
>
> It's good that it's been undergoing a long period of test, but it
> would have been nice if the commit message had included more details
> on the functional changes.
>
> Some specific comments:
>
> It seems like the update to e1000_82575 (and other chip-specific bits)
> is totally independent of the other style changes and the depletion
> fix and that it would have been easy to do that separately.
>
> > -       if (nvm->word_size == (1 << 15)) {
> > +       if (nvm->word_size == (1 << 15))
> >                nvm->page_size = 128;
> > -       }
> > -
>
> Great that this is moving towards KNF.  Might be good to take a few
> minutes and fix all such statements now rather than doing them in
> pieces later in time.
>
> > -#define E1000_DMACR_DMACTHR_MASK        0x00FF0000 /* DMA Coalescing
> Receive
> > +#define E1000_DMACR_DMACTHR_MASK        0x00FF0000 /* DMA Coalescing Rx
> >                                                     * Threshold */
>
> All of these changes could have easily been done separately since they
> are entirely stylistic.
>
> > +/* Energy efficient ethernet - default to OFF */
> > +static int eee_setting = 0;
> > +TUNABLE_INT("hw.em.eee_setting", &eee_setting);
>
> Would have been useful to see some mention of this in the commit message.
>
> > +       struct e1000_hw *hw;
> >        int             error = 0;
> >
> >        INIT_DEBUGOUT("em_attach: begin");
> >
> >        adapter = device_get_softc(dev);
> >        adapter->dev = adapter->osdep.dev = dev;
> > +       hw = &adapter->hw;
>
> [...]
>
> > -       if ((adapter->hw.mac.type == e1000_ich8lan) ||
> > -           (adapter->hw.mac.type == e1000_ich9lan) ||
> > -           (adapter->hw.mac.type == e1000_ich10lan) ||
> > -           (adapter->hw.mac.type == e1000_pchlan) ||
> > -           (adapter->hw.mac.type == e1000_pch2lan)) {
> > +       if ((hw->mac.type == e1000_ich8lan) ||
> > +           (hw->mac.type == e1000_ich9lan) ||
> > +           (hw->mac.type == e1000_ich10lan) ||
> > +           (hw->mac.type == e1000_pchlan) ||
> > +           (hw->mac.type == e1000_pch2lan)) {
>
> Like the brace changes elsewhere, this is not the first time this
> stylistic improvement has been made in the e1000 code base.  Perhaps
> it would be good to replace all uses of adapter->hw. with hw-> and add
> the appropriate hw variables now.  It seems insignificant, but I
> assure you it is a source of conflicts for those of us who have to
> maintain local changes to e1000.  That's alright as a one time cost,
> and it would seem worthwhile to fix this universally since that's the
> direction this driver and the Linux driver seem to be going in.
>
> > -       bool            more;
> >
> >
> >        if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
> > -               more = em_rxeof(rxr, adapter->rx_process_limit, NULL);
> > -
> > +               bool more = em_rxeof(rxr, adapter->rx_process_limit,
> NULL);
>
> This seems like a style regression, at least by FreeBSD standards.
>
> > -       for (int i = 0; i < j; ++i) {
> > +       for (int i = 0, n = 0; i < q; ++i) {
>
> Why is n being initialized to 0 when it will be set immediately below?
>  Even if it were necessary, putting it in the for statement is only an
> obfuscatory eye-sore, doubly so since it has nothing to do with the
> loop construct as far as I can tell.
>
> >                rxr = &adapter->rx_rings[i];
> > -               for (int n = 0; n < adapter->num_rx_desc; n++) {
> > +               n = rxr->next_to_check;
>
> ^^^ Here n is set.
>
> > +               while(n != rxr->next_to_refresh) {
>
> ^^^ Here n is used in a while missing a very small amount of whitespace.
>
> > +               while(i != rxr->next_to_refresh) {
>
> ^^^ Similar.
>
>
> > -  Copyright (c) 2001-2011, Intel Corporation
> > +  Copyright (c) 2001-2010, Intel Corporation
>
> This seems like a step backwards.  Through time.
>
> > +/*
> > +** DMA Coalescing, only for i350 - default to off,
> > +** this feature is for power savings
> > +*/
> > +static int igb_dma_coalesce = FALSE;
> > +TUNABLE_INT("hw.igb.dma_coalesce", &igb_dma_coalesce);
>
> Again, would've loved some mention of this in the commit message!
>
> > *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
>
> Another compelling reason to split up stylistic and functional changes.
>
> Thanks,
> Juli.
>

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 21:37:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E75B1065670;
	Fri, 18 Mar 2011 21:37:13 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 88E498FC13;
	Fri, 18 Mar 2011 21:37:12 +0000 (UTC)
Received: by wwk4 with SMTP id 4so1710525wwk.1
	for ; Fri, 18 Mar 2011 14:37:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=epw6VRAca+HdfWwPLN66Qs+AEREXLwkikrnMcfv4Vc8=;
	b=UTjlAjUQwo/Udhxf0YAd5tLgdUy/VfVj0a4e6NgkZU/oqNEn1+bQ78W/QiP6IffQ20
	hODyXx2eXctPE1R2LLeDEFtCagSjsvj3gB7Tic5TPWnEnW5T19CxDdzd/+jfk1GEUUDZ
	k8skNaAh6g19d6AM8IdBHuCHTTmRVgIlvIreE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=sNnJZrvnKM1UK26J3hm9G2NR0bO77cTf4jL7h1cbahy7qt1GJ643GJoGOF5qxTxCGx
	tpIk971gyCwCwIg3PydTWXMRhxHjoutQFIqheS39M8AOWaiedTPAWNLMGWgdhLpTiiDC
	JY1HrS4Q2Xsr6GCFKWncQ0NJB2MMql1hy1Qa4=
MIME-Version: 1.0
Received: by 10.216.230.99 with SMTP id i77mr1527530weq.100.1300484231504;
	Fri, 18 Mar 2011 14:37:11 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.173.142 with HTTP; Fri, 18 Mar 2011 14:37:11 -0700 (PDT)
In-Reply-To: <4D617713.1010705@dougbarton.us>
References: <201102162123.p1GLN9f9084297@svn.freebsd.org>
	<4D6065B4.7040709@p6m7g8.com> <4D606FEB.6070806@dougbarton.us>
	<4D61461E.3000406@p6m7g8.com> <4D617713.1010705@dougbarton.us>
Date: Fri, 18 Mar 2011 14:37:11 -0700
X-Google-Sender-Auth: 6-aQAbDYZBzclq0REVLbOlZEgsA
Message-ID: 
From: Garrett Cooper 
To: Doug Barton 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: "Philip M. Gollucci" , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r218753 - head/etc/namedb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 21:37:13 -0000

On Sun, Feb 20, 2011 at 12:18 PM, Doug Barton  wrote:
> On 2/20/2011 8:49 AM, Philip M. Gollucci wrote:
>>
>> On 2/19/2011 8:35 PM, Doug Barton wrote:
>>>
>>> On 02/19/2011 16:52, Philip M. Gollucci wrote:
>>>>
>>>> On 2/16/2011 4:23 PM, Doug Barton wrote:
>>>>>
>>>>> Author: dougb
>>>>> Date: Wed Feb 16 21:23:09 2011
>>>>> New Revision: 218753
>>>>> URL: http://svn.freebsd.org/changeset/base/218753
>>>>>
>>>>> Log:
>>>>> =A0 =A0Remove in-addr.arpa from the list of zones it is possible to s=
lave
>>>>> locally
>>>>
>>>> This is b/c of the recent change to fix the list of root servers that
>>>> serve this right ?
>>>
>>> Not precisely. in-addr.arpa has moved to its own set of servers operate=
d
>>> jointly by the RIRs and ICANN. At some point in the near future this
>>> zone will no longer be available directly from the root servers at all.
>>
>> We said the same thing, just I said it badly.
>
> Sorry to be pedantic, but it's for a (hopefully) good reason. People ofte=
n
> refer to any servers high up in the tree as "the root servers for ..." Th=
ere
> is actually only one set of root servers, the ones that serve the actual
> root zone. For hysterical raisins these servers also served ARPA, and
> IN-ADDR.ARPA. A little bit better job was done with IP6.ARPA to start wit=
h
> so it was the first to move from one set of servers managed by the RIRs a=
nd
> ICANN to a different set that are similarly named in order to take advant=
age
> of name compression in the DNS packet. IN-ADDR.ARPA is the next to move b=
oth
> for compression purposes, and to get the zone off the roots.
>
> So, not to pick on you here, my purpose is simply to clarify that they di=
d
> not change "the list of root servers," they actually changed the delegati=
on
> of IN-ADDR.ARPA to its own set of name servers.
>
> I should probably add that while it's technically possible, it's highly
> unlikely that ARPA itself will move off the roots. The zone is very small=
,
> and very static; and that is incredibly unlikely to change any time in th=
e
> near future. The IN-ADDR and IP6.ARPA zones on the other hand are both
> larger, and more dynamic (although IN-ADDR is going to be changing less a=
nd
> less as time goes on).

    Looks like this happened sometime in the last while because now
I'm not getting NXDOMAIN errors after removing this entry when trying
to run host on a machine in my network :).
    Doesn't fix my syslogd issue though (still debugging >o<...)..
Thanks!
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 22:33:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 97735106566B;
	Fri, 18 Mar 2011 22:33:19 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6D9258FC12;
	Fri, 18 Mar 2011 22:33: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 p2IMXJo0082013;
	Fri, 18 Mar 2011 22:33:19 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IMXJVt082011;
	Fri, 18 Mar 2011 22:33:19 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201103182233.p2IMXJVt082011@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 18 Mar 2011 22:33:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219756 - head/sys/ia64/ia64
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 22:33:19 -0000

Author: marcel
Date: Fri Mar 18 22:33:19 2011
New Revision: 219756
URL: http://svn.freebsd.org/changeset/base/219756

Log:
  Remove inclusion of unneeded bootinfo.h header.

Modified:
  head/sys/ia64/ia64/autoconf.c

Modified: head/sys/ia64/ia64/autoconf.c
==============================================================================
--- head/sys/ia64/ia64/autoconf.c	Fri Mar 18 22:30:47 2011	(r219755)
+++ head/sys/ia64/ia64/autoconf.c	Fri Mar 18 22:33:19 2011	(r219756)
@@ -38,7 +38,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 22:35:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 780691065675;
	Fri, 18 Mar 2011 22:35:48 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D4C28FC1B;
	Fri, 18 Mar 2011 22:35: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 p2IMZmOC082142;
	Fri, 18 Mar 2011 22:35:48 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IMZm8O082139;
	Fri, 18 Mar 2011 22:35:48 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201103182235.p2IMZm8O082139@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 18 Mar 2011 22:35: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: r219757 - in stable/8: include sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 22:35:48 -0000

Author: jilles
Date: Fri Mar 18 22:35:48 2011
New Revision: 219757
URL: http://svn.freebsd.org/changeset/base/219757

Log:
  MFC r219271: POSIX.1-2008 moved some constants from the XSI option to the
  Base.

Modified:
  stable/8/include/limits.h
  stable/8/sys/sys/limits.h
Directory Properties:
  stable/8/include/   (props changed)
  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/include/limits.h
==============================================================================
--- stable/8/include/limits.h	Fri Mar 18 22:33:19 2011	(r219756)
+++ stable/8/include/limits.h	Fri Mar 18 22:35:48 2011	(r219757)
@@ -120,18 +120,21 @@
 #define	_POSIX_RE_DUP_MAX	_POSIX2_RE_DUP_MAX
 #endif
 
+#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
+#define	NL_ARGMAX		99	/* max # of position args for printf */
+#define	NL_MSGMAX		32767
+#define	NL_SETMAX		255
+#define	NL_TEXTMAX		2048
+#endif
+
 #if __XSI_VISIBLE
 #define	_XOPEN_IOV_MAX		16
 #define	_XOPEN_NAME_MAX		255
 #define	_XOPEN_PATH_MAX		1024
 #define	PASS_MAX		128	/* _PASSWORD_LEN from  */
 
-#define	NL_ARGMAX		99	/* max # of position args for printf */
 #define	NL_LANGMAX		31	/* max LANG name length */
-#define	NL_MSGMAX		32767
 #define	NL_NMAX			1
-#define	NL_SETMAX		255
-#define	NL_TEXTMAX		2048
 #endif
 
 #define	MB_LEN_MAX		6	/* 31-bit UTF-8 */

Modified: stable/8/sys/sys/limits.h
==============================================================================
--- stable/8/sys/sys/limits.h	Fri Mar 18 22:33:19 2011	(r219756)
+++ stable/8/sys/sys/limits.h	Fri Mar 18 22:35:48 2011	(r219757)
@@ -88,7 +88,7 @@
 #define	QUAD_MIN	(__QUAD_MIN)	/* min value for a quad_t */
 #endif
 
-#if __XSI_VISIBLE
+#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
 #define	LONG_BIT	__LONG_BIT
 #define	WORD_BIT	__WORD_BIT
 #endif

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 22:45:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77E37106566B;
	Fri, 18 Mar 2011 22:45:43 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 66FFB8FC0A;
	Fri, 18 Mar 2011 22:45: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 p2IMjhZW082377;
	Fri, 18 Mar 2011 22:45:43 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IMjhGX082372;
	Fri, 18 Mar 2011 22:45:43 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201103182245.p2IMjhGX082372@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 18 Mar 2011 22:45:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219758 - in head/sys: conf ia64/ia64
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 22:45:43 -0000

Author: marcel
Date: Fri Mar 18 22:45:43 2011
New Revision: 219758
URL: http://svn.freebsd.org/changeset/base/219758

Log:
  o   Move the IVT and supporting functions to the front of the text
      segment so that it's always mapped by the loader.
  o   Change the alternate fault handlers to account for PBVM. Since
      currently the region is handled by the VHPT, no alternate faults
      will be generated for it.

Modified:
  head/sys/conf/ldscript.ia64
  head/sys/ia64/ia64/exception.S
  head/sys/ia64/ia64/genassym.c
  head/sys/ia64/ia64/locore.S

Modified: head/sys/conf/ldscript.ia64
==============================================================================
--- head/sys/conf/ldscript.ia64	Fri Mar 18 22:35:48 2011	(r219757)
+++ head/sys/conf/ldscript.ia64	Fri Mar 18 22:45:43 2011	(r219758)
@@ -9,6 +9,22 @@ SECTIONS
   /* Read-only sections, merged into text segment: */
   . = kernel_text + SIZEOF_HEADERS;
   .interp         : { *(.interp) }
+
+  PROVIDE (btext = .);
+  .ivt		  : { *(.ivt) }
+  .text           :
+  {
+    *(.text.ivt)
+    *(.text .stub .text.* .gnu.linkonce.t.*)
+    /* .gnu.warning sections are handled specially by elf32.em.  */
+    *(.gnu.warning)
+  } = 0x00300000010070000002000001000400
+  .init           : { *(.init) } = 0x00300000010070000002000001000400
+  .plt            : { *(.plt) }
+  .fini           : { *(.fini) } = 0x00300000010070000002000001000400
+  _etext = .;
+  PROVIDE (etext = .);
+
   .hash           : { *(.hash) }
   .dynsym         : { *(.dynsym) }
   .dynstr         : { *(.dynstr) }
@@ -30,37 +46,23 @@ SECTIONS
   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
   .rela.plt       : { *(.rela.plt) }
   .rela.IA_64.pltoff   : { *(.rela.IA_64.pltoff) }
-  PROVIDE (btext = .);
-  .init           :
-  {
-    *(.init)
-  } =0x00300000010070000002000001000400
-  .plt            : { *(.plt) }
-  .text           :
-  {
-    *(.text .stub .text.* .gnu.linkonce.t.*)
-    /* .gnu.warning sections are handled specially by elf32.em.  */
-    *(.gnu.warning)
-  } =0x00300000010070000002000001000400
-  .fini           :
-  {
-    *(.fini)
-  } =0x00300000010070000002000001000400
-  _etext = .;
-  PROVIDE (etext = .);
+
+  .IA_64.unwind_info   : { *(.IA_64.unwind_info* .gnu.linkonce.ia64unwi.*) }
+  .IA_64.unwind   : { *(.IA_64.unwind* .gnu.linkonce.ia64unw.*) }
+
   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
   .rodata1        : { *(.rodata1) }
   .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
   .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
   .opd            : { *(.opd) }
-  .IA_64.unwind_info   : { *(.IA_64.unwind_info* .gnu.linkonce.ia64unwi.*) }
-  .IA_64.unwind   : { *(.IA_64.unwind* .gnu.linkonce.ia64unw.*) }
-  /* Adjust the address for the data segment.  We want to adjust up to
-     the same address within the page on the next page up.  */
-  . = . + 8192;
+
+  /* Adjust the address for the data segment.  We want to start in the next
+     page in the loader virtual memory. */
+  . = ALIGN(65536);
+
   .data           :
   {
-    *(.data.proc0 .data .data.* .gnu.linkonce.d.*)
+    *(.data.kstack .data .data.* .gnu.linkonce.d.*)
     SORT(CONSTRUCTORS)
   }
   .data1          : { *(.data1) }

Modified: head/sys/ia64/ia64/exception.S
==============================================================================
--- head/sys/ia64/ia64/exception.S	Fri Mar 18 22:35:48 2011	(r219757)
+++ head/sys/ia64/ia64/exception.S	Fri Mar 18 22:45:43 2011	(r219758)
@@ -101,7 +101,7 @@ xhead:	data8	xtrace
 
 #endif
 
-	.text
+	.section .text.ivt, "ax"
 
 /*
  * exception_save: save interrupted state
@@ -725,7 +725,7 @@ ivt_##name:					\
  * bundles per vector and 48 slots with 16 bundles per vector.
  */
 
-	.section .text.ivt,"ax"
+	.section .ivt, "ax"
 
 	.align	32768
 	.global ia64_vector_table
@@ -812,7 +812,7 @@ IVT_ENTRY(Instruction_TLB, 0x0400)
 3:	add	r20=24,r20		// next in chain
 	;;
 	ld8	r20=[r20]		// read chain
-	br.cond.sptk.few 2b		// loop
+	br.sptk	2b			// loop
 	;;
 9:	ssm	psr.dt
 	mov	pr=r17,0x1ffff		// restore predicates
@@ -898,7 +898,7 @@ IVT_ENTRY(Data_TLB, 0x0800)
 3:	add	r20=24,r20		// next in chain
 	;;
 	ld8	r20=[r20]		// read chain
-	br.cond.sptk.few 2b		// loop
+	br.sptk	2b			// loop
 	;;
 9:	ssm	psr.dt
 	mov	pr=r17,0x1ffff		// restore predicates
@@ -913,25 +913,40 @@ IVT_ENTRY(Alternate_Instruction_TLB, 0x0
 	mov	r18=pr			// save predicates
 	;;
 	extr.u	r17=r16,61,3		// get region number
+	mov	r19=PTE_PRESENT+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+PTE_AR_RWX
 	;;
-	cmp.ge	p13,p0=5,r17		// RR0-RR5?
-	cmp.eq	p15,p14=7,r17		// RR7->p15, RR6->p14
-(p13)	br.spnt	9f
+	cmp.eq	p13,p0=4,r17		// RR4?
+(p13)	br.cond.sptk.few	4f
 	;;
-(p15)	movl	r17=PTE_PRESENT+PTE_MA_WB+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+ \
-			PTE_AR_RX+PTE_ED
-(p14)	movl	r17=PTE_PRESENT+PTE_MA_UC+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+ \
-			PTE_AR_RX
+	cmp.ge	p13,p0=5,r17		// RR0-RR5?
+	cmp.eq	p14,p15=7,r17		// RR7?
+(p13)	br.cond.spnt.few	9f
 	;;
-	dep	r16=0,r16,50,14		// clear bits above PPN
+(p14)	add	r19=PTE_MA_WB,r19
+(p15)	add	r19=PTE_MA_UC,r19
+	dep	r17=0,r16,50,14		// clear bits above PPN
 	;;
-	dep	r16=r17,r16,0,12	// put pte bits in 0..11
+1:	dep	r16=r19,r17,0,12	// put pte bits in 0..11
 	;;
 	itc.i	r16
 	mov	pr=r18,0x1ffff		// restore predicates
 	;;
 	rfi
 	;;
+4:
+	add	r19=PTE_MA_WB,r19
+	movl	r17=IA64_PBVM_BASE
+	;;
+	sub	r17=r16,r17
+	movl	r16=IA64_PBVM_PGTBL
+	;;
+	extr.u	r17=r17,IA64_PBVM_PAGE_SHIFT,61-IA64_PBVM_PAGE_SHIFT
+	;;
+	shladd	r16=r17,3,r16
+	;;
+	ld8	r17=[r16]
+	br.sptk	1b
+	;;
 9:	mov	pr=r18,0x1ffff		// restore predicates
 	CALL(trap, 3, cr.ifa)
 IVT_END(Alternate_Instruction_TLB)
@@ -941,25 +956,40 @@ IVT_ENTRY(Alternate_Data_TLB, 0x1000)
 	mov	r18=pr			// save predicates
 	;;
 	extr.u	r17=r16,61,3		// get region number
+	mov	r19=PTE_PRESENT+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+PTE_AR_RWX
 	;;
-	cmp.ge	p13,p0=5,r17		// RR0-RR5?
-	cmp.eq	p15,p14=7,r17		// RR7->p15, RR6->p14
-(p13)	br.spnt	9f
+	cmp.eq	p13,p0=4,r17		// RR4?
+(p13)	br.cond.sptk.few	4f
 	;;
-(p15)	movl	r17=PTE_PRESENT+PTE_MA_WB+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+ \
-			PTE_AR_RW+PTE_ED
-(p14)	movl	r17=PTE_PRESENT+PTE_MA_UC+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+ \
-			PTE_AR_RW
+	cmp.ge	p13,p0=5,r17		// RR0-RR5?
+	cmp.eq	p14,p15=7,r17		// RR7?
+(p13)	br.cond.spnt.few	9f
 	;;
-	dep	r16=0,r16,50,14		// clear bits above PPN
+(p14)	add	r19=PTE_MA_WB,r19
+(p15)	add	r19=PTE_MA_UC,r19
+	dep	r17=0,r16,50,14		// clear bits above PPN
 	;;
-	dep	r16=r17,r16,0,12	// put pte bits in 0..11
+1:	dep	r16=r19,r17,0,12	// put pte bits in 0..11
 	;;
 	itc.d	r16
 	mov	pr=r18,0x1ffff		// restore predicates
 	;;
 	rfi
 	;;
+4:
+	add	r19=PTE_MA_WB,r19
+	movl	r17=IA64_PBVM_BASE
+	;;
+	sub	r17=r16,r17
+	movl	r16=IA64_PBVM_PGTBL
+	;;
+	extr.u	r17=r17,IA64_PBVM_PAGE_SHIFT,61-IA64_PBVM_PAGE_SHIFT
+	;;
+	shladd	r16=r17,3,r16
+	;;
+	ld8	r17=[r16]
+	br.sptk	1b
+	;;
 9:	mov	pr=r18,0x1ffff		// restore predicates
 	CALL(trap, 4, cr.ifa)
 IVT_END(Alternate_Data_TLB)
@@ -1045,13 +1075,13 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400)
 {	.mib
 	srlz.d
 	cmp.eq		p13,p0=r29,r27
-(p12)	br.sptk		exception_save_restart
+(p12)	br.cond.sptk.few	exception_save_restart
 	;;
 }
 {	.mib
 	nop		0
 	nop		0
-(p13)	br.sptk		exception_restore_restart
+(p13)	br.cond.sptk.few	exception_restore_restart
 	;;
 }
 {	.mlx
@@ -1147,7 +1177,7 @@ IVT_ENTRY(Dirty_Bit, 0x2000)
 2:	add	r20=24,r20		// next in chain
 	;;
 	ld8	r20=[r20]		// read chain
-	br.cond.sptk.few 1b		// loop
+	br.sptk	1b			// loop
 	;;
 9:	ssm	psr.dt
 	mov	pr=r17,0x1ffff		// restore predicates
@@ -1221,7 +1251,7 @@ IVT_ENTRY(Instruction_Access_Bit, 0x2400
 2:	add	r20=24,r20		// next in chain
 	;;
 	ld8	r20=[r20]		// read chain
-	br.cond.sptk.few 1b		// loop
+	br.sptk	1b			// loop
 	;;
 9:	ssm	psr.dt
 	mov	pr=r17,0x1ffff		// restore predicates
@@ -1295,7 +1325,7 @@ IVT_ENTRY(Data_Access_Bit, 0x2800)
 2:	add	r20=24,r20		// next in chain
 	;;
 	ld8	r20=[r20]		// read chain
-	br.cond.sptk.few 1b		// loop
+	br.sptk	1b			// loop
 	;;
 9:	ssm	psr.dt
 	mov	pr=r17,0x1ffff		// restore predicates

Modified: head/sys/ia64/ia64/genassym.c
==============================================================================
--- head/sys/ia64/ia64/genassym.c	Fri Mar 18 22:35:48 2011	(r219757)
+++ head/sys/ia64/ia64/genassym.c	Fri Mar 18 22:45:43 2011	(r219758)
@@ -79,6 +79,11 @@ ASSYM(FRAME_SYSCALL,	FRAME_SYSCALL);
 
 ASSYM(IA64_ID_PAGE_SHIFT, IA64_ID_PAGE_SHIFT);
 
+ASSYM(IA64_PBVM_BASE,	IA64_PBVM_BASE);
+ASSYM(IA64_PBVM_PAGE_SHIFT, IA64_PBVM_PAGE_SHIFT);
+ASSYM(IA64_PBVM_PGTBL,	IA64_PBVM_PGTBL);
+ASSYM(IA64_PBVM_RR,	IA64_PBVM_RR);
+
 ASSYM(KSTACK_PAGES,	KSTACK_PAGES);
 
 ASSYM(MC_PRESERVED,	offsetof(mcontext_t, mc_preserved));

Modified: head/sys/ia64/ia64/locore.S
==============================================================================
--- head/sys/ia64/ia64/locore.S	Fri Mar 18 22:35:48 2011	(r219757)
+++ head/sys/ia64/ia64/locore.S	Fri Mar 18 22:45:43 2011	(r219758)
@@ -34,10 +34,18 @@
 #include 
 #include 
 
-	.section .data.proc0,"aw"
-	.global	kstack
+/*
+ * The Altix 350 needs more than the architected 16KB (8KB for stack and
+ * 8KB for RSE backing store) when calling EFI to setup virtual mode.
+ */
+#define	FW_STACK_SIZE	3*PAGE_SIZE
+
+	.section .data.kstack, "aw"
 	.align	PAGE_SIZE
-kstack:	.space KSTACK_PAGES * PAGE_SIZE
+	.global	kstack
+kstack:	.space	FW_STACK_SIZE
+	.global	kstack_top
+kstack_top:
 
 	.text
 
@@ -64,7 +72,7 @@ ENTRY_NOPROFILE(__start, 1)
 	srlz.i
 	;;
 	ssm	IA64_PSR_DFH
-	mov	r17=KSTACK_PAGES*PAGE_SIZE-SIZEOF_PCB-SIZEOF_TRAPFRAME-16
+	mov	r17=FW_STACK_SIZE-16
 	;;
 }
 {	.mlx

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 18 22:56:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB61C106564A;
	Fri, 18 Mar 2011 22:56:53 +0000 (UTC) (envelope-from mr@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CB80F8FC0C;
	Fri, 18 Mar 2011 22:56: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 p2IMur4l082706;
	Fri, 18 Mar 2011 22:56:53 GMT (envelope-from mr@svn.freebsd.org)
Received: (from mr@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2IMurYl082702;
	Fri, 18 Mar 2011 22:56:53 GMT (envelope-from mr@svn.freebsd.org)
Message-Id: <201103182256.p2IMurYl082702@svn.freebsd.org>
From: Michael Reifenberger 
Date: Fri, 18 Mar 2011 22:56:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219760 - head/tools/tools/nanobsd/rescue
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 18 Mar 2011 22:56:54 -0000

Author: mr
Date: Fri Mar 18 22:56:53 2011
New Revision: 219760
URL: http://svn.freebsd.org/changeset/base/219760

Log:
  - Build disk image (for USB sticks) and iso image
  - Change name to reflect this
  - Install all kernel modules
  - Choose image size that i386 and amd64 can be combined into one image
  - Mount tmpfs over /boot/zfs for zpool imports

Added:
  head/tools/tools/nanobsd/rescue/rescue_amd64.conf
     - copied, changed from r219753, head/tools/tools/nanobsd/rescue/isoamd64.conf
  head/tools/tools/nanobsd/rescue/rescue_i386.conf
     - copied, changed from r219753, head/tools/tools/nanobsd/rescue/isoi386.conf
Deleted:
  head/tools/tools/nanobsd/rescue/isoamd64.conf
  head/tools/tools/nanobsd/rescue/isoi386.conf
Modified:
  head/tools/tools/nanobsd/rescue/common

Modified: head/tools/tools/nanobsd/rescue/common
==============================================================================
--- head/tools/tools/nanobsd/rescue/common	Fri Mar 18 22:55:32 2011	(r219759)
+++ head/tools/tools/nanobsd/rescue/common	Fri Mar 18 22:56:53 2011	(r219760)
@@ -6,6 +6,20 @@ NANO_PACKAGE_DIR=`pwd`/Pkg
 NANO_RAM_TMPVARSIZE=20480
 NANO_PMAKE="make -j 8"
 NANO_LABEL="rescue"
+NANO_RAM_TMPVARSIZE=40960
+#NANO_MEDIASIZE="8027712"
+#NANO_MEDIASIZE="2097152"
+NANO_MEDIASIZE="3932160"
+NANO_SECTS="63"
+NANO_HEADS="16"
+NANO_IMAGES="2"
+NANO_INIT_IMG2="0"
+NANO_BOOT0CFG="-o packet,update,nosetdrv -s 1 -m 3"
+NANO_DRIVE=da0
+#NANO_MODULES=
+NANO_BOOTLOADER="boot/boot0"
+NANO_BOOT2CFG=""
+NANO_MD_BACKING=swap
 
 # Options to put in make.conf during buildworld only
 CONF_BUILD='
@@ -17,7 +31,7 @@ CONF_INSTALL='
 CONF_WORLD='                                                                    
 #TARGET_ARCH=i386
 CFLAGS=-O -pipe                                                                
-#MODULES_OVERRIDE=
+ALL_MODULES=YES
 '
 
 #customize_cmd cust_comconsole
@@ -53,8 +67,8 @@ cust_etc_cfg () (
 	echo "keymap=\"german.iso\"" >> etc/rc.conf
 	echo "#ifconfig_fxp0=\"AUTO\"" >> etc/rc.conf
 	echo "#sshd_enable=\"YES\"" >> etc/rc.conf
-	echo "/dev/iso9660/${NANO_LABEL} / cd9660 ro,noatime 0 0" > etc/fstab
-	echo "tmpfs /tmp tmpfs rw,size=268435456,mode=1777 0 0" >> etc/fstab
+	echo "/dev/ufs/${NANO_LABEL}s1a / ufs ro,noatime 0 0" > etc/fstab
+	echo "tmpfs /boot/zfs tmpfs rw,size=1048576,mode=777 0 0" >> etc/fstab
 	echo "ports:/usr/ports /usr/ports nfs rw,noauto,noatime,bg,soft,intr,nfsv3 0 0" >> etc/fstab
 #	echo "/dev/ad1s1a /scratch ufs rw,noauto,noatime 0 0" >> etc/fstab
 	/usr/sbin/pwd_mkdb -d etc etc/master.passwd
@@ -78,6 +92,10 @@ last_orders () (
 	pprint 2 "last orders"
 	(
 	cd ${NANO_WORLDDIR}
+	echo "/dev/iso9660/${NANO_LABEL} / cd9660 ro,noatime 0 0" > etc/fstab
+	echo "tmpfs /boot/zfs tmpfs rw,size=1048576,mode=777 0 0" >> etc/fstab
+	echo "ports:/usr/ports /usr/ports nfs rw,noauto,noatime,bg,soft,intr,nfsv3 0 0" >> etc/fstab
+#	echo "/dev/ad1s1a /scratch ufs rw,noauto,noatime 0 0" >> etc/fstab
 	rm -f conf/default/etc/remount
 	touch conf/default/etc/.keepme
 	touch conf/default/var/.keepme
@@ -88,10 +106,10 @@ last_orders () (
 	)
 )
 
-create_i386_diskimage () {
-	#currently not used
-}
-
-create_amd64_diskimage () {
-	create_i386_diskimage
-}
+#create_i386_diskimage () {
+#	#currently not used
+#}
+
+#create_amd64_diskimage () {
+#	create_i386_diskimage
+#}

Copied and modified: head/tools/tools/nanobsd/rescue/rescue_amd64.conf (from r219753, head/tools/tools/nanobsd/rescue/isoamd64.conf)
==============================================================================
--- head/tools/tools/nanobsd/rescue/isoamd64.conf	Fri Mar 18 18:54:00 2011	(r219753, copy source)
+++ head/tools/tools/nanobsd/rescue/rescue_amd64.conf	Fri Mar 18 22:56:53 2011	(r219760)
@@ -5,6 +5,6 @@ NANO_KERNEL=GENERIC
 NANO_ARCH=amd64
 TARGET_ARCH=amd64; export TARGET_ARCH
 #TARGET_CPUTYPE=amd64; export TARGET_CPUTYPE
-NANO_NAME=rescue_isoamd64
+NANO_NAME=rescue_amd64
 
 . common

Copied and modified: head/tools/tools/nanobsd/rescue/rescue_i386.conf (from r219753, head/tools/tools/nanobsd/rescue/isoi386.conf)
==============================================================================
--- head/tools/tools/nanobsd/rescue/isoi386.conf	Fri Mar 18 18:54:00 2011	(r219753, copy source)
+++ head/tools/tools/nanobsd/rescue/rescue_i386.conf	Fri Mar 18 22:56:53 2011	(r219760)
@@ -5,6 +5,6 @@ NANO_KERNEL=GENERIC
 NANO_ARCH=i386
 TARGET_ARCH=i386; export TARGET_ARCH
 #TARGET_CPUTYPE=i386; export TARGET_CPUTYPE
-NANO_NAME=rescue_isoi386
+NANO_NAME=rescue_i386
 
 . common

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 00:19:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 189BF1065672;
	Sat, 19 Mar 2011 00:19:19 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 08A8C8FC14;
	Sat, 19 Mar 2011 00:19: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 p2J0JIIk084511;
	Sat, 19 Mar 2011 00:19:18 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2J0JIQu084509;
	Sat, 19 Mar 2011 00:19:18 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201103190019.p2J0JIQu084509@svn.freebsd.org>
From: Jack F Vogel 
Date: Sat, 19 Mar 2011 00:19:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219763 - head/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 00:19:19 -0000

Author: jfv
Date: Sat Mar 19 00:19:18 2011
New Revision: 219763
URL: http://svn.freebsd.org/changeset/base/219763

Log:
  Correct broken define

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

Modified: head/sys/dev/e1000/if_em.h
==============================================================================
--- head/sys/dev/e1000/if_em.h	Fri Mar 18 23:55:25 2011	(r219762)
+++ head/sys/dev/e1000/if_em.h	Sat Mar 19 00:19:18 2011	(r219763)
@@ -212,7 +212,7 @@
 #define EM_BAR_MEM_TYPE_64BIT	0x00000004
 #define EM_MSIX_BAR		3	/* On 82575 */
 
-#if !defined(SYSTCL_ADD_UQUAD)
+#if !defined(SYSCTL_ADD_UQUAD)
 #define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD
 #endif
 

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 00:31:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A68D106564A;
	Sat, 19 Mar 2011 00:31:36 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2AD148FC0C;
	Sat, 19 Mar 2011 00:31: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 p2J0Va8G084816;
	Sat, 19 Mar 2011 00:31:36 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2J0Va0X084814;
	Sat, 19 Mar 2011 00:31:36 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201103190031.p2J0Va0X084814@svn.freebsd.org>
From: Jack F Vogel 
Date: Sat, 19 Mar 2011 00:31:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219764 - head/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 00:31:36 -0000

Author: jfv
Date: Sat Mar 19 00:31:35 2011
New Revision: 219764
URL: http://svn.freebsd.org/changeset/base/219764

Log:
  A cut and paste here was wrong also.

Modified:
  head/sys/dev/e1000/if_lem.h

Modified: head/sys/dev/e1000/if_lem.h
==============================================================================
--- head/sys/dev/e1000/if_lem.h	Sat Mar 19 00:19:18 2011	(r219763)
+++ head/sys/dev/e1000/if_lem.h	Sat Mar 19 00:31:35 2011	(r219764)
@@ -217,7 +217,7 @@
 #define EM_BAR_MEM_TYPE_64BIT	0x00000004
 #define EM_MSIX_BAR		3	/* On 82575 */
 
-#if !defined(SYSTCL_ADD_UQUAD)
+#if !defined(SYSCTL_ADD_UQUAD)
 #define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD
 #endif
 

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 00:34:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB1961065675;
	Sat, 19 Mar 2011 00:34:12 +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 CB0648FC0A;
	Sat, 19 Mar 2011 00:34: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 p2J0YCoK084914;
	Sat, 19 Mar 2011 00:34:12 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2J0YCQ8084912;
	Sat, 19 Mar 2011 00:34:12 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103190034.p2J0YCQ8084912@svn.freebsd.org>
From: Glen Barber 
Date: Sat, 19 Mar 2011 00:34: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: r219765 - stable/8/sbin/ifconfig
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 00:34:13 -0000

Author: gjb (doc committer)
Date: Sat Mar 19 00:34:12 2011
New Revision: 219765
URL: http://svn.freebsd.org/changeset/base/219765

Log:
  MFC 219574,219575:
  - Add example of using 'scan' for wireless networks, similarly to
    OpenBSD's ifconfig(8)[1].
  - remove unneeded newline
  
  PR:		151952 [1]

Modified:
  stable/8/sbin/ifconfig/ifconfig.8
Directory Properties:
  stable/8/sbin/ifconfig/   (props changed)

Modified: stable/8/sbin/ifconfig/ifconfig.8
==============================================================================
--- stable/8/sbin/ifconfig/ifconfig.8	Sat Mar 19 00:31:35 2011	(r219764)
+++ stable/8/sbin/ifconfig/ifconfig.8	Sat Mar 19 00:34:12 2011	(r219765)
@@ -2508,7 +2508,6 @@ to use 100baseTX, full duplex Ethernet m
 .Dl # ifconfig xl0 media 100baseTX mediaopt full-duplex
 .Pp
 Label the em0 interface as an uplink:
-.Pp
 .Dl # ifconfig em0 description \&"Uplink to Gigabit Switch 2\&"
 .Pp
 Create the software network interface
@@ -2518,6 +2517,10 @@ Create the software network interface
 Destroy the software network interface
 .Li gif1 :
 .Dl # ifconfig gif1 destroy
+.Pp
+Scan for wireless networks using
+.Li wlan0 :
+.Dl # ifconfig wlan0 scan
 .Sh DIAGNOSTICS
 Messages indicating the specified interface does not exist, the
 requested address is unknown, or the user is not privileged and

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 00:35:11 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F85F106564A;
	Sat, 19 Mar 2011 00:35:11 +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 6F9FE8FC0A;
	Sat, 19 Mar 2011 00:35: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 p2J0ZBor084974;
	Sat, 19 Mar 2011 00:35:11 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2J0ZBi8084972;
	Sat, 19 Mar 2011 00:35:11 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103190035.p2J0ZBi8084972@svn.freebsd.org>
From: Glen Barber 
Date: Sat, 19 Mar 2011 00:35: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: r219766 - stable/7/sbin/ifconfig
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 00:35:11 -0000

Author: gjb (doc committer)
Date: Sat Mar 19 00:35:11 2011
New Revision: 219766
URL: http://svn.freebsd.org/changeset/base/219766

Log:
  MFC 219574:
  - Add example of using 'scan' for wireless networks, similarly to
    OpenBSD's ifconfig(8).
  - wlan0 isn't available on 7.x, so substitute ath0 for wlan0 in the
    example.
  
  PR:		151952

Modified:
  stable/7/sbin/ifconfig/ifconfig.8
Directory Properties:
  stable/7/sbin/ifconfig/   (props changed)

Modified: stable/7/sbin/ifconfig/ifconfig.8
==============================================================================
--- stable/7/sbin/ifconfig/ifconfig.8	Sat Mar 19 00:34:12 2011	(r219765)
+++ stable/7/sbin/ifconfig/ifconfig.8	Sat Mar 19 00:35:11 2011	(r219766)
@@ -1946,6 +1946,10 @@ Create the software network interface
 Destroy the software network interface
 .Li gif1 :
 .Dl # ifconfig gif1 destroy
+.Pp
+Scan for wireless networks using
+.Li ath0 :
+.Dl # ifconfig ath0 scan
 .Sh DIAGNOSTICS
 Messages indicating the specified interface does not exist, the
 requested address is unknown, or the user is not privileged and

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 00:46:11 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 551B9106566B;
	Sat, 19 Mar 2011 00:46:11 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 458468FC1B;
	Sat, 19 Mar 2011 00:46: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 p2J0kBaf085213;
	Sat, 19 Mar 2011 00:46:11 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2J0kBP9085211;
	Sat, 19 Mar 2011 00:46:11 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103190046.p2J0kBP9085211@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 19 Mar 2011 00:46:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219767 - head/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 00:46:11 -0000

Author: adrian
Date: Sat Mar 19 00:46:10 2011
New Revision: 219767
URL: http://svn.freebsd.org/changeset/base/219767

Log:
  Add debugging messages to the AR5416 ANI code that's found in the AR5212 ANI code.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Sat Mar 19 00:35:11 2011	(r219766)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Sat Mar 19 00:46:10 2011	(r219767)
@@ -855,10 +855,16 @@ ar5416AniPoll(struct ath_hal *ah, const 
 		/* check to see if need to raise immunity */
 		if (aniState->ofdmPhyErrCount > aniState->listenTime *
 		    params->ofdmTrigHigh / 1000) {
+                        HALDEBUG(ah, HAL_DEBUG_ANI,
+                            "%s: OFDM err %u listenTime %u\n", __func__,
+                            aniState->ofdmPhyErrCount, aniState->listenTime);
 			ar5416AniOfdmErrTrigger(ah);
 			ar5416AniRestart(ah, aniState);
 		} else if (aniState->cckPhyErrCount > aniState->listenTime *
 			   params->cckTrigHigh / 1000) {
+                        HALDEBUG(ah, HAL_DEBUG_ANI,
+                            "%s: CCK err %u listenTime %u\n", __func__,
+                            aniState->ofdmPhyErrCount, aniState->listenTime);
 			ar5416AniCckErrTrigger(ah);
 			ar5416AniRestart(ah, aniState);
 		}

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 01:00:20 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35])
	by hub.freebsd.org (Postfix) with ESMTP id A36ED1065673;
	Sat, 19 Mar 2011 01:00:19 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36])
	by mx2.freebsd.org (Postfix) with ESMTP id 8BDCE14D9C0;
	Sat, 19 Mar 2011 00:59:58 +0000 (UTC)
Message-ID: <4D840010.9070301@FreeBSD.org>
Date: Fri, 18 Mar 2011 18:00:00 -0700
From: Doug Barton 
Organization: http://www.FreeBSD.org/
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version: 1.0
To: Jack Vogel 
References: <201103181854.p2IIs0G1077313@svn.freebsd.org>	
	
In-Reply-To: 
X-Enigmail-Version: 1.1.1
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Juli Mallett , Jack F Vogel ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	svn-src-head@freebsd.org
Subject: Re: svn commit: r219753 - head/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 01:00:20 -0000

On 3/18/2011 12:37 PM, Jack Vogel wrote:
> I'm trying to do my best though.

As an em0 user I really appreciate the effort you're putting in, and the 
fact that Intel is supporting you in it.


Doug

-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/


From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 01:41:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0C61A106567A;
	Sat, 19 Mar 2011 01:41:22 +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 F17D28FC1A;
	Sat, 19 Mar 2011 01:41: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 p2J1fLkd086301;
	Sat, 19 Mar 2011 01:41:21 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2J1fLl6086299;
	Sat, 19 Mar 2011 01:41:21 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103190141.p2J1fLl6086299@svn.freebsd.org>
From: Glen Barber 
Date: Sat, 19 Mar 2011 01:41: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: r219768 - stable/8/usr.sbin/moused
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 01:41:22 -0000

Author: gjb (doc committer)
Date: Sat Mar 19 01:41:21 2011
New Revision: 219768
URL: http://svn.freebsd.org/changeset/base/219768

Log:
  MFC 219723:
  - Formtting fix.

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

Modified: stable/8/usr.sbin/moused/moused.8
==============================================================================
--- stable/8/usr.sbin/moused/moused.8	Sat Mar 19 00:46:10 2011	(r219767)
+++ stable/8/usr.sbin/moused/moused.8	Sat Mar 19 01:41:21 2011	(r219768)
@@ -450,9 +450,9 @@ X10 MouseRemote.
 Genius Kidspad and Easypad protocol.
 .It Ar versapad
 Interlink VersaPad protocol.
-.El
 .It Ar gtco_digipad
 GTCO Digipad protocol.
+.El
 .Pp
 For the bus and InPort mouse:
 .Bl -tag -compact -width mousesystemsxxx

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 01:41:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D2F401065686;
	Sat, 19 Mar 2011 01:41:58 +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 C41BC8FC1D;
	Sat, 19 Mar 2011 01:41: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 p2J1fwgc086353;
	Sat, 19 Mar 2011 01:41:58 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2J1fwku086351;
	Sat, 19 Mar 2011 01:41:58 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103190141.p2J1fwku086351@svn.freebsd.org>
From: Glen Barber 
Date: Sat, 19 Mar 2011 01:41: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: r219769 - stable/7/usr.sbin/moused
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 01:41:58 -0000

Author: gjb (doc committer)
Date: Sat Mar 19 01:41:58 2011
New Revision: 219769
URL: http://svn.freebsd.org/changeset/base/219769

Log:
  MFC 219723:
  - Formatting fix.

Modified:
  stable/7/usr.sbin/moused/moused.8
Directory Properties:
  stable/7/usr.sbin/moused/   (props changed)

Modified: stable/7/usr.sbin/moused/moused.8
==============================================================================
--- stable/7/usr.sbin/moused/moused.8	Sat Mar 19 01:41:21 2011	(r219768)
+++ stable/7/usr.sbin/moused/moused.8	Sat Mar 19 01:41:58 2011	(r219769)
@@ -450,9 +450,9 @@ X10 MouseRemote.
 Genius Kidspad and Easypad protocol.
 .It Ar versapad
 Interlink VersaPad protocol.
-.El
 .It Ar gtco_digipad
 GTCO Digipad protocol.
+.El
 .Pp
 For the bus and InPort mouse:
 .Bl -tag -compact -width mousesystemsxxx

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 01:50:12 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15DEB106564A;
	Sat, 19 Mar 2011 01:50:12 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210])
	by mx1.freebsd.org (Postfix) with ESMTP id DB3608FC13;
	Sat, 19 Mar 2011 01:50:11 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by
	smtpauth1.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009)) id <0LIA00C007RMX500@smtpauth1.wiscmail.wisc.edu>; Fri,
	18 Mar 2011 20:50:10 -0500 (CDT)
Received: from comporellon.tachypleus.net ([unknown] [76.210.65.155])
	by smtpauth1.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009))
	with ESMTPSA id <0LIA001R97RKB010@smtpauth1.wiscmail.wisc.edu>; Fri,
	18 Mar 2011 20:50:10 -0500 (CDT)
Date: Fri, 18 Mar 2011 20:50:08 -0500
From: Nathan Whitehorn 
In-reply-to: <1300211430.87705.34.camel@buffy.york.ac.uk>
To: Gavin Atkinson 
Message-id: <4D840BD0.4030306@freebsd.org>
X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.65.155
X-Spam-PmxInfo: Server=avs-11, Version=5.6.0.2009776,
	Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.3.19.13921,
	SenderIP=76.210.65.155
References: <201103151327.p2FDRZPK044315@svn.freebsd.org>
	<1300198773.87705.25.camel@buffy.york.ac.uk>
	<4D7FA14C.8040205@freebsd.org>
	<1300211430.87705.34.camel@buffy.york.ac.uk>
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15)
	Gecko/20110305 Thunderbird/3.1.9
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 01:50:12 -0000

On 03/15/11 12:50, Gavin Atkinson wrote:
> On Tue, 2011-03-15 at 12:26 -0500, Nathan Whitehorn wrote:
>> On 03/15/11 09:19, Gavin Atkinson wrote:
>>> On Tue, 2011-03-15 at 13:27 +0000, Nathan Whitehorn wrote:
>>>> Author: nwhitehorn
>>>> Date: Tue Mar 15 13:27:34 2011
>>>> New Revision: 219667
>>>> URL: http://svn.freebsd.org/changeset/base/219667
>>>>
>>>> Log:
>>>>     Turn on softupdates by default. We need a UI to set filesystem
>>>> parameters.
>>>>
>>>> Modified:
>>>>     head/usr.sbin/bsdinstall/partedit/gpart_ops.c
>>> This would appear to still be a change from the previous behaviour,
>>> where softupdates were enabled by default for any filesystem except for
>>> the root filesystem.
>> It is -- and this needs to become settable. Bear in mind, however, that
>> the default partition layout is also different. If you select the auto
>> option, only one file system is made, so there are no non-root file systems.
> Hrm, I hadn't realised this was the case.  If this change is intentional
> and planned to remain, I guess the various bits of documentation that
> say "several partitions good, one bad" should be updated...

It is intended. I think it makes things somewhat easier for the 
virtualization case, and I know a lot of people have been running their 
systems with "one-big-/" for years. If it is harmful for some reason, 
however, it's easy to change.

>>> I wonder if it is time to start enabling SU+J on non-root filesystems
>>> now?
>> That's certainly something to think about, although I'll defer whether
>> that is wise to others. It's a little bit of a pain on the
>> implementation side, since you can't turn it on from newfs, but that
>> isn't a serious obstacle.
> As of r218726, you can now set this from newfs. (-j)

Ah, wonderful. The decision of whether that is a good idea still rests 
with others, however :)
-nathan

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 01:50:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1C1721065670;
	Sat, 19 Mar 2011 01:50:43 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210])
	by mx1.freebsd.org (Postfix) with ESMTP id DE8F58FC12;
	Sat, 19 Mar 2011 01:50:42 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by
	smtpauth1.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009)) id <0LIA00C007SIZP00@smtpauth1.wiscmail.wisc.edu>; Fri,
	18 Mar 2011 20:50:42 -0500 (CDT)
Received: from comporellon.tachypleus.net ([unknown] [76.210.65.155])
	by smtpauth1.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009))
	with ESMTPSA id <0LIA001RP7SGB010@smtpauth1.wiscmail.wisc.edu>; Fri,
	18 Mar 2011 20:50:41 -0500 (CDT)
Date: Fri, 18 Mar 2011 20:50:40 -0500
From: Nathan Whitehorn 
In-reply-to: 
To: Daniel O'Connor 
Message-id: <4D840BF0.9030904@freebsd.org>
X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.65.155
X-Spam-PmxInfo: Server=avs-10, Version=5.6.0.2009776,
	Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.3.19.13318,
	SenderIP=76.210.65.155
References: <201103151327.p2FDRZPK044315@svn.freebsd.org>
	<1300198773.87705.25.camel@buffy.york.ac.uk>
	<4D7FA14C.8040205@freebsd.org>
	
	
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15)
	Gecko/20110305 Thunderbird/3.1.9
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Gavin Atkinson , src-committers@freebsd.org,
	Ben Kaduk 
Subject: Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 01:50:43 -0000

On 03/16/11 01:25, Daniel O'Connor wrote:
> On 16/03/2011, at 4:14, Ben Kaduk wrote:
>>> is wise to others. It's a little bit of a pain on the implementation side,
>>> since you can't turn it on from newfs, but that isn't a serious obstacle.
>> I suspect the consensus of people like -arch and -fs will be that the
>> burn-in time before it is considered sufficiently stable is be
>> measured in years.
> Which is a good reason to have a UI to set it :)
>
> Or maybe when you say "auto" it asks if you want it on or not.

Yes, there should be a UI for sure. Just ENOTIME so far.
-Nathan

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 03:09:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2B3381065673;
	Sat, 19 Mar 2011 03:09:22 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1C0FF8FC13;
	Sat, 19 Mar 2011 03:09: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 p2J39L2B088319;
	Sat, 19 Mar 2011 03:09:21 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2J39Lh4088317;
	Sat, 19 Mar 2011 03:09:21 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103190309.p2J39Lh4088317@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 19 Mar 2011 03:09:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219770 - head/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 03:09:22 -0000

Author: adrian
Date: Sat Mar 19 03:09:21 2011
New Revision: 219770
URL: http://svn.freebsd.org/changeset/base/219770

Log:
  Use the HAL method rather than directly calling ar5212ResetTxQueue().
  
  Since ath9k does some slightly different bit fiddling when setting up
  the TX queues, it may that the TX queue setup/reset functions will need
  overriding later on.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sat Mar 19 01:41:58 2011	(r219769)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sat Mar 19 03:09:21 2011	(r219770)
@@ -285,7 +285,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 
 	ahp->ah_intrTxqs = 0;
 	for (i = 0; i < AH_PRIVATE(ah)->ah_caps.halTotalQueues; i++)
-		ar5212ResetTxQueue(ah, i);
+		ah->ah_resetTxQueue(ah, i);
 
 	ar5416InitIMR(ah, opmode);
 	ar5212SetCoverageClass(ah, AH_PRIVATE(ah)->ah_coverageClass, 1);

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 03:15:28 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ACAF2106564A;
	Sat, 19 Mar 2011 03:15:28 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9CD748FC19;
	Sat, 19 Mar 2011 03:15: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 p2J3FSmF088475;
	Sat, 19 Mar 2011 03:15:28 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2J3FS1E088470;
	Sat, 19 Mar 2011 03:15:28 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103190315.p2J3FS1E088470@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 19 Mar 2011 03:15:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219771 - in head/sys/dev/ath/ath_hal: ar5212 ar5416
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 03:15:28 -0000

Author: adrian
Date: Sat Mar 19 03:15:28 2011
New Revision: 219771
URL: http://svn.freebsd.org/changeset/base/219771

Log:
  Make sure that the AR_MISC_MODE value from the initvals are properly respected.
  
  This commit really is "fix the OFDM duration calculation to match reality when
  running in 802.11g mode."
  
  The AR5212 init vals set AR_MISC_MODE to 0x0 and all the bits that can be set are
  set through code.
  
  The AR5416 and later initvals set AR_MISC_MODE to various other values (with
  the AR5212 AR_MISC_MODE options cleared), which include AR_PCU_CCK_SIFS_MODE .
  This adds 6uS to SIFS on non-CCK frames when transmitting.
  
  This fixes the issue where _DATA_ 802.11g OFDM frames were being TX'ed with
  the ACK duration set to 38uS, not 44uS as on the AR5212 (and other devices.)
  
  The AR5212 TX pathway obeys the software-programmed duration field in the packet,
  but the 11n TX pathway overrides that with a hardware-calculated duration. This
  was getting it wrong because of the above AR_MISC_MODE setting. I've verified
  that 11g data OFDM frames are now being TXed with the correct ACK+SIFS duration
  programmed in.

Modified:
  head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c	Sat Mar 19 03:09:21 2011	(r219770)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c	Sat Mar 19 03:15:28 2011	(r219771)
@@ -934,7 +934,7 @@ ar5212SetCapability(struct ath_hal *ah, 
 		else
 			ahp->ah_miscMode |= AR_MISC_MODE_MIC_NEW_LOC_ENABLE;
 		/* NB: write here so keys can be setup w/o a reset */
-		OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode);
+		OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode);
 		return AH_TRUE;
 	case HAL_CAP_DIVERSITY:
 		if (ahp->ah_phyPowerOn) {

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c	Sat Mar 19 03:09:21 2011	(r219770)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c	Sat Mar 19 03:15:28 2011	(r219771)
@@ -199,7 +199,7 @@ ar5212SetRxFilter(struct ath_hal *ah, ui
 			ahp->ah_miscMode |= AR_MISC_MODE_BSSID_MATCH_FORCE;
 		else
 			ahp->ah_miscMode &= ~AR_MISC_MODE_BSSID_MATCH_FORCE;
-		OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode);
+		OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode);
 	}
 }
 

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Sat Mar 19 03:09:21 2011	(r219770)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Sat Mar 19 03:15:28 2011	(r219771)
@@ -372,7 +372,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s
 	 * placed into hardware.
 	 */
 	if (ahp->ah_miscMode != 0)
-		OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode);
+		OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode);
 
 	rfStatus = ar2133RfAttach(ah, &ecode);
 	if (!rfStatus) {

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sat Mar 19 03:09:21 2011	(r219770)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sat Mar 19 03:15:28 2011	(r219771)
@@ -581,7 +581,7 @@ ar5416InitUserSettings(struct ath_hal *a
 
 	/* Restore user-specified settings */
 	if (ahp->ah_miscMode != 0)
-		OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode);
+		OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode);
 	if (ahp->ah_sifstime != (u_int) -1)
 		ar5212SetSifsTime(ah, ahp->ah_sifstime);
 	if (ahp->ah_slottime != (u_int) -1)

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 14:37:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7A354106567B;
	Sat, 19 Mar 2011 14:37:13 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DDFD8FC16;
	Sat, 19 Mar 2011 14:37: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 p2JEbDkc025828;
	Sat, 19 Mar 2011 14:37:13 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JEbDUx025826;
	Sat, 19 Mar 2011 14:37:13 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103191437.p2JEbDUx025826@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 19 Mar 2011 14:37:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219772 - head/sys/dev/ath/ath_hal
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 14:37:13 -0000

Author: adrian
Date: Sat Mar 19 14:37:13 2011
New Revision: 219772
URL: http://svn.freebsd.org/changeset/base/219772

Log:
  Reserve a new diagnostic code for the channel survey code I'll add soon.

Modified:
  head/sys/dev/ath/ath_hal/ah_diagcodes.h

Modified: head/sys/dev/ath/ath_hal/ah_diagcodes.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_diagcodes.h	Sat Mar 19 03:15:28 2011	(r219771)
+++ head/sys/dev/ath/ath_hal/ah_diagcodes.h	Sat Mar 19 14:37:13 2011	(r219772)
@@ -62,6 +62,7 @@ enum {
 	HAL_DIAG_ANI_PARAMS	= 31,	/* ANI noise immunity parameters */
 	HAL_DIAG_CHECK_HANGS	= 32,	/* check h/w hangs */
 	HAL_DIAG_SETREGS	= 33,	/* write registers */
+	HAL_DIAG_CHANSURVEY	= 34,	/* channel survey */
 };
 
 #endif /* _ATH_AH_DIAGCODES_H_ */

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 14:38:29 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4B7031065676;
	Sat, 19 Mar 2011 14:38:29 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F3648FC1C;
	Sat, 19 Mar 2011 14:38: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 p2JEcTdF025887;
	Sat, 19 Mar 2011 14:38:29 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JEcTbb025885;
	Sat, 19 Mar 2011 14:38:29 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103191438.p2JEcTbb025885@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 19 Mar 2011 14:38:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219773 - head/sys/dev/ath/ath_hal
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 14:38:29 -0000

Author: adrian
Date: Sat Mar 19 14:38:28 2011
New Revision: 219773
URL: http://svn.freebsd.org/changeset/base/219773

Log:
  Add in the channel survey data structures. These will be filled out
  by the HAL at some point in the future.

Modified:
  head/sys/dev/ath/ath_hal/ah.h

Modified: head/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.h	Sat Mar 19 14:37:13 2011	(r219772)
+++ head/sys/dev/ath/ath_hal/ah.h	Sat Mar 19 14:38:28 2011	(r219773)
@@ -596,6 +596,33 @@ struct ath_rx_status;
 struct ieee80211_channel;
 
 /*
+ * This is a channel survey sample entry.
+ *
+ * The AR5212 ANI routines fill these samples. The ANI code then uses it
+ * when calculating listen time; it is also exported via a diagnostic
+ * API.
+ */
+typedef struct {
+	uint32_t        seq_num;
+	uint32_t        tx_busy;
+	uint32_t        rx_busy;
+	uint32_t        chan_busy;
+	uint32_t        cycle_count;
+} HAL_SURVEY_SAMPLE;
+
+/*
+ * This provides 3.2 seconds of sample space given an
+ * ANI time of 1/10th of a second. This may not be enough!
+ */
+#define	CHANNEL_SURVEY_SAMPLE_COUNT	32
+
+typedef struct {
+	HAL_SURVEY_SAMPLE samples[CHANNEL_SURVEY_SAMPLE_COUNT];
+	uint32_t cur_sample;	/* current sample in sequence */
+	uint32_t cur_seq;	/* current sequence number */
+} HAL_CHANNEL_SURVEY;
+
+/*
  * Hardware Access Layer (HAL) API.
  *
  * Clients of the HAL call ath_hal_attach to obtain a reference to an

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 15:50:34 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CADF2106564A;
	Sat, 19 Mar 2011 15:50:34 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BD9288FC22;
	Sat, 19 Mar 2011 15:50: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 p2JFoYnB027562;
	Sat, 19 Mar 2011 15:50:34 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JFoYHw027557;
	Sat, 19 Mar 2011 15:50:34 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201103191550.p2JFoYHw027557@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 19 Mar 2011 15:50:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219775 - in head/sys: amd64/conf i386/conf ia64/conf
	mips/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 15:50:35 -0000

Author: bz
Date: Sat Mar 19 15:50:34 2011
New Revision: 219775
URL: http://svn.freebsd.org/changeset/base/219775

Log:
  For now remove options FLOWTABLE from the remaining GENERIC kernel
  configurations and make it opt-in for those who want it.  LINT will
  still build it.
  
  While it may be a perfect win in some scenarios, it still troubles users
  (see PRs) in general cases.  In addition we are still allocating resources
  even if disabled by sysctl and still leak arp/nd6 entries in case of
  interface destruction.
  
  Discussed with:	qingli (2010-11-24, just never executed)
  Discussed with: juli (OCTEON1)
  PR:		kern/148018, kern/155604, kern/144917, kern/146792
  MFC after:	2 weeks

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/i386/conf/GENERIC
  head/sys/ia64/conf/GENERIC
  head/sys/mips/conf/OCTEON1

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Sat Mar 19 14:44:24 2011	(r219774)
+++ head/sys/amd64/conf/GENERIC	Sat Mar 19 15:50:34 2011	(r219775)
@@ -61,7 +61,6 @@ options 	KBD_INSTALL_CDEV	# install a CD
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework
-options 	FLOWTABLE		# per-cpu routing cache
 #options 	KDTRACE_FRAME		# Ensure frames are compiled in
 #options 	KDTRACE_HOOKS		# Kernel DTrace hooks
 options 	INCLUDE_CONFIG_FILE     # Include this file in kernel

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Sat Mar 19 14:44:24 2011	(r219774)
+++ head/sys/i386/conf/GENERIC	Sat Mar 19 15:50:34 2011	(r219775)
@@ -62,7 +62,6 @@ options 	KBD_INSTALL_CDEV	# install a CD
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework
-options 	FLOWTABLE		# per-cpu routing cache
 #options 	KDTRACE_HOOKS		# Kernel DTrace hooks
 options 	INCLUDE_CONFIG_FILE     # Include this file in kernel
 

Modified: head/sys/ia64/conf/GENERIC
==============================================================================
--- head/sys/ia64/conf/GENERIC	Sat Mar 19 14:44:24 2011	(r219774)
+++ head/sys/ia64/conf/GENERIC	Sat Mar 19 15:50:34 2011	(r219775)
@@ -31,8 +31,6 @@ options 	COMPAT_FREEBSD7	# Compatible wi
 options 	DDB		# Support DDB
 options 	DEADLKRES	# Enable the deadlock resolver
 options 	FFS		# Berkeley Fast Filesystem
-#options 	FLOWTABLE	# per-cpu routing cache (removed due to
-				# misaligned access -- see kern/148018)
 options 	GDB		# Support remote GDB
 options 	GEOM_LABEL	# Provides labelization
 options 	INCLUDE_CONFIG_FILE     # Include this file in kernel

Modified: head/sys/mips/conf/OCTEON1
==============================================================================
--- head/sys/mips/conf/OCTEON1	Sat Mar 19 14:44:24 2011	(r219774)
+++ head/sys/mips/conf/OCTEON1	Sat Mar 19 15:50:34 2011	(r219775)
@@ -73,7 +73,6 @@ options 	PRINTF_BUFR_SIZE=128	# Prevent 
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework
-options 	FLOWTABLE		# per-cpu routing cache
 #options 	KDTRACE_FRAME		# Ensure frames are compiled in
 #options 	KDTRACE_HOOKS		# Kernel DTrace hooks
 options 	INCLUDE_CONFIG_FILE     # Include this file in kernel

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 16:52:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9019B106568C;
	Sat, 19 Mar 2011 16:52: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 8327E8FC17;
	Sat, 19 Mar 2011 16:52: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 p2JGq6d1028960;
	Sat, 19 Mar 2011 16:52:06 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JGq6qb028958;
	Sat, 19 Mar 2011 16:52:06 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103191652.p2JGq6qb028958@svn.freebsd.org>
From: Dmitry Chagin 
Date: Sat, 19 Mar 2011 16:52:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219776 - head/sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 16:52:06 -0000

Author: dchagin
Date: Sat Mar 19 16:52:06 2011
New Revision: 219776
URL: http://svn.freebsd.org/changeset/base/219776

Log:
  Remove a now unused variable.
  
  MFC after:	1 Week

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Sat Mar 19 15:50:34 2011	(r219775)
+++ head/sys/net/route.c	Sat Mar 19 16:52:06 2011	(r219776)
@@ -338,7 +338,6 @@ rtalloc1_fib(struct sockaddr *dst, int r
 		    u_int fibnum)
 {
 	struct radix_node_head *rnh;
-	struct rtentry *rt;
 	struct radix_node *rn;
 	struct rtentry *newrt;
 	struct rt_addrinfo info;
@@ -366,7 +365,7 @@ rtalloc1_fib(struct sockaddr *dst, int r
 #endif
 	rn = rnh->rnh_matchaddr(dst, rnh);
 	if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
-		newrt = rt = RNTORT(rn);
+		newrt = RNTORT(rn);
 		RT_LOCK(newrt);
 		RT_ADDREF(newrt);
 		if (needlock)

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 19:08:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 61CB3106566B;
	Sat, 19 Mar 2011 19:08:54 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 593988FC0A;
	Sat, 19 Mar 2011 19:08: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 p2JJ8s8h032276;
	Sat, 19 Mar 2011 19:08:54 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JJ8sk2032274;
	Sat, 19 Mar 2011 19:08:54 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201103191908.p2JJ8sk2032274@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 19 Mar 2011 19:08:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219779 - head/sys/netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 19:08:54 -0000

Author: bz
Date: Sat Mar 19 19:08:54 2011
New Revision: 219779
URL: http://svn.freebsd.org/changeset/base/219779

Log:
  Properly check for an IPv4 socket after r219579.
  
  In some cases as udp6_connect() without an earlier bind(2) to an
  address, v4-mapped scokets allowed and a non mapped destination
  address, we can end up here with both v4 and v6 indicated:
  	inp_vflag = (INP_IPV4|INP_IPV6|INP_IPV6PROTO)
  
  In that case however laddrp is NULL as the IPv6 path does not
  pass in a copy currently.
  
  Reported by:	Pawel Worach (pawel.worach gmail.com)
  Tested by:	Pawel Worach (pawel.worach gmail.com)
  MFC after:	6 days
  X-MFC with:	r219579

Modified:
  head/sys/netinet/in_pcb.c

Modified: head/sys/netinet/in_pcb.c
==============================================================================
--- head/sys/netinet/in_pcb.c	Sat Mar 19 18:26:54 2011	(r219778)
+++ head/sys/netinet/in_pcb.c	Sat Mar 19 19:08:54 2011	(r219779)
@@ -387,7 +387,7 @@ in_pcb_lport(struct inpcb *inp, struct i
 #ifdef INET
 	/* Make the compiler happy. */
 	laddr.s_addr = 0;
-	if ((inp->inp_vflag & INP_IPV4) != 0) {
+	if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) {
 		KASSERT(laddrp != NULL, ("%s: laddrp NULL for v4 inp %p",
 		    __func__, inp));
 		laddr = *laddrp;
@@ -423,7 +423,7 @@ in_pcb_lport(struct inpcb *inp, struct i
 	} while (tmpinp != NULL);
 
 #ifdef INET
-	if ((inp->inp_vflag & INP_IPV4) != 0)
+	if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4)
 		laddrp->s_addr = laddr.s_addr;
 #endif                 
 	*lportp = lport;

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 19:30:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD1671065670;
	Sat, 19 Mar 2011 19:30:49 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D415A8FC16;
	Sat, 19 Mar 2011 19:30: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 p2JJUnKx032749;
	Sat, 19 Mar 2011 19:30:49 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JJUnrm032747;
	Sat, 19 Mar 2011 19:30:49 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103191930.p2JJUnrm032747@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 19 Mar 2011 19:30:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219780 - head/sys/sparc64/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 19:30:50 -0000

Author: marius
Date: Sat Mar 19 19:30:49 2011
New Revision: 219780
URL: http://svn.freebsd.org/changeset/base/219780

Log:
  In case reading PCIR_MINGNT fails don't use it for calculating the
  latency. This is more or less a theoretical problem though as it
  typically indicates way bigger problems.

Modified:
  head/sys/sparc64/pci/ofw_pcibus.c

Modified: head/sys/sparc64/pci/ofw_pcibus.c
==============================================================================
--- head/sys/sparc64/pci/ofw_pcibus.c	Sat Mar 19 19:08:54 2011	(r219779)
+++ head/sys/sparc64/pci/ofw_pcibus.c	Sat Mar 19 19:30:49 2011	(r219780)
@@ -165,7 +165,7 @@ ofw_pcibus_setup_device(device_t bridge,
 		CS_WRITE(PCIR_SECLAT_1, reg, 1);
 	} else {
 		reg = CS_READ(PCIR_MINGNT, 1);
-		if (reg != 0) {
+		if ((int)reg > 0) {
 			switch (clock) {
 			case 33000000:
 				reg *= 8;

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 19:37:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D104C106564A;
	Sat, 19 Mar 2011 19:37:53 +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 C7DDA8FC08;
	Sat, 19 Mar 2011 19:37: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 p2JJbrTE032918;
	Sat, 19 Mar 2011 19:37:53 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JJbrBs032916;
	Sat, 19 Mar 2011 19:37:53 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201103191937.p2JJbrBs032916@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Sat, 19 Mar 2011 19:37:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219781 - head/sys/netgraph
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 19:37:53 -0000

Author: glebius
Date: Sat Mar 19 19:37:53 2011
New Revision: 219781
URL: http://svn.freebsd.org/changeset/base/219781

Log:
  Remove spl(9) remnants.

Modified:
  head/sys/netgraph/ng_iface.c

Modified: head/sys/netgraph/ng_iface.c
==============================================================================
--- head/sys/netgraph/ng_iface.c	Sat Mar 19 19:30:49 2011	(r219780)
+++ head/sys/netgraph/ng_iface.c	Sat Mar 19 19:37:53 2011	(r219781)
@@ -286,12 +286,11 @@ static int
 ng_iface_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
 {
 	struct ifreq *const ifr = (struct ifreq *) data;
-	int s, error = 0;
+	int error = 0;
 
 #ifdef DEBUG
 	ng_iface_print_ioctl(ifp, command, data);
 #endif
-	s = splimp();
 	switch (command) {
 
 	/* These two are mostly handled at a higher layer */
@@ -343,7 +342,6 @@ ng_iface_ioctl(struct ifnet *ifp, u_long
 		error = EINVAL;
 		break;
 	}
-	(void) splx(s);
 	return (error);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 19:39:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1ED91106564A;
	Sat, 19 Mar 2011 19:39:06 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 159988FC08;
	Sat, 19 Mar 2011 19:39: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 p2JJd52D032975;
	Sat, 19 Mar 2011 19:39:05 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JJd5H5032973;
	Sat, 19 Mar 2011 19:39:05 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103191939.p2JJd5H5032973@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 19 Mar 2011 19:39:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219782 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 19:39:06 -0000

Author: marius
Date: Sat Mar 19 19:39:05 2011
New Revision: 219782
URL: http://svn.freebsd.org/changeset/base/219782

Log:
  On Serengeti-class machines the OFW root isn't the parent of the CPU
  nodes.

Modified:
  head/sys/sparc64/sparc64/tick.c

Modified: head/sys/sparc64/sparc64/tick.c
==============================================================================
--- head/sys/sparc64/sparc64/tick.c	Sat Mar 19 19:37:53 2011	(r219781)
+++ head/sys/sparc64/sparc64/tick.c	Sat Mar 19 19:39:05 2011	(r219782)
@@ -158,8 +158,8 @@ cpu_initclocks(void)
 	sclock = 0;
 	if (PCPU_GET(impl) == CPU_IMPL_SPARC64V ||
 	    PCPU_GET(impl) >= CPU_IMPL_ULTRASPARCIII) {
-		if (OF_getprop(OF_parent(PCPU_GET(node)), "stick-frequency",
-		    &sclock, sizeof(sclock)) == -1) {
+		if (OF_getprop(OF_peer(0), "stick-frequency", &sclock,
+		    sizeof(sclock)) == -1) {
 			panic("%s: could not determine STICK frequency",
 			    __func__);
 		}

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 19:50:37 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 278EF1065670;
	Sat, 19 Mar 2011 19:50:37 +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 1E5548FC1E;
	Sat, 19 Mar 2011 19:50:37 +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 p2JJoauq033227;
	Sat, 19 Mar 2011 19:50:36 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JJoajG033225;
	Sat, 19 Mar 2011 19:50:36 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103191950.p2JJoajG033225@svn.freebsd.org>
From: Dmitry Chagin 
Date: Sat, 19 Mar 2011 19:50:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219783 - head/sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 19:50:37 -0000

Author: dchagin
Date: Sat Mar 19 19:50:36 2011
New Revision: 219783
URL: http://svn.freebsd.org/changeset/base/219783

Log:
  A bit rearranged rtalloc1_fib() code.
  Initialize a variable when it is really needed.
  To avoid code duplication move the miss label to line up and jump on it.
  
  MFC after:	1 Week

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Sat Mar 19 19:39:05 2011	(r219782)
+++ head/sys/net/route.c	Sat Mar 19 19:50:36 2011	(r219783)
@@ -348,14 +348,13 @@ rtalloc1_fib(struct sockaddr *dst, int r
 	if (dst->sa_family != AF_INET)	/* Only INET supports > 1 fib now */
 		fibnum = 0;
 	rnh = rt_tables_get_rnh(fibnum, dst->sa_family);
-	newrt = NULL;
+	if (rnh == NULL)
+		goto miss;
+
 	/*
 	 * Look up the address in the table for that Address Family
 	 */
-	if (rnh == NULL) {
-		V_rtstat.rts_unreach++;
-		goto miss;
-	}
+	newrt = NULL;
 	needlock = !(ignflags & RTF_RNH_LOCKED);
 	if (needlock)
 		RADIX_NODE_HEAD_RLOCK(rnh);
@@ -380,8 +379,9 @@ rtalloc1_fib(struct sockaddr *dst, int r
 	 * Which basically means
 	 * "caint get there frm here"
 	 */
-	V_rtstat.rts_unreach++;
 miss:
+	V_rtstat.rts_unreach++;
+
 	if (report) {
 		/*
 		 * If required, report the failure to the supervising

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 20:36:05 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B35C106564A;
	Sat, 19 Mar 2011 20:36:05 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 568EF8FC0A;
	Sat, 19 Mar 2011 20:36:05 +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 p2JKa5bk034259;
	Sat, 19 Mar 2011 20:36:05 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JKa53G034257;
	Sat, 19 Mar 2011 20:36:05 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103192036.p2JKa53G034257@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 19 Mar 2011 20:36:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219785 - head/sys/sparc64/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 20:36:05 -0000

Author: marius
Date: Sat Mar 19 20:36:05 2011
New Revision: 219785
URL: http://svn.freebsd.org/changeset/base/219785

Log:
  - Make a panic message better reflect the actual problem.
  - A closer inspection of the OpenSolaris code indicates the block store
    workaround is only necessary in case of BUS_DMASYNC_POSTREAD.
  - Mark some unused parameters as such.

Modified:
  head/sys/sparc64/pci/fire.c

Modified: head/sys/sparc64/pci/fire.c
==============================================================================
--- head/sys/sparc64/pci/fire.c	Sat Mar 19 19:58:09 2011	(r219784)
+++ head/sys/sparc64/pci/fire.c	Sat Mar 19 20:36:05 2011	(r219785)
@@ -337,7 +337,7 @@ fire_attach(device_t dev)
 	if (OF_getprop(node, "portid", &sc->sc_ign, sizeof(sc->sc_ign)) == -1)
 		panic("%s: could not determine IGN", __func__);
 	if (OF_getprop(node, "module-revision#", &prop, sizeof(prop)) == -1)
-		panic("%s: could not determine revision", __func__);
+		panic("%s: could not determine module-revision", __func__);
 
 	device_printf(dev, "%s, module-revision %d, IGN %#x\n",
 	    desc->fd_name, prop, sc->sc_ign);
@@ -1510,18 +1510,20 @@ fire_dmamap_sync(bus_dma_tag_t dt __unus
 	static u_char buf[VIS_BLOCKSIZE] __aligned(VIS_BLOCKSIZE);
 	register_t reg, s;
 
-	if ((map->dm_flags & DMF_LOADED) == 0 ||
-	    (op & ~BUS_DMASYNC_POSTWRITE) == 0)
+	if ((map->dm_flags & DMF_LOADED) == 0)
 		return;
 
-	s = intr_disable();
-	reg = rd(fprs);
-	wr(fprs, reg | FPRS_FEF, 0);
-	__asm __volatile("stda %%f0, [%0] %1"
-	    : : "r" (buf), "n" (ASI_BLK_COMMIT_S));
-	membar(Sync);
-	wr(fprs, reg, 0);
-	intr_restore(s);
+	if ((op & BUS_DMASYNC_POSTREAD) != 0) {
+		s = intr_disable();
+		reg = rd(fprs);
+		wr(fprs, reg | FPRS_FEF, 0);
+		__asm __volatile("stda %%f0, [%0] %1"
+		    : : "r" (buf), "n" (ASI_BLK_COMMIT_S));
+		membar(Sync);
+		wr(fprs, reg, 0);
+		intr_restore(s);
+	} else if ((op & BUS_DMASYNC_PREWRITE) != 0)
+		membar(Sync);
 }
 
 static void
@@ -2128,7 +2130,7 @@ fire_release_resource(device_t bus, devi
 }
 
 static bus_dma_tag_t
-fire_get_dma_tag(device_t bus, device_t child)
+fire_get_dma_tag(device_t bus, device_t child __unused)
 {
 	struct fire_softc *sc;
 
@@ -2137,7 +2139,7 @@ fire_get_dma_tag(device_t bus, device_t 
 }
 
 static phandle_t
-fire_get_node(device_t bus, device_t dev)
+fire_get_node(device_t bus, device_t child __unused)
 {
 	struct fire_softc *sc;
 

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 21:10:57 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99B7D106564A;
	Sat, 19 Mar 2011 21:10:57 +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 8E6CF8FC12;
	Sat, 19 Mar 2011 21:10: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 p2JLAvl2034965;
	Sat, 19 Mar 2011 21:10:57 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JLAvHE034963;
	Sat, 19 Mar 2011 21:10:57 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103192110.p2JLAvHE034963@svn.freebsd.org>
From: Dmitry Chagin 
Date: Sat, 19 Mar 2011 21:10:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219786 - head/sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 21:10:57 -0000

Author: dchagin
Date: Sat Mar 19 21:10:57 2011
New Revision: 219786
URL: http://svn.freebsd.org/changeset/base/219786

Log:
  ouch, newrt is used on the return path, my fault.
  Partialy revert the previous change.
  
  MFC after:	1 Week.

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Sat Mar 19 20:36:05 2011	(r219785)
+++ head/sys/net/route.c	Sat Mar 19 21:10:57 2011	(r219786)
@@ -348,13 +348,13 @@ rtalloc1_fib(struct sockaddr *dst, int r
 	if (dst->sa_family != AF_INET)	/* Only INET supports > 1 fib now */
 		fibnum = 0;
 	rnh = rt_tables_get_rnh(fibnum, dst->sa_family);
+	newrt = NULL;
 	if (rnh == NULL)
 		goto miss;
 
 	/*
 	 * Look up the address in the table for that Address Family
 	 */
-	newrt = NULL;
 	needlock = !(ignflags & RTF_RNH_LOCKED);
 	if (needlock)
 		RADIX_NODE_HEAD_RLOCK(rnh);

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 22:36:59 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5AAB106564A;
	Sat, 19 Mar 2011 22:36: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 C8C768FC1A;
	Sat, 19 Mar 2011 22:36: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 p2JMaxi5036709;
	Sat, 19 Mar 2011 22:36:59 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JMaxEn036706;
	Sat, 19 Mar 2011 22:36:59 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201103192236.p2JMaxEn036706@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Sat, 19 Mar 2011 22:36:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219787 - head/sys/dev/vte
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 22:36:59 -0000

Author: yongari
Date: Sat Mar 19 22:36:59 2011
New Revision: 219787
URL: http://svn.freebsd.org/changeset/base/219787

Log:
  Correct broadcast frame handling. Setting bit6 of MCR0 register
  enables broadcast filtering. Make sure to clear the bit to receive
  broadcast frames. While I'm here rename the bit definition to
  reflect reality.
  
  Reported by:	brad@OpenBSD
  MFC after:	1 week

Modified:
  head/sys/dev/vte/if_vte.c
  head/sys/dev/vte/if_vtereg.h

Modified: head/sys/dev/vte/if_vte.c
==============================================================================
--- head/sys/dev/vte/if_vte.c	Sat Mar 19 21:10:57 2011	(r219786)
+++ head/sys/dev/vte/if_vte.c	Sat Mar 19 22:36:59 2011	(r219787)
@@ -1963,9 +1963,10 @@ vte_rxfilter(struct vte_softc *sc)
 	}
 
 	mcr = CSR_READ_2(sc, VTE_MCR0);
-	mcr &= ~(MCR0_PROMISC | MCR0_BROADCAST | MCR0_MULTICAST);
+	mcr &= ~(MCR0_PROMISC | MCR0_MULTICAST);
+	mcr |= MCR0_BROADCAST_DIS;
 	if ((ifp->if_flags & IFF_BROADCAST) != 0)
-		mcr |= MCR0_BROADCAST;
+		mcr &= ~MCR0_BROADCAST_DIS;
 	if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
 		if ((ifp->if_flags & IFF_PROMISC) != 0)
 			mcr |= MCR0_PROMISC;

Modified: head/sys/dev/vte/if_vtereg.h
==============================================================================
--- head/sys/dev/vte/if_vtereg.h	Sat Mar 19 21:10:57 2011	(r219786)
+++ head/sys/dev/vte/if_vtereg.h	Sat Mar 19 22:36:59 2011	(r219787)
@@ -48,7 +48,7 @@
 #define	MCR0_ACCPT_LONG_PKT		0x0008
 #define	MCR0_ACCPT_DRIBBLE		0x0010
 #define	MCR0_PROMISC			0x0020
-#define	MCR0_BROADCAST			0x0040
+#define	MCR0_BROADCAST_DIS		0x0040
 #define	MCR0_RX_EARLY_INTR		0x0080
 #define	MCR0_MULTICAST			0x0100
 #define	MCR0_FC_ENB			0x0200

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 23:06:18 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 73BFE1065672;
	Sat, 19 Mar 2011 23:06:18 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 46D5D8FC13;
	Sat, 19 Mar 2011 23:06: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 p2JN6IhN037427;
	Sat, 19 Mar 2011 23:06:18 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2JN6Inv037425;
	Sat, 19 Mar 2011 23:06:18 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103192306.p2JN6Inv037425@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 19 Mar 2011 23:06:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219788 - head/release
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 23:06:18 -0000

Author: nwhitehorn
Date: Sat Mar 19 23:06:17 2011
New Revision: 219788
URL: http://svn.freebsd.org/changeset/base/219788

Log:
  Add support for checking out ports and doc trees from a CVS repository,
  in addition to CVSUP, and add support for alternate SVN roots for src.
  
  Requested by:	jhb

Modified:
  head/release/generate-release.sh

Modified: head/release/generate-release.sh
==============================================================================
--- head/release/generate-release.sh	Sat Mar 19 22:36:59 2011	(r219787)
+++ head/release/generate-release.sh	Sat Mar 19 23:06:17 2011	(r219788)
@@ -7,8 +7,12 @@
 #
 # Environment variables:
 #  CVSUP_HOST: Host of a cvsup server to obtain the ports and documentation
-#   trees. Must be set to include ports and documentation.
-#  CVSUP_TAG:  CVS tag for ports and documentation (HEAD by default)
+#   trees. This or CVSROOT must be set to include ports and documentation.
+#  CVSROOT:    CVS root to obtain the ports and documentation trees. This or
+#   CVSUP_HOST must be set to include ports and documentation.
+#  CVS_TAG:    CVS tag for ports and documentation (HEAD by default)
+#  SVNROOT:    SVN URL to FreeBSD source repository (by default, 
+#   svn://svn.freebsd.org/base)
 #  MAKE_FLAGS: optional flags to pass to make (e.g. -j)
 # 
 #  Note: Since this requires a chroot, release cross-builds will not work!
@@ -17,20 +21,22 @@
 #
 
 mkdir -p $2/usr/src
-svn co svn://svn.freebsd.org/base/$1 $2/usr/src || exit 1
+svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src || exit 1
 if [ ! -z $CVSUP_HOST ]; then
 	cat > $2/docports-supfile << EOF
 	*default host=$CVSUP_HOST
 	*default base=/var/db
 	*default prefix=/usr
-	*default release=cvs tag=${CVSUP_TAG:-.}
+	*default release=cvs tag=${CVS_TAG:-.}
 	*default delete use-rel-suffix
 	*default compress
 	ports-all
 	doc-all
 EOF
-else
-	RELEASE_FLAGS="-DNOPORTS -DNODOC"
+elif [ ! -z $CVSROOT ]; then
+	cd $2/usr
+	cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} ports || exit 1
+	cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} doc || exit 1
 fi
 
 cd $2/usr/src
@@ -43,6 +49,10 @@ if [ ! -z $CVSUP_HOST ]; then 
 
 	# Checkout ports and doc trees
 	chroot $2 /usr/bin/csup /docports-supfile || exit 1
+fi
+
+if [ -d $2/usr/doc ]; then 
+	cp /etc/resolv.conf $2/etc/resolv.conf
 
 	# Build ports to build the docs, then build the docs
 	chroot $2 /bin/sh -c 'pkg_add -r docproj || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' || exit 1
@@ -50,7 +60,7 @@ if [ ! -z $CVSUP_HOST ]; then 
 fi
 
 chroot $2 /bin/sh -c "cd /usr/src && make $MAKE_FLAGS buildworld buildkernel" || exit 1
-chroot $2 /bin/sh -c "cd /usr/src/release && make obj release $RELEASE_FLAGS" || exit 1
+chroot $2 /bin/sh -c "cd /usr/src/release && make obj release" || exit 1
 mkdir $2/R
 cp -pRP $2/usr/obj/usr/src/release/release.iso $2/usr/obj/usr/src/release/memstick $2/usr/obj/usr/src/release/ftp $2/R
 

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 23:10:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6683F1065670;
	Sat, 19 Mar 2011 23:10:43 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 8062B8FC12;
	Sat, 19 Mar 2011 23:10:42 +0000 (UTC)
Received: by wwc33 with SMTP id 33so6153636wwc.31
	for ; Sat, 19 Mar 2011 16:10:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=QzFR7jbGGmCp4pyx8fe4crpkWgfB2S39y/hPO755tnw=;
	b=e1LaaaJ38SfesQ+kwpeErV52rnr6h65XLzVeNEP0yONm8XHcdeb1jhZhWknrDwMg5a
	pbdIcdGtRsREkoQnBd/TqUZ3oTn6+iTm4U6Arn8azuIYAM3krP7AzpHnzSp0RzA3BFru
	VVxcPe4cLy5/jPtaRpXISrvfpOsMWafFbM2RE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=v6TOMe65nyVf03upThYKPMS5lYhzzYaqLuEgEAzTZ3I3wU58l7tvdkCzwwFs7c/wH4
	URcQV0HlYiJvo0rMoHw4xVFwrpnmqDPunf/PfbHqHpGuBO4fMOQq5lyjz8kn0b6zGatT
	u/UFOWsUUcnm+OZZUPf++scRNesTQtXLShw5o=
MIME-Version: 1.0
Received: by 10.216.191.208 with SMTP id g58mr2435093wen.85.1300576240630;
	Sat, 19 Mar 2011 16:10:40 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.173.142 with HTTP; Sat, 19 Mar 2011 16:10:40 -0700 (PDT)
In-Reply-To: <201103192306.p2JN6Inv037425@svn.freebsd.org>
References: <201103192306.p2JN6Inv037425@svn.freebsd.org>
Date: Sat, 19 Mar 2011 16:10:40 -0700
X-Google-Sender-Auth: OCqNFsZEztqUc3b8IzeKloib2hk
Message-ID: 
From: Garrett Cooper 
To: Nathan Whitehorn 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219788 - head/release
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 23:10:43 -0000

On Sat, Mar 19, 2011 at 4:06 PM, Nathan Whitehorn
 wrote:
> Author: nwhitehorn
> Date: Sat Mar 19 23:06:17 2011
> New Revision: 219788
> URL: http://svn.freebsd.org/changeset/base/219788
>
> Log:
> =A0Add support for checking out ports and doc trees from a CVS repository=
,
> =A0in addition to CVSUP, and add support for alternate SVN roots for src.
>
> =A0Requested by: jhb

Although this seems good and all, wouldn't it make sense to split off
the pulling infrastructure into separate scripts so that someone could
have hooks to do:

- pre-pull (create paths, whatever)
- pull
- post-pull (patch?)

That way someone could choose any arbitrary SCM (git, hg, etc),
specify necessary configuration files, and apply local patches as
necessary.
Thanks,
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 19 23:17:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B02E1106564A;
	Sat, 19 Mar 2011 23:17:31 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DC578FC13;
	Sat, 19 Mar 2011 23:17:31 +0000 (UTC)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mail.icecube.wisc.edu (Postfix) with ESMTP id 153FE58139;
	Sat, 19 Mar 2011 18:17:31 -0500 (CDT)
X-Virus-Scanned: amavisd-new at icecube.wisc.edu
Received: from mail.icecube.wisc.edu ([127.0.0.1])
	by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new,
	port 10030)
	with ESMTP id 8qYguNIo+J5M; Sat, 19 Mar 2011 18:17:31 -0500 (CDT)
Received: from wanderer.tachypleus.net (unknown [76.210.65.155])
	by mail.icecube.wisc.edu (Postfix) with ESMTP id 6AEF358135;
	Sat, 19 Mar 2011 18:17:30 -0500 (CDT)
Message-ID: <4D85398A.7020008@freebsd.org>
Date: Sat, 19 Mar 2011 18:17:30 -0500
From: Nathan Whitehorn 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.15) Gecko/20110317 Thunderbird/3.1.9
MIME-Version: 1.0
To: Garrett Cooper 
References: <201103192306.p2JN6Inv037425@svn.freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219788 - head/release
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 19 Mar 2011 23:17:31 -0000

On 03/19/11 18:10, Garrett Cooper wrote:
> On Sat, Mar 19, 2011 at 4:06 PM, Nathan Whitehorn
>   wrote:
>> Author: nwhitehorn
>> Date: Sat Mar 19 23:06:17 2011
>> New Revision: 219788
>> URL: http://svn.freebsd.org/changeset/base/219788
>>
>> Log:
>>   Add support for checking out ports and doc trees from a CVS repository,
>>   in addition to CVSUP, and add support for alternate SVN roots for src.
>>
>>   Requested by: jhb
>
> Although this seems good and all, wouldn't it make sense to split off
> the pulling infrastructure into separate scripts so that someone could
> have hooks to do:
>
> - pre-pull (create paths, whatever)
> - pull
> - post-pull (patch?)
>
> That way someone could choose any arbitrary SCM (git, hg, etc),
> specify necessary configuration files, and apply local patches as
> necessary.
> Thanks,
> -Garrett

That's pretty much the point of having generate-release.sh be a 
different thing from 'make release'. You'll note that the script is very 
short (36 lines of code, a good chunk of which are an inline supfile), 
and could easily be adapted to suit any SCM. All it does is:

1. Check out source code
2. Build and install world into a chroot
3. Optionally check out doc/ports and install docproj ports
4. Run make release in the chroot

The regular make release stuff only cares that src(/doc/ports) have 
shown up somehow on the host system and is well suited to the local 
patches or nonstandard SCM case.
-Nathan