From owner-svn-src-stable@FreeBSD.ORG Sun Dec 28 07:14:39 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD28FE48; Sun, 28 Dec 2014 07:14:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A86FD64DE3; Sun, 28 Dec 2014 07:14:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBS7EdVl084866; Sun, 28 Dec 2014 07:14:39 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBS7Edcc084865; Sun, 28 Dec 2014 07:14:39 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201412280714.sBS7Edcc084865@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Sun, 28 Dec 2014 07:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276327 - stable/10/sys/fs/nfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2014 07:14:39 -0000 Author: peterj Date: Sun Dec 28 07:14:38 2014 New Revision: 276327 URL: https://svnweb.freebsd.org/changeset/base/276327 Log: MFH r275941: Adjust the test of a KASSERT to better match the intent. This assertion was added in r246213 as a guard against corrupted mbufs arriving from drivers, the key distinguishing factor of said mbufs being that they had a negative length. Given we're in a while loop specifically designed to skip over zero-length mbufs, panicking on a zero-length mbuf seems incorrect. Suggested by: rmacklem MFH go-ahead: benno Approved by: grog (co-mentor) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Sun Dec 28 06:41:13 2014 (r276326) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Sun Dec 28 07:14:38 2014 (r276327) @@ -219,7 +219,8 @@ nfsm_mbufuio(struct nfsrv_descript *nd, } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); - KASSERT(len > 0, ("len %d", len)); + KASSERT(len >= 0, + ("len %d, corrupted mbuf?", len)); } xfer = (left > len) ? len : left; #ifdef notdef From owner-svn-src-stable@FreeBSD.ORG Sun Dec 28 07:16:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6507F8B; Sun, 28 Dec 2014 07:16:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91E0664E15; Sun, 28 Dec 2014 07:16:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBS7GnPe085222; Sun, 28 Dec 2014 07:16:49 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBS7GnPB085221; Sun, 28 Dec 2014 07:16:49 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201412280716.sBS7GnPB085221@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Sun, 28 Dec 2014 07:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276328 - stable/9/sys/fs/nfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2014 07:16:49 -0000 Author: peterj Date: Sun Dec 28 07:16:48 2014 New Revision: 276328 URL: https://svnweb.freebsd.org/changeset/base/276328 Log: MFH r275941: Adjust the test of a KASSERT to better match the intent. This assertion was added in r246213 as a guard against corrupted mbufs arriving from drivers, the key distinguishing factor of said mbufs being that they had a negative length. Given we're in a while loop specifically designed to skip over zero-length mbufs, panicking on a zero-length mbuf seems incorrect. Suggested by: rmacklem MFH go-ahead: benno Approved by: grog (co-mentor) Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonsubs.c Sun Dec 28 07:14:38 2014 (r276327) +++ stable/9/sys/fs/nfs/nfs_commonsubs.c Sun Dec 28 07:16:48 2014 (r276328) @@ -200,7 +200,8 @@ nfsm_mbufuio(struct nfsrv_descript *nd, } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); - KASSERT(len > 0, ("len %d", len)); + KASSERT(len >= 0, + ("len %d, corrupted mbuf?", len)); } xfer = (left > len) ? len : left; #ifdef notdef From owner-svn-src-stable@FreeBSD.ORG Sun Dec 28 18:43:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC0D467D; Sun, 28 Dec 2014 18:43:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D0DC2DFB; Sun, 28 Dec 2014 18:43:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBSIheAY008998; Sun, 28 Dec 2014 18:43:40 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBSIheP5008994; Sun, 28 Dec 2014 18:43:40 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201412281843.sBSIheP5008994@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 28 Dec 2014 18:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276337 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2014 18:43:40 -0000 Author: marcel Date: Sun Dec 28 18:43:39 2014 New Revision: 276337 URL: https://svnweb.freebsd.org/changeset/base/276337 Log: MFC r275721: The size of the first level reference count table is given in terms of the number of clusters it occupies. Bump the version number of mkimg. Modified: stable/10/usr.bin/mkimg/Makefile stable/10/usr.bin/mkimg/qcow.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/Makefile ============================================================================== --- stable/10/usr.bin/mkimg/Makefile Sun Dec 28 18:38:25 2014 (r276336) +++ stable/10/usr.bin/mkimg/Makefile Sun Dec 28 18:43:39 2014 (r276337) @@ -4,7 +4,7 @@ PROG= mkimg SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 -MKIMG_VERSION=20141003 +MKIMG_VERSION=20141211 mkimg.o: Makefile CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} Modified: stable/10/usr.bin/mkimg/qcow.c ============================================================================== --- stable/10/usr.bin/mkimg/qcow.c Sun Dec 28 18:38:25 2014 (r276336) +++ stable/10/usr.bin/mkimg/qcow.c Sun Dec 28 18:43:39 2014 (r276337) @@ -71,7 +71,7 @@ struct qcow_header { uint32_t l1_entries; uint64_t l1_offset; uint64_t refcnt_offset; - uint32_t refcnt_entries; + uint32_t refcnt_clstrs; uint32_t snapshot_count; uint64_t snapshot_offset; } v2; @@ -139,7 +139,7 @@ qcow_write(int fd, u_int version) uint64_t n, imagesz, nclstrs, ofs, ofsflags; lba_t blk, blkofs, blk_imgsz; u_int l1clno, l2clno, rcclno; - u_int blk_clstrsz; + u_int blk_clstrsz, refcnt_clstrs; u_int clstrsz, l1idx, l2idx; int error; @@ -199,14 +199,15 @@ qcow_write(int fd, u_int version) be32enc(&hdr->u.v2.l1_entries, clstr_l2tbls); be64enc(&hdr->u.v2.l1_offset, clstrsz * l1clno); be64enc(&hdr->u.v2.refcnt_offset, clstrsz * rcclno); - be32enc(&hdr->u.v2.refcnt_entries, clstr_rcblks); + refcnt_clstrs = round_clstr(clstr_rcblks * 8) >> clstr_log2sz; + be32enc(&hdr->u.v2.refcnt_clstrs, refcnt_clstrs); break; default: return (EDOOFUS); } if (sparse_write(fd, hdr, clstrsz) < 0) { - error = errno; + error = errno; goto out; } From owner-svn-src-stable@FreeBSD.ORG Sun Dec 28 18:53:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36D8990A; Sun, 28 Dec 2014 18:53:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21E3E2F6E; Sun, 28 Dec 2014 18:53:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBSIrI87013678; Sun, 28 Dec 2014 18:53:18 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBSIrH9U013677; Sun, 28 Dec 2014 18:53:17 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201412281853.sBSIrH9U013677@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 28 Dec 2014 18:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276338 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2014 18:53:18 -0000 Author: marcel Date: Sun Dec 28 18:53:16 2014 New Revision: 276338 URL: https://svnweb.freebsd.org/changeset/base/276338 Log: MFC r269126 & 272786: Don't return ERESTART when the device is gone. Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Sun Dec 28 18:43:39 2014 (r276337) +++ stable/10/sys/kern/tty.c Sun Dec 28 18:53:16 2014 (r276338) @@ -1391,14 +1391,14 @@ tty_wait(struct tty *tp, struct cv *cv) error = cv_wait_sig(cv, tp->t_mtx); - /* Restart the system call when we may have been revoked. */ - if (tp->t_revokecnt != revokecnt) - return (ERESTART); - /* Bail out when the device slipped away. */ if (tty_gone(tp)) return (ENXIO); + /* Restart the system call when we may have been revoked. */ + if (tp->t_revokecnt != revokecnt) + return (ERESTART); + return (error); } @@ -1413,14 +1413,14 @@ tty_timedwait(struct tty *tp, struct cv error = cv_timedwait_sig(cv, tp->t_mtx, hz); - /* Restart the system call when we may have been revoked. */ - if (tp->t_revokecnt != revokecnt) - return (ERESTART); - /* Bail out when the device slipped away. */ if (tty_gone(tp)) return (ENXIO); + /* Restart the system call when we may have been revoked. */ + if (tp->t_revokecnt != revokecnt) + return (ERESTART); + return (error); } From owner-svn-src-stable@FreeBSD.ORG Sun Dec 28 19:03:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD711D6F; Sun, 28 Dec 2014 19:03:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EE0410F2; Sun, 28 Dec 2014 19:03:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBSJ3UvF018666; Sun, 28 Dec 2014 19:03:30 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBSJ3UJK018665; Sun, 28 Dec 2014 19:03:30 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201412281903.sBSJ3UJK018665@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 28 Dec 2014 19:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276339 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2014 19:03:30 -0000 Author: marcel Date: Sun Dec 28 19:03:29 2014 New Revision: 276339 URL: https://svnweb.freebsd.org/changeset/base/276339 Log: MFC r272789: Fix draining in ttydev_leave(). Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Sun Dec 28 18:53:16 2014 (r276338) +++ stable/10/sys/kern/tty.c Sun Dec 28 19:03:29 2014 (r276339) @@ -123,9 +123,10 @@ tty_watermarks(struct tty *tp) } static int -tty_drain(struct tty *tp) +tty_drain(struct tty *tp, int leaving) { - int error; + size_t bytesused; + int error, revokecnt; if (ttyhook_hashook(tp, getc_inject)) /* buffer is inaccessible */ @@ -134,11 +135,27 @@ tty_drain(struct tty *tp) while (ttyoutq_bytesused(&tp->t_outq) > 0) { ttydevsw_outwakeup(tp); /* Could be handled synchronously. */ - if (ttyoutq_bytesused(&tp->t_outq) == 0) + bytesused = ttyoutq_bytesused(&tp->t_outq); + if (bytesused == 0) return (0); /* Wait for data to be drained. */ - error = tty_wait(tp, &tp->t_outwait); + if (leaving) { + revokecnt = tp->t_revokecnt; + error = tty_timedwait(tp, &tp->t_outwait, hz); + switch (error) { + case ERESTART: + if (revokecnt != tp->t_revokecnt) + error = 0; + break; + case EWOULDBLOCK: + if (ttyoutq_bytesused(&tp->t_outq) < bytesused) + error = 0; + break; + } + } else + error = tty_wait(tp, &tp->t_outwait); + if (error) return (error); } @@ -191,10 +208,8 @@ ttydev_leave(struct tty *tp) /* Drain any output. */ MPASS((tp->t_flags & TF_STOPPED) == 0); - if (!tty_gone(tp)) { - while (tty_drain(tp) == ERESTART) - ; - } + if (!tty_gone(tp)) + tty_drain(tp, 1); ttydisc_close(tp); @@ -1549,7 +1564,7 @@ tty_generic_ioctl(struct tty *tp, u_long /* Set terminal flags through tcsetattr(). */ if (cmd == TIOCSETAW || cmd == TIOCSETAF) { - error = tty_drain(tp); + error = tty_drain(tp, 0); if (error) return (error); if (cmd == TIOCSETAF) @@ -1728,7 +1743,7 @@ tty_generic_ioctl(struct tty *tp, u_long } case TIOCDRAIN: /* Drain TTY output. */ - return tty_drain(tp); + return tty_drain(tp, 0); case TIOCCONS: /* Set terminal as console TTY. */ if (*(int *)data) { From owner-svn-src-stable@FreeBSD.ORG Sun Dec 28 21:27:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC550AD1; Sun, 28 Dec 2014 21:27:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4E3D184B; Sun, 28 Dec 2014 21:27:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBSLRHVa087210; Sun, 28 Dec 2014 21:27:17 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBSLRE5n087198; Sun, 28 Dec 2014 21:27:14 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412282127.sBSLRE5n087198@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 28 Dec 2014 21:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276349 - in stable/10: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/amd64/vmm/io sys/modules/vmm sys/x86/include usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2014 21:27:18 -0000 Author: neel Date: Sun Dec 28 21:27:13 2014 New Revision: 276349 URL: https://svnweb.freebsd.org/changeset/base/276349 Log: MFC r270326 Fix a recursive lock acquisition in vi_reset_dev(). MFC r270434 Return the spurious interrupt vector (IRQ7 or IRQ15) if the atpic cannot find any unmasked pin with an interrupt asserted. MFC r270436 Fix a bug in the emulation of CPUID leaf 0x4. MFC r270437 Add "hw.vmm.topology.threads_per_core" and "hw.vmm.topology.cores_per_package" tunables to modify the default cpu topology advertised by bhyve. MFC r270855 Set the 'inst_length' to '0' early on before any error conditions are detected in the emulation of the task switch. If any exceptions are triggered then the guest %rip should point to instruction that caused the task switch as opposed to the one after it. MFC r270857 The "SUB" instruction used in getcc() actually does 'x -= y' so use the proper constraint for 'x'. The "+r" constraint indicates that 'x' is an input and output register operand. While here generate code for different variants of getcc() using a macro GETCC(sz) where 'sz' indicates the operand size. Update the status bits in %rflags when emulating AND and OR opcodes. MFC r271439 Initialize 'bc_rdonly' to the right value. MFC r271451 Optimize the common case of injecting an interrupt into a vcpu after a HLT by explicitly moving it out of the interrupt shadow. MFC r271888 Restructure the MSR handling so it is entirely handled by processor-specific code. MFC r271890 MSR_KGSBASE is no longer saved and restored from the guest MSR save area. This behavior was changed in r271888 so update the comment block to reflect this. MFC r271891 Add some more KTR events to help debugging. MFC r272197 mmap(2) requires either MAP_PRIVATE or MAP_SHARED for non-anonymous mappings. MFC r272395 Get rid of code that dealt with the hardware not being able to save/restore the PAT MSR on guest exit/entry. This workaround was done for a beta release of VMware Fusion 5 but is no longer needed in later versions. All Intel CPUs since Nehalem have supported saving and restoring MSR_PAT in the VM exit and entry controls. MFC r272670 Inject #UD into the guest when it executes either 'MONITOR' or 'MWAIT'. MFC r272710 Implement the FLUSH operation in the virtio-block emulation. MFC r272838 iasl(8) expects integer fields in data tables to be specified as hexadecimal values. Therefore the bit width of the "PM Timer Block" was actually being interpreted as 50-bits instead of the expected 32-bit. This eliminates an error message emitted by a Linux 3.17 guest during boot: "Invalid length for FADT/PmTimerBlock: 50, using default 32" MFC r272839 Support Intel-specific MSRs that are accessed when booting up a linux in bhyve: - MSR_PLATFORM_INFO - MSR_TURBO_RATIO_LIMITx - MSR_RAPL_POWER_UNIT MFC r273108 Emulate "POP r/m". This is needed to boot OpenBSD/i386 MP kernel in bhyve. MFC r273212 Support stopping and restarting the AHCI command list via toggling PxCMD.ST from '1' to '0' and back. This allows the driver a chance to recover if for instance a timeout occurred due to activity on the host. Deleted: stable/10/sys/amd64/vmm/vmm_msr.c stable/10/sys/amd64/vmm/vmm_msr.h Modified: stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/vmm/intel/ept.c stable/10/sys/amd64/vmm/intel/vmcs.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/intel/vmx.h stable/10/sys/amd64/vmm/intel/vmx_msr.c stable/10/sys/amd64/vmm/intel/vmx_msr.h stable/10/sys/amd64/vmm/io/vatpic.c stable/10/sys/amd64/vmm/io/vlapic.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_instruction_emul.c stable/10/sys/amd64/vmm/x86.c stable/10/sys/modules/vmm/Makefile stable/10/sys/x86/include/specialreg.h stable/10/usr.sbin/bhyve/acpi.c stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/block_if.c stable/10/usr.sbin/bhyve/pci_ahci.c stable/10/usr.sbin/bhyve/pci_virtio_block.c stable/10/usr.sbin/bhyve/task_switch.c stable/10/usr.sbin/bhyve/virtio.c stable/10/usr.sbin/bhyve/xmsr.c stable/10/usr.sbin/bhyve/xmsr.h stable/10/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/include/vmm.h Sun Dec 28 21:27:13 2014 (r276349) @@ -82,6 +82,7 @@ enum vm_reg_name { VM_REG_GUEST_PDPTE1, VM_REG_GUEST_PDPTE2, VM_REG_GUEST_PDPTE3, + VM_REG_GUEST_INTR_SHADOW, VM_REG_LAST }; @@ -194,7 +195,6 @@ void vm_nmi_clear(struct vm *vm, int vcp int vm_inject_extint(struct vm *vm, int vcpu); int vm_extint_pending(struct vm *vm, int vcpuid); void vm_extint_clear(struct vm *vm, int vcpuid); -uint64_t *vm_guest_msrs(struct vm *vm, int cpu); struct vlapic *vm_lapic(struct vm *vm, int cpu); struct vioapic *vm_ioapic(struct vm *vm); struct vhpet *vm_hpet(struct vm *vm); @@ -485,6 +485,8 @@ enum vm_exitcode { VM_EXITCODE_SUSPENDED, VM_EXITCODE_INOUT_STR, VM_EXITCODE_TASK_SWITCH, + VM_EXITCODE_MONITOR, + VM_EXITCODE_MWAIT, VM_EXITCODE_MAX }; Modified: stable/10/sys/amd64/vmm/intel/ept.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/ept.c Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/intel/ept.c Sun Dec 28 21:27:13 2014 (r276349) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include "vmx_cpufunc.h" #include "vmm_ipi.h" -#include "vmx_msr.h" #include "ept.h" #define EPT_SUPPORTS_EXEC_ONLY(cap) ((cap) & (1UL << 0)) Modified: stable/10/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.h Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/intel/vmcs.h Sun Dec 28 21:27:13 2014 (r276349) @@ -54,6 +54,10 @@ int vmcs_getdesc(struct vmcs *vmcs, int int vmcs_setdesc(struct vmcs *vmcs, int running, int ident, struct seg_desc *desc); +/* + * Avoid header pollution caused by inline use of 'vtophys()' in vmx_cpufunc.h + */ +#ifdef _VMX_CPUFUNC_H_ static __inline uint64_t vmcs_read(uint32_t encoding) { @@ -73,6 +77,7 @@ vmcs_write(uint32_t encoding, uint64_t v error = vmwrite(encoding, val); KASSERT(error == 0, ("vmcs_write(%u) error %d", encoding, error)); } +#endif /* _VMX_CPUFUNC_H_ */ #define vmexit_instruction_length() vmcs_read(VMCS_EXIT_INSTRUCTION_LENGTH) #define vmcs_guest_rip() vmcs_read(VMCS_GUEST_RIP) Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/intel/vmx.c Sun Dec 28 21:27:13 2014 (r276349) @@ -52,20 +52,20 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "vmm_lapic.h" #include "vmm_host.h" #include "vmm_ioport.h" #include "vmm_ipi.h" -#include "vmm_msr.h" #include "vmm_ktr.h" #include "vmm_stat.h" #include "vatpic.h" #include "vlapic.h" #include "vlapic_priv.h" -#include "vmx_msr.h" #include "ept.h" #include "vmx_cpufunc.h" #include "vmx.h" +#include "vmx_msr.h" #include "x86.h" #include "vmx_controls.h" @@ -81,6 +81,8 @@ __FBSDID("$FreeBSD$"); #define PROCBASED_CTLS_ONE_SETTING \ (PROCBASED_SECONDARY_CONTROLS | \ + PROCBASED_MWAIT_EXITING | \ + PROCBASED_MONITOR_EXITING | \ PROCBASED_IO_EXITING | \ PROCBASED_MSR_BITMAPS | \ PROCBASED_CTLS_WINDOW_SETTING | \ @@ -94,34 +96,23 @@ __FBSDID("$FreeBSD$"); #define PROCBASED_CTLS2_ONE_SETTING PROCBASED2_ENABLE_EPT #define PROCBASED_CTLS2_ZERO_SETTING 0 -#define VM_EXIT_CTLS_ONE_SETTING_NO_PAT \ +#define VM_EXIT_CTLS_ONE_SETTING \ (VM_EXIT_HOST_LMA | \ VM_EXIT_SAVE_EFER | \ - VM_EXIT_LOAD_EFER) - -#define VM_EXIT_CTLS_ONE_SETTING \ - (VM_EXIT_CTLS_ONE_SETTING_NO_PAT | \ + VM_EXIT_LOAD_EFER | \ VM_EXIT_ACKNOWLEDGE_INTERRUPT | \ VM_EXIT_SAVE_PAT | \ VM_EXIT_LOAD_PAT) + #define VM_EXIT_CTLS_ZERO_SETTING VM_EXIT_SAVE_DEBUG_CONTROLS -#define VM_ENTRY_CTLS_ONE_SETTING_NO_PAT VM_ENTRY_LOAD_EFER +#define VM_ENTRY_CTLS_ONE_SETTING (VM_ENTRY_LOAD_EFER | VM_ENTRY_LOAD_PAT) -#define VM_ENTRY_CTLS_ONE_SETTING \ - (VM_ENTRY_CTLS_ONE_SETTING_NO_PAT | \ - VM_ENTRY_LOAD_PAT) #define VM_ENTRY_CTLS_ZERO_SETTING \ (VM_ENTRY_LOAD_DEBUG_CONTROLS | \ VM_ENTRY_INTO_SMM | \ VM_ENTRY_DEACTIVATE_DUAL_MONITOR) -#define guest_msr_rw(vmx, msr) \ - msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_RW) - -#define guest_msr_ro(vmx, msr) \ - msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_READ) - #define HANDLED 1 #define UNHANDLED 0 @@ -158,10 +149,6 @@ SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, initia */ static SYSCTL_NODE(_hw_vmm_vmx, OID_AUTO, cap, CTLFLAG_RW, NULL, NULL); -static int vmx_patmsr; -SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, patmsr, CTLFLAG_RD, &vmx_patmsr, 0, - "PAT MSR saved and restored in VCMS"); - static int cap_halt_exit; SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, halt_exit, CTLFLAG_RD, &cap_halt_exit, 0, "HLT triggers a VM-exit"); @@ -208,6 +195,7 @@ SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_ static int vmx_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc); static int vmx_getreg(void *arg, int vcpu, int reg, uint64_t *retval); +static int vmxctx_setreg(struct vmxctx *vmxctx, int reg, uint64_t val); static void vmx_inject_pir(struct vlapic *vlapic); #ifdef KTR @@ -475,22 +463,6 @@ vpid_init(void) } static void -msr_save_area_init(struct msr_entry *g_area, int *g_count) -{ - int cnt; - - static struct msr_entry guest_msrs[] = { - { MSR_KGSBASE, 0, 0 }, - }; - - cnt = sizeof(guest_msrs) / sizeof(guest_msrs[0]); - if (cnt > GUEST_MSR_MAX_ENTRIES) - panic("guest msr save area overrun"); - bcopy(guest_msrs, g_area, sizeof(guest_msrs)); - *g_count = cnt; -} - -static void vmx_disable(void *arg __unused) { struct invvpid_desc invvpid_desc = { 0 }; @@ -636,49 +608,24 @@ vmx_init(int ipinum) } /* Check support for VM-exit controls */ - vmx_patmsr = 1; error = vmx_set_ctlreg(MSR_VMX_EXIT_CTLS, MSR_VMX_TRUE_EXIT_CTLS, VM_EXIT_CTLS_ONE_SETTING, VM_EXIT_CTLS_ZERO_SETTING, &exit_ctls); if (error) { - /* Try again without the PAT MSR bits */ - error = vmx_set_ctlreg(MSR_VMX_EXIT_CTLS, - MSR_VMX_TRUE_EXIT_CTLS, - VM_EXIT_CTLS_ONE_SETTING_NO_PAT, - VM_EXIT_CTLS_ZERO_SETTING, - &exit_ctls); - if (error) { - printf("vmx_init: processor does not support desired " - "exit controls\n"); - return (error); - } else { - if (bootverbose) - printf("vmm: PAT MSR access not supported\n"); - guest_msr_valid(MSR_PAT); - vmx_patmsr = 0; - } + printf("vmx_init: processor does not support desired " + "exit controls\n"); + return (error); } /* Check support for VM-entry controls */ - if (vmx_patmsr) { - error = vmx_set_ctlreg(MSR_VMX_ENTRY_CTLS, - MSR_VMX_TRUE_ENTRY_CTLS, - VM_ENTRY_CTLS_ONE_SETTING, - VM_ENTRY_CTLS_ZERO_SETTING, - &entry_ctls); - } else { - error = vmx_set_ctlreg(MSR_VMX_ENTRY_CTLS, - MSR_VMX_TRUE_ENTRY_CTLS, - VM_ENTRY_CTLS_ONE_SETTING_NO_PAT, - VM_ENTRY_CTLS_ZERO_SETTING, - &entry_ctls); - } - + error = vmx_set_ctlreg(MSR_VMX_ENTRY_CTLS, MSR_VMX_TRUE_ENTRY_CTLS, + VM_ENTRY_CTLS_ONE_SETTING, VM_ENTRY_CTLS_ZERO_SETTING, + &entry_ctls); if (error) { printf("vmx_init: processor does not support desired " - "entry controls\n"); - return (error); + "entry controls\n"); + return (error); } /* @@ -800,6 +747,8 @@ vmx_init(int ipinum) vpid_init(); + vmx_msr_init(); + /* enable VMX operation */ smp_rendezvous(NULL, vmx_enable, NULL, NULL); @@ -869,7 +818,7 @@ static void * vmx_vminit(struct vm *vm, pmap_t pmap) { uint16_t vpid[VM_MAXCPU]; - int i, error, guest_msr_count; + int i, error; struct vmx *vmx; struct vmcs *vmcs; @@ -905,16 +854,14 @@ vmx_vminit(struct vm *vm, pmap_t pmap) * how they are saved/restored so can be directly accessed by the * guest. * - * Guest KGSBASE is saved and restored in the guest MSR save area. - * Host KGSBASE is restored before returning to userland from the pcb. - * There will be a window of time when we are executing in the host - * kernel context with a value of KGSBASE from the guest. This is ok - * because the value of KGSBASE is inconsequential in kernel context. - * * MSR_EFER is saved and restored in the guest VMCS area on a * VM exit and entry respectively. It is also restored from the * host VMCS area on a VM exit. * + * MSR_PAT is saved and restored in the guest VMCS are on a VM exit + * and entry respectively. It is also restored from the host VMCS + * area on a VM exit. + * * The TSC MSR is exposed read-only. Writes are disallowed as that * will impact the host TSC. * XXX Writes would be implemented with a wrmsr trap, and @@ -925,21 +872,11 @@ vmx_vminit(struct vm *vm, pmap_t pmap) guest_msr_rw(vmx, MSR_SYSENTER_CS_MSR) || guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) || guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) || - guest_msr_rw(vmx, MSR_KGSBASE) || guest_msr_rw(vmx, MSR_EFER) || + guest_msr_rw(vmx, MSR_PAT) || guest_msr_ro(vmx, MSR_TSC)) panic("vmx_vminit: error setting guest msr access"); - /* - * MSR_PAT is saved and restored in the guest VMCS are on a VM exit - * and entry respectively. It is also restored from the host VMCS - * area on a VM exit. However, if running on a system with no - * MSR_PAT save/restore support, leave access disabled so accesses - * will be trapped. - */ - if (vmx_patmsr && guest_msr_rw(vmx, MSR_PAT)) - panic("vmx_vminit: error setting guest pat msr access"); - vpid_alloc(vpid, VM_MAXCPU); if (virtual_interrupt_delivery) { @@ -958,6 +895,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) error, i); } + vmx_msr_guest_init(vmx, i); + error = vmcs_init(vmcs); KASSERT(error == 0, ("vmcs_init error %d", error)); @@ -996,13 +935,6 @@ vmx_vminit(struct vm *vm, pmap_t pmap) vmx->state[i].lastcpu = NOCPU; vmx->state[i].vpid = vpid[i]; - msr_save_area_init(vmx->guest_msrs[i], &guest_msr_count); - - error = vmcs_set_msr_save(vmcs, vtophys(vmx->guest_msrs[i]), - guest_msr_count); - if (error != 0) - panic("vmcs_set_msr_save error %d", error); - /* * Set up the CR0/4 shadows, and init the read shadow * to the power-on register value from the Intel Sys Arch. @@ -2078,6 +2010,46 @@ vmx_task_switch_reason(uint64_t qual) } static int +emulate_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t val, bool *retu) +{ + int error; + + if (lapic_msr(num)) + error = lapic_wrmsr(vmx->vm, vcpuid, num, val, retu); + else + error = vmx_wrmsr(vmx, vcpuid, num, val, retu); + + return (error); +} + +static int +emulate_rdmsr(struct vmx *vmx, int vcpuid, u_int num, bool *retu) +{ + struct vmxctx *vmxctx; + uint64_t result; + uint32_t eax, edx; + int error; + + if (lapic_msr(num)) + error = lapic_rdmsr(vmx->vm, vcpuid, num, &result, retu); + else + error = vmx_rdmsr(vmx, vcpuid, num, &result, retu); + + if (error == 0) { + eax = result; + vmxctx = &vmx->ctx[vcpuid]; + error = vmxctx_setreg(vmxctx, VM_REG_GUEST_RAX, eax); + KASSERT(error == 0, ("vmxctx_setreg(rax) error %d", error)); + + edx = result >> 32; + error = vmxctx_setreg(vmxctx, VM_REG_GUEST_RDX, edx); + KASSERT(error == 0, ("vmxctx_setreg(rdx) error %d", error)); + } + + return (error); +} + +static int vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) { int error, handled, in; @@ -2215,7 +2187,7 @@ vmx_exit_process(struct vmx *vmx, int vc retu = false; ecx = vmxctx->guest_rcx; VCPU_CTR1(vmx->vm, vcpu, "rdmsr 0x%08x", ecx); - error = emulate_rdmsr(vmx->vm, vcpu, ecx, &retu); + error = emulate_rdmsr(vmx, vcpu, ecx, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_RDMSR; vmexit->u.msr.code = ecx; @@ -2224,7 +2196,7 @@ vmx_exit_process(struct vmx *vmx, int vc } else { /* Return to userspace with a valid exitcode */ KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, - ("emulate_wrmsr retu with bogus exitcode")); + ("emulate_rdmsr retu with bogus exitcode")); } break; case EXIT_REASON_WRMSR: @@ -2235,7 +2207,7 @@ vmx_exit_process(struct vmx *vmx, int vc edx = vmxctx->guest_rdx; VCPU_CTR2(vmx->vm, vcpu, "wrmsr 0x%08x value 0x%016lx", ecx, (uint64_t)edx << 32 | eax); - error = emulate_wrmsr(vmx->vm, vcpu, ecx, + error = emulate_wrmsr(vmx, vcpu, ecx, (uint64_t)edx << 32 | eax, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_WRMSR; @@ -2403,6 +2375,12 @@ vmx_exit_process(struct vmx *vmx, int vc case EXIT_REASON_XSETBV: handled = vmx_emulate_xsetbv(vmx, vcpu, vmexit); break; + case EXIT_REASON_MONITOR: + vmexit->exitcode = VM_EXITCODE_MONITOR; + break; + case EXIT_REASON_MWAIT: + vmexit->exitcode = VM_EXITCODE_MWAIT; + break; default: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_UNKNOWN, 1); break; @@ -2523,6 +2501,8 @@ vmx_run(void *arg, int vcpu, register_t KASSERT(vmxctx->pmap == pmap, ("pmap %p different than ctx pmap %p", pmap, vmxctx->pmap)); + vmx_msr_guest_enter(vmx, vcpu); + VMPTRLD(vmcs); /* @@ -2624,6 +2604,8 @@ vmx_run(void *arg, int vcpu, register_t vmexit->exitcode); VMCLEAR(vmcs); + vmx_msr_guest_exit(vmx, vcpu); + return (0); } @@ -2712,6 +2694,46 @@ vmxctx_setreg(struct vmxctx *vmxctx, int } static int +vmx_get_intr_shadow(struct vmx *vmx, int vcpu, int running, uint64_t *retval) +{ + uint64_t gi; + int error; + + error = vmcs_getreg(&vmx->vmcs[vcpu], running, + VMCS_IDENT(VMCS_GUEST_INTERRUPTIBILITY), &gi); + *retval = (gi & HWINTR_BLOCKING) ? 1 : 0; + return (error); +} + +static int +vmx_modify_intr_shadow(struct vmx *vmx, int vcpu, int running, uint64_t val) +{ + struct vmcs *vmcs; + uint64_t gi; + int error, ident; + + /* + * Forcing the vcpu into an interrupt shadow is not supported. + */ + if (val) { + error = EINVAL; + goto done; + } + + vmcs = &vmx->vmcs[vcpu]; + ident = VMCS_IDENT(VMCS_GUEST_INTERRUPTIBILITY); + error = vmcs_getreg(vmcs, running, ident, &gi); + if (error == 0) { + gi &= ~HWINTR_BLOCKING; + error = vmcs_setreg(vmcs, running, ident, gi); + } +done: + VCPU_CTR2(vmx->vm, vcpu, "Setting intr_shadow to %#lx %s", val, + error ? "failed" : "succeeded"); + return (error); +} + +static int vmx_shadow_reg(int reg) { int shreg; @@ -2742,6 +2764,9 @@ vmx_getreg(void *arg, int vcpu, int reg, if (running && hostcpu != curcpu) panic("vmx_getreg: %s%d is running", vm_name(vmx->vm), vcpu); + if (reg == VM_REG_GUEST_INTR_SHADOW) + return (vmx_get_intr_shadow(vmx, vcpu, running, retval)); + if (vmxctx_getreg(&vmx->ctx[vcpu], reg, retval) == 0) return (0); @@ -2760,6 +2785,9 @@ vmx_setreg(void *arg, int vcpu, int reg, if (running && hostcpu != curcpu) panic("vmx_setreg: %s%d is running", vm_name(vmx->vm), vcpu); + if (reg == VM_REG_GUEST_INTR_SHADOW) + return (vmx_modify_intr_shadow(vmx, vcpu, running, val)); + if (vmxctx_setreg(&vmx->ctx[vcpu], reg, val) == 0) return (0); Modified: stable/10/sys/amd64/vmm/intel/vmx.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.h Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/intel/vmx.h Sun Dec 28 21:27:13 2014 (r276349) @@ -33,8 +33,6 @@ struct pmap; -#define GUEST_MSR_MAX_ENTRIES 64 /* arbitrary */ - struct vmxctx { register_t guest_rdi; /* Guest state */ register_t guest_rsi; @@ -97,13 +95,23 @@ struct pir_desc { } __aligned(64); CTASSERT(sizeof(struct pir_desc) == 64); +/* Index into the 'guest_msrs[]' array */ +enum { + IDX_MSR_LSTAR, + IDX_MSR_CSTAR, + IDX_MSR_STAR, + IDX_MSR_SF_MASK, + IDX_MSR_KGSBASE, + GUEST_MSR_NUM /* must be the last enumeration */ +}; + /* virtual machine softc */ struct vmx { struct vmcs vmcs[VM_MAXCPU]; /* one vmcs per virtual cpu */ struct apic_page apic_page[VM_MAXCPU]; /* one apic page per vcpu */ char msr_bitmap[PAGE_SIZE]; struct pir_desc pir_desc[VM_MAXCPU]; - struct msr_entry guest_msrs[VM_MAXCPU][GUEST_MSR_MAX_ENTRIES]; + uint64_t guest_msrs[VM_MAXCPU][GUEST_MSR_NUM]; struct vmxctx ctx[VM_MAXCPU]; struct vmxcap cap[VM_MAXCPU]; struct vmxstate state[VM_MAXCPU]; @@ -113,7 +121,6 @@ struct vmx { }; CTASSERT((offsetof(struct vmx, vmcs) & PAGE_MASK) == 0); CTASSERT((offsetof(struct vmx, msr_bitmap) & PAGE_MASK) == 0); -CTASSERT((offsetof(struct vmx, guest_msrs) & 15) == 0); CTASSERT((offsetof(struct vmx, pir_desc[0]) & 63) == 0); #define VMX_GUEST_VMEXIT 0 Modified: stable/10/sys/amd64/vmm/intel/vmx_msr.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_msr.c Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/intel/vmx_msr.c Sun Dec 28 21:27:13 2014 (r276349) @@ -31,10 +31,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include +#include #include +#include +#include "vmx.h" #include "vmx_msr.h" static boolean_t @@ -171,3 +176,213 @@ msr_bitmap_change_access(char *bitmap, u return (0); } + +static uint64_t misc_enable; +static uint64_t platform_info; +static uint64_t turbo_ratio_limit; +static uint64_t host_msrs[GUEST_MSR_NUM]; + +static bool +nehalem_cpu(void) +{ + u_int family, model; + + /* + * The family:model numbers belonging to the Nehalem microarchitecture + * are documented in Section 35.5, Intel SDM dated Feb 2014. + */ + family = CPUID_TO_FAMILY(cpu_id); + model = CPUID_TO_MODEL(cpu_id); + if (family == 0x6) { + switch (model) { + case 0x1A: + case 0x1E: + case 0x1F: + case 0x2E: + return (true); + default: + break; + } + } + return (false); +} + +static bool +westmere_cpu(void) +{ + u_int family, model; + + /* + * The family:model numbers belonging to the Westmere microarchitecture + * are documented in Section 35.6, Intel SDM dated Feb 2014. + */ + family = CPUID_TO_FAMILY(cpu_id); + model = CPUID_TO_MODEL(cpu_id); + if (family == 0x6) { + switch (model) { + case 0x25: + case 0x2C: + return (true); + default: + break; + } + } + return (false); +} + +void +vmx_msr_init(void) +{ + uint64_t bus_freq, ratio; + int i; + + /* + * It is safe to cache the values of the following MSRs because + * they don't change based on curcpu, curproc or curthread. + */ + host_msrs[IDX_MSR_LSTAR] = rdmsr(MSR_LSTAR); + host_msrs[IDX_MSR_CSTAR] = rdmsr(MSR_CSTAR); + host_msrs[IDX_MSR_STAR] = rdmsr(MSR_STAR); + host_msrs[IDX_MSR_SF_MASK] = rdmsr(MSR_SF_MASK); + + /* + * Initialize emulated MSRs + */ + misc_enable = rdmsr(MSR_IA32_MISC_ENABLE); + /* + * Set mandatory bits + * 11: branch trace disabled + * 12: PEBS unavailable + * Clear unsupported features + * 16: SpeedStep enable + * 18: enable MONITOR FSM + */ + misc_enable |= (1 << 12) | (1 << 11); + misc_enable &= ~((1 << 18) | (1 << 16)); + + if (nehalem_cpu() || westmere_cpu()) + bus_freq = 133330000; /* 133Mhz */ + else + bus_freq = 100000000; /* 100Mhz */ + + /* + * XXXtime + * The ratio should really be based on the virtual TSC frequency as + * opposed to the host TSC. + */ + ratio = (tsc_freq / bus_freq) & 0xff; + + /* + * The register definition is based on the micro-architecture + * but the following bits are always the same: + * [15:8] Maximum Non-Turbo Ratio + * [28] Programmable Ratio Limit for Turbo Mode + * [29] Programmable TDC-TDP Limit for Turbo Mode + * [47:40] Maximum Efficiency Ratio + * + * The other bits can be safely set to 0 on all + * micro-architectures up to Haswell. + */ + platform_info = (ratio << 8) | (ratio << 40); + + /* + * The number of valid bits in the MSR_TURBO_RATIO_LIMITx register is + * dependent on the maximum cores per package supported by the micro- + * architecture. For e.g., Westmere supports 6 cores per package and + * uses the low 48 bits. Sandybridge support 8 cores per package and + * uses up all 64 bits. + * + * However, the unused bits are reserved so we pretend that all bits + * in this MSR are valid. + */ + for (i = 0; i < 8; i++) + turbo_ratio_limit = (turbo_ratio_limit << 8) | ratio; +} + +void +vmx_msr_guest_init(struct vmx *vmx, int vcpuid) +{ + /* + * The permissions bitmap is shared between all vcpus so initialize it + * once when initializing the vBSP. + */ + if (vcpuid == 0) { + guest_msr_rw(vmx, MSR_LSTAR); + guest_msr_rw(vmx, MSR_CSTAR); + guest_msr_rw(vmx, MSR_STAR); + guest_msr_rw(vmx, MSR_SF_MASK); + guest_msr_rw(vmx, MSR_KGSBASE); + } + return; +} + +void +vmx_msr_guest_enter(struct vmx *vmx, int vcpuid) +{ + uint64_t *guest_msrs = vmx->guest_msrs[vcpuid]; + + /* Save host MSRs (if any) and restore guest MSRs */ + wrmsr(MSR_LSTAR, guest_msrs[IDX_MSR_LSTAR]); + wrmsr(MSR_CSTAR, guest_msrs[IDX_MSR_CSTAR]); + wrmsr(MSR_STAR, guest_msrs[IDX_MSR_STAR]); + wrmsr(MSR_SF_MASK, guest_msrs[IDX_MSR_SF_MASK]); + wrmsr(MSR_KGSBASE, guest_msrs[IDX_MSR_KGSBASE]); +} + +void +vmx_msr_guest_exit(struct vmx *vmx, int vcpuid) +{ + uint64_t *guest_msrs = vmx->guest_msrs[vcpuid]; + + /* Save guest MSRs */ + guest_msrs[IDX_MSR_LSTAR] = rdmsr(MSR_LSTAR); + guest_msrs[IDX_MSR_CSTAR] = rdmsr(MSR_CSTAR); + guest_msrs[IDX_MSR_STAR] = rdmsr(MSR_STAR); + guest_msrs[IDX_MSR_SF_MASK] = rdmsr(MSR_SF_MASK); + guest_msrs[IDX_MSR_KGSBASE] = rdmsr(MSR_KGSBASE); + + /* Restore host MSRs */ + wrmsr(MSR_LSTAR, host_msrs[IDX_MSR_LSTAR]); + wrmsr(MSR_CSTAR, host_msrs[IDX_MSR_CSTAR]); + wrmsr(MSR_STAR, host_msrs[IDX_MSR_STAR]); + wrmsr(MSR_SF_MASK, host_msrs[IDX_MSR_SF_MASK]); + + /* MSR_KGSBASE will be restored on the way back to userspace */ +} + +int +vmx_rdmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t *val, bool *retu) +{ + int error = 0; + + switch (num) { + case MSR_IA32_MISC_ENABLE: + *val = misc_enable; + break; + case MSR_PLATFORM_INFO: + *val = platform_info; + break; + case MSR_TURBO_RATIO_LIMIT: + case MSR_TURBO_RATIO_LIMIT1: + *val = turbo_ratio_limit; + break; + default: + error = EINVAL; + break; + } + return (error); +} + +int +vmx_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t val, bool *retu) +{ + int error = 0; + + switch (num) { + default: + error = EINVAL; + break; + } + + return (error); +} Modified: stable/10/sys/amd64/vmm/intel/vmx_msr.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_msr.h Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/intel/vmx_msr.h Sun Dec 28 21:27:13 2014 (r276349) @@ -29,6 +29,15 @@ #ifndef _VMX_MSR_H_ #define _VMX_MSR_H_ +struct vmx; + +void vmx_msr_init(void); +void vmx_msr_guest_init(struct vmx *vmx, int vcpuid); +void vmx_msr_guest_enter(struct vmx *vmx, int vcpuid); +void vmx_msr_guest_exit(struct vmx *vmx, int vcpuid); +int vmx_rdmsr(struct vmx *, int vcpuid, u_int num, uint64_t *val, bool *retu); +int vmx_wrmsr(struct vmx *, int vcpuid, u_int num, uint64_t val, bool *retu); + uint32_t vmx_revision(void); int vmx_set_ctlreg(int ctl_reg, int true_ctl_reg, uint32_t ones_mask, @@ -52,4 +61,10 @@ int vmx_set_ctlreg(int ctl_reg, int true void msr_bitmap_initialize(char *bitmap); int msr_bitmap_change_access(char *bitmap, u_int msr, int access); +#define guest_msr_rw(vmx, msr) \ + msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_RW) + +#define guest_msr_ro(vmx, msr) \ + msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_READ) + #endif Modified: stable/10/sys/amd64/vmm/io/vatpic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vatpic.c Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/io/vatpic.c Sun Dec 28 21:27:13 2014 (r276349) @@ -500,13 +500,19 @@ vatpic_pending_intr(struct vm *vm, int * VATPIC_LOCK(vatpic); pin = vatpic_get_highest_irrpin(atpic); - if (pin == -1) - pin = 7; if (pin == 2) { atpic = &vatpic->atpic[1]; pin = vatpic_get_highest_irrpin(atpic); } + /* + * If there are no pins active at this moment then return the spurious + * interrupt vector instead. + */ + if (pin == -1) + pin = 7; + + KASSERT(pin >= 0 && pin <= 7, ("%s: invalid pin %d", __func__, pin)); *vecptr = atpic->irq_base + pin; VATPIC_UNLOCK(vatpic); Modified: stable/10/sys/amd64/vmm/io/vlapic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vlapic.c Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/io/vlapic.c Sun Dec 28 21:27:13 2014 (r276349) @@ -633,6 +633,7 @@ vlapic_fire_timer(struct vlapic *vlapic) // The timer LVT always uses the fixed delivery mode. lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { + VLAPIC_CTR0(vlapic, "vlapic timer fired"); vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_TIMER, 1); } } Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/vmm.c Sun Dec 28 21:27:13 2014 (r276349) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include "vhpet.h" #include "vioapic.h" #include "vlapic.h" -#include "vmm_msr.h" #include "vmm_ipi.h" #include "vmm_stat.h" #include "vmm_lapic.h" @@ -105,7 +104,6 @@ struct vcpu { struct savefpu *guestfpu; /* (a,i) guest fpu state */ uint64_t guest_xcr0; /* (i) guest %xcr0 register */ void *stats; /* (a,i) statistics */ - uint64_t guest_msrs[VMM_MSR_NUM]; /* (i) emulated MSRs */ struct vm_exit exitinfo; /* (x) exit reason and collateral */ }; @@ -188,7 +186,6 @@ static struct vmm_ops *ops; #define fpu_stop_emulating() clts() static MALLOC_DEFINE(M_VM, "vm", "vm"); -CTASSERT(VMM_MSR_NUM <= 64); /* msr_mask can keep track of up to 64 msrs */ /* statistics */ static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcpu total runtime"); @@ -250,7 +247,6 @@ vcpu_init(struct vm *vm, int vcpu_id, bo vcpu->guest_xcr0 = XFEATURE_ENABLED_X87; fpu_save_area_reset(vcpu->guestfpu); vmm_stat_init(vcpu->stats); - guest_msrs_init(vm, vcpu_id); } struct vm_exit * @@ -294,7 +290,6 @@ vmm_init(void) else return (ENXIO); - vmm_msr_init(); vmm_resume_p = vmm_resume; return (VMM_INIT(vmm_ipinum)); @@ -1091,7 +1086,7 @@ vm_handle_hlt(struct vm *vm, int vcpuid, { struct vcpu *vcpu; const char *wmesg; - int t, vcpu_halted, vm_halted; + int error, t, vcpu_halted, vm_halted; KASSERT(!CPU_ISSET(vcpuid, &vm->halted_cpus), ("vcpu already halted")); @@ -1099,6 +1094,22 @@ vm_handle_hlt(struct vm *vm, int vcpuid, vcpu_halted = 0; vm_halted = 0; + /* + * The typical way to halt a cpu is to execute: "sti; hlt" + * + * STI sets RFLAGS.IF to enable interrupts. However, the processor + * remains in an "interrupt shadow" for an additional instruction + * following the STI. This guarantees that "sti; hlt" sequence is + * atomic and a pending interrupt will be recognized after the HLT. + * + * After the HLT emulation is done the vcpu is no longer in an + * interrupt shadow and a pending interrupt can be injected on + * the next entry into the guest. + */ + error = vm_set_register(vm, vcpuid, VM_REG_GUEST_INTR_SHADOW, 0); + KASSERT(error == 0, ("%s: error %d clearing interrupt shadow", + __func__, error)); + vcpu_lock(vcpu); while (1) { /* @@ -1187,8 +1198,12 @@ vm_handle_paging(struct vm *vm, int vcpu if (ftype == VM_PROT_READ || ftype == VM_PROT_WRITE) { rv = pmap_emulate_accessed_dirty(vmspace_pmap(vm->vmspace), vme->u.paging.gpa, ftype); - if (rv == 0) + if (rv == 0) { + VCPU_CTR2(vm, vcpuid, "%s bit emulation for gpa %#lx", + ftype == VM_PROT_READ ? "accessed" : "dirty", + vme->u.paging.gpa); goto done; + } } map = &vm->vmspace->vm_map; @@ -1229,6 +1244,8 @@ vm_handle_inst_emul(struct vm *vm, int v paging = &vme->u.inst_emul.paging; cpu_mode = paging->cpu_mode; + VCPU_CTR1(vm, vcpuid, "inst_emul fault accessing gpa %#lx", gpa); + vie_init(vie); /* Fetch, decode and emulate the faulting instruction */ @@ -1425,7 +1442,6 @@ restart: pcb = PCPU_GET(curpcb); set_pcb_flags(pcb, PCB_FULL_IRET); - restore_guest_msrs(vm, vcpuid); restore_guest_fpustate(vcpu); vcpu_require_state(vm, vcpuid, VCPU_RUNNING); @@ -1433,7 +1449,6 @@ restart: vcpu_require_state(vm, vcpuid, VCPU_FROZEN); save_guest_fpustate(vcpu); - restore_host_msrs(vm, vcpuid); vmm_stat_incr(vm, vcpuid, VCPU_TOTAL_RUNTIME, rdtsc() - tscval); @@ -1467,6 +1482,10 @@ restart: case VM_EXITCODE_INOUT_STR: error = vm_handle_inout(vm, vcpuid, vme, &retu); break; + case VM_EXITCODE_MONITOR: + case VM_EXITCODE_MWAIT: + vm_inject_ud(vm, vcpuid); + break; default: retu = true; /* handled in userland */ break; @@ -1875,12 +1894,6 @@ vm_set_capability(struct vm *vm, int vcp return (VMSETCAP(vm->cookie, vcpu, type, val)); } -uint64_t * -vm_guest_msrs(struct vm *vm, int cpu) -{ - return (vm->vcpu[cpu].guest_msrs); -} - struct vlapic * vm_lapic(struct vm *vm, int cpu) { Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_instruction_emul.c Sun Dec 28 21:13:55 2014 (r276348) +++ stable/10/sys/amd64/vmm/vmm_instruction_emul.c Sun Dec 28 21:27:13 2014 (r276349) @@ -69,6 +69,7 @@ enum { VIE_OP_TYPE_TWO_BYTE, VIE_OP_TYPE_PUSH, VIE_OP_TYPE_CMP, + VIE_OP_TYPE_POP, VIE_OP_TYPE_LAST }; @@ -159,6 +160,11 @@ static const struct vie_op one_byte_opco .op_type = VIE_OP_TYPE_OR, .op_flags = VIE_OP_F_IMM8, }, + [0x8F] = { + /* XXX Group 1A extended opcode - not just POP */ + .op_byte = 0x8F, + .op_type = VIE_OP_TYPE_POP, + }, [0xFF] = { /* XXX Group 5 extended opcode - not just PUSH */ .op_byte = 0xFF, @@ -316,46 +322,36 @@ vie_update_register(void *vm, int vcpuid return (error); } +#define RFLAGS_STATUS_BITS (PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N | PSL_V) + /* * Return the status flags that would result from doing (x - y). */ -static u_long -getcc16(uint16_t x, uint16_t y) -{ - u_long rflags; - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Dec 29 00:30:39 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44F845DA; Mon, 29 Dec 2014 00:30:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 164176449F; Mon, 29 Dec 2014 00:30:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBT0UcHo073316; Mon, 29 Dec 2014 00:30:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBT0Uc07073315; Mon, 29 Dec 2014 00:30:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412290030.sBT0Uc07073315@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Dec 2014 00:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276353 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 00:30:39 -0000 Author: kib Date: Mon Dec 29 00:30:38 2014 New Revision: 276353 URL: https://svnweb.freebsd.org/changeset/base/276353 Log: MFC r275260: Remove lock recursion for the pipe pair mutex, and disable the recursion on mutex initialization. Modified: stable/10/sys/kern/sys_pipe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sys_pipe.c ============================================================================== --- stable/10/sys/kern/sys_pipe.c Mon Dec 29 00:10:43 2014 (r276352) +++ stable/10/sys/kern/sys_pipe.c Mon Dec 29 00:30:38 2014 (r276353) @@ -315,7 +315,7 @@ pipe_zone_init(void *mem, int size, int pp = (struct pipepair *)mem; - mtx_init(&pp->pp_mtx, "pipe mutex", NULL, MTX_DEF | MTX_RECURSE); + mtx_init(&pp->pp_mtx, "pipe mutex", NULL, MTX_DEF); return (0); } @@ -1770,7 +1770,7 @@ filt_piperead(struct knote *kn, long hin struct pipe *wpipe = rpipe->pipe_peer; int ret; - PIPE_LOCK(rpipe); + PIPE_LOCK_ASSERT(rpipe, MA_OWNED); kn->kn_data = rpipe->pipe_buffer.cnt; if ((kn->kn_data == 0) && (rpipe->pipe_state & PIPE_DIRECTW)) kn->kn_data = rpipe->pipe_map.cnt; @@ -1779,11 +1779,9 @@ filt_piperead(struct knote *kn, long hin wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { kn->kn_flags |= EV_EOF; - PIPE_UNLOCK(rpipe); return (1); } ret = kn->kn_data > 0; - PIPE_UNLOCK(rpipe); return ret; } @@ -1794,12 +1792,11 @@ filt_pipewrite(struct knote *kn, long hi struct pipe *wpipe; wpipe = kn->kn_hook; - PIPE_LOCK(wpipe); + PIPE_LOCK_ASSERT(wpipe, MA_OWNED); if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { kn->kn_data = 0; kn->kn_flags |= EV_EOF; - PIPE_UNLOCK(wpipe); return (1); } kn->kn_data = (wpipe->pipe_buffer.size > 0) ? @@ -1807,7 +1804,6 @@ filt_pipewrite(struct knote *kn, long hi if (wpipe->pipe_state & PIPE_DIRECTW) kn->kn_data = 0; - PIPE_UNLOCK(wpipe); return (kn->kn_data >= PIPE_BUF); } From owner-svn-src-stable@FreeBSD.ORG Mon Dec 29 15:11:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1347BBA1; Mon, 29 Dec 2014 15:11:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D88D710E6; Mon, 29 Dec 2014 15:11:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBTFB8W1087159; Mon, 29 Dec 2014 15:11:08 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBTFB83f087156; Mon, 29 Dec 2014 15:11:08 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201412291511.sBTFB83f087156@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 29 Dec 2014 15:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276363 - in stable/10/bin/sh: . tests/expansion X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 15:11:09 -0000 Author: jilles Date: Mon Dec 29 15:11:07 2014 New Revision: 276363 URL: https://svnweb.freebsd.org/changeset/base/276363 Log: MFC r273920: sh: Fix corruption of CTL* bytes in positional parameters in redirection. EXP_REDIR was not being checked for while expanding positional parameters in redirection, so CTL* bytes were not being prefixed where they should be. Added: stable/10/bin/sh/tests/expansion/redir1.0 - copied unchanged from r273920, head/bin/sh/tests/expansion/redir1.0 Modified: stable/10/bin/sh/expand.c stable/10/bin/sh/tests/expansion/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Mon Dec 29 14:52:32 2014 (r276362) +++ stable/10/bin/sh/expand.c Mon Dec 29 15:11:07 2014 (r276363) @@ -867,7 +867,7 @@ varisset(const char *name, int nulok) static void strtodest(const char *p, int flag, int subtype, int quoted) { - if (flag & (EXP_FULL | EXP_CASE) && subtype != VSLENGTH) + if (flag & (EXP_FULL | EXP_CASE | EXP_REDIR) && subtype != VSLENGTH) STPUTS_QUOTES(p, quoted ? DQSYNTAX : BASESYNTAX, expdest); else STPUTS(p, expdest); Modified: stable/10/bin/sh/tests/expansion/Makefile ============================================================================== --- stable/10/bin/sh/tests/expansion/Makefile Mon Dec 29 14:52:32 2014 (r276362) +++ stable/10/bin/sh/tests/expansion/Makefile Mon Dec 29 15:11:07 2014 (r276363) @@ -69,6 +69,7 @@ FILES+= plus-minus7.0 FILES+= plus-minus8.0 FILES+= question1.0 FILES+= readonly1.0 +FILES+= redir1.0 FILES+= set-u1.0 FILES+= set-u2.0 FILES+= set-u3.0 Copied: stable/10/bin/sh/tests/expansion/redir1.0 (from r273920, head/bin/sh/tests/expansion/redir1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/bin/sh/tests/expansion/redir1.0 Mon Dec 29 15:11:07 2014 (r276363, copy of r273920, head/bin/sh/tests/expansion/redir1.0) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +bad=0 +for i in 0 1 2 3; do + for j in 0 1 2 3 4 5 6 7; do + for k in 0 1 2 3 4 5 6 7; do + case $i$j$k in + 000) continue ;; + esac + set -- "$(printf \\$i$j$k@)" + set -- "${1%@}" + ff= + for f in /dev/null /dev/zero /; do + if [ -e "$f" ] && [ ! -e "$f$1" ]; then + ff=$f + fi + done + [ -n "$ff" ] || continue + if { true <$ff$1; } 2>/dev/null; then + echo "Bad: $i$j$k ($ff)" >&2 + : $((bad += 1)) + fi + done + done +done +exit $((bad ? 2 : 0)) From owner-svn-src-stable@FreeBSD.ORG Mon Dec 29 15:15:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 954A4D2F; Mon, 29 Dec 2014 15:15:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80F1B11DA; Mon, 29 Dec 2014 15:15:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBTFFSYr088694; Mon, 29 Dec 2014 15:15:28 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBTFFSoS088693; Mon, 29 Dec 2014 15:15:28 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201412291515.sBTFFSoS088693@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 29 Dec 2014 15:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276364 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 15:15:28 -0000 Author: jilles Date: Mon Dec 29 15:15:27 2014 New Revision: 276364 URL: https://svnweb.freebsd.org/changeset/base/276364 Log: MFC r274854: sh: Use DQSYNTAX only while expanding, not SQSYNTAX. Quoting during expansion only cares about CCTL, which is the same for DQSYNTAX and SQSYNTAX. Modified: stable/10/bin/sh/expand.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Mon Dec 29 15:11:07 2014 (r276363) +++ stable/10/bin/sh/expand.c Mon Dec 29 15:15:27 2014 (r276364) @@ -339,7 +339,7 @@ done: goto lose; *p = c; if (quotes) - STPUTS_QUOTES(home, SQSYNTAX, expdest); + STPUTS_QUOTES(home, DQSYNTAX, expdest); else STPUTS(home, expdest); return (p); From owner-svn-src-stable@FreeBSD.ORG Mon Dec 29 15:33:22 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19D99259; Mon, 29 Dec 2014 15:33:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF089152B; Mon, 29 Dec 2014 15:33:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBTFXL8d097717; Mon, 29 Dec 2014 15:33:21 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBTFXLYq097714; Mon, 29 Dec 2014 15:33:21 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201412291533.sBTFXLYq097714@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 29 Dec 2014 15:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276365 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 15:33:22 -0000 Author: jilles Date: Mon Dec 29 15:33:20 2014 New Revision: 276365 URL: https://svnweb.freebsd.org/changeset/base/276365 Log: MFC r276037: sh: Remove EXP_REDIR. EXP_REDIR was supposed to generate pathnames in redirection if exactly one file matches, as permitted but not required by POSIX in interactive mode. It is unlikely this will be implemented. No functional change is intended. Modified: stable/10/bin/sh/eval.c stable/10/bin/sh/expand.c stable/10/bin/sh/expand.h Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/eval.c ============================================================================== --- stable/10/bin/sh/eval.c Mon Dec 29 15:15:27 2014 (r276364) +++ stable/10/bin/sh/eval.c Mon Dec 29 15:33:20 2014 (r276365) @@ -538,13 +538,13 @@ expredir(union node *n) case NFROMTO: case NAPPEND: case NCLOBBER: - expandarg(redir->nfile.fname, &fn, EXP_TILDE | EXP_REDIR); + expandarg(redir->nfile.fname, &fn, EXP_TILDE); redir->nfile.expfname = fn.list->text; break; case NFROMFD: case NTOFD: if (redir->ndup.vname) { - expandarg(redir->ndup.vname, &fn, EXP_TILDE | EXP_REDIR); + expandarg(redir->ndup.vname, &fn, EXP_TILDE); fixredir(redir, fn.list->text, 1); } break; Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Mon Dec 29 15:15:27 2014 (r276364) +++ stable/10/bin/sh/expand.c Mon Dec 29 15:33:20 2014 (r276365) @@ -171,17 +171,12 @@ expandarg(union node *arg, struct arglis STPUTC('\0', expdest); p = grabstackstr(expdest); exparg.lastp = &exparg.list; - /* - * TODO - EXP_REDIR - */ if (flag & EXP_FULL) { ifsbreakup(p, &exparg); *exparg.lastp = NULL; exparg.lastp = &exparg.list; expandmeta(exparg.list, flag); } else { - if (flag & EXP_REDIR) /*XXX - for now, just remove escapes */ - rmescapes(p); sp = (struct strlist *)stalloc(sizeof (struct strlist)); sp->text = p; *exparg.lastp = sp; @@ -209,7 +204,7 @@ expandarg(union node *arg, struct arglis * expansion, and tilde expansion if requested via EXP_TILDE/EXP_VARTILDE. * Processing ends at a CTLENDVAR or CTLENDARI character as well as '\0'. * This is used to expand word in ${var+word} etc. - * If EXP_FULL, EXP_CASE or EXP_REDIR are set, keep and/or generate CTLESC + * If EXP_FULL or EXP_CASE are set, keep and/or generate CTLESC * characters to allow for further processing. * If EXP_FULL is set, also preserve CTLQUOTEMARK characters. */ @@ -217,7 +212,7 @@ static char * argstr(char *p, int flag) { char c; - int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); /* do CTLESC */ + int quotes = flag & (EXP_FULL | EXP_CASE); /* do CTLESC */ int firsteq = 1; int split_lit; int lit_quoted; @@ -303,7 +298,7 @@ exptilde(char *p, int flag) char c, *startp = p; struct passwd *pw; char *home; - int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); + int quotes = flag & (EXP_FULL | EXP_CASE); while ((c = *p) != '\0') { switch(c) { @@ -442,7 +437,7 @@ expbackq(union node *cmd, int quoted, in char lastc; int startloc = dest - stackblock(); char const *syntax = quoted? DQSYNTAX : BASESYNTAX; - int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); + int quotes = flag & (EXP_FULL | EXP_CASE); size_t nnl; INTOFF; @@ -642,7 +637,7 @@ evalvar(char *p, int flag) int varlen; int varlenb; int easy; - int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); + int quotes = flag & (EXP_FULL | EXP_CASE); varflags = (unsigned char)*p++; subtype = varflags & VSTYPE; @@ -867,7 +862,7 @@ varisset(const char *name, int nulok) static void strtodest(const char *p, int flag, int subtype, int quoted) { - if (flag & (EXP_FULL | EXP_CASE | EXP_REDIR) && subtype != VSLENGTH) + if (flag & (EXP_FULL | EXP_CASE) && subtype != VSLENGTH) STPUTS_QUOTES(p, quoted ? DQSYNTAX : BASESYNTAX, expdest); else STPUTS(p, expdest); @@ -1108,7 +1103,6 @@ expandmeta(struct strlist *str, int flag struct strlist **savelastp; struct strlist *sp; char c; - /* TODO - EXP_REDIR */ while (str) { if (fflag) Modified: stable/10/bin/sh/expand.h ============================================================================== --- stable/10/bin/sh/expand.h Mon Dec 29 15:15:27 2014 (r276364) +++ stable/10/bin/sh/expand.h Mon Dec 29 15:33:20 2014 (r276365) @@ -50,7 +50,6 @@ struct arglist { #define EXP_FULL 0x1 /* perform word splitting & file globbing */ #define EXP_TILDE 0x2 /* do normal tilde expansion */ #define EXP_VARTILDE 0x4 /* expand tildes in an assignment */ -#define EXP_REDIR 0x8 /* file glob for a redirection (1 match only) */ #define EXP_CASE 0x10 /* keeps quotes around for CASE pattern */ #define EXP_SPLIT_LIT 0x20 /* IFS split literal text ${v+-a b c} */ #define EXP_LIT_QUOTED 0x40 /* for EXP_SPLIT_LIT, start off quoted */ From owner-svn-src-stable@FreeBSD.ORG Mon Dec 29 22:54:29 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 917A288C; Mon, 29 Dec 2014 22:54:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC1322CC; Mon, 29 Dec 2014 22:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBTMsTv1006166; Mon, 29 Dec 2014 22:54:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBTMsTbX006165; Mon, 29 Dec 2014 22:54:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412292254.sBTMsTbX006165@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 29 Dec 2014 22:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276384 - stable/10/contrib/binutils/gas X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 22:54:29 -0000 Author: pfg Date: Mon Dec 29 22:54:28 2014 New Revision: 276384 URL: https://svnweb.freebsd.org/changeset/base/276384 Log: MFC r276228: gas: use memmove instead of bogus memcpy. partial_where points into the buffer that begins with buffer_start so we need to use memmove() to handle the overlap. Fixes Sourceware-PR 11456. Obtained from: OpenBSD (CVS rev. 1.2) Modified: stable/10/contrib/binutils/gas/input-scrub.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/input-scrub.c ============================================================================== --- stable/10/contrib/binutils/gas/input-scrub.c Mon Dec 29 22:32:39 2014 (r276383) +++ stable/10/contrib/binutils/gas/input-scrub.c Mon Dec 29 22:54:28 2014 (r276384) @@ -335,7 +335,7 @@ input_scrub_next_buffer (char **bufp) if (partial_size) { - memcpy (buffer_start + BEFORE_SIZE, partial_where, + memmove (buffer_start + BEFORE_SIZE, partial_where, (unsigned int) partial_size); memcpy (buffer_start + BEFORE_SIZE, save_source, AFTER_SIZE); } From owner-svn-src-stable@FreeBSD.ORG Mon Dec 29 22:55:55 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A4499C4; Mon, 29 Dec 2014 22:55:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 739D022DE; Mon, 29 Dec 2014 22:55:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBTMtt4a006452; Mon, 29 Dec 2014 22:55:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBTMtt6P006451; Mon, 29 Dec 2014 22:55:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412292255.sBTMtt6P006451@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 29 Dec 2014 22:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276385 - stable/9/contrib/binutils/gas X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 22:55:55 -0000 Author: pfg Date: Mon Dec 29 22:55:54 2014 New Revision: 276385 URL: https://svnweb.freebsd.org/changeset/base/276385 Log: MFC r276228: gas: use memmove instead of bogus memcpy. partial_where points into the buffer that begins with buffer_start so we need to use memmove() to handle the overlap. Fixes Sourceware-PR 11456. Obtained from: OpenBSD (CVS rev. 1.2) Modified: stable/9/contrib/binutils/gas/input-scrub.c Directory Properties: stable/9/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/gas/input-scrub.c ============================================================================== --- stable/9/contrib/binutils/gas/input-scrub.c Mon Dec 29 22:54:28 2014 (r276384) +++ stable/9/contrib/binutils/gas/input-scrub.c Mon Dec 29 22:55:54 2014 (r276385) @@ -335,7 +335,7 @@ input_scrub_next_buffer (char **bufp) if (partial_size) { - memcpy (buffer_start + BEFORE_SIZE, partial_where, + memmove (buffer_start + BEFORE_SIZE, partial_where, (unsigned int) partial_size); memcpy (buffer_start + BEFORE_SIZE, save_source, AFTER_SIZE); } From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 00:00:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 979A1EF4; Tue, 30 Dec 2014 00:00:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7888F2FB2; Tue, 30 Dec 2014 00:00:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBU00jMA037788; Tue, 30 Dec 2014 00:00:45 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBU00hYf037772; Tue, 30 Dec 2014 00:00:43 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412300000.sBU00hYf037772@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Tue, 30 Dec 2014 00:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276386 - in stable/10/sys: amd64/amd64 amd64/vmm/intel modules/vmm sys x86/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 00:00:45 -0000 Author: neel Date: Tue Dec 30 00:00:42 2014 New Revision: 276386 URL: https://svnweb.freebsd.org/changeset/base/276386 Log: MFC 261321 Rename the AMD MSR_PERFCTR[0-3] so the Pentium Pro MSR_PERFCTR[0-1] aren't redefined. MFC r273214 Fix build to not bogusly always rebuild vmm.ko. MFC r273338 Add support for AMD's nested page tables in pmap.c: - Provide the correct bit mask for various bit fields in a PTE (e.g. valid bit) for a pmap of type PT_RVI. - Add a function 'pmap_type_guest(pmap)' that returns TRUE if the pmap is of type PT_EPT or PT_RVI. Add CPU_SET_ATOMIC_ACQ(num, cpuset): This is used when activating a vcpu in the nested pmap. Using the 'acquire' variant guarantees that the load of the 'pm_eptgen' will happen only after the vcpu is activated in 'pm_active'. Add defines for various AMD-specific MSRs. Discussed with: kib (r261321) Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/amd64/vmm/intel/vmx_support.S stable/10/sys/modules/vmm/Makefile stable/10/sys/sys/bitset.h stable/10/sys/sys/cpuset.h stable/10/sys/x86/include/specialreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Mon Dec 29 22:55:54 2014 (r276385) +++ stable/10/sys/amd64/amd64/pmap.c Tue Dec 30 00:00:42 2014 (r276386) @@ -146,6 +146,13 @@ __FBSDID("$FreeBSD$"); #endif static __inline boolean_t +pmap_type_guest(pmap_t pmap) +{ + + return ((pmap->pm_type == PT_EPT) || (pmap->pm_type == PT_RVI)); +} + +static __inline boolean_t pmap_emulate_ad_bits(pmap_t pmap) { @@ -159,6 +166,7 @@ pmap_valid_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: + case PT_RVI: mask = X86_PG_V; break; case PT_EPT: @@ -181,6 +189,7 @@ pmap_rw_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: + case PT_RVI: mask = X86_PG_RW; break; case PT_EPT: @@ -205,6 +214,7 @@ pmap_global_bit(pmap_t pmap) case PT_X86: mask = X86_PG_G; break; + case PT_RVI: case PT_EPT: mask = 0; break; @@ -222,6 +232,7 @@ pmap_accessed_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: + case PT_RVI: mask = X86_PG_A; break; case PT_EPT: @@ -244,6 +255,7 @@ pmap_modified_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: + case PT_RVI: mask = X86_PG_M; break; case PT_EPT: @@ -1103,6 +1115,7 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t en switch (pmap->pm_type) { case PT_X86: + case PT_RVI: /* Verify that both PAT bits are not set at the same time */ KASSERT((entry & x86_pat_bits) != x86_pat_bits, ("Invalid PAT bits in entry %#lx", entry)); @@ -1138,6 +1151,7 @@ pmap_cache_bits(pmap_t pmap, int mode, b switch (pmap->pm_type) { case PT_X86: + case PT_RVI: /* The PAT bit is different for PTE's and PDE's. */ pat_flag = is_pde ? X86_PG_PDE_PAT : X86_PG_PTE_PAT; @@ -1172,6 +1186,7 @@ pmap_cache_mask(pmap_t pmap, boolean_t i switch (pmap->pm_type) { case PT_X86: + case PT_RVI: mask = is_pde ? X86_PG_PDE_CACHE : X86_PG_PTE_CACHE; break; case PT_EPT: @@ -1198,6 +1213,7 @@ pmap_update_pde_store(pmap_t pmap, pd_en switch (pmap->pm_type) { case PT_X86: break; + case PT_RVI: case PT_EPT: /* * XXX @@ -1233,7 +1249,7 @@ pmap_update_pde_invalidate(pmap_t pmap, { pt_entry_t PG_G; - if (pmap->pm_type == PT_EPT) + if (pmap_type_guest(pmap)) return; KASSERT(pmap->pm_type == PT_X86, @@ -1347,7 +1363,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off cpuset_t other_cpus; u_int cpuid; - if (pmap->pm_type == PT_EPT) { + if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); return; } @@ -1425,7 +1441,7 @@ pmap_invalidate_range(pmap_t pmap, vm_of vm_offset_t addr; u_int cpuid; - if (pmap->pm_type == PT_EPT) { + if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); return; } @@ -1484,7 +1500,7 @@ pmap_invalidate_all(pmap_t pmap) uint64_t cr3; u_int cpuid; - if (pmap->pm_type == PT_EPT) { + if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); return; } @@ -1606,7 +1622,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t cpuid = PCPU_GET(cpuid); other_cpus = all_cpus; CPU_CLR(cpuid, &other_cpus); - if (pmap == kernel_pmap || pmap->pm_type == PT_EPT) + if (pmap == kernel_pmap || pmap_type_guest(pmap)) active = all_cpus; else { active = pmap->pm_active; @@ -1644,6 +1660,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) invlpg(va); break; + case PT_RVI: case PT_EPT: pmap->pm_eptgen++; break; @@ -1663,6 +1680,7 @@ pmap_invalidate_range(pmap_t pmap, vm_of for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); break; + case PT_RVI: case PT_EPT: pmap->pm_eptgen++; break; @@ -1680,6 +1698,7 @@ pmap_invalidate_all(pmap_t pmap) if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) invltlb(); break; + case PT_RVI: case PT_EPT: pmap->pm_eptgen++; break; Modified: stable/10/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_support.S Mon Dec 29 22:55:54 2014 (r276385) +++ stable/10/sys/amd64/vmm/intel/vmx_support.S Tue Dec 30 00:00:42 2014 (r276386) @@ -29,7 +29,7 @@ #include -#include "vmx_assym.s" +#include "vmx_assym.h" #ifdef SMP #define LK lock ; Modified: stable/10/sys/modules/vmm/Makefile ============================================================================== --- stable/10/sys/modules/vmm/Makefile Mon Dec 29 22:55:54 2014 (r276385) +++ stable/10/sys/modules/vmm/Makefile Tue Dec 30 00:00:42 2014 (r276386) @@ -2,7 +2,7 @@ KMOD= vmm -SRCS= opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h +SRCS= opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h vmx_assym.h CFLAGS+= -DVMM_KEEP_STATS -DSMP CFLAGS+= -I${.CURDIR}/../../amd64/vmm @@ -38,6 +38,7 @@ SRCS+= iommu.c \ SRCS+= ept.c \ vmcs.c \ vmx_msr.c \ + vmx_support.S \ vmx.c \ vtd.c @@ -45,21 +46,19 @@ SRCS+= ept.c \ .PATH: ${.CURDIR}/../../amd64/vmm/amd SRCS+= amdv.c -OBJS= vmx_support.o +CLEANFILES= vmx_assym.h vmx_genassym.o -CLEANFILES= vmx_assym.s vmx_genassym.o - -vmx_assym.s: vmx_genassym.o +vmx_assym.h: vmx_genassym.o .if exists(@) -vmx_assym.s: @/kern/genassym.sh +vmx_assym.h: @/kern/genassym.sh .endif sh @/kern/genassym.sh vmx_genassym.o > ${.TARGET} -vmx_support.o: vmx_support.S vmx_assym.s +vmx_support.o: ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ ${.IMPSRC} -o ${.TARGET} -vmx_genassym.o: vmx_genassym.c @ machine x86 +vmx_genassym.o: ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC} .include Modified: stable/10/sys/sys/bitset.h ============================================================================== --- stable/10/sys/sys/bitset.h Mon Dec 29 22:55:54 2014 (r276385) +++ stable/10/sys/sys/bitset.h Tue Dec 30 00:00:42 2014 (r276386) @@ -135,6 +135,10 @@ atomic_set_long(&(p)->__bits[__bitset_word(_s, n)], \ __bitset_mask((_s), n)) +#define BIT_SET_ATOMIC_ACQ(_s, n, p) \ + atomic_set_acq_long(&(p)->__bits[__bitset_word(_s, n)], \ + __bitset_mask((_s), n)) + /* Convenience functions catering special cases. */ #define BIT_AND_ATOMIC(_s, d, s) do { \ __size_t __i; \ Modified: stable/10/sys/sys/cpuset.h ============================================================================== --- stable/10/sys/sys/cpuset.h Mon Dec 29 22:55:54 2014 (r276385) +++ stable/10/sys/sys/cpuset.h Tue Dec 30 00:00:42 2014 (r276386) @@ -55,6 +55,7 @@ #define CPU_NAND(d, s) BIT_NAND(CPU_SETSIZE, d, s) #define CPU_CLR_ATOMIC(n, p) BIT_CLR_ATOMIC(CPU_SETSIZE, n, p) #define CPU_SET_ATOMIC(n, p) BIT_SET_ATOMIC(CPU_SETSIZE, n, p) +#define CPU_SET_ATOMIC_ACQ(n, p) BIT_SET_ATOMIC_ACQ(CPU_SETSIZE, n, p) #define CPU_AND_ATOMIC(n, p) BIT_AND_ATOMIC(CPU_SETSIZE, n, p) #define CPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) #define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) Modified: stable/10/sys/x86/include/specialreg.h ============================================================================== --- stable/10/sys/x86/include/specialreg.h Mon Dec 29 22:55:54 2014 (r276385) +++ stable/10/sys/x86/include/specialreg.h Tue Dec 30 00:00:42 2014 (r276386) @@ -81,6 +81,7 @@ #define EFER_LME 0x000000100 /* Long mode enable (R/W) */ #define EFER_LMA 0x000000400 /* Long mode active (R) */ #define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ +#define EFER_SVM 0x000001000 /* SVM enable bit for AMD, reserved for Intel */ /* * Intel Extended Features registers @@ -771,12 +772,10 @@ #define MSR_PERFEVSEL1 0xc0010001 #define MSR_PERFEVSEL2 0xc0010002 #define MSR_PERFEVSEL3 0xc0010003 -#undef MSR_PERFCTR0 -#undef MSR_PERFCTR1 -#define MSR_PERFCTR0 0xc0010004 -#define MSR_PERFCTR1 0xc0010005 -#define MSR_PERFCTR2 0xc0010006 -#define MSR_PERFCTR3 0xc0010007 +#define MSR_K7_PERFCTR0 0xc0010004 +#define MSR_K7_PERFCTR1 0xc0010005 +#define MSR_K7_PERFCTR2 0xc0010006 +#define MSR_K7_PERFCTR3 0xc0010007 #define MSR_SYSCFG 0xc0010010 #define MSR_HWCR 0xc0010015 #define MSR_IORRBASE0 0xc0010016 @@ -785,8 +784,21 @@ #define MSR_IORRMASK1 0xc0010019 #define MSR_TOP_MEM 0xc001001a /* boundary for ram below 4G */ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ +#define MSR_NB_CFG1 0xc001001f /* NB configuration 1 */ +#define MSR_P_STATE_LIMIT 0xc0010061 /* P-state Current Limit Register */ +#define MSR_P_STATE_CONTROL 0xc0010062 /* P-state Control Register */ +#define MSR_P_STATE_STATUS 0xc0010063 /* P-state Status Register */ +#define MSR_P_STATE_CONFIG(n) (0xc0010064 + (n)) /* P-state Config */ +#define MSR_SMM_ADDR 0xc0010112 /* SMM TSEG base address */ +#define MSR_SMM_MASK 0xc0010113 /* SMM TSEG address mask */ +#define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #define MSR_MC0_CTL_MASK 0xc0010044 +#define MSR_VM_CR 0xc0010114 /* SVM: feature control */ +#define MSR_VM_HSAVE_PA 0xc0010117 /* SVM: host save area address */ + +/* MSR_VM_CR related */ +#define VM_CR_SVMDIS 0x10 /* SVM: disabled by BIOS */ /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 02:32:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFC5632B; Tue, 30 Dec 2014 02:32:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A970A1B39; Tue, 30 Dec 2014 02:32:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBU2WoaU010401; Tue, 30 Dec 2014 02:32:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBU2WnvO010397; Tue, 30 Dec 2014 02:32:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412300232.sBU2WnvO010397@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 30 Dec 2014 02:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276389 - in stable/10: etc/mtree usr.bin/bmake usr.bin/bmake/tests usr.bin/make usr.bin/make/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 02:32:50 -0000 Author: ngie Date: Tue Dec 30 02:32:48 2014 New Revision: 276389 URL: https://svnweb.freebsd.org/changeset/base/276389 Log: MFC r266074,r266104,r266147: r266074: Move old fmake tests into bmake and hook them to the build. This first step is mostly to prevent the code from rotting even further and to ensure these do not get wiped when fmake's code is removed from the tree. These tests are currently being skipped because they detect the underlying make is not fmake and thus disable themselves -- and the reason is that some of the tests fail, possibly due to legitimate bugs. Enabling them to run against bmake will come separately. Lastly, it would be ideal if these tests were fed upstream but they are not ready for that yet. In the interim, just put them under usr.bin/bmake/ while we sort things out. The existence of a different unit-tests directory within here makes me feel less guilty about this. Change confirmed working with a clean amd64 build. r266104: Undo changes to the generated Makefile. Move tests directory to proper location, including updating the test to work in the more-fragile fmake -> bmake bootstrap environment. r266147: Makefile.inc is also included by the tests subdirectory, which results in SUBDIRS having tests added to it, which fails. Work around this by checking to make sure tests exists before adding it to subdirs and work to get the generated file fixed so we can rename Makefile.inc to something else so it isn't automatically included by subdirs... Added: stable/10/usr.bin/bmake/tests/ - copied from r266074, head/usr.bin/bmake/tests/ Deleted: stable/10/usr.bin/make/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.bin/bmake/Makefile stable/10/usr.bin/bmake/Makefile.inc stable/10/usr.bin/make/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Dec 30 01:28:31 2014 (r276388) +++ stable/10/etc/mtree/BSD.tests.dist Tue Dec 30 02:32:48 2014 (r276389) @@ -169,21 +169,7 @@ usr.bin apply .. - calendar - .. - comm - .. - file2c - .. - join - .. - jot - .. - lastcomm - .. - m4 - .. - make + bmake archives fmt_44bsd .. @@ -281,6 +267,20 @@ .. .. .. + calendar + .. + comm + .. + file2c + .. + join + .. + jot + .. + lastcomm + .. + m4 + .. ncal .. printf Modified: stable/10/usr.bin/bmake/Makefile ============================================================================== --- stable/10/usr.bin/bmake/Makefile Tue Dec 30 01:28:31 2014 (r276388) +++ stable/10/usr.bin/bmake/Makefile Tue Dec 30 02:32:48 2014 (r276389) @@ -106,7 +106,6 @@ COPTS.meta.c += -DHAVE_FILEMON_H -I${FIL SUBDIR+= unit-tests .endif - MAN= ${PROG}.1 MAN1= ${MAN} Modified: stable/10/usr.bin/bmake/Makefile.inc ============================================================================== --- stable/10/usr.bin/bmake/Makefile.inc Tue Dec 30 01:28:31 2014 (r276388) +++ stable/10/usr.bin/bmake/Makefile.inc Tue Dec 30 02:32:48 2014 (r276389) @@ -21,5 +21,12 @@ PROG= make NO_SHARED?= YES .endif +# hack to not add tests to tests subdir since this is included from +# there and to avoid renaming things that require changes to generated +# files. +.if defined(MK_TESTS) && ${MK_TESTS} != no && exists(${.CURDIR}/tests) +SUBDIR+= tests +.endif + WARNS=3 CFLAGS+= -DNO_PWD_OVERRIDE Modified: stable/10/usr.bin/make/Makefile ============================================================================== --- stable/10/usr.bin/make/Makefile Tue Dec 30 01:28:31 2014 (r276388) +++ stable/10/usr.bin/make/Makefile Tue Dec 30 02:32:48 2014 (r276389) @@ -118,8 +118,4 @@ fmake.1: make.1 cp ${.ALLSRC} ${.TARGET} .endif -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif - .include From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 08:24:19 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12AD8486; Tue, 30 Dec 2014 08:24:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEFA73400; Tue, 30 Dec 2014 08:24:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBU8OI9D073250; Tue, 30 Dec 2014 08:24:18 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBU8OF3D073229; Tue, 30 Dec 2014 08:24:15 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412300824.sBU8OF3D073229@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Tue, 30 Dec 2014 08:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276403 - in stable/10: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io sys/modules/vmm usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 08:24:19 -0000 Author: neel Date: Tue Dec 30 08:24:14 2014 New Revision: 276403 URL: https://svnweb.freebsd.org/changeset/base/276403 Log: MFC r273375 Add support AMD processors with the SVM/AMD-V hardware extensions. MFC r273749 Remove bhyve SVM feature printf's now that they are available in the general CPU feature detection code. MFC r273766 Add missing 'break' pointed out by Coverity CID 1249760. MFC r276098 Allow ktr(4) tracing of all guest exceptions via the tunable "hw.vmm.trace_guest_exceptions" MFC r276392 Inject #UD into the guest when it executes either 'MONITOR' or 'MWAIT' on an AMD/SVM host. MFC r276402 Remove "svn:mergeinfo" property that was dragged along when these files were svn copied in r273375. Added: - copied unchanged from r273375, head/sys/amd64/vmm/amd/npt.c - copied unchanged from r273375, head/sys/amd64/vmm/amd/npt.h stable/10/sys/amd64/vmm/amd/svm.c (contents, props changed) - copied, changed from r273375, head/sys/amd64/vmm/amd/svm.c - copied unchanged from r273375, head/sys/amd64/vmm/amd/svm.h - copied unchanged from r273375, head/sys/amd64/vmm/amd/svm_genassym.c - copied unchanged from r273375, head/sys/amd64/vmm/amd/svm_msr.c - copied unchanged from r273375, head/sys/amd64/vmm/amd/svm_msr.h - copied unchanged from r273375, head/sys/amd64/vmm/amd/svm_softc.h - copied unchanged from r273375, head/sys/amd64/vmm/amd/svm_support.S stable/10/sys/amd64/vmm/amd/vmcb.c (contents, props changed) - copied, changed from r273375, head/sys/amd64/vmm/amd/vmcb.c stable/10/sys/amd64/vmm/amd/vmcb.h (contents, props changed) - copied, changed from r273375, head/sys/amd64/vmm/amd/vmcb.h Directory Properties: stable/10/sys/amd64/vmm/amd/npt.c (props changed) stable/10/sys/amd64/vmm/amd/npt.h (props changed) stable/10/sys/amd64/vmm/amd/svm.h (props changed) stable/10/sys/amd64/vmm/amd/svm_genassym.c (props changed) stable/10/sys/amd64/vmm/amd/svm_msr.c (props changed) stable/10/sys/amd64/vmm/amd/svm_msr.h (props changed) stable/10/sys/amd64/vmm/amd/svm_softc.h (props changed) stable/10/sys/amd64/vmm/amd/svm_support.S (props changed) Modified: stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/include/vmm_instruction_emul.h stable/10/sys/amd64/vmm/amd/amdv.c stable/10/sys/amd64/vmm/intel/vmcs.c stable/10/sys/amd64/vmm/intel/vmcs.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/io/vlapic.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_instruction_emul.c stable/10/sys/amd64/vmm/x86.c stable/10/sys/modules/vmm/Makefile stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/xmsr.c stable/10/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Tue Dec 30 07:08:30 2014 (r276402) +++ stable/10/sys/amd64/include/vmm.h Tue Dec 30 08:24:14 2014 (r276403) @@ -357,6 +357,8 @@ void vm_copyin(struct vm *vm, int vcpuid void *kaddr, size_t len); void vm_copyout(struct vm *vm, int vcpuid, const void *kaddr, struct vm_copyinfo *copyinfo, size_t len); + +int vcpu_trace_exceptions(struct vm *vm, int vcpuid); #endif /* KERNEL */ #define VM_MAXCPU 16 /* maximum virtual cpus */ @@ -487,6 +489,7 @@ enum vm_exitcode { VM_EXITCODE_TASK_SWITCH, VM_EXITCODE_MONITOR, VM_EXITCODE_MWAIT, + VM_EXITCODE_SVM, VM_EXITCODE_MAX }; @@ -564,6 +567,14 @@ struct vm_exit { int inst_type; int inst_error; } vmx; + /* + * SVM specific payload. + */ + struct { + uint64_t exitcode; + uint64_t exitinfo1; + uint64_t exitinfo2; + } svm; struct { uint32_t code; /* ecx value */ uint64_t wval; Modified: stable/10/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- stable/10/sys/amd64/include/vmm_instruction_emul.h Tue Dec 30 07:08:30 2014 (r276402) +++ stable/10/sys/amd64/include/vmm_instruction_emul.h Tue Dec 30 08:24:14 2014 (r276403) @@ -93,7 +93,7 @@ int vmm_fetch_instruction(struct vm *vm, int vmm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, int prot, uint64_t *gpa); -void vie_init(struct vie *vie); +void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); /* * Decode the instruction fetched into 'vie' so it can be emulated. Modified: stable/10/sys/amd64/vmm/amd/amdv.c ============================================================================== --- stable/10/sys/amd64/vmm/amd/amdv.c Tue Dec 30 07:08:30 2014 (r276402) +++ stable/10/sys/amd64/vmm/amd/amdv.c Tue Dec 30 08:24:14 2014 (r276403) @@ -38,149 +38,6 @@ __FBSDID("$FreeBSD$"); #include "io/iommu.h" static int -amdv_init(int ipinum) -{ - - printf("amdv_init: not implemented\n"); - return (ENXIO); -} - -static int -amdv_cleanup(void) -{ - - printf("amdv_cleanup: not implemented\n"); - return (ENXIO); -} - -static void -amdv_resume(void) -{ -} - -static void * -amdv_vminit(struct vm *vm, struct pmap *pmap) -{ - - printf("amdv_vminit: not implemented\n"); - return (NULL); -} - -static int -amdv_vmrun(void *arg, int vcpu, register_t rip, struct pmap *pmap, - void *rptr, void *sptr) -{ - - printf("amdv_vmrun: not implemented\n"); - return (ENXIO); -} - -static void -amdv_vmcleanup(void *arg) -{ - - printf("amdv_vmcleanup: not implemented\n"); - return; -} - -static int -amdv_getreg(void *arg, int vcpu, int regnum, uint64_t *retval) -{ - - printf("amdv_getreg: not implemented\n"); - return (EINVAL); -} - -static int -amdv_setreg(void *arg, int vcpu, int regnum, uint64_t val) -{ - - printf("amdv_setreg: not implemented\n"); - return (EINVAL); -} - -static int -amdv_getdesc(void *vmi, int vcpu, int num, struct seg_desc *desc) -{ - - printf("amdv_get_desc: not implemented\n"); - return (EINVAL); -} - -static int -amdv_setdesc(void *vmi, int vcpu, int num, struct seg_desc *desc) -{ - - printf("amdv_get_desc: not implemented\n"); - return (EINVAL); -} - -static int -amdv_getcap(void *arg, int vcpu, int type, int *retval) -{ - - printf("amdv_getcap: not implemented\n"); - return (EINVAL); -} - -static int -amdv_setcap(void *arg, int vcpu, int type, int val) -{ - - printf("amdv_setcap: not implemented\n"); - return (EINVAL); -} - -static struct vmspace * -amdv_vmspace_alloc(vm_offset_t min, vm_offset_t max) -{ - - printf("amdv_vmspace_alloc: not implemented\n"); - return (NULL); -} - -static void -amdv_vmspace_free(struct vmspace *vmspace) -{ - - printf("amdv_vmspace_free: not implemented\n"); - return; -} - -static struct vlapic * -amdv_vlapic_init(void *arg, int vcpuid) -{ - - panic("amdv_vlapic_init: not implmented"); -} - -static void -amdv_vlapic_cleanup(void *arg, struct vlapic *vlapic) -{ - - panic("amdv_vlapic_cleanup: not implemented"); -} - -struct vmm_ops vmm_ops_amd = { - amdv_init, - amdv_cleanup, - amdv_resume, - amdv_vminit, - amdv_vmrun, - amdv_vmcleanup, - amdv_getreg, - amdv_setreg, - amdv_getdesc, - amdv_setdesc, - amdv_getcap, - amdv_setcap, - amdv_vmspace_alloc, - amdv_vmspace_free, - amdv_vlapic_init, - amdv_vlapic_cleanup, -}; - -static int amd_iommu_init(void) { Copied: stable/10/sys/amd64/vmm/amd/npt.c (from r273375, head/sys/amd64/vmm/amd/npt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/vmm/amd/npt.c Tue Dec 30 08:24:14 2014 (r276403, copy of r273375, head/sys/amd64/vmm/amd/npt.c) @@ -0,0 +1,87 @@ +/*- + * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) + * 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 unmodified, 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 "npt.h" + +SYSCTL_DECL(_hw_vmm); +SYSCTL_NODE(_hw_vmm, OID_AUTO, npt, CTLFLAG_RW, NULL, NULL); + +static int npt_flags; +SYSCTL_INT(_hw_vmm_npt, OID_AUTO, pmap_flags, CTLFLAG_RD, + &npt_flags, 0, NULL); + +#define NPT_IPIMASK 0xFF + +/* + * AMD nested page table init. + */ +int +svm_npt_init(int ipinum) +{ + int enable_superpage = 1; + + npt_flags = ipinum & NPT_IPIMASK; + TUNABLE_INT_FETCH("hw.vmm.npt.enable_superpage", &enable_superpage); + if (enable_superpage) + npt_flags |= PMAP_PDE_SUPERPAGE; + + return (0); +} + +static int +npt_pinit(pmap_t pmap) +{ + + return (pmap_pinit_type(pmap, PT_RVI, npt_flags)); +} + +struct vmspace * +svm_npt_alloc(vm_offset_t min, vm_offset_t max) +{ + + return (vmspace_alloc(min, max, npt_pinit)); +} + +void +svm_npt_free(struct vmspace *vmspace) +{ + + vmspace_free(vmspace); +} Copied: stable/10/sys/amd64/vmm/amd/npt.h (from r273375, head/sys/amd64/vmm/amd/npt.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/vmm/amd/npt.h Tue Dec 30 08:24:14 2014 (r276403, copy of r273375, head/sys/amd64/vmm/amd/npt.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) + * 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 unmodified, 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 _SVM_NPT_H_ +#define _SVM_NPT_H_ + +int svm_npt_init(int ipinum); +struct vmspace *svm_npt_alloc(vm_offset_t min, vm_offset_t max); +void svm_npt_free(struct vmspace *vmspace); + +#endif /* _SVM_NPT_H_ */ Copied and modified: stable/10/sys/amd64/vmm/amd/svm.c (from r273375, head/sys/amd64/vmm/amd/svm.c) ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Tue Oct 21 07:10:43 2014 (r273375, copy source) +++ stable/10/sys/amd64/vmm/amd/svm.c Tue Dec 30 08:24:14 2014 (r276403) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "vmm_lapic.h" @@ -174,30 +175,9 @@ check_svm_features(void) do_cpuid(0x8000000A, regs); svm_feature = regs[3]; - printf("SVM: Revision %d\n", regs[0] & 0xFF); - printf("SVM: NumASID %u\n", regs[1]); - nasid = regs[1]; KASSERT(nasid > 1, ("Insufficient ASIDs for guests: %#x", nasid)); - printf("SVM: Features 0x%b\n", svm_feature, - "\020" - "\001NP" /* Nested paging */ - "\002LbrVirt" /* LBR virtualization */ - "\003SVML" /* SVM lock */ - "\004NRIPS" /* NRIP save */ - "\005TscRateMsr" /* MSR based TSC rate control */ - "\006VmcbClean" /* VMCB clean bits */ - "\007FlushByAsid" /* Flush by ASID */ - "\010DecodeAssist" /* Decode assist */ - "\011" - "\012" - "\013PauseFilter" - "\014" - "\015PauseFilterThreshold" - "\016AVIC" - ); - /* bhyve requires the Nested Paging feature */ if (!(svm_feature & AMD_CPUID_SVM_NP)) { printf("SVM: Nested Paging feature not available.\n"); @@ -450,8 +430,24 @@ vmcb_init(struct svm_softc *sc, int vcpu svm_enable_intercept(sc, vcpu, VMCB_CR_INTCPT, mask); } - /* Intercept Machine Check exceptions. */ - svm_enable_intercept(sc, vcpu, VMCB_EXC_INTCPT, BIT(IDT_MC)); + + /* + * Intercept everything when tracing guest exceptions otherwise + * just intercept machine check exception. + */ + if (vcpu_trace_exceptions(sc->vm, vcpu)) { + for (n = 0; n < 32; n++) { + /* + * Skip unimplemented vectors in the exception bitmap. + */ + if (n == 2 || n == 9) { + continue; + } + svm_enable_intercept(sc, vcpu, VMCB_EXC_INTCPT, BIT(n)); + } + } else { + svm_enable_intercept(sc, vcpu, VMCB_EXC_INTCPT, BIT(IDT_MC)); + } /* Intercept various events (for e.g. I/O, MSR and CPUID accesses) */ svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_IO); @@ -465,6 +461,9 @@ vmcb_init(struct svm_softc *sc, int vcpu svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_FERR_FREEZE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MONITOR); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MWAIT); + /* * From section "Canonicalization and Consistency Checks" in APMv2 * the VMRUN intercept bit must be set to pass the consistency check. @@ -1144,6 +1143,10 @@ exit_reason_to_str(uint64_t reason) return ("msr"); case VMCB_EXIT_IRET: return ("iret"); + case VMCB_EXIT_MONITOR: + return ("monitor"); + case VMCB_EXIT_MWAIT: + return ("mwait"); default: snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); return (reasonbuf); @@ -1197,9 +1200,10 @@ svm_vmexit(struct svm_softc *svm_sc, int struct vmcb_state *state; struct vmcb_ctrl *ctrl; struct svm_regctx *ctx; + struct vm_exception exception; uint64_t code, info1, info2, val; uint32_t eax, ecx, edx; - int handled; + int error, errcode_valid, handled, idtvec, reflect; bool retu; ctx = svm_get_guest_regctx(svm_sc, vcpu); @@ -1258,8 +1262,78 @@ svm_vmexit(struct svm_softc *svm_sc, int case VMCB_EXIT_NMI: /* external NMI */ handled = 1; break; - case VMCB_EXIT_MC: /* machine check */ + case 0x40 ... 0x5F: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_EXCEPTION, 1); + reflect = 1; + idtvec = code - 0x40; + switch (idtvec) { + case IDT_MC: + /* + * Call the machine check handler by hand. Also don't + * reflect the machine check back into the guest. + */ + reflect = 0; + VCPU_CTR0(svm_sc->vm, vcpu, "Vectoring to MCE handler"); + __asm __volatile("int $18"); + break; + case IDT_PF: + error = svm_setreg(svm_sc, vcpu, VM_REG_GUEST_CR2, + info2); + KASSERT(error == 0, ("%s: error %d updating cr2", + __func__, error)); + /* fallthru */ + case IDT_NP: + case IDT_SS: + case IDT_GP: + case IDT_AC: + case IDT_TS: + errcode_valid = 1; + break; + + case IDT_DF: + errcode_valid = 1; + info1 = 0; + break; + + case IDT_BP: + case IDT_OF: + case IDT_BR: + /* + * The 'nrip' field is populated for INT3, INTO and + * BOUND exceptions and this also implies that + * 'inst_length' is non-zero. + * + * Reset 'inst_length' to zero so the guest %rip at + * event injection is identical to what it was when + * the exception originally happened. + */ + VCPU_CTR2(svm_sc->vm, vcpu, "Reset inst_length from %d " + "to zero before injecting exception %d", + vmexit->inst_length, idtvec); + vmexit->inst_length = 0; + /* fallthru */ + default: + errcode_valid = 0; + break; + } + KASSERT(vmexit->inst_length == 0, ("invalid inst_length (%d) " + "when reflecting exception %d into guest", + vmexit->inst_length, idtvec)); + + if (reflect) { + /* Reflect the exception back into the guest */ + exception.vector = idtvec; + exception.error_code_valid = errcode_valid; + exception.error_code = errcode_valid ? info1 : 0; + VCPU_CTR2(svm_sc->vm, vcpu, "Reflecting exception " + "%d/%#x into the guest", exception.vector, + exception.error_code); + error = vm_inject_exception(svm_sc->vm, vcpu, + &exception); + KASSERT(error == 0, ("%s: vm_inject_exception error %d", + __func__, error)); + } + handled = 1; break; case VMCB_EXIT_MSR: /* MSR access. */ eax = state->rax; @@ -1339,6 +1413,12 @@ svm_vmexit(struct svm_softc *svm_sc, int info2, info1, state->rip); } break; + case VMCB_EXIT_MONITOR: + vmexit->exitcode = VM_EXITCODE_MONITOR; + break; + case VMCB_EXIT_MWAIT: + vmexit->exitcode = VM_EXITCODE_MWAIT; + break; default: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_UNKNOWN, 1); break; Copied: stable/10/sys/amd64/vmm/amd/svm.h (from r273375, head/sys/amd64/vmm/amd/svm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/vmm/amd/svm.h Tue Dec 30 08:24:14 2014 (r276403, copy of r273375, head/sys/amd64/vmm/amd/svm.h) @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) + * 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 unmodified, 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 _SVM_H_ +#define _SVM_H_ + +/* + * Guest register state that is saved outside the VMCB. + */ +struct svm_regctx { + register_t sctx_rbp; + register_t sctx_rbx; + register_t sctx_rcx; + register_t sctx_rdx; + register_t sctx_rdi; + register_t sctx_rsi; + register_t sctx_r8; + register_t sctx_r9; + register_t sctx_r10; + register_t sctx_r11; + register_t sctx_r12; + register_t sctx_r13; + register_t sctx_r14; + register_t sctx_r15; +}; + +void svm_launch(uint64_t pa, struct svm_regctx *); + +#endif /* _SVM_H_ */ Copied: stable/10/sys/amd64/vmm/amd/svm_genassym.c (from r273375, head/sys/amd64/vmm/amd/svm_genassym.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/vmm/amd/svm_genassym.c Tue Dec 30 08:24:14 2014 (r276403, copy of r273375, head/sys/amd64/vmm/amd/svm_genassym.c) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) + * 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 unmodified, 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 "svm.h" + +ASSYM(SCTX_RBX, offsetof(struct svm_regctx, sctx_rbx)); +ASSYM(SCTX_RCX, offsetof(struct svm_regctx, sctx_rcx)); +ASSYM(SCTX_RBP, offsetof(struct svm_regctx, sctx_rbp)); +ASSYM(SCTX_RDX, offsetof(struct svm_regctx, sctx_rdx)); +ASSYM(SCTX_RDI, offsetof(struct svm_regctx, sctx_rdi)); +ASSYM(SCTX_RSI, offsetof(struct svm_regctx, sctx_rsi)); +ASSYM(SCTX_R8, offsetof(struct svm_regctx, sctx_r8)); +ASSYM(SCTX_R9, offsetof(struct svm_regctx, sctx_r9)); +ASSYM(SCTX_R10, offsetof(struct svm_regctx, sctx_r10)); +ASSYM(SCTX_R11, offsetof(struct svm_regctx, sctx_r11)); +ASSYM(SCTX_R12, offsetof(struct svm_regctx, sctx_r12)); +ASSYM(SCTX_R13, offsetof(struct svm_regctx, sctx_r13)); +ASSYM(SCTX_R14, offsetof(struct svm_regctx, sctx_r14)); +ASSYM(SCTX_R15, offsetof(struct svm_regctx, sctx_r15)); Copied: stable/10/sys/amd64/vmm/amd/svm_msr.c (from r273375, head/sys/amd64/vmm/amd/svm_msr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/vmm/amd/svm_msr.c Tue Dec 30 08:24:14 2014 (r276403, copy of r273375, head/sys/amd64/vmm/amd/svm_msr.c) @@ -0,0 +1,136 @@ +/*- + * Copyright (c) 2014, Neel Natu (neel@freebsd.org) + * 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 unmodified, 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 "svm_msr.h" + +#ifndef MSR_AMDK8_IPM +#define MSR_AMDK8_IPM 0xc0010055 +#endif + +enum { + IDX_MSR_LSTAR, + IDX_MSR_CSTAR, + IDX_MSR_STAR, + IDX_MSR_SF_MASK, + HOST_MSR_NUM /* must be the last enumeration */ +}; + +static uint64_t host_msrs[HOST_MSR_NUM]; + +void +svm_msr_init(void) +{ + /* + * It is safe to cache the values of the following MSRs because they + * don't change based on curcpu, curproc or curthread. + */ + host_msrs[IDX_MSR_LSTAR] = rdmsr(MSR_LSTAR); + host_msrs[IDX_MSR_CSTAR] = rdmsr(MSR_CSTAR); + host_msrs[IDX_MSR_STAR] = rdmsr(MSR_STAR); + host_msrs[IDX_MSR_SF_MASK] = rdmsr(MSR_SF_MASK); +} + +void +svm_msr_guest_init(struct svm_softc *sc, int vcpu) +{ + /* + * All the MSRs accessible to the guest are either saved/restored by + * hardware on every #VMEXIT/VMRUN (e.g., G_PAT) or are saved/restored + * by VMSAVE/VMLOAD (e.g., MSR_GSBASE). + * + * There are no guest MSRs that are saved/restored "by hand" so nothing + * more to do here. + */ + return; +} + +void +svm_msr_guest_enter(struct svm_softc *sc, int vcpu) +{ + /* + * Save host MSRs (if any) and restore guest MSRs (if any). + */ +} + +void +svm_msr_guest_exit(struct svm_softc *sc, int vcpu) +{ + /* + * Save guest MSRs (if any) and restore host MSRs. + */ + wrmsr(MSR_LSTAR, host_msrs[IDX_MSR_LSTAR]); + wrmsr(MSR_CSTAR, host_msrs[IDX_MSR_CSTAR]); + wrmsr(MSR_STAR, host_msrs[IDX_MSR_STAR]); + wrmsr(MSR_SF_MASK, host_msrs[IDX_MSR_SF_MASK]); + + /* MSR_KGSBASE will be restored on the way back to userspace */ +} + +int +svm_rdmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t *result, + bool *retu) +{ + int error = 0; + + switch (num) { + case MSR_AMDK8_IPM: + *result = 0; + break; + default: + error = EINVAL; + break; + } + + return (error); +} + +int +svm_wrmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t val, bool *retu) +{ + int error = 0; + + switch (num) { + case MSR_AMDK8_IPM: + /* + * Ignore writes to the "Interrupt Pending Message" MSR. + */ + break; + default: + error = EINVAL; + break; + } + + return (error); +} Copied: stable/10/sys/amd64/vmm/amd/svm_msr.h (from r273375, head/sys/amd64/vmm/amd/svm_msr.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/vmm/amd/svm_msr.h Tue Dec 30 08:24:14 2014 (r276403, copy of r273375, head/sys/amd64/vmm/amd/svm_msr.h) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2014 Neel Natu (neel@freebsd.org) + * 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 unmodified, 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 _SVM_MSR_H_ +#define _SVM_MSR_H_ + +struct svm_softc; + +void svm_msr_init(void); +void svm_msr_guest_init(struct svm_softc *sc, int vcpu); +void svm_msr_guest_enter(struct svm_softc *sc, int vcpu); +void svm_msr_guest_exit(struct svm_softc *sc, int vcpu); + +int svm_wrmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t val, + bool *retu); +int svm_rdmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t *result, + bool *retu); + +#endif /* _SVM_MSR_H_ */ Copied: stable/10/sys/amd64/vmm/amd/svm_softc.h (from r273375, head/sys/amd64/vmm/amd/svm_softc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/vmm/amd/svm_softc.h Tue Dec 30 08:24:14 2014 (r276403, copy of r273375, head/sys/amd64/vmm/amd/svm_softc.h) @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) + * 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 unmodified, 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 _SVM_SOFTC_H_ +#define _SVM_SOFTC_H_ + +#define SVM_IO_BITMAP_SIZE (3 * PAGE_SIZE) +#define SVM_MSR_BITMAP_SIZE (2 * PAGE_SIZE) + +struct asid { + uint64_t gen; /* range is [1, ~0UL] */ + uint32_t num; /* range is [1, nasid - 1] */ +}; + +/* + * XXX separate out 'struct vmcb' from 'svm_vcpu' to avoid wasting space + * due to VMCB alignment requirements. + */ +struct svm_vcpu { + struct vmcb vmcb; /* hardware saved vcpu context */ + struct svm_regctx swctx; /* software saved vcpu context */ + uint64_t vmcb_pa; /* VMCB physical address */ + int lastcpu; /* host cpu that the vcpu last ran on */ + uint32_t dirty; /* state cache bits that must be cleared */ + long eptgen; /* pmap->pm_eptgen when the vcpu last ran */ + struct asid asid; +} __aligned(PAGE_SIZE); + +/* + * SVM softc, one per virtual machine. + */ +struct svm_softc { + uint8_t iopm_bitmap[SVM_IO_BITMAP_SIZE]; /* shared by all vcpus */ + uint8_t msr_bitmap[SVM_MSR_BITMAP_SIZE]; /* shared by all vcpus */ + uint8_t apic_page[VM_MAXCPU][PAGE_SIZE]; + struct svm_vcpu vcpu[VM_MAXCPU]; + vm_offset_t nptp; /* nested page table */ + struct vm *vm; +} __aligned(PAGE_SIZE); + +CTASSERT((offsetof(struct svm_softc, nptp) & PAGE_MASK) == 0); + +static __inline struct svm_vcpu * +svm_get_vcpu(struct svm_softc *sc, int vcpu) +{ + + return (&(sc->vcpu[vcpu])); +} + +static __inline struct vmcb * +svm_get_vmcb(struct svm_softc *sc, int vcpu) +{ + + return (&(sc->vcpu[vcpu].vmcb)); +} + +static __inline struct vmcb_state * +svm_get_vmcb_state(struct svm_softc *sc, int vcpu) +{ + + return (&(sc->vcpu[vcpu].vmcb.state)); +} + +static __inline struct vmcb_ctrl * +svm_get_vmcb_ctrl(struct svm_softc *sc, int vcpu) +{ + + return (&(sc->vcpu[vcpu].vmcb.ctrl)); +} + +static __inline struct svm_regctx * +svm_get_guest_regctx(struct svm_softc *sc, int vcpu) +{ + + return (&(sc->vcpu[vcpu].swctx)); +} + +static __inline void +svm_set_dirty(struct svm_softc *sc, int vcpu, uint32_t dirtybits) +{ + struct svm_vcpu *vcpustate; + + vcpustate = svm_get_vcpu(sc, vcpu); + + vcpustate->dirty |= dirtybits; +} + +#endif /* _SVM_SOFTC_H_ */ Copied: stable/10/sys/amd64/vmm/amd/svm_support.S (from r273375, head/sys/amd64/vmm/amd/svm_support.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/vmm/amd/svm_support.S Tue Dec 30 08:24:14 2014 (r276403, copy of r273375, head/sys/amd64/vmm/amd/svm_support.S) @@ -0,0 +1,115 @@ +/*- + * Copyright (c) 2013, Anish Gupta (akgupt3@gmail.com) + * 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 unmodified, 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 + +#include "svm_assym.h" + +/* + * Be friendly to DTrace FBT's prologue/epilogue pattern matching. + * + * They are also responsible for saving/restoring the host %rbp across VMRUN. + */ +#define VENTER push %rbp ; mov %rsp,%rbp +#define VLEAVE pop %rbp + +/* + * svm_launch(uint64_t vmcb, struct svm_regctx *gctx) + * %rdi: physical address of VMCB + * %rsi: pointer to guest context + */ +ENTRY(svm_launch) + VENTER + + /* + * Host register state saved across a VMRUN. + * + * All "callee saved registers" except: + * %rsp: because it is preserved by the processor across VMRUN. + * %rbp: because it is saved/restored by the function prologue/epilogue. + */ + push %rbx + push %r12 + push %r13 + push %r14 + push %r15 + + /* Save the physical address of the VMCB in %rax */ + movq %rdi, %rax + + push %rsi /* push guest context pointer on the stack */ + + /* + * Restore guest state. + */ + movq SCTX_R8(%rsi), %r8 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 10:30:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29418C78; Tue, 30 Dec 2014 10:30:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14DCB64A7D; Tue, 30 Dec 2014 10:30:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBUAUDoA039791; Tue, 30 Dec 2014 10:30:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBUAUDJS039785; Tue, 30 Dec 2014 10:30:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412301030.sBUAUDJS039785@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 Dec 2014 10:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276408 - in stable/10/sys: fs/msdosfs kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 10:30:14 -0000 Author: kib Date: Tue Dec 30 10:30:12 2014 New Revision: 276408 URL: https://svnweb.freebsd.org/changeset/base/276408 Log: MFC r275638: Do not call VFS_SYNC() before VFS_UNMOUNT() for forced unmount. Modified: stable/10/sys/fs/msdosfs/msdosfs_vfsops.c stable/10/sys/kern/vfs_mount.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_vfsops.c Tue Dec 30 09:20:29 2014 (r276407) +++ stable/10/sys/fs/msdosfs/msdosfs_vfsops.c Tue Dec 30 10:30:12 2014 (r276408) @@ -797,11 +797,15 @@ msdosfs_unmount(struct mount *mp, int mn int error, flags; flags = 0; - if (mntflags & MNT_FORCE) + error = msdosfs_sync(mp, MNT_WAIT); + if ((mntflags & MNT_FORCE) != 0) { flags |= FORCECLOSE; + } else if (error != 0) { + return (error); + } error = vflush(mp, 0, flags, curthread); - if (error && error != ENXIO) - return error; + if (error != 0 && error != ENXIO) + return (error); pmp = VFSTOMSDOSFS(mp); if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) { error = markvoldirty(pmp, 0); Modified: stable/10/sys/kern/vfs_mount.c ============================================================================== --- stable/10/sys/kern/vfs_mount.c Tue Dec 30 09:20:29 2014 (r276407) +++ stable/10/sys/kern/vfs_mount.c Tue Dec 30 10:30:12 2014 (r276408) @@ -1305,8 +1305,8 @@ dounmount(mp, flags, td) } vput(fsrootvp); } - if (((mp->mnt_flag & MNT_RDONLY) || - (error = VFS_SYNC(mp, MNT_WAIT)) == 0) || (flags & MNT_FORCE) != 0) + if ((mp->mnt_flag & MNT_RDONLY) != 0 || (flags & MNT_FORCE) != 0 || + (error = VFS_SYNC(mp, MNT_WAIT)) == 0) error = VFS_UNMOUNT(mp, flags); vn_finished_write(mp); /* From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 19:39:37 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9DC4151; Tue, 30 Dec 2014 19:39:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A15A91769; Tue, 30 Dec 2014 19:39:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBUJdbEm011886; Tue, 30 Dec 2014 19:39:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBUJdWRt011860; Tue, 30 Dec 2014 19:39:32 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412301939.sBUJdWRt011860@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 30 Dec 2014 19:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276415 - in stable/10: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 19:39:37 -0000 Author: delphij Date: Tue Dec 30 19:39:31 2014 New Revision: 276415 URL: https://svnweb.freebsd.org/changeset/base/276415 Log: MFC r275698: MFV r275696: file 5.21. Added: stable/10/contrib/file/magic/Magdir/kerberos - copied unchanged from r275698, head/contrib/file/magic/Magdir/kerberos stable/10/contrib/file/magic/Magdir/meteorological - copied unchanged from r275698, head/contrib/file/magic/Magdir/meteorological Deleted: stable/10/contrib/file/magic/Magdir/rinex Modified: stable/10/contrib/file/ChangeLog stable/10/contrib/file/Makefile.in stable/10/contrib/file/TODO stable/10/contrib/file/aclocal.m4 stable/10/contrib/file/config.h.in stable/10/contrib/file/configure stable/10/contrib/file/configure.ac stable/10/contrib/file/doc/Makefile.in stable/10/contrib/file/doc/file.man stable/10/contrib/file/doc/libmagic.man stable/10/contrib/file/magic/Localstuff stable/10/contrib/file/magic/Magdir/android stable/10/contrib/file/magic/Magdir/animation stable/10/contrib/file/magic/Magdir/archive stable/10/contrib/file/magic/Magdir/blender stable/10/contrib/file/magic/Magdir/commands stable/10/contrib/file/magic/Magdir/compress stable/10/contrib/file/magic/Magdir/database stable/10/contrib/file/magic/Magdir/elf stable/10/contrib/file/magic/Magdir/filesystems stable/10/contrib/file/magic/Magdir/images stable/10/contrib/file/magic/Magdir/jpeg stable/10/contrib/file/magic/Magdir/linux stable/10/contrib/file/magic/Magdir/macintosh stable/10/contrib/file/magic/Magdir/msooxml stable/10/contrib/file/magic/Magdir/netbsd stable/10/contrib/file/magic/Magdir/pascal stable/10/contrib/file/magic/Magdir/pgp stable/10/contrib/file/magic/Magdir/python stable/10/contrib/file/magic/Magdir/riff stable/10/contrib/file/magic/Magdir/sequent stable/10/contrib/file/magic/Magdir/sereal stable/10/contrib/file/magic/Magdir/ssh stable/10/contrib/file/magic/Magdir/vms stable/10/contrib/file/magic/Magdir/vorbis stable/10/contrib/file/magic/Magdir/windows stable/10/contrib/file/magic/Makefile.am stable/10/contrib/file/magic/Makefile.in stable/10/contrib/file/missing stable/10/contrib/file/python/Makefile.in stable/10/contrib/file/src/Makefile.in stable/10/contrib/file/src/apprentice.c stable/10/contrib/file/src/ascmagic.c stable/10/contrib/file/src/cdf.c stable/10/contrib/file/src/cdf.h stable/10/contrib/file/src/compress.c stable/10/contrib/file/src/elfclass.h stable/10/contrib/file/src/encoding.c stable/10/contrib/file/src/file.c stable/10/contrib/file/src/file.h stable/10/contrib/file/src/file_opts.h stable/10/contrib/file/src/fsmagic.c stable/10/contrib/file/src/funcs.c stable/10/contrib/file/src/getline.c stable/10/contrib/file/src/magic.c stable/10/contrib/file/src/magic.h stable/10/contrib/file/src/magic.h.in stable/10/contrib/file/src/pread.c stable/10/contrib/file/src/readcdf.c stable/10/contrib/file/src/readelf.c stable/10/contrib/file/src/softmagic.c stable/10/contrib/file/src/vasprintf.c stable/10/contrib/file/tests/Makefile.in stable/10/lib/libmagic/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/file/ChangeLog ============================================================================== --- stable/10/contrib/file/ChangeLog Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/ChangeLog Tue Dec 30 19:39:31 2014 (r276415) @@ -1,3 +1,69 @@ +2014-12-10 20:01 Christos Zoulas + + * release 5.21 + +2014-11-27 18:40 Christos Zoulas + + * Allow setting more parameters from the command line. + * Split name/use and indirect magic recursion limits. + +2014-11-27 11:12 Christos Zoulas + + * Adjust ELF parameters and the default recursion + level. + * Allow setting the recursion level dynamically. + +2014-11-24 8:55 Christos Zoulas + + * The following fixes resulted from Thomas Jarosch's fuzzing + tests that revealed severe performance issues on pathological + input: + - limit number of elf program and sections processing + - abort elf note processing quickly + - reduce the number of recursion levels from 20 to 10 + - preserve error messages in indirect magic handling + +2014-11-12 10:30 Christos Zoulas + + * fix bogus free in the user buffer case. + +2014-11-11 12:35 Christos Zoulas + + * fix out of bounds read for pascal strings + * fix memory leak (not freeing the head of each mlist) + +2014-11-07 10:25 Christos Zoulas + + * When printing strings from a file, convert them to printable + on a byte by byte basis, so that we don't get issues with + locale's trying to interpret random byte streams as UTF-8 and + having printf error out with EILSEQ. + +2014-10-17 11:48 Christos Zoulas + + * fix bounds in note reading (Francisco Alonso / Red Hat) + +2014-10-11 15:02 Christos Zoulas + + * fix autoconf glue for setlocale and locale_t; some OS's + have locale_t in xlocale.h + +2014-10-10 15:01 Christos Zoulas + + * release 5.20 + +2014-08-17 10:01 Christos Zoulas + + * recognize encrypted CDF documents + +2014-08-04 9:18 Christos Zoulas + + * add magic_load_buffers from Brooks Davis + +2014-07-24 16:40 Christos Zoulas + + * add thumbs.db support + 2014-06-12 12:28 Christos Zoulas * release 5.19 Modified: stable/10/contrib/file/Makefile.in ============================================================================== --- stable/10/contrib/file/Makefile.in Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/Makefile.in Tue Dec 30 19:39:31 2014 (r276415) @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -618,9 +618,10 @@ distcheck: dist && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ Modified: stable/10/contrib/file/TODO ============================================================================== --- stable/10/contrib/file/TODO Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/TODO Tue Dec 30 19:39:31 2014 (r276415) @@ -15,3 +15,5 @@ small amount of C is needed (because fas required for soft magic, not the more detailed information given by hard-wired routines). In this regard, note that hplip, which is BSD-licensed, has a magic reimplementation in Python. + +Read the kerberos magic entry for more ideas. Modified: stable/10/contrib/file/aclocal.m4 ============================================================================== --- stable/10/contrib/file/aclocal.m4 Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/aclocal.m4 Tue Dec 30 19:39:31 2014 (r276415) @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.14 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -21,7 +21,7 @@ If you have problems, you may need to re To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # visibility.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -113,7 +113,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -129,7 +129,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) Modified: stable/10/contrib/file/config.h.in ============================================================================== --- stable/10/contrib/file/config.h.in Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/config.h.in Tue Dec 30 19:39:31 2014 (r276415) @@ -44,6 +44,9 @@ /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK +/* Define to 1 if you have the `freelocale' function. */ +#undef HAVE_FREELOCALE + /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO @@ -95,9 +98,15 @@ /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP +/* Define to 1 if you have the `newlocale' function. */ +#undef HAVE_NEWLOCALE + /* Define to 1 if you have the `pread' function. */ #undef HAVE_PREAD +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H @@ -182,6 +191,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the `uselocale' function. */ +#undef HAVE_USELOCALE + /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME @@ -219,6 +231,9 @@ /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK +/* Define to 1 if you have the header file. */ +#undef HAVE_XLOCALE_H + /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H Modified: stable/10/contrib/file/configure ============================================================================== --- stable/10/contrib/file/configure Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/configure Tue Dec 30 19:39:31 2014 (r276415) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.19. +# Generated by GNU Autoconf 2.69 for file 5.21. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.19' -PACKAGE_STRING='file 5.19' +PACKAGE_VERSION='5.21' +PACKAGE_STRING='file 5.21' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.19 to adapt to many kinds of systems. +\`configure' configures file 5.21 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.19:";; + short | recursive ) echo "Configuration of file 5.21:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.19 +file configure 5.21 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.19, which was +It was created by file $as_me 5.21, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.19' + VERSION='5.21' cat >>confdefs.h <<_ACEOF @@ -12785,7 +12785,7 @@ fi done -for ac_header in getopt.h err.h +for ac_header in getopt.h err.h xlocale.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -14191,7 +14191,7 @@ fi fi -for ac_func in strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof +for ac_func in strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -14998,7 +14998,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.19, which was +This file was extended by file $as_me 5.21, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15064,7 +15064,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.19 +file config.status 5.21 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/10/contrib/file/configure.ac ============================================================================== --- stable/10/contrib/file/configure.ac Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/configure.ac Tue Dec 30 19:39:31 2014 (r276415) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.19],[christos@astron.com]) +AC_INIT([file],[5.21],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -82,7 +82,7 @@ AC_HEADER_MAJOR AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h) AC_CHECK_HEADERS(stddef.h utime.h wchar.h wctype.h limits.h) -AC_CHECK_HEADERS(getopt.h err.h) +AC_CHECK_HEADERS(getopt.h err.h xlocale.h) AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h) AC_CHECK_HEADERS(zlib.h) @@ -138,7 +138,7 @@ else fi]) dnl Checks for functions -AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof) +AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale) dnl Provide implementation of some required functions if necessary AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r pread strcasestr fmtcheck) Modified: stable/10/contrib/file/doc/Makefile.in ============================================================================== --- stable/10/contrib/file/doc/Makefile.in Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/doc/Makefile.in Tue Dec 30 19:39:31 2014 (r276415) @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. Modified: stable/10/contrib/file/doc/file.man ============================================================================== --- stable/10/contrib/file/doc/file.man Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/doc/file.man Tue Dec 30 19:39:31 2014 (r276415) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.106 2014/03/07 23:11:51 christos Exp $ -.Dd January 30, 2014 +.\" $File: file.man,v 1.110 2014/11/28 02:46:39 christos Exp $ +.Dd November 27, 2014 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -16,6 +16,7 @@ .Op Fl F Ar separator .Op Fl f Ar namefile .Op Fl m Ar magicfiles +.Op Fl P Ar name=value .Ar .Ek .Nm @@ -303,6 +304,15 @@ or attempt to preserve the access time of files analyzed, to pretend that .Nm never read them. +.It Fl P , Fl Fl parameter Ar name=value +Set various parameter limits. +.Bl -column "elf_phnum" "Default" "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent +.It Sy "Name" Ta Sy "Default" Ta Sy "Explanation" +.It Li indir Ta 15 Ta recursion limit for indirect magic +.It Li name Ta 30 Ta use count limit for name/use magic +.It Li elf_phnum Ta 128 Ta max ELF program sections processed +.It Li elf_shnum Ta 32768 Ta max ELF sections processed +.El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. Normally Modified: stable/10/contrib/file/doc/libmagic.man ============================================================================== --- stable/10/contrib/file/doc/libmagic.man Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/doc/libmagic.man Tue Dec 30 19:39:31 2014 (r276415) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.28 2014/03/02 14:47:16 christos Exp $ +.\" $File: libmagic.man,v 1.33 2014/11/28 02:46:39 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 6, 2012 +.Dd November 27, 2014 .Dt LIBMAGIC 3 .Os .Sh NAME @@ -40,6 +40,9 @@ .Nm magic_compile , .Nm magic_list , .Nm magic_load , +.Nm magic_load_buffers , +.Nm magic_setparam , +.Nm magic_getparam , .Nm magic_version .Nd Magic number recognition library .Sh LIBRARY @@ -71,6 +74,12 @@ .Ft int .Fn magic_load "magic_t cookie" "const char *filename" .Ft int +.Fn magic_load_buffers "magic_t cookie" "void **buffers" "size_t *sizes" "size_t nbuffers" +.Ft int +.Fn magic_getparam "magic_t cookie" "int param" "void *value" +.Ft int +.Fn magic_setparam "magic_t cookie" "int param" "const void *value" +.Ft int .Fn magic_version "void" .Sh DESCRIPTION These functions @@ -253,6 +262,55 @@ adds to the database filename as appropriate. .Pp The +.Fn magic_load_buffers +function takes an array of size +.Fa nbuffers +of +.Fa buffers +with a respective size for each in the array of +.Fa sizes +loaded with the contents of the magic databases from the filesystem. +This function can be used in environment where the magic library does +not have direct access to the filesystem, but can access the magic +database via shared memory or other IPC means. +.Pp +The +.Fn magic_getparam +and +.Fn magic_setparam +allow getting and setting various limits related to the the magic +library. +.Bl -column "MAGIC_PARAM_ELF_PHNUM_MAX" "size_t" "Default" -offset indent +.It Sy "Parameter" Ta Sy "Type" Ta Sy "Default" +.It Li MAGIC_PARAM_INDIR_MAX Ta size_t Ta 15 +.It Li MAGIC_PARAM_NAME_MAX Ta size_t Ta 30 +.It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128 +.It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768 +.El +.Pp +The +.Dv MAGIC_PARAM_INDIR_RECURSION +parameter controls how many levels of recursion will be followed for +indirect magic entries. +.Pp +The +.Dv MAGIC_PARAM_NAME_RECURSION +parameter controls how many levels of recursion will be followed for +for name/use calls. +.Pp +The +.Dv MAGIC_PARAM_NAME_MAX +parameter controls the maximum number of calls for name/use. +.Pp +The +.Dv MAGIC_PARAM_PHNUM_MAX +parameter controls how many elf program sections will be processed. +.Pp +The +.Dv MAGIC_PARAM_SHNUM_MAX +parameter controls how many elf sections will be processed. +.Pp +The .Fn magic_version command returns the version number of this library which is compiled into the shared library using the constant Modified: stable/10/contrib/file/magic/Localstuff ============================================================================== --- stable/10/contrib/file/magic/Localstuff Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/magic/Localstuff Tue Dec 30 19:39:31 2014 (r276415) @@ -2,6 +2,6 @@ #------------------------------------------------------------------------------ # Localstuff: file(1) magic for locally observed files # -# $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $ +# $File: Localstuff,v 1.5 2007/01/12 17:38:27 christos Exp $ # Add any locally observed files here. Remember: # text if readable, executable if runnable binary, data if unreadable. Modified: stable/10/contrib/file/magic/Magdir/android ============================================================================== --- stable/10/contrib/file/magic/Magdir/android Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/magic/Magdir/android Tue Dec 30 19:39:31 2014 (r276415) @@ -1,6 +1,6 @@ #------------------------------------------------------------ -# $File: android,v 1.4 2014/06/03 19:01:34 christos Exp $ +# $File: android,v 1.7 2014/11/10 05:08:23 christos Exp $ # Various android related magic entries #------------------------------------------------------------ @@ -15,54 +15,11 @@ >0 regex dey\n[0-9]{2}\0 Dalvik dex file (optimized for host) >4 string >000 version %s -# http://android.stackexchange.com/questions/23357/\ -# is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file/\ -# 23608#23608 -0 string ANDROID\040BACKUP\n Android Backup ->15 string 1\n \b, version 1 ->17 string 0\n \b, uncompressed ->17 string 1\n \b, compressed ->19 string none\n \b, unencrypted ->19 string AES-256\n \b, encrypted AES-256 - -# Android bootimg format -# From https://android.googlesource.com/\ -# platform/system/core/+/master/mkbootimg/bootimg.h -0 string ANDROID! Android bootimg ->8 lelong >0 \b, kernel ->>12 lelong >0 \b (0x%x) ->16 lelong >0 \b, ramdisk ->>20 lelong >0 \b (0x%x) ->24 lelong >0 \b, second stage ->>28 lelong >0 \b (0x%x) ->36 lelong >0 \b, page size: %d ->38 string >0 \b, name: %s ->64 string >0 \b, cmdline (%s) -# Dalvik .dex format. http://retrodev.com/android/dexformat.html -# From "Mike Fleming" -# Fixed to avoid regexec 17 errors on some dex files -# From "Tim Strazzere" -0 string dex\n ->0 regex dex\n[0-9]{2}\0 Dalvik dex file ->4 string >000 version %s -0 string dey\n ->0 regex dey\n[0-9]{2}\0 Dalvik dex file (optimized for host) ->4 string >000 version %s - -# http://android.stackexchange.com/questions/23357/\ -# is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file/\ -# 23608#23608 -0 string ANDROID\040BACKUP\n Android Backup ->15 string 1\n \b, version 1 ->17 string 0\n \b, uncompressed ->17 string 1\n \b, compressed ->19 string none\n \b, unencrypted ->19 string AES-256\n \b, encrypted AES-256 - # Android bootimg format # From https://android.googlesource.com/\ # platform/system/core/+/master/mkbootimg/bootimg.h 0 string ANDROID! Android bootimg +>1024 string LOKI\01 \b, LOKI'd >8 lelong >0 \b, kernel >>12 lelong >0 \b (0x%x) >16 lelong >0 \b, ramdisk @@ -98,3 +55,85 @@ #>>>>>&1 regex/1l .* \b, PBKDF2 rounds: %s #>>>>>>&1 regex/1l .* \b, IV: %s #>>>>>>>&1 regex/1l .* \b, Key: %s + +# *.pit files by Joerg Jenderek +# http://forum.xda-developers.com/showthread.php?p=9122369 +# http://forum.xda-developers.com/showthread.php?t=816449 +# Partition Information Table for Samsung's smartphone with Android +# used by flash software Odin +0 ulelong 0x12349876 +# 1st pit entry marker +>0x01C ulequad&0xFFFFFFFCFFFFFFFC =0x0000000000000000 +# minimal 13 and maximal 18 PIT entries found +>>4 ulelong <128 Partition Information Table for Samsung smartphone +>>>4 ulelong x \b, %d entries +# 1. pit entry +>>>4 ulelong >0 \b; #1 +>>>0x01C use PIT-entry +>>>4 ulelong >1 \b; #2 +>>>0x0A0 use PIT-entry +>>>4 ulelong >2 \b; #3 +>>>0x124 use PIT-entry +>>>4 ulelong >3 \b; #4 +>>>0x1A8 use PIT-entry +>>>4 ulelong >4 \b; #5 +>>>0x22C use PIT-entry +>>>4 ulelong >5 \b; #6 +>>>0x2B0 use PIT-entry +>>>4 ulelong >6 \b; #7 +>>>0x334 use PIT-entry +>>>4 ulelong >7 \b; #8 +>>>0x3B8 use PIT-entry +>>>4 ulelong >8 \b; #9 +>>>0x43C use PIT-entry +>>>4 ulelong >9 \b; #10 +>>>0x4C0 use PIT-entry +>>>4 ulelong >10 \b; #11 +>>>0x544 use PIT-entry +>>>4 ulelong >11 \b; #12 +>>>0x5C8 use PIT-entry +>>>4 ulelong >12 \b; #13 +>>>>0x64C use PIT-entry +# 14. pit entry +>>>4 ulelong >13 \b; #14 +>>>>0x6D0 use PIT-entry +>>>4 ulelong >14 \b; #15 +>>>0x754 use PIT-entry +>>>4 ulelong >15 \b; #16 +>>>0x7D8 use PIT-entry +>>>4 ulelong >16 \b; #17 +>>>0x85C use PIT-entry +# 18. pit entry +>>>4 ulelong >17 \b; #18 +>>>0x8E0 use PIT-entry + +0 name PIT-entry +# garbage value implies end of pit entries +>0x00 ulequad&0xFFFFFFFCFFFFFFFC =0x0000000000000000 +# skip empty partition name +>>0x24 ubyte !0 +# partition name +>>>0x24 string >\0 %-.32s +# flags +>>>0x0C ulelong&0x00000002 2 \b+RW +# partition ID: +# 0~IPL,MOVINAND,GANG;1~PIT,GPT;2~HIDDEN;3~SBL,HIDDEN;4~SBL2,HIDDEN;5~BOOT;6~KENREl,RECOVER,misc;7~RECOVER +# ;11~MODEM;20~efs;21~PARAM;22~FACTORY,SYSTEM;23~DBDATAFS,USERDATA;24~CACHE;80~BOOTLOADER;81~TZSW +>>>0x08 ulelong x (0x%x) +# filename +>>>0x44 string >\0 "%-.64s" +#>>>0x18 ulelong >0 +# blocksize in 512 byte units ? +#>>>>0x18 ulelong x \b, %db +# partition size in blocks ? +#>>>>0x22 ulelong x \b*%d + +# Android bootimg format +# From https://android.googlesource.com/\ +# platform/system/core/+/master/libsparse/sparse_format.h +0 lelong 0xed26ff3a Android sparse image +>4 leshort x \b, version: %d +>6 leshort x \b.%d +>16 lelong x \b, Total of %d +>12 lelong x \b %d-byte output blocks in +>20 lelong x \b %d input chunks. Modified: stable/10/contrib/file/magic/Magdir/animation ============================================================================== --- stable/10/contrib/file/magic/Magdir/animation Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/magic/Magdir/animation Tue Dec 30 19:39:31 2014 (r276415) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: animation,v 1.53 2014/04/30 21:41:02 christos Exp $ +# $File: animation,v 1.56 2014/10/23 23:12:51 christos Exp $ # animation: file(1) magic for animation/movie formats # # animation formats @@ -32,43 +32,155 @@ !:mime application/x-quicktime-player 4 string/W jP JPEG 2000 image !:mime image/jp2 +# http://www.ftyps.com/ with local additions 4 string ftyp ISO Media ->8 string isom \b, MPEG v4 system, version 1 -!:mime video/mp4 ->8 string iso2 \b, MPEG v4 system, part 12 revision ->8 string mp41 \b, MPEG v4 system, version 1 -!:mime video/mp4 ->8 string mp42 \b, MPEG v4 system, version 2 -!:mime video/mp4 ->8 string mp7t \b, MPEG v4 system, MPEG v7 XML ->8 string mp7b \b, MPEG v4 system, MPEG v7 binary XML ->8 string/W jp2 \b, JPEG 2000 -!:mime image/jp2 +>8 string 3g2 \b, MPEG v4 system, 3GPP2 +!:mime video/3gpp2 +>>11 byte 4 \b v4 (H.263/AMR GSM 6.10) +>>11 byte 5 \b v5 (H.263/AMR GSM 6.10) +>>11 byte 6 \b v6 (ITU H.264/AMR GSM 6.10) +>>11 byte a \b C.S0050-0 V1.0 +>>11 byte b \b C.S0050-0-A V1.0.0 +>>11 byte c \b C.S0050-0-B V1.0 >8 string 3ge \b, MPEG v4 system, 3GPP !:mime video/3gpp +>>11 byte 6 \b, Release 6 MBMS Extended Presentations +>>11 byte 7 \b, Release 7 MBMS Extended Presentations >8 string 3gg \b, MPEG v4 system, 3GPP +>11 byte 6 \b, Release 6 General Profile !:mime video/3gpp >8 string 3gp \b, MPEG v4 system, 3GPP +>11 byte 1 \b, Release %d (non existent) +>11 byte 2 \b, Release %d (non existent) +>11 byte 3 \b, Release %d (non existent) +>11 byte 4 \b, Release %d +>11 byte 5 \b, Release %d +>11 byte 6 \b, Release %d +>11 byte 7 \b, Release %d Streaming Servers !:mime video/3gpp >8 string 3gs \b, MPEG v4 system, 3GPP +>11 byte 7 \b, Release %d Streaming Servers !:mime video/3gpp ->8 string 3g2 \b, MPEG v4 system, 3GPP2 +>8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC [ISO 14496-12:2005] +!:mime video/mp4 +>8 string/W qt \b, Apple QuickTime movie +!:mime video/quicktime +>8 string CAEP \b, Canon Digital Camera +>8 string caqv \b, Casio Digital Camera +>8 string CDes \b, Convergent Design +>8 string da0a \b, DMB MAF w/ MPEG Layer II aud, MOT slides, DLS, JPG/PNG/MNG +>8 string da0b \b, DMB MAF, ext DA0A, with 3GPP timed text, DID, TVA, REL, IPMP +>8 string da1a \b, DMB MAF audio with ER-BSAC audio, JPG/PNG/MNG images +>8 string da1b \b, DMB MAF, ext da1a, with 3GPP timed text, DID, TVA, REL, IPMP +>8 string da2a \b, DMB MAF aud w/ HE-AAC v2 aud, MOT slides, DLS, JPG/PNG/MNG +>8 string da2b \b, DMB MAF, ext da2a, with 3GPP timed text, DID, TVA, REL, IPMP +>8 string da3a \b, DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images +>8 string da3b \b, DMB MAF, ext da3a w/ BIFS, 3GPP, DID, TVA, REL, IPMP +>8 string dmb1 \b, DMB MAF supporting all the components defined in the spec +>8 string dmpf \b, Digital Media Project +>8 string drc1 \b, Dirac (wavelet compression), encap in ISO base media (MP4) +>8 string dv1a \b, DMB MAF vid w/ AVC vid, ER-BSAC aud, BIFS, JPG/PNG/MNG, TS +>8 string dv1b \b, DMB MAF, ext dv1a, with 3GPP timed text, DID, TVA, REL, IPMP +>8 string dv2a \b, DMB MAF vid w/ AVC vid, HE-AAC v2 aud, BIFS, JPG/PNG/MNG, TS +>8 string dv2b \b, DMB MAF, ext dv2a, with 3GPP timed text, DID, TVA, REL, IPMP +>8 string dv3a \b, DMB MAF vid w/ AVC vid, HE-AAC aud, BIFS, JPG/PNG/MNG, TS +>8 string dv3b \b, DMB MAF, ext dv3a, with 3GPP timed text, DID, TVA, REL, IPMP +>8 string dvr1 \b, DVB (.DVB) over RTP +!:mime video/vnd.dvb.file +>8 string dvt1 \b, DVB (.DVB) over MPEG-2 Transport Stream +!:mime video/vnd.dvb.file +>8 string F4V \b, Video for Adobe Flash Player 9+ (.F4V) +!:mime video/mp4 +>8 string F4P \b, Protected Video for Adobe Flash Player 9+ (.F4P) +!:mime video/mp4 +>8 string F4A \b, Audio for Adobe Flash Player 9+ (.F4A) +!:mime audio/mp4 +>8 string F4B \b, Audio Book for Adobe Flash Player 9+ (.F4B) +!:mime audio/mp4 +>8 string isc2 \b, ISMACryp 2.0 Encrypted File +# ?/enc-isoff-generic +>8 string iso2 \b, MP4 Base Media v2 [ISO 14496-12:2005] +!:mime video/mp4 +>8 string isom \b, MP4 Base Media v1 [IS0 14496-12:2003] +!:mime video/mp4 +>8 string/W jp2 \b, JPEG 2000 +!:mime image/jp2 +>8 string JP2 \b, JPEG 2000 Image (.JP2) [ISO 15444-1 ?] +!:mime image/jp2 +>8 string JP20 \b, Unknown, from GPAC samples (prob non-existent) +>8 string jpm \b, JPEG 2000 Compound Image (.JPM) [ISO 15444-6] +!:mime image/jpm +>8 string jpx \b, JPEG 2000 w/ extensions (.JPX) [ISO 15444-2] +!:mime image/jpx +>8 string KDDI \b, 3GPP2 EZmovie for KDDI 3G cellphones !:mime video/3gpp2 ->>11 byte 4 \b v4 (H.263/AMR GSM 6.10) ->>11 byte 5 \b v5 (H.263/AMR GSM 6.10) ->>11 byte 6 \b v6 (ITU H.264/AMR GSM 6.10) +>8 string M4A \b, Apple iTunes ALAC/AAC-LC (.M4A) Audio +!:mime audio/x-m4a +>8 string M4B \b, Apple iTunes ALAC/AAC-LC (.M4B) Audio Book +!:mime audio/mp4 +>8 string M4P \b, Apple iTunes ALAC/AAC-LC (.M4P) AES Protected Audio +!:mime video/mp4 +>8 string M4V \b, Apple iTunes Video (.M4V) Video +!:mime video/x-m4v +>8 string M4VH \b, Apple TV (.M4V) +!:mime video/x-m4v +>8 string M4VP \b, Apple iPhone (.M4V) +!:mime video/x-m4v +>8 string mj2s \b, Motion JPEG 2000 [ISO 15444-3] Simple Profile +!:mime video/mj2 +>8 string mjp2 \b, Motion JPEG 2000 [ISO 15444-3] General Profile +!:mime video/mj2 +>8 string mmp4 \b, MPEG-4/3GPP Mobile Profile (.MP4 / .3GP) (for NTT) +!:mime video/mp4 +>8 string mobi \b, MPEG-4, MOBI format +!:mime video/mp4 +>8 string mp21 \b, MPEG-21 [ISO/IEC 21000-9] +>8 string mp41 \b, MP4 v1 [ISO 14496-1:ch13] +!:mime video/mp4 +>8 string mp42 \b, MP4 v2 [ISO 14496-14] +!:mime video/mp4 +>8 string mp71 \b, MP4 w/ MPEG-7 Metadata [per ISO 14496-12] +>8 string mp7t \b, MPEG v4 system, MPEG v7 XML +>8 string mp7b \b, MPEG v4 system, MPEG v7 binary XML >8 string mmp4 \b, MPEG v4 system, 3GPP Mobile !:mime video/mp4 ->8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC -!:mime video/3gpp ->8 string/W M4A \b, MPEG v4 system, iTunes AAC-LC +>8 string MPPI \b, Photo Player, MAF [ISO/IEC 23000-3] +>8 string mqt \b, Sony / Mobile QuickTime (.MQV) US Pat 7,477,830 +!:mime video/quicktime +>8 string MSNV \b, MPEG-4 (.MP4) for SonyPSP +!:mime audio/mp4 +>8 string NDAS \b, MP4 v2 [ISO 14496-14] Nero Digital AAC Audio !:mime audio/mp4 ->8 string/W M4V \b, MPEG v4 system, iTunes AVC-LC +>8 string NDSC \b, MPEG-4 (.MP4) Nero Cinema Profile !:mime video/mp4 ->8 string/W M4P \b, MPEG v4 system, iTunes AES encrypted ->8 string/W M4B \b, MPEG v4 system, iTunes bookmarked ->8 string/W qt \b, Apple QuickTime movie +>8 string NDSH \b, MPEG-4 (.MP4) Nero HDTV Profile +!:mime video/mp4 +>8 string NDSM \b, MPEG-4 (.MP4) Nero Mobile Profile +!:mime video/mp4 +>8 string NDSP \b, MPEG-4 (.MP4) Nero Portable Profile +!:mime video/mp4 +>8 string NDSS \b, MPEG-4 (.MP4) Nero Standard Profile +!:mime video/mp4 +>8 string NDXC \b, H.264/MPEG-4 AVC (.MP4) Nero Cinema Profile +!:mime video/mp4 +>8 string NDXH \b, H.264/MPEG-4 AVC (.MP4) Nero HDTV Profile +!:mime video/mp4 +>8 string NDXM \b, H.264/MPEG-4 AVC (.MP4) Nero Mobile Profile +!:mime video/mp4 +>8 string NDXP \b, H.264/MPEG-4 AVC (.MP4) Nero Portable Profile +!:mime video/mp4 +>8 string NDXS \b, H.264/MPEG-4 AVC (.MP4) Nero Standard Profile +!:mime video/mp4 +>8 string odcf \b, OMA DCF DRM Format 2.0 (OMA-TS-DRM-DCF-V2_0-20060303-A) +>8 string opf2 \b, OMA PDCF DRM Format 2.1 (OMA-TS-DRM-DCF-V2_1-20070724-C) +>8 string opx2 \b, OMA PDCF DRM + XBS ext (OMA-TS-DRM_XBS-V1_0-20070529-C) +>8 string pana \b, Panasonic Digital Camera +>8 string qt \b, Apple QuickTime (.MOV/QT) !:mime video/quicktime +>8 string ROSS \b, Ross Video +>8 string sdv \b, SD Memory Card Video +>8 string ssc1 \b, Samsung stereo, single stream (patent pending) +>8 string ssc2 \b, Samsung stereo, dual stream (patent pending) # MPEG sequences # Scans for all common MPEG header start codes Modified: stable/10/contrib/file/magic/Magdir/archive ============================================================================== --- stable/10/contrib/file/magic/Magdir/archive Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/magic/Magdir/archive Tue Dec 30 19:39:31 2014 (r276415) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.87 2014/06/03 19:15:58 christos Exp $ +# $File: archive,v 1.88 2014/08/16 10:42:17 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -954,34 +954,3 @@ >0xE08 search/7776 \x55\xAA >>&-512 indirect x \b; contains -# Symantec GHOST image by Joerg Jenderek at May 2014 -# http://us.norton.com/ghost/ -# http://www.garykessler.net/library/file_sigs.html -0 ubelong&0xFFFFf7f0 0xFEEF0100 Norton GHost image -# *.GHO ->2 ubyte&0x08 0x00 \b, first file -# *.GHS or *.[0-9] with cns program option ->2 ubyte&0x08 0x08 \b, split file -# part of split index interesting for *.ghs ->>4 ubyte x id=0x%x -# compression tag minus one equals numeric compression command line switch z[1-9] ->3 ubyte 0 \b, no compression ->3 ubyte 2 \b, fast compression (Z1) ->3 ubyte 3 \b, medium compression (Z2) ->3 ubyte >3 ->>3 ubyte <11 \b, compression (Z%d-1) ->2 ubyte&0x08 0x00 -# ~ 30 byte password field only for *.gho ->>12 ubequad !0 \b, password protected ->>44 ubyte !1 -# 1~Image All, sector-by-sector only for *.gho ->>>10 ubyte 1 \b, sector copy -# 1~Image Boot track only for *.gho ->>>43 ubyte 1 \b, boot track -# 1~Image Disc only for *.gho implies Image Boot track and sector copy ->>44 ubyte 1 \b, disc sector copy -# optional image description only *.gho ->>0xff string >\0 "%-.254s" -# look for DOS sector end sequence ->0xE08 search/7776 \x55\xAA ->>&-512 indirect x \b; contains Modified: stable/10/contrib/file/magic/Magdir/blender ============================================================================== --- stable/10/contrib/file/magic/Magdir/blender Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/magic/Magdir/blender Tue Dec 30 19:39:31 2014 (r276415) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: blender,v 1.5 2009/09/19 16:28:08 christos Exp $ +# $File: blender,v 1.6 2014/08/30 08:34:17 christos Exp $ # blender: file(1) magic for Blender 3D related files # # Native format rule v1.2. For questions use the developers list @@ -35,5 +35,5 @@ >>>0x44 string =GLOB \b. >>>>0x60 beshort x \b%.4d -# Scripts that run in the embeded Python interpreter +# Scripts that run in the embedded Python interpreter 0 string #!BPY Blender3D BPython script Modified: stable/10/contrib/file/magic/Magdir/commands ============================================================================== --- stable/10/contrib/file/magic/Magdir/commands Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/magic/Magdir/commands Tue Dec 30 19:39:31 2014 (r276415) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: commands,v 1.50 2014/05/30 16:48:44 christos Exp $ +# $File: commands,v 1.51 2014/09/27 00:12:55 christos Exp $ # commands: file(1) magic for various shells and interpreters # #0 string/w : shell archive or script for antique kernel text @@ -56,7 +56,7 @@ !:mime text/x-awk 0 string/wt #!\ /usr/bin/awk awk script text executable !:mime text/x-awk -0 regex/4096 =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text +0 regex/4096 =^\\s{0,100}BEGIN\\s{0,100}[{] awk or perl script text # AT&T Bell Labs' Plan 9 shell 0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable Modified: stable/10/contrib/file/magic/Magdir/compress ============================================================================== --- stable/10/contrib/file/magic/Magdir/compress Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/magic/Magdir/compress Tue Dec 30 19:39:31 2014 (r276415) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: compress,v 1.58 2014/05/07 19:36:59 christos Exp $ +# $File: compress,v 1.62 2014/09/13 14:27:12 christos Exp $ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc. @@ -251,3 +251,13 @@ # http://code.google.com/p/snappy/source/browse/trunk/framing_format.txt 0 string \377\006\0\0sNaPpY snappy framed data !:mime application/x-snappy-framed + +# qpress, http://www.quicklz.com/ +0 string qpress10 qpress compressed data +!:mime application/x-qpress + +# Zlib https://www.ietf.org/rfc/rfc6713.txt +0 beshort%31 =0 +>0 byte&0xf =8 +>>0 byte&0x80 =0 zlib compressed data +!:mime application/zlib Modified: stable/10/contrib/file/magic/Magdir/database ============================================================================== --- stable/10/contrib/file/magic/Magdir/database Tue Dec 30 18:42:53 2014 (r276414) +++ stable/10/contrib/file/magic/Magdir/database Tue Dec 30 19:39:31 2014 (r276415) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: database,v 1.41 2014/06/03 19:17:27 christos Exp $ +# $File: database,v 1.43 2014/10/28 15:47:39 christos Exp $ # database: file(1) magic for various databases # # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk) @@ -9,9 +9,17 @@ # GDBM magic numbers # Will be maintained as part of the GDBM distribution in the future. # -0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian +0 belong 0x13579acd GNU dbm 1.x or ndbm database, big endian, 32-bit !:mime application/x-gdbm -0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian +0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian, old +!:mime application/x-gdbm +0 belong 0x13579acf GNU dbm 1.x or ndbm database, big endian, 64-bit +!:mime application/x-gdbm +0 lelong 0x13579acd GNU dbm 1.x or ndbm database, little endian, 32-bit +!:mime application/x-gdbm +0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian, old +!:mime application/x-gdbm +0 lelong 0x13579acf GNU dbm 1.x or ndbm database, little endian, 64-bit !:mime application/x-gdbm 0 string GDBM GNU dbm 2.x database !:mime application/x-gdbm @@ -202,27 +210,27 @@ # for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL) >>>>>>>24 ubelong&0x0133f7ff >0 # test for reserved NULL byte ->>>>>>>>47 ubyte x +>>>>>>>>47 ubyte 0 # test for valid TAG key format (0x10 or 0) >>>>>>>>>559 ubyte&0xeF 0 # test MM <= 12 ->>>>>>>>>45 ubeshort <0x0C20 ->>>>>>>>>>45 ubyte >0 ->>>>>>>>>>>46 ubyte <32 ->>>>>>>>>>>>46 ubyte >0 +>>>>>>>>>>45 ubeshort <0x0C20 +>>>>>>>>>>>45 ubyte >0 +>>>>>>>>>>>>46 ubyte <32 +>>>>>>>>>>>>>46 ubyte >0 #!:mime application/x-mdx ->>>>>>>>>>>>>0 use xbase-type ->>>>>>>>>>>>>0 ubyte x \b MDX ->>>>>>>>>>>>>1 ubyte x \b, creation-date ->>>>>>>>>>>>>1 use xbase-date ->>>>>>>>>>>>>44 ubyte x \b, update-date ->>>>>>>>>>>>>44 use xbase-date +>>>>>>>>>>>>>>0 use xbase-type +>>>>>>>>>>>>>>0 ubyte x \b MDX +>>>>>>>>>>>>>>1 ubyte x \b, creation-date +>>>>>>>>>>>>>>1 use xbase-date +>>>>>>>>>>>>>>44 ubyte x \b, update-date +>>>>>>>>>>>>>>44 use xbase-date # No.of tags in use (1,2,5,12) ->>>>>>>>>>>>>28 uleshort x \b, %d +>>>>>>>>>>>>>>28 uleshort x \b, %d # No. of entries in tag (0x30) ->>>>>>>>>>>>>25 ubyte x \b/%d tags +>>>>>>>>>>>>>>25 ubyte x \b/%d tags # Length of tag ->>>>>>>>>>>>>26 ubyte x * %d +>>>>>>>>>>>>>>26 ubyte x * %d # 1st tag name_ >>>>>>>>>>>>>548 string x \b, 1st tag "%.11s" # 2nd tag name @@ -337,60 +345,103 @@ # dBASE III >>>>>>16 ubyte 3 # dBASE III DBT ->>>>>>>0 use xbase-memo-print -# dBASE IV DBT , FoxPro FPT or many PNG , ZIP , DBF garbage +>>>>>>>0 use dbase3-memo-print +# dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage >>>>>>16 ubyte 0 -# dBASE IV DBT with DBF name or DBF garbage ->>>>>>>8 ubelong >0x40000000 -# skip DBF and catch dBASE IV DBT with DBF name and with non big index of next free block ->>>>>>>>0 ulelong <0x01010002 ->>>>>>>>>0 use xbase-memo-print ->>>>>>>8 ubelong 0 +# unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT , or garbage PCX DBF +>>>>>>>20 uleshort 0 +# FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage +>>>>>>>>8 ulong =0 +>>>>>>>>>6 ubeshort >0 +# skip emacs.PIF +>>>>>>>>>>4 ushort 0 +>>>>>>>>>>>0 use foxpro-memo-print +# dBASE III DBT , garbage +>>>>>>>>>6 ubeshort 0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 19:51:32 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C568361; Tue, 30 Dec 2014 19:51:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23CBC199E; Tue, 30 Dec 2014 19:51:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBUJpWat020203; Tue, 30 Dec 2014 19:51:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBUJpVjZ020198; Tue, 30 Dec 2014 19:51:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412301951.sBUJpVjZ020198@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 30 Dec 2014 19:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276416 - in stable/9: contrib/file contrib/file/Magdir contrib/file/doc contrib/file/m4 contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/t... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 19:51:32 -0000 Author: delphij Date: Tue Dec 30 19:51:30 2014 New Revision: 276416 URL: https://svnweb.freebsd.org/changeset/base/276416 Log: MFC: file 5.21 Added: stable/9/contrib/file/config.guess - copied unchanged from r267897, head/contrib/file/config.guess stable/9/contrib/file/config.sub - copied unchanged from r267897, head/contrib/file/config.sub stable/9/contrib/file/depcomp - copied unchanged from r267897, head/contrib/file/depcomp stable/9/contrib/file/doc/ - copied from r267897, head/contrib/file/doc/ stable/9/contrib/file/ltmain.sh - copied unchanged from r267897, head/contrib/file/ltmain.sh stable/9/contrib/file/m4/ - copied from r267897, head/contrib/file/m4/ stable/9/contrib/file/magic/ - copied from r267897, head/contrib/file/magic/ stable/9/contrib/file/magic/Magdir/kerberos - copied unchanged from r275698, head/contrib/file/magic/Magdir/kerberos stable/9/contrib/file/magic/Magdir/meteorological - copied unchanged from r275698, head/contrib/file/magic/Magdir/meteorological stable/9/contrib/file/missing - copied, changed from r267897, head/contrib/file/missing stable/9/contrib/file/python/ - copied from r267897, head/contrib/file/python/ stable/9/contrib/file/src/ - copied from r267897, head/contrib/file/src/ stable/9/contrib/file/tests/escapevel.result - copied unchanged from r267897, head/contrib/file/tests/escapevel.result stable/9/contrib/file/tests/escapevel.testfile - copied unchanged from r267897, head/contrib/file/tests/escapevel.testfile stable/9/contrib/file/tests/issue311docx.result - copied unchanged from r267897, head/contrib/file/tests/issue311docx.result stable/9/contrib/file/tests/issue311docx.testfile - copied unchanged from r267897, head/contrib/file/tests/issue311docx.testfile Deleted: stable/9/contrib/file/Header stable/9/contrib/file/Localstuff stable/9/contrib/file/Magdir/ stable/9/contrib/file/Makefile.am-src stable/9/contrib/file/apprentice.c stable/9/contrib/file/apptype.c stable/9/contrib/file/ascmagic.c stable/9/contrib/file/asprintf.c stable/9/contrib/file/cdf.c stable/9/contrib/file/cdf.h stable/9/contrib/file/cdf_time.c stable/9/contrib/file/compress.c stable/9/contrib/file/elfclass.h stable/9/contrib/file/encoding.c stable/9/contrib/file/file.c stable/9/contrib/file/file.h stable/9/contrib/file/file.man stable/9/contrib/file/file_opts.h stable/9/contrib/file/fsmagic.c stable/9/contrib/file/funcs.c stable/9/contrib/file/getline.c stable/9/contrib/file/getopt_long.c stable/9/contrib/file/is_tar.c stable/9/contrib/file/libmagic.man stable/9/contrib/file/magic.c stable/9/contrib/file/magic.h stable/9/contrib/file/magic.man stable/9/contrib/file/magic/Magdir/rinex stable/9/contrib/file/magic2mime stable/9/contrib/file/mygetopt.h stable/9/contrib/file/names.h stable/9/contrib/file/print.c stable/9/contrib/file/readcdf.c stable/9/contrib/file/readelf.c stable/9/contrib/file/readelf.h stable/9/contrib/file/softmagic.c stable/9/contrib/file/strlcat.c stable/9/contrib/file/strlcpy.c stable/9/contrib/file/tar.h stable/9/contrib/file/tests/gedcom.magic stable/9/contrib/file/vasprintf.c Modified: stable/9/contrib/file/ChangeLog stable/9/contrib/file/Makefile.am stable/9/contrib/file/Makefile.in stable/9/contrib/file/README stable/9/contrib/file/TODO stable/9/contrib/file/aclocal.m4 stable/9/contrib/file/compile stable/9/contrib/file/config.h.in stable/9/contrib/file/configure stable/9/contrib/file/configure.ac stable/9/contrib/file/doc/Makefile.in stable/9/contrib/file/doc/file.man stable/9/contrib/file/doc/libmagic.man stable/9/contrib/file/install-sh stable/9/contrib/file/magic/Localstuff stable/9/contrib/file/magic/Magdir/android stable/9/contrib/file/magic/Magdir/animation stable/9/contrib/file/magic/Magdir/archive stable/9/contrib/file/magic/Magdir/blender stable/9/contrib/file/magic/Magdir/commands stable/9/contrib/file/magic/Magdir/compress stable/9/contrib/file/magic/Magdir/database stable/9/contrib/file/magic/Magdir/elf stable/9/contrib/file/magic/Magdir/filesystems stable/9/contrib/file/magic/Magdir/images stable/9/contrib/file/magic/Magdir/jpeg stable/9/contrib/file/magic/Magdir/linux stable/9/contrib/file/magic/Magdir/macintosh stable/9/contrib/file/magic/Magdir/msooxml stable/9/contrib/file/magic/Magdir/netbsd stable/9/contrib/file/magic/Magdir/pascal stable/9/contrib/file/magic/Magdir/pgp stable/9/contrib/file/magic/Magdir/python stable/9/contrib/file/magic/Magdir/riff stable/9/contrib/file/magic/Magdir/sequent stable/9/contrib/file/magic/Magdir/sereal stable/9/contrib/file/magic/Magdir/ssh stable/9/contrib/file/magic/Magdir/vms stable/9/contrib/file/magic/Magdir/vorbis stable/9/contrib/file/magic/Magdir/windows stable/9/contrib/file/magic/Makefile.am stable/9/contrib/file/magic/Makefile.in stable/9/contrib/file/python/Makefile.in stable/9/contrib/file/src/Makefile.in stable/9/contrib/file/src/apprentice.c stable/9/contrib/file/src/ascmagic.c stable/9/contrib/file/src/cdf.c stable/9/contrib/file/src/cdf.h stable/9/contrib/file/src/compress.c stable/9/contrib/file/src/elfclass.h stable/9/contrib/file/src/encoding.c stable/9/contrib/file/src/file.c stable/9/contrib/file/src/file.h stable/9/contrib/file/src/file_opts.h stable/9/contrib/file/src/fsmagic.c stable/9/contrib/file/src/funcs.c stable/9/contrib/file/src/getline.c stable/9/contrib/file/src/magic.c stable/9/contrib/file/src/magic.h stable/9/contrib/file/src/magic.h.in stable/9/contrib/file/src/pread.c stable/9/contrib/file/src/readcdf.c stable/9/contrib/file/src/readelf.c stable/9/contrib/file/src/softmagic.c stable/9/contrib/file/src/vasprintf.c stable/9/contrib/file/tests/Makefile.am stable/9/contrib/file/tests/Makefile.in stable/9/contrib/file/tests/README stable/9/contrib/file/tests/gedcom.result stable/9/lib/libmagic/Makefile stable/9/lib/libmagic/config.h Directory Properties: stable/9/contrib/file/ (props changed) stable/9/lib/libmagic/ (props changed) Modified: stable/9/contrib/file/ChangeLog ============================================================================== --- stable/9/contrib/file/ChangeLog Tue Dec 30 19:39:31 2014 (r276415) +++ stable/9/contrib/file/ChangeLog Tue Dec 30 19:51:30 2014 (r276416) @@ -1,3 +1,311 @@ +2014-12-10 20:01 Christos Zoulas + + * release 5.21 + +2014-11-27 18:40 Christos Zoulas + + * Allow setting more parameters from the command line. + * Split name/use and indirect magic recursion limits. + +2014-11-27 11:12 Christos Zoulas + + * Adjust ELF parameters and the default recursion + level. + * Allow setting the recursion level dynamically. + +2014-11-24 8:55 Christos Zoulas + + * The following fixes resulted from Thomas Jarosch's fuzzing + tests that revealed severe performance issues on pathological + input: + - limit number of elf program and sections processing + - abort elf note processing quickly + - reduce the number of recursion levels from 20 to 10 + - preserve error messages in indirect magic handling + +2014-11-12 10:30 Christos Zoulas + + * fix bogus free in the user buffer case. + +2014-11-11 12:35 Christos Zoulas + + * fix out of bounds read for pascal strings + * fix memory leak (not freeing the head of each mlist) + +2014-11-07 10:25 Christos Zoulas + + * When printing strings from a file, convert them to printable + on a byte by byte basis, so that we don't get issues with + locale's trying to interpret random byte streams as UTF-8 and + having printf error out with EILSEQ. + +2014-10-17 11:48 Christos Zoulas + + * fix bounds in note reading (Francisco Alonso / Red Hat) + +2014-10-11 15:02 Christos Zoulas + + * fix autoconf glue for setlocale and locale_t; some OS's + have locale_t in xlocale.h + +2014-10-10 15:01 Christos Zoulas + + * release 5.20 + +2014-08-17 10:01 Christos Zoulas + + * recognize encrypted CDF documents + +2014-08-04 9:18 Christos Zoulas + + * add magic_load_buffers from Brooks Davis + +2014-07-24 16:40 Christos Zoulas + + * add thumbs.db support + +2014-06-12 12:28 Christos Zoulas + + * release 5.19 + +2014-06-09 9:04 Christos Zoulas + + * Misc buffer overruns and missing buffer size tests in cdf parsing + (Francisco Alonso, Jan Kaluza) + +2014-06-02 14:50 Christos Zoulas + + * Enforce limit of 8K on regex searches that have no limits + * Allow the l modifier for regex to mean line count. Default + to byte count. If line count is specified, assume a max + of 80 characters per line to limit the byte count. + * Don't allow conversions to be used for dates, allowing + the mask field to be used as an offset. + +2014-05-30 12:51 Christos Zoulas + + * Make the range operator limit the length of the + regex search. + +2014-05-14 19:23 Christos Zoulas + + * PR/347: Windows fixes + * PR/352: Hangul word processor recognition + * PR/354: Encoding irregularities in text files + +2014-05-06 6:12 Christos Zoulas + + * Fix uninitialized title in CDF files (Jan Kaluza) + +2014-05-04 14:55 Christos Zoulas + + * PR/351: Fix compilation of empty files + +2014-04-30 17:39 Christos Zoulas + + * Fix integer formats: We don't specify 'l' or + 'h' and 'hh' specifiers anymore, only 'll' for + quads and nothing for the rest. This is so that + magic writing is simpler. + +2014-04-01 15:25 Christos Zoulas + + * PR/341: Jan Kaluza, fix memory leak + * PR/342: Jan Kaluza, fix out of bounds read + +2014-03-28 15:25 Christos Zoulas + + * Fix issue with long formats not matching fmtcheck + +2014-03-26 11:25 Christos Zoulas + + * release 5.18 + +2014-03-15 17:45 Christos Zoulas + + * add fmtcheck(3) for those who don't have it + +2014-03-14 15:12 Christos Zoulas + + * prevent mime entries from being attached to magic + entries with no descriptions + + * adjust magic strength for regex type + + * remove superfluous ascmagic with encoding test + +2014-03-06 12:01 Christos Zoulas + + * fix regression fix echo -ne "\012\013\014" | file -i - + which printed "binary" instead of "application/octet-stream" + + * add size_t overflow check for magic file size + +2014-02-27 16:01 Christos Zoulas + + * experimental support for matching with CFD CLSID + +2014-02-18 13:04 Kimmo Suominen (kimmo@suominen.com) + + * Cache old LC_CTYPE locale before setting it to "C", so + we can use it to restore LC_CTYPE instead of asking + setlocale() to scan the environment variables. + +2014-02-12 18:21 Christos Zoulas + + * Count recursion levels through indirect magic + +2014-02-11 10:40 Christos Zoulas + + * Prevent infinite recursion on files with indirect offsets of 0 + +2014-01-30 21:00 Christos Zoulas + + * Add -E flag that makes file print filesystem errors to stderr + and exit. + +2014-01-08 17:20 Christos Zoulas + + * mime printing could print results from multiple magic entries + if there were multiple matches. + * in some cases overflow was not detected when computing offsets + in softmagic. + +2013-12-05 12:00 Christos Zoulas + + * use strcasestr() to for cdf strings + * reset to the "C" locale while doing regex operations, or case + insensitive comparisons; this is provisional + +2013-11-19 20:10 Christos Zoulas + + * always leave magic file loaded, don't unload for magic_check, etc. + * fix default encoding to binary instead of unknown which broke recently + * handle empty and one byte files, less specially so that + --mime-encoding does not break completely. + ` +2013-11-06 14:40 Christos Zoulas + + * fix erroneous non-zero exit code from non-existant file and message + +2013-10-29 14:25 Christos Zoulas + + * add CDF MSI file detection (Guy Helmer) + +2013-09-03 11:56 Christos Zoulas + + * Don't mix errors and regular output if there was an error + * in magic_descriptor() don't close the file and try to restore + its position + +2013-05-30 17:25 Christos Zoulas + + * Don't treat magic as an error if offset was past EOF (Christoph Biedl) + +2013-05-28 17:25 Christos Zoulas + + * Fix spacing issues in softmagic and elf (Jan Kaluza) + +2013-05-02 18:00 Christos Zoulas + + * Fix segmentation fault with multiple magic_load commands. + +2013-04-22 11:20 Christos Zoulas + + * The way "default" was implemented was not very useful + because the "if something was printed at that level" + was not easily controlled by the user, and the format + was bound to a string which is too restrictive. Add + a "clear" for that level keyword and make "default" + void. This way one can do: + + >>13 clear x + >>13 lelong 1 foo + >>13 lelong 2 bar + >>13 default x + >>>13 lelong x unknown %x + +2013-03-25 13:20 Christos Zoulas + + * disallow strength setting in "name" entries + +2013-03-06 21:24 Christos Zoulas + + * fix recursive magic separator printing + +2013-02-26 19:28 Christos Zoulas + + * limit recursion level for mget + * fix pread() related breakage in cdf + * handle offsets properly in recursive "use" + +2013-02-18 10:39 Christos Zoulas + + * add elf reading of debug info to determine if file is stripped + (Jan Kaluza) + * use pread() + +2013-01-25 18:05 Christos Zoulas + + * change mime description size from 64 to 80 to accommodate OOXML. + +2013-01-11 14:50 Christos Zoulas + + * Warn about inconsistent continuation levels. + * Change fsmagic to add a space after it prints. + +2013-01-10 21:00 Christos Zoulas + + * Make getline public so that file can link against it. + Perhaps it is better to rename it, or hide it differently. + Fixes builds on platforms that do not provide it. + +2013-01-07 16:30 Christos Zoulas + + * Add SuS d{,1,2,4,8}, u{,1,2,4,8} and document + what long, int, short, etc is (Guy Harris) + +2013-01-06 11:20 Christos Zoulas + + * add magic_version function and constant + * Redo memory allocation and de-allocation. + (prevents double frees on non mmap platforms) + * Fix bug with name/use having to do with passing + found state from the parent to the child and back. + +2012-12-19 8:47 Christos Zoulas + + * Only print elf capabilities for archs we know (Jan Kaluza) + +2012-10-30 19:14 Christos Zoulas + + * Add "name" and "use" file types in order to look + inside mach-o files. + +2012-09-06 10:40 Christos Zoulas + + * make --version exit 0 (Matthew Schultz) + * add string/T (Jan Kaluza) + +2012-08-09 2:15 Christos Zoulas + + * add z and t modifiers for our own vasprintf + * search for $HOME/.magic.mgc if it is there first + * fix reads from a pipe, and preserve errno + +2012-05-15 13:12 Christos Zoulas + + * use ctime_r, asctime_r + +2012-04-06 17:18 Christos Zoulas + + * Fixes for indirect offsets to handle apple disk formats + +2012-04-03 18:26 Christos Zoulas + + * Add windows date field types + * More info for windows shortcuts (incomplete) + 2012-02-20 17:33 Christos Zoulas * Fix CDF parsing issues found by CERT's fuzzing tool (Will Dormann) @@ -851,7 +1159,7 @@ * Identify gnu tar vs. posix tar - * When keep going, don't print spurious newlines (Radek Vokál) + * When keep going, don't print spurious newlines (Radek Vokal) 2006-04-01 12:02 Christos Zoulas @@ -875,7 +1183,7 @@ 2005-10-31 8:54 Christos Zoulas * Fix regression where the core info was not completely processed - (Radek Vokál) + (Radek Vokal) 2005-10-20 11:15 Christos Zoulas @@ -892,7 +1200,7 @@ 2005-09-20 13:33 Christos Zoulas * Don't print SVR4 Style in core files multiple times - (Radek Vokál) + (Radek Vokal) 2005-08-27 04:09 Christos Zoulas Modified: stable/9/contrib/file/Makefile.am ============================================================================== --- stable/9/contrib/file/Makefile.am Tue Dec 30 19:39:31 2014 (r276415) +++ stable/9/contrib/file/Makefile.am Tue Dec 30 19:51:30 2014 (r276416) @@ -1,280 +1,5 @@ -# -# $File: Makefile.am,v 1.78 2012/01/27 01:41:26 christos Exp $ -# -MAGIC_FRAGMENT_BASE = Magdir -MAGIC_DIR = $(top_srcdir)/magic -MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) +ACLOCAL_AMFLAGS = -I m4 -pkgdata_DATA = magic.mgc +EXTRA_DIST = MAINT -EXTRA_DIST = \ -$(MAGIC_DIR)/Header \ -$(MAGIC_DIR)/Localstuff \ -$(MAGIC_FRAGMENT_DIR)/acorn \ -$(MAGIC_FRAGMENT_DIR)/adi \ -$(MAGIC_FRAGMENT_DIR)/adventure \ -$(MAGIC_FRAGMENT_DIR)/allegro \ -$(MAGIC_FRAGMENT_DIR)/alliant \ -$(MAGIC_FRAGMENT_DIR)/amanda \ -$(MAGIC_FRAGMENT_DIR)/amigaos \ -$(MAGIC_FRAGMENT_DIR)/animation \ -$(MAGIC_FRAGMENT_DIR)/apl \ -$(MAGIC_FRAGMENT_DIR)/apple \ -$(MAGIC_FRAGMENT_DIR)/applix \ -$(MAGIC_FRAGMENT_DIR)/archive \ -$(MAGIC_FRAGMENT_DIR)/assembler \ -$(MAGIC_FRAGMENT_DIR)/asterix \ -$(MAGIC_FRAGMENT_DIR)/att3b \ -$(MAGIC_FRAGMENT_DIR)/audio \ -$(MAGIC_FRAGMENT_DIR)/basis \ -$(MAGIC_FRAGMENT_DIR)/bflt \ -$(MAGIC_FRAGMENT_DIR)/blcr \ -$(MAGIC_FRAGMENT_DIR)/blender \ -$(MAGIC_FRAGMENT_DIR)/blit \ -$(MAGIC_FRAGMENT_DIR)/bout \ -$(MAGIC_FRAGMENT_DIR)/bsdi \ -$(MAGIC_FRAGMENT_DIR)/bsi \ -$(MAGIC_FRAGMENT_DIR)/btsnoop \ -$(MAGIC_FRAGMENT_DIR)/c-lang \ -$(MAGIC_FRAGMENT_DIR)/c64 \ -$(MAGIC_FRAGMENT_DIR)/cad \ -$(MAGIC_FRAGMENT_DIR)/cafebabe \ -$(MAGIC_FRAGMENT_DIR)/cddb \ -$(MAGIC_FRAGMENT_DIR)/chord \ -$(MAGIC_FRAGMENT_DIR)/cisco \ -$(MAGIC_FRAGMENT_DIR)/citrus \ -$(MAGIC_FRAGMENT_DIR)/clarion \ -$(MAGIC_FRAGMENT_DIR)/claris \ -$(MAGIC_FRAGMENT_DIR)/clipper \ -$(MAGIC_FRAGMENT_DIR)/commands \ -$(MAGIC_FRAGMENT_DIR)/communications \ -$(MAGIC_FRAGMENT_DIR)/compress \ -$(MAGIC_FRAGMENT_DIR)/console \ -$(MAGIC_FRAGMENT_DIR)/convex \ -$(MAGIC_FRAGMENT_DIR)/cracklib \ -$(MAGIC_FRAGMENT_DIR)/ctags \ -$(MAGIC_FRAGMENT_DIR)/cups \ -$(MAGIC_FRAGMENT_DIR)/dact \ -$(MAGIC_FRAGMENT_DIR)/database \ -$(MAGIC_FRAGMENT_DIR)/diamond \ -$(MAGIC_FRAGMENT_DIR)/diff \ -$(MAGIC_FRAGMENT_DIR)/digital \ -$(MAGIC_FRAGMENT_DIR)/dolby \ -$(MAGIC_FRAGMENT_DIR)/dump \ -$(MAGIC_FRAGMENT_DIR)/dyadic \ -$(MAGIC_FRAGMENT_DIR)/ebml \ -$(MAGIC_FRAGMENT_DIR)/editors \ -$(MAGIC_FRAGMENT_DIR)/efi \ -$(MAGIC_FRAGMENT_DIR)/elf \ -$(MAGIC_FRAGMENT_DIR)/encore \ -$(MAGIC_FRAGMENT_DIR)/epoc \ -$(MAGIC_FRAGMENT_DIR)/erlang \ -$(MAGIC_FRAGMENT_DIR)/esri \ -$(MAGIC_FRAGMENT_DIR)/fcs \ -$(MAGIC_FRAGMENT_DIR)/filesystems \ -$(MAGIC_FRAGMENT_DIR)/flash \ -$(MAGIC_FRAGMENT_DIR)/fonts \ -$(MAGIC_FRAGMENT_DIR)/fortran \ -$(MAGIC_FRAGMENT_DIR)/frame \ -$(MAGIC_FRAGMENT_DIR)/freebsd \ -$(MAGIC_FRAGMENT_DIR)/fsav \ -$(MAGIC_FRAGMENT_DIR)/fusecompress \ -$(MAGIC_FRAGMENT_DIR)/games \ -$(MAGIC_FRAGMENT_DIR)/gcc \ -$(MAGIC_FRAGMENT_DIR)/geo \ -$(MAGIC_FRAGMENT_DIR)/geos \ -$(MAGIC_FRAGMENT_DIR)/gimp \ -$(MAGIC_FRAGMENT_DIR)/gnome-keyring \ -$(MAGIC_FRAGMENT_DIR)/gnu \ -$(MAGIC_FRAGMENT_DIR)/gnumeric \ -$(MAGIC_FRAGMENT_DIR)/grace \ -$(MAGIC_FRAGMENT_DIR)/graphviz \ -$(MAGIC_FRAGMENT_DIR)/gringotts \ -$(MAGIC_FRAGMENT_DIR)/guile \ -$(MAGIC_FRAGMENT_DIR)/hitachi-sh \ -$(MAGIC_FRAGMENT_DIR)/hp \ -$(MAGIC_FRAGMENT_DIR)/human68k \ -$(MAGIC_FRAGMENT_DIR)/ibm370 \ -$(MAGIC_FRAGMENT_DIR)/ibm6000 \ -$(MAGIC_FRAGMENT_DIR)/iff \ -$(MAGIC_FRAGMENT_DIR)/images \ -$(MAGIC_FRAGMENT_DIR)/inform \ -$(MAGIC_FRAGMENT_DIR)/intel \ -$(MAGIC_FRAGMENT_DIR)/interleaf \ -$(MAGIC_FRAGMENT_DIR)/island \ -$(MAGIC_FRAGMENT_DIR)/ispell \ -$(MAGIC_FRAGMENT_DIR)/isz \ -$(MAGIC_FRAGMENT_DIR)/java \ -$(MAGIC_FRAGMENT_DIR)/jpeg \ -$(MAGIC_FRAGMENT_DIR)/karma \ -$(MAGIC_FRAGMENT_DIR)/kde \ -$(MAGIC_FRAGMENT_DIR)/kml \ -$(MAGIC_FRAGMENT_DIR)/lecter \ -$(MAGIC_FRAGMENT_DIR)/lex \ -$(MAGIC_FRAGMENT_DIR)/lif \ -$(MAGIC_FRAGMENT_DIR)/linux \ -$(MAGIC_FRAGMENT_DIR)/lisp \ -$(MAGIC_FRAGMENT_DIR)/llvm \ -$(MAGIC_FRAGMENT_DIR)/lua \ -$(MAGIC_FRAGMENT_DIR)/luks \ -$(MAGIC_FRAGMENT_DIR)/m4 \ -$(MAGIC_FRAGMENT_DIR)/mach \ -$(MAGIC_FRAGMENT_DIR)/macintosh \ -$(MAGIC_FRAGMENT_DIR)/magic \ -$(MAGIC_FRAGMENT_DIR)/mail.news \ -$(MAGIC_FRAGMENT_DIR)/make \ -$(MAGIC_FRAGMENT_DIR)/maple \ -$(MAGIC_FRAGMENT_DIR)/marc21 \ -$(MAGIC_FRAGMENT_DIR)/mathcad \ -$(MAGIC_FRAGMENT_DIR)/mathematica \ -$(MAGIC_FRAGMENT_DIR)/matroska \ -$(MAGIC_FRAGMENT_DIR)/mcrypt \ -$(MAGIC_FRAGMENT_DIR)/mercurial \ -$(MAGIC_FRAGMENT_DIR)/metastore \ -$(MAGIC_FRAGMENT_DIR)/mime \ -$(MAGIC_FRAGMENT_DIR)/mips \ -$(MAGIC_FRAGMENT_DIR)/mirage \ -$(MAGIC_FRAGMENT_DIR)/misctools \ -$(MAGIC_FRAGMENT_DIR)/mkid \ -$(MAGIC_FRAGMENT_DIR)/mlssa \ -$(MAGIC_FRAGMENT_DIR)/mmdf \ -$(MAGIC_FRAGMENT_DIR)/modem \ -$(MAGIC_FRAGMENT_DIR)/motorola \ -$(MAGIC_FRAGMENT_DIR)/mozilla \ -$(MAGIC_FRAGMENT_DIR)/msdos \ -$(MAGIC_FRAGMENT_DIR)/msooxml \ -$(MAGIC_FRAGMENT_DIR)/msvc \ -$(MAGIC_FRAGMENT_DIR)/mup \ -$(MAGIC_FRAGMENT_DIR)/music \ -$(MAGIC_FRAGMENT_DIR)/natinst \ -$(MAGIC_FRAGMENT_DIR)/ncr \ -$(MAGIC_FRAGMENT_DIR)/netbsd \ -$(MAGIC_FRAGMENT_DIR)/netscape \ -$(MAGIC_FRAGMENT_DIR)/netware \ -$(MAGIC_FRAGMENT_DIR)/news \ -$(MAGIC_FRAGMENT_DIR)/nitpicker \ -$(MAGIC_FRAGMENT_DIR)/oasis \ -$(MAGIC_FRAGMENT_DIR)/ocaml \ -$(MAGIC_FRAGMENT_DIR)/octave \ -$(MAGIC_FRAGMENT_DIR)/ole2compounddocs \ -$(MAGIC_FRAGMENT_DIR)/olf \ -$(MAGIC_FRAGMENT_DIR)/os2 \ -$(MAGIC_FRAGMENT_DIR)/os400 \ -$(MAGIC_FRAGMENT_DIR)/os9 \ -$(MAGIC_FRAGMENT_DIR)/osf1 \ -$(MAGIC_FRAGMENT_DIR)/palm \ -$(MAGIC_FRAGMENT_DIR)/parix \ -$(MAGIC_FRAGMENT_DIR)/parrot \ -$(MAGIC_FRAGMENT_DIR)/pascal \ -$(MAGIC_FRAGMENT_DIR)/pbm \ -$(MAGIC_FRAGMENT_DIR)/pdf \ -$(MAGIC_FRAGMENT_DIR)/pdp \ -$(MAGIC_FRAGMENT_DIR)/perl \ -$(MAGIC_FRAGMENT_DIR)/pgp \ -$(MAGIC_FRAGMENT_DIR)/pkgadd \ -$(MAGIC_FRAGMENT_DIR)/plan9 \ -$(MAGIC_FRAGMENT_DIR)/plus5 \ -$(MAGIC_FRAGMENT_DIR)/printer \ -$(MAGIC_FRAGMENT_DIR)/project \ -$(MAGIC_FRAGMENT_DIR)/psdbms \ -$(MAGIC_FRAGMENT_DIR)/pulsar \ -$(MAGIC_FRAGMENT_DIR)/pyramid \ -$(MAGIC_FRAGMENT_DIR)/python \ -$(MAGIC_FRAGMENT_DIR)/revision \ -$(MAGIC_FRAGMENT_DIR)/riff \ -$(MAGIC_FRAGMENT_DIR)/rinex \ -$(MAGIC_FRAGMENT_DIR)/rpm \ -$(MAGIC_FRAGMENT_DIR)/rtf \ -$(MAGIC_FRAGMENT_DIR)/ruby \ -$(MAGIC_FRAGMENT_DIR)/sc \ -$(MAGIC_FRAGMENT_DIR)/sccs \ -$(MAGIC_FRAGMENT_DIR)/scientific \ -$(MAGIC_FRAGMENT_DIR)/securitycerts \ -$(MAGIC_FRAGMENT_DIR)/selinux \ -$(MAGIC_FRAGMENT_DIR)/sendmail \ -$(MAGIC_FRAGMENT_DIR)/sequent \ -$(MAGIC_FRAGMENT_DIR)/sgi \ -$(MAGIC_FRAGMENT_DIR)/sgml \ -$(MAGIC_FRAGMENT_DIR)/sharc \ -$(MAGIC_FRAGMENT_DIR)/sinclair \ -$(MAGIC_FRAGMENT_DIR)/sisu \ -$(MAGIC_FRAGMENT_DIR)/sketch \ -$(MAGIC_FRAGMENT_DIR)/smalltalk \ -$(MAGIC_FRAGMENT_DIR)/smile \ -$(MAGIC_FRAGMENT_DIR)/sniffer \ -$(MAGIC_FRAGMENT_DIR)/softquad \ -$(MAGIC_FRAGMENT_DIR)/spec \ -$(MAGIC_FRAGMENT_DIR)/spectrum \ -$(MAGIC_FRAGMENT_DIR)/sql \ -$(MAGIC_FRAGMENT_DIR)/ssh \ -$(MAGIC_FRAGMENT_DIR)/ssl \ -$(MAGIC_FRAGMENT_DIR)/sun \ -$(MAGIC_FRAGMENT_DIR)/sysex \ -$(MAGIC_FRAGMENT_DIR)/tcl \ -$(MAGIC_FRAGMENT_DIR)/teapot \ -$(MAGIC_FRAGMENT_DIR)/terminfo \ -$(MAGIC_FRAGMENT_DIR)/tex \ -$(MAGIC_FRAGMENT_DIR)/tgif \ -$(MAGIC_FRAGMENT_DIR)/ti-8x \ -$(MAGIC_FRAGMENT_DIR)/timezone \ -$(MAGIC_FRAGMENT_DIR)/troff \ -$(MAGIC_FRAGMENT_DIR)/tuxedo \ -$(MAGIC_FRAGMENT_DIR)/typeset \ -$(MAGIC_FRAGMENT_DIR)/unicode \ -$(MAGIC_FRAGMENT_DIR)/unknown \ -$(MAGIC_FRAGMENT_DIR)/uuencode \ -$(MAGIC_FRAGMENT_DIR)/varied.out \ -$(MAGIC_FRAGMENT_DIR)/varied.script \ -$(MAGIC_FRAGMENT_DIR)/vax \ -$(MAGIC_FRAGMENT_DIR)/vicar \ -$(MAGIC_FRAGMENT_DIR)/virtual \ -$(MAGIC_FRAGMENT_DIR)/virtutech \ -$(MAGIC_FRAGMENT_DIR)/visx \ -$(MAGIC_FRAGMENT_DIR)/vms \ -$(MAGIC_FRAGMENT_DIR)/vmware \ -$(MAGIC_FRAGMENT_DIR)/vorbis \ -$(MAGIC_FRAGMENT_DIR)/vxl \ -$(MAGIC_FRAGMENT_DIR)/warc \ -$(MAGIC_FRAGMENT_DIR)/weak \ -$(MAGIC_FRAGMENT_DIR)/windows \ -$(MAGIC_FRAGMENT_DIR)/wireless \ -$(MAGIC_FRAGMENT_DIR)/wordprocessors \ -$(MAGIC_FRAGMENT_DIR)/wsdl \ -$(MAGIC_FRAGMENT_DIR)/xdelta \ -$(MAGIC_FRAGMENT_DIR)/xenix \ -$(MAGIC_FRAGMENT_DIR)/xilinx \ -$(MAGIC_FRAGMENT_DIR)/xo65 \ -$(MAGIC_FRAGMENT_DIR)/xwindows \ -$(MAGIC_FRAGMENT_DIR)/zfs \ -$(MAGIC_FRAGMENT_DIR)/zilog \ -$(MAGIC_FRAGMENT_DIR)/zyxel - -MAGIC = magic.mgc -CLEANFILES = ${MAGIC} $(MAGIC_FRAGMENT_DIR)/Localstuff - -# FIXME: Build file natively as well so that it can be used to compile -# the target's magic file; for now we bail if the local version does not match -if IS_CROSS_COMPILE -FILE_COMPILE = file -FILE_COMPILE_DEP = -else -FILE_COMPILE = $(top_builddir)/src/file -FILE_COMPILE_DEP = $(FILE_COMPILE) -endif - -${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) - @rm -fr magic - @mkdir magic && cp -p $(EXTRA_DIST) magic - @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \ - echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \ - else \ - v=$$(file --version | sed -e s/file-// -e q); \ - if [ "$$v" != "${PACKAGE_VERSION}" ]; then \ - echo "Cannot use the installed version of file ($$v) to"; \ - echo "cross-compile file ${PACKAGE_VERSION}"; \ - echo "Please install file ${PACKAGE_VERSION} locally first"; \ - exit 1; \ - fi; \ - fi) - $(FILE_COMPILE) -C -m magic - @rm -fr magic +SUBDIRS = src magic tests doc python Modified: stable/9/contrib/file/Makefile.in ============================================================================== --- stable/9/contrib/file/Makefile.in Tue Dec 30 19:39:31 2014 (r276415) +++ stable/9/contrib/file/Makefile.in Tue Dec 30 19:51:30 2014 (r276416) @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +13,52 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ @@ -33,8 +76,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -subdir = magic -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \ + README TODO compile config.guess config.sub depcomp install-sh \ + missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -42,42 +89,111 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/l $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(pkgdatadir)" -DATA = $(pkgdata_DATA) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print pkgdatadir = @pkgdatadir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -90,11 +206,13 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -104,6 +222,7 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -118,6 +237,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MINGW = @MINGW@ MKDIR_P = @MKDIR_P@ NM = @NM@ @@ -145,6 +265,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -178,7 +299,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -194,332 +314,181 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ - -# -# $File: Makefile.am,v 1.78 2012/01/27 01:41:26 christos Exp $ -# -MAGIC_FRAGMENT_BASE = Magdir -MAGIC_DIR = $(top_srcdir)/magic -MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) -pkgdata_DATA = magic.mgc -EXTRA_DIST = \ -$(MAGIC_DIR)/Header \ -$(MAGIC_DIR)/Localstuff \ -$(MAGIC_FRAGMENT_DIR)/acorn \ -$(MAGIC_FRAGMENT_DIR)/adi \ -$(MAGIC_FRAGMENT_DIR)/adventure \ -$(MAGIC_FRAGMENT_DIR)/allegro \ -$(MAGIC_FRAGMENT_DIR)/alliant \ -$(MAGIC_FRAGMENT_DIR)/amanda \ -$(MAGIC_FRAGMENT_DIR)/amigaos \ -$(MAGIC_FRAGMENT_DIR)/animation \ -$(MAGIC_FRAGMENT_DIR)/apl \ -$(MAGIC_FRAGMENT_DIR)/apple \ -$(MAGIC_FRAGMENT_DIR)/applix \ -$(MAGIC_FRAGMENT_DIR)/archive \ -$(MAGIC_FRAGMENT_DIR)/assembler \ -$(MAGIC_FRAGMENT_DIR)/asterix \ -$(MAGIC_FRAGMENT_DIR)/att3b \ -$(MAGIC_FRAGMENT_DIR)/audio \ -$(MAGIC_FRAGMENT_DIR)/basis \ -$(MAGIC_FRAGMENT_DIR)/bflt \ -$(MAGIC_FRAGMENT_DIR)/blcr \ -$(MAGIC_FRAGMENT_DIR)/blender \ -$(MAGIC_FRAGMENT_DIR)/blit \ -$(MAGIC_FRAGMENT_DIR)/bout \ -$(MAGIC_FRAGMENT_DIR)/bsdi \ -$(MAGIC_FRAGMENT_DIR)/bsi \ -$(MAGIC_FRAGMENT_DIR)/btsnoop \ -$(MAGIC_FRAGMENT_DIR)/c-lang \ -$(MAGIC_FRAGMENT_DIR)/c64 \ -$(MAGIC_FRAGMENT_DIR)/cad \ -$(MAGIC_FRAGMENT_DIR)/cafebabe \ -$(MAGIC_FRAGMENT_DIR)/cddb \ -$(MAGIC_FRAGMENT_DIR)/chord \ -$(MAGIC_FRAGMENT_DIR)/cisco \ -$(MAGIC_FRAGMENT_DIR)/citrus \ -$(MAGIC_FRAGMENT_DIR)/clarion \ -$(MAGIC_FRAGMENT_DIR)/claris \ -$(MAGIC_FRAGMENT_DIR)/clipper \ -$(MAGIC_FRAGMENT_DIR)/commands \ -$(MAGIC_FRAGMENT_DIR)/communications \ -$(MAGIC_FRAGMENT_DIR)/compress \ -$(MAGIC_FRAGMENT_DIR)/console \ -$(MAGIC_FRAGMENT_DIR)/convex \ -$(MAGIC_FRAGMENT_DIR)/cracklib \ -$(MAGIC_FRAGMENT_DIR)/ctags \ -$(MAGIC_FRAGMENT_DIR)/cups \ -$(MAGIC_FRAGMENT_DIR)/dact \ -$(MAGIC_FRAGMENT_DIR)/database \ -$(MAGIC_FRAGMENT_DIR)/diamond \ -$(MAGIC_FRAGMENT_DIR)/diff \ -$(MAGIC_FRAGMENT_DIR)/digital \ -$(MAGIC_FRAGMENT_DIR)/dolby \ -$(MAGIC_FRAGMENT_DIR)/dump \ -$(MAGIC_FRAGMENT_DIR)/dyadic \ -$(MAGIC_FRAGMENT_DIR)/ebml \ -$(MAGIC_FRAGMENT_DIR)/editors \ -$(MAGIC_FRAGMENT_DIR)/efi \ -$(MAGIC_FRAGMENT_DIR)/elf \ -$(MAGIC_FRAGMENT_DIR)/encore \ -$(MAGIC_FRAGMENT_DIR)/epoc \ -$(MAGIC_FRAGMENT_DIR)/erlang \ -$(MAGIC_FRAGMENT_DIR)/esri \ -$(MAGIC_FRAGMENT_DIR)/fcs \ -$(MAGIC_FRAGMENT_DIR)/filesystems \ -$(MAGIC_FRAGMENT_DIR)/flash \ -$(MAGIC_FRAGMENT_DIR)/fonts \ -$(MAGIC_FRAGMENT_DIR)/fortran \ -$(MAGIC_FRAGMENT_DIR)/frame \ -$(MAGIC_FRAGMENT_DIR)/freebsd \ -$(MAGIC_FRAGMENT_DIR)/fsav \ -$(MAGIC_FRAGMENT_DIR)/fusecompress \ -$(MAGIC_FRAGMENT_DIR)/games \ -$(MAGIC_FRAGMENT_DIR)/gcc \ -$(MAGIC_FRAGMENT_DIR)/geo \ -$(MAGIC_FRAGMENT_DIR)/geos \ -$(MAGIC_FRAGMENT_DIR)/gimp \ -$(MAGIC_FRAGMENT_DIR)/gnome-keyring \ -$(MAGIC_FRAGMENT_DIR)/gnu \ -$(MAGIC_FRAGMENT_DIR)/gnumeric \ -$(MAGIC_FRAGMENT_DIR)/grace \ -$(MAGIC_FRAGMENT_DIR)/graphviz \ -$(MAGIC_FRAGMENT_DIR)/gringotts \ -$(MAGIC_FRAGMENT_DIR)/guile \ -$(MAGIC_FRAGMENT_DIR)/hitachi-sh \ -$(MAGIC_FRAGMENT_DIR)/hp \ -$(MAGIC_FRAGMENT_DIR)/human68k \ -$(MAGIC_FRAGMENT_DIR)/ibm370 \ -$(MAGIC_FRAGMENT_DIR)/ibm6000 \ -$(MAGIC_FRAGMENT_DIR)/iff \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 20:44:07 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3423F96F; Tue, 30 Dec 2014 20:44:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05CE92235; Tue, 30 Dec 2014 20:44:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBUKi6NN048677; Tue, 30 Dec 2014 20:44:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBUKi6vY048674; Tue, 30 Dec 2014 20:44:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412302044.sBUKi6vY048674@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 30 Dec 2014 20:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276422 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 20:44:07 -0000 Author: ngie Date: Tue Dec 30 20:44:05 2014 New Revision: 276422 URL: https://svnweb.freebsd.org/changeset/base/276422 Log: MFC r267276: Ensure files are created during the build when using bsd.subdir.mk. When FILES is defined in a Makefile that _also_ includes bsd.subdir.mk, the build of the files (if any) was not properly triggered during the build stage. This was because bsd.files.mk did not define the buildfiles target if it was already defined... and bsd.subdir.mk defined this target on its own, thus causing a conflict. Fix this by unconditionally defining buildfiles from bsd.files.mk; this is safe because nothing else in the tree needs to redefine this and because the target itself contains no commands: all it does is define dependencies. Also ensure that bsd.files.mk is always pulled in by bsd.test.mk regardless of what bsd.prog.mk does. These fixes allow "make installworld" to run cleanly on a system with read-only src and obj trees. This is "make tinderbox" clean. Reviewed by: imp Obtained from: jilles Modified: stable/10/share/mk/bsd.files.mk stable/10/share/mk/bsd.test.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.files.mk ============================================================================== --- stable/10/share/mk/bsd.files.mk Tue Dec 30 20:23:03 2014 (r276421) +++ stable/10/share/mk/bsd.files.mk Tue Dec 30 20:44:05 2014 (r276422) @@ -4,13 +4,14 @@ .error bsd.files.mk cannot be included directly. .endif +.if !target(____) +____: + FILESGROUPS?= FILES -.if !target(buildfiles) .for group in ${FILESGROUPS} buildfiles: ${${group}} .endfor -.endif all: buildfiles @@ -65,3 +66,5 @@ _${group}INS: ${_${group}FILES} realinstall: installfiles .ORDER: beforeinstall installfiles + +.endif # !target(____) Modified: stable/10/share/mk/bsd.test.mk ============================================================================== --- stable/10/share/mk/bsd.test.mk Tue Dec 30 20:23:03 2014 (r276421) +++ stable/10/share/mk/bsd.test.mk Tue Dec 30 20:44:05 2014 (r276422) @@ -94,8 +94,7 @@ test: aftertest .if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS) .include -.elif !empty(FILES) -.include .endif +.include .include From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 20:46:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75F8FB5F; Tue, 30 Dec 2014 20:46:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47684225D; Tue, 30 Dec 2014 20:46:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBUKk3jg049047; Tue, 30 Dec 2014 20:46:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBUKk2B3049040; Tue, 30 Dec 2014 20:46:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412302046.sBUKk2B3049040@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 30 Dec 2014 20:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276423 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 20:46:03 -0000 Author: ngie Date: Tue Dec 30 20:46:01 2014 New Revision: 276423 URL: https://svnweb.freebsd.org/changeset/base/276423 Log: MFC r274077: As an optimization (in simple, well used cases) only call cat ${.ALLSRC} when generating files from various sources instead of calling cat ${.ALLSRC} | sed The perl case was skipped because it's not being used in the tree at this time Modified: stable/10/share/mk/atf.test.mk stable/10/share/mk/plain.test.mk stable/10/share/mk/tap.test.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/atf.test.mk ============================================================================== --- stable/10/share/mk/atf.test.mk Tue Dec 30 20:44:05 2014 (r276422) +++ stable/10/share/mk/atf.test.mk Tue Dec 30 20:46:01 2014 (r276423) @@ -105,8 +105,12 @@ ATF_TESTS_SH_SED_${_T}?= # empty ATF_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${ATF_TESTS_SH_SRC_${_T}} echo '#! /usr/libexec/atf-sh' > ${.TARGET}.tmp +.if empty(ATF_TESTS_SH_SED_${_T}) + cat ${.ALLSRC:N*Makefile*} >>${.TARGET}.tmp +.else cat ${.ALLSRC:N*Makefile*} \ | sed ${ATF_TESTS_SH_SED_${_T}} >>${.TARGET}.tmp +.endif chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} .endfor Modified: stable/10/share/mk/plain.test.mk ============================================================================== --- stable/10/share/mk/plain.test.mk Tue Dec 30 20:44:05 2014 (r276422) +++ stable/10/share/mk/plain.test.mk Tue Dec 30 20:46:01 2014 (r276423) @@ -57,8 +57,12 @@ CLEANFILES+= ${_T} ${_T}.tmp PLAIN_TESTS_SH_SED_${_T}?= # empty PLAIN_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${PLAIN_TESTS_SH_SRC_${_T}} +.if empty(PLAIN_TESTS_SH_SED_${_T}) + cat ${.ALLSRC:N*Makefile*} >${.TARGET}.tmp +.else cat ${.ALLSRC:N*Makefile*} \ | sed ${PLAIN_TESTS_SH_SED_${_T}} >${.TARGET}.tmp +.endif chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} .endfor Modified: stable/10/share/mk/tap.test.mk ============================================================================== --- stable/10/share/mk/tap.test.mk Tue Dec 30 20:44:05 2014 (r276422) +++ stable/10/share/mk/tap.test.mk Tue Dec 30 20:46:01 2014 (r276423) @@ -86,7 +86,11 @@ CLEANFILES+= ${_T} ${_T}.tmp TAP_TESTS_SH_SED_${_T}?= # empty TAP_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${TAP_TESTS_SH_SRC_${_T}} +.if empty(TAP_TESTS_SH_SED_${_T}) + cat ${.ALLSRC} >${.TARGET}.tmp +.else cat ${.ALLSRC} | sed ${TAP_TESTS_SH_SED_${_T}} >${.TARGET}.tmp +.endif chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} .endfor From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 22:22:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE769519; Tue, 30 Dec 2014 22:22:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7256120C; Tue, 30 Dec 2014 22:22:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBUMMpkm098803; Tue, 30 Dec 2014 22:22:51 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBUMMl35098781; Tue, 30 Dec 2014 22:22:47 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412302222.sBUMMl35098781@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Tue, 30 Dec 2014 22:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276429 - in stable/10: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/amd64/vmm/io sys/modules/linux sys/modules/vmm usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 22:22:52 -0000 Author: neel Date: Tue Dec 30 22:22:46 2014 New Revision: 276429 URL: https://svnweb.freebsd.org/changeset/base/276429 Log: MFC r273683 Move the ACPI PM timer emulation into vmm.ko. MFC r273706 Change the type of the first argument to the I/O emulation handlers to 'struct vm *'. MFC r273710 Add a comment explaining the intent behind the I/O reservation [0x72-0x77]. MFC r273744 Add foo_genassym.c files to DPSRCS so dependencies for them are generated. This ensures these objects are rebuilt to generate an updated header of assembly constants if needed. MFC r274045 If the start bit, PxCMD.ST, is cleared and nothing is in-flight then PxCI, PxSACT, PxCMD.CCS and PxCMD.CR should be 0. MFC r274076 Improve the ability to cancel an in-flight request by using an interrupt, via SIGCONT, to force the read or write system call to return prematurely. MFC r274330 To allow a request to be submitted from within the callback routine of a completing one increase the total by 1 but don't advertise it. MFC r274931 Change the lower bound for guest vmspace allocation to 0 instead of using the VM_MIN_ADDRESS constant. MFC r275817 For level triggered interrupts clear the PIC IRR bit when the interrupt pin is deasserted. MFC r275850 Fix 8259 IRQ priority resolver. MFC r275952 Various 8259 device model improvements. MFC r275965 Emulate writes to the IA32_MISC_ENABLE MSR. Added: stable/10/sys/amd64/vmm/io/vpmtmr.c - copied, changed from r273683, head/sys/amd64/vmm/io/vpmtmr.c stable/10/sys/amd64/vmm/io/vpmtmr.h - copied, changed from r273683, head/sys/amd64/vmm/io/vpmtmr.h Deleted: stable/10/usr.sbin/bhyve/pmtmr.c Modified: stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/vmm/intel/vmx_msr.c stable/10/sys/amd64/vmm/io/vatpic.c stable/10/sys/amd64/vmm/io/vatpic.h stable/10/sys/amd64/vmm/io/vatpit.c stable/10/sys/amd64/vmm/io/vatpit.h stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_ioport.c stable/10/sys/amd64/vmm/vmm_ioport.h stable/10/sys/modules/linux/Makefile stable/10/sys/modules/vmm/Makefile stable/10/usr.sbin/bhyve/Makefile stable/10/usr.sbin/bhyve/block_if.c stable/10/usr.sbin/bhyve/pci_ahci.c stable/10/usr.sbin/bhyve/rtc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/amd64/include/vmm.h Tue Dec 30 22:22:46 2014 (r276429) @@ -285,6 +285,7 @@ int vm_assign_pptdev(struct vm *vm, int int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); struct vatpic *vm_atpic(struct vm *vm); struct vatpit *vm_atpit(struct vm *vm); +struct vpmtmr *vm_pmtmr(struct vm *vm); /* * Inject exception 'vme' into the guest vcpu. This function returns 0 on Modified: stable/10/sys/amd64/vmm/intel/vmx_msr.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_msr.c Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/amd64/vmm/intel/vmx_msr.c Tue Dec 30 22:22:46 2014 (r276429) @@ -376,9 +376,31 @@ vmx_rdmsr(struct vmx *vmx, int vcpuid, u int vmx_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t val, bool *retu) { - int error = 0; - + uint64_t changed; + int error; + + error = 0; switch (num) { + case MSR_IA32_MISC_ENABLE: + changed = val ^ misc_enable; + /* + * If the host has disabled the NX feature then the guest + * also cannot use it. However, a Linux guest will try to + * enable the NX feature by writing to the MISC_ENABLE MSR. + * + * This can be safely ignored because the memory management + * code looks at CPUID.80000001H:EDX.NX to check if the + * functionality is actually enabled. + */ + changed &= ~(1UL << 34); + + /* + * Punt to userspace if any other bits are being modified. + */ + if (changed) + error = EINVAL; + + break; default: error = EINVAL; break; Modified: stable/10/sys/amd64/vmm/io/vatpic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vatpic.c Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/amd64/vmm/io/vatpic.c Tue Dec 30 22:22:46 2014 (r276429) @@ -75,7 +75,7 @@ struct atpic { uint8_t mask; /* Interrupt Mask Register (IMR) */ int acnt[8]; /* sum of pin asserts and deasserts */ - int priority; /* current pin priority */ + int lowprio; /* lowest priority irq */ bool intr_raised; }; @@ -102,16 +102,33 @@ struct vatpic { #define VATPIC_CTR4(vatpic, fmt, a1, a2, a3, a4) \ VM_CTR4((vatpic)->vm, fmt, a1, a2, a3, a4) +/* + * Loop over all the pins in priority order from highest to lowest. + */ +#define ATPIC_PIN_FOREACH(pinvar, atpic, tmpvar) \ + for (tmpvar = 0, pinvar = (atpic->lowprio + 1) & 0x7; \ + tmpvar < 8; \ + tmpvar++, pinvar = (pinvar + 1) & 0x7) + static void vatpic_set_pinstate(struct vatpic *vatpic, int pin, bool newstate); +static __inline bool +master_atpic(struct vatpic *vatpic, struct atpic *atpic) +{ + + if (atpic == &vatpic->atpic[0]) + return (true); + else + return (false); +} + static __inline int vatpic_get_highest_isrpin(struct atpic *atpic) { int bit, pin; int i; - for (i = 0; i <= 7; i++) { - pin = ((i + 7 - atpic->priority) & 0x7); + ATPIC_PIN_FOREACH(pin, atpic, i) { bit = (1 << pin); if (atpic->service & bit) @@ -125,8 +142,7 @@ static __inline int vatpic_get_highest_irrpin(struct atpic *atpic) { int serviced; - int bit, pin; - int i, j; + int bit, pin, tmp; /* * In 'Special Fully-Nested Mode' when an interrupt request from @@ -137,17 +153,21 @@ vatpic_get_highest_irrpin(struct atpic * if (atpic->sfn) serviced &= ~(1 << 2); - for (i = 0; i <= 7; i++) { - pin = ((i + 7 - atpic->priority) & 0x7); - bit = (1 << pin); - if (serviced & bit) + ATPIC_PIN_FOREACH(pin, atpic, tmp) { + bit = 1 << pin; + + /* + * If there is already an interrupt in service at the same + * or higher priority then bail. + */ + if ((serviced & bit) != 0) break; - } - for (j = 0; j < i; j++) { - pin = ((j + 7 - atpic->priority) & 0x7); - bit = (1 << pin); - if (atpic->request & bit && (~atpic->mask & bit)) + /* + * If an interrupt is asserted and not masked then return + * the corresponding 'pin' to the caller. + */ + if ((atpic->request & bit) != 0 && (atpic->mask & bit) == 0) return (pin); } @@ -238,8 +258,9 @@ vatpic_icw1(struct vatpic *vatpic, struc atpic->icw_num = 1; atpic->mask = 0; - atpic->priority = 0; + atpic->lowprio = 7; atpic->rd_cmd_reg = 0; + atpic->poll = 0; if ((val & ICW1_SNGL) != 0) { VATPIC_CTR0(vatpic, "vatpic cascade mode required"); @@ -291,6 +312,15 @@ vatpic_icw4(struct vatpic *vatpic, struc if ((val & ICW4_AEOI) != 0) atpic->aeoi = true; + if ((val & ICW4_SFNM) != 0) { + if (master_atpic(vatpic, atpic)) { + atpic->sfn = true; + } else { + VATPIC_CTR1(vatpic, "Ignoring special fully nested " + "mode on slave atpic: %#x", val); + } + } + atpic->icw_num = 0; atpic->ready = true; @@ -329,11 +359,11 @@ vatpic_ocw2(struct vatpic *vatpic, struc atpic->service &= ~(1 << isr_bit); if (atpic->rotate) - atpic->priority = isr_bit; + atpic->lowprio = isr_bit; } } else if ((val & OCW2_SL) != 0 && atpic->rotate == true) { /* specific priority */ - atpic->priority = val & 0x7; + atpic->lowprio = val & 0x7; } return (0); @@ -344,11 +374,17 @@ vatpic_ocw3(struct vatpic *vatpic, struc { VATPIC_CTR1(vatpic, "atpic ocw3 0x%x", val); - atpic->poll = ((val & OCW3_P) != 0); + if (val & OCW3_ESMM) { + VATPIC_CTR0(vatpic, "atpic special mask mode not implemented"); + return (-1); + } if (val & OCW3_RR) { /* read register command */ atpic->rd_cmd_reg = val & OCW3_RIS; + + /* Polling mode */ + atpic->poll = ((val & OCW3_P) != 0); } return (0); @@ -388,6 +424,8 @@ vatpic_set_pinstate(struct vatpic *vatpi } else if (oldcnt == 1 && newcnt == 0) { /* falling edge */ VATPIC_CTR1(vatpic, "atpic pin%d: deasserted", pin); + if (level) + atpic->request &= ~(1 << (pin & 0x7)); } else { VATPIC_CTR3(vatpic, "atpic pin%d: %s, ignored, acnt %d", pin, newstate ? "asserted" : "deasserted", newcnt); @@ -528,7 +566,7 @@ vatpic_pin_accepted(struct atpic *atpic, if (atpic->aeoi == true) { if (atpic->rotate == true) - atpic->priority = pin; + atpic->lowprio = pin; } else { atpic->service |= (1 << pin); } @@ -566,12 +604,19 @@ static int vatpic_read(struct vatpic *vatpic, struct atpic *atpic, bool in, int port, int bytes, uint32_t *eax) { + int pin; + VATPIC_LOCK(vatpic); if (atpic->poll) { - VATPIC_CTR0(vatpic, "vatpic polled mode not supported"); - VATPIC_UNLOCK(vatpic); - return (-1); + atpic->poll = 0; + pin = vatpic_get_highest_irrpin(atpic); + if (pin >= 0) { + vatpic_pin_accepted(atpic, pin); + *eax = 0x80 | pin; + } else { + *eax = 0; + } } else { if (port & ICU_IMR_OFFSET) { /* read interrrupt mask register */ @@ -641,7 +686,7 @@ vatpic_write(struct vatpic *vatpic, stru } int -vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpic_master_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpic *vatpic; @@ -661,7 +706,7 @@ vatpic_master_handler(void *vm, int vcpu } int -vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpic_slave_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpic *vatpic; @@ -681,7 +726,7 @@ vatpic_slave_handler(void *vm, int vcpui } int -vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpic_elc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpic *vatpic; Modified: stable/10/sys/amd64/vmm/io/vatpic.h ============================================================================== --- stable/10/sys/amd64/vmm/io/vatpic.h Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/amd64/vmm/io/vatpic.h Tue Dec 30 22:22:46 2014 (r276429) @@ -39,11 +39,11 @@ struct vatpic *vatpic_init(struct vm *vm); void vatpic_cleanup(struct vatpic *vatpic); -int vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *eax); -int vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *eax); -int vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes, +int vatpic_master_handler(struct vm *vm, int vcpuid, bool in, int port, + int bytes, uint32_t *eax); +int vatpic_slave_handler(struct vm *vm, int vcpuid, bool in, int port, + int bytes, uint32_t *eax); +int vatpic_elc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax); int vatpic_assert_irq(struct vm *vm, int irq); Modified: stable/10/sys/amd64/vmm/io/vatpit.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vatpit.c Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/amd64/vmm/io/vatpit.c Tue Dec 30 22:22:46 2014 (r276429) @@ -317,7 +317,7 @@ vatpit_update_mode(struct vatpit *vatpit } int -vatpit_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpit *vatpit; @@ -400,7 +400,7 @@ vatpit_handler(void *vm, int vcpuid, boo } int -vatpit_nmisc_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vatpit_nmisc_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax) { struct vatpit *vatpit; Modified: stable/10/sys/amd64/vmm/io/vatpit.h ============================================================================== --- stable/10/sys/amd64/vmm/io/vatpit.h Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/amd64/vmm/io/vatpit.h Tue Dec 30 22:22:46 2014 (r276429) @@ -37,9 +37,9 @@ struct vatpit *vatpit_init(struct vm *vm); void vatpit_cleanup(struct vatpit *vatpit); -int vatpit_handler(void *vm, int vcpuid, bool in, int port, int bytes, - uint32_t *eax); -int vatpit_nmisc_handler(void *vm, int vcpuid, bool in, int port, int bytes, +int vatpit_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *eax); +int vatpit_nmisc_handler(struct vm *vm, int vcpuid, bool in, int port, + int bytes, uint32_t *eax); #endif /* _VATPIT_H_ */ Copied and modified: stable/10/sys/amd64/vmm/io/vpmtmr.c (from r273683, head/sys/amd64/vmm/io/vpmtmr.c) ============================================================================== --- head/sys/amd64/vmm/io/vpmtmr.c Sun Oct 26 04:44:28 2014 (r273683, copy source) +++ stable/10/sys/amd64/vmm/io/vpmtmr.c Tue Dec 30 22:22:46 2014 (r276429) @@ -79,7 +79,7 @@ vpmtmr_cleanup(struct vpmtmr *vpmtmr) } int -vpmtmr_handler(void *vm, int vcpuid, bool in, int port, int bytes, +vpmtmr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *val) { struct vpmtmr *vpmtmr; Copied and modified: stable/10/sys/amd64/vmm/io/vpmtmr.h (from r273683, head/sys/amd64/vmm/io/vpmtmr.h) ============================================================================== --- head/sys/amd64/vmm/io/vpmtmr.h Sun Oct 26 04:44:28 2014 (r273683, copy source) +++ stable/10/sys/amd64/vmm/io/vpmtmr.h Tue Dec 30 22:22:46 2014 (r276429) @@ -36,7 +36,7 @@ struct vpmtmr; struct vpmtmr *vpmtmr_init(struct vm *vm); void vpmtmr_cleanup(struct vpmtmr *pmtmr); -int vpmtmr_handler(void *vm, int vcpuid, bool in, int port, int bytes, +int vpmtmr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *val); #endif Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/amd64/vmm/vmm.c Tue Dec 30 22:22:46 2014 (r276429) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include "vhpet.h" #include "vioapic.h" #include "vlapic.h" +#include "vpmtmr.h" #include "vmm_ipi.h" #include "vmm_stat.h" #include "vmm_lapic.h" @@ -134,6 +135,7 @@ struct vm { struct vioapic *vioapic; /* (i) virtual ioapic */ struct vatpic *vatpic; /* (i) virtual atpic */ struct vatpit *vatpit; /* (i) virtual atpit */ + struct vpmtmr *vpmtmr; /* (i) virtual ACPI PM timer */ volatile cpuset_t active_cpus; /* (i) active vcpus */ int suspend; /* (i) stop VM execution */ volatile cpuset_t suspended_cpus; /* (i) suspended vcpus */ @@ -373,6 +375,7 @@ vm_init(struct vm *vm, bool create) vm->vhpet = vhpet_init(vm); vm->vatpic = vatpic_init(vm); vm->vatpit = vatpit_init(vm); + vm->vpmtmr = vpmtmr_init(vm); CPU_ZERO(&vm->active_cpus); @@ -399,7 +402,7 @@ vm_create(const char *name, struct vm ** if (name == NULL || strlen(name) >= VM_MAX_NAMELEN) return (EINVAL); - vmspace = VMSPACE_ALLOC(VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS); + vmspace = VMSPACE_ALLOC(0, VM_MAXUSER_ADDRESS); if (vmspace == NULL) return (ENOMEM); @@ -435,6 +438,7 @@ vm_cleanup(struct vm *vm, bool destroy) if (vm->iommu != NULL) iommu_destroy_domain(vm->iommu); + vpmtmr_cleanup(vm->vpmtmr); vatpit_cleanup(vm->vatpit); vhpet_cleanup(vm->vhpet); vatpic_cleanup(vm->vatpic); @@ -2212,6 +2216,13 @@ vm_atpit(struct vm *vm) return (vm->vatpit); } +struct vpmtmr * +vm_pmtmr(struct vm *vm) +{ + + return (vm->vpmtmr); +} + enum vm_reg_name vm_segment_name(int seg) { Modified: stable/10/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_ioport.c Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/amd64/vmm/vmm_ioport.c Tue Dec 30 22:22:46 2014 (r276429) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include "vatpic.h" #include "vatpit.h" +#include "vpmtmr.h" #include "vmm_ioport.h" #include "vmm_ktr.h" @@ -58,6 +59,7 @@ ioport_handler_func_t ioport_handler[MAX [IO_ICU2 + ICU_IMR_OFFSET] = vatpic_slave_handler, [IO_ELCR1] = vatpic_elc_handler, [IO_ELCR2] = vatpic_elc_handler, + [IO_PMTMR] = vpmtmr_handler, }; #ifdef KTR Modified: stable/10/sys/amd64/vmm/vmm_ioport.h ============================================================================== --- stable/10/sys/amd64/vmm/vmm_ioport.h Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/amd64/vmm/vmm_ioport.h Tue Dec 30 22:22:46 2014 (r276429) @@ -29,7 +29,7 @@ #ifndef _VMM_IOPORT_H_ #define _VMM_IOPORT_H_ -typedef int (*ioport_handler_func_t)(void *vm, int vcpuid, +typedef int (*ioport_handler_func_t)(struct vm *vm, int vcpuid, bool in, int port, int bytes, uint32_t *val); int vm_handle_inout(struct vm *vm, int vcpuid, struct vm_exit *vme, bool *retu); Modified: stable/10/sys/modules/linux/Makefile ============================================================================== --- stable/10/sys/modules/linux/Makefile Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/modules/linux/Makefile Tue Dec 30 22:22:46 2014 (r276429) @@ -16,6 +16,7 @@ SRCS= linux_fork.c linux${SFX}_dummy.c l linux_timer.c \ opt_inet6.h opt_compat.h opt_kdtrace.h opt_posix.h opt_usb.h \ vnode_if.h device_if.h bus_if.h assym.s +DPSRCS= linux${SFX}_genassym.c # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h Modified: stable/10/sys/modules/vmm/Makefile ============================================================================== --- stable/10/sys/modules/vmm/Makefile Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/sys/modules/vmm/Makefile Tue Dec 30 22:22:46 2014 (r276429) @@ -4,6 +4,7 @@ KMOD= vmm SRCS= opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h SRCS+= vmx_assym.h svm_assym.h +DPSRCS= vmx_genassym.c svm_genassym.c CFLAGS+= -DVMM_KEEP_STATS -DSMP CFLAGS+= -I${.CURDIR}/../../amd64/vmm @@ -33,7 +34,8 @@ SRCS+= iommu.c \ vatpit.c \ vhpet.c \ vioapic.c \ - vlapic.c + vlapic.c \ + vpmtmr.c # intel-specific files .PATH: ${.CURDIR}/../../amd64/vmm/intel @@ -52,7 +54,7 @@ SRCS+= vmcb.c \ npt.c \ amdv.c \ svm_msr.c - + CLEANFILES= vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o vmx_assym.h: vmx_genassym.o Modified: stable/10/usr.sbin/bhyve/Makefile ============================================================================== --- stable/10/usr.sbin/bhyve/Makefile Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/usr.sbin/bhyve/Makefile Tue Dec 30 22:22:46 2014 (r276429) @@ -31,7 +31,6 @@ SRCS= \ pci_virtio_rnd.c \ pci_uart.c \ pm.c \ - pmtmr.c \ post.c \ rtc.c \ smbiostbl.c \ Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/usr.sbin/bhyve/block_if.c Tue Dec 30 22:22:46 2014 (r276429) @@ -43,14 +43,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include + #include "bhyverun.h" +#include "mevent.h" #include "block_if.h" #define BLOCKIF_SIG 0xb109b109 -#define BLOCKIF_MAXREQ 32 +#define BLOCKIF_MAXREQ 33 enum blockop { BOP_READ, @@ -60,7 +64,9 @@ enum blockop { enum blockstat { BST_FREE, - BST_INUSE + BST_PEND, + BST_BUSY, + BST_DONE }; struct blockif_elem { @@ -68,6 +74,7 @@ struct blockif_elem { struct blockif_req *be_req; enum blockop be_op; enum blockstat be_status; + pthread_t be_tid; }; struct blockif_ctxt { @@ -81,13 +88,25 @@ struct blockif_ctxt { pthread_cond_t bc_cond; int bc_closing; - /* Request elements and free/inuse queues */ + /* Request elements and free/pending/busy queues */ TAILQ_HEAD(, blockif_elem) bc_freeq; - TAILQ_HEAD(, blockif_elem) bc_inuseq; + TAILQ_HEAD(, blockif_elem) bc_pendq; + TAILQ_HEAD(, blockif_elem) bc_busyq; u_int bc_req_count; struct blockif_elem bc_reqs[BLOCKIF_MAXREQ]; }; +static pthread_once_t blockif_once = PTHREAD_ONCE_INIT; + +struct blockif_sig_elem { + pthread_mutex_t bse_mtx; + pthread_cond_t bse_cond; + int bse_pending; + struct blockif_sig_elem *bse_next; +}; + +static struct blockif_sig_elem *blockif_bse_head; + static int blockif_enqueue(struct blockif_ctxt *bc, struct blockif_req *breq, enum blockop op) @@ -101,10 +120,10 @@ blockif_enqueue(struct blockif_ctxt *bc, assert(be->be_status == BST_FREE); TAILQ_REMOVE(&bc->bc_freeq, be, be_link); - be->be_status = BST_INUSE; + be->be_status = BST_PEND; be->be_req = breq; be->be_op = op; - TAILQ_INSERT_TAIL(&bc->bc_inuseq, be, be_link); + TAILQ_INSERT_TAIL(&bc->bc_pendq, be, be_link); bc->bc_req_count++; @@ -112,26 +131,38 @@ blockif_enqueue(struct blockif_ctxt *bc, } static int -blockif_dequeue(struct blockif_ctxt *bc, struct blockif_elem *el) +blockif_dequeue(struct blockif_ctxt *bc, struct blockif_elem **bep) { struct blockif_elem *be; if (bc->bc_req_count == 0) return (ENOENT); - be = TAILQ_FIRST(&bc->bc_inuseq); + be = TAILQ_FIRST(&bc->bc_pendq); assert(be != NULL); - assert(be->be_status == BST_INUSE); - *el = *be; + assert(be->be_status == BST_PEND); + TAILQ_REMOVE(&bc->bc_pendq, be, be_link); + be->be_status = BST_BUSY; + be->be_tid = bc->bc_btid; + TAILQ_INSERT_TAIL(&bc->bc_busyq, be, be_link); + + *bep = be; - TAILQ_REMOVE(&bc->bc_inuseq, be, be_link); + return (0); +} + +static void +blockif_complete(struct blockif_ctxt *bc, struct blockif_elem *be) +{ + assert(be->be_status == BST_DONE); + + TAILQ_REMOVE(&bc->bc_busyq, be, be_link); + be->be_tid = 0; be->be_status = BST_FREE; be->be_req = NULL; TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); - - bc->bc_req_count--; - return (0); + bc->bc_req_count--; } static void @@ -163,6 +194,8 @@ blockif_proc(struct blockif_ctxt *bc, st break; } + be->be_status = BST_DONE; + (*br->br_callback)(br, err); } @@ -170,16 +203,17 @@ static void * blockif_thr(void *arg) { struct blockif_ctxt *bc; - struct blockif_elem req; + struct blockif_elem *be; bc = arg; for (;;) { pthread_mutex_lock(&bc->bc_mtx); - while (!blockif_dequeue(bc, &req)) { + while (!blockif_dequeue(bc, &be)) { pthread_mutex_unlock(&bc->bc_mtx); - blockif_proc(bc, &req); + blockif_proc(bc, be); pthread_mutex_lock(&bc->bc_mtx); + blockif_complete(bc, be); } pthread_cond_wait(&bc->bc_cond, &bc->bc_mtx); pthread_mutex_unlock(&bc->bc_mtx); @@ -195,6 +229,38 @@ blockif_thr(void *arg) return (NULL); } +static void +blockif_sigcont_handler(int signal, enum ev_type type, void *arg) +{ + struct blockif_sig_elem *bse; + + for (;;) { + /* + * Process the entire list even if not intended for + * this thread. + */ + do { + bse = blockif_bse_head; + if (bse == NULL) + return; + } while (!atomic_cmpset_ptr((uintptr_t *)&blockif_bse_head, + (uintptr_t)bse, + (uintptr_t)bse->bse_next)); + + pthread_mutex_lock(&bse->bse_mtx); + bse->bse_pending = 0; + pthread_cond_signal(&bse->bse_cond); + pthread_mutex_unlock(&bse->bse_mtx); + } +} + +static void +blockif_init(void) +{ + mevent_add(SIGCONT, EVF_SIGNAL, blockif_sigcont_handler, NULL); + (void) signal(SIGCONT, SIG_IGN); +} + struct blockif_ctxt * blockif_open(const char *optstr, const char *ident) { @@ -206,6 +272,8 @@ blockif_open(const char *optstr, const c int extra, fd, i, sectsz; int nocache, sync, ro; + pthread_once(&blockif_once, blockif_init); + nocache = 0; sync = 0; ro = 0; @@ -280,7 +348,8 @@ blockif_open(const char *optstr, const c pthread_mutex_init(&bc->bc_mtx, NULL); pthread_cond_init(&bc->bc_cond, NULL); TAILQ_INIT(&bc->bc_freeq); - TAILQ_INIT(&bc->bc_inuseq); + TAILQ_INIT(&bc->bc_pendq); + TAILQ_INIT(&bc->bc_busyq); bc->bc_req_count = 0; for (i = 0; i < BLOCKIF_MAXREQ; i++) { bc->bc_reqs[i].be_status = BST_FREE; @@ -357,23 +426,76 @@ blockif_cancel(struct blockif_ctxt *bc, assert(bc->bc_magic == BLOCKIF_SIG); pthread_mutex_lock(&bc->bc_mtx); - TAILQ_FOREACH(be, &bc->bc_inuseq, be_link) { + /* + * Check pending requests. + */ + TAILQ_FOREACH(be, &bc->bc_pendq, be_link) { + if (be->be_req == breq) + break; + } + if (be != NULL) { + /* + * Found it. + */ + TAILQ_REMOVE(&bc->bc_pendq, be, be_link); + be->be_status = BST_FREE; + be->be_req = NULL; + TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); + bc->bc_req_count--; + pthread_mutex_unlock(&bc->bc_mtx); + + return (0); + } + + /* + * Check in-flight requests. + */ + TAILQ_FOREACH(be, &bc->bc_busyq, be_link) { if (be->be_req == breq) break; } if (be == NULL) { + /* + * Didn't find it. + */ pthread_mutex_unlock(&bc->bc_mtx); return (EINVAL); } - TAILQ_REMOVE(&bc->bc_inuseq, be, be_link); - be->be_status = BST_FREE; - be->be_req = NULL; - TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); - bc->bc_req_count--; + /* + * Interrupt the processing thread to force it return + * prematurely via it's normal callback path. + */ + while (be->be_status == BST_BUSY) { + struct blockif_sig_elem bse, *old_head; + + pthread_mutex_init(&bse.bse_mtx, NULL); + pthread_cond_init(&bse.bse_cond, NULL); + + bse.bse_pending = 1; + + do { + old_head = blockif_bse_head; + bse.bse_next = old_head; + } while (!atomic_cmpset_ptr((uintptr_t *)&blockif_bse_head, + (uintptr_t)old_head, + (uintptr_t)&bse)); + + pthread_kill(be->be_tid, SIGCONT); + + pthread_mutex_lock(&bse.bse_mtx); + while (bse.bse_pending) + pthread_cond_wait(&bse.bse_cond, &bse.bse_mtx); + pthread_mutex_unlock(&bse.bse_mtx); + } + pthread_mutex_unlock(&bc->bc_mtx); - return (0); + /* + * The processing thread has been interrupted. Since it's not + * clear if the callback has been invoked yet, return EBUSY. + */ + return (EBUSY); } int @@ -478,7 +600,7 @@ blockif_queuesz(struct blockif_ctxt *bc) { assert(bc->bc_magic == BLOCKIF_SIG); - return (BLOCKIF_MAXREQ); + return (BLOCKIF_MAXREQ - 1); } int Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Tue Dec 30 22:22:46 2014 (r276429) @@ -367,11 +367,15 @@ ahci_check_stopped(struct ahci_port *p) { /* * If we are no longer processing the command list and nothing - * is in-flight, clear the running bit. + * is in-flight, clear the running bit, the current command + * slot, the command issue and active bits. */ if (!(p->cmd & AHCI_P_CMD_ST)) { - if (p->pending == 0) + if (p->pending == 0) { p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); + p->ci = 0; + p->sact = 0; + } } } Modified: stable/10/usr.sbin/bhyve/rtc.c ============================================================================== --- stable/10/usr.sbin/bhyve/rtc.c Tue Dec 30 22:19:34 2014 (r276428) +++ stable/10/usr.sbin/bhyve/rtc.c Tue Dec 30 22:22:46 2014 (r276429) @@ -375,4 +375,8 @@ rtc_dsdt(void) } LPC_DSDT(rtc_dsdt); +/* + * Reserve the extended RTC I/O ports although they are not emulated at this + * time. + */ SYSRES_IO(0x72, 6); From owner-svn-src-stable@FreeBSD.ORG Tue Dec 30 23:52:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C57E685; Tue, 30 Dec 2014 23:52:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9F83FF3; Tue, 30 Dec 2014 23:52:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBUNqo0U041746; Tue, 30 Dec 2014 23:52:50 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBUNqo3F041744; Tue, 30 Dec 2014 23:52:50 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201412302352.sBUNqo3F041744@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Tue, 30 Dec 2014 23:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276433 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 23:52:50 -0000 Author: peterj Date: Tue Dec 30 23:52:48 2014 New Revision: 276433 URL: https://svnweb.freebsd.org/changeset/base/276433 Log: MFH r274083: convert .Nm to proper .Xr's... MFH r275298: Cross reference tap(4) and tun(4) and include a short explanation as to how they differ. This will assist users in selecting which interface is more appropriate for their purposes. No objection: jmg (r274083) Approved by: grog (co-mentor) Modified: stable/10/share/man/man4/tap.4 stable/10/share/man/man4/tun.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/tap.4 ============================================================================== --- stable/10/share/man/man4/tap.4 Tue Dec 30 23:38:31 2014 (r276432) +++ stable/10/share/man/man4/tap.4 Tue Dec 30 23:52:48 2014 (r276433) @@ -1,7 +1,7 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd January 26, 2012 +.Dd November 30, 2014 .Dt TAP 4 .Os .Sh NAME @@ -18,22 +18,33 @@ described as the network interface analo that is, .Nm does for network interfaces what the -.Nm pty +.Xr pty 4 driver does for terminals. .Pp The .Nm driver, like the -.Nm pty +.Xr pty 4 driver, provides two interfaces: an interface like the usual facility it is simulating (an Ethernet network interface in the case of .Nm , or a terminal for -.Nm pty ) , +.Xr pty 4 ) , and a character-special device .Dq control interface. +A client program transfers Ethernet frames to or from the +.Nm +.Dq control +interface. +The +.Xr tun 4 +interface provides similar functionality at the network layer: +a client will transfer IP (by default) packets to or from a +.Xr tun 4 +.Dq control +interface. .Pp The network interfaces are named .Dq Li tap0 , @@ -314,4 +325,5 @@ VMware .El .Sh SEE ALSO .Xr inet 4 , -.Xr intro 4 +.Xr intro 4 , +.Xr tun 4 Modified: stable/10/share/man/man4/tun.4 ============================================================================== --- stable/10/share/man/man4/tun.4 Tue Dec 30 23:38:31 2014 (r276432) +++ stable/10/share/man/man4/tun.4 Tue Dec 30 23:52:48 2014 (r276433) @@ -2,7 +2,7 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd February 4, 2007 +.Dd November 30, 2014 .Dt TUN 4 .Os .Sh NAME @@ -35,6 +35,17 @@ or a terminal for and a character-special device .Dq control interface. +A client program transfers IP (by default) packets to or from the +.Nm +.Dq control +interface. +The +.Xr tap 4 +interface provides similar functionality at the Ethernet layer: +a client will transfer Ethernet frames to or from a +.Xr tap 4 +.Dq control +interface. .Pp The network interfaces are named .Dq Li tun0 , @@ -307,6 +318,7 @@ them pile up. .Xr inet 4 , .Xr intro 4 , .Xr pty 4 , +.Xr tap 4 , .Xr ifconfig 8 .Sh AUTHORS This manual page was originally obtained from From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 00:08:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B227B99C; Wed, 31 Dec 2014 00:08:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D60420F4; Wed, 31 Dec 2014 00:08:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV08c5w048946; Wed, 31 Dec 2014 00:08:38 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV08cRs048944; Wed, 31 Dec 2014 00:08:38 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201412310008.sBV08cRs048944@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Wed, 31 Dec 2014 00:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276434 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 00:08:38 -0000 Author: peterj Date: Wed Dec 31 00:08:37 2014 New Revision: 276434 URL: https://svnweb.freebsd.org/changeset/base/276434 Log: MFH r230580: Don't mention no longer supported ioctl commands. MFH r274083: convert .Nm to proper .Xr's... MFH r275298: Cross reference tap(4) and tun(4) and include a short explanation as to how they differ. This will assist users in selecting which interface is more appropriate for their purposes. No objection: glebius (r230580), jmg (r274083) Approved by: grog (co-mentor) Modified: stable/9/share/man/man4/tap.4 stable/9/share/man/man4/tun.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/tap.4 ============================================================================== --- stable/9/share/man/man4/tap.4 Tue Dec 30 23:52:48 2014 (r276433) +++ stable/9/share/man/man4/tap.4 Wed Dec 31 00:08:37 2014 (r276434) @@ -1,7 +1,7 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd September 8, 2008 +.Dd November 30, 2014 .Dt TAP 4 .Os .Sh NAME @@ -18,22 +18,33 @@ described as the network interface analo that is, .Nm does for network interfaces what the -.Nm pty +.Xr pty 4 driver does for terminals. .Pp The .Nm driver, like the -.Nm pty +.Xr pty 4 driver, provides two interfaces: an interface like the usual facility it is simulating (an Ethernet network interface in the case of .Nm , or a terminal for -.Nm pty ) , +.Xr pty 4 ) , and a character-special device .Dq control interface. +A client program transfers Ethernet frames to or from the +.Nm +.Dq control +interface. +The +.Xr tun 4 +interface provides similar functionality at the network layer: +a client will transfer IP (by default) packets to or from a +.Xr tun 4 +.Dq control +interface. .Pp The network interfaces are named .Dq Li tap0 , @@ -89,11 +100,7 @@ Control devices (once successfully opene is unloaded or the interface is destroyed. .Pp Each interface supports the usual Ethernet network interface -.Xr ioctl 2 Ns s , -such as -.Dv SIOCSIFADDR -and -.Dv SIOCSIFNETMASK , +.Xr ioctl 2 Ns s and thus can be used with .Xr ifconfig 8 like any other Ethernet interface. @@ -318,4 +325,5 @@ VMware .El .Sh SEE ALSO .Xr inet 4 , -.Xr intro 4 +.Xr intro 4 , +.Xr tun 4 Modified: stable/9/share/man/man4/tun.4 ============================================================================== --- stable/9/share/man/man4/tun.4 Tue Dec 30 23:52:48 2014 (r276433) +++ stable/9/share/man/man4/tun.4 Wed Dec 31 00:08:37 2014 (r276434) @@ -2,7 +2,7 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd February 4, 2007 +.Dd November 30, 2014 .Dt TUN 4 .Os .Sh NAME @@ -35,6 +35,17 @@ or a terminal for and a character-special device .Dq control interface. +A client program transfers IP (by default) packets to or from the +.Nm +.Dq control +interface. +The +.Xr tap 4 +interface provides similar functionality at the Ethernet layer: +a client will transfer Ethernet frames to or from a +.Xr tap 4 +.Dq control +interface. .Pp The network interfaces are named .Dq Li tun0 , @@ -307,6 +318,7 @@ them pile up. .Xr inet 4 , .Xr intro 4 , .Xr pty 4 , +.Xr tap 4 , .Xr ifconfig 8 .Sh AUTHORS This manual page was originally obtained from From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 00:09:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE091ACA; Wed, 31 Dec 2014 00:09:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA22220FB; Wed, 31 Dec 2014 00:09:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV096oh049113; Wed, 31 Dec 2014 00:09:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV096FR049111; Wed, 31 Dec 2014 00:09:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412310009.sBV096FR049111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 31 Dec 2014 00:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276435 - stable/9/usr.bin/file X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 00:09:06 -0000 Author: delphij Date: Wed Dec 31 00:09:05 2014 New Revision: 276435 URL: https://svnweb.freebsd.org/changeset/base/276435 Log: MFC r267897: Update Makefile to reflect file update. Modified: stable/9/usr.bin/file/Makefile Directory Properties: stable/9/usr.bin/file/ (props changed) Modified: stable/9/usr.bin/file/Makefile ============================================================================== --- stable/9/usr.bin/file/Makefile Wed Dec 31 00:08:37 2014 (r276434) +++ stable/9/usr.bin/file/Makefile Wed Dec 31 00:09:05 2014 (r276435) @@ -21,7 +21,8 @@ # 4. This notice may not be removed or altered. SRCDIR= ${.CURDIR}/../../contrib/file -.PATH: ${SRCDIR} +.PATH: ${SRCDIR}/src +.PATH: ${SRCDIR}/doc PROG= file From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 00:34:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDD3EE80; Wed, 31 Dec 2014 00:34:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFD102725; Wed, 31 Dec 2014 00:34:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV0Yc8U064520; Wed, 31 Dec 2014 00:34:38 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV0YcAs064519; Wed, 31 Dec 2014 00:34:38 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201412310034.sBV0YcAs064519@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 31 Dec 2014 00:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276436 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 00:34:39 -0000 Author: rmacklem Date: Wed Dec 31 00:34:37 2014 New Revision: 276436 URL: https://svnweb.freebsd.org/changeset/base/276436 Log: MFC: r276192, r276200 Modify vop_stdadvlock{async}() so that it only locks/unlocks the vnode and does a VOP_GETATTR() for the SEEK_END case. This is safe to do, since lf_advlock{async}() only uses the size argument for the SEEK_END case. The NFSv4 server needs this when vfs.nfsd.enable_locallocks!=0 since locking the vnode results in a LOR that can cause a deadlock for the nfsd threads. Modified: stable/10/sys/kern/vfs_default.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_default.c ============================================================================== --- stable/10/sys/kern/vfs_default.c Wed Dec 31 00:09:05 2014 (r276435) +++ stable/10/sys/kern/vfs_default.c Wed Dec 31 00:34:37 2014 (r276436) @@ -399,17 +399,24 @@ int vop_stdadvlock(struct vop_advlock_args *ap) { struct vnode *vp; - struct ucred *cred; struct vattr vattr; int error; vp = ap->a_vp; - cred = curthread->td_ucred; - vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, cred); - VOP_UNLOCK(vp, 0); - if (error) - return (error); + if (ap->a_fl->l_whence == SEEK_END) { + /* + * The NFSv4 server must avoid doing a vn_lock() here, since it + * can deadlock the nfsd threads, due to a LOR. Fortunately + * the NFSv4 server always uses SEEK_SET and this code is + * only required for the SEEK_END case. + */ + vn_lock(vp, LK_SHARED | LK_RETRY); + error = VOP_GETATTR(vp, &vattr, curthread->td_ucred); + VOP_UNLOCK(vp, 0); + if (error) + return (error); + } else + vattr.va_size = 0; return (lf_advlock(ap, &(vp->v_lockf), vattr.va_size)); } @@ -418,17 +425,19 @@ int vop_stdadvlockasync(struct vop_advlockasync_args *ap) { struct vnode *vp; - struct ucred *cred; struct vattr vattr; int error; vp = ap->a_vp; - cred = curthread->td_ucred; - vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, cred); - VOP_UNLOCK(vp, 0); - if (error) - return (error); + if (ap->a_fl->l_whence == SEEK_END) { + /* The size argument is only needed for SEEK_END. */ + vn_lock(vp, LK_SHARED | LK_RETRY); + error = VOP_GETATTR(vp, &vattr, curthread->td_ucred); + VOP_UNLOCK(vp, 0); + if (error) + return (error); + } else + vattr.va_size = 0; return (lf_advlockasync(ap, &(vp->v_lockf), vattr.va_size)); } From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 00:40:11 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD5ED16F; Wed, 31 Dec 2014 00:40:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF9AA2778; Wed, 31 Dec 2014 00:40:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV0eBHj065830; Wed, 31 Dec 2014 00:40:11 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV0eBOk065827; Wed, 31 Dec 2014 00:40:11 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201412310040.sBV0eBOk065827@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 31 Dec 2014 00:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276437 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 00:40:12 -0000 Author: rmacklem Date: Wed Dec 31 00:40:10 2014 New Revision: 276437 URL: https://svnweb.freebsd.org/changeset/base/276437 Log: MFC: r276193 A deadlock in the NFSv4 server with vfs.nfsd.enable_locallocks=1 was reported via email. This was caused by a LOR between the sleep lock used to serialize the local locking (nfsrv_locklf()) and locking the vnode. I believe this patch fixes the problem by delaying relocking of the vnode until the sleep lock is unlocked (nfsrv_unlocklf()). To avoid nfsvno_advlock() having the side effect of unlocking the vnode, unlocking the vnode was moved to before the functions that call nfsvno_advlock(). It shouldn't affect the execution of the default case where vfs.nfsd.enable_locallocks=0. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 31 00:34:37 2014 (r276436) +++ stable/10/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 31 00:40:10 2014 (r276437) @@ -2965,12 +2965,7 @@ nfsvno_advlock(struct vnode *vp, int fty if (nfsrv_dolocallocks == 0) goto out; - - /* Check for VI_DOOMED here, so that VOP_ADVLOCK() isn't performed. */ - if ((vp->v_iflag & VI_DOOMED) != 0) { - error = EPERM; - goto out; - } + ASSERT_VOP_UNLOCKED(vp, "nfsvno_advlock: vp locked"); fl.l_whence = SEEK_SET; fl.l_type = ftype; @@ -2994,14 +2989,12 @@ nfsvno_advlock(struct vnode *vp, int fty fl.l_pid = (pid_t)0; fl.l_sysid = (int)nfsv4_sysid; - NFSVOPUNLOCK(vp, 0); if (ftype == F_UNLCK) error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_UNLCK, &fl, (F_POSIX | F_REMOTE)); else error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl, (F_POSIX | F_REMOTE)); - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); out: NFSEXITCODE(error); Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Wed Dec 31 00:34:37 2014 (r276436) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Wed Dec 31 00:40:10 2014 (r276437) @@ -1344,6 +1344,8 @@ nfsrv_freeallnfslocks(struct nfsstate *s vnode_t tvp = NULL; uint64_t first, end; + if (vp != NULL) + ASSERT_VOP_UNLOCKED(vp, "nfsrv_freeallnfslocks: vnode locked"); lop = LIST_FIRST(&stp->ls_lock); while (lop != LIST_END(&stp->ls_lock)) { nlop = LIST_NEXT(lop, lo_lckowner); @@ -1363,9 +1365,10 @@ nfsrv_freeallnfslocks(struct nfsstate *s if (gottvp == 0) { if (nfsrv_dolocallocks == 0) tvp = NULL; - else if (vp == NULL && cansleep != 0) + else if (vp == NULL && cansleep != 0) { tvp = nfsvno_getvp(&lfp->lf_fh); - else + NFSVOPUNLOCK(tvp, 0); + } else tvp = vp; gottvp = 1; } @@ -1386,7 +1389,7 @@ nfsrv_freeallnfslocks(struct nfsstate *s lop = nlop; } if (vp == NULL && tvp != NULL) - vput(tvp); + vrele(tvp); } /* @@ -1497,7 +1500,7 @@ nfsrv_lockctrl(vnode_t vp, struct nfssta struct nfsclient *clp = NULL; u_int32_t bits; int error = 0, haslock = 0, ret, reterr; - int getlckret, delegation = 0, filestruct_locked; + int getlckret, delegation = 0, filestruct_locked, vnode_unlocked = 0; fhandle_t nfh; uint64_t first, end; uint32_t lock_flags; @@ -1587,6 +1590,11 @@ tryagain: * locking rolled back. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl1"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } reterr = nfsrv_locallock(vp, lfp, (new_lop->lo_flags & (NFSLCK_READ | NFSLCK_WRITE)), new_lop->lo_first, new_lop->lo_end, cfp, p); @@ -1748,6 +1756,11 @@ tryagain: if (filestruct_locked != 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl2"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); @@ -1825,6 +1838,12 @@ tryagain: if (filestruct_locked != 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, + "nfsrv_lockctrl3"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); @@ -1844,6 +1863,8 @@ tryagain: bits = tstp->ls_flags; bits >>= NFSLCK_SHIFT; if (new_stp->ls_flags & bits & NFSLCK_ACCESSBITS) { + KASSERT(vnode_unlocked == 0, + ("nfsrv_lockctrl: vnode unlocked1")); ret = nfsrv_clientconflict(tstp->ls_clp, &haslock, vp, p); if (ret == 1) { @@ -1875,6 +1896,8 @@ tryagain: * For setattr, just get rid of all the Delegations for other clients. */ if (new_stp->ls_flags & NFSLCK_SETATTR) { + KASSERT(vnode_unlocked == 0, + ("nfsrv_lockctrl: vnode unlocked2")); ret = nfsrv_cleandeleg(vp, lfp, clp, &haslock, p); if (ret) { /* @@ -1925,14 +1948,26 @@ tryagain: (new_lop->lo_flags & NFSLCK_WRITE) && (clp != tstp->ls_clp || (tstp->ls_flags & NFSLCK_DELEGREAD)))) { + ret = 0; if (filestruct_locked != 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl4"); + NFSVOPUNLOCK(vp, 0); + } nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); + NFSUNLOCKSTATE(); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + vnode_unlocked = 0; + if ((vp->v_iflag & VI_DOOMED) != 0) + ret = NFSERR_SERVERFAULT; + NFSLOCKSTATE(); } - ret = nfsrv_delegconflict(tstp, &haslock, p, vp); + if (ret == 0) + ret = nfsrv_delegconflict(tstp, &haslock, p, vp); if (ret) { /* * nfsrv_delegconflict unlocks state when it @@ -1971,6 +2006,11 @@ tryagain: stateidp->other[2] = stp->ls_stateid.other[2]; if (filestruct_locked != 0) { NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl5"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } /* Update the local locks. */ nfsrv_localunlock(vp, lfp, first, end, p); NFSLOCKSTATE(); @@ -2001,14 +2041,29 @@ tryagain: FREE((caddr_t)other_lop, M_NFSDLOCK); other_lop = NULL; } - ret = nfsrv_clientconflict(lop->lo_stp->ls_clp,&haslock,vp,p); + if (vnode_unlocked != 0) + ret = nfsrv_clientconflict(lop->lo_stp->ls_clp, &haslock, + NULL, p); + else + ret = nfsrv_clientconflict(lop->lo_stp->ls_clp, &haslock, + vp, p); if (ret == 1) { if (filestruct_locked != 0) { + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl6"); + NFSVOPUNLOCK(vp, 0); + } /* Roll back local locks. */ nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); NFSUNLOCKSTATE(); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + vnode_unlocked = 0; + if ((vp->v_iflag & VI_DOOMED) != 0) { + error = NFSERR_SERVERFAULT; + goto out; + } } /* * nfsrv_clientconflict() unlocks state when it @@ -2042,6 +2097,11 @@ tryagain: if (filestruct_locked != 0 && ret == 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl7"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); @@ -2120,6 +2180,11 @@ out: nfsv4_unlock(&nfsv4rootfs_lock, 1); NFSUNLOCKV4ROOTMUTEX(); } + if (vnode_unlocked != 0) { + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) + error = NFSERR_SERVERFAULT; + } if (other_lop) FREE((caddr_t)other_lop, M_NFSDLOCK); NFSEXITCODE2(error, nd); @@ -3227,11 +3292,14 @@ nfsrv_openupdate(vnode_t vp, struct nfss /* Get the lf lock */ nfsrv_locklf(lfp); NFSUNLOCKSTATE(); + ASSERT_VOP_ELOCKED(vp, "nfsrv_openupdate"); + NFSVOPUNLOCK(vp, 0); if (nfsrv_freeopen(stp, vp, 1, p) == 0) { NFSLOCKSTATE(); nfsrv_unlocklf(lfp); NFSUNLOCKSTATE(); } + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); } else { (void) nfsrv_freeopen(stp, NULL, 0, p); NFSUNLOCKSTATE(); @@ -4619,7 +4687,7 @@ static int nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, vnode_t vp, NFSPROC_T *p) { - int gotlock, lktype; + int gotlock, lktype = 0; /* * If lease hasn't expired, we can't fix it. @@ -4629,8 +4697,10 @@ nfsrv_clientconflict(struct nfsclient *c return (0); if (*haslockp == 0) { NFSUNLOCKSTATE(); - lktype = NFSVOPISLOCKED(vp); - NFSVOPUNLOCK(vp, 0); + if (vp != NULL) { + lktype = NFSVOPISLOCKED(vp); + NFSVOPUNLOCK(vp, 0); + } NFSLOCKV4ROOTMUTEX(); nfsv4_relref(&nfsv4rootfs_lock); do { @@ -4639,11 +4709,12 @@ nfsrv_clientconflict(struct nfsclient *c } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; - NFSVOPLOCK(vp, lktype | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) != 0) - return (2); - else - return (1); + if (vp != NULL) { + NFSVOPLOCK(vp, lktype | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) != 0) + return (2); + } + return (1); } NFSUNLOCKSTATE(); @@ -4684,7 +4755,7 @@ nfsrv_delegconflict(struct nfsstate *stp vnode_t vp) { struct nfsclient *clp = stp->ls_clp; - int gotlock, error, lktype, retrycnt, zapped_clp; + int gotlock, error, lktype = 0, retrycnt, zapped_clp; nfsv4stateid_t tstateid; fhandle_t tfh; @@ -4801,8 +4872,10 @@ nfsrv_delegconflict(struct nfsstate *stp */ if (*haslockp == 0) { NFSUNLOCKSTATE(); - lktype = NFSVOPISLOCKED(vp); - NFSVOPUNLOCK(vp, 0); + if (vp != NULL) { + lktype = NFSVOPISLOCKED(vp); + NFSVOPUNLOCK(vp, 0); + } NFSLOCKV4ROOTMUTEX(); nfsv4_relref(&nfsv4rootfs_lock); do { @@ -4811,14 +4884,16 @@ nfsrv_delegconflict(struct nfsstate *stp } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; - NFSVOPLOCK(vp, lktype | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) != 0) { - *haslockp = 0; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); - error = NFSERR_PERM; - goto out; + if (vp != NULL) { + NFSVOPLOCK(vp, lktype | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) != 0) { + *haslockp = 0; + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); + error = NFSERR_PERM; + goto out; + } } error = -1; goto out; From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 00:44:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A36012D7; Wed, 31 Dec 2014 00:44:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F187287D; Wed, 31 Dec 2014 00:44:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV0iCtc070029; Wed, 31 Dec 2014 00:44:12 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV0iCr5070028; Wed, 31 Dec 2014 00:44:12 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201412310044.sBV0iCr5070028@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 31 Dec 2014 00:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276438 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 00:44:12 -0000 Author: rmacklem Date: Wed Dec 31 00:44:11 2014 New Revision: 276438 URL: https://svnweb.freebsd.org/changeset/base/276438 Log: MFC: r276221 Delete some duplicate code that was harmless because exactly the same code is at the end of the nfscl_checksattr() function that is called just before it. As such, this code had already been executed and didn't do anything. Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed Dec 31 00:40:10 2014 (r276437) +++ stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed Dec 31 00:44:11 2014 (r276438) @@ -1608,20 +1608,6 @@ again: } } else if (NFS_ISV34(dvp) && (fmode & O_EXCL)) { if (nfscl_checksattr(vap, &nfsva)) { - /* - * We are normally called with only a partially - * initialized VAP. Since the NFSv3 spec says that - * the server may use the file attributes to - * store the verifier, the spec requires us to do a - * SETATTR RPC. FreeBSD servers store the verifier in - * atime, but we can't really assume that all servers - * will so we ensure that our SETATTR sets both atime - * and mtime. - */ - if (vap->va_mtime.tv_sec == VNOVAL) - vfs_timestamp(&vap->va_mtime); - if (vap->va_atime.tv_sec == VNOVAL) - vap->va_atime = vap->va_mtime; error = nfsrpc_setattr(newvp, vap, NULL, cnp->cn_cred, cnp->cn_thread, &nfsva, &attrflag, NULL); if (error && (vap->va_uid != (uid_t)VNOVAL || From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 01:29:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F21A9B1; Wed, 31 Dec 2014 01:29:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 322FF3F1D; Wed, 31 Dec 2014 01:29:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV1TjxO092659; Wed, 31 Dec 2014 01:29:45 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV1TjNi092658; Wed, 31 Dec 2014 01:29:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201412310129.sBV1TjNi092658@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 31 Dec 2014 01:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276440 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 01:29:45 -0000 Author: rmacklem Date: Wed Dec 31 01:29:44 2014 New Revision: 276440 URL: https://svnweb.freebsd.org/changeset/base/276440 Log: MFC: r276192, r276200 Modify vop_stdadvlock{async}() so that it only locks/unlocks the vnode and does a VOP_GETATTR() for the SEEK_END case. This is safe to do, since lf_advlock{async}() only uses the size argument for the SEEK_END case. The NFSv4 server needs this when vfs.nfsd.enable_locallocks!=0 since locking the vnode results in a LOR that can cause a deadlock for the nfsd threads. Modified: stable/9/sys/kern/vfs_default.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_default.c ============================================================================== --- stable/9/sys/kern/vfs_default.c Wed Dec 31 00:54:38 2014 (r276439) +++ stable/9/sys/kern/vfs_default.c Wed Dec 31 01:29:44 2014 (r276440) @@ -399,17 +399,24 @@ int vop_stdadvlock(struct vop_advlock_args *ap) { struct vnode *vp; - struct ucred *cred; struct vattr vattr; int error; vp = ap->a_vp; - cred = curthread->td_ucred; - vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, cred); - VOP_UNLOCK(vp, 0); - if (error) - return (error); + if (ap->a_fl->l_whence == SEEK_END) { + /* + * The NFSv4 server must avoid doing a vn_lock() here, since it + * can deadlock the nfsd threads, due to a LOR. Fortunately + * the NFSv4 server always uses SEEK_SET and this code is + * only required for the SEEK_END case. + */ + vn_lock(vp, LK_SHARED | LK_RETRY); + error = VOP_GETATTR(vp, &vattr, curthread->td_ucred); + VOP_UNLOCK(vp, 0); + if (error) + return (error); + } else + vattr.va_size = 0; return (lf_advlock(ap, &(vp->v_lockf), vattr.va_size)); } @@ -418,17 +425,19 @@ int vop_stdadvlockasync(struct vop_advlockasync_args *ap) { struct vnode *vp; - struct ucred *cred; struct vattr vattr; int error; vp = ap->a_vp; - cred = curthread->td_ucred; - vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, cred); - VOP_UNLOCK(vp, 0); - if (error) - return (error); + if (ap->a_fl->l_whence == SEEK_END) { + /* The size argument is only needed for SEEK_END. */ + vn_lock(vp, LK_SHARED | LK_RETRY); + error = VOP_GETATTR(vp, &vattr, curthread->td_ucred); + VOP_UNLOCK(vp, 0); + if (error) + return (error); + } else + vattr.va_size = 0; return (lf_advlockasync(ap, &(vp->v_lockf), vattr.va_size)); } From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 01:34:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6372B41; Wed, 31 Dec 2014 01:34:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A71DE100B; Wed, 31 Dec 2014 01:34:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV1YcRe097142; Wed, 31 Dec 2014 01:34:38 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV1Ycdd097139; Wed, 31 Dec 2014 01:34:38 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201412310134.sBV1Ycdd097139@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 31 Dec 2014 01:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276441 - stable/9/sys/fs/nfsserver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 01:34:38 -0000 Author: rmacklem Date: Wed Dec 31 01:34:37 2014 New Revision: 276441 URL: https://svnweb.freebsd.org/changeset/base/276441 Log: MFC: r276193 A deadlock in the NFSv4 server with vfs.nfsd.enable_locallocks=1 was reported via email. This was caused by a LOR between the sleep lock used to serialize the local locking (nfsrv_locklf()) and locking the vnode. I believe this patch fixes the problem by delaying relocking of the vnode until the sleep lock is unlocked (nfsrv_unlocklf()). To avoid nfsvno_advlock() having the side effect of unlocking the vnode, unlocking the vnode was moved to before the functions that call nfsvno_advlock(). It shouldn't affect the execution of the default case where vfs.nfsd.enable_locallocks=0. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c stable/9/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 31 01:29:44 2014 (r276440) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 31 01:34:37 2014 (r276441) @@ -2969,12 +2969,7 @@ nfsvno_advlock(struct vnode *vp, int fty if (nfsrv_dolocallocks == 0) goto out; - - /* Check for VI_DOOMED here, so that VOP_ADVLOCK() isn't performed. */ - if ((vp->v_iflag & VI_DOOMED) != 0) { - error = EPERM; - goto out; - } + ASSERT_VOP_UNLOCKED(vp, "nfsvno_advlock: vp locked"); fl.l_whence = SEEK_SET; fl.l_type = ftype; @@ -2998,14 +2993,12 @@ nfsvno_advlock(struct vnode *vp, int fty fl.l_pid = (pid_t)0; fl.l_sysid = (int)nfsv4_sysid; - NFSVOPUNLOCK(vp, 0); if (ftype == F_UNLCK) error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_UNLCK, &fl, (F_POSIX | F_REMOTE)); else error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl, (F_POSIX | F_REMOTE)); - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); out: NFSEXITCODE(error); Modified: stable/9/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdstate.c Wed Dec 31 01:29:44 2014 (r276440) +++ stable/9/sys/fs/nfsserver/nfs_nfsdstate.c Wed Dec 31 01:34:37 2014 (r276441) @@ -1168,6 +1168,8 @@ nfsrv_freeallnfslocks(struct nfsstate *s vnode_t tvp = NULL; uint64_t first, end; + if (vp != NULL) + ASSERT_VOP_UNLOCKED(vp, "nfsrv_freeallnfslocks: vnode locked"); lop = LIST_FIRST(&stp->ls_lock); while (lop != LIST_END(&stp->ls_lock)) { nlop = LIST_NEXT(lop, lo_lckowner); @@ -1187,9 +1189,10 @@ nfsrv_freeallnfslocks(struct nfsstate *s if (gottvp == 0) { if (nfsrv_dolocallocks == 0) tvp = NULL; - else if (vp == NULL && cansleep != 0) + else if (vp == NULL && cansleep != 0) { tvp = nfsvno_getvp(&lfp->lf_fh); - else + NFSVOPUNLOCK(tvp, 0); + } else tvp = vp; gottvp = 1; } @@ -1210,7 +1213,7 @@ nfsrv_freeallnfslocks(struct nfsstate *s lop = nlop; } if (vp == NULL && tvp != NULL) - vput(tvp); + vrele(tvp); } /* @@ -1321,7 +1324,7 @@ nfsrv_lockctrl(vnode_t vp, struct nfssta struct nfsclient *clp = NULL; u_int32_t bits; int error = 0, haslock = 0, ret, reterr; - int getlckret, delegation = 0, filestruct_locked; + int getlckret, delegation = 0, filestruct_locked, vnode_unlocked = 0; fhandle_t nfh; uint64_t first, end; uint32_t lock_flags; @@ -1411,6 +1414,11 @@ tryagain: * locking rolled back. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl1"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } reterr = nfsrv_locallock(vp, lfp, (new_lop->lo_flags & (NFSLCK_READ | NFSLCK_WRITE)), new_lop->lo_first, new_lop->lo_end, cfp, p); @@ -1569,6 +1577,11 @@ tryagain: if (filestruct_locked != 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl2"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); @@ -1646,6 +1659,12 @@ tryagain: if (filestruct_locked != 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, + "nfsrv_lockctrl3"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); @@ -1665,6 +1684,8 @@ tryagain: bits = tstp->ls_flags; bits >>= NFSLCK_SHIFT; if (new_stp->ls_flags & bits & NFSLCK_ACCESSBITS) { + KASSERT(vnode_unlocked == 0, + ("nfsrv_lockctrl: vnode unlocked1")); ret = nfsrv_clientconflict(tstp->ls_clp, &haslock, vp, p); if (ret == 1) { @@ -1696,6 +1717,8 @@ tryagain: * For setattr, just get rid of all the Delegations for other clients. */ if (new_stp->ls_flags & NFSLCK_SETATTR) { + KASSERT(vnode_unlocked == 0, + ("nfsrv_lockctrl: vnode unlocked2")); ret = nfsrv_cleandeleg(vp, lfp, clp, &haslock, p); if (ret) { /* @@ -1746,14 +1769,26 @@ tryagain: (new_lop->lo_flags & NFSLCK_WRITE) && (clp != tstp->ls_clp || (tstp->ls_flags & NFSLCK_DELEGREAD)))) { + ret = 0; if (filestruct_locked != 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl4"); + NFSVOPUNLOCK(vp, 0); + } nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); + NFSUNLOCKSTATE(); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + vnode_unlocked = 0; + if ((vp->v_iflag & VI_DOOMED) != 0) + ret = NFSERR_SERVERFAULT; + NFSLOCKSTATE(); } - ret = nfsrv_delegconflict(tstp, &haslock, p, vp); + if (ret == 0) + ret = nfsrv_delegconflict(tstp, &haslock, p, vp); if (ret) { /* * nfsrv_delegconflict unlocks state when it @@ -1790,6 +1825,11 @@ tryagain: stateidp->other[2] = stp->ls_stateid.other[2]; if (filestruct_locked != 0) { NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl5"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } /* Update the local locks. */ nfsrv_localunlock(vp, lfp, first, end, p); NFSLOCKSTATE(); @@ -1820,14 +1860,29 @@ tryagain: FREE((caddr_t)other_lop, M_NFSDLOCK); other_lop = NULL; } - ret = nfsrv_clientconflict(lop->lo_stp->ls_clp,&haslock,vp,p); + if (vnode_unlocked != 0) + ret = nfsrv_clientconflict(lop->lo_stp->ls_clp, &haslock, + NULL, p); + else + ret = nfsrv_clientconflict(lop->lo_stp->ls_clp, &haslock, + vp, p); if (ret == 1) { if (filestruct_locked != 0) { + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl6"); + NFSVOPUNLOCK(vp, 0); + } /* Roll back local locks. */ nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); NFSUNLOCKSTATE(); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + vnode_unlocked = 0; + if ((vp->v_iflag & VI_DOOMED) != 0) { + error = NFSERR_SERVERFAULT; + goto out; + } } /* * nfsrv_clientconflict() unlocks state when it @@ -1861,6 +1916,11 @@ tryagain: if (filestruct_locked != 0 && ret == 0) { /* Roll back local locks. */ NFSUNLOCKSTATE(); + if (vnode_unlocked == 0) { + ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl7"); + vnode_unlocked = 1; + NFSVOPUNLOCK(vp, 0); + } nfsrv_locallock_rollback(vp, lfp, p); NFSLOCKSTATE(); nfsrv_unlocklf(lfp); @@ -1937,6 +1997,11 @@ out: nfsv4_unlock(&nfsv4rootfs_lock, 1); NFSUNLOCKV4ROOTMUTEX(); } + if (vnode_unlocked != 0) { + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) + error = NFSERR_SERVERFAULT; + } if (other_lop) FREE((caddr_t)other_lop, M_NFSDLOCK); NFSEXITCODE2(error, nd); @@ -2958,11 +3023,14 @@ nfsrv_openupdate(vnode_t vp, struct nfss /* Get the lf lock */ nfsrv_locklf(lfp); NFSUNLOCKSTATE(); + ASSERT_VOP_ELOCKED(vp, "nfsrv_openupdate"); + NFSVOPUNLOCK(vp, 0); if (nfsrv_freeopen(stp, vp, 1, p) == 0) { NFSLOCKSTATE(); nfsrv_unlocklf(lfp); NFSUNLOCKSTATE(); } + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); } else { (void) nfsrv_freeopen(stp, NULL, 0, p); NFSUNLOCKSTATE(); @@ -4271,7 +4339,7 @@ static int nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, vnode_t vp, NFSPROC_T *p) { - int gotlock, lktype; + int gotlock, lktype = 0; /* * If lease hasn't expired, we can't fix it. @@ -4281,8 +4349,10 @@ nfsrv_clientconflict(struct nfsclient *c return (0); if (*haslockp == 0) { NFSUNLOCKSTATE(); - lktype = NFSVOPISLOCKED(vp); - NFSVOPUNLOCK(vp, 0); + if (vp != NULL) { + lktype = NFSVOPISLOCKED(vp); + NFSVOPUNLOCK(vp, 0); + } NFSLOCKV4ROOTMUTEX(); nfsv4_relref(&nfsv4rootfs_lock); do { @@ -4291,11 +4361,12 @@ nfsrv_clientconflict(struct nfsclient *c } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; - NFSVOPLOCK(vp, lktype | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) != 0) - return (2); - else - return (1); + if (vp != NULL) { + NFSVOPLOCK(vp, lktype | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) != 0) + return (2); + } + return (1); } NFSUNLOCKSTATE(); @@ -4336,7 +4407,7 @@ nfsrv_delegconflict(struct nfsstate *stp vnode_t vp) { struct nfsclient *clp = stp->ls_clp; - int gotlock, error, lktype, retrycnt, zapped_clp; + int gotlock, error, lktype = 0, retrycnt, zapped_clp; nfsv4stateid_t tstateid; fhandle_t tfh; @@ -4453,8 +4524,10 @@ nfsrv_delegconflict(struct nfsstate *stp */ if (*haslockp == 0) { NFSUNLOCKSTATE(); - lktype = NFSVOPISLOCKED(vp); - NFSVOPUNLOCK(vp, 0); + if (vp != NULL) { + lktype = NFSVOPISLOCKED(vp); + NFSVOPUNLOCK(vp, 0); + } NFSLOCKV4ROOTMUTEX(); nfsv4_relref(&nfsv4rootfs_lock); do { @@ -4463,14 +4536,16 @@ nfsrv_delegconflict(struct nfsstate *stp } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; - NFSVOPLOCK(vp, lktype | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) != 0) { - *haslockp = 0; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); - error = NFSERR_PERM; - goto out; + if (vp != NULL) { + NFSVOPLOCK(vp, lktype | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) != 0) { + *haslockp = 0; + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); + error = NFSERR_PERM; + goto out; + } } error = -1; goto out; From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 01:38:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D30CD38; Wed, 31 Dec 2014 01:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18D92108E; Wed, 31 Dec 2014 01:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV1c31W097896; Wed, 31 Dec 2014 01:38:03 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV1c3Sl097895; Wed, 31 Dec 2014 01:38:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201412310138.sBV1c3Sl097895@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 31 Dec 2014 01:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276442 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 01:38:04 -0000 Author: rmacklem Date: Wed Dec 31 01:38:02 2014 New Revision: 276442 URL: https://svnweb.freebsd.org/changeset/base/276442 Log: MFC: r276221 Delete some duplicate code that was harmless because exactly the same code is at the end of the nfscl_checksattr() function that is called just before it. As such, this code had already been executed and didn't do anything. Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvnops.c Wed Dec 31 01:34:37 2014 (r276441) +++ stable/9/sys/fs/nfsclient/nfs_clvnops.c Wed Dec 31 01:38:02 2014 (r276442) @@ -1583,20 +1583,6 @@ again: } } else if (NFS_ISV34(dvp) && (fmode & O_EXCL)) { if (nfscl_checksattr(vap, &nfsva)) { - /* - * We are normally called with only a partially - * initialized VAP. Since the NFSv3 spec says that - * the server may use the file attributes to - * store the verifier, the spec requires us to do a - * SETATTR RPC. FreeBSD servers store the verifier in - * atime, but we can't really assume that all servers - * will so we ensure that our SETATTR sets both atime - * and mtime. - */ - if (vap->va_mtime.tv_sec == VNOVAL) - vfs_timestamp(&vap->va_mtime); - if (vap->va_atime.tv_sec == VNOVAL) - vap->va_atime = vap->va_mtime; error = nfsrpc_setattr(newvp, vap, NULL, cnp->cn_cred, cnp->cn_thread, &nfsva, &attrflag, NULL); if (error && (vap->va_uid != (uid_t)VNOVAL || From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 04:12:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9C71F99; Wed, 31 Dec 2014 04:12:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1271939F3; Wed, 31 Dec 2014 04:12:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV4CdkN082707; Wed, 31 Dec 2014 04:12:39 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV4Cd1S082706; Wed, 31 Dec 2014 04:12:39 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412310412.sBV4Cd1S082706@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 31 Dec 2014 04:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276447 - stable/10/sys/amd64/vmm/io X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 04:12:51 -0000 Author: neel Date: Wed Dec 31 04:12:38 2014 New Revision: 276447 URL: https://svnweb.freebsd.org/changeset/base/276447 Log: MFC r276323 Implement "special mask mode" in vatpic. Modified: stable/10/sys/amd64/vmm/io/vatpic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/io/vatpic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vatpic.c Wed Dec 31 04:11:29 2014 (r276446) +++ stable/10/sys/amd64/vmm/io/vatpic.c Wed Dec 31 04:12:38 2014 (r276447) @@ -73,6 +73,7 @@ struct atpic { uint8_t request; /* Interrupt Request Register (IIR) */ uint8_t service; /* Interrupt Service (ISR) */ uint8_t mask; /* Interrupt Mask Register (IMR) */ + uint8_t smm; /* special mask mode */ int acnt[8]; /* sum of pin asserts and deasserts */ int lowprio; /* lowest priority irq */ @@ -131,8 +132,16 @@ vatpic_get_highest_isrpin(struct atpic * ATPIC_PIN_FOREACH(pin, atpic, i) { bit = (1 << pin); - if (atpic->service & bit) - return (pin); + if (atpic->service & bit) { + /* + * An IS bit that is masked by an IMR bit will not be + * cleared by a non-specific EOI in Special Mask Mode. + */ + if (atpic->smm && (atpic->mask & bit) != 0) + continue; + else + return (pin); + } } return (-1); @@ -153,6 +162,15 @@ vatpic_get_highest_irrpin(struct atpic * if (atpic->sfn) serviced &= ~(1 << 2); + /* + * In 'Special Mask Mode', when a mask bit is set in OCW1 it inhibits + * further interrupts at that level and enables interrupts from all + * other levels that are not masked. In other words the ISR has no + * bearing on the levels that can generate interrupts. + */ + if (atpic->smm) + serviced = 0; + ATPIC_PIN_FOREACH(pin, atpic, tmp) { bit = 1 << pin; @@ -261,6 +279,7 @@ vatpic_icw1(struct vatpic *vatpic, struc atpic->lowprio = 7; atpic->rd_cmd_reg = 0; atpic->poll = 0; + atpic->smm = 0; if ((val & ICW1_SNGL) != 0) { VATPIC_CTR0(vatpic, "vatpic cascade mode required"); @@ -375,8 +394,10 @@ vatpic_ocw3(struct vatpic *vatpic, struc VATPIC_CTR1(vatpic, "atpic ocw3 0x%x", val); if (val & OCW3_ESMM) { - VATPIC_CTR0(vatpic, "atpic special mask mode not implemented"); - return (-1); + atpic->smm = val & OCW3_SMM ? 1 : 0; + VATPIC_CTR2(vatpic, "%s atpic special mask mode %s", + master_atpic(vatpic, atpic) ? "master" : "slave", + atpic->smm ? "enabled" : "disabled"); } if (val & OCW3_RR) { From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 04:51:10 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACFA58A6; Wed, 31 Dec 2014 04:51:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E7392432; Wed, 31 Dec 2014 04:51:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV4pA3M000593; Wed, 31 Dec 2014 04:51:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV4pAx6000591; Wed, 31 Dec 2014 04:51:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412310451.sBV4pAx6000591@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 31 Dec 2014 04:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276448 - stable/10/contrib/binutils/gas X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 04:51:10 -0000 Author: pfg Date: Wed Dec 31 04:51:09 2014 New Revision: 276448 URL: https://svnweb.freebsd.org/changeset/base/276448 Log: MFC r276229: Backport fix for binutils 11867: .quad directive not assembled correctly Alan Modra (and Alan's employer) graciously permitted use of his patch under GPLv2. Obtained from: OpenBSD Modified: stable/10/contrib/binutils/gas/expr.c stable/10/contrib/binutils/gas/read.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/expr.c ============================================================================== --- stable/10/contrib/binutils/gas/expr.c Wed Dec 31 04:12:38 2014 (r276447) +++ stable/10/contrib/binutils/gas/expr.c Wed Dec 31 04:51:09 2014 (r276448) @@ -1040,6 +1040,15 @@ operand (expressionS *expressionP, enum { for (i = 0; i < expressionP->X_add_number; ++i) generic_bignum[i] = ~generic_bignum[i]; + + /* Extend the bignum to at least the size of .octa. */ + if (expressionP->X_add_number < SIZE_OF_LARGE_NUMBER) + { + expressionP->X_add_number = SIZE_OF_LARGE_NUMBER; + for (; i < expressionP->X_add_number; ++i) + generic_bignum[i] = ~(LITTLENUM_TYPE) 0; + } + if (c == '-') for (i = 0; i < expressionP->X_add_number; ++i) { @@ -1050,14 +1059,12 @@ operand (expressionS *expressionP, enum } else if (c == '!') { - int nonzero = 0; for (i = 0; i < expressionP->X_add_number; ++i) - { - if (generic_bignum[i]) - nonzero = 1; - generic_bignum[i] = 0; - } - generic_bignum[0] = nonzero; + if (generic_bignum[i] != 0) + break; + expressionP->X_add_number = i >= expressionP->X_add_number; + expressionP->X_op = O_constant; + expressionP->X_unsigned = 1; } } else if (expressionP->X_op != O_illegal Modified: stable/10/contrib/binutils/gas/read.c ============================================================================== --- stable/10/contrib/binutils/gas/read.c Wed Dec 31 04:12:38 2014 (r276447) +++ stable/10/contrib/binutils/gas/read.c Wed Dec 31 04:51:09 2014 (r276448) @@ -4117,15 +4117,32 @@ emit_expr (expressionS *exp, unsigned in unsigned int size; LITTLENUM_TYPE *nums; - know (nbytes % CHARS_PER_LITTLENUM == 0); - size = exp->X_add_number * CHARS_PER_LITTLENUM; if (nbytes < size) { - as_warn (_("bignum truncated to %d bytes"), nbytes); + int i = nbytes / CHARS_PER_LITTLENUM; + if (i != 0) + { + LITTLENUM_TYPE sign = 0; + if ((generic_bignum[--i] + & (1 << (LITTLENUM_NUMBER_OF_BITS - 1))) != 0) + sign = ~(LITTLENUM_TYPE) 0; + while (++i < exp->X_add_number) + if (generic_bignum[i] != sign) + break; + } + if (i < exp->X_add_number) + as_warn (_("bignum truncated to %d bytes"), nbytes); size = nbytes; } + if (nbytes == 1) + { + md_number_to_chars (p, (valueT) generic_bignum[0], 1); + return; + } + know (nbytes % CHARS_PER_LITTLENUM == 0); + if (target_big_endian) { while (nbytes > size) From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 04:52:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2529A70; Wed, 31 Dec 2014 04:52:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3F9D2486; Wed, 31 Dec 2014 04:52:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBV4qX7J003611; Wed, 31 Dec 2014 04:52:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBV4qX9l003608; Wed, 31 Dec 2014 04:52:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412310452.sBV4qX9l003608@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 31 Dec 2014 04:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276449 - stable/9/contrib/binutils/gas X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 04:52:34 -0000 Author: pfg Date: Wed Dec 31 04:52:32 2014 New Revision: 276449 URL: https://svnweb.freebsd.org/changeset/base/276449 Log: MFC r276229: Backport fix for binutils 11867: .quad directive not assembled correctly Alan Modra (and Alan's employer) graciously permitted use of his patch under GPLv2. Obtained from: OpenBSD Modified: stable/9/contrib/binutils/gas/expr.c stable/9/contrib/binutils/gas/read.c Directory Properties: stable/9/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/gas/expr.c ============================================================================== --- stable/9/contrib/binutils/gas/expr.c Wed Dec 31 04:51:09 2014 (r276448) +++ stable/9/contrib/binutils/gas/expr.c Wed Dec 31 04:52:32 2014 (r276449) @@ -1040,6 +1040,15 @@ operand (expressionS *expressionP, enum { for (i = 0; i < expressionP->X_add_number; ++i) generic_bignum[i] = ~generic_bignum[i]; + + /* Extend the bignum to at least the size of .octa. */ + if (expressionP->X_add_number < SIZE_OF_LARGE_NUMBER) + { + expressionP->X_add_number = SIZE_OF_LARGE_NUMBER; + for (; i < expressionP->X_add_number; ++i) + generic_bignum[i] = ~(LITTLENUM_TYPE) 0; + } + if (c == '-') for (i = 0; i < expressionP->X_add_number; ++i) { @@ -1050,14 +1059,12 @@ operand (expressionS *expressionP, enum } else if (c == '!') { - int nonzero = 0; for (i = 0; i < expressionP->X_add_number; ++i) - { - if (generic_bignum[i]) - nonzero = 1; - generic_bignum[i] = 0; - } - generic_bignum[0] = nonzero; + if (generic_bignum[i] != 0) + break; + expressionP->X_add_number = i >= expressionP->X_add_number; + expressionP->X_op = O_constant; + expressionP->X_unsigned = 1; } } else if (expressionP->X_op != O_illegal Modified: stable/9/contrib/binutils/gas/read.c ============================================================================== --- stable/9/contrib/binutils/gas/read.c Wed Dec 31 04:51:09 2014 (r276448) +++ stable/9/contrib/binutils/gas/read.c Wed Dec 31 04:52:32 2014 (r276449) @@ -4117,15 +4117,32 @@ emit_expr (expressionS *exp, unsigned in unsigned int size; LITTLENUM_TYPE *nums; - know (nbytes % CHARS_PER_LITTLENUM == 0); - size = exp->X_add_number * CHARS_PER_LITTLENUM; if (nbytes < size) { - as_warn (_("bignum truncated to %d bytes"), nbytes); + int i = nbytes / CHARS_PER_LITTLENUM; + if (i != 0) + { + LITTLENUM_TYPE sign = 0; + if ((generic_bignum[--i] + & (1 << (LITTLENUM_NUMBER_OF_BITS - 1))) != 0) + sign = ~(LITTLENUM_TYPE) 0; + while (++i < exp->X_add_number) + if (generic_bignum[i] != sign) + break; + } + if (i < exp->X_add_number) + as_warn (_("bignum truncated to %d bytes"), nbytes); size = nbytes; } + if (nbytes == 1) + { + md_number_to_chars (p, (valueT) generic_bignum[0], 1); + return; + } + know (nbytes % CHARS_PER_LITTLENUM == 0); + if (target_big_endian) { while (nbytes > size) From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 10:03:20 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF962DE9; Wed, 31 Dec 2014 10:03:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB2E76724D; Wed, 31 Dec 2014 10:03:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVA3K6O049017; Wed, 31 Dec 2014 10:03:20 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVA3KRW049012; Wed, 31 Dec 2014 10:03:20 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201412311003.sBVA3KRW049012@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 31 Dec 2014 10:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276465 - in stable/10: . sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 10:03:20 -0000 Author: bz Date: Wed Dec 31 10:03:19 2014 New Revision: 276465 URL: https://svnweb.freebsd.org/changeset/base/276465 Log: MFC r276462: Bump copyright year. Happy New Year 2015! Modified: stable/10/COPYRIGHT stable/10/sys/sys/copyright.h Directory Properties: stable/10/ (props changed) Modified: stable/10/COPYRIGHT ============================================================================== --- stable/10/COPYRIGHT Wed Dec 31 10:02:04 2014 (r276464) +++ stable/10/COPYRIGHT Wed Dec 31 10:03:19 2014 (r276465) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2014 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2015 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/10/sys/sys/copyright.h ============================================================================== --- stable/10/sys/sys/copyright.h Wed Dec 31 10:02:04 2014 (r276464) +++ stable/10/sys/sys/copyright.h Wed Dec 31 10:03:19 2014 (r276465) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2014 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2015 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2014 The FreeBSD Project.\n" + "Copyright (c) 1992-2015 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 10:04:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 308F2FAE; Wed, 31 Dec 2014 10:04:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2EE6726D; Wed, 31 Dec 2014 10:04:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVA4gfq049267; Wed, 31 Dec 2014 10:04:42 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVA4gnx049265; Wed, 31 Dec 2014 10:04:42 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201412311004.sBVA4gnx049265@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 31 Dec 2014 10:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276466 - in stable/9: . sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 10:04:43 -0000 Author: bz Date: Wed Dec 31 10:04:41 2014 New Revision: 276466 URL: https://svnweb.freebsd.org/changeset/base/276466 Log: MFC r276462: Bump copyright year. Happy New Year 2015! Modified: stable/9/COPYRIGHT (contents, props changed) stable/9/sys/sys/copyright.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/COPYRIGHT ============================================================================== --- stable/9/COPYRIGHT Wed Dec 31 10:03:19 2014 (r276465) +++ stable/9/COPYRIGHT Wed Dec 31 10:04:41 2014 (r276466) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2014 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2015 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/9/sys/sys/copyright.h ============================================================================== --- stable/9/sys/sys/copyright.h Wed Dec 31 10:03:19 2014 (r276465) +++ stable/9/sys/sys/copyright.h Wed Dec 31 10:04:41 2014 (r276466) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2014 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2015 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2014 The FreeBSD Project.\n" + "Copyright (c) 1992-2015 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 10:05:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF80C221; Wed, 31 Dec 2014 10:05:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB6C96728C; Wed, 31 Dec 2014 10:05:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVA5hMO049509; Wed, 31 Dec 2014 10:05:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVA5hp4049504; Wed, 31 Dec 2014 10:05:43 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201412311005.sBVA5hp4049504@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 31 Dec 2014 10:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r276467 - in stable/8: . sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 10:05:44 -0000 Author: bz Date: Wed Dec 31 10:05:42 2014 New Revision: 276467 URL: https://svnweb.freebsd.org/changeset/base/276467 Log: MFC r276462: Bump copyright year. Happy New Year 2015! Modified: stable/8/COPYRIGHT (contents, props changed) stable/8/sys/sys/copyright.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/COPYRIGHT ============================================================================== --- stable/8/COPYRIGHT Wed Dec 31 10:04:41 2014 (r276466) +++ stable/8/COPYRIGHT Wed Dec 31 10:05:42 2014 (r276467) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2014 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2015 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/8/sys/sys/copyright.h ============================================================================== --- stable/8/sys/sys/copyright.h Wed Dec 31 10:04:41 2014 (r276466) +++ stable/8/sys/sys/copyright.h Wed Dec 31 10:05:42 2014 (r276467) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2014 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2015 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2014 The FreeBSD Project.\n" + "Copyright (c) 1992-2015 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 15:54:07 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F32A9FB2 for ; Wed, 31 Dec 2014 15:54:07 +0000 (UTC) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A037930D6 for ; Wed, 31 Dec 2014 15:54:07 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id bs8so27174705wib.5 for ; Wed, 31 Dec 2014 07:54:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=vml4svQiY6zqyiL38XUsG9VZMRR83ngwnsCqyhoqHn0=; b=gssWrHEv9vQuXbTbWg2v3OBGOHKqeUdjx0lDFiYLX4RnOnI+mdVEbZGoX+VfDLditR W3y0GwxALsPwt95Dg2ge0MfMo6L4mJq4YF4ztTSLBZsPKrVDMEzALILLp7faFmGbDRCC I1+ozSh4Qb+zclsIGAOoI4oBLESm4FqiyrrBizvjBVOIDw1gTAOIBGWy+viN+PsqUnaW 0CHchCGrQEs8O3MK8UPMsYgM1NHM42vLJdqSzuqcdKD3HDDwa+H2wukJ1NHhI8jCO/hu 7ZBVD/AXs1m80WjEv5zuNdD3D3NnUhkdLNtEd7WdvDM0Su/0e4/Kjnun7QYYw7qvGYMe GmrQ== X-Gm-Message-State: ALoCoQkFKOtfqvvEkrVnRedzaTsAAiT7aGc6iDj3Ex4Jsz8Nw8NXh5J+Ug2j9SK4Q3fhhaDr8sYx X-Received: by 10.194.93.5 with SMTP id cq5mr126519606wjb.84.1420041240322; Wed, 31 Dec 2014 07:54:00 -0800 (PST) Received: from [192.168.1.32] (81.184.188.119.dyn.user.ono.com. [81.184.188.119]) by mx.google.com with ESMTPSA id gs10sm47523479wib.12.2014.12.31.07.53.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Dec 2014 07:53:59 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r276423 - stable/10/share/mk From: Julio Merino In-Reply-To: <201412302046.sBUKk2B3049040@svn.freebsd.org> Date: Wed, 31 Dec 2014 16:54:28 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201412302046.sBUKk2B3049040@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 15:54:08 -0000 On Dec 30, 2014, at 21:46, Garrett Cooper wrote: > Author: ngie > Date: Tue Dec 30 20:46:01 2014 > New Revision: 276423 > URL: https://svnweb.freebsd.org/changeset/base/276423 >=20 > Log: > MFC r274077: >=20 > As an optimization (in simple, well used cases) only call cat = ${.ALLSRC} when > generating files from various sources instead of calling cat = ${.ALLSRC} | sed Is there any visible effect to this optimization? Otherwise, the extra = complexity does not seem warranted.= From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 16:28:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0502EE9B; Wed, 31 Dec 2014 16:28:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9D6B35F8; Wed, 31 Dec 2014 16:28:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVGSHjX030735; Wed, 31 Dec 2014 16:28:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVGSHSY030734; Wed, 31 Dec 2014 16:28:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412311628.sBVGSHSY030734@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 31 Dec 2014 16:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276471 - in stable: 10/contrib/binutils/gas/config 7/contrib/binutils/gas/config 8/contrib/binutils/gas/config 9/contrib/binutils/gas/config X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 16:28:18 -0000 Author: dim Date: Wed Dec 31 16:28:16 2014 New Revision: 276471 URL: https://svnweb.freebsd.org/changeset/base/276471 Log: MFC r276346: In contrib/binutils/gas/config/tc-ppc.c, fix a few -Wformat-security warnings. Modified: stable/9/contrib/binutils/gas/config/tc-ppc.c Directory Properties: stable/9/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/gas/config/tc-ppc.c stable/7/contrib/binutils/gas/config/tc-ppc.c stable/8/contrib/binutils/gas/config/tc-ppc.c Directory Properties: stable/10/ (props changed) stable/7/contrib/binutils/ (props changed) stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/gas/config/tc-ppc.c ============================================================================== --- stable/9/contrib/binutils/gas/config/tc-ppc.c Wed Dec 31 16:15:43 2014 (r276470) +++ stable/9/contrib/binutils/gas/config/tc-ppc.c Wed Dec 31 16:28:16 2014 (r276471) @@ -1548,7 +1548,7 @@ ppc_insert_operand (unsigned long insn, errmsg = NULL; insn = (*operand->insert) (insn, (long) val, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad_where (file, line, errmsg); + as_bad_where (file, line, "%s", errmsg); } else insn |= ((long) val & operand->bitm) << operand->shift; @@ -2279,7 +2279,7 @@ md_assemble (char *str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); continue; } @@ -2292,7 +2292,7 @@ md_assemble (char *str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); } if ((operand->flags & PPC_OPERAND_NEXT) != 0) next_opindex = *opindex_ptr + 1; From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 16:28:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1963E9C; Wed, 31 Dec 2014 16:28:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8214335F9; Wed, 31 Dec 2014 16:28:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVGSIG4030741; Wed, 31 Dec 2014 16:28:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVGSIgM030740; Wed, 31 Dec 2014 16:28:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412311628.sBVGSIgM030740@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 31 Dec 2014 16:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r276471 - in stable: 10/contrib/binutils/gas/config 7/contrib/binutils/gas/config 8/contrib/binutils/gas/config 9/contrib/binutils/gas/config X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 16:28:18 -0000 Author: dim Date: Wed Dec 31 16:28:16 2014 New Revision: 276471 URL: https://svnweb.freebsd.org/changeset/base/276471 Log: MFC r276346: In contrib/binutils/gas/config/tc-ppc.c, fix a few -Wformat-security warnings. Modified: stable/8/contrib/binutils/gas/config/tc-ppc.c Directory Properties: stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/gas/config/tc-ppc.c stable/7/contrib/binutils/gas/config/tc-ppc.c stable/9/contrib/binutils/gas/config/tc-ppc.c Directory Properties: stable/10/ (props changed) stable/7/contrib/binutils/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/8/contrib/binutils/gas/config/tc-ppc.c ============================================================================== --- stable/8/contrib/binutils/gas/config/tc-ppc.c Wed Dec 31 16:15:43 2014 (r276470) +++ stable/8/contrib/binutils/gas/config/tc-ppc.c Wed Dec 31 16:28:16 2014 (r276471) @@ -1474,7 +1474,7 @@ ppc_insert_operand (insn, operand, val, errmsg = NULL; insn = (*operand->insert) (insn, (long) val, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad_where (file, line, errmsg); + as_bad_where (file, line, "%s", errmsg); } else insn |= (((long) val & ((1 << operand->bits) - 1)) @@ -2210,7 +2210,7 @@ md_assemble (str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); continue; } @@ -2223,7 +2223,7 @@ md_assemble (str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); } if ((operand->flags & PPC_OPERAND_NEXT) != 0) next_opindex = *opindex_ptr + 1; From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 16:28:20 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24D58F6F; Wed, 31 Dec 2014 16:28:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBB4A35FB; Wed, 31 Dec 2014 16:28:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVGSJrf030759; Wed, 31 Dec 2014 16:28:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVGSJeb030758; Wed, 31 Dec 2014 16:28:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412311628.sBVGSJeb030758@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 31 Dec 2014 16:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r276471 - in stable: 10/contrib/binutils/gas/config 7/contrib/binutils/gas/config 8/contrib/binutils/gas/config 9/contrib/binutils/gas/config X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 16:28:20 -0000 Author: dim Date: Wed Dec 31 16:28:16 2014 New Revision: 276471 URL: https://svnweb.freebsd.org/changeset/base/276471 Log: MFC r276346: In contrib/binutils/gas/config/tc-ppc.c, fix a few -Wformat-security warnings. Modified: stable/7/contrib/binutils/gas/config/tc-ppc.c Directory Properties: stable/7/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/gas/config/tc-ppc.c stable/8/contrib/binutils/gas/config/tc-ppc.c stable/9/contrib/binutils/gas/config/tc-ppc.c Directory Properties: stable/10/ (props changed) stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/binutils/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/7/contrib/binutils/gas/config/tc-ppc.c ============================================================================== --- stable/7/contrib/binutils/gas/config/tc-ppc.c Wed Dec 31 16:15:43 2014 (r276470) +++ stable/7/contrib/binutils/gas/config/tc-ppc.c Wed Dec 31 16:28:16 2014 (r276471) @@ -1474,7 +1474,7 @@ ppc_insert_operand (insn, operand, val, errmsg = NULL; insn = (*operand->insert) (insn, (long) val, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad_where (file, line, errmsg); + as_bad_where (file, line, "%s", errmsg); } else insn |= (((long) val & ((1 << operand->bits) - 1)) @@ -2210,7 +2210,7 @@ md_assemble (str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); continue; } @@ -2223,7 +2223,7 @@ md_assemble (str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); } if ((operand->flags & PPC_OPERAND_NEXT) != 0) next_opindex = *opindex_ptr + 1; From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 16:28:19 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D126E9D; Wed, 31 Dec 2014 16:28:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D81535FA; Wed, 31 Dec 2014 16:28:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVGSJc7030749; Wed, 31 Dec 2014 16:28:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVGSJG6030748; Wed, 31 Dec 2014 16:28:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412311628.sBVGSJG6030748@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 31 Dec 2014 16:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276471 - in stable: 10/contrib/binutils/gas/config 7/contrib/binutils/gas/config 8/contrib/binutils/gas/config 9/contrib/binutils/gas/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 16:28:19 -0000 Author: dim Date: Wed Dec 31 16:28:16 2014 New Revision: 276471 URL: https://svnweb.freebsd.org/changeset/base/276471 Log: MFC r276346: In contrib/binutils/gas/config/tc-ppc.c, fix a few -Wformat-security warnings. Modified: stable/10/contrib/binutils/gas/config/tc-ppc.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/binutils/gas/config/tc-ppc.c stable/8/contrib/binutils/gas/config/tc-ppc.c stable/9/contrib/binutils/gas/config/tc-ppc.c Directory Properties: stable/7/contrib/binutils/ (props changed) stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/binutils/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-ppc.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-ppc.c Wed Dec 31 16:15:43 2014 (r276470) +++ stable/10/contrib/binutils/gas/config/tc-ppc.c Wed Dec 31 16:28:16 2014 (r276471) @@ -1548,7 +1548,7 @@ ppc_insert_operand (unsigned long insn, errmsg = NULL; insn = (*operand->insert) (insn, (long) val, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad_where (file, line, errmsg); + as_bad_where (file, line, "%s", errmsg); } else insn |= ((long) val & operand->bitm) << operand->shift; @@ -2279,7 +2279,7 @@ md_assemble (char *str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); continue; } @@ -2292,7 +2292,7 @@ md_assemble (char *str) { insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg); if (errmsg != (const char *) NULL) - as_bad (errmsg); + as_bad ("%s", errmsg); } if ((operand->flags & PPC_OPERAND_NEXT) != 0) next_opindex = *opindex_ptr + 1; From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 20:13:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 561A586C; Wed, 31 Dec 2014 20:13:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EF492FFB; Wed, 31 Dec 2014 20:13:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVKDeT2044650; Wed, 31 Dec 2014 20:13:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVKDWpR044612; Wed, 31 Dec 2014 20:13:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412312013.sBVKDWpR044612@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 31 Dec 2014 20:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276478 - in stable/10: contrib/netbsd-tests contrib/netbsd-tests/include contrib/netbsd-tests/lib/libc/db contrib/netbsd-tests/lib/libc/gen contrib/netbsd-tests/lib/libc/gen/posix_spaw... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 20:13:40 -0000 Author: ngie Date: Wed Dec 31 20:13:31 2014 New Revision: 276478 URL: https://svnweb.freebsd.org/changeset/base/276478 Log: MFC r272343,r272458,r272890,r272891,r272901,r272902,r272903,r272905,r272908,r272909,r272910,r272914,r272915,r272979,r272980,r273010,r273011,r273012,r273015,r273017,r273019,r273020,r273021,r273022,r273023,r273024,r273025,r273389,r273390,r273391,r273393,r273395,r273396,r273397,r273410,r273516,r273517,r273520,r273521,r273522,r273523,r273524,r273525,r273526,r273527,r273528,r273529,r273530,r273533,r273534,r273535,r273536,r273537,r273538,r273539,r273540,r273572,r273574,r273578,r273579,r273591,r273592,r273928,r273933,r273935,r273936,r273937,r273938,r273942,r273943,r273945,r273946,r273947,r273948,r273949,r273950,r273951,r273952,r274061,r274062,r274066,r274067,r274072,r274074,r274079,r274090,r274142,r274143,r274571,r274572,r274573,r274574,r274575,r274576,r274577,r274579,r274597,r274598,r274599,r274600,r274601,r274626,r275033,r276046,r276430: r272343: r272458: Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 , minus the vendor Makefiles Provide directions for how to bootstrap the vendor sources in FREEBSD-upgrade MFC after 2 weeks Discussed with: rpaulo Sponsored by: EMC / Isilon Storage Division r272890: Only build/run hsearch_basic and hsearch_r_basic on NetBSD hdestroy1 is not present on FreeBSD Sponsored by: EMC / Isilon Storage Division r272891: Expect SIGSEGV in lib/libc/stdlib/t_getenv:setenv_basic See bin/189805 for more details In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r272901: Disable tests that don't pass on FreeBSD due to missing support in humanize_number(3). Bringing in additional revisions from NetBSD's humanize_number(3) will fix the tests Account for the fact that util.h on NetBSD is libutil.h on FreeBSD Submitted by: pho Sponsored by: EMC / Isilon Storage Division r272902: Add missing #include for gettimeofday Sponsored by: EMC / Isilon Storage Division r272903: FreeBSD returns ENOTTY instead of EBADF in ttyname_r; mark it as an expected failure PR: 191936 In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r272905: FreeBSD doesn't support strings greater than MAXHOSTNAMELEN-1 in {get,set}{domain,host}name. Adjust the tests to not exceed that value when testing out the code Add a positive and negative test for MAXHOSTNAMELEN-1 and MAXHOSTNAMELEN, respectively PR: 181127 In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r272908: Disable the invalid pointer test on FreeBSD FreeBSD segfaults on invalid pointers passed to getcwd because it throbs the address passed in in libc, whereas NetBSD just passes the information off to the syscall, which allows the kernel to return EFAULT on bad pointers. In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r272909: Handle getting/setting niceness/priority correctly on FreeBSD vs NetBSD This might be fallout from PR: 189821 Submitted by: pho Sponsored by: EMC / Isilon Storage Division r272910: SIGPWR does not exist on FreeBSD Sponsored by: EMC / Isilon Storage Division r272914: Skip over t_spawn_open_nonexistent_diag because it requires NetBSD specific additions to posix_spawn Sponsored by: EMC / Isilon Storage Division r272915: Port the testcase to FreeBSD - Make #include path to h_macros.h a non-relative path - __gl_stat_t is synonymous with struct stat on FreeBSD - FreeBSD doesn't have _DIRENT_RECLEN - Skip over glob_star on FreeBSD (testcase doesn't pass) In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r272979: Only #include on NetBSD Sponsored by: EMC / Isilon Storage Division r272980: #include libutil.h for fparseln on FreeBSD Sponsored by: EMC / Isilon Storage Division r273010: Implement 64MB memory limit for test to ensure that it fails reliably in 600 seconds; it would previously fail inconsistently when run in some virtual machine configurations This patch might need to be reverted or revisited later (see the attached PR for more details) PR: 169302 Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273011: Fix compilation errors with missing wide-type headers and fix compilation warnings with -Wformat In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r273012: - Add libutil #include for fparseln - Change ATF_REQUIRE_EQ_MSG to ATF_CHECK_EQ_MSG to gather all failing results possible (currently 12 with leftassoc) - Mark leftassoc "atf_tc_expect_fail" on FreeBSD (PR coming soon after further analysis is done on the code) In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r273015: Expect nice_err to fail on FreeBSD with unprivileged users PR: 189821 Sponsored by: EMC / Isilon Storage Division r273017: Add #include for printf Sponsored by: EMC / Isilon Storage Division r273019: Do initial port of contrib/netbsd-tests/lib/libc/locale t_io: - Expect failures potentially related to implementation-specific knowledge of the zh_TW.Big5 locale [*] t_mbrtowc: - Handle unknown locales more gracefully (do not test if the locale doesn't exist) - Expect failure with mbrtowc_internal dealing with Japanese locales (potentially related to implementation detail knowledge of the ja_* locales) [*]. t_mbstowcs, t_mbtowc, t_wctomb: - Handle unknown locales more gracefully (do not test if the locale doesn't exist) t_wcstod: - Treat FreeBSD like NetBSD and Linux in the XXX: FIXME section [*] More investigation is required to determine the root cause of the failures Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273020: memmem with NUL length "needle" (aka small) strings on FreeBSD/OSX returns NULL instead of the "haystack" value (aka big) Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273021: Use 1 as a random seed, as recommended in srandom(3). Adjust the random values accordingly Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273022: Add #include to get sys_nerr definition Sponsored by: EMC / Isilon Storage Division r273023: __isnanl is automatically picked according to data type in . There isn't a need for the explicit __isnanl test Sponsored by: EMC / Isilon Storage Division r273024: Only test the return value in mktime_negyear Testing for the errno is an optional requirement according to POSIX, and FreeBSD doesn't document that errno would be set on failure with mktime Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273025: Change ATF_REQUIRE_MSG calls to ATF_CHECK_MSG to get as many errors as possible t_strptime:common.. - Expect the testcase body as a whole to fail. Multiple PRs will be filed to track the issues (there are 18 check failures) t_strptime:day.. - %EA and %OA seem to be case insensitive on FreeBSD r273389: Port lib/libc/gen/t_siginfo to FreeBSD - mcontext_t on FreeBSD doesn't have a __gregs field (it's split out on FreeBSD into separate fields). In order to avoid muddying the test code with MD code, the debugging trace info has not been implemented - FreeBSD does not implement the si_stime and si_utime fields in siginfo_t, so omit the debugging code that dumps the values - sys/inttypes.h doesn't exist on FreeBSD Sponsored by: EMC / Isilon Storage Division r273390: libutil.h is required for fparseln on FreeBSD Sponsored by: EMC / Isilon Storage Division r273391: Add missing #include for sys/stat.h for fchmod Sponsored by: EMC / Isilon Storage Division r273393: Port t_write to FreeBSD - Mark the signo variable for the signal handle __unused - Use limits.h instead of sys/syslimits.h (the latter does not exist on FreeBSD) Sponsored by: EMC / Isilon Storage Division r273395: Mark osi __unused so this compiles cleanly on FreeBSD Sponsored by: EMC / Isilon Storage Division r273396: unlink("/") fails with EISDIR instead of EBUSY on FreeBSD; test for that instead Sponsored by: EMC / Isilon Storage Division r273397: Port t_chroot to FreeBSD - Add missing #include sys/stat.h for mkdir(2) - Omit the fchroot(2) tests because the support is not present on FreeBSD Sponsored by: EMC / Isilon Storage Division r273410: Add sys/socket.h #include for bind(2), et al Sponsored by: EMC / Isilon Storage Division r273516: Add netinet/in.h for struct sockaddr_in Sponsored by: EMC / Isilon Storage Division r273517: Expect getgroups_err to fail on FreeBSD PR: 189941 Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273520: Port t_pipe2.c to FreeBSD - Omit the pipe2_nosigpipe testcase on FreeBSD (FreeBSD doesn't have O_NOSIGPIPE). - Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)". - Save and restore the resource limit on the number of files (RLIMIT_NOFILE). In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r273521: Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)" Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273522: - Mark unused parameters __unused in handler - Call sigqueue with getpid() instead of 0 -- the latter idiom appears to only be valid on NetBSD In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r273523: Add limits.h #include for LINE_MAX Sponsored by: EMC / Isilon Storage Division r273524: Add sys/socket.h #include for struct sockaddr_in Sponsored by: EMC / Isilon Storage Division r273525: Port t_mmap.c to FreeBSD - Add needed headers for the testcases - Omit mmap_block on non-NetBSD OSes - Use "security.bsd.map_at_zero" instead of "vm.user_va0_disable" Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273526: Omit the pollts testcases on FreeBSD Sponsored by: EMC / Isilon Storage Division r273527: Omit all of the testcases as revoke(2) is only implemented on devfs(5) Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273528: Mark signo __unused in handler(..) Sponsored by: EMC / Isilon Storage Division r273529: - Omit the poll testcases on FreeBSD (they require pollts) - Add necessary headers for the testcases Sponsored by: EMC / Isilon Storage Division r273530: Add limits.h #include for INT_MAX Sponsored by: EMC / Isilon Storage Division r273533: Use /truncate_test.root_owned instead of /usr/bin/fpr as fpr does not exist on FreeBSD truncate_test.root_owned will be generated at build time and owned by root In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r273534: - Mark sig/signo __unused - Do not provide a relative path via #include "h_macros.h" Sponsored by: EMC / Isilon Storage Division r273535: - Omit setrlimit_nthr testcase on FreeBSD (requires lwp.h, et al) - Expect overflow with rlim_max at INT64_MAX, not UINT64_MAX (rlim_t is int64_t on FreeBSD) In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r273536: Add limits.h #include for SSIZE_MAX Sponsored by: EMC / Isilon Storage Division r273537: Add limits.h #include for SSIZE_MAX Sponsored by: EMC / Isilon Storage Division r273538: Fix a typo (__FreeBSD__ -> __NetBSD__ when omitting setrlimit_nthr) r273539: Mark signum __unused Sponsored by: EMC / Isilon Storage Division r273540: Omit the mprotect_exec testcase on FreeBSD Sponsored by: EMC / Isilon Storage Division r273572: - Ignore EINVAL check with mknod(path, S_IFCHR, -1) as the testcase is always executed on a non-devfs filesystem - Expect mknod(path, S_IFREG, 0) to fail on FreeBSD Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273574: - Test for EINVAL requirement when passing an invalid flag in to msync(2) - Expect ENOMEM instead of EFAULT when msync'ing a previously munmap'ed region on FreeBSD Submitted by: pho Sponsored by: EMC / Isilon Storage Division r273578: - Add inttypes.h and stdint.h in lieu of int_limits.h from NetBSD - Use #include "h_macros.h" instead of relative path analog Sponsored by: EMC / Isilon Storage Division r273579: - Mark signo __unused in the signal handler function - Effectively #if 0 out some code that does not fail on FreeBSD In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r273591: Correct my previous commit: - getrusage_utime_back succeeds reliably on FreeBSD - getrusage_utime_zero passes/fails in a seemingly non-deterministic manner. Skip it for now (and fix it later) In the initial port of this testcase to FreeBSD, the results failed reliably in the same manner as it does on NetBSD Sponsored by: EMC / Isilon Storage Division r273592: - Add sys/types.h for the APIs in sys/sysctl.h - Poke at VM_MIN_ADDRESS in machine/vmparam.h because FreeBSD doesn't have a vm.minaddress sysctl analog - Expect ENOMEM instead of EAGAIN in mlock_limits - Provide mlock an mmap'ed page twice to simulate MAP_WIRED on NetBSD In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r273928: Put mtree test files into a subdirectory. Kyua 0.11 points TMPDIR to the test's work directory, and atf_check creates auxiliary files in TMPDIR. This confuses a couple of mtree tests that were using the work directory's root to validate the contents of the directory. Fix the two affected tests by creating an auxiliary directory to use for the mtree tests. (Kyua should probably do this on its own; filed bug #133 upstream to take a look at this.) r273933: Don't prune duplicate services in the expected output from /etc/services on FreeBSD Submitted by: pho r273935: Port tests to FreeBSD/Linux Some of the testcases don't work outside of NetBSD, and the behavior of ether_aton_r differs between FreeBSD, Linux, and NetBSD, and the calls to the API need to be massaged for FreeBSD and Linux. Submitted by: pho r273936: Port lib/libc/net/h_dns_server to FreeBSD Submitted by: pho r273937: Port lib/libc/sys/t_dup to FreeBSD/Linux - The requirements differ between FreeBSD/Linux when dealing with oldd/newd being equal (both fail with EINVAL, not EBADF) - Add an EBADF testcase - Fix compilation issues on clang In collaboration with: pho r273938: getitimer on FreeBSD returns the last set time instead of the remaining time; test for that instead Submitted by: pho r273942: Skip :sethostname_basic because it messes up the test host's hostname Convert code from #if defined(__FreeBSD__) to #ifdef __FreeBSD__ r273943: Port t_kevent to FreeBSD Submitted by: pho r273945: Port t_mincore to FreeBSD Mark :mincore_resid as atf_tc_expect_fail on FreeBSD because of new bug discovered in running the tests (it succeeded from earlier on in the year to September/October on FreeBSD, at least) Submitted by: pho r273946: Port h_atexit to FreeBSD __cxa_atexit varies between FreeBSD and NetBSD, and thus we must use pointers instead of static fields in the BSS. More extensive discussion is included in the source code In collaboration with: kib Submitted by: pho r273947: Expect :snprintf_posarg_error to blow up with a SIGSEGV on !NetBSD OSes r273948: Disable testcases 12 and 15-22 on FreeBSD Submitted by: pho r273949: Add new atf_tc_expect_fail to fflush_err; this is a new (within the past couple months) bug r273950: Skip :fopen_regular on !NetBSD because it's a NetBSD specific test Submitted by: pho r273951: Expect :sscanf_whitespace to fail on !NetBSD OSes Submitted by: pho r273952: Port h_hash and t_sha2 to FreeBSD t_sha2 contains dirty copy-paste hacks that need to be fixed with the openssh OpenBSD compat layer Submitted by: pho r274061: Port t_db.sh to FreeBSD - The blocksize on FreeBSD is 32kB, not 64kB - Add some detection for MK_DICT == no; /nonexistent is echoed along with atf_skip to ensure that the test will fail if dict(..) is called in the non-final stage of the pipeline Submitted by: pho r274062: inet_network on FreeBSD returns NULL when provided "0x" to inet_network Submitted by: pho r274066: Port lib/libc/ssp to FreeBSD In most cases, the buffers and data were resized, but when dealing with the helpers, some of the code was adjusted to fail more reliably Submitted by: pho r274067: rpc_control on FreeBSD is a public-ish API (not prefixed with __), not private like NetBSD Submitted by: pho r274072: Finish off lib/libc/stdlib/t_strtod.c port by checking for "y" twice on FreeBSD, and always assume long long double exists on FreeBSD Submitted by: pho r274074: Add Makefile snippet to ease porting NetBSD testcases to FreeBSD from contrib/netbsd-tests This Makefile snippet handles polluting testcases with -lnetbsd, specific headers for ATF version differences, and does necessary rewriting for the testcases to match the format discussed on the TestSuite wiki page (t_ -> _test) One must define SRCTOP (inspired by projects/bmake), OBJTOP, and TESTSRC (e.g. contrib/netbsd-tests/lib/libc/gen) to use the Makefile snippet Test programs are specific either via NETBSD_ATF_TESTS_C or NETBSD_ATF_TESTS_SH C++ analogs aren't currently implemented. The imported testcases will be cleaned up to use this Makefile snippet pseudo "API". r274079: Import proper fix for misc/49356 (/usr/include/atf-c/config.h) after atf-c/config.h was removed from the build Pointyhat to: me (again, for not running make delete-old after running test builds) r274090: Fix the Jenkins test run by skipping the negative testcases earlier The problem is that lib.libc.locale.t_io:bad_big5_wprintf was printing out illegal Unicode characters, which causes XML parsers to bail immediately, e.g. % kyua report-junit > ~/report.junit % python2 -c 'import xml.dom.minidom as md; md.parse("/home/ngie/report.junit")' Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 1918, in parse return expatbuilder.parse(file) File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse result = builder.parseFile(fp) File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile parser.Parse(buffer, 0) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 27137, column 13 r274142: Remove expected failure from lib.libc.sys.t_mincore:mincore_resid The failure was added based on observation seen on 11.0-CURRENT @ r273153, not based on internal testing at EMC/Isilon PR: 194829 Tested with the following configuration: - amd64/i386 - 11.0-CURRENT @ r273153 - 100 times in a tight loop as root with the following commands... -- kyua test lib/libc -- kyua test lib/libc/sys -- kyua test lib/libc/sys/mincore_test r274143: Expect lib.libc.sys.getcontext_test.setcontext_link to fail on amd64; add additional debugging to make the underlying problem more visible Calling setcontext(2) on amd64 as shown in the test program is failing on amd64, not i386, with a return code of -1 and an errno of EINVAL Further investigation is being done in the PR to determine the root cause for the failure PR: 194828 Tested with the following configuration: - amd64/i386 - 11.0-CURRENT @ r273153 - 100 times in a tight loop as root with the following commands... -- kyua test lib/libc -- kyua test lib/libc/sys -- kyua test lib/libc/sys/getcontext_test r274571: Use _exit instead of exit so the file descriptors aren't flushed twice in the child processes Submitted by: pho r274572: Only expect timeouts on powerpc with NetBSD Submitted by: pho r274573: Expect :pthread_detach to fail with EINVAL instead of ESRCH on FreeBSD PR: 191906 In collaboration with: pho r274574: Add pthread_np.h #include and initialize the pthread attribute on FreeBSD Submitted by: pho r274575: #ifdef out a printf on !NetBSD that causes the testcase to fail when comparing the output from the helper program Submitted by: pho r274576: Port helper program to FreeBSD, similar to ../../lib/libc/stdlib/h_atexit.c Submitted by: pho In collaboration with: kib r274577: Add missing sys/time.h #include for timespecsub macro in lib/libnetbsd/sys/time.h r274579: Call sem_unlink on semaphores before attempting to create them Due to the lack of uniqueness in the semaphore name, and the fact that the tests don't have cleanup routines, an interrupted test can leave a semaphore "laying around", causing all subsequent attempts to run the test to fail I will file a NetBSD PR for this issue soon r274597: Skip the long-double epsilon checks on FreeBSD/i386 Sponsored by: EMC / Isilon Storage Division r274598: Reset errno to 0 before running scalbn to be sure that the tested errno is valid Sponsored by: EMC / Isilon Storage Division r274599: Alias isinff to isinf on FreeBSD isinf on FreeBSD automatically picks the appropriate type per math.h Sponsored by: EMC / Isilon Storage Division r274600: - Expect exp2_powers to fail on FreeBSD/i386 - Expect exp2_values to fail on FreeBSD due to the small epsilon Sponsored by: EMC / Isilon Storage Division r274601: - Skip over the testcases that call cbrtl on platforms where LDBL_PREC == 53 (arm, mips, powerpc). This fixes the build on these platforms, based on some ad hoc tinderbox runs I did a while ago - Skip cast the arguments to powl as long double so powl properly interprets those arugments at compile-time when picking the type Sponsored by: EMC / Isilon Storage Division r274626: Mechanically replace #if defined(__FreeBSD__) and #if defined(__NetBSD__) with their #ifdef equivalents for everything changed in contrib/netbsd-tests. There are some items from the vendor tree that use #if defined(__FreeBSD__) or #if defined(__NetBSD__) which are being left alone Requested by: bde, rpaulo Sponsored by: EMC / Isilon Storage Division r275033: Only pass 6 arguments to the 'run' function on amd64. amd64's makecontext on FreeBSD only supports a maximum of 6 arguments. This fixes the setcontext_link test on amd64. PR: 194828 r276046: Add __FreeBSD_version guards around hsearch_r to ease MFCing the code to stable/10 It was added when __FreeBSD_version was ~1100027 r276430: Expect access_test:access_inval to fail before __FreeBSD_version == 1100033 This will allow me to MFC the test, as jilles@ requested that I don't MFC the access(2) KBI change to 10-STABLE in r271655 Added: stable/10/contrib/netbsd-tests/ - copied from r272458, head/contrib/netbsd-tests/ stable/10/share/mk/netbsd-tests.test.mk - copied, changed from r274074, head/share/mk/netbsd-tests.test.mk Modified: stable/10/contrib/netbsd-tests/include/t_paths.c stable/10/contrib/netbsd-tests/lib/libc/db/t_db.sh stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_glob.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_isnan.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_nice.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_time.c stable/10/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c stable/10/contrib/netbsd-tests/lib/libc/hash/h_hash.c stable/10/contrib/netbsd-tests/lib/libc/hash/t_sha2.c stable/10/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c stable/10/contrib/netbsd-tests/lib/libc/locale/t_io.c stable/10/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c stable/10/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c stable/10/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c stable/10/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c stable/10/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c stable/10/contrib/netbsd-tests/lib/libc/net/h_dns_server.c stable/10/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c stable/10/contrib/netbsd-tests/lib/libc/net/t_servent.sh stable/10/contrib/netbsd-tests/lib/libc/regex/debug.c stable/10/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c stable/10/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c stable/10/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c stable/10/contrib/netbsd-tests/lib/libc/ssp/h_memset.c stable/10/contrib/netbsd-tests/lib/libc/ssp/h_read.c stable/10/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c stable/10/contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c stable/10/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh stable/10/contrib/netbsd-tests/lib/libc/stdio/t_fflush.c stable/10/contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c stable/10/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c stable/10/contrib/netbsd-tests/lib/libc/stdio/t_printf.c stable/10/contrib/netbsd-tests/lib/libc/stdio/t_scanf.c stable/10/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c stable/10/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c stable/10/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c stable/10/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c stable/10/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c stable/10/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c stable/10/contrib/netbsd-tests/lib/libc/string/t_memcpy.c stable/10/contrib/netbsd-tests/lib/libc/string/t_memmem.c stable/10/contrib/netbsd-tests/lib/libc/string/t_strerror.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_access.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_chroot.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_connect.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_dup.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_kevent.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_link.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_listen.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_mincore.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_mknod.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_mlock.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_mmap.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_msync.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_poll.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_revoke.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_select.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_stat.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_truncate.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c stable/10/contrib/netbsd-tests/lib/libc/sys/t_write.c stable/10/contrib/netbsd-tests/lib/libc/time/t_strptime.c stable/10/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c stable/10/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c stable/10/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c stable/10/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c stable/10/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c stable/10/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c stable/10/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c stable/10/contrib/netbsd-tests/lib/libm/t_cbrt.c stable/10/contrib/netbsd-tests/lib/libm/t_exp.c stable/10/contrib/netbsd-tests/lib/libm/t_ldexp.c stable/10/contrib/netbsd-tests/lib/libm/t_log.c stable/10/contrib/netbsd-tests/lib/libm/t_pow.c stable/10/contrib/netbsd-tests/lib/libm/t_precision.c stable/10/contrib/netbsd-tests/lib/libm/t_scalbn.c stable/10/contrib/netbsd-tests/lib/libpthread/h_atexit.c stable/10/contrib/netbsd-tests/lib/libpthread/h_cancel.c stable/10/contrib/netbsd-tests/lib/libpthread/t_condwait.c stable/10/contrib/netbsd-tests/lib/libpthread/t_detach.c stable/10/contrib/netbsd-tests/lib/libpthread/t_fork.c stable/10/contrib/netbsd-tests/lib/libpthread/t_join.c stable/10/contrib/netbsd-tests/lib/libpthread/t_mutex.c stable/10/contrib/netbsd-tests/lib/libpthread/t_once.c stable/10/contrib/netbsd-tests/lib/libpthread/t_sem.c stable/10/contrib/netbsd-tests/lib/librt/t_sem.c stable/10/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh stable/10/share/mk/bsd.progs.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/include/t_paths.c ============================================================================== --- head/contrib/netbsd-tests/include/t_paths.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/include/t_paths.c Wed Dec 31 20:13:31 2014 (r276478) @@ -1,4 +1,4 @@ -/* $NetBSD: t_paths.c,v 1.13 2014/02/09 21:26:07 jmmv Exp $ */ +/* $NetBSD: t_paths.c,v 1.14 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_paths.c,v 1.13 2014/02/09 21:26:07 jmmv Exp $"); +__RCSID("$NetBSD: t_paths.c,v 1.14 2014/11/04 00:20:19 justin Exp $"); #include #include @@ -42,7 +42,6 @@ __RCSID("$NetBSD: t_paths.c,v 1.13 2014/ #include #include -#include #define PATH_DEV __BIT(0) /* A device node */ #define PATH_DIR __BIT(1) /* A directory */ Modified: stable/10/contrib/netbsd-tests/lib/libc/db/t_db.sh ============================================================================== --- head/contrib/netbsd-tests/lib/libc/db/t_db.sh Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/db/t_db.sh Wed Dec 31 20:13:31 2014 (r276478) @@ -41,6 +41,18 @@ dict() fi } +# Begin FreeBSD +dict() +{ + if [ -f /usr/share/dict/words ]; then + echo /usr/share/dict/words + else + echo /nonexistent + atf_skip "Test requires dict/words" + fi +} +# End FreeBSD + SEVEN_SEVEN="abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg" atf_test_case small_btree @@ -887,7 +899,15 @@ r k1234 EOF + # Begin FreeBSD + if true; then + atf_check "$(prog)" -i bsize=32768 hash in + else + # End FreeBSD atf_check "$(prog)" -i bsize=65536 hash in + # Begin FreeBSD + fi + # End FreeBSD } atf_init_test_cases() Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c Wed Dec 31 20:13:31 2014 (r276478) @@ -31,6 +31,9 @@ */ +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -248,6 +251,7 @@ ATF_TC_BODY(t_spawn_open_nonexistent, tc posix_spawn_file_actions_destroy(&fa); } +#ifdef __NetBSD__ ATF_TC(t_spawn_open_nonexistent_diag); ATF_TC_HEAD(t_spawn_open_nonexistent_diag, tc) @@ -283,6 +287,7 @@ ATF_TC_BODY(t_spawn_open_nonexistent_dia posix_spawn_file_actions_destroy(&fa); posix_spawnattr_destroy(&attr); } +#endif ATF_TC(t_spawn_fileactions); @@ -376,7 +381,9 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, t_spawn_fileactions); ATF_TP_ADD_TC(tp, t_spawn_open_nonexistent); +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, t_spawn_open_nonexistent_diag); +#endif ATF_TP_ADD_TC(tp, t_spawn_reopen); ATF_TP_ADD_TC(tp, t_spawn_openmode); ATF_TP_ADD_TC(tp, t_spawn_empty_fileactions); Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c Wed Dec 31 20:13:31 2014 (r276478) @@ -1,4 +1,4 @@ -/* $NetBSD: t_floatunditf.c,v 1.5 2014/02/02 08:16:22 martin Exp $ */ +/* $NetBSD: t_floatunditf.c,v 1.6 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -27,7 +27,6 @@ */ #include -#include #include #include Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c Wed Dec 31 20:13:31 2014 (r276478) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fpsetmask.c,v 1.13 2014/02/09 21:26:07 jmmv Exp $ */ +/* $NetBSD: t_fpsetmask.c,v 1.14 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. @@ -29,7 +29,6 @@ #include #include -#include #include #include Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c Wed Dec 31 20:13:31 2014 (r276478) @@ -56,10 +56,12 @@ ATF_TC_BODY(getcwd_err, tc) ATF_REQUIRE(getcwd(buf, 0) == NULL); ATF_REQUIRE(errno == EINVAL); +#ifdef __NetBSD__ errno = 0; ATF_REQUIRE(getcwd((void *)-1, sizeof(buf)) == NULL); ATF_REQUIRE(errno == EFAULT); +#endif } ATF_TC(getcwd_fts); Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_glob.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_glob.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_glob.c Wed Dec 31 20:13:31 2014 (r276478) @@ -46,7 +46,13 @@ __RCSID("$NetBSD: t_glob.c,v 1.3 2013/01 #include #include +#ifdef __FreeBSD__ +#include "h_macros.h" +#define __gl_stat_t struct stat +#define _S_IFDIR S_IFDIR +#else #include "../../../h_macros.h" +#endif #ifdef DEBUG @@ -132,7 +138,11 @@ gl_readdir(void *v) dir.d_ino = dd->pos; dir.d_type = f->dir ? DT_DIR : DT_REG; DPRINTF(("readdir %s %d\n", dir.d_name, dir.d_type)); +#ifdef __FreeBSD__ + dir.d_reclen = -1; /* Does not have _DIRENT_RECLEN */ +#else dir.d_reclen = _DIRENT_RECLEN(&dir, dir.d_namlen); +#endif return &dir; } return NULL; @@ -213,6 +223,7 @@ run(const char *p, int flags, const char } +#ifndef __FreeBSD__ ATF_TC(glob_star); ATF_TC_HEAD(glob_star, tc) { @@ -224,6 +235,7 @@ ATF_TC_BODY(glob_star, tc) { run("a/**", GLOB_STAR, glob_star, __arraycount(glob_star)); } +#endif ATF_TC(glob_star_not); ATF_TC_HEAD(glob_star_not, tc) @@ -260,7 +272,9 @@ ATF_TC_BODY(glob_nocheck, tc) ATF_TP_ADD_TCS(tp) { +#ifndef __FreeBSD__ ATF_TP_ADD_TC(tp, glob_star); +#endif ATF_TP_ADD_TC(tp, glob_star_not); /* * Remove this test for now - the GLOB_NOCHECK return value has been Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c Wed Dec 31 20:13:31 2014 (r276478) @@ -34,7 +34,11 @@ #include #include #include +#ifdef __FreeBSD__ +#include +#else #include +#endif const struct hnopts { size_t ho_len; @@ -78,6 +82,7 @@ const struct hnopts { /* * Truncated output. Rev. 1.7 produces "1.0 K". */ +#ifndef __FreeBSD__ { 6, 1000, "A", HN_AUTOSCALE, HN_DECIMAL, -1, "" }, /* @@ -90,6 +95,7 @@ const struct hnopts { /* Similar case it prints 1000 where it shouldn't */ { 5, 1023488, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL, 4, "1.0M" }, +#endif { 5, 1023999, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL, 4, "1.0M" }, }; Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_isnan.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_isnan.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_isnan.c Wed Dec 31 20:13:31 2014 (r276478) @@ -1,4 +1,4 @@ -/* $NetBSD: t_isnan.c,v 1.4 2014/02/09 21:26:07 jmmv Exp $ */ +/* $NetBSD: t_isnan.c,v 1.5 2014/11/04 00:20:19 justin Exp $ */ /* * This file is in the Public Domain. @@ -10,7 +10,6 @@ #include #include -#include #include #include Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_nice.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_nice.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_nice.c Wed Dec 31 20:13:31 2014 (r276478) @@ -72,6 +72,11 @@ ATF_TC_BODY(nice_err, tc) { int i; +#ifdef __FreeBSD__ + atf_tc_expect_fail("nice(incr) with incr < 0 fails with unprivileged " + "users and sets errno == EPERM; see PR # 189821 for more details"); +#endif + /* * The call should fail with EPERM if the * supplied parameter is negative and the @@ -93,7 +98,11 @@ ATF_TC_HEAD(nice_priority, tc) ATF_TC_BODY(nice_priority, tc) { +#ifdef __FreeBSD__ + int i, pri, pri2, nic; +#else int i, pri, nic; +#endif pid_t pid; int sta; @@ -106,8 +115,10 @@ ATF_TC_BODY(nice_priority, tc) pri = getpriority(PRIO_PROCESS, 0); ATF_REQUIRE(errno == 0); +#ifdef __NetBSD__ if (nic != pri) atf_tc_fail("nice(3) and getpriority(2) conflict"); +#endif /* * Also verify that the nice(3) values @@ -119,10 +130,18 @@ ATF_TC_BODY(nice_priority, tc) if (pid == 0) { errno = 0; +#ifdef __FreeBSD__ pri = getpriority(PRIO_PROCESS, 0); +#else + pri2 = getpriority(PRIO_PROCESS, 0); +#endif ATF_REQUIRE(errno == 0); +#ifdef __FreeBSD__ + if (pri != pri2) +#else if (nic != pri) +#endif _exit(EXIT_FAILURE); _exit(EXIT_SUCCESS); @@ -161,7 +180,11 @@ ATF_TC_HEAD(nice_thread, tc) ATF_TC_BODY(nice_thread, tc) { pthread_t tid[5]; +#ifdef __FreeBSD__ + int pri, rv, val; +#else int rv, val; +#endif size_t i; /* @@ -173,7 +196,12 @@ ATF_TC_BODY(nice_thread, tc) val = nice(i); ATF_REQUIRE(val != -1); +#ifdef __FreeBSD__ + pri = getpriority(PRIO_PROCESS, 0); + rv = pthread_create(&tid[i], NULL, threadfunc, &pri); +#else rv = pthread_create(&tid[i], NULL, threadfunc, &val); +#endif ATF_REQUIRE(rv == 0); rv = pthread_join(tid[i], NULL); Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_raise.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_raise.c Wed Dec 31 20:13:31 2014 (r276478) @@ -43,7 +43,11 @@ static int count; static void handler_err(int); static void handler_ret(int); static void handler_stress(int); +#ifdef __FreeBSD__ +static int sig[] = { SIGALRM, SIGIO, SIGUSR1, SIGUSR2 }; +#else static int sig[] = { SIGALRM, SIGIO, SIGUSR1, SIGUSR2, SIGPWR }; +#endif static void handler_stress(int signo) Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Wed Dec 31 20:13:31 2014 (r276478) @@ -63,8 +63,20 @@ ATF_TC_BODY(setdomainname_basic, tc) (void)memset(name, 0, sizeof(name)); +#ifdef __FreeBSD__ + /* + * Sanity checks to ensure that the wrong invariant isn't being + * tested for per PR # 181127 + */ + ATF_REQUIRE_EQ(sizeof(domains[i]), MAXHOSTNAMELEN); + ATF_REQUIRE_EQ(sizeof(name), MAXHOSTNAMELEN); + + ATF_REQUIRE(setdomainname(domains[i],sizeof(domains[i]) - 1) == 0); + ATF_REQUIRE(getdomainname(name, sizeof(name) - 1) == 0); +#else ATF_REQUIRE(setdomainname(domains[i],sizeof(domains[i])) == 0); ATF_REQUIRE(getdomainname(name, sizeof(name)) == 0); +#endif ATF_REQUIRE(strcmp(domains[i], name) == 0); } @@ -89,6 +101,10 @@ ATF_TC_BODY(setdomainname_limit, tc) (void)memset(name, 0, sizeof(name)); +#ifdef __FreeBSD__ + ATF_REQUIRE(setdomainname(name, MAXHOSTNAMELEN - 1 ) == 0); + ATF_REQUIRE(setdomainname(name, MAXHOSTNAMELEN) == -1); +#endif ATF_REQUIRE(setdomainname(name, sizeof(name)) == -1); } Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c Wed Dec 31 20:13:31 2014 (r276478) @@ -59,12 +59,26 @@ ATF_TC_BODY(sethostname_basic, tc) char name[MAXHOSTNAMELEN]; size_t i; + atf_tc_skip("screws up the test host's hostname on FreeBSD"); + for (i = 0; i < __arraycount(hosts); i++) { (void)memset(name, 0, sizeof(name)); +#ifdef __FreeBSD__ + /* + * Sanity checks to ensure that the wrong invariant isn't being + * tested for per PR # 181127 + */ + ATF_REQUIRE_EQ(sizeof(hosts[i]), MAXHOSTNAMELEN); + ATF_REQUIRE_EQ(sizeof(name), MAXHOSTNAMELEN); + + ATF_REQUIRE(sethostname(hosts[i], sizeof(hosts[i]) - 1) == 0); + ATF_REQUIRE(gethostname(name, sizeof(name) - 1) == 0); +#else ATF_REQUIRE(sethostname(hosts[i], sizeof(hosts[i])) == 0); ATF_REQUIRE(gethostname(name, sizeof(name)) == 0); +#endif ATF_REQUIRE(strcmp(hosts[i], name) == 0); } @@ -94,6 +108,10 @@ ATF_TC_BODY(sethostname_limit, tc) ATF_TC_CLEANUP(sethostname_limit, tc) { +#ifdef __FreeBSD__ + ATF_REQUIRE(sethostname(host, MAXHOSTNAMELEN - 1 ) == 0); + ATF_REQUIRE(sethostname(host, MAXHOSTNAMELEN) == -1); +#endif (void)sethostname(host, sizeof(host)); } Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c Wed Dec 31 20:13:31 2014 (r276478) @@ -1,4 +1,4 @@ -/* $NetBSD: t_siginfo.c,v 1.23 2014/02/09 21:26:07 jmmv Exp $ */ +/* $NetBSD: t_siginfo.c,v 1.24 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -27,9 +27,10 @@ */ #include -#include +#ifdef __NetBSD__ #include +#endif #include #include #include @@ -86,9 +87,11 @@ sig_debug(int signo, siginfo_t *info, uc printf("uc_stack %p %lu 0x%x\n", ctx->uc_stack.ss_sp, (unsigned long)ctx->uc_stack.ss_size, ctx->uc_stack.ss_flags); +#ifdef __NetBSD__ for (i = 0; i < __arraycount(ctx->uc_mcontext.__gregs); i++) printf("uc_mcontext.greg[%d] 0x%lx\n", i, (long)ctx->uc_mcontext.__gregs[i]); +#endif } } @@ -141,8 +144,10 @@ sigchild_action(int signo, siginfo_t *in printf("si_uid=%d\n", info->si_uid); printf("si_pid=%d\n", info->si_pid); printf("si_status=%d\n", info->si_status); +#ifdef __NetBSD__ printf("si_utime=%lu\n", (unsigned long int)info->si_utime); printf("si_stime=%lu\n", (unsigned long int)info->si_stime); +#endif } ATF_REQUIRE_EQ(info->si_code, code); ATF_REQUIRE_EQ(info->si_signo, SIGCHLD); Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Wed Dec 31 20:13:31 2014 (r276478) @@ -49,6 +49,11 @@ #define KEVNT_TIMEOUT 10300 /* measured in milli-seconds */ #define FUZZ (40 * MILLION) /* scheduling fuzz accepted - 40 ms */ +#ifdef __FreeBSD__ +#include +#include +#endif + /* * Timer notes * @@ -78,7 +83,9 @@ static volatile int sig; int sleeptest(int (*)(struct timespec *, struct timespec *), bool, bool); int do_nanosleep(struct timespec *, struct timespec *); int do_select(struct timespec *, struct timespec *); +#ifdef __NetBSD__ int do_poll(struct timespec *, struct timespec *); +#endif int do_sleep(struct timespec *, struct timespec *); int do_kevent(struct timespec *, struct timespec *); void sigalrm(int); @@ -116,6 +123,7 @@ do_select(struct timespec *delay, struct return ret; } +#ifdef __NetBSD__ int do_poll(struct timespec *delay, struct timespec *remain) { @@ -129,6 +137,7 @@ do_poll(struct timespec *delay, struct t ret = 0; return ret; } +#endif int do_sleep(struct timespec *delay, struct timespec *remain) @@ -210,6 +219,7 @@ ATF_TC_BODY(select, tc) sleeptest(do_select, true, true); } +#ifdef __NetBSD__ ATF_TC(poll); ATF_TC_HEAD(poll, tc) { @@ -223,6 +233,7 @@ ATF_TC_BODY(poll, tc) sleeptest(do_poll, true, true); } +#endif ATF_TC(sleep); ATF_TC_HEAD(sleep, tc) @@ -329,7 +340,9 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, nanosleep); ATF_TP_ADD_TC(tp, select); +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, poll); +#endif ATF_TP_ADD_TC(tp, sleep); ATF_TP_ADD_TC(tp, kevent); Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_time.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_time.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_time.c Wed Dec 31 20:13:31 2014 (r276478) @@ -31,6 +31,9 @@ #include __RCSID("$NetBSD: t_time.c,v 1.2 2011/11/11 05:03:38 jruoho Exp $"); +#ifdef __FreeBSD__ +#include +#endif #include #include #include Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c Wed Dec 31 20:13:31 2014 (r276478) @@ -107,6 +107,9 @@ ATF_TC_BODY(ttyname_r_err, tc) ATF_REQUIRE(rv == ERANGE); } +#ifdef __FreeBSD__ + atf_tc_expect_fail("FreeBSD returns ENOTTY instead of EBADF; see bin/191936"); +#endif rv = ttyname_r(-1, buf, ttymax); ATF_REQUIRE(rv == EBADF); Modified: stable/10/contrib/netbsd-tests/lib/libc/hash/h_hash.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/hash/h_hash.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/hash/h_hash.c Wed Dec 31 20:13:31 2014 (r276478) @@ -35,8 +35,13 @@ #include #include #include +#ifdef __NetBSD__ #include +#endif +#ifdef __FreeBSD__ +#include +#endif int mflag, rflag, sflag, tflag; @@ -102,17 +107,32 @@ regress(void) MD5Final(out, &ctx); outlen = 16; } else { +#ifdef __FreeBSD__ + SHA_CTX ctx; + + SHA1_Init(&ctx); + SHA1_Update(&ctx, buf, len); +#else SHA1_CTX ctx; SHA1Init(&ctx); SHA1Update(&ctx, buf, len); +#endif while (!last && fgets((char *)buf, sizeof(buf), stdin) != NULL) { len = strlen((char *)buf); CHOMP(buf, len, last); +#ifdef __FreeBSD__ + SHA1_Update(&ctx, buf, len); +#else SHA1Update(&ctx, buf, len); +#endif } +#ifdef __FreeBSD__ + SHA1_Final(out, &ctx); +#else SHA1Final(out, &ctx); +#endif outlen = 20; } hexdump(out, outlen); Modified: stable/10/contrib/netbsd-tests/lib/libc/hash/t_sha2.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/hash/t_sha2.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/hash/t_sha2.c Wed Dec 31 20:13:31 2014 (r276478) @@ -36,9 +36,23 @@ __RCSID("$NetBSD: t_sha2.c,v 1.3 2012/09 #include #include +#ifdef __NetBSD__ #include +#endif #include +#ifdef __FreeBSD__ +#include +typedef SHA512_CTX SHA384_CTX; +/* From /usr/src/crypto/openssh/openbsd-compat/sha2.h */ +#define SHA256_DIGEST_LENGTH 32 +#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) +#define SHA384_DIGEST_LENGTH 48 +#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) +#define SHA512_DIGEST_LENGTH 64 +#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) +#endif + ATF_TC(t_sha256); ATF_TC(t_sha384); ATF_TC(t_sha512); Modified: stable/10/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c Wed Dec 31 20:13:31 2014 (r276478) @@ -144,7 +144,11 @@ ATF_TC_BODY(inet_network_err, tc) H_REQUIRE(".", 0xffffffff); H_REQUIRE("1.", 0xffffffff); H_REQUIRE(".1", 0xffffffff); +#if defined(__FreeBSD__) || defined(__APPLE__) + H_REQUIRE("0x", 0x0); +#else H_REQUIRE("0x", 0xffffffff); +#endif H_REQUIRE("", 0xffffffff); H_REQUIRE(" ", 0xffffffff); H_REQUIRE("bar", 0xffffffff); Modified: stable/10/contrib/netbsd-tests/lib/libc/locale/t_io.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_io.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/locale/t_io.c Wed Dec 31 20:13:31 2014 (r276478) @@ -53,9 +53,15 @@ ATF_TC_HEAD(bad_big5_wprintf, tc) ATF_TC_BODY(bad_big5_wprintf, tc) { +#ifdef __FreeBSD__ + atf_tc_skip("does not fail as expected (may be implementation " + "specific issue with the test)"); +#endif + /* XXX implementation detail knowledge (wchar_t encoding) */ wchar_t ibuf[] = { 0xcf10, 0 }; setlocale(LC_CTYPE, "zh_TW.Big5"); + ATF_REQUIRE_ERRNO(EILSEQ, wprintf(L"%ls\n", ibuf) < 0); ATF_REQUIRE(ferror(stdout)); } @@ -68,10 +74,16 @@ ATF_TC_HEAD(bad_big5_swprintf, tc) ATF_TC_BODY(bad_big5_swprintf, tc) { +#ifdef __FreeBSD__ + atf_tc_skip("does not fail as expected (may be implementation " + "specific issue with the test)"); +#endif + /* XXX implementation detail knowledge (wchar_t encoding) */ wchar_t ibuf[] = { 0xcf10, 0 }; wchar_t obuf[20]; setlocale(LC_CTYPE, "zh_TW.Big5"); + ATF_REQUIRE_ERRNO(EILSEQ, swprintf(obuf, sizeof(obuf), L"%ls\n", ibuf) < 0); } @@ -161,6 +173,9 @@ ATF_TC_BODY(bad_big5_getwc, tc) ATF_REQUIRE(fp != NULL); setlocale(LC_CTYPE, "zh_TW.Big5"); +#ifdef __FreeBSD__ + atf_tc_expect_fail("does not return WEOF as expected"); +#endif ATF_REQUIRE_EQ(getwc(fp), WEOF); fclose(fp); } Modified: stable/10/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c Wed Dec 31 20:13:31 2014 (r276478) @@ -132,7 +132,14 @@ h_ctype2(const struct test *t, bool use_ size_t n; ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C"); +#ifdef __NetBSD__ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL); +#else + if (setlocale(LC_CTYPE, t->locale) == NULL) { + fprintf(stderr, "Locale %s not found.\n", t->locale); + return; + } +#endif (void)strvis(buf, t->data, VIS_WHITE | VIS_OCTAL); (void)printf("Checking string: \"%s\"\n", buf); @@ -238,6 +245,9 @@ ATF_TC_BODY(mbrtowc_internal, tc) { struct test *t; +#ifdef __FreeBSD__ + atf_tc_expect_fail("ja_* locale fails"); +#endif for (t = &tests[0]; t->data != NULL; ++t) h_ctype2(t, false); } Modified: stable/10/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Wed Dec 31 20:13:31 2014 (r276478) @@ -150,7 +150,14 @@ ATF_TC_BODY(mbstowcs_basic, tc) int i; ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C"); +#ifdef __NetBSD__ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL); +#else + if (setlocale(LC_CTYPE, t->locale) == NULL) { + fprintf(stderr, "Locale %s not found.\n", t->locale); + continue; + } +#endif (void)strvis(visbuf, t->data, VIS_WHITE | VIS_OCTAL); (void)printf("Checking string: \"%s\"\n", visbuf); Modified: stable/10/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Wed Dec 31 20:13:31 2014 (r276478) @@ -76,7 +76,14 @@ h_mbtowc(const char *locale, const char char *str; ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C"); +#ifdef __NetBSD__ ATF_REQUIRE(setlocale(LC_CTYPE, locale) != NULL); +#else + if (setlocale(LC_CTYPE, locale) == NULL) { + fprintf(stderr, "Locale %s not found.\n", locale); + return; + } +#endif ATF_REQUIRE((str = setlocale(LC_ALL, NULL)) != NULL); (void)printf("Using locale: %s\n", str); @@ -130,9 +137,16 @@ ATF_TC_BODY(mbtowc, tc) h_mbtowc("ja_JP.ISO2022-JP", "\033$B", "\033$B$\"\033(B"); h_mbtowc("ja_JP.SJIS", "\202", "\202\240"); h_mbtowc("ja_JP.eucJP", "\244", "\244\242"); +#ifndef __FreeBSD__ + /* Moved last as it fails */ h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); +#endif h_mbtowc("zh_TW.Big5", "\241", "\241@"); h_mbtowc("zh_TW.eucTW", "\241", "\241\241"); +#ifdef __FreeBSD__ + atf_tc_expect_fail("zh_CN.GB18030"); + h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); +#endif } ATF_TP_ADD_TCS(tp) Modified: stable/10/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c Wed Dec 31 20:13:31 2014 (r276478) @@ -66,6 +66,10 @@ __RCSID("$NetBSD: t_wcstod.c,v 1.3 2011/ #include +#ifdef __FreeBSD__ +#include +#endif + #define ALT_HUGE_VAL -1 #define ALT_MINUS_HUGE_VAL -2 #define ALT_NAN -3 @@ -234,7 +238,7 @@ static struct test { { L" -0X.", 12, 0, 0 }, #endif /* XXX: FIXME */ -#if defined(__NetBSD__) || defined(__linux__) +#if defined(__NetBSD__) || defined(__linux__) || defined(__FreeBSD__) { L"0X.0", 4, 0, 0 }, { L"+0X.0", 5, 0, 0 }, { L"-0X.0", 5, 0, 0 }, Modified: stable/10/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c Wed Dec 31 20:13:31 2014 (r276478) @@ -109,7 +109,14 @@ h_wctomb(const struct test *t, char tc) size_t sz, ret, i; ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C"); +#ifdef __NetBSD__ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL); +#else + if (setlocale(LC_CTYPE, t->locale) == NULL) { + fprintf(stderr, "Locale %s not found.\n", t->locale); + return; + } +#endif (void)strvis(buf, t->data, VIS_WHITE | VIS_OCTAL); (void)printf("Checking sequence: \"%s\"\n", buf); Modified: stable/10/contrib/netbsd-tests/lib/libc/net/h_dns_server.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/net/h_dns_server.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/net/h_dns_server.c Wed Dec 31 20:13:31 2014 (r276478) @@ -49,7 +49,13 @@ __RCSID("$NetBSD: h_dns_server.c,v 1.4 2 #include #include +#ifdef __NetBSD__ #include +#endif + +#ifdef __FreeBSD__ +#include +#endif union sockaddr_either { struct sockaddr s; @@ -164,6 +170,106 @@ name2str(const void *v, char *buf, size_ } #endif +#ifdef __FreeBSD__ +/* XXX the daemon2_* functions should be in a library */ + +int __daemon2_detach_pipe[2]; + +static int +daemon2_fork(void) +{ + int r; + int fd; + int i; + + /* + * Set up the pipe, making sure the write end does not + * get allocated one of the file descriptors that will + * be closed in daemon2_detach(). + */ + for (i = 0; i < 3; i++) { + r = pipe(__daemon2_detach_pipe); + if (r < 0) + return -1; + if (__daemon2_detach_pipe[1] <= STDERR_FILENO && + (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { + (void)dup2(fd, __daemon2_detach_pipe[0]); + (void)dup2(fd, __daemon2_detach_pipe[1]); + if (fd > STDERR_FILENO) + (void)close(fd); + continue; + } + break; + } + + r = fork(); + if (r < 0) { + return -1; + } else if (r == 0) { + /* child */ + close(__daemon2_detach_pipe[0]); + return 0; + } + /* Parent */ + + (void) close(__daemon2_detach_pipe[1]); + + for (;;) { + char dummy; + r = read(__daemon2_detach_pipe[0], &dummy, 1); + if (r < 0) { + if (errno == EINTR) + continue; + _exit(1); + } else if (r == 0) { + _exit(1); + } else { /* r > 0 */ + _exit(0); + } + } +} + +static int +daemon2_detach(int nochdir, int noclose) +{ + int r; + int fd; + + if (setsid() == -1) + return -1; + + if (!nochdir) + (void)chdir("/"); + + if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { + (void)dup2(fd, STDIN_FILENO); + (void)dup2(fd, STDOUT_FILENO); + (void)dup2(fd, STDERR_FILENO); + if (fd > STDERR_FILENO) + (void)close(fd); + } + + while (1) { + r = write(__daemon2_detach_pipe[1], "", 1); + if (r < 0) { + if (errno == EINTR) + continue; + /* May get "broken pipe" here if parent is killed */ + return -1; + } else if (r == 0) { + /* Should not happen */ + return -1; + } else { + break; + } + } + + (void) close(__daemon2_detach_pipe[1]); + + return 0; +} +#endif + int main(int argc, char **argv) { int s, r, protocol; union sockaddr_either saddr; @@ -176,6 +282,9 @@ int main(int argc, char **argv) { char buf1[1024], buf2[1024]; #endif +#ifdef __FreeBSD__ + daemon2_fork(); +#endif if (argc < 2 || ((protocol = argv[1][0]) != '4' && protocol != '6')) errx(1, "usage: dns_server 4 | 6"); s = socket(protocol == '4' ? PF_INET : PF_INET6, SOCK_DGRAM, IPPROTO_UDP); @@ -212,11 +321,19 @@ int main(int argc, char **argv) { f = fopen(pidfile_name, "w"); fprintf(f, "%d", getpid()); fclose(f); +#ifdef __FreeBSD__ +#ifdef DEBUG + daemon2_detach(0, 1); +#else + daemon2_detach(0, 0); +#endif +#else #ifdef DEBUG daemon(0, 1); #else daemon(0, 0); #endif +#endif for (;;) { unsigned char buf[512]; Modified: stable/10/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c Thu Oct 2 23:26:49 2014 (r272458) +++ stable/10/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c Wed Dec 31 20:13:31 2014 (r276478) @@ -46,9 +46,18 @@ __RCSID("$NetBSD: t_ether_aton.c,v 1.1 2 #include #include +#ifndef __NetBSD__ +#ifdef __linux__ +#include +#endif +#include +#endif + +#ifdef __NetBSD__ #define ETHER_ADDR_LEN 6 int ether_aton_r(u_char *dest, size_t len, const char *str); +#endif static const struct { u_char res[ETHER_ADDR_LEN]; @@ -56,9 +65,11 @@ static const struct { int error; } tests[] = { { { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab }, "01:23:45:67:89:ab", 0 }, +#ifdef __NetBSD__ { { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "0:1:22-3:14:05", 0 }, { { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "000122031405", 0 }, { { 0x0a, 0x0B, 0xcc, 0xdD, 0xEE, 0x0f }, "0a0BccdDEE0f", 0 }, +#endif #define ZERO { 0, 0, 0, 0, 0, 0 } { ZERO, "0:1:2-3:04:05:06", ENAMETOOLONG }, { ZERO, "0:1:2-3:04:", ENOBUFS }, @@ -75,22 +86,44 @@ ATF_TC_HEAD(tc_ether_aton, tc) ATF_TC_BODY(tc_ether_aton, tc) { +#ifdef __NetBSD__ u_char dest[ETHER_ADDR_LEN]; +#else + struct ether_addr dest; +#endif size_t t; +#ifdef __NetBSD__ int e, r; +#else + int e; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 22:15:29 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF13CFC4; Wed, 31 Dec 2014 22:15:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF7966133; Wed, 31 Dec 2014 22:15:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVMFTnT002809; Wed, 31 Dec 2014 22:15:29 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVMFTwl002808; Wed, 31 Dec 2014 22:15:29 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201412312215.sBVMFTwl002808@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 31 Dec 2014 22:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276482 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 22:15:30 -0000 Author: neel Date: Wed Dec 31 22:15:28 2014 New Revision: 276482 URL: https://svnweb.freebsd.org/changeset/base/276482 Log: MFC r273748 Output a summary of optional SVM features in dmesg similar to CPU features. If bootverbose is enabled, a detailed list is provided; otherwise, a single-line summary is displayed. Requested by: jhb Modified: stable/10/sys/x86/x86/identcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/x86/identcpu.c ============================================================================== --- stable/10/sys/x86/x86/identcpu.c Wed Dec 31 21:58:03 2014 (r276481) +++ stable/10/sys/x86/x86/identcpu.c Wed Dec 31 22:15:28 2014 (r276482) @@ -76,6 +76,7 @@ static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_INTEL_info(void); static void print_INTEL_TLB(u_int data); +static void print_svm_info(void); static void print_via_padlock_info(void); static void print_vmx_info(void); @@ -932,6 +933,9 @@ printcpuinfo(void) if (cpu_feature2 & CPUID2_VMX) print_vmx_info(); + if (amd_feature2 & AMDID2_SVM) + print_svm_info(); + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_AMD) cpu_feature &= ~CPUID_HTT; @@ -1735,6 +1739,67 @@ print_INTEL_TLB(u_int data) } } +static void +print_svm_info(void) +{ + u_int features, regs[4]; + uint64_t msr; + int comma; + + printf("\n SVM: "); + do_cpuid(0x8000000A, regs); + features = regs[3]; + + msr = rdmsr(MSR_VM_CR); + if ((msr & VM_CR_SVMDIS) == VM_CR_SVMDIS) + printf("(disabled in BIOS) "); + + if (!bootverbose) { + comma = 0; + if (features & (1 << 0)) { + printf("%sNP", comma ? "," : ""); + comma = 1; + } + if (features & (1 << 3)) { + printf("%sNRIP", comma ? "," : ""); + comma = 1; + } + if (features & (1 << 5)) { + printf("%sVClean", comma ? "," : ""); + comma = 1; + } + if (features & (1 << 6)) { + printf("%sAFlush", comma ? "," : ""); + comma = 1; + } + if (features & (1 << 7)) { + printf("%sDAssist", comma ? "," : ""); + comma = 1; + } + printf("%sNAsids=%d", comma ? "," : "", regs[1]); + return; + } + + printf("Features=0x%b", features, + "\020" + "\001NP" /* Nested paging */ + "\002LbrVirt" /* LBR virtualization */ + "\003SVML" /* SVM lock */ + "\004NRIPS" /* NRIP save */ + "\005TscRateMsr" /* MSR based TSC rate control */ + "\006VmcbClean" /* VMCB clean bits */ + "\007FlushByAsid" /* Flush by ASID */ + "\010DecodeAssist" /* Decode assist */ + "\011" + "\012" + "\013PauseFilter" /* PAUSE intercept filter */ + "\014" + "\015PauseFilterThreshold" /* PAUSE filter threshold */ + "\016AVIC" /* virtual interrupt controller */ + ); + printf("\nRevision=%d, ASIDs=%d", regs[0] & 0xff, regs[1]); +} + #ifdef __i386__ static void print_transmeta_info(void) From owner-svn-src-stable@FreeBSD.ORG Wed Dec 31 23:26:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D95729E; Wed, 31 Dec 2014 23:26:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267502ADE; Wed, 31 Dec 2014 23:26:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBVNQ5jl035871; Wed, 31 Dec 2014 23:26:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBVNPcEh035384; Wed, 31 Dec 2014 23:25:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412312325.sBVNPcEh035384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 31 Dec 2014 23:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276486 - in stable/10: cddl/usr.bin/sgsmsg cddl/usr.bin/zinject cddl/usr.bin/zlook cddl/usr.bin/ztest cddl/usr.sbin/zhack contrib/libucl contrib/libucl/doc contrib/libucl/tests contrib... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 23:26:05 -0000 Author: ngie Date: Wed Dec 31 23:25:37 2014 New Revision: 276486 URL: https://svnweb.freebsd.org/changeset/base/276486 Log: MFC r264400,r265836: r264400: NO_MAN= has been deprecated in favor of MAN= for some time, go ahead and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit. r265836: Remove last two NO_MAN= in the tree. In both of these cases, MAN= is what is needed. Modified: stable/10/cddl/usr.bin/sgsmsg/Makefile stable/10/cddl/usr.bin/zinject/Makefile stable/10/cddl/usr.bin/zlook/Makefile stable/10/cddl/usr.bin/ztest/Makefile stable/10/cddl/usr.sbin/zhack/Makefile stable/10/contrib/libucl/Makefile.am stable/10/contrib/libucl/doc/Makefile.am stable/10/contrib/libucl/tests/Makefile.am stable/10/contrib/libucl/utils/Makefile.am stable/10/contrib/ofed/usr.bin/ibsendtrap/Makefile stable/10/contrib/ofed/usr.lib/libsdp/Makefile stable/10/crypto/heimdal/appl/Makefile.am stable/10/crypto/heimdal/appl/ftp/Makefile.am stable/10/crypto/heimdal/appl/ftp/common/Makefile.am stable/10/crypto/heimdal/lib/Makefile.am stable/10/crypto/heimdal/lib/ipc/Makefile.am stable/10/games/fortune/unstr/Makefile stable/10/games/ppt/Makefile stable/10/games/primes/Makefile stable/10/gnu/usr.bin/cc/c++/Makefile stable/10/gnu/usr.bin/cc/c++filt/Makefile stable/10/gnu/usr.bin/cc/cc1/Makefile stable/10/gnu/usr.bin/cc/cc1plus/Makefile stable/10/gnu/usr.bin/cc/collect2/Makefile stable/10/gnu/usr.bin/cc/protoize/Makefile stable/10/gnu/usr.bin/gdb/Makefile.inc stable/10/gnu/usr.bin/gdb/gdbtui/Makefile stable/10/gnu/usr.bin/groff/src/devices/grohtml/Makefile stable/10/gnu/usr.bin/groff/src/preproc/html/Makefile stable/10/kerberos5/libexec/digest-service/Makefile stable/10/kerberos5/libexec/ipropd-slave/Makefile stable/10/kerberos5/tools/asn1_compile/Makefile stable/10/kerberos5/tools/make-roken/Makefile stable/10/kerberos5/tools/slc/Makefile stable/10/kerberos5/usr.bin/hxtool/Makefile stable/10/kerberos5/usr.bin/ksu/Makefile stable/10/lib/libarchive/test/Makefile stable/10/lib/libauditd/Makefile stable/10/lib/libproc/Makefile stable/10/lib/libproc/test/t1-bkpt/Makefile stable/10/lib/libproc/test/t2-name2map/Makefile stable/10/lib/libproc/test/t3-name2sym/Makefile stable/10/lib/ncurses/form/Makefile stable/10/lib/ncurses/menu/Makefile stable/10/lib/ncurses/ncurses/Makefile stable/10/lib/ncurses/panel/Makefile stable/10/libexec/bootpd/bootpgw/Makefile stable/10/libexec/ulog-helper/Makefile stable/10/release/picobsd/tinyware/aps/Makefile stable/10/release/picobsd/tinyware/help/Makefile stable/10/release/picobsd/tinyware/msg/Makefile stable/10/release/picobsd/tinyware/ns/Makefile stable/10/release/picobsd/tinyware/oinit/Makefile stable/10/release/picobsd/tinyware/simple_httpd/Makefile stable/10/release/picobsd/tinyware/sps/Makefile stable/10/release/picobsd/tinyware/view/Makefile stable/10/release/picobsd/tinyware/vm/Makefile stable/10/rescue/rescue/Makefile stable/10/sbin/geom/Makefile stable/10/sbin/rtsol/Makefile stable/10/secure/lib/libcrypto/engines/lib4758cca/Makefile stable/10/share/examples/FreeBSD_version/Makefile stable/10/share/examples/find_interface/Makefile stable/10/share/examples/kld/cdev/test/Makefile stable/10/share/examples/kld/syscall/test/Makefile stable/10/share/examples/libvgl/Makefile stable/10/share/examples/perfmon/Makefile stable/10/share/examples/ppi/Makefile stable/10/share/mk/bsd.README stable/10/share/mk/bsd.test.mk stable/10/sys/boot/amd64/boot1.efi/Makefile stable/10/sys/boot/amd64/efi/Makefile stable/10/sys/boot/arm/at91/boot0/Makefile stable/10/sys/boot/arm/at91/boot0iic/Makefile stable/10/sys/boot/arm/at91/boot0spi/Makefile stable/10/sys/boot/arm/at91/boot2/Makefile stable/10/sys/boot/arm/at91/bootiic/Makefile stable/10/sys/boot/arm/at91/bootspi/Makefile stable/10/sys/boot/arm/at91/libat91/Makefile stable/10/sys/boot/arm/ixp425/boot2/Makefile stable/10/sys/boot/i386/boot0/Makefile stable/10/sys/boot/i386/btx/btx/Makefile stable/10/sys/boot/i386/btx/btxldr/Makefile stable/10/sys/boot/i386/btx/lib/Makefile stable/10/sys/boot/i386/cdboot/Makefile stable/10/sys/boot/i386/kgzldr/Makefile stable/10/sys/boot/i386/mbr/Makefile stable/10/sys/boot/i386/pmbr/Makefile stable/10/sys/boot/i386/zfsloader/Makefile stable/10/sys/boot/ia64/efi/Makefile stable/10/sys/boot/ia64/ski/Makefile stable/10/sys/boot/libstand32/Makefile stable/10/sys/boot/pc98/boot0.5/Makefile stable/10/sys/boot/pc98/boot0/Makefile stable/10/sys/boot/pc98/btx/btx/Makefile stable/10/sys/boot/pc98/btx/btxldr/Makefile stable/10/sys/boot/pc98/btx/lib/Makefile stable/10/sys/boot/pc98/cdboot/Makefile stable/10/sys/boot/pc98/kgzldr/Makefile stable/10/sys/boot/powerpc/boot1.chrp/Makefile stable/10/sys/boot/powerpc/uboot/Makefile stable/10/sys/boot/sparc64/boot1/Makefile stable/10/sys/boot/userboot/libstand/Makefile stable/10/sys/boot/userboot/test/Makefile stable/10/sys/boot/userboot/userboot/Makefile stable/10/sys/crypto/rijndael/Makefile stable/10/sys/dev/aic7xxx/aicasm/Makefile stable/10/sys/dev/patm/genrtab/Makefile stable/10/tests/sys/netinet/Makefile stable/10/tools/KSE/ksetest/Makefile stable/10/tools/KSE/rr/Makefile stable/10/tools/bsdbox/Makefile stable/10/tools/diag/dumpvfscache/Makefile stable/10/tools/diag/localeck/Makefile stable/10/tools/regression/acct/Makefile stable/10/tools/regression/aio/aiop/Makefile stable/10/tools/regression/aio/aiotest/Makefile stable/10/tools/regression/aio/kqueue/Makefile stable/10/tools/regression/aio/kqueue/lio/Makefile stable/10/tools/regression/audit/audit_pipe_ioctl/Makefile stable/10/tools/regression/doat/Makefile stable/10/tools/regression/environ/Makefile.envctl stable/10/tools/regression/environ/Makefile.retention stable/10/tools/regression/environ/Makefile.timings stable/10/tools/regression/ethernet/ethermulti/Makefile stable/10/tools/regression/execve/Makefile stable/10/tools/regression/fifo/fifo_create/Makefile stable/10/tools/regression/fifo/fifo_io/Makefile stable/10/tools/regression/fifo/fifo_misc/Makefile stable/10/tools/regression/fifo/fifo_open/Makefile stable/10/tools/regression/file/dup/Makefile stable/10/tools/regression/file/flock/Makefile stable/10/tools/regression/file/ftruncate/Makefile stable/10/tools/regression/file/newfileops_on_fork/Makefile stable/10/tools/regression/filemon/Makefile stable/10/tools/regression/fsx/Makefile stable/10/tools/regression/gaithrstress/Makefile stable/10/tools/regression/geom/ConfCmp/Makefile stable/10/tools/regression/geom/MdLoad/Makefile stable/10/tools/regression/include/stdatomic/Makefile stable/10/tools/regression/include/tgmath/Makefile stable/10/tools/regression/kgssapi/Makefile stable/10/tools/regression/kqueue/Makefile stable/10/tools/regression/kthread/kld/Makefile stable/10/tools/regression/lib/libc/resolv/Makefile stable/10/tools/regression/mac/mac_bsdextended/Makefile stable/10/tools/regression/mlock/Makefile stable/10/tools/regression/mmap/Makefile stable/10/tools/regression/mqueue/mqtest1/Makefile stable/10/tools/regression/mqueue/mqtest2/Makefile stable/10/tools/regression/mqueue/mqtest3/Makefile stable/10/tools/regression/mqueue/mqtest4/Makefile stable/10/tools/regression/mqueue/mqtest5/Makefile stable/10/tools/regression/netinet/arphold/Makefile stable/10/tools/regression/netinet/ipbroadcast/Makefile stable/10/tools/regression/netinet/ipdivert/Makefile stable/10/tools/regression/netinet/ipmulticast/Makefile stable/10/tools/regression/netinet/ipsockopt/Makefile stable/10/tools/regression/netinet/msocket/Makefile stable/10/tools/regression/netinet/msocket_ifnet_remove/Makefile stable/10/tools/regression/netinet/rawconnect/Makefile stable/10/tools/regression/netinet/tcpconnect/Makefile stable/10/tools/regression/netinet/tcpdrop/Makefile stable/10/tools/regression/netinet/tcpfullwindowrst/Makefile stable/10/tools/regression/netinet/tcpsockclosebeforeaccept/Makefile stable/10/tools/regression/netinet/tcpsocktimewait/Makefile stable/10/tools/regression/netinet/tcpstream/Makefile stable/10/tools/regression/netinet/udpconnectjail/Makefile stable/10/tools/regression/netinet/udpzerobyte/Makefile stable/10/tools/regression/netinet6/icmp6_filter/Makefile stable/10/tools/regression/netinet6/inet6_rth/Makefile stable/10/tools/regression/netinet6/ip6_sockets/Makefile stable/10/tools/regression/nfsmmap/test1/Makefile stable/10/tools/regression/nfsmmap/test2/Makefile stable/10/tools/regression/p1003_1b/Makefile stable/10/tools/regression/pipe/Makefile stable/10/tools/regression/posixsem/Makefile stable/10/tools/regression/posixsem2/Makefile stable/10/tools/regression/posixshm/Makefile stable/10/tools/regression/pthread/cv_cancel1/Makefile stable/10/tools/regression/pthread/mutex_isowned_np/Makefile stable/10/tools/regression/rpcsec_gss/Makefile stable/10/tools/regression/security/access/Makefile stable/10/tools/regression/security/cap_test/Makefile stable/10/tools/regression/security/open_to_operation/Makefile stable/10/tools/regression/security/proc_to_proc/Makefile stable/10/tools/regression/sigqueue/sigqtest1/Makefile stable/10/tools/regression/sigqueue/sigqtest2/Makefile stable/10/tools/regression/sockets/accept_fd_leak/Makefile stable/10/tools/regression/sockets/accf_data_attach/Makefile stable/10/tools/regression/sockets/fstat/Makefile stable/10/tools/regression/sockets/kqueue/Makefile stable/10/tools/regression/sockets/listen_backlog/Makefile stable/10/tools/regression/sockets/listenclose/Makefile stable/10/tools/regression/sockets/pr_atomic/Makefile stable/10/tools/regression/sockets/reconnect/Makefile stable/10/tools/regression/sockets/rtsocket/Makefile stable/10/tools/regression/sockets/sblock/Makefile stable/10/tools/regression/sockets/sendfile/Makefile stable/10/tools/regression/sockets/shutdown/Makefile stable/10/tools/regression/sockets/sigpipe/Makefile stable/10/tools/regression/sockets/so_setfib/Makefile stable/10/tools/regression/sockets/socketpair/Makefile stable/10/tools/regression/sockets/unix_bindconnect/Makefile stable/10/tools/regression/sockets/unix_close_race/Makefile stable/10/tools/regression/sockets/unix_cmsg/Makefile stable/10/tools/regression/sockets/unix_gc/Makefile stable/10/tools/regression/sockets/unix_passfd/Makefile stable/10/tools/regression/sockets/unix_sendtorace/Makefile stable/10/tools/regression/sockets/unix_socket/Makefile stable/10/tools/regression/sockets/unix_sorflush/Makefile stable/10/tools/regression/sockets/zerosend/Makefile stable/10/tools/regression/sysvmsg/Makefile stable/10/tools/regression/sysvsem/Makefile stable/10/tools/regression/sysvshm/Makefile stable/10/tools/regression/tls/ttls1/Makefile stable/10/tools/regression/tls/ttls2/Makefile stable/10/tools/regression/tls/ttls4/Makefile stable/10/tools/regression/tmpfs/Makefile stable/10/tools/regression/ufs/uprintf/Makefile stable/10/tools/test/auxinfo/Makefile stable/10/tools/test/iconv/gnu/Makefile stable/10/tools/test/iconv/posix/Makefile stable/10/tools/test/iconv/refgen/Makefile stable/10/tools/test/iconv/tablegen/Makefile stable/10/tools/test/malloc/Makefile stable/10/tools/test/netfibs/Makefile stable/10/tools/test/ppsapi/Makefile stable/10/tools/test/ptrace/Makefile stable/10/tools/test/upsdl/Makefile stable/10/tools/tools/aac/Makefile stable/10/tools/tools/ath/Makefile.inc stable/10/tools/tools/ath/ath_ee_9287_print/Makefile stable/10/tools/tools/ath/ath_ee_9300_print/Makefile stable/10/tools/tools/ath/ath_ee_v14_print/Makefile stable/10/tools/tools/ath/ath_ee_v4k_print/Makefile stable/10/tools/tools/ath/athstats/Makefile stable/10/tools/tools/atsectl/Makefile stable/10/tools/tools/bootparttest/Makefile stable/10/tools/tools/cfi/Makefile stable/10/tools/tools/cxgbetool/Makefile stable/10/tools/tools/cxgbtool/Makefile stable/10/tools/tools/drm/radeon/mkregtable/Makefile stable/10/tools/tools/find-sb/Makefile stable/10/tools/tools/gdb_regofs/Makefile stable/10/tools/tools/ifinfo/Makefile stable/10/tools/tools/ifpifa/Makefile stable/10/tools/tools/ipw/Makefile stable/10/tools/tools/iwi/Makefile stable/10/tools/tools/mfi/Makefile stable/10/tools/tools/mwl/mwldebug/Makefile stable/10/tools/tools/mwl/mwlstats/Makefile stable/10/tools/tools/ncpus/Makefile stable/10/tools/tools/net80211/stumbler/Makefile stable/10/tools/tools/net80211/w00t/Makefile.inc stable/10/tools/tools/net80211/wesside/dics/Makefile stable/10/tools/tools/net80211/wesside/udps/Makefile stable/10/tools/tools/net80211/wesside/wesside/Makefile stable/10/tools/tools/net80211/wlaninject/Makefile stable/10/tools/tools/net80211/wlanstats/Makefile stable/10/tools/tools/net80211/wlantxtime/Makefile stable/10/tools/tools/net80211/wlanwatch/Makefile stable/10/tools/tools/net80211/wlanwds/Makefile stable/10/tools/tools/netmap/Makefile stable/10/tools/tools/netrate/http/Makefile stable/10/tools/tools/netrate/httpd/Makefile stable/10/tools/tools/netrate/juggle/Makefile stable/10/tools/tools/netrate/netblast/Makefile stable/10/tools/tools/netrate/netreceive/Makefile stable/10/tools/tools/netrate/netsend/Makefile stable/10/tools/tools/netrate/tcpconnect/Makefile stable/10/tools/tools/netrate/tcpp/Makefile stable/10/tools/tools/netrate/tcpreceive/Makefile stable/10/tools/tools/npe/npestats/Makefile stable/10/tools/tools/nxge/Makefile stable/10/tools/tools/pciroms/Makefile stable/10/tools/tools/pirtool/Makefile stable/10/tools/tools/syscall_timing/Makefile stable/10/tools/tools/tionxcl/Makefile stable/10/tools/tools/umastat/Makefile stable/10/tools/tools/vxge/Makefile stable/10/tools/tools/wtap/vis_map/Makefile stable/10/tools/tools/wtap/wtap/Makefile stable/10/tools/tools/zfsboottest/Makefile stable/10/usr.bin/bzip2recover/Makefile stable/10/usr.bin/clang/clang-tblgen/Makefile stable/10/usr.bin/clang/llvm-mc/Makefile stable/10/usr.bin/clang/llvm-objdump/Makefile stable/10/usr.bin/clang/llvm-rtdyld/Makefile stable/10/usr.bin/clang/macho-dump/Makefile stable/10/usr.bin/cpio/test/Makefile stable/10/usr.bin/dirname/Makefile stable/10/usr.bin/locate/bigram/Makefile stable/10/usr.bin/locate/code/Makefile stable/10/usr.bin/mkcsmapper_static/Makefile stable/10/usr.bin/mkesdb_static/Makefile stable/10/usr.bin/svn/svn/Makefile stable/10/usr.bin/svn/svnadmin/Makefile stable/10/usr.bin/svn/svndumpfilter/Makefile stable/10/usr.bin/svn/svnlook/Makefile stable/10/usr.bin/svn/svnmucc/Makefile stable/10/usr.bin/svn/svnrdump/Makefile stable/10/usr.bin/svn/svnserve/Makefile stable/10/usr.bin/svn/svnsync/Makefile stable/10/usr.bin/svn/svnversion/Makefile stable/10/usr.bin/tar/test/Makefile stable/10/usr.bin/unexpand/Makefile stable/10/usr.bin/uudecode/Makefile stable/10/usr.bin/vgrind/RETEST/Makefile stable/10/usr.bin/xlint/lint2/Makefile stable/10/usr.sbin/bhyvectl/Makefile stable/10/usr.sbin/bootparamd/callbootd/Makefile stable/10/usr.sbin/bsdinstall/distextract/Makefile stable/10/usr.sbin/bsdinstall/distfetch/Makefile stable/10/usr.sbin/bsdinstall/scripts/Makefile stable/10/usr.sbin/crunch/examples/Makefile stable/10/usr.sbin/ctm/ctm_dequeue/Makefile stable/10/usr.sbin/ctm/ctm_smail/Makefile stable/10/usr.sbin/ctm/mkCTM/Makefile stable/10/usr.sbin/fifolog/fifolog_reader/Makefile stable/10/usr.sbin/fifolog/fifolog_writer/Makefile stable/10/usr.sbin/lpr/filters.ru/koi2855/Makefile stable/10/usr.sbin/lpr/filters.ru/koi2alt/Makefile stable/10/usr.sbin/lpr/filters/Makefile stable/10/usr.sbin/ntp/ntp-keygen/Makefile stable/10/usr.sbin/ntp/ntpd/Makefile stable/10/usr.sbin/ntp/ntpdate/Makefile stable/10/usr.sbin/ntp/ntpdc/Makefile stable/10/usr.sbin/ntp/ntpq/Makefile stable/10/usr.sbin/ntp/ntptime/Makefile stable/10/usr.sbin/portsnap/make_index/Makefile stable/10/usr.sbin/portsnap/phttpget/Makefile stable/10/usr.sbin/rpc.ypupdated/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/usr.bin/sgsmsg/Makefile ============================================================================== --- stable/10/cddl/usr.bin/sgsmsg/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/cddl/usr.bin/sgsmsg/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -5,7 +5,7 @@ # This program is required as a bootstrap tool for 'make buildworld' PROG= sgsmsg -NO_MAN= +MAN= SRCS= avl.c sgsmsg.c string_table.c findprime.c WARNS?= 0 Modified: stable/10/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zinject/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/cddl/usr.bin/zinject/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -4,7 +4,7 @@ PROG= zinject SRCS= zinject.c translate.c -NO_MAN= +MAN= WARNS?= 0 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris Modified: stable/10/cddl/usr.bin/zlook/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zlook/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/cddl/usr.bin/zlook/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../contrib/opensolaris/cmd/zlook PROG= zlook -NO_MAN= +MAN= WARNS?= 0 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris Modified: stable/10/cddl/usr.bin/ztest/Makefile ============================================================================== --- stable/10/cddl/usr.bin/ztest/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/cddl/usr.bin/ztest/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../..//contrib/opensolaris/cmd/ztest PROG= ztest -NO_MAN= +MAN= WARNS?= 0 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris Modified: stable/10/cddl/usr.sbin/zhack/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/zhack/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/cddl/usr.sbin/zhack/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zhack PROG= zhack -NO_MAN= +MAN= WARNS?= 0 CSTD= c99 Modified: stable/10/contrib/libucl/Makefile.am ============================================================================== --- stable/10/contrib/libucl/Makefile.am Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/contrib/libucl/Makefile.am Wed Dec 31 23:25:37 2014 (r276486) @@ -4,4 +4,4 @@ EXTRA_DIST = uthash README.md pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libucl.pc -SUBDIRS = src tests utils doc \ No newline at end of file +SUBDIRS = src tests utils doc Modified: stable/10/contrib/libucl/doc/Makefile.am ============================================================================== --- stable/10/contrib/libucl/doc/Makefile.am Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/contrib/libucl/doc/Makefile.am Wed Dec 31 23:25:37 2014 (r276486) @@ -5,4 +5,4 @@ dist_man_MANS = libucl.3 gen-man: @PANDOC@ tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \ cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' | \ - @PANDOC@ -s -f markdown -t man -o libucl.3 \ No newline at end of file + @PANDOC@ -s -f markdown -t man -o libucl.3 Modified: stable/10/contrib/libucl/tests/Makefile.am ============================================================================== --- stable/10/contrib/libucl/tests/Makefile.am Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/contrib/libucl/tests/Makefile.am Wed Dec 31 23:25:37 2014 (r276486) @@ -30,4 +30,4 @@ test_schema_SOURCES = test_schema.c test_schema_LDADD = $(common_test_ldadd) test_schema_CFLAGS = $(common_test_cflags) -check_PROGRAMS = test_basic test_speed test_generate test_schema \ No newline at end of file +check_PROGRAMS = test_basic test_speed test_generate test_schema Modified: stable/10/contrib/libucl/utils/Makefile.am ============================================================================== --- stable/10/contrib/libucl/utils/Makefile.am Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/contrib/libucl/utils/Makefile.am Wed Dec 31 23:25:37 2014 (r276486) @@ -16,4 +16,4 @@ UTL = ucl_chargen ucl_objdump else UTL = endif -bin_PROGRAMS = $(UTL) \ No newline at end of file +bin_PROGRAMS = $(UTL) Modified: stable/10/contrib/ofed/usr.bin/ibsendtrap/Makefile ============================================================================== --- stable/10/contrib/ofed/usr.bin/ibsendtrap/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/contrib/ofed/usr.bin/ibsendtrap/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -7,7 +7,7 @@ PROG= ibsendtrap SRCS= ibsendtrap.c ibdiag_common.c LDADD= -libumad -libcommon -libmad CFLAGS+= -I${DIAGPATH}/include -NO_MAN= true +MAN= WARNS?= 1 Modified: stable/10/contrib/ofed/usr.lib/libsdp/Makefile ============================================================================== --- stable/10/contrib/ofed/usr.lib/libsdp/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/contrib/ofed/usr.lib/libsdp/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -11,7 +11,7 @@ SDPDIR= ${.CURDIR}/../../libsdp/src LIB= ibsdp SHLIB_MAJOR= 1 NO_PROFILE= -NO_MAN= +MAN= SRCS= log.c match.c port.c config_parser.c config_scanner.c Modified: stable/10/crypto/heimdal/appl/Makefile.am ============================================================================== --- stable/10/crypto/heimdal/appl/Makefile.am Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/crypto/heimdal/appl/Makefile.am Wed Dec 31 23:25:37 2014 (r276486) @@ -26,4 +26,4 @@ SUBDIRS = \ kf \ $(dir_dce) -EXTRA_DIST = NTMakefile \ No newline at end of file +EXTRA_DIST = NTMakefile Modified: stable/10/crypto/heimdal/appl/ftp/Makefile.am ============================================================================== --- stable/10/crypto/heimdal/appl/ftp/Makefile.am Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/crypto/heimdal/appl/ftp/Makefile.am Wed Dec 31 23:25:37 2014 (r276486) @@ -4,4 +4,4 @@ include $(top_srcdir)/Makefile.am.common SUBDIRS = common ftp ftpd -EXTRA_DIST = NTMakefile \ No newline at end of file +EXTRA_DIST = NTMakefile Modified: stable/10/crypto/heimdal/appl/ftp/common/Makefile.am ============================================================================== --- stable/10/crypto/heimdal/appl/ftp/common/Makefile.am Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/crypto/heimdal/appl/ftp/common/Makefile.am Wed Dec 31 23:25:37 2014 (r276486) @@ -11,4 +11,4 @@ libcommon_a_SOURCES = \ buffer.c \ common.h -EXTRA_DIST = NTMakefile \ No newline at end of file +EXTRA_DIST = NTMakefile Modified: stable/10/crypto/heimdal/lib/Makefile.am ============================================================================== --- stable/10/crypto/heimdal/lib/Makefile.am Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/crypto/heimdal/lib/Makefile.am Wed Dec 31 23:25:37 2014 (r276486) @@ -42,4 +42,4 @@ SUBDIRS = \ $(dir_otp) \ $(dir_dce) -EXTRA_DIST = NTMakefile heimdal \ No newline at end of file +EXTRA_DIST = NTMakefile heimdal Modified: stable/10/crypto/heimdal/lib/ipc/Makefile.am ============================================================================== --- stable/10/crypto/heimdal/lib/ipc/Makefile.am Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/crypto/heimdal/lib/ipc/Makefile.am Wed Dec 31 23:25:37 2014 (r276486) @@ -64,4 +64,4 @@ CLEANFILES = $(built_ipcc) $(built_ipcs) $(srcdir)/client.c: $(built_ipcc) $(srcdir)/server.c: $(built_ipcs) -endif \ No newline at end of file +endif Modified: stable/10/games/fortune/unstr/Makefile ============================================================================== --- stable/10/games/fortune/unstr/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/games/fortune/unstr/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= unstr -NO_MAN= +MAN= CFLAGS+= -I${.CURDIR}/../strfile .include Modified: stable/10/games/ppt/Makefile ============================================================================== --- stable/10/games/ppt/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/games/ppt/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= ppt -NO_MAN= +MAN= .include Modified: stable/10/games/primes/Makefile ============================================================================== --- stable/10/games/primes/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/games/primes/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ PROG= primes SRCS= pattern.c pr_tbl.c primes.c -NO_MAN= +MAN= DPADD= ${LIBM} LDADD= -lm Modified: stable/10/gnu/usr.bin/cc/c++/Makefile ============================================================================== --- stable/10/gnu/usr.bin/cc/c++/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/cc/c++/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include .include "../Makefile.inc" Modified: stable/10/gnu/usr.bin/cc/c++filt/Makefile ============================================================================== --- stable/10/gnu/usr.bin/cc/c++filt/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/cc/c++filt/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include .include "../Makefile.inc" Modified: stable/10/gnu/usr.bin/cc/cc1/Makefile ============================================================================== --- stable/10/gnu/usr.bin/cc/cc1/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/cc/cc1/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include .include "../Makefile.inc" Modified: stable/10/gnu/usr.bin/cc/cc1plus/Makefile ============================================================================== --- stable/10/gnu/usr.bin/cc/cc1plus/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/cc/cc1plus/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include .include "../Makefile.inc" Modified: stable/10/gnu/usr.bin/cc/collect2/Makefile ============================================================================== --- stable/10/gnu/usr.bin/cc/collect2/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/cc/collect2/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -6,6 +6,6 @@ PROG= collect2 SRCS= collect2.c tlink.c version.c -NO_MAN= +MAN= .include Modified: stable/10/gnu/usr.bin/cc/protoize/Makefile ============================================================================== --- stable/10/gnu/usr.bin/cc/protoize/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/cc/protoize/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/../cc_tools ${GCCDIR} PROG= protoize -NO_MAN= +MAN= # things are rather hard-coded, we work around that here CFLAGS+= -DDEFAULT_TARGET_VERSION=\"\" Modified: stable/10/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- stable/10/gnu/usr.bin/gdb/Makefile.inc Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/gdb/Makefile.inc Wed Dec 31 23:25:37 2014 (r276486) @@ -52,7 +52,7 @@ GENSRCS+= nm.h tm.h .if defined(GDB_CROSS_DEBUGGER) CFLAGS+= -DCROSS_DEBUGGER -I${BMAKE_ROOT}/../.. GDB_SUFFIX= -${TARGET_ARCH} -NO_MAN= +MAN= .endif .include "${TARGET_SUBDIR}/Makefile" Modified: stable/10/gnu/usr.bin/gdb/gdbtui/Makefile ============================================================================== --- stable/10/gnu/usr.bin/gdb/gdbtui/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/gdb/gdbtui/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ PROG= gdbtui${GDB_SUFFIX} SRCS= tui-main.c -NO_MAN= +MAN= BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \ ${OBJ_BU}/libiberty/libiberty.a Modified: stable/10/gnu/usr.bin/groff/src/devices/grohtml/Makefile ============================================================================== --- stable/10/gnu/usr.bin/groff/src/devices/grohtml/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/groff/src/devices/grohtml/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -4,6 +4,6 @@ PROG_CXX= post-grohtml SRCS= post-html.cpp html-table.cpp html-text.cpp output.cpp DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm -NO_MAN= +MAN= .include Modified: stable/10/gnu/usr.bin/groff/src/preproc/html/Makefile ============================================================================== --- stable/10/gnu/usr.bin/groff/src/preproc/html/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/gnu/usr.bin/groff/src/preproc/html/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -4,6 +4,6 @@ PROG_CXX= pre-grohtml SRCS= pre-html.cpp pushback.cpp DPADD= ${LIBGROFF} LDADD= ${LIBGROFF} -NO_MAN= +MAN= .include Modified: stable/10/kerberos5/libexec/digest-service/Makefile ============================================================================== --- stable/10/kerberos5/libexec/digest-service/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/kerberos5/libexec/digest-service/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= digest-service -NO_MAN= 1 +MAN= CFLAGS+= -I${KRB5DIR}/kdc \ -I${KRB5DIR}/lib/asn1 \ -I${KRB5DIR}/lib/krb5 \ Modified: stable/10/kerberos5/libexec/ipropd-slave/Makefile ============================================================================== --- stable/10/kerberos5/libexec/ipropd-slave/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/kerberos5/libexec/ipropd-slave/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= ipropd-slave -NO_MAN= +MAN= SRCS= ipropd_common.c ipropd_slave.c kadm5_err.h CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ -I. ${LDAPCFLAGS} Modified: stable/10/kerberos5/tools/asn1_compile/Makefile ============================================================================== --- stable/10/kerberos5/tools/asn1_compile/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/kerberos5/tools/asn1_compile/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= asn1_compile -NO_MAN= +MAN= LIBROKEN_A= ${.OBJDIR}/../../lib/libroken/libroken.a LDADD= ${LIBROKEN_A} ${LIBVERS} DPADD= ${LIBROKEN_A} ${LIBVERS} Modified: stable/10/kerberos5/tools/make-roken/Makefile ============================================================================== --- stable/10/kerberos5/tools/make-roken/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/kerberos5/tools/make-roken/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= make-roken -NO_MAN= +MAN= CLEANFILES= make-roken.c Modified: stable/10/kerberos5/tools/slc/Makefile ============================================================================== --- stable/10/kerberos5/tools/slc/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/kerberos5/tools/slc/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -4,7 +4,7 @@ PROG= slc LIBROKEN_A= ${.OBJDIR}/../../lib/libroken/libroken.a LDADD= ${LIBROKEN_A} ${LIBVERS} DPADD= ${LIBROKEN_A} ${LIBVERS} -NO_MAN= +MAN= SRCS= roken.h \ slc-gram.y \ Modified: stable/10/kerberos5/usr.bin/hxtool/Makefile ============================================================================== --- stable/10/kerberos5/usr.bin/hxtool/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/kerberos5/usr.bin/hxtool/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= hxtool -NO_MAN= 1 +MAN= CFLAGS+= -I${KRB5DIR}/lib/hx509 \ -I${KRB5DIR}/lib/asn1 \ -I${KRB5DIR}/lib/roken \ Modified: stable/10/kerberos5/usr.bin/ksu/Makefile ============================================================================== --- stable/10/kerberos5/usr.bin/ksu/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/kerberos5/usr.bin/ksu/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -5,7 +5,7 @@ PROG= ksu BINMODE=4555 PRECIOUSPROG= .endif -NO_MAN= +MAN= SRCS= su.c CFLAGS+=-I${KRB5DIR}/lib/roken DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509} ${LIBROKEN} ${LIBVERS} \ Modified: stable/10/lib/libarchive/test/Makefile ============================================================================== --- stable/10/lib/libarchive/test/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/libarchive/test/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ LIBARCHIVEDIR= ${.CURDIR}/../../../contrib/libarchive -NO_MAN=yes +MAN= PROG=libarchive_test INTERNALPROG=yes # Don't install this; it's just for testing Modified: stable/10/lib/libauditd/Makefile ============================================================================== --- stable/10/lib/libauditd/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/libauditd/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -19,6 +19,6 @@ CFLAGS+= -I${OPENBSMDIR} -I${LIBBSMDIR} WARNS?= 3 -NO_MAN= +MAN= .include Modified: stable/10/lib/libproc/Makefile ============================================================================== --- stable/10/lib/libproc/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/libproc/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -27,6 +27,6 @@ CFLAGS+= -DNO_CXA_DEMANGLE SHLIB_MAJOR= 2 -WITHOUT_MAN= +MAN= .include Modified: stable/10/lib/libproc/test/t1-bkpt/Makefile ============================================================================== --- stable/10/lib/libproc/test/t1-bkpt/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/libproc/test/t1-bkpt/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -7,6 +7,6 @@ SRCS= t1-bkpt.c LDADD= -lproc -lelf -lrtld_db -lutil DPADD= ${LIBPROC} ${LIBELF} -WITHOUT_MAN= +MAN= .include Modified: stable/10/lib/libproc/test/t2-name2map/Makefile ============================================================================== --- stable/10/lib/libproc/test/t2-name2map/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/libproc/test/t2-name2map/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -7,6 +7,6 @@ SRCS= t2-name2map.c LDADD= -lproc -lelf -lrtld_db -lutil DPADD= ${LIBPROC} ${LIBELF} -WITHOUT_MAN= +MAN= .include Modified: stable/10/lib/libproc/test/t3-name2sym/Makefile ============================================================================== --- stable/10/lib/libproc/test/t3-name2sym/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/libproc/test/t3-name2sym/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -7,6 +7,6 @@ SRCS= t3-name2sym.c LDADD= -lproc -lelf -lrtld_db -lutil DPADD= ${LIBPROC} ${LIBELF} -WITHOUT_MAN= +MAN= .include Modified: stable/10/lib/ncurses/form/Makefile ============================================================================== --- stable/10/lib/ncurses/form/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/ncurses/form/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -157,7 +157,7 @@ MLINKS= form_cursor.3 pos_form_cursor.3 form_win.3 set_form_sub.3 \ form_win.3 set_form_win.3 .else -NO_MAN= +MAN= .endif .include Modified: stable/10/lib/ncurses/menu/Makefile ============================================================================== --- stable/10/lib/ncurses/menu/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/ncurses/menu/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -130,7 +130,7 @@ MLINKS= menu_attributes.3 menu_back.3 \ mitem_value.3 set_item_value.3 \ mitem_visible.3 item_visible.3 .else -NO_MAN= +MAN= .endif .include Modified: stable/10/lib/ncurses/ncurses/Makefile ============================================================================== --- stable/10/lib/ncurses/ncurses/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/ncurses/ncurses/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -536,12 +536,12 @@ MAN+= \ curs_ins_wstr.3 \ curs_printw.3 \ curs_scanw.3 -.endif - -CLEANFILES+= ${MAN:M*.3} MAN+= term.5 terminfo.5 MAN+= term.7 +.endif + +CLEANFILES+= ${MAN:M*.3} MLINKS= ncurses.3 curses.3 \ curs_addch.3 addch.3 \ Modified: stable/10/lib/ncurses/panel/Makefile ============================================================================== --- stable/10/lib/ncurses/panel/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/lib/ncurses/panel/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -58,7 +58,7 @@ MLINKS= panel.3 bottom_panel.3 \ panel.3 top_panel.3 \ panel.3 update_panels.3 .else -NO_MAN= +MAN= .endif .include Modified: stable/10/libexec/bootpd/bootpgw/Makefile ============================================================================== --- stable/10/libexec/bootpd/bootpgw/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/libexec/bootpd/bootpgw/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= bootpgw -NO_MAN= +MAN= SRCS= bootpgw.c getif.c hwaddr.c report.c rtmsg.c SRCDIR= ${.CURDIR}/.. Modified: stable/10/libexec/ulog-helper/Makefile ============================================================================== --- stable/10/libexec/ulog-helper/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/libexec/ulog-helper/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ PROG= ulog-helper BINOWN= root BINMODE=4555 -NO_MAN= +MAN= DPADD= ${LIBULOG} LDADD= -lulog Modified: stable/10/release/picobsd/tinyware/aps/Makefile ============================================================================== --- stable/10/release/picobsd/tinyware/aps/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/release/picobsd/tinyware/aps/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ # PROG=ps SRCS+=main.c -NO_MAN= +MAN= .include Modified: stable/10/release/picobsd/tinyware/help/Makefile ============================================================================== --- stable/10/release/picobsd/tinyware/help/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/release/picobsd/tinyware/help/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ # PROG=help SRCS+=help.c -NO_MAN= +MAN= .include Modified: stable/10/release/picobsd/tinyware/msg/Makefile ============================================================================== --- stable/10/release/picobsd/tinyware/msg/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/release/picobsd/tinyware/msg/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ # PROG=msg SRCS= msg.c -NO_MAN= +MAN= .include Modified: stable/10/release/picobsd/tinyware/ns/Makefile ============================================================================== --- stable/10/release/picobsd/tinyware/ns/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/release/picobsd/tinyware/ns/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -4,6 +4,6 @@ PROG= ns SRCS= ns.c CFLAGS+= -DBRIDGING -NO_MAN= +MAN= .include Modified: stable/10/release/picobsd/tinyware/oinit/Makefile ============================================================================== --- stable/10/release/picobsd/tinyware/oinit/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/release/picobsd/tinyware/oinit/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -15,7 +15,7 @@ CFLAGS= -DSH_PATH=\"${SH_PATH}\" -DSH_N #LDADD= -lutil -ledit -ltermcap LDADD=-lutil -NO_MAN= +MAN= .include Modified: stable/10/release/picobsd/tinyware/simple_httpd/Makefile ============================================================================== --- stable/10/release/picobsd/tinyware/simple_httpd/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/release/picobsd/tinyware/simple_httpd/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ # PROG=simple_httpd SRCS= simple_httpd.c -NO_MAN= +MAN= WARNS?=6 .include Modified: stable/10/release/picobsd/tinyware/sps/Makefile ============================================================================== --- stable/10/release/picobsd/tinyware/sps/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/release/picobsd/tinyware/sps/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ # PROG=sps SRCS= sps.c -NO_MAN= +MAN= .include Modified: stable/10/release/picobsd/tinyware/view/Makefile ============================================================================== --- stable/10/release/picobsd/tinyware/view/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/release/picobsd/tinyware/view/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -4,6 +4,6 @@ PROG=view SRCS=view.c CFLAGS+=-I/usr/local/include LDADD+=-L/usr/local/lib -lpng -lvgl -lz -lm -NO_MAN= +MAN= .include Modified: stable/10/release/picobsd/tinyware/vm/Makefile ============================================================================== --- stable/10/release/picobsd/tinyware/vm/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/release/picobsd/tinyware/vm/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ PROG=vm #CFLAGS+= SRCS= vm.c -NO_MAN= +MAN= .include Modified: stable/10/rescue/rescue/Makefile ============================================================================== --- stable/10/rescue/rescue/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/rescue/rescue/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,7 +1,7 @@ #$FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/2/93 -NO_MAN= +MAN= .include MK_SSP= no Modified: stable/10/sbin/geom/Makefile ============================================================================== --- stable/10/sbin/geom/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sbin/geom/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -9,7 +9,7 @@ PROG= geom SRCS= geom.c geom_label.c geom_part.c subr.c -NO_MAN= +MAN= WARNS?= 2 CFLAGS+=-I${.CURDIR} -I${.CURDIR}/core -DSTATIC_GEOM_CLASSES Modified: stable/10/sbin/rtsol/Makefile ============================================================================== --- stable/10/sbin/rtsol/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sbin/rtsol/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -20,7 +20,7 @@ SRCDIR= ${.CURDIR}/../../usr.sbin/rtsold PROG= rtsol SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c -NO_MAN= +MAN= WARNS?= 3 CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DSMALL Modified: stable/10/secure/lib/libcrypto/engines/lib4758cca/Makefile ============================================================================== --- stable/10/secure/lib/libcrypto/engines/lib4758cca/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/secure/lib/libcrypto/engines/lib4758cca/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,6 +2,6 @@ SHLIB_NAME?= lib4758cca.so SRCS= e_4758cca.c -NO_MAN= # For now +MAN= .include Modified: stable/10/share/examples/FreeBSD_version/Makefile ============================================================================== --- stable/10/share/examples/FreeBSD_version/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/share/examples/FreeBSD_version/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= FreeBSD_version -NO_MAN= +MAN= install: Modified: stable/10/share/examples/find_interface/Makefile ============================================================================== --- stable/10/share/examples/find_interface/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/share/examples/find_interface/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,6 +1,6 @@ # $FreeBSD$ PROG= find_interface -NO_MAN= +MAN= .include Modified: stable/10/share/examples/kld/cdev/test/Makefile ============================================================================== --- stable/10/share/examples/kld/cdev/test/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/share/examples/kld/cdev/test/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -67,7 +67,7 @@ # $FreeBSD$ # PROG= testcdev -NO_MAN= +MAN= WARNS?= 5 MODSTAT= /sbin/kldstat Modified: stable/10/share/examples/kld/syscall/test/Makefile ============================================================================== --- stable/10/share/examples/kld/syscall/test/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/share/examples/kld/syscall/test/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= call -NO_MAN= +MAN= WARNS?= 5 .include Modified: stable/10/share/examples/libvgl/Makefile ============================================================================== --- stable/10/share/examples/libvgl/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/share/examples/libvgl/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= demo -NO_MAN= +MAN= DPADD= ${LIBVGL} LDADD= -lvgl Modified: stable/10/share/examples/perfmon/Makefile ============================================================================== --- stable/10/share/examples/perfmon/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/share/examples/perfmon/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= perfmon -NO_MAN= +MAN= install: Modified: stable/10/share/examples/ppi/Makefile ============================================================================== --- stable/10/share/examples/ppi/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/share/examples/ppi/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,6 +3,6 @@ # $FreeBSD$ PROG= ppilcd -NO_MAN= +MAN= .include Modified: stable/10/share/mk/bsd.README ============================================================================== --- stable/10/share/mk/bsd.README Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/share/mk/bsd.README Wed Dec 31 23:25:37 2014 (r276486) @@ -309,7 +309,7 @@ To build foo from foo.c with a manual pa If foo does not have a manual page at all, add the line: - NO_MAN= + MAN= If foo has multiple source files, add the line: Modified: stable/10/share/mk/bsd.test.mk ============================================================================== --- stable/10/share/mk/bsd.test.mk Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/share/mk/bsd.test.mk Wed Dec 31 23:25:37 2014 (r276486) @@ -62,8 +62,7 @@ SUBDIR+= ${ts} # it is rare for test cases to have man pages .if !defined(MAN) -WITHOUT_MAN=yes -.export WITHOUT_MAN +MAN= .endif # tell progs.mk we might want to install things Modified: stable/10/sys/boot/amd64/boot1.efi/Makefile ============================================================================== --- stable/10/sys/boot/amd64/boot1.efi/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/amd64/boot1.efi/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include Modified: stable/10/sys/boot/amd64/efi/Makefile ============================================================================== --- stable/10/sys/boot/amd64/efi/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/amd64/efi/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include Modified: stable/10/sys/boot/arm/at91/boot0/Makefile ============================================================================== --- stable/10/sys/boot/arm/at91/boot0/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/arm/at91/boot0/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -5,7 +5,7 @@ P=boot0 FILES=${P} SRCS=arm_init.S main.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: stable/10/sys/boot/arm/at91/boot0iic/Makefile ============================================================================== --- stable/10/sys/boot/arm/at91/boot0iic/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/arm/at91/boot0iic/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -5,7 +5,7 @@ P=boot0iic FILES=${P} SRCS=arm_init.S main.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: stable/10/sys/boot/arm/at91/boot0spi/Makefile ============================================================================== --- stable/10/sys/boot/arm/at91/boot0spi/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/arm/at91/boot0spi/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -5,7 +5,7 @@ P=boot0spi FILES=${P} SRCS=arm_init.S main.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: stable/10/sys/boot/arm/at91/boot2/Makefile ============================================================================== --- stable/10/sys/boot/arm/at91/boot2/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/arm/at91/boot2/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -5,7 +5,7 @@ P=boot2 FILES=${P} SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: stable/10/sys/boot/arm/at91/bootiic/Makefile ============================================================================== --- stable/10/sys/boot/arm/at91/bootiic/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/arm/at91/bootiic/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -5,7 +5,7 @@ P=bootiic FILES=${P} SRCS=arm_init.S main.c loader_prompt.c env_vars.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: stable/10/sys/boot/arm/at91/bootspi/Makefile ============================================================================== --- stable/10/sys/boot/arm/at91/bootspi/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/arm/at91/bootspi/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -5,7 +5,7 @@ P=bootspi FILES=${P} SRCS=arm_init.S main.c loader_prompt.c env_vars.c ee.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: stable/10/sys/boot/arm/at91/libat91/Makefile ============================================================================== --- stable/10/sys/boot/arm/at91/libat91/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/arm/at91/libat91/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -11,7 +11,7 @@ SRCS=${SOC}_lowlevel.c delay.c eeprom.c sd-card.c strcvt.c strlen.c strcmp.c memcpy.c strcpy.c \ memset.c memcmp.c SRCS+=ashldi3.c divsi3.S -NO_MAN= +MAN= .if ${MK_TAG_LIST} != "no" CFLAGS += -I${.CURDIR}/.. -DSUPPORT_TAG_LIST Modified: stable/10/sys/boot/arm/ixp425/boot2/Makefile ============================================================================== --- stable/10/sys/boot/arm/ixp425/boot2/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/arm/ixp425/boot2/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -20,7 +20,7 @@ SRCS+=strlen.c ashldi3.c divsi3.S muldi3 .if ${MK_ARM_EABI} != "no" SRCS+=aeabi_unwind.c .endif -NO_MAN= +MAN= KERNPHYSADDR=0x180000 KERNVIRTADDR=${KERNPHYSADDR} Modified: stable/10/sys/boot/i386/boot0/Makefile ============================================================================== --- stable/10/sys/boot/i386/boot0/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/i386/boot0/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ PROG?= boot0 STRIP= BINMODE=${NOBINMODE} -NO_MAN= +MAN= SRCS= ${PROG}.S # Additional options that you can specify with make OPTS="..." Modified: stable/10/sys/boot/i386/btx/btx/Makefile ============================================================================== --- stable/10/sys/boot/i386/btx/btx/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/i386/btx/btx/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ PROG= btx INTERNALPROG= -NO_MAN= +MAN= SRCS= btx.S .if defined(BOOT_BTX_NOHANG) Modified: stable/10/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- stable/10/sys/boot/i386/btx/btxldr/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/i386/btx/btxldr/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ PROG= btxldr INTERNALPROG= -NO_MAN= +MAN= SRCS= btxldr.S CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} Modified: stable/10/sys/boot/i386/btx/lib/Makefile ============================================================================== --- stable/10/sys/boot/i386/btx/lib/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/i386/btx/lib/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -2,7 +2,7 @@ PROG= crt0.o INTERNALPROG= -NO_MAN= +MAN= SRCS= btxcsu.S btxsys.s btxv86.s CFLAGS+=-I${.CURDIR}/../../common LDFLAGS=-Wl,-r Modified: stable/10/sys/boot/i386/cdboot/Makefile ============================================================================== --- stable/10/sys/boot/i386/cdboot/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/i386/cdboot/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ PROG= cdboot STRIP= BINMODE=${NOBINMODE} -NO_MAN= +MAN= SRCS= ${PROG}.S CFLAGS+=-I${.CURDIR}/../common Modified: stable/10/sys/boot/i386/kgzldr/Makefile ============================================================================== --- stable/10/sys/boot/i386/kgzldr/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/i386/kgzldr/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -4,7 +4,7 @@ PROG= kgzldr.o STRIP= BINMODE=${LIBMODE} BINDIR= ${LIBDIR} -NO_MAN= +MAN= SRCS= start.s boot.c inflate.c lib.c crt.s sio.s CFLAGS= -Os Modified: stable/10/sys/boot/i386/mbr/Makefile ============================================================================== --- stable/10/sys/boot/i386/mbr/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/i386/mbr/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ PROG= mbr STRIP= BINMODE=${NOBINMODE} -NO_MAN= +MAN= SRCS= ${PROG}.s # MBR flags: 0x80 -- try packet interface (also known as EDD or LBA) Modified: stable/10/sys/boot/i386/pmbr/Makefile ============================================================================== --- stable/10/sys/boot/i386/pmbr/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/i386/pmbr/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ PROG= pmbr STRIP= BINMODE=${NOBINMODE} -NO_MAN= +MAN= SRCS= ${PROG}.s ORG= 0x600 Modified: stable/10/sys/boot/i386/zfsloader/Makefile ============================================================================== --- stable/10/sys/boot/i386/zfsloader/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/i386/zfsloader/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -6,7 +6,7 @@ LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 LOADER_ZFS_SUPPORT=yes LOADER_ONLY= yes -NO_MAN= yes +MAN= .include "${.CURDIR}/../loader/Makefile" Modified: stable/10/sys/boot/ia64/efi/Makefile ============================================================================== --- stable/10/sys/boot/ia64/efi/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/ia64/efi/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include MK_SSP= no Modified: stable/10/sys/boot/ia64/ski/Makefile ============================================================================== --- stable/10/sys/boot/ia64/ski/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/ia64/ski/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include MK_SSP= no Modified: stable/10/sys/boot/libstand32/Makefile ============================================================================== --- stable/10/sys/boot/libstand32/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/libstand32/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -6,7 +6,7 @@ # quite large. # -NO_MAN= +MAN= .include MK_SSP= no Modified: stable/10/sys/boot/pc98/boot0.5/Makefile ============================================================================== --- stable/10/sys/boot/pc98/boot0.5/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/pc98/boot0.5/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ PROG= ${BOOT}.out INTERNALPROG= FILES= ${BOOT} -NO_MAN= +MAN= SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s \ putssjis.s CLEANFILES= ${BOOT} ${BOOT}.bin Modified: stable/10/sys/boot/pc98/boot0/Makefile ============================================================================== --- stable/10/sys/boot/pc98/boot0/Makefile Wed Dec 31 23:19:16 2014 (r276485) +++ stable/10/sys/boot/pc98/boot0/Makefile Wed Dec 31 23:25:37 2014 (r276486) @@ -3,7 +3,7 @@ PROG= ${BOOT}.out INTERNALPROG= FILES= ${BOOT} -NO_MAN= +MAN= *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jan 1 01:43:01 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8254EFF7; Thu, 1 Jan 2015 01:43:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C78764CC2; Thu, 1 Jan 2015 01:43:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t011h1EF001381; Thu, 1 Jan 2015 01:43:01 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t011h1qs001380; Thu, 1 Jan 2015 01:43:01 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201501010143.t011h1qs001380@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Thu, 1 Jan 2015 01:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276487 - stable/10/sys/dev/virtio/block X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2015 01:43:01 -0000 Author: bryanv Date: Thu Jan 1 01:43:00 2015 New Revision: 276487 URL: https://svnweb.freebsd.org/changeset/base/276487 Log: MFC r275335: Cleanup and performance improvement of the virtio_blk driver - Add support for GEOM direct completion. Depending on the benchmark, this tends to give a ~30% improvement w.r.t IOPs and BW. - Remove an invariants check in the strategy routine. This assertion is caught later on by an existing panic. - Rename and resort various related functions to make more sense. Modified: stable/10/sys/dev/virtio/block/virtio_blk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- stable/10/sys/dev/virtio/block/virtio_blk.c Wed Dec 31 23:25:37 2014 (r276486) +++ stable/10/sys/dev/virtio/block/virtio_blk.c Thu Jan 1 01:43:00 2015 (r276487) @@ -58,7 +58,6 @@ struct vtblk_request { struct virtio_blk_outhdr vbr_hdr; struct bio *vbr_bp; uint8_t vbr_ack; - TAILQ_ENTRY(vtblk_request) vbr_link; }; @@ -132,53 +131,60 @@ static int vtblk_dump(void *, void *, vm static void vtblk_strategy(struct bio *); static void vtblk_negotiate_features(struct vtblk_softc *); +static void vtblk_setup_features(struct vtblk_softc *); static int vtblk_maximum_segments(struct vtblk_softc *, struct virtio_blk_config *); static int vtblk_alloc_virtqueue(struct vtblk_softc *); static void vtblk_resize_disk(struct vtblk_softc *, uint64_t); -static void vtblk_set_write_cache(struct vtblk_softc *, int); -static int vtblk_write_cache_enabled(struct vtblk_softc *sc, - struct virtio_blk_config *); -static int vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS); static void vtblk_alloc_disk(struct vtblk_softc *, struct virtio_blk_config *); static void vtblk_create_disk(struct vtblk_softc *); -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 *, +static int vtblk_request_prealloc(struct vtblk_softc *); +static void vtblk_request_free(struct vtblk_softc *); +static struct vtblk_request * + vtblk_request_dequeue(struct vtblk_softc *); +static void vtblk_request_enqueue(struct vtblk_softc *, struct vtblk_request *); +static struct vtblk_request * + vtblk_request_next_ready(struct vtblk_softc *); +static void vtblk_request_requeue_ready(struct vtblk_softc *, + struct vtblk_request *); +static struct vtblk_request * + vtblk_request_next(struct vtblk_softc *); +static struct vtblk_request * + vtblk_request_bio(struct vtblk_softc *); +static int vtblk_request_execute(struct vtblk_softc *, + struct vtblk_request *); +static int vtblk_request_error(struct vtblk_request *); -static void vtblk_vq_intr(void *); +static void vtblk_queue_completed(struct vtblk_softc *, + struct bio_queue *); +static void vtblk_done_completed(struct vtblk_softc *, + struct bio_queue *); +static void vtblk_drain_vq(struct vtblk_softc *, int); +static void vtblk_drain(struct vtblk_softc *); -static void vtblk_stop(struct vtblk_softc *); +static void vtblk_startio(struct vtblk_softc *); +static void vtblk_bio_done(struct vtblk_softc *, struct bio *, int); static void vtblk_read_config(struct vtblk_softc *, struct virtio_blk_config *); -static void vtblk_get_ident(struct vtblk_softc *); -static void vtblk_prepare_dump(struct vtblk_softc *); -static int vtblk_write_dump(struct vtblk_softc *, void *, off_t, size_t); -static int vtblk_flush_dump(struct vtblk_softc *); +static void vtblk_ident(struct vtblk_softc *); static int vtblk_poll_request(struct vtblk_softc *, struct vtblk_request *); +static int vtblk_quiesce(struct vtblk_softc *); +static void vtblk_vq_intr(void *); +static void vtblk_stop(struct vtblk_softc *); -static void vtblk_finish_completed(struct vtblk_softc *); -static void vtblk_drain_vq(struct vtblk_softc *, int); -static void vtblk_drain(struct vtblk_softc *); - -static int vtblk_alloc_requests(struct vtblk_softc *); -static void vtblk_free_requests(struct vtblk_softc *); -static struct vtblk_request * vtblk_dequeue_request(struct vtblk_softc *); -static void vtblk_enqueue_request(struct vtblk_softc *, - struct vtblk_request *); - -static struct vtblk_request * vtblk_dequeue_ready(struct vtblk_softc *); -static void vtblk_enqueue_ready(struct vtblk_softc *, - struct vtblk_request *); +static void vtblk_dump_prepare(struct vtblk_softc *); +static int vtblk_dump_write(struct vtblk_softc *, void *, off_t, size_t); +static int vtblk_dump_flush(struct vtblk_softc *); -static int vtblk_request_error(struct vtblk_request *); -static void vtblk_finish_bio(struct bio *, int); +static void vtblk_set_write_cache(struct vtblk_softc *, int); +static int vtblk_write_cache_enabled(struct vtblk_softc *sc, + struct virtio_blk_config *); +static int vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS); static void vtblk_setup_sysctl(struct vtblk_softc *); static int vtblk_tunable_int(struct vtblk_softc *, const char *, int); @@ -288,30 +294,18 @@ vtblk_attach(device_t dev) struct virtio_blk_config blkcfg; int error; + virtio_set_feature_desc(dev, vtblk_feature_desc); + sc = device_get_softc(dev); sc->vtblk_dev = dev; - VTBLK_LOCK_INIT(sc, device_get_nameunit(dev)); - bioq_init(&sc->vtblk_bioq); TAILQ_INIT(&sc->vtblk_req_free); TAILQ_INIT(&sc->vtblk_req_ready); - virtio_set_feature_desc(dev, vtblk_feature_desc); - vtblk_negotiate_features(sc); - - if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) - sc->vtblk_flags |= VTBLK_FLAG_INDIRECT; - if (virtio_with_feature(dev, VIRTIO_BLK_F_RO)) - sc->vtblk_flags |= VTBLK_FLAG_READONLY; - if (virtio_with_feature(dev, VIRTIO_BLK_F_BARRIER)) - sc->vtblk_flags |= VTBLK_FLAG_BARRIER; - if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE)) - sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG; - vtblk_setup_sysctl(sc); + vtblk_setup_features(sc); - /* Get local copy of config. */ vtblk_read_config(sc, &blkcfg); /* @@ -350,7 +344,7 @@ vtblk_attach(device_t dev) goto fail; } - error = vtblk_alloc_requests(sc); + error = vtblk_request_prealloc(sc); if (error) { device_printf(dev, "cannot preallocate requests\n"); goto fail; @@ -517,14 +511,14 @@ vtblk_dump(void *arg, void *virtual, vm_ VTBLK_LOCK(sc); if ((sc->vtblk_flags & VTBLK_FLAG_DUMPING) == 0) { - vtblk_prepare_dump(sc); + vtblk_dump_prepare(sc); sc->vtblk_flags |= VTBLK_FLAG_DUMPING; } if (length > 0) - error = vtblk_write_dump(sc, virtual, offset, length); + error = vtblk_dump_write(sc, virtual, offset, length); else if (virtual == NULL && offset == 0) - error = vtblk_flush_dump(sc); + error = vtblk_dump_flush(sc); else { error = EINVAL; sc->vtblk_flags &= ~VTBLK_FLAG_DUMPING; @@ -541,7 +535,7 @@ vtblk_strategy(struct bio *bp) struct vtblk_softc *sc; if ((sc = bp->bio_disk->d_drv1) == NULL) { - vtblk_finish_bio(bp, EINVAL); + vtblk_bio_done(NULL, bp, EINVAL); return; } @@ -551,37 +545,21 @@ vtblk_strategy(struct bio *bp) */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { - vtblk_finish_bio(bp, EROFS); + vtblk_bio_done(sc, 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) { - int nsegs, max_nsegs; - - nsegs = sglist_count(bp->bio_data, bp->bio_bcount); - max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; + VTBLK_LOCK(sc); - KASSERT(nsegs <= max_nsegs, - ("%s: bio %p spanned too many segments: %d, max: %d", - __func__, bp, nsegs, max_nsegs)); + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { + VTBLK_UNLOCK(sc); + vtblk_bio_done(sc, bp, ENXIO); + return; } -#endif - VTBLK_LOCK(sc); - if (sc->vtblk_flags & VTBLK_FLAG_DETACH) - vtblk_finish_bio(bp, ENXIO); - else { - bioq_insert_tail(&sc->vtblk_bioq, bp); + bioq_insert_tail(&sc->vtblk_bioq, bp); + vtblk_startio(sc); - if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) - vtblk_startio(sc); - } VTBLK_UNLOCK(sc); } @@ -597,6 +575,25 @@ vtblk_negotiate_features(struct vtblk_so sc->vtblk_features = virtio_negotiate_features(dev, features); } +static void +vtblk_setup_features(struct vtblk_softc *sc) +{ + device_t dev; + + dev = sc->vtblk_dev; + + vtblk_negotiate_features(sc); + + if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) + sc->vtblk_flags |= VTBLK_FLAG_INDIRECT; + if (virtio_with_feature(dev, VIRTIO_BLK_F_RO)) + sc->vtblk_flags |= VTBLK_FLAG_READONLY; + if (virtio_with_feature(dev, VIRTIO_BLK_F_BARRIER)) + sc->vtblk_flags |= VTBLK_FLAG_BARRIER; + if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE)) + sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG; +} + static int vtblk_maximum_segments(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg) @@ -658,59 +655,6 @@ vtblk_resize_disk(struct vtblk_softc *sc } static void -vtblk_set_write_cache(struct vtblk_softc *sc, int wc) -{ - - /* Set either writeback (1) or writethrough (0) mode. */ - virtio_write_dev_config_1(sc->vtblk_dev, - offsetof(struct virtio_blk_config, writeback), wc); -} - -static int -vtblk_write_cache_enabled(struct vtblk_softc *sc, - struct virtio_blk_config *blkcfg) -{ - int wc; - - if (sc->vtblk_flags & VTBLK_FLAG_WC_CONFIG) { - wc = vtblk_tunable_int(sc, "writecache_mode", - vtblk_writecache_mode); - if (wc >= 0 && wc < VTBLK_CACHE_MAX) - vtblk_set_write_cache(sc, wc); - else - wc = blkcfg->writeback; - } else - wc = virtio_with_feature(sc->vtblk_dev, VIRTIO_BLK_F_WCE); - - return (wc); -} - -static int -vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS) -{ - struct vtblk_softc *sc; - int wc, error; - - sc = oidp->oid_arg1; - wc = sc->vtblk_write_cache; - - error = sysctl_handle_int(oidp, &wc, 0, req); - if (error || req->newptr == NULL) - return (error); - if ((sc->vtblk_flags & VTBLK_FLAG_WC_CONFIG) == 0) - return (EPERM); - if (wc < 0 || wc >= VTBLK_CACHE_MAX) - return (EINVAL); - - VTBLK_LOCK(sc); - sc->vtblk_write_cache = wc; - vtblk_set_write_cache(sc, sc->vtblk_write_cache); - VTBLK_UNLOCK(sc); - - return (0); -} - -static void vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg) { device_t dev; @@ -726,7 +670,8 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_name = VTBLK_DISK_NAME; dp->d_unit = device_get_unit(dev); dp->d_drv1 = sc; - dp->d_flags = DISKFLAG_CANFLUSHCACHE | DISKFLAG_UNMAPPED_BIO; + dp->d_flags = DISKFLAG_CANFLUSHCACHE | DISKFLAG_UNMAPPED_BIO | + DISKFLAG_DIRECT_COMPLETION; dp->d_hba_vendor = virtio_get_vendor(dev); dp->d_hba_device = virtio_get_device(dev); dp->d_hba_subvendor = virtio_get_subvendor(dev); @@ -787,11 +732,7 @@ vtblk_create_disk(struct vtblk_softc *sc dp = sc->vtblk_disk; - /* - * Retrieving the identification string must be done after - * the virtqueue interrupt is setup otherwise it will hang. - */ - vtblk_get_ident(sc); + vtblk_ident(sc); device_printf(sc->vtblk_dev, "%juMB (%ju %u byte sectors)\n", (uintmax_t) dp->d_mediasize >> 20, @@ -802,57 +743,107 @@ vtblk_create_disk(struct vtblk_softc *sc } static int -vtblk_quiesce(struct vtblk_softc *sc) +vtblk_request_prealloc(struct vtblk_softc *sc) { - int error; + struct vtblk_request *req; + int i, nreqs; - error = 0; + nreqs = virtqueue_size(sc->vtblk_vq); - VTBLK_LOCK_ASSERT(sc); + /* + * Preallocate sufficient requests to keep the virtqueue full. Each + * request consumes VTBLK_MIN_SEGMENTS or more descriptors so reduce + * the number allocated when indirect descriptors are not available. + */ + if ((sc->vtblk_flags & VTBLK_FLAG_INDIRECT) == 0) + nreqs /= VTBLK_MIN_SEGMENTS; - while (!virtqueue_empty(sc->vtblk_vq)) { - if (mtx_sleep(&sc->vtblk_vq, VTBLK_MTX(sc), PRIBIO, "vtblkq", - VTBLK_QUIESCE_TIMEOUT) == EWOULDBLOCK) { - error = EBUSY; - break; - } + for (i = 0; i < nreqs; i++) { + req = malloc(sizeof(struct vtblk_request), M_DEVBUF, M_NOWAIT); + if (req == NULL) + return (ENOMEM); + + MPASS(sglist_count(&req->vbr_hdr, sizeof(req->vbr_hdr)) == 1); + MPASS(sglist_count(&req->vbr_ack, sizeof(req->vbr_ack)) == 1); + + sc->vtblk_request_count++; + vtblk_request_enqueue(sc, req); } - return (error); + return (0); } static void -vtblk_startio(struct vtblk_softc *sc) +vtblk_request_free(struct vtblk_softc *sc) { - struct virtqueue *vq; struct vtblk_request *req; - int enq; - vq = sc->vtblk_vq; - enq = 0; + MPASS(TAILQ_EMPTY(&sc->vtblk_req_ready)); - VTBLK_LOCK_ASSERT(sc); + while ((req = vtblk_request_dequeue(sc)) != NULL) { + sc->vtblk_request_count--; + free(req, M_DEVBUF); + } - while (!virtqueue_full(vq)) { - if ((req = vtblk_dequeue_ready(sc)) == NULL) - req = vtblk_bio_request(sc); - if (req == NULL) - break; + KASSERT(sc->vtblk_request_count == 0, + ("%s: leaked %d requests", __func__, sc->vtblk_request_count)); +} - if (vtblk_execute_request(sc, req) != 0) { - vtblk_enqueue_ready(sc, req); - break; - } +static struct vtblk_request * +vtblk_request_dequeue(struct vtblk_softc *sc) +{ + struct vtblk_request *req; - enq++; + req = TAILQ_FIRST(&sc->vtblk_req_free); + if (req != NULL) { + TAILQ_REMOVE(&sc->vtblk_req_free, req, vbr_link); + bzero(req, sizeof(struct vtblk_request)); } - if (enq > 0) - virtqueue_notify(vq); + return (req); +} + +static void +vtblk_request_enqueue(struct vtblk_softc *sc, struct vtblk_request *req) +{ + + TAILQ_INSERT_HEAD(&sc->vtblk_req_free, req, vbr_link); +} + +static struct vtblk_request * +vtblk_request_next_ready(struct vtblk_softc *sc) +{ + struct vtblk_request *req; + + req = TAILQ_FIRST(&sc->vtblk_req_ready); + if (req != NULL) + TAILQ_REMOVE(&sc->vtblk_req_ready, req, vbr_link); + + return (req); +} + +static void +vtblk_request_requeue_ready(struct vtblk_softc *sc, struct vtblk_request *req) +{ + + /* NOTE: Currently, there will be at most one request in the queue. */ + TAILQ_INSERT_HEAD(&sc->vtblk_req_ready, req, vbr_link); +} + +static struct vtblk_request * +vtblk_request_next(struct vtblk_softc *sc) +{ + struct vtblk_request *req; + + req = vtblk_request_next_ready(sc); + if (req != NULL) + return (req); + + return (vtblk_request_bio(sc)); } static struct vtblk_request * -vtblk_bio_request(struct vtblk_softc *sc) +vtblk_request_bio(struct vtblk_softc *sc) { struct bio_queue_head *bioq; struct vtblk_request *req; @@ -863,7 +854,7 @@ vtblk_bio_request(struct vtblk_softc *sc if (bioq_first(bioq) == NULL) return (NULL); - req = vtblk_dequeue_request(sc); + req = vtblk_request_dequeue(sc); if (req == NULL) return (NULL); @@ -888,11 +879,14 @@ vtblk_bio_request(struct vtblk_softc *sc panic("%s: bio with unhandled cmd: %d", __func__, bp->bio_cmd); } + if (bp->bio_flags & BIO_ORDERED) + req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; + return (req); } static int -vtblk_execute_request(struct vtblk_softc *sc, struct vtblk_request *req) +vtblk_request_execute(struct vtblk_softc *sc, struct vtblk_request *req) { struct virtqueue *vq; struct sglist *sg; @@ -905,26 +899,20 @@ vtblk_execute_request(struct vtblk_softc ordered = 0; writable = 0; - VTBLK_LOCK_ASSERT(sc); - /* - * Wait until the ordered request completes before - * executing subsequent requests. + * Some hosts (such as bhyve) do not implement the barrier feature, + * so we emulate it in the driver by allowing the barrier request + * to be the only one in flight. */ - if (sc->vtblk_req_ordered != NULL) - return (EBUSY); - - if (bp->bio_flags & BIO_ORDERED) { - if ((sc->vtblk_flags & VTBLK_FLAG_BARRIER) == 0) { - /* - * This request will be executed once all - * the in-flight requests are completed. - */ + if ((sc->vtblk_flags & VTBLK_FLAG_BARRIER) == 0) { + if (sc->vtblk_req_ordered != NULL) + return (EBUSY); + if (bp->bio_flags & BIO_ORDERED) { if (!virtqueue_empty(vq)) return (EBUSY); ordered = 1; - } else - req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; + req->vbr_hdr.type &= ~VIRTIO_BLK_T_BARRIER; + } } sglist_reset(sg); @@ -933,7 +921,7 @@ vtblk_execute_request(struct vtblk_softc if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { error = sglist_append_bio(sg, bp); if (error || sg->sg_nseg == sg->sg_maxseg) { - panic("%s: data buffer too big bio:%p error:%d", + panic("%s: bio %p data buffer too big %d", __func__, bp, error); } @@ -953,44 +941,156 @@ vtblk_execute_request(struct vtblk_softc return (error); } -static void -vtblk_vq_intr(void *xsc) +static int +vtblk_request_error(struct vtblk_request *req) { - struct vtblk_softc *sc; - struct virtqueue *vq; - - sc = xsc; - vq = sc->vtblk_vq; + int error; -again: - VTBLK_LOCK(sc); - if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { - VTBLK_UNLOCK(sc); - return; + switch (req->vbr_ack) { + case VIRTIO_BLK_S_OK: + error = 0; + break; + case VIRTIO_BLK_S_UNSUPP: + error = ENOTSUP; + break; + default: + error = EIO; + break; } - vtblk_finish_completed(sc); + return (error); +} - if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) - vtblk_startio(sc); - else - wakeup(&sc->vtblk_vq); +static void +vtblk_queue_completed(struct vtblk_softc *sc, struct bio_queue *queue) +{ + struct vtblk_request *req; + struct bio *bp; - if (virtqueue_enable_intr(vq) != 0) { - virtqueue_disable_intr(vq); - VTBLK_UNLOCK(sc); - goto again; + while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { + if (sc->vtblk_req_ordered != NULL) { + MPASS(sc->vtblk_req_ordered == req); + sc->vtblk_req_ordered = NULL; + } + + bp = req->vbr_bp; + bp->bio_error = vtblk_request_error(req); + TAILQ_INSERT_TAIL(queue, bp, bio_queue); + + vtblk_request_enqueue(sc, req); } +} - VTBLK_UNLOCK(sc); +static void +vtblk_done_completed(struct vtblk_softc *sc, struct bio_queue *queue) +{ + struct bio *bp, *tmp; + + TAILQ_FOREACH_SAFE(bp, queue, bio_queue, tmp) { + if (bp->bio_error != 0) + disk_err(bp, "hard error", -1, 1); + vtblk_bio_done(sc, bp, bp->bio_error); + } } static void -vtblk_stop(struct vtblk_softc *sc) +vtblk_drain_vq(struct vtblk_softc *sc, int skip_done) { + struct virtqueue *vq; + struct vtblk_request *req; + int last; - virtqueue_disable_intr(sc->vtblk_vq); - virtio_stop(sc->vtblk_dev); + vq = sc->vtblk_vq; + last = 0; + + while ((req = virtqueue_drain(vq, &last)) != NULL) { + if (!skip_done) + vtblk_bio_done(sc, req->vbr_bp, ENXIO); + + vtblk_request_enqueue(sc, req); + } + + sc->vtblk_req_ordered = NULL; + KASSERT(virtqueue_empty(vq), ("virtqueue not empty")); +} + +static void +vtblk_drain(struct vtblk_softc *sc) +{ + struct bio_queue queue; + struct bio_queue_head *bioq; + struct vtblk_request *req; + struct bio *bp; + + bioq = &sc->vtblk_bioq; + TAILQ_INIT(&queue); + + if (sc->vtblk_vq != NULL) { + vtblk_queue_completed(sc, &queue); + vtblk_done_completed(sc, &queue); + + vtblk_drain_vq(sc, 0); + } + + while ((req = vtblk_request_next_ready(sc)) != NULL) { + vtblk_bio_done(sc, req->vbr_bp, ENXIO); + vtblk_request_enqueue(sc, req); + } + + while (bioq_first(bioq) != NULL) { + bp = bioq_takefirst(bioq); + vtblk_bio_done(sc, bp, ENXIO); + } + + vtblk_request_free(sc); +} + +static void +vtblk_startio(struct vtblk_softc *sc) +{ + struct virtqueue *vq; + struct vtblk_request *req; + int enq; + + VTBLK_LOCK_ASSERT(sc); + vq = sc->vtblk_vq; + enq = 0; + + if (sc->vtblk_flags & VTBLK_FLAG_SUSPEND) + return; + + while (!virtqueue_full(vq)) { + req = vtblk_request_next(sc); + if (req == NULL) + break; + + if (vtblk_request_execute(sc, req) != 0) { + vtblk_request_requeue_ready(sc, req); + break; + } + + enq++; + } + + if (enq > 0) + virtqueue_notify(vq); +} + +static void +vtblk_bio_done(struct vtblk_softc *sc, struct bio *bp, int error) +{ + + /* Because of GEOM direct dispatch, we cannot hold any locks. */ + if (sc != NULL) + VTBLK_LOCK_ASSERT_NOTOWNED(sc); + + if (error) { + bp->bio_resid = bp->bio_bcount; + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; + } + + biodone(bp); } #define VTBLK_GET_CONFIG(_dev, _feature, _field, _cfg) \ @@ -1025,7 +1125,7 @@ vtblk_read_config(struct vtblk_softc *sc #undef VTBLK_GET_CONFIG static void -vtblk_get_ident(struct vtblk_softc *sc) +vtblk_ident(struct vtblk_softc *sc) { struct bio buf; struct disk *dp; @@ -1038,7 +1138,7 @@ vtblk_get_ident(struct vtblk_softc *sc) if (vtblk_tunable_int(sc, "no_ident", vtblk_no_ident) != 0) return; - req = vtblk_dequeue_request(sc); + req = vtblk_request_dequeue(sc); if (req == NULL) return; @@ -1058,7 +1158,7 @@ vtblk_get_ident(struct vtblk_softc *sc) error = vtblk_poll_request(sc, req); VTBLK_UNLOCK(sc); - vtblk_enqueue_request(sc, req); + vtblk_request_enqueue(sc, req); if (error) { device_printf(sc->vtblk_dev, @@ -1066,77 +1166,6 @@ vtblk_get_ident(struct vtblk_softc *sc) } } -static void -vtblk_prepare_dump(struct vtblk_softc *sc) -{ - device_t dev; - struct virtqueue *vq; - - dev = sc->vtblk_dev; - vq = sc->vtblk_vq; - - vtblk_stop(sc); - - /* - * Drain all requests caught in-flight in the virtqueue, - * skipping biodone(). When dumping, only one request is - * outstanding at a time, and we just poll the virtqueue - * for the response. - */ - vtblk_drain_vq(sc, 1); - - if (virtio_reinit(dev, sc->vtblk_features) != 0) { - panic("%s: cannot reinit VirtIO block device during dump", - device_get_nameunit(dev)); - } - - virtqueue_disable_intr(vq); - virtio_reinit_complete(dev); -} - -static int -vtblk_write_dump(struct vtblk_softc *sc, void *virtual, off_t offset, - size_t length) -{ - struct bio buf; - struct vtblk_request *req; - - req = &sc->vtblk_dump_request; - req->vbr_ack = -1; - req->vbr_hdr.type = VIRTIO_BLK_T_OUT; - req->vbr_hdr.ioprio = 1; - req->vbr_hdr.sector = offset / 512; - - req->vbr_bp = &buf; - bzero(&buf, sizeof(struct bio)); - - buf.bio_cmd = BIO_WRITE; - buf.bio_data = virtual; - buf.bio_bcount = length; - - return (vtblk_poll_request(sc, req)); -} - -static int -vtblk_flush_dump(struct vtblk_softc *sc) -{ - struct bio buf; - struct vtblk_request *req; - - req = &sc->vtblk_dump_request; - req->vbr_ack = -1; - req->vbr_hdr.type = VIRTIO_BLK_T_FLUSH; - req->vbr_hdr.ioprio = 1; - req->vbr_hdr.sector = 0; - - req->vbr_bp = &buf; - bzero(&buf, sizeof(struct bio)); - - buf.bio_cmd = BIO_FLUSH; - - return (vtblk_poll_request(sc, req)); -} - static int vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req) { @@ -1148,7 +1177,7 @@ vtblk_poll_request(struct vtblk_softc *s if (!virtqueue_empty(vq)) return (EBUSY); - error = vtblk_execute_request(sc, req); + error = vtblk_request_execute(sc, req); if (error) return (error); @@ -1164,212 +1193,188 @@ vtblk_poll_request(struct vtblk_softc *s return (error); } -static void -vtblk_finish_completed(struct vtblk_softc *sc) +static int +vtblk_quiesce(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; + VTBLK_LOCK_ASSERT(sc); + error = 0; - if (sc->vtblk_req_ordered != NULL) { - /* This should be the only outstanding request. */ - MPASS(sc->vtblk_req_ordered == req); - sc->vtblk_req_ordered = NULL; + while (!virtqueue_empty(sc->vtblk_vq)) { + if (mtx_sleep(&sc->vtblk_vq, VTBLK_MTX(sc), PRIBIO, "vtblkq", + VTBLK_QUIESCE_TIMEOUT) == EWOULDBLOCK) { + error = EBUSY; + break; } - - error = vtblk_request_error(req); - if (error) - disk_err(bp, "hard error", -1, 1); - - vtblk_finish_bio(bp, error); - vtblk_enqueue_request(sc, req); } + + return (error); } static void -vtblk_drain_vq(struct vtblk_softc *sc, int skip_done) +vtblk_vq_intr(void *xsc) { + struct vtblk_softc *sc; struct virtqueue *vq; - struct vtblk_request *req; - int last; + struct bio_queue queue; + sc = xsc; vq = sc->vtblk_vq; - last = 0; - - while ((req = virtqueue_drain(vq, &last)) != NULL) { - if (!skip_done) - vtblk_finish_bio(req->vbr_bp, ENXIO); + TAILQ_INIT(&queue); - vtblk_enqueue_request(sc, req); - } - - sc->vtblk_req_ordered = NULL; - KASSERT(virtqueue_empty(vq), ("virtqueue not empty")); -} - -static void -vtblk_drain(struct vtblk_softc *sc) -{ - struct bio_queue_head *bioq; - struct vtblk_request *req; - struct bio *bp; + VTBLK_LOCK(sc); - bioq = &sc->vtblk_bioq; +again: + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) + goto out; - if (sc->vtblk_vq != NULL) { - vtblk_finish_completed(sc); - vtblk_drain_vq(sc, 0); - } + vtblk_queue_completed(sc, &queue); + vtblk_startio(sc); - while ((req = vtblk_dequeue_ready(sc)) != NULL) { - vtblk_finish_bio(req->vbr_bp, ENXIO); - vtblk_enqueue_request(sc, req); + if (virtqueue_enable_intr(vq) != 0) { + virtqueue_disable_intr(vq); + goto again; } - while (bioq_first(bioq) != NULL) { - bp = bioq_takefirst(bioq); - vtblk_finish_bio(bp, ENXIO); - } + if (sc->vtblk_flags & VTBLK_FLAG_SUSPEND) + wakeup(&sc->vtblk_vq); - vtblk_free_requests(sc); +out: + VTBLK_UNLOCK(sc); + vtblk_done_completed(sc, &queue); } -#ifdef INVARIANTS static void -vtblk_request_invariants(struct vtblk_request *req) +vtblk_stop(struct vtblk_softc *sc) { - int hdr_nsegs, ack_nsegs; - - hdr_nsegs = sglist_count(&req->vbr_hdr, sizeof(req->vbr_hdr)); - ack_nsegs = sglist_count(&req->vbr_ack, sizeof(req->vbr_ack)); - KASSERT(hdr_nsegs == 1, ("request header crossed page boundary")); - KASSERT(ack_nsegs == 1, ("request ack crossed page boundary")); + virtqueue_disable_intr(sc->vtblk_vq); + virtio_stop(sc->vtblk_dev); } -#endif -static int -vtblk_alloc_requests(struct vtblk_softc *sc) +static void +vtblk_dump_prepare(struct vtblk_softc *sc) { - struct vtblk_request *req; - int i, nreqs; + device_t dev; + struct virtqueue *vq; - nreqs = virtqueue_size(sc->vtblk_vq); + dev = sc->vtblk_dev; + vq = sc->vtblk_vq; + + vtblk_stop(sc); /* - * Preallocate sufficient requests to keep the virtqueue full. Each - * request consumes VTBLK_MIN_SEGMENTS or more descriptors so reduce - * the number allocated when indirect descriptors are not available. + * Drain all requests caught in-flight in the virtqueue, + * skipping biodone(). When dumping, only one request is + * outstanding at a time, and we just poll the virtqueue + * for the response. */ - if ((sc->vtblk_flags & VTBLK_FLAG_INDIRECT) == 0) - nreqs /= VTBLK_MIN_SEGMENTS; - - for (i = 0; i < nreqs; i++) { - req = malloc(sizeof(struct vtblk_request), M_DEVBUF, M_NOWAIT); - if (req == NULL) - return (ENOMEM); - -#ifdef INVARIANTS - vtblk_request_invariants(req); -#endif + vtblk_drain_vq(sc, 1); - sc->vtblk_request_count++; - vtblk_enqueue_request(sc, req); + if (virtio_reinit(dev, sc->vtblk_features) != 0) { + panic("%s: cannot reinit VirtIO block device during dump", + device_get_nameunit(dev)); } - return (0); + virtqueue_disable_intr(vq); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jan 1 02:04:48 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A5DA498; Thu, 1 Jan 2015 02:04:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B44464F90; Thu, 1 Jan 2015 02:04:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0124mui011148; Thu, 1 Jan 2015 02:04:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0124jq8011136; Thu, 1 Jan 2015 02:04:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201501010204.t0124jq8011136@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 1 Jan 2015 02:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276490 - in stable/10: bin/sleep bin/sleep/tests etc/mtree gnu/usr.bin/diff gnu/usr.bin/diff/tests usr.bin/basename usr.bin/basename/tests usr.bin/cmp usr.bin/cmp/tests usr.bin/cut usr... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2015 02:04:48 -0000 Author: ngie Date: Thu Jan 1 02:04:44 2015 New Revision: 276490 URL: https://svnweb.freebsd.org/changeset/base/276490 Log: MFC r272777,r272779,r272780,r272781,r272782,r272783,r272784,r272787,r272788: r272777: Integrate usr.sbin/nmtree/tests from NetBSD into atf/kyua In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r272779: Integrate usr.sbin/basename/tests from NetBSD into atf/kyua In collaboration with: pho Sponsored by: EMC / Isilon Storage Division r272780: Integrate usr.bin/cmp/tests from NetBSD into atf/kyua In collaboration with: sjg Sponsored by: EMC / Isilon Storage Division r272781: Integrate usr.bin/dirname/tests from NetBSD into atf/kyua In collaboration with: pho, sjg Sponsored by: EMC / Isilon Storage Division r272782: Integrate bin/sleep/tests from NetBSD into atf/kyua Sponsored by: EMC / Isilon Storage Division r272783: Integrate usr.bin/cut/tests from NetBSD into atf/kyua Sponsored by: EMC / Isilon Storage Division r272784: Integrate usr.bin/grep/tests from NetBSD into atf/kyua Sponsored by: EMC / Isilon Storage Division r272787: Integrate usr.bin/diff/tests from NetBSD into atf/kyua at gnu/usr.bin/diff/tests Sponsored by: EMC / Isilon Storage Division r272788: Integrate usr.bin/gzip/tests from NetBSD into atf/kyua Sponsored by: EMC / Isilon Storage Division Added: stable/10/bin/sleep/tests/ - copied from r272782, head/bin/sleep/tests/ stable/10/gnu/usr.bin/diff/tests/ - copied from r272787, head/gnu/usr.bin/diff/tests/ stable/10/usr.bin/basename/tests/ - copied from r272779, head/usr.bin/basename/tests/ stable/10/usr.bin/cmp/tests/ - copied from r272780, head/usr.bin/cmp/tests/ stable/10/usr.bin/cut/tests/ - copied from r272783, head/usr.bin/cut/tests/ stable/10/usr.bin/dirname/tests/ - copied from r272781, head/usr.bin/dirname/tests/ stable/10/usr.bin/grep/tests/ - copied from r272784, head/usr.bin/grep/tests/ stable/10/usr.bin/gzip/tests/ - copied from r272788, head/usr.bin/gzip/tests/ stable/10/usr.sbin/nmtree/tests/ - copied from r272777, head/usr.sbin/nmtree/tests/ Modified: stable/10/bin/sleep/Makefile stable/10/etc/mtree/BSD.tests.dist stable/10/gnu/usr.bin/diff/Makefile stable/10/usr.bin/basename/Makefile stable/10/usr.bin/cmp/Makefile stable/10/usr.bin/cut/Makefile stable/10/usr.bin/dirname/Makefile stable/10/usr.bin/grep/Makefile stable/10/usr.bin/gzip/Makefile stable/10/usr.sbin/nmtree/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sleep/Makefile ============================================================================== --- stable/10/bin/sleep/Makefile Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/bin/sleep/Makefile Thu Jan 1 02:04:44 2015 (r276490) @@ -1,6 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= sleep +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/etc/mtree/BSD.tests.dist Thu Jan 1 02:04:44 2015 (r276490) @@ -47,6 +47,8 @@ set-e .. .. + sleep + .. test .. .. @@ -68,6 +70,8 @@ lib .. usr.bin + diff + .. .. .. lib @@ -169,6 +173,8 @@ usr.bin apply .. + basename + .. bmake archives fmt_44bsd @@ -269,10 +275,20 @@ .. calendar .. + cmp + .. comm .. + cut + .. + dirname + .. file2c .. + grep + .. + gzip + .. join .. jot @@ -309,6 +325,8 @@ .. newsyslog .. + nmtree + .. pw .. sa Modified: stable/10/gnu/usr.bin/diff/Makefile ============================================================================== --- stable/10/gnu/usr.bin/diff/Makefile Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/gnu/usr.bin/diff/Makefile Thu Jan 1 02:04:44 2015 (r276490) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + DIFFSRC=${.CURDIR}/../../../contrib/diff/src .PATH: ${DIFFSRC} \ ${.CURDIR}/../../../contrib/diff/lib \ @@ -27,4 +29,8 @@ SUBDIR+=doc DPADD= ${LIBGNUREGEX} LDADD= -lgnuregex +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/basename/Makefile ============================================================================== --- stable/10/usr.bin/basename/Makefile Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/usr.bin/basename/Makefile Thu Jan 1 02:04:44 2015 (r276490) @@ -1,7 +1,13 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= basename MLINKS= basename.1 dirname.1 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/cmp/Makefile ============================================================================== --- stable/10/usr.bin/cmp/Makefile Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/usr.bin/cmp/Makefile Thu Jan 1 02:04:44 2015 (r276490) @@ -1,7 +1,13 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= cmp SRCS= cmp.c link.c misc.c regular.c special.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/cut/Makefile ============================================================================== --- stable/10/usr.bin/cut/Makefile Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/usr.bin/cut/Makefile Thu Jan 1 02:04:44 2015 (r276490) @@ -1,6 +1,12 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= cut +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/dirname/Makefile ============================================================================== --- stable/10/usr.bin/dirname/Makefile Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/usr.bin/dirname/Makefile Thu Jan 1 02:04:44 2015 (r276490) @@ -1,7 +1,13 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= dirname MAN= +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/grep/Makefile ============================================================================== --- stable/10/usr.bin/grep/Makefile Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/usr.bin/grep/Makefile Thu Jan 1 02:04:44 2015 (r276490) @@ -85,4 +85,8 @@ DPADD+= ${LIBGNUREGEX} CFLAGS+= -DWITHOUT_NLS .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/gzip/Makefile ============================================================================== --- stable/10/usr.bin/gzip/Makefile Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/usr.bin/gzip/Makefile Thu Jan 1 02:04:44 2015 (r276490) @@ -29,4 +29,8 @@ LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip ${BINDIR}/gzip ${BINDIR}/zcat \ ${BINDIR}/zdiff ${BINDIR}/zcmp +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.sbin/nmtree/Makefile ============================================================================== --- stable/10/usr.sbin/nmtree/Makefile Thu Jan 1 02:03:09 2015 (r276489) +++ stable/10/usr.sbin/nmtree/Makefile Thu Jan 1 02:04:44 2015 (r276490) @@ -31,4 +31,8 @@ CLEANFILES+= nmtree.8 nmtree.8: mtree.8 cp ${.ALLSRC} ${.TARGET} +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include From owner-svn-src-stable@FreeBSD.ORG Thu Jan 1 02:12:46 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C4F7751; Thu, 1 Jan 2015 02:12:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CB8D670B1; Thu, 1 Jan 2015 02:12:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t012Ckn9015770; Thu, 1 Jan 2015 02:12:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t012CikE015758; Thu, 1 Jan 2015 02:12:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201501010212.t012CikE015758@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 1 Jan 2015 02:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276492 - in stable/10: etc/mtree lib/librt lib/librt/tests lib/libthr lib/libthr/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2015 02:12:46 -0000 Author: ngie Date: Thu Jan 1 02:12:43 2015 New Revision: 276492 URL: https://svnweb.freebsd.org/changeset/base/276492 Log: MFC r274578,r274580: r274578: Add reachover Makefiles for contrib/netbsd-tests/lib/libpthread as lib/libthr/tests A variant of this code has been tested on amd64/i386 for some time by EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the code will remain off until it's proven it works on virtual hardware or real hardware on other architectures Original work by: pho Sponsored by: EMC / Isilon Storage Division r274580: Add reachover Makefiles for contrib/netbsd-tests/lib/librt A variant of this code has been tested on amd64/i386 for some time by EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the code will remain off until it's proven it works on virtual hardware or real hardware on other architectures Sponsored by: EMC / Isilon Storage Division Added: stable/10/lib/librt/Makefile.amd64 - copied unchanged from r274580, head/lib/librt/Makefile.amd64 stable/10/lib/librt/Makefile.i386 - copied unchanged from r274580, head/lib/librt/Makefile.i386 stable/10/lib/librt/tests/ - copied from r274580, head/lib/librt/tests/ stable/10/lib/libthr/Makefile.amd64 - copied unchanged from r274578, head/lib/libthr/Makefile.amd64 stable/10/lib/libthr/Makefile.i386 - copied unchanged from r274578, head/lib/libthr/Makefile.i386 stable/10/lib/libthr/tests/ - copied from r274578, head/lib/libthr/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/lib/librt/Makefile stable/10/lib/libthr/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Thu Jan 1 02:06:00 2015 (r276491) +++ stable/10/etc/mtree/BSD.tests.dist Thu Jan 1 02:12:43 2015 (r276492) @@ -91,6 +91,12 @@ .. libmp .. + librt + .. + libthr + dlopen + .. + .. libutil .. .. Modified: stable/10/lib/librt/Makefile ============================================================================== --- stable/10/lib/librt/Makefile Thu Jan 1 02:06:00 2015 (r276491) +++ stable/10/lib/librt/Makefile Thu Jan 1 02:12:43 2015 (r276492) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB=rt SHLIB_MAJOR= 1 CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR} @@ -18,4 +20,6 @@ PRECIOUSLIB= VERSION_MAP= ${.CURDIR}/Version.map +.include + .include Copied: stable/10/lib/librt/Makefile.amd64 (from r274580, head/lib/librt/Makefile.amd64) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/librt/Makefile.amd64 Thu Jan 1 02:12:43 2015 (r276492, copy of r274580, head/lib/librt/Makefile.amd64) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Copied: stable/10/lib/librt/Makefile.i386 (from r274580, head/lib/librt/Makefile.i386) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/librt/Makefile.i386 Thu Jan 1 02:12:43 2015 (r276492, copy of r274580, head/lib/librt/Makefile.i386) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Modified: stable/10/lib/libthr/Makefile ============================================================================== --- stable/10/lib/libthr/Makefile Thu Jan 1 02:06:00 2015 (r276491) +++ stable/10/lib/libthr/Makefile Thu Jan 1 02:12:43 2015 (r276492) @@ -64,4 +64,6 @@ SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpth CFLAGS+=-DSYSCALL_COMPAT .endif +.include + .include Copied: stable/10/lib/libthr/Makefile.amd64 (from r274578, head/lib/libthr/Makefile.amd64) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libthr/Makefile.amd64 Thu Jan 1 02:12:43 2015 (r276492, copy of r274578, head/lib/libthr/Makefile.amd64) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Copied: stable/10/lib/libthr/Makefile.i386 (from r274578, head/lib/libthr/Makefile.i386) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libthr/Makefile.i386 Thu Jan 1 02:12:43 2015 (r276492, copy of r274578, head/lib/libthr/Makefile.i386) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + From owner-svn-src-stable@FreeBSD.ORG Thu Jan 1 10:44:26 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 651BCA50; Thu, 1 Jan 2015 10:44:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE2E647B5; Thu, 1 Jan 2015 10:44:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t01AiQ63050859; Thu, 1 Jan 2015 10:44:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t01AiLDp050836; Thu, 1 Jan 2015 10:44:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501011044.t01AiLDp050836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 1 Jan 2015 10:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276500 - in stable/10/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/ext2fs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nfsserver fs/tmpfs fs/unionfs kern nfsclient nfsserver ufs/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2015 10:44:26 -0000 Author: kib Date: Thu Jan 1 10:44:20 2015 New Revision: 276500 URL: https://svnweb.freebsd.org/changeset/base/276500 Log: MFC r275897: Set NOCACHE flag for CREATE namei() calls, do not specially handle MAKEENTRY in VOP_LOOKUP(). Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/10/sys/fs/ext2fs/ext2_lookup.c stable/10/sys/fs/fuse/fuse_vnops.c stable/10/sys/fs/msdosfs/msdosfs_lookup.c stable/10/sys/fs/nandfs/nandfs_vnops.c stable/10/sys/fs/nfsclient/nfs_clvnops.c stable/10/sys/fs/nfsserver/nfs_nfsdserv.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c stable/10/sys/fs/unionfs/union_subr.c stable/10/sys/fs/unionfs/union_vnops.c stable/10/sys/kern/uipc_usrreq.c stable/10/sys/kern/vfs_syscalls.c stable/10/sys/kern/vfs_vnops.c stable/10/sys/nfsclient/nfs_vnops.c stable/10/sys/nfsserver/nfs_serv.c stable/10/sys/ufs/ffs/ffs_snapshot.c stable/10/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 1 10:44:20 2015 (r276500) @@ -1538,7 +1538,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode /* * Insert name into cache (as non-existent) if appropriate. */ - if (error == ENOENT && (cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if (error == ENOENT && (cnp->cn_flags & MAKEENTRY) != 0) cache_enter(dvp, *vpp, cnp); /* * Insert name into cache if appropriate. Modified: stable/10/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_lookup.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/fs/ext2fs/ext2_lookup.c Thu Jan 1 10:44:20 2015 (r276500) @@ -514,7 +514,7 @@ notfound: /* * Insert name into cache (as non-existent) if appropriate. */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(vdp, NULL, cnp); return (ENOENT); Modified: stable/10/sys/fs/fuse/fuse_vnops.c ============================================================================== --- stable/10/sys/fs/fuse/fuse_vnops.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/fs/fuse/fuse_vnops.c Thu Jan 1 10:44:20 2015 (r276500) @@ -795,7 +795,7 @@ calldaemon: * caching...) */ #if 0 - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) { + if ((cnp->cn_flags & MAKEENTRY) != 0) { FS_DEBUG("inserting NULL into cache\n"); cache_enter(dvp, NULL, cnp); } Modified: stable/10/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_lookup.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/fs/msdosfs/msdosfs_lookup.c Thu Jan 1 10:44:20 2015 (r276500) @@ -416,7 +416,7 @@ notfound: * and 8.3 filenames. Hence, it may not invalidate all negative * entries if a file with this name is later created. */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(vdp, *vpp, cnp); #endif return (ENOENT); Modified: stable/10/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- stable/10/sys/fs/nandfs/nandfs_vnops.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/fs/nandfs/nandfs_vnops.c Thu Jan 1 10:44:20 2015 (r276500) @@ -479,7 +479,7 @@ out: * the file might not be found and thus putting it into the namecache * might be seen as negative caching. */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(dvp, *vpp, cnp); return (error); Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvnops.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/fs/nfsclient/nfs_clvnops.c Thu Jan 1 10:44:20 2015 (r276500) @@ -1185,8 +1185,7 @@ nfs_lookup(struct vop_lookup_args *ap) return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && - dattrflag) { + if ((cnp->cn_flags & MAKEENTRY) != 0 && dattrflag) { /* * Cache the modification time of the parent * directory from the post-op attributes in Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Thu Jan 1 10:44:20 2015 (r276500) @@ -983,7 +983,7 @@ nfsrvd_create(struct nfsrv_descript *nd, goto out; } NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | LOCKLEAF | SAVESTART); + LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE); nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (error) @@ -1194,7 +1194,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, goto out; } } - NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, cnflags); + NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, cnflags | NOCACHE); nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (error) @@ -1647,7 +1647,7 @@ nfsrvd_link(struct nfsrv_descript *nd, i } } NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | SAVENAME); + LOCKPARENT | SAVENAME | NOCACHE); if (!nd->nd_repstat) { nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); @@ -1724,7 +1724,7 @@ nfsrvd_symlink(struct nfsrv_descript *nd *vpp = NULL; NFSVNO_ATTRINIT(&nva); NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | SAVESTART); + LOCKPARENT | SAVESTART | NOCACHE); nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (!error && !nd->nd_repstat) @@ -1842,7 +1842,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, goto out; } NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | SAVENAME); + LOCKPARENT | SAVENAME | NOCACHE); nfsvno_setpathbuf(&named, &bufp, &hashp); error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (error) @@ -2761,7 +2761,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ } if (create == NFSV4OPEN_CREATE) NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, - LOCKPARENT | LOCKLEAF | SAVESTART); + LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE); else NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, LOOKUP, LOCKLEAF | SAVESTART); Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 1 10:44:20 2015 (r276500) @@ -195,7 +195,7 @@ tmpfs_lookup(struct vop_cachedlookup_arg /* Store the result of this lookup in the cache. Avoid this if the * request was for creation, as it does not improve timings on * emprical tests. */ - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(dvp, *vpp, cnp); out: Modified: stable/10/sys/fs/unionfs/union_subr.c ============================================================================== --- stable/10/sys/fs/unionfs/union_subr.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/fs/unionfs/union_subr.c Thu Jan 1 10:44:20 2015 (r276500) @@ -536,6 +536,8 @@ unionfs_relookup(struct vnode *dvp, stru cn->cn_flags |= (cnp->cn_flags & (DOWHITEOUT | SAVESTART)); else if (RENAME == nameiop) cn->cn_flags |= (cnp->cn_flags & SAVESTART); + else if (nameiop == CREATE) + cn->cn_flags |= NOCACHE; vref(dvp); VOP_UNLOCK(dvp, LK_RELEASE); Modified: stable/10/sys/fs/unionfs/union_vnops.c ============================================================================== --- stable/10/sys/fs/unionfs/union_vnops.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/fs/unionfs/union_vnops.c Thu Jan 1 10:44:20 2015 (r276500) @@ -160,8 +160,7 @@ unionfs_lookup(struct vop_cachedlookup_a LK_RETRY); vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); - } else if (error == ENOENT && (cnflags & MAKEENTRY) && - nameiop != CREATE) + } else if (error == ENOENT && (cnflags & MAKEENTRY) != 0) cache_enter(dvp, NULLVP, cnp); UNIONFS_INTERNAL_DEBUG("unionfs_lookup: leave (%d)\n", error); @@ -337,7 +336,7 @@ unionfs_lookup_out: if (lvp != NULLVP) vrele(lvp); - if (error == ENOENT && (cnflags & MAKEENTRY) && nameiop != CREATE) + if (error == ENOENT && (cnflags & MAKEENTRY) != 0) cache_enter(dvp, NULLVP, cnp); UNIONFS_INTERNAL_DEBUG("unionfs_lookup: leave (%d)\n", error); Modified: stable/10/sys/kern/uipc_usrreq.c ============================================================================== --- stable/10/sys/kern/uipc_usrreq.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/kern/uipc_usrreq.c Thu Jan 1 10:44:20 2015 (r276500) @@ -505,7 +505,7 @@ uipc_bindat(int fd, struct socket *so, s buf[namelen] = 0; restart: - NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | SAVENAME, + NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | SAVENAME | NOCACHE, UIO_SYSSPACE, buf, fd, cap_rights_init(&rights, CAP_BINDAT), td); /* SHOULD BE ABLE TO ADOPT EXISTING AND wakeup() ALA FIFO's */ error = namei(&nd); Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/kern/vfs_syscalls.c Thu Jan 1 10:44:20 2015 (r276500) @@ -1286,8 +1286,9 @@ kern_mknodat(struct thread *td, int fd, return (error); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, - pathseg, path, fd, cap_rights_init(&rights, CAP_MKNODAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | + NOCACHE, pathseg, path, fd, cap_rights_init(&rights, CAP_MKNODAT), + td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1407,8 +1408,9 @@ kern_mkfifoat(struct thread *td, int fd, AUDIT_ARG_MODE(mode); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, - pathseg, path, fd, cap_rights_init(&rights, CAP_MKFIFOAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | + NOCACHE, pathseg, path, fd, cap_rights_init(&rights, CAP_MKFIFOAT), + td); if ((error = namei(&nd)) != 0) return (error); if (nd.ni_vp != NULL) { @@ -1559,8 +1561,9 @@ again: vrele(vp); return (EPERM); /* POSIX */ } - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE2, - segflg, path2, fd2, cap_rights_init(&rights, CAP_LINKAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE2 | + NOCACHE, segflg, path2, fd2, cap_rights_init(&rights, CAP_LINKAT), + td); if ((error = namei(&nd)) == 0) { if (nd.ni_vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1685,8 +1688,9 @@ kern_symlinkat(struct thread *td, char * AUDIT_ARG_TEXT(syspath); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, - segflg, path2, fd, cap_rights_init(&rights, CAP_SYMLINKAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | + NOCACHE, segflg, path2, fd, cap_rights_init(&rights, CAP_SYMLINKAT), + td); if ((error = namei(&nd)) != 0) goto out; if (nd.ni_vp) { @@ -3704,8 +3708,9 @@ kern_mkdirat(struct thread *td, int fd, AUDIT_ARG_MODE(mode); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, - segflg, path, fd, cap_rights_init(&rights, CAP_MKDIRAT), td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | + NOCACHE, segflg, path, fd, cap_rights_init(&rights, CAP_MKDIRAT), + td); nd.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&nd)) != 0) return (error); Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/kern/vfs_vnops.c Thu Jan 1 10:44:20 2015 (r276500) @@ -187,7 +187,11 @@ restart: fmode = *flagp; if (fmode & O_CREAT) { ndp->ni_cnd.cn_nameiop = CREATE; - ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF; + /* + * Set NOCACHE to avoid flushing the cache when + * rolling in many files at once. + */ + ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF | NOCACHE; if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0) ndp->ni_cnd.cn_flags |= FOLLOW; if (!(vn_open_flags & VN_OPEN_NOAUDIT)) Modified: stable/10/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/10/sys/nfsclient/nfs_vnops.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/nfsclient/nfs_vnops.c Thu Jan 1 10:44:20 2015 (r276500) @@ -1181,8 +1181,7 @@ nfsmout: return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && - dattrflag) { + if ((cnp->cn_flags & MAKEENTRY) != 0 && dattrflag) { /* * Cache the modification time of the parent * directory from the post-op attributes in Modified: stable/10/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/10/sys/nfsserver/nfs_serv.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/nfsserver/nfs_serv.c Thu Jan 1 10:44:20 2015 (r276500) @@ -1217,7 +1217,7 @@ nfsrv_create(struct nfsrv_descript *nfsd nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART; + nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE; /* * Call namei and do initial cleanup to get a few things @@ -1501,7 +1501,7 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART; + nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE; /* * Handle nfs_namei() call. If an error occurs, the nd structure @@ -2030,7 +2030,7 @@ nfsrv_link(struct nfsrv_descript *nfsd, VOP_UNLOCK(vp, 0); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT; + nd.ni_cnd.cn_flags = LOCKPARENT | NOCACHE; error = nfs_namei(&nd, nfsd, dfhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); if (dirp && !v3) { @@ -2153,7 +2153,7 @@ nfsrv_symlink(struct nfsrv_descript *nfs nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART; + nd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART | NOCACHE; error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); if (error == 0) { @@ -2325,7 +2325,7 @@ nfsrv_mkdir(struct nfsrv_descript *nfsd, nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT; + nd.ni_cnd.cn_flags = LOCKPARENT | NOCACHE; error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_snapshot.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/ufs/ffs/ffs_snapshot.c Thu Jan 1 10:44:20 2015 (r276500) @@ -256,7 +256,8 @@ ffs_snapshot(mp, snapfile) * Create the snapshot file. */ restart: - NDINIT(&nd, CREATE, LOCKPARENT | LOCKLEAF, UIO_SYSSPACE, snapfile, td); + NDINIT(&nd, CREATE, LOCKPARENT | LOCKLEAF | NOCACHE, UIO_SYSSPACE, + snapfile, td); if ((error = namei(&nd)) != 0) return (error); if (nd.ni_vp != NULL) { Modified: stable/10/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_lookup.c Thu Jan 1 10:07:57 2015 (r276499) +++ stable/10/sys/ufs/ufs/ufs_lookup.c Thu Jan 1 10:44:20 2015 (r276500) @@ -550,7 +550,7 @@ notfound: /* * Insert name into cache (as non-existent) if appropriate. */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(vdp, NULL, cnp); return (ENOENT); From owner-svn-src-stable@FreeBSD.ORG Thu Jan 1 15:37:22 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6F27F54; Thu, 1 Jan 2015 15:37:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A359664D21; Thu, 1 Jan 2015 15:37:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t01FbMZl085711; Thu, 1 Jan 2015 15:37:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t01FbMBO085710; Thu, 1 Jan 2015 15:37:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201501011537.t01FbMBO085710@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 1 Jan 2015 15:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276501 - stable/10/sbin/mount X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2015 15:37:22 -0000 Author: trasz Date: Thu Jan 1 15:37:21 2015 New Revision: 276501 URL: https://svnweb.freebsd.org/changeset/base/276501 Log: MFC r274857: Cross-reference automount(8) from mount(8). Sponsored by: The FreeBSD Foundation Modified: stable/10/sbin/mount/mount.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/mount/mount.8 ============================================================================== --- stable/10/sbin/mount/mount.8 Thu Jan 1 10:44:20 2015 (r276500) +++ stable/10/sbin/mount/mount.8 Thu Jan 1 15:37:21 2015 (r276501) @@ -28,7 +28,7 @@ .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" $FreeBSD$ .\" -.Dd August 20, 2014 +.Dd November 22, 2014 .Dt MOUNT 8 .Os .Sh NAME @@ -548,6 +548,7 @@ support for a particular file system mig .Xr ext2fs 5 , .Xr fstab 5 , .Xr procfs 5 , +.Xr automount 8 , .Xr kldload 8 , .Xr mount_cd9660 8 , .Xr mount_msdosfs 8 , From owner-svn-src-stable@FreeBSD.ORG Thu Jan 1 15:38:58 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48E13285; Thu, 1 Jan 2015 15:38:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3484264D72; Thu, 1 Jan 2015 15:38:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t01FcwNr085932; Thu, 1 Jan 2015 15:38:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t01FcwbP085931; Thu, 1 Jan 2015 15:38:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201501011538.t01FcwbP085931@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 1 Jan 2015 15:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276502 - stable/10/sbin/umount X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2015 15:38:58 -0000 Author: trasz Date: Thu Jan 1 15:38:57 2015 New Revision: 276502 URL: https://svnweb.freebsd.org/changeset/base/276502 Log: MFC r274858: Cross-reference autounmountd(8) from umount(8). Sponsored by: The FreeBSD Foundation Modified: stable/10/sbin/umount/umount.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/umount/umount.8 ============================================================================== --- stable/10/sbin/umount/umount.8 Thu Jan 1 15:37:21 2015 (r276501) +++ stable/10/sbin/umount/umount.8 Thu Jan 1 15:38:57 2015 (r276502) @@ -28,7 +28,7 @@ .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd May 31, 2011 +.Dd November 22, 2014 .Dt UMOUNT 8 .Os .Sh NAME @@ -140,6 +140,7 @@ file system table .Sh SEE ALSO .Xr unmount 2 , .Xr fstab 5 , +.Xr autounmountd 8 , .Xr mount 8 .Sh HISTORY A From owner-svn-src-stable@FreeBSD.ORG Thu Jan 1 15:45:23 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9973141F; Thu, 1 Jan 2015 15:45:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84B5864E72; Thu, 1 Jan 2015 15:45:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t01FjNJc090217; Thu, 1 Jan 2015 15:45:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t01FjNOm090216; Thu, 1 Jan 2015 15:45:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201501011545.t01FjNOm090216@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 1 Jan 2015 15:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276503 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2015 15:45:23 -0000 Author: trasz Date: Thu Jan 1 15:45:22 2015 New Revision: 276503 URL: https://svnweb.freebsd.org/changeset/base/276503 Log: MFC r274954: Remove the pidfile clause from the ctl.conf example. Why do everyone just copy/paste this line into their configs, it's beyond me. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctl.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Thu Jan 1 15:38:57 2015 (r276502) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Thu Jan 1 15:45:22 2015 (r276503) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2014 +.Dd November 24, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -356,8 +356,6 @@ configuration file. .El .Sh EXAMPLES .Bd -literal -pidfile /var/run/ctld.pid - auth-group ag0 { chap-mutual "user" "secret" "mutualuser" "mutualsecret" chap-mutual "user2" "secret2" "mutualuser" "mutualsecret" From owner-svn-src-stable@FreeBSD.ORG Thu Jan 1 15:48:14 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67EE1580; Thu, 1 Jan 2015 15:48:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5328E64E9A; Thu, 1 Jan 2015 15:48:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t01FmEp1090602; Thu, 1 Jan 2015 15:48:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t01FmDke090600; Thu, 1 Jan 2015 15:48:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201501011548.t01FmDke090600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 1 Jan 2015 15:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276504 - in stable/10/etc: defaults rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2015 15:48:14 -0000 Author: trasz Date: Thu Jan 1 15:48:12 2015 New Revision: 276504 URL: https://svnweb.freebsd.org/changeset/base/276504 Log: MFC r274965: Make it possible to specify flags for autofs daemons in rc.conf. Sponsored by: The FreeBSD Foundation Modified: stable/10/etc/defaults/rc.conf stable/10/etc/rc.d/automount Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Thu Jan 1 15:45:22 2015 (r276503) +++ stable/10/etc/defaults/rc.conf Thu Jan 1 15:48:12 2015 (r276504) @@ -326,7 +326,10 @@ amd_enable="NO" # Run amd service with amd_program="/usr/sbin/amd" # path to amd, if you want a different one. amd_flags="-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map" amd_map_program="NO" # Can be set to "ypcat -k amd.master" -autofs_enable="NO" # Run automountd(8) +autofs_enable="NO" # Run autofs daemons. +automount_flags="" # Flags to automount(8) (if autofs enabled). +automountd_flags="" # Flags to automountd(8) (if autofs enabled). +autounmountd_flags="" # Flags to autounmountd(8) (if autofs enabled). nfs_client_enable="NO" # This host is an NFS client (or NO). nfs_access_cache="60" # Client cache timeout in seconds nfs_server_enable="NO" # This host is an NFS server (or NO). Modified: stable/10/etc/rc.d/automount ============================================================================== --- stable/10/etc/rc.d/automount Thu Jan 1 15:45:22 2015 (r276503) +++ stable/10/etc/rc.d/automount Thu Jan 1 15:48:12 2015 (r276504) @@ -18,7 +18,7 @@ required_modules="autofs" automount_start() { - /usr/sbin/automount + /usr/sbin/automount ${automount_flags} } automount_stop() From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 06:56:09 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0250060B; Fri, 2 Jan 2015 06:56:09 +0000 (UTC) Received: from mail.myota.org (mail.myota.org [85.10.206.105]) by mx1.freebsd.org (Postfix) with ESMTP id 7FD3566F55; Fri, 2 Jan 2015 06:56:08 +0000 (UTC) Received: from g229017217.adsl.alicedsl.de (g229017217.adsl.alicedsl.de [92.229.17.217]) (authenticated bits=128) by mail.myota.org (8.14.9/8.14.9) with ESMTP id t026tghq059601; Fri, 2 Jan 2015 07:55:49 +0100 (CET) (envelope-from andre@fbsd.ata.myota.org) Received: from submit.client ([127.0.0.1]) by gate.local (8.14.9/8.14.9) with ESMTP id t026tgGg065502; Fri, 2 Jan 2015 07:55:42 +0100 (CET) (envelope-from andre@fbsd.ata.myota.org) Received: (from user@localhost) by gate.local (8.14.9/8.14.9/Submit) id t026tgXC065501; Fri, 2 Jan 2015 07:55:42 +0100 (CET) (envelope-from andre@fbsd.ata.myota.org) Date: Fri, 2 Jan 2015 07:55:42 +0100 From: Andre Albsmeier To: Erwin Lansing Subject: Re: svn commit: r275890 - in stable/9: contrib/bind9 contrib/bind9/bin/check contrib/bind9/bin/confgen contrib/bind9/bin/dig contrib/bind9/bin/dig/include/dig contrib/bind9/bin/dnssec contrib/bind9/bin... Message-ID: <20150102065542.GA65388@gate> References: <201412180836.sBI8aLHe025437@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412180836.sBI8aLHe025437@svn.freebsd.org> X-Echelon: government, 727, MD2, detonator, 757 X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Not delayed on 85.10.206.105, ACL: AUTH(59), Origin: DE, OS: FreeBSD 9.x X-Greylist: Not delayed, ACL: localhost(52) X-Virus-Scanned: clamav-milter 0.98.5 at colo X-Virus-Status: Clean Cc: mat@FreeBSD.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 06:56:09 -0000 On Thu, 18-Dec-2014 at 08:36:21 +0000, Erwin Lansing wrote: > Author: erwin > Date: Thu Dec 18 08:36:19 2014 > New Revision: 275890 > URL: https://svnweb.freebsd.org/changeset/base/275890 > > Log: > Update BIND to 9.9.6-P1 This leads to a regression due to a bug in nsupdate. A vendor patch is available from https://kb.isc.org/article/AA-01220/. It applies cleanly to 9.3-STABLE and fixes the problem. It would be great if someone could commit this. I've CC'ed the maintainer of the port dns/bind99 as it should be affected as well. From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 08:32:46 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9E10399; Fri, 2 Jan 2015 08:32:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C453364C17; Fri, 2 Jan 2015 08:32:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t028WkFT076129; Fri, 2 Jan 2015 08:32:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t028WkuR076128; Fri, 2 Jan 2015 08:32:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501020832.t028WkuR076128@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Jan 2015 08:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276528 - in stable/10/contrib/ofed/libibverbs/examples: . build X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 08:32:47 -0000 Author: hselasky Date: Fri Jan 2 08:32:45 2015 New Revision: 276528 URL: https://svnweb.freebsd.org/changeset/base/276528 Log: MFC r276238: Add proper Makefiles to build some infiniband example utilities. Sponsored by: Mellanox Technologies Added: stable/10/contrib/ofed/libibverbs/examples/build/ - copied from r276238, head/contrib/ofed/libibverbs/examples/build/ Deleted: stable/10/contrib/ofed/libibverbs/examples/Makefile Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 08:38:24 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA8E54EE; Fri, 2 Jan 2015 08:38:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95DD664C3E; Fri, 2 Jan 2015 08:38:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t028cOOD076923; Fri, 2 Jan 2015 08:38:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t028cOYQ076922; Fri, 2 Jan 2015 08:38:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501020838.t028cOYQ076922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Jan 2015 08:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276529 - in stable/9/contrib/ofed/libibverbs/examples: . build X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 08:38:24 -0000 Author: hselasky Date: Fri Jan 2 08:38:23 2015 New Revision: 276529 URL: https://svnweb.freebsd.org/changeset/base/276529 Log: MFC r276238: Add proper Makefiles to build some infiniband example utilities. Sponsored by: Mellanox Technologies Added: stable/9/contrib/ofed/libibverbs/examples/build/ - copied from r276238, head/contrib/ofed/libibverbs/examples/build/ Deleted: stable/9/contrib/ofed/libibverbs/examples/Makefile Modified: Directory Properties: stable/9/contrib/ (props changed) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 17:45:55 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 108ABA67; Fri, 2 Jan 2015 17:45:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF1DC664D6; Fri, 2 Jan 2015 17:45:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02Hjsm1034453; Fri, 2 Jan 2015 17:45:54 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02Hjrv6034434; Fri, 2 Jan 2015 17:45:53 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201501021745.t02Hjrv6034434@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 2 Jan 2015 17:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276546 - in stable/10/sys: amd64/amd64 arm/arm i386/i386 i386/include vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 17:45:55 -0000 Author: alc Date: Fri Jan 2 17:45:52 2015 New Revision: 276546 URL: https://svnweb.freebsd.org/changeset/base/276546 Log: MFC r273701, r274556 By the time that pmap_init() runs, vm_phys_segs[] has been initialized. Obtaining the end of memory address from vm_phys_segs[] is a little easier than obtaining it from phys_avail[]. Enable the use of VM_PHYSSEG_SPARSE on amd64 and i386, making it the default on i386 PAE. (The use of VM_PHYSSEG_SPARSE on i386 PAE saves us some precious kernel virtual address space that would have been wasted on unused vm_page structures.) Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/arm/arm/pmap-v6.c stable/10/sys/i386/i386/pmap.c stable/10/sys/i386/include/vmparam.h stable/10/sys/vm/vm_page.c stable/10/sys/vm/vm_phys.c stable/10/sys/vm/vm_phys.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Fri Jan 2 17:36:07 2015 (r276545) +++ stable/10/sys/amd64/amd64/pmap.c Fri Jan 2 17:45:52 2015 (r276546) @@ -130,6 +130,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -836,6 +837,15 @@ pmap_bootstrap(vm_paddr_t *firstaddr) */ create_pagetables(firstaddr); + /* + * Add a physical memory segment (vm_phys_seg) corresponding to the + * preallocated kernel page table pages so that vm_page structures + * representing these pages will be created. The vm_page structures + * are required for promotion of the corresponding kernel virtual + * addresses to superpage mappings. + */ + vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); + virtual_avail = (vm_offset_t) KERNBASE + *firstaddr; virtual_avail = pmap_kmem_choose(virtual_avail); @@ -1060,8 +1070,7 @@ pmap_init(void) /* * Calculate the size of the pv head table for superpages. */ - for (i = 0; phys_avail[i + 1]; i += 2); - pv_npg = round_2mpage(phys_avail[(i - 2) + 1]) / NBPDR; + pv_npg = howmany(vm_phys_segs[vm_phys_nsegs - 1].end, NBPDR); /* * Allocate memory for the pv head table for superpages. Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Fri Jan 2 17:36:07 2015 (r276545) +++ stable/10/sys/arm/arm/pmap-v6.c Fri Jan 2 17:45:52 2015 (r276546) @@ -172,6 +172,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1342,9 +1343,10 @@ pmap_init(void) /* * Calculate the size of the pv head table for superpages. + * Handle the possibility that "vm_phys_segs[...].end" is zero. */ - for (i = 0; phys_avail[i + 1]; i += 2); - pv_npg = round_1mpage(phys_avail[(i - 2) + 1]) / NBPDR; + pv_npg = trunc_1mpage(vm_phys_segs[vm_phys_nsegs - 1].end - + PAGE_SIZE) / NBPDR + 1; /* * Allocate memory for the pv head table for superpages. Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Fri Jan 2 17:36:07 2015 (r276545) +++ stable/10/sys/i386/i386/pmap.c Fri Jan 2 17:45:52 2015 (r276546) @@ -133,6 +133,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -374,6 +375,15 @@ pmap_bootstrap(vm_paddr_t firstaddr) int i; /* + * Add a physical memory segment (vm_phys_seg) corresponding to the + * preallocated kernel page table pages so that vm_page structures + * representing these pages will be created. The vm_page structures + * are required for promotion of the corresponding kernel virtual + * addresses to superpage mappings. + */ + vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); + + /* * Initialize the first available kernel virtual address. However, * using "firstaddr" may waste a few pages of the kernel virtual * address space, because locore may not have mapped every physical @@ -778,9 +788,10 @@ pmap_init(void) /* * Calculate the size of the pv head table for superpages. + * Handle the possibility that "vm_phys_segs[...].end" is zero. */ - for (i = 0; phys_avail[i + 1]; i += 2); - pv_npg = round_4mpage(phys_avail[(i - 2) + 1]) / NBPDR; + pv_npg = trunc_4mpage(vm_phys_segs[vm_phys_nsegs - 1].end - + PAGE_SIZE) / NBPDR + 1; /* * Allocate memory for the pv head table for superpages. Modified: stable/10/sys/i386/include/vmparam.h ============================================================================== --- stable/10/sys/i386/include/vmparam.h Fri Jan 2 17:36:07 2015 (r276545) +++ stable/10/sys/i386/include/vmparam.h Fri Jan 2 17:45:52 2015 (r276546) @@ -64,9 +64,15 @@ #endif /* - * The physical address space is densely populated. + * Choose between DENSE and SPARSE based on whether lower execution time or + * lower kernel address space consumption is desired. Under PAE, kernel + * address space is often in short supply. */ +#ifdef PAE +#define VM_PHYSSEG_SPARSE +#else #define VM_PHYSSEG_DENSE +#endif /* * The number of PHYSSEG entries must be one greater than the number Modified: stable/10/sys/vm/vm_page.c ============================================================================== --- stable/10/sys/vm/vm_page.c Fri Jan 2 17:36:07 2015 (r276545) +++ stable/10/sys/vm/vm_page.c Fri Jan 2 17:45:52 2015 (r276546) @@ -307,9 +307,23 @@ vm_page_startup(vm_offset_t vaddr) phys_avail[i + 1] = trunc_page(phys_avail[i + 1]); } +#ifdef XEN + /* + * There is no obvious reason why i386 PV Xen needs vm_page structs + * created for these pseudo-physical addresses. XXX + */ + vm_phys_add_seg(0, phys_avail[0]); +#endif + low_water = phys_avail[0]; high_water = phys_avail[1]; + for (i = 0; i < vm_phys_nsegs; i++) { + if (vm_phys_segs[i].start < low_water) + low_water = vm_phys_segs[i].start; + if (vm_phys_segs[i].end > high_water) + high_water = vm_phys_segs[i].end; + } for (i = 0; phys_avail[i + 1]; i += 2) { vm_paddr_t size = phys_avail[i + 1] - phys_avail[i]; @@ -323,10 +337,6 @@ vm_page_startup(vm_offset_t vaddr) high_water = phys_avail[i + 1]; } -#ifdef XEN - low_water = 0; -#endif - end = phys_avail[biggestone+1]; /* @@ -394,6 +404,10 @@ vm_page_startup(vm_offset_t vaddr) first_page = low_water / PAGE_SIZE; #ifdef VM_PHYSSEG_SPARSE page_range = 0; + for (i = 0; i < vm_phys_nsegs; i++) { + page_range += atop(vm_phys_segs[i].end - + vm_phys_segs[i].start); + } for (i = 0; phys_avail[i + 1] != 0; i += 2) page_range += atop(phys_avail[i + 1] - phys_avail[i]); #elif defined(VM_PHYSSEG_DENSE) @@ -436,6 +450,13 @@ vm_page_startup(vm_offset_t vaddr) phys_avail[biggestone + 1] = new_end; /* + * Add physical memory segments corresponding to the available + * physical pages. + */ + for (i = 0; phys_avail[i + 1] != 0; i += 2) + vm_phys_add_seg(phys_avail[i], phys_avail[i + 1]); + + /* * Clear all of the page structures */ bzero((caddr_t) vm_page_array, page_range * sizeof(struct vm_page)); Modified: stable/10/sys/vm/vm_phys.c ============================================================================== --- stable/10/sys/vm/vm_phys.c Fri Jan 2 17:36:07 2015 (r276545) +++ stable/10/sys/vm/vm_phys.c Fri Jan 2 17:45:52 2015 (r276546) @@ -246,29 +246,19 @@ static void _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int flind, int domain) { struct vm_phys_seg *seg; -#ifdef VM_PHYSSEG_SPARSE - long pages; - int segind; - pages = 0; - for (segind = 0; segind < vm_phys_nsegs; segind++) { - seg = &vm_phys_segs[segind]; - pages += atop(seg->end - seg->start); - } -#endif KASSERT(vm_phys_nsegs < VM_PHYSSEG_MAX, ("vm_phys_create_seg: increase VM_PHYSSEG_MAX")); KASSERT(domain < vm_ndomains, ("vm_phys_create_seg: invalid domain provided")); seg = &vm_phys_segs[vm_phys_nsegs++]; + while (seg > vm_phys_segs && (seg - 1)->start >= end) { + *seg = *(seg - 1); + seg--; + } seg->start = start; seg->end = end; seg->domain = domain; -#ifdef VM_PHYSSEG_SPARSE - seg->first_page = &vm_page_array[pages]; -#else - seg->first_page = PHYS_TO_VM_PAGE(start); -#endif seg->free_queues = &vm_phys_free_queues[domain][flind]; } @@ -302,47 +292,68 @@ vm_phys_create_seg(vm_paddr_t start, vm_ } /* - * Initialize the physical memory allocator. + * Add a physical memory segment. */ void -vm_phys_init(void) +vm_phys_add_seg(vm_paddr_t start, vm_paddr_t end) { - struct vm_freelist *fl; - int dom, flind, i, oind, pind; - for (i = 0; phys_avail[i + 1] != 0; i += 2) { + KASSERT((start & PAGE_MASK) == 0, + ("vm_phys_define_seg: start is not page aligned")); + KASSERT((end & PAGE_MASK) == 0, + ("vm_phys_define_seg: end is not page aligned")); #ifdef VM_FREELIST_ISADMA - if (phys_avail[i] < 16777216) { - if (phys_avail[i + 1] > 16777216) { - vm_phys_create_seg(phys_avail[i], 16777216, - VM_FREELIST_ISADMA); - vm_phys_create_seg(16777216, phys_avail[i + 1], - VM_FREELIST_DEFAULT); - } else { - vm_phys_create_seg(phys_avail[i], - phys_avail[i + 1], VM_FREELIST_ISADMA); - } - if (VM_FREELIST_ISADMA >= vm_nfreelists) - vm_nfreelists = VM_FREELIST_ISADMA + 1; + if (start < 16777216) { + if (end > 16777216) { + vm_phys_create_seg(start, 16777216, + VM_FREELIST_ISADMA); + vm_phys_create_seg(16777216, end, VM_FREELIST_DEFAULT); } else + vm_phys_create_seg(start, end, VM_FREELIST_ISADMA); + if (VM_FREELIST_ISADMA >= vm_nfreelists) + vm_nfreelists = VM_FREELIST_ISADMA + 1; + } else #endif #ifdef VM_FREELIST_HIGHMEM - if (phys_avail[i + 1] > VM_HIGHMEM_ADDRESS) { - if (phys_avail[i] < VM_HIGHMEM_ADDRESS) { - vm_phys_create_seg(phys_avail[i], - VM_HIGHMEM_ADDRESS, VM_FREELIST_DEFAULT); - vm_phys_create_seg(VM_HIGHMEM_ADDRESS, - phys_avail[i + 1], VM_FREELIST_HIGHMEM); - } else { - vm_phys_create_seg(phys_avail[i], - phys_avail[i + 1], VM_FREELIST_HIGHMEM); - } - if (VM_FREELIST_HIGHMEM >= vm_nfreelists) - vm_nfreelists = VM_FREELIST_HIGHMEM + 1; + if (end > VM_HIGHMEM_ADDRESS) { + if (start < VM_HIGHMEM_ADDRESS) { + vm_phys_create_seg(start, VM_HIGHMEM_ADDRESS, + VM_FREELIST_DEFAULT); + vm_phys_create_seg(VM_HIGHMEM_ADDRESS, end, + VM_FREELIST_HIGHMEM); } else + vm_phys_create_seg(start, end, VM_FREELIST_HIGHMEM); + if (VM_FREELIST_HIGHMEM >= vm_nfreelists) + vm_nfreelists = VM_FREELIST_HIGHMEM + 1; + } else +#endif + vm_phys_create_seg(start, end, VM_FREELIST_DEFAULT); +} + +/* + * Initialize the physical memory allocator. + */ +void +vm_phys_init(void) +{ + struct vm_freelist *fl; + struct vm_phys_seg *seg; +#ifdef VM_PHYSSEG_SPARSE + long pages; +#endif + int dom, flind, oind, pind, segind; + +#ifdef VM_PHYSSEG_SPARSE + pages = 0; +#endif + for (segind = 0; segind < vm_phys_nsegs; segind++) { + seg = &vm_phys_segs[segind]; +#ifdef VM_PHYSSEG_SPARSE + seg->first_page = &vm_page_array[pages]; + pages += atop(seg->end - seg->start); +#else + seg->first_page = PHYS_TO_VM_PAGE(seg->start); #endif - vm_phys_create_seg(phys_avail[i], phys_avail[i + 1], - VM_FREELIST_DEFAULT); } for (dom = 0; dom < vm_ndomains; dom++) { for (flind = 0; flind < vm_nfreelists; flind++) { Modified: stable/10/sys/vm/vm_phys.h ============================================================================== --- stable/10/sys/vm/vm_phys.h Fri Jan 2 17:36:07 2015 (r276545) +++ stable/10/sys/vm/vm_phys.h Fri Jan 2 17:45:52 2015 (r276546) @@ -69,6 +69,7 @@ extern int vm_phys_nsegs; * The following functions are only to be used by the virtual memory system. */ void vm_phys_add_page(vm_paddr_t pa); +void vm_phys_add_seg(vm_paddr_t start, vm_paddr_t end); vm_page_t vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary); vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order); From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 18:27:33 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E235F626; Fri, 2 Jan 2015 18:27:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE5F61A73; Fri, 2 Jan 2015 18:27:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02IRXDd056566; Fri, 2 Jan 2015 18:27:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02IRX4U056565; Fri, 2 Jan 2015 18:27:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201501021827.t02IRX4U056565@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 2 Jan 2015 18:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276547 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:27:34 -0000 Author: bapt Date: Fri Jan 2 18:27:32 2015 New Revision: 276547 URL: https://svnweb.freebsd.org/changeset/base/276547 Log: MFC: r276052,r276053 Build selective portions of gnu/usr.bin/texinfo as part of build-tools to ensure that building on a host without makeinfo (i.e. a host where make delete-old -DWITHOUT_INFO was run), then building with MK_INFO == yes doesn't manifest in build errors when building info pages This manifested itself like the following when I was build testing an MFC change on stable/10: makeinfo --no-split -I /usr/src/gnu/lib/libregex/doc -I /usr/src/gnu/lib/libregex/doc regex.texi -o regex.info makeinfo: not found *** [regex.info] Error code 127 make[6]: stopped in /usr/src/gnu/lib/libregex/doc 1 error Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Fri Jan 2 17:45:52 2015 (r276546) +++ stable/10/Makefile.inc1 Fri Jan 2 18:27:32 2015 (r276547) @@ -1358,6 +1358,11 @@ _share= share/syscons/scrnmaps _gcc_tools= gnu/usr.bin/cc/cc_tools .endif +.if ${MK_INFO} != "no" +_texinfo= gnu/usr.bin/texinfo/libtxi \ + gnu/usr.bin/texinfo/makeinfo +.endif + .if ${MK_RESCUE} != "no" _rescue= rescue/rescue .endif @@ -1389,6 +1394,16 @@ build-tools: .MAKE ${MAKE} DIRPRFX=${_tool}/ depend && \ ${MAKE} DIRPRFX=${_tool}/ all .endfor +.for _tool in \ + ${_texinfo} + ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ + cd ${.CURDIR}/${_tool} && \ + ${MAKE} DIRPRFX=${_tool}/ obj && \ + ${MAKE} DIRPRFX=${_tool}/ depend && \ + ${MAKE} DIRPRFX=${_tool}/ all && \ + ${MAKE} DIRPRFX=${_tool}/ install DESTDIR=${WORLDTMP} +.endfor + # # kernel-tools: Build kernel-building tools From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 18:31:13 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC21978A; Fri, 2 Jan 2015 18:31:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C79401B48; Fri, 2 Jan 2015 18:31:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02IVDCx058269; Fri, 2 Jan 2015 18:31:13 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02IVD1x058242; Fri, 2 Jan 2015 18:31:13 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501021831.t02IVD1x058242@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 2 Jan 2015 18:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276548 - stable/10/lib/libc/regex X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:31:14 -0000 Author: delphij Date: Fri Jan 2 18:31:12 2015 New Revision: 276548 URL: https://svnweb.freebsd.org/changeset/base/276548 Log: MFC r275930: Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece) Modified: stable/10/lib/libc/regex/regcomp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/regcomp.c ============================================================================== --- stable/10/lib/libc/regex/regcomp.c Fri Jan 2 18:27:32 2015 (r276547) +++ stable/10/lib/libc/regex/regcomp.c Fri Jan 2 18:31:12 2015 (r276548) @@ -1716,8 +1716,10 @@ computematchjumps(struct parse *p, struc } g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int)); - if (g->matchjump == NULL) /* Not a fatal error */ + if (g->matchjump == NULL) { /* Not a fatal error */ + free(pmatches); return; + } /* Set maximum possible jump for each character in the pattern */ for (mindex = 0; mindex < g->mlen; mindex++) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 18:32:55 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00FD88D1; Fri, 2 Jan 2015 18:32:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0FB41BB1; Fri, 2 Jan 2015 18:32:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02IWsjH061193; Fri, 2 Jan 2015 18:32:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02IWsnk061192; Fri, 2 Jan 2015 18:32:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201501021832.t02IWsnk061192@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 2 Jan 2015 18:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276549 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:32:55 -0000 Author: bapt Date: Fri Jan 2 18:32:53 2015 New Revision: 276549 URL: https://svnweb.freebsd.org/changeset/base/276549 Log: MFC: r276052,r276053 Build selective portions of gnu/usr.bin/texinfo as part of build-tools to ensure that building on a host without makeinfo (i.e. a host where make delete-old -DWITHOUT_INFO was run), then building with MK_INFO == yes doesn't manifest in build errors when building info pages This manifested itself like the following when I was build testing an MFC change on stable/10: makeinfo --no-split -I /usr/src/gnu/lib/libregex/doc -I /usr/src/gnu/lib/libregex/doc regex.texi -o regex.info makeinfo: not found *** [regex.info] Error code 127 make[6]: stopped in /usr/src/gnu/lib/libregex/doc 1 error Modified: stable/9/Makefile.inc1 (contents, props changed) Directory Properties: stable/9/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Fri Jan 2 18:31:12 2015 (r276548) +++ stable/9/Makefile.inc1 Fri Jan 2 18:32:53 2015 (r276549) @@ -1221,6 +1221,11 @@ _gcc_tools= gnu/usr.bin/cc/cc_tools _kerberos5_tools= kerberos5/tools .endif +.if ${MK_INFO} != "no" +_texinfo= gnu/usr.bin/texinfo/libtxi \ + gnu/usr.bin/texinfo/makeinfo +.endif + .if ${MK_RESCUE} != "no" _rescue= rescue/rescue .endif @@ -1253,6 +1258,16 @@ build-tools: ${MAKE} DIRPRFX=${_tool}/ depend; \ ${MAKE} DIRPRFX=${_tool}/ all .endfor +.for _tool in \ + ${_texinfo} + ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ + cd ${.CURDIR}/${_tool} && \ + ${MAKE} DIRPRFX=${_tool}/ obj && \ + ${MAKE} DIRPRFX=${_tool}/ depend && \ + ${MAKE} DIRPRFX=${_tool}/ all && \ + ${MAKE} DIRPRFX=${_tool}/ install DESTDIR=${WORLDTMP} +.endfor + # # cross-tools: Build cross-building tools From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 18:50:20 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24A9B4ED; Fri, 2 Jan 2015 18:50:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 106241E39; Fri, 2 Jan 2015 18:50:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02IoJed073061; Fri, 2 Jan 2015 18:50:19 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02IoJj9073060; Fri, 2 Jan 2015 18:50:19 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201501021850.t02IoJj9073060@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 2 Jan 2015 18:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276553 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:50:20 -0000 Author: alc Date: Fri Jan 2 18:50:18 2015 New Revision: 276553 URL: https://svnweb.freebsd.org/changeset/base/276553 Log: MFC r270961 Update a comment to reflect the changes in r213408. Modified: stable/10/sys/amd64/amd64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Fri Jan 2 18:45:48 2015 (r276552) +++ stable/10/sys/amd64/amd64/pmap.c Fri Jan 2 18:50:18 2015 (r276553) @@ -2603,7 +2603,7 @@ pmap_growkernel(vm_offset_t addr) * "kernel_vm_end" and the kernel page table as they were. * * The correctness of this action is based on the following - * argument: vm_map_findspace() allocates contiguous ranges of the + * argument: vm_map_insert() allocates contiguous ranges of the * kernel virtual address space. It calls this function if a range * ends after "kernel_vm_end". If the kernel is mapped between * "kernel_vm_end" and "addr", then the range cannot begin at From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 18:51:48 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7597B62C; Fri, 2 Jan 2015 18:51:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 613901F28; Fri, 2 Jan 2015 18:51:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02Ipmel074936; Fri, 2 Jan 2015 18:51:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02Ipmlg074935; Fri, 2 Jan 2015 18:51:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501021851.t02Ipmlg074935@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 2 Jan 2015 18:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276554 - stable/9/lib/libc/regex X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:51:48 -0000 Author: delphij Date: Fri Jan 2 18:51:47 2015 New Revision: 276554 URL: https://svnweb.freebsd.org/changeset/base/276554 Log: MFC r275930: Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece) Modified: stable/9/lib/libc/regex/regcomp.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/regex/regcomp.c ============================================================================== --- stable/9/lib/libc/regex/regcomp.c Fri Jan 2 18:50:18 2015 (r276553) +++ stable/9/lib/libc/regex/regcomp.c Fri Jan 2 18:51:47 2015 (r276554) @@ -1699,8 +1699,10 @@ computematchjumps(struct parse *p, struc } g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int)); - if (g->matchjump == NULL) /* Not a fatal error */ + if (g->matchjump == NULL) { /* Not a fatal error */ + free(pmatches); return; + } /* Set maximum possible jump for each character in the pattern */ for (mindex = 0; mindex < g->mlen; mindex++) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 18:52:20 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F80A75F; Fri, 2 Jan 2015 18:52:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF4DD1F3F; Fri, 2 Jan 2015 18:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02IqJgK075119; Fri, 2 Jan 2015 18:52:19 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02IqJDY075118; Fri, 2 Jan 2015 18:52:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501021852.t02IqJDY075118@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 2 Jan 2015 18:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r276555 - stable/8/lib/libc/regex X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:52:20 -0000 Author: delphij Date: Fri Jan 2 18:52:18 2015 New Revision: 276555 URL: https://svnweb.freebsd.org/changeset/base/276555 Log: MFC r275930: Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece) Modified: stable/8/lib/libc/regex/regcomp.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/regex/regcomp.c ============================================================================== --- stable/8/lib/libc/regex/regcomp.c Fri Jan 2 18:51:47 2015 (r276554) +++ stable/8/lib/libc/regex/regcomp.c Fri Jan 2 18:52:18 2015 (r276555) @@ -1693,8 +1693,10 @@ computematchjumps(struct parse *p, struc } g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int)); - if (g->matchjump == NULL) /* Not a fatal error */ + if (g->matchjump == NULL) { /* Not a fatal error */ + free(pmatches); return; + } /* Set maximum possible jump for each character in the pattern */ for (mindex = 0; mindex < g->mlen; mindex++) From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 18:57:27 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99946A0C; Fri, 2 Jan 2015 18:57:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8573A1FB8; Fri, 2 Jan 2015 18:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02IvRIQ076240; Fri, 2 Jan 2015 18:57:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02IvReA076239; Fri, 2 Jan 2015 18:57:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501021857.t02IvReA076239@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 2 Jan 2015 18:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276557 - stable/10/rescue/rescue X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:57:27 -0000 Author: delphij Date: Fri Jan 2 18:57:26 2015 New Revision: 276557 URL: https://svnweb.freebsd.org/changeset/base/276557 Log: MFC r275435: Add sleep(1) to /rescue. Modified: stable/10/rescue/rescue/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/rescue/rescue/Makefile ============================================================================== --- stable/10/rescue/rescue/Makefile Fri Jan 2 18:54:55 2015 (r276556) +++ stable/10/rescue/rescue/Makefile Fri Jan 2 18:57:26 2015 (r276557) @@ -51,7 +51,8 @@ CRUNCH_LIBS+= ${.OBJDIR}/../librescue/*. CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ - pkill ps pwd realpath rm rmdir setfacl sh stty sync test + pkill ps pwd realpath rm rmdir setfacl sh sleep stty \ + sync test CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcap -lutil CRUNCH_BUILDTOOLS+= bin/sh From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 18:57:52 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71F0DB37; Fri, 2 Jan 2015 18:57:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DCEA1FC2; Fri, 2 Jan 2015 18:57:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02Ivqgk076371; Fri, 2 Jan 2015 18:57:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02IvqOe076370; Fri, 2 Jan 2015 18:57:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501021857.t02IvqOe076370@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 2 Jan 2015 18:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276558 - stable/9/rescue/rescue X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:57:52 -0000 Author: delphij Date: Fri Jan 2 18:57:51 2015 New Revision: 276558 URL: https://svnweb.freebsd.org/changeset/base/276558 Log: MFC r275435: Add sleep(1) to /rescue. Modified: stable/9/rescue/rescue/Makefile Directory Properties: stable/9/rescue/rescue/ (props changed) Modified: stable/9/rescue/rescue/Makefile ============================================================================== --- stable/9/rescue/rescue/Makefile Fri Jan 2 18:57:26 2015 (r276557) +++ stable/9/rescue/rescue/Makefile Fri Jan 2 18:57:51 2015 (r276558) @@ -51,7 +51,8 @@ CRUNCH_LIBS+= ${.OBJDIR}/../librescue/*. CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ - pkill ps pwd realpath rm rmdir setfacl sh stty sync test + pkill ps pwd realpath rm rmdir setfacl sh sleep stty \ + sync test CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcap -lutil CRUNCH_BUILDTOOLS+= bin/sh From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 19:01:02 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12C40E17; Fri, 2 Jan 2015 19:01:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F30B5640A5; Fri, 2 Jan 2015 19:01:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02J11KJ079599; Fri, 2 Jan 2015 19:01:01 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02J119M079598; Fri, 2 Jan 2015 19:01:01 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201501021901.t02J119M079598@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 2 Jan 2015 19:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276560 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 19:01:02 -0000 Author: alc Date: Fri Jan 2 19:01:00 2015 New Revision: 276560 URL: https://svnweb.freebsd.org/changeset/base/276560 Log: MFC r270961 Update a comment to reflect the changes in r213408. Modified: stable/9/sys/amd64/amd64/pmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/pmap.c ============================================================================== --- stable/9/sys/amd64/amd64/pmap.c Fri Jan 2 18:57:58 2015 (r276559) +++ stable/9/sys/amd64/amd64/pmap.c Fri Jan 2 19:01:00 2015 (r276560) @@ -1999,7 +1999,7 @@ pmap_growkernel(vm_offset_t addr) * "kernel_vm_end" and the kernel page table as they were. * * The correctness of this action is based on the following - * argument: vm_map_findspace() allocates contiguous ranges of the + * argument: vm_map_insert() allocates contiguous ranges of the * kernel virtual address space. It calls this function if a range * ends after "kernel_vm_end". If the kernel is mapped between * "kernel_vm_end" and "addr", then the range cannot begin at From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 21:16:14 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A019BCCE; Fri, 2 Jan 2015 21:16:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7206C16F7; Fri, 2 Jan 2015 21:16:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02LGEMx053325; Fri, 2 Jan 2015 21:16:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02LGEfM053324; Fri, 2 Jan 2015 21:16:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201501022116.t02LGEfM053324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 2 Jan 2015 21:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276576 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 21:16:14 -0000 Author: bapt Date: Fri Jan 2 21:16:13 2015 New Revision: 276576 URL: https://svnweb.freebsd.org/changeset/base/276576 Log: Make texinfo a bootstrap tools this fixes cross building when makeinfo is not \ available on the host Differential Revision: https://reviews.freebsd.org/D1410 Submitted by: ngie (initial patch) Reviewed by: ngie, imp MFC after: 1 week Modified: stable/10/Makefile.inc1 Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Fri Jan 2 21:13:32 2015 (r276575) +++ stable/10/Makefile.inc1 Fri Jan 2 21:16:13 2015 (r276576) @@ -233,6 +233,7 @@ CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/le GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac .endif +_BOOTSTRAP_MAKEINFO?= ${MK_INFO} # bootstrap-tools stage BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${BPATH}:${PATH} \ @@ -247,6 +248,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ SSP_CFLAGS= \ -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ -DNO_PIC -DNO_PROFILE -DNO_SHARED \ + _BOOTSTRAP_MAKEINFO=${_BOOTSTRAP_MAKEINFO} \ -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS # build-tools stage @@ -1309,6 +1311,10 @@ _kerberos5_bootstrap_tools= \ usr.bin/compile_et .endif +.if ${_BOOTSTRAP_MAKEINFO} != "no" +_texinfo= gnu/usr.bin/texinfo/libtxi \ + gnu/usr.bin/texinfo/makeinfo +.endif # Please document (add comment) why something is in 'bootstrap-tools'. # Try to bound the building of the bootstrap-tool to just the # FreeBSD versions that need the tool built at this stage of the build. @@ -1338,6 +1344,7 @@ bootstrap-tools: .MAKE usr.sbin/config \ ${_crunch} \ ${_nmtree} \ + ${_texinfo} \ ${_vtfontcvt} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool} && \ @@ -1358,11 +1365,6 @@ _share= share/syscons/scrnmaps _gcc_tools= gnu/usr.bin/cc/cc_tools .endif -.if ${MK_INFO} != "no" -_texinfo= gnu/usr.bin/texinfo/libtxi \ - gnu/usr.bin/texinfo/makeinfo -.endif - .if ${MK_RESCUE} != "no" _rescue= rescue/rescue .endif @@ -1394,15 +1396,6 @@ build-tools: .MAKE ${MAKE} DIRPRFX=${_tool}/ depend && \ ${MAKE} DIRPRFX=${_tool}/ all .endfor -.for _tool in \ - ${_texinfo} - ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ - ${MAKE} DIRPRFX=${_tool}/ depend && \ - ${MAKE} DIRPRFX=${_tool}/ all && \ - ${MAKE} DIRPRFX=${_tool}/ install DESTDIR=${WORLDTMP} -.endfor # From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 21:40:56 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22CB1C1D; Fri, 2 Jan 2015 21:40:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E858B1BA8; Fri, 2 Jan 2015 21:40:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02LetDh065885; Fri, 2 Jan 2015 21:40:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02Letj9065884; Fri, 2 Jan 2015 21:40:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501022140.t02Letj9065884@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 2 Jan 2015 21:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276578 - stable/10/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 21:40:56 -0000 Author: gjb Date: Fri Jan 2 21:40:55 2015 New Revision: 276578 URL: https://svnweb.freebsd.org/changeset/base/276578 Log: Document the following security advisorires: - FreeBSD-SA-14:27.stdio - FreeBSD-SA-14:28.file - FreeBSD-SA-14:30.unbound - FreeBSD-SA-14:31.ntp Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 2 21:20:02 2015 (r276577) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 2 21:40:55 2015 (r276578) @@ -91,9 +91,29 @@ - No advisories. -   -   + SA-14:27.stdio + 10 December 2014 + Buffer overflow in stdio + + + + SA-14:28.file + 10 December 2014 + Multiple vulnerabilities in &man.file.1; and + &man.libmagic.3; + + + + SA-14:30.unbound + 17 December 2014 + Remote denial of service + vulnerability + + + + SA-14:31.ntp + 23 December 2014 + Multiple vulnerabilities From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 21:40:59 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D460D1A; Fri, 2 Jan 2015 21:40:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28C751BAE; Fri, 2 Jan 2015 21:40:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02LexXv065939; Fri, 2 Jan 2015 21:40:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02LexLn065938; Fri, 2 Jan 2015 21:40:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501022140.t02LexLn065938@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 2 Jan 2015 21:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276579 - stable/9/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 21:40:59 -0000 Author: gjb Date: Fri Jan 2 21:40:58 2015 New Revision: 276579 URL: https://svnweb.freebsd.org/changeset/base/276579 Log: Document the following security advisorires: - FreeBSD-SA-14:28.file - FreeBSD-SA-14:30.bind - FreeBSD-SA-14:31.ntp Sponsored by: The FreeBSD Foundation Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 2 21:40:55 2015 (r276578) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 2 21:40:58 2015 (r276579) @@ -151,6 +151,26 @@ 04 November 2014 Remote code execution. + + + SA-14:28.file + 10 December 2014 + Multiple vulnerabilities in &man.file.1; and + &man.libmagic.3; + + + + SA-14:29.bind + 10 December 2014 + Remote denial of service + vulnerability + + + + SA-14:31.ntp + 23 December 2014 + Multiple vulnerabilities + From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 21:42:40 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C4D9FC8; Fri, 2 Jan 2015 21:42:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 062501D80; Fri, 2 Jan 2015 21:41:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02LfeGT068190; Fri, 2 Jan 2015 21:41:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02Lfe2M068189; Fri, 2 Jan 2015 21:41:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501022141.t02Lfe2M068189@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 2 Jan 2015 21:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276580 - stable/10/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 21:42:40 -0000 Author: gjb Date: Fri Jan 2 21:41:39 2015 New Revision: 276580 URL: https://svnweb.freebsd.org/changeset/base/276580 Log: Bump copyright year. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 2 21:40:58 2015 (r276579) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 2 21:41:39 2015 (r276580) @@ -17,7 +17,7 @@ $FreeBSD$ - 2014 + 2015 The &os; Documentation Project From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 21:42:40 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F3A9FCC; Fri, 2 Jan 2015 21:42:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46F306604C; Fri, 2 Jan 2015 21:41:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02LfrY2068778; Fri, 2 Jan 2015 21:41:53 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02LfrJc068777; Fri, 2 Jan 2015 21:41:53 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501022141.t02LfrJc068777@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 2 Jan 2015 21:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276581 - stable/9/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 21:42:40 -0000 Author: gjb Date: Fri Jan 2 21:41:52 2015 New Revision: 276581 URL: https://svnweb.freebsd.org/changeset/base/276581 Log: Bump copyright year. Sponsored by: The FreeBSD Foundation Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 2 21:41:39 2015 (r276580) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 2 21:41:52 2015 (r276581) @@ -26,7 +26,7 @@ $FreeBSD$ - 2014 + 2015 The &os; Documentation Project From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 22:25:28 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6B3872D; Fri, 2 Jan 2015 22:25:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A067121A2; Fri, 2 Jan 2015 22:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02MPSac092075; Fri, 2 Jan 2015 22:25:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02MPSfV092073; Fri, 2 Jan 2015 22:25:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501022225.t02MPSfV092073@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 2 Jan 2015 22:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276585 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 22:25:28 -0000 Author: gjb Date: Fri Jan 2 22:25:27 2015 New Revision: 276585 URL: https://svnweb.freebsd.org/changeset/base/276585 Log: Prune stable/10 release notes page after 10.1-RELEASE. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 2 21:52:01 2015 (r276584) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 2 22:25:27 2015 (r276585) @@ -130,342 +130,24 @@ Kernel Changes - A new &man.sysctl.8;, - kern.panic_reboot_wait_time, has been - added, which allows controlling how long the system will wait - after &man.panic.9; before rebooting. - - The &man.vt.4; driver has been merged - from &os;-CURRENT. To enable &man.vt.4;, enter - set kern.vty=vt at the &man.loader.8; - prompt during boot, or add kern.vty=vt to - &man.loader.conf.5; and reboot the system. - - Support for &man.hwpmc.4; has been added - for &powerpc; 970 class processors. - - Support for ADT7460 and ADT7467 fan - controllers found in newer PowerBooks™ and - iBooks™ has been added to the &man.iicbus.4; - driver. - - A panic triggered by removing - a &man.urtwn.4; device has been fixed. - - A potential deadlock in the &man.usb.4; - stack triggered by detaching USB devices that create character - devices has been fixed. - - Support for &amd; Family 16h sensor - devices has been added to &man.amdtemp.4;. - - The &man.uslcom.4; driver has been - updated to support 26 new devices. - - A kernel bug that inhibited proper - functionality of the dev.cpu.0.freq - &man.sysctl.8; on &intel; processors with Turbo - Boost™ enabled has been fixed. - - The &man.uart.4; driver has been - updated to include support for the &intel; Lynx Point - KT AMT serial port. - - The radeonkms(4) - driver has been updated to include 32-bit &man.ioctl.2; - support, allowing 32-bit applications to run on a 64-bit - system. - - A bug that would prevent - a &man.jail.8; from setting the correct IPv4 source address - with some operations that required - security.jail.allow_raw_sockets has been - fixed. - - The &man.hwpmc.4; driver has been - updated to support core events from the Atom™ - Silvermont architecture. - - The &man.oce.4; driver has been updated - with vendor-supplied fixes for big endian support, and 20GB/s - and 25GB/s link speeds. - - The &os; virtual memory subsystem - has been updated to implement fast path for - the page fault handler. - - The &man.asmc.4; driver has been updated - to support the &apple; Mac Mini 3,1. - - The &os;/&arch.powerpc64; default kernel - configuration, GENERIC64, has been - updated to enable the &man.vt.4; console driver for the - Sony® Playstation 3™ platform. - - The - &os;/&arch.powerpc; ofwfb driver, used to - provide a graphics console when the &man.vt.4; console driver - is used, has been modified to work with the x11-drivers/xf86-video-scfb - port. - - - If using an ATI graphics card with - the &man.vt.4; driver, the x11-servers/xorg-server package - must be updated to version 1.12.4_8 or newer. - - - Several - performance enchancements to the &man.vt.4; driver have been - merged from &os;-CURRENT. - - The default stack size - (KSTACK_PAGES) has been increased from - 4 to 8 for the - &arch.powerpc64; architecture. - - The &os;/&arch.powerpc; ATI driver - has been updated to support enabling and disabling the - Radeon 9700 backlight, found in the - &apple; PowerBook™ G4. - - Hardware context support has been - added to the drm/i915 driver, adding - support for Mesa 9.2 and - later. +   Virtualization Support - Support for µsoft; Hyper-V - has been added to &os;/i386 as loadable modules, however - not available in the GENERIC kernel - configuration. - - The &man.bhyve.4; hypervisor now - supports soft power-off functionality via the ACPI S5 - state. - - Support for &os;/i386 guests has been - added to &man.bhyve.4;. - - Support for virtualized - XSAVE has been added to &man.bhyve.4;, - allowing guest operating systems to use - XSAVE and - XSAVE-enabled features, such as - AVX. - - The &man.bhyve.4; hypervisor now - supports booting from a &man.zfs.8; filesystem. - - A new driver, &man.virtio_random.4;, - has been added, which allows &os; virtual machines to - harvest entropy from the hypervisor. - - The &man.bhyve.4; hypervisor has been - synced with the version in &os;-CURRENT. - - A number of enhancements have been added, and several - bug fixes, including: - - - - Post-mortem debugging has been added when - a guest virtual machine exits with an - EPT Misconfiguration - error. - - - - The hypervisor &man.virtio.4; API - has been expanded from 32- to 64-bit. - - - - Support for identifying capabilities of the virtual - CPU has been added. - - - - Support for emulating legacy x86 task - switching has been added. - - - - Support to list the VT-x features in base kernel - &man.dmesg.8; has been added. - - - - Support for extended PCI configuration space - has been added. - - +   ARM Support - The WANDBOARD - kernel configuration file has been added. - - Boot devices may now be specified by - setting a u-boot environment variable. If a boot device is - not specified, the probe mechanism will be used. To specify - the boot device, set the - loaderdev=device - u-boot environment variable. - - The nexus(4) driver - has been updated to include Flattened Device - Tree support, replacing the &man.fdtbus.4; driver - in most cases. - - The &man.gpioiic.4; and - &man.gpioled.4; have been merged from &os;-CURRENT. - - Support for hardware floating point was added to the - kernel, and enabled by default in the configuration files - for all platforms that contain the required hardware. - - C++ exception handling now - works with GCC. - - Support for SMP was added to the - kernel, and enabled by default in the configuration files - for all platforms that contain multi-core CPUs. - - Support was added for: - - - - CHROMEBOOK (Samsung Exynos 5250) - - - - COLIBRI (Freescale Vybrid) - - - - COSMIC (Freescale Vybrid) - - - - IMX53-QSB (Freescale i.MX53) - - - - QUARTZ (Freescale Vybrid) - - - - RADXA (Rockchip rk30xx) - - - - WANDBOARD (Freescale i.MX6) - - - - An I2C driver was added for - the RaspberryPi. - - Drivers have been added to support TI - platforms, such as BEAGLEBONE and PANDABOARD: - - - - PRUSS (Programmable Realtime Unit Subsystem) - - - - MBOX (Mailbox hardware) - - - - SDHCI (new faster driver for - MMC/SD - storage) - - - - PPS (Pulse Per Second input on a - GPIO/timer pin) - - - - PWM (Pulse Width Modulation output) - - - - ADC (Analog to Digital converter) - - +   Boot Loader Changes - A kernel selection menu has been added - to &man.loader.8;. If the beastie menu is - enabled, the kernel to boot may be selected from the kernel - selection menu. Additional kernels may be listed in - &man.loader.conf.5; as a comma- or space-separated list. By - default, kernel and - kernel.old are listed. - - The - sys/boot/ sources - have been rearranged, moving &man.libstand.3; to a directory - indicating the library is built as 32-bit. - - The - &man.libstand.3; library has been updated to produce - a 64-bit shared library for the &os;/&arch.amd64; and - &os;/&arch.powerpc64; architectures. - - Initial support for UEFI - boot has been added. - - Three - new files are installed to /boot, supporting - UEFI boot: - - - - boot1.efi: The - UEFI first stage bootstrap - file. - - - - boot1.efifat: - A FAT filesystem image containing - an EFI system partition. - - - - loader.efi: The third stage - bootstrap file. - - - - Serial console and null console - support has been added to the UEFI boot - loader. - - Support has been added to cache - &man.geli.8; passphrases during system boot. When a system - is configured with multiple GEOM_ELI - providers all using the same passphrase, the passphrase that - is cached after the first entry is used for the subsequent - GEOM_ELI provider. If the passphrase in - the cache is incorrect, then a prompt for the passphrase for - the next provider is displayed. +   @@ -477,998 +159,68 @@ Multimedia Support   - Network Interface Support - Support for Ralink RT5370 and - RT5372 chipsets has been added to the &man.run.4; - driver. - - Firmware for the &man.run.4; driver - has been updated to version 0.33. - - Support for the Ralink RT3593 - chipset has been added to the &man.run.4; driver. - - The &man.nve.4; driver is now - deprecated, and the &man.nfe.4; driver should be used - instead. - - Support for the &man.axge.4; driver - has been added. This driver supports the ASIX AX88178A - and AX88179 USB ethernet adapters. The AX88178A supports - USB 2.0, and the AX88179 supports USB 2.0 and 3.0. - - The &man.urndis.4; driver has been - imported from OpenBSD. - - Support for multiple - transmitter/receiver queues has been added to the - &man.vmx.4; driver. - - - The &os; guest operating system must have - MSIX enabled as a prerequisite for - multiple queues. - - - Support for the ASUS USB-N10 Nano - wireless card has been added to the &man.urtwn.4; - driver. - - Transmission checksum offloading has - been disabled for the RTL8168C and RTL8168CP chipsets in - the &man.re.4; driver for TCP and UDP frames. This is - due to a report of UDP datagrams with IP options - generating corrupt frames. - - Preliminary support has been added - to the &man.urtwn.4; driver for the Realtek RTL8188EUS and - RTL8188ETV chipsets. - - A bug in the fast receiver buffer - recycle path has been fixed in the &man.cxgbe.4; - driver. - - The bundled &man.cxgbe.4; firmware for - T4 and T5 cards has been updated to version - 1.11.27.0. - - The &man.em.4; driver has been - updated to version 7.4.2. - - The &man.ixgbe.4; tunables have been - renamed to match their &man.sysctl.8; counterparts: - - - - - - - - Old Name - New Name - - - - - - hw.ixgbe.enable_aim - hw.ix.enable_aim - - - - hw.ixgbe.max_interrupt_rate - hw.ix.max_interrupt_rate - - - - hw.ixgbe.rx_process_limit - hw.ix.rx_process_limit - - - - hw.ixgbe.tx_process_limit - hw.ix.tx_process_limit - - - - hw.ixgbe.enable_msix - hw.ix.enable_msix - - - - hw.ixgbe.num_queues - hw.ix.num_queues - - - - hw.ixgbe.txd - hw.ix.txd - - - - hw.ixgbe.rxd - hw.ix.rxd - - - - hw.ixgbe.unsupported_sfp - hw.ix.unsupported_sfp - - - - - - Be sure to update &man.loader.conf.5; if using the - old tunables before upgrading to - &os; &release.current;. - - The &man.if.nf10bmac.4; driver has - been merged from &os;-CURRENT to support the NetFPGA-10G - Embedded CPU Ethernet Core. - - The &man.cxgbe.4; driver has been - updated to support &man.netmap.4; for the T5 10G/40G - cards. - - The &man.vtnet.4; driver has been - updated to support &man.netmap.4;. - - The &man.urtwn.4; driver has been - updated to support the ASUS USB-AC51 wireless card. - - The &intel; XL710 ethernet - controller driver, ixlv(4), has been - merged from &os;-CURRENT. +   Network Protocols - Support for the UDP-Lite protocol - (RFC 3828) has been added to the IPv4 and IPv6 - stacks. - - A bug in &man.sctp.4; that would allow - two listening sockets bound to the same port has been - fixed. - - Kernel RPC code, which - is a base of NFS server took multiple optimizations, that - significantly improved its performance and - SMP scalability. - - The - iSCSI initiator has been updated to - support redirection handling when an - iSCSI device is configured with multiple - IP addresses across different network - interfaces. Previously, clients connecting to - such iSCSI devices could require - additional client-side configuration. - - A new - &man.sysctl.8;, - kern.iscsi.fail_on_disconnection, has - been added, which allows iSCSI clients to - remove the attached disk device when the connection to the - target is dropped, where previously I/O would stop until the - connection is restored. - - The - iSCSI transmit code has been optimized - to coalesce PDUs and avoid lock - contention. - - Several performance optimizations have been - made to the iSCSI subsystem, including - deferring wakeup until enough data has been received to - read or write a file, reducing CPU usage - and throughput performance with large I/O workloads. - - Support for hostname- and IP-based access - restriction has been added to the iSCSI - &man.ctld.8; daemon. - - The &man.ctld.8; daemon has been updated - to allow overriding the default - portal-group configuration. - - The &man.ctld.8; daemon now includes a new - auth-group, default, - defaulting to deny, which is possible - to override. +   Disks and Storage - The - &man.geom.4; subsystem has been updated to support I/O - direct dispatch. When safety requirements are met, it - enables avoiding passing I/O requests to GEOM - g_up/g_down thread, - executing them directly in the caller context, avoiding - CPU bottlenecks in - g_up/g_down threads, - plus avoid several context switches per I/O. - - The - &man.geom.4; RAID driver has been - updated to support unmapped I/O. - - The - &man.cam.4; subsystem has been updated to support - finer-grained locking, direct dispatch and multi-queue, - which combined with &man.geom.4; direct dispatch, reduces - lock congestion and improves SMP - scalability of the SCSI/ATA stack. - - The &man.geom.8; - GEOM_MULTIPATH class has been updated to - support automatic live partition resizing. - - The &man.virtio_blk.4; driver has been - updated to support unmapped I/O. - - The &man.virtio_scsi.4; driver has - been updated to support unmapped I/O. - - Support for LUN-based CD changers has - been removed from the &man.cd.4; driver. - - Support for - BIO_DELETE has been added to &man.zfs.8; - zvol volumes. - - Support for 9th generation HP host bus - adapter cards has been added to &man.ciss.4;. - - The - &man.mpr.4; device has been added, - providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA - controllers. - - A new zvol property - volmode and &man.sysctl.8; - vfs.zfs.vol.mode has been added to allow - switching zvol between three different - ways of exposing it to a user: geom, - dev and none. - - The - &man.mrsas.4; driver has been added, providing support for - LSI MegaRAID SAS controllers. The &man.mfi.4; driver will - attach to the controller, by default. To enable - &man.mrsas.4; add hw.mfi.mrsas_enable=1 - to /boot/loader.conf, which turns off - &man.mfi.4; device probing. - - - At this time, the &man.mfiutil.8; utility and the &os; - version of MegaCLI and - StorCli do not work with - &man.mrsas.4;. - - - Fixed accounting of - BIO_FLUSH operation in &man.geom.8; - GEOM_DISK class - - The &man.gstat.8; utility now has an - -o option, to display - other operations, such as - BIO_FLUSH. - - The &man.mfi.4; driver has been - updated to include support for unmapped I/O. - - The &man.hpt27xx.4; driver has been - updated with various vendor-supplied bug fixes. - - Support for unmapped I/O has been - added to the &man.xen.4; blkfront - driver. - - The - &man.geom.8; label class is now aware of - resized partitions. This corrects an issue where - geom resize would resize the partition, - but the label provider in /dev/gptid/ would not be - resized. - - The &man.gmirror.8; - utility now has a resize command, making - it easier to resize the size of a mirror when all of its - components have been replaced. - - Support for MegaRAID Fury cards has - been added to the &man.mfi.4; driver. - - The &man.aacraid.4; driver has been - updated to version 3.2.5. - - The GEOM_VINUM - option is now able to be built both directly into the kernel - or as a &man.kldload.8; loadable module. - - The &man.geom.8; - GEOM_PART class has been updated to - support automatic partition resizing. Changes to the - partition size are not saved to disk until - gpart commit is run, and prior to saving, - can be reverted with gpart undo. - - The &man.geom.uncompress.4; module is - built by default which, similar to &man.geom.uzip.4;, - provides support for compressed, read-only disk - images. - - Support for the - disklabel64 partitioning scheme has been - added to &man.gpart.8;. - - A new &man.sysctl.8; and - &man.loader.8; tunable, - kern.geom.part.mbr.enforce_chs has been - added to the &man.geom.8; MBR partition - class. When set to a non-zero value, - GEOM_PART_MBR will automatically - recalculate the user-specified offset and size for alignment - with the disk geometry. - - Many improvements to - the CAM Target Layer (CTL): - - - Support for UNMAP, WRITE - SAME, COMPARE AND WRITE, - XCOPY and some other SCSI commands - was added to support VMWare VAAI and Microsoft ODX - storage acceleration. - - - The - READ/WRITE size - limitations were removed by supporting multiple - data moves per command. - - - Finer-grained per-LUN locking and - multiple worker threads for better - SMP scapability. - - - Memory consumption reduced by - several times by disabling some never used - functionality. - - - The maximum number of - SCSI ports increased from 32 to - 128. - - - Improved zvol - integration for better performance. - - - - The &man.hptnr.4; driver has been - updated to version 1.0.1. - - The &man.mrsas.4; driver has been - added to the GENERIC kernel - configuration on &arch.amd64; and &arch.i386; - architectures. +   File Systems - The - vfs.zfs.zio.use_uma &man.sysctl.8; has - been re-enabled. On multi-CPU machines with enough RAM, - this can easily double &man.zfs.8; performance or reduce CPU - usage in half. It was originally disabled due to memory and - KVA exhaustion problem reports, which - should be resolved due to several changes in the VM - subsystem. - - A new flag, -R, - has been added to the &man.fsck.ffs.8; utility. When used, - &man.fsck.ffs.8; will restart itself when too many critical - errors have been detected. - - The &man.zfs.8; filesystem has been - updated to implement bookmarks. See - &man.zfs.8; for further details. - - The &man.zfs.8; filesystem has been - updated to allow tuning the minimum ashift - value when creating new top-level virtual devices (vdevs). - To set the minimum ashift value, for example when creating - a &man.zpool.8; on Advanced Format drives, - set the vfs.zfs.min_auto_ashift - &man.sysctl.8; accordingly. - - The libzfs thread - pool API has been imported from - OpenSolaris, and adapted for &os;. This change allows - parallel disk scanning, which can reduce &man.zpool.8; - overall import time in some workloads. - - The &man.restore.8; utility has been - updated to prevent assertion failures when restoring - a UFS filesystem dump to - a ZFS filesystem by writing restored - files in block sizes that are a multiple of 1024. - - Two &man.sysctl.8;s have been added - to the &man.zfs.8; filesystem: - - - - - vfs.zfs.mg_fragmentation_threshold: The - percentage of the metaslab group size that should be - considered eligible for allocation, unless all metaslab - groups within the metaslab class have also crossed this - threshold. - - - - - vfs.zfs.metaslab.fragmentation_threshold: The - maximum percentage of metaslab fragmentation level to - keep their active state - - - - The default &man.zfs.8; - ARC hash table size has been increased, - and a new &man.loader.8; tunable, - vfs.zfs.arc_average_blocksize, has been - added. Previously, the hash table could be too small, which - would lead to long hash chains and limit performance for - cached reads. The - vfs.zfs.arc_average_blocksize tunable - allows overriding the default block size. The previous - default was 65536, and default of the new &man.loader.8; - tunable is 8192. - - The Fast File System - (FFS) has been updated to support - multi-threaded soft updates. Previously, soft updates were - handled by a single thread, and as of this change, now have - one thread per FFS mountpoint. - - The - new filesystem automount facility, &man.autofs.5;, has been - merged from &os;-CURRENT. The new &man.autofs.5; facility - is similar to that found in other &unix;-like operating - systems, such as OS X™ and Solaris™. The - &man.autofs.5; facility uses a &sun;-compatible - &man.auto.master.5; configuration file, and is administered - with the &man.automount.8; userland utility, and the - &man.automountd.8; and &man.autounmountd.8; daemons. +   Userland Changes - A new flag is added to &man.camcontrol.8;, - -b, which outputs the existing buses and - their parents. - - The &man.newsyslog.8; utility has been - updated to rotate files based on the actual file size instead - of the blocks on disk. This matches the behavior documented - in &man.newsyslog.conf.5;. - - The location of the &man.rctl.8; - configuration file can now be overridden in &man.rc.conf.5;. - To use a non-default location, set - rctl_rules in &man.rc.conf.5; to the - location of the file. - - The ATF test - suite has been updated to version 0.20. The test suite is - disabled by default in &os; 10.1, and can be enabled by - adding WITH_TESTS=yes to - &man.src.conf.5;. - - The libucl library - (Unified Configuration Library) has been merged from - &os;-CURRENT. - - The &man.pkg.7; bootstrapping utility - has been synced with the version in &os;-CURRENT. - - The &man.zfs.8; userland utility has - been updated to include aliases for - snapshot, which allows use of zfs - list -t snap and zfs - snap. - - The &man.zfs.8; userland utility has - been updated to include a new flag to zfs - list, -p, which when specified, - prints the output in a parsable format. - - The Blowfish password format - implementation has been updated. Support for $2b$ has - been added, allowing use of passwords greater than 256 - characters long. - - The &man.iconv.3; library has been - updated to match NetBSD, providing several bug fixes. - - The &man.date.1; utility has been - updated to include a new flag, -R, which - prints the date and time output as specified in RFC - 2822. - - The &man.bc.1; utility has been updated - to version 1.1, in sync with the version in OpenBSD. - - The &man.pmcstat.8; utility has been - updated to include a new flag, -a, which - when specified, produces a full stack track on the sampled - points. - - The &man.netstat.8; and &man.route.8; - utilities have been updated to include a shorthand equivalent - to the -f inet and -f - inet6 address specifiers, -4 - and -6, respectively. - - The &man.crypt.3; library now defaults - to SHA512 for password hashing. - - The &man.gvinum.8; utility has been - updated to allow forceful configuration reset with the - -f flag. Additionally, a bug that would - prevent -f from properly creating - a &man.gvinum.8; configuration has been fixed. - - The &man.login.conf.5; file now takes - precedence over the shell-specific environment files. In - particular, the PATH, - BLOCKSIZE variables are commented from - /usr/share/skel/dot.profile, and the - path, BLOCKSIZE, and - umask variables have been commented from - /usr/share/skel/dot.cshrc. - - The &man.binmiscctl.8; userland utility - and related image activator features have been merged from - &os;-CURRENT. - - The &man.ps.1; utility has been - updated to include the -J flag, used to - filter output by matching &man.jail.8; IDs and names. - Additionally, argument 0 can be used to - -J to only list processes running on the - host system. - - The &man.top.1; utility has been updated - to filter by &man.jail.8; ID or name, in followup to the - &man.ps.1; change in r265229. - - The &man.gstat.8; utility has been - updated to include a new flag, -o. When - set, &man.gstat.8; will display statistics for operations - such as BIO_FLUSH. - - The &man.fetch.3; library has been - updated to look for root SSL certificates - in /usr/local/etc/ssl/ - before /etc/ssl/. - - The &man.clang.1;/llvm suite has been - updated to version 3.4.1. - - The Blowfish password format - has been changed to $2b$ by default. - - The amount of data collected for - &man.hwpmc.4; has been updated to work with modern processors - and larger amounts of available memory. - - The &man.pmcstat.8; utility has been - updated to include a new flag, -l, which - ends event collection after the specified number of - seconds. - - The &man.mergemaster.8; utility has - been updated to avoid printing - /var/tmp/temproot - disappeared if there is nothing to compare. - - The &os; installer, &man.bsdinstall.8;, - has been updated to include optional - &man.geli.8;-encrypted or &man.gmirror.8;-mirrored swap - devices when installing onto a full &man.zfs.8; filesystem. - Additionally, the parent &man.zfs.8; dataset is now configured - with lz4 compression enabled. - - The default &man.newsyslog.conf.5; now - includes files in the - /etc/newsyslog.conf.d/ and - /usr/local/etc/newsyslog.conf.d/ - directories by default for &man.newsyslog.8;. - - The &man.realpath.1; utility has been - updated to return ENOTDIR on paths - components . and .. that are *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 22:25:32 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33FB972E; Fri, 2 Jan 2015 22:25:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FD5821A3; Fri, 2 Jan 2015 22:25:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02MPWIj092129; Fri, 2 Jan 2015 22:25:32 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02MPVSW092126; Fri, 2 Jan 2015 22:25:31 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501022225.t02MPVSW092126@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 2 Jan 2015 22:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276586 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 22:25:32 -0000 Author: gjb Date: Fri Jan 2 22:25:30 2015 New Revision: 276586 URL: https://svnweb.freebsd.org/changeset/base/276586 Log: Bump copyright year. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 2 22:25:27 2015 (r276585) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 2 22:25:30 2015 (r276586) @@ -36,6 +36,7 @@ 2012 2013 2014 + 2015 The &os; Documentation Project From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 22:53:04 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EACCF9A1; Fri, 2 Jan 2015 22:53:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D62EF1631; Fri, 2 Jan 2015 22:53:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02Mr44Z007530; Fri, 2 Jan 2015 22:53:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02Mr4ME007529; Fri, 2 Jan 2015 22:53:04 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201501022253.t02Mr4ME007529@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 2 Jan 2015 22:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276591 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 22:53:05 -0000 Author: gjb Date: Fri Jan 2 22:53:03 2015 New Revision: 276591 URL: https://svnweb.freebsd.org/changeset/base/276591 Log: Trim the copyright year list to match the style in head. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 2 22:49:05 2015 (r276590) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jan 2 22:53:03 2015 (r276591) @@ -21,21 +21,6 @@ $FreeBSD$ - 2000 - 2001 - 2002 - 2003 - 2004 - 2005 - 2006 - 2007 - 2008 - 2009 - 2010 - 2011 - 2012 - 2013 - 2014 2015 The &os; Documentation Project From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 23:13:05 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D75BE99; Fri, 2 Jan 2015 23:13:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38BB71A50; Fri, 2 Jan 2015 23:13:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02ND5IT017011; Fri, 2 Jan 2015 23:13:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02ND5Yf017010; Fri, 2 Jan 2015 23:13:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201501022313.t02ND5Yf017010@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 2 Jan 2015 23:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276594 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 23:13:05 -0000 Author: bapt Date: Fri Jan 2 23:13:04 2015 New Revision: 276594 URL: https://svnweb.freebsd.org/changeset/base/276594 Log: install-info is also needed for installworld so add it to the bootstrap tools Add BPATH to the installworld path to ensure using installworld works if install-info is not in base Modified: stable/10/Makefile.inc1 Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Fri Jan 2 23:10:28 2015 (r276593) +++ stable/10/Makefile.inc1 Fri Jan 2 23:13:04 2015 (r276594) @@ -815,6 +815,7 @@ MTREE_MAGIC?= mtree 2.0 distributeworld installworld: _installcheck_world mkdir -p ${INSTALLTMP} + export PATH=${BPATH}:${PATH} ; \ progs=$$(for prog in ${ITOOLS}; do \ if progpath=`which $$prog`; then \ echo $$progpath; \ @@ -1313,7 +1314,8 @@ _kerberos5_bootstrap_tools= \ .if ${_BOOTSTRAP_MAKEINFO} != "no" _texinfo= gnu/usr.bin/texinfo/libtxi \ - gnu/usr.bin/texinfo/makeinfo + gnu/usr.bin/texinfo/makeinfo \ + gnu/usr.bin/texinfo/install-info .endif # Please document (add comment) why something is in 'bootstrap-tools'. # Try to bound the building of the bootstrap-tool to just the From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 01:41:11 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FB30BF1; Sat, 3 Jan 2015 01:41:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A1DD64088; Sat, 3 Jan 2015 01:41:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t031fBHJ085972; Sat, 3 Jan 2015 01:41:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t031fAnb085970; Sat, 3 Jan 2015 01:41:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201501030141.t031fAnb085970@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Jan 2015 01:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276601 - stable/10/sys/amd64/ia32 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 01:41:11 -0000 Author: kib Date: Sat Jan 3 01:41:10 2015 New Revision: 276601 URL: https://svnweb.freebsd.org/changeset/base/276601 Log: MFC r276322: Change the way the lcall $7,$0 is reflected to usermode. Instead of setting call gate, which must be 64 bit, put a code segment descriptor into ldt slot 0. Modified: stable/10/sys/amd64/ia32/ia32_sigtramp.S stable/10/sys/amd64/ia32/ia32_syscall.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/ia32/ia32_sigtramp.S ============================================================================== --- stable/10/sys/amd64/ia32/ia32_sigtramp.S Sat Jan 3 01:28:58 2015 (r276600) +++ stable/10/sys/amd64/ia32/ia32_sigtramp.S Sat Jan 3 01:41:10 2015 (r276601) @@ -86,34 +86,14 @@ ia32_osigcode: * executed, we would have a window where the ring 0 code is * executed with the wrong gsbase. * - * Instead, reflect the lcall $7,$0 back to ring 3 trampoline - * which sets up the frame for int $0x80. + * Instead, set LDT descriptor 0 as code segment, which reflects + * the lcall $7,$0 back to ring 3 trampoline. The trampoline sets up + * the frame for int $0x80. */ 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 4f + je 1f pushl %ebp movl %esp,%ebp pushl 0x24(%ebp) /* arg 6 */ @@ -122,21 +102,20 @@ lcall_tramp: pushl 0x18(%ebp) pushl 0x14(%ebp) pushl 0x10(%ebp) /* arg 1 */ - pushl 0xc(%ebp) /* gap */ + subl $4,%esp /* gap */ int $0x80 leavel -3: lretl -4: +1: /* * 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. + * the return ip in %ecx. Also, we assume that the call was done + * with ucode32 selector in %cs. */ int $0x80 - jb 3b - addl $8,%esp - jmpl *%ecx + movl $0x33,4(%esp) /* GUCODE32_SEL | SEL_UPL */ + movl %ecx,(%esp) + lretl #endif ALIGN_TEXT Modified: stable/10/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/10/sys/amd64/ia32/ia32_syscall.c Sat Jan 3 01:28:58 2015 (r276600) +++ stable/10/sys/amd64/ia32/ia32_syscall.c Sat Jan 3 01:41:10 2015 (r276601) @@ -223,39 +223,28 @@ int setup_lcall_gate(void) { struct i386_ldt_args uap; - struct user_segment_descriptor descs[2]; - struct gate_descriptor *ssd; + struct user_segment_descriptor desc; uint32_t lcall_addr; int error; bzero(&uap, sizeof(uap)); uap.start = 0; - uap.num = 2; - - /* - * This is the easiest way to cut the space for system - * descriptor in ldt. Manually adjust the descriptor type to - * the call gate later. - */ - bzero(&descs[0], sizeof(descs)); - descs[0].sd_type = SDT_SYSNULL; - descs[1].sd_type = SDT_SYSNULL; - error = amd64_set_ldt(curthread, &uap, descs); + uap.num = 1; + lcall_addr = curproc->p_sysent->sv_psstrings - sz_lcall_tramp; + bzero(&desc, sizeof(desc)); + desc.sd_type = SDT_MEMERA; + desc.sd_dpl = SEL_UPL; + desc.sd_p = 1; + desc.sd_def32 = 1; + desc.sd_gran = 1; + desc.sd_lolimit = 0xffff; + desc.sd_hilimit = 0xf; + desc.sd_lobase = lcall_addr; + desc.sd_hibase = lcall_addr >> 24; + error = amd64_set_ldt(curthread, &uap, &desc); if (error != 0) return (error); - lcall_addr = curproc->p_sysent->sv_psstrings - sz_lcall_tramp; - mtx_lock(&dt_lock); - ssd = (struct gate_descriptor *)(curproc->p_md.md_ldt->ldt_base); - bzero(ssd, sizeof(*ssd)); - ssd->gd_looffset = lcall_addr; - ssd->gd_hioffset = lcall_addr >> 16; - ssd->gd_selector = _ucodesel; - ssd->gd_type = SDT_SYSCGT; - ssd->gd_dpl = SEL_UPL; - ssd->gd_p = 1; - mtx_unlock(&dt_lock); - return (0); } #endif From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 13:08:11 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62012645; Sat, 3 Jan 2015 13:08:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4325966358; Sat, 3 Jan 2015 13:08:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03D8B5V037956; Sat, 3 Jan 2015 13:08:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03D89Zl037944; Sat, 3 Jan 2015 13:08:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501031308.t03D89Zl037944@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Jan 2015 13:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276613 - in stable/10: sys/cam/ctl sys/dev/iscsi usr.sbin/ctld usr.sbin/iscsid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 13:08:11 -0000 Author: mav Date: Sat Jan 3 13:08:08 2015 New Revision: 276613 URL: https://svnweb.freebsd.org/changeset/base/276613 Log: MFC r275864: Make sequence numbers checks more strict. While we don't support MCS, hole in received sequence numbers may mean only PDU loss. While we don't support lost PDU recovery, terminate the connection to avoid stuck commands. While there, improve handling of sequence numbers wrap after 2^32 PDUs. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h stable/10/sys/dev/iscsi/iscsi.c stable/10/sys/dev/iscsi/iscsi_proto.h stable/10/usr.sbin/ctld/discovery.c stable/10/usr.sbin/ctld/login.c stable/10/usr.sbin/iscsid/discovery.c stable/10/usr.sbin/iscsid/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jan 3 11:52:43 2015 (r276612) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jan 3 13:08:08 2015 (r276613) @@ -237,19 +237,34 @@ cfiscsi_pdu_update_cmdsn(const struct ic } #endif - /* - * The target MUST silently ignore any non-immediate command outside - * of this range. - */ - if (cmdsn < cs->cs_cmdsn || cmdsn > cs->cs_cmdsn + maxcmdsn_delta) { - CFISCSI_SESSION_UNLOCK(cs); - CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %d, " - "while expected CmdSN was %d", cmdsn, cs->cs_cmdsn); - return (true); - } + if ((request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0) { + /* + * The target MUST silently ignore any non-immediate command + * outside of this range. + */ + if (ISCSI_SNLT(cmdsn, cs->cs_cmdsn) || + ISCSI_SNGT(cmdsn, cs->cs_cmdsn + maxcmdsn_delta)) { + CFISCSI_SESSION_UNLOCK(cs); + CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " + "while expected %u", cmdsn, cs->cs_cmdsn); + return (true); + } - if ((request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0) + /* + * We don't support multiple connections now, so any + * discontinuity in CmdSN means lost PDUs. Since we don't + * support PDU retransmission -- terminate the connection. + */ + if (cmdsn != cs->cs_cmdsn) { + CFISCSI_SESSION_UNLOCK(cs); + CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " + "while expected %u; dropping connection", + cmdsn, cs->cs_cmdsn); + cfiscsi_session_terminate(cs); + return (true); + } cs->cs_cmdsn++; + } CFISCSI_SESSION_UNLOCK(cs); @@ -896,6 +911,16 @@ cfiscsi_pdu_handle_data_out(struct icl_p return; } + if (cdw->cdw_datasn != ntohl(bhsdo->bhsdo_datasn)) { + CFISCSI_SESSION_WARN(cs, "received Data-Out PDU with " + "DataSN %u, while expected %u; dropping connection", + ntohl(bhsdo->bhsdo_datasn), cdw->cdw_datasn); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); + return; + } + cdw->cdw_datasn++; + io = cdw->cdw_ctl_io; KASSERT((io->io_hdr.flags & CTL_FLAG_DATA_MASK) != CTL_FLAG_DATA_IN, ("CTL_FLAG_DATA_IN")); @@ -2654,6 +2679,7 @@ cfiscsi_datamove_out(union ctl_io *io) cdw->cdw_target_transfer_tag = target_transfer_tag; cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; cdw->cdw_r2t_end = io->scsiio.kern_data_len; + cdw->cdw_datasn = 0; /* Set initial data pointer for the CDW respecting ext_data_filled. */ if (io->scsiio.kern_sg_entries > 0) { Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Sat Jan 3 11:52:43 2015 (r276612) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Sat Jan 3 13:08:08 2015 (r276613) @@ -58,6 +58,7 @@ struct cfiscsi_data_wait { char *cdw_sg_addr; size_t cdw_sg_len; uint32_t cdw_r2t_end; + uint32_t cdw_datasn; }; #define CFISCSI_SESSION_STATE_INVALID 0 Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Sat Jan 3 11:52:43 2015 (r276612) +++ stable/10/sys/dev/iscsi/iscsi.c Sat Jan 3 13:08:08 2015 (r276613) @@ -197,7 +197,7 @@ iscsi_pdu_prepare(struct icl_pdu *reques * Data-Out PDU does not contain CmdSN. */ if (bhssc->bhssc_opcode != ISCSI_BHS_OPCODE_SCSI_DATA_OUT) { - if (is->is_cmdsn > is->is_maxcmdsn && + if (ISCSI_SNGT(is->is_cmdsn, is->is_maxcmdsn) && (bhssc->bhssc_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0) { /* * Current MaxCmdSN prevents us from sending any more @@ -206,8 +206,10 @@ iscsi_pdu_prepare(struct icl_pdu *reques * or by maintenance thread. */ #if 0 - ISCSI_SESSION_DEBUG(is, "postponing send, CmdSN %d, ExpCmdSN %d, MaxCmdSN %d, opcode 0x%x", - is->is_cmdsn, is->is_expcmdsn, is->is_maxcmdsn, bhssc->bhssc_opcode); + ISCSI_SESSION_DEBUG(is, "postponing send, CmdSN %u, " + "ExpCmdSN %u, MaxCmdSN %u, opcode 0x%x", + is->is_cmdsn, is->is_expcmdsn, is->is_maxcmdsn, + bhssc->bhssc_opcode); #endif return (true); } @@ -616,7 +618,7 @@ iscsi_pdu_update_statsn(const struct icl { const struct iscsi_bhs_data_in *bhsdi; struct iscsi_session *is; - uint32_t expcmdsn, maxcmdsn; + uint32_t expcmdsn, maxcmdsn, statsn; is = PDU_SESSION(response); @@ -635,26 +637,27 @@ iscsi_pdu_update_statsn(const struct icl */ if (bhsdi->bhsdi_opcode != ISCSI_BHS_OPCODE_SCSI_DATA_IN || (bhsdi->bhsdi_flags & BHSDI_FLAGS_S) != 0) { - if (ntohl(bhsdi->bhsdi_statsn) < is->is_statsn) { - ISCSI_SESSION_WARN(is, - "PDU StatSN %d >= session StatSN %d, opcode 0x%x", - is->is_statsn, ntohl(bhsdi->bhsdi_statsn), - bhsdi->bhsdi_opcode); + statsn = ntohl(bhsdi->bhsdi_statsn); + if (statsn != is->is_statsn && statsn != (is->is_statsn + 1)) { + /* XXX: This is normal situation for MCS */ + ISCSI_SESSION_WARN(is, "PDU 0x%x StatSN %u != " + "session ExpStatSN %u (or + 1); reconnecting", + bhsdi->bhsdi_opcode, statsn, is->is_statsn); + iscsi_session_reconnect(is); } - is->is_statsn = ntohl(bhsdi->bhsdi_statsn); + if (ISCSI_SNGT(statsn, is->is_statsn)) + is->is_statsn = statsn; } expcmdsn = ntohl(bhsdi->bhsdi_expcmdsn); maxcmdsn = ntohl(bhsdi->bhsdi_maxcmdsn); - /* - * XXX: Compare using Serial Arithmetic Sense. - */ - if (maxcmdsn + 1 < expcmdsn) { - ISCSI_SESSION_DEBUG(is, "PDU MaxCmdSN %d + 1 < PDU ExpCmdSN %d; ignoring", + if (ISCSI_SNLT(maxcmdsn + 1, expcmdsn)) { + ISCSI_SESSION_DEBUG(is, + "PDU MaxCmdSN %u + 1 < PDU ExpCmdSN %u; ignoring", maxcmdsn, expcmdsn); } else { - if (maxcmdsn > is->is_maxcmdsn) { + if (ISCSI_SNGT(maxcmdsn, is->is_maxcmdsn)) { is->is_maxcmdsn = maxcmdsn; /* @@ -663,15 +666,19 @@ iscsi_pdu_update_statsn(const struct icl */ if (!STAILQ_EMPTY(&is->is_postponed)) cv_signal(&is->is_maintenance_cv); - } else if (maxcmdsn < is->is_maxcmdsn) { - ISCSI_SESSION_DEBUG(is, "PDU MaxCmdSN %d < session MaxCmdSN %d; ignoring", + } else if (ISCSI_SNLT(maxcmdsn, is->is_maxcmdsn)) { + /* XXX: This is normal situation for MCS */ + ISCSI_SESSION_DEBUG(is, + "PDU MaxCmdSN %u < session MaxCmdSN %u; ignoring", maxcmdsn, is->is_maxcmdsn); } - if (expcmdsn > is->is_expcmdsn) { + if (ISCSI_SNGT(expcmdsn, is->is_expcmdsn)) { is->is_expcmdsn = expcmdsn; - } else if (expcmdsn < is->is_expcmdsn) { - ISCSI_SESSION_DEBUG(is, "PDU ExpCmdSN %d < session ExpCmdSN %d; ignoring", + } else if (ISCSI_SNLT(expcmdsn, is->is_expcmdsn)) { + /* XXX: This is normal situation for MCS */ + ISCSI_SESSION_DEBUG(is, + "PDU ExpCmdSN %u < session ExpCmdSN %u; ignoring", expcmdsn, is->is_expcmdsn); } } Modified: stable/10/sys/dev/iscsi/iscsi_proto.h ============================================================================== --- stable/10/sys/dev/iscsi/iscsi_proto.h Sat Jan 3 11:52:43 2015 (r276612) +++ stable/10/sys/dev/iscsi/iscsi_proto.h Sat Jan 3 13:08:08 2015 (r276613) @@ -38,6 +38,9 @@ #define __CTASSERT(x, y) typedef char __assert_ ## y [(x) ? 1 : -1] #endif +#define ISCSI_SNGT(x, y) ((int32_t)(x) - (int32_t)(y) > 0) +#define ISCSI_SNLT(x, y) ((int32_t)(x) - (int32_t)(y) < 0) + #define ISCSI_BHS_SIZE 48 #define ISCSI_HEADER_DIGEST_SIZE 4 #define ISCSI_DATA_DIGEST_SIZE 4 Modified: stable/10/usr.sbin/ctld/discovery.c ============================================================================== --- stable/10/usr.sbin/ctld/discovery.c Sat Jan 3 11:52:43 2015 (r276612) +++ stable/10/usr.sbin/ctld/discovery.c Sat Jan 3 13:08:08 2015 (r276613) @@ -65,13 +65,13 @@ text_receive(struct connection *conn) */ if ((bhstr->bhstr_flags & BHSTR_FLAGS_CONTINUE) != 0) log_errx(1, "received Text PDU with unsupported \"C\" flag"); - if (ntohl(bhstr->bhstr_cmdsn) < conn->conn_cmdsn) { + if (ISCSI_SNLT(ntohl(bhstr->bhstr_cmdsn), conn->conn_cmdsn)) { log_errx(1, "received Text PDU with decreasing CmdSN: " - "was %d, is %d", conn->conn_cmdsn, ntohl(bhstr->bhstr_cmdsn)); + "was %u, is %u", conn->conn_cmdsn, ntohl(bhstr->bhstr_cmdsn)); } if (ntohl(bhstr->bhstr_expstatsn) != conn->conn_statsn) { log_errx(1, "received Text PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhstr->bhstr_expstatsn), + "is %u, should be %u", ntohl(bhstr->bhstr_expstatsn), conn->conn_statsn); } conn->conn_cmdsn = ntohl(bhstr->bhstr_cmdsn); @@ -120,14 +120,14 @@ logout_receive(struct connection *conn) if ((bhslr->bhslr_reason & 0x7f) != BHSLR_REASON_CLOSE_SESSION) log_debugx("received Logout PDU with invalid reason 0x%x; " "continuing anyway", bhslr->bhslr_reason & 0x7f); - if (ntohl(bhslr->bhslr_cmdsn) < conn->conn_cmdsn) { + if (ISCSI_SNLT(ntohl(bhslr->bhslr_cmdsn), conn->conn_cmdsn)) { log_errx(1, "received Logout PDU with decreasing CmdSN: " - "was %d, is %d", conn->conn_cmdsn, + "was %u, is %u", conn->conn_cmdsn, ntohl(bhslr->bhslr_cmdsn)); } if (ntohl(bhslr->bhslr_expstatsn) != conn->conn_statsn) { log_errx(1, "received Logout PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhslr->bhslr_expstatsn), + "is %u, should be %u", ntohl(bhslr->bhslr_expstatsn), conn->conn_statsn); } conn->conn_cmdsn = ntohl(bhslr->bhslr_cmdsn); Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Sat Jan 3 11:52:43 2015 (r276612) +++ stable/10/usr.sbin/ctld/login.c Sat Jan 3 13:08:08 2015 (r276613) @@ -127,17 +127,17 @@ login_receive(struct connection *conn, b log_errx(1, "received Login PDU with unsupported " "Version-min 0x%x", bhslr->bhslr_version_min); } - if (ntohl(bhslr->bhslr_cmdsn) < conn->conn_cmdsn) { + if (ISCSI_SNLT(ntohl(bhslr->bhslr_cmdsn), conn->conn_cmdsn)) { login_send_error(request, 0x02, 0x05); log_errx(1, "received Login PDU with decreasing CmdSN: " - "was %d, is %d", conn->conn_cmdsn, + "was %u, is %u", conn->conn_cmdsn, ntohl(bhslr->bhslr_cmdsn)); } if (initial == false && ntohl(bhslr->bhslr_expstatsn) != conn->conn_statsn) { login_send_error(request, 0x02, 0x05); log_errx(1, "received Login PDU with wrong ExpStatSN: " - "is %d, should be %d", ntohl(bhslr->bhslr_expstatsn), + "is %u, should be %u", ntohl(bhslr->bhslr_expstatsn), conn->conn_statsn); } conn->conn_cmdsn = ntohl(bhslr->bhslr_cmdsn); Modified: stable/10/usr.sbin/iscsid/discovery.c ============================================================================== --- stable/10/usr.sbin/iscsid/discovery.c Sat Jan 3 11:52:43 2015 (r276612) +++ stable/10/usr.sbin/iscsid/discovery.c Sat Jan 3 13:08:08 2015 (r276613) @@ -66,7 +66,7 @@ text_receive(struct connection *conn) log_errx(1, "received Text PDU with unsupported \"C\" flag"); if (ntohl(bhstr->bhstr_statsn) != conn->conn_statsn + 1) { log_errx(1, "received Text PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhstr->bhstr_statsn), + "is %u, should be %u", ntohl(bhstr->bhstr_statsn), conn->conn_statsn + 1); } conn->conn_statsn = ntohl(bhstr->bhstr_statsn); @@ -112,7 +112,7 @@ logout_receive(struct connection *conn) ntohs(bhslr->bhslr_response)); if (ntohl(bhslr->bhslr_statsn) != conn->conn_statsn + 1) { log_errx(1, "received Logout PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhslr->bhslr_statsn), + "is %u, should be %u", ntohl(bhslr->bhslr_statsn), conn->conn_statsn + 1); } conn->conn_statsn = ntohl(bhslr->bhslr_statsn); Modified: stable/10/usr.sbin/iscsid/login.c ============================================================================== --- stable/10/usr.sbin/iscsid/login.c Sat Jan 3 11:52:43 2015 (r276612) +++ stable/10/usr.sbin/iscsid/login.c Sat Jan 3 13:08:08 2015 (r276613) @@ -257,7 +257,7 @@ login_receive(struct connection *conn) * to be bug in NetBSD iSCSI target. */ log_warnx("received Login PDU with wrong StatSN: " - "is %d, should be %d", ntohl(bhslr->bhslr_statsn), + "is %u, should be %u", ntohl(bhslr->bhslr_statsn), conn->conn_statsn + 1); } conn->conn_tsih = ntohs(bhslr->bhslr_tsih); From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 13:09:34 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DC7A7AE; Sat, 3 Jan 2015 13:09:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECD6F66373; Sat, 3 Jan 2015 13:09:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03D9XaA038192; Sat, 3 Jan 2015 13:09:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03D9XGW038190; Sat, 3 Jan 2015 13:09:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501031309.t03D9XGW038190@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Jan 2015 13:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276614 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 13:09:34 -0000 Author: mav Date: Sat Jan 3 13:09:32 2015 New Revision: 276614 URL: https://svnweb.freebsd.org/changeset/base/276614 Log: MFC r275942: Reduce number of places where global control_softc is used. At some point we may want to have several CTL instances, and that is not really impossible. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_tpc.c stable/10/sys/cam/ctl/ctl_tpc.h stable/10/sys/cam/ctl/ctl_tpc_local.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 3 13:08:08 2015 (r276613) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 3 13:09:32 2015 (r276614) @@ -400,8 +400,8 @@ static int ctl_ioctl_fill_ooa(struct ctl struct ctl_ooa_entry *kern_entries); static int ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); -static uint32_t ctl_map_lun(int port_num, uint32_t lun); -static uint32_t ctl_map_lun_back(int port_num, uint32_t lun); +static uint32_t ctl_map_lun(struct ctl_softc *softc, int port_num, uint32_t lun); +static uint32_t ctl_map_lun_back(struct ctl_softc *softc, int port_num, uint32_t lun); static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, struct ctl_be_lun *be_lun, struct ctl_id target_id); static int ctl_free_lun(struct ctl_lun *lun); @@ -443,8 +443,7 @@ static ctl_action ctl_check_for_blockage static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, union ctl_io *starting_io); static int ctl_check_blocked(struct ctl_lun *lun); -static int ctl_scsiio_lun_check(struct ctl_softc *ctl_softc, - struct ctl_lun *lun, +static int ctl_scsiio_lun_check(struct ctl_lun *lun, const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio); //static int ctl_check_rtr(union ctl_io *pending_io, struct ctl_softc *softc); @@ -611,12 +610,12 @@ ctl_isc_handler_finish_ser_only(struct c static void ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_event event, int param) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; union ctl_io *io; struct ctl_prio *presio; ctl_ha_status isc_status; - ctl_softc = control_softc; + softc = control_softc; io = NULL; @@ -642,7 +641,7 @@ ctl_isc_event_handler(ctl_ha_channel cha #if 0 printf("Serialize\n"); #endif - io = ctl_alloc_io_nowait(ctl_softc->othersc_pool); + io = ctl_alloc_io_nowait(softc->othersc_pool); if (io == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -674,7 +673,7 @@ ctl_isc_event_handler(ctl_ha_channel cha * * XXX KDM add another flag that is more specific. */ - if (ctl_softc->ha_mode == CTL_HA_MODE_SER_ONLY) + if (softc->ha_mode == CTL_HA_MODE_SER_ONLY) io->io_hdr.flags |= CTL_FLAG_INT_COPY; io->io_hdr.nexus = msg_info.hdr.nexus; #if 0 @@ -688,7 +687,7 @@ ctl_isc_event_handler(ctl_ha_channel cha io->scsiio.tag_type = msg_info.scsi.tag_type; memcpy(io->scsiio.cdb, msg_info.scsi.cdb, CTL_MAX_CDBLEN); - if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) { + if (softc->ha_mode == CTL_HA_MODE_XFER) { const struct ctl_cmd_entry *entry; entry = ctl_get_cmd_entry(&io->scsiio, NULL); @@ -854,11 +853,11 @@ ctl_isc_event_handler(ctl_ha_channel cha * mode */ case CTL_MSG_FINISH_IO: - if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) - ctl_isc_handler_finish_xfer(ctl_softc, + if (softc->ha_mode == CTL_HA_MODE_XFER) + ctl_isc_handler_finish_xfer(softc, &msg_info); else - ctl_isc_handler_finish_ser_only(ctl_softc, + ctl_isc_handler_finish_ser_only(softc, &msg_info); break; @@ -888,7 +887,7 @@ ctl_isc_event_handler(ctl_ha_channel cha case CTL_MSG_MANAGE_TASKS: { struct ctl_taskio *taskio; taskio = (struct ctl_taskio *)ctl_alloc_io_nowait( - ctl_softc->othersc_pool); + softc->othersc_pool); if (taskio == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -917,7 +916,7 @@ ctl_isc_event_handler(ctl_ha_channel cha /* Persistent Reserve action which needs attention */ case CTL_MSG_PERS_ACTION: presio = (struct ctl_prio *)ctl_alloc_io_nowait( - ctl_softc->othersc_pool); + softc->othersc_pool); if (presio == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -1834,16 +1833,16 @@ bailout: static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; union ctl_ha_msg msg_info; struct ctl_lun *lun; int retval = 0; uint32_t targ_lun; - ctl_softc = control_softc; + softc = control_softc; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; - lun = ctl_softc->ctl_luns[targ_lun]; + lun = softc->ctl_luns[targ_lun]; if (lun==NULL) { /* @@ -1888,7 +1887,7 @@ ctl_serialize_other_sc_cmd(struct ctl_sc break; case CTL_ACTION_PASS: case CTL_ACTION_SKIP: - if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) { + if (softc->ha_mode == CTL_HA_MODE_XFER) { ctsio->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR; ctl_enqueue_rtr((union ctl_io *)ctsio); } else { @@ -3604,11 +3603,11 @@ ctl_port_idx(int port_num) } static uint32_t -ctl_map_lun(int port_num, uint32_t lun_id) +ctl_map_lun(struct ctl_softc *softc, int port_num, uint32_t lun_id) { struct ctl_port *port; - port = control_softc->ctl_ports[ctl_port_idx(port_num)]; + port = softc->ctl_ports[ctl_port_idx(port_num)]; if (port == NULL) return (UINT32_MAX); if (port->lun_map == NULL) @@ -3617,12 +3616,12 @@ ctl_map_lun(int port_num, uint32_t lun_i } static uint32_t -ctl_map_lun_back(int port_num, uint32_t lun_id) +ctl_map_lun_back(struct ctl_softc *softc, int port_num, uint32_t lun_id) { struct ctl_port *port; uint32_t i; - port = control_softc->ctl_ports[ctl_port_idx(port_num)]; + port = softc->ctl_ports[ctl_port_idx(port_num)]; if (port->lun_map == NULL) return (lun_id); for (i = 0; i < CTL_MAX_LUNS; i++) { @@ -4779,25 +4778,25 @@ ctl_free_lun(struct ctl_lun *lun) static void ctl_create_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; - ctl_softc = control_softc; + softc = control_softc; /* * ctl_alloc_lun() should handle all potential failure cases. */ - ctl_alloc_lun(ctl_softc, NULL, be_lun, ctl_softc->target); + ctl_alloc_lun(softc, NULL, be_lun, softc->target); } int ctl_add_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc = control_softc; + struct ctl_softc *softc = control_softc; - mtx_lock(&ctl_softc->ctl_lock); - STAILQ_INSERT_TAIL(&ctl_softc->pending_lun_queue, be_lun, links); - mtx_unlock(&ctl_softc->ctl_lock); - wakeup(&ctl_softc->pending_lun_queue); + mtx_lock(&softc->ctl_lock); + STAILQ_INSERT_TAIL(&softc->pending_lun_queue, be_lun, links); + mtx_unlock(&softc->ctl_lock); + wakeup(&softc->pending_lun_queue); return (0); } @@ -4805,16 +4804,15 @@ ctl_add_lun(struct ctl_be_lun *be_lun) int ctl_enable_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_port *port, *nport; struct ctl_lun *lun; int retval; - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + softc = lun->ctl_softc; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); if ((lun->flags & CTL_LUN_DISABLED) == 0) { /* @@ -4822,13 +4820,13 @@ ctl_enable_lun(struct ctl_be_lun *be_lun * enabled? */ mtx_unlock(&lun->lun_lock); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (0); } lun->flags &= ~CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); - for (port = STAILQ_FIRST(&ctl_softc->port_list); port != NULL; port = nport) { + for (port = STAILQ_FIRST(&softc->port_list); port != NULL; port = nport) { nport = STAILQ_NEXT(port, links); /* @@ -4836,9 +4834,9 @@ ctl_enable_lun(struct ctl_be_lun *be_lun * This can lead to a callback into CTL (at least in the * case of the internal initiator frontend. */ - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); retval = port->lun_enable(port->targ_lun_arg, lun->target,lun->lun); - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); if (retval != 0) { printf("%s: FETD %s port %d returned error " "%d for lun_enable on target %ju lun %jd\n", @@ -4853,7 +4851,7 @@ ctl_enable_lun(struct ctl_be_lun *be_lun #endif } - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (0); } @@ -4861,27 +4859,26 @@ ctl_enable_lun(struct ctl_be_lun *be_lun int ctl_disable_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_port *port; struct ctl_lun *lun; int retval; - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + softc = lun->ctl_softc; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); if (lun->flags & CTL_LUN_DISABLED) { mtx_unlock(&lun->lun_lock); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (0); } lun->flags |= CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); - STAILQ_FOREACH(port, &ctl_softc->port_list, links) { - mtx_unlock(&ctl_softc->ctl_lock); + STAILQ_FOREACH(port, &softc->port_list, links) { + mtx_unlock(&softc->ctl_lock); /* * Drop the lock before we call the frontend's disable * routine, to avoid lock order reversals. @@ -4891,7 +4888,7 @@ ctl_disable_lun(struct ctl_be_lun *be_lu */ retval = port->lun_disable(port->targ_lun_arg, lun->target, lun->lun); - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); if (retval != 0) { printf("ctl_alloc_lun: FETD %s port %d returned error " "%d for lun_disable on target %ju lun %jd\n", @@ -4900,7 +4897,7 @@ ctl_disable_lun(struct ctl_be_lun *be_lu } } - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (0); } @@ -4908,80 +4905,55 @@ ctl_disable_lun(struct ctl_be_lun *be_lu int ctl_start_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_STOPPED; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_stop_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_STOPPED; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_lun_offline(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_OFFLINE; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_lun_online(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_OFFLINE; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_invalidate_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_lun *lun; - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + softc = lun->ctl_softc; mtx_lock(&lun->lun_lock); @@ -5004,9 +4976,9 @@ ctl_invalidate_lun(struct ctl_be_lun *be */ if (TAILQ_EMPTY(&lun->ooa_queue)) { mtx_unlock(&lun->lun_lock); - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); ctl_free_lun(lun); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); } else mtx_unlock(&lun->lun_lock); @@ -5016,32 +4988,22 @@ ctl_invalidate_lun(struct ctl_be_lun *be int ctl_lun_inoperable(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_INOPERABLE; mtx_unlock(&lun->lun_lock); - return (0); } int ctl_lun_operable(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - struct ctl_lun *lun; - - ctl_softc = control_softc; - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_INOPERABLE; mtx_unlock(&lun->lun_lock); - return (0); } @@ -5227,7 +5189,6 @@ int ctl_scsi_release(struct ctl_scsiio *ctsio) { int length, longid, thirdparty_id, resv_id; - struct ctl_softc *ctl_softc; struct ctl_lun *lun; uint32_t residx; @@ -5238,7 +5199,6 @@ ctl_scsi_release(struct ctl_scsiio *ctsi residx = ctl_get_resindex(&ctsio->io_hdr.nexus); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; switch (ctsio->cdb[0]) { case RELEASE_10: { @@ -5315,7 +5275,6 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi int extent, thirdparty, longid; int resv_id, length; uint64_t thirdparty_id; - struct ctl_softc *ctl_softc; struct ctl_lun *lun; uint32_t residx; @@ -5330,7 +5289,6 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi residx = ctl_get_resindex(&ctsio->io_hdr.nexus); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; switch (ctsio->cdb[0]) { case RESERVE_10: { @@ -5404,13 +5362,11 @@ ctl_start_stop(struct ctl_scsiio *ctsio) { struct scsi_start_stop_unit *cdb; struct ctl_lun *lun; - struct ctl_softc *ctl_softc; int retval; CTL_DEBUG_PRINT(("ctl_start_stop\n")); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; retval = 0; cdb = (struct scsi_start_stop_unit *)ctsio->cdb; @@ -5531,7 +5487,7 @@ int ctl_sync_cache(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; uint64_t starting_lba; uint32_t block_count; int retval; @@ -5539,7 +5495,7 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_sync_cache\n")); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; + softc = lun->ctl_softc; retval = 0; switch (ctsio->cdb[0]) { @@ -5592,7 +5548,7 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) * CACHE command directly to the back end. */ mtx_lock(&lun->lun_lock); - if ((ctl_softc->flags & CTL_FLAG_REAL_SYNC) + if ((softc->flags & CTL_FLAG_REAL_SYNC) && (++(lun->sync_count) >= lun->sync_interval)) { lun->sync_count = 0; mtx_unlock(&lun->lun_lock); @@ -5613,13 +5569,11 @@ ctl_format(struct ctl_scsiio *ctsio) { struct scsi_format *cdb; struct ctl_lun *lun; - struct ctl_softc *ctl_softc; int length, defect_list_len; CTL_DEBUG_PRINT(("ctl_format\n")); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; cdb = (struct scsi_format *)ctsio->cdb; @@ -6077,7 +6031,6 @@ ctl_control_page_handler(struct ctl_scsi { struct scsi_control_page *current_cp, *saved_cp, *user_cp; struct ctl_lun *lun; - struct ctl_softc *softc; int set_ua; uint32_t initidx; @@ -6093,8 +6046,6 @@ ctl_control_page_handler(struct ctl_scsi (page_index->page_data + (page_index->page_len * CTL_PAGE_SAVED)); - softc = control_softc; - mtx_lock(&lun->lun_lock); if (((current_cp->rlec & SCP_DSENSE) == 0) && ((user_cp->rlec & SCP_DSENSE) != 0)) { @@ -7360,8 +7311,8 @@ ctl_report_tagret_port_groups(struct ctl CTL_DEBUG_PRINT(("ctl_report_tagret_port_groups\n")); cdb = (struct scsi_maintenance_in *)ctsio->cdb; - softc = control_softc; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + softc = lun->ctl_softc; retval = CTL_RETVAL_COMPLETE; @@ -7392,7 +7343,8 @@ ctl_report_tagret_port_groups(struct ctl STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_map_lun_back(port->targ_port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_map_lun_back(softc, port->targ_port, lun->lun) >= + CTL_MAX_LUNS) continue; num_target_ports++; } @@ -7465,8 +7417,8 @@ ctl_report_tagret_port_groups(struct ctl STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_map_lun_back(port->targ_port, lun->lun) >= - CTL_MAX_LUNS) + if (ctl_map_lun_back(softc, port->targ_port, lun->lun) + >= CTL_MAX_LUNS) continue; p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS; scsi_ulto2b(p, tpg_desc->descriptors[pc]. @@ -7758,13 +7710,12 @@ ctl_persistent_reserve_in(struct ctl_scs CTL_DEBUG_PRINT(("ctl_persistent_reserve_in\n")); - softc = control_softc; - cdb = (struct scsi_per_res_in *)ctsio->cdb; alloc_len = scsi_2btoul(cdb->length); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + softc = lun->ctl_softc; retry: mtx_lock(&lun->lun_lock); @@ -8387,10 +8338,9 @@ ctl_persistent_reserve_out(struct ctl_sc retval = CTL_RETVAL_COMPLETE; - softc = control_softc; - cdb = (struct scsi_per_res_out *)ctsio->cdb; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + softc = lun->ctl_softc; /* * We only support whole-LUN scope. The scope & type are ignored for @@ -9306,6 +9256,7 @@ ctl_verify(struct ctl_scsiio *ctsio) int ctl_report_luns(struct ctl_scsiio *ctsio) { + struct ctl_softc *softc = control_softc; struct scsi_report_luns *cdb; struct scsi_report_luns_data *lun_data; struct ctl_lun *lun, *request_lun; @@ -9321,9 +9272,9 @@ ctl_report_luns(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("ctl_report_luns\n")); - mtx_lock(&control_softc->ctl_lock); - num_luns = control_softc->num_luns; - mtx_unlock(&control_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); + num_luns = softc->num_luns; + mtx_unlock(&softc->ctl_lock); switch (cdb->select_report) { case RPL_REPORT_DEFAULT: @@ -9375,12 +9326,13 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); - mtx_lock(&control_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { - lun_id = ctl_map_lun(ctsio->io_hdr.nexus.targ_port, targ_lun_id); + lun_id = ctl_map_lun(softc, ctsio->io_hdr.nexus.targ_port, + targ_lun_id); if (lun_id >= CTL_MAX_LUNS) continue; - lun = control_softc->ctl_luns[lun_id]; + lun = softc->ctl_luns[lun_id]; if (lun == NULL) continue; @@ -9436,7 +9388,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_unlock(&lun->lun_lock); } } - mtx_unlock(&control_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); /* * It's quite possible that we've returned fewer LUNs than we allocated @@ -9871,15 +9823,15 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio { struct scsi_vpd_device_id *devid_ptr; struct scsi_vpd_id_descriptor *desc; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_lun *lun; struct ctl_port *port; int data_len; uint8_t proto; - ctl_softc = control_softc; + softc = control_softc; - port = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; + port = softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; data_len = sizeof(struct scsi_vpd_device_id) + @@ -10013,7 +9965,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_map_lun_back(port->targ_port, lun->lun) >= + ctl_map_lun_back(softc, port->targ_port, lun->lun) >= CTL_MAX_LUNS) continue; num_target_ports++; @@ -10067,8 +10019,8 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_map_lun_back(port->targ_port, lun->lun) >= - CTL_MAX_LUNS) + ctl_map_lun_back(softc, port->targ_port, lun->lun) + >= CTL_MAX_LUNS) continue; p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS; scsi_ulto2b(p, pd->relative_port_id); @@ -10344,20 +10296,20 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio { struct scsi_inquiry_data *inq_ptr; struct scsi_inquiry *cdb; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; struct ctl_lun *lun; char *val; uint32_t alloc_len, data_len; ctl_port_type port_type; - ctl_softc = control_softc; + softc = control_softc; /* * Figure out whether we're talking to a Fibre Channel port or not. * We treat the ioctl front end, and any SCSI adapters, as packetized * SCSI front ends. */ - port_type = ctl_softc->ctl_ports[ + port_type = softc->ctl_ports[ ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]->port_type; if (port_type == CTL_PORT_IOCTL || port_type == CTL_PORT_INTERNAL) port_type = CTL_PORT_SCSI; @@ -10434,7 +10386,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio if (lun != NULL) inq_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | lun->be_lun->lun_type; - else if (ctl_softc->inquiry_pq_no_lun == 0) + else if (softc->inquiry_pq_no_lun == 0) inq_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; else inq_ptr->device = (SID_QUAL_BAD_LU << 5) | T_NODEVICE; @@ -11067,7 +11019,6 @@ ctl_check_blocked(struct ctl_lun *lun) break; case CTL_ACTION_PASS: case CTL_ACTION_SKIP: { - struct ctl_softc *softc; const struct ctl_cmd_entry *entry; int isc_retval; @@ -11106,7 +11057,6 @@ ctl_check_blocked(struct ctl_lun *lun) break; } entry = ctl_get_cmd_entry(&cur_blocked->scsiio, NULL); - softc = control_softc; /* * Check this I/O for LUN state changes that may @@ -11116,7 +11066,7 @@ ctl_check_blocked(struct ctl_lun *lun) * for any states that can be caused by SCSI * commands. */ - if (ctl_scsiio_lun_check(softc, lun, entry, + if (ctl_scsiio_lun_check(lun, entry, &cur_blocked->scsiio) == 0) { cur_blocked->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR; @@ -11150,9 +11100,10 @@ ctl_check_blocked(struct ctl_lun *lun) * careful attention to the placement of any new checks. */ static int -ctl_scsiio_lun_check(struct ctl_softc *ctl_softc, struct ctl_lun *lun, +ctl_scsiio_lun_check(struct ctl_lun *lun, const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio) { + struct ctl_softc *softc = lun->ctl_softc; int retval; uint32_t residx; @@ -11164,7 +11115,7 @@ ctl_scsiio_lun_check(struct ctl_softc *c * If this shelf is a secondary shelf controller, we have to reject * any media access commands. */ - if ((ctl_softc->flags & CTL_FLAG_ACTIVE_SHELF) == 0 && + if ((softc->flags & CTL_FLAG_ACTIVE_SHELF) == 0 && (entry->flags & CTL_CMD_FLAG_OK_ON_SECONDARY) == 0) { ctl_set_lun_standby(ctsio); retval = 1; @@ -11270,14 +11221,14 @@ static void ctl_failover(void) { struct ctl_lun *lun; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; union ctl_io *next_io, *pending_io; union ctl_io *io; int lun_idx; - ctl_softc = control_softc; + softc = control_softc; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); /* * Remove any cmds from the other SC from the rtr queue. These * will obviously only be for LUNs for which we're the primary. @@ -11287,19 +11238,19 @@ ctl_failover(void) * which HA mode we're in. */ #ifdef notyet - mtx_lock(&ctl_softc->queue_lock); - for (io = (union ctl_io *)STAILQ_FIRST(&ctl_softc->rtr_queue); + mtx_lock(&softc->queue_lock); + for (io = (union ctl_io *)STAILQ_FIRST(&softc->rtr_queue); io != NULL; io = next_io) { next_io = (union ctl_io *)STAILQ_NEXT(&io->io_hdr, links); if (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) - STAILQ_REMOVE(&ctl_softc->rtr_queue, &io->io_hdr, + STAILQ_REMOVE(&softc->rtr_queue, &io->io_hdr, ctl_io_hdr, links); } - mtx_unlock(&ctl_softc->queue_lock); + mtx_unlock(&softc->queue_lock); #endif - for (lun_idx=0; lun_idx < ctl_softc->num_luns; lun_idx++) { - lun = ctl_softc->ctl_luns[lun_idx]; + for (lun_idx=0; lun_idx < softc->num_luns; lun_idx++) { + lun = softc->ctl_luns[lun_idx]; if (lun==NULL) continue; @@ -11311,7 +11262,7 @@ ctl_failover(void) continue; if ((lun->flags & CTL_LUN_PRIMARY_SC) - && (ctl_softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { + && (softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { printf("FAILOVER: primary lun %d\n", lun_idx); /* * Remove all commands from the other SC. First from the @@ -11353,7 +11304,7 @@ ctl_failover(void) } ctl_check_blocked(lun); } else if ((lun->flags & CTL_LUN_PRIMARY_SC) - && (ctl_softc->ha_mode == CTL_HA_MODE_XFER)) { + && (softc->ha_mode == CTL_HA_MODE_XFER)) { printf("FAILOVER: primary lun %d\n", lun_idx); /* @@ -11371,7 +11322,7 @@ ctl_failover(void) io->io_hdr.flags |= CTL_FLAG_ABORT; } } else if (((lun->flags & CTL_LUN_PRIMARY_SC) == 0) - && (ctl_softc->ha_mode == CTL_HA_MODE_XFER)) { + && (softc->ha_mode == CTL_HA_MODE_XFER)) { printf("FAILOVER: secondary lun %d\n", lun_idx); @@ -11410,7 +11361,7 @@ ctl_failover(void) ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else if (((lun->flags & CTL_LUN_PRIMARY_SC) == 0) - && (ctl_softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { + && (softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { printf("FAILOVER: secondary lun %d\n", lun_idx); /* * if the first io on the OOA is not on the RtR queue @@ -11500,15 +11451,15 @@ ctl_failover(void) ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else { panic("Unhandled HA mode failover, LUN flags = %#x, " - "ha_mode = #%x", lun->flags, ctl_softc->ha_mode); + "ha_mode = #%x", lun->flags, softc->ha_mode); } } ctl_pause_rtr = 0; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); } static int -ctl_scsiio_precheck(struct ctl_softc *ctl_softc, struct ctl_scsiio *ctsio) +ctl_scsiio_precheck(struct ctl_softc *softc, struct ctl_scsiio *ctsio) { struct ctl_lun *lun; const struct ctl_cmd_entry *entry; @@ -11521,7 +11472,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; if ((targ_lun < CTL_MAX_LUNS) - && ((lun = ctl_softc->ctl_luns[targ_lun]) != NULL)) { + && ((lun = softc->ctl_luns[targ_lun]) != NULL)) { /* * If the LUN is invalid, pretend that it doesn't exist. * It will go away as soon as all pending I/O has been @@ -11653,7 +11604,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct } - if (ctl_scsiio_lun_check(ctl_softc, lun, entry, ctsio) != 0) { + if (ctl_scsiio_lun_check(lun, entry, ctsio) != 0) { mtx_unlock(&lun->lun_lock); ctl_done((union ctl_io *)ctsio); return (retval); @@ -11861,13 +11812,13 @@ bailout: * our single target. */ static int -ctl_bus_reset(struct ctl_softc *ctl_softc, union ctl_io *io) +ctl_bus_reset(struct ctl_softc *softc, union ctl_io *io) { - return(ctl_target_reset(ctl_softc, io, CTL_UA_BUS_RESET)); + return(ctl_target_reset(softc, io, CTL_UA_BUS_RESET)); } static int -ctl_target_reset(struct ctl_softc *ctl_softc, union ctl_io *io, +ctl_target_reset(struct ctl_softc *softc, union ctl_io *io, ctl_ua_type ua_type) { struct ctl_lun *lun; @@ -11891,10 +11842,10 @@ ctl_target_reset(struct ctl_softc *ctl_s } retval = 0; - mtx_lock(&ctl_softc->ctl_lock); - STAILQ_FOREACH(lun, &ctl_softc->lun_list, links) + mtx_lock(&softc->ctl_lock); + STAILQ_FOREACH(lun, &softc->lun_list, links) retval += ctl_lun_reset(lun, io, ua_type); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (retval); } @@ -12080,7 +12031,7 @@ ctl_abort_task(union ctl_io *io) { union ctl_io *xio; struct ctl_lun *lun; - struct ctl_softc *ctl_softc; + struct ctl_softc *softc; #if 0 struct sbuf sb; char printbuf[128]; @@ -12088,19 +12039,19 @@ ctl_abort_task(union ctl_io *io) int found; uint32_t targ_lun; - ctl_softc = control_softc; + softc = control_softc; found = 0; /* * Look up the LUN. */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); if ((targ_lun < CTL_MAX_LUNS) - && (ctl_softc->ctl_luns[targ_lun] != NULL)) - lun = ctl_softc->ctl_luns[targ_lun]; + && (softc->ctl_luns[targ_lun] != NULL)) + lun = softc->ctl_luns[targ_lun]; else { - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); return (1); } @@ -12110,7 +12061,7 @@ ctl_abort_task(union ctl_io *io) #endif mtx_lock(&lun->lun_lock); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); /* * Run through the OOA queue and attempt to find the given I/O. * The target port, initiator ID, tag type and tag number have to @@ -12226,7 +12177,7 @@ ctl_abort_task(union ctl_io *io) static void ctl_run_task(union ctl_io *io) { - struct ctl_softc *ctl_softc = control_softc; + struct ctl_softc *softc = control_softc; int retval = 1; const char *task_desc; @@ -12281,12 +12232,12 @@ ctl_run_task(union ctl_io *io) uint32_t targ_lun; targ_lun = io->io_hdr.nexus.targ_mapped_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&softc->ctl_lock); if ((targ_lun < CTL_MAX_LUNS) - && (ctl_softc->ctl_luns[targ_lun] != NULL)) - lun = ctl_softc->ctl_luns[targ_lun]; + && (softc->ctl_luns[targ_lun] != NULL)) + lun = softc->ctl_luns[targ_lun]; else { - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); retval = 1; break; } @@ -12313,14 +12264,14 @@ ctl_run_task(union ctl_io *io) retval = ctl_lun_reset(lun, io, CTL_UA_LUN_RESET); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&softc->ctl_lock); break; } case CTL_TASK_TARGET_RESET: - retval = ctl_target_reset(ctl_softc, io, CTL_UA_TARG_RESET); + retval = ctl_target_reset(softc, io, CTL_UA_TARG_RESET); break; case CTL_TASK_BUS_RESET: - retval = ctl_bus_reset(ctl_softc, io); + retval = ctl_bus_reset(softc, io); break; case CTL_TASK_PORT_LOGIN: break; @@ -12347,13 +12298,13 @@ ctl_handle_isc(union ctl_io *io) { int free_io; struct ctl_lun *lun; - struct ctl_softc *ctl_softc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 13:10:24 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD8AB949; Sat, 3 Jan 2015 13:10:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8C546644D; Sat, 3 Jan 2015 13:10:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03DAOc5038888; Sat, 3 Jan 2015 13:10:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03DAOxN038887; Sat, 3 Jan 2015 13:10:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501031310.t03DAOxN038887@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Jan 2015 13:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276615 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 13:10:24 -0000 Author: mav Date: Sat Jan 3 13:10:23 2015 New Revision: 276615 URL: https://svnweb.freebsd.org/changeset/base/276615 Log: MFC r275943: Constify some static data. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 3 13:09:32 2015 (r276614) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 3 13:10:23 2015 (r276615) @@ -111,7 +111,7 @@ struct ctl_softc *control_softc = NULL; * Note that these are default values only. The actual values will be * filled in when the user does a mode sense. */ -static struct copan_debugconf_subpage debugconf_page_default = { +const static struct copan_debugconf_subpage debugconf_page_default = { DBGCNF_PAGE_CODE | SMPH_SPF, /* page_code */ DBGCNF_SUBPAGE_CODE, /* subpage */ {(sizeof(struct copan_debugconf_subpage) - 4) >> 8, @@ -121,7 +121,7 @@ static struct copan_debugconf_subpage de CTL_TIME_IO_DEFAULT_SECS>>0}, /* ctl_time_io_secs */ }; -static struct copan_debugconf_subpage debugconf_page_changeable = { +const static struct copan_debugconf_subpage debugconf_page_changeable = { DBGCNF_PAGE_CODE | SMPH_SPF, /* page_code */ DBGCNF_SUBPAGE_CODE, /* subpage */ {(sizeof(struct copan_debugconf_subpage) - 4) >> 8, @@ -130,7 +130,7 @@ static struct copan_debugconf_subpage de {0xff,0xff}, /* ctl_time_io_secs */ }; -static struct scsi_da_rw_recovery_page rw_er_page_default = { +const static struct scsi_da_rw_recovery_page rw_er_page_default = { /*page_code*/SMS_RW_ERROR_RECOVERY_PAGE, /*page_length*/sizeof(struct scsi_da_rw_recovery_page) - 2, /*byte3*/SMS_RWER_AWRE|SMS_RWER_ARRE, @@ -144,7 +144,7 @@ static struct scsi_da_rw_recovery_page r /*recovery_time_limit*/{0, 0}, }; -static struct scsi_da_rw_recovery_page rw_er_page_changeable = { +const static struct scsi_da_rw_recovery_page rw_er_page_changeable = { /*page_code*/SMS_RW_ERROR_RECOVERY_PAGE, /*page_length*/sizeof(struct scsi_da_rw_recovery_page) - 2, /*byte3*/0, @@ -158,7 +158,7 @@ static struct scsi_da_rw_recovery_page r /*recovery_time_limit*/{0, 0}, }; -static struct scsi_format_page format_page_default = { +const static struct scsi_format_page format_page_default = { /*page_code*/SMS_FORMAT_DEVICE_PAGE, /*page_length*/sizeof(struct scsi_format_page) - 2, /*tracks_per_zone*/ {0, 0}, @@ -175,7 +175,7 @@ static struct scsi_format_page format_pa /*reserved*/ {0, 0, 0} }; -static struct scsi_format_page format_page_changeable = { +const static struct scsi_format_page format_page_changeable = { /*page_code*/SMS_FORMAT_DEVICE_PAGE, /*page_length*/sizeof(struct scsi_format_page) - 2, /*tracks_per_zone*/ {0, 0}, @@ -191,7 +191,7 @@ static struct scsi_format_page format_pa /*reserved*/ {0, 0, 0} }; -static struct scsi_rigid_disk_page rigid_disk_page_default = { +const static struct scsi_rigid_disk_page rigid_disk_page_default = { /*page_code*/SMS_RIGID_DISK_PAGE, /*page_length*/sizeof(struct scsi_rigid_disk_page) - 2, /*cylinders*/ {0, 0, 0}, @@ -208,7 +208,7 @@ static struct scsi_rigid_disk_page rigid /*reserved2*/ {0, 0} }; -static struct scsi_rigid_disk_page rigid_disk_page_changeable = { +const static struct scsi_rigid_disk_page rigid_disk_page_changeable = { /*page_code*/SMS_RIGID_DISK_PAGE, /*page_length*/sizeof(struct scsi_rigid_disk_page) - 2, /*cylinders*/ {0, 0, 0}, @@ -224,7 +224,7 @@ static struct scsi_rigid_disk_page rigid /*reserved2*/ {0, 0} }; -static struct scsi_caching_page caching_page_default = { +const static struct scsi_caching_page caching_page_default = { /*page_code*/SMS_CACHING_PAGE, /*page_length*/sizeof(struct scsi_caching_page) - 2, /*flags1*/ SCP_DISC | SCP_WCE, @@ -240,7 +240,7 @@ static struct scsi_caching_page caching_ /*non_cache_seg_size*/ {0, 0, 0} }; -static struct scsi_caching_page caching_page_changeable = { +const static struct scsi_caching_page caching_page_changeable = { /*page_code*/SMS_CACHING_PAGE, /*page_length*/sizeof(struct scsi_caching_page) - 2, /*flags1*/ SCP_WCE | SCP_RCD, @@ -256,7 +256,7 @@ static struct scsi_caching_page caching_ /*non_cache_seg_size*/ {0, 0, 0} }; -static struct scsi_control_page control_page_default = { +const static struct scsi_control_page control_page_default = { /*page_code*/SMS_CONTROL_MODE_PAGE, /*page_length*/sizeof(struct scsi_control_page) - 2, /*rlec*/0, @@ -268,7 +268,7 @@ static struct scsi_control_page control_ /*extended_selftest_completion_time*/{0, 0} }; -static struct scsi_control_page control_page_changeable = { +const static struct scsi_control_page control_page_changeable = { /*page_code*/SMS_CONTROL_MODE_PAGE, /*page_length*/sizeof(struct scsi_control_page) - 2, /*rlec*/SCP_DSENSE, @@ -280,7 +280,7 @@ static struct scsi_control_page control_ /*extended_selftest_completion_time*/{0, 0} }; -static struct scsi_info_exceptions_page ie_page_default = { +const static struct scsi_info_exceptions_page ie_page_default = { /*page_code*/SMS_INFO_EXCEPTIONS_PAGE, /*page_length*/sizeof(struct scsi_info_exceptions_page) - 2, /*info_flags*/SIEP_FLAGS_DEXCPT, @@ -289,7 +289,7 @@ static struct scsi_info_exceptions_page /*report_count*/{0, 0, 0, 0} }; -static struct scsi_info_exceptions_page ie_page_changeable = { +const static struct scsi_info_exceptions_page ie_page_changeable = { /*page_code*/SMS_INFO_EXCEPTIONS_PAGE, /*page_length*/sizeof(struct scsi_info_exceptions_page) - 2, /*info_flags*/0, @@ -300,7 +300,7 @@ static struct scsi_info_exceptions_page #define CTL_LBPM_LEN (sizeof(struct ctl_logical_block_provisioning_page) - 4) -static struct ctl_logical_block_provisioning_page lbp_page_default = {{ +const static struct ctl_logical_block_provisioning_page lbp_page_default = {{ /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, /*subpage_code*/0x02, /*page_length*/{CTL_LBPM_LEN >> 8, CTL_LBPM_LEN}, @@ -326,7 +326,7 @@ static struct ctl_logical_block_provisio } }; -static struct ctl_logical_block_provisioning_page lbp_page_changeable = {{ +const static struct ctl_logical_block_provisioning_page lbp_page_changeable = {{ /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, /*subpage_code*/0x02, /*page_length*/{CTL_LBPM_LEN >> 8, CTL_LBPM_LEN}, From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 13:11:41 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D17CBAB4; Sat, 3 Jan 2015 13:11:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC38A66482; Sat, 3 Jan 2015 13:11:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03DBfVi042050; Sat, 3 Jan 2015 13:11:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03DBexD042041; Sat, 3 Jan 2015 13:11:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501031311.t03DBexD042041@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Jan 2015 13:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276616 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 13:11:42 -0000 Author: mav Date: Sat Jan 3 13:11:39 2015 New Revision: 276616 URL: https://svnweb.freebsd.org/changeset/base/276616 Log: MFC r275953: Replace ctl_min() macro with MIN(). Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_internal.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 3 13:10:23 2015 (r276615) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 3 13:11:39 2015 (r276616) @@ -1745,8 +1745,8 @@ ctl_ioctl_do_datamove(struct ctl_scsiio i < ext_sg_entries && j < kern_sg_entries;) { uint8_t *ext_ptr, *kern_ptr; - len_to_copy = ctl_min(ext_sglist[i].len - ext_watermark, - kern_sglist[j].len - kern_watermark); + len_to_copy = MIN(ext_sglist[i].len - ext_watermark, + kern_sglist[j].len - kern_watermark); ext_ptr = (uint8_t *)ext_sglist[i].addr; ext_ptr = ext_ptr + ext_watermark; @@ -2836,8 +2836,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, bbr_info->scsi_status = metatask->taskinfo.bbrread.scsi_status; memcpy(&bbr_info->sense_data, &metatask->taskinfo.bbrread.sense_data, - ctl_min(sizeof(bbr_info->sense_data), - sizeof(metatask->taskinfo.bbrread.sense_data))); + MIN(sizeof(bbr_info->sense_data), + sizeof(metatask->taskinfo.bbrread.sense_data))); cfi_free_metatask(metatask); @@ -3644,7 +3644,7 @@ ctl_ffz(uint32_t *mask, uint32_t size) num_chunks = (size >> 5); if (num_chunks == 0) num_chunks++; - num_pieces = ctl_min((sizeof(uint32_t) * 8), size); + num_pieces = MIN((sizeof(uint32_t) * 8), size); for (i = 0; i < num_chunks; i++) { for (j = 0; j < num_pieces; j++) { @@ -3891,7 +3891,7 @@ ctl_copy_io(union ctl_io *src, union ctl */ pool_ref = dest->io_hdr.pool; - memcpy(dest, src, ctl_min(sizeof(*src), sizeof(*dest))); + memcpy(dest, src, MIN(sizeof(*src), sizeof(*dest))); dest->io_hdr.pool = pool_ref; /* @@ -6754,7 +6754,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header = (struct scsi_mode_hdr_6 *)ctsio->kern_data_ptr; - header->datalen = ctl_min(total_len - 1, 254); + header->datalen = MIN(total_len - 1, 254); if (control_dev == 0) { header->dev_specific = 0x10; /* DPOFUA */ if ((lun->flags & CTL_LUN_READONLY) || @@ -6776,7 +6776,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header = (struct scsi_mode_hdr_10 *)ctsio->kern_data_ptr; - datalen = ctl_min(total_len - 2, 65533); + datalen = MIN(total_len - 2, 65533); scsi_ulto2b(datalen, header->datalen); if (control_dev == 0) { header->dev_specific = 0x10; /* DPOFUA */ @@ -9517,7 +9517,7 @@ ctl_request_sense(struct ctl_scsiio *cts (struct scsi_sense_data_fixed *)sense_ptr); else memcpy(sense_ptr, &lun->pending_sense[initidx], - ctl_min(sizeof(*sense_ptr), + MIN(sizeof(*sense_ptr), sizeof(lun->pending_sense[initidx]))); ctl_clear_mask(lun->have_ca, initidx); @@ -12476,8 +12476,8 @@ ctl_inject_error(struct ctl_lun *lun, un * checks. */ bcopy(&desc->custom_sense, &io->scsiio.sense_data, - ctl_min(sizeof(desc->custom_sense), - sizeof(io->scsiio.sense_data))); + MIN(sizeof(desc->custom_sense), + sizeof(io->scsiio.sense_data))); io->scsiio.scsi_status = SCSI_STATUS_CHECK_COND; io->scsiio.sense_len = SSD_FULL_SIZE; io->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE; @@ -12706,7 +12706,7 @@ ctl_datamove(union ctl_io *io) */ for (sg_entries_sent = 0; sg_entries_sent < msg.dt.kern_sg_entries; msg.dt.sg_sequence++) { - msg.dt.cur_sg_entries = ctl_min((sizeof(msg.dt.sg_list)/ + msg.dt.cur_sg_entries = MIN((sizeof(msg.dt.sg_list)/ sizeof(msg.dt.sg_list[0])), msg.dt.kern_sg_entries - sg_entries_sent); @@ -13069,7 +13069,7 @@ ctl_datamove_remote_sgl_setup(union ctl_ for (i = 0; (i < sizeof(io->io_hdr.remote_sglist) / sizeof(io->io_hdr.remote_sglist[0])) && (len_to_go > 0); i++) { - local_sglist[i].len = ctl_min(len_to_go, 131072); + local_sglist[i].len = MIN(len_to_go, 131072); CTL_SIZE_8B(local_dma_sglist[i].len, local_sglist[i].len); local_sglist[i].addr = @@ -13205,8 +13205,8 @@ ctl_datamove_remote_xfer(union ctl_io *i * also have enough slack left over at the end, though, * to round up to the next 8 byte boundary. */ - cur_len = ctl_min(local_sglist[i].len - local_used, - remote_sglist[j].len - remote_used); + cur_len = MIN(local_sglist[i].len - local_used, + remote_sglist[j].len - remote_used); /* * In this case, we have a size issue and need to decrease @@ -13705,7 +13705,7 @@ ctl_queue_sense(union ctl_io *io) } memcpy(&lun->pending_sense[initidx], &io->scsiio.sense_data, - ctl_min(sizeof(lun->pending_sense[initidx]), + MIN(sizeof(lun->pending_sense[initidx]), sizeof(io->scsiio.sense_data))); ctl_set_mask(lun->have_ca, initidx); mtx_unlock(&lun->lun_lock); Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Sat Jan 3 13:10:23 2015 (r276615) +++ stable/10/sys/cam/ctl/ctl.h Sat Jan 3 13:11:39 2015 (r276616) @@ -40,7 +40,6 @@ #ifndef _CTL_H_ #define _CTL_H_ -#define ctl_min(x,y) (((x) < (y)) ? (x) : (y)) #define CTL_RETVAL_COMPLETE 0 #define CTL_RETVAL_QUEUED 1 #define CTL_RETVAL_ALLOCATED 2 Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Sat Jan 3 13:10:23 2015 (r276615) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Sat Jan 3 13:11:39 2015 (r276616) @@ -2305,32 +2305,32 @@ ctl_be_block_create(struct ctl_be_block_ snprintf(tmpstr, sizeof(tmpstr), "MYSERIAL%4d", softc->num_luns); strncpy((char *)be_lun->ctl_be_lun.serial_num, tmpstr, - ctl_min(sizeof(be_lun->ctl_be_lun.serial_num), + MIN(sizeof(be_lun->ctl_be_lun.serial_num), sizeof(tmpstr))); /* Tell the user what we used for a serial number */ strncpy((char *)params->serial_num, tmpstr, - ctl_min(sizeof(params->serial_num), sizeof(tmpstr))); + MIN(sizeof(params->serial_num), sizeof(tmpstr))); } else { strncpy((char *)be_lun->ctl_be_lun.serial_num, params->serial_num, - ctl_min(sizeof(be_lun->ctl_be_lun.serial_num), + MIN(sizeof(be_lun->ctl_be_lun.serial_num), sizeof(params->serial_num))); } if ((params->flags & CTL_LUN_FLAG_DEVID) == 0) { snprintf(tmpstr, sizeof(tmpstr), "MYDEVID%4d", softc->num_luns); strncpy((char *)be_lun->ctl_be_lun.device_id, tmpstr, - ctl_min(sizeof(be_lun->ctl_be_lun.device_id), + MIN(sizeof(be_lun->ctl_be_lun.device_id), sizeof(tmpstr))); /* Tell the user what we used for a device ID */ strncpy((char *)params->device_id, tmpstr, - ctl_min(sizeof(params->device_id), sizeof(tmpstr))); + MIN(sizeof(params->device_id), sizeof(tmpstr))); } else { strncpy((char *)be_lun->ctl_be_lun.device_id, params->device_id, - ctl_min(sizeof(be_lun->ctl_be_lun.device_id), - sizeof(params->device_id))); + MIN(sizeof(be_lun->ctl_be_lun.device_id), + sizeof(params->device_id))); } TASK_INIT(&be_lun->io_task, /*priority*/0, ctl_be_block_worker, be_lun); Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Sat Jan 3 13:10:23 2015 (r276615) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Sat Jan 3 13:11:39 2015 (r276616) @@ -313,8 +313,7 @@ ctl_backend_ramdisk_continue(union ctl_i sg_entries = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; for (i = 0, len_filled = 0; i < sg_filled; i++) { sg_entries[i].addr = softc->ramdisk_pages[i]; - sg_entries[i].len = ctl_min(PAGE_SIZE, - len - len_filled); + sg_entries[i].len = MIN(PAGE_SIZE, len - len_filled); len_filled += sg_entries[i].len; } io->io_hdr.flags |= CTL_FLAG_KDPTR_SGLIST; @@ -614,32 +613,32 @@ ctl_backend_ramdisk_create(struct ctl_be snprintf(tmpstr, sizeof(tmpstr), "MYSERIAL%4d", softc->num_luns); strncpy((char *)be_lun->ctl_be_lun.serial_num, tmpstr, - ctl_min(sizeof(be_lun->ctl_be_lun.serial_num), - sizeof(tmpstr))); + MIN(sizeof(be_lun->ctl_be_lun.serial_num), + sizeof(tmpstr))); /* Tell the user what we used for a serial number */ strncpy((char *)params->serial_num, tmpstr, - ctl_min(sizeof(params->serial_num), sizeof(tmpstr))); + MIN(sizeof(params->serial_num), sizeof(tmpstr))); } else { strncpy((char *)be_lun->ctl_be_lun.serial_num, params->serial_num, - ctl_min(sizeof(be_lun->ctl_be_lun.serial_num), - sizeof(params->serial_num))); + MIN(sizeof(be_lun->ctl_be_lun.serial_num), + sizeof(params->serial_num))); } if ((params->flags & CTL_LUN_FLAG_DEVID) == 0) { snprintf(tmpstr, sizeof(tmpstr), "MYDEVID%4d", softc->num_luns); strncpy((char *)be_lun->ctl_be_lun.device_id, tmpstr, - ctl_min(sizeof(be_lun->ctl_be_lun.device_id), - sizeof(tmpstr))); + MIN(sizeof(be_lun->ctl_be_lun.device_id), + sizeof(tmpstr))); /* Tell the user what we used for a device ID */ strncpy((char *)params->device_id, tmpstr, - ctl_min(sizeof(params->device_id), sizeof(tmpstr))); + MIN(sizeof(params->device_id), sizeof(tmpstr))); } else { strncpy((char *)be_lun->ctl_be_lun.device_id, params->device_id, - ctl_min(sizeof(be_lun->ctl_be_lun.device_id), - sizeof(params->device_id))); + MIN(sizeof(be_lun->ctl_be_lun.device_id), + sizeof(params->device_id))); } STAILQ_INIT(&be_lun->cont_queue); Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Sat Jan 3 13:10:23 2015 (r276615) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Sat Jan 3 13:11:39 2015 (r276616) @@ -401,8 +401,8 @@ cfcs_datamove(union ctl_io *io) i < cam_sg_count && j < ctl_sg_count;) { uint8_t *cam_ptr, *ctl_ptr; - len_to_copy = ctl_min(cam_sglist[i].ds_len - cam_watermark, - ctl_sglist[j].len - ctl_watermark); + len_to_copy = MIN(cam_sglist[i].ds_len - cam_watermark, + ctl_sglist[j].len - ctl_watermark); cam_ptr = (uint8_t *)cam_sglist[i].ds_addr; cam_ptr = cam_ptr + cam_watermark; Modified: stable/10/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_internal.c Sat Jan 3 13:10:23 2015 (r276615) +++ stable/10/sys/cam/ctl/ctl_frontend_internal.c Sat Jan 3 13:11:39 2015 (r276616) @@ -499,8 +499,8 @@ cfi_datamove(union ctl_io *io) i < ext_sg_entries && j < kern_sg_entries;) { uint8_t *ext_ptr, *kern_ptr; - len_to_copy = ctl_min(ext_sglist[i].len - ext_watermark, - kern_sglist[j].len - kern_watermark); + len_to_copy = MIN(ext_sglist[i].len - ext_watermark, + kern_sglist[j].len - kern_watermark); ext_ptr = (uint8_t *)ext_sglist[i].addr; ext_ptr = ext_ptr + ext_watermark; @@ -1103,8 +1103,8 @@ cfi_metatask_bbr_errorparse(struct cfi_m metatask->taskinfo.bbrread.scsi_status = io->scsiio.scsi_status; memcpy(&metatask->taskinfo.bbrread.sense_data, &io->scsiio.sense_data, - ctl_min(sizeof(metatask->taskinfo.bbrread.sense_data), - sizeof(io->scsiio.sense_data))); + MIN(sizeof(metatask->taskinfo.bbrread.sense_data), + sizeof(io->scsiio.sense_data))); if (io->scsiio.scsi_status == SCSI_STATUS_RESERV_CONFLICT) { metatask->status = CFI_MT_ERROR; From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 13:12:49 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6893C15; Sat, 3 Jan 2015 13:12:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C27D16649C; Sat, 3 Jan 2015 13:12:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03DCmnY042241; Sat, 3 Jan 2015 13:12:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03DCmFe042240; Sat, 3 Jan 2015 13:12:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501031312.t03DCmFe042240@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Jan 2015 13:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276617 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 13:12:49 -0000 Author: mav Date: Sat Jan 3 13:12:47 2015 New Revision: 276617 URL: https://svnweb.freebsd.org/changeset/base/276617 Log: MFC r276141: Hide block device VPD pages for non-block devices. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 3 13:11:39 2015 (r276616) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 3 13:12:47 2015 (r276617) @@ -9601,6 +9601,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc struct scsi_vpd_supported_pages *pages; int sup_page_size; struct ctl_lun *lun; + int p; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -9634,27 +9635,30 @@ ctl_inquiry_evpd_supported(struct ctl_sc else pages->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; - pages->length = SCSI_EVPD_NUM_SUPPORTED_PAGES; + p = 0; /* Supported VPD pages */ - pages->page_list[0] = SVPD_SUPPORTED_PAGES; + pages->page_list[p++] = SVPD_SUPPORTED_PAGES; /* Serial Number */ - pages->page_list[1] = SVPD_UNIT_SERIAL_NUMBER; + pages->page_list[p++] = SVPD_UNIT_SERIAL_NUMBER; /* Device Identification */ - pages->page_list[2] = SVPD_DEVICE_ID; + pages->page_list[p++] = SVPD_DEVICE_ID; /* Extended INQUIRY Data */ - pages->page_list[3] = SVPD_EXTENDED_INQUIRY_DATA; + pages->page_list[p++] = SVPD_EXTENDED_INQUIRY_DATA; /* Mode Page Policy */ - pages->page_list[4] = SVPD_MODE_PAGE_POLICY; + pages->page_list[p++] = SVPD_MODE_PAGE_POLICY; /* SCSI Ports */ - pages->page_list[5] = SVPD_SCSI_PORTS; + pages->page_list[p++] = SVPD_SCSI_PORTS; /* Third-party Copy */ - pages->page_list[6] = SVPD_SCSI_TPC; - /* Block limits */ - pages->page_list[7] = SVPD_BLOCK_LIMITS; - /* Block Device Characteristics */ - pages->page_list[8] = SVPD_BDC; - /* Logical Block Provisioning */ - pages->page_list[9] = SVPD_LBP; + pages->page_list[p++] = SVPD_SCSI_TPC; + if (lun != NULL && lun->be_lun->lun_type == T_DIRECT) { + /* Block limits */ + pages->page_list[p++] = SVPD_BLOCK_LIMITS; + /* Block Device Characteristics */ + pages->page_list[p++] = SVPD_BDC; + /* Logical Block Provisioning */ + pages->page_list[p++] = SVPD_LBP; + } + pages->length = p; ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -10236,13 +10240,12 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio) { + struct ctl_lun *lun; struct scsi_inquiry *cdb; int alloc_len, retval; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_inquiry *)ctsio->cdb; - - retval = CTL_RETVAL_COMPLETE; - alloc_len = scsi_2btoul(cdb->length); switch (cdb->page_code) { @@ -10268,15 +10271,22 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsi retval = ctl_inquiry_evpd_tpc(ctsio, alloc_len); break; case SVPD_BLOCK_LIMITS: + if (lun == NULL || lun->be_lun->lun_type != T_DIRECT) + goto err; retval = ctl_inquiry_evpd_block_limits(ctsio, alloc_len); break; case SVPD_BDC: + if (lun == NULL || lun->be_lun->lun_type != T_DIRECT) + goto err; retval = ctl_inquiry_evpd_bdc(ctsio, alloc_len); break; case SVPD_LBP: + if (lun == NULL || lun->be_lun->lun_type != T_DIRECT) + goto err; retval = ctl_inquiry_evpd_lbp(ctsio, alloc_len); break; default: +err: ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 13:36:59 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D705D431; Sat, 3 Jan 2015 13:36:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B95811780; Sat, 3 Jan 2015 13:36:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03DawIX051923; Sat, 3 Jan 2015 13:36:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03DavvF051919; Sat, 3 Jan 2015 13:36:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501031336.t03DavvF051919@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Jan 2015 13:36:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276618 - in stable/10/sys: cam/ctl dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 13:36:59 -0000 Author: mav Date: Sat Jan 3 13:36:56 2015 New Revision: 276618 URL: https://svnweb.freebsd.org/changeset/base/276618 Log: MFC r274036 (by trasz): s/icl_pdu_new_bhs/icl_pdu_new/; no functional changes, just a little nicer code. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/dev/iscsi/icl.c stable/10/sys/dev/iscsi/icl.h stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jan 3 13:12:47 2015 (r276617) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jan 3 13:36:56 2015 (r276618) @@ -191,7 +191,7 @@ static struct icl_pdu * cfiscsi_pdu_new_response(struct icl_pdu *request, int flags) { - return (icl_pdu_new_bhs(request->ip_conn, flags)); + return (icl_pdu_new(request->ip_conn, flags)); } static bool @@ -1057,7 +1057,7 @@ cfiscsi_callout(void *context) if (cs->cs_timeout < 2) return; - cp = icl_pdu_new_bhs(cs->cs_conn, M_NOWAIT); + cp = icl_pdu_new(cs->cs_conn, M_NOWAIT); if (cp == NULL) { CFISCSI_SESSION_WARN(cs, "failed to allocate memory"); return; @@ -1672,7 +1672,7 @@ cfiscsi_ioctl_terminate(struct ctl_iscsi strcmp(cs->cs_initiator_addr, citp->initiator_addr) != 0) continue; - response = icl_pdu_new_bhs(cs->cs_conn, M_NOWAIT); + response = icl_pdu_new(cs->cs_conn, M_NOWAIT); if (response == NULL) { /* * Oh well. Just terminate the connection. @@ -1722,7 +1722,7 @@ cfiscsi_ioctl_logout(struct ctl_iscsi *c strcmp(cs->cs_initiator_addr, cilp->initiator_addr) != 0) continue; - response = icl_pdu_new_bhs(cs->cs_conn, M_NOWAIT); + response = icl_pdu_new(cs->cs_conn, M_NOWAIT); if (response == NULL) { ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), @@ -1892,7 +1892,7 @@ cfiscsi_ioctl_send(struct ctl_iscsi *ci) } } - ip = icl_pdu_new_bhs(cs->cs_conn, M_WAITOK); + ip = icl_pdu_new(cs->cs_conn, M_WAITOK); memcpy(ip->ip_bhs, cisp->bhs, sizeof(*ip->ip_bhs)); if (datalen > 0) { icl_pdu_append_data(ip, data, datalen, M_WAITOK); Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Sat Jan 3 13:12:47 2015 (r276617) +++ stable/10/sys/dev/iscsi/icl.c Sat Jan 3 13:36:56 2015 (r276618) @@ -193,7 +193,7 @@ icl_pdu_free(struct icl_pdu *ip) * Allocate icl_pdu with empty BHS to fill up by the caller. */ struct icl_pdu * -icl_pdu_new_bhs(struct icl_conn *ic, int flags) +icl_pdu_new(struct icl_conn *ic, int flags) { struct icl_pdu *ip; Modified: stable/10/sys/dev/iscsi/icl.h ============================================================================== --- stable/10/sys/dev/iscsi/icl.h Sat Jan 3 13:12:47 2015 (r276617) +++ stable/10/sys/dev/iscsi/icl.h Sat Jan 3 13:36:56 2015 (r276618) @@ -57,7 +57,7 @@ struct icl_pdu { uint32_t ip_prv2; }; -struct icl_pdu *icl_pdu_new_bhs(struct icl_conn *ic, int flags); +struct icl_pdu *icl_pdu_new(struct icl_conn *ic, int flags); size_t icl_pdu_data_segment_length(const struct icl_pdu *ip); int icl_pdu_append_data(struct icl_pdu *ip, const void *addr, size_t len, int flags); void icl_pdu_get_data(struct icl_pdu *ip, size_t off, void *addr, size_t len); Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Sat Jan 3 13:12:47 2015 (r276617) +++ stable/10/sys/dev/iscsi/iscsi.c Sat Jan 3 13:36:56 2015 (r276618) @@ -274,7 +274,7 @@ iscsi_session_logout(struct iscsi_sessio struct icl_pdu *request; struct iscsi_bhs_logout_request *bhslr; - request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + request = icl_pdu_new(is->is_conn, M_NOWAIT); if (request == NULL) return; @@ -593,7 +593,7 @@ iscsi_callout(void *context) if (is->is_timeout < 2) return; - request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + request = icl_pdu_new(is->is_conn, M_NOWAIT); if (request == NULL) { ISCSI_SESSION_WARN(is, "failed to allocate PDU"); return; @@ -811,7 +811,7 @@ iscsi_pdu_handle_nop_in(struct icl_pdu * icl_pdu_get_data(response, 0, data, datasize); } - request = icl_pdu_new_bhs(response->ip_conn, M_NOWAIT); + request = icl_pdu_new(response->ip_conn, M_NOWAIT); if (request == NULL) { ISCSI_SESSION_WARN(is, "failed to allocate memory; " "reconnecting"); @@ -1179,7 +1179,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *res return; } - request = icl_pdu_new_bhs(response->ip_conn, M_NOWAIT); + request = icl_pdu_new(response->ip_conn, M_NOWAIT); if (request == NULL) { icl_pdu_free(response); iscsi_session_reconnect(is); @@ -1583,7 +1583,7 @@ iscsi_ioctl_daemon_send(struct iscsi_sof } } - ip = icl_pdu_new_bhs(is->is_conn, M_WAITOK); + ip = icl_pdu_new(is->is_conn, M_WAITOK); memcpy(ip->ip_bhs, ids->ids_bhs, sizeof(*ip->ip_bhs)); if (datalen > 0) { error = icl_pdu_append_data(ip, data, datalen, M_WAITOK); @@ -2067,7 +2067,7 @@ iscsi_action_abort(struct iscsi_session return; } - request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + request = icl_pdu_new(is->is_conn, M_NOWAIT); if (request == NULL) { ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(ccb); @@ -2121,7 +2121,7 @@ iscsi_action_scsiio(struct iscsi_session } #endif - request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + request = icl_pdu_new(is->is_conn, M_NOWAIT); if (request == NULL) { if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { xpt_freeze_devq(ccb->ccb_h.path, 1); From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 15:37:35 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B72FDC3; Sat, 3 Jan 2015 15:37:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 472B02952; Sat, 3 Jan 2015 15:37:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03FbZo0008911; Sat, 3 Jan 2015 15:37:35 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03FbZ8t008910; Sat, 3 Jan 2015 15:37:35 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201501031537.t03FbZ8t008910@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 3 Jan 2015 15:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276622 - stable/10/usr.sbin/pstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 15:37:35 -0000 Author: jilles Date: Sat Jan 3 15:37:34 2015 New Revision: 276622 URL: https://svnweb.freebsd.org/changeset/base/276622 Log: MFC r272963: pstat(8): Correct description of the SESS column in pstat -t. Modified: stable/10/usr.sbin/pstat/pstat.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pstat/pstat.8 ============================================================================== --- stable/10/usr.sbin/pstat/pstat.8 Sat Jan 3 14:18:48 2015 (r276621) +++ stable/10/usr.sbin/pstat/pstat.8 Sat Jan 3 15:37:34 2015 (r276622) @@ -35,7 +35,7 @@ .\" @(#)pstat.8 8.5 (Berkeley) 5/13/94 .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd October 11, 2014 .Dt PSTAT 8 .Os .Sh NAME @@ -170,7 +170,7 @@ Low water mark for output. .It COL Calculated column position of terminal. .It SESS -Kernel address of the session structure. +Process ID of the session leader. .It PGID Process group for which this is the controlling terminal. .It STATE From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 15:39:05 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98666FD6; Sat, 3 Jan 2015 15:39:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84A232983; Sat, 3 Jan 2015 15:39:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03Fd5pc009145; Sat, 3 Jan 2015 15:39:05 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03Fd5vi009144; Sat, 3 Jan 2015 15:39:05 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201501031539.t03Fd5vi009144@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 3 Jan 2015 15:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276623 - stable/9/usr.sbin/pstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 15:39:05 -0000 Author: jilles Date: Sat Jan 3 15:39:04 2015 New Revision: 276623 URL: https://svnweb.freebsd.org/changeset/base/276623 Log: MFC r272963: pstat(8): Correct description of the SESS column in pstat -t. Modified: stable/9/usr.sbin/pstat/pstat.8 Directory Properties: stable/9/usr.sbin/pstat/ (props changed) Modified: stable/9/usr.sbin/pstat/pstat.8 ============================================================================== --- stable/9/usr.sbin/pstat/pstat.8 Sat Jan 3 15:37:34 2015 (r276622) +++ stable/9/usr.sbin/pstat/pstat.8 Sat Jan 3 15:39:04 2015 (r276623) @@ -35,7 +35,7 @@ .\" @(#)pstat.8 8.5 (Berkeley) 5/13/94 .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd October 11, 2014 .Dt PSTAT 8 .Os .Sh NAME @@ -170,7 +170,7 @@ Low water mark for output. .It COL Calculated column position of terminal. .It SESS -Kernel address of the session structure. +Process ID of the session leader. .It PGID Process group for which this is the controlling terminal. .It STATE From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 18:27:05 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06347D7C; Sat, 3 Jan 2015 18:27:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6B0C34CB; Sat, 3 Jan 2015 18:27:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03IR4wl092406; Sat, 3 Jan 2015 18:27:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03IR4fT092405; Sat, 3 Jan 2015 18:27:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501031827.t03IR4fT092405@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Jan 2015 18:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276628 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 18:27:05 -0000 Author: mav Date: Sat Jan 3 18:27:03 2015 New Revision: 276628 URL: https://svnweb.freebsd.org/changeset/base/276628 Log: MFC r274033 (by trasz): s/icl_pdu_new/icl_pdu_new_empty/g; no functional changes. Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Sat Jan 3 18:09:53 2015 (r276627) +++ stable/10/sys/dev/iscsi/icl.c Sat Jan 3 18:27:03 2015 (r276628) @@ -152,7 +152,7 @@ icl_conn_receive(struct icl_conn *ic, si } static struct icl_pdu * -icl_pdu_new(struct icl_conn *ic, int flags) +icl_pdu_new_empty(struct icl_conn *ic, int flags) { struct icl_pdu *ip; @@ -197,7 +197,7 @@ icl_pdu_new(struct icl_conn *ic, int fla { struct icl_pdu *ip; - ip = icl_pdu_new(ic, flags); + ip = icl_pdu_new_empty(ic, flags); if (ip == NULL) return (NULL); @@ -547,7 +547,7 @@ icl_conn_receive_pdu(struct icl_conn *ic if (ic->ic_receive_state == ICL_CONN_STATE_BHS) { KASSERT(ic->ic_receive_pdu == NULL, ("ic->ic_receive_pdu != NULL")); - request = icl_pdu_new(ic, M_NOWAIT); + request = icl_pdu_new_empty(ic, M_NOWAIT); if (request == NULL) { ICL_DEBUG("failed to allocate PDU; " "dropping connection"); From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 18:35:30 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D739F2C5; Sat, 3 Jan 2015 18:35:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C367E35E6; Sat, 3 Jan 2015 18:35:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03IZUmw097083; Sat, 3 Jan 2015 18:35:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03IZU2h097082; Sat, 3 Jan 2015 18:35:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201501031835.t03IZU2h097082@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Jan 2015 18:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276629 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 18:35:31 -0000 Author: mav Date: Sat Jan 3 18:35:29 2015 New Revision: 276629 URL: https://svnweb.freebsd.org/changeset/base/276629 Log: MFC r272765: Remove one second wait for threads exit from icl_conn_close(). Switch it from polling with pause() to using cv_wait()/cv_signal(). Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Sat Jan 3 18:27:03 2015 (r276628) +++ stable/10/sys/dev/iscsi/icl.c Sat Jan 3 18:35:29 2015 (r276629) @@ -776,6 +776,7 @@ icl_receive_thread(void *arg) ICL_CONN_LOCK(ic); ic->ic_receive_running = false; + cv_signal(&ic->ic_send_cv); ICL_CONN_UNLOCK(ic); kthread_exit(); } @@ -1026,6 +1027,7 @@ icl_send_thread(void *arg) STAILQ_CONCAT(&ic->ic_to_send, &queue); ic->ic_send_running = false; + cv_signal(&ic->ic_send_cv); ICL_CONN_UNLOCK(ic); kthread_exit(); } @@ -1330,15 +1332,11 @@ icl_conn_close(struct icl_conn *ic) /* * Wake up the threads, so they can properly terminate. */ - cv_signal(&ic->ic_receive_cv); - cv_signal(&ic->ic_send_cv); while (ic->ic_receive_running || ic->ic_send_running) { //ICL_DEBUG("waiting for send/receive threads to terminate"); - ICL_CONN_UNLOCK(ic); cv_signal(&ic->ic_receive_cv); cv_signal(&ic->ic_send_cv); - pause("icl_close", 1 * hz); - ICL_CONN_LOCK(ic); + cv_wait(&ic->ic_send_cv, ic->ic_lock); } //ICL_DEBUG("send/receive threads terminated"); From owner-svn-src-stable@FreeBSD.ORG Sat Jan 3 20:29:49 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11976D3C; Sat, 3 Jan 2015 20:29:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F159018AC; Sat, 3 Jan 2015 20:29:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t03KTmIr051771; Sat, 3 Jan 2015 20:29:48 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t03KTm3X051770; Sat, 3 Jan 2015 20:29:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501032029.t03KTm3X051770@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 3 Jan 2015 20:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276633 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 20:29:49 -0000 Author: ian Date: Sat Jan 3 20:29:47 2015 New Revision: 276633 URL: https://svnweb.freebsd.org/changeset/base/276633 Log: Bump version after r276312 brought in new ARM arch constants that some ports need to compile correctly. Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Sat Jan 3 19:38:37 2015 (r276632) +++ stable/10/sys/sys/param.h Sat Jan 3 20:29:47 2015 (r276633) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1001504 /* Master, propagated to newvers */ +#define __FreeBSD_version 1001505 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,