From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 02:16:23 2012 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 63BDF1065705; Sun, 19 Aug 2012 02:16:23 +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 4E88C8FC12; Sun, 19 Aug 2012 02:16:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J2GNVq012943; Sun, 19 Aug 2012 02:16:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J2GNq8012941; Sun, 19 Aug 2012 02:16:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208190216.q7J2GNq8012941@svn.freebsd.org> From: Adrian Chadd Date: Sun, 19 Aug 2012 02: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: r239380 - 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, 19 Aug 2012 02:16:23 -0000 Author: adrian Date: Sun Aug 19 02:16:22 2012 New Revision: 239380 URL: http://svn.freebsd.org/changeset/base/239380 Log: When assembling the descriptor list, make sure that the "first" descriptor is marked correctly. The existing logic assumed that the first descriptor is i == 0, which doesn't hold for EDMA TX. In this instance, the first time filltxdesc() is called can be up to i == 3. So for a two-buffer descriptor: * firstSeg is set to 0; * lastSeg is set to 1; * the ath_hal_filltxdesc() code will treat it as the last segment in a descriptor chain and blank some of the descriptor fields, causing the TX to stop. When firstSeg is set to 1 (regardless of lastSeg), it overrides the lastSeg setting. Thus, ath_hal_filltxdesc() won't blank out these fields. Tested: AR9380, STA mode. With this, association is successful. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat Aug 18 23:28:34 2012 (r239379) +++ head/sys/dev/ath/if_ath_tx.c Sun Aug 19 02:16:22 2012 (r239380) @@ -306,6 +306,7 @@ ath_tx_chaindesclist(struct ath_softc *s HAL_DMA_ADDR bufAddrList[4]; uint32_t segLenList[4]; int numTxMaps = 1; + int isFirstDesc = 1; /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -369,10 +370,11 @@ ath_tx_chaindesclist(struct ath_softc *s , segLenList , bf->bf_descid /* XXX desc id */ , bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */ - , i == 0 /* first segment */ + , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ , ds0 /* first descriptor */ ); + isFirstDesc = 0; DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %d: %08x %08x %08x %08x %08x %08x\n", __func__, i, ds->ds_link, ds->ds_data, From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 02:22:17 2012 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 1F08C106564A; Sun, 19 Aug 2012 02:22:17 +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 F414B8FC0A; Sun, 19 Aug 2012 02:22:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J2MG30013627; Sun, 19 Aug 2012 02:22:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J2MGJU013624; Sun, 19 Aug 2012 02:22:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208190222.q7J2MGJU013624@svn.freebsd.org> From: Adrian Chadd Date: Sun, 19 Aug 2012 02:22: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: r239381 - in 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: Sun, 19 Aug 2012 02:22:17 -0000 Author: adrian Date: Sun Aug 19 02:22:16 2012 New Revision: 239381 URL: http://svn.freebsd.org/changeset/base/239381 Log: Extend the TX descriptor debug printing to be properly aware of EDMA code. * create a new TX EDMA descriptor struct to represent TX EDMA descriptors when doing debugging; * implement an EDMA printing function which: + hardcodes the TX map size to 4 for now; + correctly prints out the number of segments - there's one descriptor for up to 4 buffers (segments), not one for each segment; + print out 4 DS buffer and len pointers; + print out the correct number of DWORDs in the TX descriptor. TODO: * Remove all of the hard-coded stuff. Ew. Modified: head/sys/dev/ath/ath_hal/ah_desc.h head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Sun Aug 19 02:16:22 2012 (r239380) +++ head/sys/dev/ath/ath_hal/ah_desc.h Sun Aug 19 02:22:16 2012 (r239381) @@ -223,6 +223,12 @@ struct ath_desc { uint32_t ds_hw[HAL_DESC_HW_SIZE]; /* opaque h/w region */ }; +struct ath_desc_txedma { + uint32_t ds_info; + uint32_t ds_link; + uint32_t ds_hw[21]; /* includes buf/len */ +}; + struct ath_desc_status { union { struct ath_tx_status tx;/* xmit status */ Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Sun Aug 19 02:16:22 2012 (r239380) +++ head/sys/dev/ath/if_ath_debug.c Sun Aug 19 02:22:16 2012 (r239381) @@ -132,8 +132,72 @@ ath_printrxbuf(struct ath_softc *sc, con } } -void -ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *first_bf, +static void +ath_printtxbuf_edma(struct ath_softc *sc, const struct ath_buf *first_bf, + u_int qnum, u_int ix, int done) +{ + const struct ath_tx_status *ts = + &first_bf->bf_last->bf_status.ds_txstat; + const struct ath_buf *bf = first_bf; + const char *ds; + const struct ath_desc_txedma *eds; + int i, n; + + /* + * Assume the TX map size is 4 for now and only walk + * the appropriate number of segments. + */ + n = bf->bf_nseg / 4; + if (n == 0) + n = 1; + + printf("Q%u[%3u]", qnum, ix); + while (bf != NULL) { + /* + * XXX For now, assume the txmap size is 4. + */ + for (i = 0, ds = (const char *) bf->bf_desc; + i < n; + i ++, ds += sc->sc_tx_desclen) { + eds = (const struct ath_desc_txedma *) ds; + printf(" (DS.V:%p DS.P:%p) I: %08x L:%08x F:%04x%s\n", + eds, (const struct ath_desc *)bf->bf_daddr + i, + eds->ds_info, eds->ds_link, + bf->bf_state.bfs_txflags, + !done ? "" : (ts->ts_status == 0) ? " *" : " !"); + printf(" (D[0] = %08x(%08x), D[1] = %08x(%08x)\n", + eds->ds_hw[0], eds->ds_hw[1], + eds->ds_hw[2], eds->ds_hw[3]); + printf(" (D[2] = %08x(%08x), D[3] = %08x(%08x)\n", + eds->ds_hw[4], eds->ds_hw[5], + eds->ds_hw[6], eds->ds_hw[7]); + printf(" Seq: %d swtry: %d ADDBAW?: %d DOBAW?: %d\n", + bf->bf_state.bfs_seqno, + bf->bf_state.bfs_retries, + bf->bf_state.bfs_addedbaw, + bf->bf_state.bfs_dobaw); + printf(" %08x %08x %08x %08x %08x %08x\n", + eds->ds_hw[8], eds->ds_hw[9], + eds->ds_hw[10], eds->ds_hw[11], + eds->ds_hw[12], eds->ds_hw[13]); + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + eds->ds_hw[14], eds->ds_hw[15], eds->ds_hw[16], + eds->ds_hw[17], eds->ds_hw[18], eds->ds_hw[19], + eds->ds_hw[20], eds->ds_hw[21]); +#if 0 + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[22],ds->ds_hw[23],ds->ds_hw[24], + ds->ds_hw[25],ds->ds_hw[26],ds->ds_hw[27], + ds->ds_hw[28], ds->ds_hw[29]); +#endif + } + printf(" [end]\n"); + bf = bf->bf_next; + } +} + +static void +ath_printtxbuf_legacy(struct ath_softc *sc, const struct ath_buf *first_bf, u_int qnum, u_int ix, int done) { const struct ath_tx_status *ts = &first_bf->bf_last->bf_status.ds_txstat; @@ -158,8 +222,7 @@ ath_printtxbuf(struct ath_softc *sc, con ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]); - if (ah->ah_magic == 0x20065416 || - ah->ah_magic == 0x19741014) { + if (ah->ah_magic == 0x20065416) { printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6], ds->ds_hw[7], ds->ds_hw[8], ds->ds_hw[9], @@ -175,4 +238,14 @@ ath_printtxbuf(struct ath_softc *sc, con } } +void +ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *first_bf, + u_int qnum, u_int ix, int done) +{ + if (sc->sc_ah->ah_magic == 0x19741014) + ath_printtxbuf_edma(sc, first_bf, qnum, ix, done); + else + ath_printtxbuf_legacy(sc, first_bf, qnum, ix, done); +} + #endif /* ATH_DEBUG */ From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 03:00:53 2012 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 62FAD1065678; Sun, 19 Aug 2012 03:00:53 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id 29A4B8FC15; Sun, 19 Aug 2012 03:00:52 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M8Z0084RF18NH10@smtp3.clear.net.nz>; Sun, 19 Aug 2012 15:00:46 +1200 (NZST) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Sun, 19 Aug 2012 15:00:45 +1200 Date: Sun, 19 Aug 2012 15:00:22 +1200 From: Andrew Turner In-reply-to: <201208121753.q7CHr7VU017178@svn.freebsd.org> To: Hans Petter Selasky Message-id: <20120819150022.3c583fef@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <201208121753.q7CHr7VU017178@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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: Sun, 19 Aug 2012 03:00:53 -0000 Hello, This commit causes issues for me on my AT91 board. I get messages similar to the following: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 0 0 5f d1 a0 0 0 1d 0 (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (da0:umass-sim0:0:0:0): Retrying command (da0:umass-sim0:0:0:0): WRITE(10). CDB: 2a 0 0 0 7 e0 0 0 8 0 (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (da0:umass-sim0:0:0:0): Retrying command Other people are getting similar messages on different ARM cpus. Andrew From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 07:39:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA189106566B; Sun, 19 Aug 2012 07:39:21 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from smtp01-out.isp.tdc.no (smtp01-out.isp.tdc.no [85.19.210.243]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1348FC19; Sun, 19 Aug 2012 07:39:20 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [85.19.79.136]) by smtp01-out.isp.tdc.no (Postfix) with ESMTP id 3X094k5LZsz395; Sun, 19 Aug 2012 09:38:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bitfrost.no From: =?windows-1252?Q?Hans_Petter_Selasky?= To: =?windows-1252?Q?Hans_Petter_Selasky?= , =?windows-1252?Q?Andrew_Turner?= Date: Sun, 19 Aug 2012 09:39:11 +0200 Mime-Version: 1.0 In-Reply-To: <20120819150022.3c583fef@fubar.geek.nz> References: <20120819150022.3c583fef@fubar.geek.nz> X-Priority: 3 (Normal) Message-Id: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "=?windows-1252?Q?svn-src-head=40freebsd.org?=" , "=?windows-1252?Q?svn-src-all=40freebsd.org?=" , "=?windows-1252?Q?src-committers=40freebsd.org?=" Subject: RE: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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: Sun, 19 Aug 2012 07:39:21 -0000 Hi,=0D=0A=0D=0A=A0=0D=0A=0D=0AHave you stepped the versions=3F=0D=0A=0D=0A= =A0=0D=0A=0D=0AAre you sure it is exactly this commit=3F=0D=0A=0D=0A=A0=0D= =0A=0D=0A--HPS=0D=0A-----Original message-----=0D=0AFrom:Andrew Turner =0D=0ASent:Sun 19-08-2012 05:01=0D=0ASubject:Re: svn = commit: r239214 - in head/sys: dev/usb dev/usb/controller sys=0D=0ATo:Han= s Petter Selasky ;=20=0D=0ACC:src-committers@freebs= d.org; svn-src-all@freebsd.org; svn-src-head@freebsd.org;=20=0D=0AHello,=0D= =0A=0D=0AThis commit causes issues for me on my AT91 board. I get message= s=0D=0Asimilar to the following:=0D=0A=0D=0A(da0:umass-sim0:0:0:0): READ(= 10). CDB: 28 0 0 5f d1 a0 0 0 1d 0=20=0D=0A(da0:umass-sim0:0:0:0): CAM st= atus: CCB request completed with an error=0D=0A(da0:umass-sim0:0:0:0): Re= trying command=0D=0A(da0:umass-sim0:0:0:0): WRITE(10). CDB: 2a 0 0 0 7 e0= 0 0 8 0=20=0D=0A(da0:umass-sim0:0:0:0): CAM status: CCB request complete= d with an error=0D=0A(da0:umass-sim0:0:0:0): Retrying command=0D=0A=0D=0A= Other people are getting similar messages on different ARM cpus.=0D=0A=0D= =0AAndrew=0D=0A From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 08:15:33 2012 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 34708106564A; Sun, 19 Aug 2012 08:15:33 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 143238FC08; Sun, 19 Aug 2012 08:15:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J8FWRt049958; Sun, 19 Aug 2012 08:15:32 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J8FWLi049955; Sun, 19 Aug 2012 08:15:32 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <201208190815.q7J8FWLi049955@svn.freebsd.org> From: Jun Kuriyama Date: Sun, 19 Aug 2012 08:15: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: r239382 - in head/etc: defaults 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, 19 Aug 2012 08:15:33 -0000 Author: kuriyama Date: Sun Aug 19 08:15:32 2012 New Revision: 239382 URL: http://svn.freebsd.org/changeset/base/239382 Log: - Allow to pass extra parameters for each jails. - To achieve above, convert jail(8) invocation to use new style command line "-c" flag. Reviewed at: freebsd-jail@ Modified: head/etc/defaults/rc.conf head/etc/rc.d/jail Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun Aug 19 02:22:16 2012 (r239381) +++ head/etc/defaults/rc.conf Sun Aug 19 08:15:32 2012 (r239382) @@ -705,6 +705,7 @@ jail_sysvipc_allow="NO" # Allow SystemV #jail_example_mount_enable="NO" # mount/umount jail's fs #jail_example_fstab="" # fstab(5) for mount/umount #jail_example_flags="-l -U root" # flags for jail(8) +#jail_example_parameters="allow.raw_sockets=1" # extra parameters for this jail ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Sun Aug 19 02:22:16 2012 (r239381) +++ head/etc/rc.d/jail Sun Aug 19 08:15:32 2012 (r239382) @@ -115,6 +115,8 @@ init_variables() [ -z "${_flags}" ] && _flags="-l -U root" eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\" [ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log" + eval _parameters=\"\${jail_${_j}_parameters:-${jail_parameters}}\" + [ -z "${_parameters}" ] && _parameters="" eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\" # Debugging aid @@ -193,6 +195,7 @@ init_variables() debug "$_j flags: $_flags" debug "$_j consolelog: $_consolelog" + debug "$_j parameters: $_parameters" if [ -z "${_hostname}" ]; then err 3 "$name: No hostname has been defined for ${_j}" @@ -484,9 +487,19 @@ jail_handle_ips_option() esac # Append address to list of addresses for the jail command. - case "${_addrl}" in - "") _addrl="${_addr}" ;; - *) _addrl="${_addrl},${_addr}" ;; + case "${_type}" in + inet) + case "${_addrl}" in + "") _addrl="${_addr}" ;; + *) _addrl="${_addrl},${_addr}" ;; + esac + ;; + inet6) + case "${_addr6l}" in + "") _addr6l="${_addr}" ;; + *) _addr6l="${_addr6l},${_addr}" ;; + esac + ;; esac # Configure interface alias if requested by a given interface @@ -576,6 +589,7 @@ jail_start() continue; fi _addrl="" + _addr6l="" jail_ips "add" if [ -n "${_fib}" ]; then _setfib="setfib -F '${_fib}'" @@ -641,8 +655,8 @@ jail_start() i=$((i + 1)) done - eval ${_setfib} jail -n ${_jail} ${_flags} -i ${_rootdir} ${_hostname} \ - \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ + eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \ + ip4.addr=\"${_addrl}\" ip6.addr=\"${_addr6l}\" ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \ Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 433FA106566C; Sun, 19 Aug 2012 08:16: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 2E3D78FC0A; Sun, 19 Aug 2012 08:16:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J8GEk7050058; Sun, 19 Aug 2012 08:16:14 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J8GD1M050056; Sun, 19 Aug 2012 08:16:13 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201208190816.q7J8GD1M050056@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 19 Aug 2012 08:16: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: r239383 - head/sys/netinet6 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, 19 Aug 2012 08:16:14 -0000 Author: trociny Date: Sun Aug 19 08:16:13 2012 New Revision: 239383 URL: http://svn.freebsd.org/changeset/base/239383 Log: In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK. MFC after: 2 weeks Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Aug 19 08:15:32 2012 (r239382) +++ head/sys/netinet6/ip6_output.c Sun Aug 19 08:16:13 2012 (r239383) @@ -1615,18 +1615,22 @@ ip6_ctloutput(struct socket *so, struct break; #define OPTSET(bit) \ do { \ + INP_WLOCK(in6p); \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTSET2292(bit) \ do { \ + INP_WLOCK(in6p); \ in6p->inp_flags |= IN6P_RFC2292; \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTBIT(bit) (in6p->inp_flags & (bit) ? 1 : 0) @@ -1880,6 +1884,7 @@ do { \ if (error) break; + INP_WLOCK(in6p); switch (optval) { case IPV6_PORTRANGE_DEFAULT: in6p->inp_flags &= ~(INP_LOWPORT); @@ -1900,6 +1905,7 @@ do { \ error = EINVAL; break; } + INP_WUNLOCK(in6p); break; #ifdef IPSEC From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 08:26:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 092F41065672; Sun, 19 Aug 2012 08:26:56 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp5.clear.net.nz (smtp5.clear.net.nz [203.97.33.68]) by mx1.freebsd.org (Postfix) with ESMTP id C05BD8FC0A; Sun, 19 Aug 2012 08:26:55 +0000 (UTC) Received: from mxin2-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp5.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M8Z00DKXU4O2L10@smtp5.clear.net.nz>; Sun, 19 Aug 2012 20:26:48 +1200 (NZST) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin2.paradise.net.nz with ESMTP; Sun, 19 Aug 2012 20:26:45 +1200 Date: Sun, 19 Aug 2012 20:26:22 +1200 From: Andrew Turner In-reply-to: To: Hans Petter Selasky Message-id: <20120819202622.6db6a8dd@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-Pirate: Arrrr References: <20120819150022.3c583fef@fubar.geek.nz> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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: Sun, 19 Aug 2012 08:26:56 -0000 On Sun, 19 Aug 2012 09:39:11 +0200 Hans Petter Selasky wrote: > Hi, >=20 > =C2=A0 >=20 > Have you stepped the versions? I did a binary search of the commits to find the revision that caused the issue. > Are you sure it is exactly this commit? I built with r239213 and the problem went away, when I built with r239214 it appeared again. Andrew From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 08:35:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56923106566B; Sun, 19 Aug 2012 08:35:31 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 777358FC0A; Sun, 19 Aug 2012 08:35:30 +0000 (UTC) Received: by bkcje9 with SMTP id je9so1973362bkc.13 for ; Sun, 19 Aug 2012 01:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=a1LbZjEwmmHYmr9xg0GGs8Bhxqrwn/QohZtvtNfeDpU=; b=Q19sRlGEu5ghH4z47zBVASP0mB0agktuwqDPBPjYUCz4b2J5ccSIZro5FnDPju0rKZ 80Z4BeRhU8h+Q1/qzzXjhgZ946bGpKmU0niBT2UvGSTJWwmglU7dQ8wOT3ozNf6l6gVO A0Yxm7rfDcPS8opLymzkY9SsDm/4yfsZrwOhSsTW9IW+0Tx9/2aurSJgd6O2KaQ0ZREN bXOhHsfxDZMQc/dsy2lumFjk61wQej0JYPl3Yb08Ci/TCZAOrqtdNePYQrNWAYPBVCeO eEjHjPZEmuX14YfovLQZzNj5FFTGpWWOxLykC+Tn6x6Hm1gN+UKJGJC7BoABVhaussKi 6LEg== Received: by 10.205.117.141 with SMTP id fm13mr3494877bkc.125.1345365329067; Sun, 19 Aug 2012 01:35:29 -0700 (PDT) Received: from localhost ([95.69.175.25]) by mx.google.com with ESMTPS id g6sm4901390bkg.2.2012.08.19.01.35.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Aug 2012 01:35:28 -0700 (PDT) Sender: Mikolaj Golub Date: Sun, 19 Aug 2012 11:35:25 +0300 From: Mikolaj Golub To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120819083346.GA3758@gmail.com> References: <201208190816.q7J8GD1M050056@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208190816.q7J8GD1M050056@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r239383 - head/sys/netinet6 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, 19 Aug 2012 08:35:31 -0000 On Sun, Aug 19, 2012 at 08:16:13AM +0000, Mikolaj Golub wrote: > Author: trociny > Date: Sun Aug 19 08:16:13 2012 > New Revision: 239383 > URL: http://svn.freebsd.org/changeset/base/239383 > > Log: > In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK. > The issue this commit fixes was reproduced using this simple program: http://people.freebsd.org/~trociny/test_IPPROTO_IPV6.c When two threads modified IPPROTO_IPV6 options simultaneously (each thread a different option but both options are in inp_flags, like IPV6_V6ONLY and IPV6_PORTRANGE) the result could be wrong due to the interference. I think that modification of ip6_pktopts should be guarded with the lock too. I have a patch for this: http://people.freebsd.org/~trociny/ip6_output.c.ip6_pktopts.1.patch Unfortunately, I don't know how to test this. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:17:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E89C0106564A; Sun, 19 Aug 2012 09:17:21 +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 B99A28FC0C; Sun, 19 Aug 2012 09:17:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9HLON056369; Sun, 19 Aug 2012 09:17:21 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9HL7l056367; Sun, 19 Aug 2012 09:17:21 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190917.q7J9HL7l056367@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:17:21 +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: r239384 - vendor/illumos/dist/tools/ctf/cvt 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, 19 Aug 2012 09:17:22 -0000 Author: mm Date: Sun Aug 19 09:17:21 2012 New Revision: 239384 URL: http://svn.freebsd.org/changeset/base/239384 Log: Update vendor/illumos to illumos-gate 13754:7231b684c18b References: https://www.illumos.org/issues/2978 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor/illumos/dist/tools/ctf/cvt/dwarf.c Modified: vendor/illumos/dist/tools/ctf/cvt/dwarf.c ============================================================================== --- vendor/illumos/dist/tools/ctf/cvt/dwarf.c Sun Aug 19 08:16:13 2012 (r239383) +++ vendor/illumos/dist/tools/ctf/cvt/dwarf.c Sun Aug 19 09:17:21 2012 (r239384) @@ -1839,21 +1839,53 @@ die_resolve(dwarf_t *dw) } /* - * Any object containing at least one allocatable section of non-0 size is - * taken to be a file which should contain DWARF type information + * Any object containing a function or object symbol at any scope should also + * contain DWARF data. */ static boolean_t should_have_dwarf(Elf *elf) { Elf_Scn *scn = NULL; + Elf_Data *data = NULL; + GElf_Shdr shdr; + GElf_Sym sym; + uint32_t symdx = 0; + size_t nsyms = 0; + boolean_t found = B_FALSE; while ((scn = elf_nextscn(elf, scn)) != NULL) { - GElf_Shdr shdr; gelf_getshdr(scn, &shdr); - if ((shdr.sh_flags & SHF_ALLOC) && - (shdr.sh_size != 0)) - return (B_TRUE); + if (shdr.sh_type == SHT_SYMTAB) { + found = B_TRUE; + break; + } + } + + if (!found) + terminate("cannot convert stripped objects\n"); + + data = elf_getdata(scn, NULL); + nsyms = shdr.sh_size / shdr.sh_entsize; + + for (symdx = 0; symdx < nsyms; symdx++) { + gelf_getsym(data, symdx, &sym); + + if ((GELF_ST_TYPE(sym.st_info) == STT_FUNC) || + (GELF_ST_TYPE(sym.st_info) == STT_TLS) || + (GELF_ST_TYPE(sym.st_info) == STT_OBJECT)) { + char *name; + + name = elf_strptr(elf, shdr.sh_link, sym.st_name); + + /* Studio emits these local symbols regardless */ + if ((strcmp(name, "Bbss.bss") != 0) && + (strcmp(name, "Ttbss.bss") != 0) && + (strcmp(name, "Ddata.data") != 0) && + (strcmp(name, "Ttdata.data") != 0) && + (strcmp(name, "Drodata.rodata") != 0)) + return (B_TRUE); + } } return (B_FALSE); From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:20:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1651A106566C; Sun, 19 Aug 2012 09:20:24 +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 F0F148FC12; Sun, 19 Aug 2012 09:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9KNpm056752; Sun, 19 Aug 2012 09:20:23 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9KNff056718; Sun, 19 Aug 2012 09:20:23 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190920.q7J9KNff056718@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:20:23 +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: r239385 - in vendor/illumos/dist: cmd/dtrace cmd/dtrace/test/cmd/scripts cmd/dtrace/test/tst/common/aggs cmd/dtrace/test/tst/common/arithmetic cmd/dtrace/test/tst/common/buffering cmd/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, 19 Aug 2012 09:20:24 -0000 Author: mm Date: Sun Aug 19 09:20:22 2012 New Revision: 239385 URL: http://svn.freebsd.org/changeset/base/239385 Log: Update vendor/illumos to illumos-gate 13758:23432da34147 (dtrace changes) References: https://www.illumos.org/issues/3021 https://www.illumos.org/issues/3022 https://www.illumos.org/issues/3023 https://www.illumos.org/issues/3024 https://www.illumos.org/issues/3025 https://www.illumos.org/issues/3026 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/ vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.baddif.d vendor/illumos/dist/cmd/dtrace/test/tst/common/env/ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh.out (contents, props changed) vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.dyn.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.xlate.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.xlate.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/printf/tst.signs.d vendor/illumos/dist/cmd/dtrace/test/tst/common/printf/tst.signs.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/tst.dyn.d vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out vendor/illumos/dist/lib/libdtrace/common/dt_pq.c Deleted: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d vendor/illumos/dist/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toomany.d vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d Modified: vendor/illumos/dist/cmd/dtrace/dtrace.c vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.fill1.d vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.ring3.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/printf/tst.ints.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d vendor/illumos/dist/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d vendor/illumos/dist/lib/libdtrace/common/dt_aggregate.c vendor/illumos/dist/lib/libdtrace/common/dt_cc.c vendor/illumos/dist/lib/libdtrace/common/dt_cg.c vendor/illumos/dist/lib/libdtrace/common/dt_consume.c vendor/illumos/dist/lib/libdtrace/common/dt_dis.c vendor/illumos/dist/lib/libdtrace/common/dt_error.c vendor/illumos/dist/lib/libdtrace/common/dt_errtags.h vendor/illumos/dist/lib/libdtrace/common/dt_impl.h vendor/illumos/dist/lib/libdtrace/common/dt_open.c vendor/illumos/dist/lib/libdtrace/common/dt_options.c vendor/illumos/dist/lib/libdtrace/common/dt_parser.c vendor/illumos/dist/lib/libdtrace/common/dt_printf.c vendor/illumos/dist/lib/libdtrace/common/dt_proc.c vendor/illumos/dist/lib/libdtrace/common/dt_proc.h vendor/illumos/dist/lib/libdtrace/common/dt_regset.c vendor/illumos/dist/lib/libdtrace/common/dt_regset.h vendor/illumos/dist/lib/libdtrace/common/dt_subr.c vendor/illumos/dist/lib/libdtrace/i386/dt_isadep.c Modified: vendor/illumos/dist/cmd/dtrace/dtrace.c ============================================================================== --- vendor/illumos/dist/cmd/dtrace/dtrace.c Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/dtrace.c Sun Aug 19 09:20:22 2012 (r239385) @@ -23,8 +23,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #include #include @@ -1339,6 +1340,7 @@ main(int argc, char *argv[]) (void) dtrace_setopt(g_dtp, "bufsize", "4m"); (void) dtrace_setopt(g_dtp, "aggsize", "4m"); + (void) dtrace_setopt(g_dtp, "temporal", "yes"); /* * If -G is specified, enable -xlink=dynamic and -xunodefs to permit Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl Sun Aug 19 09:20:22 2012 (r239385) @@ -27,6 +27,7 @@ # # Copyright (c) 2011, Joyent, Inc. All rights reserved. +# Copyright (c) 2012 by Delphix. All rights reserved. # require 5.8.4; @@ -612,6 +613,8 @@ if ($opt_x) { die "$PNAME: failed to open $PNAME.$$.log: $!\n" unless (!$opt_l || open(LOG, ">$PNAME.$$.log")); +$ENV{'DTRACE_DEBUG_REGSET'} = 'true'; + if ($opt_g) { $ENV{'UMEM_DEBUG'} = 'default,verbose'; $ENV{'UMEM_LOGGING'} = 'fail,contents'; Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,35 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#pragma D option quiet + +/* + * Make sure the sizes of compatible keys doesn't affect the sort order. + */ + +BEGIN +{ + @[(int)1, 0] = sum(10); + @[(uint64_t)2, 0] = sum(20); + @[(int)3, 0] = sum(30); + @[(uint64_t)4, 0] = sum(40); + printa(@); + + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,6 @@ + + 1 0 10 + 2 0 20 + 3 0 30 + 4 0 40 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,8 @@ +The value of i is 6 +The value of i is 18 +The value of i is 72 +The value of i is 25920 +The value of i is 935761216 +The value of i is -91738734 +The value of i is -91738729 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test compile-time casting between integer types of different size. + */ + +#pragma D option quiet + +int64_t x; + +BEGIN +{ + x = (int32_t)(int16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (int32_t)(uint16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(int16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(uint16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + printf("\n"); + + x = (int16_t)(int32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (int16_t)(uint32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(int32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(uint32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,10 @@ +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fffffff0 4294967280 4294967280 + fff0 65520 65520 + +fffffffffffffff0 -16 18446744073709551600 +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fff0 65520 65520 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,36 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test narrowing at assignment. + */ + +#pragma D option quiet + +uint16_t x; +uint32_t y; + +BEGIN +{ + x = 0xbeefcafe; + y = x; + printf("%x", y); /* where's the beef? */ + + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1 @@ +cafe Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test execution-time casting between integer types of different size. + */ + +#pragma D option quiet + +int64_t x; + +BEGIN +{ + z = 0xfff0; + + x = (int32_t)(int16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (int32_t)(uint16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(int16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(uint16_t)z; + printf("%16x %20d %20u\n", x, x, x); + printf("\n"); + + x = (int16_t)(int32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (int16_t)(uint32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(int32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(uint32_t)z; + printf("%16x %20d %20u\n", x, x, x); + + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,10 @@ +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fffffff0 4294967280 4294967280 + fff0 65520 65520 + +fffffffffffffff0 -16 18446744073709551600 +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fff0 65520 65520 + Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.fill1.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Sun Aug 19 09:20:22 2012 (r239385) @@ -23,26 +23,29 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: * Positive test for fill buffer policy. * * SECTION: Buffers and Buffering/fill Policy; - * Buffers and Buffering/Buffer Sizes; + * Buffers and Buffering/Buffer Sizes; * Options and Tunables/bufsize; * Options and Tunables/bufpolicy; * Options and Tunables/statusrate */ /* - * This is a brute-force way of testing fill buffers. We assume that each - * printf() stores 8 bytes. Because each fill buffer is per-CPU, we must - * fill up our buffer in one series of enablings on a single CPU. + * This is a brute-force way of testing fill buffers. We assume that + * each printf() stores 16 bytes (4x 32-bit words for EPID, timestamp + * lo, timestamp hi, and the variable i). Because each fill buffer is + * per-CPU, we must fill up our buffer in one series of enablings on a + * single CPU. */ #pragma D option bufpolicy=fill -#pragma D option bufsize=64 +#pragma D option bufsize=128 #pragma D option statusrate=10ms #pragma D option quiet Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.ring3.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.ring3.d Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.ring3.d Sun Aug 19 09:20:22 2012 (r239385) @@ -23,8 +23,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -37,19 +38,20 @@ */ /* - * We make some regrettable assumptions about the implementation in this test. - * First, we assume that each entry for the printf() of an int takes _exactly_ - * eight bytes (four bytes for the EPID, four bytes for the payload). Second, - * we assume that by allocating storage for n + 1 records, we will get exactly - * n. Here is why: the final predicate that evaluates to false will reserve - * space that it won't use. This act of reservation will advance the wrapped - * offset. That record won't be subsequently used, but the wrapped offset has - * advanced. (And in this case, that old record is clobbered by the exit() - * anyway.) Thirdly: we rely on t_cpu/cpu_id. Finally: we rely on being - * able to run on the CPU that we first ran on. + * We make some regrettable assumptions about the implementation in this + * test. First, we assume that each entry for the printf() of an int + * takes _exactly_ 16 bytes (4 bytes for the EPID, 8 bytes for the + * timestamp, 4 bytes for the payload). Second, we assume that by + * allocating storage for n + 1 records, we will get exactly n. Here is + * why: the final predicate that evaluates to false will reserve space + * that it won't use. This act of reservation will advance the wrapped + * offset. That record won't be subsequently used, but the wrapped + * offset has advanced. (And in this case, that old record is clobbered + * by the exit() anyway.) Thirdly: we rely on t_cpu/cpu_id. Finally: + * we rely on being able to run on the CPU that we first ran on. */ #pragma D option bufpolicy=ring -#pragma D option bufsize=40 +#pragma D option bufsize=80 #pragma D option quiet int n; Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Compile some code that requires exactly 9 registers. This should run out + * of registers. + * + * Changes to the code generator might cause this test to succeeed in which + * case the code should be changed to another sequence that exhausts the + * available internal registers. + * + * Note that this and err.baddif.d should be kept in sync. + */ + +BEGIN +{ + a = 4; + trace((a + a) * ((a + a) * ((a + a) * ((a + a) * ((a + a) * + ((a + a) * (a + a))))))); +} + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.baddif.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.baddif.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Compile some code that requires exactly 9 registers. This should generate + * invalid DIF because the kernel will flag the fact that we're using more + * registers than are available internally. + * + * Changes to the code generator might cause this test to succeeed in which + * case the code should be changed to another sequence that exhausts the + * available internal registers. + * + * Note that this and err.D_NOREG.noreg.d should be kept in sync. + */ + +#pragma D option iregs=9 + +BEGIN +{ + a = 4; + trace((a + a) * ((a + a) * ((a + a) * ((a + a) * ((a + a) * + ((a + a) * (a + a))))))); +} + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,25 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#pragma D option setenv=balloon=something_bad_happens + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,25 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#pragma D option unsetenv=rectalexambot + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,33 @@ +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Check that the LD_NOLAZYLOAD variable is set to 1 as expected. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -c 'printenv LD_NOLAZYLOAD' + +exit $? Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,2 @@ +1 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,33 @@ +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Reset an environment variable we already know to be set. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -xsetenv=LD_NOLAZYLOAD=0 -c 'printenv LD_NOLAZYLOAD' + +exit $? Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,2 @@ +0 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,33 @@ +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Test setting a variable that we isn't already set. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -xsetenv=CORPORATIONS=PEOPLE -c 'printenv CORPORATIONS' + +exit $? Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,2 @@ +PEOPLE + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,33 @@ +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Test unsetting a variable we know to be set. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -xunsetenv=LD_NOLAZYLOAD -c 'printenv LD_NOLAZYLOAD' + +exit $? Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh.out ============================================================================== Binary file. No diff available. Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,35 @@ +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Test invalid syntax to the unsetenv option. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -xunsetenv=ed=screven -c 'true' 2>&1 + +[[ $? -eq 1 ]] && exit 0 + +exit 1 Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1 @@ +dtrace: failed to set -x unsetenv: Invalid value for specified option Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -24,7 +24,9 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + +# +# Copyright (c) 2012 by Delphix. All rights reserved. # if [ $# != 1 ]; then @@ -49,13 +51,13 @@ tick-1s tick-1s /(i % 2) == 0/ { - system("dtrace -c date -ln 'pid\$target::main:entry' >/dev/null"); + system("dtrace -c date -n 'pid\$target::main:entry' >/dev/null"); } tick-1s /(i % 2) == 1/ { - system("dtrace -c date -ln 'pid\$target::main:return' >/dev/null"); + system("dtrace -c date -n 'pid\$target::main:return' >/dev/null"); } EOF Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,28 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + *((int *)alloca(4)) = 1; +} + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + this->a = alloca(4); + *((int *)this->a) = 1; +} + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,106 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +############################################################################ +# ASSERTION: +# temporal option causes output to be sorted +# +# SECTION: Pragma +# +# NOTES: The temporal option has no effect on a single-CPU system, so +# this needs to be run on a multi-CPU system to effectively test the +# temporal option. +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +file=/tmp/out.$$ + +rm -f $file + +$dtrace -o $file -c 'sleep 3' -s /dev/stdin < $file.2 + +sort -n $file.2 | diff $file.2 - +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: output is not sorted + exit $status +fi + +head -n 1 $file.2 | grep begin >/dev/null +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: begin probe did not fire + exit $status +fi + +tail -n 2 $file.2 | grep end >/dev/null +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: end probe did not fire + exit $status +fi + +if [ $(tail -n 1 $file.2 | cut -f3 -d ' ') -ne \ + $(wc -l $file.2) ]; then + echo $tst: incorrect number of lines output + exit 1 +fi + +exit $status Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,102 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +############################################################################ +# ASSERTION: +# temporal option causes output to be sorted, even when some +# buffers are empty +# +# SECTION: Pragma +# +# NOTES: The temporal option has no effect on a single-CPU system, so +# this needs to be run on a multi-CPU system to effectively test the +# temporal option. +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +file=/tmp/out.$$ + +rm -f $file + +$dtrace -o $file -s /dev/stdin < 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 755D11065672; Sun, 19 Aug 2012 09:21:21 +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 5EC828FC1A; Sun, 19 Aug 2012 09:21:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9LL27056880; Sun, 19 Aug 2012 09:21:21 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9LL8v056876; Sun, 19 Aug 2012 09:21:21 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190921.q7J9LL8v056876@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:21:21 +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: r239386 - in vendor-sys/illumos/dist/uts/common: dtrace 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: Sun, 19 Aug 2012 09:21:21 -0000 Author: mm Date: Sun Aug 19 09:21:20 2012 New Revision: 239386 URL: http://svn.freebsd.org/changeset/base/239386 Log: Update vendor-sys/illumos to illumos-gate 13758:23432da34147 (dtrace) References: https://www.illumos.org/issues/3021 https://www.illumos.org/issues/3022 https://www.illumos.org/issues/3023 https://www.illumos.org/issues/3024 https://www.illumos.org/issues/3025 https://www.illumos.org/issues/3026 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c vendor-sys/illumos/dist/uts/common/sys/dtrace.h vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Sun Aug 19 09:20:22 2012 (r239385) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Sun Aug 19 09:21:20 2012 (r239386) @@ -22,6 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -2401,9 +2402,10 @@ dtrace_speculation_commit(dtrace_state_t { dtrace_speculation_t *spec; dtrace_buffer_t *src, *dest; - uintptr_t daddr, saddr, dlimit; + uintptr_t daddr, saddr, dlimit, slimit; dtrace_speculation_state_t current, new; intptr_t offs; + uint64_t timestamp; if (which == 0) return; @@ -2479,7 +2481,37 @@ dtrace_speculation_commit(dtrace_state_t } /* - * We have the space; copy the buffer across. (Note that this is a + * We have sufficient space to copy the speculative buffer into the + * primary buffer. First, modify the speculative buffer, filling + * in the timestamp of all entries with the current time. The data + * must have the commit() time rather than the time it was traced, + * so that all entries in the primary buffer are in timestamp order. + */ + timestamp = dtrace_gethrtime(); + saddr = (uintptr_t)src->dtb_tomax; + slimit = saddr + src->dtb_offset; + while (saddr < slimit) { + size_t size; + dtrace_rechdr_t *dtrh = (dtrace_rechdr_t *)saddr; + + if (dtrh->dtrh_epid == DTRACE_EPIDNONE) { + saddr += sizeof (dtrace_epid_t); + continue; + } + ASSERT3U(dtrh->dtrh_epid, <=, state->dts_necbs); + size = state->dts_ecbs[dtrh->dtrh_epid - 1]->dte_size; + + ASSERT3U(saddr + size, <=, slimit); + ASSERT3U(size, >=, sizeof (dtrace_rechdr_t)); + ASSERT3U(DTRACE_RECORD_LOAD_TIMESTAMP(dtrh), ==, UINT64_MAX); + + DTRACE_RECORD_STORE_TIMESTAMP(dtrh, timestamp); + + saddr += size; + } + + /* + * Copy the buffer across. (Note that this is a * highly subobtimal bcopy(); in the unlikely event that this becomes * a serious performance issue, a high-performance DTrace-specific * bcopy() should obviously be invented.) @@ -5951,7 +5983,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t a if (now - state->dts_alive > dtrace_deadman_timeout) { /* * We seem to be dead. Unless we (a) have kernel - * destructive permissions (b) have expicitly enabled + * destructive permissions (b) have explicitly enabled * destructive actions and (c) destructive actions have * not been disabled, we're going to transition into * the KILLED state, from which no further processing @@ -5979,8 +6011,18 @@ dtrace_probe(dtrace_id_t id, uintptr_t a tomax = buf->dtb_tomax; ASSERT(tomax != NULL); - if (ecb->dte_size != 0) - DTRACE_STORE(uint32_t, tomax, offs, ecb->dte_epid); + if (ecb->dte_size != 0) { + dtrace_rechdr_t dtrh; + if (!(mstate.dtms_present & DTRACE_MSTATE_TIMESTAMP)) { + mstate.dtms_timestamp = dtrace_gethrtime(); + mstate.dtms_present |= DTRACE_MSTATE_TIMESTAMP; + } + ASSERT3U(ecb->dte_size, >=, sizeof (dtrace_rechdr_t)); + dtrh.dtrh_epid = ecb->dte_epid; + DTRACE_RECORD_STORE_TIMESTAMP(&dtrh, + mstate.dtms_timestamp); + *((dtrace_rechdr_t *)(tomax + offs)) = dtrh; + } mstate.dtms_epid = ecb->dte_epid; mstate.dtms_present |= DTRACE_MSTATE_EPID; @@ -6144,7 +6186,9 @@ dtrace_probe(dtrace_id_t id, uintptr_t a continue; switch (act->dta_kind) { - case DTRACEACT_SPECULATE: + case DTRACEACT_SPECULATE: { + dtrace_rechdr_t *dtrh; + ASSERT(buf == &state->dts_buffer[cpuid]); buf = dtrace_speculation_buffer(state, cpuid, val); @@ -6166,10 +6210,23 @@ dtrace_probe(dtrace_id_t id, uintptr_t a tomax = buf->dtb_tomax; ASSERT(tomax != NULL); - if (ecb->dte_size != 0) - DTRACE_STORE(uint32_t, tomax, offs, - ecb->dte_epid); + if (ecb->dte_size == 0) + continue; + + ASSERT3U(ecb->dte_size, >=, + sizeof (dtrace_rechdr_t)); + dtrh = ((void *)(tomax + offs)); + dtrh->dtrh_epid = ecb->dte_epid; + /* + * When the speculation is committed, all of + * the records in the speculative buffer will + * have their timestamps set to the commit + * time. Until then, it is set to a sentinel + * value, for debugability. + */ + DTRACE_RECORD_STORE_TIMESTAMP(dtrh, UINT64_MAX); continue; + } case DTRACEACT_CHILL: if (dtrace_priv_kernel_destructive(state)) @@ -9369,9 +9426,9 @@ dtrace_ecb_add(dtrace_state_t *state, dt /* * The default size is the size of the default action: recording - * the epid. + * the header. */ - ecb->dte_size = ecb->dte_needed = sizeof (dtrace_epid_t); + ecb->dte_size = ecb->dte_needed = sizeof (dtrace_rechdr_t); ecb->dte_alignment = sizeof (dtrace_epid_t); epid = state->dts_epid++; @@ -9470,122 +9527,89 @@ dtrace_ecb_enable(dtrace_ecb_t *ecb) static void dtrace_ecb_resize(dtrace_ecb_t *ecb) { - uint32_t maxalign = sizeof (dtrace_epid_t); - uint32_t align = sizeof (uint8_t), offs, diff; dtrace_action_t *act; - int wastuple = 0; + uint32_t curneeded = UINT32_MAX; uint32_t aggbase = UINT32_MAX; - dtrace_state_t *state = ecb->dte_state; /* - * If we record anything, we always record the epid. (And we always - * record it first.) + * If we record anything, we always record the dtrace_rechdr_t. (And + * we always record it first.) */ - offs = sizeof (dtrace_epid_t); - ecb->dte_size = ecb->dte_needed = sizeof (dtrace_epid_t); + ecb->dte_size = sizeof (dtrace_rechdr_t); + ecb->dte_alignment = sizeof (dtrace_epid_t); for (act = ecb->dte_action; act != NULL; act = act->dta_next) { dtrace_recdesc_t *rec = &act->dta_rec; + ASSERT(rec->dtrd_size > 0 || rec->dtrd_alignment == 1); - if ((align = rec->dtrd_alignment) > maxalign) - maxalign = align; - - if (!wastuple && act->dta_intuple) { - /* - * This is the first record in a tuple. Align the - * offset to be at offset 4 in an 8-byte aligned - * block. - */ - diff = offs + sizeof (dtrace_aggid_t); - - if (diff = (diff & (sizeof (uint64_t) - 1))) - offs += sizeof (uint64_t) - diff; - - aggbase = offs - sizeof (dtrace_aggid_t); - ASSERT(!(aggbase & (sizeof (uint64_t) - 1))); - } - - /*LINTED*/ - if (rec->dtrd_size != 0 && (diff = (offs & (align - 1)))) { - /* - * The current offset is not properly aligned; align it. - */ - offs += align - diff; - } - - rec->dtrd_offset = offs; - - if (offs + rec->dtrd_size > ecb->dte_needed) { - ecb->dte_needed = offs + rec->dtrd_size; - - if (ecb->dte_needed > state->dts_needed) - state->dts_needed = ecb->dte_needed; - } + ecb->dte_alignment = MAX(ecb->dte_alignment, + rec->dtrd_alignment); if (DTRACEACT_ISAGG(act->dta_kind)) { dtrace_aggregation_t *agg = (dtrace_aggregation_t *)act; - dtrace_action_t *first = agg->dtag_first, *prev; - ASSERT(rec->dtrd_size != 0 && first != NULL); - ASSERT(wastuple); + ASSERT(rec->dtrd_size != 0); + ASSERT(agg->dtag_first != NULL); + ASSERT(act->dta_prev->dta_intuple); ASSERT(aggbase != UINT32_MAX); + ASSERT(curneeded != UINT32_MAX); agg->dtag_base = aggbase; - while ((prev = first->dta_prev) != NULL && - DTRACEACT_ISAGG(prev->dta_kind)) { - agg = (dtrace_aggregation_t *)prev; - first = agg->dtag_first; - } - - if (prev != NULL) { - offs = prev->dta_rec.dtrd_offset + - prev->dta_rec.dtrd_size; - } else { - offs = sizeof (dtrace_epid_t); - } - wastuple = 0; + curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); + rec->dtrd_offset = curneeded; + curneeded += rec->dtrd_size; + ecb->dte_needed = MAX(ecb->dte_needed, curneeded); + + aggbase = UINT32_MAX; + curneeded = UINT32_MAX; + } else if (act->dta_intuple) { + if (curneeded == UINT32_MAX) { + /* + * This is the first record in a tuple. Align + * curneeded to be at offset 4 in an 8-byte + * aligned block. + */ + ASSERT(act->dta_prev == NULL || + !act->dta_prev->dta_intuple); + ASSERT3U(aggbase, ==, UINT32_MAX); + curneeded = P2PHASEUP(ecb->dte_size, + sizeof (uint64_t), sizeof (dtrace_aggid_t)); + + aggbase = curneeded - sizeof (dtrace_aggid_t); + ASSERT(IS_P2ALIGNED(aggbase, + sizeof (uint64_t))); + } + curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); + rec->dtrd_offset = curneeded; + curneeded += rec->dtrd_size; } else { - if (!act->dta_intuple) - ecb->dte_size = offs + rec->dtrd_size; - - offs += rec->dtrd_size; + /* tuples must be followed by an aggregation */ + ASSERT(act->dta_prev == NULL || + !act->dta_prev->dta_intuple); + + ecb->dte_size = P2ROUNDUP(ecb->dte_size, + rec->dtrd_alignment); + rec->dtrd_offset = ecb->dte_size; + ecb->dte_size += rec->dtrd_size; + ecb->dte_needed = MAX(ecb->dte_needed, ecb->dte_size); } - - wastuple = act->dta_intuple; } if ((act = ecb->dte_action) != NULL && !(act->dta_kind == DTRACEACT_SPECULATE && act->dta_next == NULL) && - ecb->dte_size == sizeof (dtrace_epid_t)) { + ecb->dte_size == sizeof (dtrace_rechdr_t)) { /* - * If the size is still sizeof (dtrace_epid_t), then all + * If the size is still sizeof (dtrace_rechdr_t), then all * actions store no data; set the size to 0. */ - ecb->dte_alignment = maxalign; ecb->dte_size = 0; - - /* - * If the needed space is still sizeof (dtrace_epid_t), then - * all actions need no additional space; set the needed - * size to 0. - */ - if (ecb->dte_needed == sizeof (dtrace_epid_t)) - ecb->dte_needed = 0; - - return; } - /* - * Set our alignment, and make sure that the dte_size and dte_needed - * are aligned to the size of an EPID. - */ - ecb->dte_alignment = maxalign; - ecb->dte_size = (ecb->dte_size + (sizeof (dtrace_epid_t) - 1)) & - ~(sizeof (dtrace_epid_t) - 1); - ecb->dte_needed = (ecb->dte_needed + (sizeof (dtrace_epid_t) - 1)) & - ~(sizeof (dtrace_epid_t) - 1); - ASSERT(ecb->dte_size <= ecb->dte_needed); + ecb->dte_size = P2ROUNDUP(ecb->dte_size, sizeof (dtrace_epid_t)); + ecb->dte_needed = P2ROUNDUP(ecb->dte_needed, (sizeof (dtrace_epid_t))); + ecb->dte_state->dts_needed = MAX(ecb->dte_state->dts_needed, + ecb->dte_needed); } static dtrace_action_t * @@ -9955,7 +9979,7 @@ dtrace_ecb_action_add(dtrace_ecb_t *ecb, break; case DTRACEACT_SPECULATE: - if (ecb->dte_size > sizeof (dtrace_epid_t)) + if (ecb->dte_size > sizeof (dtrace_rechdr_t)) return (EINVAL); if (dp == NULL) @@ -10068,7 +10092,7 @@ dtrace_ecb_action_remove(dtrace_ecb_t *e ecb->dte_action = NULL; ecb->dte_action_last = NULL; - ecb->dte_size = sizeof (dtrace_epid_t); + ecb->dte_size = 0; } static void @@ -10339,12 +10363,13 @@ dtrace_buffer_switch(dtrace_buffer_t *bu caddr_t tomax = buf->dtb_tomax; caddr_t xamot = buf->dtb_xamot; dtrace_icookie_t cookie; - hrtime_t now = dtrace_gethrtime(); + hrtime_t now; ASSERT(!(buf->dtb_flags & DTRACEBUF_NOSWITCH)); ASSERT(!(buf->dtb_flags & DTRACEBUF_RING)); cookie = dtrace_interrupt_disable(); + now = dtrace_gethrtime(); buf->dtb_tomax = xamot; buf->dtb_xamot = tomax; buf->dtb_xamot_drops = buf->dtb_drops; @@ -10639,7 +10664,7 @@ dtrace_buffer_reserve(dtrace_buffer_t *b if (epid == DTRACE_EPIDNONE) { size = sizeof (uint32_t); } else { - ASSERT(epid <= state->dts_necbs); + ASSERT3U(epid, <=, state->dts_necbs); ASSERT(state->dts_ecbs[epid - 1] != NULL); size = state->dts_ecbs[epid - 1]->dte_size; @@ -15623,6 +15648,7 @@ dtrace_ioctl(dev_t dev, int cmd, intptr_ desc.dtbd_drops = buf->dtb_drops; desc.dtbd_errors = buf->dtb_errors; desc.dtbd_oldest = buf->dtb_xamot_offset; + desc.dtbd_timestamp = dtrace_gethrtime(); mutex_exit(&dtrace_lock); @@ -15675,6 +15701,7 @@ dtrace_ioctl(dev_t dev, int cmd, intptr_ desc.dtbd_drops = buf->dtb_xamot_drops; desc.dtbd_errors = buf->dtb_xamot_errors; desc.dtbd_oldest = 0; + desc.dtbd_timestamp = buf->dtb_switched; mutex_exit(&dtrace_lock); Modified: vendor-sys/illumos/dist/uts/common/sys/dtrace.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/dtrace.h Sun Aug 19 09:20:22 2012 (r239385) +++ vendor-sys/illumos/dist/uts/common/sys/dtrace.h Sun Aug 19 09:21:20 2012 (r239386) @@ -26,6 +26,7 @@ /* * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DTRACE_H @@ -919,10 +920,10 @@ typedef struct dtrace_ecbdesc { * DTrace Metadata Description Structures * * DTrace separates the trace data stream from the metadata stream. The only - * metadata tokens placed in the data stream are enabled probe identifiers - * (EPIDs) or (in the case of aggregations) aggregation identifiers. In order - * to determine the structure of the data, DTrace consumers pass the token to - * the kernel, and receive in return a corresponding description of the enabled + * metadata tokens placed in the data stream are the dtrace_rechdr_t (EPID + + * timestamp) or (in the case of aggregations) aggregation identifiers. To + * determine the structure of the data, DTrace consumers pass the token to the + * kernel, and receive in return a corresponding description of the enabled * probe (via the dtrace_eprobedesc structure) or the aggregation (via the * dtrace_aggdesc structure). Both of these structures are expressed in terms * of record descriptions (via the dtrace_recdesc structure) that describe the @@ -1017,7 +1018,8 @@ typedef struct dtrace_fmtdesc { #define DTRACEOPT_AGGSORTREV 24 /* reverse-sort aggregations */ #define DTRACEOPT_AGGSORTPOS 25 /* agg. position to sort on */ #define DTRACEOPT_AGGSORTKEYPOS 26 /* agg. key position to sort on */ -#define DTRACEOPT_MAX 27 /* number of options */ +#define DTRACEOPT_TEMPORAL 27 /* temporally ordered output */ +#define DTRACEOPT_MAX 28 /* number of options */ #define DTRACEOPT_UNSET (dtrace_optval_t)-2 /* unset option */ @@ -1037,7 +1039,9 @@ typedef struct dtrace_fmtdesc { * where user-level wishes the kernel to snapshot the buffer to (the * dtbd_data field). The kernel uses the same structure to pass back some * information regarding the buffer: the size of data actually copied out, the - * number of drops, the number of errors, and the offset of the oldest record. + * number of drops, the number of errors, the offset of the oldest record, + * and the time of the snapshot. + * * If the buffer policy is a "switch" policy, taking a snapshot of the * principal buffer has the additional effect of switching the active and * inactive buffers. Taking a snapshot of the aggregation buffer _always_ has @@ -1050,9 +1054,30 @@ typedef struct dtrace_bufdesc { uint64_t dtbd_drops; /* number of drops */ DTRACE_PTR(char, dtbd_data); /* data */ uint64_t dtbd_oldest; /* offset of oldest record */ + uint64_t dtbd_timestamp; /* hrtime of snapshot */ } dtrace_bufdesc_t; /* + * Each record in the buffer (dtbd_data) begins with a header that includes + * the epid and a timestamp. The timestamp is split into two 4-byte parts + * so that we do not require 8-byte alignment. + */ +typedef struct dtrace_rechdr { + dtrace_epid_t dtrh_epid; /* enabled probe id */ + uint32_t dtrh_timestamp_hi; /* high bits of hrtime_t */ + uint32_t dtrh_timestamp_lo; /* low bits of hrtime_t */ +} dtrace_rechdr_t; + +#define DTRACE_RECORD_LOAD_TIMESTAMP(dtrh) \ + ((dtrh)->dtrh_timestamp_lo + \ + ((uint64_t)(dtrh)->dtrh_timestamp_hi << 32)) + +#define DTRACE_RECORD_STORE_TIMESTAMP(dtrh, hrtime) { \ + (dtrh)->dtrh_timestamp_lo = (uint32_t)hrtime; \ + (dtrh)->dtrh_timestamp_hi = hrtime >> 32; \ +} + +/* * DTrace Status * * The status of DTrace is relayed via the dtrace_status structure. This Modified: vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h Sun Aug 19 09:20:22 2012 (r239385) +++ vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h Sun Aug 19 09:21:20 2012 (r239386) @@ -26,6 +26,7 @@ /* * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DTRACE_IMPL_H @@ -199,15 +200,18 @@ typedef struct dtrace_hash { * predicate is non-NULL, the DIF object is executed. If the result is * non-zero, the action list is processed, with each action being executed * accordingly. When the action list has been completely executed, processing - * advances to the next ECB. processing advances to the next ECB. If the - * result is non-zero; For each ECB, it first determines the The ECB - * abstraction allows disjoint consumers to multiplex on single probes. + * advances to the next ECB. The ECB abstraction allows disjoint consumers + * to multiplex on single probes. + * + * Execution of the ECB results in consuming dte_size bytes in the buffer + * to record data. During execution, dte_needed bytes must be available in + * the buffer. This space is used for both recorded data and tuple data. */ struct dtrace_ecb { dtrace_epid_t dte_epid; /* enabled probe ID */ uint32_t dte_alignment; /* required alignment */ - size_t dte_needed; /* bytes needed */ - size_t dte_size; /* total size of payload */ + size_t dte_needed; /* space needed for execution */ + size_t dte_size; /* size of recorded payload */ dtrace_predicate_t *dte_predicate; /* predicate, if any */ dtrace_action_t *dte_action; /* actions, if any */ dtrace_ecb_t *dte_next; /* next ECB on probe */ @@ -265,27 +269,30 @@ typedef struct dtrace_aggregation { * the EPID, the consumer can determine the data layout. (The data buffer * layout is shown schematically below.) By assuring that one can determine * data layout from the EPID, the metadata stream can be separated from the - * data stream -- simplifying the data stream enormously. - * - * base of data buffer ---> +------+--------------------+------+ - * | EPID | data | EPID | - * +------+--------+------+----+------+ - * | data | EPID | data | - * +---------------+------+-----------+ - * | data, cont. | - * +------+--------------------+------+ - * | EPID | data | | - * +------+--------------------+ | - * | || | - * | || | - * | \/ | - * : : - * . . - * . . - * . . - * : : - * | | - * limit of data buffer ---> +----------------------------------+ + * data stream -- simplifying the data stream enormously. The ECB always + * proceeds the recorded data as part of the dtrace_rechdr_t structure that + * includes the EPID and a high-resolution timestamp used for output ordering + * consistency. + * + * base of data buffer ---> +--------+--------------------+--------+ + * | rechdr | data | rechdr | + * +--------+------+--------+----+--------+ + * | data | rechdr | data | + * +---------------+--------+-------------+ + * | data, cont. | + * +--------+--------------------+--------+ + * | rechdr | data | | + * +--------+--------------------+ | + * | || | + * | || | + * | \/ | + * : : + * . . + * . . + * . . + * : : + * | | + * limit of data buffer ---> +--------------------------------------+ * * When evaluating an ECB, dtrace_probe() determines if the ECB's needs of the * principal buffer (both scratch and payload) exceed the available space. If From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:30:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79C17106564A; Sun, 19 Aug 2012 09:30:59 +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 5A86F8FC0A; Sun, 19 Aug 2012 09:30:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9Uxpf057891; Sun, 19 Aug 2012 09:30:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9Uxkp057889; Sun, 19 Aug 2012 09:30:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190930.q7J9Uxkp057889@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:30:59 +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: r239387 - vendor/illumos/dist/man/man1m 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, 19 Aug 2012 09:30:59 -0000 Author: mm Date: Sun Aug 19 09:30:58 2012 New Revision: 239387 URL: http://svn.freebsd.org/changeset/base/239387 Log: Update vendor/illumos to illumos-gate 13773:00c2a08cf1bb References: https://www.illumos.org/issues/2399 (zfs manual page) Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Sun Aug 19 09:21:20 2012 (r239386) +++ vendor/illumos/dist/man/man1m/zfs.1m Sun Aug 19 09:30:58 2012 (r239387) @@ -7,7 +7,7 @@ .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .\" Copyright 2011 Joshua M. Clulow -.TH ZFS 1M "28 Jul 2011" +.TH ZFS 1M "Aug 16, 2012" .SH NAME zfs \- configures ZFS file systems .SH SYNOPSIS @@ -219,6 +219,10 @@ zfs \- configures ZFS file systems \fBzfs\fR \fBrelease\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR... .fi +.LP +.nf +\fBzfs\fR \fBdiff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR + .SH DESCRIPTION .sp .LP @@ -1758,7 +1762,7 @@ filesystem's oldest or newest snapshot w .sp Multiple snapshots (or ranges of snapshots) of the same filesystem or volume may be specified -in a comma-separated list of snapshots. +in a comma-separated list of snapshots. Only the snapshot's short name (the part after the \fB@\fR) should be specified when using a range or comma-separated list to identify multiple snapshots. @@ -1831,8 +1835,6 @@ options, as they can destroy large porti behavior for mounted file systems in use. .RE -.RE - .sp .ne 2 .na @@ -3057,6 +3059,9 @@ clone subcommand Must als ability in the origin file system create subcommand Must also have the 'mount' ability destroy subcommand Must also have the 'mount' ability +diff subcommand Allows lookup of paths within a dataset + given an object number, and the ability to + create snapshots necessary to 'zfs diff'. mount subcommand Allows mount/umount of ZFS datasets promote subcommand Must also have the 'mount' and 'promote' ability in the origin file system @@ -3267,6 +3272,68 @@ Recursively releases a hold with the giv descendent file systems. .RE +.sp +.ne 2 +.na +\fBzfs diff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR +.ad +.sp .6 +.RS 4n +Display the difference between a snapshot of a given filesystem and another +snapshot of that filesystem from a later time or the current contents of the +filesystem. The first column is a character indicating the type of change, +the other columns indicate pathname, new pathname (in case of rename), change +in link count, and optionally file type and/or change time. + +The types of change are: +.in +2 +.nf +- The path has been removed ++ The path has been created +M The path has been modified +R The path has been renamed +.fi +.in -2 +.sp +.ne 2 +.na +\fB-F\fR +.ad +.sp .6 +.RS 4n +Display an indication of the type of file, in a manner similar to the \fB-F\fR +option of \fBls\fR(1). +.in +2 +.nf +B Block device +C Character device +/ Directory +> Door +| Named pipe +@ Symbolic link +P Event port += Socket +F Regular file +.fi +.in -2 +.RE +.sp +.ne 2 +.na +\fB-H\fR +.ad +.sp .6 +.RS 4n +Give more parseable tab-separated output, without header lines and without arrows. +.RE +.sp +.ne 2 +.na +\fB-t\fR +.ad +.sp .6 +.RS 4n +Display the path's inode change time as the first column of output. .RE .SH EXAMPLES @@ -3650,7 +3717,7 @@ access for system \fBneo\fR on the \fBta .sp .in +2 .nf -# \fB# zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR +# \fBzfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR .fi .in -2 .sp @@ -3706,7 +3773,7 @@ The permissions on \fBtank/users\fR are .sp .in +2 .nf -# \fB# zfs allow staff create,mount tank/users\fR +# \fBzfs allow staff create,mount tank/users\fR # \fBzfs allow -c destroy tank/users\fR # \fBzfs allow tank/users\fR ------------------------------------------------------------- @@ -3795,6 +3862,28 @@ Local+Descendent permissions on (tank/us .in -2 .sp +.LP +\fBExample 23\fR Showing the differences between a snapshot and a ZFS Dataset +.sp +.LP +The following example shows how to see what has changed between a prior +snapshot of a ZFS Dataset and its current state. The \fB-F\fR option is used +to indicate type information for the files affected. + +.sp +.in +2 +.nf +# zfs diff -F tank/test@before tank/test +M / /tank/test/ +M F /tank/test/linked (+1) +R F /tank/test/oldname -> /tank/test/newname +- F /tank/test/deleted ++ F /tank/test/created +M F /tank/test/modified +.fi +.in -2 +.sp + .SH EXIT STATUS .sp .LP From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:34:04 2012 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 B1765106564A; Sun, 19 Aug 2012 09:34:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 923318FC0A; Sun, 19 Aug 2012 09:34:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9Y48k058292; Sun, 19 Aug 2012 09:34:04 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9Y4pl058288; Sun, 19 Aug 2012 09:34:04 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190934.q7J9Y4pl058288@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:34:04 +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: r239388 - in vendor-sys/illumos/dist/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: Sun, 19 Aug 2012 09:34:04 -0000 Author: mm Date: Sun Aug 19 09:34:04 2012 New Revision: 239388 URL: http://svn.freebsd.org/changeset/base/239388 Log: Update vendor-sys/illumos/dist to illumos-gate 13772:2579580ac955 References: https://www.illumos.org/issues/3085 (zfs diff panics) Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor-sys/illumos/dist/uts/common/Makefile.files vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Sun Aug 19 09:30:58 2012 (r239387) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Sun Aug 19 09:34:04 2012 (r239388) @@ -1846,7 +1846,7 @@ IDM_OBJS += $(IDM_SHARED_OBJS) \ VR_OBJS += vr.o -ATGE_OBJS += atge_main.o atge_l1e.o atge_mii.o atge_l1.o +ATGE_OBJS += atge_main.o atge_l1e.o atge_mii.o atge_l1.o atge_l1c.o YGE_OBJS = yge.o @@ -1921,7 +1921,7 @@ IXGBE_OBJS = ixgbe_82598.o ixgbe_8259 ixgbe_buf.o ixgbe_debug.o ixgbe_gld.o \ ixgbe_log.o ixgbe_main.o \ ixgbe_osdep.o ixgbe_rx.o ixgbe_stat.o \ - ixgbe_tx.o + ixgbe_tx.o ixgbe_x540.o ixgbe_mbx.o # # NIU 10G/1G driver module Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:30:58 2012 (r239387) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:34:04 2012 (r239388) @@ -3903,6 +3903,10 @@ dsl_dataset_user_release_sync(void *arg1 VERIFY(error == 0 || error == ENOENT); zapobj = ds->ds_phys->ds_userrefs_obj; VERIFY(0 == zap_remove(mos, zapobj, ra->htag, tx)); + + spa_history_log_internal_ds(ds, "release", tx, + "tag = %s refs now = %lld", ra->htag, (longlong_t)refs); + if (ds->ds_userrefs == 0 && ds->ds_phys->ds_num_children == 1 && DS_IS_DEFER_DESTROY(ds)) { struct dsl_ds_destroyarg dsda = {0}; @@ -3913,9 +3917,6 @@ dsl_dataset_user_release_sync(void *arg1 /* We already did the destroy_check */ dsl_dataset_destroy_sync(&dsda, tag, tx); } - - spa_history_log_internal_ds(ds, "release", tx, - "tag = %s refs now = %lld", ra->htag, (longlong_t)refs); } static int Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c Sun Aug 19 09:30:58 2012 (r239387) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c Sun Aug 19 09:34:04 2012 (r239388) @@ -440,8 +440,10 @@ log_internal(nvlist_t *nvl, const char * * If this is part of creating a pool, not everything is * initialized yet, so don't bother logging the internal events. */ - if (tx->tx_txg == TXG_INITIAL) + if (tx->tx_txg == TXG_INITIAL) { + fnvlist_free(nvl); return; + } msg = kmem_alloc(vsnprintf(NULL, 0, fmt, adx) + 1, KM_SLEEP); (void) vsprintf(msg, fmt, adx); From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:59:42 2012 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 5C86E106566C; Sun, 19 Aug 2012 09:59:42 +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 4732F8FC14; Sun, 19 Aug 2012 09:59:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9xgEL060993; Sun, 19 Aug 2012 09:59:42 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9xg4H060991; Sun, 19 Aug 2012 09:59:42 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190959.q7J9xg4H060991@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239389 - 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: Sun, 19 Aug 2012 09:59:42 -0000 Author: mm Date: Sun Aug 19 09:59:41 2012 New Revision: 239389 URL: http://svn.freebsd.org/changeset/base/239389 Log: Backport fix for vendor issue #3085 3085 zfs diff panics, then panics in a loop on booting References: https://www.illumos.org/issues/3085 PR: kern/170763 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate (r13772) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:34:04 2012 (r239388) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:59:41 2012 (r239389) @@ -3969,6 +3969,11 @@ dsl_dataset_user_release_sync(void *arg1 VERIFY(error == 0 || error == ENOENT); zapobj = ds->ds_phys->ds_userrefs_obj; VERIFY(0 == zap_remove(mos, zapobj, ra->htag, tx)); + + spa_history_log_internal(LOG_DS_USER_RELEASE, + dp->dp_spa, tx, "<%s> %lld dataset = %llu", + ra->htag, (longlong_t)refs, dsobj); + if (ds->ds_userrefs == 0 && ds->ds_phys->ds_num_children == 1 && DS_IS_DEFER_DESTROY(ds)) { struct dsl_ds_destroyarg dsda = {0}; @@ -3979,10 +3984,6 @@ dsl_dataset_user_release_sync(void *arg1 /* We already did the destroy_check */ dsl_dataset_destroy_sync(&dsda, tag, tx); } - - spa_history_log_internal(LOG_DS_USER_RELEASE, - dp->dp_spa, tx, "<%s> %lld dataset = %llu", - ra->htag, (longlong_t)refs, dsobj); } static int From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:31:52 2012 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 AB7DF106564A; Sun, 19 Aug 2012 10:31:52 +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 90FD88FC14; Sun, 19 Aug 2012 10:31:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAVqLV070169; Sun, 19 Aug 2012 10:31:52 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAVpir070137; Sun, 19 Aug 2012 10:31:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208191031.q7JAVpir070137@svn.freebsd.org> From: Dimitry Andric Date: Sun, 19 Aug 2012 10:31:51 +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: r239390 - in vendor/llvm/dist: . autoconf include/llvm include/llvm/ADT include/llvm/Analysis include/llvm/CodeGen include/llvm/MC include/llvm/Support include/llvm/Target lib/Analysis ... 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, 19 Aug 2012 10:31:52 -0000 Author: dim Date: Sun Aug 19 10:31:50 2012 New Revision: 239390 URL: http://svn.freebsd.org/changeset/base/239390 Log: Vendor import of llvm trunk r162107: http://llvm.org/svn/llvm-project/llvm/trunk@162107 Added: vendor/llvm/dist/include/llvm/MC/MCFixedLenDisassembler.h vendor/llvm/dist/test/CodeGen/Mips/return-vector-float4.ll vendor/llvm/dist/test/CodeGen/X86/2012-08-17-legalizer-crash.ll vendor/llvm/dist/test/CodeGen/X86/pr11334.ll vendor/llvm/dist/test/Transforms/GVN/edge.ll Deleted: vendor/llvm/dist/test/CodeGen/X86/unreachable-stack-protector.ll Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/Makefile vendor/llvm/dist/Makefile.config.in vendor/llvm/dist/autoconf/configure.ac vendor/llvm/dist/configure vendor/llvm/dist/include/llvm/ADT/DenseMap.h vendor/llvm/dist/include/llvm/ADT/VariadicFunction.h vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h vendor/llvm/dist/include/llvm/Analysis/Dominators.h vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/IntrinsicsHexagon.td vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h vendor/llvm/dist/include/llvm/Support/AlignOf.h vendor/llvm/dist/include/llvm/Support/COFF.h vendor/llvm/dist/include/llvm/Support/Compiler.h vendor/llvm/dist/include/llvm/Support/FileSystem.h vendor/llvm/dist/include/llvm/Support/LEB128.h vendor/llvm/dist/include/llvm/Support/NoFolder.h vendor/llvm/dist/include/llvm/Target/Target.td vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/ExecutionEngine/JIT/JITMemoryManager.cpp vendor/llvm/dist/lib/Support/APFloat.cpp vendor/llvm/dist/lib/Support/Unix/PathV2.inc vendor/llvm/dist/lib/Support/Windows/PathV2.inc vendor/llvm/dist/lib/Target/ARM/ARMAsmPrinter.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.h vendor/llvm/dist/lib/Target/ARM/ARMFastISel.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMInstrNEON.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/ARM/ARMInstrVFP.td vendor/llvm/dist/lib/Target/ARM/Disassembler/ARMDisassembler.cpp vendor/llvm/dist/lib/Target/Mips/Disassembler/MipsDisassembler.cpp vendor/llvm/dist/lib/Target/Mips/Mips.td vendor/llvm/dist/lib/Target/Mips/MipsCallingConv.td vendor/llvm/dist/lib/Target/Mips/MipsSubtarget.h vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h vendor/llvm/dist/lib/Target/X86/X86InstrFragmentsSIMD.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/CodeGenPrepare.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/VMCore/Dominators.cpp vendor/llvm/dist/lib/VMCore/Verifier.cpp vendor/llvm/dist/test/Analysis/ScalarEvolution/2012-05-29-MulAddRec.ll vendor/llvm/dist/test/CodeGen/ARM/2011-03-15-LdStMultipleBug.ll vendor/llvm/dist/test/CodeGen/ARM/2011-11-29-128bitArithmetics.ll vendor/llvm/dist/test/CodeGen/ARM/fast-isel-call.ll vendor/llvm/dist/test/CodeGen/ARM/fp16.ll vendor/llvm/dist/test/CodeGen/ARM/select.ll vendor/llvm/dist/test/CodeGen/ARM/select_xform.ll vendor/llvm/dist/test/CodeGen/ARM/unaligned_load_store.ll vendor/llvm/dist/test/CodeGen/Generic/donothing.ll vendor/llvm/dist/test/CodeGen/Thumb2/machine-licm.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-select_xform.ll vendor/llvm/dist/test/CodeGen/X86/2011-08-29-InitOrder.ll vendor/llvm/dist/test/CodeGen/X86/fast-isel-x86.ll vendor/llvm/dist/test/CodeGen/X86/full-lsr.ll vendor/llvm/dist/test/CodeGen/X86/memcpy.ll vendor/llvm/dist/test/Instrumentation/AddressSanitizer/basic.ll vendor/llvm/dist/test/Transforms/GVN/rle.ll vendor/llvm/dist/test/Transforms/Inline/always-inline.ll vendor/llvm/dist/test/Transforms/InstCombine/memcpy.ll vendor/llvm/dist/test/Transforms/InstCombine/objsize.ll vendor/llvm/dist/test/Transforms/ObjCARC/basic.ll vendor/llvm/dist/test/Transforms/ObjCARC/invoke.ll vendor/llvm/dist/unittests/ADT/APFloatTest.cpp vendor/llvm/dist/unittests/Support/AlignOfTest.cpp vendor/llvm/dist/unittests/Support/Path.cpp vendor/llvm/dist/utils/TableGen/CodeGenInstruction.cpp vendor/llvm/dist/utils/TableGen/CodeGenInstruction.h vendor/llvm/dist/utils/TableGen/CodeGenRegisters.cpp vendor/llvm/dist/utils/TableGen/CodeGenRegisters.h vendor/llvm/dist/utils/TableGen/FixedLenDecoderEmitter.cpp vendor/llvm/dist/utils/TableGen/InstrInfoEmitter.cpp vendor/llvm/dist/utils/TableGen/RegisterInfoEmitter.cpp vendor/llvm/dist/utils/lit/lit/main.py Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/CMakeLists.txt Sun Aug 19 10:31:50 2012 (r239390) @@ -128,10 +128,15 @@ if( LLVM_TARGETS_TO_BUILD STREQUAL "all" set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} ) endif() +set(LLVM_TARGETS_TO_BUILD + ${LLVM_TARGETS_TO_BUILD} + ${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}) + set(LLVM_ENUM_TARGETS "") foreach(c ${LLVM_TARGETS_TO_BUILD}) list(FIND LLVM_ALL_TARGETS ${c} idx) - if( idx LESS 0 ) + list(FIND LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${c} idy) + if( idx LESS 0 AND idy LESS 0 ) message(FATAL_ERROR "The target `${c}' does not exist. It should be one of\n${LLVM_ALL_TARGETS}") else() @@ -139,11 +144,6 @@ foreach(c ${LLVM_TARGETS_TO_BUILD}) endif() endforeach(c) -set(LLVM_TARGETS_TO_BUILD - ${LLVM_TARGETS_TO_BUILD} - ${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD} - ) - set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm) include(AddLLVMDefinitions) Modified: vendor/llvm/dist/Makefile ============================================================================== --- vendor/llvm/dist/Makefile Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/Makefile Sun Aug 19 10:31:50 2012 (r239390) @@ -244,13 +244,13 @@ build-for-llvm-top: SVN = svn SVN-UPDATE-OPTIONS = AWK = awk -SUB-SVN-DIRS = $(AWK) '/\?\ \ \ \ \ \ / {print $$2}' \ +SUB-SVN-DIRS = $(AWK) '/I|\? / {print $$2}' \ | LC_ALL=C xargs $(SVN) info 2>/dev/null \ | $(AWK) '/^Path:\ / {print $$2}' update: $(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT) - @ $(SVN) status $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update + @ $(SVN) status --no-ignore $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update happiness: update all check-all Modified: vendor/llvm/dist/Makefile.config.in ============================================================================== --- vendor/llvm/dist/Makefile.config.in Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/Makefile.config.in Sun Aug 19 10:31:50 2012 (r239390) @@ -258,6 +258,11 @@ ENABLE_WERROR = @ENABLE_WERROR@ #DEBUG_SYMBOLS = 1 @DEBUG_SYMBOLS@ +# When KEEP_SYMBOLS is enabled, installed executables will never have their +# symbols stripped. +#KEEP_SYMBOLS = 1 +@KEEP_SYMBOLS@ + # The compiler flags to use for optimized builds. OPTIMIZE_OPTION := @OPTIMIZE_OPTION@ Modified: vendor/llvm/dist/autoconf/configure.ac ============================================================================== --- vendor/llvm/dist/autoconf/configure.ac Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/autoconf/configure.ac Sun Aug 19 10:31:50 2012 (r239390) @@ -542,6 +542,15 @@ else AC_SUBST(DEBUG_SYMBOLS,[[DEBUG_SYMBOLS=1]]) fi +dnl --enable-keep-symbols : do not strip installed executables +AC_ARG_ENABLE(keep-symbols, + AS_HELP_STRING(--enable-keep-symbols,[Do not strip installed executables)]),,enableval=no) +if test ${enableval} = "no" ; then + AC_SUBST(KEEP_SYMBOLS,[[]]) +else + AC_SUBST(KEEP_SYMBOLS,[[KEEP_SYMBOLS=1]]) +fi + dnl --enable-jit: check whether they want to enable the jit AC_ARG_ENABLE(jit, AS_HELP_STRING(--enable-jit, Modified: vendor/llvm/dist/configure ============================================================================== --- vendor/llvm/dist/configure Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/configure Sun Aug 19 10:31:50 2012 (r239390) @@ -693,6 +693,7 @@ ENABLE_EXPENSIVE_CHECKS EXPENSIVE_CHECKS DEBUG_RUNTIME DEBUG_SYMBOLS +KEEP_SYMBOLS JIT TARGET_HAS_JIT ENABLE_DOCS @@ -1408,6 +1409,7 @@ Optional Features: NO) --enable-debug-symbols Build compiler with debug symbols (default is NO if optimization is on and YES if it's off) + --enable-keep-symbols Do not strip installed executables) --enable-jit Enable Just In Time Compiling (default is YES) --enable-docs Build documents (default is YES) --enable-doxygen Build doxygen documentation (default is NO) @@ -5158,6 +5160,21 @@ else fi +# Check whether --enable-keep-symbols was given. +if test "${enable_keep_symbols+set}" = set; then + enableval=$enable_keep_symbols; +else + enableval=no +fi + +if test ${enableval} = "no" ; then + KEEP_SYMBOLS= + +else + KEEP_SYMBOLS=KEEP_SYMBOLS=1 + +fi + # Check whether --enable-jit was given. if test "${enable_jit+set}" = set; then enableval=$enable_jit; @@ -10272,7 +10289,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <conf$$subs.sed <<_ACEOF +ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim ENABLE_PIC!$ENABLE_PIC$ac_delim ENABLE_SHARED!$ENABLE_SHARED$ac_delim ENABLE_EMBED_STDCXX!$ENABLE_EMBED_STDCXX$ac_delim @@ -22293,7 +22311,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 Modified: vendor/llvm/dist/include/llvm/ADT/DenseMap.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/DenseMap.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/ADT/DenseMap.h Sun Aug 19 10:31:50 2012 (r239390) @@ -687,8 +687,7 @@ class SmallDenseMap /// A "union" of an inline bucket array and the struct representing /// a large bucket. This union will be discriminated by the 'Small' bit. - typename AlignedCharArray::union_type - storage; + AlignedCharArrayUnion storage; public: explicit SmallDenseMap(unsigned NumInitBuckets = 0) { @@ -834,8 +833,7 @@ public: return; // Nothing to do. // First move the inline buckets into a temporary storage. - typename AlignedCharArray::union_type - TmpStorage; + AlignedCharArrayUnion TmpStorage; BucketT *TmpBegin = reinterpret_cast(TmpStorage.buffer); BucketT *TmpEnd = TmpBegin; Modified: vendor/llvm/dist/include/llvm/ADT/VariadicFunction.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/VariadicFunction.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/ADT/VariadicFunction.h Sun Aug 19 10:31:50 2012 (r239390) @@ -206,7 +206,7 @@ struct VariadicFunction2 { ResultT operator()(Param0T P0, Param1T P1, \ LLVM_COMMA_JOIN ## N(const ArgT &A)) const { \ const ArgT *const Args[] = { LLVM_COMMA_JOIN ## N(&A) }; \ - return Func(P0, P1, makeAraryRef(Args)); \ + return Func(P0, P1, makeArrayRef(Args)); \ } LLVM_DEFINE_OVERLOAD(1) LLVM_DEFINE_OVERLOAD(2) Modified: vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h Sun Aug 19 10:31:50 2012 (r239390) @@ -122,6 +122,7 @@ private: bool calcLoopBranchHeuristics(BasicBlock *BB); bool calcZeroHeuristics(BasicBlock *BB); bool calcFloatingPointHeuristics(BasicBlock *BB); + bool calcInvokeHeuristics(BasicBlock *BB); }; } Modified: vendor/llvm/dist/include/llvm/Analysis/Dominators.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/Dominators.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Analysis/Dominators.h Sun Aug 19 10:31:50 2012 (r239390) @@ -705,7 +705,20 @@ DominatorTreeBase::properlyDomina EXTERN_TEMPLATE_INSTANTIATION(class DominatorTreeBase); -class BasicBlockEdge; +class BasicBlockEdge { + const BasicBlock *Start; + const BasicBlock *End; +public: + BasicBlockEdge(const BasicBlock *Start_, const BasicBlock *End_) : + Start(Start_), End(End_) { } + const BasicBlock *getStart() const { + return Start; + } + const BasicBlock *getEnd() const { + return End; + } + bool isSingleEdge() const; +}; //===------------------------------------- /// DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h Sun Aug 19 10:31:50 2012 (r239390) @@ -420,6 +420,12 @@ public: return hasProperty(MCID::Bitcast, Type); } + /// isSelect - Return true if this instruction is a select instruction. + /// + bool isSelect(QueryType Type = IgnoreBundle) const { + return hasProperty(MCID::Select, Type); + } + /// isNotDuplicable - Return true if this instruction cannot be safely /// duplicated. For example, if the instruction has a unique labels attached /// to it, duplicating it would cause multiple definition errors. Modified: vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h Sun Aug 19 10:31:50 2012 (r239390) @@ -146,7 +146,8 @@ public: inline bool isMachineOpcode() const; inline unsigned getMachineOpcode() const; inline const DebugLoc getDebugLoc() const; - + inline void dump() const; + inline void dumpr() const; /// reachesChainWithoutSideEffects - Return true if this operand (which must /// be a chain) reaches the specified operand without crossing any @@ -806,7 +807,12 @@ inline bool SDValue::hasOneUse() const { inline const DebugLoc SDValue::getDebugLoc() const { return Node->getDebugLoc(); } - +inline void SDValue::dump() const { + return Node->dump(); +} +inline void SDValue::dumpr() const { + return Node->dumpr(); +} // Define inline functions from the SDUse class. inline void SDUse::set(const SDValue &V) { Modified: vendor/llvm/dist/include/llvm/IntrinsicsHexagon.td ============================================================================== --- vendor/llvm/dist/include/llvm/IntrinsicsHexagon.td Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/IntrinsicsHexagon.td Sun Aug 19 10:31:50 2012 (r239390) @@ -15,7 +15,7 @@ // // All Hexagon intrinsics start with "llvm.hexagon.". let TargetPrefix = "hexagon" in { - /// Hexagon_Intrinsic - Base class for all altivec intrinsics. + /// Hexagon_Intrinsic - Base class for all Hexagon intrinsics. class Hexagon_Intrinsic ret_types, list param_types, list properties> Added: vendor/llvm/dist/include/llvm/MC/MCFixedLenDisassembler.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/MC/MCFixedLenDisassembler.h Sun Aug 19 10:31:50 2012 (r239390) @@ -0,0 +1,32 @@ +//===-- llvm/MC/MCFixedLenDisassembler.h - Decoder driver -------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// Fixed length disassembler decoder state machine driver. +//===----------------------------------------------------------------------===// +#ifndef MCFIXEDLENDISASSEMBLER_H +#define MCFIXEDLENDISASSEMBLER_H + +namespace llvm { + +namespace MCD { +// Disassembler state machine opcodes. +enum DecoderOps { + OPC_ExtractField = 1, // OPC_ExtractField(uint8_t Start, uint8_t Len) + OPC_FilterValue, // OPC_FilterValue(uleb128 Val, uint16_t NumToSkip) + OPC_CheckField, // OPC_CheckField(uint8_t Start, uint8_t Len, + // uleb128 Val, uint16_t NumToSkip) + OPC_CheckPredicate, // OPC_CheckPredicate(uleb128 PIdx, uint16_t NumToSkip) + OPC_Decode, // OPC_Decode(uleb128 Opcode, uleb128 DIdx) + OPC_SoftFail, // OPC_SoftFail(uleb128 PMask, uleb128 NMask) + OPC_Fail // OPC_Fail() +}; + +} // namespace MCDecode +} // namespace llvm + +#endif Modified: vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h ============================================================================== --- vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h Sun Aug 19 10:31:50 2012 (r239390) @@ -107,6 +107,7 @@ namespace MCID { Compare, MoveImm, Bitcast, + Select, DelaySlot, FoldableAsLoad, MayLoad, @@ -282,6 +283,12 @@ public: return Flags & (1 << MCID::Bitcast); } + /// isSelect - Return true if this is a select instruction. + /// + bool isSelect() const { + return Flags & (1 << MCID::Select); + } + /// isNotDuplicable - Return true if this instruction cannot be safely /// duplicated. For example, if the instruction has a unique labels attached /// to it, duplicating it would cause multiple definition errors. Modified: vendor/llvm/dist/include/llvm/Support/AlignOf.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/AlignOf.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/AlignOf.h Sun Aug 19 10:31:50 2012 (r239390) @@ -107,8 +107,8 @@ LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT // Any larger and MSVC complains. #undef LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT -/// \brief This class template exposes a typedef for type containing a suitable -/// aligned character array to hold elements of any of up to four types. +/// \brief This union template exposes a suitably aligned and sized character +/// array member which can hold elements of any of up to four types. /// /// These types may be arrays, structs, or any other types. The goal is to /// produce a union type containing a character array which, when used, forms @@ -116,7 +116,8 @@ LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT /// than four types can be added at the cost of more boiler plate. template -class AlignedCharArray { +union AlignedCharArrayUnion { +private: class AlignerImpl { T1 t1; T2 t2; T3 t3; T4 t4; @@ -127,6 +128,12 @@ class AlignedCharArray { }; public: + /// \brief The character array buffer for use by clients. + /// + /// No other member of this union should be referenced. The exist purely to + /// constrain the layout of this character array. + char buffer[sizeof(SizerImpl)]; + // Sadly, Clang and GCC both fail to align a character array properly even // with an explicit alignment attribute. To work around this, we union // the character array that will actually be used with a struct that contains @@ -134,16 +141,10 @@ public: // and GCC will properly register the alignment of a struct containing an // aligned member, and this alignment should carry over to the character // array in the union. - union union_type { - // This is the only member of the union which should be used by clients: - char buffer[sizeof(SizerImpl)]; - - // This member of the union only exists to force the alignment. - struct { - typename llvm::AlignedCharArrayImpl::Alignment>::type - nonce_inner_member; - } nonce_member; - }; + struct { + typename llvm::AlignedCharArrayImpl::Alignment>::type + nonce_inner_member; + } nonce_member; }; } // end namespace llvm Modified: vendor/llvm/dist/include/llvm/Support/COFF.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/COFF.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/COFF.h Sun Aug 19 10:31:50 2012 (r239390) @@ -50,7 +50,7 @@ namespace COFF { }; enum MachineTypes { - MT_Invalid = -1, + MT_Invalid = 0xffff, IMAGE_FILE_MACHINE_UNKNOWN = 0x0, IMAGE_FILE_MACHINE_AM33 = 0x13, @@ -142,7 +142,7 @@ namespace COFF { /// Storage class tells where and what the symbol represents enum SymbolStorageClass { - SSC_Invalid = -1, + SSC_Invalid = 0xff, IMAGE_SYM_CLASS_END_OF_FUNCTION = -1, ///< Physical end of function IMAGE_SYM_CLASS_NULL = 0, ///< No symbol @@ -220,7 +220,7 @@ namespace COFF { }; enum SectionCharacteristics { - SC_Invalid = -1, + SC_Invalid = 0xffffffff, IMAGE_SCN_TYPE_NO_PAD = 0x00000008, IMAGE_SCN_CNT_CODE = 0x00000020, Modified: vendor/llvm/dist/include/llvm/Support/Compiler.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/Compiler.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/Compiler.h Sun Aug 19 10:31:50 2012 (r239390) @@ -38,6 +38,25 @@ #define llvm_move(value) (value) #endif +/// LLVM_DELETED_FUNCTION - Expands to = delete if the compiler supports it. +/// Use to mark functions as uncallable. Member functions with this should +/// be declared private so that some behaivor is kept in C++03 mode. +/// +/// class DontCopy { +/// private: +/// DontCopy(const DontCopy&) LLVM_DELETED_FUNCTION; +/// DontCopy &operator =(const DontCopy&) LLVM_DELETED_FUNCTION; +/// public: +/// ... +/// }; +#if (__has_feature(cxx_deleted_functions) \ + || defined(__GXX_EXPERIMENTAL_CXX0X__)) + // No version of MSVC currently supports this. +#define LLVM_DELETED_FUNCTION = delete +#else +#define LLVM_DELETED_FUNCTION +#endif + /// LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked /// into a shared library, then the class should be private to the library and /// not accessible from outside it. Can also be used to mark variables and Modified: vendor/llvm/dist/include/llvm/Support/FileSystem.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/FileSystem.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/FileSystem.h Sun Aug 19 10:31:50 2012 (r239390) @@ -28,6 +28,7 @@ #define LLVM_SUPPORT_FILE_SYSTEM_H #include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/DataTypes.h" @@ -576,6 +577,82 @@ error_code FindLibrary(const Twine &shor error_code GetMainExecutable(const char *argv0, void *MainAddr, SmallVectorImpl &result); +/// This class represents a memory mapped file. It is based on +/// boost::iostreams::mapped_file. +class mapped_file_region { + mapped_file_region() LLVM_DELETED_FUNCTION; + mapped_file_region(mapped_file_region&) LLVM_DELETED_FUNCTION; + mapped_file_region &operator =(mapped_file_region&) LLVM_DELETED_FUNCTION; + +public: + enum mapmode { + readonly, //< May only access map via const_data as read only. + readwrite, //< May access map via data and modify it. Written to path. + priv //< May modify via data, but changes are lost on destruction. + }; + +private: + /// Platform specific mapping state. + mapmode Mode; + uint64_t Size; + void *Mapping; +#if LLVM_ON_WIN32 + int FileDescriptor; + void *FileHandle; + void *FileMappingHandle; +#endif + + error_code init(int FD, uint64_t Offset); + +public: + typedef char char_type; + +#if LLVM_USE_RVALUE_REFERENCES + mapped_file_region(mapped_file_region&&); + mapped_file_region &operator =(mapped_file_region&&); +#endif + + /// Construct a mapped_file_region at \a path starting at \a offset of length + /// \a length and with access \a mode. + /// + /// \param path Path to the file to map. If it does not exist it will be + /// created. + /// \param mode How to map the memory. + /// \param length Number of bytes to map in starting at \a offset. If the file + /// is shorter than this, it will be extended. If \a length is + /// 0, the entire file will be mapped. + /// \param offset Byte offset from the beginning of the file where the map + /// should begin. Must be a multiple of + /// mapped_file_region::alignment(). + /// \param ec This is set to errc::success if the map was constructed + /// sucessfully. Otherwise it is set to a platform dependent error. + mapped_file_region(const Twine &path, + mapmode mode, + uint64_t length, + uint64_t offset, + error_code &ec); + + /// \param fd An open file descriptor to map. mapped_file_region takes + /// ownership. It must have been opended in the correct mode. + mapped_file_region(int fd, + mapmode mode, + uint64_t length, + uint64_t offset, + error_code &ec); + + ~mapped_file_region(); + + mapmode flags() const; + uint64_t size() const; + char *data() const; + + /// Get a const view of the data. Modifying this memory has undefined + /// behaivor. + const char *const_data() const; + + /// \returns The minimum alignment offset must be. + static int alignment(); +}; /// @brief Memory maps the contents of a file /// Modified: vendor/llvm/dist/include/llvm/Support/LEB128.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/LEB128.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/LEB128.h Sun Aug 19 10:31:50 2012 (r239390) @@ -19,7 +19,7 @@ namespace llvm { -/// Utility function to encode a SLEB128 value. +/// Utility function to encode a SLEB128 value to an output stream. static inline void encodeSLEB128(int64_t Value, raw_ostream &OS) { bool More; do { @@ -34,7 +34,7 @@ static inline void encodeSLEB128(int64_t } while (More); } -/// Utility function to encode a ULEB128 value. +/// Utility function to encode a ULEB128 value to an output stream. static inline void encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned Padding = 0) { do { @@ -53,6 +53,43 @@ static inline void encodeULEB128(uint64_ } } +/// Utility function to encode a ULEB128 value to a buffer. Returns +/// the length in bytes of the encoded value. +static inline unsigned encodeULEB128(uint64_t Value, uint8_t *p, + unsigned Padding = 0) { + uint8_t *orig_p = p; + do { + uint8_t Byte = Value & 0x7f; + Value >>= 7; + if (Value != 0 || Padding != 0) + Byte |= 0x80; // Mark this byte that that more bytes will follow. + *p++ = Byte; + } while (Value != 0); + + // Pad with 0x80 and emit a null byte at the end. + if (Padding != 0) { + for (; Padding != 1; --Padding) + *p++ = '\x80'; + *p++ = '\x00'; + } + return (unsigned)(p - orig_p); +} + + +/// Utility function to decode a ULEB128 value. +static inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n = 0) { + const uint8_t *orig_p = p; + uint64_t Value = 0; + unsigned Shift = 0; + do { + Value += (*p & 0x7f) << Shift; + Shift += 7; + } while (*p++ >= 128); + if (n) + *n = (unsigned)(p - orig_p); + return Value; +} + } // namespace llvm #endif // LLVM_SYSTEM_LEB128_H Modified: vendor/llvm/dist/include/llvm/Support/NoFolder.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/NoFolder.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/NoFolder.h Sun Aug 19 10:31:50 2012 (r239390) @@ -181,6 +181,12 @@ public: ArrayRef IdxList) const { return ConstantExpr::getGetElementPtr(C, IdxList); } + Constant *CreateGetElementPtr(Constant *C, Constant *Idx) const { + // This form of the function only exists to avoid ambiguous overload + // warnings about whether to convert Idx to ArrayRef or + // ArrayRef. + return ConstantExpr::getGetElementPtr(C, Idx); + } Instruction *CreateGetElementPtr(Constant *C, ArrayRef IdxList) const { return GetElementPtrInst::Create(C, IdxList); @@ -190,6 +196,12 @@ public: ArrayRef IdxList) const { return ConstantExpr::getInBoundsGetElementPtr(C, IdxList); } + Constant *CreateInBoundsGetElementPtr(Constant *C, Constant *Idx) const { + // This form of the function only exists to avoid ambiguous overload + // warnings about whether to convert Idx to ArrayRef or + // ArrayRef. + return ConstantExpr::getInBoundsGetElementPtr(C, Idx); + } Instruction *CreateInBoundsGetElementPtr(Constant *C, ArrayRef IdxList) const { return GetElementPtrInst::CreateInBounds(C, IdxList); Modified: vendor/llvm/dist/include/llvm/Target/Target.td ============================================================================== --- vendor/llvm/dist/include/llvm/Target/Target.td Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Target/Target.td Sun Aug 19 10:31:50 2012 (r239390) @@ -28,6 +28,24 @@ class SubRegIndex comp // ComposedOf - A list of two SubRegIndex instances, [A, B]. // This indicates that this SubRegIndex is the result of composing A and B. list ComposedOf = comps; + + // CoveringSubRegIndices - A list of two or more sub-register indexes that + // cover this sub-register. + // + // This field should normally be left blank as TableGen can infer it. + // + // TableGen automatically detects sub-registers that straddle the registers + // in the SubRegs field of a Register definition. For example: + // + // Q0 = dsub_0 -> D0, dsub_1 -> D1 + // Q1 = dsub_0 -> D2, dsub_1 -> D3 + // D1_D2 = dsub_0 -> D1, dsub_1 -> D2 + // QQ0 = qsub_0 -> Q0, qsub_1 -> Q1 + // + // TableGen will infer that D1_D2 is a sub-register of QQ0. It will be given + // the synthetic index dsub_1_dsub_2 unless some SubRegIndex is defined with + // CoveringSubRegIndices = [dsub_1, dsub_2]. + list CoveringSubRegIndices = []; } // RegAltNameIndex - The alternate name set to use for register operands of @@ -321,6 +339,7 @@ class Instruction { bit isCompare = 0; // Is this instruction a comparison instruction? bit isMoveImm = 0; // Is this instruction a move immediate instruction? bit isBitcast = 0; // Is this instruction a bitcast instruction? + bit isSelect = 0; // Is this instruction a select instruction? bit isBarrier = 0; // Can control flow fall through this instruction? bit isCall = 0; // Is this instruction a call instruction? bit canFoldAsLoad = 0; // Can this be folded as a simple memory operand? Modified: vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h Sun Aug 19 10:31:50 2012 (r239390) @@ -413,6 +413,51 @@ public: llvm_unreachable("Target didn't implement TargetInstrInfo::insertSelect!"); } + /// analyzeSelect - Analyze the given select instruction, returning true if + /// it cannot be understood. It is assumed that MI->isSelect() is true. + /// + /// When successful, return the controlling condition and the operands that + /// determine the true and false result values. + /// + /// Result = SELECT Cond, TrueOp, FalseOp + /// + /// Some targets can optimize select instructions, for example by predicating + /// the instruction defining one of the operands. Such targets should set + /// Optimizable. + /// + /// @param MI Select instruction to analyze. + /// @param Cond Condition controlling the select. + /// @param TrueOp Operand number of the value selected when Cond is true. + /// @param FalseOp Operand number of the value selected when Cond is false. + /// @param Optimizable Returned as true if MI is optimizable. + /// @returns False on success. + virtual bool analyzeSelect(const MachineInstr *MI, + SmallVectorImpl &Cond, + unsigned &TrueOp, unsigned &FalseOp, + bool &Optimizable) const { + assert(MI && MI->isSelect() && "MI must be a select instruction"); + return true; + } + + /// optimizeSelect - Given a select instruction that was understood by + /// analyzeSelect and returned Optimizable = true, attempt to optimize MI by + /// merging it with one of its operands. Returns NULL on failure. + /// + /// When successful, returns the new select instruction. The client is + /// responsible for deleting MI. + /// + /// If both sides of the select can be optimized, PreferFalse is used to pick + /// a side. + /// + /// @param MI Optimizable select instruction. + /// @param PreferFalse Try to optimize FalseOp instead of TrueOp. + /// @returns Optimized instruction or NULL. + virtual MachineInstr *optimizeSelect(MachineInstr *MI, + bool PreferFalse = false) const { + // This function must be implemented if Optimizable is ever set. + llvm_unreachable("Target must implement TargetInstrInfo::optimizeSelect!"); + } + /// copyPhysReg - Emit instructions to copy a pair of physical registers. virtual void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, DebugLoc DL, Modified: vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -1,4 +1,4 @@ -//===-- BranchProbabilityInfo.cpp - Branch Probability Analysis -*- C++ -*-===// +//===-- BranchProbabilityInfo.cpp - Branch Probability Analysis -----------===// // // The LLVM Compiler Infrastructure // @@ -78,6 +78,19 @@ static const uint32_t ZH_NONTAKEN_WEIGHT static const uint32_t FPH_TAKEN_WEIGHT = 20; static const uint32_t FPH_NONTAKEN_WEIGHT = 12; +/// \brief Invoke-terminating normal branch taken weight +/// +/// This is the weight for branching to the normal destination of an invoke +/// instruction. We expect this to happen most of the time. Set the weight to an +/// absurdly high value so that nested loops subsume it. +static const uint32_t IH_TAKEN_WEIGHT = 1024 * 1024 - 1; + +/// \brief Invoke-terminating normal branch not-taken weight. +/// +/// This is the weight for branching to the unwind destination of an invoke +/// instruction. This is essentially never taken. +static const uint32_t IH_NONTAKEN_WEIGHT = 1; + // Standard weight value. Used when none of the heuristics set weight for // the edge. static const uint32_t NORMAL_WEIGHT = 16; @@ -371,6 +384,19 @@ bool BranchProbabilityInfo::calcFloating return true; } +bool BranchProbabilityInfo::calcInvokeHeuristics(BasicBlock *BB) { + InvokeInst *II = dyn_cast(BB->getTerminator()); + if (!II) + return false; + + BasicBlock *Normal = II->getNormalDest(); + BasicBlock *Unwind = II->getUnwindDest(); + + setEdgeWeight(BB, Normal, IH_TAKEN_WEIGHT); + setEdgeWeight(BB, Unwind, IH_NONTAKEN_WEIGHT); + return true; +} + void BranchProbabilityInfo::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); AU.setPreservesAll(); @@ -397,7 +423,9 @@ bool BranchProbabilityInfo::runOnFunctio continue; if (calcZeroHeuristics(*I)) continue; - calcFloatingPointHeuristics(*I); + if (calcFloatingPointHeuristics(*I)) + continue; + calcInvokeHeuristics(*I); } PostDominatedByUnreachable.clear(); Modified: vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -473,6 +473,10 @@ ObjectSizeOffsetVisitor::visitExtractVal } SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator(GEPOperator &GEP) { + // Ignore self-referencing GEPs, they can occur in unreachable code. + if (&GEP == GEP.getPointerOperand()) + return unknown(); + SizeOffsetType PtrData = compute(GEP.getPointerOperand()); if (!bothKnown(PtrData) || !GEP.hasAllConstantIndices()) return unknown(); Modified: vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -681,10 +681,10 @@ void MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { const MachineInstr *MI = MO->getParent(); const MCInstrDesc &MCID = MI->getDesc(); - const MCOperandInfo &MCOI = MCID.OpInfo[MONum]; // The first MCID.NumDefs operands must be explicit register defines if (MONum < MCID.getNumDefs()) { + const MCOperandInfo &MCOI = MCID.OpInfo[MONum]; if (!MO->isReg()) report("Explicit definition must be a register", MO, MONum); else if (!MO->isDef() && !MCOI.isOptionalDef()) @@ -692,6 +692,7 @@ MachineVerifier::visitMachineOperand(con else if (MO->isImplicit()) report("Explicit definition marked as implicit", MO, MONum); } else if (MONum < MCID.getNumOperands()) { + const MCOperandInfo &MCOI = MCID.OpInfo[MONum]; // Don't check if it's the last operand in a variadic instruction. See, // e.g., LDM_RET in the arm back end. if (MO->isReg() && Modified: vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -79,6 +79,7 @@ STATISTIC(NumBitcasts, "Number of bitc STATISTIC(NumCmps, "Number of compares eliminated"); STATISTIC(NumImmFold, "Number of move immediate folded"); STATISTIC(NumLoadFold, "Number of loads folded"); +STATISTIC(NumSelects, "Number of selects optimized"); namespace { class PeepholeOptimizer : public MachineFunctionPass { @@ -109,6 +110,7 @@ namespace { bool optimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB); bool optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB, SmallPtrSet &LocalMIs); + bool optimizeSelect(MachineInstr *MI); bool isMoveImmediate(MachineInstr *MI, SmallSet &ImmDefRegs, DenseMap &ImmDefMIs); @@ -386,6 +388,23 @@ bool PeepholeOptimizer::optimizeCmpInstr return false; } +/// Optimize a select instruction. +bool PeepholeOptimizer::optimizeSelect(MachineInstr *MI) { + unsigned TrueOp = 0; + unsigned FalseOp = 0; + bool Optimizable = false; + SmallVector Cond; + if (TII->analyzeSelect(MI, Cond, TrueOp, FalseOp, Optimizable)) + return false; + if (!Optimizable) + return false; + if (!TII->optimizeSelect(MI)) + return false; + MI->eraseFromParent(); + ++NumSelects; + return true; +} + /// isLoadFoldable - Check whether MI is a candidate for folding into a later /// instruction. We only fold loads to virtual registers and the virtual /// register defined has a single use. @@ -477,11 +496,11 @@ bool PeepholeOptimizer::runOnMachineFunc ImmDefMIs.clear(); FoldAsLoadDefReg = 0; - bool First = true; - MachineBasicBlock::iterator PMII; for (MachineBasicBlock::iterator MII = I->begin(), MIE = I->end(); MII != MIE; ) { MachineInstr *MI = &*MII; + // We may be erasing MI below, increment MII now. + ++MII; LocalMIs.insert(MI); // If there exists an instruction which belongs to the following @@ -490,28 +509,18 @@ bool PeepholeOptimizer::runOnMachineFunc MI->isKill() || MI->isInlineAsm() || MI->isDebugValue() || MI->hasUnmodeledSideEffects()) { FoldAsLoadDefReg = 0; - ++MII; continue; } if (MI->mayStore() || MI->isCall()) FoldAsLoadDefReg = 0; - if (MI->isBitcast()) { - if (optimizeBitcastInstr(MI, MBB)) { - // MI is deleted. - LocalMIs.erase(MI); - Changed = true; - MII = First ? I->begin() : llvm::next(PMII); - continue; - } - } else if (MI->isCompare()) { - if (optimizeCmpInstr(MI, MBB)) { - // MI is deleted. - LocalMIs.erase(MI); - Changed = true; - MII = First ? I->begin() : llvm::next(PMII); - continue; - } + if ((MI->isBitcast() && optimizeBitcastInstr(MI, MBB)) || + (MI->isCompare() && optimizeCmpInstr(MI, MBB)) || + (MI->isSelect() && optimizeSelect(MI))) { + // MI is deleted. + LocalMIs.erase(MI); + Changed = true; + continue; } if (isMoveImmediate(MI, ImmDefRegs, ImmDefMIs)) { @@ -542,14 +551,9 @@ bool PeepholeOptimizer::runOnMachineFunc // MI is replaced with FoldMI. Changed = true; - PMII = FoldMI; - MII = llvm::next(PMII); continue; } } - First = false; - PMII = MII; - ++MII; } } Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -2303,7 +2303,7 @@ TargetLowering::SimplifySetCC(EVT VT, SD N0.getOpcode() == ISD::AND) if (ConstantSDNode *AndRHS = dyn_cast(N0.getOperand(1))) { - EVT ShiftTy = DCI.isBeforeLegalize() ? + EVT ShiftTy = DCI.isBeforeLegalizeOps() ? getPointerTy() : getShiftAmountTy(N0.getValueType()); if (Cond == ISD::SETNE && C1 == 0) {// (X & 8) != 0 --> (X & 8) >> 3 // Perform the xform if the AND RHS is a single bit. @@ -2333,7 +2333,7 @@ TargetLowering::SimplifySetCC(EVT VT, SD const APInt &AndRHSC = AndRHS->getAPIntValue(); if ((-AndRHSC).isPowerOf2() && (AndRHSC & C1) == C1) { unsigned ShiftBits = AndRHSC.countTrailingZeros(); - EVT ShiftTy = DCI.isBeforeLegalize() ? + EVT ShiftTy = DCI.isBeforeLegalizeOps() ? getPointerTy() : getShiftAmountTy(N0.getValueType()); EVT CmpTy = N0.getValueType(); SDValue Shift = DAG.getNode(ISD::SRL, dl, CmpTy, N0.getOperand(0), @@ -2361,7 +2361,7 @@ TargetLowering::SimplifySetCC(EVT VT, SD } NewC = NewC.lshr(ShiftBits); if (ShiftBits && isLegalICmpImmediate(NewC.getSExtValue())) { - EVT ShiftTy = DCI.isBeforeLegalize() ? + EVT ShiftTy = DCI.isBeforeLegalizeOps() ? getPointerTy() : getShiftAmountTy(N0.getValueType()); EVT CmpTy = N0.getValueType(); SDValue Shift = DAG.getNode(ISD::SRL, dl, CmpTy, N0, Modified: vendor/llvm/dist/lib/ExecutionEngine/JIT/JITMemoryManager.cpp ============================================================================== --- vendor/llvm/dist/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -461,6 +461,9 @@ namespace { /// allocateCodeSection - Allocate memory for a code section. uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID) { + // Grow the required block size to account for the block header + Size += sizeof(*CurBlock); + // FIXME: Alignement handling. FreeRangeHeader* candidateBlock = FreeMemoryList; FreeRangeHeader* head = FreeMemoryList; Modified: vendor/llvm/dist/lib/Support/APFloat.cpp ============================================================================== --- vendor/llvm/dist/lib/Support/APFloat.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/Support/APFloat.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -1770,23 +1770,41 @@ APFloat::opStatus APFloat::roundToIntegr opStatus fs; assertArithmeticOK(*semantics); + // If the exponent is large enough, we know that this value is already + // integral, and the arithmetic below would potentially cause it to saturate + // to +/-Inf. Bail out early instead. + if (exponent+1 >= (int)semanticsPrecision(*semantics)) + return opOK; + // The algorithm here is quite simple: we add 2^(p-1), where p is the // precision of our format, and then subtract it back off again. The choice // of rounding modes for the addition/subtraction determines the rounding mode // for our integral rounding as well. - APInt IntegerConstant(NextPowerOf2(semanticsPrecision(*semantics)), - 1 << (semanticsPrecision(*semantics)-1)); + // NOTE: When the input value is negative, we do subtraction followed by + // addition instead. + APInt IntegerConstant(NextPowerOf2(semanticsPrecision(*semantics)), 1); + IntegerConstant <<= semanticsPrecision(*semantics)-1; APFloat MagicConstant(*semantics); fs = MagicConstant.convertFromAPInt(IntegerConstant, false, rmNearestTiesToEven); + MagicConstant.copySign(*this); + if (fs != opOK) return fs; + // Preserve the input sign so that we can handle 0.0/-0.0 cases correctly. + bool inputSign = isNegative(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:32:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D9EE106564A; Sun, 19 Aug 2012 10:32:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EDD38FC14; Sun, 19 Aug 2012 10:32:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAWXnA070268; Sun, 19 Aug 2012 10:32:33 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAWXg3070267; Sun, 19 Aug 2012 10:32:33 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208191032.q7JAWXg3070267@svn.freebsd.org> From: Dimitry Andric Date: Sun, 19 Aug 2012 10:32:33 +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: r239391 - vendor/llvm/llvm-trunk-r162107 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, 19 Aug 2012 10:32:33 -0000 Author: dim Date: Sun Aug 19 10:32:32 2012 New Revision: 239391 URL: http://svn.freebsd.org/changeset/base/239391 Log: Tag llvm trunk r162107. Added: vendor/llvm/llvm-trunk-r162107/ - copied from r239390, vendor/llvm/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:33:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13B04106564A; Sun, 19 Aug 2012 10:33:06 +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 EE3208FC21; Sun, 19 Aug 2012 10:33:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAX5kj070389; Sun, 19 Aug 2012 10:33:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAX5KX070368; Sun, 19 Aug 2012 10:33:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208191033.q7JAX5KX070368@svn.freebsd.org> From: Dimitry Andric Date: Sun, 19 Aug 2012 10:33:05 +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: r239392 - in vendor/clang/dist: docs docs/analyzer include/clang/AST include/clang/ASTMatchers include/clang/Basic include/clang/Lex include/clang/Parse include/clang/Sema include/clang... 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, 19 Aug 2012 10:33:06 -0000 Author: dim Date: Sun Aug 19 10:33:04 2012 New Revision: 239392 URL: http://svn.freebsd.org/changeset/base/239392 Log: Vendor import of clang trunk r162107: http://llvm.org/svn/llvm-project/cfe/trunk@162107 Added: vendor/clang/dist/docs/analyzer/ vendor/clang/dist/docs/analyzer/IPA.txt vendor/clang/dist/test/Analysis/inlining/dyn-dispatch-bifurcate.cpp vendor/clang/dist/test/Analysis/reinterpret-cast.cpp vendor/clang/dist/test/CodeGen/align-global-large.c vendor/clang/dist/test/CodeGen/arm-neon-misc.c vendor/clang/dist/test/CodeGen/complex-builtints.c vendor/clang/dist/test/CodeGenOpenCL/vectorLoadStore.cl vendor/clang/dist/test/Index/complete-preamble.cpp vendor/clang/dist/test/Index/complete-preamble.h vendor/clang/dist/test/Sema/arm-asm.c vendor/clang/dist/test/Sema/warn-type-safety-mpi-hdf5.c vendor/clang/dist/test/Sema/warn-type-safety.c vendor/clang/dist/test/Sema/warn-type-safety.cpp vendor/clang/dist/test/SemaObjC/warn-cast-of-sel-expr.m vendor/clang/dist/test/SemaObjCXX/abstract-class-type-ivar.mm Modified: vendor/clang/dist/docs/LanguageExtensions.html vendor/clang/dist/docs/ReleaseNotes.html vendor/clang/dist/include/clang/AST/ASTContext.h vendor/clang/dist/include/clang/AST/Attr.h vendor/clang/dist/include/clang/AST/CommentCommandTraits.h vendor/clang/dist/include/clang/AST/DeclBase.h vendor/clang/dist/include/clang/AST/DeclCXX.h vendor/clang/dist/include/clang/AST/DeclGroup.h vendor/clang/dist/include/clang/AST/DeclLookups.h vendor/clang/dist/include/clang/AST/PrettyPrinter.h vendor/clang/dist/include/clang/AST/RawCommentList.h vendor/clang/dist/include/clang/AST/Stmt.h vendor/clang/dist/include/clang/AST/TemplateBase.h vendor/clang/dist/include/clang/AST/TypeLoc.h vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/Builtins.def vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Lex/PTHManager.h vendor/clang/dist/include/clang/Parse/Parser.h vendor/clang/dist/include/clang/Sema/AttributeList.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h vendor/clang/dist/lib/AST/APValue.cpp vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/ASTDiagnostic.cpp vendor/clang/dist/lib/AST/CommentCommandTraits.cpp vendor/clang/dist/lib/AST/DeclCXX.cpp vendor/clang/dist/lib/AST/DeclPrinter.cpp vendor/clang/dist/lib/AST/DeclTemplate.cpp vendor/clang/dist/lib/AST/DumpXML.cpp vendor/clang/dist/lib/AST/NestedNameSpecifier.cpp vendor/clang/dist/lib/AST/RawCommentList.cpp vendor/clang/dist/lib/AST/Stmt.cpp vendor/clang/dist/lib/AST/StmtPrinter.cpp vendor/clang/dist/lib/AST/TemplateBase.cpp vendor/clang/dist/lib/Basic/Diagnostic.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprCXX.cpp vendor/clang/dist/lib/CodeGen/CGStmt.cpp vendor/clang/dist/lib/CodeGen/CGValue.h vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Frontend/ASTConsumers.cpp vendor/clang/dist/lib/Frontend/CacheTokens.cpp vendor/clang/dist/lib/Lex/PTHLexer.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseStmt.cpp vendor/clang/dist/lib/Rewrite/RewriteModernObjC.cpp vendor/clang/dist/lib/Rewrite/RewriteObjC.cpp vendor/clang/dist/lib/Sema/AttributeList.cpp vendor/clang/dist/lib/Sema/SemaCast.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExceptionSpec.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprMember.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaTemplate.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/AnalysisManager.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/BugReporter.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/CallEvent.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/PathDiagnostic.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ProgramState.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp vendor/clang/dist/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp vendor/clang/dist/test/Analysis/CFNumber.c vendor/clang/dist/test/Analysis/CheckNSError.m vendor/clang/dist/test/Analysis/array-struct.c vendor/clang/dist/test/Analysis/ctor-inlining.mm vendor/clang/dist/test/Analysis/dtor.cpp vendor/clang/dist/test/Analysis/func.c vendor/clang/dist/test/Analysis/html-diags.c vendor/clang/dist/test/Analysis/inline.cpp vendor/clang/dist/test/Analysis/inlining/DynDispatchBifurcate.m vendor/clang/dist/test/Analysis/inlining/InlineObjCClassMethod.m vendor/clang/dist/test/Analysis/keychainAPI.m vendor/clang/dist/test/Analysis/malloc-annotations.c vendor/clang/dist/test/Analysis/malloc.c vendor/clang/dist/test/Analysis/method-call-path-notes.cpp vendor/clang/dist/test/Analysis/method-call.cpp vendor/clang/dist/test/Analysis/misc-ps-region-store.m vendor/clang/dist/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m vendor/clang/dist/test/Analysis/ptr-arith.c vendor/clang/dist/test/Analysis/security-syntax-checks.m vendor/clang/dist/test/Analysis/sizeofpointer.c vendor/clang/dist/test/Analysis/stack-addr-ps.cpp vendor/clang/dist/test/Analysis/stream.c vendor/clang/dist/test/Analysis/variadic-method-types.m vendor/clang/dist/test/CodeCompletion/objc-expr.m vendor/clang/dist/test/CodeGen/alignment.c vendor/clang/dist/test/CodeGen/ms-inline-asm.c vendor/clang/dist/test/CodeGenCXX/devirtualize-virtual-function-calls.cpp vendor/clang/dist/test/CodeGenObjC/instance-method-metadata.m vendor/clang/dist/test/CodeGenObjC/ns_consume_null_check.m vendor/clang/dist/test/Driver/Xlinker-args.c vendor/clang/dist/test/Index/complete-enums.cpp vendor/clang/dist/test/Index/complete-exprs.m vendor/clang/dist/test/Parser/ms-inline-asm.c vendor/clang/dist/test/Sema/128bitint.c vendor/clang/dist/test/Sema/builtins-decl.c vendor/clang/dist/test/Sema/callingconv.c vendor/clang/dist/test/Sema/static-array.c vendor/clang/dist/test/Sema/tentative-decls.c vendor/clang/dist/test/Sema/warn-documentation.cpp vendor/clang/dist/test/SemaCXX/convert-to-bool.cpp vendor/clang/dist/test/SemaCXX/pragma-pack.cpp vendor/clang/dist/test/SemaCXX/references.cpp vendor/clang/dist/test/SemaCXX/uninitialized.cpp vendor/clang/dist/test/SemaCXX/warn-thread-safety-parsing.cpp vendor/clang/dist/test/Tooling/clang-check-ast-dump.cpp vendor/clang/dist/unittests/ASTMatchers/ASTMatchersTest.cpp vendor/clang/dist/unittests/Tooling/RecursiveASTVisitorTest.cpp vendor/clang/dist/utils/TableGen/ClangAttrEmitter.cpp vendor/clang/dist/utils/analyzer/CmpRuns.py vendor/clang/dist/www/comparison.html Modified: vendor/clang/dist/docs/LanguageExtensions.html ============================================================================== --- vendor/clang/dist/docs/LanguageExtensions.html Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/docs/LanguageExtensions.html Sun Aug 19 10:33:04 2012 (r239392) @@ -142,6 +142,13 @@
  • shared_locks_required(...)
  • +
  • Type Safety Checking + +
  • @@ -1913,6 +1920,161 @@ declaration to specify that the function shared locks. Arguments must be lockable type, and there must be at least one argument.

    + +

    Type Safety Checking

    + + +

    Clang supports additional attributes to enable checking type safety +properties that can't be enforced by C type system. Usecases include:

    +
      +
    • MPI library implementations, where these attributes enable checking that + buffer type matches the passed MPI_Datatype;
    • +
    • for HDF5 library there is a similar usecase as MPI;
    • +
    • checking types of variadic functions' arguments for functions like + fcntl() and ioctl().
    • +
    + +

    You can detect support for these attributes with __has_attribute(). For +example:

    + +
    +
    +#if defined(__has_attribute)
    +#  if __has_attribute(argument_with_type_tag) && \
    +      __has_attribute(pointer_with_type_tag) && \
    +      __has_attribute(type_tag_for_datatype)
    +#    define ATTR_MPI_PWT(buffer_idx, type_idx) __attribute__((pointer_with_type_tag(mpi,buffer_idx,type_idx)))
    +/* ... other macros ... */
    +#  endif
    +#endif
    +
    +#if !defined(ATTR_MPI_PWT)
    +#define ATTR_MPI_PWT(buffer_idx, type_idx)
    +#endif
    +
    +int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
    +    ATTR_MPI_PWT(1,3);
    +
    +
    + +

    argument_with_type_tag(...)

    + +

    Use __attribute__((argument_with_type_tag(arg_kind, arg_idx, +type_tag_idx))) on a function declaration to specify that the function +accepts a type tag that determines the type of some other argument. +arg_kind is an identifier that should be used when annotating all +applicable type tags.

    + +

    This attribute is primarily useful for checking arguments of variadic +functions (pointer_with_type_tag can be used in most of non-variadic +cases).

    + +

    For example:

    +
    +
    +int fcntl(int fd, int cmd, ...)
    +      __attribute__(( argument_with_type_tag(fcntl,3,2) ));
    +
    +
    + +

    pointer_with_type_tag(...)

    + +

    Use __attribute__((pointer_with_type_tag(ptr_kind, ptr_idx, +type_tag_idx))) on a function declaration to specify that the +function a type tag that determines the pointee type of some other pointer +argument.

    + +

    For example:

    +
    +
    +int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
    +    __attribute__(( pointer_with_type_tag(mpi,1,3) ));
    +
    +
    + +

    type_tag_for_datatype(...)

    + +

    Clang supports annotating type tags of two forms.

    + +
      +
    • Type tag that is an expression containing a reference to some declared +identifier. Use __attribute__((type_tag_for_datatype(kind, type))) +on a declaration with that identifier: + +
      +
      +extern struct mpi_datatype mpi_datatype_int
      +    __attribute__(( type_tag_for_datatype(mpi,int) ));
      +#define MPI_INT ((MPI_Datatype) &mpi_datatype_int)
      +
      +
    • + +
    • Type tag that is an integral literal. Introduce a static +const variable with a corresponding initializer value and attach +__attribute__((type_tag_for_datatype(kind, type))) on that +declaration, for example: + +
      +
      +#define MPI_INT ((MPI_Datatype) 42)
      +static const MPI_Datatype mpi_datatype_int
      +    __attribute__(( type_tag_for_datatype(mpi,int) )) = 42
      +
      +
    • +
    + +

    The attribute also accepts an optional third argument that determines how +the expression is compared to the type tag. There are two supported flags:

    + +
    • layout_compatible will cause types to be compared according to +layout-compatibility rules (C++11 [class.mem] p 17, 18). This is +implemented to support annotating types like MPI_DOUBLE_INT. + +

      For example:

      +
      +
      +/* In mpi.h */
      +struct internal_mpi_double_int { double d; int i; };
      +extern struct mpi_datatype mpi_datatype_double_int
      +    __attribute__(( type_tag_for_datatype(mpi, struct internal_mpi_double_int,
      +                                          layout_compatible) ));
      +
      +#define MPI_DOUBLE_INT ((MPI_Datatype) &mpi_datatype_double_int)
      +
      +/* In user code */
      +struct my_pair { double a; int b; };
      +struct my_pair *buffer;
      +MPI_Send(buffer, 1, MPI_DOUBLE_INT /*, ... */); // no warning
      +
      +struct my_int_pair { int a; int b; }
      +struct my_int_pair *buffer2;
      +MPI_Send(buffer2, 1, MPI_DOUBLE_INT /*, ... */); // warning: actual buffer element
      +                                                 // type 'struct my_int_pair'
      +                                                 // doesn't match specified MPI_Datatype
      +
      +
      +
    • + +
    • must_be_null specifies that the expression should be a null +pointer constant, for example: + +
      +
      +/* In mpi.h */
      +extern struct mpi_datatype mpi_datatype_null
      +    __attribute__(( type_tag_for_datatype(mpi, void, must_be_null) ));
      +
      +#define MPI_DATATYPE_NULL ((MPI_Datatype) &mpi_datatype_null)
      +
      +/* In user code */
      +MPI_Send(buffer, 1, MPI_DATATYPE_NULL /*, ... */); // warning: MPI_DATATYPE_NULL
      +                                                   // was specified but buffer
      +                                                   // is not a null pointer
      +
      +
      +
    • +
    + Modified: vendor/clang/dist/docs/ReleaseNotes.html ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.html Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/docs/ReleaseNotes.html Sun Aug 19 10:33:04 2012 (r239392) @@ -186,6 +186,25 @@ supported by the target, or if the compi model can be used.

    +

    Type safety attributes

    +

    Clang now supports type safety attributes that allow checking during compile +time that 'void *' function arguments and arguments for variadic functions are +of a particular type which is determined by some other argument to the same +function call.

    + +

    Usecases include:

    +
      +
    • MPI library implementations, where these attributes enable checking that + buffer type matches the passed MPI_Datatype;
    • +
    • HDF5 library -- similar usecase as for MPI;
    • +
    • checking types of variadic functions' arguments for functions like +fcntl() and ioctl().
    • +
    + +

    See entries for argument_with_type_tag, +pointer_with_type_tag and type_tag_for_datatype +attributes in Clang language extensions documentation.

    +

    New Compiler Flags

    Added: vendor/clang/dist/docs/analyzer/IPA.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/docs/analyzer/IPA.txt Sun Aug 19 10:33:04 2012 (r239392) @@ -0,0 +1,96 @@ +Inlining +======== + +Inlining Modes +----------------------- +-analyzer-ipa=none - All inlining is disabled. +-analyzer-ipa=inlining - Turns on inlining when we can confidently find the function/method body corresponding to the call. (C functions, static functions, devirtualized C++ methods, ObjC class methods, ObjC instance methods when we are confident about the dynamic type of the instance). +-analyzer-ipa=dynamic - Inline instance methods for which the type is determined at runtime and we are not 100% sure that our type info is correct. For virtual calls, inline the most plausible definition. +-analyzer-ipa=dynamic-bifurcate - Same as -analyzer-ipa=dynamic, but the path is split. We inline on one branch and do not inline on the other. This mode does not drop the coverage in cases when the parent class has code that is only exercised when some of its methods are overriden. + +Currently, -analyzer-ipa=inlining is the default mode. + +Basics of Implementation +----------------------- + +The low-level mechanism of inlining a function is handled in ExprEngine::inlineCall and ExprEngine::processCallExit. If the conditions are right for inlining, a CallEnter node is created and added to the analysis work list. The CallEnter node marks the change to a new LocationContext representing the called function, and its state includes the contents of the new stack frame. When the CallEnter node is actually processed, its single successor will be a edge to the first CFG block in the function. + +Exiting an inlined function is a bit more work, fortunately broken up into reasonable steps: +1. The CoreEngine realizes we're at the end of an inlined call and generates a CallExitBegin node. +2. ExprEngine takes over (in processCallExit) and finds the return value of the function, if it has one. This is bound to the expression that triggered the call. (In the case of calls without origin expressions, such as destructors, this step is skipped.) +3. Dead symbols and bindings are cleaned out from the state, including any local bindings. +4. A CallExitEnd node is generated, which marks the transition back to the caller's LocationContext. +5. Custom post-call checks are processed and the final nodes are pushed back onto the work list, so that evaluation of the caller can continue. + +Retry Without Inlining +----------------------- + +In some cases, we would like to retry analyzes without inlining the particular call. Currently, we use this technique to recover the coverage in case we stop analyzing a path due to exceeding the maximum block count inside an inlined function. When this situation is detected, we walk up the path to find the first node before inlining was started and enqueue it on the WorkList with a special ReplayWithoutInlining bit added to it (ExprEngine::replayWithoutInlining). + +Deciding when to inline +----------------------- +In general, we try to inline as much as possible, since it provides a better summary of what actually happens in the program. However, there are some cases where we choose not to inline: +- if there is no definition available (of course) +- if we can't create a CFG or compute variable liveness for the function +- if we reach a cutoff of maximum stack depth (to avoid infinite recursion) +- if the function is variadic +- in C++, we don't inline constructors unless we know the destructor will be inlined as well +- in C++, we don't inline allocators (custom operator new implementations), since we don't properly handle deallocators (at the time of this writing) +- "Dynamic" calls are handled specially; see below. +- Engine:FunctionSummaries map stores additional information about declarations, some of which is collected at runtime based on previous analyzes of the function. We do not inline functions which were not profitable to inline in a different context (for example, if the maximum block count was exceeded, see Retry Without Inlining). + + +Dynamic calls and devirtualization +---------------------------------- +"Dynamic" calls are those that are resolved at runtime, such as C++ virtual method calls and Objective-C message sends. Due to the path-sensitive nature of the analyzer, we may be able to figure out the dynamic type of the object whose method is being called and thus "devirtualize" the call, i.e. find the actual method that will be called at runtime. (Obviously this is not always possible.) This is handled by CallEvent's getRuntimeDefinition method. + +Type information is tracked as DynamicTypeInfo, stored within the program state. If no DynamicTypeInfo has been explicitly set for a region, it will be inferred from the region's type or associated symbol. Information from symbolic regions is weaker than from true typed regions; a C++ object declared "A obj" is known to have the class 'A', but a reference "A &ref" may dynamically be a subclass of 'A'. The DynamicTypePropagation checker gathers and propagates the type information. + +(Warning: not all of the existing analyzer code has been retrofitted to use DynamicTypeInfo, nor is it universally appropriate. In particular, DynamicTypeInfo always applies to a region with all casts stripped off, but sometimes the information provided by casts can be useful.) + +When asked to provide a definition, the CallEvents for dynamic calls will use the type info in their state to provide the best definition of the method to be called. In some cases this devirtualization can be perfect or near-perfect, and we can inline the definition as usual. In others we can make a guess, but report that our guess may not be the method actually called at runtime. + +The -analyzer-ipa option has four different modes: none, inlining, dynamic, and dynamic-bifurcate. Under -analyzer-ipa=dynamic, all dynamic calls are inlined, whether we are certain or not that this will actually be the definition used at runtime. Under -analyzer-ipa=inlining, only "near-perfect" devirtualized calls are inlined*, and other dynamic calls are evaluated conservatively (as if no definition were available). + +* Currently, no Objective-C messages are not inlined under -analyzer-ipa=inlining, even if we are reasonably confident of the type of the receiver. We plan to enable this once we have tested our heuristics more thoroughly. + +The last option, -analyzer-ipa=dynamic-bifurcate, behaves similarly to "dynamic", but performs a conservative invalidation in the general virtual case in /addition/ to inlining. The details of this are discussed below. + + +Bifurcation +----------- +ExprEngine::BifurcateCall implements the -analyzer-ipa=dynamic-bifurcate mode. When a call is made on a region with dynamic type information, we bifurcate the path and add the region's processing mode to the GDM. Currently, there are 2 modes: DynamicDispatchModeInlined and DynamicDispatchModeConservative. Going forward, we consult the state of the region to make decisions on whether the calls should be inlined or not, which ensures that we have at most one split per region. The modes model the cases when the dynamic type information is perfectly correct and when the info is not correct (i.e. where the region is a subclass of the type we store in DynamicTypeInfo). + +Bifurcation mode allows for increased coverage in cases where the parent method contains code which is only executed when the class is subclassed. The disadvantages of this mode are a (considerable?) performance hit and the possibility of false positives on the path where the conservative mode is used. + + +Objective-C Message Heuristics +------------------------------ +We rely on a set of heuristics to partition the set of ObjC method calls into ones that require bifurcation and ones that do not (can or cannot be a subclass). Below are the cases when we consider that the dynamic type of the object is precise (cannot be a subclass): + - If the object was created with +alloc or +new and initialized with an -init method. + - If the calls are property accesses using dot syntax. This is based on the assumption that children rarely override properties, or do so in an essentially compatible way. + - If the class interface is declared inside the main source file. In this case it is unlikely that it will be subclassed. + - If the method is not declared outside of main source file, either by the receiver's class or by any superclasses. + + +C++ Inlining Caveats +-------------------- +C++11 [class.cdtor]p4 describes how the vtable of an object is modified as it is being constructed or destructed; that is, the type of the object depends on which base constructors have been completed. This is tracked using dynamic type info in the DynamicTypePropagation checker. + +Temporaries are poorly modelled right now because we're not confident in the placement + +'new' is poorly modelled due to some nasty CFG/design issues (elaborated in PR12014). 'delete' is essentially not modelled at all. + +Arrays of objects are modeled very poorly right now. We run only the first constructor and first destructor. Because of this, we don't inline any constructors or destructors for arrays. + + +CallEvent +========= + +A CallEvent represents a specific call to a function, method, or other body of code. It is path-sensitive, containing both the current state (ProgramStateRef) and stack space (LocationContext), and provides uniform access to the argument values and return type of a call, no matter how the call is written in the source or what sort of code body is being invoked. + +(For those familiar with Cocoa, CallEvent is roughly equivalent to NSInvocation.) + +CallEvent should be used whenever there is logic dealing with function calls that does not care how the call occurred. Examples include checking that arguments satisfy preconditions (such as __attribute__((nonnull))), and attempting to inline a call. + +CallEvents are reference-counted objects managed by a CallEventManager. While there is no inherent issue with persisting them (say, in the state's GDM), they are intended for short-lived use, and can be recreated from CFGElements or StackFrameContexts fairly easily. Modified: vendor/clang/dist/include/clang/AST/ASTContext.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ASTContext.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/ASTContext.h Sun Aug 19 10:33:04 2012 (r239392) @@ -474,8 +474,17 @@ public: Data.setPointer(RC); } + const Decl *getOriginalDecl() const LLVM_READONLY { + return OriginalDecl; + } + + void setOriginalDecl(const Decl *Orig) { + OriginalDecl = Orig; + } + private: llvm::PointerIntPair Data; + const Decl *OriginalDecl; }; /// \brief Mapping from declarations to comments attached to any @@ -485,6 +494,10 @@ public: /// lazily. mutable llvm::DenseMap RedeclComments; + /// \brief Mapping from declarations to parsed comments attached to any + /// redeclaration. + mutable llvm::DenseMap ParsedComments; + /// \brief Return the documentation comment attached to a given declaration, /// without looking into cache. RawComment *getRawCommentForDeclNoCache(const Decl *D) const; @@ -500,7 +513,12 @@ public: /// \brief Return the documentation comment attached to a given declaration. /// Returns NULL if no comment is attached. - const RawComment *getRawCommentForAnyRedecl(const Decl *D) const; + /// + /// \param OriginalDecl if not NULL, is set to declaration AST node that had + /// the comment, if the comment we found comes from a redeclaration. + const RawComment *getRawCommentForAnyRedecl( + const Decl *D, + const Decl **OriginalDecl = NULL) const; /// Return parsed documentation comment attached to a given declaration. /// Returns NULL if no comment is attached. Modified: vendor/clang/dist/include/clang/AST/Attr.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Attr.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/Attr.h Sun Aug 19 10:33:04 2012 (r239392) @@ -105,7 +105,8 @@ public: virtual bool isLateParsed() const { return false; } // Pretty print this attribute. - virtual void printPretty(llvm::raw_ostream &OS, ASTContext &C) const = 0; + virtual void printPretty(llvm::raw_ostream &OS, + const PrintingPolicy &Policy) const = 0; // Implement isa/cast/dyncast/etc. static bool classof(const Attr *) { return true; } Modified: vendor/clang/dist/include/clang/AST/CommentCommandTraits.h ============================================================================== --- vendor/clang/dist/include/clang/AST/CommentCommandTraits.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/CommentCommandTraits.h Sun Aug 19 10:33:04 2012 (r239392) @@ -35,14 +35,14 @@ public: /// A verbatim-like block command eats every character (except line starting /// decorations) until matching end command is seen or comment end is hit. /// - /// \param BeginName name of the command that starts the verbatim block. + /// \param StartName name of the command that starts the verbatim block. /// \param [out] EndName name of the command that ends the verbatim block. /// /// \returns true if a given command is a verbatim block command. bool isVerbatimBlockCommand(StringRef StartName, StringRef &EndName) const; /// \brief Register a new verbatim block command. - void addVerbatimBlockCommand(StringRef BeginName, StringRef EndName); + void addVerbatimBlockCommand(StringRef StartName, StringRef EndName); /// \brief Check if a given command is a verbatim line command. /// @@ -90,7 +90,7 @@ public: private: struct VerbatimBlockCommand { - StringRef BeginName; + StringRef StartName; StringRef EndName; }; Modified: vendor/clang/dist/include/clang/AST/DeclBase.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclBase.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/DeclBase.h Sun Aug 19 10:33:04 2012 (r239392) @@ -858,10 +858,10 @@ public: raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation = 0); // Debuggers don't usually respect default arguments. - LLVM_ATTRIBUTE_USED void dump() const { dump(llvm::errs()); } + LLVM_ATTRIBUTE_USED void dump() const; void dump(raw_ostream &Out) const; // Debuggers don't usually respect default arguments. - LLVM_ATTRIBUTE_USED void dumpXML() const { dumpXML(llvm::errs()); } + LLVM_ATTRIBUTE_USED void dumpXML() const; void dumpXML(raw_ostream &OS) const; private: Modified: vendor/clang/dist/include/clang/AST/DeclCXX.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclCXX.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/DeclCXX.h Sun Aug 19 10:33:04 2012 (r239392) @@ -1646,14 +1646,17 @@ public: /// \brief Find the method in RD that corresponds to this one. /// /// Find if RD or one of the classes it inherits from override this method. - /// If so, return it. RD is assumed to be a base class of the class defining - /// this method (or be the class itself). + /// If so, return it. RD is assumed to be a subclass of the class defining + /// this method (or be the class itself), unless MayBeBase is set to true. CXXMethodDecl * - getCorrespondingMethodInClass(const CXXRecordDecl *RD); + getCorrespondingMethodInClass(const CXXRecordDecl *RD, + bool MayBeBase = false); const CXXMethodDecl * - getCorrespondingMethodInClass(const CXXRecordDecl *RD) const { - return const_cast(this)->getCorrespondingMethodInClass(RD); + getCorrespondingMethodInClass(const CXXRecordDecl *RD, + bool MayBeBase = false) const { + return const_cast(this) + ->getCorrespondingMethodInClass(RD, MayBeBase); } // Implement isa/cast/dyncast/etc. Modified: vendor/clang/dist/include/clang/AST/DeclGroup.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclGroup.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/DeclGroup.h Sun Aug 19 10:33:04 2012 (r239392) @@ -26,7 +26,11 @@ class DeclGroupIterator; class DeclGroup { // FIXME: Include a TypeSpecifier object. - unsigned NumDecls; + union { + unsigned NumDecls; + + Decl *Aligner; + }; private: DeclGroup() : NumDecls(0) {} Modified: vendor/clang/dist/include/clang/AST/DeclLookups.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclLookups.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/DeclLookups.h Sun Aug 19 10:33:04 2012 (r239392) @@ -67,7 +67,7 @@ public: DeclContext::all_lookups_iterator DeclContext::lookups_begin() const { DeclContext *Primary = const_cast(this)->getPrimaryContext(); - if (hasExternalVisibleStorage()) + if (Primary->hasExternalVisibleStorage()) getParentASTContext().getExternalSource()->completeVisibleDeclsMap(Primary); if (StoredDeclsMap *Map = Primary->buildLookup()) return all_lookups_iterator(Map->begin(), Map->end()); @@ -76,7 +76,7 @@ DeclContext::all_lookups_iterator DeclCo DeclContext::all_lookups_iterator DeclContext::lookups_end() const { DeclContext *Primary = const_cast(this)->getPrimaryContext(); - if (hasExternalVisibleStorage()) + if (Primary->hasExternalVisibleStorage()) getParentASTContext().getExternalSource()->completeVisibleDeclsMap(Primary); if (StoredDeclsMap *Map = Primary->buildLookup()) return all_lookups_iterator(Map->end(), Map->end()); Modified: vendor/clang/dist/include/clang/AST/PrettyPrinter.h ============================================================================== --- vendor/clang/dist/include/clang/AST/PrettyPrinter.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/PrettyPrinter.h Sun Aug 19 10:33:04 2012 (r239392) @@ -34,19 +34,19 @@ public: struct PrintingPolicy { /// \brief Create a default printing policy for C. PrintingPolicy(const LangOptions &LO) - : Indentation(2), LangOpts(LO), SuppressSpecifiers(false), + : LangOpts(LO), Indentation(2), SuppressSpecifiers(false), SuppressTagKeyword(false), SuppressTag(false), SuppressScope(false), SuppressUnwrittenScope(false), SuppressInitializers(false), - Dump(false), ConstantArraySizeAsWritten(false), - AnonymousTagLocations(true), SuppressStrongLifetime(false), - Bool(LO.Bool) { } - - /// \brief The number of spaces to use to indent each line. - unsigned Indentation : 8; + ConstantArraySizeAsWritten(false), AnonymousTagLocations(true), + SuppressStrongLifetime(false), Bool(LO.Bool), + DumpSourceManager(0) { } /// \brief What language we're printing. LangOptions LangOpts; + /// \brief The number of spaces to use to indent each line. + unsigned Indentation : 8; + /// \brief Whether we should suppress printing of the actual specifiers for /// the given type or declaration. /// @@ -103,12 +103,6 @@ struct PrintingPolicy { /// internal initializer constructed for x will not be printed. bool SuppressInitializers : 1; - /// \brief True when we are "dumping" rather than "pretty-printing", - /// where dumping involves printing the internal details of the AST - /// and pretty-printing involves printing something similar to - /// source code. - bool Dump : 1; - /// \brief Whether we should print the sizes of constant array expressions /// as written in the sources. /// @@ -139,6 +133,12 @@ struct PrintingPolicy { /// \brief Whether we can use 'bool' rather than '_Bool', even if the language /// doesn't actually have 'bool' (because, e.g., it is defined as a macro). unsigned Bool : 1; + + /// \brief If we are "dumping" rather than "pretty-printing", this points to + /// a SourceManager which will be used to dump SourceLocations. Dumping + /// involves printing the internal details of the AST and pretty-printing + /// involves printing something similar to source code. + SourceManager *DumpSourceManager; }; } // end namespace clang Modified: vendor/clang/dist/include/clang/AST/RawCommentList.h ============================================================================== --- vendor/clang/dist/include/clang/AST/RawCommentList.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/RawCommentList.h Sun Aug 19 10:33:04 2012 (r239392) @@ -55,16 +55,11 @@ public: /// Is this comment attached to any declaration? bool isAttached() const LLVM_READONLY { - return !DeclOrParsedComment.isNull(); + return IsAttached; } - /// Return the declaration that this comment is attached to. - const Decl *getDecl() const; - - /// Set the declaration that this comment is attached to. - void setDecl(const Decl *D) { - assert(DeclOrParsedComment.isNull()); - DeclOrParsedComment = D; + void setAttached() { + IsAttached = true; } /// Returns true if it is a comment that should be put after a member: @@ -118,28 +113,23 @@ public: return extractBriefText(Context); } - /// Returns a \c FullComment AST node, parsing the comment if needed. - comments::FullComment *getParsed(const ASTContext &Context) const { - if (comments::FullComment *FC = - DeclOrParsedComment.dyn_cast()) - return FC; - - return parse(Context); - } + /// Parse the comment, assuming it is attached to decl \c D. + comments::FullComment *parse(const ASTContext &Context, const Decl *D) const; private: SourceRange Range; mutable StringRef RawText; mutable const char *BriefText; - mutable llvm::PointerUnion - DeclOrParsedComment; mutable bool RawTextValid : 1; ///< True if RawText is valid mutable bool BriefTextValid : 1; ///< True if BriefText is valid unsigned Kind : 3; + /// True if comment is attached to a declaration in ASTContext. + bool IsAttached : 1; + bool IsTrailingComment : 1; bool IsAlmostTrailingComment : 1; @@ -152,7 +142,7 @@ private: RawComment(SourceRange SR, CommentKind K, bool IsTrailingComment, bool IsAlmostTrailingComment) : Range(SR), RawTextValid(false), BriefTextValid(false), Kind(K), - IsTrailingComment(IsTrailingComment), + IsAttached(false), IsTrailingComment(IsTrailingComment), IsAlmostTrailingComment(IsAlmostTrailingComment), BeginLineValid(false), EndLineValid(false) { } @@ -161,8 +151,6 @@ private: const char *extractBriefText(const ASTContext &Context) const; - comments::FullComment *parse(const ASTContext &Context) const; - friend class ASTReader; }; Modified: vendor/clang/dist/include/clang/AST/Stmt.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Stmt.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/Stmt.h Sun Aug 19 10:33:04 2012 (r239392) @@ -373,15 +373,9 @@ public: /// dumpPretty/printPretty - These two methods do a "pretty print" of the AST /// back to its original source language syntax. - void dumpPretty(ASTContext& Context) const; + void dumpPretty(ASTContext &Context) const; void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, - unsigned Indentation = 0) const { - printPretty(OS, *(ASTContext*)0, Helper, Policy, Indentation); - } - void printPretty(raw_ostream &OS, ASTContext &Context, - PrinterHelper *Helper, - const PrintingPolicy &Policy, unsigned Indentation = 0) const; /// viewAST - Visualize an AST rooted at this Stmt* using GraphViz. Only @@ -1620,36 +1614,40 @@ public: /// MSAsmStmt - This represents a MS inline-assembly statement extension. /// class MSAsmStmt : public Stmt { - SourceLocation AsmLoc, EndLoc; + SourceLocation AsmLoc, LBraceLoc, EndLoc; std::string AsmStr; bool IsSimple; bool IsVolatile; unsigned NumAsmToks; - unsigned NumLineEnds; + unsigned NumInputs; + unsigned NumOutputs; unsigned NumClobbers; Token *AsmToks; - unsigned *LineEnds; + IdentifierInfo **Names; Stmt **Exprs; StringRef *Clobbers; public: - MSAsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, - bool isvolatile, ArrayRef asmtoks, - ArrayRef lineends, StringRef asmstr, - ArrayRef clobbers, SourceLocation endloc); + MSAsmStmt(ASTContext &C, SourceLocation asmloc, SourceLocation lbraceloc, + bool issimple, bool isvolatile, ArrayRef asmtoks, + ArrayRef inputs, ArrayRef outputs, + StringRef asmstr, ArrayRef clobbers, + SourceLocation endloc); SourceLocation getAsmLoc() const { return AsmLoc; } void setAsmLoc(SourceLocation L) { AsmLoc = L; } + SourceLocation getLBraceLoc() const { return LBraceLoc; } + void setLBraceLoc(SourceLocation L) { LBraceLoc = L; } SourceLocation getEndLoc() const { return EndLoc; } void setEndLoc(SourceLocation L) { EndLoc = L; } + bool hasBraces() const { return LBraceLoc.isValid(); } + unsigned getNumAsmToks() { return NumAsmToks; } Token *getAsmToks() { return AsmToks; } - unsigned getNumLineEnds() { return NumLineEnds; } - unsigned *getLineEnds() { return LineEnds; } bool isVolatile() const { return IsVolatile; } void setVolatile(bool V) { IsVolatile = V; } @@ -1665,7 +1663,7 @@ public: //===--- Other ---===// unsigned getNumClobbers() const { return NumClobbers; } - StringRef getClobber(unsigned i) { return Clobbers[i]; } + StringRef getClobber(unsigned i) const { return Clobbers[i]; } SourceRange getSourceRange() const LLVM_READONLY { return SourceRange(AsmLoc, EndLoc); Modified: vendor/clang/dist/include/clang/AST/TemplateBase.h ============================================================================== --- vendor/clang/dist/include/clang/AST/TemplateBase.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/TemplateBase.h Sun Aug 19 10:33:04 2012 (r239392) @@ -510,17 +510,23 @@ public: /// This is safe to be used inside an AST node, in contrast with /// TemplateArgumentListInfo. struct ASTTemplateArgumentListInfo { - /// \brief The source location of the left angle bracket ('<'); + /// \brief The source location of the left angle bracket ('<'). SourceLocation LAngleLoc; - /// \brief The source location of the right angle bracket ('>'); + /// \brief The source location of the right angle bracket ('>'). SourceLocation RAngleLoc; - /// \brief The number of template arguments in TemplateArgs. - /// The actual template arguments (if any) are stored after the - /// ExplicitTemplateArgumentList structure. - unsigned NumTemplateArgs; - + union { + /// \brief The number of template arguments in TemplateArgs. + /// The actual template arguments (if any) are stored after the + /// ExplicitTemplateArgumentList structure. + unsigned NumTemplateArgs; + + /// Force ASTTemplateArgumentListInfo to the right alignment + /// for the following array of TemplateArgumentLocs. + void *Aligner; + }; + /// \brief Retrieve the template arguments TemplateArgumentLoc *getTemplateArgs() { return reinterpret_cast (this + 1); Modified: vendor/clang/dist/include/clang/AST/TypeLoc.h ============================================================================== --- vendor/clang/dist/include/clang/AST/TypeLoc.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/TypeLoc.h Sun Aug 19 10:33:04 2012 (r239392) @@ -1061,7 +1061,6 @@ public: struct FunctionLocInfo { SourceLocation LocalRangeBegin; SourceLocation LocalRangeEnd; - bool TrailingReturn; }; /// \brief Wrapper for source info for functions. @@ -1084,13 +1083,6 @@ public: getLocalData()->LocalRangeEnd = L; } - bool getTrailingReturn() const { - return getLocalData()->TrailingReturn; - } - void setTrailingReturn(bool Trailing) { - getLocalData()->TrailingReturn = Trailing; - } - ArrayRef getParams() const { return ArrayRef(getParmArray(), getNumArgs()); } @@ -1119,7 +1111,6 @@ public: void initializeLocal(ASTContext &Context, SourceLocation Loc) { setLocalRangeBegin(Loc); setLocalRangeEnd(Loc); - setTrailingReturn(false); for (unsigned i = 0, e = getNumArgs(); i != e; ++i) setArg(i, NULL); } Modified: vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h ============================================================================== --- vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Sun Aug 19 10:33:04 2012 (r239392) @@ -50,6 +50,7 @@ #include "clang/ASTMatchers/ASTMatchersMacros.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/Regex.h" +#include namespace clang { namespace ast_matchers { @@ -195,6 +196,75 @@ AST_MATCHER_P(ClassTemplateSpecializatio return false; } +/// \brief Matches expressions that match InnerMatcher after any implicit casts +/// are stripped off. +/// +/// Parentheses and explicit casts are not discarded. +/// Given +/// int arr[5]; +/// int a = 0; +/// char b = 0; +/// const int c = a; +/// int *d = arr; +/// long e = (long) 0l; +/// The matchers +/// variable(hasInitializer(ignoringImpCasts(integerLiteral()))) +/// variable(hasInitializer(ignoringImpCasts(declarationReference()))) +/// would match the declarations for a, b, c, and d, but not e. +/// while +/// variable(hasInitializer(integerLiteral())) +/// variable(hasInitializer(declarationReference())) +/// only match the declarations for b, c, and d. +AST_MATCHER_P(Expr, ignoringImpCasts, + internal::Matcher, InnerMatcher) { + return InnerMatcher.matches(*Node.IgnoreImpCasts(), Finder, Builder); +} + +/// \brief Matches expressions that match InnerMatcher after parentheses and +/// casts are stripped off. +/// +/// Implicit and non-C Style casts are also discarded. +/// Given +/// int a = 0; +/// char b = (0); +/// void* c = reinterpret_cast(0); +/// char d = char(0); +/// The matcher +/// variable(hasInitializer(ignoringParenCasts(integerLiteral()))) +/// would match the declarations for a, b, c, and d. +/// while +/// variable(hasInitializer(integerLiteral())) +/// only match the declaration for a. +AST_MATCHER_P(Expr, ignoringParenCasts, internal::Matcher, InnerMatcher) { + return InnerMatcher.matches(*Node.IgnoreParenCasts(), Finder, Builder); +} + +/// \brief Matches expressions that match InnerMatcher after implicit casts and +/// parentheses are stripped off. +/// +/// Explicit casts are not discarded. +/// Given +/// int arr[5]; +/// int a = 0; +/// char b = (0); +/// const int c = a; +/// int *d = (arr); +/// long e = ((long) 0l); +/// The matchers +/// variable(hasInitializer(ignoringParenImpCasts( +/// integerLiteral()))) +/// variable(hasInitializer(ignoringParenImpCasts( +/// declarationReference()))) +/// would match the declarations for a, b, c, and d, but not e. +/// while +/// variable(hasInitializer(integerLiteral())) +/// variable(hasInitializer(declarationReference())) +/// would only match the declaration for a. +AST_MATCHER_P(Expr, ignoringParenImpCasts, + internal::Matcher, InnerMatcher) { + return InnerMatcher.matches(*Node.IgnoreParenImpCasts(), Finder, Builder); +} + /// \brief Matches classTemplateSpecializations where the n'th TemplateArgument /// matches the given Matcher. /// @@ -691,6 +761,19 @@ const internal::VariadicDynCastAllOfMatc Expr, ImplicitCastExpr> implicitCast; +/// \brief Matches any cast nodes of Clang's AST. +/// +/// Example: castExpr() matches each of the following: +/// (int) 3; +/// const_cast(SubExpr); +/// char c = 0; +/// but does not match +/// int i = (0); +/// int k = 0; +const internal::VariadicDynCastAllOfMatcher< + Expr, + CastExpr> castExpr; + /// \brief Matches functional cast expressions /// /// Example: Matches Foo(bar); @@ -1193,6 +1276,21 @@ AST_MATCHER_P(DeclRefExpr, throughUsingD return false; } +/// \brief Matches the Decl of a DeclStmt which has a single declaration. +/// +/// Given +/// int a, b; +/// int c; +/// declarationStatement(hasSingleDecl(anything())) +/// matches 'int c;' but not 'int a, b;'. +AST_MATCHER_P(DeclStmt, hasSingleDecl, internal::Matcher, InnerMatcher) { + if (Node.isSingleDecl()) { + const Decl *FoundDecl = Node.getSingleDecl(); + return InnerMatcher.matches(*FoundDecl, Finder, Builder); + } + return false; +} + /// \brief Matches a variable declaration that has an initializer expression /// that matches the given matcher. /// @@ -1238,6 +1336,44 @@ AST_POLYMORPHIC_MATCHER_P2( *Node.getArg(N)->IgnoreParenImpCasts(), Finder, Builder)); } +/// \brief Matches declaration statements that contain a specific number of +/// declarations. +/// +/// Example: Given +/// int a, b; +/// int c; +/// int d = 2, e; +/// declCountIs(2) +/// matches 'int a, b;' and 'int d = 2, e;', but not 'int c;'. +AST_MATCHER_P(DeclStmt, declCountIs, unsigned, N) { + return std::distance(Node.decl_begin(), Node.decl_end()) == N; +} + +/// \brief Matches the n'th declaration of a declaration statement. +/// +/// Note that this does not work for global declarations because the AST +/// breaks up multiple-declaration DeclStmt's into multiple single-declaration +/// DeclStmt's. +/// Example: Given non-global declarations +/// int a, b = 0; +/// int c; +/// int d = 2, e; +/// declarationStatement(containsDeclaration( +/// 0, variable(hasInitializer(anything())))) +/// matches only 'int d = 2, e;', and +/// declarationStatement(containsDeclaration(1, variable())) +/// matches 'int a, b = 0' as well as 'int d = 2, e;' +/// but 'int c;' is not matched. +AST_MATCHER_P2(DeclStmt, containsDeclaration, unsigned, N, + internal::Matcher, InnerMatcher) { + const unsigned NumDecls = std::distance(Node.decl_begin(), Node.decl_end()); + if (N >= NumDecls) + return false; + DeclStmt::const_decl_iterator Iterator = Node.decl_begin(); + std::advance(Iterator, N); + return InnerMatcher.matches(**Iterator, Finder, Builder); +} + /// \brief Matches a constructor initializer. /// /// Given @@ -1385,6 +1521,18 @@ AST_MATCHER_P(FunctionDecl, returns, int return Matcher.matches(Node.getResultType(), Finder, Builder); } +/// \brief Matches extern "C" function declarations. +/// +/// Given: +/// extern "C" void f() {} +/// extern "C" { void g() {} } +/// void h() {} +/// function(isExternC()) +/// matches the declaration of f and g, but not the declaration h +AST_MATCHER(FunctionDecl, isExternC) { + return Node.isExternC(); +} + /// \brief Matches the condition expression of an if statement, for loop, /// or conditional operator. /// Modified: vendor/clang/dist/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/Attr.td Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/Basic/Attr.td Sun Aug 19 10:33:04 2012 (r239392) @@ -826,6 +826,27 @@ def SharedLocksRequired : InheritableAtt let TemplateDependent = 1; } +// Type safety attributes for `void *' pointers and type tags. + +def ArgumentWithTypeTag : InheritableAttr { + let Spellings = [GNU<"argument_with_type_tag">, + GNU<"pointer_with_type_tag">]; + let Args = [IdentifierArgument<"ArgumentKind">, + UnsignedArgument<"ArgumentIdx">, + UnsignedArgument<"TypeTagIdx">, + BoolArgument<"IsPointer">]; + let Subjects = [Function]; +} + +def TypeTagForDatatype : InheritableAttr { + let Spellings = [GNU<"type_tag_for_datatype">]; + let Args = [IdentifierArgument<"ArgumentKind">, + TypeArgument<"MatchingCType">, + BoolArgument<"LayoutCompatible">, + BoolArgument<"MustBeNull">]; + let Subjects = [Var]; +} + // Microsoft-related attributes def MsStruct : InheritableAttr { Modified: vendor/clang/dist/include/clang/Basic/Builtins.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/Builtins.def Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/Basic/Builtins.def Sun Aug 19 10:33:04 2012 (r239392) @@ -376,9 +376,9 @@ BUILTIN(__builtin_ctz , "iUi" , "nc") BUILTIN(__builtin_ctzl , "iULi" , "nc") BUILTIN(__builtin_ctzll, "iULLi", "nc") // TODO: int ctzimax(uintmax_t) -BUILTIN(__builtin_ffs , "iUi" , "nc") -BUILTIN(__builtin_ffsl , "iULi" , "nc") -BUILTIN(__builtin_ffsll, "iULLi", "nc") +BUILTIN(__builtin_ffs , "ii" , "nc") +BUILTIN(__builtin_ffsl , "iLi" , "nc") +BUILTIN(__builtin_ffsll, "iLLi", "nc") BUILTIN(__builtin_parity , "iUi" , "nc") BUILTIN(__builtin_parityl , "iULi" , "nc") BUILTIN(__builtin_parityll, "iULLi", "nc") Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Sun Aug 19 10:33:04 2012 (r239392) @@ -155,6 +155,8 @@ def MethodAccess : DiagGroup<"objc-metho def ObjCReceiver : DiagGroup<"receiver-expr">; def OverlengthStrings : DiagGroup<"overlength-strings">; def OverloadedVirtual : DiagGroup<"overloaded-virtual">; +def PrivateExtern : DiagGroup<"private-extern">; +def SelTypeCast : DiagGroup<"cast-of-sel-type">; def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">; def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">; def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">; @@ -341,6 +343,8 @@ def FormatNonLiteral : DiagGroup<"format def Format2 : DiagGroup<"format=2", [FormatNonLiteral, FormatSecurity, FormatY2K]>; +def TypeSafety : DiagGroup<"type-safety">; + def Extra : DiagGroup<"extra", [ MissingFieldInitializers, IgnoredQualifiers, @@ -371,7 +375,9 @@ def Most : DiagGroup<"most", [ Unused, VolatileRegisterVar, ObjCMissingSuperCalls, - OverloadedVirtual + OverloadedVirtual, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:33:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86ECA106566B; Sun, 19 Aug 2012 10:33:32 +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 58FEB8FC08; Sun, 19 Aug 2012 10:33:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAXWH9070467; Sun, 19 Aug 2012 10:33:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAXW84070466; Sun, 19 Aug 2012 10:33:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208191033.q7JAXW84070466@svn.freebsd.org> From: Dimitry Andric Date: Sun, 19 Aug 2012 10:33:32 +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: r239393 - vendor/clang/clang-trunk-r162107 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, 19 Aug 2012 10:33:32 -0000 Author: dim Date: Sun Aug 19 10:33:31 2012 New Revision: 239393 URL: http://svn.freebsd.org/changeset/base/239393 Log: Tag clang trunk r162107. Added: vendor/clang/clang-trunk-r162107/ - copied from r239392, vendor/clang/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:34:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6703D106566B; Sun, 19 Aug 2012 10:34:41 +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 4FC5F8FC2C; Sun, 19 Aug 2012 10:34:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAYfl2070632; Sun, 19 Aug 2012 10:34:41 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAYfUK070629; Sun, 19 Aug 2012 10:34:41 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208191034.q7JAYfUK070629@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 10:34: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: r239394 - head/cddl/contrib/opensolaris/cmd/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: Sun, 19 Aug 2012 10:34:41 -0000 Author: mm Date: Sun Aug 19 10:34:40 2012 New Revision: 239394 URL: http://svn.freebsd.org/changeset/base/239394 Log: Update zfs(8) manpage with illumos version of "zfs diff" Illumos issue: 2399 zfs manual page does not document use of "zfs diff" References: https://www.illumos.org/issues/2399 PR: docs/170764 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Aug 19 10:33:31 2012 (r239393) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Aug 19 10:34:40 2012 (r239394) @@ -2480,6 +2480,8 @@ also have the 'create' ability and 'moun .Xc .It create Ta subcommand Ta Must also have the 'mount' ability .It destroy Ta subcommand Ta Must also have the 'mount' ability +.It diff Ta subcommand Ta Allows lookup of paths within a dataset given an +object number, and the ability to create snapshots necessary to 'zfs diff' .It hold Ta subcommand Ta Allows adding a user hold to a snapshot .It mount Ta subcommand Ta Allows mount/umount of Tn ZFS No datasets .It Xo promote Ta subcommand Ta Must @@ -2683,43 +2685,43 @@ descendent file systems. .Op Ar snapshot Ns | Ns Ar filesystem .Xc .Pp -Describes differences between a snapshot and a successor dataset. The -successor dataset can be a later snapshot or the current filesystem. -.Pp -The changed files are displayed including the change type. The change type -is displayed useing a single character. If a file or directory was renamed, -the old and the new names are displayed. -.Pp -The following change types can be displayed: -.Pp -.Bl -column -offset indent "CHARACTER" "CHANGE TYPE" -.It CHARACTER Ta CHANGE TYPE -.It \&+ Ta file was added -.It \&- Ta file was removed -.It \&M Ta file was modified -.It \&R Ta file was renamed +Display the difference between a snapshot of a given filesystem and another +snapshot of that filesystem from a later time or the current contents of the +filesystem. The first column is a character indicating the type of change, +the other columns indicate pathname, new pathname +.Pq in case of rename , +change in link count, and optionally file type and/or change time. +.Pp +The types of change are: +.Bl -column -offset 2n indent +.It \&- Ta path was removed +.It \&+ Ta path was added +.It \&M Ta path was modified +.It \&R Ta path was renamed .El .Bl -tag -width indent .It Fl F -Display a single letter for the file type in second to last column. -.Pp -The following file types can be displayed: +Display an indication of the type of file, in a manner similar to the +.Fl F +option of +.Xr ls 1 . .Pp -.Bl -column -offset indent "CHARACTER" "FILE TYPE" -.It CHARACTER Ta FILE TYPE -.It \&F Ta file -.It \&/ Ta directory +.Bl -column -offset 2n indent .It \&B Ta block device +.It \&C Ta character device +.It \&F Ta regular file +.It \&/ Ta directory .It \&@ Ta symbolic link .It \&= Ta socket .It \&> Ta door (not supported on Fx ) -.It \&| Ta FIFO (not supported on Fx ) -.It \&P Ta event portal (not supported on Fx ) +.It \&| Ta named pipe (not supported on Fx ) +.It \&P Ta event port (not supported on Fx ) .El .It Fl H -Machine-parseable output, fields separated a tab character. +Give more parseable tab-separated output, without header lines and without +arrows. .It Fl t -Display a change timestamp in the first column. +Display the path's inode change time as the first column of output. .El .It Xo .Nm @@ -3171,6 +3173,22 @@ Local+Descendent permissions on (tank/us group staff @pset,create,mount ------------------------------------------------------------- .Ed +.It Sy Example 22 Showing the differences between a snapshot and a ZFS Dataset +.Pp +The following example shows how to see what has changed between a prior +snapshot of a ZFS Dataset and its current state. The +.Fl F +option is used to indicate type information for the files affected. +.Pp +.Bd -literal -offset 2n +.Li # Ic zfs diff tank/test@before tank/test +M / /tank/test/ +M F /tank/test/linked (+1) +R F /tank/test/oldname -> /tank/test/newname +- F /tank/test/deleted ++ F /tank/test/created +M F /tank/test/modified +.Ed .El .Sh EXIT STATUS The following exit values are returned: From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 11:54:03 2012 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 10FFC106564A; Sun, 19 Aug 2012 11:54:03 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFC008FC08; Sun, 19 Aug 2012 11:54:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JBs2dA078817; Sun, 19 Aug 2012 11:54:02 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JBs2hc078815; Sun, 19 Aug 2012 11:54:02 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201208191154.q7JBs2hc078815@svn.freebsd.org> From: Randall Stewart Date: Sun, 19 Aug 2012 11:54: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: r239395 - 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: Sun, 19 Aug 2012 11:54:03 -0000 Author: rrs Date: Sun Aug 19 11:54:02 2012 New Revision: 239395 URL: http://svn.freebsd.org/changeset/base/239395 Log: Though I disagree, I conceed to jhb & Rui. Note that we still have a problem with this whole structure of locks and in_input.c [it does not lock which it should not, but this *can* lead to crashes]. (I have seen it in our SQA testbed.. besides the one with a refcnt issue that I will have SQA work on next week ;-) Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Aug 19 10:34:40 2012 (r239394) +++ head/sys/netinet/in.c Sun Aug 19 11:54:02 2012 (r239395) @@ -573,6 +573,7 @@ in_control(struct socket *so, u_long cmd } TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); IF_ADDR_WUNLOCK(ifp); + ifa_free(&ia->ia_ifa); /* if_addrhead */ IN_IFADDR_WLOCK(); TAILQ_REMOVE(&V_in_ifaddrhead, ia, ia_link); @@ -596,7 +597,6 @@ in_control(struct socket *so, u_long cmd } else ifa_free(&iap->ia_ifa); - ifa_free(&ia->ia_ifa); /* if_addrhead */ ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ out: if (ia != NULL) From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 11:58:08 2012 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 7D9C6106566C; Sun, 19 Aug 2012 11:58:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4D91D8FC18; Sun, 19 Aug 2012 11:58:08 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 773F446B0A; Sun, 19 Aug 2012 07:58:02 -0400 (EDT) Date: Sun, 19 Aug 2012 12:58:02 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Randall Stewart In-Reply-To: <201208191154.q7JBs2hc078815@svn.freebsd.org> Message-ID: References: <201208191154.q7JBs2hc078815@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239395 - 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: Sun, 19 Aug 2012 11:58:08 -0000 On Sun, 19 Aug 2012, Randall Stewart wrote: > Though I disagree, I conceed to jhb & Rui. Note > that we still have a problem with this whole structure of > locks and in_input.c [it does not lock which it should not, but > this *can* lead to crashes]. (I have seen it in our SQA > testbed.. besides the one with a refcnt issue that I will > have SQA work on next week ;-) I agree with John here -- these are seperate issues, and we need to get each part correct in isolation, not just in composition. Bjoern and I have been plotting a lock reduction exercise in the network stack for some time, based on a model Jeff Roberson and the Nokia guys used -- a global "config" lock, which would use our rmlock primitive. This would make address list synchronisation sufficiently affordable to use in ip_input(). However, it comes with a number of other issues that we need to consider, such as potential latency impacts of reconfiguration events, which have to be characterised before we commit to it, as well as potential issues with lock order. Recent rmlock improvements (e.g., with respect to WITNESS) make doing this work much more plausible. Hopefully this is something we'll get to in September. Robert From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 12:15:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C713C106564A; Sun, 19 Aug 2012 12:15:58 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from smtp01-out.isp.tdc.no (smtp01-out.isp.tdc.no [85.19.210.243]) by mx1.freebsd.org (Postfix) with ESMTP id 6074F8FC12; Sun, 19 Aug 2012 12:15:58 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [85.19.79.136]) by smtp01-out.isp.tdc.no (Postfix) with ESMTP id 3X0HD20wDFz39F; Sun, 19 Aug 2012 14:15:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bitfrost.no From: =?windows-1252?Q?Hans_Petter_Selasky?= To: =?windows-1252?Q?Andrew_Turner?= Date: Sun, 19 Aug 2012 14:15:53 +0200 Mime-Version: 1.0 In-Reply-To: <20120819202622.6db6a8dd@fubar.geek.nz> References: <20120819202622.6db6a8dd@fubar.geek.nz> X-Priority: 3 (Normal) Message-Id: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "=?windows-1252?Q?svn-src-head=40freebsd.org?=" , "=?windows-1252?Q?svn-src-all=40freebsd.org?=" , "=?windows-1252?Q?src-committers=40freebsd.org?=" , =?windows-1252?Q?Hans_Petter_Selasky?= Subject: RE: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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: Sun, 19 Aug 2012 12:15:58 -0000 Hi,=0D=0A=0D=0A=A0=0D=0A=0D=0AWhat exactly is the driver the USB mass sto= rage device is attached to=3F=0D=0A=0D=0A=A0=0D=0A=0D=0AAnd the problem i= s the same using the latest FreeBSD version from -current=3F=0D=0A=0D=0A=A0= =0D=0A=0D=0AYou are certain that all parts of the kernel were rebuilt=3F=0D= =0A=0D=0A=A0=0D=0A=0D=0AAnd you are certain that it has nothing to do wit= h the FreeBSD version bump which is also part of this change=3F=0D=0A=0D=0A= =A0=0D=0A=0D=0AProbably we should move this thread to -current @=0D=0A=0D= =0A=A0=0D=0A=0D=0A--HPS=0D=0A=A0=0D=0A-----Original message-----=0D=0AFro= m:Andrew Turner =0D=0ASent:Sun 19-08-2012 10:27=0D=0A= Subject:Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller= sys=0D=0ATo:Hans Petter Selasky ;=20=0D= =0ACC:Hans Petter Selasky ; svn-src-head@freebsd.or= g; svn-src-all@freebsd.org; src-committers@freebsd.org;=20=0D=0AOn Sun, 1= 9 Aug 2012 09:39:11 +0200=0D=0AHans Petter Selasky =A0 wrote:=0D=0A=0D=0A> Hi,=0D=0A>=20=0D=0A> =A0=0D=0A>=20=0D=0A= > Have you stepped the versions=3F=0D=0AI did a binary search of the comm= its to find the revision that caused=0D=0Athe issue.=0D=0A=0D=0A> Are you= sure it is exactly this commit=3F=0D=0AI built with r239213 and the prob= lem went away, when I built with=0D=0Ar239214 it appeared again.=0D=0A=0D= =0AAndrew=0D=0A From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 17:39:00 2012 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 5A487106566B; Sun, 19 Aug 2012 17:39:00 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from emx.nitro.dk (leto.nitro.dk [178.63.52.6]) by mx1.freebsd.org (Postfix) with ESMTP id D1D2B8FC22; Sun, 19 Aug 2012 17:38:59 +0000 (UTC) Received: from mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) by emx.nitro.dk (Postfix) with ESMTP id B8F342B43EA; Sun, 19 Aug 2012 17:38:58 +0000 (UTC) Received: from emx.nitro.dk ([127.0.1.2]) by mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) (amavisd-new, port 10024) with LMTP id 08izfVxnYxyq; Sun, 19 Aug 2012 17:38:56 +0000 (UTC) Received: from [192.168.4.24] (unknown [89.100.2.68]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by emx.nitro.dk (Postfix) with ESMTPSA id 3E9DC2B43E5; Sun, 19 Aug 2012 17:38:56 +0000 (UTC) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) From: "Simon L. B. Nielsen" In-Reply-To: Date: Sun, 19 Aug 2012 18:38:55 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <38287857-28FA-4042-911D-EE0DDC54D62F@FreeBSD.org> References: <201208180926.q7I9Qptp001696@svn.freebsd.org> To: Chris Rees X-Mailer: Apple Mail (2.1485) Cc: svn-src-head@freebsd.org, cvsadm@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Niclas Zeising Subject: Re: svn commit: r239364 - head/libexec/revnetgroup 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, 19 Aug 2012 17:39:00 -0000 On 18 Aug 2012, at 13:01, Chris Rees wrote: > On 18 August 2012 12:58, Chris Rees wrote: >> On 18 August 2012 10:26, Niclas Zeising wrote: >>> Author: zeising (ports committer) >>=20 >> There's something wrong here-- shouldn't it say (ports, doc >> committer)? Looks like it's not checking doc/svnadmin/conf/access... >=20 > (replying to own message) >=20 > For example, Glen Barber appears correctly (and demonstrates that it > should be doc,ports committer): >=20 > = http://lists.freebsd.org/pipermail/svn-src-head/2012-August/039471.html The problem is that the access file exporter which the commit scripts = use for out of repo commits looks at /home/mail/*-access which are based = on CVS versions, and and doc isn't updated in CVS anymore newer = committers status isn't shown correctly. It's a TODO, but nobody has gotten around to fixing it yet. --=20 Simon L. B. Nielsen From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:17:55 2012 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 B9D85106566B; Sun, 19 Aug 2012 19:17:55 +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 A43BC8FC08; Sun, 19 Aug 2012 19:17:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJHtFX024652; Sun, 19 Aug 2012 19:17:55 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJHtWO024650; Sun, 19 Aug 2012 19:17:55 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191917.q7JJHtWO024650@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239396 - head/gnu/usr.bin/gdb/arch/powerpc 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, 19 Aug 2012 19:17:55 -0000 Author: andreast Date: Sun Aug 19 19:17:54 2012 New Revision: 239396 URL: http://svn.freebsd.org/changeset/base/239396 Log: Fix typo. Not a win in terms of functionality but in terms of completeness. Modified: head/gnu/usr.bin/gdb/arch/powerpc/config.h Modified: head/gnu/usr.bin/gdb/arch/powerpc/config.h ============================================================================== --- head/gnu/usr.bin/gdb/arch/powerpc/config.h Sun Aug 19 11:54:02 2012 (r239395) +++ head/gnu/usr.bin/gdb/arch/powerpc/config.h Sun Aug 19 19:17:54 2012 (r239396) @@ -175,7 +175,7 @@ /* nativefile */ #ifndef CROSS_DEBUGGER -#define GDB_NM_FILE config/ia64/nm-fbsd.h +#define GDB_NM_FILE config/powerpc/nm-fbsd.h #endif /* Define to 1 so gets a definition of anon_hdl. Works From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:31:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB2221065670; Sun, 19 Aug 2012 19:31:37 +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 95F5B8FC0C; Sun, 19 Aug 2012 19:31:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJVb10026037; Sun, 19 Aug 2012 19:31:37 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJVbAe026035; Sun, 19 Aug 2012 19:31:37 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191931.q7JJVbAe026035@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239397 - head/sys/dev/iicbus 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, 19 Aug 2012 19:31:37 -0000 Author: andreast Date: Sun Aug 19 19:31:36 2012 New Revision: 239397 URL: http://svn.freebsd.org/changeset/base/239397 Log: Do the ADC init only at startup and not during every sensor read call. This reduces the number of interrupts. Modified: head/sys/dev/iicbus/ad7417.c Modified: head/sys/dev/iicbus/ad7417.c ============================================================================== --- head/sys/dev/iicbus/ad7417.c Sun Aug 19 19:17:54 2012 (r239396) +++ head/sys/dev/iicbus/ad7417.c Sun Aug 19 19:31:36 2012 (r239397) @@ -104,6 +104,7 @@ struct ad7417_softc { uint32_t sc_addr; struct ad7417_sensor *sc_sensors; int sc_nsensors; + int init_done; }; static device_method_t ad7417_methods[] = { /* Device interface */ @@ -247,6 +248,9 @@ ad7417_init_adc(device_t dev, uint32_t a { uint8_t buf; int err; + struct ad7417_softc *sc; + + sc = device_get_softc(dev); adc741x_config = 0; /* Clear Config2 */ @@ -267,6 +271,8 @@ ad7417_init_adc(device_t dev, uint32_t a if (err < 0) return (-1); + sc->init_done = 1; + return (0); } @@ -430,10 +436,10 @@ ad7417_attach(device_t dev) if (sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR) { unit = "temp"; - desc = "Sensor temp in C"; + desc = "sensor unit (C)"; } else { unit = "volt"; - desc = "Sensor Volt in V"; + desc = "sensor unit (mV)"; } /* I use i to pass the sensor id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -584,9 +590,10 @@ ad7417_sensor_read(struct ad7417_sensor sc = device_get_softc(sens->dev); - /* Init the ADC. */ - if (ad7417_init_adc(sc->sc_dev, sc->sc_addr) < 0) - return (-1); + /* Init the ADC if not already done.*/ + if (!sc->init_done) + if (ad7417_init_adc(sc->sc_dev, sc->sc_addr) < 0) + return (-1); if (sens->type == ADC7417_TEMP_SENSOR) { if (ad7417_get_temp(sc->sc_dev, sc->sc_addr, &temp) < 0) From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:32:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 121F51065670; Sun, 19 Aug 2012 19:32:39 +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 F07628FC0C; Sun, 19 Aug 2012 19:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJWc1N026172; Sun, 19 Aug 2012 19:32:38 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJWcUn026170; Sun, 19 Aug 2012 19:32:38 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191932.q7JJWcUn026170@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:32: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: r239398 - head/sys/dev/iicbus 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, 19 Aug 2012 19:32:39 -0000 Author: andreast Date: Sun Aug 19 19:32:38 2012 New Revision: 239398 URL: http://svn.freebsd.org/changeset/base/239398 Log: Avoid using the degree symbol. Looks ugly on the console. Modified: head/sys/dev/iicbus/max6690.c Modified: head/sys/dev/iicbus/max6690.c ============================================================================== --- head/sys/dev/iicbus/max6690.c Sun Aug 19 19:31:36 2012 (r239397) +++ head/sys/dev/iicbus/max6690.c Sun Aug 19 19:32:38 2012 (r239398) @@ -251,7 +251,7 @@ max6690_start(void *xdev) struct max6690_softc *sc; struct sysctl_oid *oid, *sensroot_oid; struct sysctl_ctx_list *ctx; - char sysctl_name[32]; + char sysctl_desc[40], sysctl_name[32]; int i, j; device_t dev = (device_t)xdev; @@ -293,6 +293,8 @@ max6690_start(void *xdev) } sysctl_name[j] = 0; + sprintf(sysctl_desc,"%s %s", sc->sc_sensors[i].therm.name, + "(C)"); oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO, sysctl_name, CTLFLAG_RD, 0, @@ -300,8 +302,7 @@ max6690_start(void *xdev) /* I use i to pass the sensor id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD, dev, i % 2, - max6690_sensor_sysctl, "IK", - "Sensor Temp in °C"); + max6690_sensor_sysctl, "IK", sysctl_desc); } /* Dump sensor location & ID. */ From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:34:11 2012 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 63F8E106566C; Sun, 19 Aug 2012 19:34:11 +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 3441E8FC08; Sun, 19 Aug 2012 19:34:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJYBrD026374; Sun, 19 Aug 2012 19:34:11 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJYBvJ026372; Sun, 19 Aug 2012 19:34:11 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191934.q7JJYBvJ026372@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:34: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: r239399 - head/sys/dev/iicbus 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, 19 Aug 2012 19:34:11 -0000 Author: andreast Date: Sun Aug 19 19:34:10 2012 New Revision: 239399 URL: http://svn.freebsd.org/changeset/base/239399 Log: Unify the sysctl description with the other PowerMac temperature drivers. Modified: head/sys/dev/iicbus/ds1775.c Modified: head/sys/dev/iicbus/ds1775.c ============================================================================== --- head/sys/dev/iicbus/ds1775.c Sun Aug 19 19:32:38 2012 (r239398) +++ head/sys/dev/iicbus/ds1775.c Sun Aug 19 19:34:10 2012 (r239399) @@ -172,12 +172,11 @@ ds1775_start(void *xdev) { phandle_t child; struct ds1775_softc *sc; - struct sysctl_oid *sensroot_oid; + struct sysctl_oid *oid, *sensroot_oid; struct sysctl_ctx_list *ctx; ssize_t plen; int i; char sysctl_name[40], sysctl_desc[40]; - const char *units; device_t dev = (device_t)xdev; @@ -186,7 +185,9 @@ ds1775_start(void *xdev) child = ofw_bus_get_node(dev); ctx = device_get_sysctl_ctx(dev); - sensroot_oid = device_get_sysctl_tree(dev); + sensroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", + CTLFLAG_RD, 0, "DS1775 Sensor Information"); if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, sizeof(int)) < 0) @@ -194,7 +195,6 @@ ds1775_start(void *xdev) plen = OF_getprop(child, "hwsensor-location", sc->sc_sensor.name, sizeof(sc->sc_sensor.name)); - units = "C"; if (plen == -1) { strcpy(sysctl_name, "sensor"); @@ -221,9 +221,11 @@ ds1775_start(void *xdev) (int (*)(struct pmac_therm *sc))(ds1775_sensor_read); pmac_thermal_sensor_register(&sc->sc_sensor); - sprintf(sysctl_desc,"%s (%s)", sc->sc_sensor.name, units); - SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO, - sysctl_name, + sprintf(sysctl_desc,"%s %s", sc->sc_sensor.name, "(C)"); + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), + OID_AUTO, sysctl_name, CTLFLAG_RD, 0, + "Sensor Information"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, 0, ds1775_sensor_sysctl, "IK", sysctl_desc); From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:37:15 2012 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 1C067106564A; Sun, 19 Aug 2012 19:37:15 +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 F01598FC12; Sun, 19 Aug 2012 19:37:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJbE37026708; Sun, 19 Aug 2012 19:37:14 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJbEqC026705; Sun, 19 Aug 2012 19:37:14 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191937.q7JJbEqC026705@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:37: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: r239400 - in head/sys: conf dev/iicbus 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, 19 Aug 2012 19:37:15 -0000 Author: andreast Date: Sun Aug 19 19:37:14 2012 New Revision: 239400 URL: http://svn.freebsd.org/changeset/base/239400 Log: Add a new temperature driver for certain PowerMacs. Found here on my Quad G5. Added: head/sys/dev/iicbus/ds1631.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Aug 19 19:34:10 2012 (r239399) +++ head/sys/conf/files.powerpc Sun Aug 19 19:37:14 2012 (r239400) @@ -32,6 +32,7 @@ dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/iicbus/ad7417.c optional ad7417 powermac +dev/iicbus/ds1631.c optional ds1631 powermac dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac dev/kbd/kbd.c optional sc Added: head/sys/dev/iicbus/ds1631.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/ds1631.c Sun Aug 19 19:37:14 2012 (r239400) @@ -0,0 +1,413 @@ +/*- + * Copyright (c) 2012 Andreas Tobler + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +/* Sensor: Maxim DS1631 */ + +#define DS1631_STOP 0x22 +#define DS1631_START 0x51 +#define DS1631_RESET 0x54 +#define DS1631_TEMP 0xAA +#define DS1631_CONTROL 0xAC +#define DS1631_CONTROL_1SHOT 0x01 +#define DS1631_CONTROL_9BIT 0x00 +#define DS1631_CONTROL_10BIT 0x04 +#define DS1631_CONTROL_11BIT 0x08 +#define DS1631_CONTROL_12BIT 0x0C + + + +/* Regular bus attachment functions */ +static int ds1631_probe(device_t); +static int ds1631_attach(device_t); + +struct ds1631_softc { + struct pmac_therm sc_sensor; + device_t sc_dev; + struct intr_config_hook enum_hook; + uint32_t sc_addr; + uint32_t init_done; +}; + +struct write_data { + uint8_t reg; + uint8_t val; +}; + +struct read_data { + uint8_t reg; + uint16_t val; +}; + +/* Utility functions */ +static int ds1631_sensor_read(struct ds1631_softc *sc); +static int ds1631_sensor_sysctl(SYSCTL_HANDLER_ARGS); +static void ds1631_start(void *xdev); +static int ds1631_read_1(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *data); +static int ds1631_read_2(device_t dev, uint32_t addr, uint8_t reg, + uint16_t *data); +static int ds1631_write(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *buff, int len); + +static device_method_t ds1631_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ds1631_probe), + DEVMETHOD(device_attach, ds1631_attach), + { 0, 0 }, +}; + +static driver_t ds1631_driver = { + "ds1631", + ds1631_methods, + sizeof(struct ds1631_softc) +}; + +static devclass_t ds1631_devclass; + +DRIVER_MODULE(ds1631, iicbus, ds1631_driver, ds1631_devclass, 0, 0); + +static int +ds1631_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff, int len) +{ + uint8_t buf[4]; + int try = 0; + + struct iic_msg msg[] = { + { addr, IIC_M_WR, 0, buf } + }; + + /* Prepare the write msg. */ + msg[0].len = len + 1; + buf[0] = reg; + memcpy(buf + 1, buff, len); + + for (;;) + { + if (iicbus_transfer(dev, msg, 1) == 0) + return (0); + if (++try > 5) { + device_printf(dev, "iicbus write failed\n"); + return (-1); + } + pause("ds1631_write", hz); + } +} + +static int +ds1631_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) +{ + uint8_t buf[4]; + int err, try = 0; + + struct iic_msg msg[2] = { + { addr, IIC_M_WR, 1, ® }, + { addr, IIC_M_RD, 1, buf }, + }; + + for (;;) + { + err = iicbus_transfer(dev, msg, 2); + if (err != 0) + goto retry; + + *data = *((uint8_t*)buf); + return (0); + retry: + if (++try > 5) { + device_printf(dev, "iicbus read failed\n"); + return (-1); + } + pause("ds1631_read_1", hz); + } +} + +static int +ds1631_read_2(device_t dev, uint32_t addr, uint8_t reg, uint16_t *data) +{ + uint8_t buf[4]; + int err, try = 0; + + struct iic_msg msg[2] = { + { addr, IIC_M_WR, 1, ® }, + { addr, IIC_M_RD, 2, buf }, + }; + + for (;;) + { + err = iicbus_transfer(dev, msg, 2); + if (err != 0) + goto retry; + + *data = *((uint16_t*)buf); + return (0); + retry: + if (++try > 5) { + device_printf(dev, "iicbus read failed\n"); + return (-1); + } + pause("ds1631_read_2", hz); + } +} + +static int +ds1631_probe(device_t dev) +{ + const char *name, *compatible; + struct ds1631_softc *sc; + + name = ofw_bus_get_name(dev); + compatible = ofw_bus_get_compat(dev); + + if (!name) + return (ENXIO); + + if (strcmp(name, "temp-monitor") != 0 || + strcmp(compatible, "ds1631") != 0 ) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + device_set_desc(dev, "Temp-Monitor DS1631"); + + return (0); +} + +static int +ds1631_attach(device_t dev) +{ + struct ds1631_softc *sc; + + sc = device_get_softc(dev); + + sc->enum_hook.ich_func = ds1631_start; + sc->enum_hook.ich_arg = dev; + + /* + * We have to wait until interrupts are enabled. I2C read and write + * only works if the interrupts are available. + * The unin/i2c is controlled by the htpic on unin. But this is not + * the master. The openpic on mac-io is controlling the htpic. + * This one gets attached after the mac-io probing and then the + * interrupts will be available. + */ + + if (config_intrhook_establish(&sc->enum_hook) != 0) + return (ENOMEM); + + return (0); +} +static int +ds1631_init(device_t dev, uint32_t addr) +{ + uint8_t conf; + int err; + struct ds1631_softc *sc; + + sc = device_get_softc(dev); + + err = ds1631_read_1(dev, addr, DS1631_CONTROL, &conf); + if (err < 0) { + device_printf(dev, "ds1631 read config failed: %x\n", err); + return (-1); + } + + /* Stop the conversion if not in 1SHOT mode. */ + if (conf & ~DS1631_CONTROL_1SHOT) + err = ds1631_write(dev, addr, DS1631_STOP, &conf, 0); + + /* + * Setup the resolution, 10-bit is enough. Each bit increase in + * resolution doubles the conversion time. + */ + conf = DS1631_CONTROL_10BIT; + + err = ds1631_write(dev, addr, DS1631_CONTROL, &conf, 1); + if (err < 0) { + device_printf(dev, "ds1631 write config failed: %x\n", err); + return (-1); + } + + /* And now start....*/ + err = ds1631_write(dev, addr, DS1631_START, &conf, 0); + + if (err < 0) { + device_printf(dev, "ds1631 write start failed: %x\n", err); + return (-1); + } + + sc->init_done = 1; + + return (0); + +} +static void +ds1631_start(void *xdev) +{ + phandle_t child, node; + struct ds1631_softc *sc; + struct sysctl_oid *oid, *sensroot_oid; + struct sysctl_ctx_list *ctx; + ssize_t plen; + int i; + char sysctl_desc[40], sysctl_name[40]; + + device_t dev = (device_t)xdev; + + sc = device_get_softc(dev); + + child = ofw_bus_get_node(dev); + + ctx = device_get_sysctl_ctx(dev); + sensroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", + CTLFLAG_RD, 0, "DS1631 Sensor Information"); + + if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, + sizeof(int)) < 0) + sc->sc_sensor.zone = 0; + + plen = OF_getprop(child, "hwsensor-location", sc->sc_sensor.name, + sizeof(sc->sc_sensor.name)); + if (plen == -1) { + /* + * Ok, no hwsensor-location property, so let's look for a + * location property on a sub node. + */ + for (node = OF_child(child); node; node = OF_peer(node)) + plen = OF_getprop(node, "location", sc->sc_sensor.name, + sizeof(sc->sc_sensor.name)); + } + + if (plen == -1) { + strcpy(sysctl_name, "sensor"); + } else { + for (i = 0; i < strlen(sc->sc_sensor.name); i++) { + sysctl_name[i] = tolower(sc->sc_sensor.name[i]); + if (isspace(sysctl_name[i])) + sysctl_name[i] = '_'; + } + sysctl_name[i] = 0; + } + + /* Make up target temperatures. These are low, for the drive bay. */ + if (sc->sc_sensor.zone == 0) { + sc->sc_sensor.target_temp = 400 + ZERO_C_TO_K; + sc->sc_sensor.max_temp = 500 + ZERO_C_TO_K; + } else { + sc->sc_sensor.target_temp = 300 + ZERO_C_TO_K; + sc->sc_sensor.max_temp = 500 + ZERO_C_TO_K; + } + + sc->sc_sensor.read = + (int (*)(struct pmac_therm *sc))(ds1631_sensor_read); + pmac_thermal_sensor_register(&sc->sc_sensor); + + sprintf(sysctl_desc,"%s %s", sc->sc_sensor.name, "(C)"); + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), + OID_AUTO, sysctl_name, CTLFLAG_RD, 0, + "Sensor Information"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, + 0, ds1631_sensor_sysctl, "IK", sysctl_desc); + + config_intrhook_disestablish(&sc->enum_hook); +} + +static int +ds1631_sensor_read(struct ds1631_softc *sc) +{ + uint16_t buf[2]; + uint16_t read; + int err; + + if (!sc->init_done) + ds1631_init(sc->sc_dev, sc->sc_addr); + + err = ds1631_read_2(sc->sc_dev, sc->sc_addr, DS1631_TEMP, buf); + if (err < 0) { + device_printf(sc->sc_dev, "ds1631 read TEMP failed: %x\n", err); + return (-1); + } + + read = *((int16_t *)buf); + + /* + * The default mode of the ADC is 12-bit, the resolution is 0.0625 C + * per bit. The temperature is in tenth kelvin. + * We use 10-bit resolution which seems enough, resolution is 0.25 C. + */ + + return (((int16_t)(read) >> 6) * 25 / 10 + ZERO_C_TO_K); +} + +static int +ds1631_sensor_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + struct ds1631_softc *sc; + int error; + unsigned int temp; + + dev = arg1; + sc = device_get_softc(dev); + + temp = ds1631_sensor_read(sc); + if (temp < 0) + return (EIO); + + error = sysctl_handle_int(oidp, &temp, 0, req); + + return (error); +} From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:40:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46DAD106566C; Sun, 19 Aug 2012 19:40:34 +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 2FF2E8FC08; Sun, 19 Aug 2012 19:40:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJeYcv027111; Sun, 19 Aug 2012 19:40:34 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJeXi3027107; Sun, 19 Aug 2012 19:40:33 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191940.q7JJeXi3027107@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:40: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: r239401 - in head/sys: conf dev/sound/macio 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, 19 Aug 2012 19:40:34 -0000 Author: andreast Date: Sun Aug 19 19:40:33 2012 New Revision: 239401 URL: http://svn.freebsd.org/changeset/base/239401 Log: Add a new sound driver for PowerMacs, found here on my Quad G5. It allows simple playback and volume control like the other Mac drivers, not more. Added: head/sys/dev/sound/macio/onyx.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Aug 19 19:37:14 2012 (r239400) +++ head/sys/conf/files.powerpc Sun Aug 19 19:40:33 2012 (r239401) @@ -54,6 +54,7 @@ dev/sec/sec.c optional sec mpc85xx dev/sound/macio/aoa.c optional snd_davbus | snd_ai2s powermac dev/sound/macio/davbus.c optional snd_davbus powermac dev/sound/macio/i2s.c optional snd_ai2s powermac +dev/sound/macio/onyx.c optional snd_ai2s iicbus powermac dev/sound/macio/snapper.c optional snd_ai2s iicbus powermac dev/sound/macio/tumbler.c optional snd_ai2s iicbus powermac dev/syscons/scgfbrndr.c optional sc Added: head/sys/dev/sound/macio/onyx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sound/macio/onyx.c Sun Aug 19 19:40:33 2012 (r239401) @@ -0,0 +1,315 @@ +/*- + * Copyright 2012 by Andreas Tobler. 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Apple PCM3052 aka Onyx audio codec. + * + * Datasheet: http://www.ti.com/product/pcm3052a + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + +#include + +#include "mixer_if.h" + +extern kobj_class_t i2s_mixer_class; +extern device_t i2s_mixer; + +struct onyx_softc +{ + device_t sc_dev; + uint32_t sc_addr; +}; + +static int onyx_probe(device_t); +static int onyx_attach(device_t); +static int onyx_init(struct snd_mixer *m); +static int onyx_uninit(struct snd_mixer *m); +static int onyx_reinit(struct snd_mixer *m); +static int onyx_set(struct snd_mixer *m, unsigned dev, unsigned left, + unsigned right); +static u_int32_t onyx_setrecsrc(struct snd_mixer *m, u_int32_t src); + +static device_method_t onyx_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, onyx_probe), + DEVMETHOD(device_attach, onyx_attach), + { 0, 0 } +}; + +static driver_t onyx_driver = { + "onyx", + onyx_methods, + sizeof(struct onyx_softc) +}; +static devclass_t onyx_devclass; + +DRIVER_MODULE(onyx, iicbus, onyx_driver, onyx_devclass, 0, 0); +MODULE_VERSION(onyx, 1); +MODULE_DEPEND(onyx, iicbus, 1, 1, 1); + +static kobj_method_t onyx_mixer_methods[] = { + KOBJMETHOD(mixer_init, onyx_init), + KOBJMETHOD(mixer_uninit, onyx_uninit), + KOBJMETHOD(mixer_reinit, onyx_reinit), + KOBJMETHOD(mixer_set, onyx_set), + KOBJMETHOD(mixer_setrecsrc, onyx_setrecsrc), + KOBJMETHOD_END +}; + +MIXER_DECLARE(onyx_mixer); + +#define PCM3052_IICADDR 0x8C /* Hard-coded I2C slave addr */ + +/* + * PCM3052 registers. + * Numbering in decimal as used in the data sheet. + */ +#define PCM3052_REG_LEFT_ATTN 65 +#define PCM3052_REG_RIGHT_ATTN 66 +#define PCM3052_REG_CONTROL 67 +#define PCM3052_MRST (1 << 7) +#define PCM3052_SRST (1 << 6) +#define PCM3052_REG_DAC_CONTROL 68 +#define PCM3052_OVR1 (1 << 6) +#define PCM3052_MUTE_L (1 << 1) +#define PCM3052_MUTE_R (1 << 0) +#define PCM3052_REG_DAC_DEEMPH 69 +#define PCM3052_REG_DAC_FILTER 70 +#define PCM3052_DAC_FILTER_ALWAYS (1 << 2) +#define PCM3052_REG_OUT_PHASE 71 +#define PCM3052_REG_ADC_CONTROL 72 +#define PCM3052_REG_ADC_HPF_BP 75 +#define PCM3052_HPF_ALWAYS (1 << 2) +#define PCM3052_REG_INFO_1 77 +#define PCM3052_REG_INFO_2 78 +#define PCM3052_REG_INFO_3 79 +#define PCM3052_REG_INFO_4 80 + +struct onyx_reg { + u_char LEFT_ATTN; + u_char RIGHT_ATTN; + u_char CONTROL; + u_char DAC_CONTROL; + u_char DAC_DEEMPH; + u_char DAC_FILTER; + u_char OUT_PHASE; + u_char ADC_CONTROL; + u_char ADC_HPF_BP; + u_char INFO_1; + u_char INFO_2; + u_char INFO_3; + u_char INFO_4; +}; + +static const struct onyx_reg onyx_initdata = { + 0x80, /* LEFT_ATTN, Mute default */ + 0x80, /* RIGHT_ATTN, Mute default */ + PCM3052_MRST | PCM3052_SRST, /* CONTROL */ + 0, /* DAC_CONTROL */ + 0, /* DAC_DEEMPH */ + PCM3052_DAC_FILTER_ALWAYS, /* DAC_FILTER */ + 0, /* OUT_PHASE */ + (-1 /* dB */ + 8) & 0xf, /* ADC_CONTROL */ + PCM3052_HPF_ALWAYS, /* ADC_HPF_BP */ + (1 << 2), /* INFO_1 */ + 2, /* INFO_2, */ + 0, /* INFO_3, CLK 0 (level II), + SF 0 (44.1 kHz) */ + 1 /* INFO_4, VALIDL/R 0, + WL 24-bit depth */ +}; + +static int +onyx_write(struct onyx_softc *sc, uint8_t reg, const uint8_t value) +{ + u_int size; + uint8_t buf[16]; + + struct iic_msg msg[] = { + { sc->sc_addr, IIC_M_WR, 0, buf } + }; + + size = 1; + msg[0].len = size + 1; + buf[0] = reg; + buf[1] = value; + + iicbus_transfer(sc->sc_dev, msg, 1); + + return (0); +} + +static int +onyx_probe(device_t dev) +{ + const char *name, *compat; + + name = ofw_bus_get_name(dev); + if (name == NULL) + return (ENXIO); + + if (strcmp(name, "codec") == 0) { + if (iicbus_get_addr(dev) != PCM3052_IICADDR) + return (ENXIO); + } else if (strcmp(name, "codec") == 0) { + compat = ofw_bus_get_compat(dev); + if (compat == NULL || strcmp(compat, "pcm3052") != 0) + return (ENXIO); + } else + return (ENXIO); + + device_set_desc(dev, "Texas Instruments PCM3052 Audio Codec"); + return (0); +} + +static int +onyx_attach(device_t dev) +{ + struct onyx_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + i2s_mixer_class = &onyx_mixer_class; + i2s_mixer = dev; + + return (0); +} + +static int +onyx_init(struct snd_mixer *m) +{ + struct onyx_softc *sc; + u_int x = 0; + + sc = device_get_softc(mix_getdevinfo(m)); + + onyx_write(sc, PCM3052_REG_LEFT_ATTN, onyx_initdata.LEFT_ATTN); + onyx_write(sc, PCM3052_REG_RIGHT_ATTN, onyx_initdata.RIGHT_ATTN); + onyx_write(sc, PCM3052_REG_CONTROL, onyx_initdata.CONTROL); + onyx_write(sc, PCM3052_REG_DAC_CONTROL, + onyx_initdata.DAC_CONTROL); + onyx_write(sc, PCM3052_REG_DAC_DEEMPH, onyx_initdata.DAC_DEEMPH); + onyx_write(sc, PCM3052_REG_DAC_FILTER, onyx_initdata.DAC_FILTER); + onyx_write(sc, PCM3052_REG_OUT_PHASE, onyx_initdata.OUT_PHASE); + onyx_write(sc, PCM3052_REG_ADC_CONTROL, + onyx_initdata.ADC_CONTROL); + onyx_write(sc, PCM3052_REG_ADC_HPF_BP, onyx_initdata.ADC_HPF_BP); + onyx_write(sc, PCM3052_REG_INFO_1, onyx_initdata.INFO_1); + onyx_write(sc, PCM3052_REG_INFO_2, onyx_initdata.INFO_2); + onyx_write(sc, PCM3052_REG_INFO_3, onyx_initdata.INFO_3); + onyx_write(sc, PCM3052_REG_INFO_4, onyx_initdata.INFO_4); + + x |= SOUND_MASK_VOLUME; + mix_setdevs(m, x); + + return (0); +} + +static int +onyx_uninit(struct snd_mixer *m) +{ + return (0); +} + +static int +onyx_reinit(struct snd_mixer *m) +{ + return (0); +} + +static int +onyx_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) +{ + struct onyx_softc *sc; + struct mtx *mixer_lock; + int locked; + uint8_t l, r; + + sc = device_get_softc(mix_getdevinfo(m)); + mixer_lock = mixer_get_lock(m); + locked = mtx_owned(mixer_lock); + + switch (dev) { + case SOUND_MIXER_VOLUME: + + /* + * We need to unlock the mixer lock because iicbus_transfer() + * may sleep. The mixer lock itself is unnecessary here + * because it is meant to serialize hardware access, which + * is taken care of by the I2C layer, so this is safe. + */ + if (left > 100 || right > 100) + return (0); + + l = left + 128; + r = right + 128; + + if (locked) + mtx_unlock(mixer_lock); + + onyx_write(sc, PCM3052_REG_LEFT_ATTN, l); + onyx_write(sc, PCM3052_REG_RIGHT_ATTN, r); + + if (locked) + mtx_lock(mixer_lock); + + return (left | (right << 8)); + } + + return (0); +} + +static u_int32_t +onyx_setrecsrc(struct snd_mixer *m, u_int32_t src) +{ + return (0); +} From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:44:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32F49106564A; Sun, 19 Aug 2012 19:44:14 +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 054368FC15; Sun, 19 Aug 2012 19:44:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJiDlp027516; Sun, 19 Aug 2012 19:44:13 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJiDCl027512; Sun, 19 Aug 2012 19:44:13 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191944.q7JJiDCl027512@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:44: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: r239402 - head/sys/powerpc/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: Sun, 19 Aug 2012 19:44:14 -0000 Author: andreast Date: Sun Aug 19 19:44:13 2012 New Revision: 239402 URL: http://svn.freebsd.org/changeset/base/239402 Log: Add the ds1631 temperature driver. Modified: head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/NOTES Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Aug 19 19:40:33 2012 (r239401) +++ head/sys/powerpc/conf/GENERIC Sun Aug 19 19:44:13 2012 (r239402) @@ -190,6 +190,7 @@ device fwe # Ethernet over FireWire (n device iicbus # I2C bus code device kiic # Keywest I2C device ad7417 # PowerMac7,2 temperature sensor +device ds1631 # PowerMac11,2 temperature sensor device ds1775 # PowerMac7,2 temperature sensor device fcu # Apple Fan Control Unit device max6690 # PowerMac7,2 temperature sensor Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Sun Aug 19 19:40:33 2012 (r239401) +++ head/sys/powerpc/conf/GENERIC64 Sun Aug 19 19:44:13 2012 (r239402) @@ -188,6 +188,7 @@ device fwe # Ethernet over FireWire (n device iicbus # I2C bus code device kiic # Keywest I2C device ad7417 # PowerMac7,2 temperature sensor +device ds1631 # PowerMac11,2 temperature sensor device ds1775 # PowerMac7,2 temperature sensor device fcu # Apple Fan Control Unit device max6690 # PowerMac7,2 temperature sensor Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Sun Aug 19 19:40:33 2012 (r239401) +++ head/sys/powerpc/conf/NOTES Sun Aug 19 19:44:13 2012 (r239402) @@ -41,6 +41,7 @@ device ofwd # Open Firmware disks device adb # Apple Desktop Bus device cuda # VIA-CUDA ADB interface device ad7417 # PowerMac7,2 temperature sensor +device ds1631 # PowerMac11,2 temperature sensor device ds1775 # PowerMac7,2 temperature sensor device fcu # Apple Fan Control Unit device max6690 # PowerMac7,2 temperature sensor From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 21:31:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A3EA106566B; Sun, 19 Aug 2012 21:31:48 +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 64EA48FC16; Sun, 19 Aug 2012 21:31:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JLVmEC038805; Sun, 19 Aug 2012 21:31:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JLVmAV038803; Sun, 19 Aug 2012 21:31:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201208192131.q7JLVmAV038803@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 19 Aug 2012 21:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239407 - svnadmin/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: Sun, 19 Aug 2012 21:31:48 -0000 Author: nwhitehorn Date: Sun Aug 19 21:31:47 2012 New Revision: 239407 URL: http://svn.freebsd.org/changeset/base/239407 Log: Let jhibbits fly free. Keep up the good work! Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Aug 19 20:31:33 2012 (r239406) +++ svnadmin/conf/mentors Sun Aug 19 21:31:47 2012 (r239407) @@ -19,7 +19,6 @@ davidcs gnn eadler cperciva eri mlaier Co-mentor: thompsa jceel wkoszek Co-mentor: cognet -jhibbits nwhitehorn jinmei gnn jlh kib jonathan rwatson From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 05:47:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 68654106564A; Mon, 20 Aug 2012 05:47:08 +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 52CF28FC14; Mon, 20 Aug 2012 05:47:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7K5l8bM090327; Mon, 20 Aug 2012 05:47:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7K5l8K4090325; Mon, 20 Aug 2012 05:47:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208200547.q7K5l8K4090325@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 05:47: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: r239408 - 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: Mon, 20 Aug 2012 05:47:08 -0000 Author: adrian Date: Mon Aug 20 05:47:07 2012 New Revision: 239408 URL: http://svn.freebsd.org/changeset/base/239408 Log: Make sure all of the buffers are printed, rather than (n-1). Modified: head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Sun Aug 19 21:31:47 2012 (r239407) +++ head/sys/dev/ath/if_ath_debug.c Mon Aug 20 05:47:07 2012 (r239408) @@ -147,11 +147,9 @@ ath_printtxbuf_edma(struct ath_softc *sc * Assume the TX map size is 4 for now and only walk * the appropriate number of segments. */ - n = bf->bf_nseg / 4; - if (n == 0) - n = 1; + n = (bf->bf_nseg / 4) + 1; - printf("Q%u[%3u]", qnum, ix); + printf("Q%u[%3u] (nseg=%d)", qnum, ix, bf->bf_nseg); while (bf != NULL) { /* * XXX For now, assume the txmap size is 4. From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 06:02:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E1F2106566C; Mon, 20 Aug 2012 06:02: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 109568FC0C; Mon, 20 Aug 2012 06:02:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7K629up091879; Mon, 20 Aug 2012 06:02:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7K62942091877; Mon, 20 Aug 2012 06:02:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208200602.q7K62942091877@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 06:02: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: r239409 - 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: Mon, 20 Aug 2012 06:02:10 -0000 Author: adrian Date: Mon Aug 20 06:02:09 2012 New Revision: 239409 URL: http://svn.freebsd.org/changeset/base/239409 Log: Advance the descriptor pointer by sc->sc_tx_desclen bytes, rather than sizeof(struct ath_desc). This isn't correct for EDMA TX descriptors. This popped up during iperf tests. Ping tests never created frames that had enough segments to overflow into a second descriptor. However, an iperf TCP test would do that after a few seconds; the second descriptor would almost always certainly have garbage. Tested: * AR9380, STA mode * AR9280, STA mode (802.11n TX, legacy TX) Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Aug 20 05:47:07 2012 (r239408) +++ head/sys/dev/ath/if_ath_tx.c Mon Aug 20 06:02:09 2012 (r239409) @@ -301,12 +301,13 @@ static void ath_tx_chaindesclist(struct ath_softc *sc, struct ath_buf *bf) { struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds, *ds0; + char *ds, *ds0; int i, bp, dsp; HAL_DMA_ADDR bufAddrList[4]; uint32_t segLenList[4]; int numTxMaps = 1; int isFirstDesc = 1; + int qnum = 0; /* XXX update */ /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -332,7 +333,7 @@ ath_tx_chaindesclist(struct ath_softc *s * For EDMA and later chips ensure the TX map is fully populated * before advancing to the next descriptor. */ - ds0 = ds = bf->bf_desc; + ds0 = ds = (char *) bf->bf_desc; bp = dsp = 0; bzero(bufAddrList, sizeof(bufAddrList)); bzero(segLenList, sizeof(segLenList)); @@ -354,9 +355,9 @@ ath_tx_chaindesclist(struct ath_softc *s bp = 0; if (i == bf->bf_nseg - 1) - ath_hal_settxdesclink(ah, ds, 0); + ath_hal_settxdesclink(ah, (struct ath_desc *) ds, 0); else - ath_hal_settxdesclink(ah, ds, + ath_hal_settxdesclink(ah, (struct ath_desc *) ds, bf->bf_daddr + dd->dd_descsize * (dsp + 1)); /* @@ -365,26 +366,24 @@ ath_tx_chaindesclist(struct ath_softc *s * it may actually be pointing to the multicast software * TXQ id. These must be fixed! */ - ath_hal_filltxdesc(ah, ds + ath_hal_filltxdesc(ah, (struct ath_desc *) ds , bufAddrList , segLenList , bf->bf_descid /* XXX desc id */ , bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */ , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ - , ds0 /* first descriptor */ + , (struct ath_desc *) ds0 /* first descriptor */ ); isFirstDesc = 0; - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: %d: %08x %08x %08x %08x %08x %08x\n", - __func__, i, ds->ds_link, ds->ds_data, - ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); - bf->bf_lastds = ds; + if (sc->sc_debug & ATH_DEBUG_XMIT) + ath_printtxbuf(sc, bf, qnum, 0, 0); + bf->bf_lastds = (struct ath_desc *) ds; /* * Don't forget to skip to the next descriptor. */ - ds++; + ds += sc->sc_tx_desclen; dsp++; /* From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 06:11:04 2012 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 D5F0D1065673; Mon, 20 Aug 2012 06:11:04 +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 A13118FC12; Mon, 20 Aug 2012 06:11:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7K6B4m4092846; Mon, 20 Aug 2012 06:11:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7K6B4jC092844; Mon, 20 Aug 2012 06:11:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208200611.q7K6B4jC092844@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 06:11: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: r239410 - 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: Mon, 20 Aug 2012 06:11:05 -0000 Author: adrian Date: Mon Aug 20 06:11:04 2012 New Revision: 239410 URL: http://svn.freebsd.org/changeset/base/239410 Log: Flesh out some initial EDMA TX FIFO fill, complete and refill routines. Note: This is totally sub-optimal and a work in progress. * Support filling an empty FIFO TXQ with frames from the ath_buf queue in the ath_txq list. However, since there's (currently) no clean, easy way to separate the frames that are in the FIFO versus just waiting, the code waits for the FIFO to be totally empty before it attempts to queue more. This is highly sub-optimal but is enough to get the ball rolling. * A _lot_ of the code assumes that the TX status is filled out in the struct ath_buf bf_status field. So for now, memcpy() the completion over. * None of the TX drain / reset routines will attempt to complete completed frames before draining, so it can't be used for 802.11n TX aggregation. (This won't work anyway, as the aggregation TX descriptor API hasn't yet been converted; and that'll happen in some future commits.) * Fix an issue where the FIFO counter wasn't being incremented, leading to the queue logic just plain not working. * HAL_EIO means "descriptor wasn't valid", versus "not finished, don't continue." So don't stop processing descriptors when HAL_EIO is hit. * Don't service frame completion from the beacon queue. It isn't currently fully setup like a real queue and the first attempt at accessing the queue lock will panic the kernel. Tested: * AR9380, STA mode This commit is brought to you by said AR9380 in STA mode. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Mon Aug 20 06:02:09 2012 (r239409) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon Aug 20 06:11:04 2012 (r239410) @@ -130,6 +130,24 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_ATHDEV); +static void +ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) +{ + struct ath_buf *bf; + + ATH_TXQ_LOCK_ASSERT(txq); + + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called\n", __func__); + + TAILQ_FOREACH(bf, &txq->axq_q, bf_list) { + if (txq->axq_fifo_depth >= HAL_TXFIFO_DEPTH) + break; + ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); + txq->axq_fifo_depth++; + } + ath_hal_txstart(sc->sc_ah, txq->axq_qnum); +} + /* * Re-initialise the DMA FIFO with the current contents of * said TXQ. @@ -149,6 +167,10 @@ ath_edma_dma_restart(struct ath_softc *s __func__, txq, txq->axq_qnum); + + ATH_TXQ_LOCK_ASSERT(txq); + ath_edma_tx_fifo_fill(sc, txq); + } /* @@ -186,9 +208,15 @@ ath_edma_xmit_handoff_hw(struct ath_soft /* Push and update frame stats */ ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) + ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); +#endif /* ATH_DEBUG */ + /* Only schedule to the FIFO if there's space */ if (txq->axq_fifo_depth < HAL_TXFIFO_DEPTH) { ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); + txq->axq_fifo_depth++; ath_hal_txstart(ah, txq->axq_qnum); } } @@ -259,7 +287,8 @@ ath_edma_xmit_handoff(struct ath_softc * ATH_TXQ_LOCK_ASSERT(txq); - device_printf(sc->sc_dev, "%s: called; bf=%p, txq=%p, qnum=%d\n", + DPRINTF(sc, ATH_DEBUG_XMIT_DESC, + "%s: called; bf=%p, txq=%p, qnum=%d\n", __func__, bf, txq, @@ -355,8 +384,34 @@ ath_edma_dma_txteardown(struct ath_softc static void ath_edma_tx_drain(struct ath_softc *sc, ATH_RESET_TYPE reset_type) { + struct ifnet *ifp = sc->sc_ifp; + int i; device_printf(sc->sc_dev, "%s: called\n", __func__); + + (void) ath_stoptxdma(sc); + + /* + * If reset type is noloss, the TX FIFO needs to be serviced + * and those frames need to be handled. + * + * Otherwise, just toss everything in each TX queue. + */ + + /* XXX dump out the TX completion FIFO contents */ + + /* XXX dump out the frames */ + + /* XXX for now, just drain */ + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) + ath_tx_draintxq(sc, &sc->sc_txq[i]); + } + + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + sc->sc_wd_timer = 0; } /* @@ -370,19 +425,36 @@ ath_edma_tx_proc(void *arg, int npending HAL_STATUS status; struct ath_tx_status ts; struct ath_txq *txq; + struct ath_buf *bf; + struct ieee80211_node *ni; + int nacked; - device_printf(sc->sc_dev, "%s: called, npending=%d\n", + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", __func__, npending); for (;;) { + bzero(&ts, sizeof(ts)); + ATH_TXSTATUS_LOCK(sc); status = ath_hal_txprocdesc(ah, NULL, (void *) &ts); ATH_TXSTATUS_UNLOCK(sc); - if (status != HAL_OK) + if (status == HAL_EINPROGRESS) break; /* + * If there is an error with this descriptor, continue + * processing. + * + * XXX TBD: log some statistics? + */ + if (status == HAL_EIO) { + device_printf(sc->sc_dev, "%s: invalid TX status?\n", + __func__); + continue; + } + + /* * At this point we have a valid status descriptor. * The QID and descriptor ID (which currently isn't set) * is part of the status. @@ -391,12 +463,129 @@ ath_edma_tx_proc(void *arg, int npending * -head- of the given QID. Eventually we should verify * this by using the descriptor ID. */ - device_printf(sc->sc_dev, "%s: qcuid=%d\n", - __func__, - ts.ts_queue_id); + + /* + * The beacon queue is not currently a "real" queue. + * Frames aren't pushed onto it and the lock isn't setup. + * So skip it for now; the beacon handling code will + * free and alloc more beacon buffers as appropriate. + */ + if (ts.ts_queue_id == sc->sc_bhalq) + continue; txq = &sc->sc_txq[ts.ts_queue_id]; + + ATH_TXQ_LOCK(txq); + bf = TAILQ_FIRST(&txq->axq_q); + + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: qcuid=%d, bf=%p\n", + __func__, + ts.ts_queue_id, bf); + +#if 0 + /* XXX assert the buffer/descriptor matches the status descid */ + if (ts.ts_desc_id != bf->bf_descid) { + device_printf(sc->sc_dev, + "%s: mismatched descid (qid=%d, tsdescid=%d, " + "bfdescid=%d\n", + __func__, + ts.ts_queue_id, + ts.ts_desc_id, + bf->bf_descid); + } +#endif + + /* This removes the buffer and decrements the queue depth */ + ATH_TXQ_REMOVE(txq, bf, bf_list); + if (bf->bf_state.bfs_aggr) + txq->axq_aggr_depth--; + txq->axq_fifo_depth --; + /* XXX assert FIFO depth >= 0 */ + ATH_TXQ_UNLOCK(txq); + + /* + * First we need to make sure ts_rate is valid. + * + * Pre-EDMA chips pass the whole TX descriptor to + * the proctxdesc function which will then fill out + * ts_rate based on the ts_finaltsi (final TX index) + * in the TX descriptor. However the TX completion + * FIFO doesn't have this information. So here we + * do a separate HAL call to populate that information. + */ + + /* XXX TODO */ + /* XXX faked for now. Ew. */ + if (ts.ts_finaltsi < 4) { + ts.ts_rate = + bf->bf_state.bfs_rc[ts.ts_finaltsi].ratecode; + } else { + device_printf(sc->sc_dev, "%s: finaltsi=%d\n", + __func__, + ts.ts_finaltsi); + ts.ts_rate = bf->bf_state.bfs_rc[0].ratecode; + } + + /* + * XXX This is terrible. + * + * Right now, some code uses the TX status that is + * passed in here, but the completion handlers in the + * software TX path also use bf_status.ds_txstat. + * Ew. That should all go away. + * + * XXX It's also possible the rate control completion + * routine is called twice. + */ + memcpy(&bf->bf_status, &ts, sizeof(ts)); + + ni = bf->bf_node; + + /* Update RSSI */ + /* XXX duplicate from ath_tx_processq */ + if (ni != NULL && ts.ts_status == 0 && + ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0)) { + nacked++; + sc->sc_stats.ast_tx_rssi = ts.ts_rssi; + ATH_RSSI_LPF(sc->sc_halstats.ns_avgtxrssi, + ts.ts_rssi); + } + + /* Handle frame completion and rate control update */ + ath_tx_process_buf_completion(sc, txq, &ts, bf); + + /* bf is invalid at this point */ + + /* + * Now that there's space in the FIFO, let's push some + * more frames into it. + * + * Unfortunately for now, the txq has FIFO and non-FIFO + * frames in the same linked list, so there's no way + * to quickly/easily populate frames without walking + * the queue and skipping 'axq_fifo_depth' frames. + * + * So for now, let's only repopulate the FIFO once it + * is empty. It's sucky for performance but it's enough + * to begin validating that things are somewhat + * working. + */ + ATH_TXQ_LOCK(txq); + if (txq->axq_fifo_depth == 0) { + ath_edma_tx_fifo_fill(sc, txq); + } + ATH_TXQ_UNLOCK(txq); } + + sc->sc_wd_timer = 0; + + /* Kick software scheduler */ + /* + * XXX It's inefficient to do this if the FIFO queue is full, + * but there's no easy way right now to only populate + * the txq task for _one_ TXQ. This should be fixed. + */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_txqtask); } static void From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 11:29:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 781C5106564A; Mon, 20 Aug 2012 11:29:25 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63E5A8FC1C; Mon, 20 Aug 2012 11:29:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KBTPi3027408; Mon, 20 Aug 2012 11:29:25 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KBTPnW027406; Mon, 20 Aug 2012 11:29:25 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201208201129.q7KBTPnW027406@svn.freebsd.org> From: Ken Smith Date: Mon, 20 Aug 2012 11:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239411 - svnadmin/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: Mon, 20 Aug 2012 11:29:25 -0000 Author: kensmith Date: Mon Aug 20 11:29:24 2012 New Revision: 239411 URL: http://svn.freebsd.org/changeset/base/239411 Log: Release the code freeze on stable/9, releng/9.1 was created as part of the 9.1-RC1 builds. Approved by: core (implicit) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Mon Aug 20 06:11:04 2012 (r239410) +++ svnadmin/conf/approvers Mon Aug 20 11:29:24 2012 (r239411) @@ -17,7 +17,7 @@ # $FreeBSD$ # #^head/ re -^stable/9/ re +#^stable/9/ re #^stable/8/ re #^stable/7/ re ^releng/9.1/ (re) From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 11:34:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2AEC106566C; Mon, 20 Aug 2012 11:34:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD8978FC08; Mon, 20 Aug 2012 11:34:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KBYnKu028031; Mon, 20 Aug 2012 11:34:49 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KBYnxq028028; Mon, 20 Aug 2012 11:34:49 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201208201134.q7KBYnxq028028@svn.freebsd.org> From: Colin Percival Date: Mon, 20 Aug 2012 11:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239412 - in stable/9/sys: amd64/conf i386/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: Mon, 20 Aug 2012 11:34:49 -0000 Author: cperciva Date: Mon Aug 20 11:34:49 2012 New Revision: 239412 URL: http://svn.freebsd.org/changeset/base/239412 Log: MFC r239228: Build modules along with the XENHVM kernels. Modified: stable/9/sys/amd64/conf/XENHVM stable/9/sys/i386/conf/XENHVM Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/conf/XENHVM ============================================================================== --- stable/9/sys/amd64/conf/XENHVM Mon Aug 20 11:29:24 2012 (r239411) +++ stable/9/sys/amd64/conf/XENHVM Mon Aug 20 11:34:49 2012 (r239412) @@ -6,8 +6,6 @@ include GENERIC ident XENHVM -makeoptions MODULES_OVERRIDE="" - # # Adaptive locks rely on a lock-free pointer read to determine the run state # of the thread holding a lock when under contention; under a virtualisation Modified: stable/9/sys/i386/conf/XENHVM ============================================================================== --- stable/9/sys/i386/conf/XENHVM Mon Aug 20 11:29:24 2012 (r239411) +++ stable/9/sys/i386/conf/XENHVM Mon Aug 20 11:34:49 2012 (r239412) @@ -6,8 +6,6 @@ include GENERIC ident XENHVM -makeoptions MODULES_OVERRIDE="" - # # Adaptive locks rely on a lock-free pointer read to determine the run state # of the thread holding a lock when under contention; under a virtualisation From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 11:51:49 2012 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 D44BE106564A; Mon, 20 Aug 2012 11:51:49 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B42A18FC08; Mon, 20 Aug 2012 11:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KBpncL029814; Mon, 20 Aug 2012 11:51:49 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KBpnlg029812; Mon, 20 Aug 2012 11:51:49 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201208201151.q7KBpnlg029812@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 20 Aug 2012 11:51: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: r239413 - head/sys/mips/nlm 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, 20 Aug 2012 11:51:50 -0000 Author: jchandra Date: Mon Aug 20 11:51:49 2012 New Revision: 239413 URL: http://svn.freebsd.org/changeset/base/239413 Log: Define and exclude DRAM regions used by hardware/bootloder on XLP Fix xlp_mem_init() - remove the ad-hoc code for excluding memory regions and use an array of regions. Modified: head/sys/mips/nlm/xlp_machdep.c Modified: head/sys/mips/nlm/xlp_machdep.c ============================================================================== --- head/sys/mips/nlm/xlp_machdep.c Mon Aug 20 11:34:49 2012 (r239412) +++ head/sys/mips/nlm/xlp_machdep.c Mon Aug 20 11:51:49 2012 (r239413) @@ -419,83 +419,91 @@ xlp_pic_init(void) #else #define XLP_MEM_LIM 0xfffff000UL #endif +static vm_paddr_t xlp_mem_excl[] = { + 0, 0, /* entry for kernel image, set by xlp_mem_init*/ + 0x0c000000, 0x0d000000, /* uboot mess */ + 0x10000000, 0x14000000, /* cms queue and other stuff */ + 0x1fc00000, 0x1fd00000, /* reset vec */ + 0x1e000000, 0x1e200000, /* poe buffers */ +}; + +static int +mem_exclude_add(vm_paddr_t *avail, vm_paddr_t mstart, vm_paddr_t mend) +{ + int nreg = sizeof(xlp_mem_excl)/sizeof(xlp_mem_excl[0]); + int i, pos; + + pos = 0; + for (i = 0; i < nreg; i += 2) { + if (mstart > xlp_mem_excl[i + 1]) + continue; + if (mstart < xlp_mem_excl[i]) { + avail[pos++] = mstart; + if (mend < xlp_mem_excl[i]) + avail[pos++] = mend; + else + avail[pos++] = xlp_mem_excl[i]; + } + mstart = xlp_mem_excl[i + 1]; + if (mend <= mstart) + break; + } + if (mstart < mend) { + avail[pos++] = mstart; + avail[pos++] = mend; + } + return (pos); +} + static void xlp_mem_init(void) { - uint64_t bridgebase = nlm_get_bridge_regbase(0); /* TOOD: Add other nodes */ - vm_size_t physsz = 0; - uint64_t base, lim, val; - int i, j; - + vm_paddr_t physsz, tmp; + uint64_t bridgebase, base, lim, val; + int i, j, k, n; + + /* update kernel image area in exclude regions */ + tmp = (vm_paddr_t)MIPS_KSEG0_TO_PHYS(&_end); + tmp = round_page(tmp) + 0x20000; /* round up */ + xlp_mem_excl[1] = tmp; + + printf("Memory (from DRAM BARs):\n"); + bridgebase = nlm_get_bridge_regbase(0); /* TODO: Add other nodes */ + physsz = 0; for (i = 0, j = 0; i < 8; i++) { val = nlm_read_bridge_reg(bridgebase, BRIDGE_DRAM_BAR(i)); - base = ((val >> 12) & 0xfffff) << 20; + val = (val >> 12) & 0xfffff; + base = val << 20; val = nlm_read_bridge_reg(bridgebase, BRIDGE_DRAM_LIMIT(i)); - lim = ((val >> 12) & 0xfffff) << 20; - - /* BAR not enabled */ - if (lim == 0) + val = (val >> 12) & 0xfffff; + if (val == 0) /* BAR not enabled */ continue; + lim = (val + 1) << 20; + printf(" BAR %d: %#jx - %#jx : ", i, (intmax_t)base, + (intmax_t)lim); - /* first bar, start a bit after end */ - if (base == 0) { - base = (vm_paddr_t)MIPS_KSEG0_TO_PHYS(&_end); - base = round_page(base) + 0x20000; /* round up */ - /* TODO : hack to avoid uboot packet mem, network - * interface will write here if not reset correctly - * by u-boot */ - lim = 0x0c000000; - } - if (base >= XLP_MEM_LIM) { - printf("Mem [%d]: Ignore %#jx - %#jx\n", i, - (intmax_t)base, (intmax_t)lim); - continue; - } - if (lim > XLP_MEM_LIM) { - printf("Mem [%d]: Restrict %#jx -> %#jx\n", i, - (intmax_t)lim, (intmax_t)XLP_MEM_LIM); - lim = XLP_MEM_LIM; - } if (lim <= base) { - printf("Mem[%d]: Malformed %#jx -> %#jx\n", i, + printf("\tskipped - malformed %#jx -> %#jx\n", (intmax_t)base, (intmax_t)lim); continue; + } else if (base >= XLP_MEM_LIM) { + printf(" skipped - outside usable limit %#jx.\n", + (intmax_t)XLP_MEM_LIM); + continue; + } else if (lim >= XLP_MEM_LIM) { + lim = XLP_MEM_LIM; + printf(" truncated to %#jx.\n", (intmax_t)XLP_MEM_LIM); + } else + printf(" usable\n"); + + /* exclude unusable regions from BAR and add rest */ + n = mem_exclude_add(&phys_avail[j], base, lim); + for (k = j; k < j + n; k += 2) { + physsz += phys_avail[k + 1] - phys_avail[k]; + printf("\tMem[%d]: %#jx - %#jx\n", k/2, + (intmax_t)phys_avail[k], (intmax_t)phys_avail[k+1]); } - - /* - * Exclude reset entry memory range 0x1fc00000 - 0x20000000 - * from free memory - */ - if (base < 0x20000000 && lim > 0x1fc00000) { - uint64_t base0, lim0, base1, lim1; - - base0 = base; - lim0 = 0x1fc00000; - base1 = 0x20000000; - lim1 = lim; - - if (lim0 > base0) { - phys_avail[j++] = (vm_paddr_t)base0; - phys_avail[j++] = (vm_paddr_t)lim0; - physsz += lim0 - base0; - printf("Mem[%d]: %#jx - %#jx (excl reset)\n", i, - (intmax_t)base0, (intmax_t)lim0); - } - if (lim1 > base1) { - phys_avail[j++] = (vm_paddr_t)base1; - phys_avail[j++] = (vm_paddr_t)lim1; - physsz += lim1 - base1; - printf("Mem[%d]: %#jx - %#jx (excl reset)\n", i, - (intmax_t)base1, (intmax_t)lim1); - } - } else { - phys_avail[j++] = (vm_paddr_t)base; - phys_avail[j++] = (vm_paddr_t)lim; - physsz += lim - base; - printf("Mem[%d]: %#jx - %#jx\n", i, - (intmax_t)base, (intmax_t)lim); - } - + j = k; } /* setup final entry with 0 */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 12:07:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66ACE106564A; Mon, 20 Aug 2012 12:07:11 +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 5144A8FC12; Mon, 20 Aug 2012 12:07:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KC7B2k031528; Mon, 20 Aug 2012 12:07:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KC7Bnp031526; Mon, 20 Aug 2012 12:07:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208201207.q7KC7Bnp031526@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Aug 2012 12:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239414 - stable/9/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: Mon, 20 Aug 2012 12:07:11 -0000 Author: kib Date: Mon Aug 20 12:07:10 2012 New Revision: 239414 URL: http://svn.freebsd.org/changeset/base/239414 Log: MFC r232197 (on behalf of phk): Also call the low-level driver if ->c_iflag & (IXON|IXOFF|IXANY) changes. Uftdi(4) examines (c_iflag & (IXON|IXOFF)) to control hw XON-XOFF support. This is obviously no good, if changes to those bits are not communicated down the stack. Modified: stable/9/sys/kern/tty.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/tty.c ============================================================================== --- stable/9/sys/kern/tty.c Mon Aug 20 11:51:49 2012 (r239413) +++ stable/9/sys/kern/tty.c Mon Aug 20 12:07:10 2012 (r239414) @@ -1498,6 +1498,8 @@ tty_generic_ioctl(struct tty *tp, u_long */ if ((t->c_cflag & CIGNORE) == 0 && (tp->t_termios.c_cflag != t->c_cflag || + ((tp->t_termios.c_iflag ^ t->c_iflag) & + (IXON|IXOFF|IXANY)) || tp->t_termios.c_ispeed != t->c_ispeed || tp->t_termios.c_ospeed != t->c_ospeed)) { error = ttydevsw_param(tp, t); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 12:09:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8C362106564A; Mon, 20 Aug 2012 12:09:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76F788FC14; Mon, 20 Aug 2012 12:09:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KC92hb031821; Mon, 20 Aug 2012 12:09:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KC92Zl031819; Mon, 20 Aug 2012 12:09:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208201209.q7KC92Zl031819@svn.freebsd.org> From: Alexander Motin Date: Mon, 20 Aug 2012 12:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239415 - stable/9/sys/dev/mps 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, 20 Aug 2012 12:09:02 -0000 Author: mav Date: Mon Aug 20 12:09:02 2012 New Revision: 239415 URL: http://svn.freebsd.org/changeset/base/239415 Log: MFC r238969: Fix kernel panic on `camcontrol reset` for specific target, caused by uninitialized cm_targ in mpssas_action_resetdev(). Modified: stable/9/sys/dev/mps/mps_sas.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mps/mps_sas.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas.c Mon Aug 20 12:07:10 2012 (r239414) +++ stable/9/sys/dev/mps/mps_sas.c Mon Aug 20 12:09:02 2012 (r239415) @@ -3003,6 +3003,7 @@ mpssas_action_resetdev(struct mpssas_sof tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete = mpssas_resetdev_complete; tm->cm_complete_data = ccb; + tm->cm_targ = targ; mps_map_command(sc, tm); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 12:11:09 2012 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 ABA781065674; Mon, 20 Aug 2012 12:11:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 951DB8FC18; Mon, 20 Aug 2012 12:11:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KCB9sa032133; Mon, 20 Aug 2012 12:11:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KCB945032131; Mon, 20 Aug 2012 12:11:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208201211.q7KCB945032131@svn.freebsd.org> From: Alexander Motin Date: Mon, 20 Aug 2012 12:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239416 - stable/8/sys/dev/mps X-BeenThere: svn-src-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, 20 Aug 2012 12:11:10 -0000 Author: mav Date: Mon Aug 20 12:11:09 2012 New Revision: 239416 URL: http://svn.freebsd.org/changeset/base/239416 Log: MFC r238969: Fix kernel panic on `camcontrol reset` for specific target, caused by uninitialized cm_targ in mpssas_action_resetdev(). Modified: stable/8/sys/dev/mps/mps_sas.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/mps/mps_sas.c ============================================================================== --- stable/8/sys/dev/mps/mps_sas.c Mon Aug 20 12:09:02 2012 (r239415) +++ stable/8/sys/dev/mps/mps_sas.c Mon Aug 20 12:11:09 2012 (r239416) @@ -3003,6 +3003,7 @@ mpssas_action_resetdev(struct mpssas_sof tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete = mpssas_resetdev_complete; tm->cm_complete_data = ccb; + tm->cm_targ = targ; mps_map_command(sc, tm); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 12:17:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74C791065670; Mon, 20 Aug 2012 12:17:44 +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 606D18FC16; Mon, 20 Aug 2012 12:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KCHiGL032806; Mon, 20 Aug 2012 12:17:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KCHi9Y032803; Mon, 20 Aug 2012 12:17:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208201217.q7KCHi9Y032803@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Aug 2012 12:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239417 - svnadmin/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: Mon, 20 Aug 2012 12:17:44 -0000 Author: kib Date: Mon Aug 20 12:17:42 2012 New Revision: 239417 URL: http://svn.freebsd.org/changeset/base/239417 Log: Welcome Andrey Zonov to the rank of src committers. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon Aug 20 12:11:09 2012 (r239416) +++ svnadmin/conf/access Mon Aug 20 12:17:42 2012 (r239417) @@ -265,3 +265,4 @@ yongari zack zec zml +zont Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Aug 20 12:11:09 2012 (r239416) +++ svnadmin/conf/mentors Mon Aug 20 12:17:42 2012 (r239417) @@ -34,3 +34,4 @@ snb dwmalone sson gnn versus gavin Co-mentor: fjoe will ken +zont kib From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 12:31:35 2012 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 CBFCF1065670; Mon, 20 Aug 2012 12:31:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9F34F8FC12; Mon, 20 Aug 2012 12:31:35 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BA7E7B941; Mon, 20 Aug 2012 08:31:34 -0400 (EDT) From: John Baldwin To: Randall Stewart Date: Mon, 20 Aug 2012 07:43:55 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208170551.q7H5pkd1025308@svn.freebsd.org> <201208170826.25123.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Message-Id: <201208200743.55498.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 20 Aug 2012 08:31:34 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239353 - 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: Mon, 20 Aug 2012 12:31:35 -0000 On Saturday, August 18, 2012 5:31:24 am Randall Stewart wrote: > Note that in the main FreeBSD sources however, the fact that ip_input.c d= oes *not* lock > when it looks at the hash table these lines are removing from here means = there is still a potential > for a crash. I have a fix for this that does not require the lock, when I= get a moment > I will send it your way=85 you have seen part of it ;-) Heh, that is probably true, I just think that moving the ifa_free() around here doesn't help to solve those crashes. You are just as vulnerable no matter where they are performed. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 12:53:30 2012 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 65831106564A; Mon, 20 Aug 2012 12:53:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5103C8FC08; Mon, 20 Aug 2012 12:53:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KCrUbJ036466; Mon, 20 Aug 2012 12:53:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KCrU1V036464; Mon, 20 Aug 2012 12:53:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208201253.q7KCrU1V036464@svn.freebsd.org> From: Alexander Motin Date: Mon, 20 Aug 2012 12:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239418 - releng/9.1/sys/dev/mps 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, 20 Aug 2012 12:53:30 -0000 Author: mav Date: Mon Aug 20 12:53:29 2012 New Revision: 239418 URL: http://svn.freebsd.org/changeset/base/239418 Log: MFC r238969: Fix kernel panic on `camcontrol reset` for specific target, caused by uninitialized cm_targ in mpssas_action_resetdev(). Approved by: re (kib) Modified: releng/9.1/sys/dev/mps/mps_sas.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/mps/mps_sas.c ============================================================================== --- releng/9.1/sys/dev/mps/mps_sas.c Mon Aug 20 12:17:42 2012 (r239417) +++ releng/9.1/sys/dev/mps/mps_sas.c Mon Aug 20 12:53:29 2012 (r239418) @@ -3003,6 +3003,7 @@ mpssas_action_resetdev(struct mpssas_sof tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete = mpssas_resetdev_complete; tm->cm_complete_data = ccb; + tm->cm_targ = targ; mps_map_command(sc, tm); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 13:06:52 2012 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 6218B106566C; Mon, 20 Aug 2012 13:06:52 +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 32AE38FC14; Mon, 20 Aug 2012 13:06:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KD6qoH037914; Mon, 20 Aug 2012 13:06:52 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KD6pml037912; Mon, 20 Aug 2012 13:06:51 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201208201306.q7KD6pml037912@svn.freebsd.org> From: Glen Barber Date: Mon, 20 Aug 2012 13:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239419 - stable/9/cddl/contrib/opensolaris/cmd/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, 20 Aug 2012 13:06:52 -0000 Author: gjb (doc,ports committer) Date: Mon Aug 20 13:06:51 2012 New Revision: 239419 URL: http://svn.freebsd.org/changeset/base/239419 Log: MFC r239216, r239217: r239216: - Remove a leading space that breaks rendering r239217: - Fix source dataset snapshot name in Example 15. - Bump date. Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Aug 20 12:53:29 2012 (r239418) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Aug 20 13:06:51 2012 (r239419) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd August 12, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -2241,7 +2241,7 @@ properties, and current snapshot and fil is received. If the .Fl F flag is specified when this stream is received, snapshots and file systems that - do not exist on the sending side are destroyed. +do not exist on the sending side are destroyed. .It Fl D Generate a deduplicated stream. Blocks which would have been sent multiple times in the send stream will only be sent once. The receiving system must @@ -3021,9 +3021,9 @@ a new snapshot, as follows: .Li # Ic zfs destroy -r pool/users@7daysago .Li # Ic zfs rename -r pool/users@6daysago @7daysago .Li # Ic zfs rename -r pool/users@5daysago @6daysago -.Li # Ic zfs rename -r pool/users@yesterday @5daysago -.Li # Ic zfs rename -r pool/users@yesterday @4daysago -.Li # Ic zfs rename -r pool/users@yesterday @3daysago +.Li # Ic zfs rename -r pool/users@4daysago @5daysago +.Li # Ic zfs rename -r pool/users@3daysago @4daysago +.Li # Ic zfs rename -r pool/users@2daysago @3daysago .Li # Ic zfs rename -r pool/users@yesterday @2daysago .Li # Ic zfs rename -r pool/users@today @yesterday .Li # Ic zfs snapshot -r pool/users@today From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 13:07:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55A591065676; Mon, 20 Aug 2012 13:07:23 +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 26FA98FC17; Mon, 20 Aug 2012 13:07:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KD7N7M037997; Mon, 20 Aug 2012 13:07:23 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KD7Mdg037995; Mon, 20 Aug 2012 13:07:22 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201208201307.q7KD7Mdg037995@svn.freebsd.org> From: Glen Barber Date: Mon, 20 Aug 2012 13:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239420 - releng/9.1/cddl/contrib/opensolaris/cmd/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, 20 Aug 2012 13:07:23 -0000 Author: gjb (doc,ports committer) Date: Mon Aug 20 13:07:22 2012 New Revision: 239420 URL: http://svn.freebsd.org/changeset/base/239420 Log: MFC r239216, r239217: r239216: - Remove a leading space that breaks rendering r239217: - Fix source dataset snapshot name in Example 15. - Bump date. Approved by: re (kib) Modified: releng/9.1/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Directory Properties: releng/9.1/cddl/contrib/opensolaris/ (props changed) Modified: releng/9.1/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- releng/9.1/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Aug 20 13:06:51 2012 (r239419) +++ releng/9.1/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Aug 20 13:07:22 2012 (r239420) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd August 12, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -2241,7 +2241,7 @@ properties, and current snapshot and fil is received. If the .Fl F flag is specified when this stream is received, snapshots and file systems that - do not exist on the sending side are destroyed. +do not exist on the sending side are destroyed. .It Fl D Generate a deduplicated stream. Blocks which would have been sent multiple times in the send stream will only be sent once. The receiving system must @@ -3021,9 +3021,9 @@ a new snapshot, as follows: .Li # Ic zfs destroy -r pool/users@7daysago .Li # Ic zfs rename -r pool/users@6daysago @7daysago .Li # Ic zfs rename -r pool/users@5daysago @6daysago -.Li # Ic zfs rename -r pool/users@yesterday @5daysago -.Li # Ic zfs rename -r pool/users@yesterday @4daysago -.Li # Ic zfs rename -r pool/users@yesterday @3daysago +.Li # Ic zfs rename -r pool/users@4daysago @5daysago +.Li # Ic zfs rename -r pool/users@3daysago @4daysago +.Li # Ic zfs rename -r pool/users@2daysago @3daysago .Li # Ic zfs rename -r pool/users@yesterday @2daysago .Li # Ic zfs rename -r pool/users@today @yesterday .Li # Ic zfs snapshot -r pool/users@today From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 13:08:38 2012 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 265E3106564A; Mon, 20 Aug 2012 13:08:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E82C58FC0C; Mon, 20 Aug 2012 13:08:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KD8bgs038149; Mon, 20 Aug 2012 13:08:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KD8bl4038147; Mon, 20 Aug 2012 13:08:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201208201308.q7KD8bl4038147@svn.freebsd.org> From: Glen Barber Date: Mon, 20 Aug 2012 13:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239421 - stable/8/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-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, 20 Aug 2012 13:08:38 -0000 Author: gjb (doc,ports committer) Date: Mon Aug 20 13:08:37 2012 New Revision: 239421 URL: http://svn.freebsd.org/changeset/base/239421 Log: MFC r239216, r239217: r239216: - Remove a leading space that breaks rendering r239217: - Fix source dataset snapshot name in Example 15. - Bump date. Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Aug 20 13:07:22 2012 (r239420) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Aug 20 13:08:37 2012 (r239421) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd August 12, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -2241,7 +2241,7 @@ properties, and current snapshot and fil is received. If the .Fl F flag is specified when this stream is received, snapshots and file systems that - do not exist on the sending side are destroyed. +do not exist on the sending side are destroyed. .It Fl D Generate a deduplicated stream. Blocks which would have been sent multiple times in the send stream will only be sent once. The receiving system must @@ -3021,9 +3021,9 @@ a new snapshot, as follows: .Li # Ic zfs destroy -r pool/users@7daysago .Li # Ic zfs rename -r pool/users@6daysago @7daysago .Li # Ic zfs rename -r pool/users@5daysago @6daysago -.Li # Ic zfs rename -r pool/users@yesterday @5daysago -.Li # Ic zfs rename -r pool/users@yesterday @4daysago -.Li # Ic zfs rename -r pool/users@yesterday @3daysago +.Li # Ic zfs rename -r pool/users@4daysago @5daysago +.Li # Ic zfs rename -r pool/users@3daysago @4daysago +.Li # Ic zfs rename -r pool/users@2daysago @3daysago .Li # Ic zfs rename -r pool/users@yesterday @2daysago .Li # Ic zfs rename -r pool/users@today @yesterday .Li # Ic zfs snapshot -r pool/users@today From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 13:59:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3D701065795; Mon, 20 Aug 2012 13:59:23 +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 84BEC8FC18; Mon, 20 Aug 2012 13:59:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KDxNec043455; Mon, 20 Aug 2012 13:59:23 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KDxNoo043453; Mon, 20 Aug 2012 13:59:23 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201359.q7KDxNoo043453@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 13:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239422 - stable/9/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: Mon, 20 Aug 2012 13:59:23 -0000 Author: emaste Date: Mon Aug 20 13:59:22 2012 New Revision: 239422 URL: http://svn.freebsd.org/changeset/base/239422 Log: MFC r238183: Implement SIOCGIFMEDIA for if_tap(4) Appease certain if_tap(4) consumers by providing simulated Ethernet media status. DragonFly commit 70d9a675bf5441cc854a843ead702d08928c37f3 Obtained from: DragonFly BSD Sponsored by: ADARA Networks Modified: stable/9/sys/net/if_tap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_tap.c ============================================================================== --- stable/9/sys/net/if_tap.c Mon Aug 20 13:08:37 2012 (r239421) +++ stable/9/sys/net/if_tap.c Mon Aug 20 13:59:22 2012 (r239422) @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -602,7 +603,8 @@ tapifioctl(struct ifnet *ifp, u_long cmd struct tap_softc *tp = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; - int dummy; + struct ifmediareq *ifmr = NULL; + int dummy, error = 0; switch (cmd) { case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ @@ -610,6 +612,22 @@ tapifioctl(struct ifnet *ifp, u_long cmd case SIOCDELMULTI: break; + case SIOCGIFMEDIA: + ifmr = (struct ifmediareq *)data; + dummy = ifmr->ifm_count; + ifmr->ifm_count = 1; + ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = IFM_ETHER; + if (tp->tap_flags & TAP_OPEN) + ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_current = ifmr->ifm_active; + if (dummy >= 1) { + int media = IFM_ETHER; + error = copyout(&media, ifmr->ifm_ulist, + sizeof(int)); + } + break; + case SIOCSIFMTU: ifp->if_mtu = ifr->ifr_mtu; break; @@ -626,11 +644,11 @@ tapifioctl(struct ifnet *ifp, u_long cmd break; default: - return (ether_ioctl(ifp, cmd, data)); - /* NOT REACHED */ + error = ether_ioctl(ifp, cmd, data); + break; } - return (0); + return (error); } /* tapifioctl */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:05:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92597106566C; Mon, 20 Aug 2012 14:05:19 +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 7C7D78FC1C; Mon, 20 Aug 2012 14:05:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KE5J41044137; Mon, 20 Aug 2012 14:05:19 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KE5Jof044135; Mon, 20 Aug 2012 14:05:19 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201405.q7KE5Jof044135@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239423 - stable/9/lib/libc/string 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, 20 Aug 2012 14:05:19 -0000 Author: emaste Date: Mon Aug 20 14:05:19 2012 New Revision: 239423 URL: http://svn.freebsd.org/changeset/base/239423 Log: MFC r238183: Correct BUGS description of static buffer use Since r142667 strerror has unconditionally returned a pointer to a static buffer. Modified: stable/9/lib/libc/string/strerror.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/string/strerror.3 ============================================================================== --- stable/9/lib/libc/string/strerror.3 Mon Aug 20 13:59:22 2012 (r239422) +++ stable/9/lib/libc/string/strerror.3 Mon Aug 20 14:05:19 2012 (r239423) @@ -174,10 +174,10 @@ function was implemented in by .An Wes Peters Aq wes@FreeBSD.org . .Sh BUGS -For unknown error numbers, the +The .Fn strerror -function will return its result in a static buffer which -may be overwritten by subsequent calls. +function returns its result in a static buffer which +will be overwritten by subsequent calls. .Pp The return type for .Fn strerror From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:10:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A22E1065670; Mon, 20 Aug 2012 14:10:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6408FC1D; Mon, 20 Aug 2012 14:10:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KEA18K044660; Mon, 20 Aug 2012 14:10:01 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEA1qq044658; Mon, 20 Aug 2012 14:10:01 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201410.q7KEA1qq044658@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239424 - stable/8/lib/libc/string X-BeenThere: svn-src-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, 20 Aug 2012 14:10:01 -0000 Author: emaste Date: Mon Aug 20 14:10:00 2012 New Revision: 239424 URL: http://svn.freebsd.org/changeset/base/239424 Log: MFC r238853: Correct BUGS description of static buffer use Since r142667 strerror has unconditionally returned a pointer to a static buffer. Modified: stable/8/lib/libc/string/strerror.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/string/strerror.3 ============================================================================== --- stable/8/lib/libc/string/strerror.3 Mon Aug 20 14:05:19 2012 (r239423) +++ stable/8/lib/libc/string/strerror.3 Mon Aug 20 14:10:00 2012 (r239424) @@ -174,10 +174,10 @@ function was implemented in by .An Wes Peters Aq wes@FreeBSD.org . .Sh BUGS -For unknown error numbers, the +The .Fn strerror -function will return its result in a static buffer which -may be overwritten by subsequent calls. +function returns its result in a static buffer which +will be overwritten by subsequent calls. .Pp The return type for .Fn strerror From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:12:24 2012 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 A48F8106566B; Mon, 20 Aug 2012 14:12:24 +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 8EEAB8FC15; Mon, 20 Aug 2012 14:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KECO2r044933; Mon, 20 Aug 2012 14:12:24 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KECO5q044931; Mon, 20 Aug 2012 14:12:24 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201412.q7KECO5q044931@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239425 - stable/9/sys/dev/usb/quirk 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, 20 Aug 2012 14:12:24 -0000 Author: emaste Date: Mon Aug 20 14:12:24 2012 New Revision: 239425 URL: http://svn.freebsd.org/changeset/base/239425 Log: MFC r238718: Quirk MS keyboard so that function keys work The function keys on a Microsoft Natural Egronomic Keyboard 4000 have been repurposed as "Help", "Undo", "Redo" etc., and a special "F Lock" key is required to return them to their normal purpose. This change enables the UQ_KBD_BOOTPROTO quirk for the MS Natural 4000 keyboard to get the keys working again. More extensive changes to the USB keyboard infrastructure would be needed to fully support the "F Lock" mode and the extended keys on this keyboard. PR: usb/116947 Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Mon Aug 20 14:10:00 2012 (r239424) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Mon Aug 20 14:12:24 2012 (r239425) @@ -123,6 +123,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(METAGEEK2, WISPYDBX, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), USB_QUIRK(TENX, UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR), /* MS keyboards do weird things */ + USB_QUIRK(MICROSOFT, NATURAL4000, 0x0000, 0xFFFF, UQ_KBD_BOOTPROTO), USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:14:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8271E106566C; Mon, 20 Aug 2012 14:14:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6A08FC1A; Mon, 20 Aug 2012 14:14:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KEEK45045162; Mon, 20 Aug 2012 14:14:20 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEEKT8045160; Mon, 20 Aug 2012 14:14:20 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201414.q7KEEKT8045160@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239426 - stable/8/sys/dev/usb/quirk X-BeenThere: svn-src-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, 20 Aug 2012 14:14:20 -0000 Author: emaste Date: Mon Aug 20 14:14:19 2012 New Revision: 239426 URL: http://svn.freebsd.org/changeset/base/239426 Log: MFC r238718: Quirk MS keyboard so that function keys work The function keys on a Microsoft Natural Egronomic Keyboard 4000 have been repurposed as "Help", "Undo", "Redo" etc., and a special "F Lock" key is required to return them to their normal purpose. This change enables the UQ_KBD_BOOTPROTO quirk for the MS Natural 4000 keyboard to get the keys working again. More extensive changes to the USB keyboard infrastructure would be needed to fully support the "F Lock" mode and the extended keys on this keyboard. PR: usb/116947 Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Aug 20 14:12:24 2012 (r239425) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Aug 20 14:14:19 2012 (r239426) @@ -123,6 +123,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(METAGEEK2, WISPYDBX, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), USB_QUIRK(TENX, UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR), /* MS keyboards do weird things */ + USB_QUIRK(MICROSOFT, NATURAL4000, 0x0000, 0xFFFF, UQ_KBD_BOOTPROTO), USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:26:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50C7A1065675; Mon, 20 Aug 2012 14:26:17 +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 3AB818FC20; Mon, 20 Aug 2012 14:26:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KEQHAc046466; Mon, 20 Aug 2012 14:26:17 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEQHj8046464; Mon, 20 Aug 2012 14:26:17 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201426.q7KEQHj8046464@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239427 - stable/9/contrib/ntp/ntpd 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, 20 Aug 2012 14:26:17 -0000 Author: emaste Date: Mon Aug 20 14:26:16 2012 New Revision: 239427 URL: http://svn.freebsd.org/changeset/base/239427 Log: MFC r232844: Remove extraneous log message When ntp switched between PLL and FLL mode it produced a log message "kernel time sync status change %04x". This issue is reported in ntp bug 452[1] which claims that this behaviour is normal and the log message isn't necessary. I'm not sure exactly when it was removed, but it's gone in the latest ntp release (4.2.6p5). [1] http://bugs.ntp.org/show_bug.cgi?id=452 Modified: stable/9/contrib/ntp/ntpd/ntp_loopfilter.c Directory Properties: stable/9/contrib/ntp/ (props changed) Modified: stable/9/contrib/ntp/ntpd/ntp_loopfilter.c ============================================================================== --- stable/9/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 14:14:19 2012 (r239426) +++ stable/9/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 14:26:16 2012 (r239427) @@ -646,12 +646,6 @@ local_clock( msyslog(LOG_NOTICE, "kernel time sync error %04x", ntv.status); ntv.status &= ~(STA_PPSFREQ | STA_PPSTIME); - } else { - if ((ntv.status ^ pll_status) & ~STA_FLL) - NLOG(NLOG_SYNCEVENT | NLOG_SYSEVENT) - msyslog(LOG_NOTICE, - "kernel time sync status change %04x", - ntv.status); } pll_status = ntv.status; #ifdef STA_NANO From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:34:31 2012 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 EF9521065670; Mon, 20 Aug 2012 14:34:30 +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 DA0738FC14; Mon, 20 Aug 2012 14:34:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KEYUZU047502; Mon, 20 Aug 2012 14:34:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEYUUt047499; Mon, 20 Aug 2012 14:34:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201434.q7KEYUUt047499@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239428 - stable/9/share/examples/kld/dyn_sysctl 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, 20 Aug 2012 14:34:31 -0000 Author: emaste Date: Mon Aug 20 14:34:30 2012 New Revision: 239428 URL: http://svn.freebsd.org/changeset/base/239428 Log: MFC r239130: Minor style(9) improvement Modified: stable/9/share/examples/kld/dyn_sysctl/dyn_sysctl.c Directory Properties: stable/9/share/examples/kld/dyn_sysctl/ (props changed) Modified: stable/9/share/examples/kld/dyn_sysctl/dyn_sysctl.c ============================================================================== --- stable/9/share/examples/kld/dyn_sysctl/dyn_sysctl.c Mon Aug 20 14:26:16 2012 (r239427) +++ stable/9/share/examples/kld/dyn_sysctl/dyn_sysctl.c Mon Aug 20 14:34:30 2012 (r239428) @@ -59,7 +59,7 @@ load(module_t mod, int cmd, void *arg) error = 0; switch (cmd) { - case MOD_LOAD : + case MOD_LOAD: /* Initialize the contexts */ printf("Initializing contexts and creating subtrees.\n\n"); sysctl_ctx_init(&clist); @@ -123,7 +123,7 @@ load(module_t mod, int cmd, void *arg) OID_AUTO, "string_c", CTLFLAG_RD, c, 0, "shouldn't panic"); printf("3. (%p) /kern/dyn_sysctl bad (WRONG!)\n", &clist2); break; - case MOD_UNLOAD : + case MOD_UNLOAD: printf("1. Try to free ctx1 (%p): ", &clist); if (sysctl_ctx_free(&clist) != 0) printf("failed: expected. Need to remove ctx3 first.\n"); @@ -153,7 +153,7 @@ load(module_t mod, int cmd, void *arg) } else printf("Ok\n"); break; - default : + default: error = EOPNOTSUPP; break; } From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:37:51 2012 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 836EA1065692; Mon, 20 Aug 2012 14:37:51 +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 6E7868FC2F; Mon, 20 Aug 2012 14:37:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KEbp7x047875; Mon, 20 Aug 2012 14:37:51 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEbpSh047873; Mon, 20 Aug 2012 14:37:51 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201437.q7KEbpSh047873@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239429 - stable/9/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: Mon, 20 Aug 2012 14:37:51 -0000 Author: emaste Date: Mon Aug 20 14:37:50 2012 New Revision: 239429 URL: http://svn.freebsd.org/changeset/base/239429 Log: MFC r238844: Add version so others can depend on this module Modified: stable/9/sys/netgraph/ng_ether.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/ng_ether.c ============================================================================== --- stable/9/sys/netgraph/ng_ether.c Mon Aug 20 14:34:30 2012 (r239428) +++ stable/9/sys/netgraph/ng_ether.c Mon Aug 20 14:37:50 2012 (r239429) @@ -71,6 +71,8 @@ #include #include +MODULE_VERSION(ng_ether, 1); + #define IFP2NG(ifp) (IFP2AC((ifp))->ac_netgraph) /* Per-node private data */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:42:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B75D1106566B; Mon, 20 Aug 2012 14:42:29 +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 A15578FC14; Mon, 20 Aug 2012 14:42:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KEgT8T048393; Mon, 20 Aug 2012 14:42:29 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEgTgl048391; Mon, 20 Aug 2012 14:42:29 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201442.q7KEgTgl048391@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239430 - stable/9/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: Mon, 20 Aug 2012 14:42:29 -0000 Author: emaste Date: Mon Aug 20 14:42:29 2012 New Revision: 239430 URL: http://svn.freebsd.org/changeset/base/239430 Log: MFC r236157: Add IPPROTO_MPLS (rfc4023) IP protocol definition There are currently no in-tree consumers; I'm adding it now for use by vendor code. This matches the change OpenBSD made while implementing MPLS in gif(4). Modified: stable/9/sys/netinet/in.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in.h ============================================================================== --- stable/9/sys/netinet/in.h Mon Aug 20 14:37:50 2012 (r239429) +++ stable/9/sys/netinet/in.h Mon Aug 20 14:42:29 2012 (r239430) @@ -241,6 +241,7 @@ __END_DECLS #define IPPROTO_PIM 103 /* Protocol Independent Mcast */ #define IPPROTO_CARP 112 /* CARP */ #define IPPROTO_PGM 113 /* PGM */ +#define IPPROTO_MPLS 137 /* MPLS-in-IP */ #define IPPROTO_PFSYNC 240 /* PFSYNC */ /* 255: Reserved */ /* BSD Private, local use, namespace incursion, no longer used */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:49:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CE19106566C; Mon, 20 Aug 2012 14:49:06 +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 779B68FC12; Mon, 20 Aug 2012 14:49:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KEn6fQ049156; Mon, 20 Aug 2012 14:49:06 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEn6ZK049154; Mon, 20 Aug 2012 14:49:06 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201449.q7KEn6ZK049154@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239431 - stable/9/usr.sbin/crashinfo 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, 20 Aug 2012 14:49:06 -0000 Author: emaste Date: Mon Aug 20 14:49:06 2012 New Revision: 239431 URL: http://svn.freebsd.org/changeset/base/239431 Log: MFC r232666: Improve multi-line kernel ident parsing Instead of blindly grabbing the line with 'Version string' and the following one from the core info file, take all lines after 'Version string' until the one one that matches the field format in the core info file. This provides compatibility with VendorBSD modifications that have a different kernel ident format. Modified: stable/9/usr.sbin/crashinfo/crashinfo.sh Directory Properties: stable/9/usr.sbin/crashinfo/ (props changed) Modified: stable/9/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- stable/9/usr.sbin/crashinfo/crashinfo.sh Mon Aug 20 14:42:29 2012 (r239430) +++ stable/9/usr.sbin/crashinfo/crashinfo.sh Mon Aug 20 14:49:06 2012 (r239431) @@ -45,10 +45,11 @@ find_kernel() nextline=1 next } - // { - if (nextline) { - print + nextline==1 { + if ($0 ~ "^ [A-Za-z ]+: ") { nextline=0 + } else { + print } }' $INFO) From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:52:44 2012 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 8F45D106566B; Mon, 20 Aug 2012 14:52:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79CC68FC15; Mon, 20 Aug 2012 14:52:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KEqiTU049576; Mon, 20 Aug 2012 14:52:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEqidU049573; Mon, 20 Aug 2012 14:52:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201452.q7KEqidU049573@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239432 - stable/9/libexec/tftpd 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, 20 Aug 2012 14:52:44 -0000 Author: emaste Date: Mon Aug 20 14:52:43 2012 New Revision: 239432 URL: http://svn.freebsd.org/changeset/base/239432 Log: MFC r231973: Avoid error log for transfer stop w/o error code. A number of tftp clients, including the one in Intel's pxe boot loader, may intentionally stop a transfer using error code 0 (i.e., EUNDEF). These are not real errors. Avoid spamming log files with these by logging them at level LOG_DEBUG instead. Discussed on -hackers with an initial patch proposal; this change is an improved approach suggested by kan@. Modified: stable/9/libexec/tftpd/tftp-io.c Directory Properties: stable/9/libexec/tftpd/ (props changed) Modified: stable/9/libexec/tftpd/tftp-io.c ============================================================================== --- stable/9/libexec/tftpd/tftp-io.c Mon Aug 20 14:49:06 2012 (r239431) +++ stable/9/libexec/tftpd/tftp-io.c Mon Aug 20 14:52:43 2012 (r239432) @@ -463,7 +463,8 @@ receive_packet(int peer, char *data, int } if (pkt->th_opcode == ERROR) { - tftp_log(LOG_ERR, "Got ERROR packet: %s", pkt->th_msg); + tftp_log(pkt->th_code == EUNDEF ? LOG_DEBUG : LOG_ERR, + "Got ERROR packet: %s", pkt->th_msg); return (RP_ERROR); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:54:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3B0C106564A; Mon, 20 Aug 2012 14:54:30 +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 DE8448FC16; Mon, 20 Aug 2012 14:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KEsUn1049801; Mon, 20 Aug 2012 14:54:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KEsUng049799; Mon, 20 Aug 2012 14:54:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201454.q7KEsUng049799@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 14:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239433 - stable/9/sys/dev/hwpmc 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, 20 Aug 2012 14:54:31 -0000 Author: emaste Date: Mon Aug 20 14:54:30 2012 New Revision: 239433 URL: http://svn.freebsd.org/changeset/base/239433 Log: MFC r230636: pmc_*_initialize may return NULL if the CPU is not supported, so check that md is not null before dereferencing it. PR: kern/156540 Modified: stable/9/sys/dev/hwpmc/hwpmc_x86.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_x86.c Mon Aug 20 14:52:43 2012 (r239432) +++ stable/9/sys/dev/hwpmc/hwpmc_x86.c Mon Aug 20 14:54:30 2012 (r239433) @@ -252,7 +252,7 @@ pmc_md_initialize() return (NULL); /* disallow sampling if we do not have an LAPIC */ - if (!lapic_enable_pmc()) + if (md != NULL && !lapic_enable_pmc()) for (i = 0; i < md->pmd_nclass; i++) { if (i == PMC_CLASS_INDEX_SOFT) continue; From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 14:56:42 2012 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 BD5B11065673 for ; Mon, 20 Aug 2012 14:56:42 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta03.emeryville.ca.mail.comcast.net (qmta03.emeryville.ca.mail.comcast.net [76.96.30.32]) by mx1.freebsd.org (Postfix) with ESMTP id 925AC8FC1B for ; Mon, 20 Aug 2012 14:56:41 +0000 (UTC) Received: from omta16.emeryville.ca.mail.comcast.net ([76.96.30.72]) by qmta03.emeryville.ca.mail.comcast.net with comcast id p1Z41j0041ZMdJ4A32whZH; Mon, 20 Aug 2012 14:56:41 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta16.emeryville.ca.mail.comcast.net with comcast id p2wg1j0074NgCEG8c2wgXC; Mon, 20 Aug 2012 14:56:41 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q7KEucgL021085; Mon, 20 Aug 2012 08:56:38 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Konstantin Belousov In-Reply-To: <201208201207.q7KC7Bnp031526@svn.freebsd.org> References: <201208201207.q7KC7Bnp031526@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 20 Aug 2012 08:56:38 -0600 Message-ID: <1345474598.27688.313.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r239414 - stable/9/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: Mon, 20 Aug 2012 14:56:42 -0000 On Mon, 2012-08-20 at 12:07 +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Aug 20 12:07:10 2012 > New Revision: 239414 > URL: http://svn.freebsd.org/changeset/base/239414 > > Log: > MFC r232197 (on behalf of phk): > Also call the low-level driver if ->c_iflag & (IXON|IXOFF|IXANY) changes. > > Uftdi(4) examines (c_iflag & (IXON|IXOFF)) to control hw XON-XOFF support. > This is obviously no good, if changes to those bits are not communicated > down the stack. > > Modified: > stable/9/sys/kern/tty.c > Directory Properties: > stable/9/sys/ (props changed) > > Modified: stable/9/sys/kern/tty.c > ============================================================================== > --- stable/9/sys/kern/tty.c Mon Aug 20 11:51:49 2012 (r239413) > +++ stable/9/sys/kern/tty.c Mon Aug 20 12:07:10 2012 (r239414) > @@ -1498,6 +1498,8 @@ tty_generic_ioctl(struct tty *tp, u_long > */ > if ((t->c_cflag & CIGNORE) == 0 && > (tp->t_termios.c_cflag != t->c_cflag || > + ((tp->t_termios.c_iflag ^ t->c_iflag) & > + (IXON|IXOFF|IXANY)) || > tp->t_termios.c_ispeed != t->c_ispeed || > tp->t_termios.c_ospeed != t->c_ospeed)) { > error = ttydevsw_param(tp, t); I think this is the wrong fix for this problem. The correct fix is to get the uftdi driver and hardware out of the business of managing software flow control, because it cannot do so properly. For example, the hardware has no support for the concept of IXANY. Also, this change is insufficient for communicating changes of the VSTART and VSTOP chars to the hardware. When I was working on the uftdi driver recently I saw situations where the hardware and software (tty layer) got out of sync on the state of flow control when the driver/hardware were doing the XON/XOFF handling, locking up comms until the device was closed and reopened (and that may have un-wedged things primarily because the ftdi driver inappropriately does a reset of the hardware on open(2)). I have a large set of fixes and enhancements to the uftdi driver, I've just had too many irons in the fire recently to get them packaged up and submitted for review. I guess maybe it's time to get that done. -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 15:03:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D28BB106566B for ; Mon, 20 Aug 2012 15:03:02 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta01.emeryville.ca.mail.comcast.net (qmta01.emeryville.ca.mail.comcast.net [76.96.30.16]) by mx1.freebsd.org (Postfix) with ESMTP id B13DF8FC0C for ; Mon, 20 Aug 2012 15:03:02 +0000 (UTC) Received: from omta07.emeryville.ca.mail.comcast.net ([76.96.30.59]) by qmta01.emeryville.ca.mail.comcast.net with comcast id p0yc1j0051GXsucA1332j8; Mon, 20 Aug 2012 15:03:02 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta07.emeryville.ca.mail.comcast.net with comcast id p3311j00B4NgCEG8U331dC; Mon, 20 Aug 2012 15:03:02 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q7KF2xN1021095; Mon, 20 Aug 2012 09:02:59 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Ed Maste In-Reply-To: <201208201426.q7KEQHj8046464@svn.freebsd.org> References: <201208201426.q7KEQHj8046464@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 20 Aug 2012 09:02:59 -0600 Message-ID: <1345474979.27688.317.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r239427 - stable/9/contrib/ntp/ntpd 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, 20 Aug 2012 15:03:02 -0000 On Mon, 2012-08-20 at 14:26 +0000, Ed Maste wrote: > Author: emaste > Date: Mon Aug 20 14:26:16 2012 > New Revision: 239427 > URL: http://svn.freebsd.org/changeset/base/239427 > > Log: > MFC r232844: Remove extraneous log message > > When ntp switched between PLL and FLL mode it produced a log message > "kernel time sync status change %04x". This issue is reported in ntp > bug 452[1] which claims that this behaviour is normal and the log > message isn't necessary. I'm not sure exactly when it was removed, but > it's gone in the latest ntp release (4.2.6p5). > > [1] http://bugs.ntp.org/show_bug.cgi?id=452 > > Modified: > stable/9/contrib/ntp/ntpd/ntp_loopfilter.c > Directory Properties: > stable/9/contrib/ntp/ (props changed) > > Modified: stable/9/contrib/ntp/ntpd/ntp_loopfilter.c > ============================================================================== > --- stable/9/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 14:14:19 2012 (r239426) > +++ stable/9/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 14:26:16 2012 (r239427) > @@ -646,12 +646,6 @@ local_clock( > msyslog(LOG_NOTICE, > "kernel time sync error %04x", ntv.status); > ntv.status &= ~(STA_PPSFREQ | STA_PPSTIME); > - } else { > - if ((ntv.status ^ pll_status) & ~STA_FLL) > - NLOG(NLOG_SYNCEVENT | NLOG_SYSEVENT) > - msyslog(LOG_NOTICE, > - "kernel time sync status change %04x", > - ntv.status); > } > pll_status = ntv.status; > #ifdef STA_NANO The other piece of this change should be to remove the "maxpoll 9" from src/etc/ntp.conf. It was added only to prevent the ntpd steering loop from transitioning from PLL to FLL operation on the transition from 512 to 1024 second poll/update cycles (effectively squelching the log spewage by preventing ntpd from operating normally). Removing the mythology that "FreeBSD requires maxpoll 9 in ntp.conf" from the web will be a much harder change. :) -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 15:05:29 2012 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 89BF4106564A; Mon, 20 Aug 2012 15:05:29 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74C468FC15; Mon, 20 Aug 2012 15:05:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KF5TeY050999; Mon, 20 Aug 2012 15:05:29 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KF5TUU050997; Mon, 20 Aug 2012 15:05:29 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208201505.q7KF5TUU050997@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 20 Aug 2012 15:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239434 - releng/9.1/libexec/rtld-elf 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, 20 Aug 2012 15:05:29 -0000 Author: kan Date: Mon Aug 20 15:05:29 2012 New Revision: 239434 URL: http://svn.freebsd.org/changeset/base/239434 Log: MFC r239019: Parse notes only after object structure had been allocated. Approved by: re (kib) Modified: releng/9.1/libexec/rtld-elf/map_object.c Directory Properties: releng/9.1/libexec/rtld-elf/ (props changed) Modified: releng/9.1/libexec/rtld-elf/map_object.c ============================================================================== --- releng/9.1/libexec/rtld-elf/map_object.c Mon Aug 20 14:54:30 2012 (r239433) +++ releng/9.1/libexec/rtld-elf/map_object.c Mon Aug 20 15:05:29 2012 (r239434) @@ -153,7 +153,6 @@ map_object(int fd, const char *path, con break; note_start = (Elf_Addr)(char *)hdr + phdr->p_offset; note_end = note_start + phdr->p_filesz; - digest_notes(obj, note_start, note_end); break; } @@ -291,7 +290,8 @@ map_object(int fd, const char *path, con obj->stack_flags = stack_flags; obj->relro_page = obj->relocbase + trunc_page(relro_page); obj->relro_size = round_page(relro_size); - + if (note_start < note_end) + digest_notes(obj, note_start, note_end); munmap(hdr, PAGE_SIZE); return (obj); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 15:08:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A4B3D1065673; Mon, 20 Aug 2012 15:08:22 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5448FC1A; Mon, 20 Aug 2012 15:08:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KF8MxP051345; Mon, 20 Aug 2012 15:08:22 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KF8Mw1051343; Mon, 20 Aug 2012 15:08:22 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208201508.q7KF8Mw1051343@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 20 Aug 2012 15:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239435 - stable/9/libexec/rtld-elf 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, 20 Aug 2012 15:08:22 -0000 Author: kan Date: Mon Aug 20 15:08:22 2012 New Revision: 239435 URL: http://svn.freebsd.org/changeset/base/239435 Log: MFC r239019: Parse notes only after object structure had been allocated. Modified: stable/9/libexec/rtld-elf/map_object.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/map_object.c ============================================================================== --- stable/9/libexec/rtld-elf/map_object.c Mon Aug 20 15:05:29 2012 (r239434) +++ stable/9/libexec/rtld-elf/map_object.c Mon Aug 20 15:08:22 2012 (r239435) @@ -153,7 +153,6 @@ map_object(int fd, const char *path, con break; note_start = (Elf_Addr)(char *)hdr + phdr->p_offset; note_end = note_start + phdr->p_filesz; - digest_notes(obj, note_start, note_end); break; } @@ -291,7 +290,8 @@ map_object(int fd, const char *path, con obj->stack_flags = stack_flags; obj->relro_page = obj->relocbase + trunc_page(relro_page); obj->relro_size = round_page(relro_size); - + if (note_start < note_end) + digest_notes(obj, note_start, note_end); munmap(hdr, PAGE_SIZE); return (obj); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 15:16:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F9C5106564A; Mon, 20 Aug 2012 15:16:44 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED3B28FC14; Mon, 20 Aug 2012 15:16:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KFGh82052300; Mon, 20 Aug 2012 15:16:43 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KFGhmQ052298; Mon, 20 Aug 2012 15:16:43 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208201516.q7KFGhmQ052298@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 20 Aug 2012 15:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239436 - stable/9/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: Mon, 20 Aug 2012 15:16:44 -0000 Author: kan Date: Mon Aug 20 15:16:43 2012 New Revision: 239436 URL: http://svn.freebsd.org/changeset/base/239436 Log: MFC r239095: Do not add handler to event handlers list until ithread is created. In rare event when fast and ithread interrupts share the same vector and the fast handler was registered first, we can end up trying to schedule the ithread that is not created yet. The kernel built with INVARIANTS then triggers an assertion. Change the order to create the ithread first and only then add the handler that needs it to the interrupt event handlers list. Reviewed by: jhb Modified: stable/9/sys/kern/kern_intr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_intr.c ============================================================================== --- stable/9/sys/kern/kern_intr.c Mon Aug 20 15:08:22 2012 (r239435) +++ stable/9/sys/kern/kern_intr.c Mon Aug 20 15:16:43 2012 (r239436) @@ -545,17 +545,6 @@ intr_event_add_handler(struct intr_event } } - /* Add the new handler to the event in priority order. */ - TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) { - if (temp_ih->ih_pri > ih->ih_pri) - break; - } - if (temp_ih == NULL) - TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next); - else - TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next); - intr_event_update(ie); - /* Create a thread if we need one. */ while (ie->ie_thread == NULL && handler != NULL) { if (ie->ie_flags & IE_ADDING_THREAD) @@ -572,6 +561,18 @@ intr_event_add_handler(struct intr_event wakeup(ie); } } + + /* Add the new handler to the event in priority order. */ + TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) { + if (temp_ih->ih_pri > ih->ih_pri) + break; + } + if (temp_ih == NULL) + TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next); + else + TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next); + intr_event_update(ie); + CTR3(KTR_INTR, "%s: added %s to %s", __func__, ih->ih_name, ie->ie_name); mtx_unlock(&ie->ie_lock); @@ -618,23 +619,12 @@ intr_event_add_handler(struct intr_event } } - /* Add the new handler to the event in priority order. */ - TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) { - if (temp_ih->ih_pri > ih->ih_pri) - break; - } - if (temp_ih == NULL) - TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next); - else - TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next); - intr_event_update(ie); - /* For filtered handlers, create a private ithread to run on. */ - if (filter != NULL && handler != NULL) { + if (filter != NULL && handler != NULL) { mtx_unlock(&ie->ie_lock); - it = ithread_create("intr: newborn", ih); + it = ithread_create("intr: newborn", ih); mtx_lock(&ie->ie_lock); - it->it_event = ie; + it->it_event = ie; ih->ih_thread = it; ithread_update(it); // XXX - do we really need this?!?!? } else { /* Create the global per-event thread if we need one. */ @@ -654,6 +644,18 @@ intr_event_add_handler(struct intr_event } } } + + /* Add the new handler to the event in priority order. */ + TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) { + if (temp_ih->ih_pri > ih->ih_pri) + break; + } + if (temp_ih == NULL) + TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next); + else + TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next); + intr_event_update(ie); + CTR3(KTR_INTR, "%s: added %s to %s", __func__, ih->ih_name, ie->ie_name); mtx_unlock(&ie->ie_lock); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 15:19:35 2012 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 6919E106566B; Mon, 20 Aug 2012 15:19:35 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53B658FC0C; Mon, 20 Aug 2012 15:19:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KFJZbl052653; Mon, 20 Aug 2012 15:19:35 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KFJZp3052651; Mon, 20 Aug 2012 15:19:35 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208201519.q7KFJZp3052651@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 20 Aug 2012 15:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239437 - releng/9.1/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: Mon, 20 Aug 2012 15:19:35 -0000 Author: kan Date: Mon Aug 20 15:19:34 2012 New Revision: 239437 URL: http://svn.freebsd.org/changeset/base/239437 Log: MFC r239095: Do not add handler to event handlers list until ithread is created. In rare event when fast and ithread interrupts share the same vector and the fast handler was registered first, we can end up trying to schedule the ithread that is not created yet. The kernel built with INVARIANTS then triggers an assertion. Change the order to create the ithread first and only then add the handler that needs it to the interrupt event handlers list. Approved by: re (kib) Reviewed by: jhb Modified: releng/9.1/sys/kern/kern_intr.c Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/kern/kern_intr.c ============================================================================== --- releng/9.1/sys/kern/kern_intr.c Mon Aug 20 15:16:43 2012 (r239436) +++ releng/9.1/sys/kern/kern_intr.c Mon Aug 20 15:19:34 2012 (r239437) @@ -545,17 +545,6 @@ intr_event_add_handler(struct intr_event } } - /* Add the new handler to the event in priority order. */ - TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) { - if (temp_ih->ih_pri > ih->ih_pri) - break; - } - if (temp_ih == NULL) - TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next); - else - TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next); - intr_event_update(ie); - /* Create a thread if we need one. */ while (ie->ie_thread == NULL && handler != NULL) { if (ie->ie_flags & IE_ADDING_THREAD) @@ -572,6 +561,18 @@ intr_event_add_handler(struct intr_event wakeup(ie); } } + + /* Add the new handler to the event in priority order. */ + TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) { + if (temp_ih->ih_pri > ih->ih_pri) + break; + } + if (temp_ih == NULL) + TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next); + else + TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next); + intr_event_update(ie); + CTR3(KTR_INTR, "%s: added %s to %s", __func__, ih->ih_name, ie->ie_name); mtx_unlock(&ie->ie_lock); @@ -618,23 +619,12 @@ intr_event_add_handler(struct intr_event } } - /* Add the new handler to the event in priority order. */ - TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) { - if (temp_ih->ih_pri > ih->ih_pri) - break; - } - if (temp_ih == NULL) - TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next); - else - TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next); - intr_event_update(ie); - /* For filtered handlers, create a private ithread to run on. */ - if (filter != NULL && handler != NULL) { + if (filter != NULL && handler != NULL) { mtx_unlock(&ie->ie_lock); - it = ithread_create("intr: newborn", ih); + it = ithread_create("intr: newborn", ih); mtx_lock(&ie->ie_lock); - it->it_event = ie; + it->it_event = ie; ih->ih_thread = it; ithread_update(it); // XXX - do we really need this?!?!? } else { /* Create the global per-event thread if we need one. */ @@ -654,6 +644,18 @@ intr_event_add_handler(struct intr_event } } } + + /* Add the new handler to the event in priority order. */ + TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) { + if (temp_ih->ih_pri > ih->ih_pri) + break; + } + if (temp_ih == NULL) + TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next); + else + TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next); + intr_event_update(ie); + CTR3(KTR_INTR, "%s: added %s to %s", __func__, ih->ih_name, ie->ie_name); mtx_unlock(&ie->ie_lock); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 15:30:27 2012 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 6B4C31065673; Mon, 20 Aug 2012 15:30:27 +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 57CD98FC19; Mon, 20 Aug 2012 15:30:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KFURV6053958; Mon, 20 Aug 2012 15:30:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KFURwj053956; Mon, 20 Aug 2012 15:30:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208201530.q7KFURwj053956@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 15:30: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: r239438 - 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: Mon, 20 Aug 2012 15:30:27 -0000 Author: adrian Date: Mon Aug 20 15:30:26 2012 New Revision: 239438 URL: http://svn.freebsd.org/changeset/base/239438 Log: Wrap debugging in #ifdef ATH_DEBUG Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Aug 20 15:19:34 2012 (r239437) +++ head/sys/dev/ath/if_ath_tx.c Mon Aug 20 15:30:26 2012 (r239438) @@ -376,8 +376,10 @@ ath_tx_chaindesclist(struct ath_softc *s , (struct ath_desc *) ds0 /* first descriptor */ ); isFirstDesc = 0; +#ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT) ath_printtxbuf(sc, bf, qnum, 0, 0); +#endif bf->bf_lastds = (struct ath_desc *) ds; /* From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 15:34:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CA28106566B; Mon, 20 Aug 2012 15:34:07 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D64A8FC08; Mon, 20 Aug 2012 15:34:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KFY7Qm054395; Mon, 20 Aug 2012 15:34:07 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KFY7Wd054393; Mon, 20 Aug 2012 15:34:07 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208201534.q7KFY7Wd054393@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 20 Aug 2012 15:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239439 - stable/9/libexec/rtld-elf 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, 20 Aug 2012 15:34:07 -0000 Author: kan Date: Mon Aug 20 15:34:06 2012 New Revision: 239439 URL: http://svn.freebsd.org/changeset/base/239439 Log: MFC r239253: Pospone the DF_1_NODELETE processing until object DAG is fully loaded. Trying to up the reference from the load loop risks missing dependencies that have not been loaded yet. Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Mon Aug 20 15:30:26 2012 (r239438) +++ stable/9/libexec/rtld-elf/rtld.c Mon Aug 20 15:34:06 2012 (r239439) @@ -1589,6 +1589,26 @@ init_dag(Obj_Entry *root) root->dag_inited = true; } +static void +process_nodelete(Obj_Entry *root) +{ + const Objlist_Entry *elm; + + /* + * Walk over object DAG and process every dependent object that + * is marked as DF_1_NODELETE. They need to grow their own DAG, + * which then should have its reference upped separately. + */ + STAILQ_FOREACH(elm, &root->dagmembers, link) { + if (elm->obj != NULL && elm->obj->z_nodelete && + !elm->obj->ref_nodel) { + dbg("obj %s nodelete", elm->obj->path); + init_dag(elm->obj); + ref_dag(elm->obj); + elm->obj->ref_nodel = true; + } + } +} /* * Initialize the dynamic linker. The argument is the address at which * the dynamic linker has been mapped into memory. The primary task of @@ -1777,12 +1797,6 @@ process_needed(Obj_Entry *obj, Needed_En flags & ~RTLD_LO_NOLOAD); if (obj1 == NULL && !ld_tracing && (flags & RTLD_LO_FILTEES) == 0) return (-1); - if (obj1 != NULL && obj1->z_nodelete && !obj1->ref_nodel) { - dbg("obj %s nodelete", obj1->path); - init_dag(obj1); - ref_dag(obj1); - obj1->ref_nodel = true; - } } return (0); } @@ -2678,8 +2692,14 @@ dlopen_object(const char *name, int fd, /* Make list of init functions to call. */ initlist_add_objects(obj, &obj->next, &initlist); } + /* + * Process all no_delete objects here, given them own + * DAGs to prevent their dependencies from being unloaded. + * This has to be done after we have loaded all of the + * dependencies, so that we do not miss any. + */ + process_nodelete(obj); } else { - /* * Bump the reference counts for objects on this DAG. If * this is the first dlopen() call for the object that was From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:00:34 2012 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 571CD106566C; Mon, 20 Aug 2012 16:00:34 +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 41C3B8FC08; Mon, 20 Aug 2012 16:00:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KG0Y2G058035; Mon, 20 Aug 2012 16:00:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KG0YfC058033; Mon, 20 Aug 2012 16:00:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208201600.q7KG0YfC058033@svn.freebsd.org> From: John Baldwin Date: Mon, 20 Aug 2012 16:00: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: r239440 - 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: Mon, 20 Aug 2012 16:00:34 -0000 Author: jhb Date: Mon Aug 20 16:00:33 2012 New Revision: 239440 URL: http://svn.freebsd.org/changeset/base/239440 Log: Refine the changes made in r208212 to avoid bogus failures from if_delmulti() when clearing the configuration for a subinterface when the parent interface is being detached. The current code was still triggering an assertion in if_delmulti() due to the parent interface being partially detached. Fix this by not calling if_delmulti() at all if the parent interface is being detached. Warn if if_delmulti() fails when the parent is not being detached (but similar to 208212, still proceed with tearing down the vlan state). Tested by: ae@ MFC after: 1 month Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Aug 20 15:34:06 2012 (r239439) +++ head/sys/net/if_vlan.c Mon Aug 20 16:00:33 2012 (r239440) @@ -192,7 +192,7 @@ static int vlan_setflags(struct ifnet *i static int vlan_setmulti(struct ifnet *ifp); static int vlan_transmit(struct ifnet *ifp, struct mbuf *m); static void vlan_unconfig(struct ifnet *ifp); -static void vlan_unconfig_locked(struct ifnet *ifp); +static void vlan_unconfig_locked(struct ifnet *ifp, int departing); static int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag); static void vlan_link_state(struct ifnet *ifp); static void vlan_capabilities(struct ifvlan *ifv); @@ -577,7 +577,7 @@ vlan_ifdetach(void *arg __unused, struct #ifdef VLAN_ARRAY for (i = 0; i < VLAN_ARRAY_SIZE; i++) if ((ifv = ifp->if_vlantrunk->vlans[i])) { - vlan_unconfig_locked(ifv->ifv_ifp); + vlan_unconfig_locked(ifv->ifv_ifp, 1); if (ifp->if_vlantrunk == NULL) break; } @@ -585,7 +585,7 @@ vlan_ifdetach(void *arg __unused, struct restart: for (i = 0; i < (1 << ifp->if_vlantrunk->hwidth); i++) if ((ifv = LIST_FIRST(&ifp->if_vlantrunk->hash[i]))) { - vlan_unconfig_locked(ifv->ifv_ifp); + vlan_unconfig_locked(ifv->ifv_ifp, 1); if (ifp->if_vlantrunk) goto restart; /* trunk->hwidth can change */ else @@ -968,7 +968,7 @@ vlan_clone_create(struct if_clone *ifc, error = vlan_config(ifv, p, vid); if (error != 0) { /* - * Since we've partialy failed, we need to back + * Since we've partially failed, we need to back * out all the way, otherwise userland could get * confused. Thus, we destroy the interface. */ @@ -1307,17 +1307,18 @@ vlan_unconfig(struct ifnet *ifp) { VLAN_LOCK(); - vlan_unconfig_locked(ifp); + vlan_unconfig_locked(ifp, 0); VLAN_UNLOCK(); } static void -vlan_unconfig_locked(struct ifnet *ifp) +vlan_unconfig_locked(struct ifnet *ifp, int departing) { struct ifvlantrunk *trunk; struct vlan_mc_entry *mc; struct ifvlan *ifv; struct ifnet *parent; + int error; VLAN_LOCK_ASSERT(); @@ -1337,14 +1338,21 @@ vlan_unconfig_locked(struct ifnet *ifp) */ while ((mc = SLIST_FIRST(&ifv->vlan_mc_listhead)) != NULL) { /* - * This may fail if the parent interface is - * being detached. Regardless, we should do a - * best effort to free this interface as much - * as possible as all callers expect vlan - * destruction to succeed. + * If the parent interface is being detached, + * all it's multicast addresses have already + * been removed. Warn about errors if + * if_delmulti() does fail, but don't abort as + * all callers expect vlan destruction to + * succeed. */ - (void)if_delmulti(parent, - (struct sockaddr *)&mc->mc_addr); + if (!departing) { + error = if_delmulti(parent, + (struct sockaddr *)&mc->mc_addr); + if (error) + if_printf(ifp, + "Failed to delete multicast address from parent: %d\n", + error); + } SLIST_REMOVE_HEAD(&ifv->vlan_mc_listhead, mc_entries); free(mc, M_VLAN); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:11:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7AD2A1065700; Mon, 20 Aug 2012 16:11:14 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 644AC8FC0C; Mon, 20 Aug 2012 16:11:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGBEu7059381; Mon, 20 Aug 2012 16:11:14 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGBEve059379; Mon, 20 Aug 2012 16:11:14 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208201611.q7KGBEve059379@svn.freebsd.org> From: Jim Harris Date: Mon, 20 Aug 2012 16:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239441 - stable/9/sys/geom/virstor 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, 20 Aug 2012 16:11:14 -0000 Author: jimharris Date: Mon Aug 20 16:11:13 2012 New Revision: 239441 URL: http://svn.freebsd.org/changeset/base/239441 Log: MFC r239021: In virstor_ctl_stop(), check for a valid softc before trying to update metadata. Modified: stable/9/sys/geom/virstor/g_virstor.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/virstor/g_virstor.c ============================================================================== --- stable/9/sys/geom/virstor/g_virstor.c Mon Aug 20 16:00:33 2012 (r239440) +++ stable/9/sys/geom/virstor/g_virstor.c Mon Aug 20 16:11:13 2012 (r239441) @@ -234,6 +234,12 @@ virstor_ctl_stop(struct gctl_req *req, s return; } sc = virstor_find_geom(cp, name); + if (sc == NULL) { + gctl_error(req, "Don't know anything about '%s'", name); + g_topology_unlock(); + return; + } + LOG_MSG(LVL_INFO, "Stopping %s by the userland command", sc->geom->name); update_metadata(sc); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:13:17 2012 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 35460106564A; Mon, 20 Aug 2012 16:13:17 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EF438FC14; Mon, 20 Aug 2012 16:13:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGDGEs059649; Mon, 20 Aug 2012 16:13:16 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGDG0q059647; Mon, 20 Aug 2012 16:13:16 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208201613.q7KGDG0q059647@svn.freebsd.org> From: Jim Harris Date: Mon, 20 Aug 2012 16:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239442 - stable/8/sys/geom/virstor X-BeenThere: svn-src-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, 20 Aug 2012 16:13:17 -0000 Author: jimharris Date: Mon Aug 20 16:13:16 2012 New Revision: 239442 URL: http://svn.freebsd.org/changeset/base/239442 Log: MRC r239021: In virstor_ctl_stop(), check for a valid softc before trying to update metadata. Modified: stable/8/sys/geom/virstor/g_virstor.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/virstor/g_virstor.c ============================================================================== --- stable/8/sys/geom/virstor/g_virstor.c Mon Aug 20 16:11:13 2012 (r239441) +++ stable/8/sys/geom/virstor/g_virstor.c Mon Aug 20 16:13:16 2012 (r239442) @@ -231,6 +231,12 @@ virstor_ctl_stop(struct gctl_req *req, s return; } sc = virstor_find_geom(cp, name); + if (sc == NULL) { + gctl_error(req, "Don't know anything about '%s'", name); + g_topology_unlock(); + return; + } + LOG_MSG(LVL_INFO, "Stopping %s by the userland command", sc->geom->name); update_metadata(sc); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:31:23 2012 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 C0BB9106564A; Mon, 20 Aug 2012 16:31:23 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB4508FC08; Mon, 20 Aug 2012 16:31:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGVNPb061614; Mon, 20 Aug 2012 16:31:23 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGVNAX061612; Mon, 20 Aug 2012 16:31:23 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201208201631.q7KGVNAX061612@svn.freebsd.org> From: Warren Block Date: Mon, 20 Aug 2012 16:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239443 - stable/9/usr.sbin/lpr/lpd 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, 20 Aug 2012 16:31:23 -0000 Author: wblock (doc committer) Date: Mon Aug 20 16:31:23 2012 New Revision: 239443 URL: http://svn.freebsd.org/changeset/base/239443 Log: MFC r239233: Correct description of minfree to kilobytes rather than blocks. PR: 125921 Submitted by: Andre Albsmeier Modified: stable/9/usr.sbin/lpr/lpd/lpd.8 Directory Properties: stable/9/usr.sbin/lpr/lpd/ (props changed) Modified: stable/9/usr.sbin/lpr/lpd/lpd.8 ============================================================================== --- stable/9/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:13:16 2012 (r239442) +++ stable/9/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:31:23 2012 (r239443) @@ -152,7 +152,7 @@ machine with the printer. .Pp The file .Em minfree -in each spool directory contains the number of disk blocks to leave free +in each spool directory contains the number of kilobytes to leave free so that the line printer queue will not completely fill the disk. The .Em minfree From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:37:41 2012 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 93E721065674; Mon, 20 Aug 2012 16:37:41 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EC998FC15; Mon, 20 Aug 2012 16:37:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGbf3t062335; Mon, 20 Aug 2012 16:37:41 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGbfOQ062332; Mon, 20 Aug 2012 16:37:41 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201208201637.q7KGbfOQ062332@svn.freebsd.org> From: Warren Block Date: Mon, 20 Aug 2012 16:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239444 - releng/9.1/usr.sbin/lpr/lpd 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, 20 Aug 2012 16:37:41 -0000 Author: wblock (doc committer) Date: Mon Aug 20 16:37:41 2012 New Revision: 239444 URL: http://svn.freebsd.org/changeset/base/239444 Log: MFC r239233: Correct description of minfree to kilobytes rather than blocks. PR: 125921 Submitted by: Andre Albsmeier Approved by: re (implicit) Modified: releng/9.1/usr.sbin/lpr/lpd/lpd.8 Directory Properties: releng/9.1/usr.sbin/lpr/lpd/ (props changed) Modified: releng/9.1/usr.sbin/lpr/lpd/lpd.8 ============================================================================== --- releng/9.1/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:31:23 2012 (r239443) +++ releng/9.1/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:37:41 2012 (r239444) @@ -152,7 +152,7 @@ machine with the printer. .Pp The file .Em minfree -in each spool directory contains the number of disk blocks to leave free +in each spool directory contains the number of kilobytes to leave free so that the line printer queue will not completely fill the disk. The .Em minfree From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:38:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2DAD1065688; Mon, 20 Aug 2012 16:38:58 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCA728FC0C; Mon, 20 Aug 2012 16:38:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGcwbS062529; Mon, 20 Aug 2012 16:38:58 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGcwhO062527; Mon, 20 Aug 2012 16:38:58 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201208201638.q7KGcwhO062527@svn.freebsd.org> From: Warren Block Date: Mon, 20 Aug 2012 16:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239445 - stable/8/usr.sbin/lpr/lpd X-BeenThere: svn-src-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, 20 Aug 2012 16:38:59 -0000 Author: wblock (doc committer) Date: Mon Aug 20 16:38:58 2012 New Revision: 239445 URL: http://svn.freebsd.org/changeset/base/239445 Log: MFC r239233: Correct description of minfree to kilobytes rather than blocks. PR: 125921 Submitted by: Andre Albsmeier Modified: stable/8/usr.sbin/lpr/lpd/lpd.8 Directory Properties: stable/8/usr.sbin/lpr/lpd/ (props changed) Modified: stable/8/usr.sbin/lpr/lpd/lpd.8 ============================================================================== --- stable/8/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:37:41 2012 (r239444) +++ stable/8/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:38:58 2012 (r239445) @@ -156,7 +156,7 @@ machine with the printer. .Pp The file .Em minfree -in each spool directory contains the number of disk blocks to leave free +in each spool directory contains the number of kilobytes to leave free so that the line printer queue will not completely fill the disk. The .Em minfree From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:40:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2817E10656E1; Mon, 20 Aug 2012 16:40:16 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFAEE8FC1F; Mon, 20 Aug 2012 16:40:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGeFP3062714; Mon, 20 Aug 2012 16:40:15 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGeFSs062712; Mon, 20 Aug 2012 16:40:15 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201208201640.q7KGeFSs062712@svn.freebsd.org> From: Warren Block Date: Mon, 20 Aug 2012 16:40:15 +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: r239446 - stable/7/usr.sbin/lpr/lpd 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, 20 Aug 2012 16:40:16 -0000 Author: wblock (doc committer) Date: Mon Aug 20 16:40:15 2012 New Revision: 239446 URL: http://svn.freebsd.org/changeset/base/239446 Log: MFC r239233: Correct description of minfree to kilobytes rather than blocks. PR: 125921 Submitted by: Andre Albsmeier Modified: stable/7/usr.sbin/lpr/lpd/lpd.8 Directory Properties: stable/7/usr.sbin/lpr/lpd/ (props changed) Modified: stable/7/usr.sbin/lpr/lpd/lpd.8 ============================================================================== --- stable/7/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:38:58 2012 (r239445) +++ stable/7/usr.sbin/lpr/lpd/lpd.8 Mon Aug 20 16:40:15 2012 (r239446) @@ -156,7 +156,7 @@ machine with the printer. .Pp The file .Em minfree -in each spool directory contains the number of disk blocks to leave free +in each spool directory contains the number of kilobytes to leave free so that the line printer queue will not completely fill the disk. The .Em minfree From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:42:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A4B66106567A; Mon, 20 Aug 2012 16:42:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F25D8FC1A; Mon, 20 Aug 2012 16:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGgjxj063073; Mon, 20 Aug 2012 16:42:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGgjBh063071; Mon, 20 Aug 2012 16:42:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201208201642.q7KGgjBh063071@svn.freebsd.org> From: Michael Tuexen Date: Mon, 20 Aug 2012 16:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239447 - stable/9/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: Mon, 20 Aug 2012 16:42:45 -0000 Author: tuexen Date: Mon Aug 20 16:42:45 2012 New Revision: 239447 URL: http://svn.freebsd.org/changeset/base/239447 Log: MFC r239041: Fix a bug reported by Simon L. B. Nielsen: If an SCTP endpoint receives an ASCONF with a wildcard lookup address and incorrect verification tag, the system crashes. This bug was found by Shaun Colley. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Mon Aug 20 16:40:15 2012 (r239446) +++ stable/9/sys/netinet/sctp_pcb.c Mon Aug 20 16:42:45 2012 (r239447) @@ -2048,8 +2048,6 @@ sctp_findassoc_by_vtag(struct sockaddr * struct sctp_nets *net; struct sctp_tcb *stcb; - *netp = NULL; - *inp_p = NULL; SCTP_INP_INFO_RLOCK(); head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(vtag, SCTP_BASE_INFO(hashasocmark))]; From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:45:47 2012 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 F1AB9106564A; Mon, 20 Aug 2012 16:45:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBE548FC16; Mon, 20 Aug 2012 16:45:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGjkjU063429; Mon, 20 Aug 2012 16:45:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGjkct063427; Mon, 20 Aug 2012 16:45:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201208201645.q7KGjkct063427@svn.freebsd.org> From: Michael Tuexen Date: Mon, 20 Aug 2012 16:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239448 - stable/9/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: Mon, 20 Aug 2012 16:45:47 -0000 Author: tuexen Date: Mon Aug 20 16:45:46 2012 New Revision: 239448 URL: http://svn.freebsd.org/changeset/base/239448 Log: MFC r239052: Fix a refcount issue. The caller only decrements if stcb is NULL. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Mon Aug 20 16:42:45 2012 (r239447) +++ stable/9/sys/netinet/sctp_pcb.c Mon Aug 20 16:45:46 2012 (r239448) @@ -2417,10 +2417,9 @@ sctp_findassociation_ep_asconf(struct mb if (zero_address) { stcb = sctp_findassoc_by_vtag(NULL, to, ntohl(sh->v_tag), inp_p, netp, sh->src_port, sh->dest_port, 1, vrf_id, 0); - /* - * SCTP_PRINTF("findassociation_ep_asconf: zero lookup - * address finds stcb 0x%x\n", (uint32_t)stcb); - */ + if (stcb != NULL) { + SCTP_INP_DECR_REF(*inp_p); + } } else { stcb = sctp_findassociation_ep_addr(inp_p, (struct sockaddr *)&remote_store, netp, From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:55:55 2012 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 C35F4106564A; Mon, 20 Aug 2012 16:55:55 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADE3E8FC0A; Mon, 20 Aug 2012 16:55:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGttmg064500; Mon, 20 Aug 2012 16:55:55 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGttpD064498; Mon, 20 Aug 2012 16:55:55 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208201655.q7KGttpD064498@svn.freebsd.org> From: Jim Harris Date: Mon, 20 Aug 2012 16:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239449 - releng/9.1/sys/geom/virstor 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, 20 Aug 2012 16:55:55 -0000 Author: jimharris Date: Mon Aug 20 16:55:55 2012 New Revision: 239449 URL: http://svn.freebsd.org/changeset/base/239449 Log: MFC r239021: In virstor_ctl_stop(), check for a valid softc before trying to update metadata. Approved by: re (kib) Modified: releng/9.1/sys/geom/virstor/g_virstor.c Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/geom/virstor/g_virstor.c ============================================================================== --- releng/9.1/sys/geom/virstor/g_virstor.c Mon Aug 20 16:45:46 2012 (r239448) +++ releng/9.1/sys/geom/virstor/g_virstor.c Mon Aug 20 16:55:55 2012 (r239449) @@ -234,6 +234,12 @@ virstor_ctl_stop(struct gctl_req *req, s return; } sc = virstor_find_geom(cp, name); + if (sc == NULL) { + gctl_error(req, "Don't know anything about '%s'", name); + g_topology_unlock(); + return; + } + LOG_MSG(LVL_INFO, "Stopping %s by the userland command", sc->geom->name); update_metadata(sc); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 16:57:27 2012 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 AD84A106566C; Mon, 20 Aug 2012 16:57:27 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA0F8FC0C; Mon, 20 Aug 2012 16:57:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KGvRgv064714; Mon, 20 Aug 2012 16:57:27 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KGvR0x064712; Mon, 20 Aug 2012 16:57:27 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208201657.q7KGvR0x064712@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 20 Aug 2012 16:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239450 - releng/9.1/libexec/rtld-elf 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, 20 Aug 2012 16:57:27 -0000 Author: kan Date: Mon Aug 20 16:57:27 2012 New Revision: 239450 URL: http://svn.freebsd.org/changeset/base/239450 Log: MFC r239253: Pospone the DF_1_NODELETE processing until object DAG is fully loaded. Trying to up the reference from the load loop risks missing dependencies that have not been loaded yet. Approved by: re (kib) Modified: releng/9.1/libexec/rtld-elf/rtld.c Directory Properties: releng/9.1/libexec/rtld-elf/ (props changed) Modified: releng/9.1/libexec/rtld-elf/rtld.c ============================================================================== --- releng/9.1/libexec/rtld-elf/rtld.c Mon Aug 20 16:55:55 2012 (r239449) +++ releng/9.1/libexec/rtld-elf/rtld.c Mon Aug 20 16:57:27 2012 (r239450) @@ -1589,6 +1589,26 @@ init_dag(Obj_Entry *root) root->dag_inited = true; } +static void +process_nodelete(Obj_Entry *root) +{ + const Objlist_Entry *elm; + + /* + * Walk over object DAG and process every dependent object that + * is marked as DF_1_NODELETE. They need to grow their own DAG, + * which then should have its reference upped separately. + */ + STAILQ_FOREACH(elm, &root->dagmembers, link) { + if (elm->obj != NULL && elm->obj->z_nodelete && + !elm->obj->ref_nodel) { + dbg("obj %s nodelete", elm->obj->path); + init_dag(elm->obj); + ref_dag(elm->obj); + elm->obj->ref_nodel = true; + } + } +} /* * Initialize the dynamic linker. The argument is the address at which * the dynamic linker has been mapped into memory. The primary task of @@ -1777,12 +1797,6 @@ process_needed(Obj_Entry *obj, Needed_En flags & ~RTLD_LO_NOLOAD); if (obj1 == NULL && !ld_tracing && (flags & RTLD_LO_FILTEES) == 0) return (-1); - if (obj1 != NULL && obj1->z_nodelete && !obj1->ref_nodel) { - dbg("obj %s nodelete", obj1->path); - init_dag(obj1); - ref_dag(obj1); - obj1->ref_nodel = true; - } } return (0); } @@ -2678,8 +2692,14 @@ dlopen_object(const char *name, int fd, /* Make list of init functions to call. */ initlist_add_objects(obj, &obj->next, &initlist); } + /* + * Process all no_delete objects here, given them own + * DAGs to prevent their dependencies from being unloaded. + * This has to be done after we have loaded all of the + * dependencies, so that we do not miss any. + */ + process_nodelete(obj); } else { - /* * Bump the reference counts for objects on this DAG. If * this is the first dlopen() call for the object that was From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 17:06:51 2012 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 F11BF106564A; Mon, 20 Aug 2012 17:06:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBCB78FC16; Mon, 20 Aug 2012 17:06:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KH6o5e065770; Mon, 20 Aug 2012 17:06:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KH6olo065768; Mon, 20 Aug 2012 17:06:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201208201706.q7KH6olo065768@svn.freebsd.org> From: Michael Tuexen Date: Mon, 20 Aug 2012 17:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239451 - releng/9.1/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: Mon, 20 Aug 2012 17:06:51 -0000 Author: tuexen Date: Mon Aug 20 17:06:50 2012 New Revision: 239451 URL: http://svn.freebsd.org/changeset/base/239451 Log: MFC r239041: Fix a bug reported by Simon L. B. Nielsen: If an SCTP endpoint receives an ASCONF with a wildcard lookup address and incorrect verification tag, the system crashes. This bug was found by Shaun Colley. Approved by: re (kib) Modified: releng/9.1/sys/netinet/sctp_pcb.c Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/netinet/sctp_pcb.c ============================================================================== --- releng/9.1/sys/netinet/sctp_pcb.c Mon Aug 20 16:57:27 2012 (r239450) +++ releng/9.1/sys/netinet/sctp_pcb.c Mon Aug 20 17:06:50 2012 (r239451) @@ -2048,8 +2048,6 @@ sctp_findassoc_by_vtag(struct sockaddr * struct sctp_nets *net; struct sctp_tcb *stcb; - *netp = NULL; - *inp_p = NULL; SCTP_INP_INFO_RLOCK(); head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(vtag, SCTP_BASE_INFO(hashasocmark))]; From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 17:36:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DAE7A106566B; Mon, 20 Aug 2012 17:36:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C66828FC08; Mon, 20 Aug 2012 17:36:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KHaAtb068991; Mon, 20 Aug 2012 17:36:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KHaAi8068989; Mon, 20 Aug 2012 17:36:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201208201736.q7KHaAi8068989@svn.freebsd.org> From: Michael Tuexen Date: Mon, 20 Aug 2012 17:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239452 - releng/9.1/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: Mon, 20 Aug 2012 17:36:11 -0000 Author: tuexen Date: Mon Aug 20 17:36:10 2012 New Revision: 239452 URL: http://svn.freebsd.org/changeset/base/239452 Log: MFC r239052: Fix a refcount issue. The caller only decrements if stcb is NULL. Approved by: re (kib) Modified: releng/9.1/sys/netinet/sctp_pcb.c Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/netinet/sctp_pcb.c ============================================================================== --- releng/9.1/sys/netinet/sctp_pcb.c Mon Aug 20 17:06:50 2012 (r239451) +++ releng/9.1/sys/netinet/sctp_pcb.c Mon Aug 20 17:36:10 2012 (r239452) @@ -2417,10 +2417,9 @@ sctp_findassociation_ep_asconf(struct mb if (zero_address) { stcb = sctp_findassoc_by_vtag(NULL, to, ntohl(sh->v_tag), inp_p, netp, sh->src_port, sh->dest_port, 1, vrf_id, 0); - /* - * SCTP_PRINTF("findassociation_ep_asconf: zero lookup - * address finds stcb 0x%x\n", (uint32_t)stcb); - */ + if (stcb != NULL) { + SCTP_INP_DECR_REF(*inp_p); + } } else { stcb = sctp_findassociation_ep_addr(inp_p, (struct sockaddr *)&remote_store, netp, From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 17:46:23 2012 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 15ABA106564A; Mon, 20 Aug 2012 17:46:23 +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 F36688FC0C; Mon, 20 Aug 2012 17:46:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KHkMF9070229; Mon, 20 Aug 2012 17:46:22 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KHkM9f070227; Mon, 20 Aug 2012 17:46:22 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208201746.q7KHkM9f070227@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 20 Aug 2012 17:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239453 - stable/9/lib/libpam/modules/pam_ssh 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, 20 Aug 2012 17:46:23 -0000 Author: des Date: Mon Aug 20 17:46:22 2012 New Revision: 239453 URL: http://svn.freebsd.org/changeset/base/239453 Log: MFH r236106: avoid segfault with SSH 1 keys Modified: stable/9/lib/libpam/modules/pam_ssh/pam_ssh.c Directory Properties: stable/9/lib/libpam/ (props changed) Modified: stable/9/lib/libpam/modules/pam_ssh/pam_ssh.c ============================================================================== --- stable/9/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 20 17:36:10 2012 (r239452) +++ stable/9/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 20 17:46:22 2012 (r239453) @@ -110,7 +110,7 @@ pam_ssh_load_key(const char *dir, const * with an empty passphrase, and if the key is not encrypted, * accept only an empty passphrase. */ - key = key_load_private(fn, NULL, &comment); + key = key_load_private(fn, "", &comment); if (key != NULL && !(*passphrase == '\0' && nullok)) { key_free(key); return (NULL); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 17:50:21 2012 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 28444106566B; Mon, 20 Aug 2012 17:50:21 +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 12C1A8FC19; Mon, 20 Aug 2012 17:50:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KHoKJd070705; Mon, 20 Aug 2012 17:50:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KHoKhH070703; Mon, 20 Aug 2012 17:50:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208201750.q7KHoKhH070703@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 20 Aug 2012 17:50:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239454 - releng/9.1/lib/libpam/modules/pam_ssh 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, 20 Aug 2012 17:50:21 -0000 Author: des Date: Mon Aug 20 17:50:20 2012 New Revision: 239454 URL: http://svn.freebsd.org/changeset/base/239454 Log: MFH r236106: avoid segfault with SSH 1 keys Approved by: re (kib) Modified: releng/9.1/lib/libpam/modules/pam_ssh/pam_ssh.c Directory Properties: releng/9.1/lib/libpam/ (props changed) Modified: releng/9.1/lib/libpam/modules/pam_ssh/pam_ssh.c ============================================================================== --- releng/9.1/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 20 17:46:22 2012 (r239453) +++ releng/9.1/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 20 17:50:20 2012 (r239454) @@ -110,7 +110,7 @@ pam_ssh_load_key(const char *dir, const * with an empty passphrase, and if the key is not encrypted, * accept only an empty passphrase. */ - key = key_load_private(fn, NULL, &comment); + key = key_load_private(fn, "", &comment); if (key != NULL && !(*passphrase == '\0' && nullok)) { key_free(key); return (NULL); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:01:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10EDC106564A; Mon, 20 Aug 2012 18:01:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEFBE8FC16; Mon, 20 Aug 2012 18:01:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KI1H2Z071917; Mon, 20 Aug 2012 18:01:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KI1Hpe071915; Mon, 20 Aug 2012 18:01:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201801.q7KI1Hpe071915@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239455 - stable/9/sys/dev/mlx 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, 20 Aug 2012 18:01:18 -0000 Author: delphij Date: Mon Aug 20 18:01:17 2012 New Revision: 239455 URL: http://svn.freebsd.org/changeset/base/239455 Log: MFC r238997: Correct a typo. Reported by: Sascha Wildner Reviewed by: scottl Modified: stable/9/sys/dev/mlx/mlxvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mlx/mlxvar.h ============================================================================== --- stable/9/sys/dev/mlx/mlxvar.h Mon Aug 20 17:50:20 2012 (r239454) +++ stable/9/sys/dev/mlx/mlxvar.h Mon Aug 20 18:01:17 2012 (r239455) @@ -47,7 +47,7 @@ * making that fit cleanly without crossing page boundaries requires rounding up * to the next power of two. */ -#define MLX_MAXPHYS (128 * 124) +#define MLX_MAXPHYS (128 * 1024) #define MLX_NSEG 64 #define MLX_NSLOTS 256 /* max number of command slots */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:10:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2EE3106567D; Mon, 20 Aug 2012 18:10:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE5A38FC17; Mon, 20 Aug 2012 18:10:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIAmpn073097; Mon, 20 Aug 2012 18:10:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIAmM4073095; Mon, 20 Aug 2012 18:10:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201810.q7KIAmM4073095@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239456 - releng/9.1/sys/dev/mlx 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, 20 Aug 2012 18:10:48 -0000 Author: delphij Date: Mon Aug 20 18:10:48 2012 New Revision: 239456 URL: http://svn.freebsd.org/changeset/base/239456 Log: MFC r238997: Correct a typo. Reported by: Sascha Wildner Reviewed by: scottl Approved by: re (kib) Modified: releng/9.1/sys/dev/mlx/mlxvar.h Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/mlx/mlxvar.h ============================================================================== --- releng/9.1/sys/dev/mlx/mlxvar.h Mon Aug 20 18:01:17 2012 (r239455) +++ releng/9.1/sys/dev/mlx/mlxvar.h Mon Aug 20 18:10:48 2012 (r239456) @@ -47,7 +47,7 @@ * making that fit cleanly without crossing page boundaries requires rounding up * to the next power of two. */ -#define MLX_MAXPHYS (128 * 124) +#define MLX_MAXPHYS (128 * 1024) #define MLX_NSEG 64 #define MLX_NSLOTS 256 /* max number of command slots */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:16:40 2012 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 4B42B106564A; Mon, 20 Aug 2012 18:16:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 355AB8FC0A; Mon, 20 Aug 2012 18:16:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIGeZR073803; Mon, 20 Aug 2012 18:16:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIGeVS073801; Mon, 20 Aug 2012 18:16:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201816.q7KIGeVS073801@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239457 - stable/8/share/man/man4 X-BeenThere: svn-src-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, 20 Aug 2012 18:16:40 -0000 Author: delphij Date: Mon Aug 20 18:16:39 2012 New Revision: 239457 URL: http://svn.freebsd.org/changeset/base/239457 Log: MFC r239084: Add PCI IDs for various new High Point RocketRAID 43xx and 3xxx devices. Obtained from: FreeNAS Modified: stable/8/share/man/man4/hptiop.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/hptiop.4 ============================================================================== --- stable/8/share/man/man4/hptiop.4 Mon Aug 20 18:10:48 2012 (r239456) +++ stable/8/share/man/man4/hptiop.4 Mon Aug 20 18:16:39 2012 (r239457) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2011 +.Dd August 5, 2012 .Dt HPTIOP 4 .Os .Sh NAME @@ -58,34 +58,46 @@ driver supports the following SAS and SA .Pp .Bl -bullet -compact .It -HighPoint RocketRAID 4320 +HighPoint RocketRAID 4322 .It HighPoint RocketRAID 4321 .It -HighPoint RocketRAID 4322 +HighPoint RocketRAID 4320 .It -HighPoint RocketRAID 3220 +HighPoint RocketRAID 4311 .It -HighPoint RocketRAID 3320 +HighPoint RocketRAID 4310 .It -HighPoint RocketRAID 3410 +HighPoint RocketRAID 4211 .It -HighPoint RocketRAID 3520 +HighPoint RocketRAID 4210 .It -HighPoint RocketRAID 3510 +HighPoint RocketRAID 3560 .It -HighPoint RocketRAID 3511 +HighPoint RocketRAID 3540 .It -HighPoint RocketRAID 3521 +HighPoint RocketRAID 3530 .It HighPoint RocketRAID 3522 .It -HighPoint RocketRAID 3540 +HighPoint RocketRAID 3521 .It -HighPoint RocketRAID 3120 +HighPoint RocketRAID 3520 +.It +HighPoint RocketRAID 3511 +.It +HighPoint RocketRAID 3510 +.It +HighPoint RocketRAID 3410 +.It +HighPoint RocketRAID 3320 +.It +HighPoint RocketRAID 3220 .It HighPoint RocketRAID 3122 .It +HighPoint RocketRAID 3120 +.It HighPoint RocketRAID 3020 .El .Sh NOTES From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:19:07 2012 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 575071065670; Mon, 20 Aug 2012 18:19:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 267FE8FC16; Mon, 20 Aug 2012 18:19:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIJ74G074123; Mon, 20 Aug 2012 18:19:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIJ6ie074120; Mon, 20 Aug 2012 18:19:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201819.q7KIJ6ie074120@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239458 - in stable/9: share/man/man4 sys/dev/hptiop 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, 20 Aug 2012 18:19:07 -0000 Author: delphij Date: Mon Aug 20 18:19:06 2012 New Revision: 239458 URL: http://svn.freebsd.org/changeset/base/239458 Log: MFC r239084: Add PCI IDs for various new High Point RocketRAID 43xx and 3xxx devices. Obtained from: FreeNAS Modified: stable/9/share/man/man4/hptiop.4 stable/9/sys/dev/hptiop/hptiop.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/hptiop.4 ============================================================================== --- stable/9/share/man/man4/hptiop.4 Mon Aug 20 18:16:39 2012 (r239457) +++ stable/9/share/man/man4/hptiop.4 Mon Aug 20 18:19:06 2012 (r239458) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2011 +.Dd August 5, 2012 .Dt HPTIOP 4 .Os .Sh NAME @@ -58,34 +58,46 @@ driver supports the following SAS and SA .Pp .Bl -bullet -compact .It -HighPoint RocketRAID 4320 +HighPoint RocketRAID 4322 .It HighPoint RocketRAID 4321 .It -HighPoint RocketRAID 4322 +HighPoint RocketRAID 4320 .It -HighPoint RocketRAID 3220 +HighPoint RocketRAID 4311 .It -HighPoint RocketRAID 3320 +HighPoint RocketRAID 4310 .It -HighPoint RocketRAID 3410 +HighPoint RocketRAID 4211 .It -HighPoint RocketRAID 3520 +HighPoint RocketRAID 4210 .It -HighPoint RocketRAID 3510 +HighPoint RocketRAID 3560 .It -HighPoint RocketRAID 3511 +HighPoint RocketRAID 3540 .It -HighPoint RocketRAID 3521 +HighPoint RocketRAID 3530 .It HighPoint RocketRAID 3522 .It -HighPoint RocketRAID 3540 +HighPoint RocketRAID 3521 .It -HighPoint RocketRAID 3120 +HighPoint RocketRAID 3520 +.It +HighPoint RocketRAID 3511 +.It +HighPoint RocketRAID 3510 +.It +HighPoint RocketRAID 3410 +.It +HighPoint RocketRAID 3320 +.It +HighPoint RocketRAID 3220 .It HighPoint RocketRAID 3122 .It +HighPoint RocketRAID 3120 +.It HighPoint RocketRAID 3020 .El .Sh NOTES Modified: stable/9/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/9/sys/dev/hptiop/hptiop.c Mon Aug 20 18:16:39 2012 (r239457) +++ stable/9/sys/dev/hptiop/hptiop.c Mon Aug 20 18:19:06 2012 (r239458) @@ -1284,9 +1284,13 @@ static int hptiop_probe(device_t dev) id = pci_get_device(dev); switch (id) { - case 0x4322: - case 0x4321: + case 0x4210: + case 0x4211: + case 0x4310: + case 0x4311: case 0x4320: + case 0x4321: + case 0x4322: sas = 1; case 0x3220: case 0x3320: @@ -1296,12 +1300,14 @@ static int hptiop_probe(device_t dev) case 0x3511: case 0x3521: case 0x3522: + case 0x3530: case 0x3540: + case 0x3560: ops = &hptiop_itl_ops; break; + case 0x3020: case 0x3120: case 0x3122: - case 0x3020: ops = &hptiop_mv_ops; break; default: From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:21:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0814E106564A; Mon, 20 Aug 2012 18:21:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id C9AA38FC17; Mon, 20 Aug 2012 18:21:34 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 27AB5B978; Mon, 20 Aug 2012 14:21:34 -0400 (EDT) From: John Baldwin To: Andrey Chernov Date: Mon, 20 Aug 2012 14:09:55 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> In-Reply-To: <20120818195724.GA74684@vniz.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201208201409.55544.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 20 Aug 2012 14:21:34 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239356 - 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: Mon, 20 Aug 2012 18:21:35 -0000 On Saturday, August 18, 2012 3:57:24 pm Andrey Chernov wrote: > On Fri, Aug 17, 2012 at 03:07:07PM -0400, John Baldwin wrote: > > On Friday, August 17, 2012 2:25:12 pm Andrey Chernov wrote: > > > On Fri, Aug 17, 2012 at 03:53:43PM +0000, John Baldwin wrote: > > > > Author: jhb > > > > Date: Fri Aug 17 15:53:43 2012 > > > > New Revision: 239356 > > > > URL: http://svn.freebsd.org/changeset/base/239356 > > > > > > > > Log: > > > > Fix dhclient to properly exit and teardown the configured lease when > > > > link is lost. devd will start a new dhclient instance when link is > > > > restored. > > > > > > Is it any chance to teach dhclient IPv6 addresses in very basic parser > > > level, f.e. to replace nameserver it sniffs from router? Currently > > > dhcp-options(5) understands IPv4 addresses only and produce error on > > > 'supersede' IPv6 address. > > > > I think the RFC defines those to be IPv4, yes? Presumably DHCPv6 adds > > new option types that support IPv6 addresses? > > RFC 2131 (if you mean it) describes DHCP process itself, it does not > define contents of 'supersede' or other override options for dhclient. The supersede handling bits are all based on what the protocol can actually send, which the RFC defines as IPv4. > Moreover, current dhclient somewhow able to fetch my IPv6 tunnel DNS > address from the roiter (I don't look deeper, maybe it is router bug), but > I don't want IPv6 tunnel DNS, I want router fe80:... DNS instead. Eh? DHCP can't return an IPv6 address in the protocol. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:26:17 2012 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 7A6C810656D3; Mon, 20 Aug 2012 18:26:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A5578FC21; Mon, 20 Aug 2012 18:26:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIQHZF074981; Mon, 20 Aug 2012 18:26:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIQHAF074978; Mon, 20 Aug 2012 18:26:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201826.q7KIQHAF074978@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239459 - in stable: 7/contrib/opie/libopie 8/contrib/opie/libopie 9/contrib/opie/libopie 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, 20 Aug 2012 18:26:17 -0000 Author: delphij Date: Mon Aug 20 18:26:16 2012 New Revision: 239459 URL: http://svn.freebsd.org/changeset/base/239459 Log: MFC r239169: RFC 2289 requires all hashes be stored in little endian format before folding to 64 bits, while SHA1 code is big endian. Therefore, a bswap32 is required before using the value. Without this change, the implementation does not conform to test vector found in RFC 2289. PR: bin/170519 Submitted by: Arthur Mesh (with changes) Modified: stable/9/contrib/opie/libopie/hash.c stable/9/contrib/opie/libopie/hashlen.c Directory Properties: stable/9/contrib/opie/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/opie/libopie/hash.c stable/7/contrib/opie/libopie/hashlen.c stable/8/contrib/opie/libopie/hash.c stable/8/contrib/opie/libopie/hashlen.c Directory Properties: stable/7/contrib/opie/ (props changed) stable/8/contrib/opie/ (props changed) Modified: stable/9/contrib/opie/libopie/hash.c ============================================================================== --- stable/9/contrib/opie/libopie/hash.c Mon Aug 20 18:19:06 2012 (r239458) +++ stable/9/contrib/opie/libopie/hash.c Mon Aug 20 18:26:16 2012 (r239459) @@ -17,6 +17,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -39,6 +41,13 @@ unsigned algorithm) SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); }; break; case 4: Modified: stable/9/contrib/opie/libopie/hashlen.c ============================================================================== --- stable/9/contrib/opie/libopie/hashlen.c Mon Aug 20 18:19:06 2012 (r239458) +++ stable/9/contrib/opie/libopie/hashlen.c Mon Aug 20 18:26:16 2012 (r239459) @@ -14,6 +14,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -36,6 +38,13 @@ VOIDPTR in AND struct opie_otpkey *out A SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); break; } case 4: { From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:26:17 2012 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 D603810656EA; Mon, 20 Aug 2012 18:26:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF758FC24; Mon, 20 Aug 2012 18:26:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIQHHa074988; Mon, 20 Aug 2012 18:26:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIQHYR074985; Mon, 20 Aug 2012 18:26:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201826.q7KIQHYR074985@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239459 - in stable: 7/contrib/opie/libopie 8/contrib/opie/libopie 9/contrib/opie/libopie X-BeenThere: svn-src-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, 20 Aug 2012 18:26:18 -0000 Author: delphij Date: Mon Aug 20 18:26:16 2012 New Revision: 239459 URL: http://svn.freebsd.org/changeset/base/239459 Log: MFC r239169: RFC 2289 requires all hashes be stored in little endian format before folding to 64 bits, while SHA1 code is big endian. Therefore, a bswap32 is required before using the value. Without this change, the implementation does not conform to test vector found in RFC 2289. PR: bin/170519 Submitted by: Arthur Mesh (with changes) Modified: stable/8/contrib/opie/libopie/hash.c stable/8/contrib/opie/libopie/hashlen.c Directory Properties: stable/8/contrib/opie/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/opie/libopie/hash.c stable/7/contrib/opie/libopie/hashlen.c stable/9/contrib/opie/libopie/hash.c stable/9/contrib/opie/libopie/hashlen.c Directory Properties: stable/7/contrib/opie/ (props changed) stable/9/contrib/opie/ (props changed) Modified: stable/8/contrib/opie/libopie/hash.c ============================================================================== --- stable/8/contrib/opie/libopie/hash.c Mon Aug 20 18:19:06 2012 (r239458) +++ stable/8/contrib/opie/libopie/hash.c Mon Aug 20 18:26:16 2012 (r239459) @@ -17,6 +17,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -39,6 +41,13 @@ unsigned algorithm) SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); }; break; case 4: Modified: stable/8/contrib/opie/libopie/hashlen.c ============================================================================== --- stable/8/contrib/opie/libopie/hashlen.c Mon Aug 20 18:19:06 2012 (r239458) +++ stable/8/contrib/opie/libopie/hashlen.c Mon Aug 20 18:26:16 2012 (r239459) @@ -14,6 +14,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -36,6 +38,13 @@ VOIDPTR in AND struct opie_otpkey *out A SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); break; } case 4: { From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:26:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6EEE10656EC; Mon, 20 Aug 2012 18:26:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B69F48FC17; Mon, 20 Aug 2012 18:26:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIQHfT074995; Mon, 20 Aug 2012 18:26:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIQHsP074992; Mon, 20 Aug 2012 18:26:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201826.q7KIQHsP074992@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-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: r239459 - in stable: 7/contrib/opie/libopie 8/contrib/opie/libopie 9/contrib/opie/libopie 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, 20 Aug 2012 18:26:18 -0000 Author: delphij Date: Mon Aug 20 18:26:16 2012 New Revision: 239459 URL: http://svn.freebsd.org/changeset/base/239459 Log: MFC r239169: RFC 2289 requires all hashes be stored in little endian format before folding to 64 bits, while SHA1 code is big endian. Therefore, a bswap32 is required before using the value. Without this change, the implementation does not conform to test vector found in RFC 2289. PR: bin/170519 Submitted by: Arthur Mesh (with changes) Modified: stable/7/contrib/opie/libopie/hash.c stable/7/contrib/opie/libopie/hashlen.c Directory Properties: stable/7/contrib/opie/ (props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/opie/libopie/hash.c stable/8/contrib/opie/libopie/hashlen.c stable/9/contrib/opie/libopie/hash.c stable/9/contrib/opie/libopie/hashlen.c Directory Properties: stable/8/contrib/opie/ (props changed) stable/9/contrib/opie/ (props changed) Modified: stable/7/contrib/opie/libopie/hash.c ============================================================================== --- stable/7/contrib/opie/libopie/hash.c Mon Aug 20 18:19:06 2012 (r239458) +++ stable/7/contrib/opie/libopie/hash.c Mon Aug 20 18:26:16 2012 (r239459) @@ -17,6 +17,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -39,6 +41,13 @@ unsigned algorithm) SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); }; break; case 4: Modified: stable/7/contrib/opie/libopie/hashlen.c ============================================================================== --- stable/7/contrib/opie/libopie/hashlen.c Mon Aug 20 18:19:06 2012 (r239458) +++ stable/7/contrib/opie/libopie/hashlen.c Mon Aug 20 18:26:16 2012 (r239459) @@ -14,6 +14,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -36,6 +38,13 @@ VOIDPTR in AND struct opie_otpkey *out A SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); break; } case 4: { From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:27:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 169681065724; Mon, 20 Aug 2012 18:27:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F27938FC15; Mon, 20 Aug 2012 18:27:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIR2TK075106; Mon, 20 Aug 2012 18:27:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIR2Ue075104; Mon, 20 Aug 2012 18:27:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201827.q7KIR2Ue075104@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239460 - releng/9.1/sys/dev/hptiop 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, 20 Aug 2012 18:27:03 -0000 Author: delphij Date: Mon Aug 20 18:27:02 2012 New Revision: 239460 URL: http://svn.freebsd.org/changeset/base/239460 Log: MFC r239084 Add PCI IDs for various new High Point RocketRAID 43xx and 3xxx devices. Obtained from: FreeNAS Approved by: re (kib) Modified: releng/9.1/sys/dev/hptiop/hptiop.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/hptiop/hptiop.c ============================================================================== --- releng/9.1/sys/dev/hptiop/hptiop.c Mon Aug 20 18:26:16 2012 (r239459) +++ releng/9.1/sys/dev/hptiop/hptiop.c Mon Aug 20 18:27:02 2012 (r239460) @@ -1284,9 +1284,13 @@ static int hptiop_probe(device_t dev) id = pci_get_device(dev); switch (id) { - case 0x4322: - case 0x4321: + case 0x4210: + case 0x4211: + case 0x4310: + case 0x4311: case 0x4320: + case 0x4321: + case 0x4322: sas = 1; case 0x3220: case 0x3320: @@ -1296,12 +1300,14 @@ static int hptiop_probe(device_t dev) case 0x3511: case 0x3521: case 0x3522: + case 0x3530: case 0x3540: + case 0x3560: ops = &hptiop_itl_ops; break; + case 0x3020: case 0x3120: case 0x3122: - case 0x3020: ops = &hptiop_mv_ops; break; default: From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:33:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29D4C1065795; Mon, 20 Aug 2012 18:33:06 +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 0846B8FC1A; Mon, 20 Aug 2012 18:33:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIX5Xk075899; Mon, 20 Aug 2012 18:33:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIX58p075876; Mon, 20 Aug 2012 18:33:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208201833.q7KIX58p075876@svn.freebsd.org> From: Dimitry Andric Date: Mon, 20 Aug 2012 18:33: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: r239462 - in head: . contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/Bitcode contrib/llv... 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, 20 Aug 2012 18:33:06 -0000 Author: dim Date: Mon Aug 20 18:33:03 2012 New Revision: 239462 URL: http://svn.freebsd.org/changeset/base/239462 Log: Upgrade our copy of llvm/clang to trunk r162107. With thanks to Benjamin Kramer and Joerg Sonnenberger for their input and fixes. Added: head/contrib/llvm/include/llvm-c/Linker.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm-c/Linker.h head/contrib/llvm/include/llvm/Analysis/LoopInfoImpl.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h head/contrib/llvm/include/llvm/CodeGen/RegisterClassInfo.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/CodeGen/RegisterClassInfo.h head/contrib/llvm/include/llvm/CodeGen/RegisterPressure.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/CodeGen/RegisterPressure.h head/contrib/llvm/include/llvm/DIBuilder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/DIBuilder.h head/contrib/llvm/include/llvm/DebugInfo.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/DebugInfo.h head/contrib/llvm/include/llvm/IRBuilder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/IRBuilder.h head/contrib/llvm/include/llvm/IntrinsicsMips.td - copied unchanged from r239314, vendor/llvm/dist/include/llvm/IntrinsicsMips.td head/contrib/llvm/include/llvm/IntrinsicsNVVM.td - copied unchanged from r239314, vendor/llvm/dist/include/llvm/IntrinsicsNVVM.td head/contrib/llvm/include/llvm/MC/MCFixedLenDisassembler.h - copied unchanged from r239394, vendor/llvm/dist/include/llvm/MC/MCFixedLenDisassembler.h head/contrib/llvm/include/llvm/MC/MCSchedule.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/MC/MCSchedule.h head/contrib/llvm/include/llvm/MDBuilder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/MDBuilder.h head/contrib/llvm/include/llvm/Support/FileOutputBuffer.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Support/FileOutputBuffer.h head/contrib/llvm/include/llvm/Support/IntegersSubset.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Support/IntegersSubset.h head/contrib/llvm/include/llvm/Support/IntegersSubsetMapping.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Support/IntegersSubsetMapping.h head/contrib/llvm/include/llvm/Support/LEB128.h - copied, changed from r239314, vendor/llvm/dist/include/llvm/Support/LEB128.h head/contrib/llvm/include/llvm/TableGen/StringMatcher.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/TableGen/StringMatcher.h head/contrib/llvm/include/llvm/Target/TargetItinerary.td - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Target/TargetItinerary.td head/contrib/llvm/include/llvm/Transforms/Utils/CodeExtractor.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Transforms/Utils/CodeExtractor.h head/contrib/llvm/include/llvm/TypeBuilder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/TypeBuilder.h head/contrib/llvm/include/llvm/TypeFinder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/TypeFinder.h head/contrib/llvm/lib/CodeGen/EarlyIfConversion.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/EarlyIfConversion.cpp head/contrib/llvm/lib/CodeGen/LiveRegMatrix.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/LiveRegMatrix.cpp head/contrib/llvm/lib/CodeGen/LiveRegMatrix.h - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/LiveRegMatrix.h head/contrib/llvm/lib/CodeGen/MachineTraceMetrics.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/MachineTraceMetrics.cpp head/contrib/llvm/lib/CodeGen/MachineTraceMetrics.h - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/MachineTraceMetrics.h head/contrib/llvm/lib/CodeGen/RegisterPressure.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/RegisterPressure.cpp head/contrib/llvm/lib/MC/MCRegisterInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/MC/MCRegisterInfo.cpp head/contrib/llvm/lib/Support/FileOutputBuffer.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Support/FileOutputBuffer.cpp head/contrib/llvm/lib/TableGen/StringMatcher.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/TableGen/StringMatcher.cpp head/contrib/llvm/lib/Target/AMDGPU/ - copied from r239314, vendor/llvm/dist/lib/Target/AMDGPU/ head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV5.td - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfoV5.td head/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsicsV5.td - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonIntrinsicsV5.td head/contrib/llvm/lib/Target/Hexagon/HexagonMCInst.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonMCInst.h head/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonNewValueJump.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp head/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16FrameLowering.cpp head/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16FrameLowering.h head/contrib/llvm/lib/Target/Mips/Mips16InstrFormats.td - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16InstrFormats.td head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16InstrInfo.cpp head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16InstrInfo.h head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.td - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16InstrInfo.td head/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16RegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16RegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsLongBranch.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsLongBranch.cpp head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSEFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSEFrameLowering.h head/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSEInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSEInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSERegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSERegisterInfo.h head/contrib/llvm/lib/Target/NVPTX/ - copied from r239314, vendor/llvm/dist/lib/Target/NVPTX/ head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/PowerPC/PPCCTRLoops.cpp head/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Transforms/Instrumentation/BoundsChecking.cpp head/contrib/llvm/lib/VMCore/DIBuilder.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/VMCore/DIBuilder.cpp head/contrib/llvm/lib/VMCore/DebugInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/VMCore/DebugInfo.cpp head/contrib/llvm/lib/VMCore/TypeFinder.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/VMCore/TypeFinder.cpp head/contrib/llvm/tools/clang/include/clang-c/CXCompilationDatabase.h - copied unchanged from r239314, vendor/clang/dist/include/clang-c/CXCompilationDatabase.h head/contrib/llvm/tools/clang/include/clang-c/CXString.h - copied unchanged from r239314, vendor/clang/dist/include/clang-c/CXString.h head/contrib/llvm/tools/clang/include/clang-c/Platform.h - copied unchanged from r239314, vendor/clang/dist/include/clang-c/Platform.h head/contrib/llvm/tools/clang/include/clang/AST/Comment.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/Comment.h head/contrib/llvm/tools/clang/include/clang/AST/CommentBriefParser.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentBriefParser.h head/contrib/llvm/tools/clang/include/clang/AST/CommentCommandTraits.h - copied, changed from r239314, vendor/clang/dist/include/clang/AST/CommentCommandTraits.h head/contrib/llvm/tools/clang/include/clang/AST/CommentDiagnostic.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentDiagnostic.h head/contrib/llvm/tools/clang/include/clang/AST/CommentLexer.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentLexer.h head/contrib/llvm/tools/clang/include/clang/AST/CommentParser.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentParser.h head/contrib/llvm/tools/clang/include/clang/AST/CommentSema.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentSema.h head/contrib/llvm/tools/clang/include/clang/AST/CommentVisitor.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h - copied, changed from r239314, vendor/clang/dist/include/clang/AST/RawCommentList.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ - copied from r239314, vendor/clang/dist/include/clang/ASTMatchers/ head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsMips.def - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/BuiltinsMips.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsNVPTX.def - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/BuiltinsNVPTX.def head/contrib/llvm/tools/clang/include/clang/Basic/CommentNodes.td - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/CommentNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommentKinds.td - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/DiagnosticCommentKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/ObjCRuntime.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/ObjCRuntime.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteOptions.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Sema/CodeCompleteOptions.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h - copied unchanged from r239314, vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h - copied, changed from r239314, vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h head/contrib/llvm/tools/clang/include/clang/Tooling/ArgumentsAdjusters.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Tooling/ArgumentsAdjusters.h head/contrib/llvm/tools/clang/include/clang/Tooling/CommandLineClangTool.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Tooling/CommandLineClangTool.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Tooling/Refactoring.h head/contrib/llvm/tools/clang/include/clang/Tooling/RefactoringCallbacks.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Tooling/RefactoringCallbacks.h head/contrib/llvm/tools/clang/lib/AST/Comment.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/Comment.cpp head/contrib/llvm/tools/clang/lib/AST/CommentBriefParser.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentBriefParser.cpp head/contrib/llvm/tools/clang/lib/AST/CommentCommandTraits.cpp - copied, changed from r239314, vendor/clang/dist/lib/AST/CommentCommandTraits.cpp head/contrib/llvm/tools/clang/lib/AST/CommentDumper.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentDumper.cpp head/contrib/llvm/tools/clang/lib/AST/CommentLexer.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentLexer.cpp head/contrib/llvm/tools/clang/lib/AST/CommentParser.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentParser.cpp head/contrib/llvm/tools/clang/lib/AST/CommentSema.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentSema.cpp head/contrib/llvm/tools/clang/lib/AST/RawCommentList.cpp - copied, changed from r239314, vendor/clang/dist/lib/AST/RawCommentList.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/ - copied from r239314, vendor/clang/dist/lib/ASTMatchers/ head/contrib/llvm/tools/clang/lib/Basic/ConvertUTFWrapper.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Basic/ConvertUTFWrapper.cpp head/contrib/llvm/tools/clang/lib/Basic/ObjCRuntime.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Basic/ObjCRuntime.cpp head/contrib/llvm/tools/clang/lib/Headers/ammintrin.h - copied unchanged from r239314, vendor/clang/dist/lib/Headers/ammintrin.h head/contrib/llvm/tools/clang/lib/Headers/fmaintrin.h - copied unchanged from r239314, vendor/clang/dist/lib/Headers/fmaintrin.h head/contrib/llvm/tools/clang/lib/Headers/xopintrin.h - copied unchanged from r239314, vendor/clang/dist/lib/Headers/xopintrin.h head/contrib/llvm/tools/clang/lib/Rewrite/InclusionRewriter.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Rewrite/InclusionRewriter.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp - copied, changed from r239314, vendor/clang/dist/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp - copied unchanged from r239314, vendor/clang/dist/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp - copied unchanged from r239314, vendor/clang/dist/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/APSIntType.cpp - copied unchanged from r239314, vendor/clang/dist/lib/StaticAnalyzer/Core/APSIntType.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp - copied, changed from r239314, vendor/clang/dist/lib/StaticAnalyzer/Core/CallEvent.cpp head/contrib/llvm/tools/clang/lib/Tooling/ArgumentsAdjusters.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/ArgumentsAdjusters.cpp head/contrib/llvm/tools/clang/lib/Tooling/CommandLineClangTool.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/CommandLineClangTool.cpp head/contrib/llvm/tools/clang/lib/Tooling/CustomCompilationDatabase.h - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/CustomCompilationDatabase.h head/contrib/llvm/tools/clang/lib/Tooling/Refactoring.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/Refactoring.cpp head/contrib/llvm/tools/clang/lib/Tooling/RefactoringCallbacks.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/RefactoringCallbacks.cpp head/contrib/llvm/tools/clang/utils/TableGen/TableGenBackends.h - copied unchanged from r239314, vendor/clang/dist/utils/TableGen/TableGenBackends.h head/contrib/llvm/utils/TableGen/CodeGenSchedule.cpp - copied unchanged from r239314, vendor/llvm/dist/utils/TableGen/CodeGenSchedule.cpp head/contrib/llvm/utils/TableGen/CodeGenSchedule.h - copied unchanged from r239314, vendor/llvm/dist/utils/TableGen/CodeGenSchedule.h head/contrib/llvm/utils/TableGen/TableGenBackends.h - copied unchanged from r239314, vendor/llvm/dist/utils/TableGen/TableGenBackends.h head/lib/clang/include/MipsGenDisassemblerTables.inc (contents, props changed) head/lib/clang/include/MipsGenEDInfo.inc (contents, props changed) head/lib/clang/include/clang/AST/CommentNodes.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticCommentKinds.inc (contents, props changed) head/lib/clang/libllvmmipsdisassembler/ head/lib/clang/libllvmmipsdisassembler/Makefile (contents, props changed) Deleted: head/contrib/llvm/include/llvm/Analysis/DIBuilder.h head/contrib/llvm/include/llvm/Analysis/DebugInfo.h head/contrib/llvm/include/llvm/CodeGen/ProcessImplicitDefs.h head/contrib/llvm/include/llvm/IntrinsicsPTX.td head/contrib/llvm/include/llvm/Support/IRBuilder.h head/contrib/llvm/include/llvm/Support/MDBuilder.h head/contrib/llvm/include/llvm/Support/TypeBuilder.h head/contrib/llvm/include/llvm/Transforms/Utils/FunctionUtils.h head/contrib/llvm/lib/Analysis/DIBuilder.cpp head/contrib/llvm/lib/Analysis/DebugInfo.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.h head/contrib/llvm/lib/CodeGen/RenderMachineFunction.cpp head/contrib/llvm/lib/CodeGen/RenderMachineFunction.h head/contrib/llvm/lib/Target/Mips/MipsEmitGPRestore.cpp head/contrib/llvm/lib/Target/Mips/MipsExpandPseudo.cpp head/contrib/llvm/lib/Target/NVPTX/CMakeLists.txt head/contrib/llvm/lib/Target/NVPTX/InstPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/NVPTX/InstPrinter/LLVMBuild.txt head/contrib/llvm/lib/Target/NVPTX/LLVMBuild.txt head/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt head/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt head/contrib/llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/NVPTX/TargetInfo/LLVMBuild.txt head/contrib/llvm/lib/Target/PTX/InstPrinter/PTXInstPrinter.cpp head/contrib/llvm/lib/Target/PTX/InstPrinter/PTXInstPrinter.h head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXBaseInfo.h head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXMCAsmInfo.cpp head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXMCAsmInfo.h head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXMCTargetDesc.cpp head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXMCTargetDesc.h head/contrib/llvm/lib/Target/PTX/PTX.h head/contrib/llvm/lib/Target/PTX/PTX.td head/contrib/llvm/lib/Target/PTX/PTXAsmPrinter.cpp head/contrib/llvm/lib/Target/PTX/PTXAsmPrinter.h head/contrib/llvm/lib/Target/PTX/PTXFPRoundingModePass.cpp head/contrib/llvm/lib/Target/PTX/PTXFrameLowering.cpp head/contrib/llvm/lib/Target/PTX/PTXFrameLowering.h head/contrib/llvm/lib/Target/PTX/PTXISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PTX/PTXISelLowering.cpp head/contrib/llvm/lib/Target/PTX/PTXISelLowering.h head/contrib/llvm/lib/Target/PTX/PTXInstrFormats.td head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.h head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.td head/contrib/llvm/lib/Target/PTX/PTXInstrLoadStore.td head/contrib/llvm/lib/Target/PTX/PTXIntrinsicInstrInfo.td head/contrib/llvm/lib/Target/PTX/PTXMCAsmStreamer.cpp head/contrib/llvm/lib/Target/PTX/PTXMCInstLower.cpp head/contrib/llvm/lib/Target/PTX/PTXMFInfoExtract.cpp head/contrib/llvm/lib/Target/PTX/PTXMachineFunctionInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXMachineFunctionInfo.h head/contrib/llvm/lib/Target/PTX/PTXParamManager.cpp head/contrib/llvm/lib/Target/PTX/PTXParamManager.h head/contrib/llvm/lib/Target/PTX/PTXRegAlloc.cpp head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.h head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.td head/contrib/llvm/lib/Target/PTX/PTXSelectionDAGInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXSelectionDAGInfo.h head/contrib/llvm/lib/Target/PTX/PTXSubtarget.cpp head/contrib/llvm/lib/Target/PTX/PTXSubtarget.h head/contrib/llvm/lib/Target/PTX/PTXTargetMachine.cpp head/contrib/llvm/lib/Target/PTX/PTXTargetMachine.h head/contrib/llvm/lib/Target/PTX/TargetInfo/PTXTargetInfo.cpp head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsPTX.def head/contrib/llvm/tools/clang/include/clang/Driver/ObjCRuntime.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h head/contrib/llvm/tools/clang/lib/ASTMatchers/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Driver/CC1Options.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ObjCMessage.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangASTNodesEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/ClangDiagnosticsEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/ClangSACheckersEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.h head/contrib/llvm/tools/llvm-ld/ head/contrib/llvm/tools/llvm-stub/llvm-stub.c head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.h head/contrib/llvm/utils/TableGen/AsmWriterEmitter.h head/contrib/llvm/utils/TableGen/CallingConvEmitter.h head/contrib/llvm/utils/TableGen/CodeEmitterGen.h head/contrib/llvm/utils/TableGen/DAGISelEmitter.h head/contrib/llvm/utils/TableGen/DFAPacketizerEmitter.h head/contrib/llvm/utils/TableGen/DisassemblerEmitter.h head/contrib/llvm/utils/TableGen/EDEmitter.h head/contrib/llvm/utils/TableGen/FastISelEmitter.h head/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.h head/contrib/llvm/utils/TableGen/InstrInfoEmitter.h head/contrib/llvm/utils/TableGen/IntrinsicEmitter.h head/contrib/llvm/utils/TableGen/PseudoLoweringEmitter.h head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.h head/contrib/llvm/utils/TableGen/StringMatcher.cpp head/contrib/llvm/utils/TableGen/StringMatcher.h head/contrib/llvm/utils/TableGen/SubtargetEmitter.h head/lib/clang/include/clang/Driver/CC1Options.inc head/usr.bin/clang/llvm-ld/ head/usr.bin/clang/llvm-stub/ Modified: head/ObsoleteFiles.inc head/contrib/llvm/include/llvm-c/Core.h head/contrib/llvm/include/llvm-c/Disassembler.h head/contrib/llvm/include/llvm-c/Target.h head/contrib/llvm/include/llvm/ADT/APFloat.h head/contrib/llvm/include/llvm/ADT/APInt.h head/contrib/llvm/include/llvm/ADT/APSInt.h head/contrib/llvm/include/llvm/ADT/ArrayRef.h head/contrib/llvm/include/llvm/ADT/BitVector.h head/contrib/llvm/include/llvm/ADT/DenseMap.h head/contrib/llvm/include/llvm/ADT/DepthFirstIterator.h head/contrib/llvm/include/llvm/ADT/FoldingSet.h head/contrib/llvm/include/llvm/ADT/Hashing.h head/contrib/llvm/include/llvm/ADT/ImmutableSet.h head/contrib/llvm/include/llvm/ADT/IndexedMap.h head/contrib/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h head/contrib/llvm/include/llvm/ADT/PointerIntPair.h head/contrib/llvm/include/llvm/ADT/PointerUnion.h head/contrib/llvm/include/llvm/ADT/PostOrderIterator.h head/contrib/llvm/include/llvm/ADT/STLExtras.h head/contrib/llvm/include/llvm/ADT/SmallBitVector.h head/contrib/llvm/include/llvm/ADT/SmallString.h head/contrib/llvm/include/llvm/ADT/SmallVector.h head/contrib/llvm/include/llvm/ADT/SparseSet.h head/contrib/llvm/include/llvm/ADT/StringRef.h head/contrib/llvm/include/llvm/ADT/StringSwitch.h head/contrib/llvm/include/llvm/ADT/TinyPtrVector.h head/contrib/llvm/include/llvm/ADT/Triple.h head/contrib/llvm/include/llvm/ADT/ValueMap.h head/contrib/llvm/include/llvm/ADT/VariadicFunction.h head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/BlockFrequencyImpl.h head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h head/contrib/llvm/include/llvm/Analysis/CodeMetrics.h head/contrib/llvm/include/llvm/Analysis/Dominators.h head/contrib/llvm/include/llvm/Analysis/InlineCost.h head/contrib/llvm/include/llvm/Analysis/LoopInfo.h head/contrib/llvm/include/llvm/Analysis/LoopIterator.h head/contrib/llvm/include/llvm/Analysis/MemoryBuiltins.h head/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h head/contrib/llvm/include/llvm/Analysis/ProfileInfoLoader.h head/contrib/llvm/include/llvm/Analysis/RegionInfo.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h head/contrib/llvm/include/llvm/Analysis/ValueTracking.h head/contrib/llvm/include/llvm/Attributes.h head/contrib/llvm/include/llvm/Bitcode/Archive.h head/contrib/llvm/include/llvm/Bitcode/ReaderWriter.h head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h head/contrib/llvm/include/llvm/CodeGen/DFAPacketizer.h head/contrib/llvm/include/llvm/CodeGen/EdgeBundles.h head/contrib/llvm/include/llvm/CodeGen/FastISel.h head/contrib/llvm/include/llvm/CodeGen/GCMetadata.h head/contrib/llvm/include/llvm/CodeGen/GCStrategy.h head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h head/contrib/llvm/include/llvm/CodeGen/LexicalScopes.h head/contrib/llvm/include/llvm/CodeGen/LiveInterval.h head/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h head/contrib/llvm/include/llvm/CodeGen/LiveRangeEdit.h head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h head/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h head/contrib/llvm/include/llvm/CodeGen/MachineInstrBundle.h head/contrib/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineLoopInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineOperand.h head/contrib/llvm/include/llvm/CodeGen/MachinePassRegistry.h head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineScheduler.h head/contrib/llvm/include/llvm/CodeGen/Passes.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h head/contrib/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGISel.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h head/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h head/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.td head/contrib/llvm/include/llvm/Constant.h head/contrib/llvm/include/llvm/Constants.h head/contrib/llvm/include/llvm/DebugInfo/DIContext.h head/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h head/contrib/llvm/include/llvm/ExecutionEngine/Interpreter.h head/contrib/llvm/include/llvm/ExecutionEngine/JIT.h head/contrib/llvm/include/llvm/ExecutionEngine/MCJIT.h head/contrib/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h head/contrib/llvm/include/llvm/Function.h head/contrib/llvm/include/llvm/GlobalValue.h head/contrib/llvm/include/llvm/GlobalVariable.h head/contrib/llvm/include/llvm/InitializePasses.h head/contrib/llvm/include/llvm/Instruction.h head/contrib/llvm/include/llvm/Instructions.h head/contrib/llvm/include/llvm/Intrinsics.h head/contrib/llvm/include/llvm/Intrinsics.td head/contrib/llvm/include/llvm/IntrinsicsHexagon.td head/contrib/llvm/include/llvm/IntrinsicsX86.td head/contrib/llvm/include/llvm/LinkAllPasses.h head/contrib/llvm/include/llvm/MC/EDInstInfo.h head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/include/llvm/MC/MCAssembler.h head/contrib/llvm/include/llvm/MC/MCContext.h head/contrib/llvm/include/llvm/MC/MCDirectives.h head/contrib/llvm/include/llvm/MC/MCDisassembler.h head/contrib/llvm/include/llvm/MC/MCELFObjectWriter.h head/contrib/llvm/include/llvm/MC/MCExpr.h head/contrib/llvm/include/llvm/MC/MCFixupKindInfo.h head/contrib/llvm/include/llvm/MC/MCInstrDesc.h head/contrib/llvm/include/llvm/MC/MCInstrItineraries.h head/contrib/llvm/include/llvm/MC/MCMachObjectWriter.h head/contrib/llvm/include/llvm/MC/MCObjectFileInfo.h head/contrib/llvm/include/llvm/MC/MCObjectWriter.h head/contrib/llvm/include/llvm/MC/MCRegisterInfo.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/include/llvm/MC/MCSubtargetInfo.h head/contrib/llvm/include/llvm/MC/MCTargetAsmLexer.h head/contrib/llvm/include/llvm/MC/MCTargetAsmParser.h head/contrib/llvm/include/llvm/MC/MachineLocation.h head/contrib/llvm/include/llvm/MC/SubtargetFeature.h head/contrib/llvm/include/llvm/Metadata.h head/contrib/llvm/include/llvm/Module.h head/contrib/llvm/include/llvm/Object/Binary.h head/contrib/llvm/include/llvm/Object/COFF.h head/contrib/llvm/include/llvm/Object/ELF.h head/contrib/llvm/include/llvm/Object/MachOFormat.h head/contrib/llvm/include/llvm/Object/MachOObject.h head/contrib/llvm/include/llvm/Object/ObjectFile.h head/contrib/llvm/include/llvm/PassManagers.h head/contrib/llvm/include/llvm/Support/AlignOf.h head/contrib/llvm/include/llvm/Support/COFF.h head/contrib/llvm/include/llvm/Support/CallSite.h head/contrib/llvm/include/llvm/Support/CommandLine.h head/contrib/llvm/include/llvm/Support/Compiler.h head/contrib/llvm/include/llvm/Support/ConstantRange.h head/contrib/llvm/include/llvm/Support/DataTypes.h.in head/contrib/llvm/include/llvm/Support/Debug.h head/contrib/llvm/include/llvm/Support/DebugLoc.h head/contrib/llvm/include/llvm/Support/ELF.h head/contrib/llvm/include/llvm/Support/Endian.h head/contrib/llvm/include/llvm/Support/FileSystem.h head/contrib/llvm/include/llvm/Support/GCOV.h head/contrib/llvm/include/llvm/Support/GraphWriter.h head/contrib/llvm/include/llvm/Support/InstVisitor.h head/contrib/llvm/include/llvm/Support/MachO.h head/contrib/llvm/include/llvm/Support/MathExtras.h head/contrib/llvm/include/llvm/Support/NoFolder.h head/contrib/llvm/include/llvm/Support/PathV2.h head/contrib/llvm/include/llvm/Support/Process.h head/contrib/llvm/include/llvm/Support/SMLoc.h head/contrib/llvm/include/llvm/Support/SourceMgr.h head/contrib/llvm/include/llvm/Support/TargetRegistry.h head/contrib/llvm/include/llvm/Support/ThreadLocal.h head/contrib/llvm/include/llvm/Support/ValueHandle.h head/contrib/llvm/include/llvm/Support/YAMLParser.h head/contrib/llvm/include/llvm/Support/raw_ostream.h head/contrib/llvm/include/llvm/Support/type_traits.h head/contrib/llvm/include/llvm/TableGen/Record.h head/contrib/llvm/include/llvm/TableGen/TableGenBackend.h head/contrib/llvm/include/llvm/Target/Target.td head/contrib/llvm/include/llvm/Target/TargetCallingConv.h head/contrib/llvm/include/llvm/Target/TargetData.h head/contrib/llvm/include/llvm/Target/TargetELFWriterInfo.h head/contrib/llvm/include/llvm/Target/TargetInstrInfo.h head/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h head/contrib/llvm/include/llvm/Target/TargetLowering.h head/contrib/llvm/include/llvm/Target/TargetMachine.h head/contrib/llvm/include/llvm/Target/TargetOptions.h head/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h head/contrib/llvm/include/llvm/Target/TargetSchedule.td head/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td head/contrib/llvm/include/llvm/Transforms/Instrumentation.h head/contrib/llvm/include/llvm/Transforms/Scalar.h head/contrib/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h head/contrib/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h head/contrib/llvm/include/llvm/Transforms/Utils/Local.h head/contrib/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h head/contrib/llvm/include/llvm/Transforms/Vectorize.h head/contrib/llvm/include/llvm/User.h head/contrib/llvm/lib/Analysis/AliasAnalysis.cpp head/contrib/llvm/lib/Analysis/AliasSetTracker.cpp head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp head/contrib/llvm/lib/Analysis/CaptureTracking.cpp head/contrib/llvm/lib/Analysis/CodeMetrics.cpp head/contrib/llvm/lib/Analysis/ConstantFolding.cpp head/contrib/llvm/lib/Analysis/DbgInfoPrinter.cpp head/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp head/contrib/llvm/lib/Analysis/IPA/GlobalsModRef.cpp head/contrib/llvm/lib/Analysis/IVUsers.cpp head/contrib/llvm/lib/Analysis/InlineCost.cpp head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp head/contrib/llvm/lib/Analysis/LoopInfo.cpp head/contrib/llvm/lib/Analysis/LoopPass.cpp head/contrib/llvm/lib/Analysis/MemDepPrinter.cpp head/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp head/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp head/contrib/llvm/lib/Analysis/PathNumbering.cpp head/contrib/llvm/lib/Analysis/ProfileInfoLoader.cpp head/contrib/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp head/contrib/llvm/lib/Analysis/RegionInfo.cpp head/contrib/llvm/lib/Analysis/RegionPass.cpp head/contrib/llvm/lib/Analysis/RegionPrinter.cpp head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp head/contrib/llvm/lib/Analysis/ValueTracking.cpp head/contrib/llvm/lib/Archive/ArchiveReader.cpp head/contrib/llvm/lib/Archive/ArchiveWriter.cpp head/contrib/llvm/lib/AsmParser/LLLexer.cpp head/contrib/llvm/lib/AsmParser/LLParser.cpp head/contrib/llvm/lib/AsmParser/LLParser.h head/contrib/llvm/lib/AsmParser/LLToken.h head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/AllocationOrder.cpp head/contrib/llvm/lib/CodeGen/Analysis.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h head/contrib/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp head/contrib/llvm/lib/CodeGen/CallingConvLower.cpp head/contrib/llvm/lib/CodeGen/CodeGen.cpp head/contrib/llvm/lib/CodeGen/CodePlacementOpt.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/DFAPacketizer.cpp head/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp head/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp head/contrib/llvm/lib/CodeGen/ExecutionDepsFix.cpp head/contrib/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp head/contrib/llvm/lib/CodeGen/IfConversion.cpp head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.h head/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp head/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp head/contrib/llvm/lib/CodeGen/LexicalScopes.cpp head/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp head/contrib/llvm/lib/CodeGen/LiveInterval.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalUnion.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalUnion.h head/contrib/llvm/lib/CodeGen/LiveRangeCalc.cpp head/contrib/llvm/lib/CodeGen/LiveRangeCalc.h head/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp head/contrib/llvm/lib/CodeGen/LiveVariables.cpp head/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/CodeGen/MachineBlockPlacement.cpp head/contrib/llvm/lib/CodeGen/MachineCSE.cpp head/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp head/contrib/llvm/lib/CodeGen/MachineInstr.cpp head/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp head/contrib/llvm/lib/CodeGen/MachineLICM.cpp head/contrib/llvm/lib/CodeGen/MachineLoopInfo.cpp head/contrib/llvm/lib/CodeGen/MachinePassRegistry.cpp head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/MachineSSAUpdater.cpp head/contrib/llvm/lib/CodeGen/MachineScheduler.cpp head/contrib/llvm/lib/CodeGen/MachineSink.cpp head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp head/contrib/llvm/lib/CodeGen/PHIElimination.cpp head/contrib/llvm/lib/CodeGen/Passes.cpp head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp head/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp head/contrib/llvm/lib/CodeGen/ProcessImplicitDefs.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.h head/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp head/contrib/llvm/lib/CodeGen/RegAllocFast.cpp head/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp head/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.h head/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAG.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp head/contrib/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm/lib/CodeGen/ShadowStackGC.cpp head/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp head/contrib/llvm/lib/CodeGen/SlotIndexes.cpp head/contrib/llvm/lib/CodeGen/SpillPlacement.cpp head/contrib/llvm/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/StackProtector.cpp head/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp head/contrib/llvm/lib/CodeGen/StrongPHIElimination.cpp head/contrib/llvm/lib/CodeGen/TailDuplication.cpp head/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp head/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp head/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.h head/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.cpp head/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.h head/contrib/llvm/lib/DebugInfo/DWARFContext.cpp head/contrib/llvm/lib/DebugInfo/DWARFContext.h head/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h head/contrib/llvm/lib/DebugInfo/DWARFDebugLine.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugLine.h head/contrib/llvm/lib/ExecutionEngine/EventListenerCommon.h head/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp head/contrib/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h head/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImage.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h head/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp head/contrib/llvm/lib/Linker/LinkModules.cpp head/contrib/llvm/lib/MC/ELFObjectWriter.cpp head/contrib/llvm/lib/MC/MCAsmBackend.cpp head/contrib/llvm/lib/MC/MCAsmInfo.cpp head/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp head/contrib/llvm/lib/MC/MCAsmStreamer.cpp head/contrib/llvm/lib/MC/MCAssembler.cpp head/contrib/llvm/lib/MC/MCContext.cpp head/contrib/llvm/lib/MC/MCDisassembler/Disassembler.h head/contrib/llvm/lib/MC/MCDisassembler/EDDisassembler.cpp head/contrib/llvm/lib/MC/MCDisassembler/EDMain.cpp head/contrib/llvm/lib/MC/MCDwarf.cpp head/contrib/llvm/lib/MC/MCELFObjectTargetWriter.cpp head/contrib/llvm/lib/MC/MCELFStreamer.cpp head/contrib/llvm/lib/MC/MCExpr.cpp head/contrib/llvm/lib/MC/MCMachOStreamer.cpp head/contrib/llvm/lib/MC/MCNullStreamer.cpp head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp head/contrib/llvm/lib/MC/MCObjectWriter.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp head/contrib/llvm/lib/MC/MCPureStreamer.cpp head/contrib/llvm/lib/MC/MCSectionCOFF.cpp head/contrib/llvm/lib/MC/MCSectionELF.cpp head/contrib/llvm/lib/MC/MCStreamer.cpp head/contrib/llvm/lib/MC/MCSubtargetInfo.cpp head/contrib/llvm/lib/MC/MCSymbol.cpp head/contrib/llvm/lib/MC/MCWin64EH.cpp head/contrib/llvm/lib/MC/MachObjectWriter.cpp head/contrib/llvm/lib/MC/SubtargetFeature.cpp head/contrib/llvm/lib/MC/WinCOFFStreamer.cpp head/contrib/llvm/lib/Object/Archive.cpp head/contrib/llvm/lib/Object/COFFObjectFile.cpp head/contrib/llvm/lib/Object/MachOObject.cpp head/contrib/llvm/lib/Object/MachOObjectFile.cpp head/contrib/llvm/lib/Support/APFloat.cpp head/contrib/llvm/lib/Support/APInt.cpp head/contrib/llvm/lib/Support/CommandLine.cpp head/contrib/llvm/lib/Support/ConstantRange.cpp head/contrib/llvm/lib/Support/CrashRecoveryContext.cpp head/contrib/llvm/lib/Support/Debug.cpp head/contrib/llvm/lib/Support/Errno.cpp head/contrib/llvm/lib/Support/GraphWriter.cpp head/contrib/llvm/lib/Support/Host.cpp head/contrib/llvm/lib/Support/Memory.cpp head/contrib/llvm/lib/Support/MemoryBuffer.cpp head/contrib/llvm/lib/Support/Mutex.cpp head/contrib/llvm/lib/Support/Path.cpp head/contrib/llvm/lib/Support/PathV2.cpp head/contrib/llvm/lib/Support/SourceMgr.cpp head/contrib/llvm/lib/Support/StreamableMemoryObject.cpp head/contrib/llvm/lib/Support/StringMap.cpp head/contrib/llvm/lib/Support/StringRef.cpp head/contrib/llvm/lib/Support/TargetRegistry.cpp head/contrib/llvm/lib/Support/ThreadLocal.cpp head/contrib/llvm/lib/Support/Triple.cpp head/contrib/llvm/lib/Support/Unix/Path.inc head/contrib/llvm/lib/Support/Unix/PathV2.inc head/contrib/llvm/lib/Support/Unix/Process.inc head/contrib/llvm/lib/Support/Unix/Signals.inc head/contrib/llvm/lib/Support/Unix/Unix.h head/contrib/llvm/lib/Support/Windows/Path.inc head/contrib/llvm/lib/Support/Windows/PathV2.inc head/contrib/llvm/lib/Support/Windows/Process.inc head/contrib/llvm/lib/Support/Windows/RWMutex.inc head/contrib/llvm/lib/Support/Windows/ThreadLocal.inc head/contrib/llvm/lib/Support/YAMLParser.cpp head/contrib/llvm/lib/Support/raw_ostream.cpp head/contrib/llvm/lib/TableGen/Main.cpp head/contrib/llvm/lib/TableGen/Record.cpp head/contrib/llvm/lib/TableGen/TGParser.cpp head/contrib/llvm/lib/TableGen/TGParser.h head/contrib/llvm/lib/TableGen/TableGenBackend.cpp head/contrib/llvm/lib/Target/ARM/ARM.td head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td head/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.h head/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td head/contrib/llvm/lib/Target/ARM/ARMInstrVFP.td head/contrib/llvm/lib/Target/ARM/ARMJITInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td head/contrib/llvm/lib/Target/ARM/ARMSchedule.td head/contrib/llvm/lib/Target/ARM/ARMScheduleA8.td head/contrib/llvm/lib/Target/ARM/ARMScheduleA9.td head/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.h head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.h head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp head/contrib/llvm/lib/Target/ARM/MLxExpansionPass.cpp head/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.h head/contrib/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp head/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.h head/contrib/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp head/contrib/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp head/contrib/llvm/lib/Target/CellSPU/SPUHazardRecognizers.cpp head/contrib/llvm/lib/Target/CellSPU/SPUHazardRecognizers.h head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.h head/contrib/llvm/lib/Target/CellSPU/SPUInstrInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPUInstrInfo.td head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h head/contrib/llvm/lib/Target/CellSPU/SPUTargetMachine.cpp head/contrib/llvm/lib/Target/CppBackend/CPPBackend.cpp head/contrib/llvm/lib/Target/CppBackend/CPPTargetMachine.h head/contrib/llvm/lib/Target/Hexagon/Hexagon.h head/contrib/llvm/lib/Target/Hexagon/Hexagon.td head/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonCallingConv.td head/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonExpandPredSpillCode.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.h head/contrib/llvm/lib/Target/Hexagon/HexagonImmediates.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormats.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormatsV4.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV3.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td head/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsics.td head/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsicsDerived.td head/contrib/llvm/lib/Target/Hexagon/HexagonMCInstLower.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.td head/contrib/llvm/lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSchedule.td head/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV4.td head/contrib/llvm/lib/Target/Hexagon/HexagonSplitTFRCondSets.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h head/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp head/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.cpp head/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h head/contrib/llvm/lib/Target/MBlaze/MBlaze.td head/contrib/llvm/lib/Target/MBlaze/MBlazeAsmPrinter.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td head/contrib/llvm/lib/Target/MBlaze/MBlazeMCInstLower.h head/contrib/llvm/lib/Target/MBlaze/MBlazeSchedule.td head/contrib/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp head/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeMCCodeEmitter.cpp head/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.h head/contrib/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.td head/contrib/llvm/lib/Target/MSP430/MSP430MCInstLower.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td head/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp head/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp head/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp head/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsBaseInfo.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsFixupKinds.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.h head/contrib/llvm/lib/Target/Mips/Mips.h head/contrib/llvm/lib/Target/Mips/Mips.td head/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/MipsCallingConv.td head/contrib/llvm/lib/Target/Mips/MipsCodeEmitter.cpp head/contrib/llvm/lib/Target/Mips/MipsCondMov.td head/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp head/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h head/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td head/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsJITInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsJITInfo.h head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.cpp head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.h head/contrib/llvm/lib/Target/Mips/MipsMachineFunction.cpp head/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td head/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp head/contrib/llvm/lib/Target/Mips/MipsSubtarget.h head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h head/contrib/llvm/lib/Target/PowerPC/PPC.h head/contrib/llvm/lib/Target/PowerPC/PPC.td head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h head/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrAltivec.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrFormats.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCJITInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCSchedule.td head/contrib/llvm/lib/Target/PowerPC/PPCSchedule440.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleA2.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleG3.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleG4.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleG5.td head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp head/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp head/contrib/llvm/lib/Target/Sparc/SparcAsmPrinter.cpp head/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.h head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.h head/contrib/llvm/lib/Target/TargetData.cpp head/contrib/llvm/lib/Target/TargetInstrInfo.cpp head/contrib/llvm/lib/Target/TargetLibraryInfo.cpp head/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp head/contrib/llvm/lib/Target/TargetMachine.cpp head/contrib/llvm/lib/Target/TargetRegisterInfo.cpp head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.h head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h head/contrib/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h head/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp head/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h head/contrib/llvm/lib/Target/X86/X86.h head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/X86AsmPrinter.h head/contrib/llvm/lib/Target/X86/X86COFFMachineModuleInfo.cpp head/contrib/llvm/lib/Target/X86/X86COFFMachineModuleInfo.h head/contrib/llvm/lib/Target/X86/X86CallingConv.td head/contrib/llvm/lib/Target/X86/X86CodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.h head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86InstrArithmetic.td head/contrib/llvm/lib/Target/X86/X86InstrBuilder.h head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Target/X86/X86InstrControl.td head/contrib/llvm/lib/Target/X86/X86InstrExtension.td head/contrib/llvm/lib/Target/X86/X86InstrFMA.td head/contrib/llvm/lib/Target/X86/X86InstrFPStack.td head/contrib/llvm/lib/Target/X86/X86InstrFormats.td head/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrMMX.td head/contrib/llvm/lib/Target/X86/X86InstrSSE.td head/contrib/llvm/lib/Target/X86/X86InstrSystem.td head/contrib/llvm/lib/Target/X86/X86InstrVMX.td head/contrib/llvm/lib/Target/X86/X86InstrXOP.td head/contrib/llvm/lib/Target/X86/X86JITInfo.h head/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp head/contrib/llvm/lib/Target/X86/X86MCInstLower.h head/contrib/llvm/lib/Target/X86/X86MachineFunctionInfo.h head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.h head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86Relocations.h head/contrib/llvm/lib/Target/X86/X86Schedule.td head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td head/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.h head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/lib/Target/X86/X86TargetObjectFile.cpp head/contrib/llvm/lib/Target/X86/X86TargetObjectFile.h head/contrib/llvm/lib/Target/X86/X86VZeroUpper.cpp head/contrib/llvm/lib/Target/XCore/XCoreAsmPrinter.cpp head/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.h head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h head/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp head/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp head/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp head/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalDCE.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm/lib/Transforms/IPO/Inliner.cpp head/contrib/llvm/lib/Transforms/IPO/LoopExtractor.cpp head/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp head/contrib/llvm/lib/Transforms/IPO/PartialInlining.cpp head/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp head/contrib/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp head/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp head/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp head/contrib/llvm/lib/Transforms/Scalar/ADCE.cpp head/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp head/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp head/contrib/llvm/lib/Transforms/Scalar/EarlyCSE.cpp head/contrib/llvm/lib/Transforms/Scalar/GVN.cpp head/contrib/llvm/lib/Transforms/Scalar/GlobalMerge.cpp head/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp head/contrib/llvm/lib/Transforms/Scalar/LowerAtomic.cpp head/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp head/contrib/llvm/lib/Transforms/Scalar/ObjCARC.cpp head/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp head/contrib/llvm/lib/Transforms/Scalar/Reg2Mem.cpp head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp head/contrib/llvm/lib/Transforms/Scalar/Scalar.cpp head/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp head/contrib/llvm/lib/Transforms/Scalar/Sink.cpp head/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp head/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp head/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp head/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp head/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp head/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp head/contrib/llvm/lib/Transforms/Utils/CodeExtractor.cpp head/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp head/contrib/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp head/contrib/llvm/lib/Transforms/Utils/LowerSwitch.cpp head/contrib/llvm/lib/Transforms/Utils/ModuleUtils.cpp head/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp head/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp head/contrib/llvm/lib/Transforms/Vectorize/BBVectorize.cpp head/contrib/llvm/lib/VMCore/AsmWriter.cpp head/contrib/llvm/lib/VMCore/Attributes.cpp head/contrib/llvm/lib/VMCore/AutoUpgrade.cpp head/contrib/llvm/lib/VMCore/ConstantFold.cpp head/contrib/llvm/lib/VMCore/Constants.cpp head/contrib/llvm/lib/VMCore/Core.cpp head/contrib/llvm/lib/VMCore/DebugLoc.cpp head/contrib/llvm/lib/VMCore/Dominators.cpp head/contrib/llvm/lib/VMCore/Function.cpp head/contrib/llvm/lib/VMCore/GCOV.cpp head/contrib/llvm/lib/VMCore/Globals.cpp head/contrib/llvm/lib/VMCore/IRBuilder.cpp head/contrib/llvm/lib/VMCore/Instruction.cpp head/contrib/llvm/lib/VMCore/Instructions.cpp head/contrib/llvm/lib/VMCore/Metadata.cpp head/contrib/llvm/lib/VMCore/Module.cpp head/contrib/llvm/lib/VMCore/PassManager.cpp head/contrib/llvm/lib/VMCore/Type.cpp head/contrib/llvm/lib/VMCore/Value.cpp head/contrib/llvm/lib/VMCore/ValueTypes.cpp head/contrib/llvm/lib/VMCore/Verifier.cpp head/contrib/llvm/tools/bugpoint/BugDriver.cpp head/contrib/llvm/tools/bugpoint/ExtractFunction.cpp head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/AST/ASTImporter.h head/contrib/llvm/tools/clang/include/clang/AST/ASTVector.h head/contrib/llvm/tools/clang/include/clang/AST/Attr.h head/contrib/llvm/tools/clang/include/clang/AST/BaseSubobject.h head/contrib/llvm/tools/clang/include/clang/AST/CXXInheritance.h head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h head/contrib/llvm/tools/clang/include/clang/AST/DeclContextInternals.h head/contrib/llvm/tools/clang/include/clang/AST/DeclFriend.h head/contrib/llvm/tools/clang/include/clang/AST/DeclGroup.h head/contrib/llvm/tools/clang/include/clang/AST/DeclLookups.h head/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h head/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h head/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h head/contrib/llvm/tools/clang/include/clang/AST/EvaluatedExprVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Expr.h head/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h head/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h head/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h head/contrib/llvm/tools/clang/include/clang/AST/Mangle.h head/contrib/llvm/tools/clang/include/clang/AST/NSAPI.h head/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h head/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.h head/contrib/llvm/tools/clang/include/clang/AST/PrettyPrinter.h head/contrib/llvm/tools/clang/include/clang/AST/RecordLayout.h head/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Redeclarable.h head/contrib/llvm/tools/clang/include/clang/AST/Stmt.h head/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h head/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h head/contrib/llvm/tools/clang/include/clang/AST/Type.h head/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchers.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafety.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/UninitializedValues.h head/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h head/contrib/llvm/tools/clang/include/clang/Analysis/CFG.h head/contrib/llvm/tools/clang/include/clang/Analysis/CallGraph.h head/contrib/llvm/tools/clang/include/clang/Analysis/ProgramPoint.h head/contrib/llvm/tools/clang/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h head/contrib/llvm/tools/clang/include/clang/Basic/ABI.h head/contrib/llvm/tools/clang/include/clang/Basic/AddressSpaces.h head/contrib/llvm/tools/clang/include/clang/Basic/AllDiagnostics.h head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td head/contrib/llvm/tools/clang/include/clang/Basic/AttrKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsHexagon.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def head/contrib/llvm/tools/clang/include/clang/Basic/ConvertUTF.h head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSerializationKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/ExceptionSpecificationType.h head/contrib/llvm/tools/clang/include/clang/Basic/ExpressionTraits.h head/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h head/contrib/llvm/tools/clang/include/clang/Basic/FileSystemOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/FileSystemStatCache.h head/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h head/contrib/llvm/tools/clang/include/clang/Basic/LLVM.h head/contrib/llvm/tools/clang/include/clang/Basic/Lambda.h head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/Linkage.h head/contrib/llvm/tools/clang/include/clang/Basic/MacroBuilder.h head/contrib/llvm/tools/clang/include/clang/Basic/Module.h head/contrib/llvm/tools/clang/include/clang/Basic/OnDiskHashTable.h head/contrib/llvm/tools/clang/include/clang/Basic/OpenCL.h head/contrib/llvm/tools/clang/include/clang/Basic/OperatorKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/PartialDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/PrettyStackTrace.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManagerInternals.h head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h head/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/TargetBuiltins.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/TemplateKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h head/contrib/llvm/tools/clang/include/clang/Basic/Version.h head/contrib/llvm/tools/clang/include/clang/Basic/VersionTuple.h head/contrib/llvm/tools/clang/include/clang/Basic/Visibility.h head/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td head/contrib/llvm/tools/clang/include/clang/Driver/Arg.h head/contrib/llvm/tools/clang/include/clang/Driver/ArgList.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h head/contrib/llvm/tools/clang/include/clang/Driver/Driver.h head/contrib/llvm/tools/clang/include/clang/Driver/OptParser.td head/contrib/llvm/tools/clang/include/clang/Driver/OptTable.h head/contrib/llvm/tools/clang/include/clang/Driver/Option.h head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h head/contrib/llvm/tools/clang/include/clang/Driver/Types.def head/contrib/llvm/tools/clang/include/clang/Driver/Types.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTConsumers.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h head/contrib/llvm/tools/clang/include/clang/Frontend/Analyses.def head/contrib/llvm/tools/clang/include/clang/Frontend/AnalyzerOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInstance.h head/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInvocation.h head/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticRenderer.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendAction.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/HeaderSearchOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def head/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOutputOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticPrinter.h head/contrib/llvm/tools/clang/include/clang/Frontend/VerifyDiagnosticConsumer.h head/contrib/llvm/tools/clang/include/clang/Lex/CodeCompletionHandler.h head/contrib/llvm/tools/clang/include/clang/Lex/DirectoryLookup.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderMap.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h head/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h head/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h head/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h head/contrib/llvm/tools/clang/include/clang/Lex/ModuleMap.h head/contrib/llvm/tools/clang/include/clang/Lex/MultipleIncludeOpt.h head/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h head/contrib/llvm/tools/clang/include/clang/Lex/PTHManager.h head/contrib/llvm/tools/clang/include/clang/Lex/Pragma.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorLexer.h head/contrib/llvm/tools/clang/include/clang/Lex/Token.h head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Rewrite/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Rewrite/Rewriter.h head/contrib/llvm/tools/clang/include/clang/Rewrite/Rewriters.h head/contrib/llvm/tools/clang/include/clang/Rewrite/TokenRewriter.h head/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/DelayedDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Sema/Designator.h head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h head/contrib/llvm/tools/clang/include/clang/Sema/Overload.h head/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h head/contrib/llvm/tools/clang/include/clang/Sema/Scope.h head/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/include/clang/Sema/Template.h head/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h head/contrib/llvm/tools/clang/include/clang/Sema/Weak.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h head/contrib/llvm/tools/clang/include/clang/Tooling/CompilationDatabase.h head/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h head/contrib/llvm/tools/clang/lib/ARCMigrate/ARCMT.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/FileRemapper.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/Internals.h head/contrib/llvm/tools/clang/lib/ARCMigrate/ObjCMT.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransAPIUses.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransARCAssign.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransAutoreleasePool.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransBlockObjCVariable.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransGCAttrs.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransGCCalls.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnusedInitDelegate.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransformActions.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.h head/contrib/llvm/tools/clang/lib/AST/APValue.cpp head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/CXXABI.h head/contrib/llvm/tools/clang/lib/AST/CXXInheritance.cpp head/contrib/llvm/tools/clang/lib/AST/Decl.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp head/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp head/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp head/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp head/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp head/contrib/llvm/tools/clang/lib/AST/Expr.cpp head/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp head/contrib/llvm/tools/clang/lib/AST/LambdaMangleContext.cpp head/contrib/llvm/tools/clang/lib/AST/Mangle.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp head/contrib/llvm/tools/clang/lib/AST/NSAPI.cpp head/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp head/contrib/llvm/tools/clang/lib/AST/ParentMap.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayout.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/Stmt.cpp head/contrib/llvm/tools/clang/lib/AST/StmtDumper.cpp head/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp head/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/AST/TypeLoc.cpp head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp head/contrib/llvm/tools/clang/lib/AST/VTTBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/VTableBuilder.cpp head/contrib/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp head/contrib/llvm/tools/clang/lib/Analysis/CallGraph.cpp head/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp head/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ProgramPoint.cpp head/contrib/llvm/tools/clang/lib/Analysis/PseudoConstantAnalysis.cpp head/contrib/llvm/tools/clang/lib/Analysis/ScanfFormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp head/contrib/llvm/tools/clang/lib/Basic/ConvertUTF.c head/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp head/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp head/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp head/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp head/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/Basic/VersionTuple.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBuilder.h head/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRTTI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayout.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/ArgList.cpp head/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp head/contrib/llvm/tools/clang/lib/Driver/OptTable.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.h head/contrib/llvm/tools/clang/lib/Driver/Types.cpp head/contrib/llvm/tools/clang/lib/Edit/Commit.cpp head/contrib/llvm/tools/clang/lib/Edit/EditedSource.cpp head/contrib/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp head/contrib/llvm/tools/clang/lib/Frontend/CacheTokens.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp head/contrib/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp head/contrib/llvm/tools/clang/lib/Frontend/LayoutOverrideSource.cpp head/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp head/contrib/llvm/tools/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp head/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h head/contrib/llvm/tools/clang/lib/Headers/bmiintrin.h head/contrib/llvm/tools/clang/lib/Headers/emmintrin.h head/contrib/llvm/tools/clang/lib/Headers/float.h head/contrib/llvm/tools/clang/lib/Headers/immintrin.h head/contrib/llvm/tools/clang/lib/Headers/stddef.h head/contrib/llvm/tools/clang/lib/Headers/wmmintrin.h head/contrib/llvm/tools/clang/lib/Headers/x86intrin.h head/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp head/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp head/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp head/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp head/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp head/contrib/llvm/tools/clang/lib/Lex/PTHLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp head/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessorLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenConcatenation.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp head/contrib/llvm/tools/clang/lib/Parse/ParsePragma.h head/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp head/contrib/llvm/tools/clang/lib/Parse/RAIIObjectsForParser.h head/contrib/llvm/tools/clang/lib/Rewrite/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Rewrite/HTMLRewrite.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteModernObjC.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Rewriter.cpp head/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp head/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp head/contrib/llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaFixItUtils.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLambda.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaPseudoObject.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmtAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Sema/TargetAttributesSema.cpp head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h head/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.h head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporter.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/MemRegion.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ProgramState.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SVals.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Store.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp head/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp head/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp head/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp head/contrib/llvm/tools/clang/tools/driver/driver.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangASTNodesEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangSACheckersEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/TableGen.cpp head/contrib/llvm/tools/llc/llc.cpp head/contrib/llvm/tools/lli/lli.cpp head/contrib/llvm/tools/llvm-ar/llvm-ar.cpp head/contrib/llvm/tools/llvm-diff/DiffConsumer.cpp head/contrib/llvm/tools/llvm-diff/DiffConsumer.h head/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp head/contrib/llvm/tools/llvm-diff/DifferenceEngine.h head/contrib/llvm/tools/llvm-diff/llvm-diff.cpp head/contrib/llvm/tools/llvm-dis/llvm-dis.cpp head/contrib/llvm/tools/llvm-mc/llvm-mc.cpp head/contrib/llvm/tools/llvm-nm/llvm-nm.cpp head/contrib/llvm/tools/llvm-objdump/MachODump.cpp head/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp head/contrib/llvm/tools/llvm-prof/llvm-prof.cpp head/contrib/llvm/tools/llvm-ranlib/llvm-ranlib.cpp head/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp head/contrib/llvm/tools/llvm-stress/llvm-stress.cpp head/contrib/llvm/tools/macho-dump/macho-dump.cpp head/contrib/llvm/tools/opt/opt.cpp head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp head/contrib/llvm/utils/TableGen/CallingConvEmitter.cpp head/contrib/llvm/utils/TableGen/CodeEmitterGen.cpp head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.h head/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h head/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp head/contrib/llvm/utils/TableGen/CodeGenRegisters.h head/contrib/llvm/utils/TableGen/CodeGenTarget.cpp head/contrib/llvm/utils/TableGen/CodeGenTarget.h head/contrib/llvm/utils/TableGen/DAGISelEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcher.h head/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp head/contrib/llvm/utils/TableGen/DFAPacketizerEmitter.cpp head/contrib/llvm/utils/TableGen/DisassemblerEmitter.cpp head/contrib/llvm/utils/TableGen/EDEmitter.cpp head/contrib/llvm/utils/TableGen/FastISelEmitter.cpp head/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp head/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp head/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp head/contrib/llvm/utils/TableGen/PseudoLoweringEmitter.cpp head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp head/contrib/llvm/utils/TableGen/SequenceToOffsetTable.h head/contrib/llvm/utils/TableGen/SetTheory.cpp head/contrib/llvm/utils/TableGen/StringToOffsetTable.h head/contrib/llvm/utils/TableGen/SubtargetEmitter.cpp head/contrib/llvm/utils/TableGen/TableGen.cpp head/contrib/llvm/utils/TableGen/X86DisassemblerShared.h head/contrib/llvm/utils/TableGen/X86DisassemblerTables.cpp head/contrib/llvm/utils/TableGen/X86DisassemblerTables.h head/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.h head/etc/mtree/BSD.include.dist head/lib/clang/Makefile head/lib/clang/clang.build.mk head/lib/clang/include/Makefile head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/llvm/Config/AsmParsers.def head/lib/clang/include/llvm/Config/Disassemblers.def head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/libclanganalysis/Makefile head/lib/clang/libclangarcmigrate/Makefile head/lib/clang/libclangast/Makefile head/lib/clang/libclangbasic/Makefile head/lib/clang/libclangcodegen/Makefile head/lib/clang/libclangdriver/Makefile head/lib/clang/libclangedit/Makefile head/lib/clang/libclangfrontend/Makefile head/lib/clang/libclangfrontendtool/Makefile head/lib/clang/libclangparse/Makefile head/lib/clang/libclangrewrite/Makefile head/lib/clang/libclangsema/Makefile head/lib/clang/libclangserialization/Makefile head/lib/clang/libclangstaticanalyzercheckers/Makefile head/lib/clang/libclangstaticanalyzercore/Makefile head/lib/clang/libclangstaticanalyzerfrontend/Makefile head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmcodegen/Makefile head/lib/clang/libllvmcore/Makefile head/lib/clang/libllvminstrumentation/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmmipscodegen/Makefile head/lib/clang/libllvmmipsinstprinter/Makefile head/lib/clang/libllvmpowerpccodegen/Makefile head/lib/clang/libllvmtablegen/Makefile head/sys/conf/files head/sys/conf/kern.mk head/sys/modules/ath/Makefile head/sys/modules/bwn/Makefile head/sys/modules/ips/Makefile head/sys/modules/mps/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile head/usr.bin/clang/bugpoint/bugpoint.1 head/usr.bin/clang/clang-tblgen/Makefile head/usr.bin/clang/clang/Makefile head/usr.bin/clang/clang/clang.1 head/usr.bin/clang/llc/Makefile head/usr.bin/clang/llc/llc.1 head/usr.bin/clang/lli/lli.1 head/usr.bin/clang/llvm-ar/llvm-ar.1 head/usr.bin/clang/llvm-as/llvm-as.1 head/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 head/usr.bin/clang/llvm-diff/llvm-diff.1 head/usr.bin/clang/llvm-dis/Makefile head/usr.bin/clang/llvm-dis/llvm-dis.1 head/usr.bin/clang/llvm-extract/Makefile head/usr.bin/clang/llvm-extract/llvm-extract.1 head/usr.bin/clang/llvm-link/Makefile head/usr.bin/clang/llvm-link/llvm-link.1 head/usr.bin/clang/llvm-mc/Makefile head/usr.bin/clang/llvm-nm/llvm-nm.1 head/usr.bin/clang/llvm-objdump/Makefile head/usr.bin/clang/llvm-prof/Makefile head/usr.bin/clang/llvm-prof/llvm-prof.1 head/usr.bin/clang/llvm-ranlib/llvm-ranlib.1 head/usr.bin/clang/llvm-rtdyld/Makefile head/usr.bin/clang/opt/opt.1 head/usr.bin/clang/tblgen/Makefile head/usr.bin/clang/tblgen/tblgen.1 head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Aug 20 18:32:46 2012 (r239461) +++ head/ObsoleteFiles.inc Mon Aug 20 18:33:03 2012 (r239462) @@ -38,6 +38,31 @@ # xargs -n1 | sort | uniq -d; # done +# 20120816: new clang import which bumps version from 3.1 to 3.2 +OLD_FILES+=usr/include/clang/3.1/altivec.h +OLD_FILES+=usr/include/clang/3.1/avx2intrin.h +OLD_FILES+=usr/include/clang/3.1/avxintrin.h +OLD_FILES+=usr/include/clang/3.1/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.1/bmiintrin.h +OLD_FILES+=usr/include/clang/3.1/cpuid.h +OLD_FILES+=usr/include/clang/3.1/emmintrin.h +OLD_FILES+=usr/include/clang/3.1/fma4intrin.h +OLD_FILES+=usr/include/clang/3.1/immintrin.h +OLD_FILES+=usr/include/clang/3.1/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.1/mm3dnow.h +OLD_FILES+=usr/include/clang/3.1/mm_malloc.h +OLD_FILES+=usr/include/clang/3.1/mmintrin.h +OLD_FILES+=usr/include/clang/3.1/module.map +OLD_FILES+=usr/include/clang/3.1/nmmintrin.h +OLD_FILES+=usr/include/clang/3.1/pmmintrin.h +OLD_FILES+=usr/include/clang/3.1/popcntintrin.h +OLD_FILES+=usr/include/clang/3.1/smmintrin.h +OLD_FILES+=usr/include/clang/3.1/tmmintrin.h +OLD_FILES+=usr/include/clang/3.1/unwind.h +OLD_FILES+=usr/include/clang/3.1/wmmintrin.h +OLD_FILES+=usr/include/clang/3.1/x86intrin.h +OLD_FILES+=usr/include/clang/3.1/xmmintrin.h +OLD_DIRS+=usr/include/clang/3.1 # 20120712: OpenSSL 1.0.1c import OLD_LIBS+=lib/libcrypto.so.6 OLD_LIBS+=usr/lib/libssl.so.6 Modified: head/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Core.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm-c/Core.h Mon Aug 20 18:33:03 2012 (r239462) @@ -21,9 +21,9 @@ /* Need these includes to support the LLVM 'cast' template for the C++ 'wrap' and 'unwrap' conversion functions. */ +#include "llvm/IRBuilder.h" #include "llvm/Module.h" #include "llvm/PassRegistry.h" -#include "llvm/Support/IRBuilder.h" extern "C" { #endif @@ -53,7 +53,7 @@ extern "C" { * The declared parameter names are descriptive and specify which type is * required. Additionally, each type hierarchy is documented along with the * functions that operate upon it. For more detail, refer to LLVM's C++ code. - * If in doubt, refer to Core.cpp, which performs paramter downcasts in the + * If in doubt, refer to Core.cpp, which performs parameter downcasts in the * form unwrap(Param). * * Many exotic languages can interoperate with C code but have a harder time @@ -106,7 +106,7 @@ typedef struct LLVMOpaqueType *LLVMTypeR typedef struct LLVMOpaqueValue *LLVMValueRef; /** - * Represents a basic block of instruction in LLVM IR. + * Represents a basic block of instructions in LLVM IR. * * This models llvm::BasicBlock. */ @@ -478,6 +478,15 @@ void LLVMSetTarget(LLVMModuleRef M, cons void LLVMDumpModule(LLVMModuleRef M); /** + * Print a representation of a module to a file. The ErrorMessage needs to be + * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise. + * + * @see Module::print() + */ +LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, + char **ErrorMessage); + +/** * Set inline assembly for a module. * * @see Module::setModuleInlineAsm() @@ -977,7 +986,7 @@ LLVMTypeRef LLVMX86MMXType(void); * * LLVMValueRef essentially represents llvm::Value. There is a rich * hierarchy of classes within this type. Depending on the instance - * obtain, not all APIs are available. + * obtained, not all APIs are available. * * Callers can determine the type of a LLVMValueRef by calling the * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These @@ -1153,7 +1162,7 @@ LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLAR * * Uses are obtained in an iterator fashion. First, call this function * to obtain a reference to the first use. Then, call LLVMGetNextUse() - * on that instance and all subsequently obtained instances untl + * on that instance and all subsequently obtained instances until * LLVMGetNextUse() returns NULL. * * @see llvm::Value::use_begin() @@ -2106,7 +2115,7 @@ LLVMBasicBlockRef LLVMGetInstructionPare LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst); /** - * Obtain the instruction that occured before this one. + * Obtain the instruction that occurred before this one. * * If the instruction is the first instruction in a basic block, NULL * will be returned. Modified: head/contrib/llvm/include/llvm-c/Disassembler.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Disassembler.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm-c/Disassembler.h Mon Aug 20 18:33:03 2012 (r239462) @@ -109,9 +109,9 @@ struct LLVMOpInfo1 { */ typedef const char *(*LLVMSymbolLookupCallback)(void *DisInfo, uint64_t ReferenceValue, - uint64_t *ReferenceType, - uint64_t ReferencePC, - const char **ReferenceName); + uint64_t *ReferenceType, + uint64_t ReferencePC, + const char **ReferenceName); /** * The reference types on input and output. */ Copied: head/contrib/llvm/include/llvm-c/Linker.h (from r239314, vendor/llvm/dist/include/llvm-c/Linker.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm-c/Linker.h Mon Aug 20 18:33:03 2012 (r239462, copy of r239314, vendor/llvm/dist/include/llvm-c/Linker.h) @@ -0,0 +1,42 @@ +/*===-- llvm-c/Linker.h - Module Linker C Interface -------------*- C++ -*-===*\ +|* *| +|* The LLVM Compiler Infrastructure *| +|* *| +|* This file is distributed under the University of Illinois Open Source *| +|* License. See LICENSE.TXT for details. *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file defines the C interface to the module/file/archive linker. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_C_LINKER_H +#define LLVM_C_LINKER_H + +#include "llvm-c/Core.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef enum { + LLVMLinkerDestroySource = 0, /* Allow source module to be destroyed. */ + LLVMLinkerPreserveSource = 1 /* Preserve the source module. */ +} LLVMLinkerMode; + + +/* Links the source module into the destination module, taking ownership + * of the source module away from the caller. Optionally returns a + * human-readable description of any errors that occurred in linking. + * OutMessage must be disposed with LLVMDisposeMessage. The return value + * is true if an error occurred, false otherwise. */ +LLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src, + LLVMLinkerMode Mode, char **OutMessage); + +#ifdef __cplusplus +} +#endif + +#endif Modified: head/contrib/llvm/include/llvm-c/Target.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Target.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm-c/Target.h Mon Aug 20 18:33:03 2012 (r239462) @@ -56,19 +56,19 @@ typedef struct LLVMStructLayout *LLVMStr /* Declare all of the available assembly printer initialization functions. */ #define LLVM_ASM_PRINTER(TargetName) \ - void LLVMInitialize##TargetName##AsmPrinter(); + void LLVMInitialize##TargetName##AsmPrinter(void); #include "llvm/Config/AsmPrinters.def" #undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */ /* Declare all of the available assembly parser initialization functions. */ #define LLVM_ASM_PARSER(TargetName) \ - void LLVMInitialize##TargetName##AsmParser(); + void LLVMInitialize##TargetName##AsmParser(void); #include "llvm/Config/AsmParsers.def" #undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */ /* Declare all of the available disassembler initialization functions. */ #define LLVM_DISASSEMBLER(TargetName) \ - void LLVMInitialize##TargetName##Disassembler(); + void LLVMInitialize##TargetName##Disassembler(void); #include "llvm/Config/Disassemblers.def" #undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */ @@ -102,7 +102,7 @@ static inline void LLVMInitializeAllTarg /** LLVMInitializeAllAsmPrinters - The main program should call this function if it wants all asm printers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllAsmPrinters() { +static inline void LLVMInitializeAllAsmPrinters(void) { #define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter(); #include "llvm/Config/AsmPrinters.def" #undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */ @@ -111,7 +111,7 @@ static inline void LLVMInitializeAllAsmP /** LLVMInitializeAllAsmParsers - The main program should call this function if it wants all asm parsers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllAsmParsers() { +static inline void LLVMInitializeAllAsmParsers(void) { #define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser(); #include "llvm/Config/AsmParsers.def" #undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */ @@ -120,7 +120,7 @@ static inline void LLVMInitializeAllAsmP /** LLVMInitializeAllDisassemblers - The main program should call this function if it wants all disassemblers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllDisassemblers() { +static inline void LLVMInitializeAllDisassemblers(void) { #define LLVM_DISASSEMBLER(TargetName) \ LLVMInitialize##TargetName##Disassembler(); #include "llvm/Config/Disassemblers.def" Modified: head/contrib/llvm/include/llvm/ADT/APFloat.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APFloat.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/APFloat.h Mon Aug 20 18:33:03 2012 (r239462) @@ -274,6 +274,7 @@ namespace llvm { /* C fmod, or llvm frem. */ opStatus mod(const APFloat &, roundingMode); opStatus fusedMultiplyAdd(const APFloat &, const APFloat &, roundingMode); + opStatus roundToIntegral(roundingMode); /* Sign operations. */ void changeSign(); Modified: head/contrib/llvm/include/llvm/ADT/APInt.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APInt.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/APInt.h Mon Aug 20 18:33:03 2012 (r239462) @@ -16,6 +16,7 @@ #define LLVM_APINT_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" #include #include @@ -273,6 +274,13 @@ public: initSlowCase(that); } +#if LLVM_USE_RVALUE_REFERENCES + /// @brief Move Constructor. + APInt(APInt&& that) : BitWidth(that.BitWidth), VAL(that.VAL) { + that.BitWidth = 0; + } +#endif + /// @brief Destructor. ~APInt() { if (!isSingleWord()) @@ -349,13 +357,7 @@ public: /// @brief Check if this APInt has an N-bits unsigned integer value. bool isIntN(unsigned N) const { assert(N && "N == 0 ???"); - if (N >= getBitWidth()) - return true; - - if (isSingleWord()) - return isUIntN(N, VAL); - return APInt(N, makeArrayRef(pVal, getNumWords())).zext(getBitWidth()) - == (*this); + return getActiveBits() <= N; } /// @brief Check if this APInt has an N-bits signed integer value. @@ -503,6 +505,18 @@ public: return getAllOnesValue(numBits).lshr(numBits - loBitsSet); } + /// \brief Determine if two APInts have the same value, after zero-extending + /// one of them (if needed!) to ensure that the bit-widths match. + static bool isSameValue(const APInt &I1, const APInt &I2) { + if (I1.getBitWidth() == I2.getBitWidth()) + return I1 == I2; + + if (I1.getBitWidth() > I2.getBitWidth()) + return I1 == I2.zext(I1.getBitWidth()); + + return I1.zext(I2.getBitWidth()) == I2; + } + /// \brief Overload to compute a hash_code for an APInt value. friend hash_code hash_value(const APInt &Arg); @@ -587,6 +601,21 @@ public: return AssignSlowCase(RHS); } +#if LLVM_USE_RVALUE_REFERENCES + /// @brief Move assignment operator. + APInt& operator=(APInt&& that) { + if (!isSingleWord()) + delete [] pVal; + + BitWidth = that.BitWidth; + VAL = that.VAL; + + that.BitWidth = 0; + + return *this; + } +#endif + /// The RHS value is assigned to *this. If the significant bits in RHS exceed /// the bit width, the excess bits are truncated. If the bit width is larger /// than 64, the value is zero filled in the unspecified high order bits. @@ -817,9 +846,10 @@ public: if (LHS.isNegative()) { if (RHS.isNegative()) APInt::udivrem(-LHS, -RHS, Quotient, Remainder); - else + else { APInt::udivrem(-LHS, RHS, Quotient, Remainder); - Quotient = -Quotient; + Quotient = -Quotient; + } Remainder = -Remainder; } else if (RHS.isNegative()) { APInt::udivrem(LHS, -RHS, Quotient, Remainder); @@ -1087,7 +1117,7 @@ public: else { // Set all the bits in all the words. for (unsigned i = 0; i < getNumWords(); ++i) - pVal[i] = -1ULL; + pVal[i] = -1ULL; } // Clear the unused ones clearUnusedBits(); Modified: head/contrib/llvm/include/llvm/ADT/APSInt.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APSInt.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/APSInt.h Mon Aug 20 18:33:03 2012 (r239462) @@ -135,6 +135,19 @@ public: assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!"); return IsUnsigned ? uge(RHS) : sge(RHS); } + inline bool operator==(const APSInt& RHS) const { + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!"); + return eq(RHS); + } + inline bool operator==(int64_t RHS) const { + return isSameValue(*this, APSInt(APInt(64, RHS), true)); + } + inline bool operator!=(const APSInt& RHS) const { + return !((*this) == RHS); + } + inline bool operator!=(int64_t RHS) const { + return !((*this) == RHS); + } // The remaining operators just wrap the logic of APInt, but retain the // signedness information. @@ -250,17 +263,50 @@ public: : APInt::getSignedMinValue(numBits), Unsigned); } + /// \brief Determine if two APSInts have the same value, zero- or + /// sign-extending as needed. + static bool isSameValue(const APSInt &I1, const APSInt &I2) { + if (I1.getBitWidth() == I2.getBitWidth() && I1.isSigned() == I2.isSigned()) + return I1 == I2; + + // Check for a bit-width mismatch. + if (I1.getBitWidth() > I2.getBitWidth()) + return isSameValue(I1, I2.extend(I1.getBitWidth())); + else if (I2.getBitWidth() > I1.getBitWidth()) + return isSameValue(I1.extend(I2.getBitWidth()), I2); + + // We have a signedness mismatch. Turn the signed value into an unsigned + // value. + if (I1.isSigned()) { + if (I1.isNegative()) + return false; + + return APSInt(I1, true) == I2; + } + + if (I2.isNegative()) + return false; + + return I1 == APSInt(I2, true); + } + /// Profile - Used to insert APSInt objects, or objects that contain APSInt /// objects, into FoldingSets. void Profile(FoldingSetNodeID& ID) const; }; +inline bool operator==(int64_t V1, const APSInt& V2) { + return V2 == V1; +} +inline bool operator!=(int64_t V1, const APSInt& V2) { + return V2 != V1; +} + inline raw_ostream &operator<<(raw_ostream &OS, const APSInt &I) { I.print(OS, I.isSigned()); return OS; } - } // end namespace llvm #endif Modified: head/contrib/llvm/include/llvm/ADT/ArrayRef.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/ArrayRef.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/ArrayRef.h Mon Aug 20 18:33:03 2012 (r239462) @@ -60,7 +60,7 @@ namespace llvm { : Data(begin), Length(end - begin) {} /// Construct an ArrayRef from a SmallVector. - /*implicit*/ ArrayRef(const SmallVectorImpl &Vec) + /*implicit*/ ArrayRef(const SmallVectorTemplateCommon &Vec) : Data(Vec.data()), Length(Vec.size()) {} /// Construct an ArrayRef from a std::vector. Modified: head/contrib/llvm/include/llvm/ADT/BitVector.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/BitVector.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/BitVector.h Mon Aug 20 18:33:03 2012 (r239462) @@ -14,6 +14,7 @@ #ifndef LLVM_ADT_BITVECTOR_H #define LLVM_ADT_BITVECTOR_H +#include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MathExtras.h" #include @@ -97,6 +98,13 @@ public: std::memcpy(Bits, RHS.Bits, Capacity * sizeof(BitWord)); } +#if LLVM_USE_RVALUE_REFERENCES + BitVector(BitVector &&RHS) + : Bits(RHS.Bits), Size(RHS.Size), Capacity(RHS.Capacity) { + RHS.Bits = 0; + } +#endif + ~BitVector() { std::free(Bits); } @@ -251,11 +259,6 @@ public: return *this; } - // No argument flip. - BitVector operator~() const { - return BitVector(*this).flip(); - } - // Indexing. reference operator[](unsigned Idx) { assert (Idx < Size && "Out-of-bounds Bit access."); @@ -272,6 +275,16 @@ public: return (*this)[Idx]; } + /// Test if any common bits are set. + bool anyCommon(const BitVector &RHS) const { + unsigned ThisWords = NumBitWords(size()); + unsigned RHSWords = NumBitWords(RHS.size()); + for (unsigned i = 0, e = std::min(ThisWords, RHSWords); i != e; ++i) + if (Bits[i] & RHS.Bits[i]) + return true; + return false; + } + // Comparison operators. bool operator==(const BitVector &RHS) const { unsigned ThisWords = NumBitWords(size()); @@ -366,6 +379,21 @@ public: return *this; } +#if LLVM_USE_RVALUE_REFERENCES + const BitVector &operator=(BitVector &&RHS) { + if (this == &RHS) return *this; + + std::free(Bits); + Bits = RHS.Bits; + Size = RHS.Size; + Capacity = RHS.Capacity; + + RHS.Bits = 0; + + return *this; + } +#endif + void swap(BitVector &RHS) { std::swap(Bits, RHS.Bits); std::swap(Size, RHS.Size); @@ -472,24 +500,6 @@ private: } }; -inline BitVector operator&(const BitVector &LHS, const BitVector &RHS) { - BitVector Result(LHS); - Result &= RHS; - return Result; -} - -inline BitVector operator|(const BitVector &LHS, const BitVector &RHS) { - BitVector Result(LHS); - Result |= RHS; - return Result; -} - -inline BitVector operator^(const BitVector &LHS, const BitVector &RHS) { - BitVector Result(LHS); - Result ^= RHS; - return Result; -} - } // End llvm namespace namespace std { Modified: head/contrib/llvm/include/llvm/ADT/DenseMap.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/DenseMap.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/DenseMap.h Mon Aug 20 18:33:03 2012 (r239462) @@ -14,6 +14,8 @@ #ifndef LLVM_ADT_DENSEMAP_H #define LLVM_ADT_DENSEMAP_H +#include "llvm/Support/Compiler.h" +#include "llvm/Support/AlignOf.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/PointerLikeTypeTraits.h" #include "llvm/Support/type_traits.h" @@ -23,6 +25,7 @@ #include #include #include +#include #include #include @@ -33,116 +36,83 @@ template class DenseMapIterator; -template > -class DenseMap { +template +class DenseMapBase { +protected: typedef std::pair BucketT; - unsigned NumBuckets; - BucketT *Buckets; - unsigned NumEntries; - unsigned NumTombstones; public: typedef KeyT key_type; typedef ValueT mapped_type; typedef BucketT value_type; - DenseMap(const DenseMap &other) { - NumBuckets = 0; - CopyFrom(other); - } - - explicit DenseMap(unsigned NumInitBuckets = 0) { - init(NumInitBuckets); - } - - template - DenseMap(const InputIt &I, const InputIt &E) { - init(NextPowerOf2(std::distance(I, E))); - insert(I, E); - } - - ~DenseMap() { - const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); - for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) { - if (!KeyInfoT::isEqual(P->first, EmptyKey) && - !KeyInfoT::isEqual(P->first, TombstoneKey)) - P->second.~ValueT(); - P->first.~KeyT(); - } -#ifndef NDEBUG - if (NumBuckets) - memset((void*)Buckets, 0x5a, sizeof(BucketT)*NumBuckets); -#endif - operator delete(Buckets); - } - typedef DenseMapIterator iterator; typedef DenseMapIterator const_iterator; inline iterator begin() { // When the map is empty, avoid the overhead of AdvancePastEmptyBuckets(). - return empty() ? end() : iterator(Buckets, Buckets+NumBuckets); + return empty() ? end() : iterator(getBuckets(), getBucketsEnd()); } inline iterator end() { - return iterator(Buckets+NumBuckets, Buckets+NumBuckets, true); + return iterator(getBucketsEnd(), getBucketsEnd(), true); } inline const_iterator begin() const { - return empty() ? end() : const_iterator(Buckets, Buckets+NumBuckets); + return empty() ? end() : const_iterator(getBuckets(), getBucketsEnd()); } inline const_iterator end() const { - return const_iterator(Buckets+NumBuckets, Buckets+NumBuckets, true); + return const_iterator(getBucketsEnd(), getBucketsEnd(), true); } - bool empty() const { return NumEntries == 0; } - unsigned size() const { return NumEntries; } + bool empty() const { return getNumEntries() == 0; } + unsigned size() const { return getNumEntries(); } /// Grow the densemap so that it has at least Size buckets. Does not shrink void resize(size_t Size) { - if (Size > NumBuckets) + if (Size > getNumBuckets()) grow(Size); } void clear() { - if (NumEntries == 0 && NumTombstones == 0) return; + if (getNumEntries() == 0 && getNumTombstones() == 0) return; // If the capacity of the array is huge, and the # elements used is small, // shrink the array. - if (NumEntries * 4 < NumBuckets && NumBuckets > 64) { + if (getNumEntries() * 4 < getNumBuckets() && getNumBuckets() > 64) { shrink_and_clear(); return; } const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); - for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) { + for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) { if (!KeyInfoT::isEqual(P->first, EmptyKey)) { if (!KeyInfoT::isEqual(P->first, TombstoneKey)) { P->second.~ValueT(); - --NumEntries; + decrementNumEntries(); } P->first = EmptyKey; } } - assert(NumEntries == 0 && "Node count imbalance!"); - NumTombstones = 0; + assert(getNumEntries() == 0 && "Node count imbalance!"); + setNumTombstones(0); } /// count - Return true if the specified key is in the map. bool count(const KeyT &Val) const { - BucketT *TheBucket; + const BucketT *TheBucket; return LookupBucketFor(Val, TheBucket); } iterator find(const KeyT &Val) { BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) - return iterator(TheBucket, Buckets+NumBuckets, true); + return iterator(TheBucket, getBucketsEnd(), true); return end(); } const_iterator find(const KeyT &Val) const { - BucketT *TheBucket; + const BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) - return const_iterator(TheBucket, Buckets+NumBuckets, true); + return const_iterator(TheBucket, getBucketsEnd(), true); return end(); } @@ -155,21 +125,21 @@ public: iterator find_as(const LookupKeyT &Val) { BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) - return iterator(TheBucket, Buckets+NumBuckets, true); + return iterator(TheBucket, getBucketsEnd(), true); return end(); } template const_iterator find_as(const LookupKeyT &Val) const { - BucketT *TheBucket; + const BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) - return const_iterator(TheBucket, Buckets+NumBuckets, true); + return const_iterator(TheBucket, getBucketsEnd(), true); return end(); } /// lookup - Return the entry for the specified key, or a default /// constructed value if no such entry exists. ValueT lookup(const KeyT &Val) const { - BucketT *TheBucket; + const BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) return TheBucket->second; return ValueT(); @@ -181,12 +151,12 @@ public: std::pair insert(const std::pair &KV) { BucketT *TheBucket; if (LookupBucketFor(KV.first, TheBucket)) - return std::make_pair(iterator(TheBucket, Buckets+NumBuckets, true), + return std::make_pair(iterator(TheBucket, getBucketsEnd(), true), false); // Already in map. // Otherwise, insert the new element. TheBucket = InsertIntoBucket(KV.first, KV.second, TheBucket); - return std::make_pair(iterator(TheBucket, Buckets+NumBuckets, true), true); + return std::make_pair(iterator(TheBucket, getBucketsEnd(), true), true); } /// insert - Range insertion of pairs. @@ -204,23 +174,16 @@ public: TheBucket->second.~ValueT(); TheBucket->first = getTombstoneKey(); - --NumEntries; - ++NumTombstones; + decrementNumEntries(); + incrementNumTombstones(); return true; } void erase(iterator I) { BucketT *TheBucket = &*I; TheBucket->second.~ValueT(); TheBucket->first = getTombstoneKey(); - --NumEntries; - ++NumTombstones; - } - - void swap(DenseMap& RHS) { - std::swap(NumBuckets, RHS.NumBuckets); - std::swap(Buckets, RHS.Buckets); - std::swap(NumEntries, RHS.NumEntries); - std::swap(NumTombstones, RHS.NumTombstones); + decrementNumEntries(); + incrementNumTombstones(); } value_type& FindAndConstruct(const KeyT &Key) { @@ -235,68 +198,211 @@ public: return FindAndConstruct(Key).second; } - DenseMap& operator=(const DenseMap& other) { - CopyFrom(other); - return *this; +#if LLVM_USE_RVALUE_REFERENCES + value_type& FindAndConstruct(KeyT &&Key) { + BucketT *TheBucket; + if (LookupBucketFor(Key, TheBucket)) + return *TheBucket; + + return *InsertIntoBucket(Key, ValueT(), TheBucket); } + ValueT &operator[](KeyT &&Key) { + return FindAndConstruct(Key).second; + } +#endif + /// isPointerIntoBucketsArray - Return true if the specified pointer points /// somewhere into the DenseMap's array of buckets (i.e. either to a key or /// value in the DenseMap). bool isPointerIntoBucketsArray(const void *Ptr) const { - return Ptr >= Buckets && Ptr < Buckets+NumBuckets; + return Ptr >= getBuckets() && Ptr < getBucketsEnd(); } /// getPointerIntoBucketsArray() - Return an opaque pointer into the buckets /// array. In conjunction with the previous method, this can be used to /// determine whether an insertion caused the DenseMap to reallocate. - const void *getPointerIntoBucketsArray() const { return Buckets; } + const void *getPointerIntoBucketsArray() const { return getBuckets(); } -private: - void CopyFrom(const DenseMap& other) { - if (NumBuckets != 0 && - (!isPodLike::value || !isPodLike::value)) { - const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); - for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) { - if (!KeyInfoT::isEqual(P->first, EmptyKey) && - !KeyInfoT::isEqual(P->first, TombstoneKey)) - P->second.~ValueT(); - P->first.~KeyT(); - } - } +protected: + DenseMapBase() {} - NumEntries = other.NumEntries; - NumTombstones = other.NumTombstones; + void destroyAll() { + if (getNumBuckets() == 0) // Nothing to do. + return; + + const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); + for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) { + if (!KeyInfoT::isEqual(P->first, EmptyKey) && + !KeyInfoT::isEqual(P->first, TombstoneKey)) + P->second.~ValueT(); + P->first.~KeyT(); + } - if (NumBuckets) { #ifndef NDEBUG - memset((void*)Buckets, 0x5a, sizeof(BucketT)*NumBuckets); + memset((void*)getBuckets(), 0x5a, sizeof(BucketT)*getNumBuckets()); #endif - operator delete(Buckets); - } + } - NumBuckets = other.NumBuckets; + void initEmpty() { + setNumEntries(0); + setNumTombstones(0); - if (NumBuckets == 0) { - Buckets = 0; - return; + assert((getNumBuckets() & (getNumBuckets()-1)) == 0 && + "# initial buckets must be a power of two!"); + const KeyT EmptyKey = getEmptyKey(); + for (BucketT *B = getBuckets(), *E = getBucketsEnd(); B != E; ++B) + new (&B->first) KeyT(EmptyKey); + } + + void moveFromOldBuckets(BucketT *OldBucketsBegin, BucketT *OldBucketsEnd) { + initEmpty(); + + // Insert all the old elements. + const KeyT EmptyKey = getEmptyKey(); + const KeyT TombstoneKey = getTombstoneKey(); + for (BucketT *B = OldBucketsBegin, *E = OldBucketsEnd; B != E; ++B) { + if (!KeyInfoT::isEqual(B->first, EmptyKey) && + !KeyInfoT::isEqual(B->first, TombstoneKey)) { + // Insert the key/value into the new table. + BucketT *DestBucket; + bool FoundVal = LookupBucketFor(B->first, DestBucket); + (void)FoundVal; // silence warning. + assert(!FoundVal && "Key already in new map?"); + DestBucket->first = llvm_move(B->first); + new (&DestBucket->second) ValueT(llvm_move(B->second)); + incrementNumEntries(); + + // Free the value. + B->second.~ValueT(); + } + B->first.~KeyT(); } - Buckets = static_cast(operator new(sizeof(BucketT) * NumBuckets)); +#ifndef NDEBUG + if (OldBucketsBegin != OldBucketsEnd) + memset((void*)OldBucketsBegin, 0x5a, + sizeof(BucketT) * (OldBucketsEnd - OldBucketsBegin)); +#endif + } + + template + void copyFrom(const DenseMapBase& other) { + assert(getNumBuckets() == other.getNumBuckets()); + + setNumEntries(other.getNumEntries()); + setNumTombstones(other.getNumTombstones()); if (isPodLike::value && isPodLike::value) - memcpy(Buckets, other.Buckets, NumBuckets * sizeof(BucketT)); + memcpy(getBuckets(), other.getBuckets(), + getNumBuckets() * sizeof(BucketT)); else - for (size_t i = 0; i < NumBuckets; ++i) { - new (&Buckets[i].first) KeyT(other.Buckets[i].first); - if (!KeyInfoT::isEqual(Buckets[i].first, getEmptyKey()) && - !KeyInfoT::isEqual(Buckets[i].first, getTombstoneKey())) - new (&Buckets[i].second) ValueT(other.Buckets[i].second); + for (size_t i = 0; i < getNumBuckets(); ++i) { + new (&getBuckets()[i].first) KeyT(other.getBuckets()[i].first); + if (!KeyInfoT::isEqual(getBuckets()[i].first, getEmptyKey()) && + !KeyInfoT::isEqual(getBuckets()[i].first, getTombstoneKey())) + new (&getBuckets()[i].second) ValueT(other.getBuckets()[i].second); } } + void swap(DenseMapBase& RHS) { + std::swap(getNumEntries(), RHS.getNumEntries()); + std::swap(getNumTombstones(), RHS.getNumTombstones()); + } + + static unsigned getHashValue(const KeyT &Val) { + return KeyInfoT::getHashValue(Val); + } + template + static unsigned getHashValue(const LookupKeyT &Val) { + return KeyInfoT::getHashValue(Val); + } + static const KeyT getEmptyKey() { + return KeyInfoT::getEmptyKey(); + } + static const KeyT getTombstoneKey() { + return KeyInfoT::getTombstoneKey(); + } + +private: + unsigned getNumEntries() const { + return static_cast(this)->getNumEntries(); + } + void setNumEntries(unsigned Num) { + static_cast(this)->setNumEntries(Num); + } + void incrementNumEntries() { + setNumEntries(getNumEntries() + 1); + } + void decrementNumEntries() { + setNumEntries(getNumEntries() - 1); + } + unsigned getNumTombstones() const { + return static_cast(this)->getNumTombstones(); + } + void setNumTombstones(unsigned Num) { + static_cast(this)->setNumTombstones(Num); + } + void incrementNumTombstones() { + setNumTombstones(getNumTombstones() + 1); + } + void decrementNumTombstones() { + setNumTombstones(getNumTombstones() - 1); + } + const BucketT *getBuckets() const { + return static_cast(this)->getBuckets(); + } + BucketT *getBuckets() { + return static_cast(this)->getBuckets(); + } + unsigned getNumBuckets() const { + return static_cast(this)->getNumBuckets(); + } + BucketT *getBucketsEnd() { + return getBuckets() + getNumBuckets(); + } + const BucketT *getBucketsEnd() const { + return getBuckets() + getNumBuckets(); + } + + void grow(unsigned AtLeast) { + static_cast(this)->grow(AtLeast); + } + + void shrink_and_clear() { + static_cast(this)->shrink_and_clear(); + } + + BucketT *InsertIntoBucket(const KeyT &Key, const ValueT &Value, BucketT *TheBucket) { + TheBucket = InsertIntoBucketImpl(Key, TheBucket); + + TheBucket->first = Key; + new (&TheBucket->second) ValueT(Value); + return TheBucket; + } + +#if LLVM_USE_RVALUE_REFERENCES + BucketT *InsertIntoBucket(const KeyT &Key, ValueT &&Value, + BucketT *TheBucket) { + TheBucket = InsertIntoBucketImpl(Key, TheBucket); + + TheBucket->first = Key; + new (&TheBucket->second) ValueT(std::move(Value)); + return TheBucket; + } + + BucketT *InsertIntoBucket(KeyT &&Key, ValueT &&Value, BucketT *TheBucket) { + TheBucket = InsertIntoBucketImpl(Key, TheBucket); + + TheBucket->first = std::move(Key); + new (&TheBucket->second) ValueT(std::move(Value)); + return TheBucket; + } +#endif + + BucketT *InsertIntoBucketImpl(const KeyT &Key, BucketT *TheBucket) { // If the load of the hash table is more than 3/4, or if fewer than 1/8 of // the buckets are empty (meaning that many are filled with tombstones), // grow the table. @@ -306,48 +412,38 @@ private: // probe almost the entire table until it found the empty bucket. If the // table completely filled with tombstones, no lookup would ever succeed, // causing infinite loops in lookup. - ++NumEntries; - if (NumEntries*4 >= NumBuckets*3) { + unsigned NewNumEntries = getNumEntries() + 1; + unsigned NumBuckets = getNumBuckets(); + if (NewNumEntries*4 >= NumBuckets*3) { this->grow(NumBuckets * 2); LookupBucketFor(Key, TheBucket); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:33:23 2012 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 E55801065787; Mon, 20 Aug 2012 18:33:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB4108FC14; Mon, 20 Aug 2012 18:33:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIXNim075942; Mon, 20 Aug 2012 18:33:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIXNLc075940; Mon, 20 Aug 2012 18:33:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201833.q7KIXNLc075940@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239463 - in stable: 7/share/man/man5 8/share/man/man5 9/share/man/man5 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, 20 Aug 2012 18:33:24 -0000 Author: delphij Date: Mon Aug 20 18:33:23 2012 New Revision: 239463 URL: http://svn.freebsd.org/changeset/base/239463 Log: MFC r238631: Import an updated version of moduli(5) manual page from OpenBSD. Modified: stable/9/share/man/man5/moduli.5 Directory Properties: stable/9/share/man/man5/ (props changed) Changes in other areas also in this revision: Modified: stable/7/share/man/man5/moduli.5 stable/8/share/man/man5/moduli.5 Directory Properties: stable/7/share/man/man5/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/9/share/man/man5/moduli.5 ============================================================================== --- stable/9/share/man/man5/moduli.5 Mon Aug 20 18:33:03 2012 (r239462) +++ stable/9/share/man/man5/moduli.5 Mon Aug 20 18:33:23 2012 (r239463) @@ -1,159 +1,125 @@ -.\" $OpenBSD: moduli.5,v 1.3 2001/06/24 18:50:52 provos Exp $ +.\" $OpenBSD: moduli.5,v 1.16 2011/11/28 08:46:27 eric Exp $ .\" -.\" Copyright 1997, 2000 William Allen Simpson -.\" All rights reserved. +.\" Copyright (c) 2008 Damien Miller .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software designed by William Allen Simpson. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" $FreeBSD$ .\" -.Dd July 28, 1997 +.Dd July 19, 2012 .Dt MODULI 5 .Os .Sh NAME .Nm moduli -.Nd system moduli file +.Nd Diffie-Hellman moduli .Sh DESCRIPTION The -.Nm -file contains the system-wide Diffie-Hellman prime moduli for the -.Xr photurisd 8 -and +.Pa /etc/ssh/moduli +file contains prime numbers and generators for use by .Xr sshd 8 -programs. +in the Diffie-Hellman Group Exchange key exchange method. .Pp -Each line in this file contains the following fields: -.Va Time , Type , Tests , Tries , Size , Generator , -and -.Va Modulus . -The fields are separated by white space (tab or blank). -.Bl -tag -width indent -.It Va Time Pq Vt yyyymmddhhmmss -Specifies the system time that the line was appended to the file. -The value 00000000000000 means unknown (historic). -.\"The file is sorted in ascending order. -.It Va Type Pq Vt decimal -Specifies the internal structure of the prime modulus. +New moduli may be generated with +.Xr ssh-keygen 1 +using a two-step process. +An initial +.Em candidate generation +pass, using +.Ic ssh-keygen -G , +calculates numbers that are likely to be useful. +A second +.Em primality testing +pass, using +.Ic ssh-keygen -T , +provides a high degree of assurance that the numbers are prime and are +safe for use in Diffie-Hellman operations by +.Xr sshd 8 . +This +.Nm +format is used as the output from each pass. .Pp -.Bl -tag -width indent -compact -.It 0 -unknown; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -unstructured; -a common large number. -.It 2 -safe (p = 2q + 1); -meets basic structural requirements. -.It 3 -Schnorr. -.It 4 -Sophie-Germaine (q = (p-1)/2); -usually generated in the process of testing safe or strong primes. -.It 5 -strong; -useful for RSA public key generation. -.El -.It Xo -.Va Tests Pq Vt decimal -(bit field) -.Xc -Specifies the methods used in checking for primality. -Usually, more than one test is used. +The file consists of newline-separated records, one per modulus, +containing seven space-separated fields. +These fields are as follows: +.Bl -tag -width Description -offset indent +.It timestamp +The time that the modulus was last processed as YYYYMMDDHHMMSS. +.It type +Decimal number specifying the internal structure of the prime modulus. +Supported types are: .Pp -.Bl -tag -width indent -compact +.Bl -tag -width 0x00 -compact .It 0 -not tested; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -composite; -failed one or more tests. -In this case, the highest bit specifies the test that failed. +Unknown, not tested. .It 2 -sieve; -checked for division by a range of smaller primes. +"Safe" prime; (p-1)/2 is also prime. .It 4 -Miller-Rabin. -.It 8 -Jacobi. -.It 16 -Elliptic Curve. +Sophie Germain; 2p+1 is also prime. .El -.It Va Tries Pq Vt decimal -Depends on the value of the highest valid Test bit, -where the method specified is: .Pp -.Bl -tag -width indent -compact -.It 0 -not tested -(always zero). -.It 1 -composite -(irrelevant). -.It 2 -sieve; -number of primes sieved. -Commonly on the order of 32,000,000. -.It 4 -Miller-Rabin; -number of M-R iterations. -Commonly on the order of 32 to 64. -.It 8 -Jacobi; -unknown -(always zero). -.It 16 -Elliptic Curve; -unused -(always zero). -.El -.It Va Size Pq Vt decimal -Specifies the number of significant bits. -.It Va Generator Pq Vt "hex string" -Specifies the best generator for a Diffie-Hellman exchange. -0 = unknown or variable, -2, 3, 5, etc. -.It Va Modulus Pq Vt "hex string" -The prime modulus. +Moduli candidates initially produced by +.Xr ssh-keygen 1 +are Sophie Germain primes (type 4). +Further primality testing with +.Xr ssh-keygen 1 +produces safe prime moduli (type 2) that are ready for use in +.Xr sshd 8 . +Other types are not used by OpenSSH. +.It tests +Decimal number indicating the type of primality tests that the number +has been subjected to represented as a bitmask of the following values: +.Pp +.Bl -tag -width 0x00 -compact +.It 0x00 +Not tested. +.It 0x01 +Composite number \(en not prime. +.It 0x02 +Sieve of Eratosthenes. +.It 0x04 +Probabilistic Miller-Rabin primality tests. .El .Pp -The file is searched for moduli that meet the appropriate -.Va Time , Size -and -.Va Generator -criteria. -When more than one meet the criteria, -the selection should be weighted toward newer moduli, -without completely disqualifying older moduli. -.Sh FILES -.Bl -tag -width ".Pa /etc/ssh/moduli" -compact -.It Pa /etc/ssh/moduli +The +.Xr ssh-keygen 1 +moduli candidate generation uses the Sieve of Eratosthenes (flag 0x02). +Subsequent +.Xr ssh-keygen 1 +primality tests are Miller-Rabin tests (flag 0x04). +.It trials +Decimal number indicating the number of primality trials +that have been performed on the modulus. +.It size +Decimal number indicating the size of the prime in bits. +.It generator +The recommended generator for use with this modulus (hexadecimal). +.It modulus +The modulus itself in hexadecimal. .El +.Pp +When performing Diffie-Hellman Group Exchange, +.Xr sshd 8 +first estimates the size of the modulus required to produce enough +Diffie-Hellman output to sufficiently key the selected symmetric cipher. +.Xr sshd 8 +then randomly selects a modulus from +.Fa /etc/ssh/moduli +that best meets the size requirement. .Sh SEE ALSO -.Xr photurisd 8 , +.Xr ssh-keygen 1 , .Xr sshd 8 +.Rs +.%R RFC 4419 +.%T "Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol" +.%D 2006 +.Re From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:33:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22E931065795; Mon, 20 Aug 2012 18:33:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BFB58FC15; Mon, 20 Aug 2012 18:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIXN1p075948; Mon, 20 Aug 2012 18:33:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIXNha075947; Mon, 20 Aug 2012 18:33:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201833.q7KIXNha075947@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239463 - in stable: 7/share/man/man5 8/share/man/man5 9/share/man/man5 X-BeenThere: svn-src-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, 20 Aug 2012 18:33:24 -0000 Author: delphij Date: Mon Aug 20 18:33:23 2012 New Revision: 239463 URL: http://svn.freebsd.org/changeset/base/239463 Log: MFC r238631: Import an updated version of moduli(5) manual page from OpenBSD. Modified: stable/8/share/man/man5/moduli.5 Directory Properties: stable/8/share/man/man5/ (props changed) Changes in other areas also in this revision: Modified: stable/7/share/man/man5/moduli.5 stable/9/share/man/man5/moduli.5 Directory Properties: stable/7/share/man/man5/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/moduli.5 ============================================================================== --- stable/8/share/man/man5/moduli.5 Mon Aug 20 18:33:03 2012 (r239462) +++ stable/8/share/man/man5/moduli.5 Mon Aug 20 18:33:23 2012 (r239463) @@ -1,159 +1,125 @@ -.\" $OpenBSD: moduli.5,v 1.3 2001/06/24 18:50:52 provos Exp $ +.\" $OpenBSD: moduli.5,v 1.16 2011/11/28 08:46:27 eric Exp $ .\" -.\" Copyright 1997, 2000 William Allen Simpson -.\" All rights reserved. +.\" Copyright (c) 2008 Damien Miller .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software designed by William Allen Simpson. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" $FreeBSD$ .\" -.Dd July 28, 1997 +.Dd July 19, 2012 .Dt MODULI 5 .Os .Sh NAME .Nm moduli -.Nd system moduli file +.Nd Diffie-Hellman moduli .Sh DESCRIPTION The -.Nm -file contains the system-wide Diffie-Hellman prime moduli for the -.Xr photurisd 8 -and +.Pa /etc/ssh/moduli +file contains prime numbers and generators for use by .Xr sshd 8 -programs. +in the Diffie-Hellman Group Exchange key exchange method. .Pp -Each line in this file contains the following fields: -.Va Time , Type , Tests , Tries , Size , Generator , -and -.Va Modulus . -The fields are separated by white space (tab or blank). -.Bl -tag -width indent -.It Va Time Pq Vt yyyymmddhhmmss -Specifies the system time that the line was appended to the file. -The value 00000000000000 means unknown (historic). -.\"The file is sorted in ascending order. -.It Va Type Pq Vt decimal -Specifies the internal structure of the prime modulus. +New moduli may be generated with +.Xr ssh-keygen 1 +using a two-step process. +An initial +.Em candidate generation +pass, using +.Ic ssh-keygen -G , +calculates numbers that are likely to be useful. +A second +.Em primality testing +pass, using +.Ic ssh-keygen -T , +provides a high degree of assurance that the numbers are prime and are +safe for use in Diffie-Hellman operations by +.Xr sshd 8 . +This +.Nm +format is used as the output from each pass. .Pp -.Bl -tag -width indent -compact -.It 0 -unknown; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -unstructured; -a common large number. -.It 2 -safe (p = 2q + 1); -meets basic structural requirements. -.It 3 -Schnorr. -.It 4 -Sophie-Germaine (q = (p-1)/2); -usually generated in the process of testing safe or strong primes. -.It 5 -strong; -useful for RSA public key generation. -.El -.It Xo -.Va Tests Pq Vt decimal -(bit field) -.Xc -Specifies the methods used in checking for primality. -Usually, more than one test is used. +The file consists of newline-separated records, one per modulus, +containing seven space-separated fields. +These fields are as follows: +.Bl -tag -width Description -offset indent +.It timestamp +The time that the modulus was last processed as YYYYMMDDHHMMSS. +.It type +Decimal number specifying the internal structure of the prime modulus. +Supported types are: .Pp -.Bl -tag -width indent -compact +.Bl -tag -width 0x00 -compact .It 0 -not tested; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -composite; -failed one or more tests. -In this case, the highest bit specifies the test that failed. +Unknown, not tested. .It 2 -sieve; -checked for division by a range of smaller primes. +"Safe" prime; (p-1)/2 is also prime. .It 4 -Miller-Rabin. -.It 8 -Jacobi. -.It 16 -Elliptic Curve. +Sophie Germain; 2p+1 is also prime. .El -.It Va Tries Pq Vt decimal -Depends on the value of the highest valid Test bit, -where the method specified is: .Pp -.Bl -tag -width indent -compact -.It 0 -not tested -(always zero). -.It 1 -composite -(irrelevant). -.It 2 -sieve; -number of primes sieved. -Commonly on the order of 32,000,000. -.It 4 -Miller-Rabin; -number of M-R iterations. -Commonly on the order of 32 to 64. -.It 8 -Jacobi; -unknown -(always zero). -.It 16 -Elliptic Curve; -unused -(always zero). -.El -.It Va Size Pq Vt decimal -Specifies the number of significant bits. -.It Va Generator Pq Vt "hex string" -Specifies the best generator for a Diffie-Hellman exchange. -0 = unknown or variable, -2, 3, 5, etc. -.It Va Modulus Pq Vt "hex string" -The prime modulus. +Moduli candidates initially produced by +.Xr ssh-keygen 1 +are Sophie Germain primes (type 4). +Further primality testing with +.Xr ssh-keygen 1 +produces safe prime moduli (type 2) that are ready for use in +.Xr sshd 8 . +Other types are not used by OpenSSH. +.It tests +Decimal number indicating the type of primality tests that the number +has been subjected to represented as a bitmask of the following values: +.Pp +.Bl -tag -width 0x00 -compact +.It 0x00 +Not tested. +.It 0x01 +Composite number \(en not prime. +.It 0x02 +Sieve of Eratosthenes. +.It 0x04 +Probabilistic Miller-Rabin primality tests. .El .Pp -The file is searched for moduli that meet the appropriate -.Va Time , Size -and -.Va Generator -criteria. -When more than one meet the criteria, -the selection should be weighted toward newer moduli, -without completely disqualifying older moduli. -.Sh FILES -.Bl -tag -width ".Pa /etc/ssh/moduli" -compact -.It Pa /etc/ssh/moduli +The +.Xr ssh-keygen 1 +moduli candidate generation uses the Sieve of Eratosthenes (flag 0x02). +Subsequent +.Xr ssh-keygen 1 +primality tests are Miller-Rabin tests (flag 0x04). +.It trials +Decimal number indicating the number of primality trials +that have been performed on the modulus. +.It size +Decimal number indicating the size of the prime in bits. +.It generator +The recommended generator for use with this modulus (hexadecimal). +.It modulus +The modulus itself in hexadecimal. .El +.Pp +When performing Diffie-Hellman Group Exchange, +.Xr sshd 8 +first estimates the size of the modulus required to produce enough +Diffie-Hellman output to sufficiently key the selected symmetric cipher. +.Xr sshd 8 +then randomly selects a modulus from +.Fa /etc/ssh/moduli +that best meets the size requirement. .Sh SEE ALSO -.Xr photurisd 8 , +.Xr ssh-keygen 1 , .Xr sshd 8 +.Rs +.%R RFC 4419 +.%T "Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol" +.%D 2006 +.Re From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:33:24 2012 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 5E8B210657A9; Mon, 20 Aug 2012 18:33:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 479C98FC16; Mon, 20 Aug 2012 18:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIXOme075954; Mon, 20 Aug 2012 18:33:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIXOe3075952; Mon, 20 Aug 2012 18:33:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201833.q7KIXOe3075952@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:33: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: r239463 - in stable: 7/share/man/man5 8/share/man/man5 9/share/man/man5 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, 20 Aug 2012 18:33:24 -0000 Author: delphij Date: Mon Aug 20 18:33:23 2012 New Revision: 239463 URL: http://svn.freebsd.org/changeset/base/239463 Log: MFC r238631: Import an updated version of moduli(5) manual page from OpenBSD. Modified: stable/7/share/man/man5/moduli.5 Directory Properties: stable/7/share/man/man5/ (props changed) Changes in other areas also in this revision: Modified: stable/8/share/man/man5/moduli.5 stable/9/share/man/man5/moduli.5 Directory Properties: stable/8/share/man/man5/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/moduli.5 ============================================================================== --- stable/7/share/man/man5/moduli.5 Mon Aug 20 18:33:03 2012 (r239462) +++ stable/7/share/man/man5/moduli.5 Mon Aug 20 18:33:23 2012 (r239463) @@ -1,159 +1,125 @@ -.\" $OpenBSD: moduli.5,v 1.3 2001/06/24 18:50:52 provos Exp $ +.\" $OpenBSD: moduli.5,v 1.16 2011/11/28 08:46:27 eric Exp $ .\" -.\" Copyright 1997, 2000 William Allen Simpson -.\" All rights reserved. +.\" Copyright (c) 2008 Damien Miller .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software designed by William Allen Simpson. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" $FreeBSD$ .\" -.Dd July 28, 1997 +.Dd July 19, 2012 .Dt MODULI 5 .Os .Sh NAME .Nm moduli -.Nd system moduli file +.Nd Diffie-Hellman moduli .Sh DESCRIPTION The -.Nm -file contains the system-wide Diffie-Hellman prime moduli for the -.Xr photurisd 8 -and +.Pa /etc/ssh/moduli +file contains prime numbers and generators for use by .Xr sshd 8 -programs. +in the Diffie-Hellman Group Exchange key exchange method. .Pp -Each line in this file contains the following fields: -.Va Time , Type , Tests , Tries , Size , Generator , -and -.Va Modulus . -The fields are separated by white space (tab or blank). -.Bl -tag -width indent -.It Va Time Pq Vt yyyymmddhhmmss -Specifies the system time that the line was appended to the file. -The value 00000000000000 means unknown (historic). -.\"The file is sorted in ascending order. -.It Va Type Pq Vt decimal -Specifies the internal structure of the prime modulus. +New moduli may be generated with +.Xr ssh-keygen 1 +using a two-step process. +An initial +.Em candidate generation +pass, using +.Ic ssh-keygen -G , +calculates numbers that are likely to be useful. +A second +.Em primality testing +pass, using +.Ic ssh-keygen -T , +provides a high degree of assurance that the numbers are prime and are +safe for use in Diffie-Hellman operations by +.Xr sshd 8 . +This +.Nm +format is used as the output from each pass. .Pp -.Bl -tag -width indent -compact -.It 0 -unknown; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -unstructured; -a common large number. -.It 2 -safe (p = 2q + 1); -meets basic structural requirements. -.It 3 -Schnorr. -.It 4 -Sophie-Germaine (q = (p-1)/2); -usually generated in the process of testing safe or strong primes. -.It 5 -strong; -useful for RSA public key generation. -.El -.It Xo -.Va Tests Pq Vt decimal -(bit field) -.Xc -Specifies the methods used in checking for primality. -Usually, more than one test is used. +The file consists of newline-separated records, one per modulus, +containing seven space-separated fields. +These fields are as follows: +.Bl -tag -width Description -offset indent +.It timestamp +The time that the modulus was last processed as YYYYMMDDHHMMSS. +.It type +Decimal number specifying the internal structure of the prime modulus. +Supported types are: .Pp -.Bl -tag -width indent -compact +.Bl -tag -width 0x00 -compact .It 0 -not tested; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -composite; -failed one or more tests. -In this case, the highest bit specifies the test that failed. +Unknown, not tested. .It 2 -sieve; -checked for division by a range of smaller primes. +"Safe" prime; (p-1)/2 is also prime. .It 4 -Miller-Rabin. -.It 8 -Jacobi. -.It 16 -Elliptic Curve. +Sophie Germain; 2p+1 is also prime. .El -.It Va Tries Pq Vt decimal -Depends on the value of the highest valid Test bit, -where the method specified is: .Pp -.Bl -tag -width indent -compact -.It 0 -not tested -(always zero). -.It 1 -composite -(irrelevant). -.It 2 -sieve; -number of primes sieved. -Commonly on the order of 32,000,000. -.It 4 -Miller-Rabin; -number of M-R iterations. -Commonly on the order of 32 to 64. -.It 8 -Jacobi; -unknown -(always zero). -.It 16 -Elliptic Curve; -unused -(always zero). -.El -.It Va Size Pq Vt decimal -Specifies the number of significant bits. -.It Va Generator Pq Vt "hex string" -Specifies the best generator for a Diffie-Hellman exchange. -0 = unknown or variable, -2, 3, 5, etc. -.It Va Modulus Pq Vt "hex string" -The prime modulus. +Moduli candidates initially produced by +.Xr ssh-keygen 1 +are Sophie Germain primes (type 4). +Further primality testing with +.Xr ssh-keygen 1 +produces safe prime moduli (type 2) that are ready for use in +.Xr sshd 8 . +Other types are not used by OpenSSH. +.It tests +Decimal number indicating the type of primality tests that the number +has been subjected to represented as a bitmask of the following values: +.Pp +.Bl -tag -width 0x00 -compact +.It 0x00 +Not tested. +.It 0x01 +Composite number \(en not prime. +.It 0x02 +Sieve of Eratosthenes. +.It 0x04 +Probabilistic Miller-Rabin primality tests. .El .Pp -The file is searched for moduli that meet the appropriate -.Va Time , Size -and -.Va Generator -criteria. -When more than one meet the criteria, -the selection should be weighted toward newer moduli, -without completely disqualifying older moduli. -.Sh FILES -.Bl -tag -width ".Pa /etc/ssh/moduli" -compact -.It Pa /etc/ssh/moduli +The +.Xr ssh-keygen 1 +moduli candidate generation uses the Sieve of Eratosthenes (flag 0x02). +Subsequent +.Xr ssh-keygen 1 +primality tests are Miller-Rabin tests (flag 0x04). +.It trials +Decimal number indicating the number of primality trials +that have been performed on the modulus. +.It size +Decimal number indicating the size of the prime in bits. +.It generator +The recommended generator for use with this modulus (hexadecimal). +.It modulus +The modulus itself in hexadecimal. .El +.Pp +When performing Diffie-Hellman Group Exchange, +.Xr sshd 8 +first estimates the size of the modulus required to produce enough +Diffie-Hellman output to sufficiently key the selected symmetric cipher. +.Xr sshd 8 +then randomly selects a modulus from +.Fa /etc/ssh/moduli +that best meets the size requirement. .Sh SEE ALSO -.Xr photurisd 8 , +.Xr ssh-keygen 1 , .Xr sshd 8 +.Rs +.%R RFC 4419 +.%T "Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol" +.%D 2006 +.Re From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:45:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 642131065673; Mon, 20 Aug 2012 18:45:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 145D68FC08; Mon, 20 Aug 2012 18:45:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIjGff077241; Mon, 20 Aug 2012 18:45:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIjGOx077239; Mon, 20 Aug 2012 18:45:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201845.q7KIjGOx077239@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:45: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: r239464 - 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, 20 Aug 2012 18:45:17 -0000 Author: delphij Date: Mon Aug 20 18:45:16 2012 New Revision: 239464 URL: http://svn.freebsd.org/changeset/base/239464 Log: As of r232844 we no longer need the maxpoll 9 workaround. MFC after: 3 days Modified: head/etc/ntp.conf Modified: head/etc/ntp.conf ============================================================================== --- head/etc/ntp.conf Mon Aug 20 18:33:23 2012 (r239463) +++ head/etc/ntp.conf Mon Aug 20 18:45:16 2012 (r239464) @@ -18,12 +18,11 @@ # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # # The option `iburst' is used for faster initial synchronisation. -# The option `maxpoll 9' is used to prevent PLL/FLL flipping on FreeBSD. # -server 0.freebsd.pool.ntp.org iburst maxpoll 9 -server 1.freebsd.pool.ntp.org iburst maxpoll 9 -server 2.freebsd.pool.ntp.org iburst maxpoll 9 -#server 3.freebsd.pool.ntp.org iburst maxpoll 9 +server 0.freebsd.pool.ntp.org iburst +server 1.freebsd.pool.ntp.org iburst +server 2.freebsd.pool.ntp.org iburst +#server 3.freebsd.pool.ntp.org iburst # # If you want to pick yourself which country's public NTP server @@ -31,9 +30,9 @@ server 2.freebsd.pool.ntp.org iburst max # the next ones and replace CC with the country's abbreviation. # Make sure that the hostnames resolve to a proper IP address! # -# server 0.CC.pool.ntp.org iburst maxpoll 9 -# server 1.CC.pool.ntp.org iburst maxpoll 9 -# server 2.CC.pool.ntp.org iburst maxpoll 9 +# server 0.CC.pool.ntp.org iburst +# server 1.CC.pool.ntp.org iburst +# server 2.CC.pool.ntp.org iburst # # Security: Only accept NTP traffic from the following hosts. From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 18:57:41 2012 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 A07CF106566B; Mon, 20 Aug 2012 18:57:41 +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 8C84B8FC12; Mon, 20 Aug 2012 18:57:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KIvfDK078546; Mon, 20 Aug 2012 18:57:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIvfRP078544; Mon, 20 Aug 2012 18:57:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208201857.q7KIvfRP078544@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 18:57: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: r239465 - 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: Mon, 20 Aug 2012 18:57:41 -0000 Author: adrian Date: Mon Aug 20 18:57:41 2012 New Revision: 239465 URL: http://svn.freebsd.org/changeset/base/239465 Log: Fix a build issue when ATH_DEBUG isn't defined - just initialise and use qnum. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Aug 20 18:45:16 2012 (r239464) +++ head/sys/dev/ath/if_ath_tx.c Mon Aug 20 18:57:41 2012 (r239465) @@ -307,7 +307,7 @@ ath_tx_chaindesclist(struct ath_softc *s uint32_t segLenList[4]; int numTxMaps = 1; int isFirstDesc = 1; - int qnum = 0; /* XXX update */ + int qnum; /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -366,11 +366,13 @@ ath_tx_chaindesclist(struct ath_softc *s * it may actually be pointing to the multicast software * TXQ id. These must be fixed! */ + qnum = bf->bf_state.bfs_txq->axq_qnum; + ath_hal_filltxdesc(ah, (struct ath_desc *) ds , bufAddrList , segLenList , bf->bf_descid /* XXX desc id */ - , bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */ + , qnum , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ , (struct ath_desc *) ds0 /* first descriptor */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 19:23:33 2012 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 5021F106566B; Mon, 20 Aug 2012 19:23:33 +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 3ADA18FC0C; Mon, 20 Aug 2012 19:23:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KJNXcR081332; Mon, 20 Aug 2012 19:23:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KJNXrT081330; Mon, 20 Aug 2012 19:23:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201923.q7KJNXrT081330@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 19:23:33 +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: r239466 - stable/7/contrib/ntp/ntpd 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, 20 Aug 2012 19:23:33 -0000 Author: emaste Date: Mon Aug 20 19:23:32 2012 New Revision: 239466 URL: http://svn.freebsd.org/changeset/base/239466 Log: MFC r232844: Remove extraneous log message When ntp switched between PLL and FLL mode it produced a log message "kernel time sync status change %04x". This issue is reported in ntp bug 452[1] which claims that this behaviour is normal and the log message isn't necessary. I'm not sure exactly when it was removed, but it's gone in the latest ntp release (4.2.6p5). [1] http://bugs.ntp.org/show_bug.cgi?id=452 Modified: stable/7/contrib/ntp/ntpd/ntp_loopfilter.c Directory Properties: stable/7/contrib/ntp/ (props changed) Modified: stable/7/contrib/ntp/ntpd/ntp_loopfilter.c ============================================================================== --- stable/7/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 18:57:41 2012 (r239465) +++ stable/7/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 19:23:32 2012 (r239466) @@ -646,12 +646,6 @@ local_clock( msyslog(LOG_NOTICE, "kernel time sync error %04x", ntv.status); ntv.status &= ~(STA_PPSFREQ | STA_PPSTIME); - } else { - if ((ntv.status ^ pll_status) & ~STA_FLL) - NLOG(NLOG_SYNCEVENT | NLOG_SYSEVENT) - msyslog(LOG_NOTICE, - "kernel time sync status change %04x", - ntv.status); } pll_status = ntv.status; #ifdef STA_NANO From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 19:26:44 2012 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 84C03106564A; Mon, 20 Aug 2012 19:26:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7258FC15; Mon, 20 Aug 2012 19:26:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KJQi51081715; Mon, 20 Aug 2012 19:26:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KJQiMY081712; Mon, 20 Aug 2012 19:26:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208201926.q7KJQiMY081712@svn.freebsd.org> From: Ed Maste Date: Mon, 20 Aug 2012 19:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239467 - stable/8/contrib/ntp/ntpd X-BeenThere: svn-src-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, 20 Aug 2012 19:26:44 -0000 Author: emaste Date: Mon Aug 20 19:26:43 2012 New Revision: 239467 URL: http://svn.freebsd.org/changeset/base/239467 Log: MFC r232844: Remove extraneous log message When ntp switched between PLL and FLL mode it produced a log message "kernel time sync status change %04x". This issue is reported in ntp bug 452[1] which claims that this behaviour is normal and the log message isn't necessary. I'm not sure exactly when it was removed, but it's gone in the latest ntp release (4.2.6p5). [1] http://bugs.ntp.org/show_bug.cgi?id=452 Modified: stable/8/contrib/ntp/ntpd/ntp_loopfilter.c Directory Properties: stable/8/contrib/ntp/ (props changed) Modified: stable/8/contrib/ntp/ntpd/ntp_loopfilter.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 19:23:32 2012 (r239466) +++ stable/8/contrib/ntp/ntpd/ntp_loopfilter.c Mon Aug 20 19:26:43 2012 (r239467) @@ -646,12 +646,6 @@ local_clock( msyslog(LOG_NOTICE, "kernel time sync error %04x", ntv.status); ntv.status &= ~(STA_PPSFREQ | STA_PPSTIME); - } else { - if ((ntv.status ^ pll_status) & ~STA_FLL) - NLOG(NLOG_SYNCEVENT | NLOG_SYSEVENT) - msyslog(LOG_NOTICE, - "kernel time sync status change %04x", - ntv.status); } pll_status = ntv.status; #ifdef STA_NANO From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 20:40:15 2012 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 232AB1065676; Mon, 20 Aug 2012 20:40:15 +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 0E3BE8FC18; Mon, 20 Aug 2012 20:40:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KKeEaO089793; Mon, 20 Aug 2012 20:40:14 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KKeEP0089791; Mon, 20 Aug 2012 20:40:14 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208202040.q7KKeEP0089791@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 20 Aug 2012 20:40: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: r239468 - head/sbin/camcontrol 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, 20 Aug 2012 20:40:15 -0000 Author: pluknet Date: Mon Aug 20 20:40:14 2012 New Revision: 239468 URL: http://svn.freebsd.org/changeset/base/239468 Log: Avoid segfault in the 'smpphylist' subcommand. Initialize devlist.dev_queue tail queue early enough before its any potential traversal in freebusdevlist() when in smpphylist error path. Reported by: Pavel Polyakov (on irc) Reviewed by: ken MFC after: 5 days Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Aug 20 19:26:43 2012 (r239467) +++ head/sbin/camcontrol/camcontrol.c Mon Aug 20 20:40:14 2012 (r239468) @@ -5459,6 +5459,7 @@ smpphylist(struct cam_device *device, in bzero(&(&ccb->ccb_h)[1], sizeof(union ccb) - sizeof(struct ccb_hdr)); + STAILQ_INIT(&devlist.dev_queue); rgrequest = malloc(sizeof(*rgrequest)); if (rgrequest == NULL) { @@ -5527,7 +5528,6 @@ smpphylist(struct cam_device *device, in goto bailout; } - STAILQ_INIT(&devlist.dev_queue); devlist.path_id = device->path_id; retval = buildbusdevlist(&devlist); From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 20:55:25 2012 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 28778106566C; Mon, 20 Aug 2012 20:55:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id D8B598FC08; Mon, 20 Aug 2012 20:55:24 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so7927124pbb.13 for ; Mon, 20 Aug 2012 13:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=AZfIWqkwRfkYZ0+1guxz0j6mh6qoGI4eW9ZJQZ+69Q4=; b=eBA6Q5yr83gXnguaTuCqo+XXwvaRkhgtiT5/tsPZi0pDdHio8hNO6ZCQKVK7/se5kV xCAVMtDvm2SV3w3DQZ7ff4BtmnftXOOCkq7Nb6cAprjAeT3e2VtAg3tfm5xPHrFZVtWx hog5am2fjihpGYbrvrtajQAs8vtwJZotddtlDrCDGNECy0XXVZ9lGjVIugKkcCxrSdDn Ly7jzVJQhILL1KIbqN6AG42ljh7tjgZxfIpOk6jnd21l58NHlUiD+BpLwMzZrXb2X2YV 0dzBjAphAI6zQz5AyIwHnkpFx5WRQ4hTDESrbEAjjE0jy63CT+qowPXPF91+cvGcyBkU rA1Q== MIME-Version: 1.0 Received: by 10.66.75.195 with SMTP id e3mr32523613paw.32.1345496124222; Mon, 20 Aug 2012 13:55:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.43.169 with HTTP; Mon, 20 Aug 2012 13:55:24 -0700 (PDT) In-Reply-To: References: <20120819202622.6db6a8dd@fubar.geek.nz> Date: Mon, 20 Aug 2012 13:55:24 -0700 X-Google-Sender-Auth: BiDobMTOjmOaVNoCU7Ft1LGQ0zk Message-ID: From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andrew Turner , Hans Petter Selasky Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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, 20 Aug 2012 20:55:25 -0000 I have a report that AR71XX (MIPS) USB broke with this change. Hans, would you mind reverting it until we figure out what's going on in the non-intel USB world? Thanks, Adrian On 19 August 2012 05:15, Hans Petter Selasky wrote: > Hi, > > > > What exactly is the driver the USB mass storage device is attached to? > > > > And the problem is the same using the latest FreeBSD version from -current? > > > > You are certain that all parts of the kernel were rebuilt? > > > > And you are certain that it has nothing to do with the FreeBSD version bump > which is also part of this change? > > > > Probably we should move this thread to -current @ > > > > --HPS > > > -----Original message----- > From: Andrew Turner > Sent: Sun 19-08-2012 10:27 > Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller > sys > To: Hans Petter Selasky ; > CC: Hans Petter Selasky ; svn-src-head@freebsd.org; > svn-src-all@freebsd.org; src-committers@freebsd.org; > On Sun, 19 Aug 2012 09:39:11 +0200 > Hans Petter Selasky wrote: > >> Hi, >> >> >> >> Have you stepped the versions? > I did a binary search of the commits to find the revision that caused > the issue. > >> Are you sure it is exactly this commit? > I built with r239213 and the problem went away, when I built with > r239214 it appeared again. > > Andrew From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 20:56:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70896106566B; Mon, 20 Aug 2012 20:56:41 +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 432798FC18; Mon, 20 Aug 2012 20:56:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KKuf4T091674; Mon, 20 Aug 2012 20:56:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KKufOt091671; Mon, 20 Aug 2012 20:56:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208202056.q7KKufOt091671@svn.freebsd.org> From: Dimitry Andric Date: Mon, 20 Aug 2012 20:56: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: r239469 - in head: lib/clang/include tools/build/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, 20 Aug 2012 20:56:41 -0000 Author: dim Date: Mon Aug 20 20:56:40 2012 New Revision: 239469 URL: http://svn.freebsd.org/changeset/base/239469 Log: Add three additional clang intrinsics headers, which I missed in the previous import. Modified: head/lib/clang/include/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/lib/clang/include/Makefile ============================================================================== --- head/lib/clang/include/Makefile Mon Aug 20 20:40:14 2012 (r239468) +++ head/lib/clang/include/Makefile Mon Aug 20 20:56:40 2012 (r239469) @@ -5,6 +5,7 @@ INCSDIR=${INCLUDEDIR}/clang/3.2 INCS= altivec.h \ + ammintrin.h \ avx2intrin.h \ avxintrin.h \ bmi2intrin.h \ @@ -12,6 +13,7 @@ INCS= altivec.h \ cpuid.h \ emmintrin.h \ fma4intrin.h \ + fmaintrin.h \ immintrin.h \ lzcntintrin.h \ mm3dnow.h \ @@ -26,7 +28,8 @@ INCS= altivec.h \ unwind.h \ wmmintrin.h \ x86intrin.h \ - xmmintrin.h + xmmintrin.h \ + xopintrin.h .include .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Aug 20 20:40:14 2012 (r239468) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Aug 20 20:56:40 2012 (r239469) @@ -684,6 +684,7 @@ OLD_FILES+=usr/include/clang/3.1/x86intr OLD_FILES+=usr/include/clang/3.1/xmmintrin.h OLD_DIRS+=usr/include/clang/3.1 OLD_FILES+=usr/include/clang/3.2/altivec.h +OLD_FILES+=usr/include/clang/3.2/ammintrin.h OLD_FILES+=usr/include/clang/3.2/avx2intrin.h OLD_FILES+=usr/include/clang/3.2/avxintrin.h OLD_FILES+=usr/include/clang/3.2/bmi2intrin.h @@ -691,6 +692,7 @@ OLD_FILES+=usr/include/clang/3.2/bmiintr OLD_FILES+=usr/include/clang/3.2/cpuid.h OLD_FILES+=usr/include/clang/3.2/emmintrin.h OLD_FILES+=usr/include/clang/3.2/fma4intrin.h +OLD_FILES+=usr/include/clang/3.2/fmaintrin.h OLD_FILES+=usr/include/clang/3.2/immintrin.h OLD_FILES+=usr/include/clang/3.2/lzcntintrin.h OLD_FILES+=usr/include/clang/3.2/mm3dnow.h @@ -706,6 +708,7 @@ OLD_FILES+=usr/include/clang/3.2/unwind. OLD_FILES+=usr/include/clang/3.2/wmmintrin.h OLD_FILES+=usr/include/clang/3.2/x86intrin.h OLD_FILES+=usr/include/clang/3.2/xmmintrin.h +OLD_FILES+=usr/include/clang/3.2/xopintrin.h OLD_DIRS+=usr/include/clang/3.2 OLD_DIRS+=usr/include/clang OLD_FILES+=usr/share/doc/llvm/clang/LICENSE.TXT From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 21:09:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EFD2106567A for ; Mon, 20 Aug 2012 21:09:47 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta01.emeryville.ca.mail.comcast.net (qmta01.emeryville.ca.mail.comcast.net [76.96.30.16]) by mx1.freebsd.org (Postfix) with ESMTP id 39A458FC16 for ; Mon, 20 Aug 2012 21:09:47 +0000 (UTC) Received: from omta24.emeryville.ca.mail.comcast.net ([76.96.30.92]) by qmta01.emeryville.ca.mail.comcast.net with comcast id p8dT1j0061zF43QA199ho9; Mon, 20 Aug 2012 21:09:41 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta24.emeryville.ca.mail.comcast.net with comcast id p99f1j00a4NgCEG8k99g0l; Mon, 20 Aug 2012 21:09:41 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q7KL9bF3021433; Mon, 20 Aug 2012 15:09:37 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Adrian Chadd In-Reply-To: References: <20120819202622.6db6a8dd@fubar.geek.nz> Content-Type: text/plain; charset="us-ascii" Date: Mon, 20 Aug 2012 15:09:37 -0600 Message-ID: <1345496977.27688.332.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: "src-committers@freebsd.org" , Hans Petter Selasky , "svn-src-all@freebsd.org" , Andrew Turner , Hans Petter Selasky , "svn-src-head@freebsd.org" Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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, 20 Aug 2012 21:09:47 -0000 On Mon, 2012-08-20 at 13:55 -0700, Adrian Chadd wrote: > I have a report that AR71XX (MIPS) USB broke with this change. > > Hans, would you mind reverting it until we figure out what's going on > in the non-intel USB world? > > Thanks, > > > Adrian It appears that the change in structure sizes has resulted in things shuffling around in memory in a way that triggers a partial cacheline flush bug in the busdma routines for ARM (and I guess for MIPS too). I'm chasing the actual bug in the ARM code, since it's now 100% reproducible. I'm hoping it's the concrete proof for a bug I've long thought was possible in theory. In the meantime, a quick and easy way to work around the problem is to add to your kernel config: option USB_HOST_ALIGN=32 # data cache line size on your platform Since it appears (at least until some evidence points elsewhere) that the problem is in the busdma code for architectures with VIVT caches, I'm not sure reverting the usb changes would be the right move. Avoiding an MFC until we know more might be a good idea, though. -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 21:27:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 30EBF106567E; Mon, 20 Aug 2012 21:27:11 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id DD3468FC1B; Mon, 20 Aug 2012 21:27:10 +0000 (UTC) Received: from [192.168.1.18] (unknown [217.157.7.221]) by csmtp3.one.com (Postfix) with ESMTPA id C60E124063B0; Mon, 20 Aug 2012 21:21:44 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Erik Cederstrand In-Reply-To: <201208201833.q7KIX58p075876@svn.freebsd.org> Date: Mon, 20 Aug 2012 23:21:44 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <201208201833.q7KIX58p075876@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239462 - in head: . contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/Bitcode contrib/llv... 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, 20 Aug 2012 21:27:11 -0000 Den 20/08/2012 kl. 20.33 skrev Dimitry Andric: > Author: dim > Date: Mon Aug 20 18:33:03 2012 > New Revision: 239462 > URL: http://svn.freebsd.org/changeset/base/239462 > > Log: > Upgrade our copy of llvm/clang to trunk r162107. With thanks to > Benjamin Kramer and Joerg Sonnenberger for their input and fixes. Thanks! Erik From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 23:43:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE0361065670; Mon, 20 Aug 2012 23:43:04 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E18B8FC15; Mon, 20 Aug 2012 23:43:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KNh4Ni015638; Mon, 20 Aug 2012 23:43:04 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KNh4QG015636; Mon, 20 Aug 2012 23:43:04 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208202343.q7KNh4QG015636@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 20 Aug 2012 23:43: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: r239470 - head/libexec/rtld-elf 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, 20 Aug 2012 23:43:04 -0000 Author: kan Date: Mon Aug 20 23:43:03 2012 New Revision: 239470 URL: http://svn.freebsd.org/changeset/base/239470 Log: Do not call process_nodelete with NULL object pointer. The place where the function is called can be reached if object loading and relocation fails too, in which case obj pointer will be NULL. Do not call process_nodelete then, or crash will follow. Pointy hat to: kan Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Aug 20 20:56:40 2012 (r239469) +++ head/libexec/rtld-elf/rtld.c Mon Aug 20 23:43:03 2012 (r239470) @@ -2853,7 +2853,8 @@ dlopen_object(const char *name, int fd, * This has to be done after we have loaded all of the * dependencies, so that we do not miss any. */ - process_nodelete(obj); + if (obj != NULL) + process_nodelete(obj); } else { /* * Bump the reference counts for objects on this DAG. If From owner-svn-src-all@FreeBSD.ORG Mon Aug 20 23:47:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82080106564A; Mon, 20 Aug 2012 23:47:25 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D8ED8FC16; Mon, 20 Aug 2012 23:47:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7KNlP72016323; Mon, 20 Aug 2012 23:47:25 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KNlPZe016321; Mon, 20 Aug 2012 23:47:25 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208202347.q7KNlPZe016321@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 20 Aug 2012 23:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239471 - stable/9/libexec/rtld-elf 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, 20 Aug 2012 23:47:25 -0000 Author: kan Date: Mon Aug 20 23:47:24 2012 New Revision: 239471 URL: http://svn.freebsd.org/changeset/base/239471 Log: MFC r239470: Do not call process_nodelete with NULL object pointer. The place where the function is called can be reached if object loading and relocation fails too, in which case obj pointer will be NULL. Do not call process_nodelete then, or crash will follow. Pointy hat to: kan Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Mon Aug 20 23:43:03 2012 (r239470) +++ stable/9/libexec/rtld-elf/rtld.c Mon Aug 20 23:47:24 2012 (r239471) @@ -2698,7 +2698,8 @@ dlopen_object(const char *name, int fd, * This has to be done after we have loaded all of the * dependencies, so that we do not miss any. */ - process_nodelete(obj); + if (obj != NULL) + process_nodelete(obj); } else { /* * Bump the reference counts for objects on this DAG. If From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 00:03:04 2012 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 E88E4106566C; Tue, 21 Aug 2012 00:03:04 +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 D026F8FC08; Tue, 21 Aug 2012 00:03:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L034oZ018610; Tue, 21 Aug 2012 00:03:04 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L0342r018598; Tue, 21 Aug 2012 00:03:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208210003.q7L0342r018598@svn.freebsd.org> From: Ed Maste Date: Tue, 21 Aug 2012 00:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239472 - in stable/9/sys: dev/virtio dev/virtio/balloon dev/virtio/block dev/virtio/network dev/virtio/pci modules modules/virtio 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, 21 Aug 2012 00:03:05 -0000 Author: emaste Date: Tue Aug 21 00:03:04 2012 New Revision: 239472 URL: http://svn.freebsd.org/changeset/base/239472 Log: MFC r227652, r228301, r234270, r234349 Sync Bryan Venteicher's virtio base, PCI front-end, and net/block/balloon drivers from HEAD. Added: stable/9/sys/dev/virtio/ - copied from r227652, head/sys/dev/virtio/ stable/9/sys/modules/virtio/ - copied from r227652, head/sys/modules/virtio/ Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.c stable/9/sys/dev/virtio/balloon/virtio_balloon.h stable/9/sys/dev/virtio/block/virtio_blk.c stable/9/sys/dev/virtio/block/virtio_blk.h stable/9/sys/dev/virtio/network/if_vtnet.c stable/9/sys/dev/virtio/network/if_vtnetvar.h stable/9/sys/dev/virtio/network/virtio_net.h stable/9/sys/dev/virtio/pci/virtio_pci.c stable/9/sys/dev/virtio/pci/virtio_pci.h stable/9/sys/dev/virtio/virtio.h stable/9/sys/dev/virtio/virtio_ring.h stable/9/sys/dev/virtio/virtqueue.c stable/9/sys/dev/virtio/virtqueue.h stable/9/sys/modules/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/balloon/virtio_balloon.c Tue Aug 21 00:03:04 2012 (r239472) @@ -122,6 +122,9 @@ static void vtballoon_add_sysctl(struct */ #define VTBALLOON_PAGES_PER_REQUEST 256 +/* Must be able to fix all pages frames in one page (segment). */ +CTASSERT(VTBALLOON_PAGES_PER_REQUEST * sizeof(uint32_t) <= PAGE_SIZE); + #define VTBALLOON_MTX(_sc) &(_sc)->vtballoon_mtx #define VTBALLOON_LOCK_INIT(_sc, _name) mtx_init(VTBALLOON_MTX((_sc)), _name, \ "VirtIO Balloon Lock", MTX_SPIN) @@ -138,7 +141,7 @@ static device_method_t vtballoon_methods /* VirtIO methods. */ DEVMETHOD(virtio_config_change, vtballoon_config_change), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtballoon_driver = { @@ -402,13 +405,13 @@ vtballoon_send_page_frames(struct vtball error = virtqueue_enqueue(vq, vq, &sg, 1, 0); KASSERT(error == 0, ("error enqueuing page frames to virtqueue")); + virtqueue_notify(vq); /* * Inflate and deflate operations are done synchronously. The * interrupt handler will wake us up. */ VTBALLOON_LOCK(sc); - virtqueue_notify(vq); while ((c = virtqueue_dequeue(vq, NULL)) == NULL) msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); @@ -475,7 +478,6 @@ vtballoon_update_size(struct vtballoon_s virtio_write_dev_config_4(sc->vtballoon_dev, offsetof(struct virtio_balloon_config, actual), htole32(sc->vtballoon_current_npages)); - } static int Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.h ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/balloon/virtio_balloon.h Tue Aug 21 00:03:04 2012 (r239472) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ Modified: stable/9/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/block/virtio_blk.c Tue Aug 21 00:03:04 2012 (r239472) @@ -70,8 +70,8 @@ struct vtblk_softc { uint32_t vtblk_flags; #define VTBLK_FLAG_INDIRECT 0x0001 #define VTBLK_FLAG_READONLY 0x0002 -#define VTBLK_FLAG_DETACHING 0x0004 -#define VTBLK_FLAG_SUSPENDED 0x0008 +#define VTBLK_FLAG_DETACH 0x0004 +#define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_DUMPING 0x0010 struct virtqueue *vtblk_vq; @@ -82,14 +82,12 @@ struct vtblk_softc { TAILQ_HEAD(, vtblk_request) vtblk_req_free; TAILQ_HEAD(, vtblk_request) - vtblk_req_ready; + vtblk_req_ready; struct taskqueue *vtblk_tq; struct task vtblk_intr_task; - int vtblk_sector_size; int vtblk_max_nsegs; - int vtblk_unit; int vtblk_request_count; struct vtblk_request vtblk_dump_request; @@ -118,6 +116,13 @@ static int vtblk_suspend(device_t); static int vtblk_resume(device_t); static int vtblk_shutdown(device_t); +static int vtblk_open(struct disk *); +static int vtblk_close(struct disk *); +static int vtblk_ioctl(struct disk *, u_long, void *, int, + struct thread *); +static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); +static void vtblk_strategy(struct bio *); + static void vtblk_negotiate_features(struct vtblk_softc *); static int vtblk_maximum_segments(struct vtblk_softc *, struct virtio_blk_config *); @@ -126,13 +131,7 @@ static void vtblk_alloc_disk(struct vtbl struct virtio_blk_config *); static void vtblk_create_disk(struct vtblk_softc *); -static int vtblk_open(struct disk *); -static int vtblk_close(struct disk *); -static int vtblk_ioctl(struct disk *, u_long, void *, int, - struct thread *); -static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); -static void vtblk_strategy(struct bio *); - +static int vtblk_quiesce(struct vtblk_softc *); static void vtblk_startio(struct vtblk_softc *); static struct vtblk_request * vtblk_bio_request(struct vtblk_softc *); static int vtblk_execute_request(struct vtblk_softc *, @@ -150,6 +149,7 @@ static int vtblk_flush_dump(struct vtblk static int vtblk_poll_request(struct vtblk_softc *, struct vtblk_request *); +static void vtblk_finish_completed(struct vtblk_softc *); static void vtblk_drain_vq(struct vtblk_softc *, int); static void vtblk_drain(struct vtblk_softc *); @@ -163,7 +163,8 @@ static struct vtblk_request * vtblk_dequ static void vtblk_enqueue_ready(struct vtblk_softc *, struct vtblk_request *); -static void vtblk_bio_error(struct bio *, int); +static int vtblk_request_error(struct vtblk_request *); +static void vtblk_finish_bio(struct bio *, int); /* Tunables. */ static int vtblk_no_ident = 0; @@ -185,16 +186,14 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ mtx_init(VTBLK_MTX((_sc)), (_name), \ "VTBLK Lock", MTX_DEF) #define VTBLK_LOCK(_sc) mtx_lock(VTBLK_MTX((_sc))) -#define VTBLK_TRYLOCK(_sc) mtx_trylock(VTBLK_MTX((_sc))) #define VTBLK_UNLOCK(_sc) mtx_unlock(VTBLK_MTX((_sc))) #define VTBLK_LOCK_DESTROY(_sc) mtx_destroy(VTBLK_MTX((_sc))) #define VTBLK_LOCK_ASSERT(_sc) mtx_assert(VTBLK_MTX((_sc)), MA_OWNED) #define VTBLK_LOCK_ASSERT_NOTOWNED(_sc) \ mtx_assert(VTBLK_MTX((_sc)), MA_NOTOWNED) -#define VTBLK_BIO_SEGMENTS(_bp) sglist_count((_bp)->bio_data, (_bp)->bio_bcount) - #define VTBLK_DISK_NAME "vtbd" +#define VTBLK_QUIESCE_TIMEOUT (30 * hz) /* * Each block request uses at least two segments - one for the header @@ -213,7 +212,7 @@ static device_method_t vtblk_methods[] = DEVMETHOD(device_resume, vtblk_resume), DEVMETHOD(device_shutdown, vtblk_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtblk_driver = { @@ -281,7 +280,6 @@ vtblk_attach(device_t dev) sc = device_get_softc(dev); sc->vtblk_dev = dev; - sc->vtblk_unit = device_get_unit(dev); VTBLK_LOCK_INIT(sc, device_get_nameunit(dev)); @@ -299,13 +297,8 @@ vtblk_attach(device_t dev) sc->vtblk_flags |= VTBLK_FLAG_READONLY; /* Get local copy of config. */ - if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY) == 0) { - bzero(&blkcfg, sizeof(struct virtio_blk_config)); - virtio_read_device_config(dev, 0, &blkcfg, - offsetof(struct virtio_blk_config, physical_block_exp)); - } else - virtio_read_device_config(dev, 0, &blkcfg, - sizeof(struct virtio_blk_config)); + virtio_read_device_config(dev, 0, &blkcfg, + sizeof(struct virtio_blk_config)); /* * With the current sglist(9) implementation, it is not easy @@ -323,11 +316,13 @@ vtblk_attach(device_t dev) } sc->vtblk_max_nsegs = vtblk_maximum_segments(sc, &blkcfg); + if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { + error = EINVAL; + device_printf(dev, "fewer than minimum number of segments " + "allowed: %d\n", sc->vtblk_max_nsegs); + goto fail; + } - /* - * Allocate working sglist. The number of segments may be too - * large to safely store on the stack. - */ sc->vtblk_sglist = sglist_alloc(sc->vtblk_max_nsegs, M_NOWAIT); if (sc->vtblk_sglist == NULL) { error = ENOMEM; @@ -385,7 +380,7 @@ vtblk_detach(device_t dev) sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags |= VTBLK_FLAG_DETACHING; + sc->vtblk_flags |= VTBLK_FLAG_DETACH; if (device_is_attached(dev)) vtblk_stop(sc); VTBLK_UNLOCK(sc); @@ -417,15 +412,19 @@ static int vtblk_suspend(device_t dev) { struct vtblk_softc *sc; + int error; sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags |= VTBLK_FLAG_SUSPENDED; - /* TODO Wait for any inflight IO to complete? */ + sc->vtblk_flags |= VTBLK_FLAG_SUSPEND; + /* XXX BMV: virtio_stop(), etc needed here? */ + error = vtblk_quiesce(sc); + if (error) + sc->vtblk_flags &= ~VTBLK_FLAG_SUSPEND; VTBLK_UNLOCK(sc); - return (0); + return (error); } static int @@ -436,8 +435,9 @@ vtblk_resume(device_t dev) sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags &= ~VTBLK_FLAG_SUSPENDED; - /* TODO Resume IO? */ + /* XXX BMV: virtio_reinit(), etc needed here? */ + sc->vtblk_flags &= ~VTBLK_FLAG_SUSPEND; + vtblk_startio(sc); VTBLK_UNLOCK(sc); return (0); @@ -458,7 +458,7 @@ vtblk_open(struct disk *dp) if ((sc = dp->d_drv1) == NULL) return (ENXIO); - return (sc->vtblk_flags & VTBLK_FLAG_DETACHING ? ENXIO : 0); + return (sc->vtblk_flags & VTBLK_FLAG_DETACH ? ENXIO : 0); } static int @@ -498,11 +498,7 @@ vtblk_dump(void *arg, void *virtual, vm_ if ((sc = dp->d_drv1) == NULL) return (ENXIO); - if (VTBLK_TRYLOCK(sc) == 0) { - device_printf(sc->vtblk_dev, - "softc already locked, cannot dump...\n"); - return (EBUSY); - } + VTBLK_LOCK(sc); if ((sc->vtblk_flags & VTBLK_FLAG_DUMPING) == 0) { vtblk_prepare_dump(sc); @@ -513,6 +509,10 @@ vtblk_dump(void *arg, void *virtual, vm_ error = vtblk_write_dump(sc, virtual, offset, length); else if (virtual == NULL && offset == 0) error = vtblk_flush_dump(sc); + else { + error = EINVAL; + sc->vtblk_flags &= ~VTBLK_FLAG_DUMPING; + } VTBLK_UNLOCK(sc); @@ -525,7 +525,7 @@ vtblk_strategy(struct bio *bp) struct vtblk_softc *sc; if ((sc = bp->bio_disk->d_drv1) == NULL) { - vtblk_bio_error(bp, EINVAL); + vtblk_finish_bio(bp, EINVAL); return; } @@ -535,29 +535,37 @@ vtblk_strategy(struct bio *bp) */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { - vtblk_bio_error(bp, EROFS); + vtblk_finish_bio(bp, EROFS); return; } +#ifdef INVARIANTS /* * Prevent read/write buffers spanning too many segments from * getting into the queue. This should only trip if d_maxsize * was incorrectly set. */ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - KASSERT(VTBLK_BIO_SEGMENTS(bp) <= sc->vtblk_max_nsegs - - VTBLK_MIN_SEGMENTS, + int nsegs, max_nsegs; + + nsegs = sglist_count(bp->bio_data, bp->bio_bcount); + max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; + + KASSERT(nsegs <= max_nsegs, ("bio spanned too many segments: %d, max: %d", - VTBLK_BIO_SEGMENTS(bp), - sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS)); + nsegs, max_nsegs)); } +#endif VTBLK_LOCK(sc); - if ((sc->vtblk_flags & VTBLK_FLAG_DETACHING) == 0) { + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) + vtblk_finish_bio(bp, ENXIO); + else { bioq_disksort(&sc->vtblk_bioq, bp); - vtblk_startio(sc); - } else - vtblk_bio_error(bp, ENXIO); + + if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) + vtblk_startio(sc); + } VTBLK_UNLOCK(sc); } @@ -622,7 +630,7 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_ioctl = vtblk_ioctl; dp->d_strategy = vtblk_strategy; dp->d_name = VTBLK_DISK_NAME; - dp->d_unit = sc->vtblk_unit; + dp->d_unit = device_get_unit(dev); dp->d_drv1 = sc; if ((sc->vtblk_flags & VTBLK_FLAG_READONLY) == 0) @@ -632,10 +640,9 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_mediasize = blkcfg->capacity * 512; if (virtio_with_feature(dev, VIRTIO_BLK_F_BLK_SIZE)) - sc->vtblk_sector_size = blkcfg->blk_size; + dp->d_sectorsize = blkcfg->blk_size; else - sc->vtblk_sector_size = 512; - dp->d_sectorsize = sc->vtblk_sector_size; + dp->d_sectorsize = 512; /* * The VirtIO maximum I/O size is given in terms of segments. @@ -685,6 +692,26 @@ vtblk_create_disk(struct vtblk_softc *sc disk_create(dp, DISK_VERSION); } +static int +vtblk_quiesce(struct vtblk_softc *sc) +{ + int error; + + error = 0; + + VTBLK_LOCK_ASSERT(sc); + + while (!virtqueue_empty(sc->vtblk_vq)) { + if (mtx_sleep(&sc->vtblk_vq, VTBLK_MTX(sc), PRIBIO, "vtblkq", + VTBLK_QUIESCE_TIMEOUT) == EWOULDBLOCK) { + error = EBUSY; + break; + } + } + + return (error); +} + static void vtblk_startio(struct vtblk_softc *sc) { @@ -697,9 +724,6 @@ vtblk_startio(struct vtblk_softc *sc) VTBLK_LOCK_ASSERT(sc); - if (sc->vtblk_flags & VTBLK_FLAG_SUSPENDED) - return; - while (!virtqueue_full(vq)) { if ((req = vtblk_dequeue_ready(sc)) == NULL) req = vtblk_bio_request(sc); @@ -752,9 +776,8 @@ vtblk_bio_request(struct vtblk_softc *sc req->vbr_hdr.sector = bp->bio_offset / 512; break; default: - KASSERT(0, ("bio with unhandled cmd: %d", bp->bio_cmd)); - req->vbr_hdr.type = -1; - break; + panic("%s: bio with unhandled cmd: %d", __FUNCTION__, + bp->bio_cmd); } if (bp->bio_flags & BIO_ORDERED) @@ -768,7 +791,7 @@ vtblk_execute_request(struct vtblk_softc { struct sglist *sg; struct bio *bp; - int writable, error; + int readable, writable, error; sg = sc->vtblk_sglist; bp = req->vbr_bp; @@ -799,10 +822,9 @@ vtblk_execute_request(struct vtblk_softc KASSERT(sg->sg_nseg >= VTBLK_MIN_SEGMENTS, ("fewer than min segments: %d", sg->sg_nseg)); - error = virtqueue_enqueue(sc->vtblk_vq, req, sg, - sg->sg_nseg - writable, writable); + readable = sg->sg_nseg - writable; - return (error); + return (virtqueue_enqueue(sc->vtblk_vq, req, sg, readable, writable)); } static int @@ -822,37 +844,23 @@ static void vtblk_intr_task(void *arg, int pending) { struct vtblk_softc *sc; - struct vtblk_request *req; struct virtqueue *vq; - struct bio *bp; sc = arg; vq = sc->vtblk_vq; VTBLK_LOCK(sc); - if (sc->vtblk_flags & VTBLK_FLAG_DETACHING) { + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { VTBLK_UNLOCK(sc); return; } - while ((req = virtqueue_dequeue(vq, NULL)) != NULL) { - bp = req->vbr_bp; + vtblk_finish_completed(sc); - if (req->vbr_ack == VIRTIO_BLK_S_OK) - bp->bio_resid = 0; - else { - bp->bio_flags |= BIO_ERROR; - if (req->vbr_ack == VIRTIO_BLK_S_UNSUPP) - bp->bio_error = ENOTSUP; - else - bp->bio_error = EIO; - } - - biodone(bp); - vtblk_enqueue_request(sc, req); - } - - vtblk_startio(sc); + if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) + vtblk_startio(sc); + else + wakeup(&sc->vtblk_vq); if (virtqueue_enable_intr(vq) != 0) { virtqueue_disable_intr(vq); @@ -905,9 +913,10 @@ vtblk_get_ident(struct vtblk_softc *sc) VTBLK_LOCK(sc); error = vtblk_poll_request(sc, req); - vtblk_enqueue_request(sc, req); VTBLK_UNLOCK(sc); + vtblk_enqueue_request(sc, req); + if (error) { device_printf(sc->vtblk_dev, "error getting device identifier: %d\n", error); @@ -1006,17 +1015,35 @@ vtblk_poll_request(struct vtblk_softc *s r = virtqueue_poll(vq, NULL); KASSERT(r == req, ("unexpected request response")); - if (req->vbr_ack != VIRTIO_BLK_S_OK) { - error = req->vbr_ack == VIRTIO_BLK_S_UNSUPP ? ENOTSUP : EIO; - if (bootverbose) - device_printf(dev, - "vtblk_poll_request: IO error: %d\n", error); + error = vtblk_request_error(req); + if (error && bootverbose) { + device_printf(dev, "vtblk_poll_request: IO error: %d\n", + error); } return (error); } static void +vtblk_finish_completed(struct vtblk_softc *sc) +{ + struct vtblk_request *req; + struct bio *bp; + int error; + + while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { + bp = req->vbr_bp; + + error = vtblk_request_error(req); + if (error) + disk_err(bp, "hard error", -1, 1); + + vtblk_finish_bio(bp, error); + vtblk_enqueue_request(sc, req); + } +} + +static void vtblk_drain_vq(struct vtblk_softc *sc, int skip_done) { struct virtqueue *vq; @@ -1028,7 +1055,7 @@ vtblk_drain_vq(struct vtblk_softc *sc, i while ((req = virtqueue_drain(vq, &last)) != NULL) { if (!skip_done) - vtblk_bio_error(req->vbr_bp, ENXIO); + vtblk_finish_bio(req->vbr_bp, ENXIO); vtblk_enqueue_request(sc, req); } @@ -1045,17 +1072,19 @@ vtblk_drain(struct vtblk_softc *sc) bioq = &sc->vtblk_bioq; - if (sc->vtblk_vq != NULL) + if (sc->vtblk_vq != NULL) { + vtblk_finish_completed(sc); vtblk_drain_vq(sc, 0); + } while ((req = vtblk_dequeue_ready(sc)) != NULL) { - vtblk_bio_error(req->vbr_bp, ENXIO); + vtblk_finish_bio(req->vbr_bp, ENXIO); vtblk_enqueue_request(sc, req); } while (bioq_first(bioq) != NULL) { bp = bioq_takefirst(bioq); - vtblk_bio_error(bp, ENXIO); + vtblk_finish_bio(bp, ENXIO); } vtblk_free_requests(sc); @@ -1065,9 +1094,9 @@ static int vtblk_alloc_requests(struct vtblk_softc *sc) { struct vtblk_request *req; - int i, size; + int i, nreqs; - size = virtqueue_size(sc->vtblk_vq); + nreqs = virtqueue_size(sc->vtblk_vq); /* * Preallocate sufficient requests to keep the virtqueue full. Each @@ -1075,9 +1104,9 @@ vtblk_alloc_requests(struct vtblk_softc * the number allocated when indirect descriptors are not available. */ if ((sc->vtblk_flags & VTBLK_FLAG_INDIRECT) == 0) - size /= VTBLK_MIN_SEGMENTS; + nreqs /= VTBLK_MIN_SEGMENTS; - for (i = 0; i < size; i++) { + for (i = 0; i < nreqs; i++) { req = uma_zalloc(vtblk_req_zone, M_NOWAIT); if (req == NULL) return (ENOMEM); @@ -1094,6 +1123,9 @@ vtblk_free_requests(struct vtblk_softc * { struct vtblk_request *req; + KASSERT(TAILQ_EMPTY(&sc->vtblk_req_ready), + ("ready requests left on queue")); + while ((req = vtblk_dequeue_request(sc)) != NULL) { sc->vtblk_request_count--; uma_zfree(vtblk_req_zone, req); @@ -1141,9 +1173,35 @@ vtblk_enqueue_ready(struct vtblk_softc * TAILQ_INSERT_HEAD(&sc->vtblk_req_ready, req, vbr_link); } +static int +vtblk_request_error(struct vtblk_request *req) +{ + int error; + + switch (req->vbr_ack) { + case VIRTIO_BLK_S_OK: + error = 0; + break; + case VIRTIO_BLK_S_UNSUPP: + error = ENOTSUP; + break; + default: + error = EIO; + break; + } + + return (error); +} + static void -vtblk_bio_error(struct bio *bp, int error) +vtblk_finish_bio(struct bio *bp, int error) { - biofinish(bp, NULL, error); + if (error) { + bp->bio_resid = bp->bio_bcount; + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; + } + + biodone(bp); } Modified: stable/9/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/block/virtio_blk.h Tue Aug 21 00:03:04 2012 (r239472) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ @@ -39,16 +62,6 @@ struct virtio_blk_config { /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ uint32_t blk_size; - - /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */ - /* exponent for physical block per logical block. */ - uint8_t physical_block_exp; - /* alignment offset in logical blocks. */ - uint8_t alignment_offset; - /* minimum I/O size without performance penalty in logical blocks. */ - uint16_t min_io_size; - /* optimal sustained I/O size in logical blocks. */ - uint32_t opt_io_size; } __packed; /* Modified: stable/9/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/network/if_vtnet.c Tue Aug 21 00:03:04 2012 (r239472) @@ -223,7 +223,7 @@ static device_method_t vtnet_methods[] = /* VirtIO methods. */ DEVMETHOD(virtio_config_change, vtnet_config_change), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtnet_driver = { @@ -317,8 +317,20 @@ vtnet_attach(device_t dev) if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { sc->vtnet_flags |= VTNET_FLAG_CTRL_VQ; - if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_RX)) + if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_RX)) { + sc->vtnet_mac_filter = malloc( + sizeof(struct vtnet_mac_filter), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (sc->vtnet_mac_filter == NULL) { + device_printf(dev, + "cannot allocate mac filter table\n"); + error = ENOMEM; + goto fail; + } + sc->vtnet_flags |= VTNET_FLAG_CTRL_RX; + } + if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) sc->vtnet_flags |= VTNET_FLAG_VLAN_FILTER; } @@ -505,7 +517,12 @@ vtnet_detach(device_t dev) sc->vtnet_vlan_detach = NULL; } - if (ifp) { + if (sc->vtnet_mac_filter != NULL) { + free(sc->vtnet_mac_filter, M_DEVBUF); + sc->vtnet_mac_filter = NULL; + } + + if (ifp != NULL) { if_free(ifp); sc->vtnet_ifp = NULL; } @@ -742,17 +759,11 @@ vtnet_update_link_status(struct vtnet_so if (link && ((sc->vtnet_flags & VTNET_FLAG_LINK) == 0)) { sc->vtnet_flags |= VTNET_FLAG_LINK; - if (bootverbose) - device_printf(dev, "Link is up\n"); - if_link_state_change(ifp, LINK_STATE_UP); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) vtnet_start_locked(ifp); } else if (!link && (sc->vtnet_flags & VTNET_FLAG_LINK)) { sc->vtnet_flags &= ~VTNET_FLAG_LINK; - if (bootverbose) - device_printf(dev, "Link is down\n"); - if_link_state_change(ifp, LINK_STATE_DOWN); } } @@ -1105,7 +1116,7 @@ vtnet_alloc_rxbuf(struct vtnet_softc *sc KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG, ("chained Rx mbuf requested without LRO_NOMRG")); - for (i = 0; i < nbufs - 1; i++) { + for (i = 1; i < nbufs; i++) { m = m_getjcl(M_DONTWAIT, MT_DATA, 0, clsize); if (m == NULL) goto fail; @@ -1143,9 +1154,8 @@ vtnet_replace_rxbuf(struct vtnet_softc * clsize = sc->vtnet_rx_mbuf_size; nreplace = 0; - if (m->m_next != NULL) - KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG, - ("chained Rx mbuf without LRO_NOMRG")); + KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG || + m->m_next == NULL, ("chained Rx mbuf without LRO_NOMRG")); /* * Since LRO_NOMRG mbuf chains are so large, we want to avoid @@ -1275,8 +1285,8 @@ vtnet_enqueue_rxbuf(struct vtnet_softc * int offset, error; VTNET_LOCK_ASSERT(sc); - if ((sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG) == 0) - KASSERT(m->m_next == NULL, ("chained Rx mbuf")); + KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG || + m->m_next == NULL, ("chained Rx mbuf without LRO_NOMRG")); sglist_init(&sg, VTNET_MAX_RX_SEGS, segs); @@ -1688,7 +1698,8 @@ vtnet_rxeof(struct vtnet_softc *sc, int break; } - virtqueue_notify(vq); + if (deq > 0) + virtqueue_notify(vq); if (rx_npktsp != NULL) *rx_npktsp = rx_npkts; @@ -1946,9 +1957,14 @@ vtnet_encap(struct vtnet_softc *sc, stru struct mbuf *m; int error; + m = *m_head; + txhdr = uma_zalloc(vtnet_tx_header_zone, M_NOWAIT | M_ZERO); - if (txhdr == NULL) + if (txhdr == NULL) { + *m_head = NULL; + m_freem(m); return (ENOMEM); + } /* * Always use the non-mergeable header to simplify things. When @@ -1957,21 +1973,22 @@ vtnet_encap(struct vtnet_softc *sc, stru * the correct header size to the host. */ hdr = &txhdr->vth_uhdr.hdr; - m = *m_head; - - error = ENOBUFS; if (m->m_flags & M_VLANTAG) { m = ether_vlanencap(m, m->m_pkthdr.ether_vtag); - if ((*m_head = m) == NULL) + if ((*m_head = m) == NULL) { + error = ENOBUFS; goto fail; + } m->m_flags &= ~M_VLANTAG; } if (m->m_pkthdr.csum_flags != 0) { m = vtnet_tx_offload(sc, m, hdr); - if ((*m_head = m) == NULL) + if ((*m_head = m) == NULL) { + error = ENOBUFS; goto fail; + } } error = vtnet_enqueue_txbuf(sc, m_head, txhdr); @@ -2387,6 +2404,7 @@ vtnet_rx_filter_mac(struct vtnet_softc * uint8_t ack; ifp = sc->vtnet_ifp; + filter = sc->vtnet_mac_filter; ucnt = 0; mcnt = 0; promisc = 0; @@ -2397,19 +2415,6 @@ vtnet_rx_filter_mac(struct vtnet_softc * KASSERT(sc->vtnet_flags & VTNET_FLAG_CTRL_RX, ("CTRL_RX feature not negotiated")); - /* - * Allocate the MAC filtering table. Note we could do this - * at attach time, but it is probably not worth keeping it - * around for an infrequent occurrence. - */ - filter = malloc(sizeof(struct vtnet_mac_filter), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (filter == NULL) { - device_printf(sc->vtnet_dev, - "cannot allocate MAC address filtering table\n"); - return; - } - /* Unicast MAC addresses: */ if_addr_rlock(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { @@ -2481,8 +2486,6 @@ vtnet_rx_filter_mac(struct vtnet_softc * if_printf(ifp, "error setting host MAC filter table\n"); out: - free(filter, M_DEVBUF); - if (promisc) if (vtnet_set_promisc(sc, 1) != 0) if_printf(ifp, "cannot enable promiscuous mode\n"); Modified: stable/9/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/network/if_vtnetvar.h Tue Aug 21 00:03:04 2012 (r239472) @@ -99,6 +99,7 @@ struct vtnet_softc { #define VTNET_MEDIATYPE (IFM_ETHER | IFM_1000_T | IFM_FDX) char vtnet_hwaddr[ETHER_ADDR_LEN]; + struct vtnet_mac_filter *vtnet_mac_filter; /* * During reset, the host's VLAN filtering table is lost. The * array below is used to restore all the VLANs configured on Modified: stable/9/sys/dev/virtio/network/virtio_net.h ============================================================================== --- head/sys/dev/virtio/network/virtio_net.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/network/virtio_net.h Tue Aug 21 00:03:04 2012 (r239472) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ Modified: stable/9/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/pci/virtio_pci.c Tue Aug 21 00:03:04 2012 (r239472) @@ -189,7 +189,7 @@ static device_method_t vtpci_methods[] = DEVMETHOD(virtio_bus_read_device_config, vtpci_read_dev_config), DEVMETHOD(virtio_bus_write_device_config, vtpci_write_dev_config), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtpci_driver = { Modified: stable/9/sys/dev/virtio/pci/virtio_pci.h ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/pci/virtio_pci.h Tue Aug 21 00:03:04 2012 (r239472) @@ -1,4 +1,4 @@ -/* +/*- * Copyright IBM Corp. 2007 * * Authors: @@ -7,6 +7,29 @@ * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ Modified: stable/9/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/9/sys/dev/virtio/virtio.h Tue Aug 21 00:03:04 2012 (r239472) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 00:05:45 2012 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 06A90106564A; Tue, 21 Aug 2012 00:05:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0F3C8FC1A; Tue, 21 Aug 2012 00:05:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L05ix0019041; Tue, 21 Aug 2012 00:05:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L05iF7019029; Tue, 21 Aug 2012 00:05:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208210005.q7L05iF7019029@svn.freebsd.org> From: Ed Maste Date: Tue, 21 Aug 2012 00:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239473 - in stable/8/sys: dev/virtio dev/virtio/balloon dev/virtio/block dev/virtio/network dev/virtio/pci modules modules/virtio X-BeenThere: svn-src-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, 21 Aug 2012 00:05:45 -0000 Author: emaste Date: Tue Aug 21 00:05:44 2012 New Revision: 239473 URL: http://svn.freebsd.org/changeset/base/239473 Log: MFC r227652, r228301, r234270, r234349 Sync Bryan Venteicher's virtio base, PCI front-end, and net/block/balloon drivers from HEAD. Added: - copied from r227652, head/sys/dev/virtio/ stable/8/sys/modules/virtio/ - copied from r227652, head/sys/modules/virtio/ Directory Properties: stable/8/sys/dev/virtio/ (props changed) Modified: stable/8/sys/dev/virtio/balloon/virtio_balloon.c stable/8/sys/dev/virtio/balloon/virtio_balloon.h stable/8/sys/dev/virtio/block/virtio_blk.c stable/8/sys/dev/virtio/block/virtio_blk.h stable/8/sys/dev/virtio/network/if_vtnet.c stable/8/sys/dev/virtio/network/if_vtnetvar.h stable/8/sys/dev/virtio/network/virtio_net.h stable/8/sys/dev/virtio/pci/virtio_pci.c stable/8/sys/dev/virtio/pci/virtio_pci.h stable/8/sys/dev/virtio/virtio.h stable/8/sys/dev/virtio/virtio_ring.h stable/8/sys/dev/virtio/virtqueue.c stable/8/sys/dev/virtio/virtqueue.h stable/8/sys/modules/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/balloon/virtio_balloon.c Tue Aug 21 00:05:44 2012 (r239473) @@ -122,6 +122,9 @@ static void vtballoon_add_sysctl(struct */ #define VTBALLOON_PAGES_PER_REQUEST 256 +/* Must be able to fix all pages frames in one page (segment). */ +CTASSERT(VTBALLOON_PAGES_PER_REQUEST * sizeof(uint32_t) <= PAGE_SIZE); + #define VTBALLOON_MTX(_sc) &(_sc)->vtballoon_mtx #define VTBALLOON_LOCK_INIT(_sc, _name) mtx_init(VTBALLOON_MTX((_sc)), _name, \ "VirtIO Balloon Lock", MTX_SPIN) @@ -138,7 +141,7 @@ static device_method_t vtballoon_methods /* VirtIO methods. */ DEVMETHOD(virtio_config_change, vtballoon_config_change), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtballoon_driver = { @@ -402,13 +405,13 @@ vtballoon_send_page_frames(struct vtball error = virtqueue_enqueue(vq, vq, &sg, 1, 0); KASSERT(error == 0, ("error enqueuing page frames to virtqueue")); + virtqueue_notify(vq); /* * Inflate and deflate operations are done synchronously. The * interrupt handler will wake us up. */ VTBALLOON_LOCK(sc); - virtqueue_notify(vq); while ((c = virtqueue_dequeue(vq, NULL)) == NULL) msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); @@ -475,7 +478,6 @@ vtballoon_update_size(struct vtballoon_s virtio_write_dev_config_4(sc->vtballoon_dev, offsetof(struct virtio_balloon_config, actual), htole32(sc->vtballoon_current_npages)); - } static int Modified: stable/8/sys/dev/virtio/balloon/virtio_balloon.h ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/balloon/virtio_balloon.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ Modified: stable/8/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/block/virtio_blk.c Tue Aug 21 00:05:44 2012 (r239473) @@ -70,8 +70,8 @@ struct vtblk_softc { uint32_t vtblk_flags; #define VTBLK_FLAG_INDIRECT 0x0001 #define VTBLK_FLAG_READONLY 0x0002 -#define VTBLK_FLAG_DETACHING 0x0004 -#define VTBLK_FLAG_SUSPENDED 0x0008 +#define VTBLK_FLAG_DETACH 0x0004 +#define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_DUMPING 0x0010 struct virtqueue *vtblk_vq; @@ -82,14 +82,12 @@ struct vtblk_softc { TAILQ_HEAD(, vtblk_request) vtblk_req_free; TAILQ_HEAD(, vtblk_request) - vtblk_req_ready; + vtblk_req_ready; struct taskqueue *vtblk_tq; struct task vtblk_intr_task; - int vtblk_sector_size; int vtblk_max_nsegs; - int vtblk_unit; int vtblk_request_count; struct vtblk_request vtblk_dump_request; @@ -118,6 +116,13 @@ static int vtblk_suspend(device_t); static int vtblk_resume(device_t); static int vtblk_shutdown(device_t); +static int vtblk_open(struct disk *); +static int vtblk_close(struct disk *); +static int vtblk_ioctl(struct disk *, u_long, void *, int, + struct thread *); +static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); +static void vtblk_strategy(struct bio *); + static void vtblk_negotiate_features(struct vtblk_softc *); static int vtblk_maximum_segments(struct vtblk_softc *, struct virtio_blk_config *); @@ -126,13 +131,7 @@ static void vtblk_alloc_disk(struct vtbl struct virtio_blk_config *); static void vtblk_create_disk(struct vtblk_softc *); -static int vtblk_open(struct disk *); -static int vtblk_close(struct disk *); -static int vtblk_ioctl(struct disk *, u_long, void *, int, - struct thread *); -static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); -static void vtblk_strategy(struct bio *); - +static int vtblk_quiesce(struct vtblk_softc *); static void vtblk_startio(struct vtblk_softc *); static struct vtblk_request * vtblk_bio_request(struct vtblk_softc *); static int vtblk_execute_request(struct vtblk_softc *, @@ -150,6 +149,7 @@ static int vtblk_flush_dump(struct vtblk static int vtblk_poll_request(struct vtblk_softc *, struct vtblk_request *); +static void vtblk_finish_completed(struct vtblk_softc *); static void vtblk_drain_vq(struct vtblk_softc *, int); static void vtblk_drain(struct vtblk_softc *); @@ -163,7 +163,8 @@ static struct vtblk_request * vtblk_dequ static void vtblk_enqueue_ready(struct vtblk_softc *, struct vtblk_request *); -static void vtblk_bio_error(struct bio *, int); +static int vtblk_request_error(struct vtblk_request *); +static void vtblk_finish_bio(struct bio *, int); /* Tunables. */ static int vtblk_no_ident = 0; @@ -185,16 +186,14 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ mtx_init(VTBLK_MTX((_sc)), (_name), \ "VTBLK Lock", MTX_DEF) #define VTBLK_LOCK(_sc) mtx_lock(VTBLK_MTX((_sc))) -#define VTBLK_TRYLOCK(_sc) mtx_trylock(VTBLK_MTX((_sc))) #define VTBLK_UNLOCK(_sc) mtx_unlock(VTBLK_MTX((_sc))) #define VTBLK_LOCK_DESTROY(_sc) mtx_destroy(VTBLK_MTX((_sc))) #define VTBLK_LOCK_ASSERT(_sc) mtx_assert(VTBLK_MTX((_sc)), MA_OWNED) #define VTBLK_LOCK_ASSERT_NOTOWNED(_sc) \ mtx_assert(VTBLK_MTX((_sc)), MA_NOTOWNED) -#define VTBLK_BIO_SEGMENTS(_bp) sglist_count((_bp)->bio_data, (_bp)->bio_bcount) - #define VTBLK_DISK_NAME "vtbd" +#define VTBLK_QUIESCE_TIMEOUT (30 * hz) /* * Each block request uses at least two segments - one for the header @@ -213,7 +212,7 @@ static device_method_t vtblk_methods[] = DEVMETHOD(device_resume, vtblk_resume), DEVMETHOD(device_shutdown, vtblk_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtblk_driver = { @@ -281,7 +280,6 @@ vtblk_attach(device_t dev) sc = device_get_softc(dev); sc->vtblk_dev = dev; - sc->vtblk_unit = device_get_unit(dev); VTBLK_LOCK_INIT(sc, device_get_nameunit(dev)); @@ -299,13 +297,8 @@ vtblk_attach(device_t dev) sc->vtblk_flags |= VTBLK_FLAG_READONLY; /* Get local copy of config. */ - if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY) == 0) { - bzero(&blkcfg, sizeof(struct virtio_blk_config)); - virtio_read_device_config(dev, 0, &blkcfg, - offsetof(struct virtio_blk_config, physical_block_exp)); - } else - virtio_read_device_config(dev, 0, &blkcfg, - sizeof(struct virtio_blk_config)); + virtio_read_device_config(dev, 0, &blkcfg, + sizeof(struct virtio_blk_config)); /* * With the current sglist(9) implementation, it is not easy @@ -323,11 +316,13 @@ vtblk_attach(device_t dev) } sc->vtblk_max_nsegs = vtblk_maximum_segments(sc, &blkcfg); + if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { + error = EINVAL; + device_printf(dev, "fewer than minimum number of segments " + "allowed: %d\n", sc->vtblk_max_nsegs); + goto fail; + } - /* - * Allocate working sglist. The number of segments may be too - * large to safely store on the stack. - */ sc->vtblk_sglist = sglist_alloc(sc->vtblk_max_nsegs, M_NOWAIT); if (sc->vtblk_sglist == NULL) { error = ENOMEM; @@ -385,7 +380,7 @@ vtblk_detach(device_t dev) sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags |= VTBLK_FLAG_DETACHING; + sc->vtblk_flags |= VTBLK_FLAG_DETACH; if (device_is_attached(dev)) vtblk_stop(sc); VTBLK_UNLOCK(sc); @@ -417,15 +412,19 @@ static int vtblk_suspend(device_t dev) { struct vtblk_softc *sc; + int error; sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags |= VTBLK_FLAG_SUSPENDED; - /* TODO Wait for any inflight IO to complete? */ + sc->vtblk_flags |= VTBLK_FLAG_SUSPEND; + /* XXX BMV: virtio_stop(), etc needed here? */ + error = vtblk_quiesce(sc); + if (error) + sc->vtblk_flags &= ~VTBLK_FLAG_SUSPEND; VTBLK_UNLOCK(sc); - return (0); + return (error); } static int @@ -436,8 +435,9 @@ vtblk_resume(device_t dev) sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags &= ~VTBLK_FLAG_SUSPENDED; - /* TODO Resume IO? */ + /* XXX BMV: virtio_reinit(), etc needed here? */ + sc->vtblk_flags &= ~VTBLK_FLAG_SUSPEND; + vtblk_startio(sc); VTBLK_UNLOCK(sc); return (0); @@ -458,7 +458,7 @@ vtblk_open(struct disk *dp) if ((sc = dp->d_drv1) == NULL) return (ENXIO); - return (sc->vtblk_flags & VTBLK_FLAG_DETACHING ? ENXIO : 0); + return (sc->vtblk_flags & VTBLK_FLAG_DETACH ? ENXIO : 0); } static int @@ -498,11 +498,7 @@ vtblk_dump(void *arg, void *virtual, vm_ if ((sc = dp->d_drv1) == NULL) return (ENXIO); - if (VTBLK_TRYLOCK(sc) == 0) { - device_printf(sc->vtblk_dev, - "softc already locked, cannot dump...\n"); - return (EBUSY); - } + VTBLK_LOCK(sc); if ((sc->vtblk_flags & VTBLK_FLAG_DUMPING) == 0) { vtblk_prepare_dump(sc); @@ -513,6 +509,10 @@ vtblk_dump(void *arg, void *virtual, vm_ error = vtblk_write_dump(sc, virtual, offset, length); else if (virtual == NULL && offset == 0) error = vtblk_flush_dump(sc); + else { + error = EINVAL; + sc->vtblk_flags &= ~VTBLK_FLAG_DUMPING; + } VTBLK_UNLOCK(sc); @@ -525,7 +525,7 @@ vtblk_strategy(struct bio *bp) struct vtblk_softc *sc; if ((sc = bp->bio_disk->d_drv1) == NULL) { - vtblk_bio_error(bp, EINVAL); + vtblk_finish_bio(bp, EINVAL); return; } @@ -535,29 +535,37 @@ vtblk_strategy(struct bio *bp) */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { - vtblk_bio_error(bp, EROFS); + vtblk_finish_bio(bp, EROFS); return; } +#ifdef INVARIANTS /* * Prevent read/write buffers spanning too many segments from * getting into the queue. This should only trip if d_maxsize * was incorrectly set. */ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - KASSERT(VTBLK_BIO_SEGMENTS(bp) <= sc->vtblk_max_nsegs - - VTBLK_MIN_SEGMENTS, + int nsegs, max_nsegs; + + nsegs = sglist_count(bp->bio_data, bp->bio_bcount); + max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; + + KASSERT(nsegs <= max_nsegs, ("bio spanned too many segments: %d, max: %d", - VTBLK_BIO_SEGMENTS(bp), - sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS)); + nsegs, max_nsegs)); } +#endif VTBLK_LOCK(sc); - if ((sc->vtblk_flags & VTBLK_FLAG_DETACHING) == 0) { + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) + vtblk_finish_bio(bp, ENXIO); + else { bioq_disksort(&sc->vtblk_bioq, bp); - vtblk_startio(sc); - } else - vtblk_bio_error(bp, ENXIO); + + if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) + vtblk_startio(sc); + } VTBLK_UNLOCK(sc); } @@ -622,7 +630,7 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_ioctl = vtblk_ioctl; dp->d_strategy = vtblk_strategy; dp->d_name = VTBLK_DISK_NAME; - dp->d_unit = sc->vtblk_unit; + dp->d_unit = device_get_unit(dev); dp->d_drv1 = sc; if ((sc->vtblk_flags & VTBLK_FLAG_READONLY) == 0) @@ -632,10 +640,9 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_mediasize = blkcfg->capacity * 512; if (virtio_with_feature(dev, VIRTIO_BLK_F_BLK_SIZE)) - sc->vtblk_sector_size = blkcfg->blk_size; + dp->d_sectorsize = blkcfg->blk_size; else - sc->vtblk_sector_size = 512; - dp->d_sectorsize = sc->vtblk_sector_size; + dp->d_sectorsize = 512; /* * The VirtIO maximum I/O size is given in terms of segments. @@ -685,6 +692,26 @@ vtblk_create_disk(struct vtblk_softc *sc disk_create(dp, DISK_VERSION); } +static int +vtblk_quiesce(struct vtblk_softc *sc) +{ + int error; + + error = 0; + + VTBLK_LOCK_ASSERT(sc); + + while (!virtqueue_empty(sc->vtblk_vq)) { + if (mtx_sleep(&sc->vtblk_vq, VTBLK_MTX(sc), PRIBIO, "vtblkq", + VTBLK_QUIESCE_TIMEOUT) == EWOULDBLOCK) { + error = EBUSY; + break; + } + } + + return (error); +} + static void vtblk_startio(struct vtblk_softc *sc) { @@ -697,9 +724,6 @@ vtblk_startio(struct vtblk_softc *sc) VTBLK_LOCK_ASSERT(sc); - if (sc->vtblk_flags & VTBLK_FLAG_SUSPENDED) - return; - while (!virtqueue_full(vq)) { if ((req = vtblk_dequeue_ready(sc)) == NULL) req = vtblk_bio_request(sc); @@ -752,9 +776,8 @@ vtblk_bio_request(struct vtblk_softc *sc req->vbr_hdr.sector = bp->bio_offset / 512; break; default: - KASSERT(0, ("bio with unhandled cmd: %d", bp->bio_cmd)); - req->vbr_hdr.type = -1; - break; + panic("%s: bio with unhandled cmd: %d", __FUNCTION__, + bp->bio_cmd); } if (bp->bio_flags & BIO_ORDERED) @@ -768,7 +791,7 @@ vtblk_execute_request(struct vtblk_softc { struct sglist *sg; struct bio *bp; - int writable, error; + int readable, writable, error; sg = sc->vtblk_sglist; bp = req->vbr_bp; @@ -799,10 +822,9 @@ vtblk_execute_request(struct vtblk_softc KASSERT(sg->sg_nseg >= VTBLK_MIN_SEGMENTS, ("fewer than min segments: %d", sg->sg_nseg)); - error = virtqueue_enqueue(sc->vtblk_vq, req, sg, - sg->sg_nseg - writable, writable); + readable = sg->sg_nseg - writable; - return (error); + return (virtqueue_enqueue(sc->vtblk_vq, req, sg, readable, writable)); } static int @@ -822,37 +844,23 @@ static void vtblk_intr_task(void *arg, int pending) { struct vtblk_softc *sc; - struct vtblk_request *req; struct virtqueue *vq; - struct bio *bp; sc = arg; vq = sc->vtblk_vq; VTBLK_LOCK(sc); - if (sc->vtblk_flags & VTBLK_FLAG_DETACHING) { + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { VTBLK_UNLOCK(sc); return; } - while ((req = virtqueue_dequeue(vq, NULL)) != NULL) { - bp = req->vbr_bp; + vtblk_finish_completed(sc); - if (req->vbr_ack == VIRTIO_BLK_S_OK) - bp->bio_resid = 0; - else { - bp->bio_flags |= BIO_ERROR; - if (req->vbr_ack == VIRTIO_BLK_S_UNSUPP) - bp->bio_error = ENOTSUP; - else - bp->bio_error = EIO; - } - - biodone(bp); - vtblk_enqueue_request(sc, req); - } - - vtblk_startio(sc); + if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) + vtblk_startio(sc); + else + wakeup(&sc->vtblk_vq); if (virtqueue_enable_intr(vq) != 0) { virtqueue_disable_intr(vq); @@ -905,9 +913,10 @@ vtblk_get_ident(struct vtblk_softc *sc) VTBLK_LOCK(sc); error = vtblk_poll_request(sc, req); - vtblk_enqueue_request(sc, req); VTBLK_UNLOCK(sc); + vtblk_enqueue_request(sc, req); + if (error) { device_printf(sc->vtblk_dev, "error getting device identifier: %d\n", error); @@ -1006,17 +1015,35 @@ vtblk_poll_request(struct vtblk_softc *s r = virtqueue_poll(vq, NULL); KASSERT(r == req, ("unexpected request response")); - if (req->vbr_ack != VIRTIO_BLK_S_OK) { - error = req->vbr_ack == VIRTIO_BLK_S_UNSUPP ? ENOTSUP : EIO; - if (bootverbose) - device_printf(dev, - "vtblk_poll_request: IO error: %d\n", error); + error = vtblk_request_error(req); + if (error && bootverbose) { + device_printf(dev, "vtblk_poll_request: IO error: %d\n", + error); } return (error); } static void +vtblk_finish_completed(struct vtblk_softc *sc) +{ + struct vtblk_request *req; + struct bio *bp; + int error; + + while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { + bp = req->vbr_bp; + + error = vtblk_request_error(req); + if (error) + disk_err(bp, "hard error", -1, 1); + + vtblk_finish_bio(bp, error); + vtblk_enqueue_request(sc, req); + } +} + +static void vtblk_drain_vq(struct vtblk_softc *sc, int skip_done) { struct virtqueue *vq; @@ -1028,7 +1055,7 @@ vtblk_drain_vq(struct vtblk_softc *sc, i while ((req = virtqueue_drain(vq, &last)) != NULL) { if (!skip_done) - vtblk_bio_error(req->vbr_bp, ENXIO); + vtblk_finish_bio(req->vbr_bp, ENXIO); vtblk_enqueue_request(sc, req); } @@ -1045,17 +1072,19 @@ vtblk_drain(struct vtblk_softc *sc) bioq = &sc->vtblk_bioq; - if (sc->vtblk_vq != NULL) + if (sc->vtblk_vq != NULL) { + vtblk_finish_completed(sc); vtblk_drain_vq(sc, 0); + } while ((req = vtblk_dequeue_ready(sc)) != NULL) { - vtblk_bio_error(req->vbr_bp, ENXIO); + vtblk_finish_bio(req->vbr_bp, ENXIO); vtblk_enqueue_request(sc, req); } while (bioq_first(bioq) != NULL) { bp = bioq_takefirst(bioq); - vtblk_bio_error(bp, ENXIO); + vtblk_finish_bio(bp, ENXIO); } vtblk_free_requests(sc); @@ -1065,9 +1094,9 @@ static int vtblk_alloc_requests(struct vtblk_softc *sc) { struct vtblk_request *req; - int i, size; + int i, nreqs; - size = virtqueue_size(sc->vtblk_vq); + nreqs = virtqueue_size(sc->vtblk_vq); /* * Preallocate sufficient requests to keep the virtqueue full. Each @@ -1075,9 +1104,9 @@ vtblk_alloc_requests(struct vtblk_softc * the number allocated when indirect descriptors are not available. */ if ((sc->vtblk_flags & VTBLK_FLAG_INDIRECT) == 0) - size /= VTBLK_MIN_SEGMENTS; + nreqs /= VTBLK_MIN_SEGMENTS; - for (i = 0; i < size; i++) { + for (i = 0; i < nreqs; i++) { req = uma_zalloc(vtblk_req_zone, M_NOWAIT); if (req == NULL) return (ENOMEM); @@ -1094,6 +1123,9 @@ vtblk_free_requests(struct vtblk_softc * { struct vtblk_request *req; + KASSERT(TAILQ_EMPTY(&sc->vtblk_req_ready), + ("ready requests left on queue")); + while ((req = vtblk_dequeue_request(sc)) != NULL) { sc->vtblk_request_count--; uma_zfree(vtblk_req_zone, req); @@ -1141,9 +1173,35 @@ vtblk_enqueue_ready(struct vtblk_softc * TAILQ_INSERT_HEAD(&sc->vtblk_req_ready, req, vbr_link); } +static int +vtblk_request_error(struct vtblk_request *req) +{ + int error; + + switch (req->vbr_ack) { + case VIRTIO_BLK_S_OK: + error = 0; + break; + case VIRTIO_BLK_S_UNSUPP: + error = ENOTSUP; + break; + default: + error = EIO; + break; + } + + return (error); +} + static void -vtblk_bio_error(struct bio *bp, int error) +vtblk_finish_bio(struct bio *bp, int error) { - biofinish(bp, NULL, error); + if (error) { + bp->bio_resid = bp->bio_bcount; + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; + } + + biodone(bp); } Modified: stable/8/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/block/virtio_blk.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ @@ -39,16 +62,6 @@ struct virtio_blk_config { /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ uint32_t blk_size; - - /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */ - /* exponent for physical block per logical block. */ - uint8_t physical_block_exp; - /* alignment offset in logical blocks. */ - uint8_t alignment_offset; - /* minimum I/O size without performance penalty in logical blocks. */ - uint16_t min_io_size; - /* optimal sustained I/O size in logical blocks. */ - uint32_t opt_io_size; } __packed; /* Modified: stable/8/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/network/if_vtnet.c Tue Aug 21 00:05:44 2012 (r239473) @@ -223,7 +223,7 @@ static device_method_t vtnet_methods[] = /* VirtIO methods. */ DEVMETHOD(virtio_config_change, vtnet_config_change), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtnet_driver = { @@ -317,8 +317,20 @@ vtnet_attach(device_t dev) if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { sc->vtnet_flags |= VTNET_FLAG_CTRL_VQ; - if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_RX)) + if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_RX)) { + sc->vtnet_mac_filter = malloc( + sizeof(struct vtnet_mac_filter), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (sc->vtnet_mac_filter == NULL) { + device_printf(dev, + "cannot allocate mac filter table\n"); + error = ENOMEM; + goto fail; + } + sc->vtnet_flags |= VTNET_FLAG_CTRL_RX; + } + if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) sc->vtnet_flags |= VTNET_FLAG_VLAN_FILTER; } @@ -505,7 +517,12 @@ vtnet_detach(device_t dev) sc->vtnet_vlan_detach = NULL; } - if (ifp) { + if (sc->vtnet_mac_filter != NULL) { + free(sc->vtnet_mac_filter, M_DEVBUF); + sc->vtnet_mac_filter = NULL; + } + + if (ifp != NULL) { if_free(ifp); sc->vtnet_ifp = NULL; } @@ -742,17 +759,11 @@ vtnet_update_link_status(struct vtnet_so if (link && ((sc->vtnet_flags & VTNET_FLAG_LINK) == 0)) { sc->vtnet_flags |= VTNET_FLAG_LINK; - if (bootverbose) - device_printf(dev, "Link is up\n"); - if_link_state_change(ifp, LINK_STATE_UP); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) vtnet_start_locked(ifp); } else if (!link && (sc->vtnet_flags & VTNET_FLAG_LINK)) { sc->vtnet_flags &= ~VTNET_FLAG_LINK; - if (bootverbose) - device_printf(dev, "Link is down\n"); - if_link_state_change(ifp, LINK_STATE_DOWN); } } @@ -1105,7 +1116,7 @@ vtnet_alloc_rxbuf(struct vtnet_softc *sc KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG, ("chained Rx mbuf requested without LRO_NOMRG")); - for (i = 0; i < nbufs - 1; i++) { + for (i = 1; i < nbufs; i++) { m = m_getjcl(M_DONTWAIT, MT_DATA, 0, clsize); if (m == NULL) goto fail; @@ -1143,9 +1154,8 @@ vtnet_replace_rxbuf(struct vtnet_softc * clsize = sc->vtnet_rx_mbuf_size; nreplace = 0; - if (m->m_next != NULL) - KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG, - ("chained Rx mbuf without LRO_NOMRG")); + KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG || + m->m_next == NULL, ("chained Rx mbuf without LRO_NOMRG")); /* * Since LRO_NOMRG mbuf chains are so large, we want to avoid @@ -1275,8 +1285,8 @@ vtnet_enqueue_rxbuf(struct vtnet_softc * int offset, error; VTNET_LOCK_ASSERT(sc); - if ((sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG) == 0) - KASSERT(m->m_next == NULL, ("chained Rx mbuf")); + KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG || + m->m_next == NULL, ("chained Rx mbuf without LRO_NOMRG")); sglist_init(&sg, VTNET_MAX_RX_SEGS, segs); @@ -1688,7 +1698,8 @@ vtnet_rxeof(struct vtnet_softc *sc, int break; } - virtqueue_notify(vq); + if (deq > 0) + virtqueue_notify(vq); if (rx_npktsp != NULL) *rx_npktsp = rx_npkts; @@ -1946,9 +1957,14 @@ vtnet_encap(struct vtnet_softc *sc, stru struct mbuf *m; int error; + m = *m_head; + txhdr = uma_zalloc(vtnet_tx_header_zone, M_NOWAIT | M_ZERO); - if (txhdr == NULL) + if (txhdr == NULL) { + *m_head = NULL; + m_freem(m); return (ENOMEM); + } /* * Always use the non-mergeable header to simplify things. When @@ -1957,21 +1973,22 @@ vtnet_encap(struct vtnet_softc *sc, stru * the correct header size to the host. */ hdr = &txhdr->vth_uhdr.hdr; - m = *m_head; - - error = ENOBUFS; if (m->m_flags & M_VLANTAG) { m = ether_vlanencap(m, m->m_pkthdr.ether_vtag); - if ((*m_head = m) == NULL) + if ((*m_head = m) == NULL) { + error = ENOBUFS; goto fail; + } m->m_flags &= ~M_VLANTAG; } if (m->m_pkthdr.csum_flags != 0) { m = vtnet_tx_offload(sc, m, hdr); - if ((*m_head = m) == NULL) + if ((*m_head = m) == NULL) { + error = ENOBUFS; goto fail; + } } error = vtnet_enqueue_txbuf(sc, m_head, txhdr); @@ -2387,6 +2404,7 @@ vtnet_rx_filter_mac(struct vtnet_softc * uint8_t ack; ifp = sc->vtnet_ifp; + filter = sc->vtnet_mac_filter; ucnt = 0; mcnt = 0; promisc = 0; @@ -2397,19 +2415,6 @@ vtnet_rx_filter_mac(struct vtnet_softc * KASSERT(sc->vtnet_flags & VTNET_FLAG_CTRL_RX, ("CTRL_RX feature not negotiated")); - /* - * Allocate the MAC filtering table. Note we could do this - * at attach time, but it is probably not worth keeping it - * around for an infrequent occurrence. - */ - filter = malloc(sizeof(struct vtnet_mac_filter), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (filter == NULL) { - device_printf(sc->vtnet_dev, - "cannot allocate MAC address filtering table\n"); - return; - } - /* Unicast MAC addresses: */ if_addr_rlock(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { @@ -2481,8 +2486,6 @@ vtnet_rx_filter_mac(struct vtnet_softc * if_printf(ifp, "error setting host MAC filter table\n"); out: - free(filter, M_DEVBUF); - if (promisc) if (vtnet_set_promisc(sc, 1) != 0) if_printf(ifp, "cannot enable promiscuous mode\n"); Modified: stable/8/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/network/if_vtnetvar.h Tue Aug 21 00:05:44 2012 (r239473) @@ -99,6 +99,7 @@ struct vtnet_softc { #define VTNET_MEDIATYPE (IFM_ETHER | IFM_1000_T | IFM_FDX) char vtnet_hwaddr[ETHER_ADDR_LEN]; + struct vtnet_mac_filter *vtnet_mac_filter; /* * During reset, the host's VLAN filtering table is lost. The * array below is used to restore all the VLANs configured on Modified: stable/8/sys/dev/virtio/network/virtio_net.h ============================================================================== --- head/sys/dev/virtio/network/virtio_net.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/network/virtio_net.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ Modified: stable/8/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/pci/virtio_pci.c Tue Aug 21 00:05:44 2012 (r239473) @@ -189,7 +189,7 @@ static device_method_t vtpci_methods[] = DEVMETHOD(virtio_bus_read_device_config, vtpci_read_dev_config), DEVMETHOD(virtio_bus_write_device_config, vtpci_write_dev_config), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtpci_driver = { Modified: stable/8/sys/dev/virtio/pci/virtio_pci.h ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/pci/virtio_pci.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,4 +1,4 @@ -/* +/*- * Copyright IBM Corp. 2007 * * Authors: @@ -7,6 +7,29 @@ * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ Modified: stable/8/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Fri Nov 18 05:43:43 2011 (r227652) +++ stable/8/sys/dev/virtio/virtio.h Tue Aug 21 00:05:44 2012 (r239473) @@ -1,7 +1,30 @@ -/* +/*- * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 01:03:21 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9876A106566B; Tue, 21 Aug 2012 01:03:21 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 1586E8FC15; Tue, 21 Aug 2012 01:03:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7L13D3E008482; Tue, 21 Aug 2012 05:03:13 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7L13CMr008481; Tue, 21 Aug 2012 05:03:13 +0400 (MSK) (envelope-from ache) Date: Tue, 21 Aug 2012 05:03:11 +0400 From: Andrey Chernov To: John Baldwin Message-ID: <20120821010311.GA8250@vniz.net> Mail-Followup-To: Andrey Chernov , John Baldwin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208201409.55544.jhb@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: r239356 - 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: Tue, 21 Aug 2012 01:03:21 -0000 On Mon, Aug 20, 2012 at 02:09:55PM -0400, John Baldwin wrote: > > RFC 2131 (if you mean it) describes DHCP process itself, it does not > > define contents of 'supersede' or other override options for dhclient. > > The supersede handling bits are all based on what the protocol can actually > send, which the RFC defines as IPv4. 'supercede' itself not based on DHCPv4, it simple override anything protocol can actually send and in general case overriding contents can be any IP. But... I agree with you that it looks like quick hack. Having dual-stack machine it seems proper way for me to run both DHCP and DHCPv6 clients (net-mgmt/wide-dhcp? net/dhcp6?). But I fear they both will interact with single /etc/resolv.conf overriding each other there. > > Moreover, current dhclient somewhow able to fetch my IPv6 tunnel DNS > > address from the roiter (I don't look deeper, maybe it is router bug), but > > I don't want IPv6 tunnel DNS, I want router fe80:... DNS instead. > > Eh? DHCP can't return an IPv6 address in the protocol. As I already mention, perhaps it is router bug combined with the lack of validity checking in dhclient itself. As result I currently have /etc/resolv.conf: nameserver 192.168.1.1 nameserver -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 02:17:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E99D1065672; Tue, 21 Aug 2012 02:17:07 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FFF88FC16; Tue, 21 Aug 2012 02:17:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L2H7SK038797; Tue, 21 Aug 2012 02:17:07 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L2H7xY038795; Tue, 21 Aug 2012 02:17:07 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201208210217.q7L2H7xY038795@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 21 Aug 2012 02:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239474 - stable/9/sys/netinet/khelp 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, 21 Aug 2012 02:17:07 -0000 Author: lstewart Date: Tue Aug 21 02:17:06 2012 New Revision: 239474 URL: http://svn.freebsd.org/changeset/base/239474 Log: MFC r239346: The TCP PAWS fix for kernels with fast tick rates (r231767) changed the TCP timestamp related stack variables to reference ms directly instead of ticks. The h_ertt(4) Khelp module relies on TCP timestamp information in order to calculate its enhanced RTT estimates, but was not updated as part of r231767. Consequently, h_ertt has not been calculating correct RTT estimates since r231767 was comitted, which in turn broke all delay-based congestion control algorithms because they rely on the h_ertt RTT estimates. Fix the breakage by switching h_ertt to use tcp_ts_getticks() in place of all previous uses of the ticks variable. This ensures all timestamp related variables in h_ertt use the same units as the TCP stack and therefore results in meaningful comparisons and RTT estimate calculations. Reported & tested by: Naeem Khademi (naeemk at ifi uio no) Discussed with: bz Modified: stable/9/sys/netinet/khelp/h_ertt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/khelp/h_ertt.c ============================================================================== --- stable/9/sys/netinet/khelp/h_ertt.c Tue Aug 21 00:05:44 2012 (r239473) +++ stable/9/sys/netinet/khelp/h_ertt.c Tue Aug 21 02:17:06 2012 (r239474) @@ -151,11 +151,13 @@ marked_packet_rtt(struct txseginfo *txsi *prtt_bytes_adjust += *pmeasurenext_len; } else { if (mflag & FORCED_MEASUREMENT) { - e_t->markedpkt_rtt = ticks - *pmeasurenext + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + *pmeasurenext + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt + *pmeasurenext_len - *prtt_bytes_adjust; } else { - e_t->markedpkt_rtt = ticks - txsi->tx_ts + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + txsi->tx_ts + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt - *prtt_bytes_adjust; } @@ -349,7 +351,7 @@ ertt_packet_measurement_hook(int hhook_t */ if (!e_t->dlyack_rx || multiack || new_sacked_bytes) { /* Make an accurate new measurement. */ - e_t->rtt = ticks - txsi->tx_ts + 1; + e_t->rtt = tcp_ts_getticks() - txsi->tx_ts + 1; if (e_t->rtt < e_t->minrtt || e_t->minrtt == 0) e_t->minrtt = e_t->rtt; @@ -477,7 +479,7 @@ ertt_add_tx_segment_info_hook(int hhook_ tp->ts_offset; txsi->rx_ts = ntohl(to->to_tsecr); } else { - txsi->tx_ts = ticks; + txsi->tx_ts = tcp_ts_getticks(); txsi->rx_ts = 0; /* No received time stamp. */ } TAILQ_INSERT_TAIL(&e_t->txsegi_q, txsi, txsegi_lnk); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 02:52:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B458B106564A; Tue, 21 Aug 2012 02:52:25 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84F4B8FC17; Tue, 21 Aug 2012 02:52:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L2qP26044413; Tue, 21 Aug 2012 02:52:25 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L2qPhI044411; Tue, 21 Aug 2012 02:52:25 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201208210252.q7L2qPhI044411@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 21 Aug 2012 02:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239475 - stable/8/sys/netinet/khelp X-BeenThere: svn-src-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, 21 Aug 2012 02:52:25 -0000 Author: lstewart Date: Tue Aug 21 02:52:25 2012 New Revision: 239475 URL: http://svn.freebsd.org/changeset/base/239475 Log: MFC r239346: The TCP PAWS fix for kernels with fast tick rates (r231767) changed the TCP timestamp related stack variables to reference ms directly instead of ticks. The h_ertt(4) Khelp module relies on TCP timestamp information in order to calculate its enhanced RTT estimates, but was not updated as part of r231767. Consequently, h_ertt has not been calculating correct RTT estimates since r231767 was comitted, which in turn broke all delay-based congestion control algorithms because they rely on the h_ertt RTT estimates. Fix the breakage by switching h_ertt to use tcp_ts_getticks() in place of all previous uses of the ticks variable. This ensures all timestamp related variables in h_ertt use the same units as the TCP stack and therefore results in meaningful comparisons and RTT estimate calculations. Reported & tested by: Naeem Khademi (naeemk at ifi uio no) Discussed with: bz Modified: stable/8/sys/netinet/khelp/h_ertt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/khelp/h_ertt.c ============================================================================== --- stable/8/sys/netinet/khelp/h_ertt.c Tue Aug 21 02:17:06 2012 (r239474) +++ stable/8/sys/netinet/khelp/h_ertt.c Tue Aug 21 02:52:25 2012 (r239475) @@ -151,11 +151,13 @@ marked_packet_rtt(struct txseginfo *txsi *prtt_bytes_adjust += *pmeasurenext_len; } else { if (mflag & FORCED_MEASUREMENT) { - e_t->markedpkt_rtt = ticks - *pmeasurenext + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + *pmeasurenext + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt + *pmeasurenext_len - *prtt_bytes_adjust; } else { - e_t->markedpkt_rtt = ticks - txsi->tx_ts + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + txsi->tx_ts + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt - *prtt_bytes_adjust; } @@ -349,7 +351,7 @@ ertt_packet_measurement_hook(int hhook_t */ if (!e_t->dlyack_rx || multiack || new_sacked_bytes) { /* Make an accurate new measurement. */ - e_t->rtt = ticks - txsi->tx_ts + 1; + e_t->rtt = tcp_ts_getticks() - txsi->tx_ts + 1; if (e_t->rtt < e_t->minrtt || e_t->minrtt == 0) e_t->minrtt = e_t->rtt; @@ -477,7 +479,7 @@ ertt_add_tx_segment_info_hook(int hhook_ tp->ts_offset; txsi->rx_ts = ntohl(to->to_tsecr); } else { - txsi->tx_ts = ticks; + txsi->tx_ts = tcp_ts_getticks(); txsi->rx_ts = 0; /* No received time stamp. */ } TAILQ_INSERT_TAIL(&e_t->txsegi_q, txsi, txsegi_lnk); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 02:58:08 2012 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 22A5A106566B; Tue, 21 Aug 2012 02:58:08 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 15A9F8FC16; Tue, 21 Aug 2012 02:58:06 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:9A1Q49MNuh/8KVK0fLrXYAmNXrObFGoMN/znYMGJ7Tdr8dTnDB1UWeSkgPzJ+IGU@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7L2vuZ3023950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 21 Aug 2012 11:58:01 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 21 Aug 2012 11:57:56 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov In-Reply-To: <20120821010311.GA8250@vniz.net> References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-PRERELEASE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 21 Aug 2012 11:58:01 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, John Baldwin Subject: Re: svn commit: r239356 - 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: Tue, 21 Aug 2012 02:58:08 -0000 Hi, >>>>> On Tue, 21 Aug 2012 05:03:11 +0400 >>>>> Andrey Chernov said: ache> Having dual-stack machine it seems proper way for me to run both DHCP and ache> DHCPv6 clients (net-mgmt/wide-dhcp? net/dhcp6?). But I fear they both will ache> interact with single /etc/resolv.conf overriding each other there. FreeBSD 9 and above already have a feature to handle multiple source of DNS address,; resolvconf(8). Our dhclient(8) and rtsol(8) uses it to write /etc/resolv.conf. ache> As I already mention, perhaps it is router bug combined with the lack of ache> validity checking in dhclient itself. As result I currently have ache> /etc/resolv.conf: ache> nameserver 192.168.1.1 ache> nameserver Don't you see `# Generated by resolvconf' line in your generated /etc/resolv.conf? DHCP cannot carry an IPv6 address. I suspect your router advertises an IPv6 address of your DNS server. You can confirm where the DNS server addresss come from by executing `resolvconf -l'. The following is the output on my box for example: ume@yuga:~% resolvconf -l # resolv.conf from em0:dhcpv6 search mahoroba.org nameserver 2001:2f0:104:8010::1 nameserver 2001:2f0:104:8010:221:5aff:feeb:183 # resolv.conf from em0:slaac:[fe80::218:71ff:feec:5271] nameserver 2001:2f0:104:8010::1 search mahoroba.org # resolv.conf from em0 search mahoroba.org nameserver 192.168.100.59 nameserver 192.168.100.55 My network announces DHCPv6 and my box is configured to use DHCPv6. So, there are three sources for a DNS address, here. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 04:45:59 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8BF48106566B; Tue, 21 Aug 2012 04:45:59 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 05BB48FC0C; Tue, 21 Aug 2012 04:45:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7L4jst0012360; Tue, 21 Aug 2012 08:45:54 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7L4jra2012359; Tue, 21 Aug 2012 08:45:53 +0400 (MSK) (envelope-from ache) Date: Tue, 21 Aug 2012 08:45:53 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120821044553.GA11375@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , John Baldwin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, John Baldwin Subject: Re: svn commit: r239356 - 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: Tue, 21 Aug 2012 04:45:59 -0000 On Tue, Aug 21, 2012 at 11:57:56AM +0900, Hajimu UMEMOTO wrote: > FreeBSD 9 and above already have a feature to handle multiple source > of DNS address,; resolvconf(8). Our dhclient(8) and rtsol(8) uses it > to write /etc/resolv.conf. Thanks pointing to resolvconf(8) and rtsol(8), I'll try to look there to setup this stuff properly. > Don't you see `# Generated by resolvconf' line in your generated > /etc/resolv.conf? > DHCP cannot carry an IPv6 address. > I suspect your router advertises an IPv6 address of your DNS server. Yes. Whole resolv.conf: # Generated by resolvconf search nameserver 192.168.1.1 nameserver > You can confirm where the DNS server addresss come from by executing > `resolvconf -l'. resolvconf -l output: # resolv.conf from msk0 search nameserver 192.168.1.1 # resolv.conf from msk0:slaac nameserver (btw, what is slaac?) And I want to override with simple link-local IPv6 address of my router, i.e. fe80:... Is it possible with resolvconf(8)? -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 05:39:48 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9747106564A; Tue, 21 Aug 2012 05:39:48 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og105.obsmtp.com (exprod7og105.obsmtp.com [64.18.2.163]) by mx1.freebsd.org (Postfix) with ESMTP id 4173B8FC08; Tue, 21 Aug 2012 05:39:46 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob105.postini.com ([64.18.6.12]) with SMTP ID DSNKUDMfIVaMn9lfTwDUVXYGhzqr/yn0H0Tf@postini.com; Mon, 20 Aug 2012 22:39:47 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 20 Aug 2012 22:35:20 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7L5ZKh69766; Mon, 20 Aug 2012 22:35:20 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id BD5A158085; Mon, 20 Aug 2012 22:35:19 -0700 (PDT) To: Ruslan Ermilov In-Reply-To: <20120726084903.GA48240@lo0.su> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> Comments: In-reply-to: Ruslan Ermilov message dated "Thu, 26 Jul 2012 12:49:03 +0400." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 20 Aug 2012 22:35:19 -0700 Message-ID: <20120821053519.BD5A158085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "David E. O'Brien" , sjg@juniper.net Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac 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, 21 Aug 2012 05:39:48 -0000 Hi, sorry about the slow response. On Thu, 26 Jul 2012 12:49:03 +0400, Ruslan Ermilov writes: >On Wed, Jul 18, 2012 at 05:57:43AM +0000, David E. O'Brien wrote: >> Author: obrien >> Date: Wed Jul 18 05:57:42 2012 >> New Revision: 238563 >> URL: http://svn.freebsd.org/changeset/base/238563 >> >> Log: >> a ";" tells make we want the shell to be used >> >> Submitted by: Simon Gerraty >> >> Modified: >> head/gnu/usr.bin/groff/tmac/Makefile > >I don't quite understand what this change does, could you elaborate? Sure. This is a consequence of bmake trying to be clever. >Without -jN (in backwards compatibility mode), the "cd" is a no-op >(whether it's terminated by `;' or not) because make will execute a >single shell per command, with cwd set to ${.OBJDIR}. Except on very weird systems, bmake is built in what NetBSD call "native" mode, and even in compat mode will attempt to avoid the overhead of all those shells. Thus, unless it spots a shell meta char, it will try and skip the shell. Shell builtins like 'cd' or 'chdir' cannot be directly invoked, but make doesn't know that. Simply adding the ';' convinces it to use a shell. It is still a no-op. >With -jN, "cd" becomes necessary because all commands are executed as >a script by one shell (the reason it was added in the first place), >but adding `;' is a no-op because commands are on separate lines. A better way to construct targets like this is to put any excursion out of .OBJDIR inside (): (cd ${.CURDIR} && \ ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) then the cd ${.OBJDIR} isn't needed at all. note use of && rather than ; which can be very dangerous --sjg From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 05:46:19 2012 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 7DECB1065670; Tue, 21 Aug 2012 05:46:19 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og103.obsmtp.com (exprod7og103.obsmtp.com [64.18.2.159]) by mx1.freebsd.org (Postfix) with ESMTP id 917488FC08; Tue, 21 Aug 2012 05:46:18 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob103.postini.com ([64.18.6.12]) with SMTP ID DSNKUDMgpHbMqLallxOpNXEijuwq14MGlv3h@postini.com; Mon, 20 Aug 2012 22:46:19 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 20 Aug 2012 22:44:27 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7L5iRh75647; Mon, 20 Aug 2012 22:44:27 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 4486F58085; Mon, 20 Aug 2012 22:44:27 -0700 (PDT) To: John Baldwin In-Reply-To: <201207301119.49002.jhb@freebsd.org> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <201207301119.49002.jhb@freebsd.org> Comments: In-reply-to: John Baldwin message dated "Mon, 30 Jul 2012 11:19:48 -0400." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 20 Aug 2012 22:44:27 -0700 Message-ID: <20120821054427.4486F58085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac 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, 21 Aug 2012 05:46:19 -0000 On Mon, 30 Jul 2012 11:19:48 -0400, John Baldwin writes: >> @@ -68,7 +68,7 @@ beforeinstall: >> cd ${.CURDIR}; \ >> ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ >> koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR} >> - cd ${.OBJDIR} >> + cd ${.OBJDIR}; > >Isn't this a nop now? That is, it changes the working directory in a temporar >y >shell that immediately exits? If a shell is used, yes. Even in compat mode, bmake attempts to avoid the shell, so absent a clue (like ';') it attempts - and fails direct exection. A cd like that by itself generally makes no sense (as everyone has noted ;-) The ';' was a minimal change to ensure consistent behavior b/w the two makes, but re-working the target to avoid the need for that cd would be better - as noted just now in response to Ruslan. Thanks --sjg From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 05:46:34 2012 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 8A94510657F4; Tue, 21 Aug 2012 05:46:34 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1800A8FC0A; Tue, 21 Aug 2012 05:46:33 +0000 (UTC) Received: by obbun3 with SMTP id un3so14434713obb.13 for ; Mon, 20 Aug 2012 22:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JbkCBkvCgRPSaeziztmxAbY3ututXa4VyMdq82JJ7yM=; b=cdWG36u8ng9+3kn1Bur/e1g2wou8lMx/AL57hRkaDMd23aWaOe8LkfpocQpYMgdgk6 P6/SfWaFWG49cZ14tpltWeXyznLQCwS1AavURKaa6DqA7iO24CQOqGVkAA/MStsu64si WcW+ECK83IkGTY9VdOGXsH4TDSBZhdzjsGpSUTWKu6YInGfCx+lzozBIXZHxPA9N6YqJ IlSb5W5O38JRH6fyI8+kpxtT+DsLD+YZp3sGXAAFV+9zNuzsvsotfsdcRyk482F9qPg5 Kwfo3/tiU2ySVcOVKIgyDAQzi/3CBMvEr/5bs/xlTjj8Vj6KLsKqKSZW6qfbZLRozY0j B/FA== MIME-Version: 1.0 Received: by 10.60.20.69 with SMTP id l5mr11825506oee.114.1345527993655; Mon, 20 Aug 2012 22:46:33 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Mon, 20 Aug 2012 22:46:33 -0700 (PDT) In-Reply-To: <20120821053519.BD5A158085@chaos.jnpr.net> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> Date: Mon, 20 Aug 2012 22:46:33 -0700 Message-ID: From: Garrett Cooper To: "Simon J. Gerraty" Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac 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, 21 Aug 2012 05:46:34 -0000 On Mon, Aug 20, 2012 at 10:35 PM, Simon J. Gerraty wrote: > Hi, sorry about the slow response. > > On Thu, 26 Jul 2012 12:49:03 +0400, Ruslan Ermilov writes: >>On Wed, Jul 18, 2012 at 05:57:43AM +0000, David E. O'Brien wrote: >>> Author: obrien >>> Date: Wed Jul 18 05:57:42 2012 >>> New Revision: 238563 >>> URL: http://svn.freebsd.org/changeset/base/238563 >>> >>> Log: >>> a ";" tells make we want the shell to be used >>> >>> Submitted by: Simon Gerraty >>> >>> Modified: >>> head/gnu/usr.bin/groff/tmac/Makefile >> >>I don't quite understand what this change does, could you elaborate? > > Sure. This is a consequence of bmake trying to be clever. > >>Without -jN (in backwards compatibility mode), the "cd" is a no-op >>(whether it's terminated by `;' or not) because make will execute a >>single shell per command, with cwd set to ${.OBJDIR}. > > Except on very weird systems, bmake is built in what NetBSD call > "native" mode, and even in compat mode will attempt to avoid the > overhead of all those shells. > Thus, unless it spots a shell meta char, it will try and skip the shell. > > Shell builtins like 'cd' or 'chdir' cannot be directly invoked, but make > doesn't know that. Simply adding the ';' convinces it to use a shell. > It is still a no-op. > >>With -jN, "cd" becomes necessary because all commands are executed as >>a script by one shell (the reason it was added in the first place), >>but adding `;' is a no-op because commands are on separate lines. > > A better way to construct targets like this is to put any excursion out > of .OBJDIR inside (): > > (cd ${.CURDIR} && \ > ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ > koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) > > then the cd ${.OBJDIR} isn't needed at all. > note use of && rather than ; which can be very dangerous In standard scripts I would agree. In FreeBSD pmake, I would disagree, but it seems that it's the odd man out: $ bmake -f ~/Makefile.bad false; echo hmmm hmmm $ gmake -f ~/Makefile.bad false; echo hmmm hmmm $ make -f ~/Makefile.bad false; echo hmmm *** [all] Error code 1 Stop in /scratch/p4/user/gcooper/atf-head. Cheers, -Garrett From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 06:09:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A98EC106566C; Tue, 21 Aug 2012 06:09:43 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9446F8FC12; Tue, 21 Aug 2012 06:09:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L69hLf075112; Tue, 21 Aug 2012 06:09:43 GMT (envelope-from avatar@svn.freebsd.org) Received: (from avatar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L69hHS075110; Tue, 21 Aug 2012 06:09:43 GMT (envelope-from avatar@svn.freebsd.org) Message-Id: <201208210609.q7L69hHS075110@svn.freebsd.org> From: Tai-hwa Liang Date: Tue, 21 Aug 2012 06:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239476 - stable/9 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, 21 Aug 2012 06:09:43 -0000 Author: avatar Date: Tue Aug 21 06:09:43 2012 New Revision: 239476 URL: http://svn.freebsd.org/changeset/base/239476 Log: MFC r238562: Removing bsd{ar,ranlib} found on my ancient installation. Modified: stable/9/ObsoleteFiles.inc (contents, props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Tue Aug 21 02:52:25 2012 (r239475) +++ stable/9/ObsoleteFiles.inc Tue Aug 21 06:09:43 2012 (r239476) @@ -1216,6 +1216,11 @@ OLD_FILES+=usr/share/man/man2/kse_thr_in OLD_FILES+=usr/share/man/man2/kse_wakeup.2.gz OLD_FILES+=usr/lib32/libkse.so OLD_LIBS+=usr/lib32/libkse.so.3 +# 20080225: bsdar/bsdranlib rename to ar/ranlib +OLD_FILES+=usr/bin/bsdar +OLD_FILES+=usr/bin/bsdranlib +OLD_FILES+=usr/share/man/man1/bsdar.1.gz +OLD_FILES+=usr/share/man/man1/bsdranlib.1.gz # 20080220: geom_lvm rename to geom_linux_lvm OLD_FILES+=usr/share/man/man4/geom_lvm.4.gz # 20080126: oldcard.4 removal From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 06:14:09 2012 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 4BC94106564A; Tue, 21 Aug 2012 06:14:09 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 364658FC14; Tue, 21 Aug 2012 06:14:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L6E9QY075823; Tue, 21 Aug 2012 06:14:09 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L6E9NL075820; Tue, 21 Aug 2012 06:14:09 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201208210614.q7L6E9NL075820@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 21 Aug 2012 06:14: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: r239477 - 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: Tue, 21 Aug 2012 06:14:09 -0000 Author: ache Date: Tue Aug 21 06:14:08 2012 New Revision: 239477 URL: http://svn.freebsd.org/changeset/base/239477 Log: According to resolvconf.conf(5) manpage and sources, there is no 'nameservers' option which used in examples in resolvconf.conf(5), it spelled 'name_servers', so fix examples. Modified: head/contrib/openresolv/resolvconf.conf.5.in Modified: head/contrib/openresolv/resolvconf.conf.5.in ============================================================================== --- head/contrib/openresolv/resolvconf.conf.5.in Tue Aug 21 06:09:43 2012 (r239476) +++ head/contrib/openresolv/resolvconf.conf.5.in Tue Aug 21 06:14:08 2012 (r239477) @@ -113,7 +113,7 @@ This file tells dnsmasq which nameserver This file tells dnsmasq which nameservers to use for global lookups. .Pp Example resolvconf.conf for dnsmasq: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 dnsmasq_conf=/etc/dnsmasq-conf.conf .D1 dnsmasq_resolv=/etc/dnsmasq-resolv.conf .Pp @@ -129,7 +129,7 @@ Include this file in the named global sc This file tells named which nameservers to use for specific domains. .Pp Example resolvconf.conf for named: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 named_options=/etc/named-options.conf .D1 named_zones=/etc/named-zones.conf .Pp @@ -152,7 +152,7 @@ If this variable is not set then it's wr .Pa pdnsd_conf . .Pp Example resolvconf.conf for pdnsd: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 pdnsd_conf=/etc/pdnsd.conf .D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf .Pp @@ -171,7 +171,7 @@ Example pdnsd.conf: This file tells unbound about specific and global nameservers. .Pp Example resolvconf.conf for unbound: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 unbound_conf=/etc/unbound-resolvconf.conf .Pp Example unbound.conf: From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 06:14:50 2012 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 9C7DC10657E9; Tue, 21 Aug 2012 06:14:48 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og111.obsmtp.com (exprod7og111.obsmtp.com [64.18.2.175]) by mx1.freebsd.org (Postfix) with ESMTP id 75E9F8FC0A; Tue, 21 Aug 2012 06:14:46 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob111.postini.com ([64.18.6.12]) with SMTP ID DSNKUDMnVZkqXHwL33mdA3e/uAg9xE4pF3pJ@postini.com; Mon, 20 Aug 2012 23:14:47 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 20 Aug 2012 23:14:43 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7L6Ehh91556; Mon, 20 Aug 2012 23:14:43 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 0B2D158085; Mon, 20 Aug 2012 23:14:43 -0700 (PDT) To: Garrett Cooper In-Reply-To: References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> Comments: In-reply-to: Garrett Cooper message dated "Mon, 20 Aug 2012 22:46:33 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 20 Aug 2012 23:14:43 -0700 Message-ID: <20120821061443.0B2D158085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac 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, 21 Aug 2012 06:14:50 -0000 >> note use of && rather than ; which can be very dangerous > >In standard scripts I would agree. In FreeBSD pmake, I would disagree, >but it seems that it's the odd man out: Yes, this is because FreeBSD make still uses the shell's -e for error detection. NetBSD (hence bmake) abandoned that quite a while ago, as it does more harm that good. I had a vague recollection that the posix man page covered this, but the text is somewhat ambiguous. Its descripton of using system() though is probably why most makefile authors expect the command line to be the unit of exection and thus success/failure. false || echo ok works ok even with -e, but while most makes will print ok for this one too: false; test $$? != 0 && echo ok it will fail if -e is used. That's a contrived example, but I know David had a fun real life example a couple of years ago that was quite painful to workaround. --sjg From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 06:16:32 2012 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 C93D7106564A; Tue, 21 Aug 2012 06:16:32 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6C2768FC17; Tue, 21 Aug 2012 06:16:32 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:fCwaspgSk70G1R0qWxIaItCihBOJeC9ywQKAXIKgXJMCQ1cTcZL4ldwEXt2C8UgX@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7L6GQ3u099826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 21 Aug 2012 15:16:26 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 21 Aug 2012 15:16:26 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov In-Reply-To: <20120821044553.GA11375@vniz.net> References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-PRERELEASE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 21 Aug 2012 15:16:26 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, John Baldwin Subject: Re: svn commit: r239356 - 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: Tue, 21 Aug 2012 06:16:32 -0000 Hi, >>>>> On Tue, 21 Aug 2012 08:45:53 +0400 >>>>> Andrey Chernov said: ache> resolvconf -l output: ache> # resolv.conf from msk0 ache> search ache> nameserver 192.168.1.1 ache> # resolv.conf from msk0:slaac ache> nameserver ache> (btw, what is slaac?) It is abbreviation for StateLess Address AutoConfiguration described in rfc 4862. This RA option is described in rfc 5006 (IPv6 Router Advertisement Option for DNS Configuration). ache> And I want to override ache> with simple link-local IPv6 address of my router, i.e. fe80:... I think your network admin setup to advertise the address. Why do you want to use link-local address, instead? ache> Is it possible with resolvconf(8)? resolvconf(8) doesn't have such rewrite feature. However, rtsol(8) has -R option to specify your own script to update /etc/resolv.conf. You may want to write your own script to rewrite nameserver address then pass it to resolvconf(8). Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 06:30:30 2012 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 B4BC3106564A; Tue, 21 Aug 2012 06:30:30 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1E08FC12; Tue, 21 Aug 2012 06:30:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7L6USps041551; Tue, 21 Aug 2012 10:30:28 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7L6URsw041550; Tue, 21 Aug 2012 10:30:28 +0400 (MSK) (envelope-from ache) Date: Tue, 21 Aug 2012 10:30:27 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120821063027.GA41459@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: r239356 - 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: Tue, 21 Aug 2012 06:30:30 -0000 On Tue, Aug 21, 2012 at 03:16:26PM +0900, Hajimu UMEMOTO wrote: > ache> And I want to override > ache> with simple link-local IPv6 address of my router, i.e. fe80:... > > I think your network admin setup to advertise the address. Why do you > want to use link-local address, instead? I am network admin, but what router advertise is out my easy control (fixing configs in the Linux router's FS or even rebuilding router components is needed, I don't want to touch this hardware). I want override because router runs dnsmasq with caching (on both its IPv4 and IPv6 adresses), and NS it advertise goes through tunnel each time without caching in the router. > ache> Is it possible with resolvconf(8)? > > resolvconf(8) doesn't have such rewrite feature. However, rtsol(8) > has -R option to specify your own script to update /etc/resolv.conf. > You may want to write your own script to rewrite nameserver address > then pass it to resolvconf(8). So far I found the way to specify router link-local address using name_servers=fe80::... in the /etc/resolvconf.conf It prepends this name server above all others router advertise. But I still not find the way to _exclude_ what router advertise, perhaps looking into rtsol(8) possibilities you point will help here. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 06:31:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6AA381065676; Tue, 21 Aug 2012 06:31:27 +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 5150C8FC1C; Tue, 21 Aug 2012 06:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L6VRUi078662; Tue, 21 Aug 2012 06:31:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L6VRQb078654; Tue, 21 Aug 2012 06:31:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208210631.q7L6VRQb078654@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 Aug 2012 06:31: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: r239478 - in head/sys: conf powerpc/wii 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, 21 Aug 2012 06:31:27 -0000 Author: adrian Date: Tue Aug 21 06:31:26 2012 New Revision: 239478 URL: http://svn.freebsd.org/changeset/base/239478 Log: Initial support for running FreeBSD on the Nintendo Wii. We're able to reach single user mode using a memory disk device as the file system. This port includes the framebuffer driver, the PIC driver, a platform driver and the GPIO driver. The IPC driver (to talk to IOS kernels) is not yet written but there's a placeholder for it. There are still some MMU problems and to get a working system you need to patch locore32.S. Since we haven't found the best way yet to address that problem, we're not committing those changes yet. The problem is related to the different BAT layout on the Wii and to the fact that the Homebrew loader doesn't clean up the special registers (including the 8 BATs) before passing control to us. You'll need a Wii with Homebrew loader and a TV that can do NTSC (for now). Submitted by: Margarida Gouveia Added: head/sys/powerpc/wii/ head/sys/powerpc/wii/platform_wii.c (contents, props changed) head/sys/powerpc/wii/wii_bus.c (contents, props changed) head/sys/powerpc/wii/wii_exireg.h (contents, props changed) head/sys/powerpc/wii/wii_fb.c (contents, props changed) head/sys/powerpc/wii/wii_fbreg.h (contents, props changed) head/sys/powerpc/wii/wii_fbvar.h (contents, props changed) head/sys/powerpc/wii/wii_gpio.c (contents, props changed) head/sys/powerpc/wii/wii_gpioreg.h (contents, props changed) head/sys/powerpc/wii/wii_ipc.c (contents, props changed) head/sys/powerpc/wii/wii_ipcreg.h (contents, props changed) head/sys/powerpc/wii/wii_pic.c (contents, props changed) head/sys/powerpc/wii/wii_picreg.h (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/conf/options.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Aug 21 06:14:08 2012 (r239477) +++ head/sys/conf/files.powerpc Tue Aug 21 06:31:26 2012 (r239478) @@ -228,6 +228,12 @@ powerpc/psim/iobus.c optional psim powerpc/psim/ata_iobus.c optional ata psim powerpc/psim/openpic_iobus.c optional psim powerpc/psim/uart_iobus.c optional uart psim +powerpc/wii/platform_wii.c optional wii +powerpc/wii/wii_bus.c optional wii +powerpc/wii/wii_pic.c optional wii +powerpc/wii/wii_fb.c optional wii +powerpc/wii/wii_gpio.c optional wii +powerpc/wii/wii_ipc.c optional wii compat/freebsd32/freebsd32_ioctl.c optional compat_freebsd32 compat/freebsd32/freebsd32_misc.c optional compat_freebsd32 Modified: head/sys/conf/options.powerpc ============================================================================== --- head/sys/conf/options.powerpc Tue Aug 21 06:14:08 2012 (r239477) +++ head/sys/conf/options.powerpc Tue Aug 21 06:31:26 2012 (r239478) @@ -23,6 +23,7 @@ POWERMAC opt_platform.h PS3 opt_platform.h MAMBO PSIM +WII opt_platform.h SC_OFWFB opt_ofwfb.h Added: head/sys/powerpc/wii/platform_wii.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/wii/platform_wii.c Tue Aug 21 06:31:26 2012 (r239478) @@ -0,0 +1,152 @@ +/*- + * Copyright (C) 2012 Margarida Gouveia + * 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, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "platform_if.h" + +static int wii_probe(platform_t); +static int wii_attach(platform_t); +static void wii_mem_regions(platform_t, struct mem_region **, + int *, struct mem_region **, int *); +static unsigned long wii_timebase_freq(platform_t, struct cpuref *cpuref); +static void wii_reset(platform_t); +static void wii_cpu_idle(void); + +static platform_method_t wii_methods[] = { + PLATFORMMETHOD(platform_probe, wii_probe), + PLATFORMMETHOD(platform_attach, wii_attach), + PLATFORMMETHOD(platform_mem_regions, wii_mem_regions), + PLATFORMMETHOD(platform_timebase_freq, wii_timebase_freq), + PLATFORMMETHOD(platform_reset, wii_reset), + + { 0, 0 } +}; + +static platform_def_t wii_platform = { + "wii", + wii_methods, + 0 +}; + +PLATFORM_DEF(wii_platform); + +static int +wii_probe(platform_t plat) +{ + register_t vers = mfpvr(); + + /* + * The Wii includes a PowerPC 750CL with custom modifications + * ("Broadway"). + * For now, we just assume that if we are running on a + * PowerPC 750CL, then this platform is a Nintendo Wii. + */ + if ((vers & 0xfffff0e0) == (MPC750 << 16 | MPC750CL)) + return (BUS_PROBE_SPECIFIC); + + return (ENXIO); +} + +static int +wii_attach(platform_t plat) +{ + cpu_idle_hook = wii_cpu_idle; + + return (0); +} + +#define MEM_REGIONS 2 +static struct mem_region avail_regions[MEM_REGIONS]; + +static void +wii_mem_regions(platform_t plat, struct mem_region **phys, int *physsz, + struct mem_region **avail, int *availsz) +{ + /* 24MB 1T-SRAM */ + avail_regions[0].mr_start = 0x00000000; + avail_regions[0].mr_size = 0x01800000 - 0x0004000; + + /* + * Reserve space for the framebuffer which is located + * at the end of this 24MB memory region. See wii_fbreg.h. + */ + avail_regions[0].mr_size -= WIIFB_FB_LEN; + + /* 64MB GDDR3 SDRAM */ + avail_regions[1].mr_start = 0x10000000 + 0x0004000; + avail_regions[1].mr_size = 0x04000000 - 0x0004000; + + /* XXX for now only use the first memory region */ +#undef MEM_REGIONS +#define MEM_REGIONS 1 + + *phys = *avail = avail_regions; + *physsz = *availsz = MEM_REGIONS; +} + +static u_long +wii_timebase_freq(platform_t plat, struct cpuref *cpuref) +{ + + /* Bus Frequency (243MHz) / 4 */ + return (60750000); +} + +static void +wii_reset(platform_t plat) +{ +} + +static void +wii_cpu_idle(void) +{ +} Added: head/sys/powerpc/wii/wii_bus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/wii/wii_bus.c Tue Aug 21 06:31:26 2012 (r239478) @@ -0,0 +1,293 @@ +/*- + * Copyright (C) 2012 Margarida Gouveia + * 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, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static void wiibus_identify(driver_t *, device_t); +static int wiibus_probe(device_t); +static int wiibus_attach(device_t); +static int wiibus_print_child(device_t, device_t); +static struct resource * + wiibus_alloc_resource(device_t, device_t, int, int *, + unsigned long, unsigned long, unsigned long, + unsigned int); +static int wiibus_activate_resource(device_t, device_t, int, int, + struct resource *); + +static device_method_t wiibus_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, wiibus_identify), + DEVMETHOD(device_probe, wiibus_probe), + DEVMETHOD(device_attach, wiibus_attach), + + /* Bus interface */ + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_print_child, wiibus_print_child), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, wiibus_alloc_resource), + DEVMETHOD(bus_activate_resource,wiibus_activate_resource), + + DEVMETHOD_END +}; + +struct wiibus_softc { + device_t sc_dev; + struct rman sc_rman; +}; + +static MALLOC_DEFINE(M_WIIBUS, "wiibus", "Nintendo Wii system bus"); + +struct wiibus_devinfo { + struct resource_list di_resources; + uint8_t di_init; +}; + +static driver_t wiibus_driver = { + "wiibus", + wiibus_methods, + sizeof(struct wiibus_softc) +}; + +static devclass_t wiibus_devclass; + +DRIVER_MODULE(wiibus, nexus, wiibus_driver, wiibus_devclass, 0, 0); + +static void +wiibus_identify(driver_t *driver, device_t parent) +{ + if (strcmp(installed_platform(), "wii") != 0) + return; + + if (device_find_child(parent, "wiibus", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "wiibus", 0); +} + + +static int +wiibus_probe(device_t dev) +{ + /* Do not attach to any OF nodes that may be present */ + + device_set_desc(dev, "Nintendo Wii System Bus"); + + return (BUS_PROBE_NOWILDCARD); +} + +static void +wiibus_init_device_resources(struct rman *rm, struct wiibus_devinfo *dinfo, + unsigned int rid, uintptr_t addr, size_t len, unsigned int irq) + +{ + if (!dinfo->di_init) { + resource_list_init(&dinfo->di_resources); + dinfo->di_init++; + } + if (addr) { + rman_manage_region(rm, addr, addr + len - 1); + resource_list_add(&dinfo->di_resources, SYS_RES_MEMORY, rid, + addr, addr + len, len); + } + if (irq) + resource_list_add(&dinfo->di_resources, SYS_RES_IRQ, rid, + irq, irq, 1); +} + +static int +wiibus_attach(device_t self) +{ + struct wiibus_softc *sc; + struct wiibus_devinfo *dinfo; + device_t cdev; + + sc = device_get_softc(self); + sc->sc_rman.rm_type = RMAN_ARRAY; + sc->sc_rman.rm_descr = "Wii Bus Memory Mapped I/O"; + rman_init(&sc->sc_rman); + + /* Nintendo PIC */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIPIC_REG_ADDR, + WIIPIC_REG_LEN, 0); + cdev = BUS_ADD_CHILD(self, 0, "wiipic", 0); + device_set_ivars(cdev, dinfo); + + /* Framebuffer */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIFB_REG_ADDR, + WIIFB_REG_LEN, 8); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 1, WIIFB_FB_ADDR, + WIIFB_FB_LEN, 0); + cdev = BUS_ADD_CHILD(self, 0, "wiifb", 0); + device_set_ivars(cdev, dinfo); + + /* External Interface Bus */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIEXI_REG_ADDR, + WIIEXI_REG_LEN, 4); + cdev = BUS_ADD_CHILD(self, 0, "wiiexi", 0); + device_set_ivars(cdev, dinfo); + + /* Nintendo IOS IPC */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIIPC_REG_ADDR, + WIIIPC_REG_LEN, 14); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 1, WIIIPC_IOH_ADDR, + WIIIPC_IOH_LEN, 0); + cdev = BUS_ADD_CHILD(self, 0, "wiiipc", 0); + device_set_ivars(cdev, dinfo); + + /* GPIO */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIGPIO_REG_ADDR, + WIIGPIO_REG_LEN, 0); + cdev = BUS_ADD_CHILD(self, 0, "wiigpio", 0); + device_set_ivars(cdev, dinfo); + + return (bus_generic_attach(self)); +} + +static int +wiibus_print_child(device_t dev, device_t child) +{ + struct wiibus_devinfo *dinfo = device_get_ivars(child); + int retval = 0; + + retval += bus_print_child_header(dev, child); + retval += resource_list_print_type(&dinfo->di_resources, "mem", + SYS_RES_MEMORY, "%#lx"); + retval += resource_list_print_type(&dinfo->di_resources, "irq", + SYS_RES_IRQ, "%ld"); + retval += bus_print_child_footer(dev, child); + + return (retval); +} + +static struct resource * +wiibus_alloc_resource(device_t bus, device_t child, int type, + int *rid, unsigned long start, unsigned long end, + unsigned long count, unsigned int flags) +{ + struct wiibus_softc *sc; + struct wiibus_devinfo *dinfo; + struct resource_list_entry *rle; + struct resource *rv; + int needactivate; + + sc = device_get_softc(bus); + dinfo = device_get_ivars(child); + needactivate = flags & RF_ACTIVE; + flags &= ~RF_ACTIVE; + + switch (type) { + case SYS_RES_MEMORY: + rle = resource_list_find(&dinfo->di_resources, SYS_RES_MEMORY, + *rid); + if (rle == NULL) { + device_printf(bus, "no res entry for %s memory 0x%x\n", + device_get_nameunit(child), *rid); + return (NULL); + } + rv = rman_reserve_resource(&sc->sc_rman, rle->start, rle->end, + rle->count, flags, child); + if (rv == NULL) { + device_printf(bus, + "failed to reserve resource for %s\n", + device_get_nameunit(child)); + return (NULL); + } + rman_set_rid(rv, *rid); + break; + /* XXX IRQ */ + default: + device_printf(bus, "unknown resource request from %s\n", + device_get_nameunit(child)); + return (NULL); + } + + if (needactivate) { + if (bus_activate_resource(child, type, *rid, rv) != 0) { + device_printf(bus, + "failed to activate resource for %s\n", + device_get_nameunit(child)); + return (NULL); + } + } + + return (rv); +} + +static int +wiibus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + void *p; + + switch (type) { + case SYS_RES_MEMORY: + p = pmap_mapdev(rman_get_start(res), rman_get_size(res)); + if (p == NULL) + return (ENOMEM); + rman_set_virtual(res, p); + rman_set_bustag(res, &bs_be_tag); + rman_set_bushandle(res, (unsigned long)p); + break; + /* XXX IRQ */ + default: + device_printf(bus, + "unknown activate resource request from %s\n", + device_get_nameunit(child)); + return (ENXIO); + } + + return (rman_activate_resource(res)); +} + Added: head/sys/powerpc/wii/wii_exireg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/wii/wii_exireg.h Tue Aug 21 06:31:26 2012 (r239478) @@ -0,0 +1,35 @@ +/*- + * Copyright (C) 2012 Margarida Gouveia + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _POWERPC_WII_WII_EXIREG_H +#define _POWERPC_WII_WII_EXIREG_H + +#define WIIEXI_REG_ADDR 0x0d006800 +#define WIIEXI_REG_LEN 0x40 + +#endif /* _POWERPC_WII_WII_IPCREG_H */ Added: head/sys/powerpc/wii/wii_fb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/wii/wii_fb.c Tue Aug 21 06:31:26 2012 (r239478) @@ -0,0 +1,881 @@ +/*- + * Copyright (C) 2012 Margarida Gouveia + * Copyright (c) 2003 Peter Grehan + * 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, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +/* + * Driver for the Nintendo Wii's framebuffer. Based on Linux's gcnfb.c. + */ + +/* + * Syscons glue. + */ +static int wiifb_scprobe(device_t); +static int wiifb_scattach(device_t); + +static device_method_t wiifb_sc_methods[] = { + DEVMETHOD(device_probe, wiifb_scprobe), + DEVMETHOD(device_attach, wiifb_scattach), + + DEVMETHOD_END +}; + +static driver_t wiifb_sc_driver = { + "wiifb", + wiifb_sc_methods, + sizeof(sc_softc_t), +}; + +static devclass_t sc_devclass; + +DRIVER_MODULE(sc, wiibus, wiifb_sc_driver, sc_devclass, 0, 0); + +static int +wiifb_scprobe(device_t dev) +{ + int error; + + device_set_desc(dev, "Nintendo Wii frambuffer"); + + error = sc_probe_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD); + if (error != 0) + return (error); + + /* This is a fake device, so make sure we added it ourselves */ + return (BUS_PROBE_NOWILDCARD); +} + +static int +wiifb_scattach(device_t dev) +{ + + return (sc_attach_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD)); +} + +/* + * Video driver routines and glue. + */ +static void wiifb_reset_video(struct wiifb_softc *); +static void wiifb_enable_interrupts(struct wiifb_softc *); +static void wiifb_configure_tv_mode(struct wiifb_softc *); +static void wiifb_setup_framebuffer(struct wiifb_softc *); +static int wiifb_configure(int); +static vi_probe_t wiifb_probe; +static vi_init_t wiifb_init; +static vi_get_info_t wiifb_get_info; +static vi_query_mode_t wiifb_query_mode; +static vi_set_mode_t wiifb_set_mode; +static vi_save_font_t wiifb_save_font; +static vi_load_font_t wiifb_load_font; +static vi_show_font_t wiifb_show_font; +static vi_save_palette_t wiifb_save_palette; +static vi_load_palette_t wiifb_load_palette; +static vi_set_border_t wiifb_set_border; +static vi_save_state_t wiifb_save_state; +static vi_load_state_t wiifb_load_state; +static vi_set_win_org_t wiifb_set_win_org; +static vi_read_hw_cursor_t wiifb_read_hw_cursor; +static vi_set_hw_cursor_t wiifb_set_hw_cursor; +static vi_set_hw_cursor_shape_t wiifb_set_hw_cursor_shape; +static vi_blank_display_t wiifb_blank_display; +static vi_mmap_t wiifb_mmap; +static vi_ioctl_t wiifb_ioctl; +static vi_clear_t wiifb_clear; +static vi_fill_rect_t wiifb_fill_rect; +static vi_bitblt_t wiifb_bitblt; +static vi_diag_t wiifb_diag; +static vi_save_cursor_palette_t wiifb_save_cursor_palette; +static vi_load_cursor_palette_t wiifb_load_cursor_palette; +static vi_copy_t wiifb_copy; +static vi_putp_t wiifb_putp; +static vi_putc_t wiifb_putc; +static vi_puts_t wiifb_puts; +static vi_putm_t wiifb_putm; + +static video_switch_t wiifbvidsw = { + .probe = wiifb_probe, + .init = wiifb_init, + .get_info = wiifb_get_info, + .query_mode = wiifb_query_mode, + .set_mode = wiifb_set_mode, + .save_font = wiifb_save_font, + .load_font = wiifb_load_font, + .show_font = wiifb_show_font, + .save_palette = wiifb_save_palette, + .load_palette = wiifb_load_palette, + .set_border = wiifb_set_border, + .save_state = wiifb_save_state, + .load_state = wiifb_load_state, + .set_win_org = wiifb_set_win_org, + .read_hw_cursor = wiifb_read_hw_cursor, + .set_hw_cursor = wiifb_set_hw_cursor, + .set_hw_cursor_shape = wiifb_set_hw_cursor_shape, + .blank_display = wiifb_blank_display, + .mmap = wiifb_mmap, + .ioctl = wiifb_ioctl, + .clear = wiifb_clear, + .fill_rect = wiifb_fill_rect, + .bitblt = wiifb_bitblt, + .diag = wiifb_diag, + .save_cursor_palette = wiifb_save_cursor_palette, + .load_cursor_palette = wiifb_load_cursor_palette, + .copy = wiifb_copy, + .putp = wiifb_putp, + .putc = wiifb_putc, + .puts = wiifb_puts, + .putm = wiifb_putm, +}; + +VIDEO_DRIVER(wiifb, wiifbvidsw, wiifb_configure); + +extern sc_rndr_sw_t txtrndrsw; +RENDERER(wiifb, 0, txtrndrsw, gfb_set); +RENDERER_MODULE(wiifb, gfb_set); + +static struct wiifb_softc wiifb_softc; +static uint16_t wiifb_static_window[ROW*COL]; +extern u_char dflt_font_8[]; + +/* + * Map the syscons colors to YUY2 (Y'UV422). + * Some colours are an approximation. + * + * The Wii has a 16 bit pixel, so each 32 bit DWORD encodes + * two pixels. The upper 16 bits is for pixel 0 (left hand pixel + * in a pair), the lower 16 bits is for pixel 1. + * + * For now, we're going to ignore that entirely and just use the + * lower 16 bits for each pixel. We'll take the upper value into + * account later. + */ +static uint32_t wiifb_cmap[16] = { + 0x00800080, /* Black */ + 0x1dff1d6b, /* Blue */ + 0x4b554b4a, /* Green */ + 0x80808080, /* Cyan */ + 0x4c544cff, /* Red */ + 0x3aaa34b5, /* Magenta */ + 0x7140718a, /* Brown */ + 0xff80ff80, /* White */ + 0x80808080, /* Gray */ + 0xc399c36a, /* Bright Blue */ + 0xd076d074, /* Bright Green */ + 0x80808080, /* Bright Cyan */ + 0x4c544cff, /* Bright Red */ + 0x3aaa34b5, /* Bright Magenta */ + 0xe100e194, /* Bright Yellow */ + 0xff80ff80 /* Bright White */ +}; + +static struct wiifb_mode_desc wiifb_modes[] = { + [WIIFB_MODE_NTSC_480i] = { + "NTSC 480i", + 640, 480, + 525, + WIIFB_MODE_FLAG_INTERLACED, + }, + [WIIFB_MODE_NTSC_480p] = { + "NTSC 480p", + 640, 480, + 525, + WIIFB_MODE_FLAG_PROGRESSIVE, + }, + [WIIFB_MODE_PAL_576i] = { + "PAL 576i (50Hz)", + 640, 574, + 625, + WIIFB_MODE_FLAG_INTERLACED, + }, + [WIIFB_MODE_PAL_480i] = { + "PAL 480i (60Hz)", + 640, 480, + 525, + WIIFB_MODE_FLAG_INTERLACED, + }, + [WIIFB_MODE_PAL_480p] = { + "PAL 480p", + 640, 480, + 525, + WIIFB_MODE_FLAG_PROGRESSIVE, + }, +}; + +static const uint32_t wiifb_filter_coeft[] = { + 0x1ae771f0, 0x0db4a574, 0x00c1188e, 0xc4c0cbe2, 0xfcecdecf, + 0x13130f08, 0x00080c0f +}; + +static __inline int +wiifb_background(uint8_t attr) +{ + + return (attr >> 4); +} + +static __inline int +wiifb_foreground(uint8_t attr) +{ + + return (attr & 0x0f); +} + +static void +wiifb_reset_video(struct wiifb_softc *sc) +{ + struct wiifb_dispcfg dc; + + wiifb_dispcfg_read(sc, &dc); + dc.dc_reset = 1; + wiifb_dispcfg_write(sc, &dc); + dc.dc_reset = 0; + wiifb_dispcfg_write(sc, &dc); +} + +static void +wiifb_enable_interrupts(struct wiifb_softc *sc) +{ + struct wiifb_dispint di; + +#ifdef notyet + /* + * Display Interrupt 0 + */ + di.di_htiming = 1; + di.di_vtiming = 1; + di.di_enable = 1; + di.di_irq = 1; + wiifb_dispint_write(sc, 0, &di); + + /* + * Display Interrupt 1 + */ + di.di_htiming = sc->sc_format == WIIFB_FORMAT_PAL ? 433 : 430; + di.di_vtiming = sc->sc_mode->fd_lines; + di.di_enable = 1; + di.di_irq = 1; + if (sc->sc_mode->fd_flags & WIIFB_MODE_FLAG_INTERLACED) + di.di_vtiming /= 2; + wiifb_dispint_write(sc, 1, &di); + + /* + * Display Interrupts 2 and 3 are not used. + */ + memset(&di, 0, sizeof(di)); + wiifb_dispint_write(sc, 2, &di); + wiifb_dispint_write(sc, 3, &di); +#else + memset(&di, 0, sizeof(di)); + wiifb_dispint_write(sc, 0, &di); + wiifb_dispint_write(sc, 1, &di); + wiifb_dispint_write(sc, 2, &di); + wiifb_dispint_write(sc, 3, &di); +#endif +} + +/* + * Reference gcnfb.c for an in depth explanation. + * XXX only works with NTSC. + */ +static void +wiifb_configure_tv_mode(struct wiifb_softc *sc) +{ + struct wiifb_vtiming vt; + struct wiifb_hscaling hs; + struct wiifb_htiming0 ht0; + struct wiifb_htiming1 ht1; + struct wiifb_vtimingodd vto; + struct wiifb_vtimingeven vte; + struct wiifb_burstblankodd bbo; + struct wiifb_burstblankeven bbe; + struct wiifb_picconf pc; + struct wiifb_mode_desc *mode = sc->sc_mode; + unsigned int height = mode->fd_height; + unsigned int width = mode->fd_width; + unsigned int eqpulse, interlacebias, shift; + const unsigned int maxwidth = 714; + unsigned int hblanking = maxwidth - width; + unsigned int hmargin = hblanking / 2; + unsigned int A = 20 + hmargin, C = 60 + hblanking - hmargin; + unsigned int maxheight = 484; + unsigned int P = 2 * (20 - 10 + 1); + unsigned int Q = 1; + unsigned int vblanking = maxheight - height; + unsigned int vmargin = vblanking / 2; + unsigned int prb = vmargin; + unsigned int psb = vblanking - vmargin; + int i; + + /* + * Vertical timing. + */ + if (mode->fd_flags & WIIFB_MODE_FLAG_INTERLACED) { + vt.vt_actvideo = height / 2; + interlacebias = 1; + shift = 0; + } else { + vt.vt_actvideo = height; + interlacebias = 0; + shift = 1; + } + /* Lines of equalization */ + if (mode->fd_lines == 625) + eqpulse = 2 * 2.5; + else + eqpulse = 2 * 3; + vt.vt_eqpulse = eqpulse << shift; + wiifb_vtiming_write(sc, &vt); + + /* + * Horizontal timings. + */ + ht0.ht0_hlinew = 858 / 2; + ht1.ht1_hsyncw = 64; + ht0.ht0_hcolourstart = 71; + ht0.ht0_hcolourend = 71 + 34; + ht1.ht1_hblankstart = (858 / 2) - A; + ht1.ht1_hblankend = 64 + C; + wiifb_htiming0_write(sc, &ht0); + wiifb_htiming1_write(sc, &ht1); + + /* + * Vertical timing odd/even. + */ + if (vmargin & 1) { + vto.vto_preb = (P + interlacebias + prb) << shift; + vto.vto_postb = (Q - interlacebias + psb) << shift; + vte.vte_preb = (P + prb) << shift; + vte.vte_postb = (Q - psb) << shift; + } else { + /* XXX if this isn't 0, it doesn't work? */ + prb = 0; + psb = 0; + vte.vte_preb = (P + interlacebias + prb) << shift; + vte.vte_postb = (Q - interlacebias + psb) << shift; + vto.vto_preb = (P + prb) << shift; + vto.vto_postb = (Q - psb) << shift; + } + wiifb_vtimingodd_write(sc, &vto); + wiifb_vtimingeven_write(sc, &vte); + + /* + * Burst blanking odd/even interval. + */ + bbo.bbo_bs1 = 2 * (18 - 7 + 1); + bbe.bbe_bs2 = bbo.bbo_bs3 = bbe.bbe_bs4 = bbo.bbo_bs1; + bbo.bbo_be1 = 2 * (525 - 7 + 1); + bbe.bbe_be2 = bbo.bbo_be3 = bbe.bbe_be4 = bbo.bbo_be1; + wiifb_burstblankodd_write(sc, &bbo); + wiifb_burstblankeven_write(sc, &bbe); + + /* + * Picture configuration. + */ + pc.pc_strides = (mode->fd_width * 2) / 32; + if (mode->fd_flags & WIIFB_MODE_FLAG_INTERLACED) + pc.pc_strides *= 2; + pc.pc_reads = (mode->fd_width * 2) / 32; + wiifb_picconf_write(sc, &pc); + + /* + * Horizontal scaling disabled. + */ + hs.hs_enable = 0; + hs.hs_step = 256; + wiifb_hscaling_write(sc, &hs); + + /* + * Filter coeficient table. + */ + for (i = 0; i < 7; i++) + wiifb_filtcoeft_write(sc, i, wiifb_filter_coeft[i]); + + /* + * Anti alias. + */ + wiifb_antialias_write(sc, 0x00ff0000); + + /* + * Video clock. + */ + wiifb_videoclk_write(sc, + mode->fd_flags & WIIFB_MODE_FLAG_INTERLACED ? 0 : 1); + + /* + * Disable horizontal scaling width. + */ + wiifb_hscalingw_write(sc, mode->fd_width); + + /* + * DEBUG mode borders. Not used. + */ + wiifb_hborderend_write(sc, 0); + wiifb_hborderstart_write(sc, 0); + + /* + * XXX unknown registers. + */ + wiifb_unknown1_write(sc, 0x00ff); + wiifb_unknown2_write(sc, 0x00ff00ff); + wiifb_unknown3_write(sc, 0x00ff00ff); +} + +static void +wiifb_setup_framebuffer(struct wiifb_softc *sc) +{ + intptr_t addr = sc->sc_fb_addr; + struct wiifb_topfieldbasel tfbl; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 06:33:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8D801065694; Tue, 21 Aug 2012 06:33: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 A40768FC1E; Tue, 21 Aug 2012 06:33:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L6XAu4078964; Tue, 21 Aug 2012 06:33:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L6XAcu078961; Tue, 21 Aug 2012 06:33:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208210633.q7L6XAcu078961@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 Aug 2012 06:33: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: r239479 - head/sys/powerpc/ofw 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, 21 Aug 2012 06:33:10 -0000 Author: adrian Date: Tue Aug 21 06:33:10 2012 New Revision: 239479 URL: http://svn.freebsd.org/changeset/base/239479 Log: Don't probe the openfirmware framebuffer if the system is a Wii or it will crash. Submitted by: Margarida Gouveia Modified: head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Tue Aug 21 06:31:26 2012 (r239478) +++ head/sys/powerpc/ofw/ofw_syscons.c Tue Aug 21 06:33:10 2012 (r239479) @@ -940,6 +940,12 @@ ofwfb_scidentify(driver_t *driver, devic device_t child; /* + * The Nintendo Wii doesn't have open firmware, so don't probe ofwfb + * because otherwise we will crash. + */ + if (strcmp(installed_platform(), "wii") == 0) + return; + /* * Add with a priority guaranteed to make it last on * the device list */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 06:34:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D54EE106564A; Tue, 21 Aug 2012 06:34: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 BFF078FC15; Tue, 21 Aug 2012 06:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L6YLoL079171; Tue, 21 Aug 2012 06:34:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L6YL5C079168; Tue, 21 Aug 2012 06:34:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208210634.q7L6YL5C079168@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 Aug 2012 06:34: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: r239480 - in head/sys/powerpc: aim 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, 21 Aug 2012 06:34:21 -0000 Author: adrian Date: Tue Aug 21 06:34:21 2012 New Revision: 239480 URL: http://svn.freebsd.org/changeset/base/239480 Log: On Nintendo Wii CPUs, the mdp value will be garbage. Set it to NULL so as to not confuse things. Submitted by: Margarida Gouveia Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Tue Aug 21 06:33:10 2012 (r239479) +++ head/sys/powerpc/aim/machdep.c Tue Aug 21 06:34:21 2012 (r239480) @@ -257,7 +257,7 @@ powerpc_init(vm_offset_t startkernel, vm size_t trap_offset; void *kmdp; char *env; - register_t msr, scratch; + register_t msr, scratch, vers; uint8_t *cache_check; int cacheline_warn; #ifndef __powerpc64__ @@ -269,6 +269,14 @@ powerpc_init(vm_offset_t startkernel, vm cacheline_warn = 0; /* + * The Wii loader doesn't pass us any environment so, mdp + * points to garbage at this point. The Wii CPU is a 750CL. + */ + vers = mfpvr(); + if ((vers & 0xfffff0e0) == (MPC750 << 16 | MPC750CL)) + mdp = NULL; + + /* * Parse metadata if present and fetch parameters. Must be done * before console is inited so cninit gets the right value of * boothowto. Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Tue Aug 21 06:33:10 2012 (r239479) +++ head/sys/powerpc/include/spr.h Tue Aug 21 06:34:21 2012 (r239480) @@ -140,6 +140,7 @@ #define MPC603e 0x0006 #define MPC603ev 0x0007 #define MPC750 0x0008 +#define MPC750CL 0x7000 /* Nintendo Wii's Broadway */ #define MPC604ev 0x0009 #define MPC7400 0x000c #define MPC620 0x0014 From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 06:58:18 2012 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 98E57106564A; Tue, 21 Aug 2012 06:58:18 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id EA4ED8FC14; Tue, 21 Aug 2012 06:58:17 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:1XMCF5a3HN+N+MEXE5zlVDSdOQ4J9DioeyLxsozB2OOMfXsKN5bU2Feff37ywiHQ@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7L6wC9V030446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 21 Aug 2012 15:58:13 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 21 Aug 2012 15:58:12 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov BIn-Reply-To: <20120821063027.GA41459@vniz.net> References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-PRERELEASE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 21 Aug 2012 15:58:13 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - 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: Tue, 21 Aug 2012 06:58:18 -0000 Hi, >>>>> On Tue, 21 Aug 2012 10:30:27 +0400 >>>>> Andrey Chernov said: ache> I am network admin, but what router advertise is out my easy control ache> (fixing configs in the Linux router's FS or even rebuilding router ache> components is needed, I don't want to touch this hardware). You may want to try -u option of rtsol(8) to determine which router advertises it. It saves link-local address of the advertising router in interface name. You can see it by `resolvconf -l'. ache> I want override because router runs dnsmasq with caching (on both its IPv4 ache> and IPv6 adresses), and NS it advertise goes through tunnel each time ache> without caching in the router. Okay, thanks. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 07:14:22 2012 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 87A8C106564A; Tue, 21 Aug 2012 07:14:22 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 006C98FC12; Tue, 21 Aug 2012 07:14:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7L7EK1Y042243; Tue, 21 Aug 2012 11:14:20 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7L7EK74042242; Tue, 21 Aug 2012 11:14:20 +0400 (MSK) (envelope-from ache) Date: Tue, 21 Aug 2012 11:14:20 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120821071420.GA42109@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: r239356 - 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: Tue, 21 Aug 2012 07:14:22 -0000 On Tue, Aug 21, 2012 at 03:58:12PM +0900, Hajimu UMEMOTO wrote: > ache> I am network admin, but what router advertise is out my easy control > ache> (fixing configs in the Linux router's FS or even rebuilding router > ache> components is needed, I don't want to touch this hardware). > > You may want to try -u option of rtsol(8) to determine which router > advertises it. It saves link-local address of the advertising router > in interface name. You can see it by `resolvconf -l'. I have only one router, so I know who does it :) But router runs Linix and what it advertise to client is not configurable via its web interface, so require Linux configs or/and demons patching I don't want to. > ache> I want override because router runs dnsmasq with caching (on both its IPv4 > ache> and IPv6 adresses), and NS it advertise goes through tunnel each time > ache> without caching in the router. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 08:31:30 2012 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 A5D781065678; Tue, 21 Aug 2012 08:31:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 911F78FC20; Tue, 21 Aug 2012 08:31:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L8VUxj096121; Tue, 21 Aug 2012 08:31:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L8VUPU096118; Tue, 21 Aug 2012 08:31:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208210831.q7L8VUPU096118@svn.freebsd.org> From: Xin LI Date: Tue, 21 Aug 2012 08:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239481 - releng/9.1/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, 21 Aug 2012 08:31:30 -0000 Author: delphij Date: Tue Aug 21 08:31:30 2012 New Revision: 239481 URL: http://svn.freebsd.org/changeset/base/239481 Log: MFC r239084: Add PCI IDs for various new High Point RocketRAID 43xx and 3xxx devices. Obtained from: FreeNAS Approved by: re (implicit, follow-up for r239460) Modified: releng/9.1/share/man/man4/hptiop.4 Directory Properties: releng/9.1/share/man/man4/ (props changed) Modified: releng/9.1/share/man/man4/hptiop.4 ============================================================================== --- releng/9.1/share/man/man4/hptiop.4 Tue Aug 21 06:34:21 2012 (r239480) +++ releng/9.1/share/man/man4/hptiop.4 Tue Aug 21 08:31:30 2012 (r239481) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2011 +.Dd August 5, 2012 .Dt HPTIOP 4 .Os .Sh NAME @@ -58,34 +58,46 @@ driver supports the following SAS and SA .Pp .Bl -bullet -compact .It -HighPoint RocketRAID 4320 +HighPoint RocketRAID 4322 .It HighPoint RocketRAID 4321 .It -HighPoint RocketRAID 4322 +HighPoint RocketRAID 4320 .It -HighPoint RocketRAID 3220 +HighPoint RocketRAID 4311 .It -HighPoint RocketRAID 3320 +HighPoint RocketRAID 4310 .It -HighPoint RocketRAID 3410 +HighPoint RocketRAID 4211 .It -HighPoint RocketRAID 3520 +HighPoint RocketRAID 4210 .It -HighPoint RocketRAID 3510 +HighPoint RocketRAID 3560 .It -HighPoint RocketRAID 3511 +HighPoint RocketRAID 3540 .It -HighPoint RocketRAID 3521 +HighPoint RocketRAID 3530 .It HighPoint RocketRAID 3522 .It -HighPoint RocketRAID 3540 +HighPoint RocketRAID 3521 .It -HighPoint RocketRAID 3120 +HighPoint RocketRAID 3520 +.It +HighPoint RocketRAID 3511 +.It +HighPoint RocketRAID 3510 +.It +HighPoint RocketRAID 3410 +.It +HighPoint RocketRAID 3320 +.It +HighPoint RocketRAID 3220 .It HighPoint RocketRAID 3122 .It +HighPoint RocketRAID 3120 +.It HighPoint RocketRAID 3020 .El .Sh NOTES From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 08:40:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25096106564A; Tue, 21 Aug 2012 08:40:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id CE0258FC0A; Tue, 21 Aug 2012 08:40:00 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:dd99:997b:50d0:d751] (unknown [IPv6:2001:7b8:3a7:0:dd99:997b:50d0:d751]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id BCB885C59; Tue, 21 Aug 2012 10:39:51 +0200 (CEST) Message-ID: <50334957.6020201@FreeBSD.org> Date: Tue, 21 Aug 2012 10:39:51 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120815 Thunderbird/15.0 MIME-Version: 1.0 To: Jan Beich References: <201208201833.q7KIX58p075876@svn.freebsd.org> <1T3c9K-000Jlb-7g@internal.tormail.org> In-Reply-To: <1T3c9K-000Jlb-7g@internal.tormail.org> Content-Type: multipart/mixed; boundary="------------010001080807070805040402" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jason Evans Subject: jemalloc and clang (was: Re: svn commit: r239462 - in head) 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, 21 Aug 2012 08:40:01 -0000 This is a multi-part message in MIME format. --------------010001080807070805040402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-08-21 02:17, Jan Beich wrote: ... > Time to revert r228540? > > Index: contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h > =================================================================== > --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (revision 239467) > +++ contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (working copy) > @@ -56,10 +56,6 @@ > #ifndef JEMALLOC_TLS_MODEL > # define JEMALLOC_TLS_MODEL /* Default. */ > #endif > -#ifdef __clang__ > -# undef JEMALLOC_TLS_MODEL > -# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ > -#endif > > #define STATIC_PAGE_SHIFT PAGE_SHIFT > #define LG_SIZEOF_INT 2 Well, if Jason would like to support upstream jemalloc for different versions of clang, it is probably better to to use __has_feature() instead. Jason, what do you think of the attached patch? Or could we just remove the whole #ifdef __clang__ part? --------------010001080807070805040402 Content-Type: text/x-diff; name="jemalloc-clang-tlsmodel-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="jemalloc-clang-tlsmodel-1.diff" Index: contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h =================================================================== --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (revision 239463) +++ contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (working copy) @@ -56,9 +56,9 @@ #ifndef JEMALLOC_TLS_MODEL # define JEMALLOC_TLS_MODEL /* Default. */ #endif -#ifdef __clang__ +#if defined(__clang__) && !__has_feature(tls_model) # undef JEMALLOC_TLS_MODEL -# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ +# define JEMALLOC_TLS_MODEL /* This clang does not support tls_model. */ #endif #define STATIC_PAGE_SHIFT PAGE_SHIFT --------------010001080807070805040402-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 09:05:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 879CE106566B; Tue, 21 Aug 2012 09:05:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 599C48FC15; Tue, 21 Aug 2012 09:05:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L95Ok8001402; Tue, 21 Aug 2012 09:05:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L95O95001398; Tue, 21 Aug 2012 09:05:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208210905.q7L95O95001398@svn.freebsd.org> From: Xin LI Date: Tue, 21 Aug 2012 09:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239482 - releng/9.1/contrib/opie/libopie 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, 21 Aug 2012 09:05:24 -0000 Author: delphij Date: Tue Aug 21 09:05:23 2012 New Revision: 239482 URL: http://svn.freebsd.org/changeset/base/239482 Log: MFC r239169: RFC 2289 requires all hashes be stored in little endian format before folding to 64 bits, while SHA1 code is big endian. Therefore, a bswap32 is required before using the value. Without this change, the implementation does not conform to test vector found in RFC 2289. PR: bin/170519 Submitted by: Arthur Mesh (with changes) Approved by: re (kib) Modified: releng/9.1/contrib/opie/libopie/hash.c releng/9.1/contrib/opie/libopie/hashlen.c Directory Properties: releng/9.1/contrib/opie/ (props changed) Modified: releng/9.1/contrib/opie/libopie/hash.c ============================================================================== --- releng/9.1/contrib/opie/libopie/hash.c Tue Aug 21 08:31:30 2012 (r239481) +++ releng/9.1/contrib/opie/libopie/hash.c Tue Aug 21 09:05:23 2012 (r239482) @@ -17,6 +17,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -39,6 +41,13 @@ unsigned algorithm) SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); }; break; case 4: Modified: releng/9.1/contrib/opie/libopie/hashlen.c ============================================================================== --- releng/9.1/contrib/opie/libopie/hashlen.c Tue Aug 21 08:31:30 2012 (r239481) +++ releng/9.1/contrib/opie/libopie/hashlen.c Tue Aug 21 09:05:23 2012 (r239482) @@ -14,6 +14,8 @@ you didn't get a copy, you may request o $FreeBSD$ */ +#include + #include "opie_cfg.h" #include "opie.h" @@ -36,6 +38,13 @@ VOIDPTR in AND struct opie_otpkey *out A SHA1_Final((unsigned char *)digest, &sha); results[0] = digest[0] ^ digest[2] ^ digest[4]; results[1] = digest[1] ^ digest[3]; + + /* + * RFC2289 mandates that we convert SHA1 digest from big-endian to little + * see Appendix A. + */ + results[0] = bswap32(results[0]); + results[1] = bswap32(results[1]); break; } case 4: { From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 09:10:15 2012 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 64DFC106567B; Tue, 21 Aug 2012 09:10:15 +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 457918FC18; Tue, 21 Aug 2012 09:10:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L9AFVK002201; Tue, 21 Aug 2012 09:10:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9AFE1002198; Tue, 21 Aug 2012 09:10:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208210910.q7L9AFE1002198@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Aug 2012 09:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239483 - in stable/9/sys/sparc64: include 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: Tue, 21 Aug 2012 09:10:15 -0000 Author: marius Date: Tue Aug 21 09:10:14 2012 New Revision: 239483 URL: http://svn.freebsd.org/changeset/base/239483 Log: MFC: r239079 Merge r236494 from x86: Isolate the global TTE list lock from data and other locks to prevent false sharing within the cache. Modified: stable/9/sys/sparc64/include/pmap.h stable/9/sys/sparc64/sparc64/pmap.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/sparc64/include/pmap.h ============================================================================== --- stable/9/sys/sparc64/include/pmap.h Tue Aug 21 09:05:23 2012 (r239482) +++ stable/9/sys/sparc64/include/pmap.h Tue Aug 21 09:10:14 2012 (r239483) @@ -68,6 +68,11 @@ struct pmap { struct pmap_statistics pm_stats; }; +struct tte_list_lock { + struct rwlock lock; + char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; +}; + #define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) #define PMAP_LOCK_ASSERT(pmap, type) \ mtx_assert(&(pmap)->pm_mtx, (type)) @@ -102,7 +107,8 @@ void pmap_set_kctx(void); extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) -extern struct rwlock tte_list_global_lock; +extern struct tte_list_lock tte_list_global; +#define tte_list_global_lock tte_list_global.lock extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; Modified: stable/9/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/9/sys/sparc64/sparc64/pmap.c Tue Aug 21 09:05:23 2012 (r239482) +++ stable/9/sys/sparc64/sparc64/pmap.c Tue Aug 21 09:10:14 2012 (r239483) @@ -135,9 +135,11 @@ vm_offset_t vm_max_kernel_address; struct pmap kernel_pmap_store; /* - * Global tte list lock + * Isolate the global TTE list lock from data and other locks to prevent + * false sharing within the cache (see also the declaration of struct + * tte_list_lock). */ -struct rwlock tte_list_global_lock; +struct tte_list_lock tte_list_global __aligned(CACHE_LINE_SIZE); /* * Allocate physical memory for use in pmap_bootstrap. @@ -672,7 +674,7 @@ pmap_bootstrap(u_int cpu_impl) pm->pm_context[i] = TLB_CTX_KERNEL; CPU_FILL(&pm->pm_active); - /* + /* * Initialize the global tte list lock. */ rw_init(&tte_list_global_lock, "tte list global"); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 09:14:36 2012 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 8F0841065673; Tue, 21 Aug 2012 09:14:36 +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 6119E8FC08; Tue, 21 Aug 2012 09:14:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L9EaK5002949; Tue, 21 Aug 2012 09:14:36 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9EaqN002947; Tue, 21 Aug 2012 09:14:36 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208210914.q7L9EaqN002947@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 21 Aug 2012 09:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239484 - svnadmin/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: Tue, 21 Aug 2012 09:14:36 -0000 Author: des Date: Tue Aug 21 09:14:34 2012 New Revision: 239484 URL: http://svn.freebsd.org/changeset/base/239484 Log: Release bapt from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Aug 21 09:10:14 2012 (r239483) +++ svnadmin/conf/mentors Tue Aug 21 09:14:34 2012 (r239484) @@ -12,7 +12,6 @@ # Mentee Mentor Optional comment anchie bz art avg Co-mentor: marcel -bapt des benl philip Co-mentor: simon bgray cognet davidcs gnn From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 09:17:14 2012 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 08124106564A; Tue, 21 Aug 2012 09:17:14 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E76AE8FC08; Tue, 21 Aug 2012 09:17:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L9HDOF003533; Tue, 21 Aug 2012 09:17:13 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9HDmM003531; Tue, 21 Aug 2012 09:17:13 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201208210917.q7L9HDmM003531@svn.freebsd.org> From: David Xu Date: Tue, 21 Aug 2012 09:17: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: r239485 - 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: Tue, 21 Aug 2012 09:17:14 -0000 Author: davidxu Date: Tue Aug 21 09:17:13 2012 New Revision: 239485 URL: http://svn.freebsd.org/changeset/base/239485 Log: Fix prototype. Also the function should return error code instead of -1 on error. Modified: head/lib/libc/gen/clock_getcpuclockid.c Modified: head/lib/libc/gen/clock_getcpuclockid.c ============================================================================== --- head/lib/libc/gen/clock_getcpuclockid.c Tue Aug 21 09:14:34 2012 (r239484) +++ head/lib/libc/gen/clock_getcpuclockid.c Tue Aug 21 09:17:13 2012 (r239485) @@ -32,8 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include -clockid_t +int clock_getcpuclockid(pid_t pid, clockid_t *clock_id) { - return clock_getcpuclockid2(pid, CPUCLOCK_WHICH_PID, clock_id); + if (clock_getcpuclockid2(pid, CPUCLOCK_WHICH_PID, clock_id)) + return (errno); + return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 09:18:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 986FD1065670; Tue, 21 Aug 2012 09:18:29 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 817DE8FC22; Tue, 21 Aug 2012 09:18:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L9ITsj003841; Tue, 21 Aug 2012 09:18:29 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9IT4K003836; Tue, 21 Aug 2012 09:18:29 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201208210918.q7L9IT4K003836@svn.freebsd.org> From: David Xu Date: Tue, 21 Aug 2012 09:18: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: r239486 - in head: lib/libc/gen share/man/man3 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, 21 Aug 2012 09:18:29 -0000 Author: davidxu Date: Tue Aug 21 09:18:28 2012 New Revision: 239486 URL: http://svn.freebsd.org/changeset/base/239486 Log: Add manual pages for clock_getcpuclockid and pthread_getcpuclockid. Added: head/lib/libc/gen/clock_getcpuclockid.3 (contents, props changed) head/share/man/man3/pthread_getcpuclockid.3 (contents, props changed) Modified: head/lib/libc/gen/Makefile.inc head/share/man/man3/Makefile Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Aug 21 09:17:13 2012 (r239485) +++ head/lib/libc/gen/Makefile.inc Tue Aug 21 09:18:28 2012 (r239486) @@ -52,7 +52,7 @@ SYM_MAPS+=${.CURDIR}/gen/Symbol.map .sinclude "${.CURDIR}/${LIBC_ARCH}/gen/Makefile.inc" MAN+= alarm.3 arc4random.3 \ - basename.3 check_utility_compat.3 clock.3 \ + basename.3 check_utility_compat.3 clock.3 clock_getcpuclockid.3 \ confstr.3 ctermid.3 daemon.3 devname.3 directory.3 dirname.3 \ dl_iterate_phdr.3 dladdr.3 dlinfo.3 dllockinit.3 dlopen.3 \ err.3 exec.3 \ Added: head/lib/libc/gen/clock_getcpuclockid.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/clock_getcpuclockid.3 Tue Aug 21 09:18:28 2012 (r239486) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2012 David Xu +.\" 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. +.\" +.\" Portions of this text are reprinted and reproduced in electronic form +.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- +.\" Portable Operating System Interface (POSIX), The Open Group Base +.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of +.\" Electrical and Electronics Engineers, Inc and The Open Group. In the +.\" event of any discrepancy between this version and the original IEEE and +.\" The Open Group Standard, the original IEEE and The Open Group Standard is +.\" the referee document. The original Standard can be obtained online at +.\" http://www.opengroup.org/unix/online.html. +.\" +.\" $FreeBSD$ +.\" +.Dd August 21, 2012 +.Dt CLOCK_GETCPUCLOCKID 3 +.Os +.Sh NAME +.Nm clock_getcpuclockid +.Nd access a process CPU-time clock +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft int +.Fn clock_getcpuclockid "pid_t pid" "clockid_t *clock_id" +.Sh DESCRIPTION +The +.Fn clock_getcpuclockid +returns the clock ID of the CPU-time clock of the process specified by +.Fa pid . +If the process described by +.Fa pid +exists and the calling process has permission, the clock ID of this +clock will be returned in +.Fa clock_id . +.Pp +If +.Fa pid +is zero, the +.Fn clock_getcpuclockid +function returns the clock ID of the CPU-time clock of the process +making the call, in +.Fa clock_id . +.Sh RETURN VALUES +Upon successful completion, +.Fn clock_getcpuclockid +returns zero; otherwise, an error number is returned to indicate the +error. +.Sh ERRORS +The clock_getcpuclockid() function will fail if: +.Bl -tag -width Er +.It Bq Er EPERM +The requesting process does not have permission to access the CPU-time +clock for the process. +.It Bq Er ESRCH +No process can be found corresponding to the process specified by +.Fa pid . +.El +.Sh SEE ALSO +.Xr clock_gettime 2 +.Sh STANDARDS +The +.Fn clock_getcpuclockid +function conform to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn clock_getcpuclockid +function first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An David Xu Aq davidxu@FreeBSD.org Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Tue Aug 21 09:17:13 2012 (r239485) +++ head/share/man/man3/Makefile Tue Aug 21 09:18:28 2012 (r239486) @@ -206,6 +206,7 @@ PTHREAD_MAN= pthread.3 \ pthread_equal.3 \ pthread_exit.3 \ pthread_getconcurrency.3 \ + pthread_getcpuclockid.3 \ pthread_getspecific.3 \ pthread_getthreadid_np.3 \ pthread_join.3 \ Added: head/share/man/man3/pthread_getcpuclockid.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/pthread_getcpuclockid.3 Tue Aug 21 09:18:28 2012 (r239486) @@ -0,0 +1,84 @@ +.\" Copyright (c) 2012 David Xu +.\" 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. +.\" +.\" Portions of this text are reprinted and reproduced in electronic form +.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- +.\" Portable Operating System Interface (POSIX), The Open Group Base +.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of +.\" Electrical and Electronics Engineers, Inc and The Open Group. In the +.\" event of any discrepancy between this version and the original IEEE and +.\" The Open Group Standard, the original IEEE and The Open Group Standard is +.\" the referee document. The original Standard can be obtained online at +.\" http://www.opengroup.org/unix/online.html. +.\" +.\" $FreeBSD$ +.\" +.Dd August 21, 2012 +.Dt PTHREAD_GETCPUCLOCKID 3 +.Os +.Sh NAME +.Nm pthread_getcpuclockid +.Nd access a thread CPU-time clock +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread.h +.In time.h +.Ft int +.Fn pthread_getcpuclockid "pthread_t thread_id" "clockid_t *clock_id" +.Sh DESCRIPTION +The +.Fn pthread_getcpuclockid +returns the clock ID of the CPU-time clock of the thread specified by +.Fa thread_id . +If the thread described by +.Fa thread_id +exists. +.Sh RETURN VALUES +Upon successful completion, +.Fn pthread_getcpuclockid +returns zero; otherwise, an error number is returned to indicate the +error. +.Sh ERRORS +The pthread_getcpuclockid() function will fail if: +.Bl -tag -width Er +.It Bq Er ESRCH +The value specified by +.Fa thread_id +does not refer to an existing thread. +.El +.Sh SEE ALSO +.Xr clock_gettime 2 +.Sh STANDARDS +The +.Fn pthread_getcpuclockid +function conforms to +.St -p1003.1-2004 . +.Sh HISTORY +The +.Fn pthread_getcpuclockid +function first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An David Xu Aq davidxu@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 09:37:24 2012 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 5E5EB1065670; Tue, 21 Aug 2012 09:37:24 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4B688FC0C; Tue, 21 Aug 2012 09:37:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L9bNaq007185; Tue, 21 Aug 2012 09:37:23 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9bNOB007182; Tue, 21 Aug 2012 09:37:23 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201208210937.q7L9bNOB007182@svn.freebsd.org> From: "Jayachandran C." Date: Tue, 21 Aug 2012 09:37: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: r239487 - in head/sys: boot/fdt/dts mips/nlm 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, 21 Aug 2012 09:37:24 -0000 Author: jchandra Date: Tue Aug 21 09:37:23 2012 New Revision: 239487 URL: http://svn.freebsd.org/changeset/base/239487 Log: Add correct range parameter in XLP DTS r239274 added support for ranges. Update XLP DTS to provide the correct range parameter for the XLP SoC bus. Also fix bus_space_map method for XLP bus space. Submitted by: Sreekanth M. Modified: head/sys/boot/fdt/dts/xlp-basic.dts head/sys/mips/nlm/bus_space_rmi.c Modified: head/sys/boot/fdt/dts/xlp-basic.dts ============================================================================== --- head/sys/boot/fdt/dts/xlp-basic.dts Tue Aug 21 09:18:28 2012 (r239486) +++ head/sys/boot/fdt/dts/xlp-basic.dts Tue Aug 21 09:37:23 2012 (r239487) @@ -44,7 +44,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "simple-bus"; - ranges = <0x0>; + ranges = <0x0 0x18000000 0x04000000>; bus-frequency = <0>; serial0: serial@30100 { Modified: head/sys/mips/nlm/bus_space_rmi.c ============================================================================== --- head/sys/mips/nlm/bus_space_rmi.c Tue Aug 21 09:18:28 2012 (r239486) +++ head/sys/mips/nlm/bus_space_rmi.c Tue Aug 21 09:37:23 2012 (r239487) @@ -366,7 +366,7 @@ rmi_bus_space_map(void *t __unused, bus_ bus_space_handle_t *bshp) { - *bshp = addr; + *bshp = MIPS_PHYS_TO_DIRECT_UNCACHED(addr); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 09:43:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F8CA1065678; Tue, 21 Aug 2012 09:43:04 +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 298E88FC08; Tue, 21 Aug 2012 09:43:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L9h4q3008143; Tue, 21 Aug 2012 09:43:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9h3UE008140; Tue, 21 Aug 2012 09:43:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208210943.q7L9h3UE008140@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Aug 2012 09:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239488 - releng/9.1/sys/dev/esp 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, 21 Aug 2012 09:43:04 -0000 Author: marius Date: Tue Aug 21 09:43:03 2012 New Revision: 239488 URL: http://svn.freebsd.org/changeset/base/239488 Log: MFC: r239089 - Merge from NetBSD: When issuing a non-DMA command, make sure to set the "remaining length of command to be transferred via DMA" (sc_cmdlen) to zero up-front, otherwise we might get confused on command competition interrupt (no DMA active but still data left to transfer). - Implement handling of MSG_IGN_WIDE_RESIDUE which some targets produce, as just rejecting these leads to a resend and disconnect loop. Reported and tested by: mjacob Approved by: re (kib) Modified: releng/9.1/sys/dev/esp/ncr53c9x.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/amd64/include/xen/ (props changed) releng/9.1/sys/boot/ (props changed) releng/9.1/sys/boot/i386/efi/ (props changed) releng/9.1/sys/boot/ia64/efi/ (props changed) releng/9.1/sys/boot/ia64/ski/ (props changed) releng/9.1/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.1/sys/boot/powerpc/ofw/ (props changed) releng/9.1/sys/cddl/contrib/opensolaris/ (props changed) releng/9.1/sys/conf/ (props changed) releng/9.1/sys/contrib/dev/acpica/ (props changed) releng/9.1/sys/contrib/octeon-sdk/ (props changed) releng/9.1/sys/contrib/pf/ (props changed) releng/9.1/sys/contrib/x86emu/ (props changed) releng/9.1/sys/dev/ (props changed) releng/9.1/sys/dev/e1000/ (props changed) releng/9.1/sys/dev/isp/ (props changed) releng/9.1/sys/dev/ixgbe/ (props changed) releng/9.1/sys/fs/ (props changed) releng/9.1/sys/fs/ntfs/ (props changed) releng/9.1/sys/modules/ (props changed) Modified: releng/9.1/sys/dev/esp/ncr53c9x.c ============================================================================== --- releng/9.1/sys/dev/esp/ncr53c9x.c Tue Aug 21 09:37:23 2012 (r239487) +++ releng/9.1/sys/dev/esp/ncr53c9x.c Tue Aug 21 09:43:03 2012 (r239488) @@ -26,7 +26,7 @@ * */ -/* $NetBSD: ncr53c9x.c,v 1.143 2011/07/31 18:39:00 jakllsch Exp $ */ +/* $NetBSD: ncr53c9x.c,v 1.145 2012/06/18 21:23:56 martin Exp $ */ /*- * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -256,7 +256,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s return (EINVAL); } - device_printf(sc->sc_dev, "%s, %dMHz, SCSI ID %d\n", + device_printf(sc->sc_dev, "%s, %d MHz, SCSI ID %d\n", ncr53c9x_variant_names[sc->sc_rev], sc->sc_freq, sc->sc_id); sc->sc_ntarg = (sc->sc_rev == NCR_VARIANT_FAS366) ? 16 : 8; @@ -890,11 +890,8 @@ ncr53c9x_select(struct ncr53c9x_softc *s sc->sc_cmdp = cmd; error = NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &dmasize); - if (error != 0) { - sc->sc_cmdlen = 0; - sc->sc_cmdp = NULL; + if (error != 0) goto cmd; - } /* Program the SCSI counter. */ NCR_SET_COUNT(sc, dmasize); @@ -920,6 +917,7 @@ cmd: */ /* Now get the command into the FIFO. */ + sc->sc_cmdlen = 0; ncr53c9x_wrfifo(sc, cmd, clen); /* And get the target's attention. */ @@ -1771,7 +1769,7 @@ ncr53c9x_msgin(struct ncr53c9x_softc *sc struct ncr53c9x_linfo *li; struct ncr53c9x_tinfo *ti; uint8_t *pb; - int lun, plen; + int len, lun; NCR_LOCK_ASSERT(sc, MA_OWNED); @@ -1818,15 +1816,15 @@ ncr53c9x_msgin(struct ncr53c9x_softc *sc */ case NCR_RESELECTED: pb = sc->sc_imess + 1; - plen = sc->sc_imlen - 1; + len = sc->sc_imlen - 1; break; default: pb = sc->sc_imess; - plen = sc->sc_imlen; + len = sc->sc_imlen; } - if (__verify_msg_format(pb, plen)) + if (__verify_msg_format(pb, len)) goto gotit; } @@ -1963,6 +1961,29 @@ gotit: sc->sc_dleft = ecb->dleft; break; + case MSG_IGN_WIDE_RESIDUE: + NCR_MSGS(("ignore wide residue (%d bytes)", + sc->sc_imess[1])); + if (sc->sc_imess[1] != 1) { + xpt_print_path(ecb->ccb->ccb_h.path); + printf("unexpected MESSAGE IGNORE WIDE " + "RESIDUE (%d bytes); sending REJECT\n", + sc->sc_imess[1]); + goto reject; + } + /* + * If there was a last transfer of an even number of + * bytes, wipe the "done" memory and adjust by one + * byte (sc->sc_imess[1]). + */ + len = sc->sc_dleft - ecb->dleft; + if (len != 0 && (len & 1) == 0) { + ecb->flags &= ~ECB_TENTATIVE_DONE; + sc->sc_dp = (char *)sc->sc_dp - 1; + sc->sc_dleft--; + } + break; + case MSG_EXTENDED: NCR_MSGS(("extended(%x) ", sc->sc_imess[2])); switch (sc->sc_imess[2]) { @@ -2272,6 +2293,7 @@ cmd: /* * XXX FIFO size */ + sc->sc_cmdlen = 0; ncr53c9x_flushfifo(sc); ncr53c9x_wrfifo(sc, sc->sc_omp, sc->sc_omlen); NCRCMD(sc, NCRCMD_TRANS); @@ -2811,9 +2833,10 @@ again: * (Timing problems?) */ if (sc->sc_features & NCR_F_DMASELECT) { - if (sc->sc_cmdlen == 0) + if (sc->sc_cmdlen == 0) { /* Hope for the best... */ break; + } } else if ((NCR_READ_REG(sc, NCR_FFLAG) & NCRFIFO_FF) == 0) { /* Hope for the best... */ @@ -2986,11 +3009,8 @@ msgin: sc->sc_cmdp = (void *)&ecb->cmd.cmd; error = NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &size); - if (error != 0) { - sc->sc_cmdlen = 0; - sc->sc_cmdp = NULL; + if (error != 0) goto cmd; - } /* Program the SCSI counter. */ NCR_SET_COUNT(sc, size); @@ -3005,6 +3025,7 @@ msgin: break; } cmd: + sc->sc_cmdlen = 0; ncr53c9x_wrfifo(sc, (uint8_t *)&ecb->cmd.cmd, ecb->clen); NCRCMD(sc, NCRCMD_TRANS); sc->sc_prevphase = COMMAND_PHASE; @@ -3046,7 +3067,7 @@ setup_xfer: goto finish; } - /* Target returned to data phase: wipe "done" memory */ + /* Target returned to data phase: wipe "done" memory. */ ecb->flags &= ~ECB_TENTATIVE_DONE; /* Program the SCSI counter. */ @@ -3105,8 +3126,8 @@ shortcut: * overhead to pay. For example, selecting, sending a message * and command and then doing some work can be done in one "pass". * - * The delay is a heuristic. It is 2 when at 20MHz, 2 at 25MHz and 1 - * at 40MHz. This needs testing. + * The delay is a heuristic. It is 2 when at 20 MHz, 2 at 25 MHz and + * 1 at 40 MHz. This needs testing. */ microtime(&wait); wait.tv_usec += 50 / sc->sc_freq; @@ -3191,8 +3212,7 @@ ncr53c9x_callout(void *arg) ncr53c9x_abort(sc, ecb); /* Disable sync mode if stuck in a data phase. */ - if (ecb == sc->sc_nexus && - ti->curr.offset != 0 && + if (ecb == sc->sc_nexus && ti->curr.offset != 0 && (sc->sc_phase & (MSGI | CDI)) == 0) { /* XXX ASYNC CALLBACK! */ ti->goal.offset = 0; From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 09:55:58 2012 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 55437106566C; Tue, 21 Aug 2012 09:55:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2B58FC15; Tue, 21 Aug 2012 09:55:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L9twQf010305; Tue, 21 Aug 2012 09:55:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9twIx010304; Tue, 21 Aug 2012 09:55:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208210955.q7L9twIx010304@svn.freebsd.org> From: Xin LI Date: Tue, 21 Aug 2012 09:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239489 - releng/9.1/share/man/man5 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, 21 Aug 2012 09:55:58 -0000 Author: delphij Date: Tue Aug 21 09:55:57 2012 New Revision: 239489 URL: http://svn.freebsd.org/changeset/base/239489 Log: MFC r238631: Import an updated version of moduli(5) manual page from OpenBSD. Approved by: re (kib) Modified: releng/9.1/share/man/man5/moduli.5 Directory Properties: releng/9.1/share/man/man5/ (props changed) Modified: releng/9.1/share/man/man5/moduli.5 ============================================================================== --- releng/9.1/share/man/man5/moduli.5 Tue Aug 21 09:43:03 2012 (r239488) +++ releng/9.1/share/man/man5/moduli.5 Tue Aug 21 09:55:57 2012 (r239489) @@ -1,159 +1,125 @@ -.\" $OpenBSD: moduli.5,v 1.3 2001/06/24 18:50:52 provos Exp $ +.\" $OpenBSD: moduli.5,v 1.16 2011/11/28 08:46:27 eric Exp $ .\" -.\" Copyright 1997, 2000 William Allen Simpson -.\" All rights reserved. +.\" Copyright (c) 2008 Damien Miller .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software designed by William Allen Simpson. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" $FreeBSD$ .\" -.Dd July 28, 1997 +.Dd July 19, 2012 .Dt MODULI 5 .Os .Sh NAME .Nm moduli -.Nd system moduli file +.Nd Diffie-Hellman moduli .Sh DESCRIPTION The -.Nm -file contains the system-wide Diffie-Hellman prime moduli for the -.Xr photurisd 8 -and +.Pa /etc/ssh/moduli +file contains prime numbers and generators for use by .Xr sshd 8 -programs. +in the Diffie-Hellman Group Exchange key exchange method. .Pp -Each line in this file contains the following fields: -.Va Time , Type , Tests , Tries , Size , Generator , -and -.Va Modulus . -The fields are separated by white space (tab or blank). -.Bl -tag -width indent -.It Va Time Pq Vt yyyymmddhhmmss -Specifies the system time that the line was appended to the file. -The value 00000000000000 means unknown (historic). -.\"The file is sorted in ascending order. -.It Va Type Pq Vt decimal -Specifies the internal structure of the prime modulus. +New moduli may be generated with +.Xr ssh-keygen 1 +using a two-step process. +An initial +.Em candidate generation +pass, using +.Ic ssh-keygen -G , +calculates numbers that are likely to be useful. +A second +.Em primality testing +pass, using +.Ic ssh-keygen -T , +provides a high degree of assurance that the numbers are prime and are +safe for use in Diffie-Hellman operations by +.Xr sshd 8 . +This +.Nm +format is used as the output from each pass. .Pp -.Bl -tag -width indent -compact -.It 0 -unknown; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -unstructured; -a common large number. -.It 2 -safe (p = 2q + 1); -meets basic structural requirements. -.It 3 -Schnorr. -.It 4 -Sophie-Germaine (q = (p-1)/2); -usually generated in the process of testing safe or strong primes. -.It 5 -strong; -useful for RSA public key generation. -.El -.It Xo -.Va Tests Pq Vt decimal -(bit field) -.Xc -Specifies the methods used in checking for primality. -Usually, more than one test is used. +The file consists of newline-separated records, one per modulus, +containing seven space-separated fields. +These fields are as follows: +.Bl -tag -width Description -offset indent +.It timestamp +The time that the modulus was last processed as YYYYMMDDHHMMSS. +.It type +Decimal number specifying the internal structure of the prime modulus. +Supported types are: .Pp -.Bl -tag -width indent -compact +.Bl -tag -width 0x00 -compact .It 0 -not tested; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -composite; -failed one or more tests. -In this case, the highest bit specifies the test that failed. +Unknown, not tested. .It 2 -sieve; -checked for division by a range of smaller primes. +"Safe" prime; (p-1)/2 is also prime. .It 4 -Miller-Rabin. -.It 8 -Jacobi. -.It 16 -Elliptic Curve. +Sophie Germain; 2p+1 is also prime. .El -.It Va Tries Pq Vt decimal -Depends on the value of the highest valid Test bit, -where the method specified is: .Pp -.Bl -tag -width indent -compact -.It 0 -not tested -(always zero). -.It 1 -composite -(irrelevant). -.It 2 -sieve; -number of primes sieved. -Commonly on the order of 32,000,000. -.It 4 -Miller-Rabin; -number of M-R iterations. -Commonly on the order of 32 to 64. -.It 8 -Jacobi; -unknown -(always zero). -.It 16 -Elliptic Curve; -unused -(always zero). -.El -.It Va Size Pq Vt decimal -Specifies the number of significant bits. -.It Va Generator Pq Vt "hex string" -Specifies the best generator for a Diffie-Hellman exchange. -0 = unknown or variable, -2, 3, 5, etc. -.It Va Modulus Pq Vt "hex string" -The prime modulus. +Moduli candidates initially produced by +.Xr ssh-keygen 1 +are Sophie Germain primes (type 4). +Further primality testing with +.Xr ssh-keygen 1 +produces safe prime moduli (type 2) that are ready for use in +.Xr sshd 8 . +Other types are not used by OpenSSH. +.It tests +Decimal number indicating the type of primality tests that the number +has been subjected to represented as a bitmask of the following values: +.Pp +.Bl -tag -width 0x00 -compact +.It 0x00 +Not tested. +.It 0x01 +Composite number \(en not prime. +.It 0x02 +Sieve of Eratosthenes. +.It 0x04 +Probabilistic Miller-Rabin primality tests. .El .Pp -The file is searched for moduli that meet the appropriate -.Va Time , Size -and -.Va Generator -criteria. -When more than one meet the criteria, -the selection should be weighted toward newer moduli, -without completely disqualifying older moduli. -.Sh FILES -.Bl -tag -width ".Pa /etc/ssh/moduli" -compact -.It Pa /etc/ssh/moduli +The +.Xr ssh-keygen 1 +moduli candidate generation uses the Sieve of Eratosthenes (flag 0x02). +Subsequent +.Xr ssh-keygen 1 +primality tests are Miller-Rabin tests (flag 0x04). +.It trials +Decimal number indicating the number of primality trials +that have been performed on the modulus. +.It size +Decimal number indicating the size of the prime in bits. +.It generator +The recommended generator for use with this modulus (hexadecimal). +.It modulus +The modulus itself in hexadecimal. .El +.Pp +When performing Diffie-Hellman Group Exchange, +.Xr sshd 8 +first estimates the size of the modulus required to produce enough +Diffie-Hellman output to sufficiently key the selected symmetric cipher. +.Xr sshd 8 +then randomly selects a modulus from +.Fa /etc/ssh/moduli +that best meets the size requirement. .Sh SEE ALSO -.Xr photurisd 8 , +.Xr ssh-keygen 1 , .Xr sshd 8 +.Rs +.%R RFC 4419 +.%T "Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol" +.%D 2006 +.Re From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 10:30:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C04C0106566C; Tue, 21 Aug 2012 10:30:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9CDF8FC0C; Tue, 21 Aug 2012 10:30:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LAUvTp017584; Tue, 21 Aug 2012 10:30:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LAUv53017582; Tue, 21 Aug 2012 10:30:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208211030.q7LAUv53017582@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Aug 2012 10:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239490 - stable/8/sys/dev/esp X-BeenThere: svn-src-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, 21 Aug 2012 10:30:57 -0000 Author: marius Date: Tue Aug 21 10:30:57 2012 New Revision: 239490 URL: http://svn.freebsd.org/changeset/base/239490 Log: MFC: r239089 - Merge from NetBSD: When issuing a non-DMA command, make sure to set the "remaining length of command to be transferred via DMA" (sc_cmdlen) to zero up-front, otherwise we might get confused on command competition interrupt (no DMA active but still data left to transfer). - Implement handling of MSG_IGN_WIDE_RESIDUE which some targets produce, as just rejecting these leads to a resend and disconnect loop. Reported and tested by: mjacob Modified: stable/8/sys/dev/esp/ncr53c9x.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/dev/esp/ncr53c9x.c ============================================================================== --- stable/8/sys/dev/esp/ncr53c9x.c Tue Aug 21 09:55:57 2012 (r239489) +++ stable/8/sys/dev/esp/ncr53c9x.c Tue Aug 21 10:30:57 2012 (r239490) @@ -26,7 +26,7 @@ * */ -/* $NetBSD: ncr53c9x.c,v 1.143 2011/07/31 18:39:00 jakllsch Exp $ */ +/* $NetBSD: ncr53c9x.c,v 1.145 2012/06/18 21:23:56 martin Exp $ */ /*- * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -256,7 +256,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s return (EINVAL); } - device_printf(sc->sc_dev, "%s, %dMHz, SCSI ID %d\n", + device_printf(sc->sc_dev, "%s, %d MHz, SCSI ID %d\n", ncr53c9x_variant_names[sc->sc_rev], sc->sc_freq, sc->sc_id); sc->sc_ntarg = (sc->sc_rev == NCR_VARIANT_FAS366) ? 16 : 8; @@ -890,11 +890,8 @@ ncr53c9x_select(struct ncr53c9x_softc *s sc->sc_cmdp = cmd; error = NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &dmasize); - if (error != 0) { - sc->sc_cmdlen = 0; - sc->sc_cmdp = NULL; + if (error != 0) goto cmd; - } /* Program the SCSI counter. */ NCR_SET_COUNT(sc, dmasize); @@ -920,6 +917,7 @@ cmd: */ /* Now get the command into the FIFO. */ + sc->sc_cmdlen = 0; ncr53c9x_wrfifo(sc, cmd, clen); /* And get the target's attention. */ @@ -1771,7 +1769,7 @@ ncr53c9x_msgin(struct ncr53c9x_softc *sc struct ncr53c9x_linfo *li; struct ncr53c9x_tinfo *ti; uint8_t *pb; - int lun, plen; + int len, lun; NCR_LOCK_ASSERT(sc, MA_OWNED); @@ -1818,15 +1816,15 @@ ncr53c9x_msgin(struct ncr53c9x_softc *sc */ case NCR_RESELECTED: pb = sc->sc_imess + 1; - plen = sc->sc_imlen - 1; + len = sc->sc_imlen - 1; break; default: pb = sc->sc_imess; - plen = sc->sc_imlen; + len = sc->sc_imlen; } - if (__verify_msg_format(pb, plen)) + if (__verify_msg_format(pb, len)) goto gotit; } @@ -1963,6 +1961,29 @@ gotit: sc->sc_dleft = ecb->dleft; break; + case MSG_IGN_WIDE_RESIDUE: + NCR_MSGS(("ignore wide residue (%d bytes)", + sc->sc_imess[1])); + if (sc->sc_imess[1] != 1) { + xpt_print_path(ecb->ccb->ccb_h.path); + printf("unexpected MESSAGE IGNORE WIDE " + "RESIDUE (%d bytes); sending REJECT\n", + sc->sc_imess[1]); + goto reject; + } + /* + * If there was a last transfer of an even number of + * bytes, wipe the "done" memory and adjust by one + * byte (sc->sc_imess[1]). + */ + len = sc->sc_dleft - ecb->dleft; + if (len != 0 && (len & 1) == 0) { + ecb->flags &= ~ECB_TENTATIVE_DONE; + sc->sc_dp = (char *)sc->sc_dp - 1; + sc->sc_dleft--; + } + break; + case MSG_EXTENDED: NCR_MSGS(("extended(%x) ", sc->sc_imess[2])); switch (sc->sc_imess[2]) { @@ -2272,6 +2293,7 @@ cmd: /* * XXX FIFO size */ + sc->sc_cmdlen = 0; ncr53c9x_flushfifo(sc); ncr53c9x_wrfifo(sc, sc->sc_omp, sc->sc_omlen); NCRCMD(sc, NCRCMD_TRANS); @@ -2811,9 +2833,10 @@ again: * (Timing problems?) */ if (sc->sc_features & NCR_F_DMASELECT) { - if (sc->sc_cmdlen == 0) + if (sc->sc_cmdlen == 0) { /* Hope for the best... */ break; + } } else if ((NCR_READ_REG(sc, NCR_FFLAG) & NCRFIFO_FF) == 0) { /* Hope for the best... */ @@ -2986,11 +3009,8 @@ msgin: sc->sc_cmdp = (void *)&ecb->cmd.cmd; error = NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &size); - if (error != 0) { - sc->sc_cmdlen = 0; - sc->sc_cmdp = NULL; + if (error != 0) goto cmd; - } /* Program the SCSI counter. */ NCR_SET_COUNT(sc, size); @@ -3005,6 +3025,7 @@ msgin: break; } cmd: + sc->sc_cmdlen = 0; ncr53c9x_wrfifo(sc, (uint8_t *)&ecb->cmd.cmd, ecb->clen); NCRCMD(sc, NCRCMD_TRANS); sc->sc_prevphase = COMMAND_PHASE; @@ -3046,7 +3067,7 @@ setup_xfer: goto finish; } - /* Target returned to data phase: wipe "done" memory */ + /* Target returned to data phase: wipe "done" memory. */ ecb->flags &= ~ECB_TENTATIVE_DONE; /* Program the SCSI counter. */ @@ -3105,8 +3126,8 @@ shortcut: * overhead to pay. For example, selecting, sending a message * and command and then doing some work can be done in one "pass". * - * The delay is a heuristic. It is 2 when at 20MHz, 2 at 25MHz and 1 - * at 40MHz. This needs testing. + * The delay is a heuristic. It is 2 when at 20 MHz, 2 at 25 MHz and + * 1 at 40 MHz. This needs testing. */ microtime(&wait); wait.tv_usec += 50 / sc->sc_freq; @@ -3191,8 +3212,7 @@ ncr53c9x_callout(void *arg) ncr53c9x_abort(sc, ecb); /* Disable sync mode if stuck in a data phase. */ - if (ecb == sc->sc_nexus && - ti->curr.offset != 0 && + if (ecb == sc->sc_nexus && ti->curr.offset != 0 && (sc->sc_phase & (MSGI | CDI)) == 0) { /* XXX ASYNC CALLBACK! */ ti->goal.offset = 0; From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 11:17:12 2012 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 63BEF106566B; Tue, 21 Aug 2012 11:17:12 +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 456768FC15; Tue, 21 Aug 2012 11:17:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LBHCsh024475; Tue, 21 Aug 2012 11:17:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LBHCo6024472; Tue, 21 Aug 2012 11:17:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208211117.q7LBHCo6024472@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Aug 2012 11:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239491 - in releng/9.1/sys/sparc64: include 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: Tue, 21 Aug 2012 11:17:12 -0000 Author: marius Date: Tue Aug 21 11:17:11 2012 New Revision: 239491 URL: http://svn.freebsd.org/changeset/base/239491 Log: MFC: r239079 Merge r236494 from x86: Isolate the global TTE list lock from data and other locks to prevent false sharing within the cache. Approved by: re (kib) Modified: releng/9.1/sys/sparc64/include/pmap.h releng/9.1/sys/sparc64/sparc64/pmap.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/amd64/include/xen/ (props changed) releng/9.1/sys/boot/ (props changed) releng/9.1/sys/boot/i386/efi/ (props changed) releng/9.1/sys/boot/ia64/efi/ (props changed) releng/9.1/sys/boot/ia64/ski/ (props changed) releng/9.1/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.1/sys/boot/powerpc/ofw/ (props changed) releng/9.1/sys/cddl/contrib/opensolaris/ (props changed) releng/9.1/sys/conf/ (props changed) releng/9.1/sys/contrib/dev/acpica/ (props changed) releng/9.1/sys/contrib/octeon-sdk/ (props changed) releng/9.1/sys/contrib/pf/ (props changed) releng/9.1/sys/contrib/x86emu/ (props changed) releng/9.1/sys/dev/ (props changed) releng/9.1/sys/dev/e1000/ (props changed) releng/9.1/sys/dev/isp/ (props changed) releng/9.1/sys/dev/ixgbe/ (props changed) releng/9.1/sys/fs/ (props changed) releng/9.1/sys/fs/ntfs/ (props changed) releng/9.1/sys/modules/ (props changed) Modified: releng/9.1/sys/sparc64/include/pmap.h ============================================================================== --- releng/9.1/sys/sparc64/include/pmap.h Tue Aug 21 10:30:57 2012 (r239490) +++ releng/9.1/sys/sparc64/include/pmap.h Tue Aug 21 11:17:11 2012 (r239491) @@ -68,6 +68,11 @@ struct pmap { struct pmap_statistics pm_stats; }; +struct tte_list_lock { + struct rwlock lock; + char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; +}; + #define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) #define PMAP_LOCK_ASSERT(pmap, type) \ mtx_assert(&(pmap)->pm_mtx, (type)) @@ -102,7 +107,8 @@ void pmap_set_kctx(void); extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) -extern struct rwlock tte_list_global_lock; +extern struct tte_list_lock tte_list_global; +#define tte_list_global_lock tte_list_global.lock extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; Modified: releng/9.1/sys/sparc64/sparc64/pmap.c ============================================================================== --- releng/9.1/sys/sparc64/sparc64/pmap.c Tue Aug 21 10:30:57 2012 (r239490) +++ releng/9.1/sys/sparc64/sparc64/pmap.c Tue Aug 21 11:17:11 2012 (r239491) @@ -135,9 +135,11 @@ vm_offset_t vm_max_kernel_address; struct pmap kernel_pmap_store; /* - * Global tte list lock + * Isolate the global TTE list lock from data and other locks to prevent + * false sharing within the cache (see also the declaration of struct + * tte_list_lock). */ -struct rwlock tte_list_global_lock; +struct tte_list_lock tte_list_global __aligned(CACHE_LINE_SIZE); /* * Allocate physical memory for use in pmap_bootstrap. @@ -672,7 +674,7 @@ pmap_bootstrap(u_int cpu_impl) pm->pm_context[i] = TLB_CTX_KERNEL; CPU_FILL(&pm->pm_active); - /* + /* * Initialize the global tte list lock. */ rw_init(&tte_list_global_lock, "tte list global"); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 11:34:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A18C106566B; Tue, 21 Aug 2012 11:34:41 +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 E9F4A8FC0C; Tue, 21 Aug 2012 11:34:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LBYe9M026887; Tue, 21 Aug 2012 11:34:40 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LBYerl026885; Tue, 21 Aug 2012 11:34:40 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208211134.q7LBYerl026885@svn.freebsd.org> From: Ed Maste Date: Tue, 21 Aug 2012 11:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239492 - releng/9.1/sys/dev/usb/quirk 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, 21 Aug 2012 11:34:41 -0000 Author: emaste Date: Tue Aug 21 11:34:40 2012 New Revision: 239492 URL: http://svn.freebsd.org/changeset/base/239492 Log: MFC r238718: Quirk MS keyboard so that function keys work The function keys on a Microsoft Natural Egronomic Keyboard 4000 have been repurposed as "Help", "Undo", "Redo" etc., and a special "F Lock" key is required to return them to their normal purpose. This change enables the UQ_KBD_BOOTPROTO quirk for the MS Natural 4000 keyboard to get the keys working again. More extensive changes to the USB keyboard infrastructure would be needed to fully support the "F Lock" mode and the extended keys on this keyboard. PR: usb/116947 Approved by: re Modified: releng/9.1/sys/dev/usb/quirk/usb_quirk.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- releng/9.1/sys/dev/usb/quirk/usb_quirk.c Tue Aug 21 11:17:11 2012 (r239491) +++ releng/9.1/sys/dev/usb/quirk/usb_quirk.c Tue Aug 21 11:34:40 2012 (r239492) @@ -123,6 +123,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(METAGEEK2, WISPYDBX, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), USB_QUIRK(TENX, UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR), /* MS keyboards do weird things */ + USB_QUIRK(MICROSOFT, NATURAL4000, 0x0000, 0xFFFF, UQ_KBD_BOOTPROTO), USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 11:35:55 2012 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 08B651065672; Tue, 21 Aug 2012 11:35:55 +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 E7C688FC0A; Tue, 21 Aug 2012 11:35:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LBZsSF027072; Tue, 21 Aug 2012 11:35:54 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LBZswi027070; Tue, 21 Aug 2012 11:35:54 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208211135.q7LBZswi027070@svn.freebsd.org> From: Ed Maste Date: Tue, 21 Aug 2012 11:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239493 - releng/9.1/contrib/ntp/ntpd 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, 21 Aug 2012 11:35:55 -0000 Author: emaste Date: Tue Aug 21 11:35:54 2012 New Revision: 239493 URL: http://svn.freebsd.org/changeset/base/239493 Log: MFC r232844: Remove extraneous log message When ntp switched between PLL and FLL mode it produced a log message "kernel time sync status change %04x". This issue is reported in ntp bug 452[1] which claims that this behaviour is normal and the log message isn't necessary. I'm not sure exactly when it was removed, but it's gone in the latest ntp release (4.2.6p5). [1] http://bugs.ntp.org/show_bug.cgi?id=452 Approved by: re Modified: releng/9.1/contrib/ntp/ntpd/ntp_loopfilter.c Directory Properties: releng/9.1/contrib/ntp/ (props changed) Modified: releng/9.1/contrib/ntp/ntpd/ntp_loopfilter.c ============================================================================== --- releng/9.1/contrib/ntp/ntpd/ntp_loopfilter.c Tue Aug 21 11:34:40 2012 (r239492) +++ releng/9.1/contrib/ntp/ntpd/ntp_loopfilter.c Tue Aug 21 11:35:54 2012 (r239493) @@ -646,12 +646,6 @@ local_clock( msyslog(LOG_NOTICE, "kernel time sync error %04x", ntv.status); ntv.status &= ~(STA_PPSFREQ | STA_PPSTIME); - } else { - if ((ntv.status ^ pll_status) & ~STA_FLL) - NLOG(NLOG_SYNCEVENT | NLOG_SYSEVENT) - msyslog(LOG_NOTICE, - "kernel time sync status change %04x", - ntv.status); } pll_status = ntv.status; #ifdef STA_NANO From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 11:40:32 2012 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 6502B10656AE; Tue, 21 Aug 2012 11:40:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45C328FC12; Tue, 21 Aug 2012 11:40:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LBeW9O027705; Tue, 21 Aug 2012 11:40:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LBeWIP027703; Tue, 21 Aug 2012 11:40:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208211140.q7LBeWIP027703@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Aug 2012 11:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239494 - stable/9/sys/dev/ata 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, 21 Aug 2012 11:40:32 -0000 Author: mav Date: Tue Aug 21 11:40:31 2012 New Revision: 239494 URL: http://svn.freebsd.org/changeset/base/239494 Log: MFC r238673: Use 16bit PIO instead of 32bit in case of misaligned buffer. It fixes kernel panic during CD write with cdrecord on sparc64. Modified: stable/9/sys/dev/ata/ata-lowlevel.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/9/sys/dev/ata/ata-lowlevel.c Tue Aug 21 11:35:54 2012 (r239493) +++ stable/9/sys/dev/ata/ata-lowlevel.c Tue Aug 21 11:40:31 2012 (r239494) @@ -836,23 +836,21 @@ static void ata_pio_read(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_INSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1); - ((uint8_t *)request->data + request->donecount + - (size & ~1))[0] = buf[0]; + (addr + (size & ~1))[0] = buf[0]; } } else - ATA_IDX_INSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_INSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s read data overrun %d>%d\n", @@ -867,23 +865,21 @@ static void ata_pio_write(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_OUTSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { - buf[0] = ((uint8_t *)request->data + request->donecount + - (size & ~1))[0]; + buf[0] = (addr + (size & ~1))[0]; ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1); } } else - ATA_IDX_OUTSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s write data underrun %d>%d\n", From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 11:43:01 2012 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 D4AA0106567A; Tue, 21 Aug 2012 11:43:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B516B8FC16; Tue, 21 Aug 2012 11:43:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LBh1V3028075; Tue, 21 Aug 2012 11:43:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LBh1Tl028073; Tue, 21 Aug 2012 11:43:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208211143.q7LBh1Tl028073@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Aug 2012 11:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239495 - stable/8/sys/dev/ata X-BeenThere: svn-src-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, 21 Aug 2012 11:43:02 -0000 Author: mav Date: Tue Aug 21 11:43:01 2012 New Revision: 239495 URL: http://svn.freebsd.org/changeset/base/239495 Log: MFC r238673: Use 16bit PIO instead of 32bit in case of misaligned buffer. It fixes kernel panic during CD write with cdrecord on sparc64. Modified: stable/8/sys/dev/ata/ata-lowlevel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/8/sys/dev/ata/ata-lowlevel.c Tue Aug 21 11:40:31 2012 (r239494) +++ stable/8/sys/dev/ata/ata-lowlevel.c Tue Aug 21 11:43:01 2012 (r239495) @@ -836,23 +836,21 @@ static void ata_pio_read(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_INSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1); - ((uint8_t *)request->data + request->donecount + - (size & ~1))[0] = buf[0]; + (addr + (size & ~1))[0] = buf[0]; } } else - ATA_IDX_INSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_INSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s read data overrun %d>%d\n", @@ -867,23 +865,21 @@ static void ata_pio_write(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_OUTSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { - buf[0] = ((uint8_t *)request->data + request->donecount + - (size & ~1))[0]; + buf[0] = (addr + (size & ~1))[0]; ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1); } } else - ATA_IDX_OUTSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s write data underrun %d>%d\n", From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 12:37:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB82F1065670; Tue, 21 Aug 2012 12:37:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC0B08FC12; Tue, 21 Aug 2012 12:37:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LCbbD0035162; Tue, 21 Aug 2012 12:37:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LCbb8u035160; Tue, 21 Aug 2012 12:37:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208211237.q7LCbb8u035160@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Aug 2012 12:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239496 - releng/9.1/sys/dev/ata 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, 21 Aug 2012 12:37:37 -0000 Author: mav Date: Tue Aug 21 12:37:37 2012 New Revision: 239496 URL: http://svn.freebsd.org/changeset/base/239496 Log: MFC r238673: Use 16bit PIO instead of 32bit in case of misaligned buffer. It fixes kernel panic during CD write with cdrecord on sparc64. Approved by: re (kib) Modified: releng/9.1/sys/dev/ata/ata-lowlevel.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/ata/ata-lowlevel.c ============================================================================== --- releng/9.1/sys/dev/ata/ata-lowlevel.c Tue Aug 21 11:43:01 2012 (r239495) +++ releng/9.1/sys/dev/ata/ata-lowlevel.c Tue Aug 21 12:37:37 2012 (r239496) @@ -836,23 +836,21 @@ static void ata_pio_read(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_INSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1); - ((uint8_t *)request->data + request->donecount + - (size & ~1))[0] = buf[0]; + (addr + (size & ~1))[0] = buf[0]; } } else - ATA_IDX_INSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_INSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s read data overrun %d>%d\n", @@ -867,23 +865,21 @@ static void ata_pio_write(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_OUTSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { - buf[0] = ((uint8_t *)request->data + request->donecount + - (size & ~1))[0]; + buf[0] = (addr + (size & ~1))[0]; ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1); } } else - ATA_IDX_OUTSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s write data underrun %d>%d\n", From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 12:39:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4431C1065672; Tue, 21 Aug 2012 12:39:39 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EC998FC0A; Tue, 21 Aug 2012 12:39:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LCddeD035531; Tue, 21 Aug 2012 12:39:39 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LCdcJE035529; Tue, 21 Aug 2012 12:39:38 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208211239.q7LCdcJE035529@svn.freebsd.org> From: Andrey Zonov Date: Tue, 21 Aug 2012 12:39: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: r239497 - 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: Tue, 21 Aug 2012 12:39:39 -0000 Author: zont Date: Tue Aug 21 12:39:38 2012 New Revision: 239497 URL: http://svn.freebsd.org/changeset/base/239497 Log: - Add myself as a new src committer. Approved by: kib (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Aug 21 12:37:37 2012 (r239496) +++ head/share/misc/committers-src.dot Tue Aug 21 12:39:38 2012 (r239497) @@ -272,6 +272,7 @@ yongari [label="Pyun YongHyeon\nyongari@ zack [label="Zack Kirsch\nzack@FreeBSD.org\n2010/11/05"] zec [label="Marko Zec\nzec@FreeBSD.org\n2008/06/22"] zml [label="Zachary Loafman\nzml@FreeBSD.org\n2009/05/27"] +zont [label="Andrey Zonov\nzont@FreeBSD.org\n2012/08/21"] # Pseudo target representing rev 1.1 of commit.allow day1 [label="Birth of FreeBSD"] @@ -480,6 +481,7 @@ kib -> rmh kib -> stas kib -> tijl kib -> trociny +kib -> zont kmacy -> lstewart From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 12:47:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C711106564A; Tue, 21 Aug 2012 12:47:35 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 575E88FC0C; Tue, 21 Aug 2012 12:47:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LClZCj036547; Tue, 21 Aug 2012 12:47:35 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LClZhS036545; Tue, 21 Aug 2012 12:47:35 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208211247.q7LClZhS036545@svn.freebsd.org> From: Andrey Zonov Date: Tue, 21 Aug 2012 12:47: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: r239498 - 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: Tue, 21 Aug 2012 12:47:35 -0000 Author: zont Date: Tue Aug 21 12:47:34 2012 New Revision: 239498 URL: http://svn.freebsd.org/changeset/base/239498 Log: - Add myself to the calendar. Approved by: kib (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 21 12:39:38 2012 (r239497) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 21 12:47:34 2012 (r239498) @@ -230,6 +230,7 @@ 07/22 Jens Schweikhardt born in Waiblingen, Baden-Wuerttemberg, Germany, 1967 07/22 Lukas Ertl born in Weissenbach/Enns, Steiermark, Austria, 1976 07/23 Sergey A. Osokin born in Krasnogorsky, Stepnogorsk, Akmolinskaya region, Kazakhstan, 1972 +07/23 Andrey Zonov born in Kirov, Russian Federation, 1985 07/24 Alexander Nedotsukov born in Ulyanovsk, Russian Federation, 1974 07/24 Alberto Villa born in Vercelli, Italy, 1987 07/27 Andriy Gapon born in Kyrykivka, Sumy region, Ukraine, 1976 From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 13:33:49 2012 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 EEC94106566B; Tue, 21 Aug 2012 13:33:48 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C13DB8FC08; Tue, 21 Aug 2012 13:33:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LDXmsC043054; Tue, 21 Aug 2012 13:33:48 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LDXmCb043052; Tue, 21 Aug 2012 13:33:48 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208211333.q7LDXmCb043052@svn.freebsd.org> From: Joel Dahl Date: Tue, 21 Aug 2012 13:33: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: r239499 - 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: Tue, 21 Aug 2012 13:33:49 -0000 Author: joel (doc committer) Date: Tue Aug 21 13:33:48 2012 New Revision: 239499 URL: http://svn.freebsd.org/changeset/base/239499 Log: Remove trailing whitespace. Modified: head/lib/libc/gen/clock_getcpuclockid.3 Modified: head/lib/libc/gen/clock_getcpuclockid.3 ============================================================================== --- head/lib/libc/gen/clock_getcpuclockid.3 Tue Aug 21 12:47:34 2012 (r239498) +++ head/lib/libc/gen/clock_getcpuclockid.3 Tue Aug 21 13:33:48 2012 (r239499) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2012 +.Dd August 21, 2012 .Dt CLOCK_GETCPUCLOCKID 3 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 13:46:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 404B81065781; Tue, 21 Aug 2012 13:46:47 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B01F8FC12; Tue, 21 Aug 2012 13:46:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LDkld2044715; Tue, 21 Aug 2012 13:46:47 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LDkkBV044713; Tue, 21 Aug 2012 13:46:46 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201208211346.q7LDkkBV044713@svn.freebsd.org> From: Devin Teske Date: Tue, 21 Aug 2012 13:46: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: r239500 - head/usr.sbin/bsdinstall 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, 21 Aug 2012 13:46:47 -0000 Author: dteske Date: Tue Aug 21 13:46:46 2012 New Revision: 239500 URL: http://svn.freebsd.org/changeset/base/239500 Log: Fix "unexpected operator" error when passed multi-word first-argument containing whitespace. Also make other changes to support multi-word arguments. PR: bin/170759 Submitted by: dteske Reviewed by: emaste (mentor) Approved by: emaste (mentor) MFC after: 3 days Modified: head/usr.sbin/bsdinstall/bsdinstall Modified: head/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall Tue Aug 21 13:33:48 2012 (r239499) +++ head/usr.sbin/bsdinstall/bsdinstall Tue Aug 21 13:46:46 2012 (r239500) @@ -34,11 +34,10 @@ VERB=$1; shift -if [ -z $VERB ]; then +if [ -z "$VERB" ]; then VERB=auto fi test -d "$BSDINSTALL_TMPETC" || mkdir "$BSDINSTALL_TMPETC" -echo Running installation step: $VERB $@ >> "$BSDINSTALL_LOG" -exec /usr/libexec/bsdinstall/$VERB $@ 2>>"$BSDINSTALL_LOG" - +echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG" +exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>>"$BSDINSTALL_LOG" From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 14:58:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA8C5106564A; Tue, 21 Aug 2012 14:58:52 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5CE8FC08; Tue, 21 Aug 2012 14:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LEwqHH054154; Tue, 21 Aug 2012 14:58:52 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LEwqOU054149; Tue, 21 Aug 2012 14:58:52 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208211458.q7LEwqOU054149@svn.freebsd.org> From: Andrey Zonov Date: Tue, 21 Aug 2012 14:58: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: r239501 - head/usr.bin/truss 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, 21 Aug 2012 14:58:52 -0000 Author: zont Date: Tue Aug 21 14:58:51 2012 New Revision: 239501 URL: http://svn.freebsd.org/changeset/base/239501 Log: - Use pid_t type instead of just int. Approved by: kib (mentor) Modified: head/usr.bin/truss/extern.h head/usr.bin/truss/setup.c head/usr.bin/truss/syscalls.c head/usr.bin/truss/truss.h Modified: head/usr.bin/truss/extern.h ============================================================================== --- head/usr.bin/truss/extern.h Tue Aug 21 13:46:46 2012 (r239500) +++ head/usr.bin/truss/extern.h Tue Aug 21 14:58:51 2012 (r239501) @@ -32,7 +32,7 @@ */ extern int setup_and_wait(char **); -extern int start_tracing(int); +extern int start_tracing(pid_t); extern void restore_proc(int); extern void waitevent(struct trussinfo *); extern const char *ioctlname(unsigned long val); Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Tue Aug 21 13:46:46 2012 (r239500) +++ head/usr.bin/truss/setup.c Tue Aug 21 14:58:51 2012 (r239501) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include "truss.h" #include "extern.h" -static int child_pid; +static pid_t child_pid; /* * setup_and_wait() is called to start a process. All it really does @@ -69,7 +69,7 @@ static int child_pid; int setup_and_wait(char *command[]) { - int pid; + pid_t pid; int waitval; pid = vfork(); @@ -100,7 +100,7 @@ setup_and_wait(char *command[]) */ int -start_tracing(int pid) +start_tracing(pid_t pid) { int waitval; int ret; Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Aug 21 13:46:46 2012 (r239500) +++ head/usr.bin/truss/syscalls.c Tue Aug 21 14:58:51 2012 (r239501) @@ -464,7 +464,7 @@ get_syscall(const char *name) */ static int -get_struct(int pid, void *offset, void *buf, int len) +get_struct(pid_t pid, void *offset, void *buf, int len) { struct ptrace_io_desc iorequest; @@ -539,7 +539,7 @@ char * print_arg(struct syscall_args *sc, unsigned long *args, long retval, struct trussinfo *trussinfo) { char *tmp = NULL; - int pid = trussinfo->pid; + pid_t pid = trussinfo->pid; switch (sc->type & ARG_MASK) { case Hex: Modified: head/usr.bin/truss/truss.h ============================================================================== --- head/usr.bin/truss/truss.h Tue Aug 21 13:46:46 2012 (r239500) +++ head/usr.bin/truss/truss.h Tue Aug 21 14:58:51 2012 (r239501) @@ -45,7 +45,7 @@ struct threadinfo struct trussinfo { - int pid; + pid_t pid; int flags; int pr_why; int pr_data; From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 16:18:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C5161065755; Tue, 21 Aug 2012 16:18:12 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D4508FC17; Tue, 21 Aug 2012 16:18:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LGIBSY065017; Tue, 21 Aug 2012 16:18:11 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LGIB2l065012; Tue, 21 Aug 2012 16:18:11 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201208211618.q7LGIB2l065012@svn.freebsd.org> From: Matt Jacob Date: Tue, 21 Aug 2012 16:18: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: r239502 - head/sys/dev/isp 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, 21 Aug 2012 16:18:12 -0000 Author: mjacob Date: Tue Aug 21 16:18:11 2012 New Revision: 239502 URL: http://svn.freebsd.org/changeset/base/239502 Log: Remove dependence on MAXPHYS. MFC after: 1 month Modified: head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/isp_sbus.c Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Tue Aug 21 14:58:51 2012 (r239501) +++ head/sys/dev/isp/isp_freebsd.h Tue Aug 21 16:18:11 2012 (r239502) @@ -726,9 +726,6 @@ int isp_fcp_next_crn(ispsoftc_t *, uint8 #define isp_sim_alloc(a, b, c, d, e, f, g, h) \ cam_sim_alloc(a, b, c, d, e, &(d)->isp_osinfo.lock, f, g, h) -/* Should be BUS_SPACE_MAXSIZE, but MAXPHYS is larger than BUS_SPACE_MAXSIZE */ -#define ISP_NSEGS ((MAXPHYS / PAGE_SIZE) + 1) - #define ISP_PATH_PRT(i, l, p, ...) \ if ((l) == ISP_LOGALL || ((l)& (i)->isp_dblev) != 0) { \ xpt_print(p, __VA_ARGS__); \ Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Tue Aug 21 14:58:51 2012 (r239501) +++ head/sys/dev/isp/isp_pci.c Tue Aug 21 16:18:11 2012 (r239502) @@ -1525,7 +1525,7 @@ static int isp_pci_mbxdma(ispsoftc_t *isp) { caddr_t base; - uint32_t len; + uint32_t len, nsegs; int i, error, ns, cmap = 0; bus_size_t slim; /* segment size */ bus_addr_t llim; /* low limit of unavailable dma */ @@ -1567,6 +1567,11 @@ isp_pci_mbxdma(ispsoftc_t *isp) return (1); } + if (isp->isp_osinfo.sixtyfourbit) { + nsegs = ISP_NSEG64_MAX; + } else { + nsegs = ISP_NSEG_MAX; + } #ifdef ISP_TARGET_MODE /* * XXX: We don't really support 64 bit target mode for parallel scsi yet @@ -1579,7 +1584,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) } #endif - if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, ISP_NSEGS, slim, 0, &isp->isp_osinfo.dmat)) { + if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, nsegs, slim, 0, &isp->isp_osinfo.dmat)) { free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); ISP_LOCK(isp); isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); Modified: head/sys/dev/isp/isp_sbus.c ============================================================================== --- head/sys/dev/isp/isp_sbus.c Tue Aug 21 14:58:51 2012 (r239501) +++ head/sys/dev/isp/isp_sbus.c Tue Aug 21 16:18:11 2012 (r239502) @@ -497,7 +497,7 @@ isp_sbus_mbxdma(ispsoftc_t *isp) if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_SBD(isp)), 1, BUS_SPACE_MAXADDR_24BIT+1, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR_32BIT, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, - ISP_NSEGS, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.dmat)) { + ISP_NSEG_MAX, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.dmat)) { isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); free(isp->isp_xflist, M_DEVBUF); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 16:35:15 2012 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 9C8A31065800; Tue, 21 Aug 2012 16:35:15 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8702B8FC15; Tue, 21 Aug 2012 16:35:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LGZFgS067295; Tue, 21 Aug 2012 16:35:15 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LGZFvh067293; Tue, 21 Aug 2012 16:35:15 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201208211635.q7LGZFvh067293@svn.freebsd.org> From: Niclas Zeising Date: Tue, 21 Aug 2012 16:35: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: r239503 - 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, 21 Aug 2012 16:35:15 -0000 Author: zeising (ports committer) Date: Tue Aug 21 16:35:14 2012 New Revision: 239503 URL: http://svn.freebsd.org/changeset/base/239503 Log: Add missing .Pp macro. PR: docs/170380 Submitted by: Garrett Cooper Approved by: joel (mentor) Modified: head/lib/libc/sys/dup.2 Modified: head/lib/libc/sys/dup.2 ============================================================================== --- head/lib/libc/sys/dup.2 Tue Aug 21 16:18:11 2012 (r239502) +++ head/lib/libc/sys/dup.2 Tue Aug 21 16:35:14 2012 (r239503) @@ -138,6 +138,7 @@ is not a valid active descriptor .It Bq Er EMFILE Too many descriptors are active. .El +.Pp The .Fn dup2 system call fails if: From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 16:44:26 2012 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 55E61106566C; Tue, 21 Aug 2012 16:44:26 +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 40BB28FC21; Tue, 21 Aug 2012 16:44:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LGiQtS068568; Tue, 21 Aug 2012 16:44:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LGiQBa068565; Tue, 21 Aug 2012 16:44:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208211644.q7LGiQBa068565@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 Aug 2012 16:44: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: r239504 - 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: Tue, 21 Aug 2012 16:44:26 -0000 Author: adrian Date: Tue Aug 21 16:44:25 2012 New Revision: 239504 URL: http://svn.freebsd.org/changeset/base/239504 Log: Initialise an uninitialised variable. GCC on -9 didn't pick this up; clang did. Submitted by: David Wolfskill Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Tue Aug 21 16:35:14 2012 (r239503) +++ head/sys/dev/ath/if_ath_tx_edma.c Tue Aug 21 16:44:25 2012 (r239504) @@ -427,7 +427,7 @@ ath_edma_tx_proc(void *arg, int npending struct ath_txq *txq; struct ath_buf *bf; struct ieee80211_node *ni; - int nacked; + int nacked = 0; DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", __func__, npending); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 17:05:10 2012 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 E5010106566B; Tue, 21 Aug 2012 17:05:10 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFE218FC0A; Tue, 21 Aug 2012 17:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LH5AIk071340; Tue, 21 Aug 2012 17:05:10 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LH5A3L071338; Tue, 21 Aug 2012 17:05:10 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208211705.q7LH5A3L071338@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 21 Aug 2012 17:05: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: r239505 - head/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: Tue, 21 Aug 2012 17:05:11 -0000 Author: obrien Date: Tue Aug 21 17:05:10 2012 New Revision: 239505 URL: http://svn.freebsd.org/changeset/base/239505 Log: Restore the style of r195843 to that of pre-r194498 to reduce gratuitous diffs to older sources. Modified: head/sys/sys/user.h Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Tue Aug 21 16:44:25 2012 (r239504) +++ head/sys/sys/user.h Tue Aug 21 17:05:10 2012 (r239505) @@ -98,7 +98,7 @@ #define TDNAMLEN 16 /* size of returned thread name */ #define COMMLEN 19 /* size of returned ki_comm name */ #define KI_EMULNAMELEN 16 /* size of returned ki_emul */ -#define KI_NGROUPS 16 /* number of groups in ki_groups */ +#define KI_NGROUPS 16 /* number of groups in ki_groups */ #define LOGNAMELEN 17 /* size of returned ki_login */ #define LOGINCLASSLEN 17 /* size of returned ki_loginclass */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 17:06:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC6EC106566B; Tue, 21 Aug 2012 17:06:36 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C779D8FC14; Tue, 21 Aug 2012 17:06:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LH6amZ071593; Tue, 21 Aug 2012 17:06:36 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LH6avA071590; Tue, 21 Aug 2012 17:06:36 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208211706.q7LH6avA071590@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 21 Aug 2012 17:06: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: r239506 - head/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: Tue, 21 Aug 2012 17:06:37 -0000 Author: obrien Date: Tue Aug 21 17:06:36 2012 New Revision: 239506 URL: http://svn.freebsd.org/changeset/base/239506 Log: Missing one in r239505. Modified: head/sys/sys/user.h Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Tue Aug 21 17:05:10 2012 (r239505) +++ head/sys/sys/user.h Tue Aug 21 17:06:36 2012 (r239506) @@ -146,7 +146,7 @@ struct kinfo_proc { gid_t ki_svgid; /* Saved effective group id */ short ki_ngroups; /* number of groups */ short ki_spare_short2; /* unused (just here for alignment) */ - gid_t ki_groups[KI_NGROUPS]; /* groups */ + gid_t ki_groups[KI_NGROUPS]; /* groups */ vm_size_t ki_size; /* virtual size */ segsz_t ki_rssize; /* current resident set size in pages */ segsz_t ki_swrss; /* resident set size before last swap */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 17:31:11 2012 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 1E76710656AA; Tue, 21 Aug 2012 17:31:11 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0747B8FC1C; Tue, 21 Aug 2012 17:31:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LHVAIF075119; Tue, 21 Aug 2012 17:31:10 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LHVABd075115; Tue, 21 Aug 2012 17:31:10 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201208211731.q7LHVABd075115@svn.freebsd.org> From: Hiroki Sato Date: Tue, 21 Aug 2012 17:31: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: r239507 - in head/sys: conf dev/iicbus 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, 21 Aug 2012 17:31:11 -0000 Author: hrs Date: Tue Aug 21 17:31:10 2012 New Revision: 239507 URL: http://svn.freebsd.org/changeset/base/239507 Log: Add s35390a_rtc(4) driver for Seiko Instruments S-35390A RTC. Submitted by: Yusuke Tanaka Added: head/sys/dev/iicbus/s35390a.c (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Aug 21 17:06:36 2012 (r239506) +++ head/sys/conf/NOTES Tue Aug 21 17:31:10 2012 (r239507) @@ -2555,10 +2555,12 @@ device iicoc # OpenCores I2C controlle # ds133x Dallas Semiconductor DS1337, DS1338 and DS1339 RTC # ds1374 Dallas Semiconductor DS1374 RTC # ds1672 Dallas Semiconductor DS1672 RTC +# s35390a Seiko Instruments S-35390A RTC # device ds133x device ds1374 device ds1672 +device s35390a # Parallel-Port Bus # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Aug 21 17:06:36 2012 (r239506) +++ head/sys/conf/files Tue Aug 21 17:31:10 2012 (r239507) @@ -1315,6 +1315,7 @@ dev/iicbus/iicsmb.c optional iicsmb dependency "iicbus_if.h" dev/iicbus/iicoc.c optional iicoc dev/iicbus/pcf8563.c optional pcf8563 +dev/iicbus/s35390a.c optional s35390a dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci Added: head/sys/dev/iicbus/s35390a.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/s35390a.c Tue Aug 21 17:31:10 2012 (r239507) @@ -0,0 +1,333 @@ +/*- + * Copyright (c) 2012 Yusuke Tanaka + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/*- + * Copyright (c) 2011 Frank Wille. + * All rights reserved. + * + * Written by Frank Wille for The NetBSD Project. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for Seiko Instruments S-35390A Real-time Clock + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "clock_if.h" +#include "iicbus_if.h" + +#define S390_DEVNAME "s35390a_rtc" +#define S390_DEVCODE 0x6 /* 0110 */ +/* + * S-35390A uses 4-bit device code + 3-bit command in the slave address + * field. The possible combination is 0x60-0x6f including the R/W bit. + * 0x60 means an write access to status register 1. + */ +#define S390_ADDR (S390_DEVCODE << 4) + +/* Registers are encoded into the slave address */ +#define S390_STATUS1 (0 << 1) +#define S390_STATUS2 (1 << 1) +#define S390_REALTIME1 (2 << 1) +#define S390_REALTIME2 (3 << 1) +#define S390_INT1_1 (4 << 1) +#define S390_INT1_2 (5 << 1) +#define S390_CLOCKADJ (6 << 1) +#define S390_FREE (7 << 1) + +/* Status1 bits */ +#define S390_ST1_POC (1 << 7) +#define S390_ST1_BLD (1 << 6) +#define S390_ST1_24H (1 << 1) +#define S390_ST1_RESET (1 << 0) + +/* Status2 bits */ +#define S390_ST2_TEST (1 << 7) + +/* Realtime1 data bytes */ +#define S390_RT1_NBYTES 7 +#define S390_RT1_YEAR 0 +#define S390_RT1_MONTH 1 +#define S390_RT1_DAY 2 +#define S390_RT1_WDAY 3 +#define S390_RT1_HOUR 4 +#define S390_RT1_MINUTE 5 +#define S390_RT1_SECOND 6 + +struct s390rtc_softc { + device_t sc_dev; + uint16_t sc_addr; +}; + +/* + * S-35390A interprets bits in each byte on SDA in reverse order. + * bitreverse() reverses the bits in uint8_t. + */ +static const uint8_t nibbletab[] = { + /* 0x0 0000 -> 0000 */ 0x0, + /* 0x1 0001 -> 1000 */ 0x8, + /* 0x2 0010 -> 0100 */ 0x4, + /* 0x3 0011 -> 1100 */ 0xc, + /* 0x4 0100 -> 0010 */ 0x2, + /* 0x5 0101 -> 1010 */ 0xa, + /* 0x6 0110 -> 0110 */ 0x6, + /* 0x7 0111 -> 1110 */ 0xe, + /* 0x8 1000 -> 0001 */ 0x1, + /* 0x9 1001 -> 1001 */ 0x9, + /* 0xa 1010 -> 0101 */ 0x5, + /* 0xb 1011 -> 1101 */ 0xd, + /* 0xc 1100 -> 0011 */ 0x3, + /* 0xd 1101 -> 1011 */ 0xb, + /* 0xe 1110 -> 0111 */ 0x7, + /* 0xf 1111 -> 1111 */ 0xf, }; + +static uint8_t +bitreverse(uint8_t x) +{ + + return (nibbletab[x & 0xf] << 4) | nibbletab[x >> 4]; +} + +static int +s390rtc_read(device_t dev, uint8_t reg, uint8_t *buf, size_t len) +{ + struct s390rtc_softc *sc = device_get_softc(dev); + struct iic_msg msg[] = { + { + .slave = sc->sc_addr | reg, + .flags = IIC_M_RD, + .len = len, + .buf = buf, + }, + }; + int i; + int error; + + error = iicbus_transfer(dev, msg, 1); + if (error) + return (error); + + /* this chip returns each byte in reverse order */ + for (i = 0; i < len; ++i) + buf[i] = bitreverse(buf[i]); + + return (0); +} + +static int +s390rtc_write(device_t dev, uint8_t reg, uint8_t *buf, size_t len) +{ + struct s390rtc_softc *sc = device_get_softc(dev); + struct iic_msg msg[] = { + { + .slave = sc->sc_addr | reg, + .flags = IIC_M_WR, + .len = len, + .buf = buf, + }, + }; + int i; + + /* this chip expects each byte in reverse order */ + for (i = 0; i < len; ++i) + buf[i] = bitreverse(buf[i]); + + return (iicbus_transfer(dev, msg, 1)); +} + +static int +s390rtc_probe(device_t dev) +{ + + if (iicbus_get_addr(dev) != S390_ADDR) { + if (bootverbose) + device_printf(dev, "slave address mismatch. " + "(%02x != %02x)\n", iicbus_get_addr(dev), + S390_ADDR); + return (ENXIO); + } + device_set_desc(dev, "Seiko Instruments S-35390A Real-time Clock"); + + return (BUS_PROBE_SPECIFIC); +} + +static int +s390rtc_attach(device_t dev) +{ + struct s390rtc_softc *sc; + uint8_t reg; + int error; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + /* Reset the chip and turn on 24h mode, after power-off or battery. */ + error = s390rtc_read(dev, S390_STATUS1, ®, 1); + if (error) { + device_printf(dev, "%s: cannot read status1 register\n", + __func__); + return (error); + } + if (reg & (S390_ST1_POC | S390_ST1_BLD)) { + reg |= S390_ST1_24H | S390_ST1_RESET; + error = s390rtc_write(dev, S390_STATUS1, ®, 1); + if (error) { + device_printf(dev, "%s: cannot initialize\n", __func__); + return (error); + } + } + + /* Disable the test mode, when enabled. */ + error = s390rtc_read(dev, S390_STATUS2, ®, 1); + if (error) { + device_printf(dev, "%s: cannot read status2 register\n", + __func__); + return (error); + } + if (reg & S390_ST2_TEST) { + reg &= ~S390_ST2_TEST; + error = s390rtc_write(dev, S390_STATUS2, ®, 1); + if (error) { + device_printf(dev, + "%s: cannot disable the test mode\n", __func__); + return (error); + } + } + + clock_register(dev, 1000000); /* 1 second resolution */ + return (0); +} + +static int +s390rtc_gettime(device_t dev, struct timespec *ts) +{ + uint8_t bcd[S390_RT1_NBYTES]; + struct clocktime ct; + struct s390rtc_softc *sc; + int error; + + sc = device_get_softc(dev); + error = s390rtc_read(dev, S390_REALTIME1, bcd, S390_RT1_NBYTES); + if (error) { + device_printf(dev, "%s: cannot read realtime1 register\n", + __func__); + return (error); + } + + /* + * Convert the register values into something useable. + */ + ct.nsec = 0; + ct.sec = FROMBCD(bcd[S390_RT1_SECOND]); + ct.min = FROMBCD(bcd[S390_RT1_MINUTE]); + ct.hour = FROMBCD(bcd[S390_RT1_HOUR] & 0x3f); + ct.day = FROMBCD(bcd[S390_RT1_DAY]); + ct.dow = bcd[S390_RT1_WDAY] & 0x07; + ct.mon = FROMBCD(bcd[S390_RT1_MONTH]); + ct.year = FROMBCD(bcd[S390_RT1_YEAR]) + 2000; + + return (clock_ct_to_ts(&ct, ts)); +} + +static int +s390rtc_settime(device_t dev, struct timespec *ts) +{ + uint8_t bcd[S390_RT1_NBYTES]; + struct clocktime ct; + struct s390rtc_softc *sc; + + sc = device_get_softc(dev); + clock_ts_to_ct(ts, &ct); + + /* + * Convert our time representation into something the S-xx390 + * can understand. + */ + bcd[S390_RT1_SECOND] = TOBCD(ct.sec); + bcd[S390_RT1_MINUTE] = TOBCD(ct.min); + bcd[S390_RT1_HOUR] = TOBCD(ct.hour); + bcd[S390_RT1_DAY] = TOBCD(ct.day); + bcd[S390_RT1_WDAY] = ct.dow; + bcd[S390_RT1_MONTH] = TOBCD(ct.mon); + bcd[S390_RT1_YEAR] = TOBCD(ct.year % 100); + + return (s390rtc_write(dev, S390_REALTIME1, bcd, S390_RT1_NBYTES)); +} + +static device_method_t s390rtc_methods[] = { + DEVMETHOD(device_probe, s390rtc_probe), + DEVMETHOD(device_attach, s390rtc_attach), + + DEVMETHOD(clock_gettime, s390rtc_gettime), + DEVMETHOD(clock_settime, s390rtc_settime), + + DEVMETHOD_END +}; + +static driver_t s390rtc_driver = { + S390_DEVNAME, + s390rtc_methods, + sizeof(struct s390rtc_softc), +}; +static devclass_t s390rtc_devclass; + +DRIVER_MODULE(s35390a, iicbus, s390rtc_driver, s390rtc_devclass, NULL, NULL); +MODULE_VERSION(s35390a, 1); +MODULE_DEPEND(s35390a, iicbus, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 17:49:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95EDD106566C; Tue, 21 Aug 2012 17:49:21 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 800538FC1B; Tue, 21 Aug 2012 17:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LHnLfh077548; Tue, 21 Aug 2012 17:49:21 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LHnLDC077546; Tue, 21 Aug 2012 17:49:21 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201208211749.q7LHnLDC077546@svn.freebsd.org> From: Hiroki Sato Date: Tue, 21 Aug 2012 17:49: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: r239508 - 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: Tue, 21 Aug 2012 17:49:21 -0000 Author: hrs Date: Tue Aug 21 17:49:20 2012 New Revision: 239508 URL: http://svn.freebsd.org/changeset/base/239508 Log: - Calculate the I2C baud rate to keep them <100 kHz under different TCLK frequencies. The maximum freqency is 100 kHz according to the datasheet. - Add child device probing support based on the device tree. It now tries to find i2c-address property in the tree and attach the device with given slave address to iicbus. Modified: head/sys/arm/mv/twsi.c Modified: head/sys/arm/mv/twsi.c ============================================================================== --- head/sys/arm/mv/twsi.c Tue Aug 21 17:31:10 2012 (r239507) +++ head/sys/arm/mv/twsi.c Tue Aug 21 17:49:20 2012 (r239508) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -57,12 +58,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include +#include + #include "iicbus_if.h" #define MV_TWSI_NAME "twsi" +#define IICBUS_DEVNAME "iicbus" #define TWSI_SLAVE_ADDR 0x00 #define TWSI_EXT_SLAVE_ADDR 0x10 @@ -86,10 +92,10 @@ __FBSDID("$FreeBSD$"); #define TWSI_STATUS_DATA_RD_NOACK 0x58 #define TWSI_BAUD_RATE 0x0c -#define TWSI_BAUD_RATE_94DOT3 0x53 /* N=3, M=10 */ -#define TWSI_BAUD_RATE_74DOT1 0x6b /* N=3, M=13 */ -#define TWSI_BAUD_RATE_51DOT8 0x4c /* N=4, M=9 */ -#define TWSI_BAUD_RATE_99DOT7 0x66 /* N=6, M=12 */ +#define TWSI_BAUD_RATE_PARAM(M,N) ((((M) << 3) | ((N) & 0x7)) & 0x7f) +#define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N+1))) +#define TWSI_BAUD_RATE_SLOW 50000 /* 50kHz */ +#define TWSI_BAUD_RATE_FAST 100000 /* 100kHz */ #define TWSI_SOFT_RESET 0x1c @@ -109,6 +115,13 @@ struct mv_twsi_softc { device_t iicbus; }; +static struct mv_twsi_baud_rate { + uint32_t raw; + int param; + int m; + int n; +} baud_rate[IIC_FASTEST + 1]; + static int mv_twsi_probe(device_t); static int mv_twsi_attach(device_t); static int mv_twsi_detach(device_t); @@ -299,13 +312,49 @@ mv_twsi_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +#define ABSSUB(a,b) (((a) > (b)) ? (a) - (b) : (b) - (a)) +static void +mv_twsi_cal_baud_rate(const uint32_t target, struct mv_twsi_baud_rate *rate) +{ + uint32_t clk, cur, diff, diff0; + int m, n, m0, n0; + + /* Calculate baud rate. */ + m0 = n0 = 4; /* Default values on reset */ + diff0 = 0xffffffff; + clk = get_tclk(); + + for (n = 0; n < 8; n++) { + for (m = 0; m < 16; m++) { + cur = TWSI_BAUD_RATE_RAW(clk,m,n); + diff = ABSSUB(target, cur); + if (diff < diff0) { + m0 = m; + n0 = n; + diff0 = diff; + } + } + } + rate->raw = TWSI_BAUD_RATE_RAW(clk, m0, n0); + rate->param = TWSI_BAUD_RATE_PARAM(m0, n0); + rate->m = m0; + rate->n = n0; +} + static int mv_twsi_attach(device_t dev) { struct mv_twsi_softc *sc; + phandle_t child, iicbusnode; + device_t childdev; + struct iicbus_ivar *devi; + char dname[32]; /* 32 is taken from struct u_device */ + uint32_t paddr; + int len, error; sc = device_get_softc(dev); sc->dev = dev; + bzero(baud_rate, sizeof(baud_rate)); mtx_init(&sc->mutex, device_get_nameunit(dev), MV_TWSI_NAME, MTX_DEF); @@ -316,14 +365,76 @@ mv_twsi_attach(device_t dev) return (ENXIO); } - sc->iicbus = device_add_child(dev, "iicbus", -1); + mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_SLOW, &baud_rate[IIC_SLOW]); + mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_FAST, &baud_rate[IIC_FAST]); + if (bootverbose) + device_printf(dev, "calculated baud rates are:\n" + " %" PRIu32 " kHz (M=%d, N=%d) for slow,\n" + " %" PRIu32 " kHz (M=%d, N=%d) for fast.\n", + baud_rate[IIC_SLOW].raw / 1000, + baud_rate[IIC_SLOW].m, + baud_rate[IIC_SLOW].n, + baud_rate[IIC_FAST].raw / 1000, + baud_rate[IIC_FAST].m, + baud_rate[IIC_FAST].n); + + sc->iicbus = device_add_child(dev, IICBUS_DEVNAME, -1); if (sc->iicbus == NULL) { device_printf(dev, "could not add iicbus child\n"); mv_twsi_detach(dev); return (ENXIO); } - + /* Attach iicbus. */ bus_generic_attach(dev); + + iicbusnode = 0; + /* Find iicbus as the child devices in the device tree. */ + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { + len = OF_getproplen(child, "model"); + if (len <= 0 || len > sizeof(dname) - 1) + continue; + error = OF_getprop(child, "model", &dname, len); + dname[len + 1] = '\0'; + if (error == -1) + continue; + len = strlen(dname); + if (len == strlen(IICBUS_DEVNAME) && + strncasecmp(dname, IICBUS_DEVNAME, len) == 0) { + iicbusnode = child; + break; + } + } + if (iicbusnode == 0) + goto attach_end; + + /* Attach child devices onto iicbus. */ + for (child = OF_child(iicbusnode); child != 0; child = OF_peer(child)) { + /* Get slave address. */ + error = OF_getprop(child, "i2c-address", &paddr, sizeof(paddr)); + if (error == -1) + error = OF_getprop(child, "reg", &paddr, sizeof(paddr)); + if (error == -1) + continue; + + /* Get device driver name. */ + len = OF_getproplen(child, "model"); + if (len <= 0 || len > sizeof(dname) - 1) + continue; + OF_getprop(child, "model", &dname, len); + dname[len + 1] = '\0'; + + if (bootverbose) + device_printf(dev, "adding a device %s at %d.\n", + dname, fdt32_to_cpu(paddr)); + childdev = BUS_ADD_CHILD(sc->iicbus, 0, dname, -1); + devi = IICBUS_IVAR(childdev); + devi->addr = fdt32_to_cpu(paddr); + } + +attach_end: + bus_generic_attach(sc->iicbus); + return (0); } @@ -355,28 +466,26 @@ static int mv_twsi_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) { struct mv_twsi_softc *sc; - uint32_t baud_rate; + uint32_t param; sc = device_get_softc(dev); switch (speed) { case IIC_SLOW: - baud_rate = TWSI_BAUD_RATE_51DOT8; - break; case IIC_FAST: - baud_rate = TWSI_BAUD_RATE_51DOT8; + param = baud_rate[speed].param; break; - case IIC_UNKNOWN: case IIC_FASTEST: + case IIC_UNKNOWN: default: - baud_rate = TWSI_BAUD_RATE_99DOT7; + param = baud_rate[IIC_FAST].param; break; } mtx_lock(&sc->mutex); TWSI_WRITE(sc, TWSI_SOFT_RESET, 0x0); DELAY(2000); - TWSI_WRITE(sc, TWSI_BAUD_RATE, baud_rate); + TWSI_WRITE(sc, TWSI_BAUD_RATE, param); TWSI_WRITE(sc, TWSI_CONTROL, TWSI_CONTROL_TWSIEN | TWSI_CONTROL_ACK); DELAY(1000); mtx_unlock(&sc->mutex); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 17:58:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F6681065673; Tue, 21 Aug 2012 17:58:31 +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 1761B8FC18; Tue, 21 Aug 2012 17:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LHwUX5078746; Tue, 21 Aug 2012 17:58:30 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LHwUvR078743; Tue, 21 Aug 2012 17:58:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211758.q7LHwUvR078743@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 17:58:30 +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: r239509 - head/usr.bin/clang/clang 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, 21 Aug 2012 17:58:31 -0000 Author: dim Date: Tue Aug 21 17:58:30 2012 New Revision: 239509 URL: http://svn.freebsd.org/changeset/base/239509 Log: Support the WITH_SHARED_TOOLCHAIN setting that was introduced in r234782 for the clang executable. Build it statically by default, like the gcc executables, which should improve performance a little bit. MFC after: 1 week Modified: head/usr.bin/clang/clang/Makefile Modified: head/usr.bin/clang/clang/Makefile ============================================================================== --- head/usr.bin/clang/clang/Makefile Tue Aug 21 17:49:20 2012 (r239508) +++ head/usr.bin/clang/clang/Makefile Tue Aug 21 17:58:30 2012 (r239509) @@ -9,6 +9,10 @@ SRCS= cc1_main.cpp \ cc1as_main.cpp \ driver.cpp +.if ${MK_SHARED_TOOLCHAIN} == "no" +NO_SHARED?= yes +.endif + LINKS= ${BINDIR}/clang ${BINDIR}/clang++ \ ${BINDIR}/clang ${BINDIR}/clang-cpp MLINKS= clang.1 clang++.1 \ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 17:58:40 2012 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 1E5B91065784; Tue, 21 Aug 2012 17:58:40 +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 E90B58FC0C; Tue, 21 Aug 2012 17:58:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LHwdLD078801; Tue, 21 Aug 2012 17:58:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LHwdnY078798; Tue, 21 Aug 2012 17:58:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208211758.q7LHwdnY078798@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Aug 2012 17:58: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: r239510 - 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, 21 Aug 2012 17:58:40 -0000 Author: jhb Date: Tue Aug 21 17:58:39 2012 New Revision: 239510 URL: http://svn.freebsd.org/changeset/base/239510 Log: Document DRIVER_MODULE_ORDERED, EARLY_DRIVER_MODULE, and EARLY_DRIVER_MODULE_ORDERED. Modified: head/share/man/man9/DRIVER_MODULE.9 head/share/man/man9/Makefile Modified: head/share/man/man9/DRIVER_MODULE.9 ============================================================================== --- head/share/man/man9/DRIVER_MODULE.9 Tue Aug 21 17:58:30 2012 (r239509) +++ head/share/man/man9/DRIVER_MODULE.9 Tue Aug 21 17:58:39 2012 (r239510) @@ -28,11 +28,14 @@ .\" .\" $FreeBSD$ .\" -.Dd August 27, 2011 +.Dd August 21, 2012 .Dt DRIVER_MODULE 9 .Os .Sh NAME -.Nm DRIVER_MODULE +.Nm DRIVER_MODULE , +.Nm DRIVER_MODULE_ORDERED , +.Nm EARLY_DRIVER_MODULE , +.Nm EARLY_DRIVER_MODULE_ORDERED .Nd kernel driver declaration macro .Sh SYNOPSIS .In sys/param.h @@ -40,6 +43,9 @@ .In sys/bus.h .In sys/module.h .Fn DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" +.Fn DRIVER_MODULE_ORDERED name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "int order" +.Fn EARLY_DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "enum sysinit_elem_order order" "int pass" +.Fn EARLY_DRIVER_MODULE_ORDERED name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "enum sysinit_elem_order order" "int pass" .Sh DESCRIPTION The .Fn DRIVER_MODULE @@ -95,10 +101,50 @@ The is unused at this time and should be a .Dv NULL pointer. +.Pp +The +.Fn DRIVER_MODULE_ORDERED +macro allows a driver to be registered in a specific order. +This can be useful if a single kernel module contains multiple drivers +that are inter-dependent. +The +.Fa order +argument should be one of the +.Xr SYSINIT 9 +initialization ordering constants +.Pq Dv SI_ORDER_* . +The default order for a driver module is +.Dv SI_ORDER_MIDDLE . +Typically a module will specify an order of +.Dv SI_ORDER_ANY +for a single driver to ensure it is registered last. +.Pp +The +.Fn EARLY_DRIVER_MODULE +macro allows a driver to be registered for a specific pass level. +The boot time probe and attach process makes multiple passes over the +device tree. +Certain critical drivers that provide basic services needed by other +devices are attach during earlier passes. +Most drivers are attached in a final general pass. +A driver that attaches during an early pass must register for a specific +pass level +.Pq BUS_PASS_* +via the +.Fa pass +argument. +Once a driver is registered it is available to attach to devices for +all subsequent passes. +.Pp +The +.Fn EARLY_DRIVER_MODULE_ORDERED +macro allows a driver to be registered both in a specific order and +for a specific pass level. .Sh SEE ALSO .Xr device 9 , .Xr driver 9 , -.Xr module 9 +.Xr module 9 , +.Xr SYSINIT 9 .Sh AUTHORS This manual page was written by .An Alexander Langer Aq alex@FreeBSD.org . Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Aug 21 17:58:30 2012 (r239509) +++ head/share/man/man9/Makefile Tue Aug 21 17:58:39 2012 (r239510) @@ -628,6 +628,9 @@ MLINKS+=drbr.9 drbr_free.9 \ drbr.9 drbr_empty.9 \ drbr.9 drbr_inuse.9 \ drbr.9 drbr_stats_update.9 +MLINKS+=DRIVER_MODULE.9 DRIVER_MODULE_ORDERED.9 \ + DRIVER_MODULE.9 EARLY_DRIVER_MODULE.9 \ + DRIVER_MODULE.9 EARLY_DRIVER_MODULE_ORDERED.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ EVENTHANDLER.9 eventhandler_deregister.9 \ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 18:09:33 2012 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 D215E106566C; Tue, 21 Aug 2012 18:09:33 +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 B28918FC1C; Tue, 21 Aug 2012 18:09:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LI9XAd080339; Tue, 21 Aug 2012 18:09:33 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LI9XTl080333; Tue, 21 Aug 2012 18:09:33 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208211809.q7LI9XTl080333@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 18:09: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: r239511 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom 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: Tue, 21 Aug 2012 18:09:33 -0000 Author: np Date: Tue Aug 21 18:09:33 2012 New Revision: 239511 URL: http://svn.freebsd.org/changeset/base/239511 Log: Correctly handle the case where an inp has already been dropped by the time the TOE driver reports that an active open failed. toe_connect_failed is supposed to handle this but it should be provided the inpcb instead of the tcpcb which may no longer be around. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/netinet/toecore.c head/sys/netinet/toecore.h Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Tue Aug 21 17:58:39 2012 (r239510) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Tue Aug 21 18:09:33 2012 (r239511) @@ -880,10 +880,10 @@ act_open_rpl_status_to_errno(int status) case CPL_ERR_CONN_TIMEDOUT: return (ETIMEDOUT); case CPL_ERR_TCAM_FULL: - return (ENOMEM); + return (EAGAIN); case CPL_ERR_CONN_EXIST: log(LOG_ERR, "ACTIVE_OPEN_RPL: 4-tuple in use\n"); - return (EADDRINUSE); + return (EAGAIN); default: return (EIO); } @@ -912,8 +912,7 @@ do_act_open_rpl(struct sge_qset *qs, str unsigned int atid = G_TID(ntohl(rpl->atid)); struct toepcb *toep = lookup_atid(&td->tid_maps, atid); struct inpcb *inp = toep->tp_inp; - struct tcpcb *tp = intotcpcb(inp); - int s = rpl->status; + int s = rpl->status, rc; CTR3(KTR_CXGB, "%s: atid %u, status %u ", __func__, atid, s); @@ -923,17 +922,14 @@ do_act_open_rpl(struct sge_qset *qs, str if (act_open_has_tid(s)) queue_tid_release(tod, GET_TID(rpl)); - if (s == CPL_ERR_TCAM_FULL || s == CPL_ERR_CONN_EXIST) { - INP_WLOCK(inp); - toe_connect_failed(tod, tp, EAGAIN); - toepcb_release(toep); /* unlocks inp */ - } else { + rc = act_open_rpl_status_to_errno(s); + if (rc != EAGAIN) INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(inp); - toe_connect_failed(tod, tp, act_open_rpl_status_to_errno(s)); - toepcb_release(toep); /* unlocks inp */ + INP_WLOCK(inp); + toe_connect_failed(tod, inp, rc); + toepcb_release(toep); /* unlocks inp */ + if (rc != EAGAIN) INP_INFO_WUNLOCK(&V_tcbinfo); - } m_freem(m); return (0); Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 21 17:58:39 2012 (r239510) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 21 18:09:33 2012 (r239511) @@ -167,10 +167,10 @@ act_open_rpl_status_to_errno(int status) case CPL_ERR_CONN_TIMEDOUT: return (ETIMEDOUT); case CPL_ERR_TCAM_FULL: - return (ENOMEM); + return (EAGAIN); case CPL_ERR_CONN_EXIST: log(LOG_ERR, "ACTIVE_OPEN_RPL: 4-tuple in use\n"); - return (EADDRINUSE); + return (EAGAIN); default: return (EIO); } @@ -186,8 +186,8 @@ do_act_open_rpl(struct sge_iq *iq, const unsigned int status = G_AOPEN_STATUS(be32toh(cpl->atid_status)); struct toepcb *toep = lookup_atid(sc, atid); struct inpcb *inp = toep->inp; - struct tcpcb *tp = intotcpcb(inp); struct toedev *tod = &toep->td->tod; + int rc; KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == atid, ("%s: toep tid/atid mismatch", __func__)); @@ -204,17 +204,14 @@ do_act_open_rpl(struct sge_iq *iq, const if (status && act_open_has_tid(status)) release_tid(sc, GET_TID(cpl), toep->ctrlq); - if (status == CPL_ERR_TCAM_FULL) { - INP_WLOCK(inp); - toe_connect_failed(tod, tp, EAGAIN); - final_cpl_received(toep); /* unlocks inp */ - } else { + rc = act_open_rpl_status_to_errno(status); + if (rc != EAGAIN) INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(inp); - toe_connect_failed(tod, tp, act_open_rpl_status_to_errno(status)); - final_cpl_received(toep); /* unlocks inp */ + INP_WLOCK(inp); + toe_connect_failed(tod, inp, rc); + final_cpl_received(toep); /* unlocks inp */ + if (rc != EAGAIN) INP_INFO_WUNLOCK(&V_tcbinfo); - } return (0); } Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Tue Aug 21 17:58:39 2012 (r239510) +++ head/sys/netinet/toecore.c Tue Aug 21 18:09:33 2012 (r239511) @@ -478,15 +478,17 @@ toe_l2_resolve(struct toedev *tod, struc } void -toe_connect_failed(struct toedev *tod, struct tcpcb *tp, int err) +toe_connect_failed(struct toedev *tod, struct inpcb *inp, int err) { - struct inpcb *inp = tp->t_inpcb; INP_WLOCK_ASSERT(inp); - KASSERT(tp->t_flags & TF_TOE, - ("%s: tp %p not offloaded.", __func__, tp)); if (!(inp->inp_flags & INP_DROPPED)) { + struct tcpcb *tp = intotcpcb(inp); + + KASSERT(tp->t_flags & TF_TOE, + ("%s: tp %p not offloaded.", __func__, tp)); + if (err == EAGAIN) { /* Modified: head/sys/netinet/toecore.h ============================================================================== --- head/sys/netinet/toecore.h Tue Aug 21 17:58:39 2012 (r239510) +++ head/sys/netinet/toecore.h Tue Aug 21 18:09:33 2012 (r239511) @@ -119,7 +119,7 @@ int unregister_toedev(struct toedev *); int toe_l2_resolve(struct toedev *, struct ifnet *, struct sockaddr *, uint8_t *, uint16_t *); -void toe_connect_failed(struct toedev *, struct tcpcb *, int); +void toe_connect_failed(struct toedev *, struct inpcb *, int); void toe_syncache_add(struct in_conninfo *, struct tcpopt *, struct tcphdr *, struct inpcb *, void *, void *); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 18:13:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E7AD1065670; Tue, 21 Aug 2012 18:13: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 183BC8FC0A; Tue, 21 Aug 2012 18:13:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LID9cV080855; Tue, 21 Aug 2012 18:13:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LID9UC080851; Tue, 21 Aug 2012 18:13:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208211813.q7LID9UC080851@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Aug 2012 18:13: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: r239512 - in head: share/man/man9 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, 21 Aug 2012 18:13:10 -0000 Author: jhb Date: Tue Aug 21 18:13:09 2012 New Revision: 239512 URL: http://svn.freebsd.org/changeset/base/239512 Log: Add a BUS_CHILD_DELETED() method that a bus can hook to allow it to cleanup any bus-specific state (such as ivars) when a child device is deleted. Requested by: kan MFC after: 1 month Added: head/share/man/man9/BUS_CHILD_DELETED.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/sys/kern/bus_if.m head/sys/kern/subr_bus.c Added: head/share/man/man9/BUS_CHILD_DELETED.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/BUS_CHILD_DELETED.9 Tue Aug 21 18:13:09 2012 (r239512) @@ -0,0 +1,55 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2012 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" 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$ +.\" +.Dd August 21, 2012 +.Dt BUS_CHILD_DELETED 9 +.Os +.Sh NAME +.Nm BUS_CHILD_DELETED +.Nd "notify a bus device that a child is being deleted" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn BUS_CHILD_DELETED "device_t dev" "device_t child" +.Sh DESCRIPTION +The +.Fn BUS_CHILD_DELETED +method is invoked by the new-bus framework when a device is deleted. +A bus driver can provide an implementation of this method to +release bus-specific resources associated with a device such as +instance variables. +.Sh SEE ALSO +.Xr BUS_ADD_CHILD 9 , +.Xr device 9 +.Sh HISTORY +The +.Fn BUS_CHILD_DELETED +method first appeared in +.Fx 10.0 . Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Aug 21 18:09:33 2012 (r239511) +++ head/share/man/man9/Makefile Tue Aug 21 18:13:09 2012 (r239512) @@ -26,6 +26,7 @@ MAN= accept_filter.9 \ bus_alloc_resource.9 \ BUS_BIND_INTR.9 \ bus_child_present.9 \ + BUS_CHILD_DELETED.9 \ BUS_CONFIG_INTR.9 \ BUS_DESCRIBE_INTR.9 \ bus_dma.9 \ Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Tue Aug 21 18:09:33 2012 (r239511) +++ head/sys/kern/bus_if.m Tue Aug 21 18:13:09 2012 (r239512) @@ -160,6 +160,20 @@ METHOD int write_ivar { }; /** + * @brief Notify a bus that a child was deleted + * + * Called at the beginning of device_delete_child() to allow the parent + * to teardown any bus-specific state for the child. + * + * @param _dev the device whose child is being deleted + * @param _child the child device which is being deleted + */ +METHOD void child_deleted { + device_t _dev; + device_t _child; +}; + +/** * @brief Notify a bus that a child was detached * * Called after the child's DEVICE_DETACH() method to allow the parent Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Aug 21 18:09:33 2012 (r239511) +++ head/sys/kern/subr_bus.c Tue Aug 21 18:13:09 2012 (r239512) @@ -1873,6 +1873,8 @@ device_delete_child(device_t dev, device return (error); if (child->devclass) devclass_delete_device(child->devclass, child); + if (child->parent) + BUS_CHILD_DELETED(dev, child); TAILQ_REMOVE(&dev->children, child, link); TAILQ_REMOVE(&bus_data_devices, child, devlink); kobj_delete((kobj_t) child, M_BUS); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 18:24:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 824B1106564A; Tue, 21 Aug 2012 18:24:12 +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 6D16E8FC12; Tue, 21 Aug 2012 18:24:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LIOCjo082443; Tue, 21 Aug 2012 18:24:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LIOClR082441; Tue, 21 Aug 2012 18:24:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211824.q7LIOClR082441@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 18:24: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: r239513 - head/usr.bin/clang 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, 21 Aug 2012 18:24:12 -0000 Author: dim Date: Tue Aug 21 18:24:11 2012 New Revision: 239513 URL: http://svn.freebsd.org/changeset/base/239513 Log: When WITH_CLANG_EXTRAS is enabled, avoid needlessly building the llvm and clang extras in the cross-tools stage. MFC after: 1 week Modified: head/usr.bin/clang/Makefile Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Tue Aug 21 18:13:09 2012 (r239512) +++ head/usr.bin/clang/Makefile Tue Aug 21 18:24:11 2012 (r239513) @@ -4,7 +4,7 @@ SUBDIR= clang clang-tblgen tblgen -.if ${MK_CLANG_EXTRAS} != "no" +.if ${MK_CLANG_EXTRAS} != "no" && !defined(TOOLS_PREFIX) SUBDIR+=bugpoint \ llc \ lli \ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 18:30:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 73DE3106566C; Tue, 21 Aug 2012 18:30:17 +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 5CF9D8FC17; Tue, 21 Aug 2012 18:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LIUH3A083306; Tue, 21 Aug 2012 18:30:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LIUH4S083299; Tue, 21 Aug 2012 18:30:17 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208211830.q7LIUH4S083299@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 18:30: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: r239514 - head/sys/dev/cxgbe/tom 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, 21 Aug 2012 18:30:17 -0000 Author: np Date: Tue Aug 21 18:30:16 2012 New Revision: 239514 URL: http://svn.freebsd.org/changeset/base/239514 Log: Minor cleanup: use bitwise ops instead of pointless wrappers around setbit/clrbit. Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 21 18:30:16 2012 (r239514) @@ -358,7 +358,7 @@ t4_connect(struct toedev *tod, struct so rc = t4_l2t_send(sc, wr, e); if (rc == 0) { - toepcb_set_flag(toep, TPF_CPL_PENDING); + toep->flags |= TPF_CPL_PENDING; return (0); } Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 21 18:30:16 2012 (r239514) @@ -81,7 +81,7 @@ send_flowc_wr(struct toepcb *toep, struc unsigned int pfvf = G_FW_VIID_PFN(pi->viid) << S_FW_VIID_PFN; struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; - KASSERT(!toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(!(toep->flags & TPF_FLOWC_WR_SENT), ("%s: flowc for tid %u sent already", __func__, toep->tid)); CTR2(KTR_CXGBE, "%s: tid %u", __func__, toep->tid); @@ -131,7 +131,7 @@ send_flowc_wr(struct toepcb *toep, struc toep->txsd_pidx = 0; toep->txsd_avail--; - toepcb_set_flag(toep, TPF_FLOWC_WR_SENT); + toep->flags |= TPF_FLOWC_WR_SENT; t4_wrq_tx(sc, wr); } @@ -151,15 +151,15 @@ send_reset(struct adapter *sc, struct to inp->inp_flags & INP_DROPPED ? "inp dropped" : tcpstates[tp->t_state], toep->flags, inp->inp_flags, - toepcb_flag(toep, TPF_ABORT_SHUTDOWN) ? + toep->flags & TPF_ABORT_SHUTDOWN ? " (abort already in progress)" : ""); - if (toepcb_flag(toep, TPF_ABORT_SHUTDOWN)) + if (toep->flags & TPF_ABORT_SHUTDOWN) return; /* abort already in progress */ - toepcb_set_flag(toep, TPF_ABORT_SHUTDOWN); + toep->flags |= TPF_ABORT_SHUTDOWN; - KASSERT(toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %d.", __func__, tid)); wr = alloc_wrqe(sizeof(*req), toep->ofld_txq); @@ -174,7 +174,7 @@ send_reset(struct adapter *sc, struct to req->rsvd0 = htobe32(snd_nxt); else req->rsvd0 = htobe32(tp->snd_nxt); - req->rsvd1 = !toepcb_flag(toep, TPF_TX_DATA_SENT); + req->rsvd1 = !(toep->flags & TPF_TX_DATA_SENT); req->cmd = CPL_ABORT_SEND_RST; /* @@ -364,12 +364,12 @@ close_conn(struct adapter *sc, struct to unsigned int tid = toep->tid; CTR3(KTR_CXGBE, "%s: tid %u%s", __func__, toep->tid, - toepcb_flag(toep, TPF_FIN_SENT) ? ", IGNORED" : ""); + toep->flags & TPF_FIN_SENT ? ", IGNORED" : ""); - if (toepcb_flag(toep, TPF_FIN_SENT)) + if (toep->flags & TPF_FIN_SENT) return (0); - KASSERT(toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, tid)); wr = alloc_wrqe(sizeof(*req), toep->ofld_txq); @@ -387,8 +387,8 @@ close_conn(struct adapter *sc, struct to OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_CON_REQ, tid)); req->rsvd = 0; - toepcb_set_flag(toep, TPF_FIN_SENT); - toepcb_clr_flag(toep, TPF_SEND_FIN); + toep->flags |= TPF_FIN_SENT; + toep->flags &= ~TPF_SEND_FIN; t4_l2t_send(sc, wr, toep->l2te); return (0); @@ -540,7 +540,7 @@ t4_push_frames(struct adapter *sc, struc struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; INP_WLOCK_ASSERT(inp); - KASSERT(toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); if (__predict_false(toep->ulp_mode != ULP_MODE_NONE && @@ -551,7 +551,7 @@ t4_push_frames(struct adapter *sc, struc * This function doesn't resume by itself. Someone else must clear the * flag and call this function. */ - if (__predict_false(toepcb_flag(toep, TPF_TX_SUSPENDED))) + if (__predict_false(toep->flags & TPF_TX_SUSPENDED)) return; do { @@ -577,7 +577,7 @@ t4_push_frames(struct adapter *sc, struc plen -= m->m_len; if (plen == 0) { /* Too few credits */ - toepcb_set_flag(toep, TPF_TX_SUSPENDED); + toep->flags |= TPF_TX_SUSPENDED; SOCKBUF_UNLOCK(sb); return; } @@ -620,7 +620,7 @@ unlocked: break; } - if (__predict_false(toepcb_flag(toep, TPF_FIN_SENT))) + if (__predict_false(toep->flags & TPF_FIN_SENT)) panic("%s: excess tx.", __func__); if (plen <= max_imm) { @@ -631,7 +631,7 @@ unlocked: toep->ofld_txq); if (wr == NULL) { /* XXX: how will we recover from this? */ - toepcb_set_flag(toep, TPF_TX_SUSPENDED); + toep->flags |= TPF_TX_SUSPENDED; return; } txwr = wrtod(wr); @@ -649,7 +649,7 @@ unlocked: wr = alloc_wrqe(roundup(wr_len, 16), toep->ofld_txq); if (wr == NULL) { /* XXX: how will we recover from this? */ - toepcb_set_flag(toep, TPF_TX_SUSPENDED); + toep->flags |= TPF_TX_SUSPENDED; return; } txwr = wrtod(wr); @@ -678,7 +678,7 @@ unlocked: sb->sb_sndptr = sb_sndptr; SOCKBUF_UNLOCK(sb); - toepcb_set_flag(toep, TPF_TX_DATA_SENT); + toep->flags |= TPF_TX_DATA_SENT; KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__)); txsd->plen = plen; @@ -694,7 +694,7 @@ unlocked: } while (m != NULL); /* Send a FIN if requested, but only if there's no more data to send */ - if (m == NULL && toepcb_flag(toep, TPF_SEND_FIN)) + if (m == NULL && toep->flags & TPF_SEND_FIN) close_conn(sc, toep); } @@ -731,7 +731,7 @@ t4_send_fin(struct toedev *tod, struct t ("%s: inp %p dropped.", __func__, inp)); KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); - toepcb_set_flag(toep, TPF_SEND_FIN); + toep->flags |= TPF_SEND_FIN; t4_push_frames(sc, toep); return (0); @@ -752,7 +752,7 @@ t4_send_rst(struct toedev *tod, struct t KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); /* hmmmm */ - KASSERT(toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc for tid %u [%s] not sent already", __func__, toep->tid, tcpstates[tp->t_state])); @@ -790,7 +790,7 @@ do_peer_close(struct sge_iq *iq, const s CTR5(KTR_CXGBE, "%s: tid %u (%s), toep_flags 0x%x, inp %p", __func__, tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags, inp); - if (toepcb_flag(toep, TPF_ABORT_SHUTDOWN)) + if (toep->flags & TPF_ABORT_SHUTDOWN) goto done; tp->rcv_nxt++; /* FIN */ @@ -888,7 +888,7 @@ do_close_con_rpl(struct sge_iq *iq, cons CTR4(KTR_CXGBE, "%s: tid %u (%s), toep_flags 0x%x", __func__, tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags); - if (toepcb_flag(toep, TPF_ABORT_SHUTDOWN)) + if (toep->flags & TPF_ABORT_SHUTDOWN) goto done; so = inp->inp_socket; @@ -986,7 +986,7 @@ do_abort_req(struct sge_iq *iq, const st ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); - if (toepcb_flag(toep, TPF_SYNQE)) + if (toep->flags & TPF_SYNQE) return (do_abort_req_synqe(iq, rss, m)); KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); @@ -1015,11 +1015,11 @@ do_abort_req(struct sge_iq *iq, const st * cleaning up resources. Otherwise we tear everything down right here * right now. We owe the T4 a CPL_ABORT_RPL no matter what. */ - if (toepcb_flag(toep, TPF_ABORT_SHUTDOWN)) { + if (toep->flags & TPF_ABORT_SHUTDOWN) { INP_WUNLOCK(inp); goto done; } - toepcb_set_flag(toep, TPF_ABORT_SHUTDOWN); + toep->flags |= TPF_ABORT_SHUTDOWN; so_error_set(so, abort_status_to_errno(tp, cpl->status)); tp = tcp_close(tp); @@ -1052,7 +1052,7 @@ do_abort_rpl(struct sge_iq *iq, const st ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); - if (toepcb_flag(toep, TPF_SYNQE)) + if (toep->flags & TPF_SYNQE) return (do_abort_rpl_synqe(iq, rss, m)); KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); @@ -1060,7 +1060,7 @@ do_abort_rpl(struct sge_iq *iq, const st CTR5(KTR_CXGBE, "%s: tid %u, toep %p, inp %p, status %d", __func__, tid, toep, inp, cpl->status); - KASSERT(toepcb_flag(toep, TPF_ABORT_SHUTDOWN), + KASSERT(toep->flags & TPF_ABORT_SHUTDOWN, ("%s: wasn't expecting abort reply", __func__)); INP_WLOCK(inp); @@ -1082,13 +1082,13 @@ do_rx_data(struct sge_iq *iq, const stru struct sockbuf *sb; int len; - if (__predict_false(toepcb_flag(toep, TPF_SYNQE))) { + if (__predict_false(toep->flags & TPF_SYNQE)) { /* * do_pass_establish failed and must be attempting to abort the * synqe's tid. Meanwhile, the T4 has sent us data for such a * connection. */ - KASSERT(toepcb_flag(toep, TPF_ABORT_SHUTDOWN), + KASSERT(toep->flags & TPF_ABORT_SHUTDOWN, ("%s: synqe and tid isn't being aborted.", __func__)); m_freem(m); return (0); @@ -1266,8 +1266,8 @@ do_fw4_ack(struct sge_iq *iq, const stru * Very unusual case: we'd sent a flowc + abort_req for a synq entry and * now this comes back carrying the credits for the flowc. */ - if (__predict_false(toepcb_flag(toep, TPF_SYNQE))) { - KASSERT(toepcb_flag(toep, TPF_ABORT_SHUTDOWN), + if (__predict_false(toep->flags & TPF_SYNQE)) { + KASSERT(toep->flags & TPF_ABORT_SHUTDOWN, ("%s: credits for a synq entry %p", __func__, toep)); return (0); } @@ -1281,7 +1281,7 @@ do_fw4_ack(struct sge_iq *iq, const stru INP_WLOCK(inp); - if (__predict_false(toepcb_flag(toep, TPF_ABORT_SHUTDOWN))) { + if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) { INP_WUNLOCK(inp); return (0); } @@ -1337,11 +1337,11 @@ do_fw4_ack(struct sge_iq *iq, const stru } /* XXX */ - if ((toepcb_flag(toep, TPF_TX_SUSPENDED) && + if ((toep->flags & TPF_TX_SUSPENDED && toep->tx_credits >= MIN_OFLD_TX_CREDITS) || toep->tx_credits == toep->txsd_total * howmany((sizeof(struct fw_ofld_tx_data_wr) + 1), 16)) { - toepcb_clr_flag(toep, TPF_TX_SUSPENDED); + toep->flags &= ~TPF_TX_SUSPENDED; t4_push_frames(sc, toep); } INP_WUNLOCK(inp); Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 21 18:30:16 2012 (r239514) @@ -472,7 +472,7 @@ do_rx_data_ddp(struct sge_iq *iq, const KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); - KASSERT(!toepcb_flag(toep, TPF_SYNQE), + KASSERT(!(toep->flags & TPF_SYNQE), ("%s: toep %p claims to be a synq entry", __func__, toep)); vld = be32toh(cpl->ddpvld); @@ -497,7 +497,7 @@ do_rx_ddp_complete(struct sge_iq *iq, co KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); - KASSERT(!toepcb_flag(toep, TPF_SYNQE), + KASSERT(!(toep->flags & TPF_SYNQE), ("%s: toep %p claims to be a synq entry", __func__, toep)); handle_ddp_data(toep, cpl->ddp_report, cpl->rcv_nxt, 0); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 21 18:30:16 2012 (r239514) @@ -283,11 +283,11 @@ send_reset_synqe(struct toedev *tod, str CTR4(KTR_CXGBE, "%s: synqe %p, tid %d%s", __func__, synqe, synqe->tid, - synqe_flag(synqe, TPF_ABORT_SHUTDOWN) ? + synqe->flags & TPF_ABORT_SHUTDOWN ? " (abort already in progress)" : ""); - if (synqe_flag(synqe, TPF_ABORT_SHUTDOWN)) + if (synqe->flags & TPF_ABORT_SHUTDOWN) return; /* abort already in progress */ - synqe_set_flag(synqe, TPF_ABORT_SHUTDOWN); + synqe->flags |= TPF_ABORT_SHUTDOWN; get_qids_from_mbuf(m, &txqid, &rxqid); ofld_txq = &sc->sge.ofld_txq[txqid]; @@ -318,7 +318,7 @@ send_reset_synqe(struct toedev *tod, str flowc->mnemval[2].val = htobe32(pi->tx_chan); flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id); - synqe_set_flag(synqe, TPF_FLOWC_WR_SENT); + synqe->flags |= TPF_FLOWC_WR_SENT; /* ... then ABORT request */ INIT_TP_WR_MIT_CPL(req, CPL_ABORT_REQ, synqe->tid); @@ -515,7 +515,7 @@ release_synqe(struct synq_entry *synqe) { if (refcount_release(&synqe->refcnt)) { - int needfree = synqe_flag(synqe, TPF_SYNQE_NEEDFREE); + int needfree = synqe->flags & TPF_SYNQE_NEEDFREE; m_freem(synqe->syn); if (needfree) @@ -740,7 +740,7 @@ do_abort_req_synqe(struct sge_iq *iq, co * cleaning up resources. Otherwise we tear everything down right here * right now. We owe the T4 a CPL_ABORT_RPL no matter what. */ - if (synqe_flag(synqe, TPF_ABORT_SHUTDOWN)) { + if (synqe->flags & TPF_ABORT_SHUTDOWN) { INP_WUNLOCK(inp); goto done; } @@ -775,7 +775,7 @@ do_abort_rpl_synqe(struct sge_iq *iq, co __func__, tid, synqe, synqe->flags, synqe->lctx, cpl->status); INP_WLOCK(inp); - KASSERT(synqe_flag(synqe, TPF_ABORT_SHUTDOWN), + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, ("%s: wasn't expecting abort reply for synqe %p (0x%x)", __func__, synqe, synqe->flags)); @@ -798,12 +798,12 @@ t4_offload_socket(struct toedev *tod, vo INP_INFO_LOCK_ASSERT(&V_tcbinfo); /* prevents bad race with accept() */ INP_WLOCK_ASSERT(inp); - KASSERT(synqe_flag(synqe, TPF_SYNQE), + KASSERT(synqe->flags & TPF_SYNQE, ("%s: %p not a synq_entry?", __func__, arg)); offload_socket(so, toep); make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); - toepcb_set_flag(toep, TPF_CPL_PENDING); + toep->flags |= TPF_CPL_PENDING; update_tid(sc, synqe->tid, toep); } @@ -843,13 +843,11 @@ mbuf_to_synqe(struct mbuf *m) synqe = malloc(sizeof(*synqe), M_CXGBE, M_NOWAIT); if (synqe == NULL) return (NULL); - } else + synqe->flags = TPF_SYNQE | TPF_SYNQE_NEEDFREE; + } else { synqe = (void *)(m->m_data + m->m_len + tspace - sizeof(*synqe)); - - synqe->flags = 0; - synqe_set_flag(synqe, TPF_SYNQE); - if (tspace < len) - synqe_set_flag(synqe, TPF_SYNQE_NEEDFREE); + synqe->flags = TPF_SYNQE; + } return (synqe); } @@ -1115,7 +1113,7 @@ do_pass_accept_req(struct sge_iq *iq, co INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) { ulp_mode = ULP_MODE_TCPDDP; - synqe_set_flag(synqe, TPF_SYNQE_TCPDDP); + synqe->flags |= TPF_SYNQE_TCPDDP; } else ulp_mode = ULP_MODE_NONE; rpl->opt0 = calc_opt0(so, pi, e, mtu_idx, rscale, rx_credits, ulp_mode); @@ -1160,7 +1158,7 @@ do_pass_accept_req(struct sge_iq *iq, co INP_WLOCK(inp); if (__predict_false(inp->inp_flags & INP_DROPPED)) { /* listener closed. synqe must have been aborted. */ - KASSERT(synqe_flag(synqe, TPF_ABORT_SHUTDOWN), + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, ("%s: listener %p closed but synqe %p not aborted", __func__, inp, synqe)); @@ -1178,7 +1176,7 @@ do_pass_accept_req(struct sge_iq *iq, co * that can only happen if the listener was closed and we just * checked for that. */ - KASSERT(!synqe_flag(synqe, TPF_ABORT_SHUTDOWN), + KASSERT(!(synqe->flags & TPF_ABORT_SHUTDOWN), ("%s: synqe %p aborted, but listener %p not dropped.", __func__, synqe, inp)); @@ -1275,7 +1273,7 @@ do_pass_establish(struct sge_iq *iq, con ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(lctx->stid == stid, ("%s: lctx stid mismatch", __func__)); - KASSERT(synqe_flag(synqe, TPF_SYNQE), + KASSERT(synqe->flags & TPF_SYNQE, ("%s: tid %u (ctx %p) not a synqe", __func__, tid, synqe)); INP_INFO_WLOCK(&V_tcbinfo); /* for syncache_expand */ @@ -1292,7 +1290,7 @@ do_pass_establish(struct sge_iq *iq, con * on the lctx's synq. do_abort_rpl for the tid is responsible * for cleaning up. */ - KASSERT(synqe_flag(synqe, TPF_ABORT_SHUTDOWN), + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, ("%s: listen socket dropped but tid %u not aborted.", __func__, tid)); @@ -1322,7 +1320,7 @@ reset: } toep->tid = tid; toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; - if (synqe_flag(synqe, TPF_SYNQE_TCPDDP)) + if (synqe->flags & TPF_SYNQE_TCPDDP) set_tcpddp_ulp_mode(toep); else toep->ulp_mode = ULP_MODE_NONE; Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Aug 21 18:30:16 2012 (r239514) @@ -141,9 +141,9 @@ void free_toepcb(struct toepcb *toep) { - KASSERT(toepcb_flag(toep, TPF_ATTACHED) == 0, + KASSERT(!(toep->flags & TPF_ATTACHED), ("%s: attached to an inpcb", __func__)); - KASSERT(toepcb_flag(toep, TPF_CPL_PENDING) == 0, + KASSERT(!(toep->flags & TPF_CPL_PENDING), ("%s: CPL pending", __func__)); free(toep, M_CXGBE); @@ -181,7 +181,7 @@ offload_socket(struct socket *so, struct /* Install an extra hold on inp */ toep->inp = inp; - toepcb_set_flag(toep, TPF_ATTACHED); + toep->flags |= TPF_ATTACHED; in_pcbref(inp); /* Add the TOE PCB to the active list */ @@ -216,7 +216,7 @@ undo_offload_socket(struct socket *so) tp->t_flags &= ~TF_TOE; toep->inp = NULL; - toepcb_clr_flag(toep, TPF_ATTACHED); + toep->flags &= ~TPF_ATTACHED; if (in_pcbrele_wlocked(inp)) panic("%s: inp freed.", __func__); @@ -232,9 +232,9 @@ release_offload_resources(struct toepcb struct adapter *sc = td_adapter(td); int tid = toep->tid; - KASSERT(toepcb_flag(toep, TPF_CPL_PENDING) == 0, + KASSERT(!(toep->flags & TPF_CPL_PENDING), ("%s: %p has CPL pending.", __func__, toep)); - KASSERT(toepcb_flag(toep, TPF_ATTACHED) == 0, + KASSERT(!(toep->flags & TPF_ATTACHED), ("%s: %p is still attached.", __func__, toep)); CTR4(KTR_CXGBE, "%s: toep %p (tid %d, l2te %p)", @@ -277,7 +277,7 @@ t4_pcb_detach(struct toedev *tod __unuse INP_WLOCK_ASSERT(inp); KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); - KASSERT(toepcb_flag(toep, TPF_ATTACHED), + KASSERT(toep->flags & TPF_ATTACHED, ("%s: not attached", __func__)); #ifdef KTR @@ -295,9 +295,9 @@ t4_pcb_detach(struct toedev *tod __unuse tp->t_toe = NULL; tp->t_flags &= ~TF_TOE; - toepcb_clr_flag(toep, TPF_ATTACHED); + toep->flags &= ~TPF_ATTACHED; - if (toepcb_flag(toep, TPF_CPL_PENDING) == 0) + if (!(toep->flags & TPF_CPL_PENDING)) release_offload_resources(toep); } @@ -312,16 +312,16 @@ final_cpl_received(struct toepcb *toep) KASSERT(inp != NULL, ("%s: inp is NULL", __func__)); INP_WLOCK_ASSERT(inp); - KASSERT(toepcb_flag(toep, TPF_CPL_PENDING), + KASSERT(toep->flags & TPF_CPL_PENDING, ("%s: CPL not pending already?", __func__)); CTR6(KTR_CXGBE, "%s: tid %d, toep %p (0x%x), inp %p (0x%x)", __func__, toep->tid, toep, toep->flags, inp, inp->inp_flags); toep->inp = NULL; - toepcb_clr_flag(toep, TPF_CPL_PENDING); + toep->flags &= ~TPF_CPL_PENDING; - if (toepcb_flag(toep, TPF_ATTACHED) == 0) + if (!(toep->flags & TPF_ATTACHED)) release_offload_resources(toep); if (!in_pcbrele_wlocked(inp)) Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug 21 18:30:16 2012 (r239514) @@ -55,17 +55,17 @@ /* TOE PCB flags */ enum { - TPF_ATTACHED, /* a tcpcb refers to this toepcb */ - TPF_FLOWC_WR_SENT, /* firmware flow context WR sent */ - TPF_TX_DATA_SENT, /* some data sent */ - TPF_TX_SUSPENDED, /* tx suspended for lack of resources */ - TPF_SEND_FIN, /* send FIN after sending all pending data */ - TPF_FIN_SENT, /* FIN has been sent */ - TPF_ABORT_SHUTDOWN, /* connection abort is in progress */ - TPF_CPL_PENDING, /* haven't received the last CPL */ - TPF_SYNQE, /* synq_entry, not really a toepcb */ - TPF_SYNQE_NEEDFREE, /* synq_entry was allocated externally */ - TPF_SYNQE_TCPDDP, /* ulp_mode TCPDDP when toepcb is allocated */ + TPF_ATTACHED = (1 << 0), /* a tcpcb refers to this toepcb */ + TPF_FLOWC_WR_SENT = (1 << 1), /* firmware flow context WR sent */ + TPF_TX_DATA_SENT = (1 << 2), /* some data sent */ + TPF_TX_SUSPENDED = (1 << 3), /* tx suspended for lack of resources */ + TPF_SEND_FIN = (1 << 4), /* send FIN after all pending data */ + TPF_FIN_SENT = (1 << 5), /* FIN has been sent */ + TPF_ABORT_SHUTDOWN = (1 << 6), /* connection abort is in progress */ + TPF_CPL_PENDING = (1 << 7), /* haven't received the last CPL */ + TPF_SYNQE = (1 << 8), /* synq_entry, not really a toepcb */ + TPF_SYNQE_NEEDFREE = (1 << 9), /* synq_entry was malloc'd separately */ + TPF_SYNQE_TCPDDP = (1 << 10), /* ulp_mode TCPDDP in toepcb */ }; enum { @@ -134,27 +134,6 @@ struct flowc_tx_params { unsigned int mss; }; -static inline int -toepcb_flag(struct toepcb *toep, int flag) -{ - - return isset(&toep->flags, flag); -} - -static inline void -toepcb_set_flag(struct toepcb *toep, int flag) -{ - - setbit(&toep->flags, flag); -} - -static inline void -toepcb_clr_flag(struct toepcb *toep, int flag) -{ - - clrbit(&toep->flags, flag); -} - #define DDP_RETRY_WAIT 5 /* seconds to wait before re-enabling DDP */ #define DDP_LOW_SCORE 1 #define DDP_HIGH_SCORE 3 @@ -186,27 +165,6 @@ struct synq_entry { uint16_t rcv_bufsize; }; -static inline int -synqe_flag(struct synq_entry *synqe, int flag) -{ - - return isset(&synqe->flags, flag); -} - -static inline void -synqe_set_flag(struct synq_entry *synqe, int flag) -{ - - setbit(&synqe->flags, flag); -} - -static inline void -synqe_clr_flag(struct synq_entry *synqe, int flag) -{ - - clrbit(&synqe->flags, flag); -} - /* listen_ctx flags */ #define LCTX_RPL_PENDING 1 /* waiting for a CPL_PASS_OPEN_RPL */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 18:41:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 630E6106566C; Tue, 21 Aug 2012 18:41:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 447C78FC16; Tue, 21 Aug 2012 18:41:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LIfddI084833; Tue, 21 Aug 2012 18:41:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LIfdtO084831; Tue, 21 Aug 2012 18:41:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208211841.q7LIfdtO084831@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Aug 2012 18:41: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: r239515 - 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, 21 Aug 2012 18:41:39 -0000 Author: jhb Date: Tue Aug 21 18:41:38 2012 New Revision: 239515 URL: http://svn.freebsd.org/changeset/base/239515 Log: Add a manpage for BUS_CHILD_DETACHED(). Added: head/share/man/man9/BUS_CHILD_DETACHED.9 (contents, props changed) Modified: head/share/man/man9/Makefile Added: head/share/man/man9/BUS_CHILD_DETACHED.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/BUS_CHILD_DETACHED.9 Tue Aug 21 18:41:38 2012 (r239515) @@ -0,0 +1,52 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2012 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" 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$ +.\" +.Dd August 21, 2012 +.Dt BUS_CHILD_DETACHED 9 +.Os +.Sh NAME +.Nm BUS_CHILD_DETACHED +.Nd "notify a bus device that a child was detached" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn BUS_CHILD_DETACHED "device_t dev" "device_t child" +.Sh DESCRIPTION +The +.Fn BUS_CHILD_DETACHED +method is invoked by the new-bus framework after a device is detached. +A bus driver can provide an implementation of this method to +reclaim any resources allocated on behalf of the child or +to cleanup state not properly released by a +.Xr DEVICE_DETACH 9 +method. +.Sh SEE ALSO +.Xr device 9 , +.Xr DEVICE_DETACH 9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Aug 21 18:30:16 2012 (r239514) +++ head/share/man/man9/Makefile Tue Aug 21 18:41:38 2012 (r239515) @@ -27,6 +27,7 @@ MAN= accept_filter.9 \ BUS_BIND_INTR.9 \ bus_child_present.9 \ BUS_CHILD_DELETED.9 \ + BUS_CHILD_DETACHED.9 \ BUS_CONFIG_INTR.9 \ BUS_DESCRIBE_INTR.9 \ bus_dma.9 \ From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 18:45:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52CE2106564A; Tue, 21 Aug 2012 18:45:56 +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 3D8848FC18; Tue, 21 Aug 2012 18:45:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LIju6I085428; Tue, 21 Aug 2012 18:45:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LIju1F085425; Tue, 21 Aug 2012 18:45:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211845.q7LIju1F085425@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 18:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239516 - stable/9/sbin/camcontrol 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, 21 Aug 2012 18:45:56 -0000 Author: dim Date: Tue Aug 21 18:45:55 2012 New Revision: 239516 URL: http://svn.freebsd.org/changeset/base/239516 Log: MFC r239059: In sbin/camcontrol/camcontrol.c, function smpcmd(), initialize the 'error' variable to zero, to avoid returning garbage in several cases. Modified: stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Tue Aug 21 18:41:38 2012 (r239515) +++ stable/9/sbin/camcontrol/camcontrol.c Tue Aug 21 18:45:55 2012 (r239516) @@ -4463,7 +4463,7 @@ static int smpcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { - int c, error; + int c, error = 0; union ccb *ccb; uint8_t *smp_request = NULL, *smp_response = NULL; int request_size = 0, response_size = 0; From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 18:50:16 2012 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 2B54A106566C; Tue, 21 Aug 2012 18:50:16 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id D90798FC17; Tue, 21 Aug 2012 18:50:15 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q7LIoE9j030854; Tue, 21 Aug 2012 12:50:14 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q7LIoEE4030850; Tue, 21 Aug 2012 12:50:14 -0600 (MDT) (envelope-from ken) Date: Tue, 21 Aug 2012 12:50:14 -0600 From: "Kenneth D. Merry" To: Gleb Smirnoff Message-ID: <20120821185014.GA28272@nargothrond.kdm.org> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208021357.q72DvoFJ088426@svn.freebsd.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238990 - in head/sys: net netinet netinet6 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, 21 Aug 2012 18:50:16 -0000 On Thu, Aug 02, 2012 at 13:57:50 +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Aug 2 13:57:49 2012 > New Revision: 238990 > URL: http://svn.freebsd.org/changeset/base/238990 > > Log: > Fix races between in_lltable_prefix_free(), lla_lookup(), > llentry_free() and arptimer(): > > o Use callout_init_rw() for lle timeout, this allows us safely > disestablish them. > - This allows us to simplify the arptimer() and make it > race safe. > o Consistently use ifp->if_afdata_lock to lock access to > linked lists in the lle hashes. > o Introduce new lle flag LLE_LINKED, which marks an entry that > is attached to the hash. > - Use LLE_LINKED to avoid double unlinking via consequent > calls to llentry_free(). > - Mark lle with LLE_DELETED via |= operation istead of =, > so that other flags won't be lost. > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more > consistent and provide more informative KASSERTs. > > The patch is a collaborative work of all submitters and myself. > > PR: kern/165863 > Submitted by: Andrey Zonov > Submitted by: Ryan Stone > Submitted by: Eric van Gyzen I'm running into this on stable/9, any plan on when this will get MFCed? Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x360 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff808c74c2 stack pointer = 0x28:0xffffff83e3f5d140 frame pointer = 0x28:0xffffff83e3f5d1a0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (irq265: igb0:que 0) [ thread pid 12 tid 100047 ] Stopped at 0xffffffff808c74c2 = _rw_rlock+0xf2: movl 0x360(%rcx),%edi db> bt Tracing pid 12 tid 100047 td 0xfffffe000d57c8e0 _rw_rlock() at 0xffffffff808c74c2 = _rw_rlock+0xf2 in_lltable_lookup() at 0xffffffff809e716c = in_lltable_lookup+0x4ac arpresolve() at 0xffffffff809dfe66 = arpresolve+0x116 ether_output() at 0xffffffff8098905f = ether_output+0x25f ip_output() at 0xffffffff809f73a9 = ip_output+0xc79 tcp_output() at 0xffffffff80a651dd = tcp_output+0xb0d tcp_do_segment() at 0xffffffff80a60213 = tcp_do_segment+0xb63 tcp_input() at 0xffffffff80a63148 = tcp_input+0xaf8 ip_input() at 0xffffffff809f447c = ip_input+0xac netisr_dispatch_src() at 0xffffffff8099346b = netisr_dispatch_src+0x20b ether_demux() at 0xffffffff8098890d = ether_demux+0x14d ether_nh_input() at 0xffffffff80988be4 = ether_nh_input+0x1f4 netisr_dispatch_src() at 0xffffffff8099346b = netisr_dispatch_src+0x20b igb_rxeof() at 0xffffffff8179d034 = igb_rxeof+0x394 igb_msix_que() at 0xffffffff8179d3ca = igb_msix_que+0xaa intr_event_execute_handlers() at 0xffffffff8089bdd4 = intr_event_execute_handlers+0x104 ithread_loop() at 0xffffffff8089d594 = ithread_loop+0xa4 fork_exit() at 0xffffffff8089847f = fork_exit+0x11f fork_trampoline() at 0xffffffff80bb970e = fork_trampoline+0xe --- trap 0, rip = 0, rsp = 0xffffff83e3f5dbb0, rbp = 0 --- Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 18:55:20 2012 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 1C2CD106566C; Tue, 21 Aug 2012 18:55:20 +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 074C28FC0C; Tue, 21 Aug 2012 18:55:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LItJRc086856; Tue, 21 Aug 2012 18:55:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LItJcR086854; Tue, 21 Aug 2012 18:55:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211855.q7LItJcR086854@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 18:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239517 - stable/9/usr.bin/make 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, 21 Aug 2012 18:55:20 -0000 Author: dim Date: Tue Aug 21 18:55:19 2012 New Revision: 239517 URL: http://svn.freebsd.org/changeset/base/239517 Log: MFC r239071: In usr.bin/make/var.c, function ParseModifier(), initialize the 'error' variable to NULL, to avoid using it uninitialized in certain cases. Modified: stable/9/usr.bin/make/var.c Directory Properties: stable/9/usr.bin/make/ (props changed) Modified: stable/9/usr.bin/make/var.c ============================================================================== --- stable/9/usr.bin/make/var.c Tue Aug 21 18:45:55 2012 (r239516) +++ stable/9/usr.bin/make/var.c Tue Aug 21 18:55:19 2012 (r239517) @@ -1765,7 +1765,7 @@ ParseModifier(VarParser *vp, char startc if ((vp->ptr[0] == 's') && (vp->ptr[1] == 'h') && (vp->ptr[2] == endc || vp->ptr[2] == ':')) { - const char *error; + const char *error = NULL; if (vp->execute) { newStr = Buf_Peel( From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:03:04 2012 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 BDF381065673; Tue, 21 Aug 2012 19:03:04 +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 A3CED8FC26; Tue, 21 Aug 2012 19:03:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJ340s088019; Tue, 21 Aug 2012 19:03:04 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJ34uo088017; Tue, 21 Aug 2012 19:03:04 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211903.q7LJ34uo088017@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 19:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239518 - stable/9/usr.sbin/ctladm 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, 21 Aug 2012 19:03:04 -0000 Author: dim Date: Tue Aug 21 19:03:04 2012 New Revision: 239518 URL: http://svn.freebsd.org/changeset/base/239518 Log: MFC r239074: In usr.sbin/ctladm/ctladm.c, function cctl_error_inject(), initialize the 'retval' variable to zero, to avoid returning garbage in several cases. Modified: stable/9/usr.sbin/ctladm/ctladm.c Directory Properties: stable/9/usr.sbin/ctladm/ (props changed) Modified: stable/9/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.c Tue Aug 21 18:55:19 2012 (r239517) +++ stable/9/usr.sbin/ctladm/ctladm.c Tue Aug 21 19:03:04 2012 (r239518) @@ -1026,7 +1026,7 @@ static int cctl_error_inject(int fd, uint32_t target, uint32_t lun, int argc, char **argv, char *combinedopt) { - int retval; + int retval = 0; struct ctl_error_desc err_desc; uint64_t lba = 0; uint32_t len = 0; From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:07:28 2012 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 AB1F0106566B; Tue, 21 Aug 2012 19:07:28 +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 974188FC1F; Tue, 21 Aug 2012 19:07:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJ7SUG088604; Tue, 21 Aug 2012 19:07:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJ7Smo088602; Tue, 21 Aug 2012 19:07:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208211907.q7LJ7Smo088602@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Aug 2012 19:07: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: r239519 - 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: Tue, 21 Aug 2012 19:07:28 -0000 Author: jhb Date: Tue Aug 21 19:07:28 2012 New Revision: 239519 URL: http://svn.freebsd.org/changeset/base/239519 Log: Fix a silly grammar bogon. Submitted by: Stephen McKay Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Aug 21 19:03:04 2012 (r239518) +++ head/sys/net/if_vlan.c Tue Aug 21 19:07:28 2012 (r239519) @@ -1339,7 +1339,7 @@ vlan_unconfig_locked(struct ifnet *ifp, while ((mc = SLIST_FIRST(&ifv->vlan_mc_listhead)) != NULL) { /* * If the parent interface is being detached, - * all it's multicast addresses have already + * all its multicast addresses have already * been removed. Warn about errors if * if_delmulti() does fail, but don't abort as * all callers expect vlan destruction to From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:11:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 354D6106566C; Tue, 21 Aug 2012 19:11:13 +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 1F8A88FC0A; Tue, 21 Aug 2012 19:11:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJBC34089141; Tue, 21 Aug 2012 19:11:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJBC1U089139; Tue, 21 Aug 2012 19:11:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211911.q7LJBC1U089139@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 19:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239520 - stable/9/lib/libpam/modules/pam_krb5 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, 21 Aug 2012 19:11:13 -0000 Author: dim Date: Tue Aug 21 19:11:12 2012 New Revision: 239520 URL: http://svn.freebsd.org/changeset/base/239520 Log: MFC r239099: Fix two instances in pam_krb5(8), where the variable 'princ_name' could be used uninitialized. Found by: clang 3.2 Reviewed by: des Modified: stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c Directory Properties: stable/9/lib/libpam/ (props changed) Modified: stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c ============================================================================== --- stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c Tue Aug 21 19:07:28 2012 (r239519) +++ stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c Tue Aug 21 19:11:12 2012 (r239520) @@ -320,11 +320,11 @@ cleanup: PAM_LOG("Done cleanup"); cleanup2: krb5_free_principal(pam_context, princ); - PAM_LOG("Done cleanup2"); -cleanup3: if (princ_name) free(princ_name); + PAM_LOG("Done cleanup2"); +cleanup3: krb5_free_context(pam_context); PAM_LOG("Done cleanup3"); @@ -779,11 +779,11 @@ cleanup: PAM_LOG("Done cleanup"); cleanup2: krb5_free_principal(pam_context, princ); - PAM_LOG("Done cleanup2"); -cleanup3: if (princ_name) free(princ_name); + PAM_LOG("Done cleanup2"); +cleanup3: krb5_free_context(pam_context); PAM_LOG("Done cleanup3"); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:13:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C9D5106566C; Tue, 21 Aug 2012 19:13:54 +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 149868FC0A; Tue, 21 Aug 2012 19:13:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJDrnT089540; Tue, 21 Aug 2012 19:13:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJDrGd089538; Tue, 21 Aug 2012 19:13:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211913.q7LJDrGd089538@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 19:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239521 - stable/9/lib/libpam/modules/pam_unix 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, 21 Aug 2012 19:13:54 -0000 Author: dim Date: Tue Aug 21 19:13:53 2012 New Revision: 239521 URL: http://svn.freebsd.org/changeset/base/239521 Log: MFC r239100: Fix an instance in pam_krb5(8), where the variable 'user' could be used uninitialized. Found by: clang 3.2 Reviewed by: des Modified: stable/9/lib/libpam/modules/pam_unix/pam_unix.c Directory Properties: stable/9/lib/libpam/ (props changed) Modified: stable/9/lib/libpam/modules/pam_unix/pam_unix.c ============================================================================== --- stable/9/lib/libpam/modules/pam_unix/pam_unix.c Tue Aug 21 19:11:12 2012 (r239520) +++ stable/9/lib/libpam/modules/pam_unix/pam_unix.c Tue Aug 21 19:13:53 2012 (r239521) @@ -96,13 +96,13 @@ pam_sm_authenticate(pam_handle_t *pamh, const char *pass, *user, *realpw, *prompt; if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) { - pwd = getpwnam(getlogin()); + user = getlogin(); } else { retval = pam_get_user(pamh, &user, NULL); if (retval != PAM_SUCCESS) return (retval); - pwd = getpwnam(user); } + pwd = getpwnam(user); PAM_LOG("Got user: %s", user); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:19:29 2012 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 A5EA81065670; Tue, 21 Aug 2012 19:19:29 +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 908478FC14; Tue, 21 Aug 2012 19:19:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJJTCx090333; Tue, 21 Aug 2012 19:19:29 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJJTSV090330; Tue, 21 Aug 2012 19:19:29 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211919.q7LJJTSV090330@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 19:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239522 - stable/9/sys/dev/cxgb/ulp/iw_cxgb 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, 21 Aug 2012 19:19:29 -0000 Author: dim Date: Tue Aug 21 19:19:29 2012 New Revision: 239522 URL: http://svn.freebsd.org/changeset/base/239522 Log: MFC r239101: In cxgb(4), in function iwch_reregister_phys_mem(), initialize the 'npages' variable to zero, to avoid using it uninitialized in certain cases. Found by: clang 3.2 Reviewed by: np Modified: stable/9/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c ============================================================================== --- stable/9/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Tue Aug 21 19:13:53 2012 (r239521) +++ stable/9/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Tue Aug 21 19:19:29 2012 (r239522) @@ -487,7 +487,7 @@ static int iwch_reregister_phys_mem(stru __be64 *page_list = NULL; int shift = 0; u64 total_size; - int npages; + int npages = 0; int ret; CTR3(KTR_IW_CXGB, "%s ib_mr %p ib_pd %p", __FUNCTION__, mr, pd); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:21:46 2012 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 DE6851065672; Tue, 21 Aug 2012 19:21:46 +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 C956C8FC14; Tue, 21 Aug 2012 19:21:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJLk6Q090681; Tue, 21 Aug 2012 19:21:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJLk4H090679; Tue, 21 Aug 2012 19:21:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211921.q7LJLk4H090679@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 19:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239523 - stable/9/sys/dev/cxgbe/firmware 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, 21 Aug 2012 19:21:47 -0000 Author: dim Date: Tue Aug 21 19:21:46 2012 New Revision: 239523 URL: http://svn.freebsd.org/changeset/base/239523 Log: MFC r239102: In sys/dev/cxgbe/firmware/t4fw_interface.h, change the enum 'fw_hdr_intfver' into an anonymous enum, which avoids a clang 3.2 warning about all the enum values being the same value. Reviewed by: np Modified: stable/9/sys/dev/cxgbe/firmware/t4fw_interface.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- stable/9/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Aug 21 19:19:29 2012 (r239522) +++ stable/9/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Aug 21 19:21:46 2012 (r239523) @@ -7413,7 +7413,7 @@ enum fw_hdr_chip { #define G_FW_HDR_FW_VER_BUILD(x) \ (((x) >> S_FW_HDR_FW_VER_BUILD) & M_FW_HDR_FW_VER_BUILD) -enum fw_hdr_intfver { +enum { FW_HDR_INTFVER_NIC = 0x00, FW_HDR_INTFVER_VNIC = 0x00, FW_HDR_INTFVER_OFLD = 0x00, From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:24:39 2012 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 B5CA61065677; Tue, 21 Aug 2012 19:24:39 +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 A001C8FC1E; Tue, 21 Aug 2012 19:24:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJOdQ7091108; Tue, 21 Aug 2012 19:24:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJOdEd091105; Tue, 21 Aug 2012 19:24:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211924.q7LJOdEd091105@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 19:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239524 - stable/9/sys/dev/aic7xxx 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, 21 Aug 2012 19:24:39 -0000 Author: dim Date: Tue Aug 21 19:24:39 2012 New Revision: 239524 URL: http://svn.freebsd.org/changeset/base/239524 Log: MFC r239104: In sys/dev/aic7xxx/aic79xx_osm.c, function ahd_attach(), initialize the 'path' variable to NULL, to avoid using it uninitialized in certain cases. Found by: clang 3.2 Modified: stable/9/sys/dev/aic7xxx/aic79xx_osm.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/aic7xxx/aic79xx_osm.c ============================================================================== --- stable/9/sys/dev/aic7xxx/aic79xx_osm.c Tue Aug 21 19:21:46 2012 (r239523) +++ stable/9/sys/dev/aic7xxx/aic79xx_osm.c Tue Aug 21 19:24:39 2012 (r239524) @@ -222,6 +222,7 @@ ahd_attach(struct ahd_softc *ahd) count = 0; devq = NULL; sim = NULL; + path = NULL; /* * Create a thread to perform all recovery. From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:26:50 2012 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 4A02B106566B; Tue, 21 Aug 2012 19:26:50 +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 345038FC12; Tue, 21 Aug 2012 19:26:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJQoH6091437; Tue, 21 Aug 2012 19:26:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJQoeH091435; Tue, 21 Aug 2012 19:26:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211926.q7LJQoeH091435@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 19:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239525 - stable/9/sbin/ggate/shared 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, 21 Aug 2012 19:26:50 -0000 Author: dim Date: Tue Aug 21 19:26:49 2012 New Revision: 239525 URL: http://svn.freebsd.org/changeset/base/239525 Log: MFC r239106: Make sure the compiler knows g_gate_xvlog() and g_gate_xlog() do not return. This silences a warning from clang 3.2 about uninitialized use of the variable 'mediasize' in sbin/ggate/shared/ggate.c. Reviewed by: pjd Modified: stable/9/sbin/ggate/shared/ggate.h Directory Properties: stable/9/sbin/ (props changed) Modified: stable/9/sbin/ggate/shared/ggate.h ============================================================================== --- stable/9/sbin/ggate/shared/ggate.h Tue Aug 21 19:24:39 2012 (r239524) +++ stable/9/sbin/ggate/shared/ggate.h Tue Aug 21 19:26:49 2012 (r239525) @@ -95,8 +95,8 @@ struct g_gate_hdr { void g_gate_vlog(int priority, const char *message, va_list ap); void g_gate_log(int priority, const char *message, ...); -void g_gate_xvlog(const char *message, va_list ap); -void g_gate_xlog(const char *message, ...); +void g_gate_xvlog(const char *message, va_list ap) __dead2; +void g_gate_xlog(const char *message, ...) __dead2; off_t g_gate_mediasize(int fd); unsigned g_gate_sectorsize(int fd); void g_gate_open_device(void); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:32:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D17D01065670; Tue, 21 Aug 2012 19:32:55 +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 A41598FC22; Tue, 21 Aug 2012 19:32:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJWt7o092517; Tue, 21 Aug 2012 19:32:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJWtis092516; Tue, 21 Aug 2012 19:32:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211932.q7LJWtis092516@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 19:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239526 - in stable/9/sbin: . ggate 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, 21 Aug 2012 19:32:56 -0000 Author: dim Date: Tue Aug 21 19:32:55 2012 New Revision: 239526 URL: http://svn.freebsd.org/changeset/base/239526 Log: Move erroneous Subversion merge info for r239106 from sbin to sbin/ggate. Modified: Directory Properties: stable/9/sbin/ (props changed) stable/9/sbin/ggate/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:39:10 2012 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 1354D106564A; Tue, 21 Aug 2012 19:39:10 +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 D8AB48FC12; Tue, 21 Aug 2012 19:39:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJd9Nc093496; Tue, 21 Aug 2012 19:39:09 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJd96B093494; Tue, 21 Aug 2012 19:39:09 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208211939.q7LJd96B093494@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 19:39: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: r239527 - head/sys/dev/cxgbe/tom 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, 21 Aug 2012 19:39:10 -0000 Author: np Date: Tue Aug 21 19:39:09 2012 New Revision: 239527 URL: http://svn.freebsd.org/changeset/base/239527 Log: Cannot hold a mutex around vm_fault_quick_hold_pages, so don't. Tweak some comments while here. Modified: head/sys/dev/cxgbe/tom/t4_ddp.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 21 19:32:55 2012 (r239526) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 21 19:39:09 2012 (r239527) @@ -769,7 +769,9 @@ write_page_pods(struct adapter *sc, stru } /* - * Reuse, or allocate (and program the page pods for) a new DDP buffer. + * Reuse, or allocate (and program the page pods for) a new DDP buffer. The + * "pages" array is handed over to this function and should not be used in any + * way by the caller after that. */ static int select_ddp_buffer(struct adapter *sc, struct toepcb *toep, vm_page_t *pages, @@ -843,13 +845,6 @@ unwire_ddp_buffer(struct ddp_buffer *db) } } -static inline void -unhold_ddp_buffer(struct ddp_buffer *db) -{ - - vm_page_unhold_pages(db->pages, db->npages); -} - static int handle_ddp(struct socket *so, struct uio *uio, int flags, int error) { @@ -883,15 +878,24 @@ handle_ddp(struct socket *so, struct uio * Fault in and then hold the pages of the uio buffers. We'll wire them * a bit later if everything else works out. */ - if (hold_uio(uio, &pages, &npages) != 0) + SOCKBUF_UNLOCK(sb); + if (hold_uio(uio, &pages, &npages) != 0) { + SOCKBUF_LOCK(sb); goto no_ddp; + } + SOCKBUF_LOCK(sb); + if (__predict_false(so->so_error || sb->sb_state & SBS_CANTRCVMORE)) { + vm_page_unhold_pages(pages, npages); + free(pages, M_CXGBE); + goto no_ddp; + } /* * Figure out which one of the two DDP buffers to use this time. */ db_idx = select_ddp_buffer(sc, toep, pages, npages, (uintptr_t)uio->uio_iov->iov_base & PAGE_MASK, uio->uio_resid); - pages = NULL; /* pages either in use elsewhere or unheld + freed */ + pages = NULL; /* handed off to select_ddp_buffer */ if (db_idx < 0) goto no_ddp; db = toep->db[db_idx]; @@ -904,11 +908,17 @@ handle_ddp(struct socket *so, struct uio ddp_flags = select_ddp_flags(so, flags, db_idx); wr = mk_update_tcb_for_ddp(sc, toep, db_idx, sb->sb_cc, ddp_flags); if (wr == NULL) { - unhold_ddp_buffer(db); + /* + * Just unhold the pages. The DDP buffer's software state is + * left as-is in the toep. The page pods were written + * successfully and we may have an opportunity to use it in the + * future. + */ + vm_page_unhold_pages(db->pages, db->npages); goto no_ddp; } - /* Wire the pages and give the chip the go-ahead. */ + /* Wire (and then unhold) the pages, and give the chip the go-ahead. */ wire_ddp_buffer(db); t4_wrq_tx(sc, wr); sb->sb_flags &= ~SB_DDP_INDICATE; From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:45:20 2012 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 48D071065679; Tue, 21 Aug 2012 19:45:20 +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 33D4D8FC08; Tue, 21 Aug 2012 19:45:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJjKl7094326; Tue, 21 Aug 2012 19:45:20 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJjKLm094324; Tue, 21 Aug 2012 19:45:20 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208211945.q7LJjKLm094324@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 19:45: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: r239528 - head/sys/dev/cxgbe/tom 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, 21 Aug 2012 19:45:20 -0000 Author: np Date: Tue Aug 21 19:45:19 2012 New Revision: 239528 URL: http://svn.freebsd.org/changeset/base/239528 Log: Avoid a NULL pointer dereference. Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 21 19:39:09 2012 (r239527) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 21 19:45:19 2012 (r239528) @@ -1007,8 +1007,8 @@ do_abort_req(struct sge_iq *iq, const st CTR6(KTR_CXGBE, "%s: tid %d (%s), toep_flags 0x%x, inp_flags 0x%x, status %d", - __func__, tid, tcpstates[tp->t_state], toep->flags, inp->inp_flags, - cpl->status); + __func__, tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags, + inp->inp_flags, cpl->status); /* * If we'd initiated an abort earlier the reply to it is responsible for From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:45:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD9311065688; Tue, 21 Aug 2012 19:45:48 +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 9D8778FC17; Tue, 21 Aug 2012 19:45:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJjmkh094424; Tue, 21 Aug 2012 19:45:48 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJjmr1094417; Tue, 21 Aug 2012 19:45:48 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211945.q7LJjmr1094417@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 19:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239529 - stable/9/lib/msun/src 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, 21 Aug 2012 19:45:49 -0000 Author: dim Date: Tue Aug 21 19:45:48 2012 New Revision: 239529 URL: http://svn.freebsd.org/changeset/base/239529 Log: MFC r239192: Change a few extern inline functions in libm to static inline, since they need to refer to static constants, which C99 does not allow for extern inline functions. While here, change a comment in e_rem_pio2f.c to mention the correct number of bits. Reviewed by: bde MFC r239195: Add __always_inline to __ieee754_rem_pio2() and __ieee754_rem_pio2f(), since some older versions of gcc refuse to inline these otherwise. Requested by: bde Modified: stable/9/lib/msun/src/e_rem_pio2.c stable/9/lib/msun/src/e_rem_pio2f.c stable/9/lib/msun/src/k_cosf.c stable/9/lib/msun/src/k_sinf.c stable/9/lib/msun/src/k_tanf.c stable/9/lib/msun/src/math_private.h Directory Properties: stable/9/lib/msun/ (props changed) Modified: stable/9/lib/msun/src/e_rem_pio2.c ============================================================================== --- stable/9/lib/msun/src/e_rem_pio2.c Tue Aug 21 19:45:19 2012 (r239528) +++ stable/9/lib/msun/src/e_rem_pio2.c Tue Aug 21 19:45:48 2012 (r239529) @@ -48,10 +48,10 @@ pio2_2t = 2.02226624879595063154e-21, / pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ -#ifndef INLINE_REM_PIO2 -extern +#ifdef INLINE_REM_PIO2 +static __inline __always_inline #endif -__inline int +int __ieee754_rem_pio2(double x, double *y) { double z,w,t,r,fn; Modified: stable/9/lib/msun/src/e_rem_pio2f.c ============================================================================== --- stable/9/lib/msun/src/e_rem_pio2f.c Tue Aug 21 19:45:19 2012 (r239528) +++ stable/9/lib/msun/src/e_rem_pio2f.c Tue Aug 21 19:45:48 2012 (r239529) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); /* * invpio2: 53 bits of 2/pi - * pio2_1: first 33 bit of pi/2 + * pio2_1: first 25 bits of pi/2 * pio2_1t: pi/2 - pio2_1 */ @@ -40,10 +40,10 @@ invpio2 = 6.36619772367581382433e-01, / pio2_1 = 1.57079631090164184570e+00, /* 0x3FF921FB, 0x50000000 */ pio2_1t = 1.58932547735281966916e-08; /* 0x3E5110b4, 0x611A6263 */ -#ifndef INLINE_REM_PIO2F -extern +#ifdef INLINE_REM_PIO2F +static __inline __always_inline #endif -__inline int +int __ieee754_rem_pio2f(float x, double *y) { double w,r,fn; Modified: stable/9/lib/msun/src/k_cosf.c ============================================================================== --- stable/9/lib/msun/src/k_cosf.c Tue Aug 21 19:45:19 2012 (r239528) +++ stable/9/lib/msun/src/k_cosf.c Tue Aug 21 19:45:48 2012 (r239529) @@ -30,10 +30,10 @@ C1 = 0x155553e1053a42.0p-57, /* 0.041 C2 = -0x16c087e80f1e27.0p-62, /* -0.00138867637746099294692 */ C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */ -#ifndef INLINE_KERNEL_COSDF -extern +#ifdef INLINE_KERNEL_COSDF +static __inline #endif -__inline float +float __kernel_cosdf(double x) { double r, w, z; Modified: stable/9/lib/msun/src/k_sinf.c ============================================================================== --- stable/9/lib/msun/src/k_sinf.c Tue Aug 21 19:45:19 2012 (r239528) +++ stable/9/lib/msun/src/k_sinf.c Tue Aug 21 19:45:48 2012 (r239529) @@ -29,10 +29,10 @@ S2 = 0x111110896efbb2.0p-59, /* 0.0083 S3 = -0x1a00f9e2cae774.0p-65, /* -0.000198393348360966317347 */ S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */ -#ifndef INLINE_KERNEL_SINDF -extern +#ifdef INLINE_KERNEL_SINDF +static __inline #endif -__inline float +float __kernel_sindf(double x) { double r, s, w, z; Modified: stable/9/lib/msun/src/k_tanf.c ============================================================================== --- stable/9/lib/msun/src/k_tanf.c Tue Aug 21 19:45:19 2012 (r239528) +++ stable/9/lib/msun/src/k_tanf.c Tue Aug 21 19:45:48 2012 (r239529) @@ -32,10 +32,10 @@ T[] = { 0x1362b9bf971bcd.0p-59, /* 0.00946564784943673166728 */ }; -#ifndef INLINE_KERNEL_TANDF -extern +#ifdef INLINE_KERNEL_TANDF +static __inline #endif -__inline float +float __kernel_tandf(double x, int iy) { double z,r,w,s,t,u; Modified: stable/9/lib/msun/src/math_private.h ============================================================================== --- stable/9/lib/msun/src/math_private.h Tue Aug 21 19:45:19 2012 (r239528) +++ stable/9/lib/msun/src/math_private.h Tue Aug 21 19:45:48 2012 (r239529) @@ -371,31 +371,26 @@ irint(double x) int __kernel_rem_pio2(double*,double*,int,int,int); /* double precision kernel functions */ -#ifdef INLINE_REM_PIO2 -__inline -#endif +#ifndef INLINE_REM_PIO2 int __ieee754_rem_pio2(double,double*); +#endif double __kernel_sin(double,double,int); double __kernel_cos(double,double); double __kernel_tan(double,double,int); /* float precision kernel functions */ -#ifdef INLINE_REM_PIO2F -__inline -#endif +#ifndef INLINE_REM_PIO2F int __ieee754_rem_pio2f(float,double*); -#ifdef INLINE_KERNEL_SINDF -__inline #endif +#ifndef INLINE_KERNEL_SINDF float __kernel_sindf(double); -#ifdef INLINE_KERNEL_COSDF -__inline #endif +#ifndef INLINE_KERNEL_COSDF float __kernel_cosdf(double); -#ifdef INLINE_KERNEL_TANDF -__inline #endif +#ifndef INLINE_KERNEL_TANDF float __kernel_tandf(double,int); +#endif /* long double precision kernel functions */ long double __kernel_sinl(long double, long double, int); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 19:55:25 2012 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 2BADF1065676; Tue, 21 Aug 2012 19:55:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 172C28FC16; Tue, 21 Aug 2012 19:55:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LJtOVt095791; Tue, 21 Aug 2012 19:55:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJtOO3095789; Tue, 21 Aug 2012 19:55:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208211955.q7LJtOO3095789@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 Aug 2012 19:55: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: r239530 - head/sys/arm/at91 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, 21 Aug 2012 19:55:25 -0000 Author: hselasky Date: Tue Aug 21 19:55:24 2012 New Revision: 239530 URL: http://svn.freebsd.org/changeset/base/239530 Log: Make some at91_pcm_xxx() functions NULL safe. Modified: head/sys/arm/at91/at91_pmc.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Tue Aug 21 19:45:48 2012 (r239529) +++ head/sys/arm/at91/at91_pmc.c Tue Aug 21 19:55:24 2012 (r239530) @@ -369,12 +369,15 @@ at91_pmc_clock_ref(const char *name) void at91_pmc_clock_deref(struct at91_pmc_clock *clk) { - + if (clk == NULL) + return; } void at91_pmc_clock_enable(struct at91_pmc_clock *clk) { + if (clk == NULL) + return; /* XXX LOCKING? XXX */ if (clk->parent) @@ -386,6 +389,8 @@ at91_pmc_clock_enable(struct at91_pmc_cl void at91_pmc_clock_disable(struct at91_pmc_clock *clk) { + if (clk == NULL) + return; /* XXX LOCKING? XXX */ if (--clk->refcnt == 0 && clk->set_mode) From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 20:11:00 2012 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 916481065673; Tue, 21 Aug 2012 20:11:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C7A68FC0A; Tue, 21 Aug 2012 20:11:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LKB0oe098007; Tue, 21 Aug 2012 20:11:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LKB0Hs098002; Tue, 21 Aug 2012 20:11:00 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208212011.q7LKB0Hs098002@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 Aug 2012 20:11: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: r239531 - head/sys/dev/usb/controller 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, 21 Aug 2012 20:11:00 -0000 Author: hselasky Date: Tue Aug 21 20:10:59 2012 New Revision: 239531 URL: http://svn.freebsd.org/changeset/base/239531 Log: Fix USB drivers for KB920X target. Add missing clock settings. VBUS GPIO IRQ is still missing (TODO). Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/ohci_atmelarm.c Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 21 19:55:24 2012 (r239530) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 21 20:10:59 2012 (r239531) @@ -80,6 +80,7 @@ static device_detach_t at91_udp_detach; struct at91_udp_softc { struct at91dci_softc sc_dci; /* must be first */ + struct at91_pmc_clock *sc_mclk; struct at91_pmc_clock *sc_iclk; struct at91_pmc_clock *sc_fclk; struct resource *sc_vbus_irq_res; @@ -107,6 +108,7 @@ at91_udp_clocks_on(void *arg) { struct at91_udp_softc *sc = arg; + at91_pmc_clock_enable(sc->sc_mclk); at91_pmc_clock_enable(sc->sc_iclk); at91_pmc_clock_enable(sc->sc_fclk); } @@ -118,6 +120,7 @@ at91_udp_clocks_off(void *arg) at91_pmc_clock_disable(sc->sc_fclk); at91_pmc_clock_disable(sc->sc_iclk); + at91_pmc_clock_disable(sc->sc_mclk); } static void @@ -185,6 +188,7 @@ at91_udp_attach(device_t dev) /* wait 10ms for pulldown to stabilise */ usb_pause_mtx(NULL, hz / 100); + sc->sc_mclk = at91_pmc_clock_ref("mck"); sc->sc_iclk = at91_pmc_clock_ref("udc_clk"); sc->sc_fclk = at91_pmc_clock_ref("udpck"); @@ -209,8 +213,9 @@ at91_udp_attach(device_t dev) rid = 1; sc->sc_vbus_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); - if (!(sc->sc_vbus_irq_res)) { - goto error; + if (sc->sc_vbus_irq_res == NULL) { + at91_pio_gpio_set_interrupt(VBUS_BASE, VBUS_MASK, 0); + device_printf(dev, "No VBUS IRQ!"); } sc->sc_dci.sc_bus.bdev = device_add_child(dev, "usbus", -1); if (!(sc->sc_dci.sc_bus.bdev)) { @@ -230,11 +235,19 @@ at91_udp_attach(device_t dev) goto error; } #if (__FreeBSD_version >= 700031) - err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); + if (sc->sc_vbus_irq_res != NULL) { + err = bus_setup_intr(dev, sc->sc_vbus_irq_res, + INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)at91_vbus_poll, sc, + &sc->sc_vbus_intr_hdl); + } #else - err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); + if (sc->sc_vbus_irq_res != NULL) { + err = bus_setup_intr(dev, sc->sc_vbus_irq_res, + INTR_TYPE_BIO | INTR_MPSAFE, + (driver_intr_t *)at91_vbus_poll, sc, + &sc->sc_vbus_intr_hdl); + } #endif if (err) { sc->sc_vbus_intr_hdl = NULL; @@ -317,8 +330,10 @@ at91_udp_detach(device_t dev) /* disable clocks */ at91_pmc_clock_disable(sc->sc_iclk); at91_pmc_clock_disable(sc->sc_fclk); + at91_pmc_clock_disable(sc->sc_mclk); at91_pmc_clock_deref(sc->sc_fclk); at91_pmc_clock_deref(sc->sc_iclk); + at91_pmc_clock_deref(sc->sc_mclk); return (0); } Modified: head/sys/dev/usb/controller/ohci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/ohci_atmelarm.c Tue Aug 21 19:55:24 2012 (r239530) +++ head/sys/dev/usb/controller/ohci_atmelarm.c Tue Aug 21 20:10:59 2012 (r239531) @@ -69,6 +69,7 @@ static device_detach_t ohci_atmelarm_det struct at91_ohci_softc { struct ohci_softc sc_ohci; /* must be first */ + struct at91_pmc_clock *mclk; struct at91_pmc_clock *iclk; struct at91_pmc_clock *fclk; }; @@ -98,6 +99,7 @@ ohci_atmelarm_attach(device_t dev) USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) { return (ENOMEM); } + sc->mclk = at91_pmc_clock_ref("mck"); sc->iclk = at91_pmc_clock_ref("ohci_clk"); sc->fclk = at91_pmc_clock_ref("uhpck"); @@ -143,6 +145,7 @@ ohci_atmelarm_attach(device_t dev) /* * turn on the clocks from the AT91's point of view. Keep the unit in reset. */ + at91_pmc_clock_enable(sc->mclk); at91_pmc_clock_enable(sc->iclk); at91_pmc_clock_enable(sc->fclk); bus_space_write_4(sc->sc_ohci.sc_io_tag, sc->sc_ohci.sc_io_hdl, @@ -191,8 +194,10 @@ ohci_atmelarm_detach(device_t dev) at91_pmc_clock_disable(sc->fclk); at91_pmc_clock_disable(sc->iclk); + at91_pmc_clock_disable(sc->mclk); at91_pmc_clock_deref(sc->fclk); at91_pmc_clock_deref(sc->iclk); + at91_pmc_clock_deref(sc->mclk); if (sc->sc_ohci.sc_irq_res && sc->sc_ohci.sc_intr_hdl) { /* From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 20:18:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2E21106566C; Tue, 21 Aug 2012 20:18:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EAC18FC0C; Tue, 21 Aug 2012 20:18:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LKI17a098940; Tue, 21 Aug 2012 20:18:01 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LKI1rG098938; Tue, 21 Aug 2012 20:18:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208212018.q7LKI1rG098938@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 Aug 2012 20:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239532 - head/sys/dev/usb/controller 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, 21 Aug 2012 20:18:01 -0000 Author: hselasky Date: Tue Aug 21 20:18:01 2012 New Revision: 239532 URL: http://svn.freebsd.org/changeset/base/239532 Log: Style. Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 21 20:10:59 2012 (r239531) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 21 20:18:01 2012 (r239532) @@ -215,7 +215,7 @@ at91_udp_attach(device_t dev) bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_vbus_irq_res == NULL) { at91_pio_gpio_set_interrupt(VBUS_BASE, VBUS_MASK, 0); - device_printf(dev, "No VBUS IRQ!"); + device_printf(dev, "No VBUS IRQ!\n"); } sc->sc_dci.sc_bus.bdev = device_add_child(dev, "usbus", -1); if (!(sc->sc_dci.sc_bus.bdev)) { From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 20:40:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36B4B106566C; Tue, 21 Aug 2012 20:40:13 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 220758FC0A; Tue, 21 Aug 2012 20:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LKeCuw002011; Tue, 21 Aug 2012 20:40:12 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LKeCKf002008; Tue, 21 Aug 2012 20:40:12 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208212040.q7LKeCKf002008@svn.freebsd.org> From: Joel Dahl Date: Tue, 21 Aug 2012 20:40: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: r239533 - head/share/man/man3 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, 21 Aug 2012 20:40:15 -0000 Author: joel (doc committer) Date: Tue Aug 21 20:40:12 2012 New Revision: 239533 URL: http://svn.freebsd.org/changeset/base/239533 Log: Remove trailing whitespace. Modified: head/share/man/man3/pthread_getcpuclockid.3 Modified: head/share/man/man3/pthread_getcpuclockid.3 ============================================================================== --- head/share/man/man3/pthread_getcpuclockid.3 Tue Aug 21 20:18:01 2012 (r239532) +++ head/share/man/man3/pthread_getcpuclockid.3 Tue Aug 21 20:40:12 2012 (r239533) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2012 +.Dd August 21, 2012 .Dt PTHREAD_GETCPUCLOCKID 3 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:00:34 2012 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 C01FB106566B; Tue, 21 Aug 2012 21:00:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 901648FC17; Tue, 21 Aug 2012 21:00:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LL0YKN005015; Tue, 21 Aug 2012 21:00:34 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LL0YsY005010; Tue, 21 Aug 2012 21:00:34 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212100.q7LL0YsY005010@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239534 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/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: Tue, 21 Aug 2012 21:00:35 -0000 Author: pfg Date: Tue Aug 21 21:00:33 2012 New Revision: 239534 URL: http://svn.freebsd.org/changeset/base/239534 Log: MFC r238509: Use libc's strndup() instead of Dtrace's reimplementation. Corresponds partially to OpenSolaris change: PSARC 2010/299 GNU/Linux/BSD compatibility functions 6901783 strndup would be nice. Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Tue Aug 21 20:40:12 2012 (r239533) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Tue Aug 21 21:00:33 2012 (r239534) @@ -29,23 +29,6 @@ #include #include -#include - -/* - * Create a copy of string s, but only duplicate the first n bytes. - */ -char * -strndup(const char *s, size_t n) -{ - char *s2 = malloc(n + 1); - - if (s2 == NULL) - longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); - - (void) strncpy(s2, s, n); - s2[n] = '\0'; - return (s2); -} /* * Transform string s inline, converting each embedded C escape sequence string Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Tue Aug 21 20:40:12 2012 (r239533) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Tue Aug 21 21:00:33 2012 (r239534) @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,14 +19,12 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _DT_STRING_H #define _DT_STRING_H -#pragma ident "%Z%%M% %I% %E% SMI" #include #include @@ -36,7 +33,6 @@ extern "C" { #endif -extern char *strndup(const char *, size_t); extern size_t stresc2chr(char *); extern char *strchr2esc(const char *, size_t); extern const char *strbasename(const char *); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:01:25 2012 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 56E521065687; Tue, 21 Aug 2012 21:01:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACFC78FC12; Tue, 21 Aug 2012 21:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LL1OFE005240; Tue, 21 Aug 2012 21:01:24 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LL1Oi1005237; Tue, 21 Aug 2012 21:01:24 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212101.q7LL1Oi1005237@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239535 - stable/8/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-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, 21 Aug 2012 21:01:25 -0000 Author: pfg Date: Tue Aug 21 21:01:24 2012 New Revision: 239535 URL: http://svn.freebsd.org/changeset/base/239535 Log: MFC r238509: Use libc's strndup() instead of Dtrace's reimplementation. Corresponds partially to OpenSolaris change: PSARC 2010/299 GNU/Linux/BSD compatibility functions 6901783 strndup would be nice. Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Tue Aug 21 21:00:33 2012 (r239534) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Tue Aug 21 21:01:24 2012 (r239535) @@ -29,23 +29,6 @@ #include #include -#include - -/* - * Create a copy of string s, but only duplicate the first n bytes. - */ -char * -strndup(const char *s, size_t n) -{ - char *s2 = malloc(n + 1); - - if (s2 == NULL) - longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); - - (void) strncpy(s2, s, n); - s2[n] = '\0'; - return (s2); -} /* * Transform string s inline, converting each embedded C escape sequence string Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Tue Aug 21 21:00:33 2012 (r239534) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Tue Aug 21 21:01:24 2012 (r239535) @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,14 +19,12 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _DT_STRING_H #define _DT_STRING_H -#pragma ident "%Z%%M% %I% %E% SMI" #include #include @@ -36,7 +33,6 @@ extern "C" { #endif -extern char *strndup(const char *, size_t); extern size_t stresc2chr(char *); extern char *strchr2esc(const char *, size_t); extern const char *strbasename(const char *); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:06:08 2012 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 108781065674; Tue, 21 Aug 2012 21:06:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC6BF8FC14; Tue, 21 Aug 2012 21:06:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LL67Xh005904; Tue, 21 Aug 2012 21:06:07 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LL67fn005900; Tue, 21 Aug 2012 21:06:07 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212106.q7LL67fn005900@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239536 - in stable/9/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/include cmd/dtrace/test/tst/common/pragma lib/libdtrace/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: Tue, 21 Aug 2012 21:06:08 -0000 Author: pfg Date: Tue Aug 21 21:06:07 2012 New Revision: 239536 URL: http://svn.freebsd.org/changeset/base/239536 Log: MFC r238558: Dtrace: improve handling of library paths. Merge changes from illumos 906 dtrace depends_on pragma should search all library paths, not just the current one 949 dtrace should only include the first instance of a library found on its library path Obtained from: Illumos Added: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/ - copied from r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh - copied unchanged from r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh (from r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh Tue Aug 21 21:06:07 2012 (r239536, copy of r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh) @@ -0,0 +1,76 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2011, Joyent Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Test to catch that we properly look for libraries dependencies in +# our full library parth +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +libdira=${TMPDIR:-/tmp}/libdepa.$$ +libdirb=${TMPDIR:-/tmp}/libdepb.$$ +libdirc=${TMPDIR:-/tmp}/libdepc.$$ +dtrace=$1 + +setup_libs() +{ + mkdir $libdira + mkdir $libdirb + mkdir $libdirc + cat > $libdira/liba.$$.d < $libdirb/libb.$$.d < $libdirb/libc.$$.d < $libdirb/libd.$$.d < $libdirc/libe.$$.d < $libdirc/libf.$$.d <dt_lib_dep); dld != NULL; + dld = dt_list_next(dld)) { + end = strrchr(dld->dtld_library, '/'); + /* dt_lib_depend_add ensures this */ + assert(end != NULL); + if (strcmp(end + 1, dp->d_name) == 0) + break; + } + + if (dld != NULL) { + dt_dprintf("skipping library %s, already processed " + "library with the same name: %s", dp->d_name, + dld->dtld_library); + continue; + } + dtp->dt_filetag = fname; if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) - goto err; + return (-1); /* preserve dt_errno */ rv = dt_compile(dtp, DT_CTX_DPROG, DTRACE_PROBESPEC_NAME, NULL, @@ -2203,7 +2221,7 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons if (rv != NULL && dtp->dt_errno && (dtp->dt_errno != EDT_COMPILER || dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) - goto err; + return (-1); /* preserve dt_errno */ if (dtp->dt_errno) dt_dprintf("error parsing library %s: %s\n", @@ -2214,6 +2232,27 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons } (void) closedir(dirp); + + return (0); +} + +/* + * Perform a topological sorting of all the libraries found across the entire + * dt_lib_path. Once sorted, compile each one in topological order to cache its + * inlines and translators, etc. We silently ignore any missing directories and + * other files found therein. We only fail (and thereby fail dt_load_libs()) if + * we fail to compile a library and the error is something other than #pragma D + * depends_on. Dependency errors are silently ignored to permit a library + * directory to contain libraries which may not be accessible depending on our + * privileges. + */ +static int +dt_load_libs_sort(dtrace_hdl_t *dtp) +{ + dtrace_prog_t *pgp; + FILE *fp; + dt_lib_depend_t *dld; + /* * Finish building the graph containing the library dependencies * and perform a topological sort to generate an ordered list @@ -2274,7 +2313,14 @@ dt_load_libs(dtrace_hdl_t *dtp) dtp->dt_cflags |= DTRACE_C_NOLIBS; - for (dirp = dt_list_next(&dtp->dt_lib_path); + /* + * /usr/lib/dtrace is always at the head of the list. The rest of the + * list is specified in the precedence order the user requested. Process + * everything other than the head first. DTRACE_C_NOLIBS has already + * been spcified so dt_vopen will ensure that there is always one entry + * in dt_lib_path. + */ + for (dirp = dt_list_next(dt_list_next(&dtp->dt_lib_path)); dirp != NULL; dirp = dt_list_next(dirp)) { if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) { dtp->dt_cflags &= ~DTRACE_C_NOLIBS; @@ -2282,6 +2328,16 @@ dt_load_libs(dtrace_hdl_t *dtp) } } + /* Handle /usr/lib/dtrace */ + dirp = dt_list_next(&dtp->dt_lib_path); + if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) { + dtp->dt_cflags &= ~DTRACE_C_NOLIBS; + return (-1); /* errno is set for us */ + } + + if (dt_load_libs_sort(dtp) < 0) + return (-1); /* errno is set for us */ + return (0); } Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Aug 21 21:01:24 2012 (r239535) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Aug 21 21:06:07 2012 (r239536) @@ -21,7 +21,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2011, Joyent Inc. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -31,9 +31,13 @@ #if defined(sun) #include #endif +#include #include #include +#include +#include + #include #include #include @@ -201,6 +205,29 @@ dt_pragma_binding(const char *prname, dt dtp->dt_globals->dh_defer = &dt_pragma_apply; } +static void +dt_pragma_depends_finddep(dtrace_hdl_t *dtp, const char *lname, char *lib, + size_t len) +{ + dt_dirpath_t *dirp; + struct stat sbuf; + int found = 0; + + for (dirp = dt_list_next(&dtp->dt_lib_path); dirp != NULL; + dirp = dt_list_next(dirp)) { + (void) snprintf(lib, len, "%s/%s", dirp->dir_path, lname); + + if (stat(lib, &sbuf) == 0) { + found = 1; + break; + } + } + + if (!found) + xyerror(D_PRAGMA_DEPEND, + "failed to find dependency in libpath: %s", lname); +} + /* * The #pragma depends_on directive can be used to express a dependency on a * module, provider or library which if not present will cause processing to @@ -230,16 +257,13 @@ dt_pragma_depends(const char *prname, dt if (yypcb->pcb_cflags & DTRACE_C_CTL) { assert(dtp->dt_filetag != NULL); - /* - * We have the file we are working on in dtp->dt_filetag - * so find that node and add the dependency in. - */ + dt_pragma_depends_finddep(dtp, nnp->dn_string, lib, + sizeof (lib)); + dld = dt_lib_depend_lookup(&dtp->dt_lib_dep, dtp->dt_filetag); assert(dld != NULL); - (void) snprintf(lib, sizeof (lib), "%s%s", - dld->dtld_libpath, nnp->dn_string); if ((dt_lib_depend_add(dtp, &dld->dtld_dependencies, lib)) != 0) { xyerror(D_PRAGMA_DEPEND, @@ -261,8 +285,8 @@ dt_pragma_depends(const char *prname, dt dtp->dt_filetag); assert(dld != NULL); - (void) snprintf(lib, sizeof (lib), "%s%s", - dld->dtld_libpath, nnp->dn_string); + dt_pragma_depends_finddep(dtp, nnp->dn_string, lib, + sizeof (lib)); dld = dt_lib_depend_lookup(&dtp->dt_lib_dep_sorted, lib); assert(dld != NULL); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:06:18 2012 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 5218D1065763; Tue, 21 Aug 2012 21:06:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B56308FC19; Tue, 21 Aug 2012 21:06:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LL6HBh005962; Tue, 21 Aug 2012 21:06:17 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LL6HwA005958; Tue, 21 Aug 2012 21:06:17 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212106.q7LL6HwA005958@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239537 - in stable/8/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/include cmd/dtrace/test/tst/common/pragma lib/libdtrace/common X-BeenThere: svn-src-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, 21 Aug 2012 21:06:18 -0000 Author: pfg Date: Tue Aug 21 21:06:17 2012 New Revision: 239537 URL: http://svn.freebsd.org/changeset/base/239537 Log: MFC r238558: Dtrace: improve handling of library paths. Merge changes from illumos 906 dtrace depends_on pragma should search all library paths, not just the current one 949 dtrace should only include the first instance of a library found on its library path Obtained from: Illumos Added: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/ - copied from r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh - copied unchanged from r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh (from r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh Tue Aug 21 21:06:17 2012 (r239537, copy of r238558, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh) @@ -0,0 +1,76 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2011, Joyent Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Test to catch that we properly look for libraries dependencies in +# our full library parth +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +libdira=${TMPDIR:-/tmp}/libdepa.$$ +libdirb=${TMPDIR:-/tmp}/libdepb.$$ +libdirc=${TMPDIR:-/tmp}/libdepc.$$ +dtrace=$1 + +setup_libs() +{ + mkdir $libdira + mkdir $libdirb + mkdir $libdirc + cat > $libdira/liba.$$.d < $libdirb/libb.$$.d < $libdirb/libc.$$.d < $libdirb/libd.$$.d < $libdirc/libe.$$.d < $libdirc/libf.$$.d <dt_lib_dep); dld != NULL; + dld = dt_list_next(dld)) { + end = strrchr(dld->dtld_library, '/'); + /* dt_lib_depend_add ensures this */ + assert(end != NULL); + if (strcmp(end + 1, dp->d_name) == 0) + break; + } + + if (dld != NULL) { + dt_dprintf("skipping library %s, already processed " + "library with the same name: %s", dp->d_name, + dld->dtld_library); + continue; + } + dtp->dt_filetag = fname; if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) - goto err; + return (-1); /* preserve dt_errno */ rv = dt_compile(dtp, DT_CTX_DPROG, DTRACE_PROBESPEC_NAME, NULL, @@ -2203,7 +2221,7 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons if (rv != NULL && dtp->dt_errno && (dtp->dt_errno != EDT_COMPILER || dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) - goto err; + return (-1); /* preserve dt_errno */ if (dtp->dt_errno) dt_dprintf("error parsing library %s: %s\n", @@ -2214,6 +2232,27 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons } (void) closedir(dirp); + + return (0); +} + +/* + * Perform a topological sorting of all the libraries found across the entire + * dt_lib_path. Once sorted, compile each one in topological order to cache its + * inlines and translators, etc. We silently ignore any missing directories and + * other files found therein. We only fail (and thereby fail dt_load_libs()) if + * we fail to compile a library and the error is something other than #pragma D + * depends_on. Dependency errors are silently ignored to permit a library + * directory to contain libraries which may not be accessible depending on our + * privileges. + */ +static int +dt_load_libs_sort(dtrace_hdl_t *dtp) +{ + dtrace_prog_t *pgp; + FILE *fp; + dt_lib_depend_t *dld; + /* * Finish building the graph containing the library dependencies * and perform a topological sort to generate an ordered list @@ -2274,7 +2313,14 @@ dt_load_libs(dtrace_hdl_t *dtp) dtp->dt_cflags |= DTRACE_C_NOLIBS; - for (dirp = dt_list_next(&dtp->dt_lib_path); + /* + * /usr/lib/dtrace is always at the head of the list. The rest of the + * list is specified in the precedence order the user requested. Process + * everything other than the head first. DTRACE_C_NOLIBS has already + * been spcified so dt_vopen will ensure that there is always one entry + * in dt_lib_path. + */ + for (dirp = dt_list_next(dt_list_next(&dtp->dt_lib_path)); dirp != NULL; dirp = dt_list_next(dirp)) { if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) { dtp->dt_cflags &= ~DTRACE_C_NOLIBS; @@ -2282,6 +2328,16 @@ dt_load_libs(dtrace_hdl_t *dtp) } } + /* Handle /usr/lib/dtrace */ + dirp = dt_list_next(&dtp->dt_lib_path); + if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) { + dtp->dt_cflags &= ~DTRACE_C_NOLIBS; + return (-1); /* errno is set for us */ + } + + if (dt_load_libs_sort(dtp) < 0) + return (-1); /* errno is set for us */ + return (0); } Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Aug 21 21:06:07 2012 (r239536) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Aug 21 21:06:17 2012 (r239537) @@ -21,7 +21,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2011, Joyent Inc. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -31,9 +31,13 @@ #if defined(sun) #include #endif +#include #include #include +#include +#include + #include #include #include @@ -201,6 +205,29 @@ dt_pragma_binding(const char *prname, dt dtp->dt_globals->dh_defer = &dt_pragma_apply; } +static void +dt_pragma_depends_finddep(dtrace_hdl_t *dtp, const char *lname, char *lib, + size_t len) +{ + dt_dirpath_t *dirp; + struct stat sbuf; + int found = 0; + + for (dirp = dt_list_next(&dtp->dt_lib_path); dirp != NULL; + dirp = dt_list_next(dirp)) { + (void) snprintf(lib, len, "%s/%s", dirp->dir_path, lname); + + if (stat(lib, &sbuf) == 0) { + found = 1; + break; + } + } + + if (!found) + xyerror(D_PRAGMA_DEPEND, + "failed to find dependency in libpath: %s", lname); +} + /* * The #pragma depends_on directive can be used to express a dependency on a * module, provider or library which if not present will cause processing to @@ -230,16 +257,13 @@ dt_pragma_depends(const char *prname, dt if (yypcb->pcb_cflags & DTRACE_C_CTL) { assert(dtp->dt_filetag != NULL); - /* - * We have the file we are working on in dtp->dt_filetag - * so find that node and add the dependency in. - */ + dt_pragma_depends_finddep(dtp, nnp->dn_string, lib, + sizeof (lib)); + dld = dt_lib_depend_lookup(&dtp->dt_lib_dep, dtp->dt_filetag); assert(dld != NULL); - (void) snprintf(lib, sizeof (lib), "%s%s", - dld->dtld_libpath, nnp->dn_string); if ((dt_lib_depend_add(dtp, &dld->dtld_dependencies, lib)) != 0) { xyerror(D_PRAGMA_DEPEND, @@ -261,8 +285,8 @@ dt_pragma_depends(const char *prname, dt dtp->dt_filetag); assert(dld != NULL); - (void) snprintf(lib, sizeof (lib), "%s%s", - dld->dtld_libpath, nnp->dn_string); + dt_pragma_depends_finddep(dtp, nnp->dn_string, lib, + sizeof (lib)); dld = dt_lib_depend_lookup(&dtp->dt_lib_dep_sorted, lib); assert(dld != NULL); From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:11:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 442DD1065679; Tue, 21 Aug 2012 21:11:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CBCD8FC17; Tue, 21 Aug 2012 21:11:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LLBawq007025; Tue, 21 Aug 2012 21:11:36 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLBZg5007023; Tue, 21 Aug 2012 21:11:35 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212111.q7LLBZg5007023@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239538 - in stable/9/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/sizeof lib/libdtrace/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: Tue, 21 Aug 2012 21:11:36 -0000 Author: pfg Date: Tue Aug 21 21:11:35 2012 New Revision: 239538 URL: http://svn.freebsd.org/changeset/base/239538 Log: MFC 238457: 1458 D compiler fails to generate error on sizeof() an undefined struct Reference: https://www.illumos.org/issues/1458 Obtained from: Illumos Added: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d - copied unchanged from r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d (from r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Tue Aug 21 21:11:35 2012 (r239538, copy of r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent Inc. All rights reserved. + */ + +BEGIN +{ + trace(sizeof (struct suckitlarry)); + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 21 21:06:17 2012 (r239537) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 21 21:11:35 2012 (r239538) @@ -22,7 +22,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2011, Joyent Inc. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -725,12 +725,19 @@ dt_node_type_name(const dt_node_t *dnp, size_t dt_node_type_size(const dt_node_t *dnp) { + ctf_id_t base; + if (dnp->dn_kind == DT_NODE_STRING) return (strlen(dnp->dn_string) + 1); if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL) return (dt_ident_size(dnp->dn_ident)); + base = ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type); + + if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD) + return (0); + return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type)); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:11:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B18BA1065689; Tue, 21 Aug 2012 21:11:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A7B38FC1C; Tue, 21 Aug 2012 21:11:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LLBxH9007144; Tue, 21 Aug 2012 21:11:59 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLBxx4007141; Tue, 21 Aug 2012 21:11:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212111.q7LLBxx4007141@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239539 - in stable/8/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/sizeof lib/libdtrace/common X-BeenThere: svn-src-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, 21 Aug 2012 21:11:59 -0000 Author: pfg Date: Tue Aug 21 21:11:59 2012 New Revision: 239539 URL: http://svn.freebsd.org/changeset/base/239539 Log: MFC 238457: 1458 D compiler fails to generate error on sizeof() an undefined struct Reference: https://www.illumos.org/issues/1458 Obtained from: Illumos Added: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d - copied unchanged from r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d (from r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Tue Aug 21 21:11:59 2012 (r239539, copy of r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent Inc. All rights reserved. + */ + +BEGIN +{ + trace(sizeof (struct suckitlarry)); + exit(0); +} Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 21 21:11:35 2012 (r239538) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 21 21:11:59 2012 (r239539) @@ -22,7 +22,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2011, Joyent Inc. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -725,12 +725,19 @@ dt_node_type_name(const dt_node_t *dnp, size_t dt_node_type_size(const dt_node_t *dnp) { + ctf_id_t base; + if (dnp->dn_kind == DT_NODE_STRING) return (strlen(dnp->dn_string) + 1); if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL) return (dt_ident_size(dnp->dn_ident)); + base = ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type); + + if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD) + return (0); + return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type)); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:21:30 2012 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 89D43106564A; Tue, 21 Aug 2012 21:21:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 743198FC0C; Tue, 21 Aug 2012 21:21:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LLLUOx008524; Tue, 21 Aug 2012 21:21:30 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLLUC5008522; Tue, 21 Aug 2012 21:21:30 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212121.q7LLLUC5008522@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239540 - stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace 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, 21 Aug 2012 21:21:30 -0000 Author: pfg Date: Tue Aug 21 21:21:29 2012 New Revision: 239540 URL: http://svn.freebsd.org/changeset/base/239540 Log: MFC 237817: Bump dtrace_helper_actions_max from 32 to 128 Dave Pacheco from Joyent (and Dtrace.org) bumped the cap to 1024 but, according to his blog, 128 is the recommended minimum. For now bump it safely to 128 although we may have to bump it further if there is demand in the future. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 21 21:11:59 2012 (r239539) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 21 21:21:29 2012 (r239540) @@ -157,7 +157,7 @@ dtrace_optval_t dtrace_dof_maxsize = (25 size_t dtrace_global_maxsize = (16 * 1024); size_t dtrace_actions_max = (16 * 1024); size_t dtrace_retain_max = 1024; -dtrace_optval_t dtrace_helper_actions_max = 32; +dtrace_optval_t dtrace_helper_actions_max = 128; dtrace_optval_t dtrace_helper_providers_max = 32; dtrace_optval_t dtrace_dstate_defsize = (1 * 1024 * 1024); size_t dtrace_strsize_default = 256; From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:21:52 2012 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 673B01065672; Tue, 21 Aug 2012 21:21:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50A588FC12; Tue, 21 Aug 2012 21:21:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LLLqK7008602; Tue, 21 Aug 2012 21:21:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLLq5Y008598; Tue, 21 Aug 2012 21:21:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212121.q7LLLq5Y008598@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239541 - stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-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, 21 Aug 2012 21:21:52 -0000 Author: pfg Date: Tue Aug 21 21:21:51 2012 New Revision: 239541 URL: http://svn.freebsd.org/changeset/base/239541 Log: MFC 237817: Bump dtrace_helper_actions_max from 32 to 128 Dave Pacheco from Joyent (and Dtrace.org) bumped the cap to 1024 but, according to his blog, 128 is the recommended minimum. For now bump it safely to 128 although we may have to bump it further if there is demand in the future. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 21 21:21:29 2012 (r239540) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 21 21:21:51 2012 (r239541) @@ -157,7 +157,7 @@ dtrace_optval_t dtrace_dof_maxsize = (25 size_t dtrace_global_maxsize = (16 * 1024); size_t dtrace_actions_max = (16 * 1024); size_t dtrace_retain_max = 1024; -dtrace_optval_t dtrace_helper_actions_max = 32; +dtrace_optval_t dtrace_helper_actions_max = 128; dtrace_optval_t dtrace_helper_providers_max = 32; dtrace_optval_t dtrace_dstate_defsize = (1 * 1024 * 1024); size_t dtrace_strsize_default = 256; From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:46:02 2012 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 3093A106566C; Tue, 21 Aug 2012 21:46:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B9098FC0C; Tue, 21 Aug 2012 21:46:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LLk1Ig011909; Tue, 21 Aug 2012 21:46:01 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLk1Hp011907; Tue, 21 Aug 2012 21:46:01 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212146.q7LLk1Hp011907@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239542 - stable/9/bin/sh 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, 21 Aug 2012 21:46:02 -0000 Author: pfg Date: Tue Aug 21 21:46:01 2012 New Revision: 239542 URL: http://svn.freebsd.org/changeset/base/239542 Log: MFC r238377: Merge libedit adjustment from NetBSD. On recent versions of NetBSD's libedit, el_gets now sets el_len to -1 on error so we can distinguish between a NULL string and an error. This fixes sh from exiting with newer versions of libedit now allowing EINTR to return. Obtained from: NetBSD Reviewed by: jilles MFC after: 3 weeks Modified: stable/9/bin/sh/input.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/input.c ============================================================================== --- stable/9/bin/sh/input.c Tue Aug 21 21:21:51 2012 (r239541) +++ stable/9/bin/sh/input.c Tue Aug 21 21:46:01 2012 (r239542) @@ -186,7 +186,7 @@ retry: if (rl_cp == NULL) rl_cp = el_gets(el, &el_len); if (rl_cp == NULL) - nr = 0; + nr = el_len == 0 ? 0 : -1; else { nr = el_len; if (nr > BUFSIZ - 1) From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:46:44 2012 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 9EB491065674; Tue, 21 Aug 2012 21:46:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89D978FC23; Tue, 21 Aug 2012 21:46:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LLkiuB012031; Tue, 21 Aug 2012 21:46:44 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLkiBl012029; Tue, 21 Aug 2012 21:46:44 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212146.q7LLkiBl012029@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239543 - stable/8/bin/sh X-BeenThere: svn-src-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, 21 Aug 2012 21:46:44 -0000 Author: pfg Date: Tue Aug 21 21:46:44 2012 New Revision: 239543 URL: http://svn.freebsd.org/changeset/base/239543 Log: MFC r238377: Merge libedit adjustment from NetBSD. On recent versions of NetBSD's libedit, el_gets now sets el_len to -1 on error so we can distinguish between a NULL string and an error. This fixes sh from exiting with newer versions of libedit now allowing EINTR to return. Obtained from: NetBSD Reviewed by: jilles Modified: stable/8/bin/sh/input.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/input.c ============================================================================== --- stable/8/bin/sh/input.c Tue Aug 21 21:46:01 2012 (r239542) +++ stable/8/bin/sh/input.c Tue Aug 21 21:46:44 2012 (r239543) @@ -190,7 +190,7 @@ retry: if (rl_cp == NULL) rl_cp = el_gets(el, &el_len); if (rl_cp == NULL) - nr = 0; + nr = el_len == 0 ? 0 : -1; else { nr = el_len; if (nr > BUFSIZ - 1) From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 22:23:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06469106566C; Tue, 21 Aug 2012 22:23:18 +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 E5C748FC08; Tue, 21 Aug 2012 22:23:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LMNHpf016926; Tue, 21 Aug 2012 22:23:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LMNH0K016923; Tue, 21 Aug 2012 22:23:17 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208212223.q7LMNH0K016923@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 22:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239544 - in head/sys/dev: cxgb/ulp/tom cxgbe/tom 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, 21 Aug 2012 22:23:18 -0000 Author: np Date: Tue Aug 21 22:23:17 2012 New Revision: 239544 URL: http://svn.freebsd.org/changeset/base/239544 Log: Deal with the case where a syncache entry added by the TOE driver is evicted from the syncache but a later syncache_expand succeeds because of syncookies. The TOE driver has to resort to more direct means to install its hooks in the socket in this case. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Tue Aug 21 21:46:44 2012 (r239543) +++ head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Tue Aug 21 22:23:17 2012 (r239544) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define TCPSTATES #include @@ -759,6 +760,15 @@ reset: goto reset; } + if (__predict_false(!(synqe->flags & TP_SYNQE_EXPANDED))) { + struct inpcb *new_inp = sotoinpcb(so); + + INP_WLOCK(new_inp); + tcp_timer_activate(intotcpcb(new_inp), TT_KEEP, 0); + t3_offload_socket(tod, synqe, so); + INP_WUNLOCK(new_inp); + } + /* Remove the synq entry and release its reference on the lctx */ TAILQ_REMOVE(&lctx->synq, synqe, link); inp = release_lctx(td, lctx); @@ -1136,5 +1146,6 @@ t3_offload_socket(struct toedev *tod, vo offload_socket(so, toep); make_established(so, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); update_tid(td, toep, synqe->tid); + synqe->flags |= TP_SYNQE_EXPANDED; } #endif Modified: head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h Tue Aug 21 21:46:44 2012 (r239543) +++ head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h Tue Aug 21 22:23:17 2012 (r239544) @@ -44,6 +44,7 @@ #define TP_IS_A_SYNQ_ENTRY (1 << 9) #define TP_ABORT_RPL_SENT (1 << 10) #define TP_SEND_FIN (1 << 11) +#define TP_SYNQE_EXPANDED (1 << 12) struct toepcb { TAILQ_ENTRY(toepcb) link; /* toep_list */ Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 21 21:46:44 2012 (r239543) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 21 22:23:17 2012 (r239544) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define TCPSTATES #include @@ -805,6 +806,7 @@ t4_offload_socket(struct toedev *tod, vo make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); toep->flags |= TPF_CPL_PENDING; update_tid(sc, synqe->tid, toep); + synqe->flags |= TPF_SYNQE_EXPANDED; } static inline void @@ -1349,6 +1351,24 @@ reset: goto reset; } + /* + * This is for the unlikely case where the syncache entry that we added + * has been evicted from the syncache, but the syncache_expand above + * works because of syncookies. + * + * XXX: we've held the tcbinfo lock throughout so there's no risk of + * anyone accept'ing a connection before we've installed our hooks, but + * this somewhat defeats the purpose of having a tod_offload_socket :-( + */ + if (__predict_false(!(synqe->flags & TPF_SYNQE_EXPANDED))) { + struct inpcb *new_inp = sotoinpcb(so); + + INP_WLOCK(new_inp); + tcp_timer_activate(intotcpcb(new_inp), TT_KEEP, 0); + t4_offload_socket(TOEDEV(ifp), synqe, so); + INP_WUNLOCK(new_inp); + } + /* Done with the synqe */ TAILQ_REMOVE(&lctx->synq, synqe, link); inp = release_lctx(sc, lctx); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug 21 21:46:44 2012 (r239543) +++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug 21 22:23:17 2012 (r239544) @@ -66,6 +66,7 @@ enum { TPF_SYNQE = (1 << 8), /* synq_entry, not really a toepcb */ TPF_SYNQE_NEEDFREE = (1 << 9), /* synq_entry was malloc'd separately */ TPF_SYNQE_TCPDDP = (1 << 10), /* ulp_mode TCPDDP in toepcb */ + TPF_SYNQE_EXPANDED = (1 << 11), /* toepcb ready, tid context updated */ }; enum { From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 22:28:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AAC1106566C; Tue, 21 Aug 2012 22:28:15 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04CCC8FC08; Tue, 21 Aug 2012 22:28:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LMSESl017772; Tue, 21 Aug 2012 22:28:14 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LMSEPO017765; Tue, 21 Aug 2012 22:28:14 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208212228.q7LMSEPO017765@svn.freebsd.org> From: Jim Harris Date: Tue, 21 Aug 2012 22:28: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: r239545 - in head/sys/dev/isci: . scil 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, 21 Aug 2012 22:28:15 -0000 Author: jimharris Date: Tue Aug 21 22:28:14 2012 New Revision: 239545 URL: http://svn.freebsd.org/changeset/base/239545 Log: Fix/add support for SCSI UNMAP to ATA DSM translation. This addresses kernel panic observed when sending SCSI UNMAP commands to SATA disks attached to isci(4). 1) Flesh out callback routines to allocate/free buffers needed for translating SCSI UNMAP data to ATA DSM data. 2) Add controller-level pool for storing buffers previously allocated for UNMAP translation, to lessen chance of no buffer available under memory pressure. 3) Ensure driver properly handles case where buffer pool is empty and contigmalloc returns NULL. Sponsored by: Intel Reported by: Maksim Yevmenkin Discussed with: scottl MFC after: 3 days Modified: head/sys/dev/isci/isci.c head/sys/dev/isci/isci.h head/sys/dev/isci/isci_controller.c head/sys/dev/isci/scil/sati_unmap.c head/sys/dev/isci/scil/scif_sas_sati_binding.h head/sys/dev/isci/scil/scif_sas_stp_io_request.c Modified: head/sys/dev/isci/isci.c ============================================================================== --- head/sys/dev/isci/isci.c Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/isci.c Tue Aug 21 22:28:14 2012 (r239545) @@ -185,6 +185,7 @@ isci_detach(device_t device) for (i = 0; i < isci->controller_count; i++) { struct ISCI_CONTROLLER *controller = &isci->controllers[i]; SCI_STATUS status; + void *unmap_buffer; if (controller->scif_controller_handle != NULL) { scic_controller_disable_interrupts( @@ -218,6 +219,13 @@ isci_detach(device_t device) if (controller->remote_device_memory != NULL) free(controller->remote_device_memory, M_ISCI); + + while (1) { + sci_pool_get(controller->unmap_buffer_pool, unmap_buffer); + if (unmap_buffer == NULL) + break; + contigfree(unmap_buffer, PAGE_SIZE, M_ISCI); + } } /* The SCIF controllers have been stopped, so we can now Modified: head/sys/dev/isci/isci.h ============================================================================== --- head/sys/dev/isci/isci.h Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/isci.h Tue Aug 21 22:28:14 2012 (r239545) @@ -175,6 +175,7 @@ struct ISCI_CONTROLLER SCI_POOL_CREATE(remote_device_pool, struct ISCI_REMOTE_DEVICE *, SCI_MAX_REMOTE_DEVICES); SCI_POOL_CREATE(request_pool, struct ISCI_REQUEST *, SCI_MAX_IO_REQUESTS); SCI_POOL_CREATE(timer_pool, struct ISCI_TIMER *, SCI_MAX_TIMERS); + SCI_POOL_CREATE(unmap_buffer_pool, void *, SCI_MAX_REMOTE_DEVICES); }; struct ISCI_REQUEST Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/isci_controller.c Tue Aug 21 22:28:14 2012 (r239545) @@ -145,6 +145,14 @@ void scif_cb_controller_stop_complete(SC isci_controller->is_started = FALSE; } +static void +isci_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + SCI_PHYSICAL_ADDRESS *phys_addr = arg; + + *phys_addr = seg[0].ds_addr; +} + /** * @brief This method will be invoked to allocate memory dynamically. * @@ -159,7 +167,29 @@ void scif_cb_controller_stop_complete(SC void scif_cb_controller_allocate_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T *mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Note this routine is only used for buffers needed to translate + * SCSI UNMAP commands to ATA DSM commands for SATA disks. + * + * We first try to pull a buffer from the controller's pool, and only + * call contigmalloc if one isn't there. + */ + if (!sci_pool_empty(isci_controller->unmap_buffer_pool)) { + sci_pool_get(isci_controller->unmap_buffer_pool, + mde->virtual_address); + } else + mde->virtual_address = contigmalloc(PAGE_SIZE, + M_ISCI, M_NOWAIT, 0, BUS_SPACE_MAXADDR, + mde->constant_memory_alignment, 0); + + if (mde->virtual_address != NULL) + bus_dmamap_load(isci_controller->buffer_dma_tag, + NULL, mde->virtual_address, PAGE_SIZE, + isci_single_map, &mde->physical_address, + BUS_DMA_NOWAIT); } /** @@ -176,7 +206,16 @@ void scif_cb_controller_allocate_memory( void scif_cb_controller_free_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T * mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Put the buffer back into the controller's buffer pool, rather + * than invoking configfree. This helps reduce chance we won't + * have buffers available when system is under memory pressure. + */ + sci_pool_put(isci_controller->unmap_buffer_pool, + mde->virtual_address); } void isci_controller_construct(struct ISCI_CONTROLLER *controller, @@ -228,6 +267,8 @@ void isci_controller_construct(struct IS for ( int i = 0; i < SCI_MAX_TIMERS; i++ ) { sci_pool_put(controller->timer_pool, timer++); } + + sci_pool_initialize(controller->unmap_buffer_pool); } SCI_STATUS isci_controller_initialize(struct ISCI_CONTROLLER *controller) Modified: head/sys/dev/isci/scil/sati_unmap.c ============================================================================== --- head/sys/dev/isci/scil/sati_unmap.c Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/scil/sati_unmap.c Tue Aug 21 22:28:14 2012 (r239545) @@ -335,8 +335,8 @@ SATI_STATUS sati_unmap_initial_processin sati_scsi_sense_data_construct( sequence, scsi_io, - SCSI_STATUS_CHECK_CONDITION, - SCSI_SENSE_ABORTED_COMMAND, + SCSI_STATUS_BUSY, + SCSI_SENSE_NO_SENSE, SCSI_ASC_NO_ADDITIONAL_SENSE, SCSI_ASCQ_NO_ADDITIONAL_SENSE ); Modified: head/sys/dev/isci/scil/scif_sas_sati_binding.h ============================================================================== --- head/sys/dev/isci/scil/scif_sas_sati_binding.h Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/scil/scif_sas_sati_binding.h Tue Aug 21 22:28:14 2012 (r239545) @@ -183,22 +183,16 @@ extern "C" { { \ SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ - SCI_PHYSICAL_ADDRESS phys_addr; \ mde.virtual_address = NULL; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, length, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ scif_cb_controller_allocate_memory( \ fw_request->device->domain->controller, &mde \ ); \ - scic_cb_io_request_get_physical_address(fw_request->device->domain->controller, \ - NULL, \ - mde.virtual_address, \ - &phys_addr); \ *(virt_address) = mde.virtual_address; \ - *(phys_address_low) = sci_cb_physical_address_lower(phys_addr); \ - *(phys_address_high) = sci_cb_physical_address_upper(phys_addr); \ + *(phys_address_low) = sci_cb_physical_address_lower(mde.physical_address); \ + *(phys_address_high) = sci_cb_physical_address_upper(mde.physical_address); \ } #define sati_cb_free_dma_buffer(scsi_io, virt_address) \ @@ -206,7 +200,6 @@ extern "C" { SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ mde.virtual_address = virt_address; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, 0, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ Modified: head/sys/dev/isci/scil/scif_sas_stp_io_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_stp_io_request.c Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/scil/scif_sas_stp_io_request.c Tue Aug 21 22:28:14 2012 (r239545) @@ -171,6 +171,8 @@ SCI_STATUS scif_sas_stp_io_request_const ); } + sati_sequence_terminate(&fw_io->parent.stp.sequence, fw_io, fw_io); + return SCI_SUCCESS; } /** From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 22:29:46 2012 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 4A84C106564A; Tue, 21 Aug 2012 22:29:46 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id D56DE8FC19; Tue, 21 Aug 2012 22:29:45 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 3F6083592ED; Wed, 22 Aug 2012 00:29:44 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 24B092847B; Wed, 22 Aug 2012 00:29:44 +0200 (CEST) Date: Wed, 22 Aug 2012 00:29:44 +0200 From: Jilles Tjoelker To: "Simon J. Gerraty" Message-ID: <20120821222943.GA27203@stack.nl> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120821053519.BD5A158085@chaos.jnpr.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac 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, 21 Aug 2012 22:29:46 -0000 On Mon, Aug 20, 2012 at 10:35:19PM -0700, Simon J. Gerraty wrote: > Hi, sorry about the slow response. > On Thu, 26 Jul 2012 12:49:03 +0400, Ruslan Ermilov writes: > >On Wed, Jul 18, 2012 at 05:57:43AM +0000, David E. O'Brien wrote: > >> Author: obrien > >> Date: Wed Jul 18 05:57:42 2012 > >> New Revision: 238563 > >> URL: http://svn.freebsd.org/changeset/base/238563 > >> Log: > >> a ";" tells make we want the shell to be used > >> Submitted by: Simon Gerraty > >> Modified: > >> head/gnu/usr.bin/groff/tmac/Makefile > >I don't quite understand what this change does, could you elaborate? > Sure. This is a consequence of bmake trying to be clever. > >Without -jN (in backwards compatibility mode), the "cd" is a no-op > >(whether it's terminated by `;' or not) because make will execute a > >single shell per command, with cwd set to ${.OBJDIR}. > Except on very weird systems, bmake is built in what NetBSD call > "native" mode, and even in compat mode will attempt to avoid the > overhead of all those shells. > Thus, unless it spots a shell meta char, it will try and skip the shell. > Shell builtins like 'cd' or 'chdir' cannot be directly invoked, but make > doesn't know that. Simply adding the ';' convinces it to use a shell. > It is still a no-op. On FreeBSD, the first two statements are partially false. All sh(1) builtins that correspond to utilities specified by POSIX (but not special builtins) have versions accessible to execve() (on 8.x and older, hash, type and ulimit are missing). This includes cd but not chdir, since chdir is not specified by POSIX. Also, FreeBSD make includes a somewhat arbitrary list of shell builtins, including cd, that cause it to invoke the shell even if there are no metacharacters. This list of shell builtins should probably be replaced with the list of POSIX special builtins, which are break continue eval exec exit export readonly return set shift times trap unset . : There is a portability issue in that a few systems refuse to comply to the part of POSIX (XCU 1.6 Built-In Utilities) that says that all specified utilities (except special builtins) shall be accessible via exec functions, env, find, nice, nohup, time, xargs. Working around this requires knowing which utilities are "generally" only provided as builtins. > >With -jN, "cd" becomes necessary because all commands are executed as > >a script by one shell (the reason it was added in the first place), > >but adding `;' is a no-op because commands are on separate lines. > A better way to construct targets like this is to put any excursion out > of .OBJDIR inside (): > (cd ${.CURDIR} && \ > ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ > koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) > then the cd ${.OBJDIR} isn't needed at all. > note use of && rather than ; which can be very dangerous This method makes more sense and should hardly cost any performance. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 22:42:47 2012 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 53D6E1065672; Tue, 21 Aug 2012 22:42:47 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4020F8FC15; Tue, 21 Aug 2012 22:42:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LMglNa020005; Tue, 21 Aug 2012 22:42:47 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LMglOF020003; Tue, 21 Aug 2012 22:42:47 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208212242.q7LMglOF020003@svn.freebsd.org> From: Alexander Kabaev Date: Tue, 21 Aug 2012 22:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239546 - releng/9.1/libexec/rtld-elf 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, 21 Aug 2012 22:42:47 -0000 Author: kan Date: Tue Aug 21 22:42:46 2012 New Revision: 239546 URL: http://svn.freebsd.org/changeset/base/239546 Log: MFC r239470: Do not call process_nodelete with NULL object pointer. The place where the function is called can be reached if object loading and relocation fails too, in which case obj pointer will be NULL. Do not call process_nodelete then, or crash will follow. Pointy hat to: kan Approved by: re (kib) Modified: releng/9.1/libexec/rtld-elf/rtld.c Directory Properties: releng/9.1/libexec/rtld-elf/ (props changed) Modified: releng/9.1/libexec/rtld-elf/rtld.c ============================================================================== --- releng/9.1/libexec/rtld-elf/rtld.c Tue Aug 21 22:28:14 2012 (r239545) +++ releng/9.1/libexec/rtld-elf/rtld.c Tue Aug 21 22:42:46 2012 (r239546) @@ -2698,7 +2698,8 @@ dlopen_object(const char *name, int fd, * This has to be done after we have loaded all of the * dependencies, so that we do not miss any. */ - process_nodelete(obj); + if (obj != NULL) + process_nodelete(obj); } else { /* * Bump the reference counts for objects on this DAG. If From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 23:26:15 2012 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 DB1C81065673; Tue, 21 Aug 2012 23:26:15 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og110.obsmtp.com (exprod7og110.obsmtp.com [64.18.2.173]) by mx1.freebsd.org (Postfix) with ESMTP id CA3EB8FC1C; Tue, 21 Aug 2012 23:26:11 +0000 (UTC) Received: from P-EMHUB03-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob110.postini.com ([64.18.6.12]) with SMTP ID DSNKUDQZDQ8Y6OQwfaPLyzQPy9Db3Bt0vfTX@postini.com; Tue, 21 Aug 2012 16:26:14 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB03-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Tue, 21 Aug 2012 16:25:53 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7LNPrh29756; Tue, 21 Aug 2012 16:25:53 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 35D4F58085; Tue, 21 Aug 2012 16:25:53 -0700 (PDT) To: Jilles Tjoelker In-Reply-To: <20120821222943.GA27203@stack.nl> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> <20120821222943.GA27203@stack.nl> Comments: In-reply-to: Jilles Tjoelker message dated "Wed, 22 Aug 2012 00:29:44 +0200." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Tue, 21 Aug 2012 16:25:53 -0700 Message-ID: <20120821232553.35D4F58085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, "David E. O'Brien" , sjg@juniper.net, Ruslan Ermilov , svn-src-head@FreeBSD.org Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac 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, 21 Aug 2012 23:26:16 -0000 On Wed, 22 Aug 2012 00:29:44 +0200, Jilles Tjoelker writes: >On FreeBSD, the first two statements are partially false. All sh(1) >builtins that correspond to utilities specified by POSIX (but not >special builtins) have versions accessible to execve() (on 8.x and That's interesting, especially for 'cd', though is there any use case in which it is actually useful? I'm drawing a blank. >older, hash, type and ulimit are missing). This includes cd but not >chdir, since chdir is not specified by POSIX. Also, FreeBSD make >includes a somewhat arbitrary list of shell builtins, including cd, that >cause it to invoke the shell even if there are no metacharacters. Yes, I pondered whether something like that might be worthwhile, but since a bare 'cd somewhere' all by itself is rather pointless, it seemed a corner case. >> A better way to construct targets like this is to put any excursion out >> of .OBJDIR inside (): > >> (cd ${.CURDIR} && \ >> ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ >> koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) > >> then the cd ${.OBJDIR} isn't needed at all. >> note use of && rather than ; which can be very dangerous > >This method makes more sense and should hardly cost any performance. Agreed. From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 23:44:48 2012 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 471F6106564A; Tue, 21 Aug 2012 23:44:48 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 327D28FC15; Tue, 21 Aug 2012 23:44:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LNimL6028153; Tue, 21 Aug 2012 23:44:48 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LNilhA028150; Tue, 21 Aug 2012 23:44:47 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208212344.q7LNilhA028150@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 21 Aug 2012 23:44: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: r239547 - head/sys/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: Tue, 21 Aug 2012 23:44:48 -0000 Author: gonzo Date: Tue Aug 21 23:44:47 2012 New Revision: 239547 URL: http://svn.freebsd.org/changeset/base/239547 Log: Get rid of ARM_BIG_ENDIAN for good: - remove leftovers in Makefile.arm - Let ld use default output format instead of providing one in ldscript Modified: head/sys/conf/Makefile.arm head/sys/conf/ldscript.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Tue Aug 21 22:42:46 2012 (r239546) +++ head/sys/conf/Makefile.arm Tue Aug 21 23:44:47 2012 (r239547) @@ -35,17 +35,6 @@ INCLUDES+= -I$S/contrib/libfdt SYSTEM_LD:= ${SYSTEM_LD:$S/conf/ldscript.$M=ldscript.$M} SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M} -.if defined(ARM_BIG_ENDIAN) -CC += -mbig-endian -SYSTEM_LD += -EB -LD += -EB -.else -CC += -mlittle-endian -SYSTEM_LD += -EL -LD += -EL -.endif - - .if !defined(DEBUG) && !defined(PROFLEVEL) STRIP_FLAGS = -S .endif Modified: head/sys/conf/ldscript.arm ============================================================================== --- head/sys/conf/ldscript.arm Tue Aug 21 22:42:46 2012 (r239546) +++ head/sys/conf/ldscript.arm Tue Aug 21 23:44:47 2012 (r239547) @@ -1,5 +1,4 @@ /* $FreeBSD$ */ -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 23:55:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E403D106566C; Tue, 21 Aug 2012 23:55:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF1848FC0A; Tue, 21 Aug 2012 23:55:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LNtTAZ029597; Tue, 21 Aug 2012 23:55:29 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LNtTh6029594; Tue, 21 Aug 2012 23:55:29 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201208212355.q7LNtTh6029594@svn.freebsd.org> From: Justin Hibbits Date: Tue, 21 Aug 2012 23:55: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: r239548 - 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: Tue, 21 Aug 2012 23:55:30 -0000 Author: jhibbits Date: Tue Aug 21 23:55:29 2012 New Revision: 239548 URL: http://svn.freebsd.org/changeset/base/239548 Log: phandle_t is unsigned, and OF_finddevice() returns (phandle_t)(-1) on failure, so check for that instead of 0. While here, provide a better description for ATI backlight driver. Reported by: jchandra@ MFC after: 3 days Modified: head/sys/powerpc/powermac/atibl.c head/sys/powerpc/powermac/nvbl.c Modified: head/sys/powerpc/powermac/atibl.c ============================================================================== --- head/sys/powerpc/powermac/atibl.c Tue Aug 21 23:44:47 2012 (r239547) +++ head/sys/powerpc/powermac/atibl.c Tue Aug 21 23:55:29 2012 (r239548) @@ -98,7 +98,7 @@ atibl_probe(device_t dev) handle = OF_finddevice("mac-io/backlight"); - if (handle <= 0) + if (handle == -1) return (ENXIO); if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) @@ -107,7 +107,7 @@ atibl_probe(device_t dev) if (strcmp(control, "ati") != 0) return (ENXIO); - device_set_desc(dev, "PowerBook backlight"); + device_set_desc(dev, "PowerBook backlight for ATI graphics"); return (0); } Modified: head/sys/powerpc/powermac/nvbl.c ============================================================================== --- head/sys/powerpc/powermac/nvbl.c Tue Aug 21 23:44:47 2012 (r239547) +++ head/sys/powerpc/powermac/nvbl.c Tue Aug 21 23:55:29 2012 (r239548) @@ -94,7 +94,7 @@ nvbl_probe(device_t dev) handle = OF_finddevice("mac-io/backlight"); - if (handle <= 0) + if (handle == -1) return (ENXIO); if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 00:06:51 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3BA41065672; Wed, 22 Aug 2012 00:06:51 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 038778FC0C; Wed, 22 Aug 2012 00:06:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7M06lGR055020; Wed, 22 Aug 2012 04:06:48 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7M06lkt055019; Wed, 22 Aug 2012 04:06:47 +0400 (MSK) (envelope-from ache) Date: Wed, 22 Aug 2012 04:06:46 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120822000645.GA54651@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: r239356 - 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: Wed, 22 Aug 2012 00:06:51 -0000 On Tue, Aug 21, 2012 at 03:58:12PM +0900, Hajimu UMEMOTO wrote: > Okay, thanks. I solve this riddle, thanks to your helpful tips. Relevant part of my setup are at the end of this messae for anybody who may have the same problem. BTW, I notice that link-local router address behavior is strange and inconsistant for both 'host -6' and 'dig -6' commands. host -6 example.com fe80:: dig -6 @fe80:: example.com both hangs, but in the same time host -6 example.com fe80::% dig -6 @fe80::% example.com works! host -6 example.com fe80::%1 dig -6 #fe80::%1 example.com works too. Not understanding addresses without % or %1 looks like routing problems, but I don't know where to fix it. So, I try to use nameserver fe80::% (or with %1 suffix) in my resolv.conf, as result host -6 example.com dig -6 example.com (without NS specified) both hangs despite they working when exact the same NS address is given in their command lines. So, I finally decide to use my router addres from IPv6 /64 subnet (given by my tunnel). It not goes through the whole tunnel, but directly to the router. host -6 example.com dig -6 example.com both works when it exists in /etc/reslov.conf. What I don't understand why all that bad things happens with link-local router address. To be sure I test it under Win7 and it works normally. Finally, what is working: /etc/resolvconf.conf: name_servers_append= /etc/rc.conf: rtsol_flags="-R /etc/eat.sh" /etc/eat.sh: #!/bin/sh /bin/cat > /dev/null -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 00:59:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50DDB106566C; Wed, 22 Aug 2012 00:59:18 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B3698FC0C; Wed, 22 Aug 2012 00:59:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M0xIxO037942; Wed, 22 Aug 2012 00:59:18 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M0xIXC037940; Wed, 22 Aug 2012 00:59:18 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201208220059.q7M0xIXC037940@svn.freebsd.org> From: Kevin Lo Date: Wed, 22 Aug 2012 00:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239549 - stable/9/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: Wed, 22 Aug 2012 00:59:18 -0000 Author: kevlo Date: Wed Aug 22 00:59:17 2012 New Revision: 239549 URL: http://svn.freebsd.org/changeset/base/239549 Log: MFC r239345: Make 'junk' volatile so that compilers won't be tempted to optimize Reviewed by: ache Modified: stable/9/lib/libc/stdlib/random.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/random.c ============================================================================== --- stable/9/lib/libc/stdlib/random.c Tue Aug 21 23:55:29 2012 (r239548) +++ stable/9/lib/libc/stdlib/random.c Wed Aug 22 00:59:17 2012 (r239549) @@ -315,7 +315,7 @@ srandomdev() if (!done) { struct timeval tv; - unsigned long junk; + volatile unsigned long junk; gettimeofday(&tv, NULL); srandom((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec ^ junk); From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 01:28:17 2012 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 7BF57106566B; Wed, 22 Aug 2012 01:28:17 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CEC18FC08; Wed, 22 Aug 2012 01:28:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M1SHRM041619; Wed, 22 Aug 2012 01:28:17 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M1SHFI041617; Wed, 22 Aug 2012 01:28:17 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201208220128.q7M1SHFI041617@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 22 Aug 2012 01:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239550 - releng/9.1/sys/netinet/khelp 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, 22 Aug 2012 01:28:17 -0000 Author: lstewart Date: Wed Aug 22 01:28:16 2012 New Revision: 239550 URL: http://svn.freebsd.org/changeset/base/239550 Log: MFC r239346: The TCP PAWS fix for kernels with fast tick rates (r231767) changed the TCP timestamp related stack variables to reference ms directly instead of ticks. The h_ertt(4) Khelp module relies on TCP timestamp information in order to calculate its enhanced RTT estimates, but was not updated as part of r231767. Consequently, h_ertt has not been calculating correct RTT estimates since r231767 was comitted, which in turn broke all delay-based congestion control algorithms because they rely on the h_ertt RTT estimates. Fix the breakage by switching h_ertt to use tcp_ts_getticks() in place of all previous uses of the ticks variable. This ensures all timestamp related variables in h_ertt use the same units as the TCP stack and therefore results in meaningful comparisons and RTT estimate calculations. Reported & tested by: Naeem Khademi (naeemk at ifi uio no) Discussed with: bz Approved by: re (kib) Modified: releng/9.1/sys/netinet/khelp/h_ertt.c Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/netinet/khelp/h_ertt.c ============================================================================== --- releng/9.1/sys/netinet/khelp/h_ertt.c Wed Aug 22 00:59:17 2012 (r239549) +++ releng/9.1/sys/netinet/khelp/h_ertt.c Wed Aug 22 01:28:16 2012 (r239550) @@ -151,11 +151,13 @@ marked_packet_rtt(struct txseginfo *txsi *prtt_bytes_adjust += *pmeasurenext_len; } else { if (mflag & FORCED_MEASUREMENT) { - e_t->markedpkt_rtt = ticks - *pmeasurenext + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + *pmeasurenext + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt + *pmeasurenext_len - *prtt_bytes_adjust; } else { - e_t->markedpkt_rtt = ticks - txsi->tx_ts + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + txsi->tx_ts + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt - *prtt_bytes_adjust; } @@ -349,7 +351,7 @@ ertt_packet_measurement_hook(int hhook_t */ if (!e_t->dlyack_rx || multiack || new_sacked_bytes) { /* Make an accurate new measurement. */ - e_t->rtt = ticks - txsi->tx_ts + 1; + e_t->rtt = tcp_ts_getticks() - txsi->tx_ts + 1; if (e_t->rtt < e_t->minrtt || e_t->minrtt == 0) e_t->minrtt = e_t->rtt; @@ -477,7 +479,7 @@ ertt_add_tx_segment_info_hook(int hhook_ tp->ts_offset; txsi->rx_ts = ntohl(to->to_tsecr); } else { - txsi->tx_ts = ticks; + txsi->tx_ts = tcp_ts_getticks(); txsi->rx_ts = 0; /* No received time stamp. */ } TAILQ_INSERT_TAIL(&e_t->txsegi_q, txsi, txsegi_lnk); From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 05:15:00 2012 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 B1411106564A; Wed, 22 Aug 2012 05:15:00 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 979918FC0A; Wed, 22 Aug 2012 05:15:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M5F0Md070932; Wed, 22 Aug 2012 05:15:00 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5F0bX070928; Wed, 22 Aug 2012 05:15:00 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201208220515.q7M5F0bX070928@svn.freebsd.org> From: Tim Kientzle Date: Wed, 22 Aug 2012 05:15: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: r239553 - head/sys/arm/ti 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, 22 Aug 2012 05:15:00 -0000 Author: kientzle Date: Wed Aug 22 05:14:59 2012 New Revision: 239553 URL: http://svn.freebsd.org/changeset/base/239553 Log: After r239366, fix the ti_edma3.c driver to use the exact name as used in the FDT. Modified: head/sys/arm/ti/ti_edma3.c Modified: head/sys/arm/ti/ti_edma3.c ============================================================================== --- head/sys/arm/ti/ti_edma3.c Wed Aug 22 03:00:57 2012 (r239552) +++ head/sys/arm/ti/ti_edma3.c Wed Aug 22 05:14:59 2012 (r239553) @@ -142,7 +142,7 @@ static struct { static int ti_edma3_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "ti,edma")) + if (!ofw_bus_is_compatible(dev, "ti,edma3")) return (ENXIO); device_set_desc(dev, "TI EDMA Controller"); From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 05:15:21 2012 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 D0CFD1065815; Wed, 22 Aug 2012 05:15:21 +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 BAD848FC14; Wed, 22 Aug 2012 05:15:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M5FLRm071032; Wed, 22 Aug 2012 05:15:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5FL0o071023; Wed, 22 Aug 2012 05:15:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220515.q7M5FL0o071023@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239554 - in stable/9/sys: fs/nfsclient fs/nwfs fs/smbfs nfsclient 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: Wed, 22 Aug 2012 05:15:22 -0000 Author: kib Date: Wed Aug 22 05:15:21 2012 New Revision: 239554 URL: http://svn.freebsd.org/changeset/base/239554 Log: MFC r239040: Reduce code duplication and exposure of direct access to struct vm_page oflags by providing helper function vm_page_readahead_finish(), which handles completed reads for pages with indexes other then the requested one, for VOP_GETPAGES(). MFC r239246: Do not leave invalid pages in the object after the short read for a network file systems (not only NFS proper). Short reads cause pages other then the requested one, which were not filled by read response, to stay invalid. Change the vm_page_readahead_finish() interface to not take the error code, but instead to make a decision to free or to (de)activate the page only by its validity. As result, not requested invalid pages are freed even if the read RPC indicated success. Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c stable/9/sys/fs/nwfs/nwfs_io.c stable/9/sys/fs/smbfs/smbfs_io.c stable/9/sys/nfsclient/nfs_bio.c stable/9/sys/vm/vm_page.c stable/9/sys/vm/vm_page.h stable/9/sys/vm/vnode_pager.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 22 05:14:59 2012 (r239553) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 22 05:15:21 2012 (r239554) @@ -217,42 +217,18 @@ ncl_getpages(struct vop_getpages_args *a ("nfs_getpages: page %p is dirty", m)); } else { /* - * Read operation was short. If no error occured - * we may have hit a zero-fill section. We simply - * leave valid set to 0. + * Read operation was short. If no error + * occured we may have hit a zero-fill + * section. We leave valid set to 0, and page + * is freed by vm_page_readahead_finish() if + * its index is not equal to requested, or + * page is zeroed and set valid by + * vm_pager_get_pages() for requested page. */ ; } - if (i != ap->a_reqpage) { - /* - * Whether or not to leave the page activated is up in - * the air, but we should put the page on a page queue - * somewhere (it already is in the object). Result: - * It appears that emperical results show that - * deactivating pages is best. - */ - - /* - * Just in case someone was asking for this page we - * now tell them that it is ok to use. - */ - if (!error) { - if (m->oflags & VPO_WANTED) { - vm_page_lock(m); - vm_page_activate(m); - vm_page_unlock(m); - } else { - vm_page_lock(m); - vm_page_deactivate(m); - vm_page_unlock(m); - } - vm_page_wakeup(m); - } else { - vm_page_lock(m); - vm_page_free(m); - vm_page_unlock(m); - } - } + if (i != ap->a_reqpage) + vm_page_readahead_finish(m); } VM_OBJECT_UNLOCK(object); return (0); Modified: stable/9/sys/fs/nwfs/nwfs_io.c ============================================================================== --- stable/9/sys/fs/nwfs/nwfs_io.c Wed Aug 22 05:14:59 2012 (r239553) +++ stable/9/sys/fs/nwfs/nwfs_io.c Wed Aug 22 05:15:21 2012 (r239554) @@ -457,36 +457,8 @@ nwfs_getpages(ap) ("nwfs_getpages: page %p is dirty", m)); } - if (i != ap->a_reqpage) { - /* - * Whether or not to leave the page activated is up in - * the air, but we should put the page on a page queue - * somewhere (it already is in the object). Result: - * It appears that emperical results show that - * deactivating pages is best. - */ - - /* - * Just in case someone was asking for this page we - * now tell them that it is ok to use. - */ - if (!error) { - if (m->oflags & VPO_WANTED) { - vm_page_lock(m); - vm_page_activate(m); - vm_page_unlock(m); - } else { - vm_page_lock(m); - vm_page_deactivate(m); - vm_page_unlock(m); - } - vm_page_wakeup(m); - } else { - vm_page_lock(m); - vm_page_free(m); - vm_page_unlock(m); - } - } + if (i != ap->a_reqpage) + vm_page_readahead_finish(m); } VM_OBJECT_UNLOCK(object); return 0; Modified: stable/9/sys/fs/smbfs/smbfs_io.c ============================================================================== --- stable/9/sys/fs/smbfs/smbfs_io.c Wed Aug 22 05:14:59 2012 (r239553) +++ stable/9/sys/fs/smbfs/smbfs_io.c Wed Aug 22 05:15:21 2012 (r239554) @@ -521,36 +521,8 @@ smbfs_getpages(ap) ; } - if (i != reqpage) { - /* - * Whether or not to leave the page activated is up in - * the air, but we should put the page on a page queue - * somewhere (it already is in the object). Result: - * It appears that emperical results show that - * deactivating pages is best. - */ - - /* - * Just in case someone was asking for this page we - * now tell them that it is ok to use. - */ - if (!error) { - if (m->oflags & VPO_WANTED) { - vm_page_lock(m); - vm_page_activate(m); - vm_page_unlock(m); - } else { - vm_page_lock(m); - vm_page_deactivate(m); - vm_page_unlock(m); - } - vm_page_wakeup(m); - } else { - vm_page_lock(m); - vm_page_free(m); - vm_page_unlock(m); - } - } + if (i != reqpage) + vm_page_readahead_finish(m); } VM_OBJECT_UNLOCK(object); return 0; Modified: stable/9/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/9/sys/nfsclient/nfs_bio.c Wed Aug 22 05:14:59 2012 (r239553) +++ stable/9/sys/nfsclient/nfs_bio.c Wed Aug 22 05:15:21 2012 (r239554) @@ -211,42 +211,18 @@ nfs_getpages(struct vop_getpages_args *a ("nfs_getpages: page %p is dirty", m)); } else { /* - * Read operation was short. If no error occured - * we may have hit a zero-fill section. We simply - * leave valid set to 0. + * Read operation was short. If no error + * occured we may have hit a zero-fill + * section. We leave valid set to 0, and page + * is freed by vm_page_readahead_finish() if + * its index is not equal to requested, or + * page is zeroed and set valid by + * vm_pager_get_pages() for requested page. */ ; } - if (i != ap->a_reqpage) { - /* - * Whether or not to leave the page activated is up in - * the air, but we should put the page on a page queue - * somewhere (it already is in the object). Result: - * It appears that emperical results show that - * deactivating pages is best. - */ - - /* - * Just in case someone was asking for this page we - * now tell them that it is ok to use. - */ - if (!error) { - if (m->oflags & VPO_WANTED) { - vm_page_lock(m); - vm_page_activate(m); - vm_page_unlock(m); - } else { - vm_page_lock(m); - vm_page_deactivate(m); - vm_page_unlock(m); - } - vm_page_wakeup(m); - } else { - vm_page_lock(m); - vm_page_free(m); - vm_page_unlock(m); - } - } + if (i != ap->a_reqpage) + vm_page_readahead_finish(m); } VM_OBJECT_UNLOCK(object); return (0); Modified: stable/9/sys/vm/vm_page.c ============================================================================== --- stable/9/sys/vm/vm_page.c Wed Aug 22 05:14:59 2012 (r239553) +++ stable/9/sys/vm/vm_page.c Wed Aug 22 05:15:21 2012 (r239554) @@ -754,6 +754,45 @@ vm_page_free_zero(vm_page_t m) } /* + * Unbusy and handle the page queueing for a page from the VOP_GETPAGES() + * array which is not the request page. + */ +void +vm_page_readahead_finish(vm_page_t m) +{ + + if (m->valid != 0) { + /* + * Since the page is not the requested page, whether + * it should be activated or deactivated is not + * obvious. Empirical results have shown that + * deactivating the page is usually the best choice, + * unless the page is wanted by another thread. + */ + if (m->oflags & VPO_WANTED) { + vm_page_lock(m); + vm_page_activate(m); + vm_page_unlock(m); + } else { + vm_page_lock(m); + vm_page_deactivate(m); + vm_page_unlock(m); + } + vm_page_wakeup(m); + } else { + /* + * Free the completely invalid page. Such page state + * occurs due to the short read operation which did + * not covered our page at all, or in case when a read + * error happens. + */ + vm_page_lock(m); + vm_page_free(m); + vm_page_unlock(m); + } +} + +/* * vm_page_sleep: * * Sleep and release the page and page queues locks. Modified: stable/9/sys/vm/vm_page.h ============================================================================== --- stable/9/sys/vm/vm_page.h Wed Aug 22 05:14:59 2012 (r239553) +++ stable/9/sys/vm/vm_page.h Wed Aug 22 05:15:21 2012 (r239554) @@ -386,6 +386,7 @@ vm_page_t vm_page_next(vm_page_t m); int vm_page_pa_tryrelock(pmap_t, vm_paddr_t, vm_paddr_t *); vm_page_t vm_page_prev(vm_page_t m); void vm_page_putfake(vm_page_t m); +void vm_page_readahead_finish(vm_page_t m); void vm_page_reference(vm_page_t m); void vm_page_remove (vm_page_t); void vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); Modified: stable/9/sys/vm/vnode_pager.c ============================================================================== --- stable/9/sys/vm/vnode_pager.c Wed Aug 22 05:14:59 2012 (r239553) +++ stable/9/sys/vm/vnode_pager.c Wed Aug 22 05:15:21 2012 (r239554) @@ -983,37 +983,8 @@ vnode_pager_generic_getpages(vp, m, byte mt)); } - if (i != reqpage) { - - /* - * whether or not to leave the page activated is up in - * the air, but we should put the page on a page queue - * somewhere. (it already is in the object). Result: - * It appears that empirical results show that - * deactivating pages is best. - */ - - /* - * just in case someone was asking for this page we - * now tell them that it is ok to use - */ - if (!error) { - if (mt->oflags & VPO_WANTED) { - vm_page_lock(mt); - vm_page_activate(mt); - vm_page_unlock(mt); - } else { - vm_page_lock(mt); - vm_page_deactivate(mt); - vm_page_unlock(mt); - } - vm_page_wakeup(mt); - } else { - vm_page_lock(mt); - vm_page_free(mt); - vm_page_unlock(mt); - } - } + if (i != reqpage) + vm_page_readahead_finish(mt); } VM_OBJECT_UNLOCK(object); if (error) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 05:18:39 2012 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 69446106564A; Wed, 22 Aug 2012 05:18:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 534878FC08; Wed, 22 Aug 2012 05:18:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M5IdWu071496; Wed, 22 Aug 2012 05:18:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5IdIL071494; Wed, 22 Aug 2012 05:18:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220518.q7M5IdIL071494@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239555 - stable/9/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, 22 Aug 2012 05:18:39 -0000 Author: kib Date: Wed Aug 22 05:18:38 2012 New Revision: 239555 URL: http://svn.freebsd.org/changeset/base/239555 Log: MFC r239135: Always initialize pl_event. Modified: stable/9/sys/kern/sys_process.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sys_process.c ============================================================================== --- stable/9/sys/kern/sys_process.c Wed Aug 22 05:15:21 2012 (r239554) +++ stable/9/sys/kern/sys_process.c Wed Aug 22 05:18:38 2012 (r239555) @@ -1112,6 +1112,7 @@ kern_ptrace(struct thread *td, int req, #endif pl = addr; pl->pl_lwpid = td2->td_tid; + pl->pl_event = PL_EVENT_NONE; pl->pl_flags = 0; if (td2->td_dbgflags & TDB_XSIG) { pl->pl_event = PL_EVENT_SIGNAL; From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 05:23:57 2012 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 3B967106566C; Wed, 22 Aug 2012 05:23:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 258AC8FC22; Wed, 22 Aug 2012 05:23:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M5NvRD072200; Wed, 22 Aug 2012 05:23:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5NuAE072198; Wed, 22 Aug 2012 05:23:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220523.q7M5NuAE072198@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239556 - stable/8/sys/kern X-BeenThere: svn-src-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, 22 Aug 2012 05:23:57 -0000 Author: kib Date: Wed Aug 22 05:23:56 2012 New Revision: 239556 URL: http://svn.freebsd.org/changeset/base/239556 Log: MFC r239135: Always initialize pl_event. Modified: stable/8/sys/kern/sys_process.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Wed Aug 22 05:18:38 2012 (r239555) +++ stable/8/sys/kern/sys_process.c Wed Aug 22 05:23:56 2012 (r239556) @@ -1156,6 +1156,7 @@ kern_ptrace(struct thread *td, int req, #endif pl = addr; pl->pl_lwpid = td2->td_tid; + pl->pl_event = PL_EVENT_NONE; pl->pl_flags = 0; if (td2->td_dbgflags & TDB_XSIG) { pl->pl_event = PL_EVENT_SIGNAL; From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 05:26:54 2012 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 B02661065686; Wed, 22 Aug 2012 05:26:54 +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 9A62D8FC0A; Wed, 22 Aug 2012 05:26:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M5Qs9q072624; Wed, 22 Aug 2012 05:26:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5QsfP072622; Wed, 22 Aug 2012 05:26:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220526.q7M5QsfP072622@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239557 - stable/9/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: Wed, 22 Aug 2012 05:26:54 -0000 Author: kib Date: Wed Aug 22 05:26:54 2012 New Revision: 239557 URL: http://svn.freebsd.org/changeset/base/239557 Log: MFC r239038: Remove verbose unused commented out debugging printf. Modified: stable/9/sys/dev/md/md.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/md/md.c ============================================================================== --- stable/9/sys/dev/md/md.c Wed Aug 22 05:23:56 2012 (r239556) +++ stable/9/sys/dev/md/md.c Wed Aug 22 05:26:54 2012 (r239557) @@ -723,12 +723,6 @@ mdstart_swap(struct md_s *sc, struct bio /* Actions on further pages start at offset 0 */ p += PAGE_SIZE - offs; offs = 0; -#if 0 -if (bootverbose || bp->bio_offset / PAGE_SIZE < 17) -printf("wire_count %d busy %d flags %x hold_count %d act_count %d queue %d valid %d dirty %d @ %d\n", - m->wire_count, m->busy, - m->flags, m->hold_count, m->act_count, m->queue, m->valid, m->dirty, i); -#endif } vm_object_pip_subtract(sc->object, 1); VM_OBJECT_UNLOCK(sc->object); From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 05:28:56 2012 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 2C9611065677; Wed, 22 Aug 2012 05:28:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16F298FC12; Wed, 22 Aug 2012 05:28:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M5StW6072915; Wed, 22 Aug 2012 05:28:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5StrY072913; Wed, 22 Aug 2012 05:28:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220528.q7M5StrY072913@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239558 - stable/8/sys/dev/md X-BeenThere: svn-src-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, 22 Aug 2012 05:28:56 -0000 Author: kib Date: Wed Aug 22 05:28:55 2012 New Revision: 239558 URL: http://svn.freebsd.org/changeset/base/239558 Log: MFC r239038: Remove verbose unused commented out debugging printf. Modified: stable/8/sys/dev/md/md.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Wed Aug 22 05:26:54 2012 (r239557) +++ stable/8/sys/dev/md/md.c Wed Aug 22 05:28:55 2012 (r239558) @@ -680,12 +680,6 @@ mdstart_swap(struct md_s *sc, struct bio /* Actions on further pages start at offset 0 */ p += PAGE_SIZE - offs; offs = 0; -#if 0 -if (bootverbose || bp->bio_offset / PAGE_SIZE < 17) -printf("wire_count %d busy %d flags %x hold_count %d act_count %d queue %d valid %d dirty %d @ %d\n", - m->wire_count, m->busy, - m->flags, m->hold_count, m->act_count, m->queue, m->valid, m->dirty, i); -#endif } vm_object_pip_subtract(sc->object, 1); vm_object_set_writeable_dirty(sc->object); From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 05:30:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 218EB106564A; Wed, 22 Aug 2012 05:30: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 0BCB28FC0C; Wed, 22 Aug 2012 05:30:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M5UpIs073232; Wed, 22 Aug 2012 05:30:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5Upk7073229; Wed, 22 Aug 2012 05:30:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220530.q7M5Upk7073229@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239559 - stable/9/sbin/fsck_ffs 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, 22 Aug 2012 05:30:52 -0000 Author: kib Date: Wed Aug 22 05:30:51 2012 New Revision: 239559 URL: http://svn.freebsd.org/changeset/base/239559 Log: MFC r238984: fsck_ffs shall accept the configured journal size, and not refuse to operate on it if journal size is greater then SUJ_MAX. The later constant is only to select maximal journal size when user did not specified size explicitely. Modified: stable/9/sbin/fsck_ffs/suj.c Directory Properties: stable/9/sbin/fsck_ffs/ (props changed) Modified: stable/9/sbin/fsck_ffs/suj.c ============================================================================== --- stable/9/sbin/fsck_ffs/suj.c Wed Aug 22 05:28:55 2012 (r239558) +++ stable/9/sbin/fsck_ffs/suj.c Wed Aug 22 05:30:51 2012 (r239559) @@ -2383,7 +2383,7 @@ suj_verifyino(union dinode *ip) return (-1); } - if (DIP(ip, di_size) < SUJ_MIN || DIP(ip, di_size) > SUJ_MAX) { + if (DIP(ip, di_size) < SUJ_MIN) { printf("Invalid size %jd for journal inode %d\n", DIP(ip, di_size), sujino); return (-1); From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 05:36:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4276E106564A; Wed, 22 Aug 2012 05:36:11 +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 2CD1E8FC12; Wed, 22 Aug 2012 05:36:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M5aBcd073965; Wed, 22 Aug 2012 05:36:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5aAQM073963; Wed, 22 Aug 2012 05:36:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220536.q7M5aAQM073963@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239560 - stable/9/sys/amd64/amd64 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, 22 Aug 2012 05:36:11 -0000 Author: kib Date: Wed Aug 22 05:36:10 2012 New Revision: 239560 URL: http://svn.freebsd.org/changeset/base/239560 Log: MFC r239125: Do not apply errata 721 workaround when under hypervisor, since typical hypervisor does not implement access to the required MSR, causing #GP on boot. Modified: stable/9/sys/amd64/amd64/initcpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/9/sys/amd64/amd64/initcpu.c Wed Aug 22 05:30:51 2012 (r239559) +++ stable/9/sys/amd64/amd64/initcpu.c Wed Aug 22 05:36:10 2012 (r239560) @@ -91,11 +91,17 @@ init_amd(void) * * http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf * http://support.amd.com/us/Processor_TechDocs/44739_12h_Rev_Gd.pdf + * + * Hypervisors do not provide access to the errata MSR, + * causing #GP exception on attempt to apply the errata. The + * MSR write shall be done on host and persist globally + * anyway, so do not try to do it when under virtualization. */ switch (CPUID_TO_FAMILY(cpu_id)) { case 0x10: case 0x12: - wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); + if ((cpu_feature2 & CPUID2_HV) == 0) + wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 05:38:07 2012 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 67F19106564A; Wed, 22 Aug 2012 05:38:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 518368FC0C; Wed, 22 Aug 2012 05:38:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M5c7JI074253; Wed, 22 Aug 2012 05:38:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5c74i074251; Wed, 22 Aug 2012 05:38:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208220538.q7M5c74i074251@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 05:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239561 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-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, 22 Aug 2012 05:38:07 -0000 Author: kib Date: Wed Aug 22 05:38:06 2012 New Revision: 239561 URL: http://svn.freebsd.org/changeset/base/239561 Log: MFC r239125: Do not apply errata 721 workaround when under hypervisor, since typical hypervisor does not implement access to the required MSR, causing #GP on boot. Modified: stable/8/sys/amd64/amd64/initcpu.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/8/sys/amd64/amd64/initcpu.c Wed Aug 22 05:36:10 2012 (r239560) +++ stable/8/sys/amd64/amd64/initcpu.c Wed Aug 22 05:38:06 2012 (r239561) @@ -91,11 +91,17 @@ init_amd(void) * * http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf * http://support.amd.com/us/Processor_TechDocs/44739_12h_Rev_Gd.pdf + * + * Hypervisors do not provide access to the errata MSR, + * causing #GP exception on attempt to apply the errata. The + * MSR write shall be done on host and persist globally + * anyway, so do not try to do it when under virtualization. */ switch (CPUID_TO_FAMILY(cpu_id)) { case 0x10: case 0x12: - wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); + if ((cpu_feature2 & CPUID2_HV) == 0) + wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 06:37:31 2012 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 5F5741065672; Wed, 22 Aug 2012 06:37:31 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7078FC1B; Wed, 22 Aug 2012 06:37:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M6bVCS082112; Wed, 22 Aug 2012 06:37:31 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M6bVb3082106; Wed, 22 Aug 2012 06:37:31 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201208220637.q7M6bVb3082106@svn.freebsd.org> From: Hiroki Sato Date: Wed, 22 Aug 2012 06:37: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: r239562 - head/usr.sbin/makefs 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, 22 Aug 2012 06:37:31 -0000 Author: hrs Date: Wed Aug 22 06:37:30 2012 New Revision: 239562 URL: http://svn.freebsd.org/changeset/base/239562 Log: Add -p flag to create the image as a sparse file. Submitted by: Shesha Sreenivasamurthy PR: bin/167779 Modified: head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c head/usr.sbin/makefs/makefs.h Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Wed Aug 22 05:38:06 2012 (r239561) +++ head/usr.sbin/makefs/ffs.c Wed Aug 22 06:37:30 2012 (r239562) @@ -493,13 +493,25 @@ ffs_create_image(const char *image, fsin bufsize = sfs.f_iosize; #endif bufrem = fsopts->size; - if (debug & DEBUG_FS_CREATE_IMAGE) - printf( - "zero-ing image `%s', %lld sectors, using %d byte chunks\n", - image, (long long)bufrem, bufsize); - if ((buf = calloc(1, bufsize)) == NULL) { - warn("Can't create buffer for sector"); - return (-1); + if (fsopts->sparse) { + if (ftruncate(fsopts->fd, bufrem) == -1) { + warn("sparse option disabled.\n"); + fsopts->sparse = 0; + } + } + if (fsopts->sparse) { + /* File truncated at bufrem. Remaining is 0 */ + bufrem = 0; + buf = NULL; + } else { + if (debug & DEBUG_FS_CREATE_IMAGE) + printf("zero-ing image `%s', %lld sectors, " + "using %d byte chunks\n", image, (long long)bufrem, + bufsize); + if ((buf = calloc(1, bufsize)) == NULL) { + warn("Can't create buffer for sector"); + return (-1); + } } while (bufrem > 0) { i = write(fsopts->fd, buf, MIN(bufsize, bufrem)); @@ -511,7 +523,8 @@ ffs_create_image(const char *image, fsin } bufrem -= i; } - free(buf); + if (buf) + free(buf); /* make the file system */ if (debug & DEBUG_FS_CREATE_IMAGE) Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Wed Aug 22 05:38:06 2012 (r239561) +++ head/usr.sbin/makefs/makefs.8 Wed Aug 22 06:37:30 2012 (r239562) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2012 +.Dd August 22, 2012 .Dt MAKEFS 8 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nd create a file system image from a directory tree or a mtree manifest .Sh SYNOPSIS .Nm +.Op Fl p .Op Fl x .Op Fl B Ar byte-order .Op Fl b Ar free-blocks @@ -188,6 +189,8 @@ Set file system specific options. .Ar fs-options is a comma separated list of options. Valid file system specific options are detailed below. +.It Fl p +Create the image as a sparse file. .It Fl S Ar sector-size Set the file system sector size to .Ar sector-size . Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Wed Aug 22 05:38:06 2012 (r239561) +++ head/usr.sbin/makefs/makefs.c Wed Aug 22 06:37:30 2012 (r239562) @@ -112,7 +112,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:d:f:F:M:m:N:o:s:S:t:x")) != -1) { + while ((ch = getopt(argc, argv, "B:b:d:f:F:M:m:N:o:ps:S:t:x")) != -1) { switch (ch) { case 'B': @@ -199,6 +199,9 @@ main(int argc, char *argv[]) } break; } + case 'p': + fsoptions.sparse = 1; + break; case 's': fsoptions.minsize = fsoptions.maxsize = @@ -346,7 +349,7 @@ usage(void) fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n" +"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x] [-p]\n" "\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Wed Aug 22 05:38:06 2012 (r239561) +++ head/usr.sbin/makefs/makefs.h Wed Aug 22 06:37:30 2012 (r239562) @@ -129,6 +129,7 @@ typedef struct { int freeblockpc; /* free block % */ int needswap; /* non-zero if byte swapping needed */ int sectorsize; /* sector size */ + int sparse; /* sparse image, don't fill it with zeros */ void *fs_specific; /* File system specific additions. */ } fsinfo_t; From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 08:27:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C73D4106564A; Wed, 22 Aug 2012 08:27:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7FC48FC14; Wed, 22 Aug 2012 08:27:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7M8Rb5a096137; Wed, 22 Aug 2012 08:27:37 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M8RbPm096132; Wed, 22 Aug 2012 08:27:37 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201208220827.q7M8RbPm096132@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 22 Aug 2012 08:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239563 - in stable/8/usr.sbin: . pkg X-BeenThere: svn-src-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, 22 Aug 2012 08:27:37 -0000 Author: bapt Date: Wed Aug 22 08:27:37 2012 New Revision: 239563 URL: http://svn.freebsd.org/changeset/base/239563 Log: MFC: r234313,234315,234322,234351,234870,235726,238461 add usr.sbin/pkg which is a bootstrap tool for pkgng. it respects PACKAGESITE, PACKAGEROOT, and a new environment variable ABI (if a user want to use a different API from the base one for its packages) it has no man page on purpose to avoid hidding the pkg(8) man page from the pkgng package. for now uses pkgbeta.FreeBSD.org as default mirror to find its package it respects MK_PKGTOOLS Added: - copied from r234313, head/usr.sbin/pkg/ Directory Properties: stable/8/usr.sbin/pkg/ (props changed) Modified: stable/8/usr.sbin/Makefile (contents, props changed) stable/8/usr.sbin/pkg/Makefile stable/8/usr.sbin/pkg/pkg.c Directory Properties: stable/8/usr.sbin/ (props changed) Modified: stable/8/usr.sbin/Makefile ============================================================================== --- stable/8/usr.sbin/Makefile Wed Aug 22 06:37:30 2012 (r239562) +++ stable/8/usr.sbin/Makefile Wed Aug 22 08:27:37 2012 (r239563) @@ -364,6 +364,7 @@ _ftp-proxy= ftp-proxy .if ${MK_PKGTOOLS} != "no" _pkg_install= pkg_install +SUBDIR+= pkg .endif # XXX MK_TOOLCHAIN? Modified: stable/8/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Sun Apr 15 15:13:36 2012 (r234313) +++ stable/8/usr.sbin/pkg/Makefile Wed Aug 22 08:27:37 2012 (r239563) @@ -4,6 +4,7 @@ PROG= pkg SRC= pkg.c NO_MAN= yes +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} LDADD= -larchive -lelf -lfetch .include Modified: stable/8/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sun Apr 15 15:13:36 2012 (r234313) +++ stable/8/usr.sbin/pkg/pkg.c Wed Aug 22 08:27:37 2012 (r239563) @@ -27,11 +27,10 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include #include #include +#include #include #include @@ -39,24 +38,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include #include #include -#include #include "elf_tables.h" #define _LOCALBASE "/usr/local" #define _PKGS_URL "http://pkgbeta.FreeBSD.org" -#define _DEFAULT_TMP "/tmp" static const char * -elf_corres_to_string(struct _elf_corres* m, int e) +elf_corres_to_string(struct _elf_corres *m, int e) { - int i = 0; + int i; for (i = 0; m[i].string != NULL; i++) if (m[i].elf_nb == e) @@ -69,29 +68,30 @@ static int pkg_get_myabi(char *dest, size_t sz) { Elf *elf; - GElf_Ehdr elfhdr; - GElf_Shdr shdr; Elf_Data *data; Elf_Note note; Elf_Scn *scn; char *src, *osname; const char *abi; + GElf_Ehdr elfhdr; + GElf_Shdr shdr; int fd, i, ret; uint32_t version; version = 0; - ret = 0; + ret = -1; scn = NULL; abi = NULL; if (elf_version(EV_CURRENT) == EV_NONE) { - warnx("ELF library initialization failed: %s", elf_errmsg(-1)); - return -1; + warnx("ELF library initialization failed: %s", + elf_errmsg(-1)); + return (-1); } if ((fd = open("/bin/sh", O_RDONLY)) < 0) { warn("open()"); - return -1; + return (-1); } if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { @@ -119,13 +119,13 @@ pkg_get_myabi(char *dest, size_t sz) if (scn == NULL) { ret = -1; - warn("fail to get the note section"); + warn("failed to get the note section"); goto cleanup; } data = elf_getdata(scn, NULL); src = data->d_buf; - while (1) { + for (;;) { memcpy(¬e, src, sizeof(Elf_Note)); src += sizeof(Elf_Note); if (note.n_type == NT_VERSION) @@ -143,52 +143,50 @@ pkg_get_myabi(char *dest, size_t sz) osname[i] = (char)tolower(osname[i]); snprintf(dest, sz, "%s:%d:%s:%s", - osname, - version / 100000, - elf_corres_to_string(mach_corres, (int) elfhdr.e_machine), + osname, version / 100000, + elf_corres_to_string(mach_corres, (int)elfhdr.e_machine), elf_corres_to_string(wordsize_corres, - (int)elfhdr.e_ident[EI_CLASS])); + (int)elfhdr.e_ident[EI_CLASS])); + + ret = 0; switch (elfhdr.e_machine) { - case EM_ARM: - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s:%s", - elf_corres_to_string(endian_corres, - (int) elfhdr.e_ident[EI_DATA]), - (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? - "eabi" : "oabi", - (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? - "softfp" : "vfp"); + case EM_ARM: + snprintf(dest + strlen(dest), sz - strlen(dest), + ":%s:%s:%s", elf_corres_to_string(endian_corres, + (int)elfhdr.e_ident[EI_DATA]), + (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? + "eabi" : "oabi", + (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? + "softfp" : "vfp"); + break; + case EM_MIPS: + /* + * this is taken from binutils sources: + * include/elf/mips.h + * mapping is figured out from binutils: + * gas/config/tc-mips.c + */ + switch (elfhdr.e_flags & EF_MIPS_ABI) { + case E_MIPS_ABI_O32: + abi = "o32"; break; - case EM_MIPS: - /* - * this is taken from binutils sources: - * include/elf/mips.h - * mapping is figured out from binutils: - * gas/config/tc-mips.c - */ - switch (elfhdr.e_flags & EF_MIPS_ABI) { - case E_MIPS_ABI_O32: - abi = "o32"; - break; - case E_MIPS_ABI_N32: - abi = "n32"; - break; - default: - if (elfhdr.e_ident[EI_DATA] == - ELFCLASS32) - abi = "o32"; - else if (elfhdr.e_ident[EI_DATA] == - ELFCLASS64) - abi = "n64"; - break; - } - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s", - elf_corres_to_string(endian_corres, - (int) elfhdr.e_ident[EI_DATA]), - abi); + case E_MIPS_ABI_N32: + abi = "n32"; + break; + default: + if (elfhdr.e_ident[EI_DATA] == + ELFCLASS32) + abi = "o32"; + else if (elfhdr.e_ident[EI_DATA] == + ELFCLASS64) + abi = "n64"; break; + } + snprintf(dest + strlen(dest), sz - strlen(dest), + ":%s:%s", elf_corres_to_string(endian_corres, + (int)elfhdr.e_ident[EI_DATA]), abi); + break; } cleanup: @@ -207,17 +205,22 @@ extract_pkg_static(int fd, char *p, int char *end; int ret, r; - ret = 0; + ret = -1; a = archive_read_new(); + if (a == NULL) { + warn("archive_read_new"); + return (ret); + } archive_read_support_compression_all(a); archive_read_support_format_tar(a); - lseek(fd, 0, 0); + if (lseek(fd, 0, 0) == -1) { + warn("lseek"); + goto cleanup; + } if (archive_read_open_fd(a, fd, 4096) != ARCHIVE_OK) { - warnx("archive_read_open_fd: %s", - archive_error_string(a)); - ret = -1; + warnx("archive_read_open_fd: %s", archive_error_string(a)); goto cleanup; } @@ -229,22 +232,22 @@ extract_pkg_static(int fd, char *p, int if (strcmp(end, "/pkg-static") == 0) { r = archive_read_extract(a, ae, - ARCHIVE_EXTRACT_OWNER |ARCHIVE_EXTRACT_PERM| - ARCHIVE_EXTRACT_TIME |ARCHIVE_EXTRACT_ACL | - ARCHIVE_EXTRACT_FFLAGS|ARCHIVE_EXTRACT_XATTR); - snprintf(p, sz, archive_entry_pathname(ae)); + ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM | + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_ACL | + ARCHIVE_EXTRACT_FFLAGS | ARCHIVE_EXTRACT_XATTR); + strlcpy(p, archive_entry_pathname(ae), sz); break; } } - if (r != ARCHIVE_OK) { + if (r == ARCHIVE_OK) + ret = 0; + else warnx("fail to extract pkg-static"); - ret = -1; - } cleanup: archive_read_finish(a); - return ret; + return (ret); } @@ -255,129 +258,185 @@ install_pkg_static(char *path, char *pkg pid_t pid; switch ((pid = fork())) { - case -1: - return (-1); - case 0: - execl(path, "pkg-static", "add", pkgpath, (char *)NULL); - _exit(1); /* NOT REACHED */ - default: - break; + case -1: + return (-1); + case 0: + execl(path, "pkg-static", "add", pkgpath, (char *)NULL); + _exit(1); + default: + break; } - while (waitpid(pid, &pstat, 0) == -1) { + while (waitpid(pid, &pstat, 0) == -1) if (errno != EINTR) return (-1); - } - return (WEXITSTATUS(pstat)); + if (WEXITSTATUS(pstat)) + return (WEXITSTATUS(pstat)); + else if (WIFSIGNALED(pstat)) + return (128 & (WTERMSIG(pstat))); + return (pstat); } static int bootstrap_pkg(void) { - struct url_stat st; FILE *remote; - time_t begin_dl; - time_t now; - time_t last = 0; + FILE *config; + char *site; char url[MAXPATHLEN]; + char conf[MAXPATHLEN]; char abi[BUFSIZ]; char tmppkg[MAXPATHLEN]; char buf[10240]; char pkgstatic[MAXPATHLEN]; int fd, retry, ret; + struct url_stat st; off_t done, r; + time_t now; + time_t last; done = 0; - ret = 0; - retry = 3; + last = 0; + ret = -1; remote = NULL; + config = NULL; - printf("Bootstraping pkg please wait\n"); + printf("Bootstrapping pkg please wait\n"); if (pkg_get_myabi(abi, MAXPATHLEN) != 0) { - warnx("fail to determine my abi"); - return -1; + warnx("failed to determine the system ABI"); + return (-1); } - if (getenv("PACKAGESITE") != NULL) { - snprintf(url, MAXPATHLEN, "%s/pkg.txz", - getenv("PACKAGESITE")); - } else { + if (getenv("PACKAGESITE") != NULL) + snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", getenv("PACKAGESITE")); + else snprintf(url, MAXPATHLEN, "%s/%s/latest/Latest/pkg.txz", getenv("PACKAGEROOT") ? getenv("PACKAGEROOT") : _PKGS_URL, getenv("ABI") ? getenv("ABI") : abi); - } snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : "/tmp"); + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); if ((fd = mkstemp(tmppkg)) == -1) { warn("mkstemp()"); - return -1; + return (-1); } - while (remote == NULL) { + retry = 3; + do { remote = fetchXGetURL(url, &st, ""); - if (remote == NULL) { - --retry; - if (retry == 0) { - warnx("Error fetching %s: %s", url, - fetchLastErrString); - ret = 1; - goto cleanup; - } + if (remote == NULL) sleep(1); - } - } + } while (remote == NULL && retry-- > 0); + + if (remote == NULL) + goto fetchfail; - begin_dl = time(NULL); while (done < st.size) { if ((r = fread(buf, 1, sizeof(buf), remote)) < 1) break; if (write(fd, buf, r) != r) { warn("write()"); - ret = -1; goto cleanup; } done += r; now = time(NULL); - if (now > last || done == st.size) { + if (now > last || done == st.size) last = now; - } } - if (ferror(remote)) { - warnx("Error fetching %s: %s", url, - fetchLastErrString); - ret = 1; - goto cleanup; - } + if (ferror(remote)) + goto fetchfail; if ((ret = extract_pkg_static(fd, pkgstatic, MAXPATHLEN)) == 0) ret = install_pkg_static(pkgstatic, tmppkg); + snprintf(conf, MAXPATHLEN, "%s/etc/pkg.conf", + getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); + + if (access(conf, R_OK) == -1) { + site = strrchr(url, '/'); + if (site == NULL) + goto cleanup; + site[0] = '\0'; + site = strrchr(url, '/'); + if (site == NULL) + goto cleanup; + site[0] = '\0'; + + config = fopen(conf, "w+"); + if (config == NULL) + goto cleanup; + fprintf(config, "packagesite: %s\n", url); + fclose(config); + } + + goto cleanup; + +fetchfail: + warnx("Error fetching %s: %s", url, fetchLastErrString); + cleanup: + if (remote != NULL) + fclose(remote); close(fd); unlink(tmppkg); - return 0; + return (ret); +} + +static const char confirmation_message[] = +"The package management tool is not yet installed on your system.\n" +"Do you want to fetch and install it now? [y/N]: "; + +static int +pkg_query_yes_no(void) +{ + int ret, c; + + c = getchar(); + + if (c == 'y' || c == 'Y') + ret = 1; + else + ret = 0; + + while (c != '\n' && c != EOF) + c = getchar(); + + return (ret); } int -main(__unused int argc, char * argv[]) +main(__unused int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", - getenv("LOCALBASE") ? getenv("LOCALBASE"): _LOCALBASE); + getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); - if (access(pkgpath, X_OK) == -1) - bootstrap_pkg(); + if (access(pkgpath, X_OK) == -1) { + /* + * Do not ask for confirmation if either of stdin or stdout is + * not tty. Check the environment to see if user has answer + * tucked in there already. + */ + if (getenv("ALWAYS_ASSUME_YES") == NULL && + isatty(fileno(stdin))) { + printf("%s", confirmation_message); + if (pkg_query_yes_no() == 0) + exit(EXIT_FAILURE); + } + if (bootstrap_pkg() != 0) + exit(EXIT_FAILURE); + } execv(pkgpath, argv); - return (EXIT_SUCCESS); + /* NOT REACHED */ + return (EXIT_FAILURE); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 10:17:07 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59908106566C; Wed, 22 Aug 2012 10:17:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id CA8DD8FC0A; Wed, 22 Aug 2012 10:17:06 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q7MAH5El033843; Wed, 22 Aug 2012 14:17:05 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q7MAH5TS033842; Wed, 22 Aug 2012 14:17:05 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 22 Aug 2012 14:17:05 +0400 From: Gleb Smirnoff To: "Kenneth D. Merry" Message-ID: <20120822101705.GL20560@FreeBSD.org> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> <20120821185014.GA28272@nargothrond.kdm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120821185014.GA28272@nargothrond.kdm.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: r238990 - in head/sys: net netinet netinet6 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, 22 Aug 2012 10:17:07 -0000 On Tue, Aug 21, 2012 at 12:50:14PM -0600, Kenneth D. Merry wrote: K> On Thu, Aug 02, 2012 at 13:57:50 +0000, Gleb Smirnoff wrote: K> > Author: glebius K> > Date: Thu Aug 2 13:57:49 2012 K> > New Revision: 238990 K> > URL: http://svn.freebsd.org/changeset/base/238990 K> > K> > Log: K> > Fix races between in_lltable_prefix_free(), lla_lookup(), K> > llentry_free() and arptimer(): K> > K> > o Use callout_init_rw() for lle timeout, this allows us safely K> > disestablish them. K> > - This allows us to simplify the arptimer() and make it K> > race safe. K> > o Consistently use ifp->if_afdata_lock to lock access to K> > linked lists in the lle hashes. K> > o Introduce new lle flag LLE_LINKED, which marks an entry that K> > is attached to the hash. K> > - Use LLE_LINKED to avoid double unlinking via consequent K> > calls to llentry_free(). K> > - Mark lle with LLE_DELETED via |= operation istead of =, K> > so that other flags won't be lost. K> > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more K> > consistent and provide more informative KASSERTs. K> > K> > The patch is a collaborative work of all submitters and myself. K> > K> > PR: kern/165863 K> > Submitted by: Andrey Zonov K> > Submitted by: Ryan Stone K> > Submitted by: Eric van Gyzen K> K> I'm running into this on stable/9, any plan on when this will get MFCed? I'm sorry, but after 9.1-RELEASE. Too large change to run MFC prior to release. I'd appreciate if you patch your stable/9 system manually and thus perform some testing prior to merge. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 11:45:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEC631065672; Wed, 22 Aug 2012 11:45:00 +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 38B278FC0A; Wed, 22 Aug 2012 11:44:59 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q7MBj5gt057748; Wed, 22 Aug 2012 14:45:05 +0300 (EEST) (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.5/8.14.5) with ESMTP id q7MBiqkR003085; Wed, 22 Aug 2012 14:44:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q7MBiqLs003084; Wed, 22 Aug 2012 14:44:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 22 Aug 2012 14:44:52 +0300 From: Konstantin Belousov To: Gleb Smirnoff Message-ID: <20120822114452.GC33100@deviant.kiev.zoral.com.ua> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> <20120821185014.GA28272@nargothrond.kdm.org> <20120822101705.GL20560@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4ehG9HxkuyoI6jtY" Content-Disposition: inline In-Reply-To: <20120822101705.GL20560@FreeBSD.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=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham 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, "Kenneth D. Merry" Subject: Re: svn commit: r238990 - in head/sys: net netinet netinet6 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, 22 Aug 2012 11:45:01 -0000 --4ehG9HxkuyoI6jtY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 22, 2012 at 02:17:05PM +0400, Gleb Smirnoff wrote: > On Tue, Aug 21, 2012 at 12:50:14PM -0600, Kenneth D. Merry wrote: > K> On Thu, Aug 02, 2012 at 13:57:50 +0000, Gleb Smirnoff wrote: > K> > Author: glebius > K> > Date: Thu Aug 2 13:57:49 2012 > K> > New Revision: 238990 > K> > URL: http://svn.freebsd.org/changeset/base/238990 > K> >=20 > K> > Log: > K> > Fix races between in_lltable_prefix_free(), lla_lookup(), > K> > llentry_free() and arptimer(): > K> > =20 > K> > o Use callout_init_rw() for lle timeout, this allows us safely > K> > disestablish them. > K> > - This allows us to simplify the arptimer() and make it > K> > race safe. > K> > o Consistently use ifp->if_afdata_lock to lock access to > K> > linked lists in the lle hashes. > K> > o Introduce new lle flag LLE_LINKED, which marks an entry that > K> > is attached to the hash. > K> > - Use LLE_LINKED to avoid double unlinking via consequent > K> > calls to llentry_free(). > K> > - Mark lle with LLE_DELETED via |=3D operation istead of =3D, > K> > so that other flags won't be lost. > K> > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more > K> > consistent and provide more informative KASSERTs. > K> > =20 > K> > The patch is a collaborative work of all submitters and myself. > K> > =20 > K> > PR: kern/165863 > K> > Submitted by: Andrey Zonov > K> > Submitted by: Ryan Stone > K> > Submitted by: Eric van Gyzen > K>=20 > K> I'm running into this on stable/9, any plan on when this will get MFCe= d? >=20 > I'm sorry, but after 9.1-RELEASE. Too large change to run MFC prior to > release. >=20 > I'd appreciate if you patch your stable/9 system manually and thus > perform some testing prior to merge. FYI, 9.1 was already branched. Not that I encourage you to make a commit that would diverge the stable/9 from releng/9.1 while 9.1 is still rolling. But the stall on stable/9 due to freeze was too long and IMO its longevity is damaging. --4ehG9HxkuyoI6jtY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlA0xjQACgkQC3+MBN1Mb4hYFACdHdKc9PtlFDgJnhctZHQ8m4m8 BRUAn1+Pmt4sz+d+ASkEg0eZlZJ2wAMl =vVzQ -----END PGP SIGNATURE----- --4ehG9HxkuyoI6jtY-- From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 13:53:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3DEF1106564A; Wed, 22 Aug 2012 13:53:38 +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 0EE918FC15; Wed, 22 Aug 2012 13:53:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MDrbpV039554; Wed, 22 Aug 2012 13:53:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MDrbYB039551; Wed, 22 Aug 2012 13:53:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208221353.q7MDrbYB039551@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 13:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239564 - 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: Wed, 22 Aug 2012 13:53:38 -0000 Author: jhb Date: Wed Aug 22 13:53:37 2012 New Revision: 239564 URL: http://svn.freebsd.org/changeset/base/239564 Log: Revert r239356 and use an alternate algorithm. First, don't exit when the link goes down on an interface. Instead, teach dhclient to track changes in link state and to enter the reboot state when the link on an interface goes up causing dhclient to attempt to renew its existing lease. Second, remove the change I added to clear the old lease when dhclient exits due to an error (such as ifconfig down). If an interface is using autoconfiguration it should keep its autoconfiguration as much as possible. If the next time it needs a configuration it is able to reuse the previous autoconfiguration, then leaving the settings intact allows existing connections to survive temporary outages, etc. PR: bin/166656 MFC after: 1 month Modified: head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcpd.h Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Aug 22 08:27:37 2012 (r239563) +++ head/sbin/dhclient/dhclient.c Wed Aug 22 13:53:37 2012 (r239564) @@ -218,6 +218,7 @@ routehandler(struct protocol *p) struct sockaddr *sa; struct iaddr a; ssize_t n; + int linkstat; n = read(routefd, &msg, sizeof(msg)); rtm = (struct rt_msghdr *)msg; @@ -278,10 +279,14 @@ routehandler(struct protocol *p) ifi->name); goto die; } - if (!interface_link_status(ifi->name)) { - warning("Interface %s is down, dhclient exiting", - ifi->name); - goto die; + linkstat = interface_link_status(ifi->name); + if (linkstat != ifi->linkstat) { + debug("%s link state %s -> %s", ifi->name, + ifi->linkstat ? "up" : "down", + linkstat ? "up" : "down"); + ifi->linkstat = linkstat; + if (linkstat) + state_reboot(ifi); } break; case RTM_IFANNOUNCE: @@ -321,8 +326,6 @@ routehandler(struct protocol *p) die: script_init("FAIL", NULL); - if (ifi->client->active) - script_write_params("old_", ifi->client->active); if (ifi->client->alias) script_write_params("alias_", ifi->client->alias); script_go(); @@ -437,6 +440,7 @@ main(int argc, char *argv[]) } fprintf(stderr, " got link\n"); } + ifi->linkstat = 1; if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1) error("cannot open %s: %m", _PATH_DEVNULL); Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Wed Aug 22 08:27:37 2012 (r239563) +++ head/sbin/dhclient/dhcpd.h Wed Aug 22 13:53:37 2012 (r239564) @@ -208,6 +208,7 @@ struct interface_info { int errors; int dead; u_int16_t index; + int linkstat; }; struct timeout { From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 15:27:58 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD337106564A; Wed, 22 Aug 2012 15:27:58 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id B330F8FC12; Wed, 22 Aug 2012 15:27:57 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:7258:12ff:fe22:d94b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7MFRksi012875 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 23 Aug 2012 00:27:52 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 23 Aug 2012 00:27:46 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov In-Reply-To: <20120822000645.GA54651@vniz.net> References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> <20120822000645.GA54651@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-PRERELEASE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Thu, 23 Aug 2012 00:27:52 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - 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: Wed, 22 Aug 2012 15:27:58 -0000 Hi, >>>>> On Wed, 22 Aug 2012 04:06:46 +0400 >>>>> Andrey Chernov said: ache> BTW, I notice that link-local router address behavior is ache> strange and inconsistant for both 'host -6' and 'dig -6' commands. ache> host -6 example.com fe80:: ache> dig -6 @fe80:: example.com ache> both hangs, but in the same time ache> host -6 example.com fe80::% ache> dig -6 @fe80::% example.com ache> works! ache> host -6 example.com fe80::%1 ache> dig -6 #fe80::%1 example.com ache> works too. Not understanding addresses without % or %1 looks like ache> routing problems, but I don't know where to fix it. A link-local address has a scope; an interface here. You cannot omit it on FreeBSD by default. To be able to omit it, specify something like ipv6_default_interface="em0" in your /etc/rc.conf. ache> So, I try to use ache> nameserver fe80::% (or with %1 suffix) ache> in my resolv.conf, as result ache> host -6 example.com ache> dig -6 example.com ache> (without NS specified) both hangs despite they working when exact the same ache> NS address is given in their command lines. Our stub resolver in libc should work with a link-local address as nameserver. However, host(1) and dig(1) don't use the stub resolver in libc, and use its own resolver. I suspect host(1) and dig(1) have some problem in handling a link-local address. In anyway, I don't recommend to use a link-local address for DNS. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 16:09:20 2012 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 C74601065670; Wed, 22 Aug 2012 16:09:20 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1878FC12; Wed, 22 Aug 2012 16:09:20 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q7MG9Exu003861; Wed, 22 Aug 2012 10:09:14 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q7MG9EfR003860; Wed, 22 Aug 2012 10:09:14 -0600 (MDT) (envelope-from ken) Date: Wed, 22 Aug 2012 10:09:14 -0600 From: "Kenneth D. Merry" To: Gleb Smirnoff Message-ID: <20120822160914.GA1194@nargothrond.kdm.org> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> <20120821185014.GA28272@nargothrond.kdm.org> <20120822101705.GL20560@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120822101705.GL20560@FreeBSD.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238990 - in head/sys: net netinet netinet6 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, 22 Aug 2012 16:09:20 -0000 On Wed, Aug 22, 2012 at 14:17:05 +0400, Gleb Smirnoff wrote: > On Tue, Aug 21, 2012 at 12:50:14PM -0600, Kenneth D. Merry wrote: > K> On Thu, Aug 02, 2012 at 13:57:50 +0000, Gleb Smirnoff wrote: > K> > Author: glebius > K> > Date: Thu Aug 2 13:57:49 2012 > K> > New Revision: 238990 > K> > URL: http://svn.freebsd.org/changeset/base/238990 > K> > > K> > Log: > K> > Fix races between in_lltable_prefix_free(), lla_lookup(), > K> > llentry_free() and arptimer(): > K> > > K> > o Use callout_init_rw() for lle timeout, this allows us safely > K> > disestablish them. > K> > - This allows us to simplify the arptimer() and make it > K> > race safe. > K> > o Consistently use ifp->if_afdata_lock to lock access to > K> > linked lists in the lle hashes. > K> > o Introduce new lle flag LLE_LINKED, which marks an entry that > K> > is attached to the hash. > K> > - Use LLE_LINKED to avoid double unlinking via consequent > K> > calls to llentry_free(). > K> > - Mark lle with LLE_DELETED via |= operation istead of =, > K> > so that other flags won't be lost. > K> > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more > K> > consistent and provide more informative KASSERTs. > K> > > K> > The patch is a collaborative work of all submitters and myself. > K> > > K> > PR: kern/165863 > K> > Submitted by: Andrey Zonov > K> > Submitted by: Ryan Stone > K> > Submitted by: Eric van Gyzen > K> > K> I'm running into this on stable/9, any plan on when this will get MFCed? > > I'm sorry, but after 9.1-RELEASE. Too large change to run MFC prior to > release. I understand. > I'd appreciate if you patch your stable/9 system manually and thus > perform some testing prior to merge. I'm running stable/9 from late March (we're working on merging a newer version of stable/9), and have merged in these changes from head: 237571, 238222, 238945, 238967, 238990 At the moment I'm getting a panic inside arptimer: Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x0 fault code = supervisor read instruction, page not present instruction pointer = 0x20:0x0 stack pointer = 0x28:0xffffff800027da40 frame pointer = 0x28:0xffffff800027da80 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (swi4: clock) [ thread pid 12 tid 100010 ] Stopped at 0: *** error reading from address 0 *** db> bt Tracing pid 12 tid 100010 td 0xfffffe00072158e0 uart_sab82532_class() at 0 arptimer() at arptimer+0xd0 softclock() at softclock+0x2ba intr_event_execute_handlers() at intr_event_execute_handlers+0x66 ithread_loop() at ithread_loop+0xb2 fork_exit() at fork_exit+0x135 fork_trampoline() at fork_trampoline+0xe --- trap 0, rip = 0, rsp = 0xffffff800027dcf0, rbp = 0 --- db> It looks like it's inside llentry_free(): (kgdb) up 15 #15 0xffffffff8056b420 in arptimer (arg=Variable "arg" is not available. ) at /usr/home/kenm/perforce7/sys/netinet/if_ether.c:189 189 pkts_dropped = llentry_free(lle); (kgdb) list 184 /* XXX: LOR avoidance. We still have ref on lle. */ 185 LLE_WUNLOCK(lle); 186 IF_AFDATA_LOCK(ifp); 187 LLE_WLOCK(lle); 188 LLE_REMREF(lle); 189 pkts_dropped = llentry_free(lle); 190 IF_AFDATA_UNLOCK(ifp); 191 ARPSTAT_ADD(dropped, pkts_dropped); 192 ARPSTAT_INC(timeouts); 193 CURVNET_RESTORE(); (kgdb) print lle $1 = (struct llentry *) 0xfffffe000aea8600 (kgdb) print *lle $2 = {lle_next = {le_next = 0x0, le_prev = 0xfffffe000a36dcd0}, lle_lock = { lock_object = {lo_name = 0xffffffff8090cc65 "lle", lo_flags = 73596928, lo_data = 0, lo_witness = 0x0}, rw_lock = 18446741874805922016}, lle_tbl = 0xfffffe000a36dc00, lle_head = 0xfffffe000a36dcd0, lle_free = 0, la_hold = 0x0, la_numheld = 0, la_expire = 33571, la_flags = 8192, la_asked = 0, la_preempt = 5, ln_byhint = 0, ln_state = 0, ln_router = 0, ln_ntick = 0, lle_refcnt = 1, ll_addr = {mac_aligned = 55295740969106, mac16 = {32914, 35583, 12874}}, lle_timer = {ln_timer_ch = {c_links = { sle = {sle_next = 0x0}, tqe = {tqe_next = 0x0, tqe_prev = 0xffffff81ed7e4760}}, c_time = 3357036, c_arg = 0xfffffe000aea8600, c_func = 0xffffffff8056b350 , c_lock = 0xfffffe000aea8610, c_flags = 16, c_cpu = 0}, la_timer = { c_links = {sle = {sle_next = 0x0}, tqe = {tqe_next = 0x0, tqe_prev = 0xffffff81ed7e4760}}, c_time = 3357036, c_arg = 0xfffffe000aea8600, c_func = 0xffffffff8056b350 , c_lock = 0xfffffe000aea8610, c_flags = 16, c_cpu = 0}}} (kgdb) down #14 0xffffffff80554950 in llentry_free (lle=0xfffffe000aea8600) at /usr/home/kenm/perforce7/sys/net/if_llatbl.c:137 137 LLE_FREE_LOCKED(lle); (kgdb) list 132 133 KASSERT(lle->la_numheld == 0, 134 ("%s: la_numheld %d > 0, pkts_droped %zd", __func__, 135 lle->la_numheld, pkts_dropped)); 136 137 LLE_FREE_LOCKED(lle); 138 139 return (pkts_dropped); 140 } 141 (kgdb) print lle->lle_free $3 = (void (*)(struct lltable *, struct llentry *)) 0 Looks like I'm missing SVN rev 232054. I'll merge that and try again. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 16:18:19 2012 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 314181065670; Wed, 22 Aug 2012 16:18:19 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from canonware.com (10140.x.rootbsd.net [204.109.63.53]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2FE8FC08; Wed, 22 Aug 2012 16:18:19 +0000 (UTC) Received: from [192.168.168.12] (70-91-206-178-BusName-SFBA.hfc.comcastbusiness.net [70.91.206.178]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id 784EE28419; Wed, 22 Aug 2012 09:11:16 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) From: Jason Evans In-Reply-To: <50334957.6020201@FreeBSD.org> Date: Wed, 22 Aug 2012 09:11:15 -0700 Content-Transfer-Encoding: 7bit Message-Id: <64C5CE7C-1AB5-4F19-A261-5A166470A12D@freebsd.org> References: <201208201833.q7KIX58p075876@svn.freebsd.org> <1T3c9K-000Jlb-7g@internal.tormail.org> <50334957.6020201@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1485) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jan Beich Subject: Re: jemalloc and clang (was: Re: svn commit: r239462 - in head) 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, 22 Aug 2012 16:18:19 -0000 On Aug 21, 2012, at 1:39 AM, Dimitry Andric wrote: > On 2012-08-21 02:17, Jan Beich wrote: > ... >> Time to revert r228540? >> >> Index: contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h >> =================================================================== >> --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (revision 239467) >> +++ contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (working copy) >> @@ -56,10 +56,6 @@ >> #ifndef JEMALLOC_TLS_MODEL >> # define JEMALLOC_TLS_MODEL /* Default. */ >> #endif >> -#ifdef __clang__ >> -# undef JEMALLOC_TLS_MODEL >> -# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ >> -#endif >> >> #define STATIC_PAGE_SHIFT PAGE_SHIFT >> #define LG_SIZEOF_INT 2 > > Well, if Jason would like to support upstream jemalloc for different > versions of clang, it is probably better to to use __has_feature() > instead. > > Jason, what do you think of the attached patch? Or could we just remove > the whole #ifdef __clang__ part? > I'm happy with the above patch (completely removing the #ifdef __clang__). Jason From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 17:13:01 2012 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 A56D2106566B; Wed, 22 Aug 2012 17:13:01 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8683D8FC0C; Wed, 22 Aug 2012 17:13:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MHD10p065366; Wed, 22 Aug 2012 17:13:01 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MHD1oc065361; Wed, 22 Aug 2012 17:13:01 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201208221713.q7MHD1oc065361@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 22 Aug 2012 17:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239565 - in stable/9/sys: kern 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: Wed, 22 Aug 2012 17:13:01 -0000 Author: mdf Date: Wed Aug 22 17:13:00 2012 New Revision: 239565 URL: http://svn.freebsd.org/changeset/base/239565 Log: MFC r238502: Fix a bug with memguard(9) on 32-bit architectures without a VM_KMEM_MAX_SIZE. The code was not taking into account the size of the kernel_map, which the kmem_map is allocated from, so it could produce a sub-map size too large to fit. The simplest solution is to ignore VM_KMEM_MAX entirely and base the memguard map's size off the kernel_map's size, since this is always relevant and always smaller. Found by: Justin Hibbits Modified: stable/9/sys/kern/kern_malloc.c stable/9/sys/vm/memguard.c stable/9/sys/vm/memguard.h stable/9/sys/vm/vm_map.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/kern/kern_malloc.c ============================================================================== --- stable/9/sys/kern/kern_malloc.c Wed Aug 22 13:53:37 2012 (r239564) +++ stable/9/sys/kern/kern_malloc.c Wed Aug 22 17:13:00 2012 (r239565) @@ -707,7 +707,7 @@ kmeminit(void *dummy) vm_kmem_size = 2 * mem_size * PAGE_SIZE; #ifdef DEBUG_MEMGUARD - tmp = memguard_fudge(vm_kmem_size, vm_kmem_size_max); + tmp = memguard_fudge(vm_kmem_size, kernel_map); #else tmp = vm_kmem_size; #endif Modified: stable/9/sys/vm/memguard.c ============================================================================== --- stable/9/sys/vm/memguard.c Wed Aug 22 13:53:37 2012 (r239564) +++ stable/9/sys/vm/memguard.c Wed Aug 22 17:13:00 2012 (r239565) @@ -156,16 +156,18 @@ SYSCTL_ULONG(_vm_memguard, OID_AUTO, fre * the kmem_map. The memguard memory will be a submap. */ unsigned long -memguard_fudge(unsigned long km_size, unsigned long km_max) +memguard_fudge(unsigned long km_size, const struct vm_map *parent_map) { - u_long mem_pgs = cnt.v_page_count; + u_long mem_pgs, parent_size; vm_memguard_divisor = 10; TUNABLE_INT_FETCH("vm.memguard.divisor", &vm_memguard_divisor); + parent_size = vm_map_max(parent_map) - vm_map_min(parent_map) + + PAGE_SIZE; /* Pick a conservative value if provided value sucks. */ if ((vm_memguard_divisor <= 0) || - ((km_size / vm_memguard_divisor) == 0)) + ((parent_size / vm_memguard_divisor) == 0)) vm_memguard_divisor = 10; /* * Limit consumption of physical pages to @@ -174,21 +176,19 @@ memguard_fudge(unsigned long km_size, un * This prevents memguard's page promotions from completely * using up memory, since most malloc(9) calls are sub-page. */ + mem_pgs = cnt.v_page_count; memguard_physlimit = (mem_pgs / vm_memguard_divisor) * PAGE_SIZE; /* * We want as much KVA as we can take safely. Use at most our - * allotted fraction of kmem_max. Limit this to twice the - * physical memory to avoid using too much memory as pagetable - * pages. + * allotted fraction of the parent map's size. Limit this to + * twice the physical memory to avoid using too much memory as + * pagetable pages (size must be multiple of PAGE_SIZE). */ - memguard_mapsize = km_max / vm_memguard_divisor; - /* size must be multiple of PAGE_SIZE */ - memguard_mapsize = round_page(memguard_mapsize); - if (memguard_mapsize == 0 || - memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) + memguard_mapsize = round_page(parent_size / vm_memguard_divisor); + if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; - if (km_max > 0 && km_size + memguard_mapsize > km_max) - return (km_max); + if (km_size + memguard_mapsize > parent_size) + memguard_mapsize = 0; return (km_size + memguard_mapsize); } Modified: stable/9/sys/vm/memguard.h ============================================================================== --- stable/9/sys/vm/memguard.h Wed Aug 22 13:53:37 2012 (r239564) +++ stable/9/sys/vm/memguard.h Wed Aug 22 17:13:00 2012 (r239565) @@ -35,7 +35,7 @@ struct malloc_type; struct vm_map; #ifdef DEBUG_MEMGUARD -unsigned long memguard_fudge(unsigned long, unsigned long); +unsigned long memguard_fudge(unsigned long, const struct vm_map *); void memguard_init(struct vm_map *); void *memguard_alloc(unsigned long, int); void *memguard_realloc(void *, unsigned long, struct malloc_type *, int); Modified: stable/9/sys/vm/vm_map.h ============================================================================== --- stable/9/sys/vm/vm_map.h Wed Aug 22 13:53:37 2012 (r239564) +++ stable/9/sys/vm/vm_map.h Wed Aug 22 17:13:00 2012 (r239565) @@ -200,13 +200,13 @@ struct vm_map { #ifdef _KERNEL static __inline vm_offset_t -vm_map_max(vm_map_t map) +vm_map_max(const struct vm_map *map) { return (map->max_offset); } static __inline vm_offset_t -vm_map_min(vm_map_t map) +vm_map_min(const struct vm_map *map) { return (map->min_offset); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 17:16:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17890106564A; Wed, 22 Aug 2012 17:16:06 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBD458FC15; Wed, 22 Aug 2012 17:16:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MHG5xB065782; Wed, 22 Aug 2012 17:16:05 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MHG5vq065777; Wed, 22 Aug 2012 17:16:05 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201208221716.q7MHG5vq065777@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 22 Aug 2012 17:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239566 - in stable/8/sys: kern vm X-BeenThere: svn-src-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, 22 Aug 2012 17:16:06 -0000 Author: mdf Date: Wed Aug 22 17:16:05 2012 New Revision: 239566 URL: http://svn.freebsd.org/changeset/base/239566 Log: MFC r238502: Fix a bug with memguard(9) on 32-bit architectures without a VM_KMEM_MAX_SIZE. The code was not taking into account the size of the kernel_map, which the kmem_map is allocated from, so it could produce a sub-map size too large to fit. The simplest solution is to ignore VM_KMEM_MAX entirely and base the memguard map's size off the kernel_map's size, since this is always relevant and always smaller. Found by: Justin Hibbits Modified: stable/8/sys/kern/kern_malloc.c stable/8/sys/vm/memguard.c stable/8/sys/vm/memguard.h stable/8/sys/vm/vm_map.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/kern/kern_malloc.c ============================================================================== --- stable/8/sys/kern/kern_malloc.c Wed Aug 22 17:13:00 2012 (r239565) +++ stable/8/sys/kern/kern_malloc.c Wed Aug 22 17:16:05 2012 (r239566) @@ -646,7 +646,7 @@ kmeminit(void *dummy) init_param3(vm_kmem_size / PAGE_SIZE); #ifdef DEBUG_MEMGUARD - tmp = memguard_fudge(vm_kmem_size, vm_kmem_size_max); + tmp = memguard_fudge(vm_kmem_size, kernel_map); #else tmp = vm_kmem_size; #endif Modified: stable/8/sys/vm/memguard.c ============================================================================== --- stable/8/sys/vm/memguard.c Wed Aug 22 17:13:00 2012 (r239565) +++ stable/8/sys/vm/memguard.c Wed Aug 22 17:16:05 2012 (r239566) @@ -156,16 +156,18 @@ SYSCTL_ULONG(_vm_memguard, OID_AUTO, fre * the kmem_map. The memguard memory will be a submap. */ unsigned long -memguard_fudge(unsigned long km_size, unsigned long km_max) +memguard_fudge(unsigned long km_size, const struct vm_map *parent_map) { - u_long mem_pgs = cnt.v_page_count; + u_long mem_pgs, parent_size; vm_memguard_divisor = 10; TUNABLE_INT_FETCH("vm.memguard.divisor", &vm_memguard_divisor); + parent_size = vm_map_max(parent_map) - vm_map_min(parent_map) + + PAGE_SIZE; /* Pick a conservative value if provided value sucks. */ if ((vm_memguard_divisor <= 0) || - ((km_size / vm_memguard_divisor) == 0)) + ((parent_size / vm_memguard_divisor) == 0)) vm_memguard_divisor = 10; /* * Limit consumption of physical pages to @@ -174,20 +176,19 @@ memguard_fudge(unsigned long km_size, un * This prevents memguard's page promotions from completely * using up memory, since most malloc(9) calls are sub-page. */ + mem_pgs = cnt.v_page_count; memguard_physlimit = (mem_pgs / vm_memguard_divisor) * PAGE_SIZE; /* * We want as much KVA as we can take safely. Use at most our - * allotted fraction of kmem_max. Limit this to twice the - * physical memory to avoid using too much memory as pagetable - * pages. + * allotted fraction of the parent map's size. Limit this to + * twice the physical memory to avoid using too much memory as + * pagetable pages (size must be multiple of PAGE_SIZE). */ - memguard_mapsize = km_max / vm_memguard_divisor; - /* size must be multiple of PAGE_SIZE */ - memguard_mapsize = round_page(memguard_mapsize); + memguard_mapsize = round_page(parent_size / vm_memguard_divisor); if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; - if (km_size + memguard_mapsize > km_max) - return (km_max); + if (km_size + memguard_mapsize > parent_size) + memguard_mapsize = 0; return (km_size + memguard_mapsize); } Modified: stable/8/sys/vm/memguard.h ============================================================================== --- stable/8/sys/vm/memguard.h Wed Aug 22 17:13:00 2012 (r239565) +++ stable/8/sys/vm/memguard.h Wed Aug 22 17:16:05 2012 (r239566) @@ -35,7 +35,7 @@ struct malloc_type; struct vm_map; #ifdef DEBUG_MEMGUARD -unsigned long memguard_fudge(unsigned long, unsigned long); +unsigned long memguard_fudge(unsigned long, const struct vm_map *); void memguard_init(struct vm_map *); void *memguard_alloc(unsigned long, int); void *memguard_realloc(void *, unsigned long, struct malloc_type *, int); Modified: stable/8/sys/vm/vm_map.h ============================================================================== --- stable/8/sys/vm/vm_map.h Wed Aug 22 17:13:00 2012 (r239565) +++ stable/8/sys/vm/vm_map.h Wed Aug 22 17:16:05 2012 (r239566) @@ -198,13 +198,13 @@ struct vm_map { #ifdef _KERNEL static __inline vm_offset_t -vm_map_max(vm_map_t map) +vm_map_max(const struct vm_map *map) { return (map->max_offset); } static __inline vm_offset_t -vm_map_min(vm_map_t map) +vm_map_min(const struct vm_map *map) { return (map->min_offset); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 18:30:13 2012 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 BFE921065672; Wed, 22 Aug 2012 18:30:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5A3A8FC16; Wed, 22 Aug 2012 18:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MIUDWr076178; Wed, 22 Aug 2012 18:30:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MIUDFa076175; Wed, 22 Aug 2012 18:30:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208221830.q7MIUDFa076175@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 22 Aug 2012 18:30: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: r239567 - in head/sys/dev/usb: . serial 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, 22 Aug 2012 18:30:13 -0000 Author: hselasky Date: Wed Aug 22 18:30:13 2012 New Revision: 239567 URL: http://svn.freebsd.org/changeset/base/239567 Log: Add new USB device ID. Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Wed Aug 22 17:16:05 2012 (r239566) +++ head/sys/dev/usb/serial/uftdi.c Wed Aug 22 18:30:13 2012 (r239567) @@ -434,6 +434,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, SEMC_DSS20, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_2232D, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_232RL, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, SERIAL_4232H, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_8U100AX, UFTDI_TYPE_SIO), UFTDI_DEV(FTDI, SERIAL_8U232AM, UFTDI_TYPE_8U232AM), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Aug 22 17:16:05 2012 (r239566) +++ head/sys/dev/usb/usbdevs Wed Aug 22 18:30:13 2012 (r239567) @@ -1699,6 +1699,7 @@ product FSC E5400 0x1009 PrismGT USB 2. product FTDI SERIAL_8U100AX 0x8372 8U100AX Serial product FTDI SERIAL_8U232AM 0x6001 8U232AM Serial product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial +product FTDI SERIAL_232RL 0x6006 FT232RL Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI 232H 0x6014 FTDI compatible adapter product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 18:35:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8EEFD106566C; Wed, 22 Aug 2012 18:35:18 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 605968FC1A; Wed, 22 Aug 2012 18:35:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MIZIJe076857; Wed, 22 Aug 2012 18:35:18 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MIZI77076855; Wed, 22 Aug 2012 18:35:18 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208221835.q7MIZI77076855@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 18:35: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: r239568 - 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: Wed, 22 Aug 2012 18:35:20 -0000 Author: obrien Date: Wed Aug 22 18:35:17 2012 New Revision: 239568 URL: http://svn.freebsd.org/changeset/base/239568 Log: Add dependencies based on security(7). Modified: head/etc/rc.d/securelevel Modified: head/etc/rc.d/securelevel ============================================================================== --- head/etc/rc.d/securelevel Wed Aug 22 18:30:13 2012 (r239567) +++ head/etc/rc.d/securelevel Wed Aug 22 18:35:17 2012 (r239568) @@ -4,6 +4,7 @@ # # PROVIDE: securelevel +# REQUIRE: adjkerntz ipfw ipfilter pf . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 18:43:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 077C2106564A; Wed, 22 Aug 2012 18:43:22 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD87E8FC0C; Wed, 22 Aug 2012 18:43:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MIhLx1077953; Wed, 22 Aug 2012 18:43:21 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MIhLU4077951; Wed, 22 Aug 2012 18:43:21 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208221843.q7MIhLU4077951@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 18:43: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: r239569 - 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: Wed, 22 Aug 2012 18:43:22 -0000 Author: obrien Date: Wed Aug 22 18:43:21 2012 New Revision: 239569 URL: http://svn.freebsd.org/changeset/base/239569 Log: Remove old entropy seeding after consumption initializing /dev/random PRNG. Not doing so opens us up to replay attacks. Submitted by: Arthur Mesh Sponsored by: Juniper Networks Added: head/etc/rc.d/postrandom (contents, props changed) Modified: head/etc/rc.d/random Added: head/etc/rc.d/postrandom ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/postrandom Wed Aug 22 18:43:21 2012 (r239569) @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: postrandom +# REQUIRE: initrandom random var +# BEFORE: LOGIN +# KEYWORD: nojail + +. /etc/rc.subr + +name="postrandom" +start_cmd="${name}_start" +stop_cmd=":" + +# This will remove old ${entropy_file} and generate a new one. +# According to Bruce Schneier, this is stronly recomended in order +# to avoid using same ${entropy_file} across reboots. +# Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 + +postrandom_start() +{ + /etc/rc.d/random fastsaveseed + + case ${entropy_dir} in + [Nn][Oo]) + ;; + *) + entropy_dir=${entropy_dir:-/var/db/entropy} + if [ -d "${entropy_dir}" ]; then + if [ -w /dev/random ]; then + rm -f ${entropy_dir}/* + fi + fi + ;; + esac +} + +load_rc_config random +run_rc_command "$1" Modified: head/etc/rc.d/random ============================================================================== --- head/etc/rc.d/random Wed Aug 22 18:35:17 2012 (r239568) +++ head/etc/rc.d/random Wed Aug 22 18:43:21 2012 (r239569) @@ -4,7 +4,7 @@ # # PROVIDE: random -# REQUIRE: var initrandom +# REQUIRE: initrandom var # BEFORE: netif # KEYWORD: nojail shutdown @@ -14,6 +14,9 @@ name="random" start_cmd="random_start" stop_cmd="random_stop" +extra_commands="saveseed" +saveseed_cmd="${name}_stop" + feed_dev_random() { if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 18:46:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4F621065670; Wed, 22 Aug 2012 18:46:10 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id 783668FC12; Wed, 22 Aug 2012 18:46:10 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id q7MIk4Mt018306; Wed, 22 Aug 2012 11:46:04 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id q7MIk4vS018305; Wed, 22 Aug 2012 11:46:04 -0700 (PDT) (envelope-from sgk) Date: Wed, 22 Aug 2012 11:46:04 -0700 From: Steve Kargl To: "David E. O'Brien" Message-ID: <20120822184603.GA18294@troutmask.apl.washington.edu> References: <201208221843.q7MIhLU4077951@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208221843.q7MIhLU4077951@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: r239569 - 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: Wed, 22 Aug 2012 18:46:10 -0000 On Wed, Aug 22, 2012 at 06:43:21PM +0000, David E. O'Brien wrote: > + > +# This will remove old ${entropy_file} and generate a new one. > +# According to Bruce Schneier, this is stronly recomended in order s/stronly/strongly -- Steve From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 18:49:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C29B9106564A; Wed, 22 Aug 2012 18:49:02 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADF9B8FC14; Wed, 22 Aug 2012 18:49:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MIn2QT078698; Wed, 22 Aug 2012 18:49:02 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MIn2YX078696; Wed, 22 Aug 2012 18:49:02 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208221849.q7MIn2YX078696@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 18:49: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: r239570 - 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: Wed, 22 Aug 2012 18:49:02 -0000 Author: obrien Date: Wed Aug 22 18:49:02 2012 New Revision: 239570 URL: http://svn.freebsd.org/changeset/base/239570 Log: Depend on the new 'postrandom' instead of random. We need to limit the amount of time between consuming the entropy seeds and removing it in case of a kernel panic. Modified: head/etc/rc.d/adjkerntz Modified: head/etc/rc.d/adjkerntz ============================================================================== --- head/etc/rc.d/adjkerntz Wed Aug 22 18:43:21 2012 (r239569) +++ head/etc/rc.d/adjkerntz Wed Aug 22 18:49:02 2012 (r239570) @@ -4,7 +4,7 @@ # # PROVIDE: adjkerntz -# REQUIRE: FILESYSTEMS random +# REQUIRE: FILESYSTEMS postrandom # BEFORE: netif # KEYWORD: nojail From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:02:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA327106566C; Wed, 22 Aug 2012 19:02:07 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C58EB8FC1A; Wed, 22 Aug 2012 19:02:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJ273M080467; Wed, 22 Aug 2012 19:02:07 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJ276q080465; Wed, 22 Aug 2012 19:02:07 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208221902.q7MJ276q080465@svn.freebsd.org> From: Jim Harris Date: Wed, 22 Aug 2012 19:02:07 +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: r239571 - head/usr.sbin/pmcstat 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, 22 Aug 2012 19:02:08 -0000 Author: jimharris Date: Wed Aug 22 19:02:07 2012 New Revision: 239571 URL: http://svn.freebsd.org/changeset/base/239571 Log: Add -m option (for printing sampled PCs to a file) to pmcstat usage message. Sponsored by: Intel MFC after: 3 days Modified: head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Wed Aug 22 18:49:02 2012 (r239570) +++ head/usr.sbin/pmcstat/pmcstat.c Wed Aug 22 19:02:07 2012 (r239571) @@ -509,6 +509,7 @@ pmcstat_show_usage(void) "\t -f spec\t pass \"spec\" to as plugin option\n" "\t -g\t\t produce gprof(1) compatible profiles\n" "\t -k dir\t\t set the path to the kernel\n" + "\t -m file\t print sampled PCs to \"file\"\n" "\t -n rate\t set sampling rate\n" "\t -o file\t send print output to \"file\"\n" "\t -p spec\t allocate a process-private counting PMC\n" From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:02:33 2012 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 93FD51065680 for ; Wed, 22 Aug 2012 19:02:33 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 074498FC15 for ; Wed, 22 Aug 2012 19:02:32 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so1042187lbb.13 for ; Wed, 22 Aug 2012 12:02:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=Hyu/hP2unNNcZ1JvHhn9HyVplYAhTg8wCK88bQrzeq4=; b=jDU5S/xpQbBqASo9lfq9oW5uWXBogDZaXWB3ZgrQFeg2txQvPyIpXMzLiP8Q0Ke5Qd rTaTr63eJAEOOu+PQgKTocn1eThNKbrgRFN0yuaBt6Eup3DooTyXLcmgiVmSU74Y4fkB ctFihOjeNbAiFgNjAVVezW/ZuzxUC382nbsoawm13BXy6kMYkt9hiXXK3v+pmFzYGhVv UVIBvhR490WKEENGgROWEQMrtSFuWbE5q98Vl0zcx7qEZi8MFqsL191Rong9qjQFt09E 2oX3eoj2dk7/7HW1Ieiu+wvoZ6I5IB2xKW2/Dr8s9PRWjHKxTl/NZM/d/7q/hvRQTHZ0 vECA== Received: by 10.152.110.70 with SMTP id hy6mr22348876lab.44.1345662151995; Wed, 22 Aug 2012 12:02:31 -0700 (PDT) Received: from zont-osx.local (ppp95-165-143-86.pppoe.spdop.ru. [95.165.143.86]) by mx.google.com with ESMTPS id j3sm1344149lbh.0.2012.08.22.12.02.30 (version=SSLv3 cipher=OTHER); Wed, 22 Aug 2012 12:02:31 -0700 (PDT) Sender: Andrey Zonov Message-ID: <50352CC1.8030608@FreeBSD.org> Date: Wed, 22 Aug 2012 23:02:25 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Hiroki Sato References: <201208220637.q7M6bVb3082106@svn.freebsd.org> In-Reply-To: <201208220637.q7M6bVb3082106@svn.freebsd.org> X-Enigmail-Version: 1.4.3 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF98DDB1FEA1EB8BE8738E72B" X-Gm-Message-State: ALoCoQm2zsH7T9GZGwitz1BHykhw/suLmMlNxhAdeZh1zzX72k6GyfjjI1+vcPD7nYLcTYwd8q7+ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239562 - head/usr.sbin/makefs 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, 22 Aug 2012 19:02:33 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF98DDB1FEA1EB8BE8738E72B Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 8/22/12 10:37 AM, Hiroki Sato wrote: > Author: hrs > Date: Wed Aug 22 06:37:30 2012 > New Revision: 239562 > URL: http://svn.freebsd.org/changeset/base/239562 >=20 > Log: > Add -p flag to create the image as a sparse file. > =20 > Submitted by: Shesha Sreenivasamurthy > PR: bin/167779 >=20 > Modified: > head/usr.sbin/makefs/ffs.c > head/usr.sbin/makefs/makefs.8 > head/usr.sbin/makefs/makefs.c > head/usr.sbin/makefs/makefs.h >=20 [snip] >=20 > Modified: head/usr.sbin/makefs/makefs.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/usr.sbin/makefs/makefs.c Wed Aug 22 05:38:06 2012 (r239561) > +++ head/usr.sbin/makefs/makefs.c Wed Aug 22 06:37:30 2012 (r239562) > @@ -112,7 +112,7 @@ main(int argc, char *argv[]) > start_time.tv_sec =3D start.tv_sec; > start_time.tv_nsec =3D start.tv_usec * 1000; > =20 > - while ((ch =3D getopt(argc, argv, "B:b:d:f:F:M:m:N:o:s:S:t:x")) !=3D = -1) { > + while ((ch =3D getopt(argc, argv, "B:b:d:f:F:M:m:N:o:ps:S:t:x")) !=3D= -1) { > switch (ch) { > =20 > case 'B': > @@ -199,6 +199,9 @@ main(int argc, char *argv[]) > } > break; > } > + case 'p': > + fsoptions.sparse =3D 1; > + break; > =20 > case 's': > fsoptions.minsize =3D fsoptions.maxsize =3D > @@ -346,7 +349,7 @@ usage(void) > fprintf(stderr, > "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n"= > "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size= ]\n" > -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n" > +"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x] [-p]\n" style(9) violation. Options should be sorted. > "\t[-N userdb-dir] image-file directory | manifest [extra-directory ..= =2E]\n", > prog); > exit(1); >=20 > Modified: head/usr.sbin/makefs/makefs.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/usr.sbin/makefs/makefs.h Wed Aug 22 05:38:06 2012 (r239561) > +++ head/usr.sbin/makefs/makefs.h Wed Aug 22 06:37:30 2012 (r239562) > @@ -129,6 +129,7 @@ typedef struct { > int freeblockpc; /* free block % */ > int needswap; /* non-zero if byte swapping needed */ > int sectorsize; /* sector size */ > + int sparse; /* sparse image, don't fill it with zeros */ > =20 > void *fs_specific; /* File system specific additions. */ > } fsinfo_t; >=20 --=20 Andrey Zonov --------------enigF98DDB1FEA1EB8BE8738E72B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJQNSzFAAoJEBWLemxX/CvT64AIAJ29hDJZLovM6XUzHkVUVflw n+3401/rVZbdbSA6XewJjdRARbhurjDfrDLipXuRxjKYAo0+x7cEN5w2EW/qKCw8 WmvO3ATF9hWlH0u6Y3oXMRJml0C6QirMtH2Pe7UdtEId+iJoVVePz6zxFw58x1NZ aCduPDdRXKthCdCc+Xf/j3DNdkL6IyN2c92BTAyO75Jjq7XVEca+qS6kh5q0pvBI xxQZ6TYFYFH+RXFxjqWpBjpPc/5hjauO46l9aPx4nBlVKetm3YfGPPGNEN7IVLH4 zHW1DCs9jW4WeODKKAbm94U0Paz9+e3UrqwADmPGQJk2YT7o9A7FV+ChGwuQVbc= =KqYW -----END PGP SIGNATURE----- --------------enigF98DDB1FEA1EB8BE8738E72B-- From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:27:18 2012 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 2606B1065670; Wed, 22 Aug 2012 19:27: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 108BB8FC08; Wed, 22 Aug 2012 19:27:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJRHAC083867; Wed, 22 Aug 2012 19:27:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJRHEr083865; Wed, 22 Aug 2012 19:27:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221927.q7MJRHEr083865@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239573 - stable/9/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: Wed, 22 Aug 2012 19:27:18 -0000 Author: kib Date: Wed Aug 22 19:27:17 2012 New Revision: 239573 URL: http://svn.freebsd.org/changeset/base/239573 Log: MFC r239247: Adjust the r205536, by allowing a non-zero offset for anonymous mappings for a.out binaries. Apparently, a.out ld.so from FreeBSD 1.1.5.1 can issue such requests. Modified: stable/9/sys/vm/vm_mmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_mmap.c ============================================================================== --- stable/9/sys/vm/vm_mmap.c Wed Aug 22 19:25:57 2012 (r239572) +++ stable/9/sys/vm/vm_mmap.c Wed Aug 22 19:27:17 2012 (r239573) @@ -208,11 +208,23 @@ sys_mmap(td, uap) fp = NULL; - /* Make sure mapping fits into numeric range, etc. */ - if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && - curproc->p_osrel >= P_OSREL_MAP_ANON) || - ((flags & MAP_ANON) && (uap->fd != -1 || pos != 0))) - return (EINVAL); + /* + * Enforce the constraints. + * Mapping of length 0 is only allowed for old binaries. + * Anonymous mapping shall specify -1 as filedescriptor and + * zero position for new code. Be nice to ancient a.out + * binaries and correct pos for anonymous mapping, since old + * ld.so sometimes issues anonymous map requests with non-zero + * pos. + */ + if (!SV_CURPROC_FLAG(SV_AOUT)) { + if ((uap->len == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) || + ((flags & MAP_ANON) != 0 && (uap->fd != -1 || pos != 0))) + return (EINVAL); + } else { + if ((flags & MAP_ANON) != 0) + pos = 0; + } if (flags & MAP_STACK) { if ((uap->fd != -1) || From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:27:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4947106564A; Wed, 22 Aug 2012 19:27:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D03068FC17; Wed, 22 Aug 2012 19:27:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJRgoq083952; Wed, 22 Aug 2012 19:27:42 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJRge5083949; Wed, 22 Aug 2012 19:27:42 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201208221927.q7MJRge5083949@svn.freebsd.org> From: Hiroki Sato Date: Wed, 22 Aug 2012 19:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239574 - head/usr.sbin/makefs 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, 22 Aug 2012 19:27:43 -0000 Author: hrs Date: Wed Aug 22 19:27:42 2012 New Revision: 239574 URL: http://svn.freebsd.org/changeset/base/239574 Log: Sort options. Modified: head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Wed Aug 22 19:27:17 2012 (r239573) +++ head/usr.sbin/makefs/makefs.8 Wed Aug 22 19:27:42 2012 (r239574) @@ -43,8 +43,7 @@ .Nd create a file system image from a directory tree or a mtree manifest .Sh SYNOPSIS .Nm -.Op Fl p -.Op Fl x +.Op Fl px .Op Fl B Ar byte-order .Op Fl b Ar free-blocks .Op Fl d Ar debug-mask Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Wed Aug 22 19:27:17 2012 (r239573) +++ head/usr.sbin/makefs/makefs.c Wed Aug 22 19:27:42 2012 (r239574) @@ -349,7 +349,7 @@ usage(void) fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x] [-p]\n" +"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\n" "\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:27:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 405771065673; Wed, 22 Aug 2012 19:27:46 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 285448FC19; Wed, 22 Aug 2012 19:27:44 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so1059845lbb.13 for ; Wed, 22 Aug 2012 12:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=2OW/jznCkHSovklMNXNwtP+2zEyYQyvXlDF8CrgQQu0=; b=KC3kTQvMmobb963pbM/qzd2v8vPFfs5zC+ZATr/GjjGcn5axjV5PZ9DvEP941aTxqj 17kYwHcbJvA0URAIPhtpdpqVWLFVYnFHT9iHWRaZIsUM1zy141NaxLVKpmPf/MzkJoOd zmYzYus+b41J2msXmIl9hK8wfb6PFKuLQOy93DqaMHDbkK1KX+VU605aEmHOblakJTD+ j3hibdM1Z45TwGCsjWVhPXi3iY5WzJ/bHhQTWEztv6dALQOXvt//V4dGyQ+xiBzPk7Mw 0nGYixkPN9pywPQoRIr4e04XmHeYpczCE0H5CEnLNcp/IujZSKNGiahkNbTusTCUIOLK YO7A== MIME-Version: 1.0 Received: by 10.152.146.163 with SMTP id td3mr22809754lab.26.1345663664086; Wed, 22 Aug 2012 12:27:44 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.102.39 with HTTP; Wed, 22 Aug 2012 12:27:44 -0700 (PDT) In-Reply-To: <201208221902.q7MJ276q080465@svn.freebsd.org> References: <201208221902.q7MJ276q080465@svn.freebsd.org> Date: Wed, 22 Aug 2012 20:27:44 +0100 X-Google-Sender-Auth: yli6AJKE9StRcQxePZPVRRNWa2U Message-ID: From: Attilio Rao To: Jim Harris 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: r239571 - head/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: attilio@FreeBSD.org 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, 22 Aug 2012 19:27:46 -0000 On Wed, Aug 22, 2012 at 8:02 PM, Jim Harris wrote: > Author: jimharris > Date: Wed Aug 22 19:02:07 2012 > New Revision: 239571 > URL: http://svn.freebsd.org/changeset/base/239571 > > Log: > Add -m option (for printing sampled PCs to a file) to pmcstat usage > message. Pointy hat to me. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:29:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 830AC10656D3; Wed, 22 Aug 2012 19:29: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 6E2788FC1F; Wed, 22 Aug 2012 19:29:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJTNQq084219; Wed, 22 Aug 2012 19:29:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJTNBp084217; Wed, 22 Aug 2012 19:29:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221929.q7MJTNBp084217@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239575 - stable/9/sys/compat/freebsd32 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, 22 Aug 2012 19:29:23 -0000 Author: kib Date: Wed Aug 22 19:29:22 2012 New Revision: 239575 URL: http://svn.freebsd.org/changeset/base/239575 Log: MFC r239248: Implement the old mmap syscall for compat32, when COMPAT_43 option is enabled. The syscall is used by FreeBSD 1.1.5.1 dynamic linker. Modified: stable/9/sys/compat/freebsd32/syscalls.master Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/9/sys/compat/freebsd32/syscalls.master Wed Aug 22 19:27:42 2012 (r239574) +++ stable/9/sys/compat/freebsd32/syscalls.master Wed Aug 22 19:29:22 2012 (r239575) @@ -168,7 +168,8 @@ 68 AUE_NULL OBSOL vwrite 69 AUE_SBRK NOPROTO { int sbrk(int incr); } 70 AUE_SSTK NOPROTO { int sstk(int incr); } -71 AUE_MMAP OBSOL ommap +71 AUE_MMAP COMPAT|NOPROTO { int mmap(void *addr, int len, \ + int prot, int flags, int fd, int pos); } 72 AUE_O_VADVISE NOPROTO { int ovadvise(int anom); } vadvise \ ovadvise_args int 73 AUE_MUNMAP NOPROTO { int munmap(void *addr, size_t len); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:31:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE8A81065672; Wed, 22 Aug 2012 19:31:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B88608FC1A; Wed, 22 Aug 2012 19:31:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJVSgD084519; Wed, 22 Aug 2012 19:31:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJVSdA084514; Wed, 22 Aug 2012 19:31:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221931.q7MJVSdA084514@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239576 - stable/9/sys/compat/freebsd32 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, 22 Aug 2012 19:31:28 -0000 Author: kib Date: Wed Aug 22 19:31:28 2012 New Revision: 239576 URL: http://svn.freebsd.org/changeset/base/239576 Log: Regen. Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h stable/9/sys/compat/freebsd32/freebsd32_syscall.h stable/9/sys/compat/freebsd32/freebsd32_syscalls.c stable/9/sys/compat/freebsd32/freebsd32_sysent.c Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_proto.h Wed Aug 22 19:29:22 2012 (r239575) +++ stable/9/sys/compat/freebsd32/freebsd32_proto.h Wed Aug 22 19:31:28 2012 (r239576) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239575 2012-08-22 19:29:22Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: stable/9/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscall.h Wed Aug 22 19:29:22 2012 (r239575) +++ stable/9/sys/compat/freebsd32/freebsd32_syscall.h Wed Aug 22 19:31:28 2012 (r239576) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239575 2012-08-22 19:29:22Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -77,7 +77,7 @@ /* 68 is obsolete vwrite */ #define FREEBSD32_SYS_sbrk 69 #define FREEBSD32_SYS_sstk 70 - /* 71 is obsolete ommap */ + /* 71 is old mmap */ #define FREEBSD32_SYS_vadvise 72 #define FREEBSD32_SYS_munmap 73 #define FREEBSD32_SYS_freebsd32_mprotect 74 Modified: stable/9/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Wed Aug 22 19:29:22 2012 (r239575) +++ stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Wed Aug 22 19:31:28 2012 (r239576) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239575 2012-08-22 19:29:22Z kib */ const char *freebsd32_syscallnames[] = { @@ -81,7 +81,7 @@ const char *freebsd32_syscallnames[] = { "obs_vwrite", /* 68 = obsolete vwrite */ "sbrk", /* 69 = sbrk */ "sstk", /* 70 = sstk */ - "obs_ommap", /* 71 = obsolete ommap */ + "compat.mmap", /* 71 = old mmap */ "vadvise", /* 72 = vadvise */ "munmap", /* 73 = munmap */ "freebsd32_mprotect", /* 74 = freebsd32_mprotect */ Modified: stable/9/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_sysent.c Wed Aug 22 19:29:22 2012 (r239575) +++ stable/9/sys/compat/freebsd32/freebsd32_sysent.c Wed Aug 22 19:31:28 2012 (r239576) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239575 2012-08-22 19:29:22Z kib */ #include "opt_compat.h" @@ -118,7 +118,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 68 = obsolete vwrite */ { AS(sbrk_args), (sy_call_t *)sys_sbrk, AUE_SBRK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 69 = sbrk */ { AS(sstk_args), (sy_call_t *)sys_sstk, AUE_SSTK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 70 = sstk */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 71 = obsolete ommap */ + { compat(AS(ommap_args),mmap), AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 71 = old mmap */ { AS(ovadvise_args), (sy_call_t *)sys_ovadvise, AUE_O_VADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 72 = vadvise */ { AS(munmap_args), (sy_call_t *)sys_munmap, AUE_MUNMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 73 = munmap */ { AS(freebsd32_mprotect_args), (sy_call_t *)freebsd32_mprotect, AUE_MPROTECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 74 = freebsd32_mprotect */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:34:02 2012 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 D4B26106566C; Wed, 22 Aug 2012 19:34: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 C01668FC08; Wed, 22 Aug 2012 19:34:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJY2gd084917; Wed, 22 Aug 2012 19:34:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJY21W084915; Wed, 22 Aug 2012 19:34:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221934.q7MJY21W084915@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239577 - stable/9/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: Wed, 22 Aug 2012 19:34:03 -0000 Author: kib Date: Wed Aug 22 19:34:02 2012 New Revision: 239577 URL: http://svn.freebsd.org/changeset/base/239577 Log: MFC r239250: For old mmap syscall, when executing on amd64 or ia64, enforce the PROT_EXEC if prot is non-zero, process is 32bit and kern.elf32.i386_read_exec syscal is enabled. Modified: stable/9/sys/vm/vm_mmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_mmap.c ============================================================================== --- stable/9/sys/vm/vm_mmap.c Wed Aug 22 19:31:28 2012 (r239576) +++ stable/9/sys/vm/vm_mmap.c Wed Aug 22 19:34:02 2012 (r239577) @@ -454,6 +454,13 @@ ommap(td, uap) nargs.addr = uap->addr; nargs.len = uap->len; nargs.prot = cvtbsdprot[uap->prot & 0x7]; +#ifdef COMPAT_FREEBSD32 +#if defined(__amd64__) || defined(__ia64__) + if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32) && + nargs.prot != 0) + nargs.prot |= PROT_EXEC; +#endif +#endif nargs.flags = 0; if (uap->flags & OMAP_ANON) nargs.flags |= MAP_ANON; From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:36:47 2012 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 BDD8C1065675; Wed, 22 Aug 2012 19:36:47 +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 8FA058FC19; Wed, 22 Aug 2012 19:36:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJalxo085312; Wed, 22 Aug 2012 19:36:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJalJq085309; Wed, 22 Aug 2012 19:36:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221936.q7MJalJq085309@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:36:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239578 - stable/9/sys/amd64/ia32 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, 22 Aug 2012 19:36:47 -0000 Author: kib Date: Wed Aug 22 19:36:47 2012 New Revision: 239578 URL: http://svn.freebsd.org/changeset/base/239578 Log: MFC r239251: Real hardware, as opposed to QEMU, does not allow to have a call gate in long mode which transfers control to 32bit code segment. Unbreak the lcall $7,$0 implementation on amd64 by putting the 64bit user code segment' selector into call gate, and execute the 64bit trampoline which converts the return frame into 32bit format and switches back to 32bit mode for executing int $0x80 trampoline. Modified: stable/9/sys/amd64/ia32/ia32_sigtramp.S stable/9/sys/amd64/ia32/ia32_syscall.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/ia32/ia32_sigtramp.S ============================================================================== --- stable/9/sys/amd64/ia32/ia32_sigtramp.S Wed Aug 22 19:34:02 2012 (r239577) +++ stable/9/sys/amd64/ia32/ia32_sigtramp.S Wed Aug 22 19:36:47 2012 (r239578) @@ -91,8 +91,29 @@ ia32_osigcode: */ ALIGN_TEXT lcall_tramp: + .code64 + /* + * There, we are in 64bit mode and need to return to 32bit. + * First, convert call frame from 64 to 32 bit format. + */ + pushq %rax + movl 16(%rsp),%eax + movl %eax,20(%rsp) /* ret %cs */ + movl 8(%rsp),%eax + movl %eax,16(%rsp) /* ret %rip -> %eip */ + popq %rax + addq $8,%rsp + /* Now return to 32bit */ + pushq $0x33 /* _ucode32sel UPL */ + callq 1f +1: + addq $2f-1b,(%rsp) + lretq +2: + /* Back in 32bit mode */ + .code32 cmpl $SYS_vfork,%eax - je 2f + je 4f pushl %ebp movl %esp,%ebp pushl 0x24(%ebp) /* arg 6 */ @@ -101,19 +122,19 @@ lcall_tramp: pushl 0x18(%ebp) pushl 0x14(%ebp) pushl 0x10(%ebp) /* arg 1 */ - pushl 0xc(%ebp) /* gap */ + pushl 0xc(%ebp) /* gap */ int $0x80 leavel -1: +3: lretl -2: +4: /* * vfork handling is special and relies on the libc stub saving * the return ip in %ecx. If vfork failed, then there is no * child which can corrupt the frame created by call gate. */ int $0x80 - jb 1b + jb 3b addl $8,%esp jmpl *%ecx #endif Modified: stable/9/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/9/sys/amd64/ia32/ia32_syscall.c Wed Aug 22 19:34:02 2012 (r239577) +++ stable/9/sys/amd64/ia32/ia32_syscall.c Wed Aug 22 19:36:47 2012 (r239578) @@ -244,7 +244,7 @@ setup_lcall_gate(void) bzero(ssd, sizeof(*ssd)); ssd->gd_looffset = lcall_addr; ssd->gd_hioffset = lcall_addr >> 16; - ssd->gd_selector = _ucode32sel; + ssd->gd_selector = _ucodesel; ssd->gd_type = SDT_SYSCGT; ssd->gd_dpl = SEL_UPL; ssd->gd_p = 1; From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:41:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3831106566C; Wed, 22 Aug 2012 19:41:37 +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 851308FC14; Wed, 22 Aug 2012 19:41:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJfbSS085996; Wed, 22 Aug 2012 19:41:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJfb6m085994; Wed, 22 Aug 2012 19:41:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221941.q7MJfb6m085994@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239579 - stable/9/sys/amd64/amd64 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, 22 Aug 2012 19:41:37 -0000 Author: kib Date: Wed Aug 22 19:41:36 2012 New Revision: 239579 URL: http://svn.freebsd.org/changeset/base/239579 Log: MFC r239252: Add a hackish debugging facility to provide a bit of information about reason for generated trap. The dump of basic signal information and 8 bytes of the faulting instruction are printed on the controlling terminal of the process, if the machdep.uprintf_signal syscal is enabled. Modified: stable/9/sys/amd64/amd64/trap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/trap.c ============================================================================== --- stable/9/sys/amd64/amd64/trap.c Wed Aug 22 19:36:47 2012 (r239578) +++ stable/9/sys/amd64/amd64/trap.c Wed Aug 22 19:41:36 2012 (r239579) @@ -176,9 +176,14 @@ static int panic_on_nmi = 1; SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW, &panic_on_nmi, 0, "Panic on NMI"); TUNABLE_INT("machdep.panic_on_nmi", &panic_on_nmi); -static int prot_fault_translation = 0; +static int prot_fault_translation; SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, - &prot_fault_translation, 0, "Select signal to deliver on protection fault"); + &prot_fault_translation, 0, + "Select signal to deliver on protection fault"); +static int uprintf_signal; +SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW, + &uprintf_signal, 0, + "Print debugging information on trap signal to ctty"); /* * Exception, fault, and trap interface to the FreeBSD kernel. @@ -609,6 +614,19 @@ trap(struct trapframe *frame) ksi.ksi_code = ucode; ksi.ksi_trapno = type; ksi.ksi_addr = (void *)addr; + if (uprintf_signal) { + uprintf("pid %d comm %s: signal %d err %lx code %d type %d " + "addr 0x%lx <%02x %02x %02x %02x %02x %02x %02x %02x>\n", + p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, + fubyte((void *)(frame->tf_rip + 0)), + fubyte((void *)(frame->tf_rip + 1)), + fubyte((void *)(frame->tf_rip + 2)), + fubyte((void *)(frame->tf_rip + 3)), + fubyte((void *)(frame->tf_rip + 4)), + fubyte((void *)(frame->tf_rip + 5)), + fubyte((void *)(frame->tf_rip + 6)), + fubyte((void *)(frame->tf_rip + 7))); + } trapsignal(td, &ksi); user: From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:43:47 2012 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 42C8B106566C; Wed, 22 Aug 2012 19:43:47 +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 2DA5C8FC14; Wed, 22 Aug 2012 19:43:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJhlTN086339; Wed, 22 Aug 2012 19:43:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJhkXC086336; Wed, 22 Aug 2012 19:43:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221943.q7MJhkXC086336@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239580 - stable/9/sys/compat/freebsd32 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, 22 Aug 2012 19:43:47 -0000 Author: kib Date: Wed Aug 22 19:43:46 2012 New Revision: 239580 URL: http://svn.freebsd.org/changeset/base/239580 Log: MFC r239296: Provide 32bit compat for old truncate(2) and ftruncate(2). Modified: stable/9/sys/compat/freebsd32/syscalls.master Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/9/sys/compat/freebsd32/syscalls.master Wed Aug 22 19:41:36 2012 (r239579) +++ stable/9/sys/compat/freebsd32/syscalls.master Wed Aug 22 19:43:46 2012 (r239580) @@ -257,8 +257,9 @@ 126 AUE_SETREUID NOPROTO { int setreuid(int ruid, int euid); } 127 AUE_SETREGID NOPROTO { int setregid(int rgid, int egid); } 128 AUE_RENAME NOPROTO { int rename(char *from, char *to); } -129 AUE_TRUNCATE OBSOL otruncate -130 AUE_FTRUNCATE OBSOL ftruncate +129 AUE_TRUNCATE COMPAT|NOPROTO { int truncate(char *path, \ + int length); } +130 AUE_FTRUNCATE COMPAT|NOPROTO { int ftruncate(int fd, int length); } 131 AUE_FLOCK NOPROTO { int flock(int fd, int how); } 132 AUE_MKFIFO NOPROTO { int mkfifo(char *path, int mode); } 133 AUE_SENDTO NOPROTO { int sendto(int s, caddr_t buf, \ From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:45:19 2012 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 317E4106566C; Wed, 22 Aug 2012 19:45:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11CDC8FC15; Wed, 22 Aug 2012 19:45:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJjIir086637; Wed, 22 Aug 2012 19:45:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJjINK086632; Wed, 22 Aug 2012 19:45:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221945.q7MJjINK086632@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239581 - stable/9/sys/compat/freebsd32 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, 22 Aug 2012 19:45:19 -0000 Author: kib Date: Wed Aug 22 19:45:18 2012 New Revision: 239581 URL: http://svn.freebsd.org/changeset/base/239581 Log: Regen. Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h stable/9/sys/compat/freebsd32/freebsd32_syscall.h stable/9/sys/compat/freebsd32/freebsd32_syscalls.c stable/9/sys/compat/freebsd32/freebsd32_sysent.c Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_proto.h Wed Aug 22 19:43:46 2012 (r239580) +++ stable/9/sys/compat/freebsd32/freebsd32_proto.h Wed Aug 22 19:45:18 2012 (r239581) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239575 2012-08-22 19:29:22Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: stable/9/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscall.h Wed Aug 22 19:43:46 2012 (r239580) +++ stable/9/sys/compat/freebsd32/freebsd32_syscall.h Wed Aug 22 19:45:18 2012 (r239581) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239575 2012-08-22 19:29:22Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -132,8 +132,8 @@ #define FREEBSD32_SYS_setreuid 126 #define FREEBSD32_SYS_setregid 127 #define FREEBSD32_SYS_rename 128 - /* 129 is obsolete otruncate */ - /* 130 is obsolete ftruncate */ + /* 129 is old truncate */ + /* 130 is old ftruncate */ #define FREEBSD32_SYS_flock 131 #define FREEBSD32_SYS_mkfifo 132 #define FREEBSD32_SYS_sendto 133 Modified: stable/9/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Wed Aug 22 19:43:46 2012 (r239580) +++ stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Wed Aug 22 19:45:18 2012 (r239581) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239575 2012-08-22 19:29:22Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib */ const char *freebsd32_syscallnames[] = { @@ -139,8 +139,8 @@ const char *freebsd32_syscallnames[] = { "setreuid", /* 126 = setreuid */ "setregid", /* 127 = setregid */ "rename", /* 128 = rename */ - "obs_otruncate", /* 129 = obsolete otruncate */ - "obs_ftruncate", /* 130 = obsolete ftruncate */ + "compat.truncate", /* 129 = old truncate */ + "compat.ftruncate", /* 130 = old ftruncate */ "flock", /* 131 = flock */ "mkfifo", /* 132 = mkfifo */ "sendto", /* 133 = sendto */ Modified: stable/9/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_sysent.c Wed Aug 22 19:43:46 2012 (r239580) +++ stable/9/sys/compat/freebsd32/freebsd32_sysent.c Wed Aug 22 19:45:18 2012 (r239581) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239575 2012-08-22 19:29:22Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib */ #include "opt_compat.h" @@ -176,8 +176,8 @@ struct sysent freebsd32_sysent[] = { { AS(setreuid_args), (sy_call_t *)sys_setreuid, AUE_SETREUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 126 = setreuid */ { AS(setregid_args), (sy_call_t *)sys_setregid, AUE_SETREGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 127 = setregid */ { AS(rename_args), (sy_call_t *)sys_rename, AUE_RENAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 128 = rename */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 129 = obsolete otruncate */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 130 = obsolete ftruncate */ + { compat(AS(otruncate_args),truncate), AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 129 = old truncate */ + { compat(AS(oftruncate_args),ftruncate), AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 130 = old ftruncate */ { AS(flock_args), (sy_call_t *)sys_flock, AUE_FLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 131 = flock */ { AS(mkfifo_args), (sy_call_t *)sys_mkfifo, AUE_MKFIFO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 132 = mkfifo */ { AS(sendto_args), (sy_call_t *)sys_sendto, AUE_SENDTO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 133 = sendto */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:53:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22C371065670; Wed, 22 Aug 2012 19:53:34 +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 0C6018FC19; Wed, 22 Aug 2012 19:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJrX3S087843; Wed, 22 Aug 2012 19:53:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJrXRG087835; Wed, 22 Aug 2012 19:53:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221953.q7MJrXRG087835@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239582 - in stable/9/sys: kern nlm 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: Wed, 22 Aug 2012 19:53:34 -0000 Author: kib Date: Wed Aug 22 19:53:33 2012 New Revision: 239582 URL: http://svn.freebsd.org/changeset/base/239582 Log: MFC r239301: Add a sysctl kern.pid_max, which limits the maximum pid the system is allowed to allocate, and corresponding tunable with the same name. Note that existing processes with higher pids are left intact. MFC r239328: Fix grammar. MFC r239329: As a safety measure, disable lowering pid_max too much. Modified: stable/9/sys/kern/init_main.c stable/9/sys/kern/kern_fork.c stable/9/sys/kern/kern_mib.c stable/9/sys/kern/kern_thread.c stable/9/sys/kern/subr_param.c stable/9/sys/nlm/nlm_advlock.c stable/9/sys/sys/proc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/init_main.c ============================================================================== --- stable/9/sys/kern/init_main.c Wed Aug 22 19:45:18 2012 (r239581) +++ stable/9/sys/kern/init_main.c Wed Aug 22 19:53:33 2012 (r239582) @@ -476,6 +476,7 @@ proc0_init(void *dummy __unused) knlist_init_mtx(&p->p_klist, &p->p_mtx); STAILQ_INIT(&p->p_ktr); p->p_nice = NZERO; + /* pid_max cannot be greater than PID_MAX */ td->td_tid = PID_MAX + 1; LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); td->td_state = TDS_RUNNING; Modified: stable/9/sys/kern/kern_fork.c ============================================================================== --- stable/9/sys/kern/kern_fork.c Wed Aug 22 19:45:18 2012 (r239581) +++ stable/9/sys/kern/kern_fork.c Wed Aug 22 19:53:33 2012 (r239582) @@ -209,8 +209,8 @@ sysctl_kern_randompid(SYSCTL_HANDLER_ARG pid = randompid; error = sysctl_handle_int(oidp, &pid, 0, req); if (error == 0 && req->newptr != NULL) { - if (pid < 0 || pid > PID_MAX - 100) /* out of range */ - pid = PID_MAX - 100; + if (pid < 0 || pid > pid_max - 100) /* out of range */ + pid = pid_max - 100; else if (pid < 2) /* NOP */ pid = 0; else if (pid < 100) /* Make it reasonable */ @@ -259,8 +259,8 @@ retry: * restart somewhat above 0, as the low-numbered procs * tend to include daemons that don't exit. */ - if (trypid >= PID_MAX) { - trypid = trypid % PID_MAX; + if (trypid >= pid_max) { + trypid = trypid % pid_max; if (trypid < 100) trypid += 100; pidchecked = 0; Modified: stable/9/sys/kern/kern_mib.c ============================================================================== --- stable/9/sys/kern/kern_mib.c Wed Aug 22 19:45:18 2012 (r239581) +++ stable/9/sys/kern/kern_mib.c Wed Aug 22 19:53:33 2012 (r239582) @@ -499,6 +499,34 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, vnod SYSCTL_INT(_debug_sizeof, OID_AUTO, proc, CTLFLAG_RD, 0, sizeof(struct proc), "sizeof(struct proc)"); +static int +sysctl_kern_pid_max(SYSCTL_HANDLER_ARGS) +{ + int error, pm; + + pm = pid_max; + error = sysctl_handle_int(oidp, &pm, 0, req); + if (error || !req->newptr) + return (error); + sx_xlock(&proctree_lock); + sx_xlock(&allproc_lock); + + /* + * Only permit the values less then PID_MAX. + * As a safety measure, do not allow to limit the pid_max too much. + */ + if (pm < 300 || pm > PID_MAX) + error = EINVAL; + else + pid_max = pm; + sx_xunlock(&allproc_lock); + sx_xunlock(&proctree_lock); + return (error); +} +SYSCTL_PROC(_kern, OID_AUTO, pid_max, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_TUN | + CTLFLAG_MPSAFE, 0, 0, sysctl_kern_pid_max, "I", + "Maximum allowed pid"); + #include #include SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD, Modified: stable/9/sys/kern/kern_thread.c ============================================================================== --- stable/9/sys/kern/kern_thread.c Wed Aug 22 19:45:18 2012 (r239581) +++ stable/9/sys/kern/kern_thread.c Wed Aug 22 19:53:33 2012 (r239582) @@ -266,7 +266,11 @@ threadinit(void) { mtx_init(&tid_lock, "TID lock", NULL, MTX_DEF); - /* leave one number for thread0 */ + + /* + * pid_max cannot be greater than PID_MAX. + * leave one number for thread0. + */ tid_unrhdr = new_unrhdr(PID_MAX + 2, INT_MAX, &tid_lock); thread_zone = uma_zcreate("THREAD", sched_sizeof_thread(), Modified: stable/9/sys/kern/subr_param.c ============================================================================== --- stable/9/sys/kern/subr_param.c Wed Aug 22 19:45:18 2012 (r239581) +++ stable/9/sys/kern/subr_param.c Wed Aug 22 19:53:33 2012 (r239582) @@ -41,12 +41,13 @@ __FBSDID("$FreeBSD$"); #include "opt_msgbuf.h" #include "opt_maxusers.h" -#include #include #include #include -#include +#include #include +#include +#include #include #include @@ -92,6 +93,7 @@ int ncallout; /* maximum # of timer ev int nbuf; int ngroups_max; /* max # groups per process */ int nswbuf; +pid_t pid_max = PID_MAX; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ long maxpipekva; /* Limit on pipe KVA */ @@ -250,6 +252,16 @@ init_param1(void) TUNABLE_INT_FETCH("kern.ngroups", &ngroups_max); if (ngroups_max < NGROUPS_MAX) ngroups_max = NGROUPS_MAX; + + /* + * Only allow to lower the maximal pid. + * Prevent setting up a non-bootable system if pid_max is too low. + */ + TUNABLE_INT_FETCH("kern.pid_max", &pid_max); + if (pid_max > PID_MAX) + pid_max = PID_MAX; + else if (pid_max < 300) + pid_max = 300; } /* Modified: stable/9/sys/nlm/nlm_advlock.c ============================================================================== --- stable/9/sys/nlm/nlm_advlock.c Wed Aug 22 19:45:18 2012 (r239581) +++ stable/9/sys/nlm/nlm_advlock.c Wed Aug 22 19:53:33 2012 (r239582) @@ -98,6 +98,7 @@ nlm_client_init(void *dummy) int i; mtx_init(&nlm_svid_lock, "NLM svid lock", NULL, MTX_DEF); + /* pid_max cannot be greater than PID_MAX */ nlm_svid_allocator = new_unrhdr(PID_MAX + 2, INT_MAX, &nlm_svid_lock); for (i = 0; i < NLM_SVID_HASH_SIZE; i++) LIST_INIT(&nlm_file_svids[i]); Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Wed Aug 22 19:45:18 2012 (r239581) +++ stable/9/sys/sys/proc.h Wed Aug 22 19:53:33 2012 (r239582) @@ -693,11 +693,12 @@ MALLOC_DECLARE(M_SUBPROC); #define FIRST_THREAD_IN_PROC(p) TAILQ_FIRST(&(p)->p_threads) /* - * We use process IDs <= PID_MAX; PID_MAX + 1 must also fit in a pid_t, - * as it is used to represent "no process group". + * We use process IDs <= pid_max <= PID_MAX; PID_MAX + 1 must also fit + * in a pid_t, as it is used to represent "no process group". */ #define PID_MAX 99999 #define NO_PID 100000 +extern pid_t pid_max; #define SESS_LEADER(p) ((p)->p_session->s_leader == (p)) From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 19:56:41 2012 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 CB4EB1065672; Wed, 22 Aug 2012 19:56:41 +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 AB9E28FC15; Wed, 22 Aug 2012 19:56:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MJufW9088291; Wed, 22 Aug 2012 19:56:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJuf63088288; Wed, 22 Aug 2012 19:56:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208221956.q7MJuf63088288@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 19:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239583 - stable/9/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: Wed, 22 Aug 2012 19:56:41 -0000 Author: kib Date: Wed Aug 22 19:56:41 2012 New Revision: 239583 URL: http://svn.freebsd.org/changeset/base/239583 Log: MFC r239302: Add a short man page describing how to run a.out binaries on the current kernels. MFC r239305 (by joel): Minor mdoc fixes and language tweaks. MFC r239306: Small tweaks. Added: stable/9/share/man/man4/aout.4 - copied, changed from r239302, head/share/man/man4/aout.4 Modified: stable/9/share/man/man4/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Wed Aug 22 19:53:33 2012 (r239582) +++ stable/9/share/man/man4/Makefile Wed Aug 22 19:56:41 2012 (r239583) @@ -40,6 +40,7 @@ MAN= aac.4 \ ${_bxe.4} \ amr.4 \ an.4 \ + ${_aout.4} \ ${_apic.4} \ arcmsr.4 \ ${_asmc.4} \ @@ -699,6 +700,7 @@ _acpi_sony.4= acpi_sony.4 _acpi_toshiba.4=acpi_toshiba.4 _acpi_wmi.4= acpi_wmi.4 _aesni.4= aesni.4 +_aout.4= aout.4 _apic.4= apic.4 _atrtc.4= atrtc.4 _attimer.4= attimer.4 Copied and modified: stable/9/share/man/man4/aout.4 (from r239302, head/share/man/man4/aout.4) ============================================================================== --- head/share/man/man4/aout.4 Wed Aug 15 16:01:45 2012 (r239302, copy source) +++ stable/9/share/man/man4/aout.4 Wed Aug 22 19:56:41 2012 (r239583) @@ -35,16 +35,15 @@ kldload a.out .Sh DESCRIPTION The .Xr a.out 5 -executable format was used by -.Fx -of versions \*(Lt 3.0. -Since only i386 architecture was supported at that time, the +executable format was used before the release of +.Fx 3.0 . +Since i386 was the only supported architecture at that time, .Xr a.out 5 -executables can only be activated on the platforms that support -execution of i386 code, which are i386, amd64 and (partially) ia64. +executables can only be activated on platforms that support +execution of i386 code, such as i386, amd64 and (partially) ia64. .Pp To add kernel support for old syscalls and old syscall invocation methods, -you need to place the following options in the kernel configuration file: +place the following options in the kernel configuration file: .Bd -ragged -offset indent .Cd "options COMPAT_43" .br @@ -57,14 +56,16 @@ option is only required on 64-bit CPU ar .Pp The .Va aout.ko -module must be loaded to get support for +module needs to be loaded with the +.Xr kldload 8 +utility in order to support the .Xr a.out 5 -image activator. -Use the command +image activator: .Bd -ragged -offset indent .Ic kldload aout .Ed -or put the following line in +.Pp +Alternatively, to load the module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent aout_load="YES" @@ -72,10 +73,10 @@ aout_load="YES" .Pp The .Xr a.out 5 -format was mainstream quite long time ago. -The reasonable default settings and security requirements of the -modern OS contradict to the default environment of that time and -require adjustments of the system to mimic natural environment for +format was mainstream quite a long time ago. +Reasonable default settings and security requirements of +modern operating systems today contradict the default environment of that time +and require adjustments of the system to mimic natural environment for old binaries. .Pp The following @@ -84,24 +85,24 @@ tunables are useful for this: .Bl -tag -offset indent -width "XXXXXXXXXXXXXXXXXXXXXXXXX" .It Xo Va security.bsd.map_at_zero .Xc -Set to 1 to allow the mapping of process pages at the address 0. +Set to 1 to allow mapping of process pages at address 0. Some very old .Va ZMAGIC -executable images require the text mapping at the address 0. +executable images require text mapping at address 0. .It Xo Va kern.pid_max .Xc Old versions of .Fx -used 16-bit types for +used signed 16-bit type for .Vt pid_t . Current kernels use 32-bit type for .Vt pid_t , -and allow the process id's up to 99999. +and allow process id's up to 99999. Such values cannot be represented by old .Vt pid_t , -mostly causing issues for the processes using +mostly causing issues for processes using .Xr wait 2 -syscalls, for instance, shells. +syscalls, for example shells. Set the sysctl to 30000 to work around the problem. .It Xo Va kern.elf32.read_exec .Xc @@ -109,7 +110,7 @@ Set to 1 to force any accessible memory process to allow execution, see .Xr mmap 2 . Old i386 CPUs did not have a bit in PTE which disallowed execution -from the page, so many old programs did not specified +from the page, so many old programs did not specify .Va PROT_EXEC even for mapping of executable code. The sysctl forces @@ -123,8 +124,6 @@ non-executable mappings. .Xr a.out 5 , .Xr elf 5 , .Xr sysctl 8 . -.Sh BUGS -On 64bit architectures, not all wrappers for older syscalls are implemented. .Sh HISTORY The .Xr a.out 5 @@ -132,7 +131,7 @@ executable format was used on ancient .At and served as the main executable format for .Fx -from inception up to +from the beginning up to .Fx 2.2.9 . In .Fx 3.0 @@ -143,3 +142,5 @@ The .Nm manual page was written by .An Konstantin Belousov Aq kib@FreeBSD.org . +.Sh BUGS +On 64bit architectures, not all wrappers for older syscalls are implemented. From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:00:41 2012 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 AEFDA106574F; Wed, 22 Aug 2012 20:00:41 +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 9B5AC8FC1C; Wed, 22 Aug 2012 20:00:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MK0fss089029; Wed, 22 Aug 2012 20:00:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK0ff6089027; Wed, 22 Aug 2012 20:00:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208222000.q7MK0ff6089027@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 20:00: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: r239584 - 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, 22 Aug 2012 20:00:41 -0000 Author: jhb Date: Wed Aug 22 20:00:41 2012 New Revision: 239584 URL: http://svn.freebsd.org/changeset/base/239584 Log: Fix the 'show witness' DDB command to honor db_pager_quit. Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Aug 22 19:56:41 2012 (r239583) +++ head/sys/kern/subr_witness.c Wed Aug 22 20:00:41 2012 (r239584) @@ -947,6 +947,8 @@ witness_ddb_display_descendants(int(*prn indent++; WITNESS_INDEX_ASSERT(w->w_index); for (i = 1; i <= w_max_used_index; i++) { + if (db_pager_quit) + return; if (w_rmatrix[w->w_index][i] & WITNESS_PARENT) witness_ddb_display_descendants(prnt, &w_data[i], indent); @@ -965,6 +967,8 @@ witness_ddb_display_list(int(*prnt)(cons /* This lock has no anscestors - display its descendants. */ witness_ddb_display_descendants(prnt, w, 0); + if (db_pager_quit) + return; } } @@ -986,12 +990,16 @@ witness_ddb_display(int(*prnt)(const cha */ prnt("Sleep locks:\n"); witness_ddb_display_list(prnt, &w_sleep); + if (db_pager_quit) + return; /* * Now do spin locks which have been acquired at least once. */ prnt("\nSpin locks:\n"); witness_ddb_display_list(prnt, &w_spin); + if (db_pager_quit) + return; /* * Finally, any locks which have not been acquired yet. @@ -1002,6 +1010,8 @@ witness_ddb_display(int(*prnt)(const cha continue; prnt("%s (type: %s, depth: %d)\n", w->w_name, w->w_class->lc_name, w->w_ddb_level); + if (db_pager_quit) + return; } } #endif /* DDB */ @@ -2398,6 +2408,8 @@ DB_SHOW_ALL_COMMAND(locks, db_witness_li db_printf("Process %d (%s) thread %p (%d)\n", p->p_pid, p->p_comm, td, td->td_tid); witness_ddb_list(td); + if (db_pager_quit) + return; } } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:01:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 961A81065687; Wed, 22 Aug 2012 20:01:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81E7E8FC1B; Wed, 22 Aug 2012 20:01:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MK1dNa089239; Wed, 22 Aug 2012 20:01:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK1dBu089235; Wed, 22 Aug 2012 20:01:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208222001.q7MK1dBu089235@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 20:01: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: r239585 - 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, 22 Aug 2012 20:01:39 -0000 Author: jhb Date: Wed Aug 22 20:01:38 2012 New Revision: 239585 URL: http://svn.freebsd.org/changeset/base/239585 Log: Mark the idle threads as non-sleepable and also assert that an idle thread never blocks on a turnstile. Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_turnstile.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Wed Aug 22 20:00:41 2012 (r239584) +++ head/sys/kern/sched_4bsd.c Wed Aug 22 20:01:38 2012 (r239585) @@ -1598,6 +1598,7 @@ sched_idletd(void *dummy) { struct pcpuidlestat *stat; + THREAD_NO_SLEEPING(); stat = DPCPU_PTR(idlestat); for (;;) { mtx_assert(&Giant, MA_NOTOWNED); Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Aug 22 20:00:41 2012 (r239584) +++ head/sys/kern/sched_ule.c Wed Aug 22 20:01:38 2012 (r239585) @@ -2581,6 +2581,7 @@ sched_idletd(void *dummy) mtx_assert(&Giant, MA_NOTOWNED); td = curthread; tdq = TDQ_SELF(); + THREAD_NO_SLEEPING(); for (;;) { #ifdef SMP if (tdq_idled(tdq) == 0) Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Wed Aug 22 20:00:41 2012 (r239584) +++ head/sys/kern/subr_turnstile.c Wed Aug 22 20:01:38 2012 (r239585) @@ -684,6 +684,7 @@ turnstile_wait(struct turnstile *ts, str if (owner) MPASS(owner->td_proc->p_magic == P_MAGIC); MPASS(queue == TS_SHARED_QUEUE || queue == TS_EXCLUSIVE_QUEUE); + KASSERT(!TD_IS_IDLETHREAD(td), ("idle threads cannot block on locks")); /* * If the lock does not already have a turnstile, use this thread's From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:01:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9456610657FB; Wed, 22 Aug 2012 20:01:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 807518FC12; Wed, 22 Aug 2012 20:01:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MK1wPd089300; Wed, 22 Aug 2012 20:01:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK1w8Y089298; Wed, 22 Aug 2012 20:01:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208222001.q7MK1w8Y089298@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 20:01: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: r239586 - 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, 22 Aug 2012 20:01:58 -0000 Author: jhb Date: Wed Aug 22 20:01:57 2012 New Revision: 239586 URL: http://svn.freebsd.org/changeset/base/239586 Log: Fix a typo. Modified: head/sys/kern/kern_module.c Modified: head/sys/kern/kern_module.c ============================================================================== --- head/sys/kern/kern_module.c Wed Aug 22 20:01:38 2012 (r239585) +++ head/sys/kern/kern_module.c Wed Aug 22 20:01:57 2012 (r239586) @@ -133,7 +133,7 @@ module_register_init(const void *arg) MOD_XLOCK; if (mod->file) { /* - * Once a module is succesfully loaded, move + * Once a module is successfully loaded, move * it to the head of the module list for this * linker file. This resorts the list so that * when the kernel linker iterates over the From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:02:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3184C1065674; Wed, 22 Aug 2012 20:02:43 +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 1DB5E8FC21; Wed, 22 Aug 2012 20:02:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MK2gPN089437; Wed, 22 Aug 2012 20:02:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK2gVY089435; Wed, 22 Aug 2012 20:02:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208222002.q7MK2gVY089435@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 20:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239587 - 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, 22 Aug 2012 20:02:43 -0000 Author: jhb Date: Wed Aug 22 20:02:42 2012 New Revision: 239587 URL: http://svn.freebsd.org/changeset/base/239587 Log: Assert that system calls do not leak a pinned thread (via sched_pin()) to userland. Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Wed Aug 22 20:01:57 2012 (r239586) +++ head/sys/kern/subr_syscall.c Wed Aug 22 20:02:42 2012 (r239587) @@ -188,6 +188,9 @@ syscallret(struct thread *td, int error, KASSERT((td->td_pflags & TDP_NOSLEEPING) == 0, ("System call %s returning with sleep disabled", syscallname(p, sa->code))); + KASSERT(td->td_pinned == 0, + ("System call %s returning with pinned thread", + syscallname(p, sa->code))); /* * Handle reschedule and other end-of-syscall issues From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:05:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A980106566C; Wed, 22 Aug 2012 20:05:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25A988FC08; Wed, 22 Aug 2012 20:05:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MK5ZGW089835; Wed, 22 Aug 2012 20:05:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK5YOa089833; Wed, 22 Aug 2012 20:05:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208222005.q7MK5YOa089833@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 20:05: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: r239588 - 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, 22 Aug 2012 20:05:35 -0000 Author: kib Date: Wed Aug 22 20:05:34 2012 New Revision: 239588 URL: http://svn.freebsd.org/changeset/base/239588 Log: Provide some compat32 shims for sysctl vfs.conflist. It is required for getvfsbyname(3) operation when called from 32bit process, and getvfsbyname(3) is used by recent bsdtar import. Reported by: many Tested by: David Naylor MFC after: 5 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Aug 22 20:02:42 2012 (r239587) +++ head/sys/kern/vfs_subr.c Wed Aug 22 20:05:34 2012 (r239588) @@ -41,6 +41,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_ddb.h" #include "opt_watchdog.h" @@ -3111,22 +3112,50 @@ DB_SHOW_COMMAND(mount, db_show_mount) /* * Fill in a struct xvfsconf based on a struct vfsconf. */ -static void -vfsconf2x(struct vfsconf *vfsp, struct xvfsconf *xvfsp) +static int +vfsconf2x(struct sysctl_req *req, struct vfsconf *vfsp) { + struct xvfsconf xvfsp; - strcpy(xvfsp->vfc_name, vfsp->vfc_name); - xvfsp->vfc_typenum = vfsp->vfc_typenum; - xvfsp->vfc_refcount = vfsp->vfc_refcount; - xvfsp->vfc_flags = vfsp->vfc_flags; + bzero(&xvfsp, sizeof(xvfsp)); + strcpy(xvfsp.vfc_name, vfsp->vfc_name); + xvfsp.vfc_typenum = vfsp->vfc_typenum; + xvfsp.vfc_refcount = vfsp->vfc_refcount; + xvfsp.vfc_flags = vfsp->vfc_flags; /* * These are unused in userland, we keep them * to not break binary compatibility. */ - xvfsp->vfc_vfsops = NULL; - xvfsp->vfc_next = NULL; + xvfsp.vfc_vfsops = NULL; + xvfsp.vfc_next = NULL; + return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); } +#ifdef COMPAT_FREEBSD32 +struct xvfsconf32 { + uint32_t vfc_vfsops; + char vfc_name[MFSNAMELEN]; + int32_t vfc_typenum; + int32_t vfc_refcount; + int32_t vfc_flags; + uint32_t vfc_next; +}; + +static int +vfsconf2x32(struct sysctl_req *req, struct vfsconf *vfsp) +{ + struct xvfsconf32 xvfsp; + + strcpy(xvfsp.vfc_name, vfsp->vfc_name); + xvfsp.vfc_typenum = vfsp->vfc_typenum; + xvfsp.vfc_refcount = vfsp->vfc_refcount; + xvfsp.vfc_flags = vfsp->vfc_flags; + xvfsp.vfc_vfsops = 0; + xvfsp.vfc_next = 0; + return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); +} +#endif + /* * Top level filesystem related information gathering. */ @@ -3134,14 +3163,16 @@ static int sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS) { struct vfsconf *vfsp; - struct xvfsconf xvfsp; int error; error = 0; TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { - bzero(&xvfsp, sizeof(xvfsp)); - vfsconf2x(vfsp, &xvfsp); - error = SYSCTL_OUT(req, &xvfsp, sizeof xvfsp); +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + error = vfsconf2x32(req, vfsp); + else +#endif + error = vfsconf2x(req, vfsp); if (error) break; } @@ -3161,7 +3192,6 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) int *name = (int *)arg1 - 1; /* XXX */ u_int namelen = arg2 + 1; /* XXX */ struct vfsconf *vfsp; - struct xvfsconf xvfsp; log(LOG_WARNING, "userland calling deprecated sysctl, " "please rebuild world\n"); @@ -3185,9 +3215,12 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) break; if (vfsp == NULL) return (EOPNOTSUPP); - bzero(&xvfsp, sizeof(xvfsp)); - vfsconf2x(vfsp, &xvfsp); - return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + return (vfsconf2x32(req, vfsp)); + else +#endif + return (vfsconf2x(req, vfsp)); } return (EOPNOTSUPP); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:06:33 2012 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 DB8281065672; Wed, 22 Aug 2012 20:06:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id B00598FC26; Wed, 22 Aug 2012 20:06:33 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 20698B9B7; Wed, 22 Aug 2012 16:06:33 -0400 (EDT) From: John Baldwin To: Jan Beich Date: Wed, 22 Aug 2012 16:06:22 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208221353.q7MDrbYB039551__4686.74262888289$1345643666$gmane$org@svn.freebsd.org> <1T4CmR-00012d-OP@internal.tormail.org> In-Reply-To: <1T4CmR-00012d-OP@internal.tormail.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201208221606.22178.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 22 Aug 2012 16:06:33 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239564 - 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: Wed, 22 Aug 2012 20:06:34 -0000 On Wednesday, August 22, 2012 11:24:05 am Jan Beich wrote: > (mx1.freebsd.org hates my smtp relay) > > John Baldwin writes: > > > Author: jhb > > Date: Wed Aug 22 13:53:37 2012 > > New Revision: 239564 > > URL: http://svn.freebsd.org/changeset/base/239564 > > > > Log: > > Revert r239356 and use an alternate algorithm. > > Doesn't help here. It now goes into an endless cycle trying to renew IP. > > $ (pciconf -l; dmesg) | fgrep -m2 fxp0 > fxp0@pci0:5:0:0: class=0x020000 card=0xb1440e11 chip=0x12298086 rev=0x08 hdr=0x00 > fxp0: port 0xd000-0xd03f mem 0xf9100000-0xf9100fff,0xf9000000-0xf90fffff irq 20 at device 0.0 on pci5 Please try this patch relative to what is in HEAD: Index: dhcpd.h =================================================================== --- dhcpd.h (revision 239564) +++ dhcpd.h (working copy) @@ -209,6 +209,7 @@ int dead; u_int16_t index; int linkstat; + time_t linktime; }; struct timeout { Index: dhclient.c =================================================================== --- dhclient.c (revision 239564) +++ dhclient.c (working copy) @@ -285,8 +285,14 @@ ifi->linkstat ? "up" : "down", linkstat ? "up" : "down"); ifi->linkstat = linkstat; - if (linkstat) + + /* + * XXX: Hardcoded 5 second grace window on + * link flaps. + */ + if (linkstat && (cur_time - ifi->linktime) >= 5) state_reboot(ifi); + ifi->linktime = cur_time; } break; case RTM_IFANNOUNCE: @@ -441,6 +447,7 @@ fprintf(stderr, " got link\n"); } ifi->linkstat = 1; + ifi->linktime = cur_time; if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1) error("cannot open %s: %m", _PATH_DEVNULL); -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:07:00 2012 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 61CCE10658D3; Wed, 22 Aug 2012 20:07:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4332E8FC0A; Wed, 22 Aug 2012 20:07:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MK70pS090049; Wed, 22 Aug 2012 20:07:00 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK70v6090038; Wed, 22 Aug 2012 20:07:00 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208222007.q7MK70v6090038@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 22 Aug 2012 20:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239589 - stable/9/lib/libedit 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, 22 Aug 2012 20:07:00 -0000 Author: pfg Date: Wed Aug 22 20:06:59 2012 New Revision: 239589 URL: http://svn.freebsd.org/changeset/base/239589 Log: MFC r238178, 238624, 238810: Re-merge a couple of changes from NetBSD libedit. bin/sh has been taught about el_gets setting the count to -1 on error, so now we can partially revert r238173 to reduce differences with NetBSD's implementation. Also fix some warnings to be more in sync with NetBSD. Obtained from: NetBSD Modified: stable/9/lib/libedit/chared.c stable/9/lib/libedit/chared.h stable/9/lib/libedit/editline.3 stable/9/lib/libedit/el.h stable/9/lib/libedit/makelist stable/9/lib/libedit/read.c stable/9/lib/libedit/sig.c stable/9/lib/libedit/sig.h stable/9/lib/libedit/tokenizer.c Directory Properties: stable/9/lib/libedit/ (props changed) Modified: stable/9/lib/libedit/chared.c ============================================================================== --- stable/9/lib/libedit/chared.c Wed Aug 22 20:05:34 2012 (r239588) +++ stable/9/lib/libedit/chared.c Wed Aug 22 20:06:59 2012 (r239589) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: chared.c,v 1.25 2005/08/08 01:41:30 christos Exp $ + * $NetBSD: chared.c,v 1.27 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -59,12 +59,12 @@ cv_undo(EditLine *el) { c_undo_t *vu = &el->el_chared.c_undo; c_redo_t *r = &el->el_chared.c_redo; - unsigned int size; + size_t size; /* Save entire line for undo */ size = el->el_line.lastchar - el->el_line.buffer; vu->len = size; - vu->cursor = el->el_line.cursor - el->el_line.buffer; + vu->cursor = (int)(el->el_line.cursor - el->el_line.buffer); memcpy(vu->buf, el->el_line.buffer, size); /* save command info for redo */ @@ -83,7 +83,7 @@ cv_yank(EditLine *el, const char *ptr, i { c_kill_t *k = &el->el_chared.c_kill; - memcpy(k->buf, ptr, size +0u); + memcpy(k->buf, ptr, (size_t)size); k->last = k->buf + size; } @@ -97,7 +97,7 @@ c_insert(EditLine *el, int num) char *cp; if (el->el_line.lastchar + num >= el->el_line.limit) { - if (!ch_enlargebufs(el, num +0u)) + if (!ch_enlargebufs(el, (size_t)num)) return; /* can't go past end of buffer */ } @@ -118,7 +118,7 @@ c_delafter(EditLine *el, int num) { if (el->el_line.cursor + num > el->el_line.lastchar) - num = el->el_line.lastchar - el->el_line.cursor; + num = (int)(el->el_line.lastchar - el->el_line.cursor); if (el->el_map.current != el->el_map.emacs) { cv_undo(el); @@ -159,7 +159,7 @@ c_delbefore(EditLine *el, int num) { if (el->el_line.cursor - num < el->el_line.buffer) - num = el->el_line.cursor - el->el_line.buffer; + num = (int)(el->el_line.cursor - el->el_line.buffer); if (el->el_map.current != el->el_map.emacs) { cv_undo(el); @@ -375,7 +375,7 @@ cv_delfini(EditLine *el) /* sanity */ return; - size = el->el_line.cursor - el->el_chared.c_vcmd.pos; + size = (int)(el->el_line.cursor - el->el_chared.c_vcmd.pos); if (size == 0) size = 1; el->el_line.cursor = el->el_chared.c_vcmd.pos; @@ -529,8 +529,7 @@ ch_reset(EditLine *el, int mclear) } private void -ch__clearmacro(el) - EditLine *el; +ch__clearmacro(EditLine *el) { c_macro_t *ma = &el->el_chared.c_macro; while (ma->level >= 0) @@ -542,9 +541,7 @@ ch__clearmacro(el) * Returns 1 if successful, 0 if not. */ protected int -ch_enlargebufs(el, addlen) - EditLine *el; - size_t addlen; +ch_enlargebufs(EditLine *el, size_t addlen) { size_t sz, newsz; char *newbuffer, *oldbuf, *oldkbuf; @@ -695,12 +692,12 @@ protected int c_gets(EditLine *el, char *buf, const char *prompt) { char ch; - int len; + ssize_t len; char *cp = el->el_line.buffer; if (prompt) { len = strlen(prompt); - memcpy(cp, prompt, len + 0u); + memcpy(cp, prompt, (size_t)len); cp += len; } len = 0; @@ -721,7 +718,7 @@ c_gets(EditLine *el, char *buf, const ch case '\010': /* Delete and backspace */ case '\177': - if (len <= 0) { + if (len == 0) { len = -1; break; } @@ -749,7 +746,7 @@ c_gets(EditLine *el, char *buf, const ch el->el_line.buffer[0] = '\0'; el->el_line.lastchar = el->el_line.buffer; el->el_line.cursor = el->el_line.buffer; - return len; + return (int)len; } @@ -771,6 +768,6 @@ c_hpos(EditLine *el) ptr >= el->el_line.buffer && *ptr != '\n'; ptr--) continue; - return (el->el_line.cursor - ptr - 1); + return (int)(el->el_line.cursor - ptr - 1); } } Modified: stable/9/lib/libedit/chared.h ============================================================================== --- stable/9/lib/libedit/chared.h Wed Aug 22 20:05:34 2012 (r239588) +++ stable/9/lib/libedit/chared.h Wed Aug 22 20:06:59 2012 (r239589) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)chared.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: chared.h,v 1.17 2006/03/06 21:11:56 christos Exp $ + * $NetBSD: chared.h,v 1.18 2009/02/15 21:55:23 christos Exp $ * $FreeBSD$ */ @@ -70,7 +70,7 @@ typedef struct c_macro_t { * Undo information for vi - no undo in emacs (yet) */ typedef struct c_undo_t { - int len; /* length of saved line */ + ssize_t len; /* length of saved line */ int cursor; /* position of saved cursor */ char *buf; /* full saved text */ } c_undo_t; Modified: stable/9/lib/libedit/editline.3 ============================================================================== --- stable/9/lib/libedit/editline.3 Wed Aug 22 20:05:34 2012 (r239588) +++ stable/9/lib/libedit/editline.3 Wed Aug 22 20:06:59 2012 (r239589) @@ -162,6 +162,11 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. +If an error occurred, +.Fa count +is set to \-1 and +.Dv errno +contains the error code that caused it. The return value may not remain valid across calls to .Fn el_gets and must be copied if the data is to be retained. Modified: stable/9/lib/libedit/el.h ============================================================================== --- stable/9/lib/libedit/el.h Wed Aug 22 20:05:34 2012 (r239588) +++ stable/9/lib/libedit/el.h Wed Aug 22 20:06:59 2012 (r239589) @@ -115,6 +115,7 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ + int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: stable/9/lib/libedit/makelist ============================================================================== --- stable/9/lib/libedit/makelist Wed Aug 22 20:05:34 2012 (r239588) +++ stable/9/lib/libedit/makelist Wed Aug 22 20:06:59 2012 (r239589) @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: makelist,v 1.10 2005/08/08 14:04:49 christos Exp $ +# $NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $ # $FreeBSD$ # # Copyright (c) 1992, 1993 @@ -141,7 +141,7 @@ case $FLAG in # -fh) cat $FILES | $AWK '/el_action_t/ { print $3 }' | \ - sort | LC_ALL=C tr 'a-z' 'A-Z' | $AWK ' + sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK ' BEGIN { printf("/* Automatically generated file, do not edit */\n"); printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n"); Modified: stable/9/lib/libedit/read.c ============================================================================== --- stable/9/lib/libedit/read.c Wed Aug 22 20:05:34 2012 (r239588) +++ stable/9/lib/libedit/read.c Wed Aug 22 20:06:59 2012 (r239589) @@ -235,9 +235,12 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; + el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ + if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ + el->el_errno = num == 0 ? 0 : errno; return (num); + } #ifdef KANJI if ((*ch & 0200)) { @@ -289,14 +292,21 @@ read_char(EditLine *el, char *cp) ssize_t num_read; int tried = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) + again: + el->el_signal->sig_no = 0; + while ((num_read = read(el->el_infd, cp, 1)) == -1) { + if (el->el_signal->sig_no == SIGCONT) { + sig_set(el); + el_set(el, EL_REFRESH); + goto again; + } if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - + } return (int)num_read; } @@ -403,10 +413,13 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; + int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ + if (nread == NULL) + nread = &nrb; *nread = 0; if (el->el_flags & NO_TTY) { @@ -427,12 +440,13 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } + if (num == -1) + el->el_errno = errno; el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + goto done; } @@ -443,8 +457,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); if (chrs == 0) { if (tty_rawmode(el) < 0) { - if (nread) - *nread = 0; + errno = 0; + *nread = 0; return (NULL); } } @@ -457,6 +471,7 @@ el_gets(EditLine *el, int *nread) if (el->el_flags & EDIT_DISABLED) { char *cp; size_t idx; + if ((el->el_flags & UNBUFFERED) == 0) cp = el->el_line.buffer; else @@ -480,11 +495,13 @@ el_gets(EditLine *el, int *nread) break; } + if (num == -1) { + el->el_errno = errno; + } + el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + goto done; } for (num = OKCMD; num == OKCMD;) { /* while still editing this @@ -617,12 +634,17 @@ el_gets(EditLine *el, int *nread) /* make sure the tty is set up correctly */ if ((el->el_flags & UNBUFFERED) == 0) { read_finish(el); - if (nread) - *nread = num; + *nread = num != -1 ? num : 0; } else { - if (nread) - *nread = - (int)(el->el_line.lastchar - el->el_line.buffer); + *nread = (int)(el->el_line.lastchar - el->el_line.buffer); } - return (num ? el->el_line.buffer : NULL); +done: + if (*nread == 0) { + if (num == -1) { + *nread = -1; + errno = el->el_errno; + } + return NULL; + } else + return el->el_line.buffer; } Modified: stable/9/lib/libedit/sig.c ============================================================================== --- stable/9/lib/libedit/sig.c Wed Aug 22 20:05:34 2012 (r239588) +++ stable/9/lib/libedit/sig.c Wed Aug 22 20:06:59 2012 (r239589) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $ + * $NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -73,6 +73,8 @@ sig_handler(int signo) (void) sigaddset(&nset, signo); (void) sigprocmask(SIG_BLOCK, &nset, &oset); + sel->el_signal->sig_no = signo; + switch (signo) { case SIGCONT: tty_rawmode(sel); @@ -158,12 +160,12 @@ sig_set(EditLine *el) struct sigaction osa, nsa; nsa.sa_handler = sig_handler; + nsa.sa_flags = 0; sigemptyset(&nsa.sa_mask); (void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset); for (i = 0; sighdl[i] != -1; i++) { - nsa.sa_flags = SIGINT ? 0 : SA_RESTART; /* This could happen if we get interrupted */ if (sigaction(sighdl[i], &nsa, &osa) != -1 && osa.sa_handler != sig_handler) Modified: stable/9/lib/libedit/sig.h ============================================================================== --- stable/9/lib/libedit/sig.h Wed Aug 22 20:05:34 2012 (r239588) +++ stable/9/lib/libedit/sig.h Wed Aug 22 20:06:59 2012 (r239589) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sig.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ + * $NetBSD: sig.h,v 1.8 2009/02/19 15:20:22 christos Exp $ * $FreeBSD$ */ @@ -61,6 +61,7 @@ typedef struct { struct sigaction sig_action[ALLSIGSNO]; sigset_t sig_set; + volatile sig_atomic_t sig_no; } *el_signal_t; protected void sig_end(EditLine*); Modified: stable/9/lib/libedit/tokenizer.c ============================================================================== --- stable/9/lib/libedit/tokenizer.c Wed Aug 22 20:05:34 2012 (r239588) +++ stable/9/lib/libedit/tokenizer.c Wed Aug 22 20:06:59 2012 (r239589) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: tokenizer.c,v 1.14 2003/12/05 13:37:48 lukem Exp $ + * $NetBSD: tokenizer.c,v 1.15 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -198,7 +198,7 @@ tok_line(Tokenizer *tok, const LineInfo ptr = ""; if (ptr == line->cursor) { cc = tok->argc; - co = tok->wptr - tok->wstart; + co = (int)(tok->wptr - tok->wstart); } switch (*ptr) { case '\'': @@ -417,7 +417,7 @@ tok_line(Tokenizer *tok, const LineInfo tok_line_outok: if (cc == -1 && co == -1) { cc = tok->argc; - co = tok->wptr - tok->wstart; + co = (int)(tok->wptr - tok->wstart); } if (cursorc != NULL) *cursorc = cc; From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:07:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F25961065AAF; Wed, 22 Aug 2012 20:07:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D45908FC08; Wed, 22 Aug 2012 20:07:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MK7AgU090138; Wed, 22 Aug 2012 20:07:10 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK7APC090128; Wed, 22 Aug 2012 20:07:10 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208222007.q7MK7APC090128@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 22 Aug 2012 20:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239590 - stable/8/lib/libedit X-BeenThere: svn-src-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, 22 Aug 2012 20:07:11 -0000 Author: pfg Date: Wed Aug 22 20:07:10 2012 New Revision: 239590 URL: http://svn.freebsd.org/changeset/base/239590 Log: MFC r238178, 238624, 238810: Re-merge a couple of changes from NetBSD libedit. bin/sh has been taught about el_gets setting the count to -1 on error, so now we can partially revert r238173 to reduce differences with NetBSD's implementation. Also fix some warnings to be more in sync with NetBSD. Obtained from: NetBSD Modified: stable/8/lib/libedit/chared.c stable/8/lib/libedit/chared.h stable/8/lib/libedit/editline.3 stable/8/lib/libedit/el.h stable/8/lib/libedit/makelist stable/8/lib/libedit/read.c stable/8/lib/libedit/sig.c stable/8/lib/libedit/sig.h stable/8/lib/libedit/tokenizer.c Directory Properties: stable/8/lib/libedit/ (props changed) Modified: stable/8/lib/libedit/chared.c ============================================================================== --- stable/8/lib/libedit/chared.c Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/chared.c Wed Aug 22 20:07:10 2012 (r239590) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: chared.c,v 1.25 2005/08/08 01:41:30 christos Exp $ + * $NetBSD: chared.c,v 1.27 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -59,12 +59,12 @@ cv_undo(EditLine *el) { c_undo_t *vu = &el->el_chared.c_undo; c_redo_t *r = &el->el_chared.c_redo; - unsigned int size; + size_t size; /* Save entire line for undo */ size = el->el_line.lastchar - el->el_line.buffer; vu->len = size; - vu->cursor = el->el_line.cursor - el->el_line.buffer; + vu->cursor = (int)(el->el_line.cursor - el->el_line.buffer); memcpy(vu->buf, el->el_line.buffer, size); /* save command info for redo */ @@ -83,7 +83,7 @@ cv_yank(EditLine *el, const char *ptr, i { c_kill_t *k = &el->el_chared.c_kill; - memcpy(k->buf, ptr, size +0u); + memcpy(k->buf, ptr, (size_t)size); k->last = k->buf + size; } @@ -97,7 +97,7 @@ c_insert(EditLine *el, int num) char *cp; if (el->el_line.lastchar + num >= el->el_line.limit) { - if (!ch_enlargebufs(el, num +0u)) + if (!ch_enlargebufs(el, (size_t)num)) return; /* can't go past end of buffer */ } @@ -118,7 +118,7 @@ c_delafter(EditLine *el, int num) { if (el->el_line.cursor + num > el->el_line.lastchar) - num = el->el_line.lastchar - el->el_line.cursor; + num = (int)(el->el_line.lastchar - el->el_line.cursor); if (el->el_map.current != el->el_map.emacs) { cv_undo(el); @@ -159,7 +159,7 @@ c_delbefore(EditLine *el, int num) { if (el->el_line.cursor - num < el->el_line.buffer) - num = el->el_line.cursor - el->el_line.buffer; + num = (int)(el->el_line.cursor - el->el_line.buffer); if (el->el_map.current != el->el_map.emacs) { cv_undo(el); @@ -375,7 +375,7 @@ cv_delfini(EditLine *el) /* sanity */ return; - size = el->el_line.cursor - el->el_chared.c_vcmd.pos; + size = (int)(el->el_line.cursor - el->el_chared.c_vcmd.pos); if (size == 0) size = 1; el->el_line.cursor = el->el_chared.c_vcmd.pos; @@ -529,8 +529,7 @@ ch_reset(EditLine *el, int mclear) } private void -ch__clearmacro(el) - EditLine *el; +ch__clearmacro(EditLine *el) { c_macro_t *ma = &el->el_chared.c_macro; while (ma->level >= 0) @@ -542,9 +541,7 @@ ch__clearmacro(el) * Returns 1 if successful, 0 if not. */ protected int -ch_enlargebufs(el, addlen) - EditLine *el; - size_t addlen; +ch_enlargebufs(EditLine *el, size_t addlen) { size_t sz, newsz; char *newbuffer, *oldbuf, *oldkbuf; @@ -695,12 +692,12 @@ protected int c_gets(EditLine *el, char *buf, const char *prompt) { char ch; - int len; + ssize_t len; char *cp = el->el_line.buffer; if (prompt) { len = strlen(prompt); - memcpy(cp, prompt, len + 0u); + memcpy(cp, prompt, (size_t)len); cp += len; } len = 0; @@ -721,7 +718,7 @@ c_gets(EditLine *el, char *buf, const ch case '\010': /* Delete and backspace */ case '\177': - if (len <= 0) { + if (len == 0) { len = -1; break; } @@ -749,7 +746,7 @@ c_gets(EditLine *el, char *buf, const ch el->el_line.buffer[0] = '\0'; el->el_line.lastchar = el->el_line.buffer; el->el_line.cursor = el->el_line.buffer; - return len; + return (int)len; } @@ -771,6 +768,6 @@ c_hpos(EditLine *el) ptr >= el->el_line.buffer && *ptr != '\n'; ptr--) continue; - return (el->el_line.cursor - ptr - 1); + return (int)(el->el_line.cursor - ptr - 1); } } Modified: stable/8/lib/libedit/chared.h ============================================================================== --- stable/8/lib/libedit/chared.h Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/chared.h Wed Aug 22 20:07:10 2012 (r239590) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)chared.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: chared.h,v 1.17 2006/03/06 21:11:56 christos Exp $ + * $NetBSD: chared.h,v 1.18 2009/02/15 21:55:23 christos Exp $ * $FreeBSD$ */ @@ -70,7 +70,7 @@ typedef struct c_macro_t { * Undo information for vi - no undo in emacs (yet) */ typedef struct c_undo_t { - int len; /* length of saved line */ + ssize_t len; /* length of saved line */ int cursor; /* position of saved cursor */ char *buf; /* full saved text */ } c_undo_t; Modified: stable/8/lib/libedit/editline.3 ============================================================================== --- stable/8/lib/libedit/editline.3 Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/editline.3 Wed Aug 22 20:07:10 2012 (r239590) @@ -165,6 +165,11 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. +If an error occurred, +.Fa count +is set to \-1 and +.Dv errno +contains the error code that caused it. The return value may not remain valid across calls to .Fn el_gets and must be copied if the data is to be retained. Modified: stable/8/lib/libedit/el.h ============================================================================== --- stable/8/lib/libedit/el.h Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/el.h Wed Aug 22 20:07:10 2012 (r239590) @@ -115,6 +115,7 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ + int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: stable/8/lib/libedit/makelist ============================================================================== --- stable/8/lib/libedit/makelist Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/makelist Wed Aug 22 20:07:10 2012 (r239590) @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: makelist,v 1.10 2005/08/08 14:04:49 christos Exp $ +# $NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $ # $FreeBSD$ # # Copyright (c) 1992, 1993 @@ -141,7 +141,7 @@ case $FLAG in # -fh) cat $FILES | $AWK '/el_action_t/ { print $3 }' | \ - sort | LC_ALL=C tr 'a-z' 'A-Z' | $AWK ' + sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK ' BEGIN { printf("/* Automatically generated file, do not edit */\n"); printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n"); Modified: stable/8/lib/libedit/read.c ============================================================================== --- stable/8/lib/libedit/read.c Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/read.c Wed Aug 22 20:07:10 2012 (r239590) @@ -235,9 +235,12 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; + el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ + if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ + el->el_errno = num == 0 ? 0 : errno; return (num); + } #ifdef KANJI if ((*ch & 0200)) { @@ -289,14 +292,21 @@ read_char(EditLine *el, char *cp) ssize_t num_read; int tried = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) + again: + el->el_signal->sig_no = 0; + while ((num_read = read(el->el_infd, cp, 1)) == -1) { + if (el->el_signal->sig_no == SIGCONT) { + sig_set(el); + el_set(el, EL_REFRESH); + goto again; + } if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - + } return (int)num_read; } @@ -403,10 +413,13 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; + int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ + if (nread == NULL) + nread = &nrb; *nread = 0; if (el->el_flags & NO_TTY) { @@ -427,12 +440,13 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } + if (num == -1) + el->el_errno = errno; el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + goto done; } @@ -443,8 +457,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); if (chrs == 0) { if (tty_rawmode(el) < 0) { - if (nread) - *nread = 0; + errno = 0; + *nread = 0; return (NULL); } } @@ -457,6 +471,7 @@ el_gets(EditLine *el, int *nread) if (el->el_flags & EDIT_DISABLED) { char *cp; size_t idx; + if ((el->el_flags & UNBUFFERED) == 0) cp = el->el_line.buffer; else @@ -480,11 +495,13 @@ el_gets(EditLine *el, int *nread) break; } + if (num == -1) { + el->el_errno = errno; + } + el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + goto done; } for (num = OKCMD; num == OKCMD;) { /* while still editing this @@ -617,12 +634,17 @@ el_gets(EditLine *el, int *nread) /* make sure the tty is set up correctly */ if ((el->el_flags & UNBUFFERED) == 0) { read_finish(el); - if (nread) - *nread = num; + *nread = num != -1 ? num : 0; } else { - if (nread) - *nread = - (int)(el->el_line.lastchar - el->el_line.buffer); + *nread = (int)(el->el_line.lastchar - el->el_line.buffer); } - return (num ? el->el_line.buffer : NULL); +done: + if (*nread == 0) { + if (num == -1) { + *nread = -1; + errno = el->el_errno; + } + return NULL; + } else + return el->el_line.buffer; } Modified: stable/8/lib/libedit/sig.c ============================================================================== --- stable/8/lib/libedit/sig.c Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/sig.c Wed Aug 22 20:07:10 2012 (r239590) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $ + * $NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -73,6 +73,8 @@ sig_handler(int signo) (void) sigaddset(&nset, signo); (void) sigprocmask(SIG_BLOCK, &nset, &oset); + sel->el_signal->sig_no = signo; + switch (signo) { case SIGCONT: tty_rawmode(sel); @@ -158,12 +160,12 @@ sig_set(EditLine *el) struct sigaction osa, nsa; nsa.sa_handler = sig_handler; + nsa.sa_flags = 0; sigemptyset(&nsa.sa_mask); (void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset); for (i = 0; sighdl[i] != -1; i++) { - nsa.sa_flags = SIGINT ? 0 : SA_RESTART; /* This could happen if we get interrupted */ if (sigaction(sighdl[i], &nsa, &osa) != -1 && osa.sa_handler != sig_handler) Modified: stable/8/lib/libedit/sig.h ============================================================================== --- stable/8/lib/libedit/sig.h Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/sig.h Wed Aug 22 20:07:10 2012 (r239590) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sig.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ + * $NetBSD: sig.h,v 1.8 2009/02/19 15:20:22 christos Exp $ * $FreeBSD$ */ @@ -61,6 +61,7 @@ typedef struct { struct sigaction sig_action[ALLSIGSNO]; sigset_t sig_set; + volatile sig_atomic_t sig_no; } *el_signal_t; protected void sig_end(EditLine*); Modified: stable/8/lib/libedit/tokenizer.c ============================================================================== --- stable/8/lib/libedit/tokenizer.c Wed Aug 22 20:06:59 2012 (r239589) +++ stable/8/lib/libedit/tokenizer.c Wed Aug 22 20:07:10 2012 (r239590) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: tokenizer.c,v 1.14 2003/12/05 13:37:48 lukem Exp $ + * $NetBSD: tokenizer.c,v 1.15 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -198,7 +198,7 @@ tok_line(Tokenizer *tok, const LineInfo ptr = ""; if (ptr == line->cursor) { cc = tok->argc; - co = tok->wptr - tok->wstart; + co = (int)(tok->wptr - tok->wstart); } switch (*ptr) { case '\'': @@ -417,7 +417,7 @@ tok_line(Tokenizer *tok, const LineInfo tok_line_outok: if (cc == -1 && co == -1) { cc = tok->argc; - co = tok->wptr - tok->wstart; + co = (int)(tok->wptr - tok->wstart); } if (cursorc != NULL) *cursorc = cc; From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:22:55 2012 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 AD8BB106566B; Wed, 22 Aug 2012 20:22:55 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99EED8FC08; Wed, 22 Aug 2012 20:22:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MKMtZH092128; Wed, 22 Aug 2012 20:22:55 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MKMtEt092126; Wed, 22 Aug 2012 20:22:55 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208222022.q7MKMtEt092126@svn.freebsd.org> From: Jim Harris Date: Wed, 22 Aug 2012 20:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239591 - head/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: Wed, 22 Aug 2012 20:22:55 -0000 Author: jimharris Date: Wed Aug 22 20:22:55 2012 New Revision: 239591 URL: http://svn.freebsd.org/changeset/base/239591 Log: Remove unncessary atomic operation when reading process flags in PMC_PROC_IS_USING_PMCS macro. Invocations of this macro are not synchronized with setting/clearing of P_HWPMC flag, so the atomic operation here isn't needed. Removing the atomic operation provides noticeable improvement (5-6%) on some scheduler-intensive workloads with HWPMC_HOOKS enabled on an 8C Sandy Bridge Xeon system. Sponsored by: Intel Reviewed by: jhb MFC after: 1 week Modified: head/sys/sys/pmckern.h Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Wed Aug 22 20:07:10 2012 (r239590) +++ head/sys/sys/pmckern.h Wed Aug 22 20:22:55 2012 (r239591) @@ -201,8 +201,7 @@ do { \ /* Check if a process is using HWPMCs.*/ #define PMC_PROC_IS_USING_PMCS(p) \ - (__predict_false(atomic_load_acq_int(&(p)->p_flag) & \ - P_HWPMC)) + (__predict_false(p->p_flag & P_HWPMC)) /* Check if a thread have pending user capture. */ #define PMC_IS_PENDING_CALLCHAIN(p) \ From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:34:24 2012 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 0F8AA106564A; Wed, 22 Aug 2012 20:34:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE2288FC14; Wed, 22 Aug 2012 20:34:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MKYNv0093644; Wed, 22 Aug 2012 20:34:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MKYNxn093642; Wed, 22 Aug 2012 20:34:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208222034.q7MKYNxn093642@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 20:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239592 - stable/8/sys/vm X-BeenThere: svn-src-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, 22 Aug 2012 20:34:24 -0000 Author: kib Date: Wed Aug 22 20:34:23 2012 New Revision: 239592 URL: http://svn.freebsd.org/changeset/base/239592 Log: MFC r239247: Adjust the r205536, by allowing a non-zero offset for anonymous mappings for a.out binaries. Apparently, a.out ld.so from FreeBSD 1.1.5.1 can issue such requests. Modified: stable/8/sys/vm/vm_mmap.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/vm/vm_mmap.c ============================================================================== --- stable/8/sys/vm/vm_mmap.c Wed Aug 22 20:22:55 2012 (r239591) +++ stable/8/sys/vm/vm_mmap.c Wed Aug 22 20:34:23 2012 (r239592) @@ -202,11 +202,24 @@ mmap(td, uap) pos = uap->pos; fp = NULL; - /* make sure mapping fits into numeric range etc */ - if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && - curproc->p_osrel >= P_OSREL_MAP_ANON) || - ((flags & MAP_ANON) && (uap->fd != -1 || pos != 0))) - return (EINVAL); + + /* + * Enforce the constraints. + * Mapping of length 0 is only allowed for old binaries. + * Anonymous mapping shall specify -1 as filedescriptor and + * zero position for new code. Be nice to ancient a.out + * binaries and correct pos for anonymous mapping, since old + * ld.so sometimes issues anonymous map requests with non-zero + * pos. + */ + if (!SV_CURPROC_FLAG(SV_AOUT)) { + if ((uap->len == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) || + ((flags & MAP_ANON) != 0 && (uap->fd != -1 || pos != 0))) + return (EINVAL); + } else { + if ((flags & MAP_ANON) != 0) + pos = 0; + } if (flags & MAP_STACK) { if ((uap->fd != -1) || From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:56:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B921A106566B; Wed, 22 Aug 2012 20:56:53 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A530C8FC0A; Wed, 22 Aug 2012 20:56:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MKur1l096538; Wed, 22 Aug 2012 20:56:53 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MKurns096535; Wed, 22 Aug 2012 20:56:53 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208222056.q7MKurns096535@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 20: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: r239593 - 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: Wed, 22 Aug 2012 20:56:53 -0000 Author: obrien Date: Wed Aug 22 20:56:53 2012 New Revision: 239593 URL: http://svn.freebsd.org/changeset/base/239593 Log: Fix comment misspelling. Submitted by: kargl Modified: head/etc/rc.d/postrandom Modified: head/etc/rc.d/postrandom ============================================================================== --- head/etc/rc.d/postrandom Wed Aug 22 20:34:23 2012 (r239592) +++ head/etc/rc.d/postrandom Wed Aug 22 20:56:53 2012 (r239593) @@ -15,7 +15,7 @@ start_cmd="${name}_start" stop_cmd=":" # This will remove old ${entropy_file} and generate a new one. -# According to Bruce Schneier, this is stronly recomended in order +# According to Bruce Schneier, this is strongly recomended in order # to avoid using same ${entropy_file} across reboots. # Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 21:20:23 2012 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 5FCAA106564A; Wed, 22 Aug 2012 21:20:23 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3BAFE8FC0C; Wed, 22 Aug 2012 21:20:21 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so44236lbb.13 for ; Wed, 22 Aug 2012 14:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8iSPOeI7shXRnFpZ6/nkumuP2+dxOaT/BfzweaAjUG8=; b=qfCLxM5kPRvtKllHymqe9354rA9gQ1evym/xFRoy8Wp2zYEOSAluGYyEbzyCsjjqhf HIAekIuN8AW0frjqBKf/vVqVoSNr5KO8+8BShzjWNPqoBoCwZXxJEytVSSe6eh7LosuP WwSMLRWhXVgYwLcKEiywe8F/rRkxXmyacq3KL2vCKSTPK5YAI9hleAos7dNxCUI3dCaJ 5F9jjStFSJI5xruoPa0kulJOvno0GUb6Tw7xWD84Ed3B03b5Fd7H2G4K6nzLxUwDjFZI Cii2Z3lQRGxTbsUbDr2cDhrkF5euoioizjWt3yng7DUGsXXPzfOeQuZX6Nqp42v06sRu vRbQ== MIME-Version: 1.0 Received: by 10.112.101.194 with SMTP id fi2mr9841592lbb.104.1345670420780; Wed, 22 Aug 2012 14:20:20 -0700 (PDT) Received: by 10.112.60.227 with HTTP; Wed, 22 Aug 2012 14:20:20 -0700 (PDT) Received: by 10.112.60.227 with HTTP; Wed, 22 Aug 2012 14:20:20 -0700 (PDT) In-Reply-To: <201208222056.q7MKurns096535@svn.freebsd.org> References: <201208222056.q7MKurns096535@svn.freebsd.org> Date: Wed, 22 Aug 2012 22:20:20 +0100 Message-ID: From: Chris Rees To: "David E. O'Brien" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239593 - 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: Wed, 22 Aug 2012 21:20:23 -0000 On 22 Aug 2012 21:57, "David E. O'Brien" wrote: > > Author: obrien > Date: Wed Aug 22 20:56:53 2012 > New Revision: 239593 > URL: http://svn.freebsd.org/changeset/base/239593 > > Log: > Fix comment misspelling. > > Submitted by: kargl > > Modified: > head/etc/rc.d/postrandom > > Modified: head/etc/rc.d/postrandom > ============================================================================== > --- head/etc/rc.d/postrandom Wed Aug 22 20:34:23 2012 (r239592) > +++ head/etc/rc.d/postrandom Wed Aug 22 20:56:53 2012 (r239593) > @@ -15,7 +15,7 @@ start_cmd="${name}_start" > stop_cmd=":" > > # This will remove old ${entropy_file} and generate a new one. > -# According to Bruce Schneier, this is stronly recomended in order > +# According to Bruce Schneier, this is strongly recomended in order > # to avoid using same ${entropy_file} across reboots. > # Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 Nitpicking... but recommended is also incorrect! Chris From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 21:30:55 2012 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 986D01065670; Wed, 22 Aug 2012 21:30:55 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 336548FC15; Wed, 22 Aug 2012 21:30:55 +0000 (UTC) Received: by obbun3 with SMTP id un3so148314obb.13 for ; Wed, 22 Aug 2012 14:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=J6tC5gHcm6CIMCQmIoW4lC3WjTitHWsVto6EbkC2czA=; b=eed+P5ZrFWMOAgLQ7CfC1tWhRrXPV379WZjaLkEiIs00PEgUTnf/VnKvTTm+F3uo7g tpNt45Dlq3h3wcW3UV3QBIq3IXdshXVy3zejwj5hm34A3RUp+QWuJ5daR5rr5jze4m7G 8hiw5imuTJNdt6umOJCaYJ9UD+jJv9PfbRSnlw7wWOd9SlmK88lwTrY5eBo6okUi0t4n F4cdZTpYCIa/Len2SrlnKmFzN9IIj4evb41nXTSMI7iZTNcG07BU3mYY6EZ5NMsj98jS eQIQRuk42Oj4KyMUay7oYpMd7I2ifaXbpgl4GPMIEugR7QV+efEHar2GiTJcG+uUgpeu VgfQ== MIME-Version: 1.0 Received: by 10.182.45.41 with SMTP id j9mr16671633obm.67.1345671054837; Wed, 22 Aug 2012 14:30:54 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Wed, 22 Aug 2012 14:30:54 -0700 (PDT) In-Reply-To: References: <201208222056.q7MKurns096535@svn.freebsd.org> Date: Wed, 22 Aug 2012 14:30:54 -0700 Message-ID: From: Garrett Cooper To: Chris Rees Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r239593 - 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: Wed, 22 Aug 2012 21:30:55 -0000 On Wed, Aug 22, 2012 at 2:20 PM, Chris Rees wrote: > On 22 Aug 2012 21:57, "David E. O'Brien" wrote: >> >> Author: obrien >> Date: Wed Aug 22 20:56:53 2012 >> New Revision: 239593 >> URL: http://svn.freebsd.org/changeset/base/239593 >> >> Log: >> Fix comment misspelling. >> >> Submitted by: kargl >> >> Modified: >> head/etc/rc.d/postrandom >> >> Modified: head/etc/rc.d/postrandom >> > ============================================================================== >> --- head/etc/rc.d/postrandom Wed Aug 22 20:34:23 2012 (r239592) >> +++ head/etc/rc.d/postrandom Wed Aug 22 20:56:53 2012 (r239593) >> @@ -15,7 +15,7 @@ start_cmd="${name}_start" >> stop_cmd=":" >> >> # This will remove old ${entropy_file} and generate a new one. >> -# According to Bruce Schneier, this is stronly recomended in order >> +# According to Bruce Schneier, this is strongly recomended in order >> # to avoid using same ${entropy_file} across reboots. >> # Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 > > Nitpicking... but recommended is also incorrect! As is "Cryptography". -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 21:37:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id 25B701065670; Wed, 22 Aug 2012 21:37:38 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id B5821162977; Wed, 22 Aug 2012 21:37:37 +0000 (UTC) Message-ID: <50355121.3070408@FreeBSD.org> Date: Wed, 22 Aug 2012 14:37:37 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120728 Thunderbird/14.0 MIME-Version: 1.0 To: "David E. O'Brien" References: <201208221835.q7MIZI77076855@svn.freebsd.org> In-Reply-To: <201208221835.q7MIZI77076855@svn.freebsd.org> X-Enigmail-Version: 1.4.3 OpenPGP: id=1A1ABC84 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: r239568 - 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: Wed, 22 Aug 2012 21:37:38 -0000 Were these changes discussed somewhere and I missed it? I'm not opposed per se, but the security aspects should be discussed on freebsd-security@, and it's preferable that significant changes to rcorder be looked at on freebsd-rc@ as well. Can you hold off on MFC'ing any of this until it's been reviewed more thoroughly? Doug On 08/22/2012 11:35, David E. O'Brien wrote: > Author: obrien > Date: Wed Aug 22 18:35:17 2012 > New Revision: 239568 > URL: http://svn.freebsd.org/changeset/base/239568 > > Log: > Add dependencies based on security(7). > > Modified: > head/etc/rc.d/securelevel > > Modified: head/etc/rc.d/securelevel > ============================================================================== > --- head/etc/rc.d/securelevel Wed Aug 22 18:30:13 2012 (r239567) > +++ head/etc/rc.d/securelevel Wed Aug 22 18:35:17 2012 (r239568) > @@ -4,6 +4,7 @@ > # > > # PROVIDE: securelevel > +# REQUIRE: adjkerntz ipfw ipfilter pf > > . /etc/rc.subr > > -- I am only one, but I am one. I cannot do everything, but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward Everett Hale, (1822 - 1909) From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 22:17:36 2012 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 A2B47106564A; Wed, 22 Aug 2012 22:17:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E3BA8FC08; Wed, 22 Aug 2012 22:17:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MMHaZv007234; Wed, 22 Aug 2012 22:17:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MMHa5U007231; Wed, 22 Aug 2012 22:17:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208222217.q7MMHa5U007231@svn.freebsd.org> From: Xin LI Date: Wed, 22 Aug 2012 22:17: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: r239595 - 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: Wed, 22 Aug 2012 22:17:36 -0000 Author: delphij Date: Wed Aug 22 22:17:35 2012 New Revision: 239595 URL: http://svn.freebsd.org/changeset/base/239595 Log: Allow - be used in the name of a provider. Without this change it's not possible to specify a gptid in geli_devices. Modified: head/etc/rc.d/geli head/etc/rc.d/geli2 Modified: head/etc/rc.d/geli ============================================================================== --- head/etc/rc.d/geli Wed Aug 22 21:14:59 2012 (r239594) +++ head/etc/rc.d/geli Wed Aug 22 22:17:35 2012 (r239595) @@ -53,7 +53,7 @@ geli_start() fi for provider in ${devices}; do - provider_=`ltr ${provider} '/' '_'` + provider_=`ltr ${provider} '/-' '_'` eval "flags=\${geli_${provider_}_flags}" if [ -z "${flags}" ]; then Modified: head/etc/rc.d/geli2 ============================================================================== --- head/etc/rc.d/geli2 Wed Aug 22 21:14:59 2012 (r239594) +++ head/etc/rc.d/geli2 Wed Aug 22 22:17:35 2012 (r239595) @@ -42,7 +42,7 @@ geli2_start() devices=`geli_make_list` for provider in ${devices}; do - provider_=`ltr ${provider} '/' '_'` + provider_=`ltr ${provider} '/-' '_'` eval "autodetach=\${geli_${provider_}_autodetach}" if [ -z "${autodetach}" ]; then From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 22:25:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 664) id 83E251065744; Wed, 22 Aug 2012 22:25:12 +0000 (UTC) Date: Wed, 22 Aug 2012 15:25:11 -0700 From: David O'Brien To: Doug Barton Message-ID: <20120822222511.GD78670@dragon.NUXI.org> References: <201208221835.q7MIZI77076855@svn.freebsd.org> <50355121.3070408@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50355121.3070408@FreeBSD.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239568 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org 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, 22 Aug 2012 22:25:13 -0000 On Wed, Aug 22, 2012 at 02:37:37PM -0700, Doug Barton wrote: > Were these changes discussed somewhere and I missed it? They were not discussed. I did not see the need. This is simple functionality. If securelevel is raised > 0, one cannot start up a firewall nor make major changes to time. Thus these components are required to be done before raising securelevel. > I'm not opposed per se, but the security aspects should be discussed on > freebsd-security@, I'm sorry, I didn't feel that ensuring the software follows the published specification of its functionality to have such a security aspect. > and it's preferable that significant changes to > rcorder be looked at on freebsd-rc@ as well. I don't consider this to be a significant change. I do have some significant changes that I do want freebsd-rc@ to review I will be sending soon. > Can you hold off on MFC'ing any of this until it's been reviewed more > thoroughly? Yes. -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 22:30:05 2012 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 2E9DF106564A; Wed, 22 Aug 2012 22:30:05 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id B10118FC0A; Wed, 22 Aug 2012 22:30:04 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 1592E3592ED; Thu, 23 Aug 2012 00:30:03 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id F02B42847B; Thu, 23 Aug 2012 00:30:02 +0200 (CEST) Date: Thu, 23 Aug 2012 00:30:02 +0200 From: Jilles Tjoelker To: "Simon J. Gerraty" Message-ID: <20120822223002.GA41104@stack.nl> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> <20120821222943.GA27203@stack.nl> <20120821232553.35D4F58085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120821232553.35D4F58085@chaos.jnpr.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac 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, 22 Aug 2012 22:30:05 -0000 On Tue, Aug 21, 2012 at 04:25:53PM -0700, Simon J. Gerraty wrote: > On Wed, 22 Aug 2012 00:29:44 +0200, Jilles Tjoelker writes: > >On FreeBSD, the first two statements are partially false. All sh(1) > >builtins that correspond to utilities specified by POSIX (but not > >special builtins) have versions accessible to execve() (on 8.x and > That's interesting, especially for 'cd', though is there any use case in > which it is actually useful? I'm drawing a blank. I think the most important reason is to reduce special cases. The POSIX developers did not want to create a second subset of utilities that are not available via execve() (the first subset is the special builtins). The burden on implementations is very low (see src/usr.bin/alias), and there are some possible use cases: 'cd' will fail if the directory does not exist. 'command -v' and 'command -V' will show information. 'read' will swallow input. 'type', 'umask' and 'ulimit' will show information. > >older, hash, type and ulimit are missing). This includes cd but not > >chdir, since chdir is not specified by POSIX. Also, FreeBSD make > >includes a somewhat arbitrary list of shell builtins, including cd, that > >cause it to invoke the shell even if there are no metacharacters. > Yes, I pondered whether something like that might be worthwhile, > but since a bare 'cd somewhere' all by itself is rather pointless, it > seemed a corner case. If it avoids the need to add semicolons for mysterious reasons, that may be enough reason. I think make's optimization of executing certain commands directly instead of passing them to sh should be rather invisible to the user, particularly if the optimization may be activated or deactivated by something seemingly innocuous like toggling -j. It seems not entirely possible to hide the optimization completely as that would require deeper knowledge of the shell in make. Shell builtins are usually found before a PATH search and there may be non-standard shell builtins. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 22:34:56 2012 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 7CF86106566B; Wed, 22 Aug 2012 22:34:56 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 690588FC12; Wed, 22 Aug 2012 22:34:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MMYulE009506; Wed, 22 Aug 2012 22:34:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MMYuCl009504; Wed, 22 Aug 2012 22:34:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208222234.q7MMYuCl009504@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 22:34: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: r239596 - 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: Wed, 22 Aug 2012 22:34:56 -0000 Author: obrien Date: Wed Aug 22 22:34:55 2012 New Revision: 239596 URL: http://svn.freebsd.org/changeset/base/239596 Log: The entire comment block is now spell checked this time -- I promise. Modified: head/etc/rc.d/postrandom Modified: head/etc/rc.d/postrandom ============================================================================== --- head/etc/rc.d/postrandom Wed Aug 22 22:17:35 2012 (r239595) +++ head/etc/rc.d/postrandom Wed Aug 22 22:34:55 2012 (r239596) @@ -15,9 +15,9 @@ start_cmd="${name}_start" stop_cmd=":" # This will remove old ${entropy_file} and generate a new one. -# According to Bruce Schneier, this is strongly recomended in order +# According to Bruce Schneier, this is strongly recommended in order # to avoid using same ${entropy_file} across reboots. -# Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 +# Reference: Chapter 10.6, Practical Cryptography, ISBN: 0-471-22357-3 postrandom_start() { From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 22:48:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 177E5106566B; Wed, 22 Aug 2012 22:48:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 036D08FC14; Wed, 22 Aug 2012 22:48:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MMmoGK011384; Wed, 22 Aug 2012 22:48:50 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MMmojL011382; Wed, 22 Aug 2012 22:48:50 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208222248.q7MMmojL011382@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 22 Aug 2012 22:48: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: r239597 - head/sys/arm/arm 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, 22 Aug 2012 22:48:51 -0000 Author: gonzo Date: Wed Aug 22 22:48:50 2012 New Revision: 239597 URL: http://svn.freebsd.org/changeset/base/239597 Log: Do not change "cachable" attribute for DMA memory allocated with BUS_DMA_COHERENT attribute The minimum unit for changing "cachable" attribute is page, so call to pmap_change_attr effectively disable cache for all pages that newly allocated DMA memory region spans on. The problem is that general-purpose memory could reside on these pages too and disabling cache might affect performance. Moreover ldrex/strex operators raise Data Abort exception when accessing memory on page with "cachable" attribute off. BUS_DMA_COHERENT does nto require memory to be coherent. It just suggests to do best effort for reducing synchronization overhead. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Wed Aug 22 22:34:55 2012 (r239596) +++ head/sys/arm/arm/busdma_machdep-v6.c Wed Aug 22 22:48:50 2012 (r239597) @@ -618,10 +618,6 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi } dmat->map_count++; - if (flags & BUS_DMA_COHERENT) - pmap_change_attr((vm_offset_t)*vaddr, len, - BUS_DMA_NOCACHE); - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, 0); return (0); From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 23:37:25 2012 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 26F55106564A; Wed, 22 Aug 2012 23:37:25 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12CBF8FC08; Wed, 22 Aug 2012 23:37:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MNbOmf017644; Wed, 22 Aug 2012 23:37:24 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MNbORo017642; Wed, 22 Aug 2012 23:37:24 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208222337.q7MNbORo017642@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 23:37: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: r239598 - 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: Wed, 22 Aug 2012 23:37:25 -0000 Author: obrien Date: Wed Aug 22 23:37:24 2012 New Revision: 239598 URL: http://svn.freebsd.org/changeset/base/239598 Log: * Reinstate r128059's consumption of our best entropy first. r128060 for "hardware-supplied entropy" reversed this without reason, seems a typo. * Isolate "better than nothing" implementation to a function. Submitted by: obrien & Arthur Mesh Sponsored by: Juniper Networks Modified: head/etc/rc.d/initrandom Modified: head/etc/rc.d/initrandom ============================================================================== --- head/etc/rc.d/initrandom Wed Aug 22 22:48:50 2012 (r239597) +++ head/etc/rc.d/initrandom Wed Aug 22 23:37:24 2012 (r239598) @@ -21,6 +21,17 @@ feed_dev_random() fi } +better_than_nothing() +{ + # XXX temporary until we can improve the entropy + # harvesting rate. + # Entropy below is not great, but better than nothing. + # This unblocks the generator at startup + ( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww ) \ + | dd of=/dev/random bs=8k 2>/dev/null + cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null +} + initrandom_start() { soft_random_generator=`sysctl kern.random 2>/dev/null` @@ -52,14 +63,6 @@ initrandom_start() fi fi - # XXX temporary until we can improve the entropy - # harvesting rate. - # Entropy below is not great, but better than nothing. - # This unblocks the generator at startup - ( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww ) \ - | dd of=/dev/random bs=8k 2>/dev/null - cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null - # First pass at reseeding /dev/random. # case ${entropy_file} in @@ -72,6 +75,8 @@ initrandom_start() ;; esac + better_than_nothing() + echo -n ' kickstart' fi From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 23:44:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA220106564A; Wed, 22 Aug 2012 23:44:12 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC57F8FC0C; Wed, 22 Aug 2012 23:44:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MNiCFJ018580; Wed, 22 Aug 2012 23:44:12 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MNiC2n018578; Wed, 22 Aug 2012 23:44:12 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208222344.q7MNiC2n018578@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 23:44: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: r239599 - 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: Wed, 22 Aug 2012 23:44:13 -0000 Author: obrien Date: Wed Aug 22 23:44:12 2012 New Revision: 239599 URL: http://svn.freebsd.org/changeset/base/239599 Log: Correct style. Modified: head/etc/rc.d/initrandom Modified: head/etc/rc.d/initrandom ============================================================================== --- head/etc/rc.d/initrandom Wed Aug 22 23:37:24 2012 (r239598) +++ head/etc/rc.d/initrandom Wed Aug 22 23:44:12 2012 (r239599) @@ -75,7 +75,7 @@ initrandom_start() ;; esac - better_than_nothing() + better_than_nothing echo -n ' kickstart' fi From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 00:39:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5AB4106564A; Thu, 23 Aug 2012 00:39:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF4608FC15; Thu, 23 Aug 2012 00:39:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N0d8Te025769; Thu, 23 Aug 2012 00:39:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N0d8tO025767; Thu, 23 Aug 2012 00:39:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208230039.q7N0d8tO025767@svn.freebsd.org> From: Xin LI Date: Thu, 23 Aug 2012 00:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239600 - in stable: 8/etc 9/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, 23 Aug 2012 00:39:09 -0000 Author: delphij Date: Thu Aug 23 00:39:08 2012 New Revision: 239600 URL: http://svn.freebsd.org/changeset/base/239600 Log: MFC r239464: As of r232844 we no longer need the maxpoll 9 workaround. Modified: stable/9/etc/ntp.conf Directory Properties: stable/9/etc/ (props changed) Changes in other areas also in this revision: Modified: stable/8/etc/ntp.conf Directory Properties: stable/8/etc/ (props changed) Modified: stable/9/etc/ntp.conf ============================================================================== --- stable/9/etc/ntp.conf Wed Aug 22 23:44:12 2012 (r239599) +++ stable/9/etc/ntp.conf Thu Aug 23 00:39:08 2012 (r239600) @@ -18,12 +18,11 @@ # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # # The option `iburst' is used for faster initial synchronisation. -# The option `maxpoll 9' is used to prevent PLL/FLL flipping on FreeBSD. # -server 0.freebsd.pool.ntp.org iburst maxpoll 9 -server 1.freebsd.pool.ntp.org iburst maxpoll 9 -server 2.freebsd.pool.ntp.org iburst maxpoll 9 -#server 3.freebsd.pool.ntp.org iburst maxpoll 9 +server 0.freebsd.pool.ntp.org iburst +server 1.freebsd.pool.ntp.org iburst +server 2.freebsd.pool.ntp.org iburst +#server 3.freebsd.pool.ntp.org iburst # # If you want to pick yourself which country's public NTP server @@ -31,9 +30,9 @@ server 2.freebsd.pool.ntp.org iburst max # the next ones and replace CC with the country's abbreviation. # Make sure that the hostnames resolve to a proper IP address! # -# server 0.CC.pool.ntp.org iburst maxpoll 9 -# server 1.CC.pool.ntp.org iburst maxpoll 9 -# server 2.CC.pool.ntp.org iburst maxpoll 9 +# server 0.CC.pool.ntp.org iburst +# server 1.CC.pool.ntp.org iburst +# server 2.CC.pool.ntp.org iburst # # Security: Only accept NTP traffic from the following hosts. From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 00:39:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2451A1065672; Thu, 23 Aug 2012 00:39:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ED958FC16; Thu, 23 Aug 2012 00:39:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N0d8EF025775; Thu, 23 Aug 2012 00:39:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N0d8dQ025773; Thu, 23 Aug 2012 00:39:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208230039.q7N0d8dQ025773@svn.freebsd.org> From: Xin LI Date: Thu, 23 Aug 2012 00:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239600 - in stable: 8/etc 9/etc X-BeenThere: svn-src-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, 23 Aug 2012 00:39:09 -0000 Author: delphij Date: Thu Aug 23 00:39:08 2012 New Revision: 239600 URL: http://svn.freebsd.org/changeset/base/239600 Log: MFC r239464: As of r232844 we no longer need the maxpoll 9 workaround. Modified: stable/8/etc/ntp.conf Directory Properties: stable/8/etc/ (props changed) Changes in other areas also in this revision: Modified: stable/9/etc/ntp.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/8/etc/ntp.conf ============================================================================== --- stable/8/etc/ntp.conf Wed Aug 22 23:44:12 2012 (r239599) +++ stable/8/etc/ntp.conf Thu Aug 23 00:39:08 2012 (r239600) @@ -18,12 +18,11 @@ # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # # The option `iburst' is used for faster initial synchronisation. -# The option `maxpoll 9' is used to prevent PLL/FLL flipping on FreeBSD. # -server 0.freebsd.pool.ntp.org iburst maxpoll 9 -server 1.freebsd.pool.ntp.org iburst maxpoll 9 -server 2.freebsd.pool.ntp.org iburst maxpoll 9 -#server 3.freebsd.pool.ntp.org iburst maxpoll 9 +server 0.freebsd.pool.ntp.org iburst +server 1.freebsd.pool.ntp.org iburst +server 2.freebsd.pool.ntp.org iburst +#server 3.freebsd.pool.ntp.org iburst # # If you want to pick yourself which country's public NTP server @@ -31,9 +30,9 @@ server 2.freebsd.pool.ntp.org iburst max # the next ones and replace CC with the country's abbreviation. # Make sure that the hostnames resolve to a proper IP address! # -# server 0.CC.pool.ntp.org iburst maxpoll 9 -# server 1.CC.pool.ntp.org iburst maxpoll 9 -# server 2.CC.pool.ntp.org iburst maxpoll 9 +# server 0.CC.pool.ntp.org iburst +# server 1.CC.pool.ntp.org iburst +# server 2.CC.pool.ntp.org iburst # # Security: Only accept NTP traffic from the following hosts. From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 00:39:33 2012 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 D42CB10656DA; Thu, 23 Aug 2012 00:39:33 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og104.obsmtp.com (exprod7og104.obsmtp.com [64.18.2.161]) by mx1.freebsd.org (Postfix) with ESMTP id 311468FC17; Thu, 23 Aug 2012 00:39:32 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob104.postini.com ([64.18.6.12]) with SMTP ID DSNKUDV7vUTMvzPXEcuG7tNxjN6WgzNXOF8T@postini.com; Wed, 22 Aug 2012 17:39:33 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Wed, 22 Aug 2012 17:36:04 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7N0a3h67762; Wed, 22 Aug 2012 17:36:04 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 9B58458088; Wed, 22 Aug 2012 17:36:03 -0700 (PDT) To: Jilles Tjoelker In-Reply-To: <20120822223002.GA41104@stack.nl> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> <20120821222943.GA27203@stack.nl> <20120821232553.35D4F58085@chaos.jnpr.net> <20120822223002.GA41104@stack.nl> Comments: In-reply-to: Jilles Tjoelker message dated "Thu, 23 Aug 2012 00:30:02 +0200." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Wed, 22 Aug 2012 17:36:03 -0700 Message-ID: <20120823003603.9B58458088@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac 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, 23 Aug 2012 00:39:34 -0000 On Thu, 23 Aug 2012 00:30:02 +0200, Jilles Tjoelker writes: >I think the most important reason is to reduce special cases. The POSIX >developers did not want to create a second subset of utilities that are >not available via execve() (the first subset is the special builtins). >The burden on implementations is very low (see src/usr.bin/alias), and >there are some possible use cases: The burden may be low, but so is the functionality ;-) 'cd' makes little sense in a child process. >'cd' will fail if the directory does not exist. so will 'test -d', and without giving the false impression that something useful will result if the directory does exist. >If it avoids the need to add semicolons for mysterious reasons, that may >be enough reason. I think everyone agrees that re-writing the target to remove the spurious 'cd' would have been better. That aside, I would disagree, at least for the case of 'cd'. It is only the fact that there is probably no way to construct a harmful example that did not involve a shell meta char (hence rendering the existance of /usr/bin/cd irrelevant). 'cd /tmp/dir && rm -rf *' would be rather dangerous if the && (or ;) didn't trigger use of a shell, and since as previously noted just 'cd /tmp/dir' is pretty pointless, the functionality is very low. In over 25 years of writing makefiles, I don't recall seeing this before. >I think make's optimization of executing certain commands directly >instead of passing them to sh should be rather invisible to the user, >particularly if the optimization may be activated or deactivated by >something seemingly innocuous like toggling -j. Changing the way the dependency graph is processed is probably more often the cause of surprises. But yes, makefiles which need work for -j (heck even separate objdirs) are common enough. >It seems not entirely possible to hide the optimization completely as >that would require deeper knowledge of the shell in make. Shell builtins >are usually found before a PATH search and there may be non-standard >shell builtins. True, which is a good argument for having a standard shell as part of the build environment. From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 01:43:02 2012 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 289F2106566C; Thu, 23 Aug 2012 01:43:02 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14AC98FC12; Thu, 23 Aug 2012 01:43:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N1h1Fm034133; Thu, 23 Aug 2012 01:43:01 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N1h1FQ034131; Thu, 23 Aug 2012 01:43:01 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201208230143.q7N1h1FQ034131@svn.freebsd.org> From: Jamie Gritton Date: Thu, 23 Aug 2012 01:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239601 - head/usr.sbin/jail 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, 23 Aug 2012 01:43:02 -0000 Author: jamie Date: Thu Aug 23 01:43:01 2012 New Revision: 239601 URL: http://svn.freebsd.org/changeset/base/239601 Log: Remember that I'm using length-defined strings in parameters: Remove a bogus null terminator when stripping the netmask from IP addresses. This was causing later addresses in a comma-separated string to disappear. Use memcpy instead of strcpy. This could just cause Bad Things. PR: 170832 MFC after: 1 week Modified: head/usr.sbin/jail/config.c Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Thu Aug 23 00:39:08 2012 (r239600) +++ head/usr.sbin/jail/config.c Thu Aug 23 01:43:01 2012 (r239601) @@ -597,8 +597,7 @@ check_intparams(struct cfjail *j) "ip4.addr: bad netmask \"%s\"", cs); error = -1; } - *cs = '\0'; - s->len = cs - s->s + 1; + s->len = cs - s->s; } } } @@ -621,8 +620,7 @@ check_intparams(struct cfjail *j) cs); error = -1; } - *cs = '\0'; - s->len = cs - s->s + 1; + s->len = cs - s->s; } } } @@ -714,7 +712,7 @@ import_params(struct cfjail *j) value = alloca(vallen); cs = value; TAILQ_FOREACH_SAFE(s, &p->val, tq, ts) { - strcpy(cs, s->s); + memcpy(cs, s->s, s->len); if (ts != NULL) { cs += s->len + 1; cs[-1] = ','; From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 01:43:23 2012 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 1BB2E106566B; Thu, 23 Aug 2012 01:43:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071038FC12; Thu, 23 Aug 2012 01:43:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N1hMgd034215; Thu, 23 Aug 2012 01:43:22 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N1hM61034213; Thu, 23 Aug 2012 01:43:22 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201208230143.q7N1hM61034213@svn.freebsd.org> From: Jamie Gritton Date: Thu, 23 Aug 2012 01:43: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: r239602 - head/usr.sbin/jail 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, 23 Aug 2012 01:43:23 -0000 Author: jamie Date: Thu Aug 23 01:43:22 2012 New Revision: 239602 URL: http://svn.freebsd.org/changeset/base/239602 Log: Pre-separate IP addresses passed on the command line, so they can be properly parsed for interface prefixes and netmask suffixes. This was already done for the old-style (fixed) command line, but missed for the new-style. MFC after: 1 week Modified: head/usr.sbin/jail/jail.c Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Thu Aug 23 01:43:01 2012 (r239601) +++ head/usr.sbin/jail/jail.c Thu Aug 23 01:43:22 2012 (r239602) @@ -304,9 +304,33 @@ main(int argc, char **argv) for (i++; i < argc; i++) add_param(NULL, NULL, IP_COMMAND, argv[i]); - break; } - add_param(NULL, NULL, 0, argv[i]); +#ifdef INET + else if (!strncmp(argv[i], "ip4.addr=", 9)) { + for (cs = argv[i] + 9;; cs = ncs + 1) { + ncs = strchr(cs, ','); + if (ncs) + *ncs = '\0'; + add_param(NULL, NULL, KP_IP4_ADDR, cs); + if (!ncs) + break; + } + } +#endif +#ifdef INET6 + else if (!strncmp(argv[i], "ip6.addr=", 9)) { + for (cs = argv[i] + 9;; cs = ncs + 1) { + ncs = strchr(cs, ','); + if (ncs) + *ncs = '\0'; + add_param(NULL, NULL, KP_IP6_ADDR, cs); + if (!ncs) + break; + } + } +#endif + else + add_param(NULL, NULL, 0, argv[i]); } } else { /* From the config file, perhaps with a specified jail */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 02:58:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EF94106566C; Thu, 23 Aug 2012 02:58:07 +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 3AB398FC14; Thu, 23 Aug 2012 02:58:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N2w71K043759; Thu, 23 Aug 2012 02:58:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N2w7Xo043757; Thu, 23 Aug 2012 02:58:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208230258.q7N2w7Xo043757@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Aug 2012 02:58: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: r239603 - 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: Thu, 23 Aug 2012 02:58:07 -0000 Author: adrian Date: Thu Aug 23 02:58:06 2012 New Revision: 239603 URL: http://svn.freebsd.org/changeset/base/239603 Log: Add chipset names. Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Aug 23 01:43:22 2012 (r239602) +++ head/sys/dev/ath/ath_hal/ah.c Thu Aug 23 02:58:06 2012 (r239603) @@ -101,9 +101,9 @@ ath_hal_mac_name(struct ath_hal *ah) return "5413"; case AR_SREV_VERSION_COBRA: return "2415"; - case AR_SREV_2425: + case AR_SREV_2425: /* Swan */ return "2425"; - case AR_SREV_2417: + case AR_SREV_2417: /* Nala */ return "2417"; case AR_XSREV_VERSION_OWL_PCI: return "5416"; From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 03:03:01 2012 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 9DAF2106564A; Thu, 23 Aug 2012 03:03:01 +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 7E6278FC0A; Thu, 23 Aug 2012 03:03:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N331q7044527; Thu, 23 Aug 2012 03:03:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N331Wh044523; Thu, 23 Aug 2012 03:03:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208230303.q7N331Wh044523@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Aug 2012 03:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239604 - in head/sys/dev/ath/ath_hal: . ar9003 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, 23 Aug 2012 03:03:01 -0000 Author: adrian Date: Thu Aug 23 03:03:00 2012 New Revision: 239604 URL: http://svn.freebsd.org/changeset/base/239604 Log: Add AR9380 devid HAL definitions and probe/attach strings. Obtained from: Device IDs are from Qualcomm Atheros Added: head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Aug 23 02:58:06 2012 (r239603) +++ head/sys/dev/ath/ath_hal/ah.c Thu Aug 23 03:03:00 2012 (r239604) @@ -24,6 +24,7 @@ #include "ah_eeprom.h" /* for 5ghz fast clock flag */ #include "ar5416/ar5416reg.h" /* NB: includes ar5212reg.h */ +#include "ar9003/ar9300_devid.h" /* linker set of registered chips */ OS_SET_DECLARE(ah_chips, struct ath_hal_chip); @@ -123,6 +124,21 @@ ath_hal_mac_name(struct ath_hal *ah) if (AH_PRIVATE(ah)->ah_ispcie) return "9287"; return "9227"; + case AR_SREV_VERSION_AR9380: + if (ah->ah_macRev >= AR_SREV_REVISION_AR9580_10) + return "9580"; + return "9380"; + case AR_SREV_VERSION_AR9460: + return "9460"; + case AR_SREV_VERSION_AR9330: + return "9330"; + case AR_SREV_VERSION_AR9340: + return "9340"; + case AR_SREV_VERSION_QCA9550: + /* XXX should say QCA, not AR */ + return "9550"; + case AR_SREV_VERSION_AR9485: + return "9485"; } return "????"; } Added: head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h Thu Aug 23 03:03:00 2012 (r239604) @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2012, Qualcomm Atheros, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the following conditions are met: + * 1. The materials contained herein are unmodified and are used + * unmodified. + * 2. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following NO + * ''WARRANTY'' disclaimer below (''Disclaimer''), without + * modification. + * 3. Redistributions in binary form must reproduce at minimum a + * disclaimer similar to the Disclaimer below and any redistribution + * must be conditioned upon including a substantially similar + * Disclaimer requirement for further binary redistribution. + * 4. Neither the names of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote + * product derived from this software without specific prior written + * permission. + * + * NO WARRANTY + * 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 NONINFRINGEMENT, + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE + * FOR 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 DAMAGES. + * + * $FreeBSD$ + * + */ +#ifndef __AR9300_DEVID_H__ +#define __AR9300_DEVID_H__ + +/* + * AR9380 HAL device IDs. + */ + +/* + * MAC Version and Revision + */ +#define AR_SREV_VERSION_AR9380 0x1C0 +#define AR_SREV_VERSION_AR9580 0x1C0 +#define AR_SREV_VERSION_AR9460 0x280 + +#define AR_SREV_VERSION_AR9330 0x200 +#define AR_SREV_VERSION_AR9340 0x300 +#define AR_SREV_VERSION_QCA9550 0x400 +#define AR_SREV_VERSION_AR9485 0x240 + +#define AR_SREV_REVISION_AR9380_10 0 /* AR9380 1.0 */ +#define AR_SREV_REVISION_AR9380_20 2 /* AR9380 2.0/2.1 */ +#define AR_SREV_REVISION_AR9380_22 3 /* AR9380 2.2 */ +#define AR_SREV_REVISION_AR9580_10 4 /* AR9580/Peacock 1.0 */ + +#define AR_SREV_REVISION_AR9330_10 0 /* AR9330 1.0 */ +#define AR_SREV_REVISION_AR9330_11 1 /* AR9330 1.1 */ +#define AR_SREV_REVISION_AR9330_12 2 /* AR9330 1.2 */ +#define AR_SREV_REVISION_AR9330_11_MASK 0xf /* AR9330 1.1 revision mask */ + +#define AR_SREV_REVISION_AR9485_10 0 /* AR9485 1.0 */ +#define AR_SREV_REVISION_AR9485_11 1 /* AR9485 1.1 */ + +#define AR_SREV_REVISION_AR9340_10 0 /* AR9340 1.0 */ +#define AR_SREV_REVISION_AR9340_11 1 /* AR9340 1.1 */ +#define AR_SREV_REVISION_AR9340_12 2 /* AR9340 1.2 */ +#define AR_SREV_REVISION_AR9340_MASK 0xf /* AR9340 revision mask */ + +#define AR_SREV_REVISION_AR9460_10 0 /* AR946x 1.0 */ + +#endif /* __AR9300_DEVID_H__ */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 03:25:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D78F5106564A; Thu, 23 Aug 2012 03:25:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C29EB8FC12; Thu, 23 Aug 2012 03:25:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N3P9G1047600; Thu, 23 Aug 2012 03:25:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N3P9Od047598; Thu, 23 Aug 2012 03:25:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208230325.q7N3P9Od047598@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Aug 2012 03:25: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: r239605 - 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: Thu, 23 Aug 2012 03:25:10 -0000 Author: adrian Date: Thu Aug 23 03:25:09 2012 New Revision: 239605 URL: http://svn.freebsd.org/changeset/base/239605 Log: Add some more interrupt handling bits. Obtained from: Qualcomm Atheros 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 Thu Aug 23 03:03:00 2012 (r239604) +++ head/sys/dev/ath/ath_hal/ah.h Thu Aug 23 03:25:09 2012 (r239605) @@ -412,20 +412,23 @@ typedef enum { typedef enum { HAL_INT_RX = 0x00000001, /* Non-common mapping */ HAL_INT_RXDESC = 0x00000002, /* Legacy mapping */ + HAL_INT_RXERR = 0x00000004, HAL_INT_RXHP = 0x00000001, /* EDMA */ HAL_INT_RXLP = 0x00000002, /* EDMA */ - HAL_INT_RXERR = 0x00000004, HAL_INT_RXNOFRM = 0x00000008, HAL_INT_RXEOL = 0x00000010, HAL_INT_RXORN = 0x00000020, HAL_INT_TX = 0x00000040, /* Non-common mapping */ HAL_INT_TXDESC = 0x00000080, HAL_INT_TIM_TIMER= 0x00000100, + HAL_INT_MCI = 0x00000200, + HAL_INT_BBPANIC = 0x00000400, HAL_INT_TXURN = 0x00000800, HAL_INT_MIB = 0x00001000, HAL_INT_RXPHY = 0x00004000, HAL_INT_RXKCM = 0x00008000, HAL_INT_SWBA = 0x00010000, + HAL_INT_BRSSI = 0x00020000, HAL_INT_BMISS = 0x00040000, HAL_INT_BNR = 0x00100000, HAL_INT_TIM = 0x00200000, /* Non-common mapping */ @@ -435,6 +438,8 @@ typedef enum { HAL_INT_CABEND = 0x02000000, /* Non-common mapping */ HAL_INT_TSFOOR = 0x04000000, /* Non-common mapping */ HAL_INT_TBTT = 0x08000000, /* Non-common mapping */ + /* Atheros ref driver has a generic timer interrupt now..*/ + HAL_INT_GENTIMER = 0x08000000, /* Non-common mapping */ HAL_INT_CST = 0x10000000, /* Non-common mapping */ HAL_INT_GTT = 0x20000000, /* Non-common mapping */ HAL_INT_FATAL = 0x40000000, /* Non-common mapping */ @@ -457,6 +462,7 @@ typedef enum { | HAL_INT_RXKCM | HAL_INT_SWBA | HAL_INT_BMISS + | HAL_INT_BRSSI | HAL_INT_BNR | HAL_INT_GPIO, } HAL_INT; From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 03:37:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19098106564A; Thu, 23 Aug 2012 03:37:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02CB78FC08; Thu, 23 Aug 2012 03:37:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N3b1ev049142; Thu, 23 Aug 2012 03:37:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N3b1DK049140; Thu, 23 Aug 2012 03:37:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208230337.q7N3b1DK049140@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Aug 2012 03:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239606 - 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: Thu, 23 Aug 2012 03:37:02 -0000 Author: adrian Date: Thu Aug 23 03:37:01 2012 New Revision: 239606 URL: http://svn.freebsd.org/changeset/base/239606 Log: Add a placeholder and typedefs for MFP (management frame protection.) Obtained from: Qualcomm Atheros 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 Thu Aug 23 03:25:09 2012 (r239605) +++ head/sys/dev/ath/ath_hal/ah.h Thu Aug 23 03:37:01 2012 (r239606) @@ -830,6 +830,16 @@ typedef enum { } HAL_DFS_DOMAIN; /* + * MFP decryption options for initializing the MAC. + */ + +typedef enum { + HAL_MFP_QOSDATA = 0, /* Decrypt MFP frames like QoS data frames. All chips before Merlin. */ + HAL_MFP_PASSTHRU, /* Don't decrypt MFP frames at all. Passthrough */ + HAL_MFP_HW_CRYPTO /* hardware decryption enabled. Merlin can do it. */ +} HAL_MFP_OPT_T; + +/* * Flag for setting QUIET period */ typedef enum { @@ -1404,4 +1414,14 @@ int __ahdecl ath_hal_getcca(struct ath_h HAL_BOOL __ahdecl ath_hal_EepromDataRead(struct ath_hal *ah, u_int off, uint16_t *data); +/* + * For now, simply pass through MFP frames. + */ +static inline u_int32_t +ath_hal_get_mfp_qos(struct ath_hal *ah) +{ + //return AH_PRIVATE(ah)->ah_mfp_qos; + return HAL_MFP_QOSDATA; +} + #endif /* _ATH_AH_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 03:43:01 2012 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 636081065674; Thu, 23 Aug 2012 03:43:01 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 0CFF78FC16; Thu, 23 Aug 2012 03:43:00 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q7N3h0QN097115; Wed, 22 Aug 2012 21:43:00 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q7N3gxWI097114; Wed, 22 Aug 2012 21:42:59 -0600 (MDT) (envelope-from ken) Date: Wed, 22 Aug 2012 21:42:59 -0600 From: "Kenneth D. Merry" To: Gleb Smirnoff Message-ID: <20120823034259.GA97058@nargothrond.kdm.org> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> <20120802213344.GF70185@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120802213344.GF70185@FreeBSD.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, "Bjoern A. Zeeb" , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238990 - in head/sys: net netinet netinet6 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, 23 Aug 2012 03:43:01 -0000 On Fri, Aug 03, 2012 at 01:33:44 +0400, Gleb Smirnoff wrote: > On Thu, Aug 02, 2012 at 04:46:42PM +0000, Bjoern A. Zeeb wrote: > B> On Thu, 2 Aug 2012, Gleb Smirnoff wrote: > B> > B> > Author: glebius > B> > Date: Thu Aug 2 13:57:49 2012 > B> > New Revision: 238990 > B> > URL: http://svn.freebsd.org/changeset/base/238990 > B> > > B> > Log: > B> > Fix races between in_lltable_prefix_free(), lla_lookup(), > B> > llentry_free() and arptimer(): > B> > > B> > o Use callout_init_rw() for lle timeout, this allows us safely > B> > disestablish them. > B> > - This allows us to simplify the arptimer() and make it > B> > race safe. > B> > o Consistently use ifp->if_afdata_lock to lock access to > B> > linked lists in the lle hashes. > B> > o Introduce new lle flag LLE_LINKED, which marks an entry that > B> > is attached to the hash. > B> > - Use LLE_LINKED to avoid double unlinking via consequent > B> > calls to llentry_free(). > B> > - Mark lle with LLE_DELETED via |= operation istead of =, > B> > so that other flags won't be lost. > B> > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more > B> > consistent and provide more informative KASSERTs. > B> > > B> > The patch is a collaborative work of all submitters and myself. > B> > B> Quoting from 2 year old memory you just introduced a possible deadlock > B> on tbale (or with that networkstack) teardown adding the extra af_data > B> write locking to the table walk. > > Can you please give more details? I didn't get it. What else needs > afdata lock and what does it hold which is held by table walk. Is there a deadlock in that particular change? If so, what will it take to fix it? Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 04:35:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2CDD8106564A; Thu, 23 Aug 2012 04:35:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F30948FC17; Thu, 23 Aug 2012 04:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N4ZtsC057109; Thu, 23 Aug 2012 04:35:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N4Ztvq057107; Thu, 23 Aug 2012 04:35:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208230435.q7N4Ztvq057107@svn.freebsd.org> From: Warner Losh Date: Thu, 23 Aug 2012 04:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239607 - head/sys/dev/mmc 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, 23 Aug 2012 04:35:56 -0000 Author: imp Date: Thu Aug 23 04:35:55 2012 New Revision: 239607 URL: http://svn.freebsd.org/changeset/base/239607 Log: The check for MAXPHYS doesn't make sense, so remove it. Report errors indicated by the transport. If this is too chatty, I'll throw it behind a debug write. Remove commented out debugs that are no longer useful. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Thu Aug 23 03:37:01 2012 (r239606) +++ head/sys/dev/mmc/mmcsd.c Thu Aug 23 04:35:55 2012 (r239607) @@ -88,6 +88,17 @@ struct mmcsd_softc { int suspend; }; +static const char *errmsg[] = +{ + "None", + "Timeout", + "Bad CRC", + "Fifo", + "Failed", + "Invalid", + "NO MEMORY" +}; + /* bus entry points */ static int mmcsd_attach(device_t dev); static int mmcsd_detach(device_t dev); @@ -169,13 +180,10 @@ mmcsd_attach(device_t dev) /* * Report the clock speed of the underlying hardware, which might be * different than what the card reports due to hardware limitations. - * Report how many blocks the hardware transfers at once, but clip the - * number to MAXPHYS since the system won't initiate larger transfers. + * Report how many blocks the hardware transfers at once. */ speed = mmcbr_get_clock(device_get_parent(dev)); maxblocks = mmc_get_max_data(dev); - if (maxblocks > MAXPHYS) - maxblocks = MAXPHYS; device_printf(dev, "%ju%cB <%s>%s at %s %d.%01dMHz/%dbit/%d-block\n", mb, unit, mmc_get_card_id_string(dev), mmc_get_read_only(dev) ? " (read-only)" : "", @@ -286,6 +294,14 @@ mmcsd_strategy(struct bio *bp) } } +static const char * +mmcsd_errmsg(int e) +{ + if (e < 0 || e > MMC_ERR_MAX) + return "Bad error code"; + return errmsg[e]; +} + static daddr_t mmcsd_rw(struct mmcsd_softc *sc, struct bio *bp) { @@ -337,12 +353,13 @@ mmcsd_rw(struct mmcsd_softc *sc, struct stop.flags = MMC_RSP_R1B | MMC_CMD_AC; req.stop = &stop; } -// printf("Len %d %lld-%lld flags %#x sz %d\n", -// (int)data.len, (long long)block, (long long)end, data.flags, sz); MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, &req); - if (req.cmd->error != MMC_ERR_NONE) + if (req.cmd->error != MMC_ERR_NONE) { + device_printf(dev, "Error indicated: %d %s\n", + req.cmd->error, mmcsd_errmsg(req.cmd->error)); break; + } block += numblocks; } return (block); From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 04:41:39 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DD4C106564A; Thu, 23 Aug 2012 04:41:39 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 163CB8FC0C; Thu, 23 Aug 2012 04:41:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7N4fbns015923; Thu, 23 Aug 2012 08:41:37 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7N4fbY0015918; Thu, 23 Aug 2012 08:41:37 +0400 (MSK) (envelope-from ache) Date: Thu, 23 Aug 2012 08:41:37 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120823044137.GA7987@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> <20120822000645.GA54651@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: r239356 - 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: Thu, 23 Aug 2012 04:41:39 -0000 On Thu, Aug 23, 2012 at 12:27:46AM +0900, Hajimu UMEMOTO wrote: > A link-local address has a scope; an interface here. You cannot omit > it on FreeBSD by default. To be able to omit it, specify something > like ipv6_default_interface="em0" in your /etc/rc.conf. Please enlighten me a bit. RFC 4007 "11.6. Omitting Zone Indices" states: "The format defined in this document does not intend to invalidate the original format for non-global addresses; that is, the format without the zone index portion. As described in Section 6, in some common cases with the notion of the default zone index, there can be no ambiguity about scope zones. In such an environment, the implementation can omit the "%" part." Does absolutely trusted IPv6 local net using link-local addresses only falls in that case? If yes, is there a way to make address scope optional for all link-local addresses in FreeBSD? Are link-local addresses ever usable for DNS or not due to their % part? F.e. for the case there is no global IPv6 net assigned at all but pure isolated IPv6 local network. > In anyway, I don't recommend to use a link-local address for DNS. Is it only due to their scope part or other reasons exists too? -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 04:57:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77D18106564A; Thu, 23 Aug 2012 04:57:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6314B8FC0C; Thu, 23 Aug 2012 04:57:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N4vvu4060052; Thu, 23 Aug 2012 04:57:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N4vv7M060049; Thu, 23 Aug 2012 04:57:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208230457.q7N4vv7M060049@svn.freebsd.org> From: Xin LI Date: Thu, 23 Aug 2012 04:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239608 - releng/9.1/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, 23 Aug 2012 04:57:57 -0000 Author: delphij Date: Thu Aug 23 04:57:56 2012 New Revision: 239608 URL: http://svn.freebsd.org/changeset/base/239608 Log: MFC r239464: > As of r232844 we no longer need the maxpoll 9 workaround. > Approved by: re (kib) Modified: releng/9.1/etc/ntp.conf Directory Properties: releng/9.1/etc/ (props changed) Modified: releng/9.1/etc/ntp.conf ============================================================================== --- releng/9.1/etc/ntp.conf Thu Aug 23 04:35:55 2012 (r239607) +++ releng/9.1/etc/ntp.conf Thu Aug 23 04:57:56 2012 (r239608) @@ -18,12 +18,11 @@ # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # # The option `iburst' is used for faster initial synchronisation. -# The option `maxpoll 9' is used to prevent PLL/FLL flipping on FreeBSD. # -server 0.freebsd.pool.ntp.org iburst maxpoll 9 -server 1.freebsd.pool.ntp.org iburst maxpoll 9 -server 2.freebsd.pool.ntp.org iburst maxpoll 9 -#server 3.freebsd.pool.ntp.org iburst maxpoll 9 +server 0.freebsd.pool.ntp.org iburst +server 1.freebsd.pool.ntp.org iburst +server 2.freebsd.pool.ntp.org iburst +#server 3.freebsd.pool.ntp.org iburst # # If you want to pick yourself which country's public NTP server @@ -31,9 +30,9 @@ server 2.freebsd.pool.ntp.org iburst max # the next ones and replace CC with the country's abbreviation. # Make sure that the hostnames resolve to a proper IP address! # -# server 0.CC.pool.ntp.org iburst maxpoll 9 -# server 1.CC.pool.ntp.org iburst maxpoll 9 -# server 2.CC.pool.ntp.org iburst maxpoll 9 +# server 0.CC.pool.ntp.org iburst +# server 1.CC.pool.ntp.org iburst +# server 2.CC.pool.ntp.org iburst # # Security: Only accept NTP traffic from the following hosts. From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 05:15:15 2012 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 CE9DF1065676; Thu, 23 Aug 2012 05:15:15 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9BBA8FC16; Thu, 23 Aug 2012 05:15:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N5FFsL062299; Thu, 23 Aug 2012 05:15:15 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N5FFHc062297; Thu, 23 Aug 2012 05:15:15 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201208230515.q7N5FFHc062297@svn.freebsd.org> From: David Xu Date: Thu, 23 Aug 2012 05:15: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: r239609 - head/lib/libthr/thread 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, 23 Aug 2012 05:15:15 -0000 Author: davidxu Date: Thu Aug 23 05:15:15 2012 New Revision: 239609 URL: http://svn.freebsd.org/changeset/base/239609 Log: Eliminate redundant code, _thr_spinlock_init() has already been called in init_private(), don't call it again in fork() wrapper. Modified: head/lib/libthr/thread/thr_fork.c Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Thu Aug 23 04:57:56 2012 (r239608) +++ head/lib/libthr/thread/thr_fork.c Thu Aug 23 05:15:15 2012 (r239609) @@ -200,9 +200,6 @@ _fork(void) _rtld_atfork_post(rtld_locks); _thr_setthreaded(0); - /* reinitialize libc spinlocks. */ - _thr_spinlock_init(); - /* reinitalize library. */ _libpthread_init(curthread); From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 08:55:58 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04841106566B; Thu, 23 Aug 2012 08:55:58 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id EB5F48FC15; Thu, 23 Aug 2012 08:55:56 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:Z1fJRrNRM+0ffE0naoJB4jgRcxh3yDTLzcEsx4X76WygOU74ZXpGZ9mLnRkCJsxu@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7N8tlLh037496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 23 Aug 2012 17:55:51 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 23 Aug 2012 17:55:47 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov In-Reply-To: <20120823044137.GA7987@vniz.net> References: <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> <20120822000645.GA54651@vniz.net> <20120823044137.GA7987@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-RC1 X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Thu, 23 Aug 2012 17:55:51 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - 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: Thu, 23 Aug 2012 08:55:58 -0000 Hi, >>>>> On Thu, 23 Aug 2012 08:41:37 +0400 >>>>> Andrey Chernov said: ache> On Thu, Aug 23, 2012 at 12:27:46AM +0900, Hajimu UMEMOTO wrote: > A link-local address has a scope; an interface here. You cannot omit > it on FreeBSD by default. To be able to omit it, specify something > like ipv6_default_interface="em0" in your /etc/rc.conf. ache> Please enlighten me a bit. ache> RFC 4007 "11.6. Omitting Zone Indices" states: ache> "The format defined in this document does not intend to invalidate the ache> original format for non-global addresses; that is, the format without ache> the zone index portion. As described in Section 6, in some common ache> cases with the notion of the default zone index, there can be no ache> ambiguity about scope zones. In such an environment, the ache> implementation can omit the "%" part." ache> Does absolutely trusted IPv6 local net using link-local addresses only ache> falls in that case? If yes, is there a way to make address scope optional ache> for all link-local addresses in FreeBSD? FreeBSD doesn't have a feature to define a zone manually. If a node has more than one interfaces, a link-local address without zone identifer has ambiguity. If you mean `all link-local addresses' are within one interface, yes, you can omit zone identifer by setting ipv6_default_interface' ache> Are link-local addresses ever usable for DNS or not due to their ache> % part? F.e. for the case there is no global IPv6 net assigned at ache> all but pure isolated IPv6 local network. > In anyway, I don't recommend to use a link-local address for DNS. ache> Is it only due to their scope part or other reasons exists too? As you saw, dig(1) and host(1) doesn't work well with a link-local address. Not only a zone identifier, but also some implementation may handle a link-local address (fe80:: prefix) as special. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 09:18:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B8B3106564A; Thu, 23 Aug 2012 09:18:54 +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 4155D8FC08; Thu, 23 Aug 2012 09:18:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N9IsMi095031; Thu, 23 Aug 2012 09:18:54 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N9IrZ8095013; Thu, 23 Aug 2012 09:18:53 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208230918.q7N9IrZ8095013@svn.freebsd.org> From: Martin Matuska Date: Thu, 23 Aug 2012 09:18:53 +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: r239610 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest vendor/illumos/dist/lib/libzfs/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: Thu, 23 Aug 2012 09:18:54 -0000 Author: mm Date: Thu Aug 23 09:18:52 2012 New Revision: 239610 URL: http://svn.freebsd.org/changeset/base/239610 Log: Update vendor/illumos and vendor-sys/illumos to revision 13777:b1e53580146d Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Thu Aug 23 09:18:52 2012 (r239610) @@ -1759,15 +1759,15 @@ dmu_init(void) dnode_init(); dbuf_init(); zfetch_init(); - arc_init(); l2arc_init(); + arc_init(); } void dmu_fini(void) { - l2arc_fini(); arc_fini(); + l2arc_fini(); zfetch_fini(); dbuf_fini(); dnode_fini(); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Thu Aug 23 09:18:52 2012 (r239610) @@ -1608,13 +1608,6 @@ dmu_recv_existing_end(dmu_recv_cookie_t dsl_dataset_t *ds = drc->drc_logical_ds; int err, myerr; - /* - * XXX hack; seems the ds is still dirty and dsl_pool_zil_clean() - * expects it to have a ds_user_ptr (and zil), but clone_swap() - * can close it. - */ - txg_wait_synced(ds->ds_dir->dd_pool, 0); - if (dsl_dataset_tryown(ds, FALSE, dmu_recv_tag)) { err = dsl_dataset_clone_swap(drc->drc_real_ds, ds, drc->drc_force); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Thu Aug 23 09:18:52 2012 (r239610) @@ -103,14 +103,8 @@ dsl_dataset_block_born(dsl_dataset_t *ds ASSERT(BP_GET_TYPE(bp) != DMU_OT_NONE); ASSERT(DMU_OT_IS_VALID(BP_GET_TYPE(bp))); if (ds == NULL) { - /* - * Account for the meta-objset space in its placeholder - * dsl_dir. - */ - ASSERT3U(compressed, ==, uncompressed); /* it's all metadata */ - dsl_dir_diduse_space(tx->tx_pool->dp_mos_dir, DD_USED_HEAD, - used, compressed, uncompressed, tx); - dsl_dir_dirty(tx->tx_pool->dp_mos_dir, tx); + dsl_pool_mos_diduse_space(tx->tx_pool, + used, compressed, uncompressed); return; } dmu_buf_will_dirty(ds->ds_dbuf, tx); @@ -146,15 +140,9 @@ dsl_dataset_block_kill(dsl_dataset_t *ds ASSERT(used > 0); if (ds == NULL) { - /* - * Account for the meta-objset space in its placeholder - * dataset. - */ dsl_free(tx->tx_pool, tx->tx_txg, bp); - - dsl_dir_diduse_space(tx->tx_pool->dp_mos_dir, DD_USED_HEAD, - -used, -compressed, -uncompressed, tx); - dsl_dir_dirty(tx->tx_pool->dp_mos_dir, tx); + dsl_pool_mos_diduse_space(tx->tx_pool, + -used, -compressed, -uncompressed); return (used); } ASSERT3P(tx->tx_pool, ==, ds->ds_dir->dd_pool); @@ -1068,26 +1056,26 @@ dsl_dataset_destroy(dsl_dataset_t *ds, v dd = ds->ds_dir; - /* - * Check for errors and mark this ds as inconsistent, in - * case we crash while freeing the objects. - */ - err = dsl_sync_task_do(dd->dd_pool, dsl_dataset_destroy_begin_check, - dsl_dataset_destroy_begin_sync, ds, NULL, 0); - if (err) - goto out; - - err = dmu_objset_from_ds(ds, &os); - if (err) - goto out; - - /* - * If async destruction is not enabled try to remove all objects - * while in the open context so that there is less work to do in - * the syncing context. - */ if (!spa_feature_is_enabled(dsl_dataset_get_spa(ds), &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + /* + * Check for errors and mark this ds as inconsistent, in + * case we crash while freeing the objects. + */ + err = dsl_sync_task_do(dd->dd_pool, + dsl_dataset_destroy_begin_check, + dsl_dataset_destroy_begin_sync, ds, NULL, 0); + if (err) + goto out; + + err = dmu_objset_from_ds(ds, &os); + if (err) + goto out; + + /* + * Remove all objects while in the open context so that + * there is less work to do in the syncing context. + */ for (obj = 0; err == 0; err = dmu_object_next(os, &obj, FALSE, ds->ds_phys->ds_prev_snap_txg)) { /* @@ -1098,30 +1086,25 @@ dsl_dataset_destroy(dsl_dataset_t *ds, v } if (err != ESRCH) goto out; - } - /* - * Only the ZIL knows how to free log blocks. - */ - zil_destroy(dmu_objset_zil(os), B_FALSE); - - /* - * Sync out all in-flight IO. - */ - txg_wait_synced(dd->dd_pool, 0); - - /* - * If we managed to free all the objects in open - * context, the user space accounting should be zero. - */ - if (ds->ds_phys->ds_bp.blk_fill == 0 && - dmu_objset_userused_enabled(os)) { - uint64_t count; + /* + * Sync out all in-flight IO. + */ + txg_wait_synced(dd->dd_pool, 0); - ASSERT(zap_count(os, DMU_USERUSED_OBJECT, &count) != 0 || - count == 0); - ASSERT(zap_count(os, DMU_GROUPUSED_OBJECT, &count) != 0 || - count == 0); + /* + * If we managed to free all the objects in open + * context, the user space accounting should be zero. + */ + if (ds->ds_phys->ds_bp.blk_fill == 0 && + dmu_objset_userused_enabled(os)) { + uint64_t count; + + ASSERT(zap_count(os, DMU_USERUSED_OBJECT, + &count) != 0 || count == 0); + ASSERT(zap_count(os, DMU_GROUPUSED_OBJECT, + &count) != 0 || count == 0); + } } rw_enter(&dd->dd_pool->dp_config_rwlock, RW_READER); @@ -1859,6 +1842,7 @@ dsl_dataset_destroy_sync(void *arg1, voi } else { zfeature_info_t *async_destroy = &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]; + objset_t *os; /* * There's no next snapshot, so this is a head dataset. @@ -1870,6 +1854,8 @@ dsl_dataset_destroy_sync(void *arg1, voi dsl_deadlist_free(mos, ds->ds_phys->ds_deadlist_obj, tx); ds->ds_phys->ds_deadlist_obj = 0; + VERIFY3U(0, ==, dmu_objset_from_ds(ds, &os)); + if (!spa_feature_is_enabled(dp->dp_spa, async_destroy)) { err = old_synchronous_dataset_destroy(ds, tx); } else { @@ -1879,12 +1865,12 @@ dsl_dataset_destroy_sync(void *arg1, voi */ uint64_t used, comp, uncomp; - ASSERT(err == 0 || err == EBUSY); + zil_destroy_sync(dmu_objset_zil(os), tx); + if (!spa_feature_is_active(dp->dp_spa, async_destroy)) { spa_feature_incr(dp->dp_spa, async_destroy, tx); - dp->dp_bptree_obj = bptree_alloc( - dp->dp_meta_objset, tx); - VERIFY(zap_add(dp->dp_meta_objset, + dp->dp_bptree_obj = bptree_alloc(mos, tx); + VERIFY(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1, &dp->dp_bptree_obj, tx) == 0); @@ -1897,7 +1883,7 @@ dsl_dataset_destroy_sync(void *arg1, voi ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) || ds->ds_phys->ds_unique_bytes == used); - bptree_add(dp->dp_meta_objset, dp->dp_bptree_obj, + bptree_add(mos, dp->dp_bptree_obj, &ds->ds_phys->ds_bp, ds->ds_phys->ds_prev_snap_txg, used, comp, uncomp, tx); dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, @@ -2179,7 +2165,6 @@ dsl_dataset_sync(dsl_dataset_t *ds, zio_ dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_phys->ds_fsid_guid = ds->ds_fsid_guid; - dsl_dir_dirty(ds->ds_dir, tx); dmu_objset_sync(ds->ds_objset, zio, tx); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Thu Aug 23 09:18:52 2012 (r239610) @@ -190,7 +190,6 @@ errout: kmem_free(dd, sizeof (dsl_dir_t)); dmu_buf_rele(dbuf, tag); return (err); - } void @@ -224,7 +223,7 @@ dsl_dir_name(dsl_dir_t *dd, char *buf) } } -/* Calculate name legnth, avoiding all the strcat calls of dsl_dir_name */ +/* Calculate name length, avoiding all the strcat calls of dsl_dir_name */ int dsl_dir_namelen(dsl_dir_t *dd) { @@ -582,8 +581,6 @@ dsl_dir_sync(dsl_dir_t *dd, dmu_tx_t *tx { ASSERT(dmu_tx_is_syncing(tx)); - dmu_buf_will_dirty(dd->dd_dbuf, tx); - mutex_enter(&dd->dd_lock); ASSERT3U(dd->dd_tempreserved[tx->tx_txg&TXG_MASK], ==, 0); dprintf_dd(dd, "txg=%llu towrite=%lluK\n", tx->tx_txg, @@ -940,8 +937,6 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u ASSERT(dmu_tx_is_syncing(tx)); ASSERT(type < DD_USED_NUM); - dsl_dir_dirty(dd, tx); - if (needlock) mutex_enter(&dd->dd_lock); accounted_delta = parent_delta(dd, dd->dd_phys->dd_used_bytes, used); @@ -950,6 +945,7 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u dd->dd_phys->dd_compressed_bytes >= -compressed); ASSERT(uncompressed >= 0 || dd->dd_phys->dd_uncompressed_bytes >= -uncompressed); + dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_bytes += used; dd->dd_phys->dd_uncompressed_bytes += uncompressed; dd->dd_phys->dd_compressed_bytes += compressed; @@ -991,13 +987,13 @@ dsl_dir_transfer_space(dsl_dir_t *dd, in if (delta == 0 || !(dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN)) return; - dsl_dir_dirty(dd, tx); if (needlock) mutex_enter(&dd->dd_lock); ASSERT(delta > 0 ? dd->dd_phys->dd_used_breakdown[oldtype] >= delta : dd->dd_phys->dd_used_breakdown[newtype] >= -delta); ASSERT(dd->dd_phys->dd_used_bytes >= ABS(delta)); + dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_breakdown[oldtype] -= delta; dd->dd_phys->dd_used_breakdown[newtype] += delta; if (needlock) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Thu Aug 23 09:18:52 2012 (r239610) @@ -42,6 +42,7 @@ #include #include #include +#include int zfs_no_write_throttle = 0; int zfs_write_limit_shift = 3; /* 1/8th of physical memory */ @@ -86,12 +87,12 @@ dsl_pool_open_impl(spa_t *spa, uint64_t txg_list_create(&dp->dp_dirty_datasets, offsetof(dsl_dataset_t, ds_dirty_link)); + txg_list_create(&dp->dp_dirty_zilogs, + offsetof(zilog_t, zl_dirty_link)); txg_list_create(&dp->dp_dirty_dirs, offsetof(dsl_dir_t, dd_dirty_link)); txg_list_create(&dp->dp_sync_tasks, offsetof(dsl_sync_task_group_t, dstg_node)); - list_create(&dp->dp_synced_datasets, sizeof (dsl_dataset_t), - offsetof(dsl_dataset_t, ds_synced_link)); mutex_init(&dp->dp_lock, NULL, MUTEX_DEFAULT, NULL); @@ -224,9 +225,9 @@ dsl_pool_close(dsl_pool_t *dp) dmu_objset_evict(dp->dp_meta_objset); txg_list_destroy(&dp->dp_dirty_datasets); + txg_list_destroy(&dp->dp_dirty_zilogs); txg_list_destroy(&dp->dp_sync_tasks); txg_list_destroy(&dp->dp_dirty_dirs); - list_destroy(&dp->dp_synced_datasets); arc_flush(dp->dp_spa); txg_fini(dp); @@ -306,6 +307,21 @@ dsl_pool_create(spa_t *spa, nvlist_t *zp return (dp); } +/* + * Account for the meta-objset space in its placeholder dsl_dir. + */ +void +dsl_pool_mos_diduse_space(dsl_pool_t *dp, + int64_t used, int64_t comp, int64_t uncomp) +{ + ASSERT3U(comp, ==, uncomp); /* it's all metadata */ + mutex_enter(&dp->dp_lock); + dp->dp_mos_used_delta += used; + dp->dp_mos_compressed_delta += comp; + dp->dp_mos_uncompressed_delta += uncomp; + mutex_exit(&dp->dp_lock); +} + static int deadlist_enqueue_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { @@ -324,11 +340,14 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t dmu_tx_t *tx; dsl_dir_t *dd; dsl_dataset_t *ds; - dsl_sync_task_group_t *dstg; objset_t *mos = dp->dp_meta_objset; hrtime_t start, write_time; uint64_t data_written; int err; + list_t synced_datasets; + + list_create(&synced_datasets, sizeof (dsl_dataset_t), + offsetof(dsl_dataset_t, ds_synced_link)); /* * We need to copy dp_space_towrite() before doing @@ -351,7 +370,7 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t * may sync newly-created datasets on pass 2. */ ASSERT(!list_link_active(&ds->ds_synced_link)); - list_insert_tail(&dp->dp_synced_datasets, ds); + list_insert_tail(&synced_datasets, ds); dsl_dataset_sync(ds, zio, tx); } DTRACE_PROBE(pool_sync__1setup); @@ -361,15 +380,20 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t ASSERT(err == 0); DTRACE_PROBE(pool_sync__2rootzio); - for (ds = list_head(&dp->dp_synced_datasets); ds; - ds = list_next(&dp->dp_synced_datasets, ds)) + /* + * After the data blocks have been written (ensured by the zio_wait() + * above), update the user/group space accounting. + */ + for (ds = list_head(&synced_datasets); ds; + ds = list_next(&synced_datasets, ds)) dmu_objset_do_userquota_updates(ds->ds_objset, tx); /* * Sync the datasets again to push out the changes due to * userspace updates. This must be done before we process the - * sync tasks, because that could cause a snapshot of a dataset - * whose ds_bp will be rewritten when we do this 2nd sync. + * sync tasks, so that any snapshots will have the correct + * user accounting information (and we won't get confused + * about which blocks are part of the snapshot). */ zio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); while (ds = txg_list_remove(&dp->dp_dirty_datasets, txg)) { @@ -380,30 +404,42 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t err = zio_wait(zio); /* - * Move dead blocks from the pending deadlist to the on-disk - * deadlist. + * Now that the datasets have been completely synced, we can + * clean up our in-memory structures accumulated while syncing: + * + * - move dead blocks from the pending deadlist to the on-disk deadlist + * - clean up zil records + * - release hold from dsl_dataset_dirty() */ - for (ds = list_head(&dp->dp_synced_datasets); ds; - ds = list_next(&dp->dp_synced_datasets, ds)) { + while (ds = list_remove_head(&synced_datasets)) { + objset_t *os = ds->ds_objset; bplist_iterate(&ds->ds_pending_deadlist, deadlist_enqueue_cb, &ds->ds_deadlist, tx); + ASSERT(!dmu_objset_is_dirty(os, txg)); + dmu_buf_rele(ds->ds_dbuf, ds); } - while (dstg = txg_list_remove(&dp->dp_sync_tasks, txg)) { - /* - * No more sync tasks should have been added while we - * were syncing. - */ - ASSERT(spa_sync_pass(dp->dp_spa) == 1); - dsl_sync_task_group_sync(dstg, tx); - } - DTRACE_PROBE(pool_sync__3task); - start = gethrtime(); while (dd = txg_list_remove(&dp->dp_dirty_dirs, txg)) dsl_dir_sync(dd, tx); write_time += gethrtime() - start; + /* + * The MOS's space is accounted for in the pool/$MOS + * (dp_mos_dir). We can't modify the mos while we're syncing + * it, so we remember the deltas and apply them here. + */ + if (dp->dp_mos_used_delta != 0 || dp->dp_mos_compressed_delta != 0 || + dp->dp_mos_uncompressed_delta != 0) { + dsl_dir_diduse_space(dp->dp_mos_dir, DD_USED_HEAD, + dp->dp_mos_used_delta, + dp->dp_mos_compressed_delta, + dp->dp_mos_uncompressed_delta, tx); + dp->dp_mos_used_delta = 0; + dp->dp_mos_compressed_delta = 0; + dp->dp_mos_uncompressed_delta = 0; + } + start = gethrtime(); if (list_head(&mos->os_dirty_dnodes[txg & TXG_MASK]) != NULL || list_head(&mos->os_free_dnodes[txg & TXG_MASK]) != NULL) { @@ -419,6 +455,27 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t hrtime_t, dp->dp_read_overhead); write_time -= dp->dp_read_overhead; + /* + * If we modify a dataset in the same txg that we want to destroy it, + * its dsl_dir's dd_dbuf will be dirty, and thus have a hold on it. + * dsl_dir_destroy_check() will fail if there are unexpected holds. + * Therefore, we want to sync the MOS (thus syncing the dd_dbuf + * and clearing the hold on it) before we process the sync_tasks. + * The MOS data dirtied by the sync_tasks will be synced on the next + * pass. + */ + DTRACE_PROBE(pool_sync__3task); + if (!txg_list_empty(&dp->dp_sync_tasks, txg)) { + dsl_sync_task_group_t *dstg; + /* + * No more sync tasks should have been added while we + * were syncing. + */ + ASSERT(spa_sync_pass(dp->dp_spa) == 1); + while (dstg = txg_list_remove(&dp->dp_sync_tasks, txg)) + dsl_sync_task_group_sync(dstg, tx); + } + dmu_tx_commit(tx); dp->dp_space_towrite[txg & TXG_MASK] = 0; @@ -467,15 +524,14 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t void dsl_pool_sync_done(dsl_pool_t *dp, uint64_t txg) { + zilog_t *zilog; dsl_dataset_t *ds; - objset_t *os; - while (ds = list_head(&dp->dp_synced_datasets)) { - list_remove(&dp->dp_synced_datasets, ds); - os = ds->ds_objset; - zil_clean(os->os_zil, txg); - ASSERT(!dmu_objset_is_dirty(os, txg)); - dmu_buf_rele(ds->ds_dbuf, ds); + while (zilog = txg_list_remove(&dp->dp_dirty_zilogs, txg)) { + ds = dmu_objset_ds(zilog->zl_os); + zil_clean(zilog, txg); + ASSERT(!dmu_objset_is_dirty(zilog->zl_os, txg)); + dmu_buf_rele(ds->ds_dbuf, zilog); } ASSERT(!dmu_objset_is_dirty(dp->dp_meta_objset, txg)); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Thu Aug 23 09:18:52 2012 (r239610) @@ -116,6 +116,8 @@ const zio_taskq_info_t zio_taskqs[ZIO_TY static dsl_syncfunc_t spa_sync_version; static dsl_syncfunc_t spa_sync_props; +static dsl_checkfunc_t spa_change_guid_check; +static dsl_syncfunc_t spa_change_guid_sync; static boolean_t spa_has_active_shared_spare(spa_t *spa); static int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config, spa_load_state_t state, spa_import_type_t type, boolean_t mosconfig, @@ -675,6 +677,47 @@ spa_prop_clear_bootfs(spa_t *spa, uint64 } } +/*ARGSUSED*/ +static int +spa_change_guid_check(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + uint64_t *newguid = arg2; + vdev_t *rvd = spa->spa_root_vdev; + uint64_t vdev_state; + + spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); + vdev_state = rvd->vdev_state; + spa_config_exit(spa, SCL_STATE, FTAG); + + if (vdev_state != VDEV_STATE_HEALTHY) + return (ENXIO); + + ASSERT3U(spa_guid(spa), !=, *newguid); + + return (0); +} + +static void +spa_change_guid_sync(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + uint64_t *newguid = arg2; + uint64_t oldguid; + vdev_t *rvd = spa->spa_root_vdev; + + oldguid = spa_guid(spa); + + spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); + rvd->vdev_guid = *newguid; + rvd->vdev_guid_sum += (*newguid - oldguid); + vdev_config_dirty(rvd); + spa_config_exit(spa, SCL_STATE, FTAG); + + spa_history_log_internal(spa, "guid change", tx, "old=%lld new=%lld", + oldguid, *newguid); +} + /* * Change the GUID for the pool. This is done so that we can later * re-import a pool built from a clone of our own vdevs. We will modify @@ -687,29 +730,23 @@ spa_prop_clear_bootfs(spa_t *spa, uint64 int spa_change_guid(spa_t *spa) { - uint64_t oldguid, newguid; - uint64_t txg; - - if (!(spa_mode_global & FWRITE)) - return (EROFS); - - txg = spa_vdev_enter(spa); - - if (spa->spa_root_vdev->vdev_state != VDEV_STATE_HEALTHY) - return (spa_vdev_exit(spa, NULL, txg, ENXIO)); + int error; + uint64_t guid; - oldguid = spa_guid(spa); - newguid = spa_generate_guid(NULL); - ASSERT3U(oldguid, !=, newguid); + mutex_enter(&spa_namespace_lock); + guid = spa_generate_guid(NULL); - spa->spa_root_vdev->vdev_guid = newguid; - spa->spa_root_vdev->vdev_guid_sum += (newguid - oldguid); + error = dsl_sync_task_do(spa_get_dsl(spa), spa_change_guid_check, + spa_change_guid_sync, spa, &guid, 5); - vdev_config_dirty(spa->spa_root_vdev); + if (error == 0) { + spa_config_sync(spa, B_FALSE, B_TRUE); + spa_event_notify(spa, NULL, ESC_ZFS_POOL_REGUID); + } - spa_event_notify(spa, NULL, ESC_ZFS_POOL_REGUID); + mutex_exit(&spa_namespace_lock); - return (spa_vdev_exit(spa, NULL, txg, 0)); + return (error); } /* @@ -6062,6 +6099,9 @@ spa_sync(spa_t *spa, uint64_t txg) rvd->vdev_children, txg, B_TRUE); } + if (error == 0) + spa->spa_last_synced_guid = rvd->vdev_guid; + spa_config_exit(spa, SCL_STATE, FTAG); if (error == 0) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Thu Aug 23 09:18:52 2012 (r239610) @@ -1348,16 +1348,29 @@ spa_name(spa_t *spa) uint64_t spa_guid(spa_t *spa) { + dsl_pool_t *dp = spa_get_dsl(spa); + uint64_t guid; + /* * If we fail to parse the config during spa_load(), we can go through * the error path (which posts an ereport) and end up here with no root * vdev. We stash the original pool guid in 'spa_config_guid' to handle * this case. */ - if (spa->spa_root_vdev != NULL) + if (spa->spa_root_vdev == NULL) + return (spa->spa_config_guid); + + guid = spa->spa_last_synced_guid != 0 ? + spa->spa_last_synced_guid : spa->spa_root_vdev->vdev_guid; + + /* + * Return the most recently synced out guid unless we're + * in syncing context. + */ + if (dp && dsl_pool_sync_context(dp)) return (spa->spa_root_vdev->vdev_guid); else - return (spa->spa_config_guid); + return (guid); } uint64_t Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Thu Aug 23 09:18:52 2012 (r239610) @@ -82,7 +82,6 @@ typedef struct dsl_pool { /* No lock needed - sync context only */ blkptr_t dp_meta_rootbp; - list_t dp_synced_datasets; hrtime_t dp_read_overhead; uint64_t dp_throughput; /* bytes per millisec */ uint64_t dp_write_limit; @@ -96,10 +95,14 @@ typedef struct dsl_pool { kmutex_t dp_lock; uint64_t dp_space_towrite[TXG_SIZE]; uint64_t dp_tempreserved[TXG_SIZE]; + uint64_t dp_mos_used_delta; + uint64_t dp_mos_compressed_delta; + uint64_t dp_mos_uncompressed_delta; /* Has its own locking */ tx_state_t dp_tx; txg_list_t dp_dirty_datasets; + txg_list_t dp_dirty_zilogs; txg_list_t dp_dirty_dirs; txg_list_t dp_sync_tasks; @@ -139,6 +142,8 @@ int dsl_read_nolock(zio_t *pio, spa_t *s void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx); +void dsl_pool_mos_diduse_space(dsl_pool_t *dp, + int64_t used, int64_t comp, int64_t uncomp); taskq_t *dsl_pool_vnrele_taskq(dsl_pool_t *dp); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Thu Aug 23 09:18:52 2012 (r239610) @@ -141,6 +141,7 @@ struct spa { vdev_t *spa_root_vdev; /* top-level vdev container */ uint64_t spa_config_guid; /* config pool guid */ uint64_t spa_load_guid; /* spa_load initialized guid */ + uint64_t spa_last_synced_guid; /* last synced guid */ list_t spa_config_dirty_list; /* vdevs with dirty config */ list_t spa_state_dirty_list; /* vdevs with dirty state */ spa_aux_vdev_t spa_spares; /* hot spares */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h Thu Aug 23 09:18:52 2012 (r239610) @@ -22,6 +22,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #ifndef _SYS_TXG_H #define _SYS_TXG_H @@ -115,7 +118,7 @@ extern boolean_t txg_sync_waiting(struct extern void txg_list_create(txg_list_t *tl, size_t offset); extern void txg_list_destroy(txg_list_t *tl); -extern int txg_list_empty(txg_list_t *tl, uint64_t txg); +extern boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg); extern int txg_list_add(txg_list_t *tl, void *p, uint64_t txg); extern int txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg); extern void *txg_list_remove(txg_list_t *tl, uint64_t txg); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h Thu Aug 23 09:18:52 2012 (r239610) @@ -142,7 +142,7 @@ extern nvlist_t *vdev_config_generate(sp struct uberblock; extern uint64_t vdev_label_offset(uint64_t psize, int l, uint64_t offset); extern int vdev_label_number(uint64_t psise, uint64_t offset); -extern nvlist_t *vdev_label_read_config(vdev_t *vd, int label); +extern nvlist_t *vdev_label_read_config(vdev_t *vd, uint64_t txg); extern void vdev_uberblock_load(vdev_t *, struct uberblock *, nvlist_t **); typedef enum { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h Thu Aug 23 09:18:52 2012 (r239610) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -395,6 +396,7 @@ extern void zil_replay(objset_t *os, voi zil_replay_func_t *replay_func[TX_MAX_TYPE]); extern boolean_t zil_replaying(zilog_t *zilog, dmu_tx_t *tx); extern void zil_destroy(zilog_t *zilog, boolean_t keep_first); +extern void zil_destroy_sync(zilog_t *zilog, dmu_tx_t *tx); extern void zil_rollback_destroy(zilog_t *zilog, dmu_tx_t *tx); extern itx_t *zil_itx_create(uint64_t txtype, size_t lrsize); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h Thu Aug 23 09:18:52 2012 (r239610) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -130,6 +131,7 @@ struct zilog { zil_header_t zl_old_header; /* debugging aid */ uint_t zl_prev_blks[ZIL_PREV_BLKS]; /* size - sector rounded */ uint_t zl_prev_rotor; /* rotor for zl_prev[] */ + txg_node_t zl_dirty_link; /* protected by dp_dirty_zilogs list */ }; typedef struct zil_bp_node { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Thu Aug 23 09:18:52 2012 (r239610) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 Martin Matuska + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -587,7 +588,7 @@ txg_list_destroy(txg_list_t *tl) mutex_destroy(&tl->tl_lock); } -int +boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg) { return (tl->tl_head[txg & TXG_MASK] == NULL); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Thu Aug 23 09:18:52 2012 (r239610) @@ -1327,9 +1327,9 @@ vdev_validate(vdev_t *vd, boolean_t stri if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) { uint64_t aux_guid = 0; nvlist_t *nvl; + uint64_t txg = strict ? spa->spa_config_txg : -1ULL; - if ((label = vdev_label_read_config(vd, VDEV_BEST_LABEL)) == - NULL) { + if ((label = vdev_label_read_config(vd, txg)) == NULL) { vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, VDEV_AUX_BAD_LABEL); return (0); @@ -1511,7 +1511,7 @@ vdev_reopen(vdev_t *vd) !l2arc_vdev_present(vd)) l2arc_add_vdev(spa, vd); } else { - (void) vdev_validate(vd, B_TRUE); + (void) vdev_validate(vd, spa_last_synced_txg(spa)); } /* @@ -1970,7 +1970,7 @@ vdev_validate_aux(vdev_t *vd) if (!vdev_readable(vd)) return (0); - if ((label = vdev_label_read_config(vd, VDEV_BEST_LABEL)) == NULL) { + if ((label = vdev_label_read_config(vd, -1ULL)) == NULL) { vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, VDEV_AUX_CORRUPT_DATA); return (-1); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c Thu Aug 23 09:18:52 2012 (r239610) @@ -433,17 +433,22 @@ vdev_top_config_generate(spa_t *spa, nvl } /* - * Returns the configuration from the label of the given vdev. If 'label' is - * VDEV_BEST_LABEL, each label of the vdev will be read until a valid - * configuration is found; otherwise, only the specified label will be read. + * Returns the configuration from the label of the given vdev. For vdevs + * which don't have a txg value stored on their label (i.e. spares/cache) + * or have not been completely initialized (txg = 0) just return + * the configuration from the first valid label we find. Otherwise, + * find the most up-to-date label that does not exceed the specified + * 'txg' value. */ nvlist_t * -vdev_label_read_config(vdev_t *vd, int label) +vdev_label_read_config(vdev_t *vd, uint64_t txg) { spa_t *spa = vd->vdev_spa; nvlist_t *config = NULL; vdev_phys_t *vp; zio_t *zio; + uint64_t best_txg = 0; + int error = 0; int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE; @@ -456,8 +461,7 @@ vdev_label_read_config(vdev_t *vd, int l retry: for (int l = 0; l < VDEV_LABELS; l++) { - if (label >= 0 && label < VDEV_LABELS && label != l) - continue; + nvlist_t *label = NULL; zio = zio_root(spa, NULL, NULL, flags); @@ -467,12 +471,31 @@ retry: if (zio_wait(zio) == 0 && nvlist_unpack(vp->vp_nvlist, sizeof (vp->vp_nvlist), - &config, 0) == 0) - break; + &label, 0) == 0) { + uint64_t label_txg = 0; - if (config != NULL) { - nvlist_free(config); - config = NULL; + /* + * Auxiliary vdevs won't have txg values in their + * labels and newly added vdevs may not have been + * completely initialized so just return the + * configuration from the first valid label we + * encounter. + */ + error = nvlist_lookup_uint64(label, + ZPOOL_CONFIG_POOL_TXG, &label_txg); + if ((error || label_txg == 0) && !config) { + config = label; + break; + } else if (label_txg <= txg && label_txg > best_txg) { + best_txg = label_txg; + nvlist_free(config); + config = fnvlist_dup(label); + } + } + + if (label != NULL) { + nvlist_free(label); + label = NULL; } } @@ -507,7 +530,7 @@ vdev_inuse(vdev_t *vd, uint64_t crtxg, v /* * Read the label, if any, and perform some basic sanity checks. */ - if ((label = vdev_label_read_config(vd, VDEV_BEST_LABEL)) == NULL) + if ((label = vdev_label_read_config(vd, -1ULL)) == NULL) return (B_FALSE); (void) nvlist_lookup_uint64(label, ZPOOL_CONFIG_CREATE_TXG, @@ -867,7 +890,6 @@ vdev_uberblock_compare(uberblock_t *ub1, struct ubl_cbdata { uberblock_t *ubl_ubbest; /* Best uberblock */ vdev_t *ubl_vd; /* vdev associated with the above */ - int ubl_label; /* Label associated with the above */ }; static void @@ -886,15 +908,13 @@ vdev_uberblock_load_done(zio_t *zio) if (ub->ub_txg <= spa->spa_load_max_txg && vdev_uberblock_compare(ub, cbp->ubl_ubbest) > 0) { /* - * Keep track of the vdev and label in which this - * uberblock was found. We will use this information - * later to obtain the config nvlist associated with + * Keep track of the vdev in which this uberblock + * was found. We will use this information later + * to obtain the config nvlist associated with * this uberblock. */ *cbp->ubl_ubbest = *ub; cbp->ubl_vd = vd; - cbp->ubl_label = vdev_label_number(vd->vdev_psize, - zio->io_offset); } mutex_exit(&rio->io_lock); } @@ -926,12 +946,11 @@ vdev_uberblock_load_impl(zio_t *zio, vde * Reads the 'best' uberblock from disk along with its associated * configuration. First, we read the uberblock array of each label of each * vdev, keeping track of the uberblock with the highest txg in each array. - * Then, we read the configuration from the same label as the best uberblock. + * Then, we read the configuration from the same vdev as the best uberblock. */ void vdev_uberblock_load(vdev_t *rvd, uberblock_t *ub, nvlist_t **config) { - int i; zio_t *zio; spa_t *spa = rvd->vdev_spa; struct ubl_cbdata cb; @@ -951,13 +970,15 @@ vdev_uberblock_load(vdev_t *rvd, uberblo zio = zio_root(spa, NULL, &cb, flags); vdev_uberblock_load_impl(zio, rvd, flags, &cb); (void) zio_wait(zio); - if (cb.ubl_vd != NULL) { - for (i = cb.ubl_label % 2; i < VDEV_LABELS; i += 2) { - *config = vdev_label_read_config(cb.ubl_vd, i); - if (*config != NULL) - break; - } - } + + /* + * It's possible that the best uberblock was discovered on a label + * that has a configuration which was written in a future txg. + * Search all labels on this vdev to find the configuration that + * matches the txg for our uberblock. + */ + if (cb.ubl_vd != NULL) + *config = vdev_label_read_config(cb.ubl_vd, ub->ub_txg); spa_config_exit(spa, SCL_ALL, FTAG); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Thu Aug 23 09:18:52 2012 (r239610) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -455,6 +455,37 @@ zil_alloc_lwb(zilog_t *zilog, blkptr_t * } /* + * Called when we create in-memory log transactions so that we know + * to cleanup the itxs at the end of spa_sync(). + */ +void +zilog_dirty(zilog_t *zilog, uint64_t txg) +{ + dsl_pool_t *dp = zilog->zl_dmu_pool; + dsl_dataset_t *ds = dmu_objset_ds(zilog->zl_os); + + if (dsl_dataset_is_snapshot(ds)) + panic("dirtying snapshot!"); + + if (txg_list_add(&dp->dp_dirty_zilogs, zilog, txg) == 0) { + /* up the hold count until we can be written out */ + dmu_buf_add_ref(ds->ds_dbuf, zilog); + } +} + +boolean_t +zilog_is_dirty(zilog_t *zilog) +{ + dsl_pool_t *dp = zilog->zl_dmu_pool; + + for (int t = 0; t < TXG_SIZE; t++) { + if (txg_list_member(&dp->dp_dirty_zilogs, zilog, t)) + return (B_TRUE); + } + return (B_FALSE); +} + +/* * Create an on-disk intent log. */ static lwb_t * @@ -570,14 +601,21 @@ zil_destroy(zilog_t *zilog, boolean_t ke kmem_cache_free(zil_lwb_cache, lwb); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 09:18:54 2012 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 906201065670; Thu, 23 Aug 2012 09:18:54 +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 78D218FC0A; Thu, 23 Aug 2012 09:18:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N9IsrO095038; Thu, 23 Aug 2012 09:18:54 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N9IsU5095035; Thu, 23 Aug 2012 09:18:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208230918.q7N9IsU5095035@svn.freebsd.org> From: Martin Matuska Date: Thu, 23 Aug 2012 09:18: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: r239610 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest vendor/illumos/dist/lib/libzfs/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: Thu, 23 Aug 2012 09:18:54 -0000 Author: mm Date: Thu Aug 23 09:18:52 2012 New Revision: 239610 URL: http://svn.freebsd.org/changeset/base/239610 Log: Update vendor/illumos and vendor-sys/illumos to revision 13777:b1e53580146d Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor/illumos/dist/cmd/ztest/ztest.c Thu Aug 23 09:18:52 2012 (r239610) @@ -362,7 +362,7 @@ ztest_info_t ztest_info[] = { { ztest_spa_rename, 1, &zopt_rarely }, { ztest_scrub, 1, &zopt_rarely }, { ztest_dsl_dataset_promote_busy, 1, &zopt_rarely }, - { ztest_vdev_attach_detach, 1, &zopt_rarely }, + { ztest_vdev_attach_detach, 1, &zopt_rarely }, { ztest_vdev_LUN_growth, 1, &zopt_rarely }, { ztest_vdev_add_remove, 1, &ztest_opts.zo_vdevtime }, @@ -413,6 +413,13 @@ static spa_t *ztest_spa = NULL; static ztest_ds_t *ztest_ds; static mutex_t ztest_vdev_lock; + +/* + * The ztest_name_lock protects the pool and dataset namespace used by + * the individual tests. To modify the namespace, consumers must grab + * this lock as writer. Grabbing the lock as reader will ensure that the + * namespace does not change while the lock is held. + */ static rwlock_t ztest_name_lock; static boolean_t ztest_dump_core = B_TRUE; @@ -2223,6 +2230,7 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 { objset_t *os = zd->zd_os; + VERIFY(mutex_lock(&zd->zd_dirobj_lock) == 0); (void) rw_wrlock(&zd->zd_zilog_lock); /* zfsvfs_teardown() */ @@ -2233,6 +2241,7 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 zil_replay(os, zd, ztest_replay_vector); (void) rw_unlock(&zd->zd_zilog_lock); + VERIFY(mutex_unlock(&zd->zd_dirobj_lock) == 0); } /* @@ -4852,10 +4861,16 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id { spa_t *spa = ztest_spa; uint64_t orig, load; + int error; orig = spa_guid(spa); load = spa_load_guid(spa); - if (spa_change_guid(spa) != 0) + + (void) rw_wrlock(&ztest_name_lock); + error = spa_change_guid(spa); + (void) rw_unlock(&ztest_name_lock); + + if (error != 0) return; if (ztest_opts.zo_verbose >= 3) { @@ -5531,8 +5546,15 @@ ztest_freeze(void) */ kernel_init(FREAD | FWRITE); VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG)); + ASSERT(spa_freeze_txg(spa) == UINT64_MAX); VERIFY3U(0, ==, ztest_dataset_open(0)); ztest_dataset_close(0); + + spa->spa_debug = B_TRUE; + ztest_spa = spa; + txg_wait_synced(spa_get_dsl(spa), 0); + ztest_reguid(NULL, 0); + spa_close(spa, FTAG); kernel_fini(); } Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Thu Aug 23 05:15:15 2012 (r239609) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Thu Aug 23 09:18:52 2012 (r239610) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -439,8 +439,8 @@ get_configs(libzfs_handle_t *hdl, pool_l uint_t i, nspares, nl2cache; boolean_t config_seen; uint64_t best_txg; - char *name, *hostname, *comment; - uint64_t version, guid; + char *name, *hostname; + uint64_t guid; uint_t children = 0; nvlist_t **child = NULL; uint_t holes; @@ -526,61 +526,54 @@ get_configs(libzfs_handle_t *hdl, pool_l * configuration: * * version - * pool guid - * name + * pool guid + * name + * pool txg (if available) * comment (if available) - * pool state + * pool state * hostid (if available) * hostname (if available) */ - uint64_t state; + uint64_t state, version, pool_txg; + char *comment = NULL; - verify(nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_VERSION, &version) == 0); - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_VERSION, version) != 0) - goto nomem; - verify(nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_POOL_GUID, &guid) == 0); - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_POOL_GUID, guid) != 0) - goto nomem; - verify(nvlist_lookup_string(tmp, - ZPOOL_CONFIG_POOL_NAME, &name) == 0); - if (nvlist_add_string(config, - ZPOOL_CONFIG_POOL_NAME, name) != 0) - goto nomem; + version = fnvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_VERSION); + fnvlist_add_uint64(config, + ZPOOL_CONFIG_VERSION, version); + guid = fnvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_POOL_GUID); + fnvlist_add_uint64(config, + ZPOOL_CONFIG_POOL_GUID, guid); + name = fnvlist_lookup_string(tmp, + ZPOOL_CONFIG_POOL_NAME); + fnvlist_add_string(config, + ZPOOL_CONFIG_POOL_NAME, name); - /* - * COMMENT is optional, don't bail if it's not - * there, instead, set it to NULL. - */ - if (nvlist_lookup_string(tmp, - ZPOOL_CONFIG_COMMENT, &comment) != 0) - comment = NULL; - else if (nvlist_add_string(config, - ZPOOL_CONFIG_COMMENT, comment) != 0) - goto nomem; + if (nvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_POOL_TXG, &pool_txg) == 0) + fnvlist_add_uint64(config, + ZPOOL_CONFIG_POOL_TXG, pool_txg); - verify(nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_POOL_STATE, &state) == 0); - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_POOL_STATE, state) != 0) - goto nomem; + if (nvlist_lookup_string(tmp, + ZPOOL_CONFIG_COMMENT, &comment) == 0) + fnvlist_add_string(config, + ZPOOL_CONFIG_COMMENT, comment); + + state = fnvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_POOL_STATE); + fnvlist_add_uint64(config, + ZPOOL_CONFIG_POOL_STATE, state); hostid = 0; if (nvlist_lookup_uint64(tmp, ZPOOL_CONFIG_HOSTID, &hostid) == 0) { - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_HOSTID, hostid) != 0) - goto nomem; - verify(nvlist_lookup_string(tmp, - ZPOOL_CONFIG_HOSTNAME, - &hostname) == 0); - if (nvlist_add_string(config, - ZPOOL_CONFIG_HOSTNAME, - hostname) != 0) - goto nomem; + fnvlist_add_uint64(config, + ZPOOL_CONFIG_HOSTID, hostid); + hostname = fnvlist_lookup_string(tmp, + ZPOOL_CONFIG_HOSTNAME); + fnvlist_add_string(config, + ZPOOL_CONFIG_HOSTNAME, hostname); } config_seen = B_TRUE; From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 10:38:54 2012 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 7F885106564A; Thu, 23 Aug 2012 10:38:54 +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 2B1878FC0C; Thu, 23 Aug 2012 10:38:53 +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 8515725D3888; Thu, 23 Aug 2012 10:38:46 +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 9897ABE84F2; Thu, 23 Aug 2012 10:38:45 +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 m-UkyGeRzPpU; Thu, 23 Aug 2012 10:38:44 +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 29A20BE84F1; Thu, 23 Aug 2012 10:38:44 +0000 (UTC) Date: Thu, 23 Aug 2012 10:38:43 +0000 (UTC) From: "Bjoern A. Zeeb" To: John Baldwin In-Reply-To: <201208222000.q7MK0ff6089027@svn.freebsd.org> Message-ID: References: <201208222000.q7MK0ff6089027@svn.freebsd.org> X-OpenPGP-Key-Id: 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: r239584 - 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: Thu, 23 Aug 2012 10:38:54 -0000 On Wed, 22 Aug 2012, John Baldwin wrote: > Author: jhb > Date: Wed Aug 22 20:00:41 2012 > New Revision: 239584 > URL: http://svn.freebsd.org/changeset/base/239584 > > Log: > Fix the 'show witness' DDB command to honor db_pager_quit. Thanks! -- 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 Aug 23 12:20:30 2012 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 6D257106567C; Thu, 23 Aug 2012 12:20:30 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 589228FC14; Thu, 23 Aug 2012 12:20:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NCKUOf022584; Thu, 23 Aug 2012 12:20:30 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NCKUSh022582; Thu, 23 Aug 2012 12:20:30 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208231220.q7NCKUSh022582@svn.freebsd.org> From: Andrey Zonov Date: Thu, 23 Aug 2012 12:20:30 +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: r239611 - head/usr.bin/truss 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, 23 Aug 2012 12:20:30 -0000 Author: zont Date: Thu Aug 23 12:20:29 2012 New Revision: 239611 URL: http://svn.freebsd.org/changeset/base/239611 Log: - Put arguments for print_syscall_ret() function in proper order. Bug was introduced in r192025. Approved by: kib (mentor) Modified: head/usr.bin/truss/ia64-fbsd.c Modified: head/usr.bin/truss/ia64-fbsd.c ============================================================================== --- head/usr.bin/truss/ia64-fbsd.c Thu Aug 23 09:18:52 2012 (r239610) +++ head/usr.bin/truss/ia64-fbsd.c Thu Aug 23 12:20:29 2012 (r239611) @@ -294,7 +294,7 @@ ia64_syscall_exit(struct trussinfo *trus */ print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - fsc.sc, retval); + retval, fsc.sc); clear_fsc(); return (retval); From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 14:27:46 2012 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 B46CA106567F; Thu, 23 Aug 2012 14:27:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 89EDF8FC08; Thu, 23 Aug 2012 14:27:46 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E0734B91E; Thu, 23 Aug 2012 10:27:45 -0400 (EDT) From: John Baldwin To: Oleksandr Tymoshenko Date: Thu, 23 Aug 2012 07:46:57 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208222248.q7MMmojL011382@svn.freebsd.org> In-Reply-To: <201208222248.q7MMmojL011382@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208230746.57495.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 23 Aug 2012 10:27:46 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239597 - head/sys/arm/arm 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, 23 Aug 2012 14:27:46 -0000 On Wednesday, August 22, 2012 6:48:50 pm Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Wed Aug 22 22:48:50 2012 > New Revision: 239597 > URL: http://svn.freebsd.org/changeset/base/239597 > > Log: > Do not change "cachable" attribute for DMA memory allocated with > BUS_DMA_COHERENT attribute > > The minimum unit for changing "cachable" attribute is page, so call > to pmap_change_attr effectively disable cache for all pages that newly > allocated DMA memory region spans on. The problem is that general-purpose > memory could reside on these pages too and disabling cache might affect > performance. Moreover ldrex/strex operators raise Data Abort exception > when accessing memory on page with "cachable" attribute off. > > BUS_DMA_COHERENT does nto require memory to be coherent. It just suggests > to do best effort for reducing synchronization overhead. Alternatively you could force an allocation with BUS_DMA_COHERENT to always allocate at least one page. Also, it is probably better to match what I recently did in x86 and use kmem_alloc_contig() or kmem_alloc_attr() for allocations with a custom memory attribute rather than using pmap_change_attr() directly. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 14:27:50 2012 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 6C5BD1065670; Thu, 23 Aug 2012 14:27:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBAC8FC18; Thu, 23 Aug 2012 14:27:50 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 73FFDB91E; Thu, 23 Aug 2012 10:27:49 -0400 (EDT) From: John Baldwin To: Marius Strobl , Bjoern Zeeb Date: Thu, 23 Aug 2012 10:12:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201111182239.pAIMdkCr003347@svn.freebsd.org> In-Reply-To: <201111182239.pAIMdkCr003347@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208231012.52720.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 23 Aug 2012 10:27:49 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227687 - head/sys/dev/mii 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, 23 Aug 2012 14:27:50 -0000 On Friday, November 18, 2011 5:39:46 pm Marius Strobl wrote: > Author: marius > Date: Fri Nov 18 22:39:46 2011 > New Revision: 227687 > URL: http://svn.freebsd.org/changeset/base/227687 > > Log: > - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY > addresses from being probed and attaching something including ukphy(4) > to it. This is mainly necessarily for PHY switches that create duplicate > or fake PHYs on the bus that can corrupt the PHY state when accessed or > simply cause problems when ukphy(4) isolates the additional instances. > - Change miibus(4) to be a hinted bus, allowing to add child devices via > hints and to set their attach arguments (including for automatically > probed PHYs). This is mainly needed for PHY switches that violate IEEE > 802.3 and don't even implement the basic register set so we can't probe > them automatically. However, the ability to alter the attach arguments > for automatically probed PHYs is also useful as for example it allows > to test (or tell a user to test) new variant of a PHY with a specific > driver by letting an existing driver attach to it via manipulating the > IDs without the need to touch the source code or to limit a Gigabit > Ethernet PHY to only announce up to Fast Ethernet in order to save > energy by limiting the capability mask. Generally, a driver has to > be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" > (which already is sufficient to add phydrvX at miibusY at PHY address > Z). Then optionally the following attach arguments additionally can > be configured: > hint.phydrv.X.id1 > hint.phydrv.X.id2 > hint.phydrv.X.capmask > - Some minor cleanup. I was looking at this today with bz to try to figure out how to use this. It strikes me that in a case of a bus with devices that have IDs it can be useful to not hardcode the driver name and unit number, but to be able to create a device and let the normal driver probe mechanics work. The existing miibus_hinted_child() routine already largely enforces that by ensuring that any new child has a unique phyno address. Two approaches I can think of are: 1) Never hardcode the name and unit number. 2) Don't hardcode the name and unit number if the name is "phy". This would let you do something like: hint.phy.0.at="miibus0" hint.phy.0.phyno="1" hint.phy.0.id1="xxx" hint.phy.0.id2="yyy" And then 'e1000phy' or 'brphy' or whoever could manage the phy. Though perhaps in the case of hinted children you want to always force the phy driver? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 16:00:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB14D1065670; Thu, 23 Aug 2012 16:00:04 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id 788878FC08; Thu, 23 Aug 2012 16:00:04 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id C95294C03BA; Thu, 23 Aug 2012 11:00:03 -0500 (CDT) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id C7B1A4C03A0; Thu, 23 Aug 2012 11:00:03 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id Eq9XAP9KyIBE; Thu, 23 Aug 2012 11:00:03 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 916FB4C0372; Thu, 23 Aug 2012 11:00:01 -0500 (CDT) Message-ID: <5036537F.2060801@rice.edu> Date: Thu, 23 Aug 2012 10:59:59 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: John Baldwin References: <201208222248.q7MMmojL011382@svn.freebsd.org> <201208230746.57495.jhb@freebsd.org> In-Reply-To: <201208230746.57495.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Oleksandr Tymoshenko , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239597 - head/sys/arm/arm 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, 23 Aug 2012 16:00:05 -0000 On 08/23/2012 06:46, John Baldwin wrote: > On Wednesday, August 22, 2012 6:48:50 pm Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Wed Aug 22 22:48:50 2012 >> New Revision: 239597 >> URL: http://svn.freebsd.org/changeset/base/239597 >> >> Log: >> Do not change "cachable" attribute for DMA memory allocated with >> BUS_DMA_COHERENT attribute >> >> The minimum unit for changing "cachable" attribute is page, so call >> to pmap_change_attr effectively disable cache for all pages that newly >> allocated DMA memory region spans on. The problem is that general-purpose >> memory could reside on these pages too and disabling cache might affect >> performance. Moreover ldrex/strex operators raise Data Abort exception >> when accessing memory on page with "cachable" attribute off. >> >> BUS_DMA_COHERENT does nto require memory to be coherent. It just suggests >> to do best effort for reducing synchronization overhead. > Alternatively you could force an allocation with BUS_DMA_COHERENT to always > allocate at least one page. Also, it is probably better to match what I > recently did in x86 and use kmem_alloc_contig() or kmem_alloc_attr() for > allocations with a custom memory attribute rather than using > pmap_change_attr() directly. > The arm pmap doesn't have the necessary support for memory attributes. pmap_page_{get,set}_memattr() are just stubs. Alan From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 16:25:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2332C106566B; Thu, 23 Aug 2012 16:25:37 +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 0D4E18FC20; Thu, 23 Aug 2012 16:25:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NGPa5s057571; Thu, 23 Aug 2012 16:25:36 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NGPadO057568; Thu, 23 Aug 2012 16:25:36 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201208231625.q7NGPadO057568@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 23 Aug 2012 16:25: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: r239612 - head/sbin/camcontrol 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, 23 Aug 2012 16:25:37 -0000 Author: jh Date: Thu Aug 23 16:25:36 2012 New Revision: 239612 URL: http://svn.freebsd.org/changeset/base/239612 Log: Check the return value of sbuf_finish(). Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Aug 23 12:20:29 2012 (r239611) +++ head/sbin/camcontrol/camcontrol.c Thu Aug 23 16:25:36 2012 (r239612) @@ -4758,7 +4758,10 @@ try_long: smp_report_general_sbuf(response, sizeof(*response), sb); - sbuf_finish(sb); + if (sbuf_finish(sb) != 0) { + warnx("%s: sbuf_finish", __func__); + goto bailout; + } printf("%s", sbuf_data(sb)); @@ -5129,7 +5132,10 @@ smpmaninfo(struct cam_device *device, in smp_report_manuf_info_sbuf(&response, sizeof(response), sb); - sbuf_finish(sb); + if (sbuf_finish(sb) != 0) { + warnx("%s: sbuf_finish", __func__); + goto bailout; + } printf("%s", sbuf_data(sb)); From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 17:03:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FFD2106564A; Thu, 23 Aug 2012 17:03:34 +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 3BF8A8FC12; Thu, 23 Aug 2012 17:03:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NH3YX2062577; Thu, 23 Aug 2012 17:03:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NH3YgS062575; Thu, 23 Aug 2012 17:03:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208231703.q7NH3YgS062575@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Aug 2012 17:03: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: r239613 - 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: Thu, 23 Aug 2012 17:03:34 -0000 Author: dim Date: Thu Aug 23 17:03:33 2012 New Revision: 239613 URL: http://svn.freebsd.org/changeset/base/239613 Log: Make sure bsd.dep.mk does not filter out -stdlib=xxx from CXXFLAGS, since this determines parts of the C++ include path. MFC after: 1 week Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Thu Aug 23 16:25:36 2012 (r239612) +++ head/share/mk/bsd.dep.mk Thu Aug 23 17:03:33 2012 (r239613) @@ -125,8 +125,10 @@ depend: beforedepend ${DEPENDFILE} after # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. -MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} ${CFLAGS:M-ansi} -MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} ${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} +MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} \ + ${CFLAGS:M-ansi} +MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} \ + ${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} ${CXXFLAGS:M-stdlib=*} DPSRCS+= ${SRCS} ${DEPENDFILE}: ${DPSRCS} From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 17:08:08 2012 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 0E4B2106564A; Thu, 23 Aug 2012 17:08:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED6698FC14; Thu, 23 Aug 2012 17:08:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NH8799063194; Thu, 23 Aug 2012 17:08:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NH87Ru063190; Thu, 23 Aug 2012 17:08:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208231708.q7NH87Ru063190@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Aug 2012 17:08:07 +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: r239614 - in head: lib/clang usr.bin/clang 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, 23 Aug 2012 17:08:08 -0000 Author: dim Date: Thu Aug 23 17:08:07 2012 New Revision: 239614 URL: http://svn.freebsd.org/changeset/base/239614 Log: Sprinkle a bit of style.Makefile(5) across various clang Makefiles. No functional changes. MFC after: 3 days Modified: head/lib/clang/clang.build.mk head/lib/clang/clang.lib.mk head/usr.bin/clang/clang.prog.mk Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Thu Aug 23 17:03:33 2012 (r239613) +++ head/lib/clang/clang.build.mk Thu Aug 23 17:08:07 2012 (r239614) @@ -1,15 +1,15 @@ # $FreeBSD$ -CLANG_SRCS=${LLVM_SRCS}/tools/clang +CLANG_SRCS= ${LLVM_SRCS}/tools/clang -CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \ - -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ - -I${LLVM_SRCS}/../../lib/clang/include \ - -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ - -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG +CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \ + -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ + -I${LLVM_SRCS}/../../lib/clang/include \ + -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ + -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG # LLVM is not strict aliasing safe as of 12/31/2011 -CFLAGS+= -fno-strict-aliasing +CFLAGS+= -fno-strict-aliasing TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} @@ -19,23 +19,23 @@ CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\" -DLLVM_HOSTTRIPLE=\"${BUILD_TRIPLE}\" .ifndef LLVM_REQUIRES_EH -CXXFLAGS+=-fno-exceptions +CXXFLAGS+= -fno-exceptions .else # If the library or program requires EH, it also requires RTTI. LLVM_REQUIRES_RTTI= .endif .ifndef LLVM_REQUIRES_RTTI -CXXFLAGS+=-fno-rtti +CXXFLAGS+= -fno-rtti .endif -CFLAGS+=-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" +CFLAGS+= -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" .PATH: ${LLVM_SRCS}/${SRCDIR} -TBLGEN?=tblgen -CLANG_TBLGEN?=clang-tblgen -TBLINC+=-I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target +TBLGEN?= tblgen +CLANG_TBLGEN?= clang-tblgen +TBLINC+= -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/Intrinsics.td ${TBLGEN} -I ${LLVM_SRCS}/lib/VMCore ${TBLINC} -gen-intrinsic \ Modified: head/lib/clang/clang.lib.mk ============================================================================== --- head/lib/clang/clang.lib.mk Thu Aug 23 17:03:33 2012 (r239613) +++ head/lib/clang/clang.lib.mk Thu Aug 23 17:08:07 2012 (r239614) @@ -1,6 +1,6 @@ # $FreeBSD$ -LLVM_SRCS=${.CURDIR}/../../../contrib/llvm +LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm .include "clang.build.mk" Modified: head/usr.bin/clang/clang.prog.mk ============================================================================== --- head/usr.bin/clang/clang.prog.mk Thu Aug 23 17:03:33 2012 (r239613) +++ head/usr.bin/clang/clang.prog.mk Thu Aug 23 17:08:07 2012 (r239614) @@ -1,14 +1,14 @@ # $FreeBSD$ -LLVM_SRCS=${.CURDIR}/../../../contrib/llvm +LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm .include "../../lib/clang/clang.build.mk" .for lib in ${LIBDEPS} -DPADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a -LDADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a +DPADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a +LDADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a .endfor -BINDIR?=/usr/bin +BINDIR?= /usr/bin .include From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 17:09:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3688106566C; Thu, 23 Aug 2012 17:09:52 +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 C66F48FC08; Thu, 23 Aug 2012 17:09:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NH9q9V063453; Thu, 23 Aug 2012 17:09:52 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NH9qi5063451; Thu, 23 Aug 2012 17:09:52 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208231709.q7NH9qi5063451@svn.freebsd.org> From: Bernhard Schmidt Date: Thu, 23 Aug 2012 17:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239615 - stable/9/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: Thu, 23 Aug 2012 17:09:53 -0000 Author: bschmidt Date: Thu Aug 23 17:09:52 2012 New Revision: 239615 URL: http://svn.freebsd.org/changeset/base/239615 Log: MFC r231187: Update the 802.11s IE numbers to represent the latest 802.11 amendment standard. This update breaks compatibility with older mesh setups but is necessary as the previous IDs are used by another amendment leading to unexpected results when trying to associate with an accesspoint using the affected IDs. Discussed with: re Tested by: honestqiao at gmail dot com Modified: stable/9/sys/net80211/ieee80211.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net80211/ieee80211.h ============================================================================== --- stable/9/sys/net80211/ieee80211.h Thu Aug 23 17:08:07 2012 (r239614) +++ stable/9/sys/net80211/ieee80211.h Thu Aug 23 17:09:52 2012 (r239615) @@ -709,27 +709,32 @@ enum { IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ /* - * 802.11s IEs based on D3.03 spec and were not assigned by - * ANA. Beware changing them because some of them are being - * kept compatible with Linux. + * 802.11s IEs + * NB: On vanilla Linux still IEEE80211_ELEMID_MESHPEER = 55, + * but they defined a new with id 117 called PEER_MGMT. + * NB: complies with open80211 */ - IEEE80211_ELEMID_MESHCONF = 51, - IEEE80211_ELEMID_MESHID = 52, - IEEE80211_ELEMID_MESHLINK = 35, - IEEE80211_ELEMID_MESHCNGST = 36, - IEEE80211_ELEMID_MESHPEER = 55, - IEEE80211_ELEMID_MESHCSA = 38, - IEEE80211_ELEMID_MESHTIM = 39, - IEEE80211_ELEMID_MESHAWAKEW = 40, - IEEE80211_ELEMID_MESHBEACONT = 41, - IEEE80211_ELEMID_MESHPANN = 48, - IEEE80211_ELEMID_MESHRANN = 49, - IEEE80211_ELEMID_MESHPREQ = 68, - IEEE80211_ELEMID_MESHPREP = 69, - IEEE80211_ELEMID_MESHPERR = 70, - IEEE80211_ELEMID_MESHPXU = 53, - IEEE80211_ELEMID_MESHPXUC = 54, - IEEE80211_ELEMID_MESHAH = 60, /* Abbreviated Handshake */ + IEEE80211_ELEMID_MESHCONF = 113, + IEEE80211_ELEMID_MESHID = 114, + IEEE80211_ELEMID_MESHLINK = 115, + IEEE80211_ELEMID_MESHCNGST = 116, + IEEE80211_ELEMID_MESHPEER = 117, + IEEE80211_ELEMID_MESHCSA = 118, + IEEE80211_ELEMID_MESHTIM = 39, /* XXX: remove */ + IEEE80211_ELEMID_MESHAWAKEW = 119, + IEEE80211_ELEMID_MESHBEACONT = 120, + /* 121-124 MMCAOP not implemented yet */ + IEEE80211_ELEMID_MESHPANN = 125, /* XXX: is GANN now, not used */ + IEEE80211_ELEMID_MESHRANN = 126, + /* 127 Extended Capabilities */ + /* 128-129 reserved */ + IEEE80211_ELEMID_MESHPREQ = 130, + IEEE80211_ELEMID_MESHPREP = 131, + IEEE80211_ELEMID_MESHPERR = 132, + /* 133-136 reserved */ + IEEE80211_ELEMID_MESHPXU = 137, + IEEE80211_ELEMID_MESHPXUC = 138, + IEEE80211_ELEMID_MESHAH = 60, /* XXX: remove */ }; struct ieee80211_tim_ie { From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 17:09:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB280106578C; Thu, 23 Aug 2012 17:09:59 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36AC38FC1B; Thu, 23 Aug 2012 17:09:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NH9xeO063498; Thu, 23 Aug 2012 17:09:59 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NH9xg5063496; Thu, 23 Aug 2012 17:09:59 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208231709.q7NH9xg5063496@svn.freebsd.org> From: Bernhard Schmidt Date: Thu, 23 Aug 2012 17:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239616 - stable/8/sys/net80211 X-BeenThere: svn-src-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, 23 Aug 2012 17:10:00 -0000 Author: bschmidt Date: Thu Aug 23 17:09:58 2012 New Revision: 239616 URL: http://svn.freebsd.org/changeset/base/239616 Log: MFC r231187: Update the 802.11s IE numbers to represent the latest 802.11 amendment standard. This update breaks compatibility with older mesh setups but is necessary as the previous IDs are used by another amendment leading to unexpected results when trying to associate with an accesspoint using the affected IDs. Discussed with: re Tested by: honestqiao at gmail dot com Modified: stable/8/sys/net80211/ieee80211.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net80211/ieee80211.h ============================================================================== --- stable/8/sys/net80211/ieee80211.h Thu Aug 23 17:09:52 2012 (r239615) +++ stable/8/sys/net80211/ieee80211.h Thu Aug 23 17:09:58 2012 (r239616) @@ -708,27 +708,32 @@ enum { IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ /* - * 802.11s IEs based on D3.03 spec and were not assigned by - * ANA. Beware changing them because some of them are being - * kept compatible with Linux. + * 802.11s IEs + * NB: On vanilla Linux still IEEE80211_ELEMID_MESHPEER = 55, + * but they defined a new with id 117 called PEER_MGMT. + * NB: complies with open80211 */ - IEEE80211_ELEMID_MESHCONF = 51, - IEEE80211_ELEMID_MESHID = 52, - IEEE80211_ELEMID_MESHLINK = 35, - IEEE80211_ELEMID_MESHCNGST = 36, - IEEE80211_ELEMID_MESHPEER = 55, - IEEE80211_ELEMID_MESHCSA = 38, - IEEE80211_ELEMID_MESHTIM = 39, - IEEE80211_ELEMID_MESHAWAKEW = 40, - IEEE80211_ELEMID_MESHBEACONT = 41, - IEEE80211_ELEMID_MESHPANN = 48, - IEEE80211_ELEMID_MESHRANN = 49, - IEEE80211_ELEMID_MESHPREQ = 68, - IEEE80211_ELEMID_MESHPREP = 69, - IEEE80211_ELEMID_MESHPERR = 70, - IEEE80211_ELEMID_MESHPXU = 53, - IEEE80211_ELEMID_MESHPXUC = 54, - IEEE80211_ELEMID_MESHAH = 60, /* Abbreviated Handshake */ + IEEE80211_ELEMID_MESHCONF = 113, + IEEE80211_ELEMID_MESHID = 114, + IEEE80211_ELEMID_MESHLINK = 115, + IEEE80211_ELEMID_MESHCNGST = 116, + IEEE80211_ELEMID_MESHPEER = 117, + IEEE80211_ELEMID_MESHCSA = 118, + IEEE80211_ELEMID_MESHTIM = 39, /* XXX: remove */ + IEEE80211_ELEMID_MESHAWAKEW = 119, + IEEE80211_ELEMID_MESHBEACONT = 120, + /* 121-124 MMCAOP not implemented yet */ + IEEE80211_ELEMID_MESHPANN = 125, /* XXX: is GANN now, not used */ + IEEE80211_ELEMID_MESHRANN = 126, + /* 127 Extended Capabilities */ + /* 128-129 reserved */ + IEEE80211_ELEMID_MESHPREQ = 130, + IEEE80211_ELEMID_MESHPREP = 131, + IEEE80211_ELEMID_MESHPERR = 132, + /* 133-136 reserved */ + IEEE80211_ELEMID_MESHPXU = 137, + IEEE80211_ELEMID_MESHPXUC = 138, + IEEE80211_ELEMID_MESHAH = 60, /* XXX: remove */ }; struct ieee80211_tim_ie { From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 17:40:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8EA761065689; Thu, 23 Aug 2012 17:40:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FAFE8FC16; Thu, 23 Aug 2012 17:40:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NHeLm9067537; Thu, 23 Aug 2012 17:40:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NHeLsE067532; Thu, 23 Aug 2012 17:40:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208231740.q7NHeLsE067532@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 23 Aug 2012 17:40: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: r239617 - head/sys/dev/usb/controller 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, 23 Aug 2012 17:40:21 -0000 Author: hselasky Date: Thu Aug 23 17:40:20 2012 New Revision: 239617 URL: http://svn.freebsd.org/changeset/base/239617 Log: Add tunable for XHCI port routing. MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Thu Aug 23 17:09:58 2012 (r239616) +++ head/sys/dev/usb/controller/xhci.c Thu Aug 23 17:40:20 2012 (r239617) @@ -84,14 +84,17 @@ __FBSDID("$FreeBSD$"); ((uint8_t *)&(((struct xhci_softc *)0)->sc_bus)))) #ifdef USB_DEBUG -static int xhcidebug = 0; +static int xhcidebug; +static int xhciroute; static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, &xhcidebug, 0, "Debug level"); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW, + &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); - +TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); #endif #define XHCI_INTR_ENDPT 1 @@ -177,6 +180,16 @@ xhci_dump_device(struct xhci_softc *sc, } #endif +uint32_t +xhci_get_port_route(void) +{ +#ifdef USB_DEBUG + return (0xFFFFFFFFU ^ ((uint32_t)xhciroute)); +#else + return (0xFFFFFFFFU); +#endif +} + static void xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) { Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Thu Aug 23 17:09:58 2012 (r239616) +++ head/sys/dev/usb/controller/xhci.h Thu Aug 23 17:40:20 2012 (r239617) @@ -499,6 +499,7 @@ struct xhci_softc { /* prototypes */ +uint32_t xhci_get_port_route(void); usb_error_t xhci_halt_controller(struct xhci_softc *); usb_error_t xhci_init(struct xhci_softc *, device_t); usb_error_t xhci_start_controller(struct xhci_softc *); Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Thu Aug 23 17:09:58 2012 (r239616) +++ head/sys/dev/usb/controller/xhci_pci.c Thu Aug 23 17:40:20 2012 (r239617) @@ -292,9 +292,9 @@ xhci_pci_take_controller(device_t self) /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ if (device_id == 0x1e318086 /* Panther Point */ || device_id == 0x8c318086 /* Lynx Point */) { - pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 0xffffffff, 4); - pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, 0xffffffff, 4); + uint32_t temp = xhci_get_port_route(); + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); } - return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 17:42:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67E2D1065673; Thu, 23 Aug 2012 17:42:48 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id 584C48FC18; Thu, 23 Aug 2012 17:42:46 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 144299957; Thu, 23 Aug 2012 19:42:40 +0200 From: Hans Petter Selasky To: Ian Lepore Date: Thu, 23 Aug 2012 19:43:29 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <1345496977.27688.332.camel@revolution.hippie.lan> In-Reply-To: <1345496977.27688.332.camel@revolution.hippie.lan> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201208231943.29308.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Andrew Turner Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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, 23 Aug 2012 17:42:48 -0000 On Monday 20 August 2012 23:09:37 Ian Lepore wrote: > On Mon, 2012-08-20 at 13:55 -0700, Adrian Chadd wrote: > > I have a report that AR71XX (MIPS) USB broke with this change. > > > > Thanks, > > > > > > Adrian > Hi Ian, Have you figured out the root cause for this? --HPS From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 17:58:23 2012 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 80420106566B; Thu, 23 Aug 2012 17:58:23 +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 6BBE28FC0A; Thu, 23 Aug 2012 17:58:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NHwN3u069914; Thu, 23 Aug 2012 17:58:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NHwNk8069911; Thu, 23 Aug 2012 17:58:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208231758.q7NHwNk8069911@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Aug 2012 17:58: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: r239618 - in head/contrib/jemalloc: . include/jemalloc 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, 23 Aug 2012 17:58:23 -0000 Author: dim Date: Thu Aug 23 17:58:22 2012 New Revision: 239618 URL: http://svn.freebsd.org/changeset/base/239618 Log: Since our clang now supports the tls_model attribute, remove the workaround for it in jemalloc_FreeBSD.h. Reviewed by: jasone Modified: head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Thu Aug 23 17:40:20 2012 (r239617) +++ head/contrib/jemalloc/FREEBSD-diffs Thu Aug 23 17:58:22 2012 (r239618) @@ -125,7 +125,7 @@ new file mode 100644 index 0000000..9efab93 --- /dev/null +++ b/include/jemalloc/jemalloc_FreeBSD.h -@@ -0,0 +1,80 @@ +@@ -0,0 +1,76 @@ +/* + * Override settings that were generated in jemalloc_defs.h as necessary. + */ @@ -184,10 +184,6 @@ index 0000000..9efab93 +#ifndef JEMALLOC_TLS_MODEL +# define JEMALLOC_TLS_MODEL /* Default. */ +#endif -+#ifdef __clang__ -+# undef JEMALLOC_TLS_MODEL -+# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ -+#endif + +#define STATIC_PAGE_SHIFT PAGE_SHIFT +#define LG_SIZEOF_INT 2 Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Aug 23 17:40:20 2012 (r239617) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Aug 23 17:58:22 2012 (r239618) @@ -56,10 +56,6 @@ #ifndef JEMALLOC_TLS_MODEL # define JEMALLOC_TLS_MODEL /* Default. */ #endif -#ifdef __clang__ -# undef JEMALLOC_TLS_MODEL -# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ -#endif #define STATIC_PAGE_SHIFT PAGE_SHIFT #define LG_SIZEOF_INT 2 From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 18:15:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36852106566C; Thu, 23 Aug 2012 18:15:00 +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 217288FC12; Thu, 23 Aug 2012 18:15:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NIExoW072117; Thu, 23 Aug 2012 18:14:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NIEx4h072114; Thu, 23 Aug 2012 18:14:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208231814.q7NIEx4h072114@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Aug 2012 18:14: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: r239619 - head/contrib/llvm/tools/clang/lib/Sema 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, 23 Aug 2012 18:15:00 -0000 Author: dim Date: Thu Aug 23 18:14:59 2012 New Revision: 239619 URL: http://svn.freebsd.org/changeset/base/239619 Log: Pull in r162360 from upstream clang trunk: Merge existing attributes before processing pragmas in friend template declarations. Fixes pr13662. This should help when building Firefox with libc++. Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp Thu Aug 23 17:58:22 2012 (r239618) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp Thu Aug 23 18:14:59 2012 (r239619) @@ -1104,6 +1104,9 @@ Sema::CheckClassTemplate(Scope *S, unsig if (Attr) ProcessDeclAttributeList(S, NewClass, Attr); + if (PrevClassTemplate) + mergeDeclAttributes(NewClass, PrevClassTemplate->getTemplatedDecl()); + AddPushedVisibilityAttribute(NewClass); if (TUK != TUK_Friend) @@ -1138,8 +1141,6 @@ Sema::CheckClassTemplate(Scope *S, unsig NewTemplate->setInvalidDecl(); NewClass->setInvalidDecl(); } - if (PrevClassTemplate) - mergeDeclAttributes(NewClass, PrevClassTemplate->getTemplatedDecl()); ActOnDocumentableDecl(NewTemplate); From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 19:32:58 2012 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 5EE2D106566C; Thu, 23 Aug 2012 19:32: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 4665F8FC0C; Thu, 23 Aug 2012 19:32:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NJWwFe082178; Thu, 23 Aug 2012 19:32:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NJWv2S082159; Thu, 23 Aug 2012 19:32:57 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208231932.q7NJWv2S082159@svn.freebsd.org> From: Martin Matuska Date: Thu, 23 Aug 2012 19:32: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: r239620 - in head: cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/f... 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, 23 Aug 2012 19:32:58 -0000 Author: mm Date: Thu Aug 23 19:32:57 2012 New Revision: 239620 URL: http://svn.freebsd.org/changeset/base/239620 Log: Merge recent vendor changes: 3086 unnecessarily setting DS_FLAG_INCONSISTENT on async destroyed datasets 3090 vdev_reopen() during reguid causes vdev to be treated as corrupt 3102 vdev_uberblock_load() and vdev_validate() may read the wrong label Referenes: https://www.illumos.org/issues/3086 https://www.illumos.org/issues/3090 https://www.illumos.org/issues/3102 PR: kern/170912, kern/170914 Obtained from: illumos (changeset #13776, #13777) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Aug 23 19:32:57 2012 (r239620) @@ -364,7 +364,7 @@ ztest_info_t ztest_info[] = { { ztest_spa_rename, 1, &zopt_rarely }, { ztest_scrub, 1, &zopt_rarely }, { ztest_dsl_dataset_promote_busy, 1, &zopt_rarely }, - { ztest_vdev_attach_detach, 1, &zopt_rarely }, + { ztest_vdev_attach_detach, 1, &zopt_rarely }, { ztest_vdev_LUN_growth, 1, &zopt_rarely }, { ztest_vdev_add_remove, 1, &ztest_opts.zo_vdevtime }, @@ -415,6 +415,13 @@ static spa_t *ztest_spa = NULL; static ztest_ds_t *ztest_ds; static mutex_t ztest_vdev_lock; + +/* + * The ztest_name_lock protects the pool and dataset namespace used by + * the individual tests. To modify the namespace, consumers must grab + * this lock as writer. Grabbing the lock as reader will ensure that the + * namespace does not change while the lock is held. + */ static rwlock_t ztest_name_lock; static boolean_t ztest_dump_core = B_TRUE; @@ -2225,6 +2232,7 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 { objset_t *os = zd->zd_os; + VERIFY(mutex_lock(&zd->zd_dirobj_lock) == 0); (void) rw_wrlock(&zd->zd_zilog_lock); /* zfsvfs_teardown() */ @@ -2235,6 +2243,7 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 zil_replay(os, zd, ztest_replay_vector); (void) rw_unlock(&zd->zd_zilog_lock); + VERIFY(mutex_unlock(&zd->zd_dirobj_lock) == 0); } /* @@ -4860,10 +4869,16 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id { spa_t *spa = ztest_spa; uint64_t orig, load; + int error; orig = spa_guid(spa); load = spa_load_guid(spa); - if (spa_change_guid(spa) != 0) + + (void) rw_wrlock(&ztest_name_lock); + error = spa_change_guid(spa); + (void) rw_unlock(&ztest_name_lock); + + if (error != 0) return; if (ztest_opts.zo_verbose >= 3) { @@ -5540,8 +5555,15 @@ ztest_freeze(void) */ kernel_init(FREAD | FWRITE); VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG)); + ASSERT(spa_freeze_txg(spa) == UINT64_MAX); VERIFY3U(0, ==, ztest_dataset_open(0)); ztest_dataset_close(0); + + spa->spa_debug = B_TRUE; + ztest_spa = spa; + txg_wait_synced(spa_get_dsl(spa), 0); + ztest_reguid(NULL, 0); + spa_close(spa, FTAG); kernel_fini(); } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Aug 23 19:32:57 2012 (r239620) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -437,8 +437,8 @@ get_configs(libzfs_handle_t *hdl, pool_l uint_t i, nspares, nl2cache; boolean_t config_seen; uint64_t best_txg; - char *name, *hostname, *comment; - uint64_t version, guid; + char *name, *hostname; + uint64_t guid; uint_t children = 0; nvlist_t **child = NULL; uint_t holes; @@ -524,61 +524,54 @@ get_configs(libzfs_handle_t *hdl, pool_l * configuration: * * version - * pool guid - * name + * pool guid + * name + * pool txg (if available) * comment (if available) - * pool state + * pool state * hostid (if available) * hostname (if available) */ - uint64_t state; + uint64_t state, version, pool_txg; + char *comment = NULL; - verify(nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_VERSION, &version) == 0); - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_VERSION, version) != 0) - goto nomem; - verify(nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_POOL_GUID, &guid) == 0); - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_POOL_GUID, guid) != 0) - goto nomem; - verify(nvlist_lookup_string(tmp, - ZPOOL_CONFIG_POOL_NAME, &name) == 0); - if (nvlist_add_string(config, - ZPOOL_CONFIG_POOL_NAME, name) != 0) - goto nomem; + version = fnvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_VERSION); + fnvlist_add_uint64(config, + ZPOOL_CONFIG_VERSION, version); + guid = fnvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_POOL_GUID); + fnvlist_add_uint64(config, + ZPOOL_CONFIG_POOL_GUID, guid); + name = fnvlist_lookup_string(tmp, + ZPOOL_CONFIG_POOL_NAME); + fnvlist_add_string(config, + ZPOOL_CONFIG_POOL_NAME, name); - /* - * COMMENT is optional, don't bail if it's not - * there, instead, set it to NULL. - */ - if (nvlist_lookup_string(tmp, - ZPOOL_CONFIG_COMMENT, &comment) != 0) - comment = NULL; - else if (nvlist_add_string(config, - ZPOOL_CONFIG_COMMENT, comment) != 0) - goto nomem; + if (nvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_POOL_TXG, &pool_txg) == 0) + fnvlist_add_uint64(config, + ZPOOL_CONFIG_POOL_TXG, pool_txg); - verify(nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_POOL_STATE, &state) == 0); - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_POOL_STATE, state) != 0) - goto nomem; + if (nvlist_lookup_string(tmp, + ZPOOL_CONFIG_COMMENT, &comment) == 0) + fnvlist_add_string(config, + ZPOOL_CONFIG_COMMENT, comment); + + state = fnvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_POOL_STATE); + fnvlist_add_uint64(config, + ZPOOL_CONFIG_POOL_STATE, state); hostid = 0; if (nvlist_lookup_uint64(tmp, ZPOOL_CONFIG_HOSTID, &hostid) == 0) { - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_HOSTID, hostid) != 0) - goto nomem; - verify(nvlist_lookup_string(tmp, - ZPOOL_CONFIG_HOSTNAME, - &hostname) == 0); - if (nvlist_add_string(config, - ZPOOL_CONFIG_HOSTNAME, - hostname) != 0) - goto nomem; + fnvlist_add_uint64(config, + ZPOOL_CONFIG_HOSTID, hostid); + hostname = fnvlist_lookup_string(tmp, + ZPOOL_CONFIG_HOSTNAME); + fnvlist_add_string(config, + ZPOOL_CONFIG_HOSTNAME, hostname); } config_seen = B_TRUE; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Aug 23 19:32:57 2012 (r239620) @@ -1769,15 +1769,15 @@ dmu_init(void) dnode_init(); dbuf_init(); zfetch_init(); - arc_init(); l2arc_init(); + arc_init(); } void dmu_fini(void) { - l2arc_fini(); arc_fini(); + l2arc_fini(); zfetch_fini(); dbuf_fini(); dnode_fini(); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Aug 23 19:32:57 2012 (r239620) @@ -1649,13 +1649,6 @@ dmu_recv_existing_end(dmu_recv_cookie_t dsl_dataset_t *ds = drc->drc_logical_ds; int err, myerr; - /* - * XXX hack; seems the ds is still dirty and dsl_pool_zil_clean() - * expects it to have a ds_user_ptr (and zil), but clone_swap() - * can close it. - */ - txg_wait_synced(ds->ds_dir->dd_pool, 0); - if (dsl_dataset_tryown(ds, FALSE, dmu_recv_tag)) { err = dsl_dataset_clone_swap(drc->drc_real_ds, ds, drc->drc_force); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Aug 23 19:32:57 2012 (r239620) @@ -106,14 +106,8 @@ dsl_dataset_block_born(dsl_dataset_t *ds ASSERT(BP_GET_TYPE(bp) != DMU_OT_NONE); ASSERT(DMU_OT_IS_VALID(BP_GET_TYPE(bp))); if (ds == NULL) { - /* - * Account for the meta-objset space in its placeholder - * dsl_dir. - */ - ASSERT3U(compressed, ==, uncompressed); /* it's all metadata */ - dsl_dir_diduse_space(tx->tx_pool->dp_mos_dir, DD_USED_HEAD, - used, compressed, uncompressed, tx); - dsl_dir_dirty(tx->tx_pool->dp_mos_dir, tx); + dsl_pool_mos_diduse_space(tx->tx_pool, + used, compressed, uncompressed); return; } dmu_buf_will_dirty(ds->ds_dbuf, tx); @@ -149,15 +143,9 @@ dsl_dataset_block_kill(dsl_dataset_t *ds ASSERT(used > 0); if (ds == NULL) { - /* - * Account for the meta-objset space in its placeholder - * dataset. - */ dsl_free(tx->tx_pool, tx->tx_txg, bp); - - dsl_dir_diduse_space(tx->tx_pool->dp_mos_dir, DD_USED_HEAD, - -used, -compressed, -uncompressed, tx); - dsl_dir_dirty(tx->tx_pool->dp_mos_dir, tx); + dsl_pool_mos_diduse_space(tx->tx_pool, + -used, -compressed, -uncompressed); return (used); } ASSERT3P(tx->tx_pool, ==, ds->ds_dir->dd_pool); @@ -1116,26 +1104,26 @@ dsl_dataset_destroy(dsl_dataset_t *ds, v dummy_ds.ds_dir = dd; dummy_ds.ds_object = ds->ds_object; - /* - * Check for errors and mark this ds as inconsistent, in - * case we crash while freeing the objects. - */ - err = dsl_sync_task_do(dd->dd_pool, dsl_dataset_destroy_begin_check, - dsl_dataset_destroy_begin_sync, ds, NULL, 0); - if (err) - goto out; - - err = dmu_objset_from_ds(ds, &os); - if (err) - goto out; - - /* - * If async destruction is not enabled try to remove all objects - * while in the open context so that there is less work to do in - * the syncing context. - */ if (!spa_feature_is_enabled(dsl_dataset_get_spa(ds), &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + /* + * Check for errors and mark this ds as inconsistent, in + * case we crash while freeing the objects. + */ + err = dsl_sync_task_do(dd->dd_pool, + dsl_dataset_destroy_begin_check, + dsl_dataset_destroy_begin_sync, ds, NULL, 0); + if (err) + goto out; + + err = dmu_objset_from_ds(ds, &os); + if (err) + goto out; + + /* + * Remove all objects while in the open context so that + * there is less work to do in the syncing context. + */ for (obj = 0; err == 0; err = dmu_object_next(os, &obj, FALSE, ds->ds_phys->ds_prev_snap_txg)) { /* @@ -1146,30 +1134,25 @@ dsl_dataset_destroy(dsl_dataset_t *ds, v } if (err != ESRCH) goto out; - } - /* - * Only the ZIL knows how to free log blocks. - */ - zil_destroy(dmu_objset_zil(os), B_FALSE); - - /* - * Sync out all in-flight IO. - */ - txg_wait_synced(dd->dd_pool, 0); - - /* - * If we managed to free all the objects in open - * context, the user space accounting should be zero. - */ - if (ds->ds_phys->ds_bp.blk_fill == 0 && - dmu_objset_userused_enabled(os)) { - uint64_t count; + /* + * Sync out all in-flight IO. + */ + txg_wait_synced(dd->dd_pool, 0); - ASSERT(zap_count(os, DMU_USERUSED_OBJECT, &count) != 0 || - count == 0); - ASSERT(zap_count(os, DMU_GROUPUSED_OBJECT, &count) != 0 || - count == 0); + /* + * If we managed to free all the objects in open + * context, the user space accounting should be zero. + */ + if (ds->ds_phys->ds_bp.blk_fill == 0 && + dmu_objset_userused_enabled(os)) { + uint64_t count; + + ASSERT(zap_count(os, DMU_USERUSED_OBJECT, + &count) != 0 || count == 0); + ASSERT(zap_count(os, DMU_GROUPUSED_OBJECT, + &count) != 0 || count == 0); + } } rw_enter(&dd->dd_pool->dp_config_rwlock, RW_READER); @@ -1906,6 +1889,7 @@ dsl_dataset_destroy_sync(void *arg1, voi } else { zfeature_info_t *async_destroy = &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]; + objset_t *os; /* * There's no next snapshot, so this is a head dataset. @@ -1917,6 +1901,8 @@ dsl_dataset_destroy_sync(void *arg1, voi dsl_deadlist_free(mos, ds->ds_phys->ds_deadlist_obj, tx); ds->ds_phys->ds_deadlist_obj = 0; + VERIFY3U(0, ==, dmu_objset_from_ds(ds, &os)); + if (!spa_feature_is_enabled(dp->dp_spa, async_destroy)) { err = old_synchronous_dataset_destroy(ds, tx); } else { @@ -1926,12 +1912,12 @@ dsl_dataset_destroy_sync(void *arg1, voi */ uint64_t used, comp, uncomp; - ASSERT(err == 0 || err == EBUSY); + zil_destroy_sync(dmu_objset_zil(os), tx); + if (!spa_feature_is_active(dp->dp_spa, async_destroy)) { spa_feature_incr(dp->dp_spa, async_destroy, tx); - dp->dp_bptree_obj = bptree_alloc( - dp->dp_meta_objset, tx); - VERIFY(zap_add(dp->dp_meta_objset, + dp->dp_bptree_obj = bptree_alloc(mos, tx); + VERIFY(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1, &dp->dp_bptree_obj, tx) == 0); @@ -1944,7 +1930,7 @@ dsl_dataset_destroy_sync(void *arg1, voi ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) || ds->ds_phys->ds_unique_bytes == used); - bptree_add(dp->dp_meta_objset, dp->dp_bptree_obj, + bptree_add(mos, dp->dp_bptree_obj, &ds->ds_phys->ds_bp, ds->ds_phys->ds_prev_snap_txg, used, comp, uncomp, tx); dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, @@ -2233,7 +2219,6 @@ dsl_dataset_sync(dsl_dataset_t *ds, zio_ dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_phys->ds_fsid_guid = ds->ds_fsid_guid; - dsl_dir_dirty(ds->ds_dir, tx); dmu_objset_sync(ds->ds_objset, zio, tx); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Thu Aug 23 19:32:57 2012 (r239620) @@ -195,7 +195,6 @@ errout: kmem_free(dd, sizeof (dsl_dir_t)); dmu_buf_rele(dbuf, tag); return (err); - } void @@ -229,7 +228,7 @@ dsl_dir_name(dsl_dir_t *dd, char *buf) } } -/* Calculate name legnth, avoiding all the strcat calls of dsl_dir_name */ +/* Calculate name length, avoiding all the strcat calls of dsl_dir_name */ int dsl_dir_namelen(dsl_dir_t *dd) { @@ -593,8 +592,6 @@ dsl_dir_sync(dsl_dir_t *dd, dmu_tx_t *tx { ASSERT(dmu_tx_is_syncing(tx)); - dmu_buf_will_dirty(dd->dd_dbuf, tx); - mutex_enter(&dd->dd_lock); ASSERT3U(dd->dd_tempreserved[tx->tx_txg&TXG_MASK], ==, 0); dprintf_dd(dd, "txg=%llu towrite=%lluK\n", tx->tx_txg, @@ -951,8 +948,6 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u ASSERT(dmu_tx_is_syncing(tx)); ASSERT(type < DD_USED_NUM); - dsl_dir_dirty(dd, tx); - if (needlock) mutex_enter(&dd->dd_lock); accounted_delta = parent_delta(dd, dd->dd_phys->dd_used_bytes, used); @@ -961,6 +956,7 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u dd->dd_phys->dd_compressed_bytes >= -compressed); ASSERT(uncompressed >= 0 || dd->dd_phys->dd_uncompressed_bytes >= -uncompressed); + dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_bytes += used; dd->dd_phys->dd_uncompressed_bytes += uncompressed; dd->dd_phys->dd_compressed_bytes += compressed; @@ -1002,13 +998,13 @@ dsl_dir_transfer_space(dsl_dir_t *dd, in if (delta == 0 || !(dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN)) return; - dsl_dir_dirty(dd, tx); if (needlock) mutex_enter(&dd->dd_lock); ASSERT(delta > 0 ? dd->dd_phys->dd_used_breakdown[oldtype] >= delta : dd->dd_phys->dd_used_breakdown[newtype] >= -delta); ASSERT(dd->dd_phys->dd_used_bytes >= ABS(delta)); + dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_breakdown[oldtype] -= delta; dd->dd_phys->dd_used_breakdown[newtype] += delta; if (needlock) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Thu Aug 23 19:32:57 2012 (r239620) @@ -42,6 +42,7 @@ #include #include #include +#include int zfs_no_write_throttle = 0; int zfs_write_limit_shift = 3; /* 1/8th of physical memory */ @@ -111,12 +112,12 @@ dsl_pool_open_impl(spa_t *spa, uint64_t txg_list_create(&dp->dp_dirty_datasets, offsetof(dsl_dataset_t, ds_dirty_link)); + txg_list_create(&dp->dp_dirty_zilogs, + offsetof(zilog_t, zl_dirty_link)); txg_list_create(&dp->dp_dirty_dirs, offsetof(dsl_dir_t, dd_dirty_link)); txg_list_create(&dp->dp_sync_tasks, offsetof(dsl_sync_task_group_t, dstg_node)); - list_create(&dp->dp_synced_datasets, sizeof (dsl_dataset_t), - offsetof(dsl_dataset_t, ds_synced_link)); mutex_init(&dp->dp_lock, NULL, MUTEX_DEFAULT, NULL); @@ -249,9 +250,9 @@ dsl_pool_close(dsl_pool_t *dp) dmu_objset_evict(dp->dp_meta_objset); txg_list_destroy(&dp->dp_dirty_datasets); + txg_list_destroy(&dp->dp_dirty_zilogs); txg_list_destroy(&dp->dp_sync_tasks); txg_list_destroy(&dp->dp_dirty_dirs); - list_destroy(&dp->dp_synced_datasets); arc_flush(dp->dp_spa); txg_fini(dp); @@ -331,6 +332,21 @@ dsl_pool_create(spa_t *spa, nvlist_t *zp return (dp); } +/* + * Account for the meta-objset space in its placeholder dsl_dir. + */ +void +dsl_pool_mos_diduse_space(dsl_pool_t *dp, + int64_t used, int64_t comp, int64_t uncomp) +{ + ASSERT3U(comp, ==, uncomp); /* it's all metadata */ + mutex_enter(&dp->dp_lock); + dp->dp_mos_used_delta += used; + dp->dp_mos_compressed_delta += comp; + dp->dp_mos_uncompressed_delta += uncomp; + mutex_exit(&dp->dp_lock); +} + static int deadlist_enqueue_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { @@ -349,11 +365,14 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t dmu_tx_t *tx; dsl_dir_t *dd; dsl_dataset_t *ds; - dsl_sync_task_group_t *dstg; objset_t *mos = dp->dp_meta_objset; hrtime_t start, write_time; uint64_t data_written; int err; + list_t synced_datasets; + + list_create(&synced_datasets, sizeof (dsl_dataset_t), + offsetof(dsl_dataset_t, ds_synced_link)); /* * We need to copy dp_space_towrite() before doing @@ -376,7 +395,7 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t * may sync newly-created datasets on pass 2. */ ASSERT(!list_link_active(&ds->ds_synced_link)); - list_insert_tail(&dp->dp_synced_datasets, ds); + list_insert_tail(&synced_datasets, ds); dsl_dataset_sync(ds, zio, tx); } DTRACE_PROBE(pool_sync__1setup); @@ -386,15 +405,20 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t ASSERT(err == 0); DTRACE_PROBE(pool_sync__2rootzio); - for (ds = list_head(&dp->dp_synced_datasets); ds; - ds = list_next(&dp->dp_synced_datasets, ds)) + /* + * After the data blocks have been written (ensured by the zio_wait() + * above), update the user/group space accounting. + */ + for (ds = list_head(&synced_datasets); ds; + ds = list_next(&synced_datasets, ds)) dmu_objset_do_userquota_updates(ds->ds_objset, tx); /* * Sync the datasets again to push out the changes due to * userspace updates. This must be done before we process the - * sync tasks, because that could cause a snapshot of a dataset - * whose ds_bp will be rewritten when we do this 2nd sync. + * sync tasks, so that any snapshots will have the correct + * user accounting information (and we won't get confused + * about which blocks are part of the snapshot). */ zio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); while (ds = txg_list_remove(&dp->dp_dirty_datasets, txg)) { @@ -405,30 +429,42 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t err = zio_wait(zio); /* - * Move dead blocks from the pending deadlist to the on-disk - * deadlist. + * Now that the datasets have been completely synced, we can + * clean up our in-memory structures accumulated while syncing: + * + * - move dead blocks from the pending deadlist to the on-disk deadlist + * - clean up zil records + * - release hold from dsl_dataset_dirty() */ - for (ds = list_head(&dp->dp_synced_datasets); ds; - ds = list_next(&dp->dp_synced_datasets, ds)) { + while (ds = list_remove_head(&synced_datasets)) { + objset_t *os = ds->ds_objset; bplist_iterate(&ds->ds_pending_deadlist, deadlist_enqueue_cb, &ds->ds_deadlist, tx); + ASSERT(!dmu_objset_is_dirty(os, txg)); + dmu_buf_rele(ds->ds_dbuf, ds); } - while (dstg = txg_list_remove(&dp->dp_sync_tasks, txg)) { - /* - * No more sync tasks should have been added while we - * were syncing. - */ - ASSERT(spa_sync_pass(dp->dp_spa) == 1); - dsl_sync_task_group_sync(dstg, tx); - } - DTRACE_PROBE(pool_sync__3task); - start = gethrtime(); while (dd = txg_list_remove(&dp->dp_dirty_dirs, txg)) dsl_dir_sync(dd, tx); write_time += gethrtime() - start; + /* + * The MOS's space is accounted for in the pool/$MOS + * (dp_mos_dir). We can't modify the mos while we're syncing + * it, so we remember the deltas and apply them here. + */ + if (dp->dp_mos_used_delta != 0 || dp->dp_mos_compressed_delta != 0 || + dp->dp_mos_uncompressed_delta != 0) { + dsl_dir_diduse_space(dp->dp_mos_dir, DD_USED_HEAD, + dp->dp_mos_used_delta, + dp->dp_mos_compressed_delta, + dp->dp_mos_uncompressed_delta, tx); + dp->dp_mos_used_delta = 0; + dp->dp_mos_compressed_delta = 0; + dp->dp_mos_uncompressed_delta = 0; + } + start = gethrtime(); if (list_head(&mos->os_dirty_dnodes[txg & TXG_MASK]) != NULL || list_head(&mos->os_free_dnodes[txg & TXG_MASK]) != NULL) { @@ -444,6 +480,27 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t hrtime_t, dp->dp_read_overhead); write_time -= dp->dp_read_overhead; + /* + * If we modify a dataset in the same txg that we want to destroy it, + * its dsl_dir's dd_dbuf will be dirty, and thus have a hold on it. + * dsl_dir_destroy_check() will fail if there are unexpected holds. + * Therefore, we want to sync the MOS (thus syncing the dd_dbuf + * and clearing the hold on it) before we process the sync_tasks. + * The MOS data dirtied by the sync_tasks will be synced on the next + * pass. + */ + DTRACE_PROBE(pool_sync__3task); + if (!txg_list_empty(&dp->dp_sync_tasks, txg)) { + dsl_sync_task_group_t *dstg; + /* + * No more sync tasks should have been added while we + * were syncing. + */ + ASSERT(spa_sync_pass(dp->dp_spa) == 1); + while (dstg = txg_list_remove(&dp->dp_sync_tasks, txg)) + dsl_sync_task_group_sync(dstg, tx); + } + dmu_tx_commit(tx); dp->dp_space_towrite[txg & TXG_MASK] = 0; @@ -492,15 +549,14 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t void dsl_pool_sync_done(dsl_pool_t *dp, uint64_t txg) { + zilog_t *zilog; dsl_dataset_t *ds; - objset_t *os; - while (ds = list_head(&dp->dp_synced_datasets)) { - list_remove(&dp->dp_synced_datasets, ds); - os = ds->ds_objset; - zil_clean(os->os_zil, txg); - ASSERT(!dmu_objset_is_dirty(os, txg)); - dmu_buf_rele(ds->ds_dbuf, ds); + while (zilog = txg_list_remove(&dp->dp_dirty_zilogs, txg)) { + ds = dmu_objset_ds(zilog->zl_os); + zil_clean(zilog, txg); + ASSERT(!dmu_objset_is_dirty(zilog->zl_os, txg)); + dmu_buf_rele(ds->ds_dbuf, zilog); } ASSERT(!dmu_objset_is_dirty(dp->dp_meta_objset, txg)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Aug 23 19:32:57 2012 (r239620) @@ -120,6 +120,8 @@ const zio_taskq_info_t zio_taskqs[ZIO_TY static dsl_syncfunc_t spa_sync_version; static dsl_syncfunc_t spa_sync_props; +static dsl_checkfunc_t spa_change_guid_check; +static dsl_syncfunc_t spa_change_guid_sync; static boolean_t spa_has_active_shared_spare(spa_t *spa); static int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config, spa_load_state_t state, spa_import_type_t type, boolean_t mosconfig, @@ -683,6 +685,56 @@ spa_prop_clear_bootfs(spa_t *spa, uint64 } } +/*ARGSUSED*/ +static int +spa_change_guid_check(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + uint64_t *newguid = arg2; + vdev_t *rvd = spa->spa_root_vdev; + uint64_t vdev_state; + + spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); + vdev_state = rvd->vdev_state; + spa_config_exit(spa, SCL_STATE, FTAG); + + if (vdev_state != VDEV_STATE_HEALTHY) + return (ENXIO); + + ASSERT3U(spa_guid(spa), !=, *newguid); + + return (0); +} + +static void +spa_change_guid_sync(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + uint64_t *newguid = arg2; + uint64_t oldguid; + vdev_t *rvd = spa->spa_root_vdev; + + oldguid = spa_guid(spa); + + spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); + rvd->vdev_guid = *newguid; + rvd->vdev_guid_sum += (*newguid - oldguid); + vdev_config_dirty(rvd); + spa_config_exit(spa, SCL_STATE, FTAG); + +#ifdef __FreeBSD__ + /* + * TODO: until recent illumos logging changes are merged + * log reguid as pool property change + */ + spa_history_log_internal(LOG_POOL_PROPSET, spa, tx, + "guid change old=%llu new=%llu", oldguid, *newguid); +#else + spa_history_log_internal(spa, "guid change", tx, "old=%lld new=%lld", + oldguid, *newguid); +#endif +} + /* * Change the GUID for the pool. This is done so that we can later * re-import a pool built from a clone of our own vdevs. We will modify @@ -695,29 +747,23 @@ spa_prop_clear_bootfs(spa_t *spa, uint64 int spa_change_guid(spa_t *spa) { - uint64_t oldguid, newguid; - uint64_t txg; - - if (!(spa_mode_global & FWRITE)) - return (EROFS); - - txg = spa_vdev_enter(spa); - - if (spa->spa_root_vdev->vdev_state != VDEV_STATE_HEALTHY) - return (spa_vdev_exit(spa, NULL, txg, ENXIO)); + int error; + uint64_t guid; - oldguid = spa_guid(spa); - newguid = spa_generate_guid(NULL); - ASSERT3U(oldguid, !=, newguid); + mutex_enter(&spa_namespace_lock); + guid = spa_generate_guid(NULL); - spa->spa_root_vdev->vdev_guid = newguid; - spa->spa_root_vdev->vdev_guid_sum += (newguid - oldguid); + error = dsl_sync_task_do(spa_get_dsl(spa), spa_change_guid_check, + spa_change_guid_sync, spa, &guid, 5); - vdev_config_dirty(spa->spa_root_vdev); + if (error == 0) { + spa_config_sync(spa, B_FALSE, B_TRUE); + spa_event_notify(spa, NULL, ESC_ZFS_POOL_REGUID); + } - spa_event_notify(spa, NULL, ESC_ZFS_POOL_REGUID); + mutex_exit(&spa_namespace_lock); - return (spa_vdev_exit(spa, NULL, txg, 0)); + return (error); } /* @@ -6107,6 +6153,9 @@ spa_sync(spa_t *spa, uint64_t txg) rvd->vdev_children, txg, B_TRUE); } + if (error == 0) + spa->spa_last_synced_guid = rvd->vdev_guid; + spa_config_exit(spa, SCL_STATE, FTAG); if (error == 0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Aug 23 19:32:57 2012 (r239620) @@ -1352,16 +1352,29 @@ spa_name(spa_t *spa) uint64_t spa_guid(spa_t *spa) { + dsl_pool_t *dp = spa_get_dsl(spa); + uint64_t guid; + /* * If we fail to parse the config during spa_load(), we can go through * the error path (which posts an ereport) and end up here with no root * vdev. We stash the original pool guid in 'spa_config_guid' to handle * this case. */ - if (spa->spa_root_vdev != NULL) + if (spa->spa_root_vdev == NULL) + return (spa->spa_config_guid); + + guid = spa->spa_last_synced_guid != 0 ? + spa->spa_last_synced_guid : spa->spa_root_vdev->vdev_guid; + + /* + * Return the most recently synced out guid unless we're + * in syncing context. + */ + if (dp && dsl_pool_sync_context(dp)) return (spa->spa_root_vdev->vdev_guid); else - return (spa->spa_config_guid); + return (guid); } uint64_t Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Thu Aug 23 19:32:57 2012 (r239620) @@ -82,7 +82,6 @@ typedef struct dsl_pool { /* No lock needed - sync context only */ blkptr_t dp_meta_rootbp; - list_t dp_synced_datasets; hrtime_t dp_read_overhead; uint64_t dp_throughput; /* bytes per millisec */ uint64_t dp_write_limit; @@ -96,10 +95,14 @@ typedef struct dsl_pool { kmutex_t dp_lock; uint64_t dp_space_towrite[TXG_SIZE]; uint64_t dp_tempreserved[TXG_SIZE]; + uint64_t dp_mos_used_delta; + uint64_t dp_mos_compressed_delta; + uint64_t dp_mos_uncompressed_delta; /* Has its own locking */ tx_state_t dp_tx; txg_list_t dp_dirty_datasets; + txg_list_t dp_dirty_zilogs; txg_list_t dp_dirty_dirs; txg_list_t dp_sync_tasks; @@ -139,6 +142,8 @@ int dsl_read_nolock(zio_t *pio, spa_t *s void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx); +void dsl_pool_mos_diduse_space(dsl_pool_t *dp, + int64_t used, int64_t comp, int64_t uncomp); taskq_t *dsl_pool_vnrele_taskq(dsl_pool_t *dp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Thu Aug 23 19:32:57 2012 (r239620) @@ -141,6 +141,7 @@ struct spa { vdev_t *spa_root_vdev; /* top-level vdev container */ uint64_t spa_config_guid; /* config pool guid */ uint64_t spa_load_guid; /* spa_load initialized guid */ + uint64_t spa_last_synced_guid; /* last synced guid */ list_t spa_config_dirty_list; /* vdevs with dirty config */ list_t spa_state_dirty_list; /* vdevs with dirty state */ spa_aux_vdev_t spa_spares; /* hot spares */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h Thu Aug 23 19:32:57 2012 (r239620) @@ -22,6 +22,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #ifndef _SYS_TXG_H #define _SYS_TXG_H @@ -115,7 +118,7 @@ extern boolean_t txg_sync_waiting(struct extern void txg_list_create(txg_list_t *tl, size_t offset); extern void txg_list_destroy(txg_list_t *tl); -extern int txg_list_empty(txg_list_t *tl, uint64_t txg); +extern boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg); extern int txg_list_add(txg_list_t *tl, void *p, uint64_t txg); extern int txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg); extern void *txg_list_remove(txg_list_t *tl, uint64_t txg); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Thu Aug 23 19:32:57 2012 (r239620) @@ -142,7 +142,7 @@ extern nvlist_t *vdev_config_generate(sp struct uberblock; extern uint64_t vdev_label_offset(uint64_t psize, int l, uint64_t offset); extern int vdev_label_number(uint64_t psise, uint64_t offset); -extern nvlist_t *vdev_label_read_config(vdev_t *vd, int label); +extern nvlist_t *vdev_label_read_config(vdev_t *vd, uint64_t txg); extern void vdev_uberblock_load(vdev_t *, struct uberblock *, nvlist_t **); typedef enum { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Thu Aug 23 19:32:57 2012 (r239620) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -395,6 +396,7 @@ extern void zil_replay(objset_t *os, voi zil_replay_func_t *replay_func[TX_MAX_TYPE]); extern boolean_t zil_replaying(zilog_t *zilog, dmu_tx_t *tx); extern void zil_destroy(zilog_t *zilog, boolean_t keep_first); +extern void zil_destroy_sync(zilog_t *zilog, dmu_tx_t *tx); extern void zil_rollback_destroy(zilog_t *zilog, dmu_tx_t *tx); extern itx_t *zil_itx_create(uint64_t txtype, size_t lrsize); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Thu Aug 23 19:32:57 2012 (r239620) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -130,6 +131,7 @@ struct zilog { zil_header_t zl_old_header; /* debugging aid */ uint_t zl_prev_blks[ZIL_PREV_BLKS]; /* size - sector rounded */ uint_t zl_prev_rotor; /* rotor for zl_prev[] */ + txg_node_t zl_dirty_link; /* protected by dp_dirty_zilogs list */ }; typedef struct zil_bp_node { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Thu Aug 23 19:32:57 2012 (r239620) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 Martin Matuska + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -596,7 +597,7 @@ txg_list_destroy(txg_list_t *tl) mutex_destroy(&tl->tl_lock); } -int +boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg) { return (tl->tl_head[txg & TXG_MASK] == NULL); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Aug 23 19:32:57 2012 (r239620) @@ -1328,9 +1328,9 @@ vdev_validate(vdev_t *vd, boolean_t stri if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) { uint64_t aux_guid = 0; nvlist_t *nvl; + uint64_t txg = strict ? spa->spa_config_txg : -1ULL; - if ((label = vdev_label_read_config(vd, VDEV_BEST_LABEL)) == - NULL) { + if ((label = vdev_label_read_config(vd, txg)) == NULL) { vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, VDEV_AUX_BAD_LABEL); return (0); @@ -1512,7 +1512,7 @@ vdev_reopen(vdev_t *vd) !l2arc_vdev_present(vd)) l2arc_add_vdev(spa, vd); } else { - (void) vdev_validate(vd, B_TRUE); + (void) vdev_validate(vd, spa_last_synced_txg(spa)); } /* @@ -1971,7 +1971,7 @@ vdev_validate_aux(vdev_t *vd) if (!vdev_readable(vd)) return (0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 19:39:23 2012 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 B21D9106566C; Thu, 23 Aug 2012 19:39:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D2AC8FC17; Thu, 23 Aug 2012 19:39:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NJdNe2083052; Thu, 23 Aug 2012 19:39:23 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NJdNgl083050; Thu, 23 Aug 2012 19:39:23 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201208231939.q7NJdNgl083050@svn.freebsd.org> From: Jamie Gritton Date: Thu, 23 Aug 2012 19:39: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: r239621 - head/usr.sbin/jail 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, 23 Aug 2012 19:39:23 -0000 Author: jamie Date: Thu Aug 23 19:39:23 2012 New Revision: 239621 URL: http://svn.freebsd.org/changeset/base/239621 Log: Partially roll back r239601 - keep parameter strings both length-delimited and null-terminated at the same time, because they're later passed to libjail as null-terminated. That means I also need to add a nul byte when comma-combining array parameters. MFC after: 6 days Modified: head/usr.sbin/jail/config.c Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Thu Aug 23 19:32:57 2012 (r239620) +++ head/usr.sbin/jail/config.c Thu Aug 23 19:39:23 2012 (r239621) @@ -597,6 +597,7 @@ check_intparams(struct cfjail *j) "ip4.addr: bad netmask \"%s\"", cs); error = -1; } + *cs = '\0'; s->len = cs - s->s; } } @@ -620,6 +621,7 @@ check_intparams(struct cfjail *j) cs); error = -1; } + *cs = '\0'; s->len = cs - s->s; } } @@ -713,11 +715,10 @@ import_params(struct cfjail *j) cs = value; TAILQ_FOREACH_SAFE(s, &p->val, tq, ts) { memcpy(cs, s->s, s->len); - if (ts != NULL) { - cs += s->len + 1; - cs[-1] = ','; - } + cs += s->len + 1; + cs[-1] = ','; } + value[vallen - 1] = '\0'; } if (jailparam_import(jp, value) < 0) { error = -1; From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 19:40:28 2012 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 D022710656D3; Thu, 23 Aug 2012 19:40:28 +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 BADBD8FC0A; Thu, 23 Aug 2012 19:40:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NJeSBO083225; Thu, 23 Aug 2012 19:40:28 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NJeSYi083223; Thu, 23 Aug 2012 19:40:28 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208231940.q7NJeSYi083223@svn.freebsd.org> From: Martin Matuska Date: Thu, 23 Aug 2012 19:40: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: r239622 - head/contrib/libarchive/tar 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, 23 Aug 2012 19:40:29 -0000 Author: mm Date: Thu Aug 23 19:40:28 2012 New Revision: 239622 URL: http://svn.freebsd.org/changeset/base/239622 Log: Apply fix for vendor pull request #17: Support appending to empty archives References: https://github.com/libarchive/libarchive/pull/17 Submitted by: myself Obtained from: libarchive master branch on github Modified: head/contrib/libarchive/tar/write.c Modified: head/contrib/libarchive/tar/write.c ============================================================================== --- head/contrib/libarchive/tar/write.c Thu Aug 23 19:39:23 2012 (r239621) +++ head/contrib/libarchive/tar/write.c Thu Aug 23 19:40:28 2012 (r239622) @@ -235,6 +235,7 @@ tar_mode_r(struct bsdtar *bsdtar) a = archive_read_new(); archive_read_support_filter_all(a); + archive_read_support_format_empty(a); archive_read_support_format_tar(a); archive_read_support_format_gnutar(a); r = archive_read_open_fd(a, bsdtar->fd, 10240); From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 19:46:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id 998B61065672; Thu, 23 Aug 2012 19:46: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 23D88163E52; Thu, 23 Aug 2012 19:43:56 +0000 (UTC) Message-ID: <503687FB.5020301@FreeBSD.org> Date: Thu, 23 Aug 2012 12:43:55 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: obrien@freebsd.org References: <201208221835.q7MIZI77076855@svn.freebsd.org> <50355121.3070408@FreeBSD.org> <20120822222511.GD78670@dragon.NUXI.org> In-Reply-To: <20120822222511.GD78670@dragon.NUXI.org> X-Enigmail-Version: 1.4.3 OpenPGP: id=1A1ABC84 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: r239568 - 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: Thu, 23 Aug 2012 19:46:19 -0000 On 8/22/2012 3:25 PM, David O'Brien wrote: > On Wed, Aug 22, 2012 at 02:37:37PM -0700, Doug Barton wrote: >> Were these changes discussed somewhere and I missed it? > > They were not discussed. I did not see the need. > > This is simple functionality. If securelevel is raised > 0, one > cannot start up a firewall nor make major changes to time. > Thus these components are required to be done before raising securelevel. > > >> I'm not opposed per se, but the security aspects should be discussed on >> freebsd-security@, > > I'm sorry, I didn't feel that ensuring the software follows the > published specification of its functionality to have such a security > aspect. > >> and it's preferable that significant changes to >> rcorder be looked at on freebsd-rc@ as well. > > I don't consider this to be a significant change. > > I do have some significant changes that I do want freebsd-rc@ to > review I will be sending soon. > >> Can you hold off on MFC'ing any of this until it's been reviewed more >> thoroughly? > > Yes. Thanks. Just to reiterate, I'm not saying that either your changes or your methodology were wrong ... I personally would just like a little time to review them before we move forward. Doug -- I am only one, but I am one. I cannot do everything, but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward Everett Hale, (1822 - 1909) From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 21:31:53 2012 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 1F652106564A; Thu, 23 Aug 2012 21:31:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B2348FC0A; Thu, 23 Aug 2012 21:31:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NLVqWx098188; Thu, 23 Aug 2012 21:31:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NLVqm6098185; Thu, 23 Aug 2012 21:31:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208232131.q7NLVqm6098185@svn.freebsd.org> From: Warner Losh Date: Thu, 23 Aug 2012 21:31: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: r239623 - head/sys/arm/at91 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, 23 Aug 2012 21:31:53 -0000 Author: imp Date: Thu Aug 23 21:31:52 2012 New Revision: 239623 URL: http://svn.freebsd.org/changeset/base/239623 Log: Use proper resource type when freeing. Submitted by: Ian Lapore (indirectly in a larger patch) Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Thu Aug 23 19:40:28 2012 (r239622) +++ head/sys/arm/at91/at91_mci.c Thu Aug 23 21:31:52 2012 (r239623) @@ -299,7 +299,7 @@ at91_mci_deactivate(device_t dev) sc->intrhand = 0; bus_generic_detach(sc->dev); if (sc->mem_res) - bus_release_resource(dev, SYS_RES_IOPORT, + bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->mem_res), sc->mem_res); sc->mem_res = 0; if (sc->irq_res) From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 21:32:03 2012 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 6E38110657DF; Thu, 23 Aug 2012 21:32:03 +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 58CAB8FC14; Thu, 23 Aug 2012 21:32:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NLW3pK098255; Thu, 23 Aug 2012 21:32:03 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NLW38a098252; Thu, 23 Aug 2012 21:32:03 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208232132.q7NLW38a098252@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 23 Aug 2012 21:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239624 - 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: Thu, 23 Aug 2012 21:32:03 -0000 Author: np Date: Thu Aug 23 21:32:02 2012 New Revision: 239624 URL: http://svn.freebsd.org/changeset/base/239624 Log: Allow nmbjumbop, nmbjumbo9, and nmbjumbo16 to be set directly via loader tunables. MFC after: 1 month Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Aug 23 21:31:52 2012 (r239623) +++ head/sys/kern/kern_mbuf.c Thu Aug 23 21:32:02 2012 (r239624) @@ -110,14 +110,23 @@ struct mbstat mbstat; static void tunable_mbinit(void *dummy) { - TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); /* This has to be done before VM init. */ + TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); if (nmbclusters == 0) nmbclusters = 1024 + maxusers * 64; - nmbjumbop = nmbclusters / 2; - nmbjumbo9 = nmbjumbop / 2; - nmbjumbo16 = nmbjumbo9 / 2; + + TUNABLE_INT_FETCH("kern.ipc.nmbjumbop", &nmbjumbop); + if (nmbjumbop == 0) + nmbjumbop = nmbclusters / 2; + + TUNABLE_INT_FETCH("kern.ipc.nmbjumbo9", &nmbjumbo9); + if (nmbjumbo9 == 0) + nmbjumbo9 = nmbclusters / 4; + + TUNABLE_INT_FETCH("kern.ipc.nmbjumbo16", &nmbjumbo16); + if (nmbjumbo16 == 0) + nmbjumbo16 = nmbclusters / 8; } SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 21:39:05 2012 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 8C9E7106564A; Thu, 23 Aug 2012 21:39:05 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2763A8FC08; Thu, 23 Aug 2012 21:39:05 +0000 (UTC) Received: by obbun3 with SMTP id un3so3851070obb.13 for ; Thu, 23 Aug 2012 14:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CH90NwQZqvurtqmcK/1Mz/StriwkL49qEk+muU1N6qU=; b=gZ7Nijn8W+gz3K9xADWfUbxw201SgTew4hdVGAwks1U7oPxjPdTJDg5+wPkD1xK0Wh XVSlbpdfP0dNi8q3teZF35Q6Lb1SnohpERHGxvMGx/m7CuH10vCpcSZFibRZeOeK7h2d zCKRZ8q9JA875yP9LUnDCpk1XBIC5wi4K/rMXRjJ1mrdZ8+7XulkP5vgjbaQQHAZG7t8 8wTCDcNTo4K+Q0F6sUhSV9+tJguGnaMgTEqpzcNz+piUSUuqxc8Fbn7D19z5/6rIAKTc qrWSoY/KxOScIyy75P0bCe0LqSOt7UbxnFKbihV1r1Bi+FH3yDsvfzBzrOJcr50IKgG5 rJvA== MIME-Version: 1.0 Received: by 10.182.31.102 with SMTP id z6mr2301848obh.66.1345757944677; Thu, 23 Aug 2012 14:39:04 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Thu, 23 Aug 2012 14:39:04 -0700 (PDT) In-Reply-To: <201208232132.q7NLW38a098252@svn.freebsd.org> References: <201208232132.q7NLW38a098252@svn.freebsd.org> Date: Thu, 23 Aug 2012 14:39:04 -0700 Message-ID: From: Garrett Cooper To: Navdeep Parhar Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239624 - 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: Thu, 23 Aug 2012 21:39:05 -0000 On Thu, Aug 23, 2012 at 2:32 PM, Navdeep Parhar wrote: > Author: np > Date: Thu Aug 23 21:32:02 2012 > New Revision: 239624 > URL: http://svn.freebsd.org/changeset/base/239624 > > Log: > Allow nmbjumbop, nmbjumbo9, and nmbjumbo16 to be set directly via loader > tunables. > > MFC after: 1 month > > Modified: > head/sys/kern/kern_mbuf.c > > Modified: head/sys/kern/kern_mbuf.c Thanks! From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 22:23:57 2012 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 22B51106564A; Thu, 23 Aug 2012 22:23:57 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DF5C8FC08; Thu, 23 Aug 2012 22:23:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NMNuTE005229; Thu, 23 Aug 2012 22:23:56 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NMNuOd005220; Thu, 23 Aug 2012 22:23:56 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201208232223.q7NMNuOd005220@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 23 Aug 2012 22:23: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: r239625 - head/sys/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: Thu, 23 Aug 2012 22:23:57 -0000 Author: ray Date: Thu Aug 23 22:23:56 2012 New Revision: 239625 URL: http://svn.freebsd.org/changeset/base/239625 Log: Remove duplicated GEOM_PART_* options. PR: 170931 Approved by: adrian Modified: head/sys/mips/conf/AP93 head/sys/mips/conf/AP96 head/sys/mips/conf/PB47 head/sys/mips/conf/PB92 head/sys/mips/conf/ROUTERSTATION head/sys/mips/conf/RSPRO head/sys/mips/conf/RSPRO_STANDALONE head/sys/mips/conf/TP-WN1043ND Modified: head/sys/mips/conf/AP93 ============================================================================== --- head/sys/mips/conf/AP93 Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/AP93 Thu Aug 23 22:23:56 2012 (r239625) @@ -108,8 +108,6 @@ options USB_HOST_ALIGN=32 #device da # Read MSDOS formatted disks -options GEOM_PART_BSD -options GEOM_PART_MBR #options MSDOSFS # GPIO Bus Modified: head/sys/mips/conf/AP96 ============================================================================== --- head/sys/mips/conf/AP96 Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/AP96 Thu Aug 23 22:23:56 2012 (r239625) @@ -22,8 +22,6 @@ options AR71XX_REALMEM=64*1024*1024 options AR71XX_ENV_UBOOT # For DOS - enable if required -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # uncompress - to boot read-only lzma natively from flash Modified: head/sys/mips/conf/PB47 ============================================================================== --- head/sys/mips/conf/PB47 Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/PB47 Thu Aug 23 22:23:56 2012 (r239625) @@ -27,8 +27,6 @@ options AR71XX_ENV_UBOOT options AR71XX_REALMEM=64*1024*1024 # For DOS - enable if required -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # uncompress - to boot read-only lzma natively from flash Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/PB92 Thu Aug 23 22:23:56 2012 (r239625) @@ -106,8 +106,6 @@ options USB_HOST_ALIGN=32 #device da # Read MSDOS formatted disks -options GEOM_PART_BSD -options GEOM_PART_MBR # options MSDOSFS # GPIO Bus Modified: head/sys/mips/conf/ROUTERSTATION ============================================================================== --- head/sys/mips/conf/ROUTERSTATION Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/ROUTERSTATION Thu Aug 23 22:23:56 2012 (r239625) @@ -16,8 +16,6 @@ device geom_uzip # compressed in-memory options GEOM_UZIP # For DOS -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # Boot path - redboot MFS Modified: head/sys/mips/conf/RSPRO ============================================================================== --- head/sys/mips/conf/RSPRO Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/RSPRO Thu Aug 23 22:23:56 2012 (r239625) @@ -17,8 +17,6 @@ device geom_uzip # compressed in-memory options GEOM_UZIP # For DOS -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # For etherswitch support Modified: head/sys/mips/conf/RSPRO_STANDALONE ============================================================================== --- head/sys/mips/conf/RSPRO_STANDALONE Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/RSPRO_STANDALONE Thu Aug 23 22:23:56 2012 (r239625) @@ -18,8 +18,6 @@ device geom_uzip # compressed in-memory options GEOM_UZIP # For DOS -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # .. first DOS-partitioned, BSD sliced flash disk Modified: head/sys/mips/conf/TP-WN1043ND ============================================================================== --- head/sys/mips/conf/TP-WN1043ND Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/TP-WN1043ND Thu Aug 23 22:23:56 2012 (r239625) @@ -29,8 +29,6 @@ device rtl8366rb # read MSDOS formatted disks - USB options MSDOSFS -options GEOM_PART_BSD -options GEOM_PART_MBR # Enable the uboot environment stuff rather then the # redboot stuff. From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 22:38:38 2012 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 C9788106583A; Thu, 23 Aug 2012 22:38:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A1F58FC0A; Thu, 23 Aug 2012 22:38:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NMcc42007211; Thu, 23 Aug 2012 22:38:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NMccwx007206; Thu, 23 Aug 2012 22:38:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208232238.q7NMccwx007206@svn.freebsd.org> From: Warner Losh Date: Thu, 23 Aug 2012 22:38: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: r239626 - in head/sys: arm/at91 dev/spibus 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, 23 Aug 2012 22:38:39 -0000 Author: imp Date: Thu Aug 23 22:38:37 2012 New Revision: 239626 URL: http://svn.freebsd.org/changeset/base/239626 Log: Fetch the chip select in the bridge driver, like all the other spi bridges do. Modified: head/sys/arm/at91/at91_spi.c head/sys/dev/spibus/spi.h head/sys/dev/spibus/spibus.c Modified: head/sys/arm/at91/at91_spi.c ============================================================================== --- head/sys/arm/at91/at91_spi.c Thu Aug 23 22:23:56 2012 (r239625) +++ head/sys/arm/at91/at91_spi.c Thu Aug 23 22:38:37 2012 (r239626) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "spibus_if.h" @@ -270,13 +271,16 @@ at91_spi_transfer(device_t dev, device_t { struct at91_spi_softc *sc; bus_addr_t addr; - int err, i, j, mode[4]; + int err, i, j, mode[4], cs; KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, ("%s: TX/RX command sizes should be equal", __func__)); KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, ("%s: TX/RX data sizes should be equal", __func__)); + /* get the proper chip select */ + spibus_get_cs(child, &cs); + sc = device_get_softc(dev); i = 0; @@ -291,9 +295,9 @@ at91_spi_transfer(device_t dev, device_t * PSCDEC = 0 has a range of 0..3 for chip select. We * don't support PSCDEC = 1 which has a range of 0..15. */ - if (cmd->cs < 0 || cmd->cs > 3) { + if (cs < 0 || cs > 3) { device_printf(dev, - "Invalid chip select %d requested by %s\n", cmd->cs, + "Invalid chip select %d requested by %s\n", cs, device_get_nameunit(child)); err = EINVAL; goto out; @@ -304,7 +308,7 @@ at91_spi_transfer(device_t dev, device_t * The AT91RM9200 couldn't do CS high for CS 0. Other chips can, but we * don't support that yet, or other spi modes. */ - if (at91_is_rm92() && cmd->cs == 0 && + if (at91_is_rm92() && cs == 0 && (cmd->flags & SPI_CHIP_SELECT_HIGH) != 0) { device_printf(dev, "Invalid chip select high requested by %s for cs 0.\n", @@ -313,7 +317,7 @@ at91_spi_transfer(device_t dev, device_t goto out; } #endif - err = (RD4(sc, SPI_MR) & ~0x000f0000) | CS_TO_MR(cmd->cs); + err = (RD4(sc, SPI_MR) & ~0x000f0000) | CS_TO_MR(cs); WR4(sc, SPI_MR, err); /* Modified: head/sys/dev/spibus/spi.h ============================================================================== --- head/sys/dev/spibus/spi.h Thu Aug 23 22:23:56 2012 (r239625) +++ head/sys/dev/spibus/spi.h Thu Aug 23 22:38:37 2012 (r239626) @@ -1,7 +1,6 @@ /* $FreeBSD$ */ struct spi_command { - int cs; void *tx_cmd; uint32_t tx_cmd_sz; void *rx_cmd; Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Thu Aug 23 22:23:56 2012 (r239625) +++ head/sys/dev/spibus/spibus.c Thu Aug 23 22:38:37 2012 (r239626) @@ -158,9 +158,6 @@ spibus_hinted_child(device_t bus, const static int spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd) { - /* Maybe set flags too? spi mode? */ - spibus_get_cs(dev, &cmd->cs); - return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd)); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 00:09:50 2012 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 736DB1065672; Fri, 24 Aug 2012 00:09:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45A628FC12; Fri, 24 Aug 2012 00:09:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O09os3021007; Fri, 24 Aug 2012 00:09:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O09o3u021005; Fri, 24 Aug 2012 00:09:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240009.q7O09o3u021005@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:09: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: r239627 - 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: Fri, 24 Aug 2012 00:09:50 -0000 Author: adrian Date: Fri Aug 24 00:09:49 2012 New Revision: 239627 URL: http://svn.freebsd.org/changeset/base/239627 Log: Add some new flags: * mfp support; * 4.9ghz support in the HAL; * device type - specifically, the bus type and whether it's a HB63 NIC (which requires some subtle chainmask handling differences in the AR5416 HAL.) Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Aug 23 22:38:37 2012 (r239626) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:09:49 2012 (r239627) @@ -228,7 +228,8 @@ typedef struct { halEnhancedDmaSupport : 1; uint32_t halIsrRacSupport : 1, halApmEnable : 1, - halIntrMitigation : 1; + halIntrMitigation : 1, + hal49GhzSupport : 1; uint32_t halWirelessModes; uint16_t halTotalQueues; @@ -245,7 +246,7 @@ typedef struct { uint32_t halIntrMask; uint8_t halTxStreams; uint8_t halRxStreams; - + HAL_MFP_OPT_T halMfpSupport; int halNumTxMaps; int halTxDescLen; int halTxStatusLen; @@ -258,6 +259,12 @@ typedef struct { struct regDomain; /* + * Definitions for ah_flags in ath_hal_private + */ +#define AH_USE_EEPROM 0x1 +#define AH_IS_HB63 0x2 + +/* * The ``private area'' follows immediately after the ``public area'' * in the data structure returned by ath_hal_attach. Private data are * used by device-independent code such as the regulatory domain support. @@ -316,7 +323,9 @@ struct ath_hal_private { uint16_t ah_phyRev; /* PHY revision */ uint16_t ah_analog5GhzRev; /* 2GHz radio revision */ uint16_t ah_analog2GhzRev; /* 5GHz radio revision */ + uint32_t ah_flags; /* misc flags */ uint8_t ah_ispcie; /* PCIE, special treatment */ + uint8_t ah_devType; /* card type - CB, PCI, PCIe */ HAL_OPMODE ah_opmode; /* operating mode from reset */ const struct ieee80211_channel *ah_curchan;/* operating channel */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 00:15:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E1A6106566C; Fri, 24 Aug 2012 00:15:27 +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 798958FC12; Fri, 24 Aug 2012 00:15:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O0FRxM022086; Fri, 24 Aug 2012 00:15:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0FRLF022083; Fri, 24 Aug 2012 00:15:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240015.q7O0FRLF022083@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:15: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: r239628 - 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: Fri, 24 Aug 2012 00:15:27 -0000 Author: adrian Date: Fri Aug 24 00:15:26 2012 New Revision: 239628 URL: http://svn.freebsd.org/changeset/base/239628 Log: Wrap this a little so it's slightly easier on the eyes. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:09:49 2012 (r239627) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:15:26 2012 (r239628) @@ -514,7 +514,8 @@ isBigEndian(void) /* Analog register writes may require a delay between each one (eg Merlin?) */ #define OS_A_REG_RMW_FIELD(_a, _r, _f, _v) \ - do { OS_REG_WRITE(_a, _r, (OS_REG_READ(_a, _r) &~ (_f)) | (((_v) << _f##_S) & (_f))) ; OS_DELAY(100); } while (0) + do { OS_REG_WRITE(_a, _r, (OS_REG_READ(_a, _r) &~ (_f)) | \ + (((_v) << _f##_S) & (_f))) ; OS_DELAY(100); } while (0) #define OS_A_REG_WRITE(_a, _r, _v) \ do { OS_REG_WRITE(_a, _r, _v); OS_DELAY(100); } while (0) From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 00:17:40 2012 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 50719106566B; Fri, 24 Aug 2012 00:17:40 +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 3BA968FC15; Fri, 24 Aug 2012 00:17:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O0Heu7022517; Fri, 24 Aug 2012 00:17:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0HeHF022514; Fri, 24 Aug 2012 00:17:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240017.q7O0HeHF022514@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:17: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: r239629 - 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: Fri, 24 Aug 2012 00:17:40 -0000 Author: adrian Date: Fri Aug 24 00:17:39 2012 New Revision: 239629 URL: http://svn.freebsd.org/changeset/base/239629 Log: Add some more diagnostic codes. Obtained from: Qualcomm Atheros 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 Fri Aug 24 00:15:26 2012 (r239628) +++ head/sys/dev/ath/ath_hal/ah_diagcodes.h Fri Aug 24 00:17:39 2012 (r239629) @@ -63,6 +63,10 @@ enum { HAL_DIAG_CHECK_HANGS = 32, /* check h/w hangs */ HAL_DIAG_SETREGS = 33, /* write registers */ HAL_DIAG_CHANSURVEY = 34, /* channel survey */ + HAL_DIAG_PRINT_REG = 35, + HAL_DIAG_PRINT_REG_ALL = 36, + HAL_DIAG_CHANNELS = 37, + HAL_DIAG_PRINT_REG_COUNTER = 38, }; #endif /* _ATH_AH_DIAGCODES_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 00:33:26 2012 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 8CBBD106564A; Fri, 24 Aug 2012 00:33:26 +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 781988FC0A; Fri, 24 Aug 2012 00:33:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O0XQKJ025382; Fri, 24 Aug 2012 00:33:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0XQFu025380; Fri, 24 Aug 2012 00:33:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240033.q7O0XQFu025380@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:33: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: r239630 - 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: Fri, 24 Aug 2012 00:33:26 -0000 Author: adrian Date: Fri Aug 24 00:33:25 2012 New Revision: 239630 URL: http://svn.freebsd.org/changeset/base/239630 Log: Add the MFP capability to ath_hal_getcapability(). Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Fri Aug 24 00:17:39 2012 (r239629) +++ head/sys/dev/ath/ath_hal/ah.c Fri Aug 24 00:33:25 2012 (r239630) @@ -718,7 +718,9 @@ ath_hal_getcapability(struct ath_hal *ah return pCap->halHasBBReadWar? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_SERIALISE_WAR: /* PCI register serialisation */ return pCap->halSerialiseRegWar ? HAL_OK : HAL_ENOTSUPP; - + case HAL_CAP_MFP: /* Management frame protection setting */ + *result = pCap->halMfpSupport; + return HAL_OK; default: return HAL_EINVAL; } From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 00:36:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E14A106566C; Fri, 24 Aug 2012 00:36: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 596968FC0A; Fri, 24 Aug 2012 00:36:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O0amJ5025991; Fri, 24 Aug 2012 00:36:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0amVr025989; Fri, 24 Aug 2012 00:36:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240036.q7O0amVr025989@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239631 - 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: Fri, 24 Aug 2012 00:36:48 -0000 Author: adrian Date: Fri Aug 24 00:36:47 2012 New Revision: 239631 URL: http://svn.freebsd.org/changeset/base/239631 Log: Add some more capabilities (unused at the present.) Obtained from: Qualcomm Atheros 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 Fri Aug 24 00:33:25 2012 (r239630) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:36:47 2012 (r239631) @@ -163,8 +163,24 @@ typedef enum { HAL_CAP_HT20_SGI = 96, /* hardware supports HT20 short GI */ + HAL_CAP_LDPC = 99, + HAL_CAP_RXTSTAMP_PREC = 100, /* rx desc tstamp precision (bits) */ + + HAL_CAP_PHYRESTART_CLR_WAR = 106, /* in some cases, clear phy restart to fix bb hang */ + HAL_CAP_ENTERPRISE_MODE = 107, /* Enterprise mode features */ + HAL_CAP_LDPCWAR = 108, + HAL_CAP_CHANNEL_SWITCH_TIME_USEC = 109, /* Channel change time, usec */ + HAL_CAP_ENABLE_APM = 110, /* APM enabled */ + HAL_CAP_PCIE_LCR_EXTSYNC_EN = 111, + HAL_CAP_PCIE_LCR_OFFSET = 112, + HAL_CAP_ENHANCED_DFS_SUPPORT = 117, /* hardware supports enhanced DFS */ + HAL_CAP_MCI = 118, + HAL_CAP_SMARTANTENNA = 119, + HAL_CAP_TRAFFIC_FAST_RECOVER = 120, + HAL_CAP_TX_DIVERSITY = 121, + HAL_CAP_CRDC = 122, /* The following are private to the FreeBSD HAL (224 onward) */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 00:40:02 2012 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 256D01065700; Fri, 24 Aug 2012 00:40:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5D88FC0C; Fri, 24 Aug 2012 00:40:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O0e1U9026607; Fri, 24 Aug 2012 00:40:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0e1Y3026606; Fri, 24 Aug 2012 00:40:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240040.q7O0e1Y3026606@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239632 - 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: Fri, 24 Aug 2012 00:40:02 -0000 Author: adrian Date: Fri Aug 24 00:40:01 2012 New Revision: 239632 URL: http://svn.freebsd.org/changeset/base/239632 Log: Oops, fix copy/paste silliness. 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 Fri Aug 24 00:36:47 2012 (r239631) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:40:01 2012 (r239632) @@ -176,11 +176,11 @@ typedef enum { HAL_CAP_PCIE_LCR_OFFSET = 112, HAL_CAP_ENHANCED_DFS_SUPPORT = 117, /* hardware supports enhanced DFS */ - HAL_CAP_MCI = 118, - HAL_CAP_SMARTANTENNA = 119, - HAL_CAP_TRAFFIC_FAST_RECOVER = 120, - HAL_CAP_TX_DIVERSITY = 121, - HAL_CAP_CRDC = 122, + HAL_CAP_MCI = 118, + HAL_CAP_SMARTANTENNA = 119, + HAL_CAP_TRAFFIC_FAST_RECOVER = 120, + HAL_CAP_TX_DIVERSITY = 121, + HAL_CAP_CRDC = 122, /* The following are private to the FreeBSD HAL (224 onward) */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 00:43:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 886FF1065679; Fri, 24 Aug 2012 00:43: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 745AC8FC20; Fri, 24 Aug 2012 00:43:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O0hBOF027240; Fri, 24 Aug 2012 00:43:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0hBCZ027238; Fri, 24 Aug 2012 00:43:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240043.q7O0hBCZ027238@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:43: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: r239633 - 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: Fri, 24 Aug 2012 00:43:11 -0000 Author: adrian Date: Fri Aug 24 00:43:10 2012 New Revision: 239633 URL: http://svn.freebsd.org/changeset/base/239633 Log: Add rfkill HAL accessor methods. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:40:01 2012 (r239632) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:43:10 2012 (r239633) @@ -393,6 +393,13 @@ struct ath_hal_private { #define ath_hal_setInterrupts(_ah, _mask) \ (_ah)->ah_setInterrupts(_ah, _mask) +#define ath_hal_isrfkillenabled(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_RFSILENT, 1, AH_NULL) == HAL_OK) +#define ath_hal_enable_rfkill(_ah, _v) \ + ath_hal_setcapability(_ah, HAL_CAP_RFSILENT, 1, _v, AH_NULL) +#define ath_hal_hasrfkill_int(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_RFSILENT, 3, AH_NULL) == HAL_OK) + #define ath_hal_eepromDetach(_ah) do { \ if (AH_PRIVATE(_ah)->ah_eepromDetach != AH_NULL) \ AH_PRIVATE(_ah)->ah_eepromDetach(_ah); \ From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 00:52:38 2012 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 9F3C61065673; Fri, 24 Aug 2012 00:52:38 +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 70FF18FC08; Fri, 24 Aug 2012 00:52:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O0qc6X028979; Fri, 24 Aug 2012 00:52:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0qcXA028975; Fri, 24 Aug 2012 00:52:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240052.q7O0qcXA028975@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:52: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: r239634 - 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: Fri, 24 Aug 2012 00:52:38 -0000 Author: adrian Date: Fri Aug 24 00:52:37 2012 New Revision: 239634 URL: http://svn.freebsd.org/changeset/base/239634 Log: Add ath_hal_get_curmode() - this is used by the Osprey HAL. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Fri Aug 24 00:43:10 2012 (r239633) +++ head/sys/dev/ath/ath_hal/ah.c Fri Aug 24 00:52:37 2012 (r239634) @@ -420,6 +420,50 @@ ath_hal_computetxtime(struct ath_hal *ah return txTime; } +int +ath_hal_get_curmode(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ + /* + * Pick a default mode at bootup. A channel change is inevitable. + */ + if (!chan) + return HAL_MODE_11NG_HT20; + + if (IEEE80211_IS_CHAN_TURBO(chan)) + return HAL_MODE_TURBO; + + /* check for NA_HT before plain A, since IS_CHAN_A includes NA_HT */ + if (IEEE80211_IS_CHAN_5GHZ(chan) && IEEE80211_IS_CHAN_HT20(chan)) + return HAL_MODE_11NA_HT20; + if (IEEE80211_IS_CHAN_5GHZ(chan) && IEEE80211_IS_CHAN_HT40U(chan)) + return HAL_MODE_11NA_HT40PLUS; + if (IEEE80211_IS_CHAN_5GHZ(chan) && IEEE80211_IS_CHAN_HT40D(chan)) + return HAL_MODE_11NA_HT40MINUS; + if (IEEE80211_IS_CHAN_A(chan)) + return HAL_MODE_11A; + + /* check for NG_HT before plain G, since IS_CHAN_G includes NG_HT */ + if (IEEE80211_IS_CHAN_2GHZ(chan) && IEEE80211_IS_CHAN_HT20(chan)) + return HAL_MODE_11NG_HT20; + if (IEEE80211_IS_CHAN_2GHZ(chan) && IEEE80211_IS_CHAN_HT40U(chan)) + return HAL_MODE_11NG_HT40PLUS; + if (IEEE80211_IS_CHAN_2GHZ(chan) && IEEE80211_IS_CHAN_HT40D(chan)) + return HAL_MODE_11NG_HT40MINUS; + + /* + * XXX For FreeBSD, will this work correctly given the DYN + * chan mode (OFDM+CCK dynamic) ? We have pure-G versions DYN-BG.. + */ + if (IEEE80211_IS_CHAN_G(chan)) + return HAL_MODE_11G; + if (IEEE80211_IS_CHAN_B(chan)) + return HAL_MODE_11B; + + HALASSERT(0); + return HAL_MODE_11NG_HT20; +} + + typedef enum { WIRELESS_MODE_11a = 0, WIRELESS_MODE_TURBO = 1, Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:43:10 2012 (r239633) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:52:37 2012 (r239634) @@ -1390,6 +1390,12 @@ extern void __ahdecl ath_hal_process_noi extern u_int __ahdecl ath_hal_getwirelessmodes(struct ath_hal*); /* + * Get the HAL wireless mode for the given channel. + */ +extern int ath_hal_get_curmode(struct ath_hal *ah, + const struct ieee80211_channel *chan); + +/* * Calculate the packet TX time for a legacy or 11n frame */ extern uint32_t __ahdecl ath_hal_pkt_txtime(struct ath_hal *ah, From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 00:54:32 2012 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 84BD9106564A; Fri, 24 Aug 2012 00:54:32 +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 7045F8FC1A; Fri, 24 Aug 2012 00:54:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O0sWgT029353; Fri, 24 Aug 2012 00:54:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0sWXI029351; Fri, 24 Aug 2012 00:54:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240054.q7O0sWXI029351@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:54: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: r239635 - 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: Fri, 24 Aug 2012 00:54:32 -0000 Author: adrian Date: Fri Aug 24 00:54:31 2012 New Revision: 239635 URL: http://svn.freebsd.org/changeset/base/239635 Log: Oops, another copy/paste issue. 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 Fri Aug 24 00:52:37 2012 (r239634) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:54:31 2012 (r239635) @@ -1392,7 +1392,7 @@ extern u_int __ahdecl ath_hal_getwireles /* * Get the HAL wireless mode for the given channel. */ -extern int ath_hal_get_curmode(struct ath_hal *ah, +extern int ath_hal_get_curmode(struct ath_hal *ah, const struct ieee80211_channel *chan); /* From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 01:12:07 2012 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 B7898106566B; Fri, 24 Aug 2012 01:12:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2F028FC12; Fri, 24 Aug 2012 01:12:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O1C785032544; Fri, 24 Aug 2012 01:12:07 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O1C7hl032541; Fri, 24 Aug 2012 01:12:07 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208240112.q7O1C7hl032541@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 24 Aug 2012 01:12:07 +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: r239636 - head/sys/fs/ext2fs 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, 24 Aug 2012 01:12:07 -0000 Author: pfg Date: Fri Aug 24 01:12:07 2012 New Revision: 239636 URL: http://svn.freebsd.org/changeset/base/239636 Log: Add some basic definitions for a future htree implementation. MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Fri Aug 24 00:54:31 2012 (r239635) +++ head/sys/fs/ext2fs/ext2_dinode.h Fri Aug 24 01:12:07 2012 (r239636) @@ -57,10 +57,12 @@ #define EXT2_COMPR 0x00000004 /* Compress file */ #define EXT2_SYNC 0x00000008 /* Synchronous updates */ #define EXT2_IMMUTABLE 0x00000010 /* Immutable file */ -#define EXT2_APPEND 0x00000020 /* writes to file may only append */ +#define EXT2_APPEND 0x00000020 /* writes to file may only append */ #define EXT2_NODUMP 0x00000040 /* do not dump file */ #define EXT2_NOATIME 0x00000080 /* do not update atime */ +#define EXT2_HTREE 0x00001000 /* HTree-indexed directory */ + /* * Definitions for nanosecond timestamps. * Ext3 inode versioning, 2006-12-13. Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Fri Aug 24 00:54:31 2012 (r239635) +++ head/sys/fs/ext2fs/ext2fs.h Fri Aug 24 01:12:07 2012 (r239636) @@ -210,6 +210,7 @@ struct m_ext2fs { #define EXT2F_COMPAT_PREALLOC 0x0001 #define EXT2F_COMPAT_HASJOURNAL 0x0004 #define EXT2F_COMPAT_RESIZE 0x0010 +#define EXT2F_COMPAT_HTREE 0x0020 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 01:14:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E3FD106566C; Fri, 24 Aug 2012 01:14:01 +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 58F6A8FC0A; Fri, 24 Aug 2012 01:14:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O1E1MV033126; Fri, 24 Aug 2012 01:14:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O1E1Xf033124; Fri, 24 Aug 2012 01:14:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240114.q7O1E1Xf033124@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 01:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239637 - 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: Fri, 24 Aug 2012 01:14:01 -0000 Author: adrian Date: Fri Aug 24 01:14:00 2012 New Revision: 239637 URL: http://svn.freebsd.org/changeset/base/239637 Log: Bring over some new EEPROM regulatory domain flags. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom.h Fri Aug 24 01:12:07 2012 (r239636) +++ head/sys/dev/ath/ath_hal/ah_eeprom.h Fri Aug 24 01:14:00 2012 (r239637) @@ -105,6 +105,10 @@ enum { AR_EEP_TEMPSENSE_SLOPE, /* int8_t* */ AR_EEP_TEMPSENSE_SLOPE_PAL_ON, /* int8_t* */ AR_EEP_FRAC_N_5G, /* uint8_t* */ + + /* New fields for AR9300 and later */ + AR_EEP_DRIVE_STRENGTH, + AR_EEP_PAPRD_ENABLED, }; typedef struct { @@ -127,6 +131,30 @@ typedef struct { #define CTL_2GHT40 7 #define CTL_5GHT40 8 +/* XXX must match what FCC/MKK/ETSI are defined as in ah_regdomain.h */ +#define HAL_REG_DMN_MASK 0xf0 +#define HAL_REGDMN_FCC 0x10 +#define HAL_REGDMN_MKK 0x40 +#define HAL_REGDMN_ETSI 0x30 + +#define is_reg_dmn_fcc(reg_dmn) \ + (((reg_dmn & HAL_REG_DMN_MASK) == HAL_REGDMN_FCC) ? 1 : 0) +#define is_reg_dmn_etsi(reg_dmn) \ + (((reg_dmn & HAL_REG_DMN_MASK) == HAL_REGDMN_ETSI) ? 1 : 0) +#define is_reg_dmn_mkk(reg_dmn) \ + (((reg_dmn & HAL_REG_DMN_MASK) == HAL_REGDMN_MKK) ? 1 : 0) + +#define AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040 +#define AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080 +#define AR_EEPROM_EEREGCAP_EN_KK_U2 0x0100 +#define AR_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200 +#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400 +#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800 + +/* regulatory capabilities prior to eeprom version 4.0 */ +#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0 0x4000 +#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0 0x8000 + #define AR_NO_SPUR 0x8000 /* XXX exposed to chip code */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 01:29:47 2012 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 33F92106566B; Fri, 24 Aug 2012 01:29:47 +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 1E8728FC18; Fri, 24 Aug 2012 01:29:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O1Tkt7035826; Fri, 24 Aug 2012 01:29:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O1TkJ8035821; Fri, 24 Aug 2012 01:29:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240129.q7O1TkJ8035821@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 01:29: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: r239638 - in 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: Fri, 24 Aug 2012 01:29:47 -0000 Author: adrian Date: Fri Aug 24 01:29:46 2012 New Revision: 239638 URL: http://svn.freebsd.org/changeset/base/239638 Log: Implement an API to fetch the default DFS parameters for the given chip. The only chip this is currently implemented for is the AR5416 HAL family. A follow-up commit will add AR5212 support. PR: kern/170904 Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 01:14:00 2012 (r239637) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 01:29:46 2012 (r239638) @@ -1223,6 +1223,8 @@ struct ath_hal { HAL_PHYERR_PARAM *pe); void __ahdecl(*ah_getDfsThresh)(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); + HAL_BOOL __ahdecl(*ah_getDfsDefaultThresh)(struct ath_hal *ah, + HAL_PHYERR_PARAM *pe); HAL_BOOL __ahdecl(*ah_procRadarEvent)(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Aug 24 01:14:00 2012 (r239637) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Aug 24 01:29:46 2012 (r239638) @@ -253,6 +253,8 @@ extern HAL_BOOL ar5416SetRifsDelay(struc const struct ieee80211_channel *chan, HAL_BOOL enable); extern void ar5416EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); +extern HAL_BOOL ar5416GetDfsDefaultThresh(struct ath_hal *ah, + HAL_PHYERR_PARAM *pe); extern void ar5416GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); extern HAL_BOOL ar5416ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Aug 24 01:14:00 2012 (r239637) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Aug 24 01:29:46 2012 (r239638) @@ -156,6 +156,7 @@ ar5416InitState(struct ath_hal_5416 *ahp /* DFS Functions */ ah->ah_enableDfs = ar5416EnableDfs; ah->ah_getDfsThresh = ar5416GetDfsThresh; + ah->ah_getDfsDefaultThresh = ar5416GetDfsDefaultThresh; ah->ah_procRadarEvent = ar5416ProcessRadarEvent; ah->ah_isFastClockEnabled = ar5416IsFastClockEnabled; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c Fri Aug 24 01:14:00 2012 (r239637) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c Fri Aug 24 01:29:46 2012 (r239638) @@ -29,6 +29,51 @@ #include "ah_eeprom_v14.h" /* for owl_get_ntxchains() */ /* + * These are default parameters for the AR5416 and + * later 802.11n NICs. They simply enable some + * radar pulse event generation. + * + * These are very likely not valid for the AR5212 era + * NICs. + * + * Since these define signal sizing and threshold + * parameters, they may need changing based on the + * specific antenna and receive amplifier + * configuration. + */ +#define AR5416_DFS_FIRPWR -33 +#define AR5416_DFS_RRSSI 20 +#define AR5416_DFS_HEIGHT 10 +#define AR5416_DFS_PRSSI 15 +#define AR5416_DFS_INBAND 15 +#define AR5416_DFS_RELPWR 8 +#define AR5416_DFS_RELSTEP 12 +#define AR5416_DFS_MAXLEN 255 + +HAL_BOOL +ar5416GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) +{ + + /* + * These are general examples of the parameter values + * to use when configuring radar pulse detection for + * the AR5416, AR91xx, AR92xx NICs. They are only + * for testing and do require tuning depending upon the + * hardware and deployment specifics. + */ + pe->pe_firpwr = AR5416_DFS_FIRPWR; + pe->pe_rrssi = AR5416_DFS_RRSSI; + pe->pe_height = AR5416_DFS_HEIGHT; + pe->pe_prssi = AR5416_DFS_PRSSI; + pe->pe_inband = AR5416_DFS_INBAND; + pe->pe_relpwr = AR5416_DFS_RELPWR; + pe->pe_relstep = AR5416_DFS_RELSTEP; + pe->pe_maxlen = AR5416_DFS_MAXLEN; + + return (AH_TRUE); +} + +/* * Get the radar parameter values and return them in the pe * structure */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 05:36:38 2012 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 71728106564A; Fri, 24 Aug 2012 05:36:38 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB4A8FC08; Fri, 24 Aug 2012 05:36:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O5acYl075337; Fri, 24 Aug 2012 05:36:38 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O5acvH075334; Fri, 24 Aug 2012 05:36:38 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201208240536.q7O5acvH075334@svn.freebsd.org> From: Colin Percival Date: Fri, 24 Aug 2012 05:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239639 - in releng/9.1/sys: amd64/conf i386/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: Fri, 24 Aug 2012 05:36:38 -0000 Author: cperciva Date: Fri Aug 24 05:36:37 2012 New Revision: 239639 URL: http://svn.freebsd.org/changeset/base/239639 Log: MFC r239228: Build modules along with the XENHVM kernels. Approved by: re (kib) Modified: releng/9.1/sys/amd64/conf/XENHVM releng/9.1/sys/i386/conf/XENHVM Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/amd64/conf/XENHVM ============================================================================== --- releng/9.1/sys/amd64/conf/XENHVM Fri Aug 24 01:29:46 2012 (r239638) +++ releng/9.1/sys/amd64/conf/XENHVM Fri Aug 24 05:36:37 2012 (r239639) @@ -6,8 +6,6 @@ include GENERIC ident XENHVM -makeoptions MODULES_OVERRIDE="" - # # Adaptive locks rely on a lock-free pointer read to determine the run state # of the thread holding a lock when under contention; under a virtualisation Modified: releng/9.1/sys/i386/conf/XENHVM ============================================================================== --- releng/9.1/sys/i386/conf/XENHVM Fri Aug 24 01:29:46 2012 (r239638) +++ releng/9.1/sys/i386/conf/XENHVM Fri Aug 24 05:36:37 2012 (r239639) @@ -6,8 +6,6 @@ include GENERIC ident XENHVM -makeoptions MODULES_OVERRIDE="" - # # Adaptive locks rely on a lock-free pointer read to determine the run state # of the thread holding a lock when under contention; under a virtualisation From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 06:55:17 2012 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 37892106564A; Fri, 24 Aug 2012 06:55:17 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22BFC8FC08; Fri, 24 Aug 2012 06:55:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O6tGTs086538; Fri, 24 Aug 2012 06:55:16 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O6tG6Y086536; Fri, 24 Aug 2012 06:55:16 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201208240655.q7O6tG6Y086536@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 24 Aug 2012 06:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239640 - head/gnu/usr.bin/groff/tmac 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, 24 Aug 2012 06:55:17 -0000 Author: ru Date: Fri Aug 24 06:55:16 2012 New Revision: 239640 URL: http://svn.freebsd.org/changeset/base/239640 Log: A workaround in r238563 was for makes (notably bmake) without the internal knowledge that "cd" is a shell's built-in. Such makes may attempt to exec() "cd" that in turn will fail on systems that lack the "cd" executable. Reworked this by eliminating the root cause. Submitted by: Simon Gerraty Modified: head/gnu/usr.bin/groff/tmac/Makefile Modified: head/gnu/usr.bin/groff/tmac/Makefile ============================================================================== --- head/gnu/usr.bin/groff/tmac/Makefile Fri Aug 24 05:36:37 2012 (r239639) +++ head/gnu/usr.bin/groff/tmac/Makefile Fri Aug 24 06:55:16 2012 (r239640) @@ -62,13 +62,12 @@ $f-s: $f .endfor beforeinstall: - cd ${DIST_DIR}; \ + (cd ${DIST_DIR} && \ ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ - ${NORMALFILES} ${DESTDIR}${TMACDIR} - cd ${.CURDIR}; \ + ${NORMALFILES} ${DESTDIR}${TMACDIR}) + (cd ${.CURDIR} && \ ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ - koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR} - cd ${.OBJDIR}; + koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) .for f in ${STRIPFILES} ${SPECIALFILES} ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ $f-s ${DESTDIR}${TMACDIR}/$f From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 06:56:45 2012 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 9372F106566C; Fri, 24 Aug 2012 06:56:45 +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 658FC8FC08; Fri, 24 Aug 2012 06:56:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O6ujEs086847; Fri, 24 Aug 2012 06:56:45 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O6ujVU086845; Fri, 24 Aug 2012 06:56:45 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208240656.q7O6ujVU086845@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 24 Aug 2012 06:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239641 - releng/9.1/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: Fri, 24 Aug 2012 06:56:45 -0000 Author: bschmidt Date: Fri Aug 24 06:56:44 2012 New Revision: 239641 URL: http://svn.freebsd.org/changeset/base/239641 Log: MFC r231187: Update the 802.11s IE numbers to represent the latest 802.11 amendment standard. This update breaks compatibility with older mesh setups but is necessary as the previous IDs are used by another amendment leading to unexpected results when trying to associate with an accesspoint using the affected IDs. Approved by: re (kib) Modified: releng/9.1/sys/net80211/ieee80211.h Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/net80211/ieee80211.h ============================================================================== --- releng/9.1/sys/net80211/ieee80211.h Fri Aug 24 06:55:16 2012 (r239640) +++ releng/9.1/sys/net80211/ieee80211.h Fri Aug 24 06:56:44 2012 (r239641) @@ -709,27 +709,32 @@ enum { IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ /* - * 802.11s IEs based on D3.03 spec and were not assigned by - * ANA. Beware changing them because some of them are being - * kept compatible with Linux. + * 802.11s IEs + * NB: On vanilla Linux still IEEE80211_ELEMID_MESHPEER = 55, + * but they defined a new with id 117 called PEER_MGMT. + * NB: complies with open80211 */ - IEEE80211_ELEMID_MESHCONF = 51, - IEEE80211_ELEMID_MESHID = 52, - IEEE80211_ELEMID_MESHLINK = 35, - IEEE80211_ELEMID_MESHCNGST = 36, - IEEE80211_ELEMID_MESHPEER = 55, - IEEE80211_ELEMID_MESHCSA = 38, - IEEE80211_ELEMID_MESHTIM = 39, - IEEE80211_ELEMID_MESHAWAKEW = 40, - IEEE80211_ELEMID_MESHBEACONT = 41, - IEEE80211_ELEMID_MESHPANN = 48, - IEEE80211_ELEMID_MESHRANN = 49, - IEEE80211_ELEMID_MESHPREQ = 68, - IEEE80211_ELEMID_MESHPREP = 69, - IEEE80211_ELEMID_MESHPERR = 70, - IEEE80211_ELEMID_MESHPXU = 53, - IEEE80211_ELEMID_MESHPXUC = 54, - IEEE80211_ELEMID_MESHAH = 60, /* Abbreviated Handshake */ + IEEE80211_ELEMID_MESHCONF = 113, + IEEE80211_ELEMID_MESHID = 114, + IEEE80211_ELEMID_MESHLINK = 115, + IEEE80211_ELEMID_MESHCNGST = 116, + IEEE80211_ELEMID_MESHPEER = 117, + IEEE80211_ELEMID_MESHCSA = 118, + IEEE80211_ELEMID_MESHTIM = 39, /* XXX: remove */ + IEEE80211_ELEMID_MESHAWAKEW = 119, + IEEE80211_ELEMID_MESHBEACONT = 120, + /* 121-124 MMCAOP not implemented yet */ + IEEE80211_ELEMID_MESHPANN = 125, /* XXX: is GANN now, not used */ + IEEE80211_ELEMID_MESHRANN = 126, + /* 127 Extended Capabilities */ + /* 128-129 reserved */ + IEEE80211_ELEMID_MESHPREQ = 130, + IEEE80211_ELEMID_MESHPREP = 131, + IEEE80211_ELEMID_MESHPERR = 132, + /* 133-136 reserved */ + IEEE80211_ELEMID_MESHPXU = 137, + IEEE80211_ELEMID_MESHPXUC = 138, + IEEE80211_ELEMID_MESHAH = 60, /* XXX: remove */ }; struct ieee80211_tim_ie { From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 07:32:35 2012 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 C924D106566B; Fri, 24 Aug 2012 07:32:35 +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 B3BC08FC0C; Fri, 24 Aug 2012 07:32:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O7WZEH091998; Fri, 24 Aug 2012 07:32:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O7WZbb091994; Fri, 24 Aug 2012 07:32:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240732.q7O7WZbb091994@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 07:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239642 - head/sys/dev/ath/ath_hal/ar5212 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, 24 Aug 2012 07:32:36 -0000 Author: adrian Date: Fri Aug 24 07:32:35 2012 New Revision: 239642 URL: http://svn.freebsd.org/changeset/base/239642 Log: Add the method to fetch the default DFS parameters for the AR5212 PHY. I need to check whether new parameters were added for the AR5413 NIC. PR: kern/170904 Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Aug 24 06:56:44 2012 (r239641) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Aug 24 07:32:35 2012 (r239642) @@ -633,6 +633,8 @@ extern void ar5212AniReset(struct ath_ha extern HAL_BOOL ar5212IsNFCalInProgress(struct ath_hal *ah); extern HAL_BOOL ar5212WaitNFCalComplete(struct ath_hal *ah, int i); extern void ar5212EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); +extern HAL_BOOL ar5212GetDfsDefaultThresh(struct ath_hal *ah, + HAL_PHYERR_PARAM *pe); extern void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); extern HAL_BOOL ar5212ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 06:56:44 2012 (r239641) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 07:32:35 2012 (r239642) @@ -137,6 +137,7 @@ static const struct ath_hal_private ar52 /* DFS Functions */ .ah_enableDfs = ar5212EnableDfs, .ah_getDfsThresh = ar5212GetDfsThresh, + .ah_getDfsDefaultThresh = ar5212GetDfsDefaultThresh, .ah_procRadarEvent = ar5212ProcessRadarEvent, .ah_isFastClockEnabled = ar5212IsFastClockEnabled, .ah_get11nExtBusy = ar5212Get11nExtBusy, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 06:56:44 2012 (r239641) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 07:32:35 2012 (r239642) @@ -1163,6 +1163,35 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA); } +/* + * Parameters for the AR5212 PHY. + * + * TODO: figure out what values were added for the AR5413 and later + * PHY; update these here. + */ +#define AR5212_DFS_FIRPWR -41 +#define AR5212_DFS_RRSSI 12 +#define AR5212_DFS_HEIGHT 20 +#define AR5212_DFS_PRSSI 22 +#define AR5212_DFS_INBAND 6 + +HAL_BOOL +ar5212GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) +{ + + pe->pe_firpwr = AR5212_DFS_FIRPWR; + pe->pe_rrssi = AR5212_DFS_RRSSI; + pe->pe_height = AR5212_DFS_HEIGHT; + pe->pe_prssi = AR5212_DFS_PRSSI; + pe->pe_inband = AR5212_DFS_INBAND; + /* XXX look up what is needed for the AR5413 */ + pe->pe_relpwr = 0; + pe->pe_relstep = 0; + pe->pe_maxlen = 0; + + return (AH_TRUE); +} + void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { @@ -1250,7 +1279,7 @@ ar5212Get11nExtBusy(struct ath_hal *ah) } /* - * There's no channel survey support for the AR5211. + * There's no channel survey support for the AR5212. */ HAL_BOOL ar5212GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample) From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 07:35:19 2012 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 F2C4E106564A; Fri, 24 Aug 2012 07:35:18 +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 C48718FC08; Fri, 24 Aug 2012 07:35:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O7ZIwU092428; Fri, 24 Aug 2012 07:35:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O7ZIbo092423; Fri, 24 Aug 2012 07:35:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240735.q7O7ZIbo092423@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 07:35: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: r239643 - in head/sys/dev/ath/ath_hal: ar5210 ar5211 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: Fri, 24 Aug 2012 07:35:19 -0000 Author: adrian Date: Fri Aug 24 07:35:18 2012 New Revision: 239643 URL: http://svn.freebsd.org/changeset/base/239643 Log: Add default values for the NumTxMaps capability. Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Aug 24 07:32:35 2012 (r239642) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Aug 24 07:35:18 2012 (r239643) @@ -362,6 +362,7 @@ ar5210FillCapabilityInfo(struct ath_hal pCap->halSleepAfterBeaconBroken = AH_TRUE; pCap->halPSPollBroken = AH_FALSE; pCap->halNumMRRetries = 1; /* No hardware MRR support */ + pCap->halNumTxMaps = 1; /* Single TX ptr per descr */ pCap->halTotalQueues = HAL_NUM_TX_QUEUES; pCap->halKeyCacheSize = 64; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Aug 24 07:32:35 2012 (r239642) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Aug 24 07:35:18 2012 (r239643) @@ -497,6 +497,7 @@ ar5211FillCapabilityInfo(struct ath_hal pCap->halPSPollBroken = AH_TRUE; pCap->halVEOLSupport = AH_TRUE; pCap->halNumMRRetries = 1; /* No hardware MRR support */ + pCap->halNumTxMaps = 1; /* Single TX ptr per descr */ pCap->halTotalQueues = HAL_NUM_TX_QUEUES; pCap->halKeyCacheSize = 128; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 07:32:35 2012 (r239642) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 07:35:18 2012 (r239643) @@ -826,6 +826,7 @@ ar5212FillCapabilityInfo(struct ath_hal pCap->halPSPollBroken = AH_TRUE; /* XXX fixed in later revs? */ pCap->halNumMRRetries = 4; /* Hardware supports 4 MRR */ + pCap->halNumTxMaps = 1; /* Single TX ptr per descr */ pCap->halVEOLSupport = AH_TRUE; pCap->halBssIdMaskSupport = AH_TRUE; pCap->halMcastKeySrchSupport = AH_TRUE; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Aug 24 07:32:35 2012 (r239642) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Aug 24 07:35:18 2012 (r239643) @@ -894,6 +894,7 @@ ar5416FillCapabilityInfo(struct ath_hal pCap->halPSPollBroken = AH_TRUE; /* XXX fixed in later revs? */ pCap->halNumMRRetries = 4; /* Hardware supports 4 MRR */ + pCap->halNumTxMaps = 1; /* Single TX ptr per descr */ pCap->halVEOLSupport = AH_TRUE; pCap->halBssIdMaskSupport = AH_TRUE; pCap->halMcastKeySrchSupport = AH_TRUE; /* Works on AR5416 and later */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 09:58:15 2012 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 95E80106566C; Fri, 24 Aug 2012 09:58:15 +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 66DC98FC08; Fri, 24 Aug 2012 09:58:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O9wFSt010503; Fri, 24 Aug 2012 09:58:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O9wF82010501; Fri, 24 Aug 2012 09:58:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208240958.q7O9wF82010501@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 24 Aug 2012 09:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239645 - stable/9/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, 24 Aug 2012 09:58:15 -0000 Author: des Date: Fri Aug 24 09:58:14 2012 New Revision: 239645 URL: http://svn.freebsd.org/changeset/base/239645 Log: MFH (r239327): warn when too much swap is configured, and avoid flooding the console when running out of space for metadata. Modified: stable/9/sys/vm/swap_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/swap_pager.c ============================================================================== --- stable/9/sys/vm/swap_pager.c Fri Aug 24 09:28:22 2012 (r239644) +++ stable/9/sys/vm/swap_pager.c Fri Aug 24 09:58:14 2012 (r239645) @@ -1804,6 +1804,7 @@ restart: static void swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) { + static volatile int exhausted; struct swblock *swap; struct swblock **pswap; int idx; @@ -1847,7 +1848,9 @@ retry: mtx_unlock(&swhash_mtx); VM_OBJECT_UNLOCK(object); if (uma_zone_exhausted(swap_zone)) { - printf("swap zone exhausted, increase kern.maxswzone\n"); + if (atomic_cmpset_rel_int(&exhausted, 0, 1)) + printf("swap zone exhausted, " + "increase kern.maxswzone\n"); vm_pageout_oom(VM_OOM_SWAPZ); pause("swzonex", 10); } else @@ -1856,6 +1859,9 @@ retry: goto retry; } + if (atomic_cmpset_rel_int(&exhausted, 1, 0)) + printf("swap zone ok\n"); + swap->swb_hnext = NULL; swap->swb_object = object; swap->swb_index = pindex & ~(vm_pindex_t)SWAP_META_MASK; @@ -2112,6 +2118,31 @@ done: return (error); } +/* + * Check that the total amount of swap currently configured does not + * exceed half the theoretical maximum. If it does, print a warning + * message and return -1; otherwise, return 0. + */ +static int +swapon_check_swzone(unsigned long npages) +{ + unsigned long maxpages; + + /* absolute maximum we can handle assuming 100% efficiency */ + maxpages = uma_zone_get_max(swap_zone) * SWAP_META_PAGES; + + /* recommend using no more than half that amount */ + if (npages > maxpages / 2) { + printf("warning: total configured swap (%lu pages) " + "exceeds maximum recommended amount (%lu pages).\n", + npages, maxpages); + printf("warning: increase kern.maxswzone " + "or reduce amount of swap.\n"); + return (-1); + } + return (0); +} + static void swaponsomething(struct vnode *vp, void *id, u_long nblks, sw_strategy_t *strategy, sw_close_t *close, dev_t dev) { @@ -2175,6 +2206,7 @@ swaponsomething(struct vnode *vp, void * nswapdev++; swap_pager_avail += nblks; swap_total += (vm_ooffset_t)nblks * PAGE_SIZE; + swapon_check_swzone(swap_total / PAGE_SIZE); swp_sizecheck(); mtx_unlock(&sw_dev_mtx); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 10:09:35 2012 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 3266B106566B; Fri, 24 Aug 2012 10:09: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 1C3BC8FC12; Fri, 24 Aug 2012 10:09:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OA9YCc017318; Fri, 24 Aug 2012 10:09:34 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OA9YO1017316; Fri, 24 Aug 2012 10:09:34 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208241009.q7OA9YO1017316@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 24 Aug 2012 10:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239646 - stable/9/usr.bin/unzip 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, 24 Aug 2012 10:09:35 -0000 Author: des Date: Fri Aug 24 10:09:34 2012 New Revision: 239646 URL: http://svn.freebsd.org/changeset/base/239646 Log: MFH (r236226): pass filename to libarchive rather than descriptor Modified: stable/9/usr.bin/unzip/unzip.c Directory Properties: stable/9/usr.bin/unzip/ (props changed) Modified: stable/9/usr.bin/unzip/unzip.c ============================================================================== --- stable/9/usr.bin/unzip/unzip.c Fri Aug 24 09:58:14 2012 (r239645) +++ stable/9/usr.bin/unzip/unzip.c Fri Aug 24 10:09:34 2012 (r239646) @@ -865,19 +865,14 @@ unzip(const char *fn) { struct archive *a; struct archive_entry *e; - int fd, ret; + int ret; uintmax_t total_size, file_count, error_count; - if (strcmp(fn, "-") == 0) - fd = STDIN_FILENO; - else if ((fd = open(fn, O_RDONLY)) < 0) - error("%s", fn); - if ((a = archive_read_new()) == NULL) error("archive_read_new failed"); ac(archive_read_support_format_zip(a)); - ac(archive_read_open_fd(a, fd, 8192)); + ac(archive_read_open_filename(a, fn, 8192)); if (!zipinfo_mode) { if (!p_opt && !q_opt) @@ -933,9 +928,6 @@ unzip(const char *fn) ac(archive_read_close(a)); (void)archive_read_finish(a); - if (fd != STDIN_FILENO && close(fd) != 0) - error("%s", fn); - if (t_opt) { if (error_count > 0) { errorx("%d checksum error(s) found.", error_count); @@ -1061,6 +1053,9 @@ main(int argc, char *argv[]) usage(); zipfile = argv[nopts++]; + if (strcmp(zipfile, "-") == 0) + zipfile = NULL; /* STDIN */ + while (nopts < argc && *argv[nopts] != '-') add_pattern(&include, argv[nopts++]); From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 10:34:52 2012 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 D2F6E106564A; Fri, 24 Aug 2012 10:34:52 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 772948FC08; Fri, 24 Aug 2012 10:34:52 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q7OAYphM036756; Fri, 24 Aug 2012 12:34:51 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q7OAYpE0036755; Fri, 24 Aug 2012 12:34:51 +0200 (CEST) (envelope-from marius) Date: Fri, 24 Aug 2012 12:34:51 +0200 From: Marius Strobl To: John Baldwin Message-ID: <20120824103451.GM28757@alchemy.franken.de> References: <201111182239.pAIMdkCr003347@svn.freebsd.org> <201208231012.52720.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208231012.52720.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Marius Strobl , Bjoern Zeeb , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r227687 - head/sys/dev/mii 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, 24 Aug 2012 10:34:53 -0000 On Thu, Aug 23, 2012 at 10:12:52AM -0400, John Baldwin wrote: > On Friday, November 18, 2011 5:39:46 pm Marius Strobl wrote: > > Author: marius > > Date: Fri Nov 18 22:39:46 2011 > > New Revision: 227687 > > URL: http://svn.freebsd.org/changeset/base/227687 > > > > Log: > > - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY > > addresses from being probed and attaching something including ukphy(4) > > to it. This is mainly necessarily for PHY switches that create duplicate > > or fake PHYs on the bus that can corrupt the PHY state when accessed or > > simply cause problems when ukphy(4) isolates the additional instances. > > - Change miibus(4) to be a hinted bus, allowing to add child devices via > > hints and to set their attach arguments (including for automatically > > probed PHYs). This is mainly needed for PHY switches that violate IEEE > > 802.3 and don't even implement the basic register set so we can't probe > > them automatically. However, the ability to alter the attach arguments > > for automatically probed PHYs is also useful as for example it allows > > to test (or tell a user to test) new variant of a PHY with a specific > > driver by letting an existing driver attach to it via manipulating the > > IDs without the need to touch the source code or to limit a Gigabit > > Ethernet PHY to only announce up to Fast Ethernet in order to save > > energy by limiting the capability mask. Generally, a driver has to > > be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" > > (which already is sufficient to add phydrvX at miibusY at PHY address > > Z). Then optionally the following attach arguments additionally can > > be configured: > > hint.phydrv.X.id1 > > hint.phydrv.X.id2 > > hint.phydrv.X.capmask > > - Some minor cleanup. > > I was looking at this today with bz to try to figure out how to use this. > It strikes me that in a case of a bus with devices that have IDs it can > be useful to not hardcode the driver name and unit number, but to be able > to create a device and let the normal driver probe mechanics work. The > existing miibus_hinted_child() routine already largely enforces that by > ensuring that any new child has a unique phyno address. Two approaches I > can think of are: > > 1) Never hardcode the name and unit number. > > 2) Don't hardcode the name and unit number if the name is "phy". > > This would let you do something like: > > hint.phy.0.at="miibus0" > hint.phy.0.phyno="1" > hint.phy.0.id1="xxx" > hint.phy.0.id2="yyy" > > And then 'e1000phy' or 'brphy' or whoever could manage the phy. Though > perhaps in the case of hinted children you want to always force the phy > driver? > I think to understand what you mean but fail to see an actual use case for it. If there's a real PHY on a MII bus a specialized driver like e1000phy(4) already knows about, there's no reason to use a hint to force it to probe and attach as that will be done automatically. If on the other hand, you'd want to say e1000phy(4) probe and attach a PHY it doesn't know about, you'd need to also alter its probe table but your approach doesn't provide any means to link a PHY hint with a certain driver. In general, the use for the latter is also very limited in reality as drivers have to not only take IDs into account but also things like chip revisions etc. (that's also why I think that attempts to make PCI drivers use a unified probing approach/tables in order to provide means to patch ID lists is rather pointless). The main purpose of the above commit is to force wildcard/hoover drivers like ukphy(4) to attach to non-IEEE 802.3 compliant "PHYs" without proper ID registers like so: hint.ukphy.0.at="miibus0" hint.ukphy.0.phyno="2" The use of the name of the driver to probe and attach in these hints mainly was done for consistency with the ISA etc. hints we have. However, as noted in the commit message, you can actually (ab)use these hints to also make a specialized driver probe and attach an unknown PHY (real or not) by faking the ID registers of a PHY it knows of. Note that for this to work, you actually need to put the appropriate contents of real ID registers into these hints and not just OUI and model as found in the driver. As noted above, the use for this method might be very limited in reality. Marius From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 11:44:48 2012 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 333EF106567E; Fri, 24 Aug 2012 11:44:48 +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 1E8D38FC16; Fri, 24 Aug 2012 11:44:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OBilev030577; Fri, 24 Aug 2012 11:44:47 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OBiln3030575; Fri, 24 Aug 2012 11:44:47 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208241144.q7OBiln3030575@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 24 Aug 2012 11:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239647 - stable/9/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: Fri, 24 Aug 2012 11:44:48 -0000 Author: des Date: Fri Aug 24 11:44:47 2012 New Revision: 239647 URL: http://svn.freebsd.org/changeset/base/239647 Log: MFH (r238102, r238605): automatically name jails. Modified: stable/9/etc/rc.d/jail Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/jail ============================================================================== --- stable/9/etc/rc.d/jail Fri Aug 24 10:09:34 2012 (r239646) +++ stable/9/etc/rc.d/jail Fri Aug 24 11:44:47 2012 (r239647) @@ -641,7 +641,7 @@ jail_start() i=$((i + 1)) done - eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ + eval ${_setfib} jail -n ${_jail} ${_flags} -i ${_rootdir} ${_hostname} \ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CC6F1065674; Fri, 24 Aug 2012 12:36:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1D60F8FC08; Fri, 24 Aug 2012 12:36:26 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6DF76B921; Fri, 24 Aug 2012 08:36:25 -0400 (EDT) From: John Baldwin To: Marius Strobl Date: Fri, 24 Aug 2012 07:50:41 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201111182239.pAIMdkCr003347@svn.freebsd.org> <201208231012.52720.jhb@freebsd.org> <20120824103451.GM28757@alchemy.franken.de> In-Reply-To: <20120824103451.GM28757@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201208240750.41304.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 24 Aug 2012 08:36:25 -0400 (EDT) Cc: svn-src-head@freebsd.org, Marius Strobl , Bjoern Zeeb , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r227687 - head/sys/dev/mii 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, 24 Aug 2012 12:36:26 -0000 On Friday, August 24, 2012 6:34:51 am Marius Strobl wrote: > On Thu, Aug 23, 2012 at 10:12:52AM -0400, John Baldwin wrote: > > On Friday, November 18, 2011 5:39:46 pm Marius Strobl wrote: > > > Author: marius > > > Date: Fri Nov 18 22:39:46 2011 > > > New Revision: 227687 > > > URL: http://svn.freebsd.org/changeset/base/227687 > > > > > > Log: > > > - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY > > > addresses from being probed and attaching something including ukphy(4) > > > to it. This is mainly necessarily for PHY switches that create duplicate > > > or fake PHYs on the bus that can corrupt the PHY state when accessed or > > > simply cause problems when ukphy(4) isolates the additional instances. > > > - Change miibus(4) to be a hinted bus, allowing to add child devices via > > > hints and to set their attach arguments (including for automatically > > > probed PHYs). This is mainly needed for PHY switches that violate IEEE > > > 802.3 and don't even implement the basic register set so we can't probe > > > them automatically. However, the ability to alter the attach arguments > > > for automatically probed PHYs is also useful as for example it allows > > > to test (or tell a user to test) new variant of a PHY with a specific > > > driver by letting an existing driver attach to it via manipulating the > > > IDs without the need to touch the source code or to limit a Gigabit > > > Ethernet PHY to only announce up to Fast Ethernet in order to save > > > energy by limiting the capability mask. Generally, a driver has to > > > be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" > > > (which already is sufficient to add phydrvX at miibusY at PHY address > > > Z). Then optionally the following attach arguments additionally can > > > be configured: > > > hint.phydrv.X.id1 > > > hint.phydrv.X.id2 > > > hint.phydrv.X.capmask > > > - Some minor cleanup. > > > > I was looking at this today with bz to try to figure out how to use this. > > It strikes me that in a case of a bus with devices that have IDs it can > > be useful to not hardcode the driver name and unit number, but to be able > > to create a device and let the normal driver probe mechanics work. The > > existing miibus_hinted_child() routine already largely enforces that by > > ensuring that any new child has a unique phyno address. Two approaches I > > can think of are: > > > > 1) Never hardcode the name and unit number. > > > > 2) Don't hardcode the name and unit number if the name is "phy". > > > > This would let you do something like: > > > > hint.phy.0.at="miibus0" > > hint.phy.0.phyno="1" > > hint.phy.0.id1="xxx" > > hint.phy.0.id2="yyy" > > > > And then 'e1000phy' or 'brphy' or whoever could manage the phy. Though > > perhaps in the case of hinted children you want to always force the phy > > driver? > > > > I think to understand what you mean but fail to see an actual > use case for it. If there's a real PHY on a MII bus a specialized > driver like e1000phy(4) already knows about, there's no reason > to use a hint to force it to probe and attach as that will be > done automatically. If on the other hand, you'd want to say > e1000phy(4) probe and attach a PHY it doesn't know about, you'd > need to also alter its probe table but your approach doesn't > provide any means to link a PHY hint with a certain driver. > In general, the use for the latter is also very limited in > reality as drivers have to not only take IDs into account but > also things like chip revisions etc. (that's also why I think > that attempts to make PCI drivers use a unified probing > approach/tables in order to provide means to patch ID lists > is rather pointless). > The main purpose of the above commit is to force wildcard/hoover > drivers like ukphy(4) to attach to non-IEEE 802.3 compliant "PHYs" > without proper ID registers like so: > hint.ukphy.0.at="miibus0" > hint.ukphy.0.phyno="2" > The use of the name of the driver to probe and attach in these > hints mainly was done for consistency with the ISA etc. hints > we have. > However, as noted in the commit message, you can actually > (ab)use these hints to also make a specialized driver probe and > attach an unknown PHY (real or not) by faking the ID registers > of a PHY it knows of. Note that for this to work, you actually > need to put the appropriate contents of real ID registers into > these hints and not just OUI and model as found in the driver. > As noted above, the use for this method might be very limited > in reality. Ah, this is actually the specific use case bz@ is running into. :) That said, I do agree it's quite rare, and it may indeed be fine to just hardcode the name/unit in that case. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 12:36:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E182B106564A; Fri, 24 Aug 2012 12:36:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id B75068FC0A; Fri, 24 Aug 2012 12:36:26 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1100EB95D; Fri, 24 Aug 2012 08:36:26 -0400 (EDT) From: John Baldwin To: Warner Losh Date: Fri, 24 Aug 2012 08:30:46 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208232131.q7NLVqm6098185@svn.freebsd.org> In-Reply-To: <201208232131.q7NLVqm6098185@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208240830.46202.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 24 Aug 2012 08:36:26 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239623 - head/sys/arm/at91 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, 24 Aug 2012 12:36:27 -0000 On Thursday, August 23, 2012 5:31:52 pm Warner Losh wrote: > Author: imp > Date: Thu Aug 23 21:31:52 2012 > New Revision: 239623 > URL: http://svn.freebsd.org/changeset/base/239623 > > Log: > Use proper resource type when freeing. > > Submitted by: Ian Lapore (indirectly in a larger patch) > > Modified: > head/sys/arm/at91/at91_mci.c > > Modified: head/sys/arm/at91/at91_mci.c > ============================================================================== > --- head/sys/arm/at91/at91_mci.c Thu Aug 23 19:40:28 2012 (r239622) > +++ head/sys/arm/at91/at91_mci.c Thu Aug 23 21:31:52 2012 (r239623) > @@ -299,7 +299,7 @@ at91_mci_deactivate(device_t dev) > sc->intrhand = 0; > bus_generic_detach(sc->dev); > if (sc->mem_res) > - bus_release_resource(dev, SYS_RES_IOPORT, > + bus_release_resource(dev, SYS_RES_MEMORY, > rman_get_rid(sc->mem_res), sc->mem_res); If I had my way, it would just be 'bus_release_resource(dev, sc->mem_res);'. There's no good reason the resource can't store its rid and type internally. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 13:11:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0CB65106566B; Fri, 24 Aug 2012 13:11:31 +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 EB4AC8FC16; Fri, 24 Aug 2012 13:11:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7ODBU4W041938; Fri, 24 Aug 2012 13:11:30 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7ODBUnE041936; Fri, 24 Aug 2012 13:11:30 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208241311.q7ODBUnE041936@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 24 Aug 2012 13:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239648 - stable/9/sbin/shutdown 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, 24 Aug 2012 13:11:31 -0000 Author: des Date: Fri Aug 24 13:11:30 2012 New Revision: 239648 URL: http://svn.freebsd.org/changeset/base/239648 Log: MFH (r238968): restore a piece of BSD history Modified: stable/9/sbin/shutdown/shutdown.c Directory Properties: stable/9/sbin/shutdown/ (props changed) Modified: stable/9/sbin/shutdown/shutdown.c ============================================================================== --- stable/9/sbin/shutdown/shutdown.c Fri Aug 24 11:44:47 2012 (r239647) +++ stable/9/sbin/shutdown/shutdown.c Fri Aug 24 13:11:30 2012 (r239648) @@ -93,7 +93,7 @@ static char mbuf[BUFSIZ]; static const char *nosync, *whom; static void badtime(void); -static void perform_shutdown(void); +static void die_you_gravy_sucking_pig_dog(void); static void finish(int); static void getoffset(char *); static void loop(void); @@ -282,7 +282,7 @@ loop(void) if (!tp->timeleft) break; } - perform_shutdown(); + die_you_gravy_sucking_pig_dog(); } static jmp_buf alarmbuf; @@ -349,7 +349,7 @@ timeout(int signo __unused) } static void -perform_shutdown(void) +die_you_gravy_sucking_pig_dog(void) { char *empty_environ[] = { NULL }; From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 13:55:22 2012 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 D02BD106566B; Fri, 24 Aug 2012 13:55:22 +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 BAB5E8FC08; Fri, 24 Aug 2012 13:55:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7ODtMAf047723; Fri, 24 Aug 2012 13:55:22 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7ODtMHs047720; Fri, 24 Aug 2012 13:55:22 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208241355.q7ODtMHs047720@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 24 Aug 2012 13:55: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: r239649 - head/release/doc/en_US.ISO8859-1/relnotes 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, 24 Aug 2012 13:55:22 -0000 Author: bschmidt Date: Fri Aug 24 13:55:22 2012 New Revision: 239649 URL: http://svn.freebsd.org/changeset/base/239649 Log: Document update of 802.11s IE identifiers. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 13:11:30 2012 (r239648) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 13:55:22 2012 (r239649) @@ -282,6 +282,13 @@ A bug in TCP options padding, where the wrong padding bytes were used, has been fixed. + The IEEE 802.11s element identifiers have + been updated to reflect the final version of the amendment. This + update breaks compatibility with older mesh setups but is necessary + as the previous IDs are used by another amendment leading to + unexpected results when trying to associate with an accesspoint + using the affected IDs. + From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 14:11:54 2012 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 B2AB2106566C; Fri, 24 Aug 2012 14:11:54 +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 9BBD88FC12; Fri, 24 Aug 2012 14:11:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OEBsPh049955; Fri, 24 Aug 2012 14:11:54 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OEBs4M049952; Fri, 24 Aug 2012 14:11:54 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208241411.q7OEBs4M049952@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 24 Aug 2012 14:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239650 - stable/9/release/doc/en_US.ISO8859-1/relnotes 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, 24 Aug 2012 14:11:54 -0000 Author: bschmidt Date: Fri Aug 24 14:11:54 2012 New Revision: 239650 URL: http://svn.freebsd.org/changeset/base/239650 Log: MFC r239649: Document update of 802.11s IE identifiers. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 13:55:22 2012 (r239649) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 14:11:54 2012 (r239650) @@ -871,6 +871,14 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile export9 hook has been added for NetFlow v9 data. Note that data export can be done simultaneously in both version 5 and version 9. + + The IEEE 802.11s element identifiers have + been updated to reflect the final version of the amendment. This + update breaks compatibility with older mesh setups but is necessary + as the previous IDs are used by another amendment leading to + unexpected results when trying to associate with an accesspoint + using the affected IDs. + From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 14:22:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20597106564A; Fri, 24 Aug 2012 14:22:48 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08DFB8FC0C; Fri, 24 Aug 2012 14:22:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OEMlsb051427; Fri, 24 Aug 2012 14:22:47 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OEMlJm051425; Fri, 24 Aug 2012 14:22:47 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208241422.q7OEMlJm051425@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 24 Aug 2012 14:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239651 - stable/8/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-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, 24 Aug 2012 14:22:48 -0000 Author: bschmidt Date: Fri Aug 24 14:22:47 2012 New Revision: 239651 URL: http://svn.freebsd.org/changeset/base/239651 Log: MFC r239649: Document update of 802.11s IE identifiers. Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Directory Properties: stable/8/release/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 14:11:54 2012 (r239650) +++ stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 14:22:47 2012 (r239651) @@ -718,6 +718,13 @@ &os; virtual network stack (vnet) now supports IPv4 multicast routing. + + The IEEE 802.11s element identifiers have + been updated to reflect the final version of the amendment. This + update breaks compatibility with older mesh setups but is necessary + as the previous IDs are used by another amendment leading to + unexpected results when trying to associate with an accesspoint + using the affected IDs. From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 14:50:45 2012 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 4B3B6106566B; Fri, 24 Aug 2012 14:50:45 +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 34F7B8FC15; Fri, 24 Aug 2012 14:50:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OEoj9E055168; Fri, 24 Aug 2012 14:50:45 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OEoi1x055165; Fri, 24 Aug 2012 14:50:44 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208241450.q7OEoi1x055165@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 24 Aug 2012 14:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239653 - releng/9.1/release/doc/en_US.ISO8859-1/relnotes 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, 24 Aug 2012 14:50:45 -0000 Author: bschmidt Date: Fri Aug 24 14:50:44 2012 New Revision: 239653 URL: http://svn.freebsd.org/changeset/base/239653 Log: MFC r239649: Document update of 802.11s IE identifiers. Approved by: re (kib) Modified: releng/9.1/release/doc/en_US.ISO8859-1/relnotes/article.sgml Directory Properties: releng/9.1/release/ (props changed) Modified: releng/9.1/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- releng/9.1/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 14:25:57 2012 (r239652) +++ releng/9.1/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 14:50:44 2012 (r239653) @@ -871,6 +871,14 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile export9 hook has been added for NetFlow v9 data. Note that data export can be done simultaneously in both version 5 and version 9. + + The IEEE 802.11s element identifiers have + been updated to reflect the final version of the amendment. This + update breaks compatibility with older mesh setups but is necessary + as the previous IDs are used by another amendment leading to + unexpected results when trying to associate with an accesspoint + using the affected IDs. + From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 16:37:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5AE86106564A; Fri, 24 Aug 2012 16:37:01 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 451278FC0A; Fri, 24 Aug 2012 16:37:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OGb0R3069245; Fri, 24 Aug 2012 16:37:00 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OGb079069242; Fri, 24 Aug 2012 16:37:00 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201208241637.q7OGb079069242@svn.freebsd.org> From: Roman Divacky Date: Fri, 24 Aug 2012 16:37: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: r239654 - in head/gnu/usr.bin/binutils: as libbfd 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, 24 Aug 2012 16:37:01 -0000 Author: rdivacky Date: Fri Aug 24 16:37:00 2012 New Revision: 239654 URL: http://svn.freebsd.org/changeset/base/239654 Log: Dont use -Werror when building libbfd and gnu as on powerpc64 with clang as there are warnings. Reviewed by: nwhitehorn Modified: head/gnu/usr.bin/binutils/as/Makefile head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Fri Aug 24 14:50:44 2012 (r239653) +++ head/gnu/usr.bin/binutils/as/Makefile Fri Aug 24 16:37:00 2012 (r239654) @@ -8,6 +8,10 @@ .PATH: ${SRCDIR}/gas ${SRCDIR}/gas/config +.if ${TARGET_ARCH} == "powerpc64" +NO_WERROR.clang= +.endif + PROG= as SRCS+= app.c \ as.c \ Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 ============================================================================== --- head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 Fri Aug 24 14:50:44 2012 (r239653) +++ head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 Fri Aug 24 16:37:00 2012 (r239654) @@ -3,6 +3,7 @@ ARCHS+= rs6000 DEFAULT_VECTOR= bfd_elf64_powerpc_vec +NO_WERROR.clang= SRCS+= cpu-powerpc.c \ cpu-rs6000.c \ From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 17:08:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC6EF106566B; Fri, 24 Aug 2012 17:08:02 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7A448FC18; Fri, 24 Aug 2012 17:08:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OH82v6073657; Fri, 24 Aug 2012 17:08:02 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OH82Hi073655; Fri, 24 Aug 2012 17:08:02 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208241708.q7OH82Hi073655@svn.freebsd.org> From: Jim Harris Date: Fri, 24 Aug 2012 17:08: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: r239655 - head/sys/cam/scsi 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, 24 Aug 2012 17:08:03 -0000 Author: jimharris Date: Fri Aug 24 17:08:02 2012 New Revision: 239655 URL: http://svn.freebsd.org/changeset/base/239655 Log: Fix scsi_da's BIO_DELETE->SCSI_UNMAP translation to use correct local variable when determining various sizes related to SCSI UNMAP block descriptor lists. Sponsored by: Intel Reviewed by: mav MFC after: 3 days Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Aug 24 16:37:00 2012 (r239654) +++ head/sys/cam/scsi/scsi_da.c Fri Aug 24 17:08:02 2012 (r239655) @@ -1849,8 +1849,8 @@ dastart(struct cam_periph *periph, union softc->params.secsize > softc->unmap_max_lba) break; } while (1); - scsi_ulto2b(count * 16 + 6, &buf[0]); - scsi_ulto2b(count * 16, &buf[2]); + scsi_ulto2b(ranges * 16 + 6, &buf[0]); + scsi_ulto2b(ranges * 16, &buf[2]); scsi_unmap(&start_ccb->csio, /*retries*/da_retry_count, @@ -1858,7 +1858,7 @@ dastart(struct cam_periph *periph, union /*tag_action*/MSG_SIMPLE_Q_TAG, /*byte2*/0, /*data_ptr*/ buf, - /*dxfer_len*/ count * 16 + 8, + /*dxfer_len*/ ranges * 16 + 8, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 17:37:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D6C2106566B; Fri, 24 Aug 2012 17: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 88D168FC12; Fri, 24 Aug 2012 17:37:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OHbDRI077514; Fri, 24 Aug 2012 17:37:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OHbDU6077511; Fri, 24 Aug 2012 17:37:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208241737.q7OHbDU6077511@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 17: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: r239656 - 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: Fri, 24 Aug 2012 17:37:13 -0000 Author: adrian Date: Fri Aug 24 17:37:12 2012 New Revision: 239656 URL: http://svn.freebsd.org/changeset/base/239656 Log: Add an accessor macro for getting access to the default DFS parameters. PR: kern/170904 Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Aug 24 17:08:02 2012 (r239655) +++ head/sys/dev/ath/if_athvar.h Fri Aug 24 17:37:12 2012 (r239656) @@ -1185,6 +1185,8 @@ void ath_intr(void *); ((*(_ah)->ah_enableDfs)((_ah), (_param))) #define ath_hal_getdfsthresh(_ah, _param) \ ((*(_ah)->ah_getDfsThresh)((_ah), (_param))) +#define ath_hal_getdfsdefaultthresh(_ah, _param) \ + ((*(_ah)->ah_getDfsDefaultThresh)((_ah), (_param))) #define ath_hal_procradarevent(_ah, _rxs, _fulltsf, _buf, _event) \ ((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), \ (_buf), (_event))) From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 17:37:52 2012 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 5E684106566C; Fri, 24 Aug 2012 17:37:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4971B8FC08; Fri, 24 Aug 2012 17:37:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OHbqtY077620; Fri, 24 Aug 2012 17:37:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OHbq6e077618; Fri, 24 Aug 2012 17:37:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208241737.q7OHbq6e077618@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 17:37: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: r239657 - head/sys/dev/ath/ath_hal/ar5212 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, 24 Aug 2012 17:37:52 -0000 Author: adrian Date: Fri Aug 24 17:37:51 2012 New Revision: 239657 URL: http://svn.freebsd.org/changeset/base/239657 Log: Correctly handle the "pe_enabled" flag - both when configuring DFS and fetching the current DFS configuration. PR: kern/170904 Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 17:37:12 2012 (r239656) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 17:37:51 2012 (r239657) @@ -1160,7 +1160,12 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ val &= ~AR_PHY_RADAR_0_INBAND; val |= SM(pe->pe_inband, AR_PHY_RADAR_0_INBAND); } - OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA); + if (pe->pe_enabled) + val |= AR_PHY_RADAR_0_ENA; + else + val &= ~ AR_PHY_RADAR_0_ENA; + + OS_REG_WRITE(ah, AR_PHY_RADAR_0, val); } /* @@ -1206,6 +1211,7 @@ ar5212GetDfsThresh(struct ath_hal *ah, H pe->pe_height = MS(val, AR_PHY_RADAR_0_HEIGHT); pe->pe_prssi = MS(val, AR_PHY_RADAR_0_PRSSI); pe->pe_inband = MS(val, AR_PHY_RADAR_0_INBAND); + pe->pe_enabled = !! (val & AR_PHY_RADAR_0_ENA); pe->pe_relpwr = 0; pe->pe_relstep = 0; From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 17:39:58 2012 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 3E1081065670; Fri, 24 Aug 2012 17:39: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 1F13B8FC0C; Fri, 24 Aug 2012 17:39:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OHdvN5077925; Fri, 24 Aug 2012 17:39:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OHdvlH077922; Fri, 24 Aug 2012 17:39:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208241739.q7OHdvlH077922@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 17:39: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: r239658 - head/sys/dev/ath/ath_dfs/null 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, 24 Aug 2012 17:39:58 -0000 Author: adrian Date: Fri Aug 24 17:39:57 2012 New Revision: 239658 URL: http://svn.freebsd.org/changeset/base/239658 Log: Remove the hard-coded AR5416-series parameters and instead use the DFS parameters fetched from the HAL. Check whether the specific chipset supports RADAR reporting before enabling DFS; or some of the (unset) DFS methods may fail. Tested: * AR5210 (correctly didn't enable radar PHY reporting) * AR5212 (correctly enabled radar PHY reporting w/ the correct default parameters.) TODO: * Now that I have this capability check in place, I could remove the (empty) DFS methods from AR5210/AR5211. * Test on AR5416, AR9160, AR9280. PR: kern/170904 Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Fri Aug 24 17:37:51 2012 (r239657) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Fri Aug 24 17:39:57 2012 (r239658) @@ -72,28 +72,6 @@ __FBSDID("$FreeBSD$"); #include /* - * These are default parameters for the AR5416 and - * later 802.11n NICs. They simply enable some - * radar pulse event generation. - * - * These are very likely not valid for the AR5212 era - * NICs. - * - * Since these define signal sizing and threshold - * parameters, they may need changing based on the - * specific antenna and receive amplifier - * configuration. - */ -#define AR5416_DFS_FIRPWR -33 -#define AR5416_DFS_RRSSI 20 -#define AR5416_DFS_HEIGHT 10 -#define AR5416_DFS_PRSSI 15 -#define AR5416_DFS_INBAND 15 -#define AR5416_DFS_RELPWR 8 -#define AR5416_DFS_RELSTEP 12 -#define AR5416_DFS_MAXLEN 255 - -/* * Methods which are required */ @@ -125,30 +103,27 @@ ath_dfs_radar_enable(struct ath_softc *s #if 0 HAL_PHYERR_PARAM pe; + /* Check if the hardware supports radar reporting */ + /* XXX TODO: migrate HAL_CAP_RADAR/HAL_CAP_AR to somewhere public! */ + if (ath_hal_getcapability(sc->sc_ah, + HAL_CAP_PHYDIAG, 0, NULL) != HAL_OK) + return (0); + /* Check if the current channel is radar-enabled */ if (! IEEE80211_IS_CHAN_DFS(chan)) return (0); + /* Fetch the default parameters */ + memset(&pe, '\0', sizeof(pe)); + if (! ath_hal_getdfsdefaultthresh(sc->sc_ah, &pe)) + return (0); + /* Enable radar PHY error reporting */ sc->sc_dodfs = 1; - /* - * These are general examples of the parameter values - * to use when configuring radar pulse detection for - * the AR5416, AR91xx, AR92xx NICs. They are only - * for testing and do require tuning depending upon the - * hardware and deployment specifics. - */ - pe.pe_firpwr = AR5416_DFS_FIRPWR; - pe.pe_rrssi = AR5416_DFS_RRSSI; - pe.pe_height = AR5416_DFS_HEIGHT; - pe.pe_prssi = AR5416_DFS_PRSSI; - pe.pe_inband = AR5416_DFS_INBAND; - pe.pe_relpwr = AR5416_DFS_RELPWR; - pe.pe_relstep = AR5416_DFS_RELSTEP; - pe.pe_maxlen = AR5416_DFS_MAXLEN; + /* Tell the hardware to enable radar reporting */ pe.pe_enabled = 1; - + /* Flip on extension channel events only if doing HT40 */ if (IEEE80211_IS_CHAN_HT40(chan)) pe.pe_extchannel = 1; From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 20:41:32 2012 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 A0ADC1065670; Fri, 24 Aug 2012 20:41: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 8A39A8FC17; Fri, 24 Aug 2012 20:41:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OKfWP7001722; Fri, 24 Aug 2012 20:41:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OKfWnU001719; Fri, 24 Aug 2012 20:41:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208242041.q7OKfWnU001719@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Aug 2012 20:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239662 - in stable/9/sys: amd64/conf i386/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: Fri, 24 Aug 2012 20:41:32 -0000 Author: jhb Date: Fri Aug 24 20:41:31 2012 New Revision: 239662 URL: http://svn.freebsd.org/changeset/base/239662 Log: MFC 233872: Add descriptions after the 'device' line for several NICs to match the existing style. Modified: stable/9/sys/amd64/conf/NOTES stable/9/sys/i386/conf/NOTES Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Fri Aug 24 17:48:55 2012 (r239661) +++ stable/9/sys/amd64/conf/NOTES Fri Aug 24 20:41:31 2012 (r239662) @@ -298,18 +298,18 @@ options DRM_DEBUG # Include debug print # wpi: Intel 3945ABG Wireless LAN controller # Requires the wpi firmware module -device ed +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards options ED_3C503 options ED_HPP options ED_SIC -device ipw -device iwi -device iwn -device mwl -device nfe -device nve +device ipw # Intel 2100 wireless NICs. +device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. +device iwn # Intel 4965/1000/5000/6000 wireless NICs. +device mwl # Marvell 88W8363 802.11n wireless NICs. +device nfe # nVidia nForce MCP on-board Ethernet +device nve # nVidia nForce MCP on-board Ethernet Networking device sfxge -device wpi +device wpi # Intel 3945ABG wireless NICs. # IEEE 802.11 adapter firmware modules Modified: stable/9/sys/i386/conf/NOTES ============================================================================== --- stable/9/sys/i386/conf/NOTES Fri Aug 24 17:48:55 2012 (r239661) +++ stable/9/sys/i386/conf/NOTES Fri Aug 24 20:41:31 2012 (r239662) @@ -574,7 +574,7 @@ hint.mse.0.irq="5" device ce device cp -device cs +device cs # Crystal Semiconductor CS89x0 NIC hint.cs.0.at="isa" hint.cs.0.port="0x300" device ctau @@ -583,7 +583,7 @@ hint.ctau.0.port="0x240" hint.ctau.0.irq="15" hint.ctau.0.drq="7" #options NETGRAPH_CRONYX # Enable NETGRAPH support for Cronyx adapter(s) -device ed +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards options ED_3C503 options ED_HPP options ED_SIC @@ -591,21 +591,22 @@ hint.ed.0.at="isa" hint.ed.0.port="0x280" hint.ed.0.irq="5" hint.ed.0.maddr="0xd8000" -device ie # Hints only required for Starlan +device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. +# Hints only required for Starlan hint.ie.2.at="isa" hint.ie.2.port="0x300" hint.ie.2.irq="5" hint.ie.2.maddr="0xd0000" -device ipw -device iwi -device iwn +device ipw # Intel 2100 wireless NICs. +device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. +device iwn # Intel 4965/1000/5000/6000 wireless NICs. # Hint for the i386-only ISA front-end of le(4). hint.le.0.at="isa" hint.le.0.port="0x280" hint.le.0.irq="10" hint.le.0.drq="0" -device mwl -device nfe # nVidia nForce MCP on-board Ethernet Networking +device mwl # Marvell 88W8363 802.11n wireless NICs. +device nfe # nVidia nForce MCP on-board Ethernet device nve # nVidia nForce MCP on-board Ethernet Networking device sbni hint.sbni.0.at="isa" @@ -617,7 +618,7 @@ hint.wl.0.at="isa" hint.wl.0.port="0x300" options WLCACHE # enables the signal-strength cache options WLDEBUG # enables verbose debugging output -device wpi +device wpi # Intel 3945ABG wireless NICs. # IEEE 802.11 adapter firmware modules From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 21:08:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18D91106564A; Fri, 24 Aug 2012 21:08:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 048258FC0A; Fri, 24 Aug 2012 21:08:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OL8un6005301; Fri, 24 Aug 2012 21:08:56 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OL8uIs005299; Fri, 24 Aug 2012 21:08:56 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201208242108.q7OL8uIs005299@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 24 Aug 2012 21:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239663 - head/usr.sbin/pkg 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, 24 Aug 2012 21:08:57 -0000 Author: bapt Date: Fri Aug 24 21:08:56 2012 New Revision: 239663 URL: http://svn.freebsd.org/changeset/base/239663 Log: - change ALWAYS_ASSUME_YES to ASSUME_ALWAYS_YES for consistency with pkg(8) - if not on a tty prompt about the missing pkg(8) but default on 'no' except if ASSUME_ALWAYS_YES is set MFC after: 2 days Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Fri Aug 24 20:41:31 2012 (r239662) +++ head/usr.sbin/pkg/pkg.c Fri Aug 24 21:08:56 2012 (r239663) @@ -425,10 +425,12 @@ main(__unused int argc, char *argv[]) * not tty. Check the environment to see if user has answer * tucked in there already. */ - if (getenv("ALWAYS_ASSUME_YES") == NULL && - isatty(fileno(stdin))) { + if (getenv("ASSUME_ALWAYS_YES") == NULL) { printf("%s", confirmation_message); - if (pkg_query_yes_no() == 0) + if (isatty(fileno(stdin)) && + pkg_query_yes_no() == 0) + exit(EXIT_FAILURE); + else exit(EXIT_FAILURE); } if (bootstrap_pkg() != 0) From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 21:45:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4E83B1065673; Fri, 24 Aug 2012 21:45:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A3638FC14; Fri, 24 Aug 2012 21:45:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OLjrT3010297; Fri, 24 Aug 2012 21:45:53 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OLjrqB010295; Fri, 24 Aug 2012 21:45:53 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201208242145.q7OLjrqB010295@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 24 Aug 2012 21:45: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: r239664 - head/usr.sbin/pkg 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, 24 Aug 2012 21:45:53 -0000 Author: bapt Date: Fri Aug 24 21:45:52 2012 New Revision: 239664 URL: http://svn.freebsd.org/changeset/base/239664 Log: Fix confirmation logic when detecting a tty Reported by: mjg Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Fri Aug 24 21:08:56 2012 (r239663) +++ head/usr.sbin/pkg/pkg.c Fri Aug 24 21:45:52 2012 (r239664) @@ -427,10 +427,10 @@ main(__unused int argc, char *argv[]) */ if (getenv("ASSUME_ALWAYS_YES") == NULL) { printf("%s", confirmation_message); - if (isatty(fileno(stdin)) && - pkg_query_yes_no() == 0) + if (!isatty(fileno(stdin))) exit(EXIT_FAILURE); - else + + if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } if (bootstrap_pkg() != 0) From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 22:04:17 2012 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 71DAB106564A; Fri, 24 Aug 2012 22:04:17 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE8E8FC16; Fri, 24 Aug 2012 22:04:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7OM4HO9012765; Fri, 24 Aug 2012 22:04:17 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OM4HX0012763; Fri, 24 Aug 2012 22:04:17 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208242204.q7OM4HX0012763@svn.freebsd.org> From: Jim Harris Date: Fri, 24 Aug 2012 22:04: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: r239665 - head/sys/dev/isci 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, 24 Aug 2012 22:04:17 -0000 Author: jimharris Date: Fri Aug 24 22:04:16 2012 New Revision: 239665 URL: http://svn.freebsd.org/changeset/base/239665 Log: Clear freeze bit before calling xpt_release_devq. This ensures that any ccbs which immediately start during the call to xpt_release_devq see an accurate picture of the frozen_lun_mask. Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/isci/isci_remote_device.c Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Fri Aug 24 21:45:52 2012 (r239664) +++ head/sys/dev/isci/isci_remote_device.c Fri Aug 24 22:04:16 2012 (r239665) @@ -278,12 +278,12 @@ isci_remote_device_release_lun_queue(str if (remote_device->frozen_lun_mask & (1 << lun)) { struct cam_path *path; + remote_device->frozen_lun_mask &= ~(1 << lun); xpt_create_path(&path, xpt_periph, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_release_devq(path, 1, TRUE); xpt_free_path(path); - remote_device->frozen_lun_mask &= ~(1 << lun); } } From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 00:47:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB685106564A; Sat, 25 Aug 2012 00:47:55 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B77528FC0A; Sat, 25 Aug 2012 00:47:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7P0lt7H036748; Sat, 25 Aug 2012 00:47:55 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P0ltM2036746; Sat, 25 Aug 2012 00:47:55 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201208250047.q7P0ltM2036746@svn.freebsd.org> From: Rui Paulo Date: Sat, 25 Aug 2012 00:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239666 - head/sys/powerpc/aim 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, 25 Aug 2012 00:47:55 -0000 Author: rpaulo Date: Sat Aug 25 00:47:55 2012 New Revision: 239666 URL: http://svn.freebsd.org/changeset/base/239666 Log: Set mdp only under #ifdef WII. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Fri Aug 24 22:04:16 2012 (r239665) +++ head/sys/powerpc/aim/machdep.c Sat Aug 25 00:47:55 2012 (r239666) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" +#include "opt_platform.h" #include #include @@ -268,6 +269,7 @@ powerpc_init(vm_offset_t startkernel, vm trap_offset = 0; cacheline_warn = 0; +#ifdef WII /* * The Wii loader doesn't pass us any environment so, mdp * points to garbage at this point. The Wii CPU is a 750CL. @@ -275,6 +277,7 @@ powerpc_init(vm_offset_t startkernel, vm vers = mfpvr(); if ((vers & 0xfffff0e0) == (MPC750 << 16 | MPC750CL)) mdp = NULL; +#endif /* * Parse metadata if present and fetch parameters. Must be done From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 07:47:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E147106564A; Sat, 25 Aug 2012 07:47:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5998B8FC15; Sat, 25 Aug 2012 07:47:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7P7lDcU001305; Sat, 25 Aug 2012 07:47:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P7lD63001303; Sat, 25 Aug 2012 07:47:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250747.q7P7lD63001303@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 07:47: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: r239667 - head/sys/dev/gxemul/cons 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, 25 Aug 2012 07:47:13 -0000 Author: rwatson Date: Sat Aug 25 07:47:12 2012 New Revision: 239667 URL: http://svn.freebsd.org/changeset/base/239667 Log: Rename the gxemul console device to "ttyu0" to match the expectations of the default MIPS /etc/ttys. Sponsored by: DARPA, AFRL Modified: head/sys/dev/gxemul/cons/gxemul_cons.c Modified: head/sys/dev/gxemul/cons/gxemul_cons.c ============================================================================== --- head/sys/dev/gxemul/cons/gxemul_cons.c Sat Aug 25 00:47:55 2012 (r239666) +++ head/sys/dev/gxemul/cons/gxemul_cons.c Sat Aug 25 07:47:12 2012 (r239667) @@ -218,7 +218,7 @@ static void gxemul_cons_cnprobe(struct consdev *cp) { - sprintf(cp->cn_name, "gxcons"); + sprintf(cp->cn_name, "ttyu0"); cp->cn_pri = CN_NORMAL; } @@ -279,7 +279,7 @@ gxemul_cons_ttyinit(void *unused) tp = tty_alloc(&gxemul_cons_ttydevsw, NULL); tty_init_console(tp, 0); - tty_makedev(tp, NULL, "%s", "gxcons"); + tty_makedev(tp, NULL, "%s", "ttyu0"); callout_init(&gxemul_cons_callout, CALLOUT_MPSAFE); callout_reset(&gxemul_cons_callout, gxemul_cons_polltime, gxemul_cons_timeout, tp); From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 07:48:53 2012 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 6E370106566C; Sat, 25 Aug 2012 07:48:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59C778FC14; Sat, 25 Aug 2012 07:48:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7P7mr0u001557; Sat, 25 Aug 2012 07:48:53 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P7mr1B001555; Sat, 25 Aug 2012 07:48:53 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250748.q7P7mr1B001555@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 07:48: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: r239668 - head/sys/dev/gxemul/cons 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, 25 Aug 2012 07:48:53 -0000 Author: rwatson Date: Sat Aug 25 07:48:52 2012 New Revision: 239668 URL: http://svn.freebsd.org/changeset/base/239668 Log: In the gxemul console, check the RB_SERIAL boot flag, and change the relative priority of the gxemul console in line with its role as a "seiral console". This allows it to override video console drivers that might otherwise take precdence, subject to that boot flag. Sponsored by: DARPA, AFRL Modified: head/sys/dev/gxemul/cons/gxemul_cons.c Modified: head/sys/dev/gxemul/cons/gxemul_cons.c ============================================================================== --- head/sys/dev/gxemul/cons/gxemul_cons.c Sat Aug 25 07:47:12 2012 (r239667) +++ head/sys/dev/gxemul/cons/gxemul_cons.c Sat Aug 25 07:48:52 2012 (r239668) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -219,7 +220,7 @@ gxemul_cons_cnprobe(struct consdev *cp) { sprintf(cp->cn_name, "ttyu0"); - cp->cn_pri = CN_NORMAL; + cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; } static void From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 08:02:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2EBFE106564A; Sat, 25 Aug 2012 08:02:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC1C8FC0A; Sat, 25 Aug 2012 08:02:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7P82k2l003488; Sat, 25 Aug 2012 08:02:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P82ksh003486; Sat, 25 Aug 2012 08:02:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250802.q7P82ksh003486@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 08:02: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: r239669 - head/sys/mips/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: Sat, 25 Aug 2012 08:02:47 -0000 Author: rwatson Date: Sat Aug 25 08:02:46 2012 New Revision: 239669 URL: http://svn.freebsd.org/changeset/base/239669 Log: On MIPS, when printing page fault information for an unexpected exception type, explicitly print out "unknown" rather than the empty string, and include the exception type number for ease of debugging. Sponsored by: DARPA, AFRL Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Sat Aug 25 07:48:52 2012 (r239668) +++ head/sys/mips/mips/trap.c Sat Aug 25 08:02:46 2012 (r239669) @@ -1465,15 +1465,17 @@ log_bad_page_fault(char *msg, struct tra read_or_write = "read"; break; default: - read_or_write = ""; + read_or_write = "unknown"; } pc = frame->pc + (DELAYBRANCH(frame->cause) ? 4 : 0); - log(LOG_ERR, "%s: pid %d tid %ld (%s), uid %d: pc %#jx got a %s fault at %#jx\n", + log(LOG_ERR, "%s: pid %d tid %ld (%s), uid %d: pc %#jx got a %s fault " + "(type %#x) at %#jx\n", msg, p->p_pid, (long)td->td_tid, p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, (intmax_t)pc, read_or_write, + trap_type, (intmax_t)frame->badvaddr); /* log registers in trap frame */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 08:09:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C430106564A; Sat, 25 Aug 2012 08:09:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 665838FC14; Sat, 25 Aug 2012 08:09:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7P89cH6004451; Sat, 25 Aug 2012 08:09:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P89cdS004442; Sat, 25 Aug 2012 08:09:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250809.q7P89cdS004442@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 08:09: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: r239670 - in head/sys: conf dev/fb dev/syscons mips/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: Sat, 25 Aug 2012 08:09:38 -0000 Author: rwatson Date: Sat Aug 25 08:09:37 2012 New Revision: 239670 URL: http://svn.freebsd.org/changeset/base/239670 Log: Provide basic glue to allow syscons to be used on MIPS, modelled on PowerPC support. This was clearly not something syscons was designed to do (very specific assumptions about the nature of VGA consoles on PCs), but fortunately others have long since blazed the way on making it work regardless of that. Sponsored by: DARPA, AFRL Added: head/sys/mips/mips/sc_machdep.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/conf/options.mips head/sys/dev/fb/fbreg.h head/sys/dev/syscons/schistory.c head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/syscons.c Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/conf/files.mips Sat Aug 25 08:09:37 2012 (r239670) @@ -122,3 +122,9 @@ dev/ofw/ofw_fdt.c optional fdt dev/fdt/fdt_mips.c optional fdt +dev/fb/fb.c optional sc +dev/kbd/kbd.c optional sc +dev/syscons/scgfbrndr.c optional sc +dev/syscons/scterm-teken.c optional sc +dev/syscons/scvtb.c optional sc +mips/mips/sc_machdep.c optional sc Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/conf/options.mips Sat Aug 25 08:09:37 2012 (r239670) @@ -46,6 +46,10 @@ CFE_CONSOLE opt_global.h CFE_ENV opt_global.h CFE_ENV_SIZE opt_global.h +GFB_DEBUG opt_gfb.h +GFB_NO_FONT_LOADING opt_gfb.h +GFB_NO_MODE_CHANGE opt_gfb.h + NOFPU opt_global.h TICK_USE_YAMON_FREQ opt_global.h Modified: head/sys/dev/fb/fbreg.h ============================================================================== --- head/sys/dev/fb/fbreg.h Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/dev/fb/fbreg.h Sat Aug 25 08:09:37 2012 (r239670) @@ -92,6 +92,29 @@ void ofwfb_fillw(int pat, void *base, si u_int16_t ofwfb_readw(u_int16_t *addr); void ofwfb_writew(u_int16_t *addr, u_int16_t val); +#elif defined(__mips__) + +/* + * Use amd64/i386-like settings under the assumption that MIPS-based display + * drivers will have to add a level of indirection between a syscons-managed + * frame buffer and the actual video hardware. We are forced to do this + * because syscons doesn't carry around required busspace handles and tags to + * use here. This is only really a problem for true VGA devices hooked up to + * MIPS, as others will be performing a translation anyway. + */ +#define bcopy_io(s, d, c) memcpy((void *)(d), (void *)(s), (c)) +#define bcopy_toio(s, d, c) memcpy((void *)(d), (void *)(s), (c)) +#define bcopy_fromio(s, d, c) memcpy((void *)(d), (void *)(s), (c)) +#define bzero_io(d, c) memset((void *)(d), 0, (c)) +#define fill_io(p, d, c) memset((void *)(d), (p), (c)) +static __inline void +fillw(int val, uint16_t *buf, size_t size) +{ + while (size--) + *buf++ = val; +} +#define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) + #else /* !__i386__ && !__amd64__ && !__ia64__ && !__sparc64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) Modified: head/sys/dev/syscons/schistory.c ============================================================================== --- head/sys/dev/syscons/schistory.c Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/dev/syscons/schistory.c Sat Aug 25 08:09:37 2012 (r239670) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) #include #else #include Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/dev/syscons/scterm-teken.c Sat Aug 25 08:09:37 2012 (r239670) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) #include #else #include Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/dev/syscons/syscons.c Sat Aug 25 08:09:37 2012 (r239670) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) #include #else #include Added: head/sys/mips/mips/sc_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/sc_machdep.c Sat Aug 25 08:09:37 2012 (r239670) @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2003 Jake Burkholder. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static sc_softc_t sc_softcs[8]; + +int +sc_get_cons_priority(int *unit, int *flags) +{ + + *unit = 0; + *flags = 0; + return (CN_INTERNAL); +} + +int +sc_max_unit(void) +{ + return (1); +} + +sc_softc_t * +sc_get_softc(int unit, int flags) +{ + sc_softc_t *sc; + + if (unit < 0) + return (NULL); + sc = &sc_softcs[unit]; + sc->unit = unit; + if ((sc->flags & SC_INIT_DONE) == 0) { + sc->keyboard = -1; + sc->adapter = -1; + sc->cursor_char = SC_CURSOR_CHAR; + sc->mouse_char = SC_MOUSE_CHAR; + } + return (sc); +} + +void +sc_get_bios_values(bios_values_t *values) +{ + values->cursor_start = 0; + values->cursor_end = 32; + values->shift_state = 0; +} + +int +sc_tone(int hz) +{ + return (0); +} From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 08:31:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6D74106566B; Sat, 25 Aug 2012 08:31:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1D6B8FC14; Sat, 25 Aug 2012 08:31:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7P8VLuD007395; Sat, 25 Aug 2012 08:31:21 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P8VLkT007389; Sat, 25 Aug 2012 08:31:21 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250831.q7P8VLkT007389@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 08:31: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: r239671 - in head/sys: conf mips/beri mips/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: Sat, 25 Aug 2012 08:31:22 -0000 Author: rwatson Date: Sat Aug 25 08:31:21 2012 New Revision: 239671 URL: http://svn.freebsd.org/changeset/base/239671 Log: Add preliminary support for the SRI International / University of Cambridge Bluespec Extensible RISC Implementation (BERI) processor. BERI is a 64-bit MIPS ISA soft CPU core that can be synthesised to Altera and Xilinx FPGAs, and is being used for CPU and OS research at several institutions. Sponsored by: DARPA, AFRL Added: head/sys/mips/beri/ head/sys/mips/beri/beri_machdep.c (contents, props changed) head/sys/mips/beri/files.beri (contents, props changed) head/sys/mips/beri/std.beri (contents, props changed) Modified: head/sys/conf/options.mips head/sys/mips/mips/machdep.c Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Sat Aug 25 08:09:37 2012 (r239670) +++ head/sys/conf/options.mips Sat Aug 25 08:31:21 2012 (r239671) @@ -37,6 +37,7 @@ CPU_SB1 opt_global.h CPU_CNMIPS opt_global.h CPU_RMI opt_global.h CPU_NLM opt_global.h +CPU_BERI opt_global.h COMPAT_FREEBSD32 opt_compat.h Added: head/sys/mips/beri/beri_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/beri_machdep.c Sat Aug 25 08:31:21 2012 (r239671) @@ -0,0 +1,165 @@ +/*- + * Copyright (c) 2006 Wojciech A. Koszek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ddb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +extern int *edata; +extern int *end; + +void +platform_cpu_init() +{ + /* Nothing special */ +} + +static void +mips_init(void) +{ + int i; + + for (i = 0; i < 10; i++) { + phys_avail[i] = 0; + } + + /* phys_avail regions are in bytes */ + phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); + phys_avail[1] = ctob(realmem); + + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1]; + + physmem = realmem; + + init_param1(); + init_param2(physmem); + mips_cpu_init(); + pmap_bootstrap(); + mips_proc0_init(); + mutex_init(); + kdb_init(); +#ifdef KDB + if (boothowto & RB_KDB) + kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); +#endif +} + +/* + * Perform a board-level soft-reset. + * + * XXXRW: BERI doesn't yet have a board-level soft-reset. + */ +void +platform_reset(void) +{ + + panic("%s: not yet", __func__); +} + +void +platform_start(__register_t a0, __register_t a1, __register_t a2, + __register_t a3) +{ + vm_offset_t kernend; + uint64_t platform_counter_freq; + int argc = a0; + char **argv = (char **)a1; + char **envp = (char **)a2; + unsigned int memsize = a3; + int i; + + /* clear the BSS and SBSS segments */ + kernend = (vm_offset_t)&end; + memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + + mips_postboot_fixup(); + + mips_pcpu0_init(); + + /* + * XXXRW: We have no way to compare wallclock time to cycle rate on + * BERI, so for now assume we run at the MALTA default (100MHz). + */ + platform_counter_freq = MIPS_DEFAULT_HZ; + mips_timer_early_init(platform_counter_freq); + + cninit(); + printf("entry: platform_start()\n"); + + bootverbose = 1; + if (bootverbose) { + printf("cmd line: "); + for (i = 0; i < argc; i++) + printf("%s ", argv[i]); + printf("\n"); + + printf("envp:\n"); + for (i = 0; envp[i]; i += 2) + printf("\t%s = %s\n", envp[i], envp[i+1]); + + printf("memsize = %08x\n", memsize); + } + + realmem = btoc(memsize); + mips_init(); + + mips_timer_init_params(platform_counter_freq, 0); +} Added: head/sys/mips/beri/files.beri ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/files.beri Sat Aug 25 08:31:21 2012 (r239671) @@ -0,0 +1,4 @@ +# $FreeBSD$ +mips/beri/beri_machdep.c standard +mips/mips/intr_machdep.c standard +mips/mips/tick.c standard Added: head/sys/mips/beri/std.beri ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/std.beri Sat Aug 25 08:31:21 2012 (r239671) @@ -0,0 +1,4 @@ +# $FreeBSD$ +files "../beri/files.beri" + +cpu CPU_MIPS4KC Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Sat Aug 25 08:09:37 2012 (r239670) +++ head/sys/mips/mips/machdep.c Sat Aug 25 08:31:21 2012 (r239671) @@ -346,7 +346,12 @@ mips_vector_init(void) bcopy(MipsTLBMiss, (void *)MIPS_UTLB_MISS_EXC_VEC, MipsTLBMissEnd - MipsTLBMiss); -#if defined(__mips_n64) || defined(CPU_RMI) || defined(CPU_NLM) + /* + * XXXRW: Why don't we install the XTLB handler for all 64-bit + * architectures? + */ +#if defined(__mips_n64) || defined(CPU_RMI) || defined(CPU_NLM) || defined (CPU_BERI) +/* Fake, but sufficient, for the 32-bit with 64-bit hardware addresses */ bcopy(MipsTLBMiss, (void *)MIPS_XTLB_MISS_EXC_VEC, MipsTLBMissEnd - MipsTLBMiss); #endif From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 09:26:38 2012 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 537AA106564A; Sat, 25 Aug 2012 09:26:38 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF1B18FC12; Sat, 25 Aug 2012 09:26:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7P9QbU5014753; Sat, 25 Aug 2012 09:26:37 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P9QbcQ014751; Sat, 25 Aug 2012 09:26:37 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201208250926.q7P9QbcQ014751@svn.freebsd.org> From: Randall Stewart Date: Sat, 25 Aug 2012 09:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239672 - 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, 25 Aug 2012 09:26:38 -0000 Author: rrs Date: Sat Aug 25 09:26:37 2012 New Revision: 239672 URL: http://svn.freebsd.org/changeset/base/239672 Log: This small change takes care of a race condition that can occur when both sides close at the same time. If that occurs, without this fix the connection enters FIN1 on both sides and they will forever send FIN|ACK at each other until the connection times out. This is because we stopped processing the FIN|ACK and thus did not advance the sequence and so never ACK'd each others FIN. This fix adjusts it so we *do* process the FIN properly and the race goes away ;-) MFC after: 1 month Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Aug 25 08:31:21 2012 (r239671) +++ head/sys/netinet/tcp_input.c Sat Aug 25 09:26:37 2012 (r239672) @@ -2414,6 +2414,16 @@ tcp_do_segment(struct mbuf *m, struct tc } } else tp->snd_cwnd += tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); goto drop; } else if (tp->t_dupacks == tcprexmtthresh) { @@ -2453,6 +2463,16 @@ tcp_do_segment(struct mbuf *m, struct tc } tp->snd_nxt = th->th_ack; tp->snd_cwnd = tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); KASSERT(tp->snd_limited <= 2, ("%s: tp->snd_limited too big", @@ -2479,6 +2499,16 @@ tcp_do_segment(struct mbuf *m, struct tc (tp->snd_nxt - tp->snd_una) + (tp->t_dupacks - tp->snd_limited) * tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 10:36:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 69F44106566C; Sat, 25 Aug 2012 10:36:32 +0000 (UTC) (envelope-from thomas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 548B98FC0A; Sat, 25 Aug 2012 10:36:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PAaW6o024829; Sat, 25 Aug 2012 10:36:32 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PAaWhi024826; Sat, 25 Aug 2012 10:36:32 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201208251036.q7PAaWhi024826@svn.freebsd.org> From: Thomas Quinot Date: Sat, 25 Aug 2012 10:36: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: r239673 - head/sys/geom/multipath 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, 25 Aug 2012 10:36:32 -0000 Author: thomas Date: Sat Aug 25 10:36:31 2012 New Revision: 239673 URL: http://svn.freebsd.org/changeset/base/239673 Log: (g_multipath_rotate): Fix algorithm so that it does rotate over all good providers, not just the last two. PR: kern/170379 Reviewed by: mav MFC after: 2 weeks Modified: head/sys/geom/multipath/g_multipath.c Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Sat Aug 25 09:26:37 2012 (r239672) +++ head/sys/geom/multipath/g_multipath.c Sat Aug 25 10:36:31 2012 (r239673) @@ -590,19 +590,26 @@ g_multipath_destroy_geom(struct gctl_req static int g_multipath_rotate(struct g_geom *gp) { - struct g_consumer *lcp; + struct g_consumer *lcp, *first_good_cp = NULL; struct g_multipath_softc *sc = gp->softc; + int active_cp_seen = 0; g_topology_assert(); if (sc == NULL) return (ENXIO); LIST_FOREACH(lcp, &gp->consumer, consumer) { if ((lcp->index & MP_BAD) == 0) { - if (sc->sc_active != lcp) + if (first_good_cp == NULL) + first_good_cp = lcp; + if (active_cp_seen) break; } + if (sc->sc_active == lcp) + active_cp_seen = 1; } - if (lcp) { + if (lcp == NULL) + lcp = first_good_cp; + if (lcp && lcp != sc->sc_active) { sc->sc_active = lcp; if (sc->sc_active_active != 1) printf("GEOM_MULTIPATH: %s is now active path in %s\n", From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 11:07:43 2012 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 BE527106566C; Sat, 25 Aug 2012 11:07:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6B7B8FC16; Sat, 25 Aug 2012 11:07:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PB7h3e028272; Sat, 25 Aug 2012 11:07:43 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PB7hZR028266; Sat, 25 Aug 2012 11:07:43 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251107.q7PB7hZR028266@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 11:07: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: r239674 - in head: share/man/man4 sys/conf sys/dev/altera sys/dev/altera/avgen 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, 25 Aug 2012 11:07:43 -0000 Author: rwatson Date: Sat Aug 25 11:07:43 2012 New Revision: 239674 URL: http://svn.freebsd.org/changeset/base/239674 Log: Add altera_avgen(4), a generic device driver to be used by hard and soft CPU cores on Altera FPGAs. The device driver allows memory-mapped devices on Altera's Avalon SoC bus to be exported to userspace via device nodes. device.hints directories dictate device name, permissible access methods, physical address and length, and I/O alignment. Devices can be accessed using read(2)/write(2), but also memory mapped in userspace using mmap(2). Devices attach directly to the Nexus, as is common for embedded device drivers; in the future something more mature might be desirable. There is currently no facility to support directing device-originated interrupts to userspace. In the future, this device driver may be renamed to socgen(4), as it can in principle also be used with other system-on-chip (SoC) busses, such as Axi on ASICs and FPGAs. However, we have only tested it on Avalon busses with memory-mapped ROMs, frame buffers, etc. Sponsored by: DARPA, AFRL Added: head/share/man/man4/altera_avgen.4 (contents, props changed) head/sys/dev/altera/ head/sys/dev/altera/avgen/ head/sys/dev/altera/avgen/altera_avgen.c (contents, props changed) head/sys/dev/altera/avgen/altera_avgen.h (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 10:36:31 2012 (r239673) +++ head/share/man/man4/Makefile Sat Aug 25 11:07:43 2012 (r239674) @@ -32,6 +32,7 @@ MAN= aac.4 \ alc.4 \ ale.4 \ alpm.4 \ + altera_avgen.4 \ altq.4 \ amdpm.4 \ ${_amdsbwd.4} \ Added: head/share/man/man4/altera_avgen.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/altera_avgen.4 Sat Aug 25 11:07:43 2012 (r239674) @@ -0,0 +1,155 @@ +.\"- +.\" Copyright (c) 2012 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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$ +.\" +.Dd August 18, 2012 +.Dt ALTERA_AVGEN 4 +.Os +.Sh NAME +.Nm altera_avgen +.Nd driver for generic Altera Avalon-bus-attached, memory-mapped devices +.Sh SYNOPSIS +.Cd "device altera_avgen" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.altera_avgen.0.at="nexus0" +.Cd hint.altera_avgen.0.maddr=0x7f00a000 +.Cd hint.altera_avgen.0.msize=20 +.Cd hint.altera_avgen.0.width=4 +.Cd hint.altera_avgen.0.fileio="rw" +.Cd hint.altera_avgen.0.devname="berirom" +.Sh DESCRIPTION +The +.Nm +device driver provides generic support for memory-mapped devices on the +Altera Avalon bus. +.Pa device.hints +entries configure the address, size, I/O disposition, and +.Pa /dev +device node name that will be used. +The +.Xr open , +.Xr read , +.Xr write , +and +.Xr mmap +system calls (and variations) may be used on +.Nm +device nodes, subject to constraints imposed using +.Pa device.hints +entries. +Although reading and writing mapped memory is supported, +.Nm +does not currently support directing device interrupts to userspace. +.Pp +A number of +.Pa device.hints +sub-fields are available to configure +.Nm +device instances: +.Bl -tag -width devunit +.It maddr +base physical address of the memory region to export; must be aligned to +.Li width +.Ot msize +length of the memory region export; must be aligned to +.Li width +.It width +Granularity at which +.Xr read 2 +and +.Xr write 2 +operations will be performed. +Larger requests will be broken down into +.Li width -sized +operations; smaller requests will be rejected. +I/O operations must be aligned to +.Li width . +.It fileio +allowed file descriptor operations; +.Li r +authorizes +.Xr read 2 ; +.Li w +authorizes +.Xr write 2 . +.It mmapio +allowed +.Xr mmap 2 +permissions; +.Li w +authorizes +.Dv PROT_WRITE ; +.Li r +authorizes +.Dv PROT_READ ; +.Li x +authorizes +.Dv PROT_EXEC . +.It devname +specifies a device name relative to +.Pa /dev . +.It devunit +specifies a device unit number; no unit number is used if this is unspecified. +.El +.Sh SEE ALSO +.Xr mmap 2 , +.Xr open 2 , +.Xr read 2 , +.Xr write 2 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +This device driver was written by +.An Robert N. M. Watson . +.Sh BUGS +.Nm +is intended to support the writing of userspace device drivers; however, it +does not permit directing interrupts to userspace, only memory-mapped I/O. +.Pp +.Nm +supports only a +.Li nexus +bus attachment, which is appropriate for system-on-chip busses such as +Altera's Avalon bus. +If the target device is off of another bus type, then additional bus +attachments will be required. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 25 10:36:31 2012 (r239673) +++ head/sys/conf/files Sat Aug 25 11:07:43 2012 (r239674) @@ -659,6 +659,7 @@ dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci +dev/altera/avgen/altera_avgen.c optional altera_avgen dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr dev/amr/amr_disk.c optional amr Added: head/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/avgen/altera_avgen.c Sat Aug 25 11:07:43 2012 (r239674) @@ -0,0 +1,451 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +/* + * Generic device driver for allowing read(), write(), and mmap() on + * memory-mapped, Avalon-attached devices. There is no actual dependence on + * Avalon, so conceivably this should just be soc_dev or similar, since many + * system-on-chip bus environments would work fine with the same code. + */ + +static d_mmap_t altera_avgen_mmap; +static d_read_t altera_avgen_read; +static d_write_t altera_avgen_write; + +static struct cdevsw avg_cdevsw = { + .d_version = D_VERSION, + .d_mmap = altera_avgen_mmap, + .d_read = altera_avgen_read, + .d_write = altera_avgen_write, + .d_name = "altera_avgen", +}; + +static int +altera_avgen_read(struct cdev *dev, struct uio *uio, int flag) +{ + struct altera_avgen_softc *sc; + u_long offset, size; +#ifdef NOTYET + uint64_t v8; +#endif + uint32_t v4; + uint16_t v2; + uint8_t v1; + u_int width; + int error; + + sc = dev->si_drv1; + if ((sc->avg_flags & ALTERA_AVALON_FLAG_READ) == 0) + return (EACCES); + width = sc->avg_width; + if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || + uio->uio_resid % width != 0) + return (ENODEV); + size = rman_get_size(sc->avg_res); + if ((uio->uio_offset + uio->uio_resid < 0) || + (uio->uio_offset + uio->uio_resid > size)) + return (ENODEV); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + width > size) + return (ENODEV); + switch (width) { + case 1: + v1 = bus_read_1(sc->avg_res, offset); + error = uiomove(&v1, sizeof(v1), uio); + break; + + case 2: + v2 = bus_read_2(sc->avg_res, offset); + error = uiomove(&v2, sizeof(v2), uio); + break; + + case 4: + v4 = bus_read_4(sc->avg_res, offset); + error = uiomove(&v4, sizeof(v4), uio); + break; + +#ifdef NOTYET + case 8: + v8 = bus_read_8(sc->avg_res, offset); + error = uiomove(&v8, sizeof(v8), uio); + break; + +#endif + + default: + panic("%s: unexpected widthment %u", __func__, width); + } + if (error) + return (error); + } + return (0); +} + +static int +altera_avgen_write(struct cdev *dev, struct uio *uio, int flag) +{ + struct altera_avgen_softc *sc; + u_long offset, size; +#ifdef NOTYET + uint64_t v8; +#endif + uint32_t v4; + uint16_t v2; + uint8_t v1; + u_int width; + int error; + + sc = dev->si_drv1; + if ((sc->avg_flags & ALTERA_AVALON_FLAG_WRITE) == 0) + return (EACCES); + width = sc->avg_width; + if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || + uio->uio_resid % width != 0) + return (ENODEV); + size = rman_get_size(sc->avg_res); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + width > size) + return (ENODEV); + switch (width) { + case 1: + error = uiomove(&v1, sizeof(v1), uio); + if (error) + return (error); + bus_write_1(sc->avg_res, offset, v1); + break; + + case 2: + error = uiomove(&v2, sizeof(v2), uio); + if (error) + return (error); + bus_write_2(sc->avg_res, offset, v2); + break; + + case 4: + error = uiomove(&v4, sizeof(v4), uio); + if (error) + return (error); + bus_write_4(sc->avg_res, offset, v4); + break; + +#ifdef NOTYET + case 8: + error = uiomove(&v8, sizeof(v8), uio); + if (error) + return (error); + bus_write_8(sc->avg_res, offset, v8); + break; +#endif + + default: + panic("%s: unexpected width %u", __func__, width); + } + } + return (0); +} + +static int +altera_avgen_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) +{ + struct altera_avgen_softc *sc; + + sc = dev->si_drv1; + if (nprot & VM_PROT_READ) { + if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_READ) == 0) + return (EACCES); + } + if (nprot & VM_PROT_WRITE) { + if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_WRITE) == 0) + return (EACCES); + } + if (nprot & VM_PROT_EXECUTE) { + if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_EXEC) == 0) + return (EACCES); + } + if (trunc_page(offset) == offset && + rman_get_size(sc->avg_res) >= offset + PAGE_SIZE) { + *paddr = rman_get_start(sc->avg_res) + offset; + *memattr = VM_MEMATTR_UNCACHEABLE; + } else + return (ENODEV); + return (0); +} + +static int +altera_avgen_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Generic Altera Avalon device attachment"); + return (BUS_PROBE_DEFAULT); +} + +static int +altera_avgen_process_options(struct altera_avgen_softc *sc, + const char *str_fileio, const char *str_mmapio, const char *str_devname, + int devunit) +{ + const char *cp; + device_t dev = sc->avg_dev; + + /* + * Check for valid combinations of options. + */ + if (str_fileio == NULL && str_mmapio == NULL) { + device_printf(dev, + "at least one of %s or %s must be specified\n", + ALTERA_AVALON_STR_FILEIO, ALTERA_AVALON_STR_MMAPIO); + return (ENXIO); + } + if (str_devname == NULL && devunit != -1) { + device_printf(dev, "%s requires %s be specified\n", + ALTERA_AVALON_STR_DEVUNIT, ALTERA_AVALON_STR_DEVNAME); + return (ENXIO); + } + + /* + * Extract, digest, and save values. + */ + switch (sc->avg_width) { + case 1: + case 2: + case 4: +#ifdef NOTYET + case 8: +#endif + break; + + default: + device_printf(dev, "%s unsupported value %u\n", + ALTERA_AVALON_STR_WIDTH, sc->avg_width); + return (ENXIO); + } + sc->avg_flags = 0; + if (str_fileio != NULL) { + for (cp = str_fileio; *cp != '\0'; cp++) { + switch (*cp) { + case ALTERA_AVALON_CHAR_READ: + sc->avg_flags |= ALTERA_AVALON_FLAG_READ; + break; + + case ALTERA_AVALON_CHAR_WRITE: + sc->avg_flags |= ALTERA_AVALON_FLAG_WRITE; + break; + + default: + device_printf(dev, + "invalid %s character %c\n", + ALTERA_AVALON_STR_FILEIO, *cp); + return (ENXIO); + } + } + } + if (str_mmapio != NULL) { + for (cp = str_mmapio; *cp != '\0'; cp++) { + switch (*cp) { + case ALTERA_AVALON_CHAR_READ: + sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_READ; + break; + + case ALTERA_AVALON_CHAR_WRITE: + sc->avg_flags |= + ALTERA_AVALON_FLAG_MMAP_WRITE; + break; + + case ALTERA_AVALON_CHAR_EXEC: + sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_EXEC; + break; + + default: + device_printf(dev, + "invalid %s character %c\n", + ALTERA_AVALON_STR_MMAPIO, *cp); + return (ENXIO); + } + } + } + return (0); +} + +static int +altera_avgen_nexus_attach(device_t dev) +{ + struct altera_avgen_softc *sc; + const char *str_fileio, *str_mmapio; + const char *str_devname; + char devname[SPECNAMELEN + 1]; + int devunit, error; + + sc = device_get_softc(dev); + sc->avg_dev = dev; + sc->avg_unit = device_get_unit(dev); + + /* + * Query non-standard hints to find out what operations are permitted + * on the device, and whether it is cached. + */ + str_fileio = NULL; + str_mmapio = NULL; + str_devname = NULL; + devunit = -1; + sc->avg_width = 1; + error = resource_int_value(device_get_name(dev), device_get_unit(dev), + ALTERA_AVALON_STR_WIDTH, &sc->avg_width); + if (error != 0 && error != ENOENT) { + device_printf(dev, "invalid %s\n", ALTERA_AVALON_STR_WIDTH); + return (error); + } + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_FILEIO, &str_fileio); + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_MMAPIO, &str_mmapio); + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); + (void)resource_int_value(device_get_name(dev), device_get_unit(dev), + ALTERA_AVALON_STR_DEVUNIT, &devunit); + error = altera_avgen_process_options(sc, str_fileio, str_mmapio, + str_devname, devunit); + if (error) + return (error); + + /* Select a device name. */ + if (str_devname != NULL) { + if (devunit != -1) + (void)snprintf(devname, sizeof(devname), "%s%d", + str_devname, devunit); + else + (void)snprintf(devname, sizeof(devname), "%s", + str_devname); + } else + snprintf(devname, sizeof(devname), "%s%d", "avgen", + sc->avg_unit); + + /* Memory allocation and checking. */ + sc->avg_rid = 0; + sc->avg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->avg_rid, RF_ACTIVE); + if (sc->avg_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + return (ENXIO); + } + if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { + if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { + device_printf(dev, + "memory region not even multiple of page size\n"); + error = ENXIO; + goto error; + } + if (rman_get_start(sc->avg_res) % PAGE_SIZE != 0) { + device_printf(dev, "memory region not page-aligned\n"); + error = ENXIO; + goto error; + } + } + + /* Device node allocation. */ + if (str_devname == NULL) { + str_devname = "altera_avgen%d"; + devunit = sc->avg_unit; + } + if (devunit != -1) + sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, + GID_WHEEL, S_IRUSR | S_IWUSR, str_devname, devunit); + else + sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, + GID_WHEEL, S_IRUSR | S_IWUSR, str_devname); + if (sc->avg_cdev == NULL) { + device_printf(sc->avg_dev, "%s: make_dev failed\n", __func__); + error = ENXIO; + goto error; + } + /* XXXRW: Slight race between make_dev(9) and here. */ + sc->avg_cdev->si_drv1 = sc; + return (0); + +error: + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + return (error); +} + +static int +altera_avgen_nexus_detach(device_t dev) +{ + struct altera_avgen_softc *sc; + + sc = device_get_softc(dev); + destroy_dev(sc->avg_cdev); + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + return (0); +} + +static device_method_t altera_avgen_nexus_methods[] = { + DEVMETHOD(device_probe, altera_avgen_nexus_probe), + DEVMETHOD(device_attach, altera_avgen_nexus_attach), + DEVMETHOD(device_detach, altera_avgen_nexus_detach), + { 0, 0 } +}; + +static driver_t altera_avgen_nexus_driver = { + "altera_avgen", + altera_avgen_nexus_methods, + sizeof(struct altera_avgen_softc), +}; + +static devclass_t altera_avgen_devclass; + +DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, + 0, 0); Added: head/sys/dev/altera/avgen/altera_avgen.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/avgen/altera_avgen.h Sat Aug 25 11:07:43 2012 (r239674) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +#ifndef _DEV_ALTERA_AVALON_H_ +#define _DEV_ALTERA_AVALON_H_ + +struct altera_avgen_softc { + /* + * Bus-related fields. + */ + device_t avg_dev; + int avg_unit; + + /* + * The device node and memory-mapped I/O region. + */ + struct cdev *avg_cdev; + struct resource *avg_res; + int avg_rid; + + /* + * Access properties configured by device.hints. + */ + u_int avg_flags; + u_int avg_width; +}; + +/* + * Various flags extracted from device.hints to configure operations on the + * device. + */ +#define ALTERA_AVALON_FLAG_READ 0x01 +#define ALTERA_AVALON_FLAG_WRITE 0x02 +#define ALTERA_AVALON_FLAG_MMAP_READ 0x04 +#define ALTERA_AVALON_FLAG_MMAP_WRITE 0x08 +#define ALTERA_AVALON_FLAG_MMAP_EXEC 0x10 + +#define ALTERA_AVALON_CHAR_READ 'r' +#define ALTERA_AVALON_CHAR_WRITE 'w' +#define ALTERA_AVALON_CHAR_EXEC 'x' + +#define ALTERA_AVALON_STR_WIDTH "width" +#define ALTERA_AVALON_STR_FILEIO "fileio" +#define ALTERA_AVALON_STR_MMAPIO "mmapio" +#define ALTERA_AVALON_STR_DEVNAME "devname" +#define ALTERA_AVALON_STR_DEVUNIT "devunit" + +/* + * Driver setup routines from the bus attachment/teardown. + */ +int altera_avgen_attach(struct altera_avgen_softc *sc); +void altera_avgen_detach(struct altera_avgen_softc *sc); + +#endif /* _DEV_ALTERA_AVALON_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 11:19:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBA6F106566B; Sat, 25 Aug 2012 11:19:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B38CE8FC12; Sat, 25 Aug 2012 11:19:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PBJK6J029552; Sat, 25 Aug 2012 11:19:20 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PBJKtf029543; Sat, 25 Aug 2012 11:19:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251119.q7PBJKtf029543@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 11:19: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: r239675 - in head: share/man/man4 sys/conf sys/dev/altera/sdcard 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, 25 Aug 2012 11:19:20 -0000 Author: rwatson Date: Sat Aug 25 11:19:20 2012 New Revision: 239675 URL: http://svn.freebsd.org/changeset/base/239675 Log: Add a device driver for the Altera University Program SD Card IP Core, which can be synthesised in Altera FPGAs. An altera_sdcardc device probes during the boot, and /dev/altera_sdcard devices come and go as inserted and removed. The device driver attaches directly to the Nexus, as is common for system-on-chip device drivers. This IP core suffers a number of significant limitations, including a lack of interrupt-driven I/O -- we must implement timer-driven polling, only CSD 0 cards (up to 2G) are supported, there are serious memory access issues that require the driver to verify writes to memory-mapped buffers, undocumented alignment requirements, and erroneous error returns. The driver must therefore work quite hard, despite a fairly simple hardware-software interface. The IP core also supports at most one outstanding I/O at a time, so is not a speed demon. However, with the above workarounds, and subject to performance problems, it works quite reliably in practice, and we can use it for read-write mounts of root file systems, etc. Sponsored by: DARPA, AFRL Added: head/share/man/man4/altera_sdcard.4 (contents, props changed) head/sys/dev/altera/sdcard/ head/sys/dev/altera/sdcard/altera_sdcard.c (contents, props changed) head/sys/dev/altera/sdcard/altera_sdcard.h (contents, props changed) head/sys/dev/altera/sdcard/altera_sdcard_disk.c (contents, props changed) head/sys/dev/altera/sdcard/altera_sdcard_io.c (contents, props changed) head/sys/dev/altera/sdcard/altera_sdcard_nexus.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 11:07:43 2012 (r239674) +++ head/share/man/man4/Makefile Sat Aug 25 11:19:20 2012 (r239675) @@ -33,6 +33,7 @@ MAN= aac.4 \ ale.4 \ alpm.4 \ altera_avgen.4 \ + altera_sdcard.4 \ altq.4 \ amdpm.4 \ ${_amdsbwd.4} \ Added: head/share/man/man4/altera_sdcard.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/altera_sdcard.4 Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,118 @@ +.\"- +.\" Copyright (c) 2012 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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$ +.\" +.Dd August 18, 2012 +.Dt ALTERA_SDCARD 4 +.Os +.Sh NAME +.Nm altera_sdcard +.Nd driver for the Altera University Program Secure Data Card IP Core +.Sh SYNOPSIS +.Cd "device altera_sdcard" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.altera_sdcardc.0.at="nexus0" +.Cd hint.altera_sdcardc.0.maddr=0x7f008000 +.Cd hint.altera_sdcardc.0.msize=0x400 +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Altera University Program Secure Data +Card (SD Card) IP Core device. +A controller device, +.Li altera_sdcardcX , +will be attached during boot. +Inserted disks are presented as +.Xr disk 9 +devices, +.Li altera_sdcardX , +corresponding to the controller number. +.Sh HARDWARE +The current version of the +.Nm +driver supports the SD Card IP core as described in the August 2011 version of +Altera's documentation. +The core supports only cards up to 2G (CSD 0); larger cards, or cards using +newer CSD versions, will not be detected. +The IP core has two key limitations: a lack of interrupt support, requiring +timer-driven polling to detect I/O completion, and support for only single +512-byte block read and write operations at a time. +The combined effect of those two limits is that the system clock rate, +.Dv HZ , +must be set to at least 200 in order to accomplish the maximum 100KB/s data +rate supported by the IP core. +.Sh SEE ALSO +.Xr disk 9 +.Rs +.%T Altera University Program Secure Data Card IP Core +.%D August 2011 +.%I Altera Corporation - University Program +.%U ftp://ftp.altera.com/up/pub/Altera_Material/11.0/University_Program_IP_Cores/Memory/SD_Card_Interface_for_SoPC_Builder.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +This device driver was written by +.An Robert N. M. Watson . +.Sh BUGS +.Nm +contains a number of work-arounds for IP core bugs. +Perhaps most critically, +.Nm +ignores the CRC error bit returned in the RR1 register, which appears to be +unexpectedly set by the IP core. +.Pp +.Nm +uses fixed polling intervals are used for card insertion/removal and +I/O completion detection; an adaptive strategy might improve performance by +reducing the latency to detecting completed I/O. +However, in our experiments, using polling rates greater than 200 times a +second did not improve performance. +.Pp +.Nm +supports only a +.Li nexus +bus attachment, which is appropriate for system-on-chip busses such as +Altera's Avalon bus. +If the IP core is configured off of another bus type, then additional bus +attachments will be required. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 25 11:07:43 2012 (r239674) +++ head/sys/conf/files Sat Aug 25 11:19:20 2012 (r239675) @@ -660,6 +660,10 @@ dev/aic7xxx/aic7xxx_pci.c optional ahc p dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci dev/altera/avgen/altera_avgen.c optional altera_avgen +dev/altera/sdcard/altera_sdcard.c optional altera_sdcard +dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard +dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard +dev/altera/sdcard/altera_sdcard_nexus.c optional altera_sdcard dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr dev/amr/amr_disk.c optional amr Added: head/sys/dev/altera/sdcard/altera_sdcard.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/sdcard/altera_sdcard.c Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,402 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* + * Device driver for the Altera University Program Secure Data Card IP Core, + * as described in the similarly named SOPC Builder IP Core specification. + * This soft core is not a full SD host controller interface (SDHCI) but + * instead provides a set of memory mapped registers and memory buffer that + * mildly abstract the SD Card protocol, but without providing DMA or + * interrupts. However, it does hide the details of voltage and + * communications negotiation. This driver implements disk(9), but due to the + * lack of interrupt support, must rely on timer-driven polling to determine + * when I/Os have completed. + * + * TODO: + * + * 1. Implement DISKFLAG_CANDELETE / SD Card sector erase support. + * 2. Implement d_ident from SD Card CID serial number field. + * 3. Handle read-only SD Cards. + * 4. Tune timeouts based on real-world SD Card speeds. + */ + +void +altera_sdcard_attach(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_INIT(sc); + ALTERA_SDCARD_CONDVAR_INIT(sc); + sc->as_disk = NULL; + bioq_init(&sc->as_bioq); + sc->as_currentbio = NULL; + sc->as_state = ALTERA_SDCARD_STATE_NOCARD; + sc->as_taskqueue = taskqueue_create("altera_sdcardc taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->as_taskqueue); + taskqueue_start_threads(&sc->as_taskqueue, 1, PI_DISK, + "altera_sdcardc%d taskqueue", sc->as_unit); + TIMEOUT_TASK_INIT(sc->as_taskqueue, &sc->as_task, 0, + altera_sdcard_task, sc); + + /* + * Kick off timer-driven processing with a manual poll so that we + * synchronously detect an already-inserted SD Card during the boot or + * other driver attach point. + */ + altera_sdcard_task(sc, 1); +} + +void +altera_sdcard_detach(struct altera_sdcard_softc *sc) +{ + + KASSERT(sc->as_taskqueue != NULL, ("%s: taskqueue not present", + __func__)); + + /* + * Winding down the driver on detach is a bit complex. Update the + * flags to indicate that a detach has been requested, and then wait + * for in-progress I/O to wind down before continuing. + */ + ALTERA_SDCARD_LOCK(sc); + sc->as_flags |= ALTERA_SDCARD_FLAG_DETACHREQ; + while (sc->as_state != ALTERA_SDCARD_STATE_DETACHED) + ALTERA_SDCARD_CONDVAR_WAIT(sc); + ALTERA_SDCARD_UNLOCK(sc); + + /* + * Now wait for the possibly still executing taskqueue to drain. In + * principle no more events will be scheduled as we've transitioned to + * a detached state, but there might still be a request in execution. + */ + while (taskqueue_cancel_timeout(sc->as_taskqueue, &sc->as_task, NULL)) + taskqueue_drain_timeout(sc->as_taskqueue, &sc->as_task); + + /* + * Simulate a disk removal if one is present to deal with any pending + * or queued I/O. + */ + if (sc->as_disk != NULL) + altera_sdcard_disk_remove(sc); + KASSERT(bioq_first(&sc->as_bioq) == NULL, + ("%s: non-empty bioq", __func__)); + + /* + * Free any remaining allocated resources. + */ + taskqueue_free(sc->as_taskqueue); + sc->as_taskqueue = NULL; + ALTERA_SDCARD_CONDVAR_DESTROY(sc); + ALTERA_SDCARD_LOCK_DESTROY(sc); +} + +/* + * Set up and start the next I/O. Transition to the I/O state, but allow the + * caller to schedule the next timeout, as this may be called either from an + * initial attach context, or from the task queue, which requires different + * behaviour. + */ +static void +altera_sdcard_nextio(struct altera_sdcard_softc *sc) +{ + struct bio *bp; + + ALTERA_SDCARD_LOCK_ASSERT(sc); + KASSERT(sc->as_currentbio == NULL, + ("%s: bio already active", __func__)); + + bp = bioq_takefirst(&sc->as_bioq); + if (bp == NULL) + panic("%s: bioq empty", __func__); + altera_sdcard_io_start(sc, bp); + sc->as_state = ALTERA_SDCARD_STATE_IO; +} + +static void +altera_sdcard_task_nocard(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + /* + * Handle device driver detach. + */ + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) { + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + return; + } + + /* + * If there is no card insertion, remain in NOCARD. + */ + if (!(altera_sdcard_read_asr(sc) & ALTERA_SDCARD_ASR_CARDPRESENT)) + return; + + /* + * Read the CSD -- it may contain values that the driver can't handle, + * either because of an unsupported version/feature, or because the + * card is misbehaving. This triggers a transition to + * ALTERA_SDCARD_STATE_BADCARD. We rely on the CSD read to print a + * banner about how the card is problematic, since it has more + * information. The bad card state allows us to print that banner + * once rather than each time we notice the card is there, and still + * bad. + */ + if (altera_sdcard_read_csd(sc) != 0) { + sc->as_state = ALTERA_SDCARD_STATE_BADCARD; + return; + } + + /* + * Process card insertion and upgrade to the IDLE state. + */ + altera_sdcard_disk_insert(sc); + sc->as_state = ALTERA_SDCARD_STATE_IDLE; +} + +static void +altera_sdcard_task_badcard(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + /* + * Handle device driver detach. + */ + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) { + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + return; + } + + /* + * Handle safe card removal -- no teardown is required, just a state + * transition. + */ + if (!(altera_sdcard_read_asr(sc) & ALTERA_SDCARD_ASR_CARDPRESENT)) + sc->as_state = ALTERA_SDCARD_STATE_NOCARD; +} + +static void +altera_sdcard_task_idle(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + /* + * Handle device driver detach. + */ + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) { + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + return; + } + + /* + * Handle safe card removal. + */ + if (!(altera_sdcard_read_asr(sc) & ALTERA_SDCARD_ASR_CARDPRESENT)) { + altera_sdcard_disk_remove(sc); + sc->as_state = ALTERA_SDCARD_STATE_NOCARD; + } +} + +static void +altera_sdcard_task_io(struct altera_sdcard_softc *sc) +{ + uint16_t asr; + + ALTERA_SDCARD_LOCK_ASSERT(sc); + KASSERT(sc->as_currentbio != NULL, ("%s: no current I/O", __func__)); + + asr = altera_sdcard_read_asr(sc); + + /* + * Check for unexpected card removal during an I/O. + */ + if (!(asr & ALTERA_SDCARD_ASR_CARDPRESENT)) { + altera_sdcard_disk_remove(sc); + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + else + sc->as_state = ALTERA_SDCARD_STATE_NOCARD; + return; + } + + /* + * If the I/O isn't complete, remain in the IO state without further + * action, even if DETACHREQ is in flight. + */ + if (asr & ALTERA_SDCARD_ASR_CMDINPROGRESS) + return; + + /* + * Handle various forms of I/O completion, successful and otherwise. + * The I/O layer may restart the transaction if an error occurred, in + * which case remain in the IO state and reschedule. + */ + if (!altera_sdcard_io_complete(sc, asr)) + return; + + /* + * Now that I/O is complete, process detach requests in preference to + * starting new I/O. + */ + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) { + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + return; + } + + /* + * Finally, either start the next I/O or transition to the IDLE state. + */ + if (bioq_first(&sc->as_bioq) != NULL) + altera_sdcard_nextio(sc); + else + sc->as_state = ALTERA_SDCARD_STATE_IDLE; +} + +static void +altera_sdcard_task_rechedule(struct altera_sdcard_softc *sc) +{ + int interval; + + /* + * Reschedule based on new state. Or not, if detaching the device + * driver. Treat a bad card as though it were no card at all. + */ + switch (sc->as_state) { + case ALTERA_SDCARD_STATE_NOCARD: + case ALTERA_SDCARD_STATE_BADCARD: + interval = ALTERA_SDCARD_TIMEOUT_NOCARD; + break; + + case ALTERA_SDCARD_STATE_IDLE: + interval = ALTERA_SDCARD_TIMEOUT_IDLE; + break; + + case ALTERA_SDCARD_STATE_IO: + if (sc->as_flags & ALTERA_SDCARD_FLAG_IOERROR) + interval = ALTERA_SDCARD_TIMEOUT_IOERROR; + else + interval = ALTERA_SDCARD_TIMEOUT_IO; + break; + + default: + panic("%s: invalid exit state %d", __func__, sc->as_state); + } + taskqueue_enqueue_timeout(sc->as_taskqueue, &sc->as_task, interval); +} + +/* + * Because the Altera SD Card IP Core doesn't support interrupts, we do all + * asynchronous work from a timeout. Poll at two different rates -- an + * infrequent check for card insertion status changes, and a frequent one for + * I/O completion. The task should never start in DETACHED, as that would + * imply that a previous instance failed to cancel rather than reschedule. + */ +void +altera_sdcard_task(void *arg, int pending) +{ + struct altera_sdcard_softc *sc; + + sc = arg; + KASSERT(sc->as_state != ALTERA_SDCARD_STATE_DETACHED, + ("%s: already in detached", __func__)); + + ALTERA_SDCARD_LOCK(sc); + switch (sc->as_state) { + case ALTERA_SDCARD_STATE_NOCARD: + altera_sdcard_task_nocard(sc); + break; + + case ALTERA_SDCARD_STATE_BADCARD: + altera_sdcard_task_badcard(sc); + break; + + case ALTERA_SDCARD_STATE_IDLE: + altera_sdcard_task_idle(sc); + break; + + case ALTERA_SDCARD_STATE_IO: + altera_sdcard_task_io(sc); + break; + + default: + panic("%s: invalid enter state %d", __func__, sc->as_state); + } + + /* + * If we have transitioned to DETACHED, signal the detach thread and + * cancel the timeout-driven task. Otherwise reschedule on an + * appropriate timeout. + */ + if (sc->as_state == ALTERA_SDCARD_STATE_DETACHED) + ALTERA_SDCARD_CONDVAR_SIGNAL(sc); + else + altera_sdcard_task_rechedule(sc); + ALTERA_SDCARD_UNLOCK(sc); +} + +void +altera_sdcard_start(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + KASSERT(sc->as_state == ALTERA_SDCARD_STATE_IDLE, + ("%s: starting when not IDLE", __func__)); + + taskqueue_cancel_timeout(sc->as_taskqueue, &sc->as_task, NULL); + altera_sdcard_nextio(sc); + taskqueue_enqueue_timeout(sc->as_taskqueue, &sc->as_task, + ALTERA_SDCARD_TIMEOUT_IO); +} Added: head/sys/dev/altera/sdcard/altera_sdcard.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/sdcard/altera_sdcard.h Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,247 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +#ifndef _DEV_ALTERA_SDCARD_H_ +#define _DEV_ALTERA_SDCARD_H_ + +#define ALTERA_SDCARD_CSD_SIZE 16 +struct altera_sdcard_csd { + uint8_t csd_data[ALTERA_SDCARD_CSD_SIZE]; +} __aligned(2); /* CSD is read in 16-bit chunks, so align to match. */ + +struct altera_sdcard_softc { + device_t as_dev; + int as_unit; + struct resource *as_res; + int as_rid; + struct mtx as_lock; + struct cv as_condvar; + int as_state; + int as_flags; + struct disk *as_disk; + struct taskqueue *as_taskqueue; + struct timeout_task as_task; + + /* + * Fields relating to in-progress and pending I/O, if any. + */ + struct bio_queue_head as_bioq; + struct bio *as_currentbio; + u_int as_retriesleft; + + /* + * Infrequently changing fields cached from the SD Card IP Core. + */ + struct altera_sdcard_csd as_csd; + uint8_t as_csd_structure; /* CSD version. */ + uint64_t as_mediasize; +}; + +#define ALTERA_SDCARD_LOCK(sc) mtx_lock(&(sc)->as_lock) +#define ALTERA_SDCARD_LOCK_ASSERT(sc) mtx_assert(&(sc)->as_lock, MA_OWNED) +#define ALTERA_SDCARD_LOCK_DESTROY(sc) mtx_destroy(&(sc)->as_lock) +#define ALTERA_SDCARD_LOCK_INIT(sc) mtx_init(&(sc)->as_lock, \ + "altera_sdcard", NULL, MTX_DEF) +#define ALTERA_SDCARD_UNLOCK(sc) mtx_unlock(&(sc)->as_lock) + +#define ALTERA_SDCARD_CONDVAR_DESTROY(sc) cv_destroy(&(sc)->as_condvar) +#define ALTERA_SDCARD_CONDVAR_INIT(sc) cv_init(&(sc)->as_condvar, \ + "altera_sdcard_detach_wait") +#define ALTERA_SDCARD_CONDVAR_SIGNAL(dc) cv_signal(&(sc)->as_condvar) +#define ALTERA_SDCARD_CONDVAR_WAIT(sc) cv_wait(&(sc)->as_condvar, \ + &(sc)->as_lock) + +/* + * States an instance can be in at any given moment. + */ +#define ALTERA_SDCARD_STATE_NOCARD 1 /* No card inserted. */ +#define ALTERA_SDCARD_STATE_BADCARD 2 /* Card bad/not supported. */ +#define ALTERA_SDCARD_STATE_IDLE 3 /* Card present but idle. */ +#define ALTERA_SDCARD_STATE_IO 4 /* Card in I/O currently. */ +#define ALTERA_SDCARD_STATE_DETACHED 5 /* Driver is detaching. */ + +/* + * Different timeout intervals based on state. When just looking for a card + * status change, check twice a second. When we're actively waiting on I/O + * completion, check every millisecond. + */ +#define ALTERA_SDCARD_TIMEOUT_NOCARD (hz/2) +#define ALTERA_SDCARD_TIMEOUT_IDLE (hz/2) +#define ALTERA_SDCARD_TIMEOUT_IO (1) +#define ALTERA_SDCARD_TIMEOUT_IOERROR (hz/5) + +/* + * Maximum number of retries on an I/O. + */ +#define ALTERA_SDCARD_RETRY_LIMIT 10 + +/* + * Driver status flags. + */ +#define ALTERA_SDCARD_FLAG_DETACHREQ 0x00000001 /* Detach requested. */ +#define ALTERA_SDCARD_FLAG_IOERROR 0x00000002 /* Error in progress. */ + +/* + * Functions for performing low-level register and memory I/O to/from the SD + * Card IP Core. In general, only code in altera_sdcard_io.c is aware of the + * hardware interface. + */ +uint16_t altera_sdcard_read_asr(struct altera_sdcard_softc *sc); +int altera_sdcard_read_csd(struct altera_sdcard_softc *sc); + +int altera_sdcard_io_complete(struct altera_sdcard_softc *sc, + uint16_t asr); +void altera_sdcard_io_start(struct altera_sdcard_softc *sc, + struct bio *bp); + +/* + * Constants for interpreting the SD Card Card Specific Data (CSD) register. + */ +#define ALTERA_SDCARD_CSD_STRUCTURE_BYTE 15 +#define ALTERA_SDCARD_CSD_STRUCTURE_MASK 0xc0 /* 2 bits */ +#define ALTERA_SDCARD_CSD_STRUCTURE_RSHIFT 6 + +#define ALTERA_SDCARD_CSD_READ_BL_LEN_BYTE 10 +#define ALTERA_SDCARD_CSD_READ_BL_LEN_MASK 0x0f /* 4 bits */ + +/* + * C_SIZE is a 12-bit field helpfully split over three differe bytes of CSD + * data. Software ease of use was not a design consideration. + */ +#define ALTERA_SDCARD_CSD_C_SIZE_BYTE0 7 +#define ALTERA_SDCARD_CSD_C_SIZE_MASK0 0xc /* top 2 bits */ +#define ALTERA_SDCARD_CSD_C_SIZE_RSHIFT0 6 + +#define ALTERA_SDCARD_CSD_C_SIZE_BYTE1 8 +#define ALTERA_SDCARD_CSD_C_SIZE_MASK1 0xff /* 8 bits */ +#define ALTERA_SDCARD_CSD_C_SIZE_LSHIFT1 2 + +#define ALTERA_SDCARD_CSD_C_SIZE_BYTE2 9 +#define ALTERA_SDCARD_CSD_C_SIZE_MASK2 0x03 /* bottom 2 bits */ +#define ALTERA_SDCARD_CSD_C_SIZE_LSHIFT2 10 + +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_BYTE0 5 +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_MASK0 0x80 /* top 1 bit */ +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_RSHIFT0 7 + +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_BYTE1 6 +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_MASK1 0x03 /* bottom 2 bits */ +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_LSHIFT1 1 + +/* + * I/O register/buffer offsets, from Table 4.1.1 in the Altera University + * Program SD Card IP Core specification. + */ +#define ALTERA_SDCARD_OFF_RXTX_BUFFER 0 /* 512-byte I/O buffer */ +#define ALTERA_SDCARD_OFF_CID 512 /* 16-byte Card ID number */ +#define ALTERA_SDCARD_OFF_CSD 528 /* 16-byte Card Specific Data */ +#define ALTERA_SDCARD_OFF_OCR 544 /* Operating Conditions Reg */ +#define ALTERA_SDCARD_OFF_SR 548 /* SD Card Status Register */ +#define ALTERA_SDCARD_OFF_RCA 552 /* Relative Card Address Reg */ +#define ALTERA_SDCARD_OFF_CMD_ARG 556 /* Command Argument Register */ +#define ALTERA_SDCARD_OFF_CMD 560 /* Command Register */ +#define ALTERA_SDCARD_OFF_ASR 564 /* Auxiliary Status Register */ +#define ALTERA_SDCARD_OFF_RR1 568 /* Response R1 */ + +/* + * The Altera IP Core provides a 16-bit "Additional Status Register" (ASR) + * beyond those described in the SD Card specification that captures IP Core + * transaction state, such as whether the last command is in progress, the + * card has been removed, etc. + */ +#define ALTERA_SDCARD_ASR_CMDVALID 0x0001 +#define ALTERA_SDCARD_ASR_CARDPRESENT 0x0002 +#define ALTERA_SDCARD_ASR_CMDINPROGRESS 0x0004 +#define ALTERA_SDCARD_ASR_SRVALID 0x0008 +#define ALTERA_SDCARD_ASR_CMDTIMEOUT 0x0010 +#define ALTERA_SDCARD_ASR_CMDDATAERROR 0x0020 + +/* + * The Altera IP Core claims to provide a 16-bit "Response R1" register (RR1) + * to provide more detailed error reporting when a read or write fails. + * + * XXXRW: The specification claims that this field is 16-bit, but then + * proceeds to define values as though it is 32-bit. In practice, 16-bit + * seems more likely as the register is not 32-bit aligned. + */ +#define ALTERA_SDCARD_RR1_INITPROCRUNNING 0x0100 +#define ALTERA_SDCARD_RR1_ERASEINTERRUPTED 0x0200 +#define ALTERA_SDCARD_RR1_ILLEGALCOMMAND 0x0400 +#define ALTERA_SDCARD_RR1_COMMANDCRCFAILED 0x0800 +#define ALTERA_SDCARD_RR1_ADDRESSMISALIGNED 0x1000 +#define ALTERA_SDCARD_RR1_ADDRBLOCKRANGE 0x2000 + +/* + * Not all RR1 values are "errors" per se -- check only for the ones that are + * when performing error handling. + */ +#define ALTERA_SDCARD_RR1_ERRORMASK \ + (ALTERA_SDCARD_RR1_ERASEINTERRUPTED | ALTERA_SDCARD_RR1_ILLEGALCOMMAND | \ + ALTERA_SDCARD_RR1_COMMANDCRCFAILED | ALTERA_SDCARD_RR1_ADDRESSMISALIGNED |\ + ALTERA_SDCARD_RR1_ADDRBLOCKRANGE) + +/* + * Although SD Cards may have various sector sizes, the Altera IP Core + * requires that I/O be done in 512-byte chunks. + */ +#define ALTERA_SDCARD_SECTORSIZE 512 + +/* + * SD Card commands used in this driver. + */ +#define ALTERA_SDCARD_CMD_SEND_RCA 0x03 /* Retrieve card RCA. */ +#define ALTERA_SDCARD_CMD_SEND_CSD 0x09 /* Retrieve CSD register. */ +#define ALTERA_SDCARD_CMD_SEND_CID 0x0A /* Retrieve CID register. */ +#define ALTERA_SDCARD_CMD_READ_BLOCK 0x11 /* Read block from disk. */ +#define ALTERA_SDCARD_CMD_WRITE_BLOCK 0x18 /* Write block to disk. */ + +/* + * Functions exposed by the device driver core to newbus(9) bus attachment + * implementations. + */ +void altera_sdcard_attach(struct altera_sdcard_softc *sc); +void altera_sdcard_detach(struct altera_sdcard_softc *sc); +void altera_sdcard_task(void *arg, int pending); + +/* + * Functions exposed by the device driver core to the disk(9) front-end. + */ +void altera_sdcard_start(struct altera_sdcard_softc *sc); + +/* + * Functions relating to the implementation of disk(9) KPIs for the SD Card + * driver. + */ +void altera_sdcard_disk_insert(struct altera_sdcard_softc *sc); +void altera_sdcard_disk_remove(struct altera_sdcard_softc *sc); + +#endif /* _DEV_ALTERA_SDCARD_H_ */ Added: head/sys/dev/altera/sdcard/altera_sdcard_disk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/sdcard/altera_sdcard_disk.c Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,185 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +static int +altera_sdcard_disk_dump(void *arg, void *virtual, vm_offset_t physical, + off_t offset, size_t length) +{ + + panic("%s: not yet", __func__); +} + +static int +altera_sdcard_disk_ioctl(struct disk *disk, u_long cmd, void *data, int fflag, + struct thread *td) +{ + + /* XXXRW: more here? */ + return (EINVAL); +} + +static void +altera_sdcard_disk_strategy(struct bio *bp) +{ + struct altera_sdcard_softc *sc; + + /* + * Although the SD Card doesn't need sorting, we don't want to + * introduce barriers, so use bioq_disksort(). + */ + sc = bp->bio_disk->d_drv1; + ALTERA_SDCARD_LOCK(sc); + switch (sc->as_state) { + case ALTERA_SDCARD_STATE_NOCARD: + device_printf(sc->as_dev, "%s: unexpected I/O on NOCARD", + __func__); + biofinish(bp, NULL, ENXIO); + break; + + case ALTERA_SDCARD_STATE_BADCARD: + device_printf(sc->as_dev, "%s: unexpected I/O on BADCARD", + __func__); + biofinish(bp, NULL, ENXIO); + break; + + case ALTERA_SDCARD_STATE_DETACHED: + device_printf(sc->as_dev, "%s: unexpected I/O on DETACHED", + __func__); + biofinish(bp, NULL, ENXIO); + + case ALTERA_SDCARD_STATE_IDLE: + bioq_disksort(&sc->as_bioq, bp); + altera_sdcard_start(sc); + break; + + case ALTERA_SDCARD_STATE_IO: + bioq_disksort(&sc->as_bioq, bp); + break; + + default: + panic("%s: invalid state %d", __func__, sc->as_state); + } + ALTERA_SDCARD_UNLOCK(sc); +} + +void +altera_sdcard_disk_insert(struct altera_sdcard_softc *sc) +{ + struct disk *disk; + uint64_t size; + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + /* + * Because the disk insertion routine occupies the driver instance's + * task queue thread, and the disk(9) instance isn't hooked up yet by + * definition, the only other source of events of concern is a thread + * initiating driver detach. That thread has to issue a detach + * request and await an ACK from the taskqueue thread. It is + * therefore safe to drop the lock here. + */ + ALTERA_SDCARD_UNLOCK(sc); + disk = disk_alloc(); + disk->d_drv1 = sc; + disk->d_name = "altera_sdcard"; + disk->d_unit = sc->as_unit; + disk->d_strategy = altera_sdcard_disk_strategy; + disk->d_dump = altera_sdcard_disk_dump; + disk->d_ioctl = altera_sdcard_disk_ioctl; + disk->d_sectorsize = ALTERA_SDCARD_SECTORSIZE; + disk->d_mediasize = sc->as_mediasize; + disk->d_maxsize = ALTERA_SDCARD_SECTORSIZE; + sc->as_disk = disk; + disk_create(disk, DISK_VERSION); + ALTERA_SDCARD_LOCK(sc); + + /* + * Print a pretty-ish card insertion string. We could stand to + * decorate this further, e.g., with card vendor information. + */ + size = sc->as_mediasize / (1000 * 1000); + device_printf(sc->as_dev, "%juM SD Card inserted\n", (uintmax_t)size); +} + +void +altera_sdcard_disk_remove(struct altera_sdcard_softc *sc) +{ + struct disk *disk; + + ALTERA_SDCARD_LOCK_ASSERT(sc); + KASSERT(sc->as_disk != NULL, ("%s: as_disk NULL", __func__)); + + /* + * sc->as_state will be updated by the caller. + * + * XXXRW: Is it OK to call disk_destroy() under the mutex, or should + * we be deferring that to the calling context once it is released? + */ + disk = sc->as_disk; + disk_gone(disk); + disk_destroy(disk); + sc->as_disk = NULL; + + /* + * Cancel all outstanding I/O on the SD Card. + */ + if (sc->as_currentbio != NULL) { + device_printf(sc->as_dev, "%s: SD Card removed during I/O", + __func__); + biofinish(sc->as_currentbio, NULL, ENXIO); + sc->as_currentbio = NULL; + } + bioq_flush(&sc->as_bioq, NULL, ENXIO); + device_printf(sc->as_dev, "SD Card removed\n"); +} Added: head/sys/dev/altera/sdcard/altera_sdcard_io.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/sdcard/altera_sdcard_io.c Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,447 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 11:30:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F687106566C; Sat, 25 Aug 2012 11:30:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 377188FC12; Sat, 25 Aug 2012 11:30:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PBUbfu030980; Sat, 25 Aug 2012 11:30:37 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PBUbJG030972; Sat, 25 Aug 2012 11:30:37 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251130.q7PBUbJG030972@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 11:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239676 - in head: share/man/man4 sys/dev/altera/jtag_uart sys/mips/beri 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, 25 Aug 2012 11:30:37 -0000 Author: rwatson Date: Sat Aug 25 11:30:36 2012 New Revision: 239676 URL: http://svn.freebsd.org/changeset/base/239676 Log: Add altera_jtag_uart(4), a device driver for Altera's JTAG UART soft core, which presents a UART-like interface over the Avalon bus that can be addressed over JTAG. This IP core proves extremely useful, allowing us to connect trivially to the FreeBSD console over JTAG for FPGA-embedded hard and soft cores. As interrupts are optionally configured for this soft core, we support both interrupt-driven and polled modes of operation, which must be selected using device.hints. UART instances appear in /dev as ttyu0, ttyu1, etc. However, it also contains a number of quirks, which make it difficult to tell when JTAG is connected, and some buffering issues. We work around these as best we can, using various heuristics. While the majority of this device driver is not only not BERI-specific, but also not MIPS-specific, for now add its defines in the BERI files list, as the console-level parts are aware of where the first JTAG UART is mapped on Avalon, and contain MIPS-specific address translation, to use before Newbus and device.hints are available. Sponsored by: DARPA, AFRL Added: head/share/man/man4/altera_jtag_uart.4 (contents, props changed) head/sys/dev/altera/jtag_uart/ head/sys/dev/altera/jtag_uart/altera_jtag_uart.h (contents, props changed) head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c (contents, props changed) head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c (contents, props changed) head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/mips/beri/files.beri Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 11:19:20 2012 (r239675) +++ head/share/man/man4/Makefile Sat Aug 25 11:30:36 2012 (r239676) @@ -33,6 +33,7 @@ MAN= aac.4 \ ale.4 \ alpm.4 \ altera_avgen.4 \ + altera_jtag_uart.4 \ altera_sdcard.4 \ altq.4 \ amdpm.4 \ Added: head/share/man/man4/altera_jtag_uart.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/altera_jtag_uart.4 Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,121 @@ +.\"- +.\" Copyright (c) 2012 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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$ +.\" +.Dd August 18, 2012 +.Dt ALTERA_JTAG_UART 4 +.Os +.Sh NAME +.Nm altera_jtag_uart +.Nd driver for the Altera JTAG UART Core +.Sh SYNOPSIS +.Cd "device altera_jtag_uart" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.altera_jtag_uart.0.at="nexus0" +.Cd hint.altera_jtag_uart.0.maddr=0x7f000000 +.Cd hint.altera_jtag_uart.0.msize=0x40 +.Cd hint.altera_jtag_uart.0.irq=0 +.Cd hint.altera_jtag_uart.1.at="nexus0" +.Cd hint.altera_jtag_uart.1.maddr=0x7f001000 +.Cd hint.altera_jtag_uart.1.msize=0x40 +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Altera JTAG UART core, which allows +multiple UART-like streams to be carried over JTAG. +.Nm +allows JTAG UART streams to be attached to both the low-level console +interface, used for direct kernel input and output, and the +.Xr tty 4 +layer, to be used with +.Xr ttys 5 +and +.Xr login 1 . +Sequential Altera JTAG UART devices will appear as +.Li ttyu0 , +.Li ttyu1 , +etc. +.Sh HARDWARE +Altera JTAG UART devices can be connected to using Altera's +.Pa nios2-terminal +program, with the instance selected using the +.Li --instance +argument on the management host. +.Nm +supports JTAG UART cores with or without interrupt lines connected; if the +.Li irq +portion of the +.Pa device.hints +entry is omitted, the driver will poll rather than configure interrupts. +.Sh SEE ALSO +.Xr login 1 , +.Xr tty 4 , +.Xr ttys 5 +.Rs +.%T Altera Embedded Peripherals IP User Guide +.%D June 2011 +.%I Altera Corporation +.%U http://www.altera.com/literature/ug/ug_embedded_ip.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +This device driver was written by +.An Robert N. M. Watson . +.Sh BUGS +.Nm +must dynamically poll to detect when JTAG is present, in order to disable flow +control in the event that there is no receiving endpoint. +Otherwise, the boot may hang waiting for the JTAG client to be attached, and +user processes attached to JTAG UART devices might block indefinitely. +However, there is no way to flush the output buffer once JTAG is detected to +have disappeared; this means that a small amount of stale output data will +remain in the output buffer, being displayed by +.Li nios2-terminal +when it is connected. +Loss of JTAG will not generate a hang-up event, as that is rarely the desired +behaviour. +.Pp +.Li nios2-terminal +does not place the client-side TTY in raw mode, and so by default will not +pass all control characters through to the UART. Added: head/sys/dev/altera/jtag_uart/altera_jtag_uart.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,197 @@ +/*- + * Copyright (c) 2011-2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +#ifndef _DEV_ALTERA_JTAG_UART_H_ +#define _DEV_ALTERA_JTAG_UART_H_ + +struct altera_jtag_uart_softc { + device_t ajus_dev; + int ajus_unit; + + /* + * Hardware resources. + */ + struct resource *ajus_irq_res; + int ajus_irq_rid; + void *ajus_irq_cookie; + struct resource *ajus_mem_res; + int ajus_mem_rid; + + /* + * TTY resources. + */ + struct tty *ajus_ttyp; + int ajus_alt_break_state; + + /* + * Driver resources. + */ + u_int ajus_flags; + struct mtx *ajus_lockp; + struct mtx ajus_lock; + struct callout ajus_io_callout; + struct callout ajus_ac_callout; + + /* + * One-character buffer required because it's not possible to peek at + * the input FIFO without reading it. + */ + int ajus_buffer_valid; + int *ajus_buffer_validp; + uint8_t ajus_buffer_data; + uint8_t *ajus_buffer_datap; + int ajus_jtag_present; + int *ajus_jtag_presentp; + u_int ajus_jtag_missed; + u_int *ajus_jtag_missedp; +}; + +#define AJU_TTYNAME "ttyu" + +/* + * Flag values for ajus_flags. + */ +#define ALTERA_JTAG_UART_FLAG_CONSOLE 0x00000001 /* Is console. */ + +/* + * Because tty-level use of the I/O ports completes with low-level console + * use, spinlocks must be employed here. + */ +#define AJU_CONSOLE_LOCK_INIT() do { \ + mtx_init(&aju_cons_lock, "aju_cons_lock", NULL, MTX_SPIN); \ +} while (0) + +#define AJU_CONSOLE_LOCK() do { \ + if (!kdb_active) \ + mtx_lock_spin(&aju_cons_lock); \ +} while (0) + +#define AJU_CONSOLE_LOCK_ASSERT() { \ + if (!kdb_active) \ + mtx_assert(&aju_cons_lock, MA_OWNED); \ +} while (0) + +#define AJU_CONSOLE_UNLOCK() do { \ + if (!kdb_active) \ + mtx_unlock_spin(&aju_cons_lock); \ +} while (0) + +#define AJU_LOCK_INIT(sc) do { \ + mtx_init(&(sc)->ajus_lock, "aju_lock", NULL, MTX_SPIN); \ +} while (0) + +#define AJU_LOCK_DESTROY(sc) do { \ + mtx_destroy(&(sc)->ajus_lock); \ +} while (0) + +#define AJU_LOCK(sc) do { \ + mtx_lock_spin((sc)->ajus_lockp); \ +} while (0) + +#define AJU_LOCK_ASSERT(sc) do { \ + mtx_assert((sc)->ajus_lockp, MA_OWNED); \ +} while (0) + +#define AJU_UNLOCK(sc) do { \ + mtx_unlock_spin((sc)->ajus_lockp); \ +} while (0) + +/* + * When a TTY-level Altera JTAG UART instance is also the low-level console, + * the TTY layer borrows the console-layer lock and buffer rather than using + * its own. + */ +extern struct mtx aju_cons_lock; +extern char aju_cons_buffer_data; +extern int aju_cons_buffer_valid; +extern int aju_cons_jtag_present; +extern u_int aju_cons_jtag_missed; + +/* + * Base physical address of the JTAG UART in BERI. + */ +#define BERI_UART_BASE 0x7f000000 /* JTAG UART */ + +/*- + * Routines for interacting with the BERI console JTAG UART. Programming + * details from the June 2011 "Embedded Peripherals User Guide" by Altera + * Corporation, tables 6-2 (JTAG UART Core Register Map), 6-3 (Data Register + * Bits), and 6-4 (Control Register Bits). + * + * Offsets of data and control registers relative to the base. Altera + * conventions are maintained in BERI. + */ +#define ALTERA_JTAG_UART_DATA_OFF 0x00000000 +#define ALTERA_JTAG_UART_CONTROL_OFF 0x00000004 + +/* + * Offset 0: 'data' register -- bits 31-16 (RAVAIL), 15 (RVALID), + * 14-8 (Reserved), 7-0 (DATA). + * + * DATA - One byte read or written. + * RAVAIL - Bytes available to read (excluding the current byte). + * RVALID - Whether the byte in DATA is valid. + */ +#define ALTERA_JTAG_UART_DATA_DATA 0x000000ff +#define ALTERA_JTAG_UART_DATA_RESERVED 0x00007f00 +#define ALTERA_JTAG_UART_DATA_RVALID 0x00008000 +#define ALTERA_JTAG_UART_DATA_RAVAIL 0xffff0000 +#define ALTERA_JTAG_UART_DATA_RAVAIL_SHIFT 16 + +/*- + * Offset 1: 'control' register -- bits 31-16 (WSPACE), 15-11 (Reserved), + * 10 (AC), 9 (WI), 8 (RI), 7..2 (Reserved), 1 (WE), 0 (RE). + * + * RE - Enable read interrupts. + * WE - Enable write interrupts. + * RI - Read interrupt pending. + * WI - Write interrupt pending. + * AC - Activity bit; set to '1' to clear to '0'. + * WSPACE - Space available in the write FIFO. + */ +#define ALTERA_JTAG_UART_CONTROL_RE 0x00000001 +#define ALTERA_JTAG_UART_CONTROL_WE 0x00000002 +#define ALTERA_JTAG_UART_CONTROL_RESERVED0 0x000000fc +#define ALTERA_JTAG_UART_CONTROL_RI 0x00000100 +#define ALTERA_JTAG_UART_CONTROL_WI 0x00000200 +#define ALTERA_JTAG_UART_CONTROL_AC 0x00000400 +#define ALTERA_JTAG_UART_CONTROL_RESERVED1 0x0000f800 +#define ALTERA_JTAG_UART_CONTROL_WSPACE 0xffff0000 +#define ALTERA_JTAG_UART_CONTROL_WSPACE_SHIFT 16 + +/* + * Driver attachment functions for Nexus. + */ +int altera_jtag_uart_attach(struct altera_jtag_uart_softc *sc); +void altera_jtag_uart_detach(struct altera_jtag_uart_softc *sc); + +#endif /* _DEV_ALTERA_JTAG_UART_H_ */ Added: head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,318 @@ +/*- + * Copyright (c) 2011-2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +/* + * One-byte buffer as we can't check whether the UART is readable without + * actually reading from it, synchronised by a spinlock; this lock also + * synchronises access to the I/O ports for non-atomic sequences. These + * symbols are public so that the TTY layer can use them when working on an + * instance of the UART that is also a low-level console. + */ +char aju_cons_buffer_data; +int aju_cons_buffer_valid; +int aju_cons_jtag_present; +u_int aju_cons_jtag_missed; +struct mtx aju_cons_lock; + +/* + * Low-level console driver functions. + */ +static cn_probe_t aju_cnprobe; +static cn_init_t aju_cninit; +static cn_term_t aju_cnterm; +static cn_getc_t aju_cngetc; +static cn_putc_t aju_cnputc; +static cn_grab_t aju_cngrab; +static cn_ungrab_t aju_cnungrab; + +/* + * JTAG sets the ALTERA_JTAG_UART_CONTROL_AC bit whenever it accesses the + * FIFO. This allows us to (sort of) tell when JTAG is present, so that we + * can adopt lossy, rather than blocking, behaviour when JTAG isn't there. + * When it is present, we do full flow control. This delay is how long we + * wait to see if JTAG has really disappeared when finding a full buffer and + * no AC bit set. + */ +#define ALTERA_JTAG_UART_AC_POLL_DELAY 10000 + +/* + * I/O routines lifted from Deimos. This is not only MIPS-specific, but also + * BERI-specific, as we're hard coding the the address at which we expect to + * find the Altera JTAG UART and using it unconditionally. We use these + * low-level routines so that we can perform console I/O long before newbus + * has initialised and devices have attached. The TTY layer of the driver + * knows about this, and uses the console-layer spinlock instead of the + * TTY-layer lock to avoid confusion between layers for the console UART. + * + * XXXRW: The only place this inter-layer behaviour breaks down is if the + * low-level console is used for polled read while the TTY driver is also + * looking for input. Probably we should also share buffers between layers. + */ +#define MIPS_XKPHYS_UNCACHED_BASE 0x9000000000000000 + +typedef uint64_t paddr_t; +typedef uint64_t vaddr_t; + +static inline vaddr_t +mips_phys_to_uncached(paddr_t phys) +{ + + return (phys | MIPS_XKPHYS_UNCACHED_BASE); +} + +static inline uint32_t +mips_ioread_uint32(vaddr_t vaddr) +{ + uint32_t v; + + __asm__ __volatile__ ("lw %0, 0(%1)" : "=r" (v) : "r" (vaddr)); + return (v); +} + +static inline void +mips_iowrite_uint32(vaddr_t vaddr, uint32_t v) +{ + + __asm__ __volatile__ ("sw %0, 0(%1)" : : "r" (v), "r" (vaddr)); +} + +/* + * Little-endian versions of 32-bit I/O routines. + */ +static inline uint32_t +mips_ioread_uint32le(vaddr_t vaddr) +{ + + return (le32toh(mips_ioread_uint32(vaddr))); +} + +static inline void +mips_iowrite_uint32le(vaddr_t vaddr, uint32_t v) +{ + + mips_iowrite_uint32(vaddr, htole32(v)); +} + +/* + * Low-level read and write register routines; the Altera UART is little + * endian, so we byte swap 32-bit reads and writes. + */ +static inline uint32_t +aju_cons_data_read(void) +{ + + return (mips_ioread_uint32le(mips_phys_to_uncached(BERI_UART_BASE + + ALTERA_JTAG_UART_DATA_OFF))); +} + +static inline void +aju_cons_data_write(uint32_t v) +{ + + mips_iowrite_uint32le(mips_phys_to_uncached(BERI_UART_BASE + + ALTERA_JTAG_UART_DATA_OFF), v); +} + +static inline uint32_t +aju_cons_control_read(void) +{ + + return (mips_ioread_uint32le(mips_phys_to_uncached(BERI_UART_BASE + + ALTERA_JTAG_UART_CONTROL_OFF))); +} + +static inline void +aju_cons_control_write(uint32_t v) +{ + + mips_iowrite_uint32le(mips_phys_to_uncached(BERI_UART_BASE + + ALTERA_JTAG_UART_CONTROL_OFF), v); +} + +/* + * Slightly higher-level routines aware of buffering and flow control. + */ +static int +aju_cons_readable(void) +{ + uint32_t v; + + AJU_CONSOLE_LOCK_ASSERT(); + + if (aju_cons_buffer_valid) + return (1); + v = aju_cons_data_read(); + if ((v & ALTERA_JTAG_UART_DATA_RVALID) != 0) { + aju_cons_buffer_valid = 1; + aju_cons_buffer_data = (v & ALTERA_JTAG_UART_DATA_DATA); + return (1); + } + return (0); +} + +static void +aju_cons_write(char ch) +{ + uint32_t v; + + AJU_CONSOLE_LOCK_ASSERT(); + + /* + * The flow control logic here is somewhat subtle: we want to wait for + * write buffer space only while JTAG is present. However, we can't + * directly ask if JTAG is present -- just whether it's been seen + * since we last cleared the ALTERA_JTAG_UART_CONTROL_AC bit. As + * such, implement a polling loop in which we both wait for space and + * try to decide whether JTAG has disappeared on us. We will have to + * wait one complete polling delay to detect that JTAG has gone away, + * but otherwise shouldn't wait any further once it has gone. And we + * had to wait for buffer space anyway, if it was there. + * + * If JTAG is spotted, reset the TTY-layer miss counter so console- + * layer clearing of the bit doesn't trigger a TTY-layer + * disconnection. + * + * XXXRW: The polling delay may require tuning. + */ + v = aju_cons_control_read(); + if (v & ALTERA_JTAG_UART_CONTROL_AC) { + aju_cons_jtag_present = 1; + aju_cons_jtag_missed = 0; + v &= ~ALTERA_JTAG_UART_CONTROL_AC; + aju_cons_control_write(v); + } + while ((v & ALTERA_JTAG_UART_CONTROL_WSPACE) == 0) { + if (!aju_cons_jtag_present) + return; + DELAY(ALTERA_JTAG_UART_AC_POLL_DELAY); + v = aju_cons_control_read(); + if (v & ALTERA_JTAG_UART_CONTROL_AC) { + aju_cons_jtag_present = 1; + v &= ~ALTERA_JTAG_UART_CONTROL_AC; + aju_cons_control_write(v); + } else + aju_cons_jtag_present = 0; + } + aju_cons_data_write(ch); +} + +static char +aju_cons_read(void) +{ + + AJU_CONSOLE_LOCK_ASSERT(); + + while (!aju_cons_readable()); + aju_cons_buffer_valid = 0; + return (aju_cons_buffer_data); +} + +/* + * Implementation of a FreeBSD low-level, polled console driver. + */ +static void +aju_cnprobe(struct consdev *cp) +{ + + sprintf(cp->cn_name, "%s%d", AJU_TTYNAME, 0); + cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; +} + +static void +aju_cninit(struct consdev *cp) +{ + uint32_t v; + + AJU_CONSOLE_LOCK_INIT(); + + AJU_CONSOLE_LOCK(); + v = aju_cons_control_read(); + v &= ~ALTERA_JTAG_UART_CONTROL_AC; + aju_cons_control_write(v); + AJU_CONSOLE_UNLOCK(); +} + +static void +aju_cnterm(struct consdev *cp) +{ + +} + +static int +aju_cngetc(struct consdev *cp) +{ + int ret; + + AJU_CONSOLE_LOCK(); + ret = aju_cons_read(); + AJU_CONSOLE_UNLOCK(); + return (ret); +} + +static void +aju_cnputc(struct consdev *cp, int c) +{ + + AJU_CONSOLE_LOCK(); + aju_cons_write(c); + AJU_CONSOLE_UNLOCK(); +} + +static void +aju_cngrab(struct consdev *cp) +{ + +} + +static void +aju_cnungrab(struct consdev *cp) +{ + +} + +CONSOLE_DRIVER(aju); Added: head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* + * Nexus bus attachment for Altera JTAG UARTs. Appropriate for most Altera + * FPGA SoC-style configurations in which the IP core will be exposed to the + * processor via a memory-mapped Avalon bus. + */ +static int +altera_jtag_uart_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Altera JTAG UART"); + return (BUS_PROBE_DEFAULT); +} + +static int +altera_jtag_uart_nexus_attach(device_t dev) +{ + struct altera_jtag_uart_softc *sc; + int error; + + error = 0; + sc = device_get_softc(dev); + sc->ajus_dev = dev; + sc->ajus_unit = device_get_unit(dev); + sc->ajus_mem_rid = 0; + sc->ajus_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->ajus_mem_rid, RF_ACTIVE); + if (sc->ajus_mem_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + error = ENXIO; + goto out; + } + + /* + * Interrupt support is optional -- if we can't allocate an IRQ, then + * we fall back on polling. + */ + sc->ajus_irq_rid = 0; + sc->ajus_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->ajus_irq_rid, RF_ACTIVE | RF_SHAREABLE); + if (sc->ajus_irq_res == NULL) + device_printf(dev, + "IRQ unavailable; selecting polled operation\n"); + error = altera_jtag_uart_attach(sc); +out: + if (error) { + if (sc->ajus_irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, + sc->ajus_irq_rid, sc->ajus_irq_res); + if (sc->ajus_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + sc->ajus_mem_rid, sc->ajus_mem_res); + } + return (error); +} + +static int +altera_jtag_uart_nexus_detach(device_t dev) +{ + struct altera_jtag_uart_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc->ajus_mem_res != NULL, ("%s: resources not allocated", + __func__)); + + altera_jtag_uart_detach(sc); + bus_release_resource(dev, SYS_RES_IRQ, sc->ajus_irq_rid, + sc->ajus_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->ajus_mem_rid, + sc->ajus_mem_res); + return (0); +} + +static device_method_t altera_jtag_uart_nexus_methods[] = { + DEVMETHOD(device_probe, altera_jtag_uart_nexus_probe), + DEVMETHOD(device_attach, altera_jtag_uart_nexus_attach), + DEVMETHOD(device_detach, altera_jtag_uart_nexus_detach), + { 0, 0 } +}; + +static driver_t altera_jtag_uart_nexus_driver = { + "altera_jtag_uart", + altera_jtag_uart_nexus_methods, + sizeof(struct altera_jtag_uart_softc), +}; + +static devclass_t altera_jtag_uart_devclass; + +DRIVER_MODULE(altera_jtag_uart, nexus, altera_jtag_uart_nexus_driver, + altera_jtag_uart_devclass, 0, 0); Added: head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,474 @@ +/*- + * Copyright (c) 2011-2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +/* + * If one of the Altera JTAG UARTs is currently the system console, register + * it here. + */ +static struct altera_jtag_uart_softc *aju_cons_sc; + +static tsw_outwakeup_t aju_outwakeup; +static void aju_ac_callout(void *); +static void aju_io_callout(void *); + +static struct ttydevsw aju_ttydevsw = { + .tsw_flags = TF_NOPREFIX, + .tsw_outwakeup = aju_outwakeup, +}; + +/* + * When polling for the AC bit, the number of times we have to not see it + * before assuming JTAG has disappeared on us. By default, one second. + */ +#define AJU_JTAG_MAXMISS 5 + +/* + * Polling intervals for input/output and JTAG connection events. + */ +#define AJU_IO_POLLINTERVAL (hz/100) +#define AJU_AC_POLLINTERVAL (hz/5) + +/* + * Low-level read and write register routines; the Altera UART is little + * endian, so we byte swap 32-bit reads and writes. + */ +static inline uint32_t +aju_data_read(struct altera_jtag_uart_softc *sc) +{ + + return (le32toh(bus_read_4(sc->ajus_mem_res, + ALTERA_JTAG_UART_DATA_OFF))); +} + +static inline void +aju_data_write(struct altera_jtag_uart_softc *sc, uint32_t v) +{ + + bus_write_4(sc->ajus_mem_res, ALTERA_JTAG_UART_DATA_OFF, htole32(v)); +} + +static inline uint32_t +aju_control_read(struct altera_jtag_uart_softc *sc) +{ + + return (le32toh(bus_read_4(sc->ajus_mem_res, + ALTERA_JTAG_UART_CONTROL_OFF))); +} + +static inline void +aju_control_write(struct altera_jtag_uart_softc *sc, uint32_t v) +{ + + bus_write_4(sc->ajus_mem_res, ALTERA_JTAG_UART_CONTROL_OFF, + htole32(v)); +} + +/* + * Slightly higher-level routines aware of buffering and flow control. + */ +static inline int +aju_writable(struct altera_jtag_uart_softc *sc) +{ + + return ((aju_control_read(sc) & + ALTERA_JTAG_UART_CONTROL_WSPACE) != 0); +} + +static inline int +aju_readable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + + AJU_LOCK_ASSERT(sc); + + if (*sc->ajus_buffer_validp) + return (1); + v = aju_data_read(sc); + if ((v & ALTERA_JTAG_UART_DATA_RVALID) != 0) { + *sc->ajus_buffer_validp = 1; + *sc->ajus_buffer_datap = (v & ALTERA_JTAG_UART_DATA_DATA); + return (1); + } + return (0); +} + +static char +aju_read(struct altera_jtag_uart_softc *sc) +{ + + AJU_LOCK_ASSERT(sc); + + while (!aju_readable(sc)); + *sc->ajus_buffer_validp = 0; + return (*sc->ajus_buffer_datap); +} + +/* + * Routines for enabling and disabling interrupts for read and write. + */ +static void +aju_intr_readable_enable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + + AJU_LOCK_ASSERT(sc); + + v = aju_control_read(sc); + v |= ALTERA_JTAG_UART_CONTROL_RE; + aju_control_write(sc, v); +} + +static void +aju_intr_writable_enable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + + AJU_LOCK_ASSERT(sc); + + v = aju_control_read(sc); + v |= ALTERA_JTAG_UART_CONTROL_WE; + aju_control_write(sc, v); +} + +static void +aju_intr_writable_disable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + + AJU_LOCK_ASSERT(sc); + + v = aju_control_read(sc); + v &= ~ALTERA_JTAG_UART_CONTROL_WE; + aju_control_write(sc, v); +} + +static void +aju_intr_disable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 11:34:55 2012 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 C4247106564A; Sat, 25 Aug 2012 11:34:55 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFB578FC08; Sat, 25 Aug 2012 11:34:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PBYtmU031549; Sat, 25 Aug 2012 11:34:55 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PBYtLk031547; Sat, 25 Aug 2012 11:34:55 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208251134.q7PBYtLk031547@svn.freebsd.org> From: Joel Dahl Date: Sat, 25 Aug 2012 11:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239677 - 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: Sat, 25 Aug 2012 11:34:55 -0000 Author: joel (doc committer) Date: Sat Aug 25 11:34:55 2012 New Revision: 239677 URL: http://svn.freebsd.org/changeset/base/239677 Log: Minor mdoc fix. Modified: head/share/man/man4/altera_avgen.4 Modified: head/share/man/man4/altera_avgen.4 ============================================================================== --- head/share/man/man4/altera_avgen.4 Sat Aug 25 11:30:36 2012 (r239676) +++ head/share/man/man4/altera_avgen.4 Sat Aug 25 11:34:55 2012 (r239677) @@ -79,7 +79,7 @@ device instances: .It maddr base physical address of the memory region to export; must be aligned to .Li width -.Ot msize +.It msize length of the memory region export; must be aligned to .Li width .It width From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 11:53:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95227106564A; Sat, 25 Aug 2012 11:53:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 667178FC17; Sat, 25 Aug 2012 11:53:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PBrvJL033652; Sat, 25 Aug 2012 11:53:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PBrv2L033649; Sat, 25 Aug 2012 11:53:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208251153.q7PBrv2L033649@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 25 Aug 2012 11:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239678 - svnadmin/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, 25 Aug 2012 11:53:57 -0000 Author: kib Date: Sat Aug 25 11:53:55 2012 New Revision: 239678 URL: http://svn.freebsd.org/changeset/base/239678 Log: Free melifaro. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sat Aug 25 11:34:55 2012 (r239677) +++ svnadmin/conf/mentors Sat Aug 25 11:53:55 2012 (r239678) @@ -23,7 +23,6 @@ jlh kib jonathan rwatson jwd rmacklem kargl das -melifaro ae Co-mentor: kib miwi rwatson mjg trasz monthadar adrian From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 12:02:14 2012 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 79E0B1065670; Sat, 25 Aug 2012 12:02:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6440C8FC17; Sat, 25 Aug 2012 12:02:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PC2E1T034677; Sat, 25 Aug 2012 12:02:14 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PC2EL6034670; Sat, 25 Aug 2012 12:02:14 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251202.q7PC2EL6034670@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 12: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: r239679 - head/sys/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, 25 Aug 2012 12:02:14 -0000 Author: rwatson Date: Sat Aug 25 12:02:13 2012 New Revision: 239679 URL: http://svn.freebsd.org/changeset/base/239679 Log: Add reference kernel configurations for FreeBSD/beri in simulation, on the Terasic DE-4, and Terasic tPad Altera-based boards. Sponsored by: DARPA, AFRL Added: head/sys/mips/conf/BERI_DE4.hints (contents, props changed) head/sys/mips/conf/BERI_DE4_MDROOT (contents, props changed) head/sys/mips/conf/BERI_DE4_SDROOT (contents, props changed) head/sys/mips/conf/BERI_SIM.hints (contents, props changed) head/sys/mips/conf/BERI_SIM_MDROOT (contents, props changed) head/sys/mips/conf/BERI_TEMPLATE (contents, props changed) head/sys/mips/conf/BERI_TPAD.hints (contents, props changed) Added: head/sys/mips/conf/BERI_DE4.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_DE4.hints Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,72 @@ +# $FreeBSD$ + +# +# Altera JTAG UARTs configured for console, debugging, and data putput on the +# Terasic DE-4. +# +hint.altera_jtag_uart.0.at="nexus0" +hint.altera_jtag_uart.0.maddr=0x7f000000 +hint.altera_jtag_uart.0.msize=0x40 +hint.altera_jtag_uart.0.irq=0 + +hint.altera_jtag_uart.1.at="nexus0" +hint.altera_jtag_uart.1.maddr=0x7f001000 +hint.altera_jtag_uart.1.msize=0x40 + +hint.altera_jtag_uart.2.at="nexus0" +hint.altera_jtag_uart.2.maddr=0x7f002000 +hint.altera_jtag_uart.2.msize=0x40 + +# +# On-board DE4 and tPad SD Card IP core +# +hint.altera_sdcardc.0.at="nexus0" +hint.altera_sdcardc.0.maddr=0x7f008000 +hint.altera_sdcardc.0.msize=0x400 + +# +# BERI Hardware Version ROM +# +hint.altera_avgen.0.at="nexus0" +hint.altera_avgen.0.maddr=0x7F00A000 +hint.altera_avgen.0.msize=20 +hint.altera_avgen.0.width=4 +hint.altera_avgen.0.fileio="rw" +hint.altera_avgen.0.devname="berirom" + +# +# Expose the DE4 flash via an Avalon "generic" device. +# This is incompatible with the isf(4) driver. +# +#hint.altera_avgen.0.at="nexus0" +#hint.altera_avgen.0.maddr=0x74000000 +#hint.altera_avgen.0.msize=0x4000000 +#hint.altera_avgen.0.width=2 +#hint.altera_avgen.0.fileio="rw" +#hint.altera_avgen.0.mmapio="rwx" +#hint.altera_avgen.0.devname="de4flash" + +# Reserved configuration blocks. Don't touch. +hint.map.0.at="isf0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00020000 +hint.map.0.name="config" +hint.map.0.readonly=1 + +# Hardwired location of bitfile +hint.map.1.at="isf0" +hint.map.1.start=0x00020000 +hint.map.1.end=0x01820000 +hint.map.1.name="fpga" + +# Kernel on first chip +hint.map.2.at="isf0" +hint.map.2.start=0x01820000 +hint.map.2.end=0x02000000 +hint.map.2.name="reserved" + +# The second chip +hint.map.3.at="isf1" +hint.map.3.start=0x00000000 +hint.map.3.end=0x02000000 +hint.map.3.name="kernel" Added: head/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_DE4_MDROOT Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,28 @@ +# +# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC +# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference +# configuration. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +ident BERI_DE4_MDROOT + +hints "BERI_DE4.hints" #Default places to look for devices. + +# +# This kernel configuration uses an embedded 8MB memory root file system. +# Adjust the following path based on local requirements. +# +options MD_ROOT # MD is a potential root device +options MD_ROOT_SIZE=8192 +makeoptions MFS_IMAGE=/local/scratch/rnw24/mdroot.img +options ROOTDEVNAME=\"ufs:md0\" + +device altera_avgen +device altera_jtag_uart +device altera_sdcard + +device sc Added: head/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_DE4_SDROOT Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,21 @@ +# +# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC +# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference +# configuration. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +ident BERI_DE4_SDROOT + +hints "BERI_DE4.hints" #Default places to look for devices. + +options ROOTDEVNAME=\"ufs:altera_sdcard0\" + +device altera_avgen +device altera_jtag_uart +device altera_sdcard + +device sc Added: head/sys/mips/conf/BERI_SIM.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_SIM.hints Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# +# Altera JTAG UARTs configured for console, debugging, and data putput on the +# BERI simulator. +# +hint.altera_jtag_uart.0.at="nexus0" +hint.altera_jtag_uart.0.maddr=0x7f000000 +hint.altera_jtag_uart.0.msize=0x40 +hint.altera_jtag_uart.0.irq=0 + +hint.altera_jtag_uart.1.at="nexus0" +hint.altera_jtag_uart.1.maddr=0x7f001000 +hint.altera_jtag_uart.1.msize=0x40 + +hint.altera_jtag_uart.2.at="nexus0" +hint.altera_jtag_uart.2.maddr=0x7f002000 +hint.altera_jtag_uart.2.msize=0x40 + +# +# On-board DE4 and tPad SD Card IP core -- also present in Bluespec +# simulation. +# +hint.altera_sdcardc.0.at="nexus0" +hint.altera_sdcardc.0.maddr=0x7f008000 +hint.altera_sdcardc.0.msize=0x400 Added: head/sys/mips/conf/BERI_SIM_MDROOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_SIM_MDROOT Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,25 @@ +# +# BERI_SIM -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC +# Implementation) FPGA soft core, as configured for simulation. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +ident BERI_SIM_MDROOT + +hints "BERI_SIM.hints" #Default places to look for devices. + +# +# This kernel configuration uses an embedded 8MB memory root file system. +# Adjust the following path based on local requirements. +# +options MD_ROOT # MD is a potential root device +options MD_ROOT_SIZE=8192 +makeoptions MFS_IMAGE=/local/scratch/rnw24/mdroot.img +options ROOTDEVNAME=\"ufs:md0\" + +device altera_avgen +device altera_jtag_uart +device altera_sdcard Added: head/sys/mips/conf/BERI_TEMPLATE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_TEMPLATE Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,58 @@ +# +# BERI_TEMPLATE -- a template kernel configuration for the SRI/Cambridge +# "BERI" (Bluespec Extensible RISC Implementation) FPGA soft core CPU. This +# kernel configuration file will be included by other board-specific files, +# and so contains only BERI features common across all board targets. +# +# $FreeBSD$ +# + +ident BERI_TEMPLATE + +machine mips mips64 + +cpu CPU_BERI + +options HZ=200 + +makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" + +makeoptions KERNLOADADDR=0xffffffff80100000 + +include "../beri/std.beri" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB +options ALT_BREAK_TO_DEBUGGER +options KTRACE + +options CAPABILITY_MODE +options CAPABILITIES + +options SCHED_ULE + +options FFS #Berkeley Fast Filesystem + +options INET +options INET6 +options NFSCL +options NFS_ROOT + +# Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed + +device geom_map + +device md +device ether +device loop +device random +device snp Added: head/sys/mips/conf/BERI_TPAD.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_TPAD.hints Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,51 @@ +# $FreeBSD$ + +# +# Altera JTAG UARTs configured for console, debugging, and data putput on the +# Terasic tPad. +# +hint.altera_jtag_uart.0.at="nexus0" +hint.altera_jtag_uart.0.maddr=0x7f000000 +hint.altera_jtag_uart.0.msize=0x40 +hint.altera_jtag_uart.0.irq=0 + +hint.altera_jtag_uart.1.at="nexus0" +hint.altera_jtag_uart.1.maddr=0x7f001000 +hint.altera_jtag_uart.1.msize=0x40 + +hint.altera_jtag_uart.2.at="nexus0" +hint.altera_jtag_uart.2.maddr=0x7f002000 +hint.altera_jtag_uart.2.msize=0x40 + +# +# Expose the tPad touchscreen device via an Avalon "generic" device. Observe +# that this is a portion of DRAM, so some care may be required in how memory +# is exposed to FreeBSD to avoid use of that DRAM for both the touch screen +# and FreeBSD use. +# +# Two separate devices are used here because alignment/width requirements for +# I/O differ: the frame buffer accepts 16-bit I/O, and the touch input device +# requires 32-bit I/O. +# +hint.altera_avgen.0.at="nexus0" +hint.altera_avgen.0.maddr=0x04000000 +hint.altera_avgen.0.msize=0x01000000 +hint.altera_avgen.0.width=2 +hint.altera_avgen.0.fileio="rw" +hint.altera_avgen.0.mmapio="rw" +hint.altera_avgen.0.devname="display" + +hint.altera_avgen.1.at="nexus0" +hint.altera_avgen.1.maddr=0x05000000 +hint.altera_avgen.1.msize=0x00000020 +hint.altera_avgen.1.width=4 +hint.altera_avgen.1.fileio="rw" +hint.altera_avgen.1.mmapio="rw" +hint.altera_avgen.1.devname="touch" + +# +# On-board DE4 and tPad SD Card IP core +# +hint.altera_sdcardc.0.at="nexus0" +hint.altera_sdcardc.0.maddr=0x7f008000 +hint.altera_sdcardc.0.msize=0x400 From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 13:15:45 2012 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 89AFE106564A; Sat, 25 Aug 2012 13:15:45 +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 74BA98FC15; Sat, 25 Aug 2012 13:15:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PDFjxu042497; Sat, 25 Aug 2012 13:15:45 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PDFj25042495; Sat, 25 Aug 2012 13:15:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208251315.q7PDFj25042495@svn.freebsd.org> From: Dimitry Andric Date: Sat, 25 Aug 2012 13:15: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: r239680 - head/lib/libc++ 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, 25 Aug 2012 13:15:45 -0000 Author: dim Date: Sat Aug 25 13:15:44 2012 New Revision: 239680 URL: http://svn.freebsd.org/changeset/base/239680 Log: Add libcxxrt's objects (prefixing them with cxxrt_ to avoid collisions) to libc++.a and libc++_p.a, to make static linking of C++ executables with libc++ easier. This is similar to the approach used in libstdc++. MFC after: 2 weeks Modified: head/lib/libc++/Makefile Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Sat Aug 25 12:02:13 2012 (r239679) +++ head/lib/libc++/Makefile Sat Aug 25 13:15:44 2012 (r239680) @@ -35,8 +35,25 @@ SRCS+= algorithm.cpp\ utility.cpp\ valarray.cpp +CXXRT_SRCS+= libelftc_dem_gnu3.c\ + terminate.cc\ + dynamic_cast.cc\ + memory.cc\ + auxhelper.cc\ + exception.cc\ + stdexcept.cc\ + typeinfo.cc\ + guard.cc + +.for _S in ${CXXRT_SRCS} +STATICOBJS+= cxxrt_${_S:R}.o +cxxrt_${_S}: + ln -sf ${LIBCXXRTDIR}/${_S} ${.TARGET} +.endfor + WARNS= 0 -CXXFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -std=c++0x -nostdlib -DLIBCXXRT +CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT +CXXFLAGS+= -std=c++0x DPADD= ${LIBCXXRT} LDADD= -lcxxrt From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 16:55:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E240106567B; Sat, 25 Aug 2012 16:55:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 794EC8FC19; Sat, 25 Aug 2012 16:55:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PGtdTE067303; Sat, 25 Aug 2012 16:55:39 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PGtdn4067300; Sat, 25 Aug 2012 16:55:39 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201208251655.q7PGtdn4067300@svn.freebsd.org> From: Alan Cox Date: Sat, 25 Aug 2012 16:55: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: r239681 - 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: Sat, 25 Aug 2012 16:55:39 -0000 Author: alc Date: Sat Aug 25 16:55:38 2012 New Revision: 239681 URL: http://svn.freebsd.org/changeset/base/239681 Log: Retire PV_TABLE_MOD. When we destroy or write protect a dirty mapping, we call vm_page_dirty(). Maintaining the PV_TABLE_MOD flag, in addition, serves no useful purpose. Modified: head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Sat Aug 25 13:15:44 2012 (r239680) +++ head/sys/mips/include/pmap.h Sat Aug 25 16:55:38 2012 (r239681) @@ -73,7 +73,6 @@ struct md_page { TAILQ_HEAD(, pv_entry) pv_list; }; -#define PV_TABLE_MOD 0x01 /* modified */ #define PV_TABLE_REF 0x02 /* referenced */ #define ASID_BITS 8 Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Aug 25 13:15:44 2012 (r239680) +++ head/sys/mips/mips/pmap.c Sat Aug 25 16:55:38 2012 (r239681) @@ -195,7 +195,7 @@ static int _pmap_unwire_pte_hold(pmap_t static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); static vm_page_t _pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t); -static pt_entry_t init_pte_prot(vm_page_t m, vm_prot_t prot); +static pt_entry_t init_pte_prot(vm_page_t m, vm_prot_t access, vm_prot_t prot); #ifdef SMP static void pmap_invalidate_page_action(void *arg); @@ -1431,12 +1431,10 @@ pmap_pv_reclaim(pmap_t locked_pmap) vm_page_dirty(m); if (m->md.pv_flags & PV_TABLE_REF) vm_page_aflag_set(m, PGA_REFERENCED); + m->md.pv_flags &= ~PV_TABLE_REF; TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - if (TAILQ_EMPTY(&m->md.pv_list)) { + if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); - m->md.pv_flags &= ~(PV_TABLE_REF | - PV_TABLE_MOD); - } pc->pc_map[field] |= 1UL << bit; pmap_unuse_pt(pmap, va, *pde); freed++; @@ -1705,7 +1703,7 @@ pmap_remove_pte(struct pmap *pmap, pt_en } if (m->md.pv_flags & PV_TABLE_REF) vm_page_aflag_set(m, PGA_REFERENCED); - m->md.pv_flags &= ~(PV_TABLE_REF | PV_TABLE_MOD); + m->md.pv_flags &= ~PV_TABLE_REF; pmap_remove_entry(pmap, m, va); } @@ -1877,7 +1875,7 @@ pmap_remove_all(vm_page_t m) } vm_page_aflag_clear(m, PGA_WRITEABLE); - m->md.pv_flags &= ~(PV_TABLE_REF | PV_TABLE_MOD); + m->md.pv_flags &= ~PV_TABLE_REF; rw_wunlock(&pvh_global_lock); } @@ -1936,7 +1934,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sv if (page_is_managed(pa) && pte_test(&pbits, PTE_D)) { m = PHYS_TO_VM_PAGE(pa); vm_page_dirty(m); - m->md.pv_flags &= ~PV_TABLE_MOD; } pte_clear(&pbits, PTE_D); pte_set(&pbits, PTE_RO); @@ -2082,8 +2079,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, validate: if ((access & VM_PROT_WRITE) != 0) - m->md.pv_flags |= PV_TABLE_MOD | PV_TABLE_REF; - rw = init_pte_prot(m, prot); + m->md.pv_flags |= PV_TABLE_REF; + rw = init_pte_prot(m, access, prot); #ifdef PMAP_DEBUG printf("pmap_enter: va: %p -> pa: %p\n", (void *)va, (void *)pa); @@ -2114,8 +2111,7 @@ validate: if (page_is_managed(opa) && (opa != pa)) { if (om->md.pv_flags & PV_TABLE_REF) vm_page_aflag_set(om, PGA_REFERENCED); - om->md.pv_flags &= - ~(PV_TABLE_REF | PV_TABLE_MOD); + om->md.pv_flags &= ~PV_TABLE_REF; } if (pte_test(&origpte, PTE_D)) { KASSERT(!pte_test(&origpte, PTE_RO), @@ -2751,7 +2747,6 @@ pmap_remove_write(vm_page_t m) if (pte_test(&pbits, PTE_D)) { pte_clear(&pbits, PTE_D); vm_page_dirty(m); - m->md.pv_flags &= ~PV_TABLE_MOD; } pte_set(&pbits, PTE_RO); if (pbits != *pte) { @@ -2808,10 +2803,7 @@ pmap_is_modified(vm_page_t m) (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); - if (m->md.pv_flags & PV_TABLE_MOD) - rv = TRUE; - else - rv = pmap_testbit(m, PTE_D); + rv = pmap_testbit(m, PTE_D); rw_wunlock(&pvh_global_lock); return (rv); } @@ -2876,7 +2868,6 @@ pmap_clear_modify(vm_page_t m) } PMAP_UNLOCK(pmap); } - m->md.pv_flags &= ~PV_TABLE_MOD; rw_wunlock(&pvh_global_lock); } @@ -3259,14 +3250,14 @@ page_is_managed(vm_paddr_t pa) } static pt_entry_t -init_pte_prot(vm_page_t m, vm_prot_t prot) +init_pte_prot(vm_page_t m, vm_prot_t access, vm_prot_t prot) { pt_entry_t rw; if (!(prot & VM_PROT_WRITE)) rw = PTE_V | PTE_RO; else if ((m->oflags & VPO_UNMANAGED) == 0) { - if ((m->md.pv_flags & PV_TABLE_MOD) != 0) + if ((access & VM_PROT_WRITE) != 0) rw = PTE_V | PTE_D; else rw = PTE_V; @@ -3318,7 +3309,7 @@ pmap_emulate_modified(pmap_t pmap, vm_of if (!page_is_managed(pa)) panic("pmap_emulate_modified: unmanaged page"); m = PHYS_TO_VM_PAGE(pa); - m->md.pv_flags |= (PV_TABLE_REF | PV_TABLE_MOD); + m->md.pv_flags |= PV_TABLE_REF; PMAP_UNLOCK(pmap); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 17:15:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64B9D106564A; Sat, 25 Aug 2012 17:15:34 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50ABA8FC0C; Sat, 25 Aug 2012 17:15:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PHFYee070343; Sat, 25 Aug 2012 17:15:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PHFYfK070341; Sat, 25 Aug 2012 17:15:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201208251715.q7PHFYfK070341@svn.freebsd.org> From: Rui Paulo Date: Sat, 25 Aug 2012 17:15: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: r239682 - head/sys/powerpc/aim 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, 25 Aug 2012 17:15:34 -0000 Author: rpaulo Date: Sat Aug 25 17:15:33 2012 New Revision: 239682 URL: http://svn.freebsd.org/changeset/base/239682 Log: Unbreak tinderbox. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Aug 25 16:55:38 2012 (r239681) +++ head/sys/powerpc/aim/machdep.c Sat Aug 25 17:15:33 2012 (r239682) @@ -258,7 +258,10 @@ powerpc_init(vm_offset_t startkernel, vm size_t trap_offset; void *kmdp; char *env; - register_t msr, scratch, vers; + register_t msr, scratch; +#ifdef WII + register_t vers; +#endif uint8_t *cache_check; int cacheline_warn; #ifndef __powerpc64__ From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 17:34:49 2012 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 C91E0106566C; Sat, 25 Aug 2012 17:34:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53398FC12; Sat, 25 Aug 2012 17:34:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PHYn9C072732; Sat, 25 Aug 2012 17:34:49 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PHYnNF072729; Sat, 25 Aug 2012 17:34:49 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201208251734.q7PHYnNF072729@svn.freebsd.org> From: Brooks Davis Date: Sat, 25 Aug 2012 17:34: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: r239683 - head/sys/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, 25 Aug 2012 17:34:49 -0000 Author: brooks Date: Sat Aug 25 17:34:48 2012 New Revision: 239683 URL: http://svn.freebsd.org/changeset/base/239683 Log: Don't include syscons in the config just yet. We haven't imported the touchscreen driver yet. Modified: head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT Modified: head/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_MDROOT Sat Aug 25 17:15:33 2012 (r239682) +++ head/sys/mips/conf/BERI_DE4_MDROOT Sat Aug 25 17:34:48 2012 (r239683) @@ -25,4 +25,4 @@ device altera_avgen device altera_jtag_uart device altera_sdcard -device sc +#device sc Modified: head/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_SDROOT Sat Aug 25 17:15:33 2012 (r239682) +++ head/sys/mips/conf/BERI_DE4_SDROOT Sat Aug 25 17:34:48 2012 (r239683) @@ -18,4 +18,4 @@ device altera_avgen device altera_jtag_uart device altera_sdcard -device sc +#device sc From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 17:57:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56476106564A; Sat, 25 Aug 2012 17:57:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2842B8FC12; Sat, 25 Aug 2012 17:57:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PHvpF2075317; Sat, 25 Aug 2012 17:57:51 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PHvoJg075316; Sat, 25 Aug 2012 17:57:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251757.q7PHvoJg075316@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 17:57: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: r239684 - head/sys/mips/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: Sat, 25 Aug 2012 17:57:51 -0000 Author: rwatson Date: Sat Aug 25 17:57:50 2012 New Revision: 239684 URL: http://svn.freebsd.org/changeset/base/239684 Log: Add MD syscons header file for MIPS. Sponsored by: DARPA, AFRL Added: head/sys/mips/include/sc_machdep.h (contents, props changed) Added: head/sys/mips/include/sc_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/include/sc_machdep.h Sat Aug 25 17:57:50 2012 (r239684) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2003 Jake Burkholder. + * 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$ + */ + +#ifndef _MACHINE_SC_MACHDEP_H_ +#define _MACHINE_SC_MACHDEP_H_ + +/* Color attributes for foreground text */ + +#define FG_BLACK 0x0 +#define FG_BLUE 0x1 +#define FG_GREEN 0x2 +#define FG_CYAN 0x3 +#define FG_RED 0x4 +#define FG_MAGENTA 0x5 +#define FG_BROWN 0x6 +#define FG_LIGHTGREY 0x7 /* aka white */ +#define FG_DARKGREY 0x8 +#define FG_LIGHTBLUE 0x9 +#define FG_LIGHTGREEN 0xa +#define FG_LIGHTCYAN 0xb +#define FG_LIGHTRED 0xc +#define FG_LIGHTMAGENTA 0xd +#define FG_YELLOW 0xe +#define FG_WHITE 0xf /* aka bright white */ +#define FG_BLINK 0x80 + +/* Color attributes for text background */ + +#define BG_BLACK 0x00 +#define BG_BLUE 0x10 +#define BG_GREEN 0x20 +#define BG_CYAN 0x30 +#define BG_RED 0x40 +#define BG_MAGENTA 0x50 +#define BG_BROWN 0x60 +#define BG_LIGHTGREY 0x70 +#define BG_DARKGREY 0x80 +#define BG_LIGHTBLUE 0x90 +#define BG_LIGHTGREEN 0xa0 +#define BG_LIGHTCYAN 0xb0 +#define BG_LIGHTRED 0xc0 +#define BG_LIGHTMAGENTA 0xd0 +#define BG_YELLOW 0xe0 +#define BG_WHITE 0xf0 + +#endif /* !_MACHINE_SC_MACHDEP_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 18:08:21 2012 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 9DFDE1065673; Sat, 25 Aug 2012 18:08:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86FE68FC18; Sat, 25 Aug 2012 18:08:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PI8LUW076584; Sat, 25 Aug 2012 18:08:21 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PI8LXK076576; Sat, 25 Aug 2012 18:08:21 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201208251808.q7PI8LXK076576@svn.freebsd.org> From: Brooks Davis Date: Sat, 25 Aug 2012 18:08: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: r239685 - in head: share/man/man4 sys/conf sys/dev/isf sys/mips/conf usr.sbin usr.sbin/isfctl 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, 25 Aug 2012 18:08:21 -0000 Author: brooks Date: Sat Aug 25 18:08:20 2012 New Revision: 239685 URL: http://svn.freebsd.org/changeset/base/239685 Log: Add isf(4), a driver for the Intel StrataFlash family of NOR flash parts. The driver attempts to support all documented parts, but has only been tested with the 512Mbit part on the Terasic DE4 FPGA board. It should be trivial to adapt the driver's attach routine to other embedded boards using with any parts in the family. Also import isfctl(8) which can be used to erase sections of the flash. Sponsored by: DARPA, AFRL Added: head/share/man/man4/isf.4 (contents, props changed) head/sys/dev/isf/ head/sys/dev/isf/isf.c (contents, props changed) head/sys/dev/isf/isf.h (contents, props changed) head/sys/dev/isf/isf_nexus.c (contents, props changed) head/usr.sbin/isfctl/ head/usr.sbin/isfctl/Makefile (contents, props changed) head/usr.sbin/isfctl/isfctl.8 (contents, props changed) head/usr.sbin/isfctl/isfctl.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/mips/conf/BERI_DE4.hints head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT head/usr.sbin/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 17:57:50 2012 (r239684) +++ head/share/man/man4/Makefile Sat Aug 25 18:08:20 2012 (r239685) @@ -192,6 +192,7 @@ MAN= aac.4 \ ipwfw.4 \ isci.4 \ iscsi_initiator.4 \ + isf.4 \ isp.4 \ ispfw.4 \ iwi.4 \ Added: head/share/man/man4/isf.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/isf.4 Sat Aug 25 18:08:20 2012 (r239685) @@ -0,0 +1,135 @@ +.\"- +.\" Copyright (c) 2012 SRI International +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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$ +.\" +.Dd August 3, 2012 +.Dt ISF 4 +.Os +.Sh NAME +.Nm isf +.Nd driver for Intel StrataFlash NOR flash devices +.Sh SYNOPSIS +.Cd "device isf" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.isf.0.at="nexus0" +.Cd hint.isf.0.maddr=0x74000000 +.Cd hint.isf.0.msize=0x2000000 +.Sh DESCRIPTION +The +.Nm +device driver provides support for Intel StrataFlash NOR flash devices. +Devices are presented as +.Xr disk 9 +devices and read access is supported along with limited write support. +Erasing blocks is supported the +.Dv ISF_ERASE +ioctl. +.Pp +The erase block size of +.Nm +devices is 128K. +NOR flash blocks contains all 1's after an erase cycle. +Writes to +.Nm +devices are allowed to succeed if and only if they all bits in the write +block (512-bytes) remain the same or transition from 1 to 0. +.Sh HARDWARE +The current version of the +.Nm +driver is known to support the 64MB part found on the Altera DE4 board. +It attempts to support other StrataFlash parts documented in the +datasheet, but those are untested. +.Sh IOCTLS +The +.Nm device +supports the +.Xr ioctl 2 +command codes: +.Bl -tag -width ISF_ERASE +.It Dv ISF_ERASE +Erase one or more blocks. +.Dv ISF_ERASE is defined as follows: +.Bd -literal + struct isf_range { + off_t ir_off; + size_t ir_size; + }; + + #define ISF_ERASE _IOW('I', 1, struct isf_range) +.Ed +.Pp +The +.Li ir_off +member marks the beginning of the area to be erased and must fall on at 128K +boundary. +The +.Li ir_size +member indicates the size of the area to be erased and must a multiple +of 128K. +.El +.Sh SEE ALSO +.Xr isfctl 4 , +.Xr disk 9 +.Rs +.%T Intel StrataFlash Embedded Memory (P30) +.%D November 1, 2005 +.%I Intel Corporation +.%U http://www.xilinx.com/products/boards/ml505/datasheets/30666604.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +.Sh BUGS +While an erase is in progress, all read and write operations return +.Er EBUSY . +In principle, reads could be allowed outside the programming region the +blocked currently being erased resides in and writes could be allowed by +suspending the erase, but neither of these is currently implemented. +.Pp +Depending on the flash part ether the top or bottom 128K of the flash +address space is divided into 4 32K erase blocks. +The +.Nm +driver hides this from the user requiring that all erase requests be +multiples of 128K in size and erasing the individual blocks as needed at +the top or bottom. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 25 17:57:50 2012 (r239684) +++ head/sys/conf/files Sat Aug 25 18:08:20 2012 (r239685) @@ -1380,6 +1380,8 @@ dev/iscsi/initiator/isc_cam.c optional i dev/iscsi/initiator/isc_soc.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_sm.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_subr.c optional iscsi_initiator scbus +dev/isf/isf.c optional isf +dev/isf/isf_nexus.c optional isf dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp Added: head/sys/dev/isf/isf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/isf/isf.c Sat Aug 25 18:08:20 2012 (r239685) @@ -0,0 +1,740 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* Read Mode */ +#define ISF_CMD_RA 0xFF /* Read Array mode */ +#define ISF_CMD_RSR 0x70 /* Read Status Register mode */ +#define ISF_CMD_RDI 0x90 /* Read Device ID/Config Reg mode */ +#define ISF_CMD_RQ 0x98 /* Read Query mode */ +#define ISF_CMD_CSR 0x50 /* Clear Status Register */ + +/* Write Mode */ +#define ISF_CMD_WPS 0x40 /* Word Program Setup */ +#define ISF_CMD_BPS 0xE8 /* Buffered Program Setup */ +#define ISF_CMD_BPC 0xD0 /* Buffered Program Confirm */ + +/* Erase Mode */ +#define ISF_CMD_BES 0x20 /* Block Erase Setup */ +#define ISF_CMD_BEC 0xD0 /* Block Erase Confirm */ + +/* Block Locking/Unlocking */ +#define ISF_CMD_LBS 0x60 /* Lock Block Setup */ +#define ISF_CMD_LB 0x01 /* Lock Block */ +#define ISF_CMD_UB 0xD0 /* Unlock Block */ + +/* + * Read Device Identifier registers. + * + * NOTE: ISF_RDIR_BLC is relative to the block base address. + */ +#define ISF_REG_MC 0x00 /* Manufacture Code */ +#define ISF_REG_ID 0x01 /* Device ID Code */ +#define ISF_REG_BLC 0x02 /* Block Lock Configuration */ +#define ISF_REG_RCR 0x05 /* Read Configuration Register */ + +/* + * Protection Registers + */ +#define ISF_REG_L0 0x80 /* Lock Register 0 */ +#define ISF_REG_FPP 0x81 /* 64-bit Factory Protection Register */ +#define ISF_REG_UPP 0x85 /* 64-bit User Protection Register */ +#define ISF_REG_L1 0x89 /* Lock Register 1 */ +#define ISF_REG_PP1 0x8A /* 128-bit Protection Register 1 */ +#define ISF_REG_PP2 0x92 /* 128-bit Protection Register 2 */ +#define ISF_REG_PP3 0x9A /* 128-bit Protection Register 3 */ +#define ISF_REG_PP4 0xA2 /* 128-bit Protection Register 4 */ +#define ISF_REG_PP5 0xAA /* 128-bit Protection Register 5 */ +#define ISF_REG_PP6 0xB2 /* 128-bit Protection Register 6 */ +#define ISF_REG_PP7 0xBA /* 128-bit Protection Register 7 */ +#define ISF_REG_PP8 0xC2 /* 128-bit Protection Register 8 */ +#define ISF_REG_PP9 0xCA /* 128-bit Protection Register 9 */ +#define ISF_REG_PP10 0xD2 /* 128-bit Protection Register 10 */ +#define ISF_REG_PP11 0xDA /* 128-bit Protection Register 11 */ +#define ISF_REG_PP12 0xE2 /* 128-bit Protection Register 12 */ +#define ISF_REG_PP13 0xEA /* 128-bit Protection Register 13 */ +#define ISF_REG_PP14 0xF2 /* 128-bit Protection Register 14 */ +#define ISF_REG_PP15 0xFA /* 128-bit Protection Register 15 */ +#define ISF_REG_PP16 0x102 /* 128-bit Protection Register 16 */ + +#define ISF_SR_BWS (1 << 0) /* BEFP Status */ +#define ISF_SR_BLS (1 << 1) /* Block-Locked Status */ +#define ISF_SR_PSS (1 << 2) /* Program Suspend Status */ +#define ISF_SR_VPPS (1 << 3) /* Vpp Status */ +#define ISF_SR_PS (1 << 4) /* Program Status */ +#define ISF_SR_ES (1 << 5) /* Erase Status */ +#define ISF_SR_ESS (1 << 6) /* Erase Suspend Status */ +#define ISF_SR_DWS (1 << 7) /* Device Write Status */ +#define ISF_SR_FSC_MASK (ISF_SR_VPPS | ISF_SR_PS | ISF_SR_BLS) + +#define ISF_BUFFER_PROGRAM + +MALLOC_DEFINE(M_ISF, "isf_data", "Intel StrateFlash driver"); +static int isf_debug = 0; + +static struct isf_chips { + uint16_t chip_id; + size_t chip_size; + const char *chip_desc; +} chip_ids[] = { + { 0x8817, 0x0800000, "64-Mbit Top Parameter" }, + { 0x881A, 0x0800000, "64-Mbit Bottom Parameter" }, + { 0x8818, 0x1000000, "128-Mbit Top Parameter" }, + { 0x881B, 0x1000000, "128-Mbit Bottom Parameter" }, + { 0x8919, 0x2000000, "256-Mbit Top Parameter" }, + { 0x891C, 0x2000000, "256-Mbit Bottom Parameter" }, + { 0x8961, 0x2000000, "512-Mbit package (half)" }, + { 0x0000, 0x0000000, NULL } +}; + +static void isf_task(void *arg); + +/* + * Device driver for the Intel StrataFlash NOR flash device. This + * implementation is known to work with 256Mb instances of the device, but may + * also work with other 64/128/512Mb parts without much work. Multiple + * device instances should be used when multiple parts are in the same + * physical package, due to variable block size support in the StrataFlash + * part. + */ + +static uint16_t +isf_read_reg(struct isf_softc *sc, uint16_t reg) +{ + + if (isf_debug) + device_printf(sc->isf_dev, "isf_read_reg(0x%02x)\n", reg); + return (le16toh(bus_read_2(sc->isf_res, reg * 2))); +} + +static uint64_t +isf_read_reg64(struct isf_softc *sc, uint16_t reg) +{ + uint64_t val; + uint16_t *val16 = (uint16_t *)&val; + + if (isf_debug) + device_printf(sc->isf_dev, "isf_read_reg64(0x%02x)\n", reg); + val16[0] = bus_read_2(sc->isf_res, reg * 2); + val16[1] = bus_read_2(sc->isf_res, (reg+1) * 2); + val16[2] = bus_read_2(sc->isf_res, (reg+2) * 2); + val16[3] = bus_read_2(sc->isf_res, (reg+3) * 2); + + return(le64toh(val)); +} + +static uint16_t +isf_read_off(struct isf_softc *sc, off_t off) +{ + + KASSERT(off >= 0, ("%s: negative offset\n", __func__)); + KASSERT(off < sc->isf_disk->d_mediasize, + ("%s: offset out side address space 0x%08jx \n", __func__, + (intmax_t)off)); + + if (isf_debug) + device_printf(sc->isf_dev, "isf_read_off(0x%08jx)\n", + (intmax_t)off); + return (le16toh(bus_read_2(sc->isf_res, off))); +} + +static void +isf_write_cmd(struct isf_softc *sc, off_t off, uint16_t cmd) +{ + + if (isf_debug) + device_printf(sc->isf_dev, "isf_write_cmd(0x%08jx, 0x%02x)\n", + off, cmd); + bus_write_2(sc->isf_res, off, htole16(cmd)); +} + +static uint16_t +isf_read_status(struct isf_softc *sc, off_t off) +{ + + isf_write_cmd(sc, off/2, ISF_CMD_RSR); + return isf_read_off(sc, off); +} + +static void +isf_clear_status(struct isf_softc *sc) +{ + + isf_write_cmd(sc, 0, ISF_CMD_CSR); +} + +static int +isf_full_status_check(struct isf_softc *sc, off_t off) +{ + int error = 0; + uint16_t status; + + status = isf_read_status(sc, off); + if (status & ISF_SR_VPPS) { + device_printf(sc->isf_dev, "Vpp Range Error\n"); + error = EIO; + } else if (status & ISF_SR_PS) { + device_printf(sc->isf_dev, "Program Error\n"); + error = EIO; + } else if (status & ISF_SR_BLS) { + device_printf(sc->isf_dev, "Device Protect Error\n"); + error = EIO; + } + isf_clear_status(sc); + + return(error); +} + +static int +isf_full_erase_status_check(struct isf_softc *sc, off_t off) +{ + int error = 0; + uint16_t status; + + status = isf_read_status(sc, off); + if (status & ISF_SR_VPPS) { + device_printf(sc->isf_dev, "Vpp Range Error\n"); + error = EIO; + } else if (status & (ISF_SR_PS|ISF_SR_ES)) { + device_printf(sc->isf_dev, "Command Sequence Error\n"); + error = EIO; + } else if (status & ISF_SR_ES) { + device_printf(sc->isf_dev, "Block Erase Error\n"); + error = EIO; + } else if (status & ISF_SR_BLS) { + device_printf(sc->isf_dev, "Block Locked Error\n"); + error = EIO; + } + isf_clear_status(sc); + + return(error); +} + +static void +isf_unlock_block(struct isf_softc *sc, off_t off) +{ + + isf_write_cmd(sc, off, ISF_CMD_LBS); + isf_write_cmd(sc, off, ISF_CMD_UB); + isf_write_cmd(sc, off, ISF_CMD_RA); +} + +static void +isf_lock_block(struct isf_softc *sc, off_t off) +{ + + isf_write_cmd(sc, off, ISF_CMD_LBS); + isf_write_cmd(sc, off, ISF_CMD_LB); + isf_write_cmd(sc, off, ISF_CMD_RA); +} + +static void +isf_read(struct isf_softc *sc, off_t off, void *data, size_t len) +{ + + KASSERT((uintptr_t)data % 2 == 0, + ("%s: unaligned data %p", __func__, data)); + KASSERT((len <= ISF_SECTORSIZE) && (len % 2 == 0), + ("%s: invalid length %ju", __func__, len)); + KASSERT(off % ISF_SECTORSIZE == 0, + ("%s: invalid offset %ju\n", __func__, off)); + + /* + * It is not permitted to read blocks that are in the process of + * being erased, but we know they will be all 1's after the + * erase so just report that value if asked about a block that + * is being erased. + */ + if (sc->isf_bstate[off / ISF_ERASE_BLOCK] == BS_ERASING) + memset(data, 0xFF, len); + else + bus_read_region_2(sc->isf_res, off, (uint16_t *)data, len / 2); +} + +static int +isf_write(struct isf_softc *sc, off_t off, void *data, size_t len) +{ + int cycles, error = 0; + uint16_t *dp; + uint16_t status; + off_t coff; + + KASSERT((uintptr_t)data % 2 == 0, + ("%s: unaligned data %p", __func__, data)); + KASSERT((len <= ISF_SECTORSIZE) && (len % 2 == 0), + ("%s: invalid length %ju", __func__, len)); + KASSERT(off % ISF_SECTORSIZE == 0, + ("%s: invalid offset %ju\n", __func__, off)); + KASSERT(!sc->isf_erasing, + ("%s: trying to write while erasing\n", __func__)); + KASSERT(sc->isf_bstate[off / ISF_ERASE_BLOCK] != BS_ERASING, + ("%s: block being erased at %ju\n", __func__, off)); + + isf_unlock_block(sc, off); + +#ifdef ISF_BUFFER_PROGRAM + for (dp = data, coff = off; dp - (uint16_t *)data < len / 2; + dp += 32, coff += 64) { + isf_clear_status(sc); + isf_write_cmd(sc, coff, ISF_CMD_BPS); + cycles = 0xFFFF; + while ( !(isf_read_off(sc, coff) & ISF_SR_DWS) ) { + if (cycles-- == 0) { + device_printf(sc->isf_dev, "timeout waiting" + " for write to start at 0x08%jx\n", + (intmax_t)coff); + return (EIO); + } + isf_write_cmd(sc, coff, ISF_CMD_BPS); + } + + /* When writing N blocks, send N-1 as the count */ + isf_write_cmd(sc, coff, 31); + bus_write_region_2(sc->isf_res, coff, dp, 32); + + isf_write_cmd(sc, coff, ISF_CMD_BPC); + + status = isf_read_off(sc, coff); + cycles = 0xFFFFF; + while ( !(status & ISF_SR_DWS) ) { + if (cycles-- == 0) { + device_printf(sc->isf_dev, "timeout waiting" + " for write to complete at 0x08%jx\n", + (intmax_t)coff); + error = EIO; + break; + } + status = isf_read_off(sc, coff); + } + isf_full_status_check(sc, off); + + isf_write_cmd(sc, coff, ISF_CMD_RA); + } +#else + for (dp = data, coff = off; dp - (uint16_t *)data < len / 2; + dp++, coff += 2) { + isf_write_cmd(sc, coff, ISF_CMD_WPS); + bus_write_2(sc->isf_res, coff, *dp); + status = isf_read_off(sc, coff); + cycles=0xFFFFF; + while ( !(status & ISF_SR_DWS) ) { + if (cycles-- == 0) { + device_printf(sc->isf_dev, "timeout waiting" + " for write to complete at 0x08%jx\n", + (intmax_t)coff); + error = EIO; + break; + } + status = isf_read_off(sc, coff); + } + + } + isf_full_status_check(sc, off); + isf_write_cmd(sc, coff, ISF_CMD_RA); +#endif + + isf_lock_block(sc, off); + + return error; +} + +static void +isf_erase_at(struct isf_softc *sc, off_t off) +{ + int cycles; + uint16_t status; + + isf_unlock_block(sc, off); + isf_clear_status(sc); + + isf_write_cmd(sc, off, ISF_CMD_BES); + isf_write_cmd(sc, off, ISF_CMD_BEC); + + cycles=0xFFFFFF; + status = isf_read_off(sc, off); + while ( !(status & ISF_SR_DWS) ) { +#ifdef NOTYET + ISF_SLEEP(sc, sc, hz); +#endif + if (cycles-- == 0) { + device_printf(sc->isf_dev, + "Giving up on erase\n"); + break; + } + status = isf_read_off(sc, off); + } + + isf_full_erase_status_check(sc, off); + + isf_lock_block(sc, off); + + isf_write_cmd(sc, off, ISF_CMD_RA); +} + +static void +isf_erase_range(struct isf_softc *sc, off_t blk_off, size_t size) +{ + off_t off; + off_t ms = sc->isf_disk->d_mediasize; + + KASSERT(blk_off % ISF_ERASE_BLOCK == 0, + ("%s: invalid offset %ju\n", __func__, blk_off)); + + ISF_LOCK_ASSERT(sc); + + for (off = blk_off; off < blk_off + size; off += ISF_ERASE_BLOCK) { + sc->isf_bstate[off / ISF_ERASE_BLOCK] = BS_ERASING; + + /* + * The first or last 128K is four blocks depending which + * part this is. For now, just assume both are and + * erase four times. + */ + if (off == 0 || ms - off == ISF_ERASE_BLOCK) { + isf_erase_at(sc, off); + isf_erase_at(sc, off + 0x08000); + isf_erase_at(sc, off + 0x10000); + isf_erase_at(sc, off + 0x18000); + } else + isf_erase_at(sc, off); + + sc->isf_bstate[off / ISF_ERASE_BLOCK] = BS_STEADY; + } +} + +/* + * disk(9) methods. + */ +static int +isf_disk_ioctl(struct disk *disk, u_long cmd, void *data, int fflag, + struct thread *td) +{ + int error = 0; + struct isf_softc *sc = disk->d_drv1; + struct isf_range *ir; + + switch (cmd) { + case ISF_ERASE: + ir = data; + if (ir->ir_off % ISF_ERASE_BLOCK != 0 || + ir->ir_off >= disk->d_mediasize || + ir->ir_size == 0 || + ir->ir_size % ISF_ERASE_BLOCK != 0 || + ir->ir_off + ir->ir_size > disk->d_mediasize) { + error = EINVAL; + break; + } + ISF_LOCK(sc); + if (sc->isf_erasing) { + ISF_UNLOCK(sc); + error = EBUSY; + break; + } + sc->isf_erasing = 1; + isf_erase_range(sc, ir->ir_off, ir->ir_size); + sc->isf_erasing = 0; + ISF_UNLOCK(sc); + break; + default: + error = EINVAL; + } + + return (error); +} + +static void +isf_disk_strategy(struct bio *bp) +{ + struct isf_softc *sc = bp->bio_disk->d_drv1;; + + /* + * We advertise a block size and maximum I/O size up the stack; catch + * any attempts to not follow the rules. + */ + KASSERT(bp->bio_bcount == ISF_SECTORSIZE, + ("%s: I/O size not %d", __func__, ISF_SECTORSIZE)); + + ISF_LOCK(sc); + bioq_disksort(&sc->isf_bioq, bp); + ISF_WAKEUP(sc); + ISF_UNLOCK(sc); +} + +static void +isf_task(void *arg) +{ + struct isf_softc *sc = arg; + struct bio *bp; + int ss = sc->isf_disk->d_sectorsize; + int error, i; + + for (;;) { + ISF_LOCK(sc); + do { + bp = bioq_first(&sc->isf_bioq); + if (bp == NULL) { + if (sc->isf_doomed) + kproc_exit(0); + else + ISF_SLEEP(sc, sc, 0); + } + } while (bp == NULL); + bioq_remove(&sc->isf_bioq, bp); + + error = 0; + switch (bp->bio_cmd) { + case BIO_READ: + isf_read(sc, bp->bio_pblkno * ss, bp->bio_data, + bp->bio_bcount); + break; + + case BIO_WRITE: + /* + * In principle one could suspend the in-progress + * erase, process any pending writes to other + * blocks and then proceed, but that seems + * overly complex for the likely usage modes. + */ + if (sc->isf_erasing) { + error = EBUSY; + break; + } + + /* + * Read in the block we want to write and check that + * we're only setting bits to 0. If an erase would + * be required return an I/O error. + */ + isf_read(sc, bp->bio_pblkno * ss, sc->isf_rbuf, + bp->bio_bcount); + for (i = 0; i < bp->bio_bcount / 2; i++) + if ((sc->isf_rbuf[i] & + ((uint16_t *)bp->bio_data)[i]) != + ((uint16_t *)bp->bio_data)[i]) { + device_printf(sc->isf_dev, "write" + " requires erase at 0x%08jx\n", + bp->bio_pblkno * ss); + error = EIO; + break; + } + if (error != 0) + break; + + error = isf_write(sc, bp->bio_pblkno * ss, + bp->bio_data, bp->bio_bcount); + break; + + default: + panic("%s: unsupported I/O operation %d", __func__, + bp->bio_cmd); + } + if (error == 0) + biodone(bp); + else + biofinish(bp, NULL, error); + ISF_UNLOCK(sc); + } +} + +static void +isf_dump_info(struct isf_softc *sc) +{ + int i; + int32_t reg; + + isf_write_cmd(sc, 0, ISF_CMD_RDI); + device_printf(sc->isf_dev, "manufacturer code: 0x%04x\n", + isf_read_reg(sc, ISF_REG_MC)); + device_printf(sc->isf_dev, "device id code: 0x%04x\n", + isf_read_reg(sc, ISF_REG_ID)); + device_printf(sc->isf_dev, "read config register: 0x%04x\n", + isf_read_reg(sc, ISF_REG_RCR)); + + device_printf(sc->isf_dev, "lock register 0: 0x%04x\n", + isf_read_reg(sc, ISF_REG_L0)); + device_printf(sc->isf_dev, "lock register 1: 0x%04x\n", + isf_read_reg(sc, ISF_REG_L1)); + + device_printf(sc->isf_dev, "factory PPR: 0x%016jx\n", + (uintmax_t)isf_read_reg64(sc, ISF_REG_FPP)); + device_printf(sc->isf_dev, "user PPR (64-bit): 0x%016jx\n", + (uintmax_t)isf_read_reg64(sc, ISF_REG_UPP)); + + for (reg = ISF_REG_PP1, i = 1; reg <= ISF_REG_PP16; reg += 8, i++) { + /* XXX: big-endian ordering of uint64_t's */ + device_printf(sc->isf_dev, + "user PPR [%02d]: 0x%016jx%016jx\n", i, + (uintmax_t)isf_read_reg64(sc, reg+4), + (uintmax_t)isf_read_reg64(sc, reg)); + } + + isf_write_cmd(sc, 0, ISF_CMD_RA); +} + +static void +isf_disk_insert(struct isf_softc *sc, off_t mediasize) +{ + struct disk *disk; + + sc->isf_doomed = 0; + sc->isf_erasing = 0; + sc->isf_bstate = malloc(sizeof(*sc->isf_bstate) * + (mediasize / ISF_ERASE_BLOCK), M_ISF, M_ZERO | M_WAITOK); + kproc_create(&isf_task, sc, &sc->isf_proc, 0, 0, "isf"); + + disk = disk_alloc(); + disk->d_drv1 = sc; + disk->d_name = "isf"; + disk->d_unit = sc->isf_unit; + disk->d_strategy = isf_disk_strategy; + disk->d_ioctl = isf_disk_ioctl; + disk->d_sectorsize = ISF_SECTORSIZE; + disk->d_mediasize = mediasize; + disk->d_maxsize = ISF_SECTORSIZE; + sc->isf_disk = disk; + + if (bootverbose) + isf_dump_info(sc); + + disk_create(disk, DISK_VERSION); + device_printf(sc->isf_dev, "%juM flash device\n", + (uintmax_t)disk->d_mediasize / (1024 * 1024)); + +} + +static void +isf_disk_remove(struct isf_softc *sc) +{ + struct disk *disk; + + ISF_LOCK_ASSERT(sc); + KASSERT(sc->isf_disk != NULL, ("%s: isf_disk NULL", __func__)); + + sc->isf_doomed = 1; + ISF_WAKEUP(sc); + ISF_SLEEP(sc, sc->isf_proc, 0); + + /* + * XXXRW: Is it OK to call disk_destroy() under the mutex, or should + * we be deferring that to the calling context once it is released? + */ + disk = sc->isf_disk; + disk_gone(disk); + disk_destroy(disk); + sc->isf_disk = NULL; + free(sc->isf_bstate, M_ISF); + device_printf(sc->isf_dev, "flash device removed\n"); +} + +int +isf_attach(struct isf_softc *sc) +{ + uint16_t id; + u_long start, size; + struct isf_chips *cp = chip_ids; + + start = rman_get_start(sc->isf_res); + if (start % 2 != 0) { + device_printf(sc->isf_dev, + "Unsupported flash start alignment %lu\n", + start); + return (ENXIO); + } + + isf_write_cmd(sc, 0, ISF_CMD_RDI); + id = isf_read_reg(sc, ISF_REG_ID); + while (cp->chip_id != id) + cp++; + if (cp->chip_desc == NULL) { + device_printf(sc->isf_dev, + "Unsupported device ID 0x%04x\n", id); + return (ENXIO); + } + isf_write_cmd(sc, 0, ISF_CMD_RA); + + size = rman_get_size(sc->isf_res); + if (size != cp->chip_size) { + device_printf(sc->isf_dev, + "Unsupported flash size %lu\n", size); + return (ENXIO); + } + + bioq_init(&sc->isf_bioq); + ISF_LOCK_INIT(sc); + sc->isf_disk = NULL; + isf_disk_insert(sc, size); + return(0); +} + +void +isf_detach(struct isf_softc *sc) +{ + + /* + * Simulate a disk removal if one is present to deal with any pending + * or queued I/O. This will occur as a result of a device driver + * detach -- the Intel StrataFlash has no notion of removal itself. + * + * XXXRW: Is the locking here right? + */ + ISF_LOCK(sc); + isf_disk_remove(sc); + bioq_flush(&sc->isf_bioq, NULL, ENXIO); + KASSERT(bioq_first(&sc->isf_bioq) == NULL, + ("%s: non-empty bioq", __func__)); + ISF_UNLOCK(sc); + ISF_LOCK_DESTROY(sc); +} Added: head/sys/dev/isf/isf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/isf/isf.h Sat Aug 25 18:08:20 2012 (r239685) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +#ifndef _DEV_ISF_H_ +#define _DEV_ISF_H_ + +struct isf_range { + off_t ir_off; /* Offset of range to delete (set to 0xFF) */ + size_t ir_size; /* Size of range */ +}; + +#define ISF_ERASE _IOW('I', 1, struct isf_range) + +/* + * Ordinary read and write operations are limited to 512 bytes. + * We support erasing 128K blocks and ignore the fact that portions of the + * flash are in fact divided into 32K blocks. + */ +#define ISF_SECTORSIZE (512) +#define ISF_ERASE_BLOCK (128 * 1024) + +#ifdef _KERNEL +MALLOC_DECLARE(M_ISF); + +enum bstate { + BS_STEADY = 0, + BS_ERASING +}; + +struct isf_softc { + device_t isf_dev; + int isf_unit; + struct resource *isf_res; + int isf_rid; + struct mtx isf_lock; + struct disk *isf_disk; + struct proc *isf_proc; + int isf_doomed; + + /* + * Fields relating to in-progress and pending I/O, if any. + */ + struct bio_queue_head isf_bioq; + uint16_t isf_rbuf[ISF_SECTORSIZE / 2]; + int isf_erasing; + enum bstate *isf_bstate; +}; + +#define ISF_LOCK(sc) mtx_lock(&(sc)->isf_lock) +#define ISF_LOCK_ASSERT(sc) mtx_assert(&(sc)->isf_lock, MA_OWNED) +#define ISF_LOCK_DESTROY(sc) mtx_destroy(&(sc)->isf_lock) +#define ISF_LOCK_INIT(sc) mtx_init(&(sc)->isf_lock, "isf", NULL, \ + MTX_DEF) +#define ISF_SLEEP(sc, wait, timo) mtx_sleep((wait), \ + &(sc)->isf_lock, PRIBIO, \ + "isf", (timo)) +#define ISF_UNLOCK(sc) mtx_unlock(&(sc)->isf_lock) +#define ISF_WAKEUP(sc) wakeup((sc)) + +int isf_attach(struct isf_softc *sc); +void isf_detach(struct isf_softc *sc); +#endif /* _KERNEL */ + +#endif /* _DEV_ISF_H_ */ Added: head/sys/dev/isf/isf_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 19:30:16 2012 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 12A4D106566B; Sat, 25 Aug 2012 19:30:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F24478FC18; Sat, 25 Aug 2012 19:30:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PJUFSm085671; Sat, 25 Aug 2012 19:30:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PJUF12085669; Sat, 25 Aug 2012 19:30:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208251930.q7PJUF12085669@svn.freebsd.org> From: Dimitry Andric Date: Sat, 25 Aug 2012 19:30: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: r239686 - 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: Sat, 25 Aug 2012 19:30:16 -0000 Author: dim Date: Sat Aug 25 19:30:15 2012 New Revision: 239686 URL: http://svn.freebsd.org/changeset/base/239686 Log: When using -stdlib=libc++, add the correct dependency to .depend in bsd.prog.mk. Submitted by: Yamaya Takashi MFC after: 2 weeks Modified: head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sat Aug 25 18:08:20 2012 (r239685) +++ head/share/mk/bsd.prog.mk Sat Aug 25 19:30:15 2012 (r239686) @@ -126,10 +126,14 @@ _EXTRADEPEND: .else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} .if defined(PROG_CXX) +.if !empty(CXXFLAGS:M-stdlib=libc++) + echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} +.else echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} .endif .endif .endif +.endif .if !target(install) From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 20:01:32 2012 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 6953E106567B; Sat, 25 Aug 2012 20:01:32 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53D9E8FC16; Sat, 25 Aug 2012 20:01:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PK1W8l089237; Sat, 25 Aug 2012 20:01:32 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PK1WAq089235; Sat, 25 Aug 2012 20:01:32 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252001.q7PK1WAq089235@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 20:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239687 - head/sys/arm/arm 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, 25 Aug 2012 20:01:32 -0000 Author: gonzo Date: Sat Aug 25 20:01:31 2012 New Revision: 239687 URL: http://svn.freebsd.org/changeset/base/239687 Log: Add clrex, strex , ldrex, strex and variants Submitted by: Alexander Rybalko Modified: head/sys/arm/arm/disassem.c Modified: head/sys/arm/arm/disassem.c ============================================================================== --- head/sys/arm/arm/disassem.c Sat Aug 25 19:30:15 2012 (r239686) +++ head/sys/arm/arm/disassem.c Sat Aug 25 20:01:31 2012 (r239687) @@ -130,6 +130,17 @@ static const struct arm32_insn arm32_i[] { 0x0c500000, 0x04100000, "ldr", "daW" }, { 0x0c500000, 0x04400000, "strb", "daW" }, { 0x0c500000, 0x04500000, "ldrb", "daW" }, +#ifdef __FreeBSD_ARCH_armv6__ + { 0xffffffff, 0xf57ff01f, "clrex", "c" }, + { 0x0ff00ff0, 0x01800f90, "strex", "dmo" }, + { 0x0ff00fff, 0x01900f9f, "ldrex", "do" }, + { 0x0ff00ff0, 0x01a00f90, "strexd", "dmo" }, + { 0x0ff00fff, 0x01b00f9f, "ldrexd", "do" }, + { 0x0ff00ff0, 0x01c00f90, "strexb", "dmo" }, + { 0x0ff00fff, 0x01d00f9f, "ldrexb", "do" }, + { 0x0ff00ff0, 0x01e00f90, "strexh", "dmo" }, + { 0x0ff00fff, 0x01f00f9f, "ldrexh", "do" }, +#endif { 0x0e1f0000, 0x080d0000, "stm", "YnWl" },/* separate out r13 base */ { 0x0e1f0000, 0x081d0000, "ldm", "YnWl" },/* separate out r13 base */ { 0x0e100000, 0x08000000, "stm", "XnWl" }, From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 20:13:19 2012 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 B2EFE1065674; Sat, 25 Aug 2012 20:13:19 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E38E8FC16; Sat, 25 Aug 2012 20:13:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PKDJRQ090570; Sat, 25 Aug 2012 20:13:19 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PKDJjO090568; Sat, 25 Aug 2012 20:13:19 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252013.q7PKDJjO090568@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 20:13: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: r239688 - head/sys/arm/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: Sat, 25 Aug 2012 20:13:19 -0000 Author: gonzo Date: Sat Aug 25 20:13:19 2012 New Revision: 239688 URL: http://svn.freebsd.org/changeset/base/239688 Log: ARM11 might have more then 32 interrupts, e.g. BCM2835: 72 interrupts Modified: head/sys/arm/include/intr.h Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Sat Aug 25 20:01:31 2012 (r239687) +++ head/sys/arm/include/intr.h Sat Aug 25 20:13:19 2012 (r239688) @@ -52,6 +52,8 @@ #define NIRQ 64 #elif defined(CPU_CORTEXA) #define NIRQ 128 +#elif defined(CPU_ARM11) +#define NIRQ 128 #else #define NIRQ 32 #endif From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 20:18:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 482A5106564A; Sat, 25 Aug 2012 20:18:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 330508FC08; Sat, 25 Aug 2012 20:18:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PKIDO3091147; Sat, 25 Aug 2012 20:18:13 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PKIDZn091145; Sat, 25 Aug 2012 20:18:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252018.q7PKIDZn091145@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 20:18: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: r239689 - head/sys/dev/fdt 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, 25 Aug 2012 20:18:13 -0000 Author: gonzo Date: Sat Aug 25 20:18:12 2012 New Revision: 239689 URL: http://svn.freebsd.org/changeset/base/239689 Log: Do not swap byte order if we assign default value for intr_cells Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sat Aug 25 20:13:19 2012 (r239688) +++ head/sys/dev/fdt/fdt_common.c Sat Aug 25 20:18:12 2012 (r239689) @@ -524,7 +524,8 @@ fdt_intr_to_rl(phandle_t node, struct re debugf("no intr-cells defined, defaulting to 1\n"); intr_cells = 1; } - intr_cells = fdt32_to_cpu(intr_cells); + else + intr_cells = fdt32_to_cpu(intr_cells); intr_num = OF_getprop_alloc(node, "interrupts", intr_cells * sizeof(pcell_t), (void **)&intr); From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 21:13:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A21DC106564A; Sat, 25 Aug 2012 21:13:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CAE88FC12; Sat, 25 Aug 2012 21:13:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PLD075097506; Sat, 25 Aug 2012 21:13:00 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PLD0CY097504; Sat, 25 Aug 2012 21:13:00 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252113.q7PLD0CY097504@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 21:13: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: r239690 - head/sys/arm/ti 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, 25 Aug 2012 21:13:00 -0000 Author: gonzo Date: Sat Aug 25 21:13:00 2012 New Revision: 239690 URL: http://svn.freebsd.org/changeset/base/239690 Log: Style cleanup Modified: head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sat Aug 25 20:18:12 2012 (r239689) +++ head/sys/arm/ti/ti_machdep.c Sat Aug 25 21:13:00 2012 (r239690) @@ -339,9 +339,6 @@ initarm(struct arm_boot_params *abp) &memsize) != 0) while(1); -// if (fdt_immr_addr(OMAP44XX_L4_PERIPH_VBASE) != 0) -// while (1); - /* Platform-specific initialisation */ pmap_bootstrap_lastaddr = DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE; @@ -522,7 +519,7 @@ initarm(struct arm_boot_params *abp) undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); - init_proc0(kernelstack.pv_va); + init_proc0(kernelstack.pv_va); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 22:35:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B1F18106564A; Sat, 25 Aug 2012 22:35:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DDE98FC08; Sat, 25 Aug 2012 22:35:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PMZU1N007197; Sat, 25 Aug 2012 22:35:30 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PMZUih007188; Sat, 25 Aug 2012 22:35:30 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208252235.q7PMZUih007188@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 22:35:30 +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: r239691 - in head: share/man/man4 sys/dev/terasic sys/dev/terasic/mtl sys/mips/beri sys/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, 25 Aug 2012 22:35:30 -0000 Author: rwatson Date: Sat Aug 25 22:35:29 2012 New Revision: 239691 URL: http://svn.freebsd.org/changeset/base/239691 Log: Add terasic_mtl(4), a device driver for the Terasic Multi-Touch LCD, used with Terasic's DE-4 and other similar FPGA boards. This display is 800x480 and includes a capacitive touch screen, multi-touch gesture recognition, etc. This device driver depends on a Cambridge- provided IP core that allows the MTL device to be hooked up to the Altera Avalon SoC bus, and also provides a VGA-like text frame buffer. Although it is compiled as a single device driver, it actually implements a number of different device nodes exporting various aspects of this multi-function device to userspace: - Simple memory-mapped driver for the MTL 24-bit pixel frame buffer. - Simple memory-mapped driver for the MTL control register set. - Simple memory-mapped driver for the MTL text frame buffer. - syscons attachment for the MTL text frame buffer. This driver attaches directly to Nexus as is common for SoC device drivers, and for the time being is considered BERI-specific, although in principle it might be used with other hard and soft cores on Altera FPGAs. Control registers, including touchscreen input, are simply memory mapped; in the future it would be desirable to hook up a more conventional device node that can stream events, support kqueue(2)/ poll(2)/select(2), etc. This is the first use of syscons on MIPS, as far as I can tell, and there are some loose ends, such as an inability to use the hardware cursor. More fundamentally, it appears that syscons(4) assumes that either a host is PC-like (i386, amd64) *or* it must be using a graphical frame buffer. While the MTL supports a graphical frame buffer, using the text frame buffer is preferable for console use. Fixing this issue in syscons(4) requires non-trivial changes, as the text frame buffer support assumes that direct memory access can be done to the text frame buffer without using bus accessor methods, which is not the case on MIPS. As a workaround for this, we instead double-buffer and pretend to be a graphical frame buffer exposing text accessor methods, leading to some quirks in syscons behaviour. Sponsored by: DARPA, AFRL Added: head/share/man/man4/terasic_mtl.4 (contents, props changed) head/sys/dev/terasic/ head/sys/dev/terasic/mtl/ head/sys/dev/terasic/mtl/terasic_mtl.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl.h (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_nexus.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_pixel.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_reg.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_syscons.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_text.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/mips/beri/files.beri head/sys/mips/conf/BERI_DE4.hints head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 21:13:00 2012 (r239690) +++ head/share/man/man4/Makefile Sat Aug 25 22:35:29 2012 (r239691) @@ -457,6 +457,7 @@ MAN= aac.4 \ targ.4 \ tcp.4 \ tdfx.4 \ + terasic_mtl.4 \ termios.4 \ textdump.4 \ ti.4 \ Added: head/share/man/man4/terasic_mtl.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/terasic_mtl.4 Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,132 @@ +.\"- +.\" Copyright (c) 2012 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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$ +.\" +.Dd August 18, 2012 +.Dt TERASIC_MTL 4 +.Os +.Sh NAME +.Nm terasic_mtl +.Nd driver for the Terasic/Cambridge Multi-Touch LCD device +.Sh SYNOPSIS +.Cd "device terasic_mtl" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.terasic_mtl.0.at="nexus0" +.Cd hint.terasic_mtl.0.reg_maddr=0x70400000 +.Cd hint.terasic_mtl.0.reg_msize=0x1000 +.Cd hint.terasic_mtl.0.pixel_maddr=0x70000000 +.Cd hint.terasic_mtl.0.pixel_msize=0x177000 +.Cd hint.terasic_mtl.0.text_maddr=0x70177000 +.Cd hint.terasic_mtl.0.text_msize=0x2000 +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Terasic Multi-Touch LCD combined as +controlled by a University of Cambridge's IP Core. +Three device nodes are instantiated, representing various services supported +by the device: +.Bl -tag -width terasic_pixelX +.It terasic_regX +Memory-mapped register interface, including touch screen input. +.It terasic_pixelX +Memory-mapped pixel-oriented frame buffer. +.It terasic_textX +Memory-mapped text-oriented frame buffer. +.El +.Pp +.Nm +devices are also attached to the +.Xr syscons 4 +framework, which implements a VT-compatible terminal connected to the +.Xr tty 4 +framework. +.Li ttyvX +device nodes may be added to +.Xr ttys 5 +in order to launch +.Xr login 1 +sessions at boot. +.Pp +Register, text, and pixel devices may be accessed using +.Xr read 2 +and +.Xr write 2 +system calls, and also memory mapped using +.Xr mmap 2 . +.Sh SEE ALSO +.Xr login 1 , +.Xr ioctl 2 , +.Xr mmap 2 , +.Xr poll 2 , +.Xr read 2 , +.Xr write 2 , +.Xr syscons 4 , +.Xr tty 4 , +.Xr ttys 5 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +This device driver was written by +.An Robert N. M. Watson . +.Sh BUGS +.Nm +The +.Xr syscons 4 +attachment does not support the hardware cursor feature. +.Pp +A more structured interface to control registers using the +.Xr ioctl 2 +system call, would sometimes be preferable to memory mapping. +For touch screen input, it would be highly desirable to offer a streaming +interface whose events can be managed using +.Xr poll 2 +and related system calls, with the kernel performing polling rather than the +userspace application. +.Pp +.Nm +supports only a +.Li nexus +bus attachment, which is appropriate for system-on-chip busses such as +Altera's Avalon bus. +If the IP core is configured off of another bus type, then additional bus +attachments will be required. Added: head/sys/dev/terasic/mtl/terasic_mtl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl.c Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,110 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include /* struct vt_mode */ +#include /* video_adapter_t */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* + * Device driver for the Terasic Multitouch LCD (MTL). Three separate + * sub-drivers that support, respectively, access to device control registers, + * the pixel frame buffer, and the text frame buffer. The last of these is + * also hooked up to syscons. + * + * Eventually, the frame buffer control registers and touch screen input FIFO + * will end up being separate sub-drivers as well. + * + * Note: sub-driver detach routines must check whether or not they have + * attached as they may be called even if the attach routine hasn't been, on + * an error. + */ +int +terasic_mtl_attach(struct terasic_mtl_softc *sc) +{ + int error; + + error = terasic_mtl_reg_attach(sc); + if (error) + goto error; + error = terasic_mtl_pixel_attach(sc); + if (error) + goto error; + error = terasic_mtl_text_attach(sc); + if (error) + goto error; + /* + * XXXRW: Once we've attached syscons, we can't detach it, so do it + * last. + */ + error = terasic_mtl_syscons_attach(sc); + if (error) + goto error; + terasic_mtl_blend_default_set(sc, TERASIC_MTL_COLOR_BLACK); + terasic_mtl_blend_pixel_set(sc, TERASIC_MTL_ALPHA_TRANSPARENT); + terasic_mtl_blend_textfg_set(sc, TERASIC_MTL_ALPHA_OPAQUE); + terasic_mtl_blend_textbg_set(sc, TERASIC_MTL_ALPHA_OPAQUE); + return (0); +error: + terasic_mtl_text_detach(sc); + terasic_mtl_pixel_detach(sc); + terasic_mtl_reg_detach(sc); + return (error); +} + +void +terasic_mtl_detach(struct terasic_mtl_softc *sc) +{ + + /* XXXRW: syscons can't detach, but we try anyway, only to panic. */ + terasic_mtl_syscons_detach(sc); + + /* All other aspects of the driver can detach just fine. */ + terasic_mtl_text_detach(sc); + terasic_mtl_pixel_detach(sc); + terasic_mtl_reg_detach(sc); +} Added: head/sys/dev/terasic/mtl/terasic_mtl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl.h Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,210 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +#ifndef _DEV_TERASIC_MTL_H_ +#define _DEV_TERASIC_MTL_H_ + +struct terasic_mtl_softc { + /* + * syscons requires that its video_adapter_t be at the front of the + * softc, so place syscons fields first, which we otherwise would + * probably not do. + */ + video_adapter_t mtl_va; + + /* + * Bus-related fields. + */ + device_t mtl_dev; + int mtl_unit; + + /* + * The MTL driver doesn't require a lot of synchronisation; however, + * the lock is used to protect read-modify-write operations on MTL + * registers. + */ + struct mtx mtl_lock; + + /* + * Control register device -- mappable from userspace. + */ + struct cdev *mtl_reg_cdev; + struct resource *mtl_reg_res; + int mtl_reg_rid; + + /* + * Graphics frame buffer device -- mappable form userspace. + */ + struct cdev *mtl_pixel_cdev; + struct resource *mtl_pixel_res; + int mtl_pixel_rid; + + /* + * Text frame buffer device -- mappable from userspace, and syscons + * hookup. + */ + struct cdev *mtl_text_cdev; + struct resource *mtl_text_res; + int mtl_text_rid; + uint16_t *mtl_text_soft; +}; + +#define TERASIC_MTL_LOCK(sc) mtx_lock(&(sc)->mtl_lock) +#define TERASIC_MTL_LOCK_ASSERT(sc) mtx_assert(&(sc)->mtl_lock, MA_OWNED) +#define TERASIC_MTL_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtl_lock) +#define TERASIC_MTL_LOCK_INIT(sc) mtx_init(&(sc)->mtl_lock, \ + "terasic_mtl", NULL, MTX_DEF) +#define TERASIC_MTL_UNLOCK(sc) mtx_unlock(&(sc)->mtl_lock) + +/* + * Constant properties of the MTL text frame buffer. + */ +#define TERASIC_MTL_COLS 100 +#define TERASIC_MTL_ROWS 40 + +/* + * MTL control register offsets. + */ +#define TERASIC_MTL_OFF_BLEND 0 +#define TERASIC_MTL_OFF_TEXTCURSOR 4 +#define TERASIC_MTL_OFF_TEXTFRAMEBUFADDR 8 +#define TERASIC_MTL_OFF_TOUCHPOINT_X1 12 +#define TERASIC_MTL_OFF_TOUCHPOINT_Y1 16 +#define TERASIC_MTL_OFF_TOUCHPOINT_X2 20 +#define TERASIC_MTL_OFF_TOUCHPOINT_Y2 24 +#define TERASIC_MTL_OFF_TOUCHGESTURE 28 + +/* + * Constants to help interpret various control registers. + */ +#define TERASIC_MTL_BLEND_DEFAULT_MASK 0x0f000000 +#define TERASIC_MTL_BLEND_DEFAULT_SHIFT 24 +#define TERASIC_MTL_BLEND_PIXEL_MASK 0x00ff0000 +#define TERASIC_MTL_BLEND_PIXEL_SHIFT 16 +#define TERASIC_MTL_BLEND_TEXTFG_MASK 0x0000ff00 +#define TERASIC_MTL_BLEND_TEXTFG_SHIFT 8 +#define TERASIC_MTL_BLEND_TEXTBG_MASK 0x000000ff +#define TERASIC_MTL_BLEND_TEXTBG_SHIFT 0 +#define TERASIC_MTL_TEXTCURSOR_COL_MASK 0xff00 +#define TERASIC_MTL_TEXTCURSOR_COL_SHIFT 8 +#define TERASIC_MTL_TEXTCURSOR_ROW_MASK 0xff + +/* + * Colours used both by VGA-like text rendering, and for the default display + * colour. + */ +#define TERASIC_MTL_COLOR_BLACK 0 +#define TERASIC_MTL_COLOR_DARKBLUE 1 +#define TERASIC_MTL_COLOR_DARKGREEN 2 +#define TERASIC_MTL_COLOR_DARKCYAN 3 +#define TERASIC_MTL_COLOR_DARKRED 4 +#define TERASIC_MTL_COLOR_DARKMAGENTA 5 +#define TERASIC_MTL_COLOR_BROWN 6 +#define TERASIC_MTL_COLOR_LIGHTGREY 7 +#define TERASIC_MTL_COLOR_DARKGREY 8 +#define TERASIC_MTL_COLOR_LIGHTBLUE 9 +#define TERASIC_MTL_COLOR_LIGHTGREEN 10 +#define TERASIC_MTL_COLOR_LIGHTCYAN 11 +#define TERASIC_MTL_COLOR_LIGHTRED 12 +#define TERASIC_MTL_COLOR_LIGHTMAGENTA 13 +#define TERASIC_MTL_COLOR_LIGHTYELLOW 14 +#define TERASIC_MTL_COLOR_WHITE 15 +#define TERASIC_MTL_COLORMASK_BLINK 0x80 + +/* + * Constants to help interpret the text frame buffer. + */ +#define TERASIC_MTL_TEXTFRAMEBUF_EXPECTED_ADDR 0x0177000 +#define TERASIC_MTL_TEXTFRAMEBUF_CHAR_SHIFT 0 +#define TERASIC_MTL_TEXTFRAMEBUF_ATTR_SHIFT 8 + +/* + * Alpha-blending constants. + */ +#define TERASIC_MTL_ALPHA_TRANSPARENT 0 +#define TERASIC_MTL_ALPHA_OPAQUE 255 + +/* + * Driver setup routines from the bus attachment/teardown. + */ +int terasic_mtl_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_detach(struct terasic_mtl_softc *sc); + +/* + * Sub-driver setup routines. + */ +int terasic_mtl_pixel_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_pixel_detach(struct terasic_mtl_softc *sc); +int terasic_mtl_reg_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_reg_detach(struct terasic_mtl_softc *sc); +int terasic_mtl_syscons_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_syscons_detach(struct terasic_mtl_softc *sc); +int terasic_mtl_text_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_text_detach(struct terasic_mtl_softc *sc); + +/* + * Control register I/O routines. + */ +void terasic_mtl_reg_blank(struct terasic_mtl_softc *sc); + +void terasic_mtl_reg_blend_get(struct terasic_mtl_softc *sc, + uint32_t *blendp); +void terasic_mtl_reg_blend_set(struct terasic_mtl_softc *sc, + uint32_t blend); +void terasic_mtl_reg_textcursor_get(struct terasic_mtl_softc *sc, + uint8_t *colp, uint8_t *rowp); +void terasic_mtl_reg_textcursor_set(struct terasic_mtl_softc *sc, + uint8_t col, uint8_t row); +void terasic_mtl_reg_textframebufaddr_get(struct terasic_mtl_softc *sc, + uint32_t *addrp); +void terasic_mtl_reg_textframebufaddr_set(struct terasic_mtl_softc *sc, + uint32_t addr); + +/* + * Read-modify-write updates of sub-bytes of the blend register. + */ +void terasic_mtl_blend_default_set(struct terasic_mtl_softc *sc, + uint8_t colour); +void terasic_mtl_blend_pixel_set(struct terasic_mtl_softc *sc, + uint8_t alpha); +void terasic_mtl_blend_textfg_set(struct terasic_mtl_softc *sc, + uint8_t alpha); +void terasic_mtl_blend_textbg_set(struct terasic_mtl_softc *sc, + uint8_t alpha); + +/* + * Text frame buffer I/O routines. + */ +void terasic_mtl_text_putc(struct terasic_mtl_softc *sc, u_int x, u_int y, + uint8_t c, uint8_t a); + +#endif /* _DEV_TERASIC_MTL_H_ */ Added: head/sys/dev/terasic/mtl/terasic_mtl_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include /* struct vt_mode */ +#include /* video_adapter_t */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +static int +terasic_mtl_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); + return (BUS_PROBE_DEFAULT); +} + +static int +terasic_mtl_nexus_attach(device_t dev) +{ + struct terasic_mtl_softc *sc; + u_long pixel_maddr, text_maddr, reg_maddr; + u_long pixel_msize, text_msize, reg_msize; + int error; + + sc = device_get_softc(dev); + sc->mtl_dev = dev; + sc->mtl_unit = device_get_unit(dev); + + /* + * Query non-standard hints to find the locations of our two memory + * regions. Enforce certain alignment and size requirements. + */ + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "reg_maddr", ®_maddr) != 0 || (reg_maddr % PAGE_SIZE != 0)) { + device_printf(dev, "improper register address"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "reg_msize", ®_msize) != 0 || (reg_msize % PAGE_SIZE != 0)) { + device_printf(dev, "improper register size"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "pixel_maddr", &pixel_maddr) != 0 || + (pixel_maddr % PAGE_SIZE != 0)) { + device_printf(dev, "improper pixel frame buffer address"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "pixel_msize", &pixel_msize) != 0 || + (pixel_msize % PAGE_SIZE != 0)) { + device_printf(dev, "improper pixel frame buffer size"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "text_maddr", &text_maddr) != 0 || + (text_maddr % PAGE_SIZE != 0)) { + device_printf(dev, "improper text frame buffer address"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "text_msize", &text_msize) != 0 || + (text_msize % PAGE_SIZE != 0)) { + device_printf(dev, "improper text frame buffer size"); + return (ENXIO); + } + + /* + * Allocate resources. + */ + sc->mtl_reg_rid = 0; + sc->mtl_reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, + &sc->mtl_reg_rid, reg_maddr, reg_maddr + reg_msize - 1, + reg_msize, RF_ACTIVE); + if (sc->mtl_reg_res == NULL) { + device_printf(dev, "couldn't map register memory\n"); + error = ENXIO; + goto error; + } + device_printf(sc->mtl_dev, "registers at mem %p-%p\n", + (void *)reg_maddr, (void *)(reg_maddr + reg_msize)); + sc->mtl_pixel_rid = 0; + sc->mtl_pixel_res = bus_alloc_resource(dev, SYS_RES_MEMORY, + &sc->mtl_pixel_rid, pixel_maddr, pixel_maddr + pixel_msize - 1, + pixel_msize, RF_ACTIVE); + if (sc->mtl_pixel_res == NULL) { + device_printf(dev, "couldn't map pixel memory\n"); + error = ENXIO; + goto error; + } + device_printf(sc->mtl_dev, "pixel frame buffer at mem %p-%p\n", + (void *)pixel_maddr, (void *)(pixel_maddr + pixel_msize)); + sc->mtl_text_rid = 0; + sc->mtl_text_res = bus_alloc_resource(dev, SYS_RES_MEMORY, + &sc->mtl_text_rid, text_maddr, text_maddr + text_msize - 1, + text_msize, RF_ACTIVE); + if (sc->mtl_text_res == NULL) { + device_printf(dev, "couldn't map text memory\n"); + error = ENXIO; + goto error; + } + device_printf(sc->mtl_dev, "text frame buffer at mem %p-%p\n", + (void *)text_maddr, (void *)(text_maddr + text_msize)); + error = terasic_mtl_attach(sc); + if (error == 0) + return (0); +error: + if (sc->mtl_text_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_text_rid, + sc->mtl_text_res); + if (sc->mtl_pixel_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_pixel_rid, + sc->mtl_pixel_res); + if (sc->mtl_reg_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_reg_rid, + sc->mtl_reg_res); + return (error); +} + +static int +terasic_mtl_nexus_detach(device_t dev) +{ + struct terasic_mtl_softc *sc; + + sc = device_get_softc(dev); + terasic_mtl_detach(sc); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_text_rid, + sc->mtl_text_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_pixel_rid, + sc->mtl_pixel_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_reg_rid, + sc->mtl_reg_res); + return (0); +} + +static device_method_t terasic_mtl_nexus_methods[] = { + DEVMETHOD(device_probe, terasic_mtl_nexus_probe), + DEVMETHOD(device_attach, terasic_mtl_nexus_attach), + DEVMETHOD(device_detach, terasic_mtl_nexus_detach), + { 0, 0 } +}; + +static driver_t terasic_mtl_nexus_driver = { + "terasic_mtl", + terasic_mtl_nexus_methods, + sizeof(struct terasic_mtl_softc), +}; + +static devclass_t terasic_mtl_devclass; + +DRIVER_MODULE(mtl, nexus, terasic_mtl_nexus_driver, terasic_mtl_devclass, 0, + 0); Added: head/sys/dev/terasic/mtl/terasic_mtl_pixel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl_pixel.c Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,159 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include /* struct vt_mode */ +#include /* video_adapter_t */ +#include +#include +#include +#include + +#include +#include +#include + +#include + +static d_mmap_t terasic_mtl_pixel_mmap; +static d_read_t terasic_mtl_pixel_read; +static d_write_t terasic_mtl_pixel_write; + +static struct cdevsw mtl_pixel_cdevsw = { + .d_version = D_VERSION, + .d_mmap = terasic_mtl_pixel_mmap, + .d_read = terasic_mtl_pixel_read, + .d_write = terasic_mtl_pixel_write, + .d_name = "terasic_mtl_pixel", +}; + +/* + * All I/O to/from the MTL pixel device must be 32-bit, and aligned to 32-bit. + */ +static int +terasic_mtl_pixel_read(struct cdev *dev, struct uio *uio, int flag) +{ + struct terasic_mtl_softc *sc; + u_long offset, size; + uint32_t v; + int error; + + if (uio->uio_offset < 0 || uio->uio_offset % 4 != 0 || + uio->uio_resid % 4 != 0) + return (ENODEV); + sc = dev->si_drv1; + size = rman_get_size(sc->mtl_pixel_res); + error = 0; + if ((uio->uio_offset + uio->uio_resid < 0) || + (uio->uio_offset + uio->uio_resid > size)) + return (ENODEV); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + sizeof(v) > size) + return (ENODEV); + v = bus_read_4(sc->mtl_pixel_res, offset); + error = uiomove(&v, sizeof(v), uio); + if (error) + return (error); + } + return (error); +} + +static int +terasic_mtl_pixel_write(struct cdev *dev, struct uio *uio, int flag) +{ + struct terasic_mtl_softc *sc; + u_long offset, size; + uint32_t v; + int error; + + if (uio->uio_offset < 0 || uio->uio_offset % 4 != 0 || + uio->uio_resid % 4 != 0) + return (ENODEV); + sc = dev->si_drv1; + size = rman_get_size(sc->mtl_pixel_res); + error = 0; + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + sizeof(v) > size) + return (ENODEV); + error = uiomove(&v, sizeof(v), uio); + if (error) + return (error); + bus_write_4(sc->mtl_pixel_res, offset, v); + } + return (error); +} + +static int +terasic_mtl_pixel_mmap(struct cdev *dev, vm_ooffset_t offset, + vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) +{ + struct terasic_mtl_softc *sc; + int error; + + sc = dev->si_drv1; + error = 0; + if (trunc_page(offset) == offset && + rman_get_size(sc->mtl_pixel_res) >= offset + PAGE_SIZE) { + *paddr = rman_get_start(sc->mtl_pixel_res) + offset; + *memattr = VM_MEMATTR_UNCACHEABLE; + } else + error = ENODEV; + return (error); +} + +int +terasic_mtl_pixel_attach(struct terasic_mtl_softc *sc) +{ + + sc->mtl_pixel_cdev = make_dev(&mtl_pixel_cdevsw, sc->mtl_unit, + UID_ROOT, GID_WHEEL, 0400, "mtl_pixel%d", sc->mtl_unit); + if (sc->mtl_pixel_cdev == NULL) { + device_printf(sc->mtl_dev, "%s: make_dev failed\n", __func__); + return (ENXIO); + } + /* XXXRW: Slight race between make_dev(9) and here. */ + sc->mtl_pixel_cdev->si_drv1 = sc; + return (0); +} + +void +terasic_mtl_pixel_detach(struct terasic_mtl_softc *sc) +{ + + if (sc->mtl_pixel_cdev != NULL) + destroy_dev(sc->mtl_pixel_cdev); +} Added: head/sys/dev/terasic/mtl/terasic_mtl_reg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl_reg.c Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,278 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include /* struct vt_mode */ +#include +#include /* video_adapter_t */ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +static d_mmap_t terasic_mtl_reg_mmap; +static d_read_t terasic_mtl_reg_read; +static d_write_t terasic_mtl_reg_write; + +static struct cdevsw terasic_mtl_reg_cdevsw = { + .d_version = D_VERSION, + .d_mmap = terasic_mtl_reg_mmap, + .d_read = terasic_mtl_reg_read, + .d_write = terasic_mtl_reg_write, + .d_name = "terasic_mtl_reg", +}; + +/* + * All I/O to/from the MTL register device must be 32-bit, and aligned to + * 32-bit. + */ +static int +terasic_mtl_reg_read(struct cdev *dev, struct uio *uio, int flag) +{ + struct terasic_mtl_softc *sc; + u_long offset, size; + uint32_t v; + int error; + + if (uio->uio_offset < 0 || uio->uio_offset % 4 != 0 || + uio->uio_resid % 4 != 0) + return (ENODEV); + sc = dev->si_drv1; + size = rman_get_size(sc->mtl_reg_res); + error = 0; + if ((uio->uio_offset + uio->uio_resid < 0) || + (uio->uio_offset + uio->uio_resid > size)) + return (ENODEV); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + sizeof(v) > size) + return (ENODEV); + v = bus_read_4(sc->mtl_reg_res, offset); + error = uiomove(&v, sizeof(v), uio); + if (error) + return (error); + } + return (error); +} + +static int +terasic_mtl_reg_write(struct cdev *dev, struct uio *uio, int flag) +{ + struct terasic_mtl_softc *sc; + u_long offset, size; + uint32_t v; + int error; + + if (uio->uio_offset < 0 || uio->uio_offset % 4 != 0 || + uio->uio_resid % 4 != 0) + return (ENODEV); + sc = dev->si_drv1; + size = rman_get_size(sc->mtl_reg_res); + error = 0; + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + sizeof(v) > size) + return (ENODEV); + error = uiomove(&v, sizeof(v), uio); + if (error) + return (error); + bus_write_4(sc->mtl_reg_res, offset, v); + } + return (error); +} + +static int +terasic_mtl_reg_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) +{ + struct terasic_mtl_softc *sc; + int error; + + sc = dev->si_drv1; + error = 0; + if (trunc_page(offset) == offset && + rman_get_size(sc->mtl_reg_res) >= offset + PAGE_SIZE) { + *paddr = rman_get_start(sc->mtl_reg_res) + offset; + *memattr = VM_MEMATTR_UNCACHEABLE; + } else + error = ENODEV; + return (error); +} + +void +terasic_mtl_reg_blend_get(struct terasic_mtl_softc *sc, uint32_t *blendp) +{ + + *blendp = le32toh(bus_read_4(sc->mtl_reg_res, TERASIC_MTL_OFF_BLEND)); +} + +void +terasic_mtl_reg_blend_set(struct terasic_mtl_softc *sc, uint32_t blend) +{ + + bus_write_4(sc->mtl_reg_res, TERASIC_MTL_OFF_BLEND, htole32(blend)); +} + +void +terasic_mtl_blend_default_set(struct terasic_mtl_softc *sc, uint8_t colour) +{ + uint32_t v; + + TERASIC_MTL_LOCK(sc); + terasic_mtl_reg_blend_get(sc, &v); + v &= ~TERASIC_MTL_BLEND_DEFAULT_MASK; + v |= colour << TERASIC_MTL_BLEND_DEFAULT_SHIFT; + terasic_mtl_reg_blend_set(sc, v); + TERASIC_MTL_UNLOCK(sc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 23:01:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7AA2D1065673; Sat, 25 Aug 2012 23:01:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6607A8FC1C; Sat, 25 Aug 2012 23:01:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PN1wSv010229; Sat, 25 Aug 2012 23:01:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PN1wQR010227; Sat, 25 Aug 2012 23:01:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208252301.q7PN1wQR010227@svn.freebsd.org> From: Alexander Motin Date: Sat, 25 Aug 2012 23:01: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: r239693 - head/sys/dev/ahci 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, 25 Aug 2012 23:01:58 -0000 Author: mav Date: Sat Aug 25 23:01:57 2012 New Revision: 239693 URL: http://svn.freebsd.org/changeset/base/239693 Log: Return "locally assigned" Enclosure Logical Identifier instead of 8 zero bytes. Zeroes there are incorrect and tend to cause false device ID matches. Modified: head/sys/dev/ahci/ahciem.c Modified: head/sys/dev/ahci/ahciem.c ============================================================================== --- head/sys/dev/ahci/ahciem.c Sat Aug 25 22:45:26 2012 (r239692) +++ head/sys/dev/ahci/ahciem.c Sat Aug 25 23:01:57 2012 (r239693) @@ -380,6 +380,8 @@ ahci_em_emulate_ses_on_led(device_t dev, ccb->ataio.cmd.sector_count >= 16) { bzero(buf, ccb->ataio.dxfer_len); buf[0] = 64; /* Valid bytes. */ + buf[2] = 0x30; /* NAA Locally Assigned. */ + strncpy(&buf[3], device_get_nameunit(dev), 7); strncpy(&buf[10], "AHCI ", SID_VENDOR_SIZE); strncpy(&buf[18], "SGPIO Enclosure ", SID_PRODUCT_SIZE); strncpy(&buf[34], "1.00", SID_REVISION_SIZE); From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 23:08:25 2012 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 49297106564A; Sat, 25 Aug 2012 23:08:25 +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 342508FC0C; Sat, 25 Aug 2012 23:08:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PN8PM1011084; Sat, 25 Aug 2012 23:08:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PN8O33011081; Sat, 25 Aug 2012 23:08:24 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208252308.q7PN8O33011081@svn.freebsd.org> From: Dimitry Andric Date: Sat, 25 Aug 2012 23:08: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: r239695 - in head/gnu/lib: libstdc++ libsupc++ 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, 25 Aug 2012 23:08:25 -0000 Author: dim Date: Sat Aug 25 23:08:24 2012 New Revision: 239695 URL: http://svn.freebsd.org/changeset/base/239695 Log: For building libstdc++ and libsupc++, filter out any -stdlib=libc++ option from CXXFLAGS, otherwise these libraries will not build. Similarly, filter out any -std=xxx options that aren't supported. Submitted by: Yamaya Takashi MFC after: 2 weeks Modified: head/gnu/lib/libstdc++/Makefile head/gnu/lib/libsupc++/Makefile Modified: head/gnu/lib/libstdc++/Makefile ============================================================================== --- head/gnu/lib/libstdc++/Makefile Sat Aug 25 23:03:45 2012 (r239694) +++ head/gnu/lib/libstdc++/Makefile Sat Aug 25 23:08:24 2012 (r239695) @@ -22,6 +22,7 @@ CFLAGS+= -I${GCCLIB}/include -I${SRCDIR} CFLAGS+= -frandom-seed=RepeatabilityConsideredGood CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections \ -Wno-deprecated +CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} PO_CXXFLAGS= ${CXXFLAGS:N-ffunction-sections} DPADD= ${LIBM} Modified: head/gnu/lib/libsupc++/Makefile ============================================================================== --- head/gnu/lib/libsupc++/Makefile Sat Aug 25 23:03:45 2012 (r239694) +++ head/gnu/lib/libsupc++/Makefile Sat Aug 25 23:08:24 2012 (r239695) @@ -24,6 +24,7 @@ CFLAGS+= -I${GCCLIB}/include -I${SRCDIR} CFLAGS+= -I${.CURDIR}/../libstdc++ -I. CFLAGS+= -frandom-seed=RepeatabilityConsideredGood CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections +CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} PO_CXXFLAGS= ${CXXFLAGS:N-ffunction-sections} HDRS= exception new typeinfo cxxabi.h exception_defines.h From owner-svn-src-all@FreeBSD.ORG Sat Aug 25 23:59:32 2012 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 35DDD1065689; Sat, 25 Aug 2012 23:59:32 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F07E8FC0A; Sat, 25 Aug 2012 23:59:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7PNxVFA018143; Sat, 25 Aug 2012 23:59:31 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PNxVrT018134; Sat, 25 Aug 2012 23:59:31 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252359.q7PNxVrT018134@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 23: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: r239696 - in head/sys: arm/arm arm/include conf dev/fb dev/syscons 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, 25 Aug 2012 23:59:32 -0000 Author: gonzo Date: Sat Aug 25 23:59:31 2012 New Revision: 239696 URL: http://svn.freebsd.org/changeset/base/239696 Log: Piggyback MIPS changes and add ARM syscons support for devices with framebuffer While here - sort #if defined() order alphabetically Added: head/sys/arm/arm/sc_machdep.c (contents, props changed) head/sys/arm/include/sc_machdep.h (contents, props changed) Modified: head/sys/conf/files.arm head/sys/conf/options.arm head/sys/dev/fb/fbreg.h head/sys/dev/syscons/schistory.c head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/syscons.c Added: head/sys/arm/arm/sc_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/sc_machdep.c Sat Aug 25 23:59:31 2012 (r239696) @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2003 Jake Burkholder. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static sc_softc_t sc_softcs[8]; + +int +sc_get_cons_priority(int *unit, int *flags) +{ + + *unit = 0; + *flags = 0; + return (CN_INTERNAL); +} + +int +sc_max_unit(void) +{ + return (1); +} + +sc_softc_t * +sc_get_softc(int unit, int flags) +{ + sc_softc_t *sc; + + if (unit < 0) + return (NULL); + sc = &sc_softcs[unit]; + sc->unit = unit; + if ((sc->flags & SC_INIT_DONE) == 0) { + sc->keyboard = -1; + sc->adapter = -1; + sc->cursor_char = SC_CURSOR_CHAR; + sc->mouse_char = SC_MOUSE_CHAR; + } + return (sc); +} + +void +sc_get_bios_values(bios_values_t *values) +{ + values->cursor_start = 0; + values->cursor_end = 32; + values->shift_state = 0; +} + +int +sc_tone(int hz) +{ + return (0); +} Added: head/sys/arm/include/sc_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/sc_machdep.h Sat Aug 25 23:59:31 2012 (r239696) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2003 Jake Burkholder. + * 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$ + */ + +#ifndef _MACHINE_SC_MACHDEP_H_ +#define _MACHINE_SC_MACHDEP_H_ + +/* Color attributes for foreground text */ + +#define FG_BLACK 0x0 +#define FG_BLUE 0x1 +#define FG_GREEN 0x2 +#define FG_CYAN 0x3 +#define FG_RED 0x4 +#define FG_MAGENTA 0x5 +#define FG_BROWN 0x6 +#define FG_LIGHTGREY 0x7 /* aka white */ +#define FG_DARKGREY 0x8 +#define FG_LIGHTBLUE 0x9 +#define FG_LIGHTGREEN 0xa +#define FG_LIGHTCYAN 0xb +#define FG_LIGHTRED 0xc +#define FG_LIGHTMAGENTA 0xd +#define FG_YELLOW 0xe +#define FG_WHITE 0xf /* aka bright white */ +#define FG_BLINK 0x80 + +/* Color attributes for text background */ + +#define BG_BLACK 0x00 +#define BG_BLUE 0x10 +#define BG_GREEN 0x20 +#define BG_CYAN 0x30 +#define BG_RED 0x40 +#define BG_MAGENTA 0x50 +#define BG_BROWN 0x60 +#define BG_LIGHTGREY 0x70 +#define BG_DARKGREY 0x80 +#define BG_LIGHTBLUE 0x90 +#define BG_LIGHTGREEN 0xa0 +#define BG_LIGHTCYAN 0xb0 +#define BG_LIGHTRED 0xc0 +#define BG_LIGHTMAGENTA 0xd0 +#define BG_YELLOW 0xe0 +#define BG_WHITE 0xf0 + +#endif /* !_MACHINE_SC_MACHDEP_H_ */ Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/conf/files.arm Sat Aug 25 23:59:31 2012 (r239696) @@ -1,4 +1,9 @@ # $FreeBSD$ +font.h optional sc \ + compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ + no-obj no-implicit-rule before-depend \ + clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" + crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb arm/arm/autoconf.c standard @@ -37,6 +42,7 @@ arm/arm/nexus.c standard arm/arm/pl310.c optional pl310 arm/arm/pmap.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 arm/arm/pmap-v6.c optional cpu_arm11 | cpu_cortexa | cpu_mv_pj4b +arm/arm/sc_machdep.c optional sc arm/arm/setcpsr.S standard arm/arm/setstack.s standard arm/arm/stack_machdep.c optional ddb | stack @@ -53,13 +59,18 @@ arm/fpe-arm/armfpe_glue.S optional armfp arm/fpe-arm/armfpe_init.c optional armfpe arm/fpe-arm/armfpe.S optional armfpe cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs compile-with "${ZFS_C}" +dev/fb/fb.c optional sc dev/hwpmc/hwpmc_arm.c optional hwpmc +dev/kbd/kbd.c optional sc dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt dev/ofw/ofw_bus_if.m optional fdt dev/ofw/ofw_if.m optional fdt dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt +dev/syscons/scgfbrndr.c optional sc +dev/syscons/scterm-teken.c optional sc +dev/syscons/scvtb.c optional sc geom/geom_bsd.c optional geom_bsd geom/geom_bsd_enc.c optional geom_bsd geom/geom_mbr.c optional geom_mbr Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/conf/options.arm Sat Aug 25 23:59:31 2012 (r239696) @@ -55,4 +55,7 @@ VM_MAXUSER_ADDRESS opt_global.h AT91_ATE_USE_RMII opt_at91.h AT91_MCI_HAS_4WIRE opt_at91.h AT91_MCI_SLOT_B opt_at91.h +GFB_DEBUG opt_gfb.h +GFB_NO_FONT_LOADING opt_gfb.h +GFB_NO_MODE_CHANGE opt_gfb.h AT91C_MAIN_CLOCK opt_at91.h Modified: head/sys/dev/fb/fbreg.h ============================================================================== --- head/sys/dev/fb/fbreg.h Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/dev/fb/fbreg.h Sat Aug 25 23:59:31 2012 (r239696) @@ -92,7 +92,7 @@ void ofwfb_fillw(int pat, void *base, si u_int16_t ofwfb_readw(u_int16_t *addr); void ofwfb_writew(u_int16_t *addr, u_int16_t val); -#elif defined(__mips__) +#elif defined(__mips__) || defined(__arm__) /* * Use amd64/i386-like settings under the assumption that MIPS-based display @@ -115,6 +115,11 @@ fillw(int val, uint16_t *buf, size_t siz } #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) +#if defined(__arm__) +#define readw(a) (*(uint16_t*)(a)) +#define writew(a, v) (*(uint16_t*)(a) = (v)) +#endif + #else /* !__i386__ && !__amd64__ && !__ia64__ && !__sparc64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) Modified: head/sys/dev/syscons/schistory.c ============================================================================== --- head/sys/dev/syscons/schistory.c Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/dev/syscons/schistory.c Sat Aug 25 23:59:31 2012 (r239696) @@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) +#if defined(__arm__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__sparc64__) #include #else #include Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/dev/syscons/scterm-teken.c Sat Aug 25 23:59:31 2012 (r239696) @@ -40,7 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) +#if defined(__arm__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__sparc64__) #include #else #include Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/dev/syscons/syscons.c Sat Aug 25 23:59:31 2012 (r239696) @@ -62,7 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) +#if defined(__arm__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__sparc64__) #include #else #include